UNPKG

@dstoken-solana/rwa-token-sdk

Version:

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

159 lines 5.88 kB
import { TransactionInstruction } from "@solana/web3.js"; import { type CommonArgs, type IxReturn } from "../utils"; import { type Provider, BN } from "@coral-xyz/anchor"; /** Represents arguments for creating an on chain asset controller. */ export type CreateAssetControllerIx = { decimals: number; authority: string; name: string; uri: string; symbol: string; } & CommonArgs; /** * Builds the transaction instruction to create an Asset Controller. * @param args - {@link CreateAssetControllerIx} * @returns Create asset controller transaction instruction */ export declare function getCreateAssetControllerIx(args: CreateAssetControllerIx, provider: Provider): Promise<TransactionInstruction>; /** Represents arguments for update an on chain asset metadata. */ export type UpdateAssetMetadataArgs = { authority: string; name?: string; uri?: string; symbol?: string; } & CommonArgs; /** * Builds the transaction instruction to create an Asset Controller. * @param args - {@link UpdateAssetMetadataArgs} * @returns Create asset controller transaction instruction */ export declare function getUpdateAssetMetadataIx(args: UpdateAssetMetadataArgs, provider: Provider): Promise<TransactionInstruction>; /** Represents arguments for issuing an on chain asset/token. */ export type IssueTokenArgs = { amount: BN; authority: string; owner: string; wallet?: string; timestamp?: BN; } & CommonArgs; /** * Creates transaction instruction to issue tokens for a specific amount for a specific asset. * @param args {@link IssueTokenArgs} * @returns A transaction instruction distributing the specified amount for the specific asset. */ export declare function getIssueTokensIx(args: IssueTokenArgs, provider: Provider): Promise<TransactionInstruction[]>; export type TransferTokensArgs = { from: string; to: string; amount: BN; assetMint: string; decimals: number; message?: string; createTa?: boolean; wallet?: string; }; /** * Creates a transaction instruction to transfer a token between addresses with transfer controls. * @param args {@link TransferTokensArgs} * @returns Transaction instruction to transfer RWA token. */ export declare function getTransferTokensIxs(args: TransferTokensArgs, provider: Provider): Promise<TransactionInstruction[]>; /** Args used to generate new asset controller */ export type SetupAssetControllerArgs = { authority: string; decimals: number; payer: string; name: string; uri: string; symbol: string; interestRate?: number; }; /** * Generates a new asset controller. * This includes generation of a new key pair, a new asset registry, policy registry, data registry, identity registry. * @param args - {@link SetupAssetControllerArgs} * @returns - {@link IxReturn}, an object of the initialize transaction instructions and a new keypair. */ export declare function getSetupAssetControllerIxs(args: SetupAssetControllerArgs, provider: Provider): Promise<IxReturn>; /** Args used to setup user */ export type SetupUserArgs = { payer: string; owner: string; signer: string; assetMint: string; levels: number[]; expiry: BN[]; country: number; }; /** * Generate instructions to set up a user for permissioned based assets. * This function constructs the instructions necessary for setting up a user, which includes * creating an identity account, indicating permissions, and a token account for the user. * @param args {@link SetupUserArgs} * @returns - {@link IxReturn}, a promise that resolves to a list of generated transaction instructions. */ export declare function getSetupUserIxs(args: SetupUserArgs, provider: Provider): Promise<IxReturn>; export type MemoTranferArgs = { owner: string; tokenAccount: string; assetMint: string; authority: string; }; /** * Generate Instructions to disable memo transfer * @param args - {@link MemoTranferArgs} * @returns - {@link TransactionInstruction} * */ export declare function getEnableMemoTransferIx(args: MemoTranferArgs, provider: Provider): Promise<TransactionInstruction>; /** * Generate Instructions to disable memo transfer * @param args - {@link MemoTranferArgs} * @returns - {@link TransactionInstruction} * */ export declare function getDisableMemoTransferIx(args: MemoTranferArgs, provider: Provider): Promise<TransactionInstruction>; export type FreezeTokenArgs = { authority: string; owner: string; } & CommonArgs; /** * Generate Instructions to freeze token account * @param args - {@link FreezeTokenArgs} * @returns - {@link TransactionInstruction} */ export declare function getFreezeTokenIx(args: FreezeTokenArgs, provider: Provider): Promise<TransactionInstruction>; /** * Generate Instructions to thaw token account * @param args - {@link FreezeTokenArgs} * @returns - {@link TransactionInstruction} * */ export declare function getThawTokenIx(args: FreezeTokenArgs, provider: Provider): Promise<TransactionInstruction>; export type RevokeTokensArgs = { amount: BN; owner: string; wallet?: string; authority: string; assetMint: string; reason: string; }; /** * Revoke tokens from a user * @param args - {@link RevokeTokensArgs} * @returns - {@link TransactionInstruction} * */ export declare function getRevokeTokensIx(args: RevokeTokensArgs, provider: Provider): Promise<TransactionInstruction>; export type SeizeTokensArgs = { amount: BN; from: string; to: string; wallet?: string; authority: string; assetMint: string; reason: string; }; /** * Seize tokens from a user * @param args - {@link SeizeTokensArgs} * @returns - {@link TransactionInstruction} * */ export declare function getSeizeTokensIx(args: SeizeTokensArgs, provider: Provider): Promise<TransactionInstruction[]>; //# sourceMappingURL=instructions.d.ts.map