UNPKG

@dstoken-solana/rwa-token-sdk

Version:

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

133 lines 5.34 kB
import { type TransactionInstruction } from "@solana/web3.js"; import { type CommonArgs, type IxReturn } from "../utils"; import { type PolicyType, type IdentityFilter, Counter, CounterLimit, IssuancePolicies } from "./types"; import { BN, Provider } from "@coral-xyz/anchor"; /** Represents the arguments required to create a policy engine account. */ export type CreatePolicyEngineArgs = { authority: string; signer: string; } & CommonArgs; /** * Generate instructions to create a new policy account. * @param args {@link CreatePolicyEngineArgs}. * @returns Create policy engine transaction instruction. */ export declare function getCreatePolicyEngineIx(args: CreatePolicyEngineArgs, provider: Provider): Promise<TransactionInstruction>; /** Represents the arguments required to attach a policy to an asset. */ export type AttachPolicyArgs = { authority: string; assetMint: string; payer: string; identityFilter: IdentityFilter; policyType: PolicyType; customError?: number; }; /** Represents the arguments required to detach a policy from an asset. */ export type DetachPolicyArgs = { authority: string; assetMint: string; payer: string; hash: string; }; /** * Generate instructions to connect am policy to an asset. * * This function constructs an instruction to attach a policy account to an asset * using the provided arguments. It calls the policy engine program to attach the policy account, * and returns the generated instruction along with the required signers. * * @param args {@link AttachPolicyArgs} * @returns - {@link IxReturn}, a list of transaction instructions and a new key pair responsible to sign it. */ export declare function getAttachToPolicyEngineIx(args: AttachPolicyArgs, provider: Provider): Promise<IxReturn>; export type ChangeIssuancePoliciesArgs = { authority: string; payer: string; assetMint: string; issuancePolicies: IssuancePolicies; }; export declare function getChangeIssuancePoliciesIx(args: ChangeIssuancePoliciesArgs, provider: Provider): Promise<IxReturn>; export type SetCountersArgs = { authority: string; payer: string; assetMint: string; changedCounters: number[]; values: BN[]; }; export declare function getSetCountersIx(args: SetCountersArgs, provider: Provider): Promise<IxReturn>; export type ChangeMappingArgs = { authority: string; payer: string; assetMint: string; mappingSource: number[]; mappingValue: number[]; }; export declare function getChangeMappingIx(args: ChangeMappingArgs, provider: Provider): Promise<IxReturn>; export type ChangeCountersArgs = { authority: string; payer: string; assetMint: string; removedCounters: Buffer; addedCounters: Counter[]; }; /** * Generate instructions to connect am policy to an asset. * * This function constructs an instruction to attach a policy account to an asset * using the provided arguments. It calls the policy engine program to attach the policy account, * and returns the generated instruction along with the required signers. * * @param args {@link AttachPolicyArgs} * @returns - {@link IxReturn}, a list of transaction instructions and a new key pair responsible to sign it. */ export declare function getChangeCountersIx(args: ChangeCountersArgs, provider: Provider): Promise<IxReturn>; export type ChangeCounterLimitsArgs = { authority: string; payer: string; assetMint: string; removedCounterLimits: Buffer; addedCounterLimits: CounterLimit[]; }; /** * Generate instructions to connect am policy to an asset. * * This function constructs an instruction to attach a policy account to an asset * using the provided arguments. It calls the policy engine program to attach the policy account, * and returns the generated instruction along with the required signers. * * @param args {@link AttachPolicyArgs} * @returns - {@link IxReturn}, a list of transaction instructions and a new key pair responsible to sign it. */ export declare function getChangeCounterLimitsIx(args: ChangeCounterLimitsArgs, provider: Provider): Promise<IxReturn>; /** * Generate instructions to detach an identity policy account to an asset. * * This function constructs an instruction to attach a policy account to an asset * using the provided arguments. It creates a new policy account, calls the policy * engine program to attach the policy account, and returns the generated instruction * along with the required signers. * * @param args {@link AttachPolicyArgs} * @returns - {@link IxReturn}, a list of transaction instructions and a new key pair responsible to sign it. */ export declare function getDetachFromPolicyEngineIx(args: DetachPolicyArgs, provider: Provider): Promise<IxReturn>; export interface AddLockArgs { payer: string; authority: string; owner: string; assetMint: string; reason: BN; reasonString: string; amount: BN; lockTime: BN; } export declare function getAddLockIx(args: AddLockArgs, provider: Provider): Promise<IxReturn>; export interface RemoveLockArgs { payer: string; authority: string; owner: string; assetMint: string; index: number; } export declare function getRemoveLockIx(args: RemoveLockArgs, provider: Provider): Promise<IxReturn>; //# sourceMappingURL=instructions.d.ts.map