PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/@aptos-labs/ts-sdk/dist/esm

Просмотр файла: chunk-7V35JAAF.mjs.map

{"version":3,"sources":["../../src/internal/fungibleAsset.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/fungible_asset}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * fungible_asset namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport {\n  AnyNumber,\n  GetCurrentFungibleAssetBalancesResponse,\n  GetFungibleAssetActivitiesResponse,\n  GetFungibleAssetMetadataResponse,\n  PaginationArgs,\n  WhereArg,\n} from \"../types\";\nimport { queryIndexer } from \"./general\";\nimport {\n  GetCurrentFungibleAssetBalances,\n  GetFungibleAssetActivities,\n  GetFungibleAssetMetadata,\n} from \"../types/generated/queries\";\nimport {\n  GetCurrentFungibleAssetBalancesQuery,\n  GetFungibleAssetActivitiesQuery,\n  GetFungibleAssetMetadataQuery,\n} from \"../types/generated/operations\";\nimport {\n  CurrentFungibleAssetBalancesBoolExp,\n  FungibleAssetActivitiesBoolExp,\n  FungibleAssetMetadataBoolExp,\n} from \"../types/generated/types\";\nimport { AccountAddressInput } from \"../core\";\nimport { Account } from \"../account\";\nimport {\n  EntryFunctionABI,\n  InputGenerateTransactionOptions,\n  parseTypeTag,\n  TypeTagAddress,\n  TypeTagU64,\n} from \"../transactions\";\nimport { generateTransaction } from \"./transactionSubmission\";\nimport { SimpleTransaction } from \"../transactions/instances/simpleTransaction\";\n\n/**\n * Retrieves metadata for fungible assets based on specified criteria.\n * This function allows you to filter and paginate through fungible asset metadata.\n *\n * @param args - The arguments for the function.\n * @param args.aptosConfig - The configuration for Aptos.\n * @param [args.options] - Optional parameters for pagination and filtering.\n * @param [args.options.limit] - The maximum number of results to return.\n * @param [args.options.offset] - The number of results to skip before starting to collect the result set.\n * @param [args.options.where] - Conditions to filter the results.\n */\nexport async function getFungibleAssetMetadata(args: {\n  aptosConfig: AptosConfig;\n  options?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>;\n}): Promise<GetFungibleAssetMetadataResponse> {\n  const { aptosConfig, options } = args;\n\n  const graphqlQuery = {\n    query: GetFungibleAssetMetadata,\n    variables: {\n      where_condition: options?.where,\n      limit: options?.limit,\n      offset: options?.offset,\n    },\n  };\n\n  const data = await queryIndexer<GetFungibleAssetMetadataQuery>({\n    aptosConfig,\n    query: graphqlQuery,\n    originMethod: \"getFungibleAssetMetadata\",\n  });\n\n  return data.fungible_asset_metadata;\n}\n\n/**\n * Retrieves the activities associated with fungible assets.\n * This function allows you to filter and paginate through the activities based on specified conditions.\n *\n * @param args - The arguments for retrieving fungible asset activities.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param [args.options] - Optional parameters for pagination and filtering.\n * @param [args.options.limit] - The maximum number of activities to retrieve.\n * @param [args.options.offset] - The number of activities to skip before starting to collect the result set.\n * @param [args.options.where] - Conditions to filter the activities.\n * @returns A promise that resolves to an array of fungible asset activities.\n */\nexport async function getFungibleAssetActivities(args: {\n  aptosConfig: AptosConfig;\n  options?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>;\n}): Promise<GetFungibleAssetActivitiesResponse> {\n  const { aptosConfig, options } = args;\n\n  const graphqlQuery = {\n    query: GetFungibleAssetActivities,\n    variables: {\n      where_condition: options?.where,\n      limit: options?.limit,\n      offset: options?.offset,\n    },\n  };\n\n  const data = await queryIndexer<GetFungibleAssetActivitiesQuery>({\n    aptosConfig,\n    query: graphqlQuery,\n    originMethod: \"getFungibleAssetActivities\",\n  });\n\n  return data.fungible_asset_activities;\n}\n\n/**\n * Retrieves the current balances of fungible assets for a specified configuration.\n *\n * @param args - The arguments for retrieving fungible asset balances.\n * @param args.aptosConfig - The configuration settings for Aptos.\n * @param args.options - Optional parameters for pagination and filtering.\n * @param args.options.limit - The maximum number of results to return.\n * @param args.options.offset - The number of results to skip before starting to collect the results.\n * @param args.options.where - Conditions to filter the results based on specific criteria.\n * @returns The current balances of fungible assets.\n */\nexport async function getCurrentFungibleAssetBalances(args: {\n  aptosConfig: AptosConfig;\n  options?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n}): Promise<GetCurrentFungibleAssetBalancesResponse> {\n  const { aptosConfig, options } = args;\n\n  const graphqlQuery = {\n    query: GetCurrentFungibleAssetBalances,\n    variables: {\n      where_condition: options?.where,\n      limit: options?.limit,\n      offset: options?.offset,\n    },\n  };\n\n  const data = await queryIndexer<GetCurrentFungibleAssetBalancesQuery>({\n    aptosConfig,\n    query: graphqlQuery,\n    originMethod: \"getCurrentFungibleAssetBalances\",\n  });\n\n  return data.current_fungible_asset_balances;\n}\n\nconst faTransferAbi: EntryFunctionABI = {\n  typeParameters: [{ constraints: [] }],\n  parameters: [parseTypeTag(\"0x1::object::Object\"), new TypeTagAddress(), new TypeTagU64()],\n};\n\n/**\n * Transfers a specified amount of a fungible asset from the sender to the recipient.\n * This function helps facilitate the transfer of digital assets between accounts on the Aptos blockchain.\n *\n * @param args - The parameters for the transfer operation.\n * @param args.aptosConfig - The configuration settings for the Aptos network.\n * @param args.sender - The account initiating the transfer.\n * @param args.fungibleAssetMetadataAddress - The address of the fungible asset's metadata.\n * @param args.recipient - The address of the account receiving the asset.\n * @param args.amount - The amount of the fungible asset to transfer.\n * @param args.options - Optional settings for generating the transaction.\n */\nexport async function transferFungibleAsset(args: {\n  aptosConfig: AptosConfig;\n  sender: Account;\n  fungibleAssetMetadataAddress: AccountAddressInput;\n  recipient: AccountAddressInput;\n  amount: AnyNumber;\n  options?: InputGenerateTransactionOptions;\n}): Promise<SimpleTransaction> {\n  const { aptosConfig, sender, fungibleAssetMetadataAddress, recipient, amount, options } = args;\n  return generateTransaction({\n    aptosConfig,\n    sender: sender.accountAddress,\n    data: {\n      function: \"0x1::primary_fungible_store::transfer\",\n      typeArguments: [\"0x1::fungible_asset::Metadata\"],\n      functionArguments: [fungibleAssetMetadataAddress, recipient, amount],\n      abi: faTransferAbi,\n    },\n    options,\n  });\n}\n"],"mappings":"kOA0DA,eAAsBA,EAAyBC,EAGD,CAC5C,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOC,EACP,UAAW,CACT,gBAAiBF,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAA4C,CAC7D,YAAAJ,EACA,MAAOE,EACP,aAAc,0BAChB,CAAC,GAEW,uBACd,CAcA,eAAsBG,EAA2BN,EAGD,CAC9C,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOI,EACP,UAAW,CACT,gBAAiBL,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAA8C,CAC/D,YAAAJ,EACA,MAAOE,EACP,aAAc,4BAChB,CAAC,GAEW,yBACd,CAaA,eAAsBK,EAAgCR,EAGD,CACnD,GAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAE3BG,EAAe,CACnB,MAAOM,EACP,UAAW,CACT,gBAAiBP,GAAS,MAC1B,MAAOA,GAAS,MAChB,OAAQA,GAAS,MACnB,CACF,EAQA,OANa,MAAMG,EAAmD,CACpE,YAAAJ,EACA,MAAOE,EACP,aAAc,iCAChB,CAAC,GAEW,+BACd,CAEA,IAAMO,EAAkC,CACtC,eAAgB,CAAC,CAAE,YAAa,CAAC,CAAE,CAAC,EACpC,WAAY,CAACC,EAAa,qBAAqB,EAAG,IAAIC,EAAkB,IAAIC,CAAY,CAC1F,EAcA,eAAsBC,EAAsBd,EAOb,CAC7B,GAAM,CAAE,YAAAC,EAAa,OAAAc,EAAQ,6BAAAC,EAA8B,UAAAC,EAAW,OAAAC,EAAQ,QAAAhB,CAAQ,EAAIF,EAC1F,OAAOmB,EAAoB,CACzB,YAAAlB,EACA,OAAQc,EAAO,eACf,KAAM,CACJ,SAAU,wCACV,cAAe,CAAC,+BAA+B,EAC/C,kBAAmB,CAACC,EAA8BC,EAAWC,CAAM,EACnE,IAAKR,CACP,EACA,QAAAR,CACF,CAAC,CACH","names":["getFungibleAssetMetadata","args","aptosConfig","options","graphqlQuery","GetFungibleAssetMetadata","queryIndexer","getFungibleAssetActivities","GetFungibleAssetActivities","getCurrentFungibleAssetBalances","GetCurrentFungibleAssetBalances","faTransferAbi","parseTypeTag","TypeTagAddress","TypeTagU64","transferFungibleAsset","sender","fungibleAssetMetadataAddress","recipient","amount","generateTransaction"]}

Выполнить команду


Для локальной разработки. Не используйте в интернете!