mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 16:51:02 +00:00
1 line
16 KiB
Plaintext
1 line
16 KiB
Plaintext
{"dependencies":[{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":52,"index":52}}],"key":"ISHU1ovvPMrCldqRjtd1JhW9dyo=","exportNames":["*"],"imports":1}},{"name":"../base/index.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":2,"column":0,"index":53},"end":{"line":2,"column":43,"index":96}}],"key":"F7yfqO9kbR/r5udcI7E6w0J8QfU=","exportNames":["*"],"imports":1}},{"name":"./Combinator.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":3,"column":0,"index":97},"end":{"line":3,"column":45,"index":142}}],"key":"Sw0+0EhbWn2HPgz2B744U9j6DDs=","exportNames":["*"],"imports":1}},{"name":"./decorateMethod.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":4,"column":0,"index":143},"end":{"line":4,"column":70,"index":213}}],"key":"guYLkGE+pB1ArcvHIuuZ3j4O5Zw=","exportNames":["*"],"imports":1}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n Object.defineProperty(exports, \"ApiPromise\", {\n enumerable: true,\n get: function () {\n return ApiPromise;\n }\n });\n var _polkadotUtil = require(_dependencyMap[0], \"@polkadot/util\");\n var _baseIndexJs = require(_dependencyMap[1], \"../base/index.js\");\n var _CombinatorJs = require(_dependencyMap[2], \"./Combinator.js\");\n var _decorateMethodJs = require(_dependencyMap[3], \"./decorateMethod.js\");\n /**\n * # @polkadot/api/promise\n *\n * ## Overview\n *\n * @name ApiPromise\n * @description\n * ApiPromise is a standard JavaScript wrapper around the RPC and interfaces on the Polkadot network. As a full Promise-based, all interface calls return Promises, including the static `.create(...)`. Subscription calls utilise `(value) => {}` callbacks to pass through the latest values.\n *\n * The API is well suited to real-time applications where either the single-shot state is needed or use is to be made of the subscription-based features of Polkadot (and Substrate) clients.\n *\n * @see [[ApiRx]]\n *\n * ## Usage\n *\n * Making rpc calls -\n * <BR>\n *\n * ```javascript\n * import ApiPromise from '@polkadot/api/promise';\n *\n * // initialise via static create\n * const api = await ApiPromise.create();\n *\n * // make a subscription to the network head\n * api.rpc.chain.subscribeNewHeads((header) => {\n * console.log(`Chain is at #${header.number}`);\n * });\n * ```\n * <BR>\n *\n * Subscribing to chain state -\n * <BR>\n *\n * ```javascript\n * import { ApiPromise, WsProvider } from '@polkadot/api';\n *\n * // initialise a provider with a specific endpoint\n * const provider = new WsProvider('wss://example.com:9944')\n *\n * // initialise via isReady & new with specific provider\n * const api = await new ApiPromise({ provider }).isReady;\n *\n * // retrieve the block target time\n * const blockPeriod = await api.query.timestamp.blockPeriod().toNumber();\n * let last = 0;\n *\n * // subscribe to the current block timestamp, updates automatically (callback provided)\n * api.query.timestamp.now((timestamp) => {\n * const elapsed = last\n * ? `, ${timestamp.toNumber() - last}s since last`\n * : '';\n *\n * last = timestamp.toNumber();\n * console.log(`timestamp ${timestamp}${elapsed} (${blockPeriod}s target)`);\n * });\n * ```\n * <BR>\n *\n * Submitting a transaction -\n * <BR>\n *\n * ```javascript\n * import ApiPromise from '@polkadot/api/promise';\n *\n * ApiPromise.create().then((api) => {\n * const [nonce] = await api.query.system.account(keyring.alice.address);\n *\n * api.tx.balances\n * // create transfer\n * transfer(keyring.bob.address, 12345)\n * // sign the transcation\n * .sign(keyring.alice, { nonce })\n * // send the transaction (optional status callback)\n * .send((status) => {\n * console.log(`current status ${status.type}`);\n * })\n * // retrieve the submitted extrinsic hash\n * .then((hash) => {\n * console.log(`submitted with hash ${hash}`);\n * });\n * });\n * ```\n */\n class ApiPromise extends _baseIndexJs.ApiBase {\n #isReadyPromise;\n #isReadyOrErrorPromise;\n /**\n * @description Creates an instance of the ApiPromise class\n * @param options Options to create an instance. This can be either [[ApiOptions]] or\n * an [[WsProvider]].\n * @example\n * <BR>\n *\n * ```javascript\n * import Api from '@polkadot/api/promise';\n *\n * new Api().isReady.then((api) => {\n * api.rpc.subscribeNewHeads((header) => {\n * console.log(`new block #${header.number.toNumber()}`);\n * });\n * });\n * ```\n */\n constructor(options) {\n super(options, 'promise', _decorateMethodJs.toPromiseMethod);\n this.#isReadyPromise = new Promise(resolve => {\n super.once('ready', () => resolve(this));\n });\n this.#isReadyOrErrorPromise = new Promise((resolve, reject) => {\n const tracker = (0, _decorateMethodJs.promiseTracker)(resolve, reject);\n super.once('ready', () => tracker.resolve(this));\n super.once('error', error => tracker.reject(error));\n });\n }\n /**\n * @description Creates an ApiPromise instance using the supplied provider. Returns an Promise containing the actual Api instance.\n * @param options options that is passed to the class contructor. Can be either [[ApiOptions]] or a\n * provider (see the constructor arguments)\n * @example\n * <BR>\n *\n * ```javascript\n * import Api from '@polkadot/api/promise';\n *\n * Api.create().then(async (api) => {\n * const timestamp = await api.query.timestamp.now();\n *\n * console.log(`lastest block timestamp ${timestamp}`);\n * });\n * ```\n */\n static create(options) {\n const instance = new ApiPromise(options);\n if (options && options.throwOnConnect) {\n return instance.isReadyOrError;\n }\n // Swallow any rejections on isReadyOrError\n // (in Node 15.x this creates issues, when not being looked at)\n instance.isReadyOrError.catch(_polkadotUtil.noop);\n return instance.isReady;\n }\n /**\n * @description Promise that resolves the first time we are connected and loaded\n */\n get isReady() {\n return this.#isReadyPromise;\n }\n /**\n * @description Promise that resolves if we can connect, or reject if there is an error\n */\n get isReadyOrError() {\n return this.#isReadyOrErrorPromise;\n }\n /**\n * @description Returns a clone of this ApiPromise instance (new underlying provider connection)\n */\n clone() {\n return new ApiPromise((0, _polkadotUtil.objectSpread)({}, this._options, {\n source: this\n }));\n }\n /**\n * @description Creates a combinator that can be used to combine the latest results from multiple subscriptions\n * @param fns An array of function to combine, each in the form of `(cb: (value: void)) => void`\n * @param callback A callback that will return an Array of all the values this combinator has been applied to\n * @example\n * <BR>\n *\n * ```javascript\n * const address = '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFacT7';\n *\n * // combines values from balance & nonce as it updates\n * api.combineLatest([\n * api.rpc.chain.subscribeNewHeads,\n * (cb) => api.query.system.account(address, cb)\n * ], ([head, [balance, nonce]]) => {\n * console.log(`#${head.number}: You have ${balance.free} units, with ${nonce} transactions sent`);\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/require-await\n async combineLatest(fns, callback) {\n const combinator = new _CombinatorJs.Combinator(fns, callback);\n return () => {\n combinator.unsubscribe();\n };\n }\n }\n});","lineCount":206,"map":[[7,2,89,0,"Object"],[7,8,89,0],[7,9,89,0,"defineProperty"],[7,23,89,0],[7,24,89,0,"exports"],[7,31,89,0],[8,4,89,0,"enumerable"],[8,14,89,0],[9,4,89,0,"get"],[9,7,89,0],[9,18,89,0,"get"],[9,19,89,0],[10,6,89,0],[10,13,89,0,"ApiPromise"],[10,23,89,0],[11,4,89,0],[12,2,89,0],[13,2,1,0],[13,6,1,0,"_polkadotUtil"],[13,19,1,0],[13,22,1,0,"require"],[13,29,1,0],[13,30,1,0,"_dependencyMap"],[13,44,1,0],[14,2,2,0],[14,6,2,0,"_baseIndexJs"],[14,18,2,0],[14,21,2,0,"require"],[14,28,2,0],[14,29,2,0,"_dependencyMap"],[14,43,2,0],[15,2,3,0],[15,6,3,0,"_CombinatorJs"],[15,19,3,0],[15,22,3,0,"require"],[15,29,3,0],[15,30,3,0,"_dependencyMap"],[15,44,3,0],[16,2,4,0],[16,6,4,0,"_decorateMethodJs"],[16,23,4,0],[16,26,4,0,"require"],[16,33,4,0],[16,34,4,0,"_dependencyMap"],[16,48,4,0],[17,2,5,0],[18,0,6,0],[19,0,7,0],[20,0,8,0],[21,0,9,0],[22,0,10,0],[23,0,11,0],[24,0,12,0],[25,0,13,0],[26,0,14,0],[27,0,15,0],[28,0,16,0],[29,0,17,0],[30,0,18,0],[31,0,19,0],[32,0,20,0],[33,0,21,0],[34,0,22,0],[35,0,23,0],[36,0,24,0],[37,0,25,0],[38,0,26,0],[39,0,27,0],[40,0,28,0],[41,0,29,0],[42,0,30,0],[43,0,31,0],[44,0,32,0],[45,0,33,0],[46,0,34,0],[47,0,35,0],[48,0,36,0],[49,0,37,0],[50,0,38,0],[51,0,39,0],[52,0,40,0],[53,0,41,0],[54,0,42,0],[55,0,43,0],[56,0,44,0],[57,0,45,0],[58,0,46,0],[59,0,47,0],[60,0,48,0],[61,0,49,0],[62,0,50,0],[63,0,51,0],[64,0,52,0],[65,0,53,0],[66,0,54,0],[67,0,55,0],[68,0,56,0],[69,0,57,0],[70,0,58,0],[71,0,59,0],[72,0,60,0],[73,0,61,0],[74,0,62,0],[75,0,63,0],[76,0,64,0],[77,0,65,0],[78,0,66,0],[79,0,67,0],[80,0,68,0],[81,0,69,0],[82,0,70,0],[83,0,71,0],[84,0,72,0],[85,0,73,0],[86,0,74,0],[87,0,75,0],[88,0,76,0],[89,0,77,0],[90,0,78,0],[91,0,79,0],[92,0,80,0],[93,0,81,0],[94,0,82,0],[95,0,83,0],[96,0,84,0],[97,0,85,0],[98,0,86,0],[99,0,87,0],[100,0,88,0],[101,2,89,7],[101,8,89,13,"ApiPromise"],[101,18,89,23],[101,27,89,32,"ApiBase"],[101,39,89,39],[101,40,89,39,"ApiBase"],[101,47,89,39],[101,48,89,40],[102,4,90,4],[102,5,90,5,"isReadyPromise"],[102,19,90,19],[103,4,91,4],[103,5,91,5,"isReadyOrErrorPromise"],[103,26,91,26],[104,4,92,4],[105,0,93,0],[106,0,94,0],[107,0,95,0],[108,0,96,0],[109,0,97,0],[110,0,98,0],[111,0,99,0],[112,0,100,0],[113,0,101,0],[114,0,102,0],[115,0,103,0],[116,0,104,0],[117,0,105,0],[118,0,106,0],[119,0,107,0],[120,0,108,0],[121,4,109,4,"constructor"],[121,15,109,15,"constructor"],[121,16,109,16,"options"],[121,23,109,23],[121,25,109,25],[122,6,110,8],[122,11,110,13],[122,12,110,14,"options"],[122,19,110,21],[122,21,110,23],[122,30,110,32],[122,32,110,34,"toPromiseMethod"],[122,49,110,49],[122,50,110,49,"toPromiseMethod"],[122,65,110,49],[122,66,110,50],[123,6,111,8],[123,10,111,12],[123,11,111,13],[123,12,111,14,"isReadyPromise"],[123,26,111,28],[123,29,111,31],[123,33,111,35,"Promise"],[123,40,111,42],[123,41,111,44,"resolve"],[123,48,111,51],[123,52,111,56],[124,8,112,12],[124,13,112,17],[124,14,112,18,"once"],[124,18,112,22],[124,19,112,23],[124,26,112,30],[124,28,112,32],[124,34,112,38,"resolve"],[124,41,112,45],[124,42,112,46],[124,46,112,50],[124,47,112,51],[124,48,112,52],[125,6,113,8],[125,7,113,9],[125,8,113,10],[126,6,114,8],[126,10,114,12],[126,11,114,13],[126,12,114,14,"isReadyOrErrorPromise"],[126,33,114,35],[126,36,114,38],[126,40,114,42,"Promise"],[126,47,114,49],[126,48,114,50],[126,49,114,51,"resolve"],[126,56,114,58],[126,58,114,60,"reject"],[126,64,114,66],[126,69,114,71],[127,8,115,12],[127,14,115,18,"tracker"],[127,21,115,25],[127,24,115,28],[127,28,115,28,"promiseTracker"],[127,45,115,42],[127,46,115,42,"promiseTracker"],[127,60,115,42],[127,62,115,43,"resolve"],[127,69,115,50],[127,71,115,52,"reject"],[127,77,115,58],[127,78,115,59],[128,8,116,12],[128,13,116,17],[128,14,116,18,"once"],[128,18,116,22],[128,19,116,23],[128,26,116,30],[128,28,116,32],[128,34,116,38,"tracker"],[128,41,116,45],[128,42,116,46,"resolve"],[128,49,116,53],[128,50,116,54],[128,54,116,58],[128,55,116,59],[128,56,116,60],[129,8,117,12],[129,13,117,17],[129,14,117,18,"once"],[129,18,117,22],[129,19,117,23],[129,26,117,30],[129,28,117,33,"error"],[129,33,117,38],[129,37,117,43,"tracker"],[129,44,117,50],[129,45,117,51,"reject"],[129,51,117,57],[129,52,117,58,"error"],[129,57,117,63],[129,58,117,64],[129,59,117,65],[130,6,118,8],[130,7,118,9],[130,8,118,10],[131,4,119,4],[132,4,120,4],[133,0,121,0],[134,0,122,0],[135,0,123,0],[136,0,124,0],[137,0,125,0],[138,0,126,0],[139,0,127,0],[140,0,128,0],[141,0,129,0],[142,0,130,0],[143,0,131,0],[144,0,132,0],[145,0,133,0],[146,0,134,0],[147,0,135,0],[148,0,136,0],[149,4,137,4],[149,11,137,11,"create"],[149,17,137,17,"create"],[149,18,137,18,"options"],[149,25,137,25],[149,27,137,27],[150,6,138,8],[150,12,138,14,"instance"],[150,20,138,22],[150,23,138,25],[150,27,138,29,"ApiPromise"],[150,37,138,39],[150,38,138,40,"options"],[150,45,138,47],[150,46,138,48],[151,6,139,8],[151,10,139,12,"options"],[151,17,139,19],[151,21,139,23,"options"],[151,28,139,30],[151,29,139,31,"throwOnConnect"],[151,43,139,45],[151,45,139,47],[152,8,140,12],[152,15,140,19,"instance"],[152,23,140,27],[152,24,140,28,"isReadyOrError"],[152,38,140,42],[153,6,141,8],[154,6,142,8],[155,6,143,8],[156,6,144,8,"instance"],[156,14,144,16],[156,15,144,17,"isReadyOrError"],[156,29,144,31],[156,30,144,32,"catch"],[156,35,144,37],[156,36,144,38,"noop"],[156,49,144,42],[156,50,144,42,"noop"],[156,54,144,42],[156,55,144,43],[157,6,145,8],[157,13,145,15,"instance"],[157,21,145,23],[157,22,145,24,"isReady"],[157,29,145,31],[158,4,146,4],[159,4,147,4],[160,0,148,0],[161,0,149,0],[162,4,150,4],[162,8,150,8,"isReady"],[162,15,150,15,"isReady"],[162,16,150,15],[162,18,150,18],[163,6,151,8],[163,13,151,15],[163,17,151,19],[163,18,151,20],[163,19,151,21,"isReadyPromise"],[163,33,151,35],[164,4,152,4],[165,4,153,4],[166,0,154,0],[167,0,155,0],[168,4,156,4],[168,8,156,8,"isReadyOrError"],[168,22,156,22,"isReadyOrError"],[168,23,156,22],[168,25,156,25],[169,6,157,8],[169,13,157,15],[169,17,157,19],[169,18,157,20],[169,19,157,21,"isReadyOrErrorPromise"],[169,40,157,42],[170,4,158,4],[171,4,159,4],[172,0,160,0],[173,0,161,0],[174,4,162,4,"clone"],[174,9,162,9,"clone"],[174,10,162,9],[174,12,162,12],[175,6,163,8],[175,13,163,15],[175,17,163,19,"ApiPromise"],[175,27,163,29],[175,28,163,30],[175,32,163,30,"objectSpread"],[175,45,163,42],[175,46,163,42,"objectSpread"],[175,58,163,42],[175,60,163,43],[175,61,163,44],[175,62,163,45],[175,64,163,47],[175,68,163,51],[175,69,163,52,"_options"],[175,77,163,60],[175,79,163,62],[176,8,163,64,"source"],[176,14,163,70],[176,16,163,72],[177,6,163,77],[177,7,163,78],[177,8,163,79],[177,9,163,80],[178,4,164,4],[179,4,165,4],[180,0,166,0],[181,0,167,0],[182,0,168,0],[183,0,169,0],[184,0,170,0],[185,0,171,0],[186,0,172,0],[187,0,173,0],[188,0,174,0],[189,0,175,0],[190,0,176,0],[191,0,177,0],[192,0,178,0],[193,0,179,0],[194,0,180,0],[195,0,181,0],[196,0,182,0],[197,0,183,0],[198,4,184,4],[199,4,185,4],[199,10,185,10,"combineLatest"],[199,23,185,23,"combineLatest"],[199,24,185,24,"fns"],[199,27,185,27],[199,29,185,29,"callback"],[199,37,185,37],[199,39,185,39],[200,6,186,8],[200,12,186,14,"combinator"],[200,22,186,24],[200,25,186,27],[200,29,186,31,"Combinator"],[200,42,186,41],[200,43,186,41,"Combinator"],[200,53,186,41],[200,54,186,42,"fns"],[200,57,186,45],[200,59,186,47,"callback"],[200,67,186,55],[200,68,186,56],[201,6,187,8],[201,13,187,15],[201,19,187,21],[202,8,188,12,"combinator"],[202,18,188,22],[202,19,188,23,"unsubscribe"],[202,30,188,34],[202,31,188,35],[202,32,188,36],[203,6,189,8],[203,7,189,9],[204,4,190,4],[205,2,191,0],[206,0,191,1],[206,3]],"functionMap":{"names":["<global>","ApiPromise","ApiPromise#constructor","Promise$argument_0","once$argument_1","ApiPromise.create","ApiPromise#get__isReady","ApiPromise#get__isReadyOrError","ApiPromise#clone","ApiPromise#combineLatest","<anonymous>"],"mappings":"AAA;OCwF;ICoB;2CCE;gCCC,mBD;SDC;kDCC;gCCE,2BD;gCCC,gCD;SDC;KDC;IIkB;KJS;IKI;KLE;IMI;KNE;IOI;KPE;IQqB;eCE;SDE;KRC;CDC"},"hasCjsExports":false},"type":"js/module"}]} |