@bridgesplit/rwa-token-sdk
Version:
RWA Token SDK for the development of permissioned tokens on SVM blockchains.
36 lines (35 loc) • 2.04 kB
TypeScript
import { type AnchorProvider } from "@coral-xyz/anchor";
import { type PolicyEngineAccount, type PolicyAccount, TrackerAccount } from "./types";
/**
* Retrieves policy engine account associated with a specific asset mint.
* @param assetMint - The string representation of the asset mint.
* @returns A promise resolving to {@link PolicyEngineAccount}, or `undefined` if it doesn't exist.
*/
export declare function getPolicyEngineAccount(assetMint: string, provider: AnchorProvider): Promise<PolicyEngineAccount | undefined>;
export interface PolicyEngineFilter {
assetMint?: string;
authority?: string;
delegate?: string;
}
export declare const POLICY_ENGINE_ASSET_MINT_OFFSET = 9;
export declare const POLICY_ENGINE_AUTHORITY_OFFSET = 41;
export declare const POLICY_ENGINE_DELEGATE_OFFSET = 73;
/**
* Retrieves policy engine accounts with a filter.
* @param filter - The filter to apply to the policy engine accounts.
* @returns A promise resolving to an array of {@link PolicyEngineAccount}, or `undefined` if it doesn't exist.
*/
export declare function getPolicyEngineAccountsWithFilter(filter: PolicyEngineFilter, provider: AnchorProvider): Promise<PolicyEngineAccount[] | undefined>;
/**
* Retrieves a policy account associated with a specific asset mint.
* @param assetMint - The string representation of the asset mint.
* @returns A promise resolving to the fetched policy account, or `undefined` if it doesn't exist.
*/
export declare function getPolicyAccount(assetMint: string, provider: AnchorProvider): Promise<PolicyAccount | undefined>;
/**
* Retrieves a tracker account pda associated with a specific asset mint and owner.
* @param assetMint - The string representation of the asset mint.
* @param owner - The string representation of the owner's public key.
* @returns A promise resolving to the fetched tracker account, or `undefined` if it doesn't exist.
*/
export declare function getTrackerAccount(assetMint: string, owner: string, provider: AnchorProvider): Promise<TrackerAccount>;