Identity
[# Masa SDK
- v3.30.3](/docs/developers/sdk/) / Exports / Identity
Class: Identity
Hierarchy
↳
Identity
Table of contents
Constructors
Properties
Methods
- burn
- checkOrGiveAllowance
- createOverrides
- estimateGasWithSlippage
- formatPrice
- getMintPrice
- getNetworkFeeInformation
- getPaymentAddress
- loadSBTContract
- purchase
- purchaseIdentityAndName
- verify
- addSlippage
Constructors
constructor
• new Identity(masa
, instances
): Identity
Parameters
Name | Type |
---|---|
masa | MasaInterface |
instances | IIdentityContracts |
Returns
Inherited from
Properties
instances
• Protected
instances: IIdentityContracts
Inherited from
masa
• Protected
Readonly
masa: MasaInterface
Inherited from
Methods
burn
▸ burn(identityId
): Promise
\<BaseResult
>
Parameters
Name | Type |
---|---|
identityId | BigNumber |
Returns
Promise
\<BaseResult
>
checkOrGiveAllowance
▸ checkOrGiveAllowance(paymentAddress
, paymentMethod
, spenderAddress
, price
): Promise
\<undefined
| ContractReceipt
>
Checks or gives allowance on ERC20 tokens
Parameters
Name | Type |
---|---|
paymentAddress | string |
paymentMethod | PaymentMethod |
spenderAddress | string |
price | BigNumber |
Returns
Promise
\<undefined
| ContractReceipt
>
Inherited from
MasaSBTModuleBase.checkOrGiveAllowance
createOverrides
▸ createOverrides(value?
): Promise
\<PayableOverrides
>
Parameters
Name | Type |
---|---|
value? | BigNumber |
Returns
Promise
\<PayableOverrides
>
Inherited from
MasaSBTModuleBase.createOverrides
estimateGasWithSlippage
▸ estimateGasWithSlippage(estimateGas
, args?
, overrides?
): Promise
\<BigNumber
>
Parameters
Name | Type |
---|---|
estimateGas | (...estimateGasArgAndOverrides : never []) => Promise \<BigNumber > |
args? | unknown [] |
overrides? | PayableOverrides |
Returns
Promise
\<BigNumber
>
Inherited from
MasaSBTModuleBase.estimateGasWithSlippage
formatPrice
▸ formatPrice(paymentAddress
, price
): Promise
\<string
>
Parameters
Name | Type |
---|---|
paymentAddress | string |
price | BigNumber |
Returns
Promise
\<string
>
Inherited from
getMintPrice
▸ getMintPrice(paymentMethod
, contract
, slippage?
): Promise
\<PriceInformation
>
Parameters
Name | Type | Default value |
---|---|---|
paymentMethod | PaymentMethod | undefined |
contract | MasaSBT | undefined |
slippage | undefined | number | 250 |
Returns
Promise
\<PriceInformation
>
Inherited from
MasaSBTModuleBase.getMintPrice
getNetworkFeeInformation
▸ getNetworkFeeInformation(): Promise
\<undefined
| FeeData
>
Returns
Promise
\<undefined
| FeeData
>
Inherited from
MasaSBTModuleBase.getNetworkFeeInformation
getPaymentAddress
▸ getPaymentAddress(paymentMethod
): string
Gets the payment address for a given payment method
Parameters
Name | Type |
---|---|
paymentMethod | PaymentMethod |
Returns
string
Inherited from
MasaSBTModuleBase.getPaymentAddress
loadSBTContract
▸ loadSBTContract\<Contract
>(address
, factory
): Promise
\<Contract
>
Type parameters
Name | Type |
---|---|
Contract | extends MasaSBT |
Parameters
Name | Type |
---|---|
address | string |
factory | ContractFactory |
Returns
Promise
\<Contract
>
Inherited from
MasaSBTModuleBase.loadSBTContract
purchase
▸ purchase(): Promise
\<ContractTransaction
>
purchase only identity
Returns
Promise
\<ContractTransaction
>
purchaseIdentityAndName
▸ purchaseIdentityAndName(paymentMethod
, name
, nameLength
, duration?
, metadataURL
, authorityAddress
, signature
): Promise
\<ContractTransaction
>
purchase identity with name
Parameters
Name | Type | Default value |
---|---|---|
paymentMethod | PaymentMethod | undefined |
name | string | undefined |
nameLength | number | undefined |
duration | number | 1 |
metadataURL | string | undefined |
authorityAddress | string | undefined |
signature | string | undefined |
Returns
Promise
\<ContractTransaction
>
verify
▸ verify(errorMessage
, contract
, domain
, types
, value
, signature
, authorityAddress
): Promise
\<void
>
verify a signature created during one of the SBT signing flows
Parameters
Name | Type |
---|---|
errorMessage | string |
contract | SoulLinker | SoulStore | MasaSBT | MasaSBTSelfSovereign | MasaSBTAuthority |
domain | TypedDataDomain |
types | Record \<string , TypedDataField []> |
value | Record \<string , string | number | boolean | BigNumber > |
signature | string |
authorityAddress | string |
Returns
Promise
\<void
>
Inherited from
addSlippage
▸ addSlippage(price
, slippage
): BigNumber
adds a percentage to the price as slippage
Parameters
Name | Type |
---|---|
price | BigNumber |
slippage | number |
Returns
BigNumber