Skip to content

Commit

Permalink
Merge pull request #22 from InstaDApp/update-readme
Browse files Browse the repository at this point in the history
Minor changes
  • Loading branch information
mubaris authored Jan 24, 2021
2 parents baeab3f + 4f6b7eb commit ea44cd3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ The official DSA SDK for JavaScript, available for browsers and Node.js backends

To get started, install the DSA Connect package from npm:

`npm install dsa-connect`
```bash
npm install dsa-connect
```

For browsers, via jsDelivr CDN:

```html
<script src="https://cdn.jsdelivr.net/npm/dsa-connect@latest/dist/index.bundle.min.js"></script>
```

### Usage

Expand Down Expand Up @@ -190,26 +198,24 @@ At last, cast your spell using `cast()` method.

```js
// in async functions
let transactionHash = await dsa.cast(spells)
let transactionHash = await spells.cast();

// or
dsa.cast(spells).then(console.log) // returns transaction hash
spells.cast().then(console.log) // returns transaction hash
```

You can also pass an object to send **optional** parameters like sending ETH along with the transaction.

```js
dsa.cast({
spells: spells,
spells.cast({
gasPrice: web3.utils.toWei(gasPrice, 'gwei'), // in gwei, used in node implementation.
value: "1000000000000000000", // sending 1 Eth along the transaction.
nonce: nonce
})
```

| **Parameter (optional)** | **Type** | **Description** |
|--------------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `spells` | *object* | Instance of the `spells()` method speed. |
|--------------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `gasPrice` | *string/number* | The gas price in gwei. Mostly used in Node implementation to configure the transaction confirmation speed. |
| `value` | *string/number* | Amount of ETH which you want to send along with the transaction (in wei). |
| `nonce` | *string/number* | Nonce of your sender account. Mostly used in Node implementation to send transaction with a particular nonce either to override unconfirmed transaction or some other purpose. |
Expand Down

0 comments on commit ea44cd3

Please sign in to comment.