UNPKG

@metaplex-foundation/digital-asset-standard-api

Version:

Open-source specification for interacting with digital assets on Solana

66 lines (65 loc) 2.86 kB
import { PublicKey, RpcInterface } from '@metaplex-foundation/umi'; import { GetAssetProofRpcResponse, GetAssetsByAuthorityRpcInput, GetAssetsByCreatorRpcInput, GetAssetsByGroupRpcInput, GetAssetsByOwnerRpcInput, DasApiAsset, DasApiAssetList, SearchAssetsRpcInput, GetAssetSignaturesRpcResponse, GetAssetProofsRpcResponse, GetAssetSignaturesRpcInput, GetAssetsRpcInput, GetAssetRpcInput } from './types'; export interface DasApiInterface { /** * Return the metadata information of a compressed/standard asset. * * @param input the input parameters for the RPC call */ getAsset(input: GetAssetRpcInput | PublicKey): Promise<DasApiAsset>; /** * Return the metadata information of multiple compressed/standard assets. * * @param input the input parameters for the RPC call */ getAssets(input: GetAssetsRpcInput | PublicKey[]): Promise<DasApiAsset[]>; /** * Return the merkle tree proof information for a compressed asset. * * @param assetId the id of the asset to fetch the proof for */ getAssetProof(assetId: PublicKey): Promise<GetAssetProofRpcResponse>; /** * Return the merkle tree proof information for multiple compressed assets. * * @param assetIds array of the ids of the assets to fetch the proofs for */ getAssetProofs(assetIds: PublicKey[]): Promise<GetAssetProofsRpcResponse>; /** * Return the list of assets given an authority address. * * @param input the input parameters for the RPC call */ getAssetsByAuthority(input: GetAssetsByAuthorityRpcInput): Promise<DasApiAssetList>; /** * Return the list of assets given a creator address. * * @param input the input parameters for the RPC call */ getAssetsByCreator(input: GetAssetsByCreatorRpcInput): Promise<DasApiAssetList>; /** * Return the list of assets given a group (key, value) pair. * * @param input the input parameters for the RPC call */ getAssetsByGroup(input: GetAssetsByGroupRpcInput): Promise<DasApiAssetList>; /** * Return the list of assets given an owner address. * * @param input the input parameters for the RPC call */ getAssetsByOwner(input: GetAssetsByOwnerRpcInput): Promise<DasApiAssetList>; /** * Return the list of assets given a search criteria. * * @param input the input parameters for the RPC call */ searchAssets(input: SearchAssetsRpcInput): Promise<DasApiAssetList>; /** * Return the transaction signatures for a compressed asset * * @param input the input parameters for the RPC call */ getAssetSignatures(input: GetAssetSignaturesRpcInput): Promise<GetAssetSignaturesRpcResponse>; } export declare const createDasApiDecorator: (rpc: RpcInterface) => RpcInterface & DasApiInterface;