PHP WebShell

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

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

{"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Table } from \"./table\";\nimport { Keyless } from \"./keyless\";\nimport { AptosObject } from \"./object\";\n\n/**\n * The main entry point for interacting with the Aptos APIs,\n * providing access to various functionalities organized into\n * distinct namespaces.\n *\n * To utilize the SDK, instantiate a new Aptos object to gain\n * access to the complete range of SDK features.\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 connecting to the Aptos testnet\n *     const config = new AptosConfig({ network: Network.TESTNET });\n *\n *     // Initialize the Aptos client with the configuration\n *     const aptos = new Aptos(config);\n *\n *     console.log(\"Aptos client initialized:\", aptos);\n * }\n * runExample().catch(console.error);\n * ```\n */\nexport class Aptos {\n  readonly config: AptosConfig;\n\n  readonly account: Account;\n\n  readonly ans: ANS;\n\n  readonly coin: Coin;\n\n  readonly digitalAsset: DigitalAsset;\n\n  readonly event: Event;\n\n  readonly faucet: Faucet;\n\n  readonly fungibleAsset: FungibleAsset;\n\n  readonly general: General;\n\n  readonly staking: Staking;\n\n  readonly transaction: Transaction;\n\n  readonly table: Table;\n\n  readonly keyless: Keyless;\n\n  readonly object: AptosObject;\n\n  /**\n   * Initializes a new instance of the Aptos client with the provided configuration settings.\n   * This allows you to interact with various Aptos functionalities such as accounts, transactions, and events.\n   *\n   * @param settings - Configuration settings for the Aptos client.\n   *\n   * @example\n   * ```typescript\n   * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n   *\n   * async function runExample() {\n   *     // Create a new Aptos client with default settings\n   *     const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own settings if needed\n   *     const aptos = new Aptos(config);\n   *\n   *     console.log(\"Aptos client initialized:\", aptos);\n   * }\n   * runExample().catch(console.error);\n   * ```\n   */\n  constructor(settings?: AptosConfig) {\n    this.config = new AptosConfig(settings);\n    this.account = new Account(this.config);\n    this.ans = new ANS(this.config);\n    this.coin = new Coin(this.config);\n    this.digitalAsset = new DigitalAsset(this.config);\n    this.event = new Event(this.config);\n    this.faucet = new Faucet(this.config);\n    this.fungibleAsset = new FungibleAsset(this.config);\n    this.general = new General(this.config);\n    this.staking = new Staking(this.config);\n    this.transaction = new Transaction(this.config);\n    this.table = new Table(this.config);\n    this.keyless = new Keyless(this.config);\n    this.object = new AptosObject(this.config);\n  }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n  extends Account,\n    ANS,\n    Coin,\n    DigitalAsset,\n    Event,\n    Faucet,\n    FungibleAsset,\n    General,\n    Keyless,\n    Staking,\n    Table,\n    AptosObject,\n    Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n  // Mixin instance methods\n  Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n    const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n    if (!propertyDescriptor) return;\n    // eslint-disable-next-line func-names\n    propertyDescriptor.value = function (...args: any) {\n      return (this as any)[baseClassProp][propertyName](...args);\n    };\n    Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n  });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, Table, \"table\");\napplyMixin(Aptos, Keyless, \"keyless\");\napplyMixin(Aptos, AptosObject, \"object\");\n"],"mappings":"yjBA0CO,IAAMA,EAAN,KAAY,CAiDjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,OAAS,IAAIC,EAAY,KAAK,MAAM,CAC3C,CACF,EA2BA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWhB,EAAOG,EAAS,SAAS,EACpCa,EAAWhB,EAAOI,EAAK,KAAK,EAC5BY,EAAWhB,EAAOK,EAAM,MAAM,EAC9BW,EAAWhB,EAAOM,EAAc,cAAc,EAC9CU,EAAWhB,EAAOO,EAAO,OAAO,EAChCS,EAAWhB,EAAOQ,EAAQ,QAAQ,EAClCQ,EAAWhB,EAAOS,EAAe,eAAe,EAChDO,EAAWhB,EAAOU,EAAS,SAAS,EACpCM,EAAWhB,EAAOW,EAAS,SAAS,EACpCK,EAAWhB,EAAOY,EAAa,aAAa,EAC5CI,EAAWhB,EAAOa,EAAO,OAAO,EAChCG,EAAWhB,EAAOc,EAAS,SAAS,EACpCE,EAAWhB,EAAOe,EAAa,QAAQ","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","Table","Keyless","AptosObject","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}

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


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