@taquito/taquito 24.2.0 → 24.3.0-beta.0
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/README.md +1 -1
- package/dist/lib/batch/rpc-batch-provider.js +91 -83
- package/dist/lib/context.js +22 -26
- package/dist/lib/contract/big-map.js +16 -29
- package/dist/lib/contract/contract-methods/contract-method-object-param.js +7 -7
- package/dist/lib/contract/contract-methods/contract-on-chain-view.js +31 -44
- package/dist/lib/contract/contract.js +21 -32
- package/dist/lib/contract/errors.js +9 -9
- package/dist/lib/contract/prepare.js +36 -45
- package/dist/lib/contract/rpc-contract-provider.js +426 -475
- package/dist/lib/contract/sapling-state-abstraction.js +3 -14
- package/dist/lib/contract/semantic.js +2 -2
- package/dist/lib/errors.js +3 -3
- package/dist/lib/estimate/errors.js +1 -1
- package/dist/lib/estimate/estimate.js +66 -20
- package/dist/lib/estimate/rpc-estimate-provider.js +427 -460
- package/dist/lib/forger/composite-forger.js +16 -27
- package/dist/lib/forger/errors.js +2 -2
- package/dist/lib/forger/taquito-local-forger.js +9 -22
- package/dist/lib/global-constants/default-global-constants-provider.js +8 -19
- package/dist/lib/global-constants/errors.js +2 -2
- package/dist/lib/global-constants/noop-global-constants-provider.js +2 -13
- package/dist/lib/import-key.js +23 -34
- package/dist/lib/injector/rpc-injector.js +13 -24
- package/dist/lib/operations/ballot-operation.js +2 -3
- package/dist/lib/operations/delegate-operation.js +5 -8
- package/dist/lib/operations/drain-delegate-operation.js +1 -1
- package/dist/lib/operations/errors.js +9 -6
- package/dist/lib/operations/increase-paid-storage-operation.js +4 -7
- package/dist/lib/operations/operations.js +100 -30
- package/dist/lib/operations/origination-operation.js +16 -27
- package/dist/lib/operations/proposals-operation.js +2 -3
- package/dist/lib/operations/register-global-constant-operation.js +4 -7
- package/dist/lib/operations/reveal-operation.js +1 -1
- package/dist/lib/operations/smart-rollup-add-messages-operation.js +4 -7
- package/dist/lib/operations/smart-rollup-execute-outbox-message-operation.js +4 -7
- package/dist/lib/operations/smart-rollup-originate-operation.js +4 -7
- package/dist/lib/operations/transaction-operation.js +2 -2
- package/dist/lib/operations/transfer-ticket-operation.js +4 -6
- package/dist/lib/operations/types.js +17 -19
- package/dist/lib/operations/update-companion-key-operation.js +4 -7
- package/dist/lib/operations/update-consensus-key-operation.js +4 -7
- package/dist/lib/packer/michel-codec-packer.js +3 -14
- package/dist/lib/packer/rpc-packer.js +2 -13
- package/dist/lib/parser/michel-codec-parser.js +82 -107
- package/dist/lib/parser/noop-parser.js +2 -13
- package/dist/lib/prepare/prepare-provider.js +780 -744
- package/dist/lib/provider.js +322 -128
- package/dist/lib/read-provider/rpc-read-adapter.js +76 -121
- package/dist/lib/signer/errors.js +1 -1
- package/dist/lib/signer/noop.js +9 -26
- package/dist/lib/subscribe/errors.js +2 -2
- package/dist/lib/subscribe/polling-subcribe-provider.js +35 -38
- package/dist/lib/taquito.js +33 -33
- package/dist/lib/tz/rpc-tz-provider.js +27 -44
- package/dist/lib/version.js +2 -2
- package/dist/lib/wallet/batch-operation.js +32 -45
- package/dist/lib/wallet/delegation-operation.js +25 -40
- package/dist/lib/wallet/errors.js +15 -3
- package/dist/lib/wallet/increase-paid-storage-operation.js +25 -40
- package/dist/lib/wallet/legacy.js +28 -63
- package/dist/lib/wallet/operation-factory.js +27 -56
- package/dist/lib/wallet/operation.js +123 -59
- package/dist/lib/wallet/origination-operation.js +34 -46
- package/dist/lib/wallet/register-global-constant-operation.js +26 -43
- package/dist/lib/wallet/transaction-operation.js +21 -36
- package/dist/lib/wallet/transfer-ticket-operation.js +21 -36
- package/dist/lib/wallet/wallet.js +187 -184
- package/dist/taquito.es6.js +3424 -3197
- package/dist/taquito.es6.js.map +1 -1
- package/dist/taquito.min.js +1 -1
- package/dist/taquito.umd.js +7930 -7701
- package/dist/taquito.umd.js.map +1 -1
- package/dist/types/batch/rpc-batch-provider.d.ts +18 -18
- package/dist/types/context.d.ts +4 -4
- package/dist/types/contract/big-map.d.ts +3 -3
- package/dist/types/contract/contract-methods/contract-method-interface.d.ts +4 -4
- package/dist/types/contract/contract-methods/contract-method-object-param.d.ts +6 -6
- package/dist/types/contract/contract-methods/contract-on-chain-view.d.ts +3 -3
- package/dist/types/contract/contract.d.ts +6 -6
- package/dist/types/contract/errors.d.ts +11 -11
- package/dist/types/contract/interface.d.ts +42 -42
- package/dist/types/contract/rpc-contract-provider.d.ts +44 -43
- package/dist/types/contract/sapling-state-abstraction.d.ts +1 -1
- package/dist/types/contract/semantic.d.ts +2 -2
- package/dist/types/errors.d.ts +5 -5
- package/dist/types/estimate/errors.d.ts +1 -1
- package/dist/types/estimate/estimate-provider-interface.d.ts +81 -84
- package/dist/types/estimate/estimate.d.ts +28 -11
- package/dist/types/estimate/rpc-estimate-provider.d.ts +34 -30
- package/dist/types/forger/errors.d.ts +2 -2
- package/dist/types/global-constants/default-global-constants-provider.d.ts +2 -2
- package/dist/types/global-constants/errors.d.ts +2 -2
- package/dist/types/global-constants/interface-global-constants-provider.d.ts +1 -1
- package/dist/types/import-key.d.ts +2 -2
- package/dist/types/operations/ballot-operation.d.ts +1 -1
- package/dist/types/operations/delegate-operation.d.ts +2 -2
- package/dist/types/operations/drain-delegate-operation.d.ts +1 -1
- package/dist/types/operations/errors.d.ts +5 -5
- package/dist/types/operations/failing-noop-operation.d.ts +1 -1
- package/dist/types/operations/increase-paid-storage-operation.d.ts +1 -1
- package/dist/types/operations/operations.d.ts +2 -2
- package/dist/types/operations/origination-operation.d.ts +5 -5
- package/dist/types/operations/proposals-operation.d.ts +1 -1
- package/dist/types/operations/register-global-constant-operation.d.ts +2 -2
- package/dist/types/operations/reveal-operation.d.ts +1 -1
- package/dist/types/operations/smart-rollup-add-messages-operation.d.ts +1 -1
- package/dist/types/operations/smart-rollup-execute-outbox-message-operation.d.ts +1 -1
- package/dist/types/operations/smart-rollup-originate-operation.d.ts +1 -1
- package/dist/types/operations/transaction-operation.d.ts +2 -2
- package/dist/types/operations/transfer-ticket-operation.d.ts +2 -2
- package/dist/types/operations/types.d.ts +387 -25
- package/dist/types/operations/update-companion-key-operation.d.ts +1 -1
- package/dist/types/operations/update-consensus-key-operation.d.ts +1 -1
- package/dist/types/prepare/interface.d.ts +32 -33
- package/dist/types/prepare/prepare-provider.d.ts +34 -60
- package/dist/types/provider.d.ts +7 -1
- package/dist/types/read-provider/interface.d.ts +21 -21
- package/dist/types/read-provider/rpc-read-adapter.d.ts +22 -22
- package/dist/types/signer/errors.d.ts +1 -1
- package/dist/types/signer/noop.d.ts +1 -1
- package/dist/types/subscribe/errors.d.ts +2 -2
- package/dist/types/taquito.d.ts +33 -33
- package/dist/types/wallet/errors.d.ts +10 -2
- package/dist/types/wallet/interface.d.ts +13 -13
- package/dist/types/wallet/operation.d.ts +4 -3
- package/dist/types/wallet/wallet.d.ts +36 -35
- package/package.json +27 -15
- package/LICENSE +0 -202
package/dist/lib/taquito.js
CHANGED
|
@@ -75,7 +75,7 @@ __exportStar(require("./prepare"), exports);
|
|
|
75
75
|
var import_key_1 = require("./import-key");
|
|
76
76
|
Object.defineProperty(exports, "importKey", { enumerable: true, get: function () { return import_key_1.importKey; } });
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Facade class that surfaces all of the libraries capability and allow it's configuration
|
|
79
79
|
*
|
|
80
80
|
* @param _rpc The RPC server to use
|
|
81
81
|
*/
|
|
@@ -95,7 +95,7 @@ class TezosToolkit {
|
|
|
95
95
|
this.setProvider({ rpc: this._rpcClient });
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* Sets configuration on the Tezos Taquito instance. Allows user to choose which signer, rpc client, rpc url, forger and so forth
|
|
99
99
|
*
|
|
100
100
|
* @param options rpc url or rpcClient to use to interact with the Tezos network
|
|
101
101
|
*
|
|
@@ -120,9 +120,9 @@ class TezosToolkit {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* Sets signer provider on the Tezos Taquito instance.
|
|
124
124
|
*
|
|
125
|
-
* @param
|
|
125
|
+
* @param signer signer to use to interact with the Tezos network
|
|
126
126
|
*
|
|
127
127
|
* @example Tezos.setSignerProvider(new InMemorySigner.fromSecretKey('edsk...'))
|
|
128
128
|
*
|
|
@@ -138,9 +138,9 @@ class TezosToolkit {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Sets rpc provider on the Tezos Taquito instance
|
|
142
142
|
*
|
|
143
|
-
* @param
|
|
143
|
+
* @param rpc rpc url or rpcClient to use to interact with the Tezos network
|
|
144
144
|
*
|
|
145
145
|
* @example Tezos.setRpcProvider('https://mainnet.tezos.ecadinfra.com/')
|
|
146
146
|
*
|
|
@@ -159,10 +159,10 @@ class TezosToolkit {
|
|
|
159
159
|
this._context.rpc = this._rpcClient;
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
|
-
*
|
|
162
|
+
* Sets forger provider on the Tezos Taquito instance
|
|
163
163
|
* The `LocalForger` from `@taquito/local-forging` is set by default.
|
|
164
164
|
*
|
|
165
|
-
* @param
|
|
165
|
+
* @param forger forger to use to interact with the Tezos network
|
|
166
166
|
*
|
|
167
167
|
* @example Tezos.setForgerProvider(this.getFactory(RpcForger)())
|
|
168
168
|
*
|
|
@@ -179,9 +179,9 @@ class TezosToolkit {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
182
|
+
* Sets stream provider on the Tezos Taquito instance
|
|
183
183
|
*
|
|
184
|
-
* @param
|
|
184
|
+
* @param stream stream to use to interact with the Tezos network
|
|
185
185
|
*
|
|
186
186
|
* @example Tezos.setStreamProvider(...)
|
|
187
187
|
*
|
|
@@ -203,9 +203,9 @@ class TezosToolkit {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* Sets wallet provider on the Tezos Taquito instance
|
|
207
207
|
*
|
|
208
|
-
* @param
|
|
208
|
+
* @param wallet wallet to use to interact with the Tezos network
|
|
209
209
|
*
|
|
210
210
|
* @example Tezos.setWalletProvider(...)
|
|
211
211
|
*
|
|
@@ -222,9 +222,9 @@ class TezosToolkit {
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
|
-
*
|
|
225
|
+
* Sets Packer provider on the Tezos Taquito instance
|
|
226
226
|
*
|
|
227
|
-
* @param
|
|
227
|
+
* @param packer packer to use to interact with the Tezos network
|
|
228
228
|
*
|
|
229
229
|
* @example Tezos.setPackerProvider(new MichelCodecPacker())
|
|
230
230
|
*
|
|
@@ -241,9 +241,9 @@ class TezosToolkit {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
|
-
*
|
|
244
|
+
* Sets global constants provider on the Tezos Taquito instance
|
|
245
245
|
*
|
|
246
|
-
* @param
|
|
246
|
+
* @param globalConstantsProvider globalConstantsProvider to use to interact with the Tezos network
|
|
247
247
|
*
|
|
248
248
|
* @example
|
|
249
249
|
* ```
|
|
@@ -268,10 +268,10 @@ class TezosToolkit {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
271
|
-
*
|
|
271
|
+
* Sets read provider on the Tezos Taquito instance
|
|
272
272
|
* By default reads are done from the RPC usign the RpcReadAdapter class, this can be overridden to read from an indexer that implements the TzReadProvider interface
|
|
273
273
|
*
|
|
274
|
-
* @param
|
|
274
|
+
* @param readProvider TzReadProvider to use to interact with the Tezos network
|
|
275
275
|
*
|
|
276
276
|
*/
|
|
277
277
|
setReadProvider(readProvider) {
|
|
@@ -280,9 +280,9 @@ class TezosToolkit {
|
|
|
280
280
|
this._context.readProvider = readP;
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
283
|
-
*
|
|
283
|
+
* Sets parser provider on the Tezos Taquito instance
|
|
284
284
|
*
|
|
285
|
-
* @param
|
|
285
|
+
* @param parserProvider parserProvider to use to interact with the Tezos network
|
|
286
286
|
*
|
|
287
287
|
*/
|
|
288
288
|
setParserProvider(parserProvider) {
|
|
@@ -297,9 +297,9 @@ class TezosToolkit {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
/**
|
|
300
|
-
*
|
|
300
|
+
* Sets injector provider on the Tezos Taquito instance
|
|
301
301
|
*
|
|
302
|
-
* @param
|
|
302
|
+
* @param injectorProvider Injector to use to interact with the Tezos network by default RpcInjector
|
|
303
303
|
*
|
|
304
304
|
*/
|
|
305
305
|
setInjectorProvider(injectorProvider) {
|
|
@@ -314,26 +314,26 @@ class TezosToolkit {
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
|
-
*
|
|
317
|
+
* Sets the strategy used for field numbering in Token execute/encode/decode to convert Michelson values to/from javascript objects
|
|
318
318
|
* @param strategy a value of type FieldNumberingStrategy that controls how field numbers are calculated
|
|
319
319
|
*/
|
|
320
320
|
setFieldNumberingStrategy(strategy) {
|
|
321
321
|
michelson_encoder_1.Token.fieldNumberingStrategy = strategy;
|
|
322
322
|
}
|
|
323
323
|
/**
|
|
324
|
-
*
|
|
324
|
+
* Provide access to tezos account management
|
|
325
325
|
*/
|
|
326
326
|
get tz() {
|
|
327
327
|
return this._context.tz;
|
|
328
328
|
}
|
|
329
329
|
/**
|
|
330
|
-
*
|
|
330
|
+
* Provide access to smart contract utilities
|
|
331
331
|
*/
|
|
332
332
|
get contract() {
|
|
333
333
|
return this._context.contract;
|
|
334
334
|
}
|
|
335
335
|
/**
|
|
336
|
-
*
|
|
336
|
+
* Provide access to tezos operation preparation utilities
|
|
337
337
|
*/
|
|
338
338
|
get prepare() {
|
|
339
339
|
return this._context.prepare;
|
|
@@ -345,37 +345,37 @@ class TezosToolkit {
|
|
|
345
345
|
return this._context.operationFactory;
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
348
|
-
*
|
|
348
|
+
* Provide access to operation estimation utilities
|
|
349
349
|
*/
|
|
350
350
|
get estimate() {
|
|
351
351
|
return this._context.estimate;
|
|
352
352
|
}
|
|
353
353
|
/**
|
|
354
|
-
*
|
|
354
|
+
* Provide access to streaming utilities backed by an streamer implementation
|
|
355
355
|
*/
|
|
356
356
|
get stream() {
|
|
357
357
|
return this._context.stream;
|
|
358
358
|
}
|
|
359
359
|
/**
|
|
360
|
-
*
|
|
360
|
+
* Provide access to the currently used rpc client
|
|
361
361
|
*/
|
|
362
362
|
get rpc() {
|
|
363
363
|
return this._context.rpc;
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
366
|
-
*
|
|
366
|
+
* Provide access to the currently used signer
|
|
367
367
|
*/
|
|
368
368
|
get signer() {
|
|
369
369
|
return this._context.signer;
|
|
370
370
|
}
|
|
371
371
|
/**
|
|
372
|
-
*
|
|
372
|
+
* Provide access to the currently used globalConstantsProvider
|
|
373
373
|
*/
|
|
374
374
|
get globalConstants() {
|
|
375
375
|
return this._context.globalConstantsProvider;
|
|
376
376
|
}
|
|
377
377
|
/**
|
|
378
|
-
*
|
|
378
|
+
* Allow to add a module to the TezosToolkit instance. This method adds the appropriate Providers(s) required by the module to the internal context.
|
|
379
379
|
*
|
|
380
380
|
* @param module extension to add to the TezosToolkit instance
|
|
381
381
|
*
|
|
@@ -395,7 +395,7 @@ class TezosToolkit {
|
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
397
|
/**
|
|
398
|
-
*
|
|
398
|
+
* Gets an object containing the version of Taquito library and git sha of the commit this library is compiled from
|
|
399
399
|
*/
|
|
400
400
|
getVersionInfo() {
|
|
401
401
|
return version_1.VERSION;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.RpcTzProvider = void 0;
|
|
13
4
|
const operations_1 = require("../operations/operations");
|
|
@@ -20,44 +11,36 @@ class RpcTzProvider extends provider_1.Provider {
|
|
|
20
11
|
super(context);
|
|
21
12
|
this.prepare = new prepare_1.PrepareProvider(this.context);
|
|
22
13
|
}
|
|
23
|
-
getBalance(address) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return this.context.readProvider.getBalance(address, 'head');
|
|
30
|
-
});
|
|
14
|
+
async getBalance(address) {
|
|
15
|
+
const addressValidation = (0, utils_1.validateAddress)(address);
|
|
16
|
+
if (addressValidation !== utils_1.ValidationResult.VALID) {
|
|
17
|
+
throw new core_1.InvalidAddressError(address, addressValidation);
|
|
18
|
+
}
|
|
19
|
+
return this.context.readProvider.getBalance(address, 'head');
|
|
31
20
|
}
|
|
32
|
-
getSpendable(address) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return this.context.readProvider.getSpendable(address, 'head');
|
|
39
|
-
});
|
|
21
|
+
async getSpendable(address) {
|
|
22
|
+
const addressValidation = (0, utils_1.validateAddress)(address);
|
|
23
|
+
if (addressValidation !== utils_1.ValidationResult.VALID) {
|
|
24
|
+
throw new core_1.InvalidAddressError(address, addressValidation);
|
|
25
|
+
}
|
|
26
|
+
return this.context.readProvider.getSpendable(address, 'head');
|
|
40
27
|
}
|
|
41
|
-
getDelegate(address) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return this.context.readProvider.getDelegate(address, 'head');
|
|
48
|
-
});
|
|
28
|
+
async getDelegate(address) {
|
|
29
|
+
const addressValidation = (0, utils_1.validateAddress)(address);
|
|
30
|
+
if (addressValidation !== utils_1.ValidationResult.VALID) {
|
|
31
|
+
throw new core_1.InvalidAddressError(address, addressValidation);
|
|
32
|
+
}
|
|
33
|
+
return this.context.readProvider.getDelegate(address, 'head');
|
|
49
34
|
}
|
|
50
|
-
activate(pkh, secret) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return new operations_1.Operation(yield this.rpc.injectOperation(bytes), Object.assign(Object.assign({}, forgedBytes), { opbytes: bytes }), [], this.context.clone());
|
|
60
|
-
});
|
|
35
|
+
async activate(pkh, secret) {
|
|
36
|
+
const pkhValidation = (0, utils_1.validateKeyHash)(pkh);
|
|
37
|
+
if (pkhValidation !== utils_1.ValidationResult.VALID) {
|
|
38
|
+
throw new utils_1.InvalidKeyHashError(pkh, pkhValidation);
|
|
39
|
+
}
|
|
40
|
+
const prepared = await this.prepare.activate({ pkh, secret });
|
|
41
|
+
const forgedBytes = await this.forge(prepared);
|
|
42
|
+
const bytes = `${forgedBytes.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;
|
|
43
|
+
return new operations_1.Operation(await this.rpc.injectOperation(bytes), { ...forgedBytes, opbytes: bytes }, [], this.context.clone());
|
|
61
44
|
}
|
|
62
45
|
}
|
|
63
46
|
exports.RpcTzProvider = RpcTzProvider;
|
package/dist/lib/version.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
|
|
5
5
|
exports.VERSION = {
|
|
6
|
-
"commitHash": "
|
|
7
|
-
"version": "24.
|
|
6
|
+
"commitHash": "27675679db6515e8b092195ef5c58c2c0ea5f5c8",
|
|
7
|
+
"version": "24.3.0-beta.0"
|
|
8
8
|
};
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.BatchWalletOperation = exports.WALLET_BATCH_KINDS = void 0;
|
|
13
4
|
const rpc_1 = require("@taquito/rpc");
|
|
@@ -28,8 +19,8 @@ class BatchWalletOperation extends operation_1.WalletOperation {
|
|
|
28
19
|
super(opHash, context, newHead$);
|
|
29
20
|
this.opHash = opHash;
|
|
30
21
|
this.context = context;
|
|
31
|
-
this.getOriginatedContractAddresses = () =>
|
|
32
|
-
const opResult =
|
|
22
|
+
this.getOriginatedContractAddresses = async () => {
|
|
23
|
+
const opResult = await this.operationResults();
|
|
33
24
|
if (!opResult) {
|
|
34
25
|
throw new errors_1.ObservableError('Unable to fetch operation results');
|
|
35
26
|
}
|
|
@@ -43,42 +34,38 @@ class BatchWalletOperation extends operation_1.WalletOperation {
|
|
|
43
34
|
}
|
|
44
35
|
return addresses;
|
|
45
36
|
}
|
|
46
|
-
}
|
|
37
|
+
};
|
|
47
38
|
}
|
|
48
|
-
revealOperation() {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
});
|
|
39
|
+
async revealOperation() {
|
|
40
|
+
const operationResult = await this.operationResults();
|
|
41
|
+
if (!operationResult) {
|
|
42
|
+
throw new errors_1.ObservableError('Unable to fetch operation results');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return operationResult.find((x) => x.kind === rpc_1.OpKind.REVEAL);
|
|
46
|
+
}
|
|
58
47
|
}
|
|
59
|
-
status() {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
});
|
|
48
|
+
async status() {
|
|
49
|
+
if (!this._included) {
|
|
50
|
+
return 'pending';
|
|
51
|
+
}
|
|
52
|
+
const op = await this.operationResults();
|
|
53
|
+
if (op) {
|
|
54
|
+
return (op
|
|
55
|
+
.filter((result) => exports.WALLET_BATCH_KINDS.indexOf(result.kind) !== -1)
|
|
56
|
+
.map((result) => {
|
|
57
|
+
if ((0, types_1.hasMetadataWithResult)(result)) {
|
|
58
|
+
const opResult = result.metadata.operation_result;
|
|
59
|
+
return opResult.status;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return 'unknown';
|
|
63
|
+
}
|
|
64
|
+
})[0] || 'unknown');
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
throw new errors_1.ObservableError('Unable to fetch operation results');
|
|
68
|
+
}
|
|
82
69
|
}
|
|
83
70
|
}
|
|
84
71
|
exports.BatchWalletOperation = BatchWalletOperation;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.DelegationWalletOperation = void 0;
|
|
13
4
|
const rpc_1 = require("@taquito/rpc");
|
|
@@ -19,39 +10,33 @@ class DelegationWalletOperation extends operation_1.WalletOperation {
|
|
|
19
10
|
this.opHash = opHash;
|
|
20
11
|
this.context = context;
|
|
21
12
|
}
|
|
22
|
-
revealOperation() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
});
|
|
13
|
+
async revealOperation() {
|
|
14
|
+
const operationResult = await this.operationResults();
|
|
15
|
+
if (operationResult) {
|
|
16
|
+
return operationResult.find((x) => x.kind === rpc_1.OpKind.REVEAL);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
throw new errors_1.ObservableError('Unable to fetch operation result');
|
|
20
|
+
}
|
|
32
21
|
}
|
|
33
|
-
delegationOperation() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
});
|
|
22
|
+
async delegationOperation() {
|
|
23
|
+
const operationResult = await this.operationResults();
|
|
24
|
+
if (operationResult) {
|
|
25
|
+
return operationResult.find((x) => x.kind === rpc_1.OpKind.DELEGATION);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
throw new errors_1.ObservableError('Unable to fetch operation result');
|
|
29
|
+
}
|
|
43
30
|
}
|
|
44
|
-
status() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return op.metadata.operation_result.status;
|
|
54
|
-
});
|
|
31
|
+
async status() {
|
|
32
|
+
if (!this._included) {
|
|
33
|
+
return 'pending';
|
|
34
|
+
}
|
|
35
|
+
const op = await this.delegationOperation();
|
|
36
|
+
if (!op) {
|
|
37
|
+
return 'unknown';
|
|
38
|
+
}
|
|
39
|
+
return op.metadata.operation_result.status;
|
|
55
40
|
}
|
|
56
41
|
}
|
|
57
42
|
exports.DelegationWalletOperation = DelegationWalletOperation;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObservableError = exports.ConfirmationUndefinedError = void 0;
|
|
3
|
+
exports.OriginationWalletOperationError = exports.ObservableError = exports.ConfirmationUndefinedError = void 0;
|
|
4
4
|
const core_1 = require("@taquito/core");
|
|
5
5
|
/**
|
|
6
6
|
* @category Error
|
|
7
|
-
*
|
|
7
|
+
* Error that indicates undefined confirmation has not been specified or configured
|
|
8
8
|
*/
|
|
9
9
|
class ConfirmationUndefinedError extends core_1.TezosToolkitConfigError {
|
|
10
10
|
constructor() {
|
|
@@ -16,7 +16,7 @@ class ConfirmationUndefinedError extends core_1.TezosToolkitConfigError {
|
|
|
16
16
|
exports.ConfirmationUndefinedError = ConfirmationUndefinedError;
|
|
17
17
|
/**
|
|
18
18
|
* @category Error
|
|
19
|
-
*
|
|
19
|
+
* Error that indicates a generic failure when trying to fetch an observable
|
|
20
20
|
*/
|
|
21
21
|
class ObservableError extends core_1.NetworkError {
|
|
22
22
|
constructor(message) {
|
|
@@ -26,3 +26,15 @@ class ObservableError extends core_1.NetworkError {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
exports.ObservableError = ObservableError;
|
|
29
|
+
/**
|
|
30
|
+
* @category Error
|
|
31
|
+
* Error that indicates a newly originated wallet contract could not be resolved
|
|
32
|
+
*/
|
|
33
|
+
class OriginationWalletOperationError extends ObservableError {
|
|
34
|
+
constructor(message) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.message = message;
|
|
37
|
+
this.name = 'OriginationWalletOperationError';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.OriginationWalletOperationError = OriginationWalletOperationError;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.IncreasePaidStorageWalletOperation = void 0;
|
|
13
4
|
const operation_1 = require("./operation");
|
|
@@ -19,39 +10,33 @@ class IncreasePaidStorageWalletOperation extends operation_1.WalletOperation {
|
|
|
19
10
|
this.opHash = opHash;
|
|
20
11
|
this.context = context;
|
|
21
12
|
}
|
|
22
|
-
revealOperation() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
});
|
|
13
|
+
async revealOperation() {
|
|
14
|
+
const operationResult = await this.operationResults();
|
|
15
|
+
if (!operationResult) {
|
|
16
|
+
throw new errors_1.ObservableError('Unable to fetch operation result');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return operationResult.find((x) => x.kind === rpc_1.OpKind.REVEAL);
|
|
20
|
+
}
|
|
32
21
|
}
|
|
33
|
-
increasePaidStorageOperation() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
});
|
|
22
|
+
async increasePaidStorageOperation() {
|
|
23
|
+
const operationResult = await this.operationResults();
|
|
24
|
+
if (!operationResult) {
|
|
25
|
+
throw new errors_1.ObservableError('Unable to fetch operation result');
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return operationResult.find((x) => x.kind === rpc_1.OpKind.INCREASE_PAID_STORAGE);
|
|
29
|
+
}
|
|
43
30
|
}
|
|
44
|
-
status() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return op.metadata.operation_result.status;
|
|
54
|
-
});
|
|
31
|
+
async status() {
|
|
32
|
+
if (!this._included) {
|
|
33
|
+
return 'pending';
|
|
34
|
+
}
|
|
35
|
+
const op = await this.increasePaidStorageOperation();
|
|
36
|
+
if (!op) {
|
|
37
|
+
return 'unknown';
|
|
38
|
+
}
|
|
39
|
+
return op.metadata.operation_result.status;
|
|
55
40
|
}
|
|
56
41
|
}
|
|
57
42
|
exports.IncreasePaidStorageWalletOperation = IncreasePaidStorageWalletOperation;
|