@0xobelisk/client 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +757 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +755 -0
- package/dist/index.mjs.map +1 -0
- package/dist/libs/suiAccountManager/crypto.d.ts +1 -0
- package/dist/libs/suiAccountManager/index.d.ts +35 -0
- package/dist/libs/suiAccountManager/keypair.d.ts +21 -0
- package/dist/libs/suiAccountManager/types.d.ts +9 -0
- package/dist/libs/suiAccountManager/util.d.ts +29 -0
- package/dist/libs/suiRpcProvider/defaultChainConfigs.d.ts +8 -0
- package/dist/libs/suiRpcProvider/faucet.d.ts +8 -0
- package/dist/libs/suiRpcProvider/index.d.ts +40 -0
- package/dist/libs/suiRpcProvider/types.d.ts +14 -0
- package/dist/libs/suiTxBuilder/index.d.ts +544 -0
- package/dist/libs/suiTxBuilder/types.d.ts +12 -0
- package/dist/libs/suiTxBuilder/util.d.ts +76 -0
- package/dist/obelisk.d.ts +2857 -0
- package/dist/test/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +11 -0
- package/package.json +152 -0
- package/src/index.ts +10 -0
- package/src/libs/suiAccountManager/crypto.ts +7 -0
- package/src/libs/suiAccountManager/index.ts +72 -0
- package/src/libs/suiAccountManager/keypair.ts +38 -0
- package/src/libs/suiAccountManager/types.ts +10 -0
- package/src/libs/suiAccountManager/util.ts +70 -0
- package/src/libs/suiRpcProvider/defaultChainConfigs.ts +30 -0
- package/src/libs/suiRpcProvider/faucet.ts +57 -0
- package/src/libs/suiRpcProvider/index.ts +114 -0
- package/src/libs/suiRpcProvider/types.ts +17 -0
- package/src/libs/suiTxBuilder/index.ts +245 -0
- package/src/libs/suiTxBuilder/types.ts +32 -0
- package/src/libs/suiTxBuilder/util.ts +84 -0
- package/src/obelisk.ts +297 -0
- package/src/types/index.ts +17 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/globals.global.d.ts","../../node_modules/@types/node/index.d.ts","../../node_modules/dotenv/lib/main.d.ts","../../node_modules/vitest/dist/types-2b1c412e.d.ts","../../node_modules/vitest/dist/config.d.ts","../../node_modules/vitest/dist/index.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/cryptography/publickey.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/cryptography/signature.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/cryptography/keypair.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/ed25519/publickey.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/ed25519/keypair.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/ed25519/index.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/secp256k1/keypair.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/secp256k1/publickey.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/secp256k1/index.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/secp256r1/keypair.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/secp256r1/publickey.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/keypairs/secp256r1/index.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/cryptography/multisig.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/cryptography/mnemonics.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/cryptography/utils.d.ts","../../node_modules/superstruct/dist/error.d.ts","../../node_modules/superstruct/dist/utils.d.ts","../../node_modules/superstruct/dist/struct.d.ts","../../node_modules/superstruct/dist/structs/coercions.d.ts","../../node_modules/superstruct/dist/structs/refinements.d.ts","../../node_modules/superstruct/dist/structs/types.d.ts","../../node_modules/superstruct/dist/structs/utilities.d.ts","../../node_modules/superstruct/dist/index.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/rpc/client.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/events.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/transactions.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/objects.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/sui-bcs.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/common.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/option.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/coin.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/framework/framework.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/faucet.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/normalized.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/validator.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/epochs.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/subscriptions.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/name-service.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/dynamic_fields.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/checkpoints.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/types/index.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/rpc/websocket-client.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/rpc/connection.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/builder/transactions.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/builder/inputs.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/builder/transactionblockdata.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/builder/transactionblock.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/builder/bcs.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/builder/serializer.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/builder/index.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/providers/json-rpc-provider.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/rpc/faucet-client.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/signers/txn-data-serializers/type-tag-serializer.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/signers/signer.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/signers/types.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/signers/signer-with-provider.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/signers/raw-signer.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/utils/format.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/utils/intent.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/utils/verify.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/utils/errors.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/framework/sui-system-state.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/framework/index.d.ts","../../node_modules/@mysten/sui.js/dist/cjs/index.d.ts","../../src/libs/suiaccountmanager/types.ts","../../src/libs/suiaccountmanager/keypair.ts","../../src/libs/suiaccountmanager/util.ts","../../node_modules/@scure/bip39/index.d.ts","../../node_modules/@scure/bip39/wordlists/english.d.ts","../../src/libs/suiaccountmanager/crypto.ts","../../src/libs/suiaccountmanager/index.ts","../../node_modules/ts-retry-promise/dist/retry-promise.d.ts","../../src/libs/suirpcprovider/faucet.ts","../../src/libs/suirpcprovider/types.ts","../../src/libs/suirpcprovider/defaultchainconfigs.ts","../../src/libs/suirpcprovider/index.ts","../../src/libs/suitxbuilder/types.ts","../../src/libs/suitxbuilder/util.ts","../../src/libs/suitxbuilder/index.ts","../../src/types/index.ts","../../src/suikit.ts","../../src/index.ts","../../test/index.spec.ts","../../node_modules/@types/tmp/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"9a60b92bca4c1257db03b349d58e63e4868cfc0d1c8d0ba60c2dbc63f4e6c9f6","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"b7feb7967c6c6003e11f49efa8f5de989484e0a6ba2e5a6c41b55f8b8bd85dba","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"a7534271773a27ff7d136d550e86b41894d8090fa857ba4c02b5bb18d2eb1c8e","affectsGlobalScope":true},"db71be322f07f769200108aa19b79a75dd19a187c9dca2a30c4537b233aa2863","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","b8e431e9b9bb2dc832b23d4e3e02774e953d5537998923f215ea446169e9a61e","3690133deae19c8127c5505fcb67b04bdc9eb053796008538a9b9abbb70d85aa","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"b85c02e14ecb2a873dad5a1de72319b265160ba48f1b83661aeb3bba1366c1bc","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","fc3764040518a1008dd04bdc80964591b566b896283e00df85c95851c1f46237","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","790623a47c5eda62910098884ecb154dc0e5f3a23fc36c1bfb3b5b9ed44e2c2d","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"125af9d85cb9d5e508353f10a8d52f01652d2d48b2cea54789a33e5b4d289c1c","affectsGlobalScope":true},"f5490f53d40291cc8607f5463434d1ac6c5564bc4fbb03abceb03a8f6b014457","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"14a50dafe3f45713f7f27cb6320dff07c6ac31678f07959c2134260061bf91ff","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","0cab4d7d4edc40cd3af9eea7c3ed6d1016910c0954c49c4297e479bf3822a625","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270",{"version":"ba437529769c1d4766a8a6d5a304f46fbb4f5f1716f23f4cbf20b7a4fd82d8ba","affectsGlobalScope":true},{"version":"ab294c4b7279318ee2a8fdf681305457ecc05970c94108d304933f18823eeac1","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","bbda6ea452a2386093a1eda18a6e26a989e98869f1b9f37e46f510a986d2e740","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"75dd741ca6a6c8d2437a6ca8349b64b816421dbf9fe82dd026afaba965576962","affectsGlobalScope":true},{"version":"8799401a7ab57764f0d464513a7fa7c72e1d70a226b172ec60fff534ea94d108","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"247aa3419c98713231952b33801d4f46563fe542e03604acd8c63ac45a32409c","082fd595b601cead92b1aada1b38b23174ef0eee4b853fa37765f71e5d709236","4a2798997b873de3407090693f238bf993d4e6084f0cd104c0c70395c5dcbf1b","2de6c96fad4bb4e68240088848e45f7ed6227f2a12337eae76201c0d780a316a","0d701fd5341e0d3ee1a0920099962cc0f3ae8940388539c76d49cfa829fdf79e","fdf443274d1e0199b892dd938723784b7f499b395a50132c5ac9a04b0bd353d2","68265f77e958640f95a7115174349d84f5446eb36e3406e4696b82ddccefbb24","3368b09f8b410ade24fefd120a59df61c520a41d580b0afa2b33c8f2f4461ae0","9fdcefd27ef1d1fb1895b9ec77c8ba9953b6d1c9986887f1a4376341b1db280c","08e73912de89cccfbaf16870f41e091a0ebc35b86a1fa47a3136fb5bc53d0036","04f414530fe3c5b1c0fc42d5f7838c3ba2fed4a89db9859097e811ed9faccfb4","67fc3f4d5bc6fb1a194a5785a6a8cb0cce1afbdda730087b8694ecdcc7d07a87","89cc418ee20c7518305a62dc387bdd4e953488ec998627be53107cfb3e56a5d3","04f414530fe3c5b1c0fc42d5f7838c3ba2fed4a89db9859097e811ed9faccfb4","0887e08a60896c19277e5788a1b5a0a956c09c5266c30773faaca469810b1153","e950aeaa7295420b3c3d689056367ecec9e9ba02fe738bfaa3023cff877b6a2d","04f414530fe3c5b1c0fc42d5f7838c3ba2fed4a89db9859097e811ed9faccfb4","5eda023907b229e5e2a667eda49d45d11ad111d80a46c367ab37785c0b76b154","eb3671ec7a51c0e20962ba24be3fd7a41919455739c123e774d5dd5f125eec25","b2c9522850b219660ccba6fcac09f7c430efdcc8877938c27d0639758d21c2f8","5041d1e151f77eb97f762c51fade8d268f271de2f8b165b050e7caa4b7f8c4bd","0296071bdd869379505de371c04065cc68ddfb9564d6b75cda2373b0130bf57f","00cac821c5c6466146321dc8192f48c84d9f7c321f862b9a4a01a6a832ce6a2f","c6eff85f66b05eba0a5af516cfa2e7ce0c6d2a2cc71bc4c543915c823cea9ce8","434272013d17121b677ec280c2309b16442cd47060af926d1deba5a00fa26856","b55144428bf4cdc9d7f5027035b45e165feb6064538a06339aa3d7186aead0fb","0c7192e40da80243d167d93fd23c11d2efba22dc27fda3602d99889ed02ade86","0706139fea91b191554d605cc00192d295832707c54782c14b2e770f84786576","ad122ad90df2949434fb9c26d04f564ffdda0ee6944282c1994a6c1bbb190d0e","8f251f3ae1a87f8d7c23032a61dd35f00abc5d12e927cd449687ed638aada596","99863d49b64b302b19aaeb626219dbfc1acfd89648dbadbb74d2464137294ee0","eef89dee7db39634ad0ab854675769673c01fe842b608eed53e708947040ea25","da1119696f880c6990fe57f2436ef619092cdc9de0bcae7c89482d16ad55a2fb","9844c383deb0f271be7ef35b2cb6da58d0928527117d7330f48c17725b21c782","d793401cb103180e52a1f221880011925341bbcb24922a9f232bbbca693c6ade","a112b16047dd36a16a657c00a3a3cdc56108ee00299844a6ee40f86765ffcdb6","042da3dfd5bce902cf003715c159bb81ff4a813ee59e09e4cf7f6bb22b5ad56d","2bc9de1a7c15d979aa446fcd7b9d3ac2e5e334cb258eea967e9799f8dc1450d4","5ff1b3636ae0de44cbef0e0005a72f4bf8206961eb1d3dd9884ac48e05bd86b3","7118c06c9882a7908d6d6ba88ff718250a80de78848342f5b6e1df6ce8e3e210","b4cf8e0713b89cb77a8b558ac786dbc8a291ea16f7f13d89f0c7b0b7b432340e","1fb28cf903ebe44e58c88dcf95cb4d8210ad594720dc49a7fe4dbb38d1dbecdf","df7cc5ada8774718584d19175d883d128124c3bcf3f6d3373dcef88973a1134c","d94d39c591dc2b5f0a85ab1a5b995758ff16cd0fc168dfbc6863f87615ebbccf","90776ca077decd2d9bcb15ff7c232087af4a551a423f23cf3ab946a4153b96e7","859932b119afc62c445e5ddf5c338267043e0ce2dc287e59b079120b36f01f07","621b618c238598ee08f67c2a40d3f9cfd88caa1f6b33a0478046fd8fc2590a41","2a8c99baa54a9638532ded21dda7aada5e9d33494fb775f667ad05d95f22a294","1b91c731a216af73fd9872719140195f94c6a782c9f55a373da13779968902da","8a1ac036b1fd5470e3dab5bcfe7c403916cd0b59d6676319152d948b47911bd1","4d1c3592eca29bfed129fd18c939790b879ceaa0e72a4f04c7993e155072aa79","21e17d1caec65874668dacdafba78f9e22653ec42452b04e791a126e960caf0b","74659c4bc2ef27c3579b9c33ef5df6495080884d92f7478e86b32826254af5b9","2279d26d44311ec9f472f3c693edc18a779b9a9a88686976172f6e4e9a9a1e20","7b319daed069a285bd1895a37df54aa229fdffbe803cbbef9bf932a9400fb738","a7f0ebb6608dac081fbd56284c2925aeb0f14a133077b1d961abba9f3d7ac63c","41992537f3e6c6b447f7ad9c71dbbb9468f987b926a020805c1a0a799caab6d2","5f410d5ff221d20f5a4de024f86ea1cfc28f77e77e531031eecbd58b02574c1a","b1cbe101475fe68a86e185e828679d8fa515813895cb08cd795000db62d4d29f","3c34c5913a870c0378425583361d4e2c2c1dcec034fb6810574b35c5198594ba","63f31793a7d80712c526c2c07ababf31537045136e20243402060e7a319a5d83","19d1e67c53f69fd826c0955251ff53193b66c24ed874ee95aeddd6c5aad312ad","ddc8c232a5b14c7cb91899a5c5fc74b798a441de0d6816eca6ef622f4100460c","8f6ddad1b0e9fb2fb1ae0e95d0f51b38bbd79df0105ffeff95af235a21d94dbb","c55768dbb7d5d3c0260a71889cc3fb6ec356fa6914ad2bdad984b0bf991bf41d","ddd8a0a7ee205857cf1867a64852a468645f44d79f166e09eee3ac801738214a","0228d6519a2562acad1fd12747e74e1ba1ea06c736a73afaa0e10e9b47aad203","ae3748ea86d4031ba4fbd33911ef100db9682ebd4ed61a7c77c65e0d5c196382","978219244a636a889d6ea66298b2f6f091bbbf30ccb5231d1d591bc11e445934","edf1244a35c115c0b502944ea86d0a8ba3d8a25eede3d85c678af4b78960bf95","d9a6608c1fd216d065e59069ba605c5f711cd66fd475584482d9d40e0add7fd7","ee8d1881b69f1ca504751399bafd9d5aa72b5270c58963c21bf43fd15c110232","e2bf27dbed14335aaeccc1d6740e6be997af9a0fa3eec82db409d2b63d73a517","6a1197b37f8f406bfb74528ca1fb90659c6d1a251d472b1c65affb5c6a6ba5f8","7cdbf15a9d691fcac442b145d8e842f47e73c89b32e84772ed65e7fe5395dd2e","f8fba12774ea29ecefa066755f96420f77174a45dca7cec2a12eb7f2eb6ab8b8","5a81e19c1c83744fd65d8ca71c50dbac46c05c03824c274ad436249bcc6a3ec1","2e4767bcecf6d84b8e35567e86003665c32b6291901f340a0486bf7c9f778153","db33202aef862e7b43bb6e871b0245fae11474444162f387a218c2d987026341","eb6dc9007288470167255aa1c5179796ef8775dadb2ab55dcf92d08cbe873af9","f1c93a09eb1d0d1dfad415369d3748467bd47187b358c95415dc4c74b5e466e0","865a75c669e55d389b3011a4e63c908fefd8165b91c56ff397b0e4322d28b950","85c80f2206800eb99bfa097143ec663bf211d487b232c21e60f5d66108182342","06a7cbc02fcd33acd4196db53beaddbdb7b8f18d1099bbd5032890ef89fff5ad","dd251f55da949dced0dc3a18a06730ac0e8815a112c637705f8e2047ea5d6992","d43742143303a98dbf76267d087731faf87a147e3a6666fbc0dde1110e0d7ab6","b8d2ec3abba273e56a70ba3c85dbd9382792f89287d3314bdd6ab54bbdddc1cb","598ddaf6797e4e9090be7371a8fc395fa02e6f82e5b7d1848dfc45ab6ce82656","6061aa83817c30d3a590f037b3cba22cdd809fbe697926d6511b45147928a342"],"root":[[184,186],189,190,[192,202]],"options":{"declaration":true,"downlevelIteration":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":1,"outDir":"..","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7},"fileIdsList":[[108],[108,163,164,166,167,168],[108,142,160],[108,160],[108,147,160,163,164,165,170],[108,142,163],[108,142,148],[108,120,121],[108,120],[108,120,121,122],[108,142,146,147,148,149,150],[108,151,181],[108,160,169,170],[108,120,121,122,125,128,131,132,133,134,142,143,160,161,162,169,170,171,172,173,174,175,176,177,178,179,180,182],[108,123,124],[108,121,122,123],[108,126,127],[108,129,130],[108,121,143,155,158,159,160,161,162,169],[108,142],[108,143,160],[108,121,122,160,170,175],[108,121,143,160,169,170,173,174],[108,121],[108,142,147],[108,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159],[108,142,145,148],[108,146],[108,142,144,146,148],[108,121,178],[62,108],[65,108],[66,71,99,108],[67,78,79,86,96,107,108],[67,68,78,86,108],[69,108],[70,71,79,87,108],[71,96,104,108],[72,74,78,86,108],[73,108],[74,75,108],[78,108],[76,78,108],[78,79,80,96,107,108],[78,79,80,93,96,99,108],[108,112],[74,78,81,86,96,107,108],[78,79,81,82,86,96,104,107,108],[81,83,96,104,107,108],[62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114],[78,84,108],[85,107,108],[74,78,86,96,108],[87,108],[88,108],[65,89,108],[90,106,108,112],[91,108],[92,108],[78,93,94,108],[93,95,108,110],[66,78,96,97,98,99,108],[66,96,98,108],[96,97,108],[99,108],[100,108],[96,108],[78,102,103,108],[102,103,108],[71,86,96,104,108],[105,108],[86,106,108],[66,81,92,107,108],[71,108],[96,108,109],[108,110],[108,111],[66,71,78,80,89,96,107,108,110,112],[96,108,113],[107,108,115],[108,135,137,138,139,140,141],[108,135,136],[108,137],[108,136,137],[108,135,137],[79,108,112,117],[79,108,112,117,118],[79,108,112],[108,183,190,195,198,199,200],[108,187,188],[108,183,184,185,186,189],[108,183,184],[108,183],[108,183,193],[108,183,191],[108,183,192,193,194],[108,183,196,197],[108,183,196],[108,183,190,195,198,199],[108,184,193,196],[108,116,119,201]],"referencedMap":[[60,1],[61,1],[12,1],[13,1],[15,1],[14,1],[2,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[23,1],[3,1],[4,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[58,1],[10,1],[1,1],[11,1],[59,1],[167,1],[169,2],[164,3],[168,4],[166,5],[165,6],[163,7],[122,8],[133,1],[132,8],[120,1],[121,9],[134,10],[151,11],[182,12],[181,13],[183,14],[125,15],[124,16],[123,9],[128,17],[126,10],[127,9],[131,18],[129,10],[130,9],[170,19],[143,20],[162,1],[171,21],[161,1],[176,22],[175,23],[173,24],[172,4],[174,24],[159,20],[150,20],[148,25],[158,20],[155,20],[144,7],[152,20],[160,26],[157,20],[153,20],[146,27],[149,1],[156,20],[147,28],[145,29],[154,20],[180,1],[177,1],[178,1],[179,30],[187,1],[188,1],[62,31],[63,31],[65,32],[66,33],[67,34],[68,35],[69,36],[70,37],[71,38],[72,39],[73,40],[74,41],[75,41],[77,42],[76,43],[78,42],[79,44],[80,45],[64,46],[114,1],[81,47],[82,48],[83,49],[115,50],[84,51],[85,52],[86,53],[87,54],[88,55],[89,56],[90,57],[91,58],[92,59],[93,60],[94,60],[95,61],[96,62],[98,63],[97,64],[99,65],[100,66],[101,67],[102,68],[103,69],[104,70],[105,71],[106,72],[107,73],[108,74],[109,75],[110,76],[111,77],[112,78],[113,79],[203,1],[116,80],[135,1],[142,81],[137,82],[138,83],[139,83],[140,84],[141,84],[136,85],[191,1],[118,86],[119,87],[117,88],[201,89],[189,90],[190,91],[185,92],[184,1],[186,93],[194,94],[192,95],[195,96],[193,93],[198,97],[196,93],[197,98],[200,99],[199,100],[202,101]],"exportedModulesMap":[[60,1],[61,1],[12,1],[13,1],[15,1],[14,1],[2,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[23,1],[3,1],[4,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[58,1],[10,1],[1,1],[11,1],[59,1],[167,1],[169,2],[164,3],[168,4],[166,5],[165,6],[163,7],[122,8],[133,1],[132,8],[120,1],[121,9],[134,10],[151,11],[182,12],[181,13],[183,14],[125,15],[124,16],[123,9],[128,17],[126,10],[127,9],[131,18],[129,10],[130,9],[170,19],[143,20],[162,1],[171,21],[161,1],[176,22],[175,23],[173,24],[172,4],[174,24],[159,20],[150,20],[148,25],[158,20],[155,20],[144,7],[152,20],[160,26],[157,20],[153,20],[146,27],[149,1],[156,20],[147,28],[145,29],[154,20],[180,1],[177,1],[178,1],[179,30],[187,1],[188,1],[62,31],[63,31],[65,32],[66,33],[67,34],[68,35],[69,36],[70,37],[71,38],[72,39],[73,40],[74,41],[75,41],[77,42],[76,43],[78,42],[79,44],[80,45],[64,46],[114,1],[81,47],[82,48],[83,49],[115,50],[84,51],[85,52],[86,53],[87,54],[88,55],[89,56],[90,57],[91,58],[92,59],[93,60],[94,60],[95,61],[96,62],[98,63],[97,64],[99,65],[100,66],[101,67],[102,68],[103,69],[104,70],[105,71],[106,72],[107,73],[108,74],[109,75],[110,76],[111,77],[112,78],[113,79],[203,1],[116,80],[135,1],[142,81],[137,82],[138,83],[139,83],[140,84],[141,84],[136,85],[191,1],[118,86],[119,87],[117,88],[201,89],[189,90],[190,91],[185,92],[184,1],[186,93],[194,94],[192,95],[195,96],[193,93],[198,97],[196,93],[197,98],[200,99],[199,100],[202,101]],"semanticDiagnosticsPerFile":[60,61,12,13,15,14,2,16,17,18,19,20,21,22,23,3,4,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,58,10,1,11,59,167,169,164,168,166,165,163,122,133,132,120,121,134,151,182,181,183,125,124,123,128,126,127,131,129,130,170,143,162,171,161,176,175,173,172,174,159,150,148,158,155,144,152,160,157,153,146,149,156,147,145,154,180,177,178,179,187,188,62,63,65,66,67,68,69,70,71,72,73,74,75,77,76,78,79,80,64,114,81,82,83,115,84,85,86,87,88,89,90,91,92,93,94,95,96,98,97,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,203,116,135,142,137,138,139,140,141,136,191,118,119,117,201,189,190,185,184,186,194,192,195,193,198,196,197,200,199,202],"affectedFilesPendingEmit":[201,189,190,185,184,186,194,192,195,193,198,196,197,200,199,202]},"version":"5.0.4"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NetworkType as SuiNetworkType } from '../libs/suiRpcProvider/types';
|
|
2
|
+
export type { DerivePathParams } from '../libs/suiAccountManager/types';
|
|
3
|
+
export type { SuiTxArg, SuiVecTxArg, SuiObjectArg, } from '../libs/suiTxBuilder/types';
|
|
4
|
+
export type NetworkType = SuiNetworkType;
|
|
5
|
+
export type SuiKitParams = {
|
|
6
|
+
mnemonics?: string;
|
|
7
|
+
secretKey?: string;
|
|
8
|
+
fullnodeUrl?: string;
|
|
9
|
+
faucetUrl?: string;
|
|
10
|
+
networkType?: NetworkType;
|
|
11
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@0xobelisk/client",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Tookit for interacting with move eps framework",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sui",
|
|
7
|
+
"obelisk labs",
|
|
8
|
+
"move",
|
|
9
|
+
"blockchain"
|
|
10
|
+
],
|
|
11
|
+
"author": "team@obelisk.build",
|
|
12
|
+
"homepage": "https://github.com/0xobelisk/obelisk-engine/tree/main/package/@0xobelisk/client#readme",
|
|
13
|
+
"bugs": "https://github.com/0xobelisk/obelisk-engine/issues",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/0xobelisk/obelisk-engine.git"
|
|
17
|
+
},
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=18"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"module": "./dist/index.mjs",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"source": "./src/index.ts",
|
|
31
|
+
"import": "./dist/index.mjs",
|
|
32
|
+
"require": "./dist/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"src"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
41
|
+
"build": "npm run build:types && npm run build:tsup",
|
|
42
|
+
"build:tsup": "tsup ./src/index.ts --format esm,cjs --sourcemap",
|
|
43
|
+
"build:types": "tsc --build",
|
|
44
|
+
"watch:tsup": "tsup ./src/index.ts --format esm,cjs --clean --splitting --watch",
|
|
45
|
+
"watch:types": "tsc --watch",
|
|
46
|
+
"watch": "pnpm run clean & pnpm run watch:types & pnpm run watch:tsup",
|
|
47
|
+
"test": "pnpm test:typecheck && pnpm test:unit",
|
|
48
|
+
"test:typecheck": "tsc -p ./test",
|
|
49
|
+
"test:unit": "vitest run --test-timeout=60000",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"format:fix": "prettier --ignore-path 'dist/* docs/*' --write '**/*.{ts,json,md}'",
|
|
52
|
+
"lint:fix": "eslint . --ignore-pattern dist --ext .ts --fix",
|
|
53
|
+
"prepare": "husky install",
|
|
54
|
+
"commit": "commit",
|
|
55
|
+
"doc": "typedoc --out docs src/index.ts"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@mysten/sui.js": "^0.37.1",
|
|
59
|
+
"@scure/bip39": "^1.2.1",
|
|
60
|
+
"assert": "^2.0.0",
|
|
61
|
+
"colorts": "^0.1.63",
|
|
62
|
+
"superstruct": "^1.0.3",
|
|
63
|
+
"tmp": "^0.2.1",
|
|
64
|
+
"ts-retry-promise": "^0.7.0"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@mysten/sui.js": "^0.37.1"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@commitlint/cli": "^17.6.6",
|
|
71
|
+
"@commitlint/config-conventional": "^17.6.6",
|
|
72
|
+
"@commitlint/prompt-cli": "^17.6.6",
|
|
73
|
+
"@types/node": "^20.3.2",
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
75
|
+
"@typescript-eslint/parser": "^5.60.1",
|
|
76
|
+
"@types/tmp": "^0.2.3",
|
|
77
|
+
"dotenv": "^16.3.1",
|
|
78
|
+
"eslint": "^8.43.0",
|
|
79
|
+
"eslint-config-prettier": "^8.8.0",
|
|
80
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
81
|
+
"husky": "^8.0.3",
|
|
82
|
+
"lint-staged": "^13.2.3",
|
|
83
|
+
"prettier": "^2.8.8",
|
|
84
|
+
"tsconfig-paths": "^4.2.0",
|
|
85
|
+
"ts-node": "^10.9.1",
|
|
86
|
+
"tsup": "^7.1.0",
|
|
87
|
+
"typedoc": "^0.24.8",
|
|
88
|
+
"typescript": "^5.0.4",
|
|
89
|
+
"vitest": "^0.32.2"
|
|
90
|
+
},
|
|
91
|
+
"lint-staged": {
|
|
92
|
+
"**/*.ts": [
|
|
93
|
+
"pnpm run format:fix",
|
|
94
|
+
"pnpm run lint:fix"
|
|
95
|
+
],
|
|
96
|
+
"**/*.json|md": [
|
|
97
|
+
"pnpm run format:fix"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"husky": {
|
|
101
|
+
"hooks": {
|
|
102
|
+
"pre-commit": "lint-staged"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"commitlint": {
|
|
106
|
+
"extends": [
|
|
107
|
+
"@commitlint/config-conventional"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"prettier": {
|
|
111
|
+
"trailingComma": "es5",
|
|
112
|
+
"tabWidth": 2,
|
|
113
|
+
"semi": true,
|
|
114
|
+
"singleQuote": true,
|
|
115
|
+
"useTabs": false,
|
|
116
|
+
"quoteProps": "as-needed",
|
|
117
|
+
"bracketSpacing": true,
|
|
118
|
+
"arrowParens": "always",
|
|
119
|
+
"endOfLine": "lf"
|
|
120
|
+
},
|
|
121
|
+
"eslintConfig": {
|
|
122
|
+
"root": true,
|
|
123
|
+
"env": {
|
|
124
|
+
"browser": true,
|
|
125
|
+
"node": true,
|
|
126
|
+
"es2022": true
|
|
127
|
+
},
|
|
128
|
+
"extends": [
|
|
129
|
+
"eslint:recommended",
|
|
130
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
131
|
+
"plugin:prettier/recommended"
|
|
132
|
+
],
|
|
133
|
+
"plugins": [
|
|
134
|
+
"@typescript-eslint",
|
|
135
|
+
"prettier"
|
|
136
|
+
],
|
|
137
|
+
"parser": "@typescript-eslint/parser",
|
|
138
|
+
"rules": {
|
|
139
|
+
"prettier/prettier": "warn",
|
|
140
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
141
|
+
"no-unused-vars": "off",
|
|
142
|
+
"@typescript-eslint/no-unused-vars": [
|
|
143
|
+
"error",
|
|
144
|
+
{
|
|
145
|
+
"argsIgnorePattern": "^_",
|
|
146
|
+
"varsIgnorePattern": "^_",
|
|
147
|
+
"caughtErrorsIgnorePattern": "^_"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export {
|
|
2
|
+
TransactionBlock,
|
|
3
|
+
SUI_CLOCK_OBJECT_ID,
|
|
4
|
+
SUI_SYSTEM_STATE_OBJECT_ID,
|
|
5
|
+
} from '@mysten/sui.js';
|
|
6
|
+
export { Obelisk } from './obelisk';
|
|
7
|
+
export { SuiAccountManager } from './libs/suiAccountManager';
|
|
8
|
+
export { SuiTxBlock } from './libs/suiTxBuilder';
|
|
9
|
+
export { SuiRpcProvider } from './libs/suiRpcProvider';
|
|
10
|
+
export type * from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { generateMnemonic as genMnemonic } from '@scure/bip39';
|
|
2
|
+
import { wordlist } from '@scure/bip39/wordlists/english';
|
|
3
|
+
|
|
4
|
+
export const generateMnemonic = (numberOfWords: 12 | 24 = 24) => {
|
|
5
|
+
const strength = numberOfWords === 12 ? 128 : 256;
|
|
6
|
+
return genMnemonic(wordlist, strength);
|
|
7
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Ed25519Keypair } from '@mysten/sui.js';
|
|
2
|
+
import { getKeyPair } from './keypair';
|
|
3
|
+
import { hexOrBase64ToUint8Array, normalizePrivateKey } from './util';
|
|
4
|
+
import { generateMnemonic } from './crypto';
|
|
5
|
+
import type { AccountMangerParams, DerivePathParams } from './types';
|
|
6
|
+
|
|
7
|
+
export class SuiAccountManager {
|
|
8
|
+
private mnemonics: string;
|
|
9
|
+
private secretKey: string;
|
|
10
|
+
public currentKeyPair: Ed25519Keypair;
|
|
11
|
+
public currentAddress: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Support the following ways to init the SuiToolkit:
|
|
15
|
+
* 1. mnemonics
|
|
16
|
+
* 2. secretKey (base64 or hex)
|
|
17
|
+
* If none of them is provided, will generate a random mnemonics with 24 words.
|
|
18
|
+
*
|
|
19
|
+
* @param mnemonics, 12 or 24 mnemonics words, separated by space
|
|
20
|
+
* @param secretKey, base64 or hex string, when mnemonics is provided, secretKey will be ignored
|
|
21
|
+
*/
|
|
22
|
+
constructor({ mnemonics, secretKey }: AccountMangerParams = {}) {
|
|
23
|
+
// If the mnemonics or secretKey is provided, use it
|
|
24
|
+
// Otherwise, generate a random mnemonics with 24 words
|
|
25
|
+
this.mnemonics = mnemonics || '';
|
|
26
|
+
this.secretKey = secretKey || '';
|
|
27
|
+
if (!this.mnemonics && !this.secretKey) {
|
|
28
|
+
this.mnemonics = generateMnemonic(24);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Init the current account
|
|
32
|
+
this.currentKeyPair = this.secretKey
|
|
33
|
+
? Ed25519Keypair.fromSecretKey(
|
|
34
|
+
normalizePrivateKey(hexOrBase64ToUint8Array(this.secretKey))
|
|
35
|
+
)
|
|
36
|
+
: getKeyPair(this.mnemonics);
|
|
37
|
+
this.currentAddress = this.currentKeyPair.getPublicKey().toSuiAddress();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* if derivePathParams is not provided or mnemonics is empty, it will return the currentKeyPair.
|
|
42
|
+
* else:
|
|
43
|
+
* it will generate keyPair from the mnemonic with the given derivePathParams.
|
|
44
|
+
*/
|
|
45
|
+
getKeyPair(derivePathParams?: DerivePathParams) {
|
|
46
|
+
if (!derivePathParams || !this.mnemonics) return this.currentKeyPair;
|
|
47
|
+
return getKeyPair(this.mnemonics, derivePathParams);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* if derivePathParams is not provided or mnemonics is empty, it will return the currentAddress.
|
|
52
|
+
* else:
|
|
53
|
+
* it will generate address from the mnemonic with the given derivePathParams.
|
|
54
|
+
*/
|
|
55
|
+
getAddress(derivePathParams?: DerivePathParams) {
|
|
56
|
+
if (!derivePathParams || !this.mnemonics) return this.currentAddress;
|
|
57
|
+
return getKeyPair(this.mnemonics, derivePathParams)
|
|
58
|
+
.getPublicKey()
|
|
59
|
+
.toSuiAddress();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Switch the current account with the given derivePathParams.
|
|
64
|
+
* This is only useful when the mnemonics is provided. For secretKey mode, it will always use the same account.
|
|
65
|
+
*/
|
|
66
|
+
switchAccount(derivePathParams: DerivePathParams) {
|
|
67
|
+
if (this.mnemonics) {
|
|
68
|
+
this.currentKeyPair = getKeyPair(this.mnemonics, derivePathParams);
|
|
69
|
+
this.currentAddress = this.currentKeyPair.getPublicKey().toSuiAddress();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Ed25519Keypair } from '@mysten/sui.js';
|
|
2
|
+
import type { DerivePathParams } from './types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description Get ed25519 derive path for SUI
|
|
6
|
+
* @param derivePathParams
|
|
7
|
+
*/
|
|
8
|
+
export const getDerivePathForSUI = (
|
|
9
|
+
derivePathParams: DerivePathParams = {}
|
|
10
|
+
) => {
|
|
11
|
+
const {
|
|
12
|
+
accountIndex = 0,
|
|
13
|
+
isExternal = false,
|
|
14
|
+
addressIndex = 0,
|
|
15
|
+
} = derivePathParams;
|
|
16
|
+
return `m/44'/784'/${accountIndex}'/${isExternal ? 1 : 0}'/${addressIndex}'`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* the format is m/44'/784'/accountIndex'/${isExternal ? 1 : 0}'/addressIndex'
|
|
21
|
+
*
|
|
22
|
+
* accountIndex is the index of the account, default is 0.
|
|
23
|
+
*
|
|
24
|
+
* isExternal is the type of the address, default is false. Usually, the external address is used to receive coins. The internal address is used to change coins.
|
|
25
|
+
*
|
|
26
|
+
* addressIndex is the index of the address, default is 0. It's used to generate multiple addresses for one account.
|
|
27
|
+
*
|
|
28
|
+
* @description Get keypair from mnemonics and derive path
|
|
29
|
+
* @param mnemonics
|
|
30
|
+
* @param derivePathParams
|
|
31
|
+
*/
|
|
32
|
+
export const getKeyPair = (
|
|
33
|
+
mnemonics: string,
|
|
34
|
+
derivePathParams: DerivePathParams = {}
|
|
35
|
+
) => {
|
|
36
|
+
const derivePath = getDerivePathForSUI(derivePathParams);
|
|
37
|
+
return Ed25519Keypair.deriveKeypair(mnemonics, derivePath);
|
|
38
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { fromB64 } from '@mysten/sui.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description This regular expression matches any string that contains only hexadecimal digits (0-9, A-F, a-f).
|
|
5
|
+
* @param str
|
|
6
|
+
*/
|
|
7
|
+
export const isHex = (str: string) =>
|
|
8
|
+
/^0x[0-9a-fA-F]+$|^[0-9a-fA-F]+$/.test(str);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @description This regular expression matches any string that contains only base64 digits (0-9, A-Z, a-z, +, /, =).
|
|
12
|
+
* Note that the "=" signs at the end are optional padding characters that may be present in some base64 encoded strings.
|
|
13
|
+
* @param str
|
|
14
|
+
*/
|
|
15
|
+
export const isBase64 = (str: string) => /^[a-zA-Z0-9+/]+={0,2}$/g.test(str);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Convert a hex string to Uint8Array
|
|
19
|
+
* @param hexStr
|
|
20
|
+
*/
|
|
21
|
+
export const fromHEX = (hexStr: string): Uint8Array => {
|
|
22
|
+
if (!hexStr) {
|
|
23
|
+
throw new Error('cannot parse empty string to Uint8Array');
|
|
24
|
+
}
|
|
25
|
+
const intArr = hexStr
|
|
26
|
+
.replace('0x', '')
|
|
27
|
+
.match(/.{1,2}/g)
|
|
28
|
+
?.map((byte) => parseInt(byte, 16));
|
|
29
|
+
|
|
30
|
+
if (!intArr || intArr.length === 0) {
|
|
31
|
+
throw new Error(`Unable to parse HEX: ${hexStr}`);
|
|
32
|
+
}
|
|
33
|
+
return Uint8Array.from(intArr);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @description Convert a hex or base64 string to Uint8Array
|
|
38
|
+
*/
|
|
39
|
+
export const hexOrBase64ToUint8Array = (str: string): Uint8Array => {
|
|
40
|
+
if (isHex(str)) {
|
|
41
|
+
return fromHEX(str);
|
|
42
|
+
} else if (isBase64(str)) {
|
|
43
|
+
return fromB64(str);
|
|
44
|
+
} else {
|
|
45
|
+
throw new Error('The string is not a valid hex or base64 string.');
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const PRIVATE_KEY_SIZE = 32;
|
|
50
|
+
const LEGACY_PRIVATE_KEY_SIZE = 64;
|
|
51
|
+
/**
|
|
52
|
+
* normalize a private key
|
|
53
|
+
* A private key is a 32-byte array.
|
|
54
|
+
* But there are two different formats for private keys:
|
|
55
|
+
* 1. A 32-byte array
|
|
56
|
+
* 2. A 64-byte array with the first 32 bytes being the private key and the last 32 bytes being the public key
|
|
57
|
+
* 3. A 33-byte array with the first byte being 0x00 (sui.keystore key is a Base64 string with scheme flag 0x00 at the beginning)
|
|
58
|
+
*/
|
|
59
|
+
export const normalizePrivateKey = (key: Uint8Array): Uint8Array => {
|
|
60
|
+
if (key.length === LEGACY_PRIVATE_KEY_SIZE) {
|
|
61
|
+
// This is a legacy secret key, we need to strip the public key bytes and only read the first 32 bytes
|
|
62
|
+
key = key.slice(0, PRIVATE_KEY_SIZE);
|
|
63
|
+
} else if (key.length === PRIVATE_KEY_SIZE + 1 && key[0] === 0) {
|
|
64
|
+
// sui.keystore key is a Base64 string with scheme flag 0x00 at the beginning
|
|
65
|
+
return key.slice(1);
|
|
66
|
+
} else if (key.length === PRIVATE_KEY_SIZE) {
|
|
67
|
+
return key;
|
|
68
|
+
}
|
|
69
|
+
throw new Error('invalid secret key');
|
|
70
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
localnetConnection,
|
|
3
|
+
devnetConnection,
|
|
4
|
+
testnetConnection,
|
|
5
|
+
mainnetConnection,
|
|
6
|
+
} from '@mysten/sui.js';
|
|
7
|
+
import type { Connection } from '@mysten/sui.js';
|
|
8
|
+
import type { NetworkType } from './types';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @description Get the default fullnode url and faucet url for the given network type
|
|
12
|
+
* @param networkType, 'testnet' | 'mainnet' | 'devnet' | 'localnet', default is 'devnet'
|
|
13
|
+
* @returns { fullNode: string, websocket: string, faucet?: string }
|
|
14
|
+
*/
|
|
15
|
+
export const getDefaultNetworkParams = (
|
|
16
|
+
networkType: NetworkType = 'devnet'
|
|
17
|
+
): Connection => {
|
|
18
|
+
switch (networkType) {
|
|
19
|
+
case 'localnet':
|
|
20
|
+
return localnetConnection;
|
|
21
|
+
case 'devnet':
|
|
22
|
+
return devnetConnection;
|
|
23
|
+
case 'testnet':
|
|
24
|
+
return testnetConnection;
|
|
25
|
+
case 'mainnet':
|
|
26
|
+
return mainnetConnection;
|
|
27
|
+
default:
|
|
28
|
+
return devnetConnection;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
JsonRpcProvider,
|
|
3
|
+
FaucetRateLimitError,
|
|
4
|
+
assert,
|
|
5
|
+
FaucetResponse,
|
|
6
|
+
} from '@mysten/sui.js';
|
|
7
|
+
import { retry } from 'ts-retry-promise';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request some SUI from faucet
|
|
11
|
+
* @param address
|
|
12
|
+
* @param provider
|
|
13
|
+
* @returns {Promise<boolean>}, return true if the request is successful
|
|
14
|
+
*/
|
|
15
|
+
export const requestFaucet = async (
|
|
16
|
+
address: string,
|
|
17
|
+
provider: JsonRpcProvider
|
|
18
|
+
) => {
|
|
19
|
+
console.log('\nRequesting SUI from faucet for address: ', address);
|
|
20
|
+
const headers = {
|
|
21
|
+
authority: 'faucet.testnet.sui.io',
|
|
22
|
+
method: 'POST',
|
|
23
|
+
path: '/gas',
|
|
24
|
+
scheme: 'https',
|
|
25
|
+
accept: '*/*',
|
|
26
|
+
'accept-encoding': 'gzip, deflate, br',
|
|
27
|
+
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,ja;q=0.7',
|
|
28
|
+
'content-length': '105',
|
|
29
|
+
'content-type': 'application/json',
|
|
30
|
+
origin: 'chrome-extension://opcgpfmipidbgpenhmajoajpbobppdil',
|
|
31
|
+
cookie:
|
|
32
|
+
'_ga=GA1.1.2092533979.1664032306; sui_io_cookie={"level":["necessary","analytics"],"revision":0,"data":null,"rfc_cookie":false}; _ga_YKP53WJMB0=GS1.1.1680531285.31.0.1680531334.11.0.0; _ga_0GW4F97GFL=GS1.1.1680826187.125.0.1680826187.60.0.0; __cf_bm=6rPjXUwuzUPy4yDlZuXgDj0v7xLPpUd5z0CFGCoN_YI-1680867579-0-AZMhU7/mKUUbUlOa27LmfW6eIFkBkXsPKqYgWjpjWpj2XzDckgUsRu/pxSRGfvXCspn3w7Df+uO1MR/b+XikJU0=; _cfuvid=zjwCXMmu19KBIVo_L9Qbq4TqFXJpophG3.EvFTxqdf4-1680867579342-0-604800000',
|
|
33
|
+
'sec-ch-ua':
|
|
34
|
+
'"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
|
|
35
|
+
'sec-ch-ua-mobile': '?0',
|
|
36
|
+
'sec-ch-ua-platform': 'macOS',
|
|
37
|
+
'sec-fetch-dest': 'empty',
|
|
38
|
+
'sec-fetch-mode': 'cors',
|
|
39
|
+
'sec-fetch-site': 'none',
|
|
40
|
+
'user-agent':
|
|
41
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
|
|
42
|
+
};
|
|
43
|
+
// We need to add the following headers to the request, otherwise the request will be rejected by the faucet server
|
|
44
|
+
const resp = await retry<FaucetResponse>(
|
|
45
|
+
() => provider.requestSuiFromFaucet(address, headers),
|
|
46
|
+
{
|
|
47
|
+
backoff: 'EXPONENTIAL',
|
|
48
|
+
// overall timeout in 60 seconds
|
|
49
|
+
timeout: 1000 * 60,
|
|
50
|
+
// skip retry if we hit the rate-limit error
|
|
51
|
+
retryIf: (error: any) => !(error instanceof FaucetRateLimitError),
|
|
52
|
+
logger: (msg) => console.warn(`Retry requesting faucet: ${msg}`),
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
assert(resp, FaucetResponse, 'Request faucet failed\n');
|
|
56
|
+
console.log('Request faucet success\n');
|
|
57
|
+
};
|