Skip to main content

ASBTContract

Masa SDK v3.36.1Docs


Masa SDK v3.36.1 / ASBTContract

Class: ASBTContract

Extends

Constructors

new ASBTContract()

new ASBTContract(masa, instances): ASBTContract

Parameters

masa: MasaInterface

instances: IIdentityContracts

Returns

ASBTContract

Inherited from

MasaSBTModuleBase.constructor

Properties

instances

protected instances: IIdentityContracts

Inherited from

MasaSBTModuleBase.instances


masa

protected readonly masa: MasaInterface

Inherited from

MasaSBTModuleBase.masa

Methods

attach()

attach\<Contract>(contract): ASBTContractWrapper\<Contract>

Type parameters

Contract extends ReferenceSBTAuthority

Parameters

contract: Contract

Returns

ASBTContractWrapper\<Contract>


checkOrGiveAllowance()

private checkOrGiveAllowance(paymentAddress, paymentMethod, spenderAddress, price): Promise\<undefined | ContractReceipt>

Checks or gives allowance on ERC20 tokens

Parameters

paymentAddress: string

paymentMethod: PaymentMethod

spenderAddress: string

price: BigNumber

Returns

Promise\<undefined | ContractReceipt>

Inherited from

MasaSBTModuleBase.checkOrGiveAllowance


connect()

connect\<Contract>(address, factory): Promise\<ASBTContractWrapper\<Contract>>

Type parameters

Contract extends ReferenceSBTAuthority

Parameters

address: string

factory: ContractFactory= MasaSBTAuthority__factory

Returns

Promise\<ASBTContractWrapper\<Contract>>


createOverrides()

protected createOverrides(value?): Promise\<PayableOverrides>

Parameters

value?: BigNumber

Returns

Promise\<PayableOverrides>

Inherited from

MasaSBTModuleBase.createOverrides


estimateGasWithSlippage()

protected estimateGasWithSlippage(estimateGas, args?, overrides?): Promise\<BigNumber>

Parameters

estimateGas

args?: unknown[]

overrides?: PayableOverrides

Returns

Promise\<BigNumber>

Inherited from

MasaSBTModuleBase.estimateGasWithSlippage


formatPrice()

protected formatPrice(paymentAddress, price): Promise\<string>

Parameters

paymentAddress: string

price: BigNumber

Returns

Promise\<string>

Inherited from

MasaSBTModuleBase.formatPrice


getMintPrice()

protected getMintPrice(paymentMethod, contract, slippage): Promise\<PriceInformation>

Parameters

paymentMethod: PaymentMethod

contract: MasaSBT

slippage: undefined | number= 250

Returns

Promise\<PriceInformation>

Inherited from

MasaSBTModuleBase.getMintPrice


getNetworkFeeInformation()

protected getNetworkFeeInformation(): Promise\<undefined | FeeData>

Returns

Promise\<undefined | FeeData>

Inherited from

MasaSBTModuleBase.getNetworkFeeInformation


getPaymentAddress()

private getPaymentAddress(paymentMethod): string

Gets the payment address for a given payment method

Parameters

paymentMethod: PaymentMethod

Returns

string

Inherited from

MasaSBTModuleBase.getPaymentAddress


loadSBTContract()

protected loadSBTContract\<Contract>(address, factory): Promise\<Contract>

Type parameters

Contract extends MasaSBT

Parameters

address: string

factory: ContractFactory

Returns

Promise\<Contract>

Inherited from

MasaSBTModuleBase.loadSBTContract


verify()

protected verify(errorMessage, contract, domain, types, value, signature, authorityAddress): Promise\<void>

verify a signature created during one of the SBT signing flows

Parameters

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

MasaSBTModuleBase.verify


addSlippage()

static protected addSlippage(price, slippage): BigNumber

adds a percentage to the price as slippage

Parameters

price: BigNumber

slippage: number

Returns

BigNumber

Inherited from

MasaSBTModuleBase.addSlippage