@taquito/taquito
Advanced tools
Comparing version 19.1.0-RC.1 to 19.1.0-RC.2
@@ -61,3 +61,3 @@ "use strict"; | ||
/** | ||
* @description The limit on the amount of storage an [operation](https://tezos.gitlab.io/user/glossary.html#operations) can use. | ||
* @description The limit on the amount of storage an [operation](https://tezos.gitlab.io/user/glossary.html#operations) can use with 20 buffer. | ||
*/ | ||
@@ -68,3 +68,3 @@ get storageLimit() { | ||
/** | ||
* @description The limit on the amount of [gas](https://tezos.gitlab.io/user/glossary.html#gas) a given operation can consume. | ||
* @description The limit on the amount of [gas](https://tezos.gitlab.io/user/glossary.html#gas) a given operation can consume with 100 buffer depends on the operation. | ||
*/ | ||
@@ -71,0 +71,0 @@ get gasLimit() { |
@@ -39,2 +39,3 @@ "use strict"; | ||
this.MILLIGAS_BUFFER = 100 * 1000; // 100 buffer depends on operation kind | ||
this.STORAGE_BUFFER = 20; // according to octez-client | ||
this.prepare = new prepare_provider_1.PrepareProvider(this.context); | ||
@@ -82,3 +83,3 @@ } | ||
: consumedMilligas, | ||
storageLimit: accumulatedStorage || 0, | ||
storageLimit: accumulatedStorage > 0 ? accumulatedStorage + this.STORAGE_BUFFER : 0, | ||
opSize: size, | ||
@@ -85,0 +86,0 @@ minimalFeePerStorageByteMutez: costPerByte.toNumber(), |
@@ -81,6 +81,5 @@ "use strict"; | ||
} | ||
getAccountLimits(pkh, constants, numberOfOps) { | ||
getOperationLimits(constants, numberOfOps) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const balance = yield this.context.readProvider.getBalance(pkh, 'head'); | ||
const { hard_gas_limit_per_operation, hard_gas_limit_per_block, hard_storage_limit_per_operation, cost_per_byte, } = constants; | ||
const { hard_gas_limit_per_operation, hard_gas_limit_per_block, hard_storage_limit_per_operation, } = constants; | ||
return { | ||
@@ -91,3 +90,3 @@ fee: 0, | ||
: hard_gas_limit_per_operation.toNumber(), | ||
storageLimit: Math.floor(bignumber_js_1.default.min(balance.dividedBy(cost_per_byte), hard_storage_limit_per_operation).toNumber()), | ||
storageLimit: hard_storage_limit_per_operation.toNumber(), | ||
}; | ||
@@ -235,3 +234,3 @@ }); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const mergedEstimates = mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS); | ||
@@ -271,3 +270,3 @@ const op = yield (0, contract_1.createRevealOperation)({ | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createOriginationOperation)(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS)))); | ||
@@ -303,3 +302,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createTransferOperation)(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS))); | ||
@@ -335,3 +334,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createSetDelegateOperation)(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS))); | ||
@@ -366,3 +365,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const mergedEstimates = mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS); | ||
@@ -403,3 +402,3 @@ const op = yield (0, contract_1.createRegisterDelegateOperation)({ | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createRegisterGlobalConstantOperation)(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS))); | ||
@@ -435,3 +434,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createUpdateConsensusKeyOperation)(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS))); | ||
@@ -467,3 +466,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createIncreasePaidStorageOperation)(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS))); | ||
@@ -591,3 +590,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createTransferTicketOperation)(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS))); | ||
@@ -623,3 +622,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createSmartRollupAddMessagesOperation)(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS))); | ||
@@ -654,3 +653,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createSmartRollupOriginateOperation)(Object.assign(Object.assign({}, mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS)), rest)); | ||
@@ -686,3 +685,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createSmartRollupExecuteOutboxMessageOperation)(Object.assign(Object.assign({}, rest), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS))); | ||
@@ -716,3 +715,3 @@ const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants, batchParams.length); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants, batchParams.length); | ||
const revealNeeded = yield this.isRevealOpNeeded(batchParams, pkh); | ||
@@ -788,3 +787,3 @@ const ops = []; | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getAccountLimits(pkh, protocolConstants); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const estimateLimits = mergeLimits({ | ||
@@ -791,0 +790,0 @@ fee: params.fee, |
@@ -6,4 +6,4 @@ "use strict"; | ||
exports.VERSION = { | ||
"commitHash": "708d150af0e1d81cf4bd44df7e41867689f39d22", | ||
"version": "19.1.0-RC.1" | ||
"commitHash": "1aa9945ea2318318f16f494216a1c09801fa4bf8", | ||
"version": "19.1.0-RC.2" | ||
}; |
@@ -62,7 +62,7 @@ export interface EstimateProperties { | ||
/** | ||
* @description The limit on the amount of storage an [operation](https://tezos.gitlab.io/user/glossary.html#operations) can use. | ||
* @description The limit on the amount of storage an [operation](https://tezos.gitlab.io/user/glossary.html#operations) can use with 20 buffer. | ||
*/ | ||
get storageLimit(): number; | ||
/** | ||
* @description The limit on the amount of [gas](https://tezos.gitlab.io/user/glossary.html#gas) a given operation can consume. | ||
* @description The limit on the amount of [gas](https://tezos.gitlab.io/user/glossary.html#gas) a given operation can consume with 100 buffer depends on the operation. | ||
*/ | ||
@@ -69,0 +69,0 @@ get gasLimit(): number; |
@@ -9,2 +9,3 @@ import { DelegateParams, OriginateParams, ParamsWithKind, RegisterDelegateParams, TransferParams, RevealParams, RegisterGlobalConstantParams, TransferTicketParams, IncreasePaidStorageParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams } from '../operations/types'; | ||
private readonly MILLIGAS_BUFFER; | ||
private readonly STORAGE_BUFFER; | ||
private prepare; | ||
@@ -11,0 +12,0 @@ private getKeys; |
@@ -23,3 +23,3 @@ import { PreapplyParams } from '@taquito/rpc'; | ||
private adjustGasForBatchOperation; | ||
private getAccountLimits; | ||
private getOperationLimits; | ||
private getFee; | ||
@@ -26,0 +26,0 @@ private getSource; |
{ | ||
"name": "@taquito/taquito", | ||
"version": "19.1.0-RC.1", | ||
"version": "19.1.0-RC.2", | ||
"description": "High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.", | ||
@@ -80,9 +80,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@taquito/core": "^19.1.0-RC.1", | ||
"@taquito/http-utils": "^19.1.0-RC.1", | ||
"@taquito/local-forging": "^19.1.0-RC.1", | ||
"@taquito/michel-codec": "^19.1.0-RC.1", | ||
"@taquito/michelson-encoder": "^19.1.0-RC.1", | ||
"@taquito/rpc": "^19.1.0-RC.1", | ||
"@taquito/utils": "^19.1.0-RC.1", | ||
"@taquito/core": "^19.1.0-RC.2", | ||
"@taquito/http-utils": "^19.1.0-RC.2", | ||
"@taquito/local-forging": "^19.1.0-RC.2", | ||
"@taquito/michel-codec": "^19.1.0-RC.2", | ||
"@taquito/michelson-encoder": "^19.1.0-RC.2", | ||
"@taquito/rpc": "^19.1.0-RC.2", | ||
"@taquito/utils": "^19.1.0-RC.2", | ||
"bignumber.js": "^9.1.2", | ||
@@ -129,3 +129,3 @@ "rxjs": "^7.8.1" | ||
}, | ||
"gitHead": "dc0254c0ded7574d36705761c123b25116c7eeaf" | ||
"gitHead": "72feb924392ac02aa06f08a9c4f535a876ac57d8" | ||
} |
@@ -10,3 +10,3 @@ # Taquito high-level functions | ||
```html | ||
<script src="https://unpkg.com/@taquito/taquito@19.1.0-RC.1/dist/taquito.min.js" | ||
<script src="https://unpkg.com/@taquito/taquito@19.1.0-RC.2/dist/taquito.min.js" | ||
crossorigin="anonymous" integrity="sha384-IxvP0ECHi5oqLyz94wF85pU9+ktcsL1HHtA42MITxZsGbsUMEu/g+0Vkjj5vqiMR"></script> | ||
@@ -13,0 +13,0 @@ ``` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
26958
2030358