UNPKG

@bridgesplit/rwa-token-sdk

Version:

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

37 lines (36 loc) 1.5 kB
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" /> import { type IxReturn } from "../utils"; import { type AttachPolicyArgs, DetachPolicyArgs } from "../policy-engine"; import { type RwaClient } from "./Client"; import { type PublicKey } from "@solana/web3.js"; /** * Represents the client Policy Engine for an RWA. */ export declare class PolicyEngine { private readonly rwaClient; constructor(rwaClient: RwaClient); /** * Asynchronously create a policy account to assets. * @param - {@link AttachPolicyArgs} * @returns A Promise that resolves to the instructions to attach a policy. * */ createPolicy(policyArgs: AttachPolicyArgs): Promise<IxReturn>; /** * Asynchronously attaches a policy to the policy account. * @param - {@link AttachPolicyArgs} * @returns A Promise that resolves to the instructions to attach a policy. * */ attachPolicy(policyArgs: AttachPolicyArgs): Promise<IxReturn>; /** * Asynchronously detaches a policy to the policy account. * @param - {@link DetachPolicyArgs} * @returns A Promise that resolves to the instructions to detach a policy. * */ detachPolicy(policyArgs: DetachPolicyArgs): Promise<IxReturn>; /** * Retrieves the policy registry pda account for a specific asset mint. * @param assetMint - The string representation of the asset's mint address. * @returns The policy registry pda as a public key. */ getPolicyEnginePda(assetMint: string): PublicKey; }