minor change

This commit is contained in:
Sowmay Jain 2020-04-07 20:55:48 +10:00
parent 964c3b8d96
commit 31cb948696

View File

@ -1,6 +1,8 @@
# Developing on DSA # Developing on DSA
We empower third-party developers to build dapps, use-cases, and other integrations on DSAs platform. That way, users can get curated experience as per their needs, and developers can build their own businesses supporting those users. This virtuous circle creates new opportunities and benefits users, developers, and protocols. We empower third-party developers to build dapps, use-cases, and other integrations on DSAs platform. That way, users can get curated experience as per their needs, and developers can build their own businesses supporting those users. This virtuous circle creates new opportunities and benefits users, developers, and protocols.
Our team is super active to assist you with all of your queries at our [TG developer group](https://t.me/instadevelopers) or [discord channel](https://discord.gg/83vvrnY).
## Get Started ## Get Started
To get started, install the DSA SDK package from NPM: To get started, install the DSA SDK package from NPM:
@ -17,20 +19,24 @@ You can also import the build from CDN:
For production, we recommend linking to a specific version number ([jsdeliver](https://www.jsdelivr.com/package/npm/dsa-sdk)). For production, we recommend linking to a specific version number ([jsdeliver](https://www.jsdelivr.com/package/npm/dsa-sdk)).
Now instantiate Web3 and DSA. Now instantiate DSA.
```js ```js
const dsa = new DSA() const dsa = new DSA()
```
DSA only works with web3 library so you also have to instantiate Web3.
```js
if (window.ethereum) { if (window.ethereum) {
window.web3 = new Web3(window.ethereum) window.web3 = new Web3(window.ethereum)
} else if (window.web3) { } else if (window.web3) {
window.web3 = new Web3(window.web3.currentProvider) window.web3 = new Web3(window.web3.currentProvider)
} else { } else {
console.log('Non-Ethereum browser detected. You should consider trying MetaMask!') window.web3 = new Web3(customProvider)
} }
``` ```
## Get Accounts ## Get Accounts
Once connected to a web3 client, get all the DSA where a specific address is authorised. Once connected to a web3 client, get all the DSA where a specific address is authorised.
@ -108,7 +114,7 @@ Build a new DSA.
```js ```js
dsa.build() dsa.build()
.then(data => { .then(data => {
return data return data // transaction hash
}) })
.catch(error => { .catch(error => {
return error return error
@ -176,9 +182,9 @@ Note: You can get the specific input interface by calling `dsa.getInterface(conn
Send the transaction to blockchain. CAST YOUR SPELL. Send the transaction to blockchain. CAST YOUR SPELL.
```js ```js
dsa.cast(spells) // or dsa.cast({data:spells}) dsa.cast(spells) // or dsa.cast({spells:spells})
.then(data => { .then(data => {
return data return data // transaction hash
}) })
.catch(error => { .catch(error => {
return error return error