Skip to content

Latest commit

 

History

History
265 lines (133 loc) · 5.24 KB

SBTContract.md

File metadata and controls

265 lines (133 loc) · 5.24 KB

Masa SDK v4.2.0Docs


Masa SDK v4.2.0 / SBTContract

Class: SBTContract

Extends

Constructors

new SBTContract()

new SBTContract(masa, instances): SBTContract

Parameters

masa: MasaInterface

instances: IIdentityContracts

Returns

SBTContract

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): SBTContractWrapper<Contract>

Type Parameters

Contract extends MasaSBT

Parameters

contract: Contract

Returns

SBTContractWrapper<Contract>


connect()

connect<Contract>(address, factory): Promise<SBTContractWrapper<Contract>>

loads an sbt instance and connects the contract functions to it

Type Parameters

Contract extends MasaSBT

Parameters

address: string

factory: ContractFactory = MasaSBT__factory

Returns

Promise<SBTContractWrapper<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


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()

protected static addSlippage(price, slippage): BigNumber

adds a percentage to the price as slippage

Parameters

price: BigNumber

slippage: number

Returns

BigNumber

Inherited from

MasaSBTModuleBase.addSlippage