conseiljs
Advanced tools
Comparing version 5.0.7-beta.1 to 5.0.7-beta.2
@@ -213,6 +213,8 @@ "use strict"; | ||
if (optimizeFee) { | ||
const estimate = yield estimateOperation(server, 'main', ...operations); | ||
transaction.fee = estimate.estimatedFee.toString(); | ||
transaction.gas_limit = estimate.gas.toString(); | ||
transaction.storage_limit = estimate.storageCost.toString(); | ||
const estimate = yield estimateOperationGroup(server, 'main', operations); | ||
operations[0].fee = estimate.estimatedFee.toString(); | ||
for (let i = 0; i < operations.length; i++) { | ||
operations[i].gas_limit = estimate.operationResources[i].gas.toString(); | ||
operations[i].storage_limit = estimate.operationResources[i].storageCost.toString(); | ||
} | ||
} | ||
@@ -237,6 +239,8 @@ return sendOperation(server, operations, signer, offset); | ||
if (optimizeFee) { | ||
const estimate = yield estimateOperation(server, 'main', ...operations); | ||
delegation.fee = estimate.estimatedFee.toString(); | ||
delegation.gas_limit = estimate.gas.toString(); | ||
delegation.storage_limit = estimate.storageCost.toString(); | ||
const estimate = yield estimateOperationGroup(server, 'main', operations); | ||
operations[0].fee = estimate.estimatedFee.toString(); | ||
for (let i = 0; i < operations.length; i++) { | ||
operations[i].gas_limit = estimate.operationResources[i].gas.toString(); | ||
operations[i].storage_limit = estimate.operationResources[i].storageCost.toString(); | ||
} | ||
} | ||
@@ -260,6 +264,6 @@ return sendOperation(server, operations, signer, offset); | ||
const estimate = yield estimateOperationGroup(server, 'main', operations); | ||
operation.fee = estimate.estimatedFee.toString(); | ||
operations[0].fee = estimate.estimatedFee.toString(); | ||
for (let i = 0; i < operations.length; i++) { | ||
operation.gas_limit = estimate.operationResources[i].gas.toString(); | ||
operation.storage_limit = estimate.operationResources[i].storageCost.toString(); | ||
operation[i].gas_limit = estimate.operationResources[i].gas.toString(); | ||
operation[i].storage_limit = estimate.operationResources[i].storageCost.toString(); | ||
} | ||
@@ -302,7 +306,7 @@ } | ||
const operations = yield appendRevealOperation(server, keyStore.publicKey, keyStore.publicKeyHash, counter - 1, [transaction]); | ||
if (optimizeFee) { | ||
const estimate = yield estimateOperation(server, 'main', transaction); | ||
transaction.fee = estimate.estimatedFee.toString(); | ||
transaction.gas_limit = estimate.gas.toString(); | ||
transaction.storage_limit = estimate.storageCost.toString(); | ||
const estimate = yield estimateOperationGroup(server, 'main', operations); | ||
operations[0].fee = estimate.estimatedFee.toString(); | ||
for (let i = 0; i < operations.length; i++) { | ||
operations[i].gas_limit = estimate.operationResources[i].gas.toString(); | ||
operations[i].storage_limit = estimate.operationResources[i].storageCost.toString(); | ||
} | ||
@@ -429,3 +433,3 @@ return sendOperation(server, operations, signer, offset); | ||
storageCost += parseInt(c['metadata']['operation_result']['paid_storage_size_diff']) || 0; | ||
if (c.kind === 'origination') { | ||
if (c.kind === 'origination' || c['metadata']['operation_result']['allocated_destination_contract']) { | ||
storageCost += TezosConstants_1.TezosConstants.EmptyAccountStorageBurn; | ||
@@ -443,3 +447,3 @@ } | ||
storageCost += parseInt(result['paid_storage_size_diff']) || 0; | ||
if (result.kind === 'origination') { | ||
if (result.kind === 'origination' || c['metadata']['operation_result']['allocated_destination_contract']) { | ||
storageCost += TezosConstants_1.TezosConstants.EmptyAccountStorageBurn; | ||
@@ -477,3 +481,5 @@ } | ||
if ('kind' in arr[0]) { | ||
errors = arr.map(e => `(${e.kind}: ${e.id})`).join(', '); | ||
errors = arr.map(e => { | ||
return `(${e.kind}: ${e.id})`; | ||
}).join(', '); | ||
} | ||
@@ -480,0 +486,0 @@ else if (arr.length === 1 && arr[0].contents.length === 1 && arr[0].contents[0].kind === 'activate_account') { |
{ | ||
"name": "conseiljs", | ||
"version": "5.0.7-beta.1", | ||
"version": "5.0.7-beta.2", | ||
"description": "Client-side library for Tezos dApp development.", | ||
@@ -5,0 +5,0 @@ "browser": "dist/index-web.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
783855
7563