UNPKG

@bridgesplit/rwa-token-sdk

Version:

RWA Token SDK for the development of permissioned tokens on SVM blockchains.

44 lines (43 loc) 2.42 kB
import { type AnchorProvider } from "@coral-xyz/anchor"; import { type IdentityRegistryAccount, type IdentityAccount } from "./types"; /** * Retrieves identity registry account associated with a specific asset mint. * @param assetMint - The string representation of the asset mint. * @returns A promise resolving to {@link IdentityRegistryAccount}, or `undefined` if it doesn't exist. */ export declare function getIdentityRegistryAccount(assetMint: string, provider: AnchorProvider): Promise<IdentityRegistryAccount | undefined>; export interface IdentityRegistryFilter { assetMint?: string; authority?: string; delegate?: string; } export declare const IDENTITY_REGISTRY_ASSET_MINT_OFFSET = 9; export declare const IDENTITY_REGISTRY_AUTHORITY_OFFSET = 41; export declare const IDENTITY_REGISTRY_DELEGATE_OFFSET = 73; /** * Retrieves identity registry account associated with a specific asset mint. * @param assetMint - The string representation of the asset mint. * @returns A promise resolving to {@link IdentityRegistryAccount}, or `undefined` if it doesn't exist. */ export declare function getIdentityRegistryAccountsWithFilter(filter: IdentityRegistryFilter, provider: AnchorProvider): Promise<IdentityRegistryAccount[] | undefined>; /** * Retrieves a identity account associated with a specific asset mint and owner. * @param assetMint - The string representation of the asset mint. * @param owner - The string representation of the asset owner. * @returns A promise resolving to the {@link IdentityAccount}, or `undefined` if it doesn't exist. */ export declare function getIdentityAccount(assetMint: string, owner: string, provider: AnchorProvider): Promise<IdentityAccount | undefined>; export interface IdentityAccountFilter { assetMint?: string; registry?: string; owner?: string; } export declare const IDENTITY_ACCOUNT_REGISTRY_OFFSET = 9; export declare const IDENTITY_ACCOUNT_OWNER_OFFSET = 41; /** * Retrieves all identity accounts associated with a specific asset mint and owner. * @param assetMint - The string representation of the asset mint. * @param owner - The string representation of the asset owner. * @returns A promise resolving to the {@link IdentityAccount}, or `undefined` if it doesn't exist. */ export declare function getIdentityAccountsWithFilter(filter: IdentityAccountFilter, provider: AnchorProvider): Promise<IdentityAccount[] | undefined>;