Operator
Set signer for write operation. For some secnarios, like frontend, we are not able to get the private key of the user, so we need to set signer for write operation.
Input:
Name | Type | Description | required |
---|---|---|---|
signer | ethers.Signer | ethers.Signer object | true |
Example:
Get the price of minting a user DID
Input:
Name | Type | Description | required |
---|---|---|---|
name | string | The name of the user DID | true |
options | object | mint options | false |
options.brandDID | object | the brand DID object from | false |
Example:
Mint a user DID (This is a write method, the generateSigner function of the chain which this user DID on is required)
Input:
Name | Type | Description | required |
---|---|---|---|
name | string | The name of the user DID | true |
mintTo | string | The address that you want mint this user DID to | true |
options | MintUserDIDOptions | mint options | false |
options.signature | string | The signature to mint user DID | false |
options.owner | string | The owner in signature | false |
options.mintPrice | BigNumber | number | string | The price to mint this brand DID, if you do not pass this, this function will get the price by itself | false |
options.refundRecipient | string | If you passed higher value than mint price, the excees part will transfer to this wallet, default is address of signer | false |
options.brandDID | BrandDID | The brand DID that this user DID belongs to, if you do not pass this, this function will get the brand DID by itself | false |
options.txConfig | Object | The config for sending transaction | false |
options.onTransactionCreated | (transaction: object) => any | The callback function when the transaction is created | false |
Example:
Get the price of renew a user DID
Input:
Name | Type | Description | required |
---|---|---|---|
name | string | The name of the user DID | true |
options | object | mint options | false |
options.userDID | object | the user DID object from | false |
Example:
Mint a user DID (This is a write method, the generateSigner function of the chain which this user DID on is required)
Input:
Name | Type | Description | required |
---|---|---|---|
name | string | The name of the user DID | true |
options | RenewUserDIDOptions | renew options | false |
options.mintPrice | BigNumber | number | string | The price to mint this brand DID, if you do not pass this, this function will get the price by itself | false |
options.brandDID | BrandDID | The brand DID that this user DID belongs to, if you do not pass this, this function will get the brand DID by itself | false |
options.userDID | UserDID | The user DID object that you want to renew, if you do not pass this, this function will get the brand DID by itself | false |
options.refundRecipient | string | If you passed higher value than mint price, the excees part will transfer to this wallet, default is address of signer | false |
options.txConfig | Object | The config for sending transaction | false |
options.onTransactionCreated | (transaction: object) => any | The callback function when the transaction is created | false |
Example:
Burn a user DID (This is a write method, the generateSigner function of the chain which this user DID on is required)
Input:
Name | Type | Description | required |
---|---|---|---|
name | string | The name of the user DID | true |
options | BurnUserDIDOptions | burn options | false |
options.brandDID | BrandDID | The brand DID that this user DID belongs to, if you do not pass this, this function will get the brand DID by itself | false |
options.txConfig | Object | The config for sending transaction | false |
options.onTransactionCreated | (transaction: object) => any | The callback function when the transaction is created | false |
Example:
Set a user DID as primary (This is a write method, the generateSigner function of the chain which this user DID on is required)
Input:
Name | Type | Description | required |
---|---|---|---|
name | string | The name of the user DID | true |
options | object | setAsPrimary options | false |
options.txConfig | Object | The config for sending transaction | false |
options.onTransactionCreated | (transaction: object) => any | The callback function when the transaction is created | false |
Example:
Last updated