CreditScore
[# Masa SDK
- v3.30.3](/docs/developers/sdk/) / Exports / CreditScore
Class: CreditScore
Hierarchy
↳
CreditScore
Table of contents
Constructors
Properties
Methods
- burn
- checkOrGiveAllowance
- createOverrides
- estimateGasWithSlippage
- formatPrice
- getMintPrice
- getNetworkFeeInformation
- getPaymentAddress
- getPrice
- loadSBTContract
- mint
- sign
- verify
- addSlippage
Constructors
constructor
• new CreditScore(masa
, instances
): CreditScore
Parameters
Name | Type |
---|---|
masa | MasaInterface |
instances | IIdentityContracts |
Returns
Inherited from
Properties
instances
• Protected
instances: IIdentityContracts
Inherited from
masa
• Protected
Readonly
masa: MasaInterface
Inherited from
types
• Readonly
types: Record
\<string
, TypedDataField
[]>
Methods
burn
▸ burn(creditScoreId
): Promise
\<BaseResult
>
Parameters
Name | Type |
---|---|
creditScoreId | 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
getPrice
▸ getPrice(paymentMethod
, slippage?
): Promise
\<PriceInformation
>
gets the price for a credit score
Parameters
Name | Type | Default value |
---|---|---|
paymentMethod | PaymentMethod | undefined |
slippage | undefined | number | 250 |
Returns
Promise
\<PriceInformation
>
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
mint
▸ mint(paymentMethod
, identityId
, authorityAddress
, signatureDate
, signature
, slippage?
): Promise
\<ContractTransaction
>
purchase credit score
Parameters
Name | Type | Default value |
---|---|---|
paymentMethod | PaymentMethod | undefined |
identityId | BigNumber | undefined |
authorityAddress | string | undefined |
signatureDate | number | undefined |
signature | string | undefined |
slippage | undefined | number | 250 |
Returns
Promise
\<ContractTransaction
>
sign
▸ sign(identityId
): Promise
\<undefined
| { authorityAddress
: string
; signature
: string
; signatureDate
: number
}>
Signs a credit score
Parameters
Name | Type |
---|---|
identityId | BigNumber |
Returns
Promise
\<undefined
| { authorityAddress
: string
; signature
: string
; signatureDate
: number
}>
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