PHP WebShell

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

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

{"version":3,"sources":["../../src/api/transactionSubmission/build.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AccountAddressInput } from \"../../core\";\nimport { generateTransaction } from \"../../internal/transactionSubmission\";\nimport { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from \"../../transactions\";\nimport { MultiAgentTransaction } from \"../../transactions/instances/multiAgentTransaction\";\nimport { SimpleTransaction } from \"../../transactions/instances/simpleTransaction\";\nimport { AptosConfig } from \"../aptosConfig\";\n\n/**\n * A class to handle all `Build` transaction operations.\n */\nexport class Build {\n  readonly config: AptosConfig;\n\n  /**\n   * Initializes a new instance of the Aptos client with the specified configuration.\n   * This allows you to interact with the Aptos blockchain using the provided settings.\n   *\n   * @param config - The configuration settings for the Aptos client.\n   * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n   * @param config.nodeUrl - The URL of the Aptos node to connect to.\n   * @param config.account - The account details for authentication.\n   *\n   * @example\n   * ```typescript\n   * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n   *\n   * async function runExample() {\n   *     // Create a configuration for the Aptos client\n   *     const config = new AptosConfig({\n   *         network: Network.TESTNET, // specify the network\n   *         nodeUrl: \"https://testnet.aptos.dev\", // specify the node URL\n   *     });\n   *\n   *     // Initialize the Aptos client\n   *     const aptos = new Aptos(config);\n   *\n   *     console.log(\"Aptos client initialized:\", aptos);\n   * }\n   * runExample().catch(console.error);\n   * ```\n   */\n  constructor(config: AptosConfig) {\n    this.config = config;\n  }\n\n  /**\n   * Build a simple transaction.\n   *\n   * This function allows you to create a transaction with specified sender and data.\n   *\n   * @param args.sender - The sender account address.\n   * @param args.data - The transaction data.\n   * @param args.options - Optional transaction configurations.\n   * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n   *\n   * @returns SimpleTransaction\n   *\n   * @example\n   * ```typescript\n   * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n   *\n   * const config = new AptosConfig({ network: Network.TESTNET });\n   * const aptos = new Aptos(config);\n   *\n   * async function runExample() {\n   *   // Build a simple transaction\n   *   const transaction = await aptos.transaction.simple({\n   *     sender: \"0x1\", // replace with a real sender account address\n   *     data: {\n   *       function: \"0x1::aptos_account::transfer\",\n   *       functionArguments: [\"0x2\", 100], // replace with a real destination account address\n   *     },\n   *     options: {\n   *       gasUnitPrice: 100, // specify your own gas unit price if needed\n   *       maxGasAmount: 1000, // specify your own max gas amount if needed\n   *     },\n   *   });\n   *\n   *   console.log(transaction);\n   * }\n   * runExample().catch(console.error);\n   * ```\n   */\n  async simple(args: {\n    sender: AccountAddressInput;\n    data: InputGenerateTransactionPayloadData;\n    options?: InputGenerateTransactionOptions;\n    withFeePayer?: boolean;\n  }): Promise<SimpleTransaction> {\n    return generateTransaction({ aptosConfig: this.config, ...args });\n  }\n\n  /**\n   * Build a multi-agent transaction that allows multiple signers to authorize a transaction.\n   *\n   * @param args - The parameters for creating the multi-agent transaction.\n   * @param args.sender - The sender account address.\n   * @param args.data - The transaction data.\n   * @param args.secondarySignerAddresses - An array of the secondary signers' account addresses.\n   * @param args.options - Optional transaction configurations.\n   * @param args.withFeePayer - Whether there is a fee payer for the transaction.\n   *\n   * @returns MultiAgentTransaction\n   *\n   * @example\n   * ```typescript\n   * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n   *\n   * const config = new AptosConfig({ network: Network.TESTNET });\n   * const aptos = new Aptos(config);\n   *\n   * async function runExample() {\n   *   // Build a multi-agent transaction\n   *   const transaction = await aptos.multiAgent({\n   *     sender: \"0x1\", // replace with a real sender account address\n   *     data: {\n   *       // Transaction data structure\n   *       function: \"0x1::aptos_account::transfer\",\n   *       functionArguments: [\"0x2\", 100], // replace with a real destination account address and amount\n   *     },\n   *     secondarySignerAddresses: [\"0x3\", \"0x4\"], // replace with real secondary signer addresses\n   *     options: {\n   *       // Optional transaction configurations\n   *       maxGasAmount: \"1000\",\n   *       gasUnitPrice: \"1\",\n   *     },\n   *   });\n   *\n   *   console.log(transaction);\n   * }\n   * runExample().catch(console.error);\n   * ```\n   */\n  async multiAgent(args: {\n    sender: AccountAddressInput;\n    data: InputGenerateTransactionPayloadData;\n    secondarySignerAddresses: AccountAddressInput[];\n    options?: InputGenerateTransactionOptions;\n    withFeePayer?: boolean;\n  }): Promise<MultiAgentTransaction> {\n    return generateTransaction({ aptosConfig: this.config, ...args });\n  }\n}\n"],"mappings":"yCAaO,IAAMA,EAAN,KAAY,CA+BjB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,CAChB,CAwCA,MAAM,OAAOC,EAKkB,CAC7B,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CA2CA,MAAM,WAAWA,EAMkB,CACjC,OAAOC,EAAoB,CAAE,YAAa,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAClE,CACF","names":["Build","config","args","generateTransaction"]}

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


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