@taquito/taquito 11.0.2 → 11.2.0-beta-RC.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 +2 -2
- package/dist/lib/batch/rpc-batch-provider.js +115 -249
- package/dist/lib/batch/rpc-batch-provider.js.map +1 -1
- package/dist/lib/constants.js +10 -4
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/context.js +143 -223
- package/dist/lib/context.js.map +1 -1
- package/dist/lib/contract/big-map.js +26 -66
- package/dist/lib/contract/big-map.js.map +1 -1
- package/dist/lib/contract/compose.js +1 -3
- package/dist/lib/contract/compose.js.map +1 -1
- package/dist/lib/contract/contract-methods/contract-method-factory.js +17 -16
- package/dist/lib/contract/contract-methods/contract-method-factory.js.map +1 -1
- package/dist/lib/contract/contract-methods/contract-method-flat-param.js +39 -68
- package/dist/lib/contract/contract-methods/contract-method-flat-param.js.map +1 -1
- package/dist/lib/contract/contract-methods/contract-method-object-param.js +21 -28
- package/dist/lib/contract/contract-methods/contract-method-object-param.js.map +1 -1
- package/dist/lib/contract/contract-methods/contract-on-chain-view.js +142 -0
- package/dist/lib/contract/contract-methods/contract-on-chain-view.js.map +1 -0
- package/dist/lib/contract/contract.js +114 -162
- package/dist/lib/contract/contract.js.map +1 -1
- package/dist/lib/contract/errors.js +68 -24
- package/dist/lib/contract/errors.js.map +1 -1
- package/dist/lib/contract/estimate.js +74 -112
- package/dist/lib/contract/estimate.js.map +1 -1
- package/dist/lib/contract/lambda-view.js +39 -95
- package/dist/lib/contract/lambda-view.js.map +1 -1
- package/dist/lib/contract/manager-lambda.js +10 -10
- package/dist/lib/contract/manager-lambda.js.map +1 -1
- package/dist/lib/contract/naive-estimate-provider.js +49 -143
- package/dist/lib/contract/naive-estimate-provider.js.map +1 -1
- package/dist/lib/contract/prepare.js +96 -160
- package/dist/lib/contract/prepare.js.map +1 -1
- package/dist/lib/contract/rpc-contract-provider.js +237 -523
- package/dist/lib/contract/rpc-contract-provider.js.map +1 -1
- package/dist/lib/contract/rpc-estimate-provider.js +209 -532
- package/dist/lib/contract/rpc-estimate-provider.js.map +1 -1
- package/dist/lib/contract/sapling-state-abstraction.js +9 -39
- package/dist/lib/contract/sapling-state-abstraction.js.map +1 -1
- package/dist/lib/contract/semantic.js +9 -9
- package/dist/lib/contract/semantic.js.map +1 -1
- package/dist/lib/contract/view_lambda.js +4 -4
- package/dist/lib/contract/view_lambda.js.map +1 -1
- package/dist/lib/forger/composite-forger.js +26 -61
- package/dist/lib/forger/composite-forger.js.map +1 -1
- package/dist/lib/forger/rpc-forger.js +6 -8
- package/dist/lib/forger/rpc-forger.js.map +1 -1
- package/dist/lib/format.js +5 -7
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/global-constants/default-global-constants-provider.js +47 -0
- package/dist/lib/global-constants/default-global-constants-provider.js.map +1 -0
- package/dist/lib/global-constants/error.js +19 -0
- package/dist/lib/global-constants/error.js.map +1 -0
- package/dist/lib/global-constants/interface-global-constants-provider.js +3 -0
- package/dist/lib/global-constants/interface-global-constants-provider.js.map +1 -0
- package/dist/lib/global-constants/noop-global-constants-provider.js +22 -0
- package/dist/lib/global-constants/noop-global-constants-provider.js.map +1 -0
- package/dist/lib/injector/rpc-injector.js +5 -6
- package/dist/lib/injector/rpc-injector.js.map +1 -1
- package/dist/lib/operations/batch-operation.js +43 -87
- package/dist/lib/operations/batch-operation.js.map +1 -1
- package/dist/lib/operations/delegate-operation.js +44 -96
- package/dist/lib/operations/delegate-operation.js.map +1 -1
- package/dist/lib/operations/operation-emitter.js +184 -340
- package/dist/lib/operations/operation-emitter.js.map +1 -1
- package/dist/lib/operations/operation-errors.js +29 -64
- package/dist/lib/operations/operation-errors.js.map +1 -1
- package/dist/lib/operations/operations.js +80 -148
- package/dist/lib/operations/operations.js.map +1 -1
- package/dist/lib/operations/origination-operation.js +59 -145
- package/dist/lib/operations/origination-operation.js.map +1 -1
- package/dist/lib/operations/register-global-constant-operation.js +38 -82
- package/dist/lib/operations/register-global-constant-operation.js.map +1 -1
- package/dist/lib/operations/reveal-operation.js +50 -106
- package/dist/lib/operations/reveal-operation.js.map +1 -1
- package/dist/lib/operations/transaction-operation.js +54 -114
- package/dist/lib/operations/transaction-operation.js.map +1 -1
- package/dist/lib/operations/types.js +11 -22
- package/dist/lib/operations/types.js.map +1 -1
- package/dist/lib/packer/michel-codec-packer.js +8 -41
- package/dist/lib/packer/michel-codec-packer.js.map +1 -1
- package/dist/lib/packer/rpc-packer.js +7 -37
- package/dist/lib/packer/rpc-packer.js.map +1 -1
- package/dist/lib/parser/michel-codec-parser.js +103 -159
- package/dist/lib/parser/michel-codec-parser.js.map +1 -1
- package/dist/lib/parser/noop-parser.js +6 -38
- package/dist/lib/parser/noop-parser.js.map +1 -1
- package/dist/lib/signer/noop.js +22 -61
- package/dist/lib/signer/noop.js.map +1 -1
- package/dist/lib/subscribe/filters.js +13 -33
- package/dist/lib/subscribe/filters.js.map +1 -1
- package/dist/lib/subscribe/observable-subscription.js +32 -56
- package/dist/lib/subscribe/observable-subscription.js.map +1 -1
- package/dist/lib/subscribe/polling-provider.js +24 -81
- package/dist/lib/subscribe/polling-provider.js.map +1 -1
- package/dist/lib/taquito.js +117 -142
- package/dist/lib/taquito.js.map +1 -1
- package/dist/lib/tz/rpc-tz-provider.js +37 -97
- package/dist/lib/tz/rpc-tz-provider.js.map +1 -1
- package/dist/lib/version.js +2 -4
- package/dist/lib/version.js.map +1 -1
- package/dist/lib/wallet/batch-operation.js +31 -89
- package/dist/lib/wallet/batch-operation.js.map +1 -1
- package/dist/lib/wallet/delegation-operation.js +29 -94
- package/dist/lib/wallet/delegation-operation.js.map +1 -1
- package/dist/lib/wallet/legacy.js +25 -86
- package/dist/lib/wallet/legacy.js.map +1 -1
- package/dist/lib/wallet/operation-factory.js +61 -191
- package/dist/lib/wallet/operation-factory.js.map +1 -1
- package/dist/lib/wallet/operation.js +79 -185
- package/dist/lib/wallet/operation.js.map +1 -1
- package/dist/lib/wallet/origination-operation.js +36 -108
- package/dist/lib/wallet/origination-operation.js.map +1 -1
- package/dist/lib/wallet/receipt.js +20 -21
- package/dist/lib/wallet/receipt.js.map +1 -1
- package/dist/lib/wallet/transaction-operation.js +29 -94
- package/dist/lib/wallet/transaction-operation.js.map +1 -1
- package/dist/lib/wallet/wallet.js +133 -311
- package/dist/lib/wallet/wallet.js.map +1 -1
- package/dist/taquito.es6.js +4573 -0
- package/dist/taquito.es6.js.map +1 -0
- package/dist/taquito.min.js +1 -1
- package/dist/taquito.umd.js +2741 -4196
- package/dist/taquito.umd.js.map +1 -1
- package/dist/types/batch/rpc-batch-provider.d.ts +2 -1
- package/dist/types/constants.d.ts +9 -3
- package/dist/types/context.d.ts +7 -4
- package/dist/types/contract/contract-methods/contract-method-factory.d.ts +9 -3
- package/dist/types/contract/contract-methods/contract-method-flat-param.d.ts +1 -1
- package/dist/types/contract/contract-methods/contract-method-object-param.d.ts +2 -2
- package/dist/types/contract/contract-methods/contract-on-chain-view.d.ts +42 -0
- package/dist/types/contract/contract.d.ts +32 -15
- package/dist/types/contract/errors.d.ts +28 -8
- package/dist/types/contract/interface.d.ts +2 -2
- package/dist/types/contract/lambda-view.d.ts +1 -1
- package/dist/types/contract/prepare.d.ts +1 -1
- package/dist/types/contract/rpc-contract-provider.d.ts +3 -3
- package/dist/types/forger/composite-forger.d.ts +1 -2
- package/dist/types/global-constants/default-global-constants-provider.d.ts +18 -0
- package/dist/types/global-constants/error.d.ts +9 -0
- package/dist/types/global-constants/interface-global-constants-provider.d.ts +11 -0
- package/dist/types/global-constants/noop-global-constants-provider.d.ts +5 -0
- package/dist/types/operations/operation-emitter.d.ts +3 -3
- package/dist/types/operations/operation-errors.d.ts +2 -4
- package/dist/types/operations/origination-operation.d.ts +3 -2
- package/dist/types/operations/types.d.ts +2 -2
- package/dist/types/parser/michel-codec-parser.d.ts +1 -0
- package/dist/types/signer/interface.d.ts +1 -1
- package/dist/types/signer/noop.d.ts +2 -2
- package/dist/types/taquito.d.ts +28 -1
- package/dist/types/wallet/interface.d.ts +1 -1
- package/dist/types/wallet/legacy.d.ts +1 -1
- package/dist/types/wallet/operation.d.ts +2 -2
- package/dist/types/wallet/origination-operation.d.ts +3 -2
- package/dist/types/wallet/wallet.d.ts +5 -4
- package/package.json +30 -31
- package/dist/taquito.es5.js +0 -6036
- package/dist/taquito.es5.js.map +0 -1
package/dist/lib/context.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -19,77 +8,60 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
9
|
});
|
|
21
10
|
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
12
|
exports.Context = exports.defaultConfigStreamer = exports.defaultConfigConfirmation = void 0;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
13
|
+
const rpc_1 = require("@taquito/rpc");
|
|
14
|
+
const rpc_forger_1 = require("./forger/rpc-forger");
|
|
15
|
+
const rpc_injector_1 = require("./injector/rpc-injector");
|
|
16
|
+
const noop_1 = require("./signer/noop");
|
|
17
|
+
const operation_factory_1 = require("./wallet/operation-factory");
|
|
18
|
+
const rpc_tz_provider_1 = require("./tz/rpc-tz-provider");
|
|
19
|
+
const rpc_estimate_provider_1 = require("./contract/rpc-estimate-provider");
|
|
20
|
+
const rpc_contract_provider_1 = require("./contract/rpc-contract-provider");
|
|
21
|
+
const rpc_batch_provider_1 = require("./batch/rpc-batch-provider");
|
|
22
|
+
const wallet_1 = require("./wallet");
|
|
23
|
+
const michel_codec_parser_1 = require("./parser/michel-codec-parser");
|
|
24
|
+
const rpc_packer_1 = require("./packer/rpc-packer");
|
|
25
|
+
const bignumber_js_1 = require("bignumber.js");
|
|
26
|
+
const operators_1 = require("rxjs/operators");
|
|
27
|
+
const rxjs_1 = require("rxjs");
|
|
28
|
+
const noop_global_constants_provider_1 = require("./global-constants/noop-global-constants-provider");
|
|
66
29
|
exports.defaultConfigConfirmation = {
|
|
67
30
|
defaultConfirmationCount: 1,
|
|
68
|
-
confirmationPollingTimeoutSecond: 180
|
|
31
|
+
confirmationPollingTimeoutSecond: 180,
|
|
69
32
|
};
|
|
70
33
|
exports.defaultConfigStreamer = {
|
|
71
34
|
streamerPollingIntervalMilliseconds: 20000,
|
|
72
35
|
shouldObservableSubscriptionRetry: false,
|
|
73
|
-
observableSubscriptionRetryFunction: operators_1.retry()
|
|
36
|
+
observableSubscriptionRetryFunction: operators_1.retry(),
|
|
74
37
|
};
|
|
75
38
|
/**
|
|
76
39
|
* @description Encapsulate common service used throughout different part of the library
|
|
77
40
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (_signer === void 0) { _signer = new noop_1.NoopSigner(); }
|
|
81
|
-
if (_config === void 0) { _config = new rxjs_1.BehaviorSubject(__assign(__assign({}, exports.defaultConfigStreamer), exports.defaultConfigConfirmation)); }
|
|
41
|
+
class Context {
|
|
42
|
+
constructor(_rpc, _signer = new noop_1.NoopSigner(), _proto, _config = new rxjs_1.BehaviorSubject(Object.assign(Object.assign({}, exports.defaultConfigStreamer), exports.defaultConfigConfirmation)), forger, injector, packer, wallet, parser, globalConstantsProvider) {
|
|
82
43
|
this._rpc = _rpc;
|
|
83
44
|
this._signer = _signer;
|
|
84
45
|
this._proto = _proto;
|
|
85
46
|
this._config = _config;
|
|
86
|
-
this._extensions = {};
|
|
87
47
|
this.providerDecorator = [];
|
|
88
48
|
this.tz = new rpc_tz_provider_1.RpcTzProvider(this);
|
|
89
49
|
this.estimate = new rpc_estimate_provider_1.RPCEstimateProvider(this);
|
|
90
50
|
this.contract = new rpc_contract_provider_1.RpcContractProvider(this, this.estimate);
|
|
91
51
|
this.batch = new rpc_batch_provider_1.RPCBatchProvider(this, this.estimate);
|
|
92
52
|
this.wallet = new wallet_1.Wallet(this);
|
|
53
|
+
/**
|
|
54
|
+
* @description Applies the decorators on a cloned instance of the context and returned this cloned instance.
|
|
55
|
+
* The decorators are functions that inject logic into the context.
|
|
56
|
+
* They are provided by the extensions set on the TezosToolkit by calling the registerProviderDecorator method.
|
|
57
|
+
*/
|
|
58
|
+
this.withExtensions = () => {
|
|
59
|
+
let clonedContext = this.clone();
|
|
60
|
+
this.providerDecorator.forEach((decorator) => {
|
|
61
|
+
clonedContext = decorator(clonedContext);
|
|
62
|
+
});
|
|
63
|
+
return clonedContext;
|
|
64
|
+
};
|
|
93
65
|
if (typeof this._rpc === 'string') {
|
|
94
66
|
this._rpcClient = new rpc_1.RpcClient(this._rpc);
|
|
95
67
|
}
|
|
@@ -102,180 +74,128 @@ var Context = /** @class */ (function () {
|
|
|
102
74
|
this._walletProvider = wallet ? wallet : new wallet_1.LegacyWalletProvider(this);
|
|
103
75
|
this._parser = parser ? parser : new michel_codec_parser_1.MichelCodecParser(this);
|
|
104
76
|
this._packer = packer ? packer : new rpc_packer_1.RpcPacker(this);
|
|
77
|
+
this._globalConstantsProvider = globalConstantsProvider
|
|
78
|
+
? globalConstantsProvider
|
|
79
|
+
: new noop_global_constants_provider_1.NoopGlobalConstantsProvider();
|
|
105
80
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
});
|
|
179
|
-
Object.defineProperty(Context.prototype, "parser", {
|
|
180
|
-
get: function () {
|
|
181
|
-
return this._parser;
|
|
182
|
-
},
|
|
183
|
-
set: function (value) {
|
|
184
|
-
this._parser = value;
|
|
185
|
-
},
|
|
186
|
-
enumerable: false,
|
|
187
|
-
configurable: true
|
|
188
|
-
});
|
|
189
|
-
Object.defineProperty(Context.prototype, "packer", {
|
|
190
|
-
get: function () {
|
|
191
|
-
return this._packer;
|
|
192
|
-
},
|
|
193
|
-
set: function (value) {
|
|
194
|
-
this._packer = value;
|
|
195
|
-
},
|
|
196
|
-
enumerable: false,
|
|
197
|
-
configurable: true
|
|
198
|
-
});
|
|
199
|
-
Context.prototype.isAnyProtocolActive = function (protocol) {
|
|
200
|
-
if (protocol === void 0) { protocol = []; }
|
|
201
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
202
|
-
var next_protocol;
|
|
203
|
-
return __generator(this, function (_a) {
|
|
204
|
-
switch (_a.label) {
|
|
205
|
-
case 0:
|
|
206
|
-
if (!this._proto) return [3 /*break*/, 1];
|
|
207
|
-
return [2 /*return*/, protocol.includes(this._proto)];
|
|
208
|
-
case 1: return [4 /*yield*/, this.rpc.getBlockMetadata()];
|
|
209
|
-
case 2:
|
|
210
|
-
next_protocol = (_a.sent()).next_protocol;
|
|
211
|
-
return [2 /*return*/, protocol.includes(next_protocol)];
|
|
212
|
-
}
|
|
213
|
-
});
|
|
81
|
+
get config() {
|
|
82
|
+
return this._config.getValue();
|
|
83
|
+
}
|
|
84
|
+
set config(value) {
|
|
85
|
+
this._config.next(Object.assign({}, value));
|
|
86
|
+
}
|
|
87
|
+
setPartialConfig(value) {
|
|
88
|
+
this._config.next(Object.assign(Object.assign({}, this._config.getValue()), value));
|
|
89
|
+
}
|
|
90
|
+
get rpc() {
|
|
91
|
+
return this._rpcClient;
|
|
92
|
+
}
|
|
93
|
+
set rpc(value) {
|
|
94
|
+
this._rpcClient = value;
|
|
95
|
+
}
|
|
96
|
+
get injector() {
|
|
97
|
+
return this._injector;
|
|
98
|
+
}
|
|
99
|
+
set injector(value) {
|
|
100
|
+
this._injector = value;
|
|
101
|
+
}
|
|
102
|
+
get forger() {
|
|
103
|
+
return this._forger;
|
|
104
|
+
}
|
|
105
|
+
set forger(value) {
|
|
106
|
+
this._forger = value;
|
|
107
|
+
}
|
|
108
|
+
get signer() {
|
|
109
|
+
return this._signer;
|
|
110
|
+
}
|
|
111
|
+
set signer(value) {
|
|
112
|
+
this._signer = value;
|
|
113
|
+
}
|
|
114
|
+
get walletProvider() {
|
|
115
|
+
return this._walletProvider;
|
|
116
|
+
}
|
|
117
|
+
set walletProvider(value) {
|
|
118
|
+
this._walletProvider = value;
|
|
119
|
+
}
|
|
120
|
+
set proto(value) {
|
|
121
|
+
this._proto = value;
|
|
122
|
+
}
|
|
123
|
+
get proto() {
|
|
124
|
+
return this._proto;
|
|
125
|
+
}
|
|
126
|
+
get parser() {
|
|
127
|
+
return this._parser;
|
|
128
|
+
}
|
|
129
|
+
set parser(value) {
|
|
130
|
+
this._parser = value;
|
|
131
|
+
}
|
|
132
|
+
get packer() {
|
|
133
|
+
return this._packer;
|
|
134
|
+
}
|
|
135
|
+
set packer(value) {
|
|
136
|
+
this._packer = value;
|
|
137
|
+
}
|
|
138
|
+
get globalConstantsProvider() {
|
|
139
|
+
return this._globalConstantsProvider;
|
|
140
|
+
}
|
|
141
|
+
set globalConstantsProvider(value) {
|
|
142
|
+
this._globalConstantsProvider = value;
|
|
143
|
+
}
|
|
144
|
+
isAnyProtocolActive(protocol = []) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
if (this._proto) {
|
|
147
|
+
return protocol.includes(this._proto);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
const { next_protocol } = yield this.rpc.getBlockMetadata();
|
|
151
|
+
return protocol.includes(next_protocol);
|
|
152
|
+
}
|
|
214
153
|
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return [4 /*yield*/, this.rpc.getConstants()];
|
|
227
|
-
case 2:
|
|
228
|
-
constants = _a.sent();
|
|
229
|
-
blockTime = constants.time_between_blocks[0];
|
|
230
|
-
if (constants.minimal_block_delay !== undefined) {
|
|
231
|
-
blockTime = constants.minimal_block_delay;
|
|
232
|
-
}
|
|
233
|
-
confirmationPollingInterval = bignumber_js_1.default.sum(blockTime, new bignumber_js_1.default(constants.delay_per_missing_endorsement)
|
|
234
|
-
.multipliedBy(Math.max(0, constants.initial_endorsers - constants.endorsers_per_block)));
|
|
235
|
-
// Divide the polling interval by a constant 3
|
|
236
|
-
// to improvise for polling time to work in prod,
|
|
237
|
-
// testnet and sandbox enviornment.
|
|
238
|
-
confirmationPollingInterval = confirmationPollingInterval.dividedBy(3);
|
|
239
|
-
this.config.confirmationPollingIntervalSecond = confirmationPollingInterval.toNumber() === 0 ?
|
|
240
|
-
0.1 :
|
|
241
|
-
confirmationPollingInterval.toNumber();
|
|
242
|
-
return [2 /*return*/, this.config.confirmationPollingIntervalSecond];
|
|
243
|
-
case 3:
|
|
244
|
-
exception_1 = _a.sent();
|
|
245
|
-
// Return default value if there is
|
|
246
|
-
// an issue returning from constants
|
|
247
|
-
// file.
|
|
248
|
-
return [2 /*return*/, defaultInterval];
|
|
249
|
-
case 4: return [2 /*return*/];
|
|
154
|
+
}
|
|
155
|
+
getConfirmationPollingInterval() {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
// Granada will generally halve the time between blocks, from 60 seconds to 30 seconds (mainnet).
|
|
158
|
+
// We reduce the default value in the same proportion, from 10 to 5.
|
|
159
|
+
const defaultInterval = 5;
|
|
160
|
+
try {
|
|
161
|
+
const constants = yield this.rpc.getConstants();
|
|
162
|
+
let blockTime = constants.time_between_blocks[0];
|
|
163
|
+
if (constants.minimal_block_delay !== undefined) {
|
|
164
|
+
blockTime = constants.minimal_block_delay;
|
|
250
165
|
}
|
|
251
|
-
|
|
166
|
+
let confirmationPollingInterval = bignumber_js_1.default.sum(blockTime,
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
168
|
+
new bignumber_js_1.default(constants.delay_per_missing_endorsement).multipliedBy(
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
170
|
+
Math.max(0, constants.initial_endorsers - constants.endorsers_per_block)));
|
|
171
|
+
// Divide the polling interval by a constant 3
|
|
172
|
+
// to improvise for polling time to work in prod,
|
|
173
|
+
// testnet and sandbox enviornment.
|
|
174
|
+
confirmationPollingInterval = confirmationPollingInterval.dividedBy(3);
|
|
175
|
+
this.config.confirmationPollingIntervalSecond =
|
|
176
|
+
confirmationPollingInterval.toNumber() === 0 ? 0.1 : confirmationPollingInterval.toNumber();
|
|
177
|
+
return this.config.confirmationPollingIntervalSecond;
|
|
178
|
+
}
|
|
179
|
+
catch (exception) {
|
|
180
|
+
// Return default value if there is
|
|
181
|
+
// an issue returning from constants
|
|
182
|
+
// file.
|
|
183
|
+
return defaultInterval;
|
|
184
|
+
}
|
|
252
185
|
});
|
|
253
|
-
}
|
|
186
|
+
}
|
|
254
187
|
/**
|
|
255
188
|
* @description Create a copy of the current context. Useful when you have long running operation and you do not want a context change to affect the operation
|
|
256
189
|
*/
|
|
257
|
-
|
|
190
|
+
clone() {
|
|
258
191
|
return new Context(this.rpc, this.signer, this.proto, this._config, this.forger, this._injector, this.packer);
|
|
259
|
-
}
|
|
192
|
+
}
|
|
260
193
|
/**
|
|
261
194
|
* @description Allows extensions set on the TezosToolkit to inject logic into the context
|
|
262
195
|
*/
|
|
263
|
-
|
|
196
|
+
registerProviderDecorator(fx) {
|
|
264
197
|
this.providerDecorator.push(fx);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
* @description Applies the decorators on a cloned instance of the context and returned this cloned instance.
|
|
268
|
-
* The decorators are functions that inject logic into the context.
|
|
269
|
-
* They are provided by the extensions set on the TezosToolkit by calling the registerProviderDecorator method.
|
|
270
|
-
*/
|
|
271
|
-
Context.prototype.withExtensions = function () {
|
|
272
|
-
var currentContext = this;
|
|
273
|
-
this.providerDecorator.forEach(function (decorator) {
|
|
274
|
-
currentContext = decorator(currentContext.clone());
|
|
275
|
-
});
|
|
276
|
-
return currentContext;
|
|
277
|
-
};
|
|
278
|
-
return Context;
|
|
279
|
-
}());
|
|
198
|
+
}
|
|
199
|
+
}
|
|
280
200
|
exports.Context = Context;
|
|
281
201
|
//# sourceMappingURL=context.js.map
|
package/dist/lib/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAA6D;AAG7D,oDAAgD;AAEhD,0DAAsD;AAEtD,wCAA2C;AAC3C,kEAA8D;AAC9D,0DAAqD;AACrD,4EAAuE;AACvE,4EAAuE;AACvE,mEAA8D;AAE9D,qCAAwE;AAExE,sEAAiE;AAEjE,oDAAgD;AAChD,+CAAqC;AACrC,8CAAuC;AACvC,+BAAyD;AAEzD,sGAAgG;AAYnF,QAAA,yBAAyB,GAAuB;IAC3D,wBAAwB,EAAE,CAAC;IAC3B,gCAAgC,EAAE,GAAG;CACtC,CAAC;AAWW,QAAA,qBAAqB,GAAmB;IACnD,mCAAmC,EAAE,KAAK;IAC1C,iCAAiC,EAAE,KAAK;IACxC,mCAAmC,EAAE,iBAAK,EAAE;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAa,OAAO;IAgBlB,YACU,IAAiC,EACjC,UAAkB,IAAI,iBAAU,EAAE,EAClC,MAAkB,EACV,UAAU,IAAI,sBAAe,iCACxC,6BAAqB,GACrB,iCAAyB,EAC5B,EACF,MAAe,EACf,QAAmB,EACnB,MAAe,EACf,MAAuB,EACvB,MAAuB,EACvB,uBAAiD;QAZzC,SAAI,GAAJ,IAAI,CAA6B;QACjC,YAAO,GAAP,OAAO,CAA2B;QAClC,WAAM,GAAN,MAAM,CAAY;QACV,YAAO,GAAP,OAAO,CAGrB;QAfI,sBAAiB,GAAyC,EAAE,CAAC;QAErD,OAAE,GAAG,IAAI,+BAAa,C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,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;CAeF;AAvND,0BAuNC"}
|
|
@@ -8,38 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.BigMapAbstraction = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
13
|
+
const http_utils_1 = require("@taquito/http-utils");
|
|
14
|
+
class BigMapAbstraction {
|
|
15
|
+
constructor(id, schema, provider) {
|
|
43
16
|
this.id = id;
|
|
44
17
|
this.schema = schema;
|
|
45
18
|
this.provider = provider;
|
|
@@ -53,31 +26,22 @@ var BigMapAbstraction = /** @class */ (function () {
|
|
|
53
26
|
* @returns Return a well formatted json object of a big map value or undefined if the key is not found in the big map
|
|
54
27
|
*
|
|
55
28
|
*/
|
|
56
|
-
|
|
57
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
e_1 = _a.sent();
|
|
69
|
-
if (e_1 instanceof http_utils_1.HttpResponseError && e_1.status === http_utils_1.STATUS_CODE.NOT_FOUND) {
|
|
70
|
-
return [2 /*return*/, undefined];
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
throw e_1;
|
|
74
|
-
}
|
|
75
|
-
return [3 /*break*/, 3];
|
|
76
|
-
case 3: return [2 /*return*/];
|
|
29
|
+
get(keyToEncode, block) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
try {
|
|
32
|
+
const id = yield this.provider.getBigMapKeyByID(this.id.toString(), keyToEncode, this.schema, block);
|
|
33
|
+
return id;
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
if (e instanceof http_utils_1.HttpResponseError && e.status === http_utils_1.STATUS_CODE.NOT_FOUND) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
throw e;
|
|
77
41
|
}
|
|
78
|
-
}
|
|
42
|
+
}
|
|
79
43
|
});
|
|
80
|
-
}
|
|
44
|
+
}
|
|
81
45
|
/**
|
|
82
46
|
*
|
|
83
47
|
* @description Fetch multiple values in a big map
|
|
@@ -91,21 +55,17 @@ var BigMapAbstraction = /** @class */ (function () {
|
|
|
91
55
|
* @returns A MichelsonMap containing the keys queried in the big map and their value in a well-formatted JSON object format
|
|
92
56
|
*
|
|
93
57
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return __generator(this, function (_a) {
|
|
98
|
-
return [2 /*return*/, this.provider.getBigMapKeysByID(this.id.toString(), keysToEncode, this.schema, block, batchSize)];
|
|
99
|
-
});
|
|
58
|
+
getMultipleValues(keysToEncode, block, batchSize = 5) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
return this.provider.getBigMapKeysByID(this.id.toString(), keysToEncode, this.schema, block, batchSize);
|
|
100
61
|
});
|
|
101
|
-
}
|
|
102
|
-
|
|
62
|
+
}
|
|
63
|
+
toJSON() {
|
|
103
64
|
return this.id.toString();
|
|
104
|
-
}
|
|
105
|
-
|
|
65
|
+
}
|
|
66
|
+
toString() {
|
|
106
67
|
return this.id.toString();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
}());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
110
70
|
exports.BigMapAbstraction = BigMapAbstraction;
|
|
111
71
|
//# sourceMappingURL=big-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"big-map.js","sourceRoot":"","sources":["../../../src/contract/big-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"big-map.js","sourceRoot":"","sources":["../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ose = void 0;
|
|
4
4
|
function compose(functioncomposer1, functioncomposer2) {
|
|
5
|
-
return
|
|
6
|
-
return functioncomposer2(functioncomposer1(contractAbstraction, context), context);
|
|
7
|
-
};
|
|
5
|
+
return (contractAbstraction, context) => functioncomposer2(functioncomposer1(contractAbstraction, context), context);
|
|
8
6
|
}
|
|
9
7
|
exports.compose = compose;
|
|
10
8
|
//# sourceMappingURL=compose.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/contract/compose.ts"],"names":[],"mappings":";;;AAKA,SAAgB,OAAO,CAKnB,iBAAwF,EACxF,iBAA+F;IAE/F,OAAO,
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/contract/compose.ts"],"names":[],"mappings":";;;AAKA,SAAgB,OAAO,CAKnB,iBAAwF,EACxF,iBAA+F;IAE/F,OAAO,CAAC,mBAAmB,EAAE,OAAO,EAAE,EAAE,CACpC,iBAAiB,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AACpF,CAAC;AAVD,0BAUC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContractMethodFactory = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const contract_method_object_param_1 = require("./contract-method-object-param");
|
|
5
|
+
const contract_method_flat_param_1 = require("./contract-method-flat-param");
|
|
6
|
+
const contract_on_chain_view_1 = require("./contract-on-chain-view");
|
|
7
|
+
class ContractMethodFactory {
|
|
8
|
+
constructor(provider, contractAddress) {
|
|
9
|
+
this.provider = provider;
|
|
10
|
+
this.contractAddress = contractAddress;
|
|
8
11
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return ContractMethodFactory;
|
|
20
|
-
}());
|
|
12
|
+
createContractMethodFlatParams(smartContractMethodSchema, smartContractMethodName, args, isMultipleEntrypoint = true, isAnonymous = false) {
|
|
13
|
+
return new contract_method_flat_param_1.ContractMethod(this.provider, this.contractAddress, smartContractMethodSchema, smartContractMethodName, args, isMultipleEntrypoint, isAnonymous);
|
|
14
|
+
}
|
|
15
|
+
createContractMethodObjectParam(smartContractMethodSchema, smartContractMethodName, args, isMultipleEntrypoint = true, isAnonymous = false) {
|
|
16
|
+
return new contract_method_object_param_1.ContractMethodObject(this.provider, this.contractAddress, smartContractMethodSchema, smartContractMethodName, args, isMultipleEntrypoint, isAnonymous);
|
|
17
|
+
}
|
|
18
|
+
createContractViewObjectParam(rpc, smartContractViewSchema, contractStorageType, contractStorageValue, viewArgs) {
|
|
19
|
+
return new contract_on_chain_view_1.OnChainView(rpc, this.contractAddress, smartContractViewSchema, contractStorageType, contractStorageValue, viewArgs);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
21
22
|
exports.ContractMethodFactory = ContractMethodFactory;
|
|
22
23
|
//# sourceMappingURL=contract-method-factory.js.map
|