Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed Apr 28, 2023
1 parent 2e365ab commit 71a3833
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions README.md
@@ -1,8 +1,9 @@
<!-- TOC -->
* [Installation](#installation)
* [Usage](#usage)
* [Interface](#interface)
* [Configuration](#configuration)

- [Installation](#installation)
- [Usage](#usage)
- [Interface](#interface)
- [Configuration](#configuration)
<!-- TOC -->

## Installation
Expand All @@ -18,37 +19,31 @@ npm
Browser:

```typescript
import {
Masa
} from "@masa-finance/masa-sdk";
import {
ethers
} from "ethers";
import { Masa } from "@masa-finance/masa-sdk";
import { providers } from "ethers";

// with metamask
const provider = new ethers.providers.Web3Provider(window.ethereum);
const provider = new providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();

export const masa = new Masa({ wallet: signer });
export const masa = new Masa({
wallet: signer,
});
```

Node:

```typescript
import {
Masa
} from "@masa-finance/masa-sdk";
import {
ethers
} from "ethers";
import { Masa } from "@masa-finance/masa-sdk";
import { providers, Wallet } from "ethers";

const provider = new ethers.providers.JsonRpcProvider(
"your blockchain rpc endpoint"
);
const provider = new providers.JsonRpcProvider("your blockchain rpc endpoint");

const wallet = new ethers.Wallet("your private key", provider);
const wallet = new Wallet("your private key", provider);

export const masa = new Masa({ wallet });
export const masa = new Masa({
wallet,
});
```

## Interface
Expand All @@ -58,10 +53,10 @@ For a detailed interface description see [Masa](docs/classes/Masa.md)
## Configuration

| Key | Type | Description | Default Value |
|------------------|----------------------------------|---------------------------------------------------------------------------------------|----------------------------------------|
| ---------------- | -------------------------------- | ------------------------------------------------------------------------------------- | -------------------------------------- |
| cookie | `string` | Cookie value. Don't set this manually unless you know what you do! | |
| wallet | `ethers.Signer or ethers.Wallet` | The Wallet instance to use when interacting with the Blockchain. | "wallet with a random private key" |
| apiUrl | `string` | The API Endpoint of the Masa Infrastructure for `dev`, `test`, `beta` and production. | "https://dev.middleware.masa.finance/" |
| apiUrl | `string` | The API Endpoint of the Masa Infrastructure for `dev`, `test`, `beta` and production. | "https://dev.middleware.masa.finance/" |
| environment | `string` | The environment to use `dev`, `test`, `beta`, `production`. | "dev" |
| network | `string` | The network name ie. "goerli". | "goerli" |
| arweave.host | `string` | The arweave host to use for loading metadata. | "arweave.net" |
Expand Down Expand Up @@ -89,4 +84,4 @@ new Masa({
logging: false,
},
});
```
```

0 comments on commit 71a3833

Please sign in to comment.