@taquito/taquito 18.0.0-RC.0 → 19.0.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 +18 -19
- package/dist/lib/constants.js +31 -35
- package/dist/lib/context.js +0 -1
- package/dist/lib/contract/big-map.js +0 -1
- package/dist/lib/contract/compose.js +0 -1
- package/dist/lib/contract/contract-methods/contract-method-factory.js +0 -1
- package/dist/lib/contract/contract-methods/contract-method-flat-param.js +0 -1
- package/dist/lib/contract/contract-methods/contract-method-interface.js +0 -1
- package/dist/lib/contract/contract-methods/contract-method-object-param.js +0 -1
- package/dist/lib/contract/contract-methods/contract-on-chain-view.js +3 -4
- package/dist/lib/contract/contract.js +3 -4
- package/dist/lib/contract/errors.js +0 -1
- package/dist/lib/contract/index.js +8 -3
- package/dist/lib/contract/interface.js +0 -1
- package/dist/lib/contract/lambda-view.js +0 -1
- package/dist/lib/contract/manager-lambda.js +0 -1
- package/dist/lib/contract/prepare.js +3 -4
- package/dist/lib/contract/rpc-contract-provider.js +25 -26
- package/dist/lib/contract/sapling-state-abstraction.js +0 -1
- package/dist/lib/contract/semantic.js +5 -2
- package/dist/lib/contract/view_lambda.js +0 -1
- package/dist/lib/errors.js +0 -1
- package/dist/lib/estimate/errors.js +0 -1
- package/dist/lib/estimate/estimate-provider-interface.js +0 -1
- package/dist/lib/estimate/estimate.js +0 -1
- package/dist/lib/estimate/index.js +5 -2
- package/dist/lib/estimate/rpc-estimate-provider.js +16 -17
- package/dist/lib/extension/extension.js +0 -1
- package/dist/lib/forger/composite-forger.js +0 -1
- package/dist/lib/forger/errors.js +0 -1
- package/dist/lib/forger/rpc-forger.js +0 -1
- package/dist/lib/forger/taquito-local-forger.js +0 -1
- package/dist/lib/global-constants/default-global-constants-provider.js +0 -1
- package/dist/lib/global-constants/errors.js +0 -1
- package/dist/lib/global-constants/interface-global-constants-provider.js +0 -1
- package/dist/lib/global-constants/noop-global-constants-provider.js +0 -1
- package/dist/lib/injector/helper.js +0 -1
- package/dist/lib/injector/interface.js +0 -1
- package/dist/lib/injector/rpc-injector.js +1 -2
- package/dist/lib/operations/ballot-operation.js +0 -1
- package/dist/lib/operations/batch-operation.js +4 -5
- package/dist/lib/operations/delegate-operation.js +0 -1
- package/dist/lib/operations/drain-delegate-operation.js +0 -1
- package/dist/lib/operations/errors.js +4 -5
- package/dist/lib/operations/failing-noop-operation.js +0 -1
- package/dist/lib/operations/increase-paid-storage-operation.js +0 -1
- package/dist/lib/operations/index.js +0 -1
- package/dist/lib/operations/operations.js +18 -19
- package/dist/lib/operations/origination-operation.js +1 -2
- package/dist/lib/operations/proposals-operation.js +0 -1
- package/dist/lib/operations/register-global-constant-operation.js +0 -1
- package/dist/lib/operations/reveal-operation.js +4 -5
- package/dist/lib/operations/smart-rollup-add-messages-operation.js +0 -1
- package/dist/lib/operations/smart-rollup-originate-operation.js +0 -1
- package/dist/lib/operations/transaction-operation.js +4 -5
- package/dist/lib/operations/transfer-ticket-operation.js +0 -1
- package/dist/lib/operations/types.js +3 -4
- package/dist/lib/operations/update-consensus-key-operation.js +0 -1
- package/dist/lib/packer/interface.js +0 -1
- package/dist/lib/packer/michel-codec-packer.js +1 -2
- package/dist/lib/packer/rpc-packer.js +0 -1
- package/dist/lib/parser/interface.js +0 -1
- package/dist/lib/parser/michel-codec-parser.js +0 -1
- package/dist/lib/parser/noop-parser.js +0 -1
- package/dist/lib/prepare/index.js +5 -2
- package/dist/lib/prepare/interface.js +0 -1
- package/dist/lib/prepare/prepare-provider.js +55 -58
- package/dist/lib/provider.js +13 -14
- package/dist/lib/read-provider/interface.js +0 -1
- package/dist/lib/read-provider/rpc-read-adapter.js +0 -1
- package/dist/lib/signer/errors.js +0 -1
- package/dist/lib/signer/interface.js +0 -1
- package/dist/lib/signer/noop.js +0 -1
- package/dist/lib/subscribe/create-observable-from-subscription.js +0 -1
- package/dist/lib/subscribe/errors.js +0 -1
- package/dist/lib/subscribe/filters.js +4 -5
- package/dist/lib/subscribe/interface.js +0 -1
- package/dist/lib/subscribe/observable-subscription.js +3 -4
- package/dist/lib/subscribe/polling-subcribe-provider.js +12 -13
- package/dist/lib/taquito.js +5 -2
- package/dist/lib/tz/interface.js +0 -1
- package/dist/lib/tz/rpc-tz-provider.js +6 -7
- package/dist/lib/version.js +2 -3
- package/dist/lib/wallet/batch-operation.js +1 -2
- package/dist/lib/wallet/delegation-operation.js +0 -1
- package/dist/lib/wallet/errors.js +0 -1
- package/dist/lib/wallet/increase-paid-storage-operation.js +0 -1
- package/dist/lib/wallet/index.js +5 -2
- package/dist/lib/wallet/interface.js +0 -1
- package/dist/lib/wallet/legacy.js +9 -8
- package/dist/lib/wallet/operation-factory.js +11 -12
- package/dist/lib/wallet/operation.js +33 -34
- package/dist/lib/wallet/origination-operation.js +2 -3
- package/dist/lib/wallet/receipt.js +1 -2
- package/dist/lib/wallet/transaction-operation.js +0 -1
- package/dist/lib/wallet/wallet.js +35 -16
- package/dist/taquito.es6.js +6420 -6395
- package/dist/taquito.es6.js.map +1 -1
- package/dist/taquito.min.js +1 -1
- package/dist/taquito.min.js.LICENSE.txt +1 -1
- package/dist/taquito.umd.js +6426 -6403
- package/dist/taquito.umd.js.map +1 -1
- package/dist/types/batch/rpc-batch-provider.d.ts +121 -121
- package/dist/types/constants.d.ts +80 -80
- package/dist/types/context.d.ts +100 -100
- package/dist/types/contract/big-map.d.ts +35 -35
- package/dist/types/contract/compose.d.ts +5 -5
- package/dist/types/contract/contract-methods/contract-method-factory.d.ts +16 -16
- package/dist/types/contract/contract-methods/contract-method-flat-param.d.ts +43 -43
- package/dist/types/contract/contract-methods/contract-method-interface.d.ts +28 -28
- package/dist/types/contract/contract-methods/contract-method-object-param.d.ts +38 -38
- package/dist/types/contract/contract-methods/contract-on-chain-view.d.ts +43 -43
- package/dist/types/contract/contract.d.ts +94 -94
- package/dist/types/contract/errors.d.ts +83 -83
- package/dist/types/contract/index.d.ts +12 -11
- package/dist/types/contract/interface.d.ts +224 -224
- package/dist/types/contract/lambda-view.d.ts +19 -19
- package/dist/types/contract/manager-lambda.d.ts +73 -73
- package/dist/types/contract/prepare.d.ts +16 -16
- package/dist/types/contract/rpc-contract-provider.d.ts +240 -240
- package/dist/types/contract/sapling-state-abstraction.d.ts +17 -17
- package/dist/types/contract/semantic.d.ts +7 -3
- package/dist/types/contract/view_lambda.d.ts +34 -34
- package/dist/types/errors.d.ts +26 -26
- package/dist/types/estimate/errors.d.ts +8 -8
- package/dist/types/estimate/estimate-provider-interface.d.ts +114 -114
- package/dist/types/estimate/estimate.d.ts +94 -94
- package/dist/types/estimate/index.d.ts +4 -4
- package/dist/types/estimate/rpc-estimate-provider.d.ts +129 -129
- package/dist/types/extension/extension.d.ts +4 -4
- package/dist/types/forger/composite-forger.d.ts +6 -6
- package/dist/types/forger/errors.d.ts +16 -16
- package/dist/types/forger/rpc-forger.d.ts +7 -7
- package/dist/types/forger/taquito-local-forger.d.ts +8 -8
- package/dist/types/global-constants/default-global-constants-provider.d.ts +18 -18
- package/dist/types/global-constants/errors.d.ts +16 -16
- package/dist/types/global-constants/interface-global-constants-provider.d.ts +11 -11
- package/dist/types/global-constants/noop-global-constants-provider.d.ts +5 -5
- package/dist/types/injector/helper.d.ts +2 -2
- package/dist/types/injector/interface.d.ts +5 -5
- package/dist/types/injector/rpc-injector.d.ts +7 -7
- package/dist/types/operations/ballot-operation.d.ts +18 -18
- package/dist/types/operations/batch-operation.d.ts +19 -19
- package/dist/types/operations/delegate-operation.d.ts +24 -24
- package/dist/types/operations/drain-delegate-operation.d.ts +17 -17
- package/dist/types/operations/errors.d.ts +48 -48
- package/dist/types/operations/failing-noop-operation.d.ts +17 -17
- package/dist/types/operations/increase-paid-storage-operation.d.ts +23 -23
- package/dist/types/operations/index.d.ts +9 -9
- package/dist/types/operations/operations.d.ts +35 -35
- package/dist/types/operations/origination-operation.d.ts +35 -35
- package/dist/types/operations/proposals-operation.d.ts +17 -17
- package/dist/types/operations/register-global-constant-operation.d.ts +25 -25
- package/dist/types/operations/reveal-operation.d.ts +24 -24
- package/dist/types/operations/smart-rollup-add-messages-operation.d.ts +20 -20
- package/dist/types/operations/smart-rollup-originate-operation.d.ts +23 -23
- package/dist/types/operations/transaction-operation.d.ts +28 -28
- package/dist/types/operations/transfer-ticket-operation.d.ts +22 -22
- package/dist/types/operations/types.d.ts +373 -373
- package/dist/types/operations/update-consensus-key-operation.d.ts +22 -22
- package/dist/types/packer/interface.d.ts +4 -4
- package/dist/types/packer/michel-codec-packer.d.ts +5 -5
- package/dist/types/packer/rpc-packer.d.ts +8 -8
- package/dist/types/parser/interface.d.ts +4 -4
- package/dist/types/parser/michel-codec-parser.d.ts +16 -16
- package/dist/types/parser/noop-parser.d.ts +5 -5
- package/dist/types/prepare/index.d.ts +2 -2
- package/dist/types/prepare/interface.d.ts +135 -135
- package/dist/types/prepare/prepare-provider.d.ts +174 -174
- package/dist/types/provider.d.ts +49 -49
- package/dist/types/read-provider/interface.d.ts +120 -120
- package/dist/types/read-provider/rpc-read-adapter.d.ts +118 -118
- package/dist/types/signer/errors.d.ts +8 -8
- package/dist/types/signer/interface.d.ts +28 -28
- package/dist/types/signer/noop.d.ts +11 -11
- package/dist/types/subscribe/create-observable-from-subscription.d.ts +4 -4
- package/dist/types/subscribe/errors.d.ts +18 -18
- package/dist/types/subscribe/filters.d.ts +6 -6
- package/dist/types/subscribe/interface.d.ts +48 -48
- package/dist/types/subscribe/observable-subscription.d.ts +21 -21
- package/dist/types/subscribe/polling-subcribe-provider.d.ts +23 -23
- package/dist/types/taquito.d.ts +247 -247
- package/dist/types/tz/interface.d.ts +15 -15
- package/dist/types/tz/rpc-tz-provider.d.ts +12 -12
- package/dist/types/version.d.ts +4 -4
- package/dist/types/wallet/batch-operation.d.ts +12 -12
- package/dist/types/wallet/delegation-operation.d.ts +12 -12
- package/dist/types/wallet/errors.d.ts +16 -16
- package/dist/types/wallet/increase-paid-storage-operation.d.ts +12 -12
- package/dist/types/wallet/index.d.ts +7 -7
- package/dist/types/wallet/interface.d.ts +41 -41
- package/dist/types/wallet/legacy.d.ts +16 -16
- package/dist/types/wallet/operation-factory.d.ts +28 -28
- package/dist/types/wallet/operation.d.ts +54 -54
- package/dist/types/wallet/origination-operation.d.ts +14 -14
- package/dist/types/wallet/receipt.d.ts +16 -16
- package/dist/types/wallet/transaction-operation.d.ts +12 -12
- package/dist/types/wallet/wallet.d.ts +186 -174
- package/package.json +39 -40
- package/signature.json +3 -5
- package/dist/lib/batch/rpc-batch-provider.js.map +0 -1
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/context.js.map +0 -1
- package/dist/lib/contract/big-map.js.map +0 -1
- package/dist/lib/contract/compose.js.map +0 -1
- package/dist/lib/contract/contract-methods/contract-method-factory.js.map +0 -1
- package/dist/lib/contract/contract-methods/contract-method-flat-param.js.map +0 -1
- package/dist/lib/contract/contract-methods/contract-method-interface.js.map +0 -1
- package/dist/lib/contract/contract-methods/contract-method-object-param.js.map +0 -1
- package/dist/lib/contract/contract-methods/contract-on-chain-view.js.map +0 -1
- package/dist/lib/contract/contract.js.map +0 -1
- package/dist/lib/contract/errors.js.map +0 -1
- package/dist/lib/contract/index.js.map +0 -1
- package/dist/lib/contract/interface.js.map +0 -1
- package/dist/lib/contract/lambda-view.js.map +0 -1
- package/dist/lib/contract/manager-lambda.js.map +0 -1
- package/dist/lib/contract/prepare.js.map +0 -1
- package/dist/lib/contract/rpc-contract-provider.js.map +0 -1
- package/dist/lib/contract/sapling-state-abstraction.js.map +0 -1
- package/dist/lib/contract/semantic.js.map +0 -1
- package/dist/lib/contract/view_lambda.js.map +0 -1
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/estimate/errors.js.map +0 -1
- package/dist/lib/estimate/estimate-provider-interface.js.map +0 -1
- package/dist/lib/estimate/estimate.js.map +0 -1
- package/dist/lib/estimate/index.js.map +0 -1
- package/dist/lib/estimate/rpc-estimate-provider.js.map +0 -1
- package/dist/lib/extension/extension.js.map +0 -1
- package/dist/lib/forger/composite-forger.js.map +0 -1
- package/dist/lib/forger/errors.js.map +0 -1
- package/dist/lib/forger/rpc-forger.js.map +0 -1
- package/dist/lib/forger/taquito-local-forger.js.map +0 -1
- package/dist/lib/global-constants/default-global-constants-provider.js.map +0 -1
- package/dist/lib/global-constants/errors.js.map +0 -1
- package/dist/lib/global-constants/interface-global-constants-provider.js.map +0 -1
- package/dist/lib/global-constants/noop-global-constants-provider.js.map +0 -1
- package/dist/lib/injector/helper.js.map +0 -1
- package/dist/lib/injector/interface.js.map +0 -1
- package/dist/lib/injector/rpc-injector.js.map +0 -1
- package/dist/lib/operations/ballot-operation.js.map +0 -1
- package/dist/lib/operations/batch-operation.js.map +0 -1
- package/dist/lib/operations/delegate-operation.js.map +0 -1
- package/dist/lib/operations/drain-delegate-operation.js.map +0 -1
- package/dist/lib/operations/errors.js.map +0 -1
- package/dist/lib/operations/failing-noop-operation.js.map +0 -1
- package/dist/lib/operations/increase-paid-storage-operation.js.map +0 -1
- package/dist/lib/operations/index.js.map +0 -1
- package/dist/lib/operations/operations.js.map +0 -1
- package/dist/lib/operations/origination-operation.js.map +0 -1
- package/dist/lib/operations/proposals-operation.js.map +0 -1
- package/dist/lib/operations/register-global-constant-operation.js.map +0 -1
- package/dist/lib/operations/reveal-operation.js.map +0 -1
- package/dist/lib/operations/smart-rollup-add-messages-operation.js.map +0 -1
- package/dist/lib/operations/smart-rollup-originate-operation.js.map +0 -1
- package/dist/lib/operations/transaction-operation.js.map +0 -1
- package/dist/lib/operations/transfer-ticket-operation.js.map +0 -1
- package/dist/lib/operations/types.js.map +0 -1
- package/dist/lib/operations/update-consensus-key-operation.js.map +0 -1
- package/dist/lib/packer/interface.js.map +0 -1
- package/dist/lib/packer/michel-codec-packer.js.map +0 -1
- package/dist/lib/packer/rpc-packer.js.map +0 -1
- package/dist/lib/parser/interface.js.map +0 -1
- package/dist/lib/parser/michel-codec-parser.js.map +0 -1
- package/dist/lib/parser/noop-parser.js.map +0 -1
- package/dist/lib/prepare/index.js.map +0 -1
- package/dist/lib/prepare/interface.js.map +0 -1
- package/dist/lib/prepare/prepare-provider.js.map +0 -1
- package/dist/lib/provider.js.map +0 -1
- package/dist/lib/read-provider/interface.js.map +0 -1
- package/dist/lib/read-provider/rpc-read-adapter.js.map +0 -1
- package/dist/lib/signer/errors.js.map +0 -1
- package/dist/lib/signer/interface.js.map +0 -1
- package/dist/lib/signer/noop.js.map +0 -1
- package/dist/lib/subscribe/create-observable-from-subscription.js.map +0 -1
- package/dist/lib/subscribe/errors.js.map +0 -1
- package/dist/lib/subscribe/filters.js.map +0 -1
- package/dist/lib/subscribe/interface.js.map +0 -1
- package/dist/lib/subscribe/observable-subscription.js.map +0 -1
- package/dist/lib/subscribe/polling-subcribe-provider.js.map +0 -1
- package/dist/lib/taquito.js.map +0 -1
- package/dist/lib/tz/interface.js.map +0 -1
- package/dist/lib/tz/rpc-tz-provider.js.map +0 -1
- package/dist/lib/version.js.map +0 -1
- package/dist/lib/wallet/batch-operation.js.map +0 -1
- package/dist/lib/wallet/delegation-operation.js.map +0 -1
- package/dist/lib/wallet/errors.js.map +0 -1
- package/dist/lib/wallet/increase-paid-storage-operation.js.map +0 -1
- package/dist/lib/wallet/index.js.map +0 -1
- package/dist/lib/wallet/interface.js.map +0 -1
- package/dist/lib/wallet/legacy.js.map +0 -1
- package/dist/lib/wallet/operation-factory.js.map +0 -1
- package/dist/lib/wallet/operation.js.map +0 -1
- package/dist/lib/wallet/origination-operation.js.map +0 -1
- package/dist/lib/wallet/receipt.js.map +0 -1
- package/dist/lib/wallet/transaction-operation.js.map +0 -1
- package/dist/lib/wallet/wallet.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@ The `@taquito/taquito` package contains higher-level functionality that builds u
|
|
|
7
7
|
## CDN Bundle
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
|
-
<script src="https://unpkg.com/@taquito/taquito@
|
|
11
|
-
crossorigin="anonymous" integrity="sha384-
|
|
10
|
+
<script src="https://unpkg.com/@taquito/taquito@19.0.0/dist/taquito.min.js"
|
|
11
|
+
crossorigin="anonymous" integrity="sha384-IxvP0ECHi5oqLyz94wF85pU9+ktcsL1HHtA42MITxZsGbsUMEu/g+0Vkjj5vqiMR"></script>
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## General Information
|
|
@@ -37,12 +37,12 @@ class OperationBatch extends provider_1.Provider {
|
|
|
37
37
|
* @param params Transfer operation parameter
|
|
38
38
|
*/
|
|
39
39
|
withTransfer(params) {
|
|
40
|
-
const toValidation = utils_1.validateAddress(params.to);
|
|
40
|
+
const toValidation = (0, utils_1.validateAddress)(params.to);
|
|
41
41
|
if (params.amount < 0) {
|
|
42
42
|
throw new core_1.InvalidAmountError(params.amount.toString());
|
|
43
43
|
}
|
|
44
44
|
if (toValidation !== utils_1.ValidationResult.VALID) {
|
|
45
|
-
throw new core_1.InvalidAddressError(params.to, utils_1.invalidDetail(toValidation));
|
|
45
|
+
throw new core_1.InvalidAddressError(params.to, (0, utils_1.invalidDetail)(toValidation));
|
|
46
46
|
}
|
|
47
47
|
this.operations.push(Object.assign({ kind: rpc_1.OpKind.TRANSACTION }, params));
|
|
48
48
|
return this;
|
|
@@ -54,9 +54,9 @@ class OperationBatch extends provider_1.Provider {
|
|
|
54
54
|
* @param params Transfer operation parameter
|
|
55
55
|
*/
|
|
56
56
|
withTransferTicket(params) {
|
|
57
|
-
const destinationValidation = utils_1.validateAddress(params.destination);
|
|
57
|
+
const destinationValidation = (0, utils_1.validateAddress)(params.destination);
|
|
58
58
|
if (destinationValidation !== utils_1.ValidationResult.VALID) {
|
|
59
|
-
throw new core_1.InvalidAddressError(params.destination, utils_1.invalidDetail(destinationValidation));
|
|
59
|
+
throw new core_1.InvalidAddressError(params.destination, (0, utils_1.invalidDetail)(destinationValidation));
|
|
60
60
|
}
|
|
61
61
|
this.operations.push(Object.assign({ kind: rpc_1.OpKind.TRANSFER_TICKET }, params));
|
|
62
62
|
return this;
|
|
@@ -79,13 +79,13 @@ class OperationBatch extends provider_1.Provider {
|
|
|
79
79
|
*/
|
|
80
80
|
withDelegation(params) {
|
|
81
81
|
var _a;
|
|
82
|
-
const sourceValidation = utils_1.validateAddress(params.source);
|
|
82
|
+
const sourceValidation = (0, utils_1.validateAddress)(params.source);
|
|
83
83
|
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) {
|
|
84
|
-
throw new core_1.InvalidAddressError(params.source, utils_1.invalidDetail(sourceValidation));
|
|
84
|
+
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation));
|
|
85
85
|
}
|
|
86
|
-
const delegateValidation = utils_1.validateAddress((_a = params.delegate) !== null && _a !== void 0 ? _a : '');
|
|
86
|
+
const delegateValidation = (0, utils_1.validateAddress)((_a = params.delegate) !== null && _a !== void 0 ? _a : '');
|
|
87
87
|
if (params.delegate && delegateValidation !== utils_1.ValidationResult.VALID) {
|
|
88
|
-
throw new core_1.InvalidAddressError(params.delegate, utils_1.invalidDetail(delegateValidation));
|
|
88
|
+
throw new core_1.InvalidAddressError(params.delegate, (0, utils_1.invalidDetail)(delegateValidation));
|
|
89
89
|
}
|
|
90
90
|
this.operations.push(Object.assign({ kind: rpc_1.OpKind.DELEGATION }, params));
|
|
91
91
|
return this;
|
|
@@ -98,9 +98,9 @@ class OperationBatch extends provider_1.Provider {
|
|
|
98
98
|
* @throws {@link InvalidKeyHashError}
|
|
99
99
|
*/
|
|
100
100
|
withActivation({ pkh, secret }) {
|
|
101
|
-
const pkhValidation = utils_1.validateKeyHash(pkh);
|
|
101
|
+
const pkhValidation = (0, utils_1.validateKeyHash)(pkh);
|
|
102
102
|
if (pkhValidation !== utils_1.ValidationResult.VALID) {
|
|
103
|
-
throw new core_1.InvalidKeyHashError(pkh, utils_1.invalidDetail(pkhValidation));
|
|
103
|
+
throw new core_1.InvalidKeyHashError(pkh, (0, utils_1.invalidDetail)(pkhValidation));
|
|
104
104
|
}
|
|
105
105
|
this.operations.push({ kind: rpc_1.OpKind.ACTIVATION, pkh, secret });
|
|
106
106
|
return this;
|
|
@@ -159,21 +159,21 @@ class OperationBatch extends provider_1.Provider {
|
|
|
159
159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
160
|
switch (param.kind) {
|
|
161
161
|
case rpc_1.OpKind.TRANSACTION:
|
|
162
|
-
return prepare_1.createTransferOperation(Object.assign({}, param));
|
|
162
|
+
return (0, prepare_1.createTransferOperation)(Object.assign({}, param));
|
|
163
163
|
case rpc_1.OpKind.ORIGINATION:
|
|
164
|
-
return prepare_1.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({}, param)));
|
|
164
|
+
return (0, prepare_1.createOriginationOperation)(yield this.context.parser.prepareCodeOrigination(Object.assign({}, param)));
|
|
165
165
|
case rpc_1.OpKind.DELEGATION:
|
|
166
|
-
return prepare_1.createSetDelegateOperation(Object.assign({}, param));
|
|
166
|
+
return (0, prepare_1.createSetDelegateOperation)(Object.assign({}, param));
|
|
167
167
|
case rpc_1.OpKind.REGISTER_GLOBAL_CONSTANT:
|
|
168
|
-
return prepare_1.createRegisterGlobalConstantOperation(Object.assign({}, param));
|
|
168
|
+
return (0, prepare_1.createRegisterGlobalConstantOperation)(Object.assign({}, param));
|
|
169
169
|
case rpc_1.OpKind.INCREASE_PAID_STORAGE:
|
|
170
|
-
return prepare_1.createIncreasePaidStorageOperation(Object.assign({}, param));
|
|
170
|
+
return (0, prepare_1.createIncreasePaidStorageOperation)(Object.assign({}, param));
|
|
171
171
|
case rpc_1.OpKind.TRANSFER_TICKET:
|
|
172
|
-
return prepare_1.createTransferTicketOperation(Object.assign({}, param));
|
|
172
|
+
return (0, prepare_1.createTransferTicketOperation)(Object.assign({}, param));
|
|
173
173
|
case rpc_1.OpKind.SMART_ROLLUP_ADD_MESSAGES:
|
|
174
|
-
return prepare_1.createSmartRollupAddMessagesOperation(Object.assign({}, param));
|
|
174
|
+
return (0, prepare_1.createSmartRollupAddMessagesOperation)(Object.assign({}, param));
|
|
175
175
|
case rpc_1.OpKind.SMART_ROLLUP_ORIGINATE:
|
|
176
|
-
return prepare_1.createSmartRollupOriginateOperation(Object.assign({}, param));
|
|
176
|
+
return (0, prepare_1.createSmartRollupOriginateOperation)(Object.assign({}, param));
|
|
177
177
|
default:
|
|
178
178
|
throw new core_1.InvalidOperationKindError(JSON.stringify(param.kind));
|
|
179
179
|
}
|
|
@@ -264,4 +264,3 @@ class RPCBatchProvider {
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
exports.RPCBatchProvider = RPCBatchProvider;
|
|
267
|
-
//# sourceMappingURL=rpc-batch-provider.js.map
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRevealGasLimit = exports.ChainIds = exports.protocols = exports.Protocols = exports.COST_PER_BYTE = exports.DEFAULT_STORAGE_LIMIT = exports.DEFAULT_FEE = exports.DEFAULT_GAS_LIMIT = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
DEFAULT_GAS_LIMIT[DEFAULT_GAS_LIMIT["TRANSFER"] = 10600] = "TRANSFER";
|
|
4
|
+
exports.DEFAULT_GAS_LIMIT = {
|
|
5
|
+
DELEGATION: 10600,
|
|
6
|
+
ORIGINATION: 10600,
|
|
7
|
+
TRANSFER: 10600,
|
|
9
8
|
/* This is used for gas_limit. There is no harm in setting a higher limit.
|
|
10
9
|
Only if an account has a balance that is very close to the total gas consumption,
|
|
11
10
|
then this margin can fail the operation.
|
|
12
11
|
Another benefit of this higher value is that then Dapps build with Taquito 17 can
|
|
13
12
|
still work with Mumbainet, as this value is higher than the reveal cost in Mumbai.
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
DEFAULT_STORAGE_LIMIT[DEFAULT_STORAGE_LIMIT["REVEAL"] = 0] = "REVEAL";
|
|
33
|
-
})(DEFAULT_STORAGE_LIMIT = exports.DEFAULT_STORAGE_LIMIT || (exports.DEFAULT_STORAGE_LIMIT = {}));
|
|
14
|
+
REVEAL_TZ1: 1000,
|
|
15
|
+
REVEAL_TZ2: 1000,
|
|
16
|
+
REVEAL_TZ3: 2000,
|
|
17
|
+
REVEAL_TZ4: 2000,
|
|
18
|
+
};
|
|
19
|
+
exports.DEFAULT_FEE = {
|
|
20
|
+
DELEGATION: 1257,
|
|
21
|
+
ORIGINATION: 10000,
|
|
22
|
+
TRANSFER: 10000,
|
|
23
|
+
REVEAL: 374,
|
|
24
|
+
};
|
|
25
|
+
exports.DEFAULT_STORAGE_LIMIT = {
|
|
26
|
+
DELEGATION: 0,
|
|
27
|
+
ORIGINATION: 257,
|
|
28
|
+
TRANSFER: 257,
|
|
29
|
+
REVEAL: 0,
|
|
30
|
+
};
|
|
34
31
|
exports.COST_PER_BYTE = 250;
|
|
35
32
|
var Protocols;
|
|
36
33
|
(function (Protocols) {
|
|
@@ -51,9 +48,9 @@ var Protocols;
|
|
|
51
48
|
Protocols["PtMumbaii"] = "PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc";
|
|
52
49
|
Protocols["PtMumbai2"] = "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1";
|
|
53
50
|
Protocols["PtNairobi"] = "PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf";
|
|
54
|
-
Protocols["
|
|
51
|
+
Protocols["ProxfordY"] = "ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH";
|
|
55
52
|
Protocols["ProtoALpha"] = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK";
|
|
56
|
-
})(Protocols
|
|
53
|
+
})(Protocols || (exports.Protocols = Protocols = {}));
|
|
57
54
|
exports.protocols = {
|
|
58
55
|
'004': [Protocols.Pt24m4xi],
|
|
59
56
|
'005': [Protocols.PsBABY5H, Protocols.PsBabyM1],
|
|
@@ -69,8 +66,8 @@ exports.protocols = {
|
|
|
69
66
|
'015': [Protocols.PtLimaPtL],
|
|
70
67
|
'016': [Protocols.PtMumbai2],
|
|
71
68
|
'017': [Protocols.PtNairobi],
|
|
72
|
-
'
|
|
73
|
-
'
|
|
69
|
+
'019': [Protocols.ProxfordY],
|
|
70
|
+
'020': [Protocols.ProtoALpha],
|
|
74
71
|
};
|
|
75
72
|
var ChainIds;
|
|
76
73
|
(function (ChainIds) {
|
|
@@ -89,22 +86,21 @@ var ChainIds;
|
|
|
89
86
|
ChainIds["MUMBAINET"] = "NetXQw6nWSnrJ5t";
|
|
90
87
|
ChainIds["MUMBAINET2"] = "NetXgbcrNtXD2yA";
|
|
91
88
|
ChainIds["NAIROBINET"] = "NetXyuzvDo2Ugzb";
|
|
92
|
-
ChainIds["
|
|
93
|
-
})(ChainIds
|
|
89
|
+
ChainIds["OXFORDNET2"] = "NetXxWsskGahzQB";
|
|
90
|
+
})(ChainIds || (exports.ChainIds = ChainIds = {}));
|
|
94
91
|
const getRevealGasLimit = (address) => Math.round((getRevealGasLimitInternal(address) * 11) / 10);
|
|
95
92
|
exports.getRevealGasLimit = getRevealGasLimit;
|
|
96
93
|
const getRevealGasLimitInternal = (address) => {
|
|
97
94
|
switch (address.substring(0, 3)) {
|
|
98
95
|
case 'tz1':
|
|
99
|
-
return DEFAULT_GAS_LIMIT.REVEAL_TZ1;
|
|
96
|
+
return exports.DEFAULT_GAS_LIMIT.REVEAL_TZ1;
|
|
100
97
|
case 'tz2':
|
|
101
|
-
return DEFAULT_GAS_LIMIT.REVEAL_TZ2;
|
|
98
|
+
return exports.DEFAULT_GAS_LIMIT.REVEAL_TZ2;
|
|
102
99
|
case 'tz3':
|
|
103
|
-
return DEFAULT_GAS_LIMIT.REVEAL_TZ3;
|
|
100
|
+
return exports.DEFAULT_GAS_LIMIT.REVEAL_TZ3;
|
|
104
101
|
case 'tz4':
|
|
105
|
-
return DEFAULT_GAS_LIMIT.REVEAL_TZ4;
|
|
102
|
+
return exports.DEFAULT_GAS_LIMIT.REVEAL_TZ4;
|
|
106
103
|
default:
|
|
107
104
|
throw new Error(`Cannot estimate reveal gas limit for ${address}`);
|
|
108
105
|
}
|
|
109
106
|
};
|
|
110
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/lib/context.js
CHANGED
|
@@ -56,11 +56,11 @@ class OnChainView {
|
|
|
56
56
|
}
|
|
57
57
|
verifyContextExecution(executionContext) {
|
|
58
58
|
if (executionContext.source &&
|
|
59
|
-
utils_1.validateAddress(executionContext.source) !== utils_1.ValidationResult.VALID) {
|
|
59
|
+
(0, utils_1.validateAddress)(executionContext.source) !== utils_1.ValidationResult.VALID) {
|
|
60
60
|
throw new errors_1.InvalidViewSimulationContext(`The source account who initialized the view execution is invalid: ${executionContext.source}.`);
|
|
61
61
|
}
|
|
62
62
|
if (!executionContext.viewCaller ||
|
|
63
|
-
utils_1.validateAddress(executionContext.viewCaller) !== utils_1.ValidationResult.VALID) {
|
|
63
|
+
(0, utils_1.validateAddress)(executionContext.viewCaller) !== utils_1.ValidationResult.VALID) {
|
|
64
64
|
throw new errors_1.InvalidViewSimulationContext(`The contract which is the caller of view is invalid: ${executionContext.viewCaller}.`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -112,7 +112,7 @@ class OnChainView {
|
|
|
112
112
|
.data;
|
|
113
113
|
}
|
|
114
114
|
catch (error) {
|
|
115
|
-
const failWith = errors_1.validateAndExtractFailwith(error);
|
|
115
|
+
const failWith = (0, errors_1.validateAndExtractFailwith)(error);
|
|
116
116
|
throw failWith
|
|
117
117
|
? new errors_1.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(failWith)}`, this._smartContractViewSchema.viewName, failWith, error)
|
|
118
118
|
: error;
|
|
@@ -122,4 +122,3 @@ class OnChainView {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
exports.OnChainView = OnChainView;
|
|
125
|
-
//# sourceMappingURL=contract-on-chain-view.js.map
|
|
@@ -31,12 +31,12 @@ class ContractView {
|
|
|
31
31
|
}
|
|
32
32
|
read(chainId) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
const chainIdValidation = utils_1.validateChain(chainId !== null && chainId !== void 0 ? chainId : '');
|
|
35
|
-
if (utils_1.validateContractAddress(chainId !== null && chainId !== void 0 ? chainId : '') == utils_1.ValidationResult.VALID) {
|
|
34
|
+
const chainIdValidation = (0, utils_1.validateChain)(chainId !== null && chainId !== void 0 ? chainId : '');
|
|
35
|
+
if ((0, utils_1.validateContractAddress)(chainId !== null && chainId !== void 0 ? chainId : '') == utils_1.ValidationResult.VALID) {
|
|
36
36
|
throw new core_1.DeprecationError(`Since version 12, the lambda view no longer depends on a lambda contract. The read method no longer accepts a contract address as a parameter.`);
|
|
37
37
|
}
|
|
38
38
|
else if (chainId && chainIdValidation !== utils_1.ValidationResult.VALID) {
|
|
39
|
-
throw new core_1.InvalidChainIdError(chainId, utils_1.invalidDetail(chainIdValidation));
|
|
39
|
+
throw new core_1.InvalidChainIdError(chainId, (0, utils_1.invalidDetail)(chainIdValidation));
|
|
40
40
|
}
|
|
41
41
|
const arg = this.parameterSchema.Encode(...this.args);
|
|
42
42
|
const result = yield this.rpc.runView({
|
|
@@ -190,4 +190,3 @@ class ContractAbstraction {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
exports.ContractAbstraction = ContractAbstraction;
|
|
193
|
-
//# sourceMappingURL=contract.js.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -10,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.compose = void 0;
|
|
17
|
+
exports.smartContractAbstractionSemantic = exports.compose = void 0;
|
|
14
18
|
__exportStar(require("./contract"), exports);
|
|
15
19
|
__exportStar(require("./errors"), exports);
|
|
16
20
|
__exportStar(require("./interface"), exports);
|
|
@@ -23,4 +27,5 @@ __exportStar(require("./contract-methods/contract-method-interface"), exports);
|
|
|
23
27
|
__exportStar(require("./contract-methods/contract-method-flat-param"), exports);
|
|
24
28
|
__exportStar(require("./contract-methods/contract-method-object-param"), exports);
|
|
25
29
|
__exportStar(require("./sapling-state-abstraction"), exports);
|
|
26
|
-
|
|
30
|
+
var semantic_1 = require("./semantic");
|
|
31
|
+
Object.defineProperty(exports, "smartContractAbstractionSemantic", { enumerable: true, get: function () { return semantic_1.smartContractAbstractionSemantic; } });
|
|
@@ -57,7 +57,7 @@ const createOriginationOperation = ({ code, init, balance = '0', delegate, stora
|
|
|
57
57
|
fee,
|
|
58
58
|
gas_limit: gasLimit,
|
|
59
59
|
storage_limit: storageLimit,
|
|
60
|
-
balance: mutez ? balance.toString() : utils_1.format('tz', 'mutez', balance).toString(),
|
|
60
|
+
balance: mutez ? balance.toString() : (0, utils_1.format)('tz', 'mutez', balance).toString(),
|
|
61
61
|
script,
|
|
62
62
|
};
|
|
63
63
|
if (delegate) {
|
|
@@ -72,7 +72,7 @@ const createTransferOperation = ({ to, amount, parameter, fee = constants_1.DEFA
|
|
|
72
72
|
fee,
|
|
73
73
|
gas_limit: gasLimit,
|
|
74
74
|
storage_limit: storageLimit,
|
|
75
|
-
amount: mutez ? amount.toString() : utils_1.format('tz', 'mutez', amount).toString(),
|
|
75
|
+
amount: mutez ? amount.toString() : (0, utils_1.format)('tz', 'mutez', amount).toString(),
|
|
76
76
|
destination: to,
|
|
77
77
|
parameters: parameter,
|
|
78
78
|
};
|
|
@@ -107,7 +107,7 @@ const createRevealOperation = ({ fee = constants_1.DEFAULT_FEE.REVEAL, gasLimit
|
|
|
107
107
|
fee,
|
|
108
108
|
public_key: publicKey,
|
|
109
109
|
source,
|
|
110
|
-
gas_limit: gasLimit !== null && gasLimit !== void 0 ? gasLimit : constants_1.getRevealGasLimit(source),
|
|
110
|
+
gas_limit: gasLimit !== null && gasLimit !== void 0 ? gasLimit : (0, constants_1.getRevealGasLimit)(source),
|
|
111
111
|
storage_limit: storageLimit,
|
|
112
112
|
};
|
|
113
113
|
});
|
|
@@ -212,4 +212,3 @@ const createSmartRollupOriginateOperation = ({ source, fee, gasLimit, storageLim
|
|
|
212
212
|
};
|
|
213
213
|
});
|
|
214
214
|
exports.createSmartRollupOriginateOperation = createSmartRollupOriginateOperation;
|
|
215
|
-
//# sourceMappingURL=prepare.js.map
|
|
@@ -52,9 +52,9 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
52
52
|
*/
|
|
53
53
|
getStorage(contract, schema) {
|
|
54
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const contractValidation = utils_1.validateContractAddress(contract);
|
|
55
|
+
const contractValidation = (0, utils_1.validateContractAddress)(contract);
|
|
56
56
|
if (contractValidation !== utils_1.ValidationResult.VALID) {
|
|
57
|
-
throw new core_1.InvalidContractAddressError(contract, utils_1.invalidDetail(contractValidation));
|
|
57
|
+
throw new core_1.InvalidContractAddressError(contract, (0, utils_1.invalidDetail)(contractValidation));
|
|
58
58
|
}
|
|
59
59
|
const script = yield this.context.readProvider.getScript(contract, 'head');
|
|
60
60
|
if (!schema) {
|
|
@@ -67,7 +67,7 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
67
67
|
else {
|
|
68
68
|
contractSchema = michelson_encoder_1.Schema.fromRPCResponse({ script: schema });
|
|
69
69
|
}
|
|
70
|
-
return contractSchema.Execute(script.storage, semantic_1.smartContractAbstractionSemantic(this)); // Cast into T because only the caller can know the true type of the storage
|
|
70
|
+
return contractSchema.Execute(script.storage, (0, semantic_1.smartContractAbstractionSemantic)(this)); // Cast into T because only the caller can know the true type of the storage
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
@@ -84,9 +84,9 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
84
84
|
*/
|
|
85
85
|
getBigMapKey(contract, key, schema) {
|
|
86
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
const contractValidation = utils_1.validateContractAddress(contract);
|
|
87
|
+
const contractValidation = (0, utils_1.validateContractAddress)(contract);
|
|
88
88
|
if (contractValidation !== utils_1.ValidationResult.VALID) {
|
|
89
|
-
throw new core_1.InvalidContractAddressError(contract, utils_1.invalidDetail(contractValidation));
|
|
89
|
+
throw new core_1.InvalidContractAddressError(contract, (0, utils_1.invalidDetail)(contractValidation));
|
|
90
90
|
}
|
|
91
91
|
if (!schema) {
|
|
92
92
|
schema = (yield this.rpc.getContract(contract)).script;
|
|
@@ -118,11 +118,11 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
118
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
119
|
const { key, type } = schema.EncodeBigMapKey(keyToEncode);
|
|
120
120
|
const { packed } = yield this.context.packer.packData({ data: key, type });
|
|
121
|
-
const encodedExpr = utils_1.encodeExpr(packed);
|
|
121
|
+
const encodedExpr = (0, utils_1.encodeExpr)(packed);
|
|
122
122
|
const bigMapValue = block
|
|
123
123
|
? yield this.context.readProvider.getBigMapValue({ id: id.toString(), expr: encodedExpr }, block)
|
|
124
124
|
: yield this.context.readProvider.getBigMapValue({ id: id.toString(), expr: encodedExpr }, 'head');
|
|
125
|
-
return schema.ExecuteOnBigMapValue(bigMapValue, semantic_1.smartContractAbstractionSemantic(this));
|
|
125
|
+
return schema.ExecuteOnBigMapValue(bigMapValue, (0, semantic_1.smartContractAbstractionSemantic)(this));
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
@@ -228,13 +228,13 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
228
228
|
setDelegate(params) {
|
|
229
229
|
var _a;
|
|
230
230
|
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
-
const sourceValidation = utils_1.validateAddress(params.source);
|
|
231
|
+
const sourceValidation = (0, utils_1.validateAddress)(params.source);
|
|
232
232
|
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) {
|
|
233
|
-
throw new core_1.InvalidAddressError(params.source, utils_1.invalidDetail(sourceValidation));
|
|
233
|
+
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation));
|
|
234
234
|
}
|
|
235
|
-
const delegateValidation = utils_1.validateAddress((_a = params.delegate) !== null && _a !== void 0 ? _a : '');
|
|
235
|
+
const delegateValidation = (0, utils_1.validateAddress)((_a = params.delegate) !== null && _a !== void 0 ? _a : '');
|
|
236
236
|
if (params.delegate && delegateValidation !== utils_1.ValidationResult.VALID) {
|
|
237
|
-
throw new core_1.InvalidAddressError(params.delegate, utils_1.invalidDetail(delegateValidation));
|
|
237
|
+
throw new core_1.InvalidAddressError(params.delegate, (0, utils_1.invalidDetail)(delegateValidation));
|
|
238
238
|
}
|
|
239
239
|
// Since babylon delegation source cannot smart contract
|
|
240
240
|
if (/kt1/i.test(params.source)) {
|
|
@@ -280,13 +280,13 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
280
280
|
transfer(params) {
|
|
281
281
|
var _a;
|
|
282
282
|
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
-
const toValidation = utils_1.validateAddress(params.to);
|
|
283
|
+
const toValidation = (0, utils_1.validateAddress)(params.to);
|
|
284
284
|
if (toValidation !== utils_1.ValidationResult.VALID) {
|
|
285
|
-
throw new core_1.InvalidAddressError(params.to, utils_1.invalidDetail(toValidation));
|
|
285
|
+
throw new core_1.InvalidAddressError(params.to, (0, utils_1.invalidDetail)(toValidation));
|
|
286
286
|
}
|
|
287
|
-
const sourceValidation = utils_1.validateAddress((_a = params.source) !== null && _a !== void 0 ? _a : '');
|
|
287
|
+
const sourceValidation = (0, utils_1.validateAddress)((_a = params.source) !== null && _a !== void 0 ? _a : '');
|
|
288
288
|
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) {
|
|
289
|
-
throw new core_1.InvalidAddressError(params.source, utils_1.invalidDetail(sourceValidation));
|
|
289
|
+
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation));
|
|
290
290
|
}
|
|
291
291
|
if (params.amount < 0) {
|
|
292
292
|
throw new core_1.InvalidAmountError(params.amount.toString());
|
|
@@ -312,13 +312,13 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
312
312
|
transferTicket(params) {
|
|
313
313
|
var _a, _b;
|
|
314
314
|
return __awaiter(this, void 0, void 0, function* () {
|
|
315
|
-
const destinationValidation = utils_1.validateAddress(params.destination);
|
|
315
|
+
const destinationValidation = (0, utils_1.validateAddress)(params.destination);
|
|
316
316
|
if (destinationValidation !== utils_1.ValidationResult.VALID) {
|
|
317
|
-
throw new core_1.InvalidAddressError(params.destination, utils_1.invalidDetail(destinationValidation));
|
|
317
|
+
throw new core_1.InvalidAddressError(params.destination, (0, utils_1.invalidDetail)(destinationValidation));
|
|
318
318
|
}
|
|
319
|
-
const sourceValidation = utils_1.validateAddress((_a = params.source) !== null && _a !== void 0 ? _a : '');
|
|
319
|
+
const sourceValidation = (0, utils_1.validateAddress)((_a = params.source) !== null && _a !== void 0 ? _a : '');
|
|
320
320
|
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) {
|
|
321
|
-
throw new core_1.InvalidAddressError(params.source, utils_1.invalidDetail(sourceValidation));
|
|
321
|
+
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation));
|
|
322
322
|
}
|
|
323
323
|
const publicKeyHash = yield this.signer.publicKeyHash();
|
|
324
324
|
const source = (_b = params.source) !== null && _b !== void 0 ? _b : publicKeyHash;
|
|
@@ -425,9 +425,9 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
425
425
|
var _a, _b;
|
|
426
426
|
return __awaiter(this, void 0, void 0, function* () {
|
|
427
427
|
const publicKeyHash = yield this.signer.publicKeyHash();
|
|
428
|
-
const sourceValidation = utils_1.validateAddress((_a = params.source) !== null && _a !== void 0 ? _a : '');
|
|
428
|
+
const sourceValidation = (0, utils_1.validateAddress)((_a = params.source) !== null && _a !== void 0 ? _a : '');
|
|
429
429
|
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) {
|
|
430
|
-
throw new core_1.InvalidAddressError(params.source, utils_1.invalidDetail(sourceValidation));
|
|
430
|
+
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation));
|
|
431
431
|
}
|
|
432
432
|
const source = (_b = params.source) !== null && _b !== void 0 ? _b : publicKeyHash;
|
|
433
433
|
const prepared = yield this.prepare.ballot(Object.assign(Object.assign({}, params), { source }));
|
|
@@ -449,9 +449,9 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
449
449
|
var _a, _b;
|
|
450
450
|
return __awaiter(this, void 0, void 0, function* () {
|
|
451
451
|
const publicKeyHash = yield this.signer.publicKeyHash();
|
|
452
|
-
const sourceValidation = utils_1.validateAddress((_a = params.source) !== null && _a !== void 0 ? _a : '');
|
|
452
|
+
const sourceValidation = (0, utils_1.validateAddress)((_a = params.source) !== null && _a !== void 0 ? _a : '');
|
|
453
453
|
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) {
|
|
454
|
-
throw new core_1.InvalidAddressError(params.source, utils_1.invalidDetail(sourceValidation));
|
|
454
|
+
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation));
|
|
455
455
|
}
|
|
456
456
|
const source = (_b = params.source) !== null && _b !== void 0 ? _b : publicKeyHash;
|
|
457
457
|
const prepared = yield this.prepare.proposals(Object.assign(Object.assign({}, params), { source }));
|
|
@@ -556,9 +556,9 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
556
556
|
*/
|
|
557
557
|
at(address, contractAbstractionComposer = (x) => x) {
|
|
558
558
|
return __awaiter(this, void 0, void 0, function* () {
|
|
559
|
-
const addressValidation = utils_1.validateContractAddress(address);
|
|
559
|
+
const addressValidation = (0, utils_1.validateContractAddress)(address);
|
|
560
560
|
if (addressValidation !== utils_1.ValidationResult.VALID) {
|
|
561
|
-
throw new core_1.InvalidContractAddressError(address, utils_1.invalidDetail(addressValidation));
|
|
561
|
+
throw new core_1.InvalidContractAddressError(address, (0, utils_1.invalidDetail)(addressValidation));
|
|
562
562
|
}
|
|
563
563
|
const rpc = this.context.withExtensions().rpc;
|
|
564
564
|
const readProvider = this.context.withExtensions().readProvider;
|
|
@@ -585,4 +585,3 @@ class RpcContractProvider extends provider_1.Provider {
|
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
exports.RpcContractProvider = RpcContractProvider;
|
|
588
|
-
//# sourceMappingURL=rpc-contract-provider.js.map
|
|
@@ -5,6 +5,10 @@ const michelson_encoder_1 = require("@taquito/michelson-encoder");
|
|
|
5
5
|
const big_map_1 = require("./big-map");
|
|
6
6
|
const bignumber_js_1 = require("bignumber.js");
|
|
7
7
|
const sapling_state_abstraction_1 = require("./sapling-state-abstraction");
|
|
8
|
+
/**
|
|
9
|
+
* @description Override the default michelson encoder semantic to provide richer abstraction over storage properties
|
|
10
|
+
* @param provider ContractProvider (contract API)
|
|
11
|
+
*/
|
|
8
12
|
// Override the default michelson encoder semantic to provide richer abstraction over storage properties
|
|
9
13
|
const smartContractAbstractionSemantic = (provider) => ({
|
|
10
14
|
// Provide a specific abstraction for BigMaps
|
|
@@ -26,7 +30,7 @@ const smartContractAbstractionSemantic = (provider) => ({
|
|
|
26
30
|
else {
|
|
27
31
|
return new sapling_state_abstraction_1.SaplingStateAbstraction(new bignumber_js_1.default(val.int), provider);
|
|
28
32
|
}
|
|
29
|
-
}
|
|
33
|
+
},
|
|
30
34
|
/*
|
|
31
35
|
// TODO: embed useful other abstractions
|
|
32
36
|
'contract': () => {},
|
|
@@ -34,4 +38,3 @@ const smartContractAbstractionSemantic = (provider) => ({
|
|
|
34
38
|
*/
|
|
35
39
|
});
|
|
36
40
|
exports.smartContractAbstractionSemantic = smartContractAbstractionSemantic;
|
|
37
|
-
//# sourceMappingURL=semantic.js.map
|
package/dist/lib/errors.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -14,4 +18,3 @@ __exportStar(require("./estimate"), exports);
|
|
|
14
18
|
__exportStar(require("./estimate-provider-interface"), exports);
|
|
15
19
|
__exportStar(require("./rpc-estimate-provider"), exports);
|
|
16
20
|
__exportStar(require("./errors"), exports);
|
|
17
|
-
//# sourceMappingURL=index.js.map
|