Skip to content

Latest commit

 

History

History
293 lines (147 loc) · 5.11 KB

SoulLinker.md

File metadata and controls

293 lines (147 loc) · 5.11 KB

Masa SDK v4.2.0Docs


Masa SDK v4.2.0 / SoulLinker

Class: SoulLinker

Extends

  • MasaContractModuleBase

Constructors

new SoulLinker()

new SoulLinker(masa, instances): SoulLinker

Parameters

masa: MasaInterface

instances: IIdentityContracts

Returns

SoulLinker

Inherited from

MasaContractModuleBase.constructor

Properties

instances

protected instances: IIdentityContracts

Inherited from

MasaContractModuleBase.instances


masa

protected readonly masa: MasaInterface

Inherited from

MasaContractModuleBase.masa


types

readonly types: Record<string, TypedDataField[]>

Methods

addLink()

addLink(tokenAddress, paymentMethod, readerIdentityId, ownerIdentityId, tokenId, signatureDate, expirationDate, signature, slippage): Promise<BaseResult>

Adds a link to the soullinker

Parameters

tokenAddress: string

paymentMethod: PaymentMethod

readerIdentityId: BigNumber

ownerIdentityId: BigNumber

tokenId: BigNumber

signatureDate: number

expirationDate: number

signature: string

slippage: undefined | number = 250

Returns

Promise<BaseResult>


breakLink()

breakLink(contract, tokenId, readerIdentityId): Promise<BaseResult>

Parameters

contract: Contract

tokenId: BigNumber

readerIdentityId: BigNumber

Returns

Promise<BaseResult>


createOverrides()

protected createOverrides(value?): Promise<PayableOverrides>

Parameters

value?: BigNumber

Returns

Promise<PayableOverrides>

Inherited from

MasaContractModuleBase.createOverrides


estimateGasWithSlippage()

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

Parameters

estimateGas

args?: unknown[]

overrides?: PayableOverrides

Returns

Promise<BigNumber>

Inherited from

MasaContractModuleBase.estimateGasWithSlippage


formatPrice()

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

Parameters

paymentAddress: string

price: BigNumber

Returns

Promise<string>

Inherited from

MasaContractModuleBase.formatPrice


getNetworkFeeInformation()

protected getNetworkFeeInformation(): Promise<undefined | FeeData>

Returns

Promise<undefined | FeeData>

Inherited from

MasaContractModuleBase.getNetworkFeeInformation


getPrice()

getPrice(tokenAddress, paymentMethod, slippage): Promise<PriceInformation>

Gets price for establishing a link

Parameters

tokenAddress: string

paymentMethod: PaymentMethod

slippage: undefined | number = 250

Returns

Promise<PriceInformation>


signLink()

signLink(readerIdentityId, ownerIdentityId, tokenAddress, tokenId, signatureDate, expirationOffset): Promise<object>

Signs a soul linker link

Parameters

readerIdentityId: BigNumber

ownerIdentityId: BigNumber

tokenAddress: string

tokenId: BigNumber

signatureDate: number = ...

expirationOffset: number = ...

Returns

Promise<object>

expirationDate

expirationDate: number

signature

signature: string

signatureDate

signatureDate: number


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

MasaContractModuleBase.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

MasaContractModuleBase.addSlippage