mirror of
https://github.com/Instadapp/dsa-developers.git
synced 2024-07-29 21:56:57 +00:00
added support links
This commit is contained in:
parent
1dc1bda4c6
commit
2d5a58e061
26
README.md
26
README.md
|
@ -15,7 +15,7 @@ You can also import the build from CDN:
|
|||
<script src="https://cdn.jsdelivr.net/npm/dsa-sdk@1.1.12/build/dsa.min.js"></script>
|
||||
```
|
||||
|
||||
For production, we recommend linking to a specific version number and build to avoid unexpected breakage from newer versions.
|
||||
For production, we recommend linking to a specific version number ([jsdeliver](https://www.jsdelivr.com/package/npm/dsa-sdk)).
|
||||
|
||||
Now instantiate Web3 and DSA.
|
||||
|
||||
|
@ -30,7 +30,7 @@ if (window.ethereum) {
|
|||
}
|
||||
```
|
||||
|
||||
Once connected to a web3 client, check if a user (i.e. EOA address) owns any DSA:
|
||||
Once connected to a web3 client, get all the DSA where a specific address is authorised:
|
||||
|
||||
```js
|
||||
const accounts = await web3.eth.getAccounts()
|
||||
|
@ -50,20 +50,20 @@ dsa.getAccounts(accounts[0])
|
|||
An `Array` of `Object` of all the DSA authorised by `address`.
|
||||
|
||||
```js
|
||||
[
|
||||
{
|
||||
id: 52, // DSA Number
|
||||
account: "0x...", // DSA Address
|
||||
version: 1 // DSA version
|
||||
},
|
||||
...
|
||||
]
|
||||
[
|
||||
{
|
||||
id: 52, // DSA Number
|
||||
account: "0x...", // DSA Address
|
||||
version: 1 // DSA version
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
web3 equivalent of the above:
|
||||
Web3 equivalent of the above:
|
||||
```js
|
||||
const ABI = [{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"origin","type":"address"}],"name":"LogAccountCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_newAccount","type":"address"},{"indexed":true,"internalType":"address","name":"_connectors","type":"address"},{"indexed":true,"internalType":"address","name":"_check","type":"address"}],"name":"LogNewAccount","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"accountVersion","type":"uint256"},{"indexed":true,"internalType":"address","name":"check","type":"address"}],"name":"LogNewCheck","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"master","type":"address"}],"name":"LogNewMaster","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"master","type":"address"}],"name":"LogUpdateMaster","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"account","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newAccount","type":"address"},{"internalType":"address","name":"_connectors","type":"address"},{"internalType":"address","name":"_check","type":"address"}],"name":"addNewAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"accountVersion","type":"uint256"},{"internalType":"address","name":"_origin","type":"address"}],"name":"build","outputs":[{"internalType":"address","name":"_account","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"accountVersion","type":"uint256"},{"internalType":"address[]","name":"_targets","type":"address[]"},{"internalType":"bytes[]","name":"_datas","type":"bytes[]"},{"internalType":"address","name":"_origin","type":"address"}],"name":"buildWithCast","outputs":[{"internalType":"address","name":"_account","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"accountVersion","type":"uint256"},{"internalType":"address","name":"_newCheck","type":"address"}],"name":"changeCheck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMaster","type":"address"}],"name":"changeMaster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"check","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"connectors","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"version","type":"uint256"},{"internalType":"address","name":"query","type":"address"}],"name":"isClone","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"list","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"master","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_master","type":"address"},{"internalType":"address","name":"_list","type":"address"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_connectors","type":"address"}],"name":"setBasics","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateMaster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"versionCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
|
||||
const address = "0x2971AdFa57b20E5a416aE5a708A8655A9c74f723"
|
||||
const address = "0xD6fB4fd8b595d0A1dE727C35fe6F1D4aE5B60F51"
|
||||
const accounts = await web3.eth.getAccounts()
|
||||
new web3.eth.Contract(ABI, address);
|
||||
.getOwnerDetails(accounts[0])
|
||||
|
@ -75,3 +75,5 @@ new web3.eth.Contract(ABI, address);
|
|||
return error
|
||||
});
|
||||
```
|
||||
|
||||
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).
|
Loading…
Reference in New Issue
Block a user