Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@swapynetwork/swapy-identity-api
Advanced tools
Swapy Identity API aims to ease the interaction with Swapy financial identities. The current implementation was designed to be used on browsers and it provides methods to: * Create personal and multi sig identities; * Manage identity's data on IPFS a
Swapy Identity API aims to ease the interaction with Swapy financial identities. The current implementation was designed to be used on browsers and it provides methods to:
Check out our smart contracts and Wiki for more details around Swapy Identity Protocol.
The API is available on NPM. So, install it
npm install @swapynetwork/swapy-identity-api
Init the API with a first account, Ethereum http provider and network parameters as well.
import { Api } from '@swapynetwork/swapy-identity-api'
const api = new Api('<0xPrivateKey>','<ethereumHttpProvider')
Promise.<Object, Error>
Promise.<Object, Error>
Promise.<Object, Error>
Promise.<Object, Error>
Integer
String
Object
Instantiates a new personal identity
Input | Type | Description | Default value |
---|---|---|---|
profileDataNodes | Object[] | Initial profile data | [] |
profileDataNodes.parentLabel | String | Parent node label | - |
profileDataNodes.label | String | Node label | - |
profileDataNodes.data | String | Leaf content | - |
profileDataNodes.childrens | Object[] | Node childrens | - |
opt | Object | Transaction options | {from: null, gas: null, gasPrice: null} |
opt.from | String | Wallet address | First account set |
opt.gas | Integer | GAS limit | 4500000 |
opt.gasPrice | BigNumber | GAS price | 20 gwei |
Output | Description |
---|---|
Promise<Object, Error> | A promise that resolves with the transaction object or rejects with an error |
Returns the profile data of an identity
Input | Type | Description | Default value |
---|---|---|---|
identity | String | Identity's contract address | - |
fetchData | Boolean | Returns the data value | false |
Output | Description |
---|---|
Promise<Object, Error> | A promise that resolves with the profile object or rejects with an error |
Inserts nodes on the profile tree
Input | Type | Description | Default value |
---|---|---|---|
profileNodes | Object[] | Insertions | [] |
profileNodes.parentLabel | String | Parent node label | - |
profileNodes.label | String | Node label | - |
profileNodes.data | String | Leaf content | - |
profileNodes.childrens | Object[] | Node childrens | - |
identity | String | Identity's contract address | - |
multiSig | Boolean | multi sig identity | false |
opt | Object | Transaction options | {from: null, gas: null, gasPrice: null} |
opt.from | String | Wallet address | First account set |
opt.gas | Integer | GAS limit | 4500000 |
opt.gasPrice | BigNumber | GAS price | 20 gwei |
Output | Description |
---|---|
Promise<Object, Error> | A promise that resolves with the transaction object or rejects with an error |
Inserts nodes on the profile tree
Input | Type | Description | Default value |
---|---|---|---|
nodeLabel | String | Node label | - |
data | String | New content | - |
identity | String | Identity's contract address | - |
multiSig | Boolean | multi sig identity | false |
opt | Object | Transaction options | {from: null, gas: null, gasPrice: null} |
opt.from | String | Wallet address | First account set |
opt.gas | Integer | GAS limit | 4500000 |
opt.gasPrice | BigNumber | GAS price | 20 gwei |
Output | Description |
---|---|
Promise<Object, Error> | A promise that resolves with the transaction object or rejects with an error |
Returns Identity's Swapy Token balance
Input | Type | Description | Default value |
---|---|---|---|
identity | String | Identity's contract address | - |
Output | Description |
---|---|
Integer | Swapy Token balance |
Returns Identity's Swapy Token balance
Input | Type | Description | Default value |
---|---|---|---|
identity | String | Identity's contract address | - |
Output | Description |
---|---|
Integer | Swapy Token balance |
Generates a qrCode image that contains the sale arguments
Input | Type | Description | Default value |
---|---|---|---|
identity | String | Identity's contract address | - |
saleNodes | Object[] | Profile Nodes to be sold | - |
saleNodes.label | String | Node label | - |
saleNodes.price | Integer | Individual node price | - |
price | Integer | General sale price | - |
Output | Description |
---|---|
String | QRCode image url |
Transfer tokens to seller's identity and retrieve the data bought
Input | Type | Description | Default value |
---|---|---|---|
identity | String | Buyer's identity contract address | - |
seller | String | Seller's identity contract address | - |
saleNodes | Object[] | Profile Nodes to be sold | - |
saleNodes.label | String | Node label | - |
price | Integer | Sale price | - |
opt | Object | Transaction options | {from: null, gas: null, gasPrice: null} |
opt.from | String | Wallet address | First account set |
opt.gas | Integer | GAS limit | 4500000 |
opt.gasPrice | BigNumber | GAS price | 20 gwei |
Output | Description |
---|---|
Object | Data Bought |
FAQs
Swapy Identity API aims to ease the interaction with Swapy financial identities. The current implementation was designed to be used on browsers and it provides methods to: * Create personal and multi sig identities; * Manage identity's data on IPFS a
The npm package @swapynetwork/swapy-identity-api receives a total of 1 weekly downloads. As such, @swapynetwork/swapy-identity-api popularity was classified as not popular.
We found that @swapynetwork/swapy-identity-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.