Attestation Service
getDigitalAssetGrade()
getDigitalAssetGrade(Gets the current grade of a digital asset. The grade is selected by the digital asset minter during attestation and determines both the initial bond requirement and the thresholds for verified rights promotion.digitalAssetAddress,digitalAssetId):Promise<number>
Parameters
digitalAssetAddress
`0x${string}`
Address of the digital asset contract
digitalAssetId
bigint
Token ID of the digital asset to check
Returns
Promise<number>
Numerical grade value (0-3), where:
- Grade S (0): Elite level
- Grade A (1): Premium level
- Grade B (2): Intermediate level
- Grade C (3): Entry level
Remarks
The grade cannot be changed after attestation and affects the requirements for verified rights level:- Higher grades require larger initial bonds from the digital asset creator
- Higher grades also require more total bonded tokens or attesters to achieve higher verified level
- The grade affects the trust factor in the verification process
- Professional attesters may prioritize higher-grade digital assets for verification
Example
getAttestation()
getAttestation(Retrieves detailed information about an attestation by its unique identifier. Use this method to get complete information about a specific attestation, including the recipient, attester, schema reference, and associated data.uid):Promise<{uid:`0x${string}`;schema:`0x${string}`;time:bigint;expirationTime:bigint;revocationTime:bigint;refUID:`0x${string}`;recipient:`0x${string}`;attester:`0x${string}`;verifierCount:bigint;revocable:boolean;data:`0x${string}`;bondedAmount:bigint;digitalAssetAddress:`0x${string}`;digitalAssetId:bigint;communityUserCount:bigint;WLVerifierCount:bigint; }>
Parameters
uid
`0x${string}`
Unique identifier of the attestation to retrieve
Returns
Promise<{ uid: `0x${string}`; schema: `0x${string}`; time: bigint; expirationTime: bigint; revocationTime: bigint; refUID: `0x${string}`; recipient: `0x${string}`; attester: `0x${string}`; verifierCount: bigint; revocable: boolean; data: `0x${string}`; bondedAmount: bigint; digitalAssetAddress: `0x${string}`; digitalAssetId: bigint; communityUserCount: bigint; WLVerifierCount: bigint; }>
Complete attestation data including recipient, attester, schema, digital asset details, and bond amounts
Example
new AttestationServiceClient()
new AttestationServiceClient(publicClient,walletClient,contractAddress):AttestationServiceClient
Parameters
publicClient
walletClient
contractAddress
`0x${string}`
Returns
AttestationServiceClient
Methods
attest()
attest(Create an attestation for a digital assetattestationRequest,digitalAssetAddress,digitalAssetId,grade,bondAmount):Promise<`0x${string}`>
Parameters
attestationRequest
AttestationRequest
Object containing attestation details
digitalAssetAddress
`0x${string}`
Address of the digital asset token contract
digitalAssetId
bigint
Token ID of the digital asset being attested
grade
bigint
Grade level for the attestation (affects fees and requirements)
bondAmount
bigint
Amount of tokens to bond for the attestation
Returns
Promise<`0x${string}`>
Unique identifier (UID) of the created attestation
Example
delegatedAttest()
delegatedAttest(Create a delegated attestation This method allows a user to create an attestation on behalf of another account, using a signature from that account for authorization.signatureParams,attestationRequest,digitalAssetAddress,digitalAssetId,grade,bondAmount,delegatedAddress):Promise<`0x${string}`>
Parameters
signatureParams
SignatureParams
Parameters for the signature verification
attestationRequest
AttestationRequest
Object containing attestation details
digitalAssetAddress
`0x${string}`
Address of the digital asset token contract
digitalAssetId
bigint
Token ID of the digital asset being attested
grade
bigint
Grade level for the attestation (affects fees and requirements)
bondAmount
bigint
Amount of tokens to bond for the attestation
delegatedAddress
`0x${string}`
Address that will perform the attestation on behalf of the signer
Returns
Promise<`0x${string}`>
Transaction hash of the attestation transaction
verifyAttestation()
verifyAttestation(Verify an attestation by bonding tokens This method allows a verifier to stake tokens against an attestation, supporting its validity. Verifiers receive rewards for accurate verifications. A digital asset can achieve Verified Rights status when it meets either of these thresholds:attestationUID,bondAmount):Promise<`0x${string}`>
- Total bonded tokens reach the level requirement
- Number of unique attesters reaches the minimum threshold
Parameters
attestationUID
`0x${string}`
Unique identifier of the attestation to verify
bondAmount
bigint
Amount of tokens to bond for the verification
Returns
Promise<`0x${string}`>
Transaction hash of the verification transaction
Remarks
Important notes about the Verified Rights promotion process:- Only one endorsement per address is counted towards the attester threshold
- Endorsement amounts are cumulative for the token threshold
- Once Verified Rights level 2 is achieved, the digital asset can be used in licensing and other trust-dependent transactions
- Professional attesters’ endorsements may carry additional weight in the verification process
- The level system reflects the trust and verification achieved by the digital asset
Example
isVerifiedAttester()
isVerifiedAttester(Check if an address is a whitelisted verifieraddress):Promise<boolean>
Parameters
address
`0x${string}`
The address to check
Returns
Promise<boolean>
True if the address is a whitelisted verifier, false otherwise
addWhitelistVerifier()
addWhitelistVerifier(Add a new whitelisted verifierattesterAddress):Promise<`0x${string}`>
Parameters
attesterAddress
`0x${string}`
The address to add as a whitelisted verifier
Returns
Promise<`0x${string}`>
The transaction hash
isOwner()
isOwner(Check if an address is the owner of the contractaddress):Promise<boolean>
Parameters
address
`0x${string}`
The address to check
Returns
Promise<boolean>
True if the address is the owner, false otherwise
getNonce()
getNonce(Get the current nonce for an addressaddress):Promise<bigint>
Parameters
address
`0x${string}`
The address to get the nonce for
Returns
Promise<bigint>
The current nonce as a bigint
getDigitalAssetLevel()
getDigitalAssetLevel(Get the level of a digital assetdigitalAssetAddress,digitalAssetId):Promise<number>
Parameters
digitalAssetAddress
`0x${string}`
The address of the digital asset contract
digitalAssetId
bigint
The token ID of the digital asset
Returns
Promise<number>
The level of the digital asset (0 = unverified, 1 = basic, 2 = verified/licensable)
Remarks
The level system represents the verification status of a digital asset:- Level 0: Just minted - Initial state of any newly minted digital asset
- Level 1: Attested - Digital asset creator has completed attestation, initial bond and fee paid
- Level 2: Verified Rights - Achieved through community endorsements, meets token threshold or unique attesters requirement
- All digital assets, regardless of grade, can achieve Verified Rights status
- Verified Rights level 2 is required for licensing and other trust-dependent operations
- Level status is independent of the digital asset’s grade
Example
getDigitalAssetUID()
getDigitalAssetUID(Generate a unique identifier for a digital assetdigitalAssetAddress,digitalAssetId):`0x${string}`
Parameters
digitalAssetAddress
`0x${string}`
The address of the digital asset contract
digitalAssetId
bigint
The token ID of the digital asset
Returns
`0x${string}`
The unique identifier for the digital asset
removeVerifiedAttester()
removeVerifiedAttester(Remove a whitelisted verifierattesterAddress):Promise<`0x${string}`>
Parameters
attesterAddress
`0x${string}`
The address to remove from the whitelist
Returns
Promise<`0x${string}`>
The transaction hash
getRightsBoundAccountFromReceipt()
getRightsBoundAccountFromReceipt(Extracts the rights bound account from a transaction receipt.receipt):`0x${string}`
Parameters
receipt
The transaction receipt to extract the rights bound account fromlogs
object[]
Returns
`0x${string}`
The rights bound account address if found, zero address otherwise
getAttestationDataFromReceipt()
getAttestationDataFromReceipt(Extracts attestation data from a transaction receipt.receipt):object
Parameters
receipt
The transaction receipt to extract the attestation data fromlogs
object[]
Returns
object
The attestation data including UID and rights bound account
attestationUid
attestationUid: `0x${string}`
rightsBoundAccount
rightsBoundAccount: `0x${string}`
Throws
Error if the attestation UID is not found in the logsgenerateSignatureParams()
generateSignatureParams(Generates signature parameters required for delegated attestationsignature,signerAddress):object
Parameters
signature
`0x${string}`
The signed message signature
signerAddress
`0x${string}`
The address of the signer
Returns
object
Signature parameters object with signature, signer, v, r, and s values
signature
signature: `0x${string}`
signer
signer: `0x${string}`
v
v: number
r
r: `0x${string}`
s
s: `0x${string}`
signForDelegatedAttestation()
signForDelegatedAttestation(Signs a message for delegated attestation and returns the signature parametersaccount):Promise<{signature:`0x${string}`;signer:`0x${string}`;v:number;r:`0x${string}`;s:`0x${string}`; }>
Parameters
account
`0x${string}`
The account performing the signature
Returns
Promise<{ signature: `0x${string}`; signer: `0x${string}`; v: number; r: `0x${string}`; s: `0x${string}`; }>
Signature parameters object with signature, signer, v, r, and s values
