conseiljs
Advanced tools
Comparing version 5.0.7 to 5.0.8-1
@@ -21,2 +21,3 @@ "use strict"; | ||
const TezosTypes = __importStar(require("../../../types/tezos/TezosChainTypes")); | ||
const TezosConstants_1 = require("../../../types/tezos/TezosConstants"); | ||
const TezosMessageUtil_1 = require("../TezosMessageUtil"); | ||
@@ -44,3 +45,3 @@ const TezosNodeReader_1 = require("../TezosNodeReader"); | ||
const storage = `Pair {} (Pair "${administrator}" (Pair ${pause ? 'True' : 'False'} ${supply}))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractOriginationOperation(server, signer, keystore, 0, undefined, fee, freight, gas, contract, storage, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractOriginationOperation(server, signer, keystore, 0, undefined, fee, freight, gas, contract, storage, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult['operationGroupID']); | ||
@@ -80,5 +81,5 @@ }); | ||
mapid: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].int', json: storageResult })[0]), | ||
supply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[1].int', json: storageResult })[0]), | ||
administrator: jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].string', json: storageResult })[0], | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[0].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t') | ||
supply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[3].int', json: storageResult })[0]), | ||
administrator: jsonpath_plus_1.JSONPath({ path: '$.args[1].string', json: storageResult })[0], | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[2].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t') | ||
}; | ||
@@ -91,3 +92,3 @@ }); | ||
const storageResult = yield TezosNodeReader_1.TezosNodeReader.getContractStorage(server, address); | ||
return Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[1].int', json: storageResult })[0]); | ||
return Number(jsonpath_plus_1.JSONPath({ path: '$.args[3].int', json: storageResult })[0]); | ||
}); | ||
@@ -99,3 +100,3 @@ } | ||
const storageResult = yield TezosNodeReader_1.TezosNodeReader.getContractStorage(server, address); | ||
return jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].string', json: storageResult })[0]; | ||
return jsonpath_plus_1.JSONPath({ path: '$.args[1].string', json: storageResult })[0]; | ||
}); | ||
@@ -107,3 +108,3 @@ } | ||
const storageResult = yield TezosNodeReader_1.TezosNodeReader.getContractStorage(server, address); | ||
return (jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[0].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t'); | ||
return (jsonpath_plus_1.JSONPath({ path: '$.args[2].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t'); | ||
}); | ||
@@ -115,3 +116,3 @@ } | ||
const parameters = `(Left (Left (Left (Pair "${source}" (Pair "${destination}" ${amount})))))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -124,3 +125,3 @@ }); | ||
const parameters = `(Left (Left (Right (Pair "${destination}" ${amount}))))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -133,3 +134,3 @@ }); | ||
const parameters = '(Right (Left (Left False)))'; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -142,3 +143,3 @@ }); | ||
const parameters = '(Right (Left (Left True)))'; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -151,3 +152,3 @@ }); | ||
const parameters = `(Right (Left (Right "${address}")))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -160,3 +161,3 @@ }); | ||
const parameters = `(Right (Right (Right (Left (Pair "${destination}" ${amount})))))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -169,3 +170,3 @@ }); | ||
const parameters = `(Right (Right (Right (Right (Pair "${source}" ${amount})))))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -172,0 +173,0 @@ }); |
@@ -26,2 +26,3 @@ "use strict"; | ||
const TezosConseilClient_1 = require("../../../reporting/tezos/TezosConseilClient"); | ||
const TezosConstants_1 = require("../../../types/tezos/TezosConstants"); | ||
const TezosChainTypes_1 = require("../../../types/tezos/TezosChainTypes"); | ||
@@ -60,9 +61,9 @@ const CONTRACT_CHECKSUMS = { | ||
return { | ||
balanceMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[1].args[0].int', json: storageResult })[0]), | ||
approvalsMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[0].args[1].int', json: storageResult })[0]), | ||
supply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[1].int', json: storageResult })[0]), | ||
administrator: jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[0].args[0].string', json: storageResult })[0], | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[0].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t'), | ||
pauseGuardian: jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[1].args[1].string', json: storageResult })[0], | ||
outcomeMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].int', json: storageResult })[0]), | ||
balanceMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].int', json: storageResult })[0]), | ||
approvalsMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[1].int', json: storageResult })[0]), | ||
supply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[3].int', json: storageResult })[0]), | ||
administrator: jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[0].string', json: storageResult })[0], | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[2].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t'), | ||
pauseGuardian: jsonpath_plus_1.JSONPath({ path: '$.args[1].args[2].string', json: storageResult })[0], | ||
outcomeMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].args[1].int', json: storageResult })[0]), | ||
swapMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].int', json: storageResult })[0]) | ||
@@ -88,3 +89,3 @@ }; | ||
const parameters = `Pair "${sourceAddress}" (Pair "${destinationAddress}" ${amount})`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, tokenContractAddress, 0, fee, storageLimit, gasLimit, 'transfer', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, tokenContractAddress, 0, fee, storageLimit, gasLimit, 'transfer', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -97,3 +98,3 @@ }); | ||
const parameters = 'Unit'; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, ovenAddress, amountMutez, fee, storageLimit, gasLimit, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, ovenAddress, amountMutez, fee, storageLimit, gasLimit, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -106,3 +107,3 @@ }); | ||
const parameters = `${amountMutez}`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, ovenAddress, 0, fee, storageLimit, gasLimit, 'withdraw', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, ovenAddress, 0, fee, storageLimit, gasLimit, 'withdraw', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -152,3 +153,3 @@ }); | ||
const parameters = `Pair "${lambdaName}" 0x${bytes}`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, coreAddress, 0, fee, storageLimit, gasLimit, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, coreAddress, 0, fee, storageLimit, gasLimit, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
const operationHash = TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -166,3 +167,3 @@ const ovenAddress = TezosMessageUtil_1.TezosMessageUtils.calculateContractAddress(operationHash, 0); | ||
const parameters = `Some "${bakerAddress}"`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, ovenAddress, 0, fee, storageLimit, gasLimit, 'setDelegate', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, ovenAddress, 0, fee, storageLimit, gasLimit, 'setDelegate', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -175,3 +176,3 @@ }); | ||
const parameters = `None`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, ovenAddress, 0, fee, storageLimit, gasLimit, 'setDelegate', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(nodeUrl, signer, keystore, ovenAddress, 0, fee, storageLimit, gasLimit, 'setDelegate', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -178,0 +179,0 @@ }); |
@@ -28,5 +28,5 @@ "use strict"; | ||
code: ['Code', 'code'], | ||
comparableType: ['int', 'nat', 'string', 'bytes', 'mutez', 'bool', 'key_hash', 'timestamp', 'chain_id'], | ||
constantType: ['key', 'unit', 'signature', 'operation', 'address'], | ||
singleArgType: ['option', 'list', 'set', 'contract'], | ||
comparableType: ['int', 'nat', 'string', 'bytes', 'mutez', 'bool', 'key_hash', 'timestamp', 'chain_id', 'never'], | ||
constantType: ['key', 'unit', 'signature', 'operation', 'address', 'bls12_381_fr', 'bls12_381_g1', 'bls12_381_g2'], | ||
singleArgType: ['option', 'list', 'set', 'contract', 'ticket'], | ||
doubleArgType: ['pair', 'or', 'lambda', 'map', 'big_map'], | ||
@@ -44,3 +44,4 @@ baseInstruction: ['ABS', 'ADD', 'ADDRESS', 'AMOUNT', 'AND', 'BALANCE', 'BLAKE2B', 'CAR', 'CAST', 'CDR', 'CHECK_SIGNATURE', | ||
'CMPGE', 'IFEQ', 'NEQ', 'IFLT', 'IFGT', 'IFLE', 'IFGE', | ||
'EMPTY_BIG_MAP', 'APPLY', 'CHAIN_ID' | ||
'EMPTY_BIG_MAP', 'APPLY', 'CHAIN_ID', | ||
'KECCAK', 'SHA3', 'PAIRING_CHECK', 'SAPLING_EMPTY_STATE', 'SAPLING_VERIFY_UPDATE', 'GET_AND_UPDATE', 'NEVER', 'VOTING_POWER', 'TOTAL_VOTING_POWER', 'TICKET', 'READ_TICKET', 'SPLIT_TICKET', 'JOIN_TICKETS', 'SELF_ADDRESS', 'LEVEL' | ||
], | ||
@@ -427,2 +428,10 @@ macroCADR: macroCADRconst, | ||
}; | ||
const saplingToJson = d => { | ||
if (d.length == 7) { | ||
const annot = d[3].map(x => `"${x[1]}"`); | ||
return `{ "prim": "${d[2]}", "args": [ { "int": "${d[5]}" } ], "annots": [${annot}] }`; | ||
} | ||
else | ||
return `{ "prim": "${d[2]}", "args": [ { "int": "${d[4]}" } ] }`; | ||
}; | ||
const dipnToJson = d => (d.length > 4) ? `{ "prim": "${d[0]}", "args": [ { "int": "${d[2]}" }, [ ${d[4]} ] ] }` : `{ "prim": "${d[0]}", "args": [ ${d[2]} ] }`; | ||
@@ -510,2 +519,14 @@ const dupnToJson = d => { | ||
{ "name": "type", "symbols": [(lexer.has("lparen") ? { type: "lparen" } : lparen), "_", (lexer.has("doubleArgType") ? { type: "doubleArgType" } : doubleArgType), "type$ebnf$6", "_", "type", "_", "type", (lexer.has("rparen") ? { type: "rparen" } : rparen)], "postprocess": doubleArgTypeKeywordWithParenToJson }, | ||
{ "name": "type$ebnf$7$subexpression$1", "symbols": ["_", (lexer.has("annot") ? { type: "annot" } : annot)] }, | ||
{ "name": "type$ebnf$7", "symbols": ["type$ebnf$7$subexpression$1"] }, | ||
{ "name": "type$ebnf$7$subexpression$2", "symbols": ["_", (lexer.has("annot") ? { type: "annot" } : annot)] }, | ||
{ "name": "type$ebnf$7", "symbols": ["type$ebnf$7", "type$ebnf$7$subexpression$2"], "postprocess": (d) => d[0].concat([d[1]]) }, | ||
{ "name": "type", "symbols": [(lexer.has("lparen") ? { type: "lparen" } : lparen), "_", { "literal": "sapling_state" }, "type$ebnf$7", "_", (lexer.has("number") ? { type: "number" } : number), (lexer.has("rparen") ? { type: "rparen" } : rparen)], "postprocess": saplingToJson }, | ||
{ "name": "type$ebnf$8$subexpression$1", "symbols": ["_", (lexer.has("annot") ? { type: "annot" } : annot)] }, | ||
{ "name": "type$ebnf$8", "symbols": ["type$ebnf$8$subexpression$1"] }, | ||
{ "name": "type$ebnf$8$subexpression$2", "symbols": ["_", (lexer.has("annot") ? { type: "annot" } : annot)] }, | ||
{ "name": "type$ebnf$8", "symbols": ["type$ebnf$8", "type$ebnf$8$subexpression$2"], "postprocess": (d) => d[0].concat([d[1]]) }, | ||
{ "name": "type", "symbols": [(lexer.has("lparen") ? { type: "lparen" } : lparen), "_", { "literal": "sapling_transaction" }, "type$ebnf$8", "_", (lexer.has("number") ? { type: "number" } : number), (lexer.has("rparen") ? { type: "rparen" } : rparen)], "postprocess": saplingToJson }, | ||
{ "name": "type", "symbols": [(lexer.has("lparen") ? { type: "lparen" } : lparen), "_", { "literal": "sapling_state" }, "_", (lexer.has("number") ? { type: "number" } : number), (lexer.has("rparen") ? { type: "rparen" } : rparen)], "postprocess": saplingToJson }, | ||
{ "name": "type", "symbols": [(lexer.has("lparen") ? { type: "lparen" } : lparen), "_", { "literal": "sapling_transaction" }, "_", (lexer.has("number") ? { type: "number" } : number), (lexer.has("rparen") ? { type: "rparen" } : rparen)], "postprocess": saplingToJson }, | ||
{ "name": "typeData", "symbols": [(lexer.has("singleArgType") ? { type: "singleArgType" } : singleArgType), "_", "typeData"], "postprocess": singleArgKeywordToJson }, | ||
@@ -512,0 +533,0 @@ { "name": "typeData", "symbols": [(lexer.has("lparen") ? { type: "lparen" } : lparen), "_", (lexer.has("singleArgType") ? { type: "singleArgType" } : singleArgType), "_", "typeData", "_", (lexer.has("rparen") ? { type: "rparen" } : rparen)], "postprocess": singleArgKeywordWithParenToJson }, |
@@ -18,2 +18,3 @@ import * as TezosRPCTypes from '../../types/tezos/TezosRPCResponseTypes'; | ||
function getMempoolOperationsForAccount(server: string, accountHash: string, chainid?: string): Promise<any>; | ||
function getChainId(server: string, chainid?: string): Promise<string>; | ||
} |
@@ -142,3 +142,9 @@ "use strict"; | ||
TezosNodeReader.getMempoolOperationsForAccount = getMempoolOperationsForAccount; | ||
function getChainId(server, chainid = 'main') { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return performGetRequest(server, `chains/${chainid}/chain_id`).then(r => r.toString()); | ||
}); | ||
} | ||
TezosNodeReader.getChainId = getChainId; | ||
})(TezosNodeReader = exports.TezosNodeReader || (exports.TezosNodeReader = {})); | ||
//# sourceMappingURL=TezosNodeReader.js.map |
@@ -183,3 +183,3 @@ "use strict"; | ||
source: accountHash, | ||
fee: '0', | ||
fee: TezosConstants_1.TezosConstants.DefaultKeyRevealFee.toString(), | ||
counter: counter.toString(), | ||
@@ -378,2 +378,3 @@ gas_limit: TezosConstants_1.TezosConstants.DefaultKeyRevealGasLimit.toString(), | ||
} | ||
const staticFee = (operations.filter(o => o.kind === 'reveal').length === 1) ? 1270 : 0; | ||
const validBranch = 'BMLxA4tQjiu1PT2x3dMiijgvMTQo8AVxkPBPpdtM8hCfiyiC1jz'; | ||
@@ -384,3 +385,3 @@ const gasLimitTotal = operationResources.map(r => r.gas).reduce((a, c) => a + c, 0); | ||
const groupSize = forgedOperationGroup.length / 2 + 64; | ||
let estimatedFee = Math.ceil(gasLimitTotal / 10) + TezosConstants_1.TezosConstants.BaseOperationFee + groupSize + TezosConstants_1.TezosConstants.DefaultBakerVig; | ||
let estimatedFee = staticFee + Math.ceil(gasLimitTotal / 10) + TezosConstants_1.TezosConstants.BaseOperationFee + groupSize + TezosConstants_1.TezosConstants.DefaultBakerVig; | ||
const estimatedStorageBurn = Math.ceil(storageLimitTotal * TezosConstants_1.TezosConstants.StorageRate); | ||
@@ -401,2 +402,3 @@ if (Number(operations[0].fee) < estimatedFee) { | ||
let storageCost = 0; | ||
let staticFee = 0; | ||
for (let c of responseJSON['contents']) { | ||
@@ -409,2 +411,5 @@ try { | ||
} | ||
else if (c.kind === 'reveal') { | ||
staticFee += 1270; | ||
} | ||
} | ||
@@ -420,3 +425,3 @@ catch (_a) { } | ||
storageCost += parseInt(result['paid_storage_size_diff']) || 0; | ||
if (result.kind === 'origination' || c['metadata']['operation_result']['allocated_destination_contract']) { | ||
if (internalOperation.kind === 'origination') { | ||
storageCost += TezosConstants_1.TezosConstants.EmptyAccountStorageBurn; | ||
@@ -429,3 +434,3 @@ } | ||
const operationSize = forgedOperationGroup.length / 2 + 64; | ||
const estimatedFee = Math.ceil(gas / 10) + TezosConstants_1.TezosConstants.BaseOperationFee + operationSize + TezosConstants_1.TezosConstants.DefaultBakerVig; | ||
const estimatedFee = staticFee + Math.ceil(gas / 10) + TezosConstants_1.TezosConstants.BaseOperationFee + operationSize + TezosConstants_1.TezosConstants.DefaultBakerVig; | ||
const estimatedStorageBurn = Math.ceil(storageCost * TezosConstants_1.TezosConstants.StorageRate); | ||
@@ -432,0 +437,0 @@ log.debug(`TezosNodeWriter.estimateOperation; gas: ${gas}, storage: ${storageCost}, fee estimate: ${estimatedFee}, burn estimate: ${estimatedStorageBurn}`); |
@@ -10,4 +10,4 @@ export * from './chain/tezos/TezosContractIntrospector'; | ||
export * from './chain/tezos/contracts/DexterPoolHelper'; | ||
export * from './chain/tezos/contracts/KolibriTokenHelper'; | ||
export * from './chain/tezos/contracts/MurbardMultisigHelper'; | ||
export * from './chain/tezos/contracts/StakerDAOTokenHelper'; | ||
export * from './chain/tezos/contracts/TCFBakerRegistryHelper'; | ||
@@ -14,0 +14,0 @@ export * from './chain/tezos/contracts/Tzip7ReferenceTokenHelper'; |
@@ -22,4 +22,4 @@ "use strict"; | ||
__export(require("./chain/tezos/contracts/DexterPoolHelper")); | ||
__export(require("./chain/tezos/contracts/KolibriTokenHelper")); | ||
__export(require("./chain/tezos/contracts/MurbardMultisigHelper")); | ||
__export(require("./chain/tezos/contracts/StakerDAOTokenHelper")); | ||
__export(require("./chain/tezos/contracts/TCFBakerRegistryHelper")); | ||
@@ -26,0 +26,0 @@ __export(require("./chain/tezos/contracts/Tzip7ReferenceTokenHelper")); |
@@ -12,4 +12,4 @@ export declare function registerLogger(logger: any): void; | ||
export * from './chain/tezos/contracts/DexterPoolHelper'; | ||
export * from './chain/tezos/contracts/KolibriTokenHelper'; | ||
export * from './chain/tezos/contracts/MurbardMultisigHelper'; | ||
export * from './chain/tezos/contracts/StakerDAOTokenHelper'; | ||
export * from './chain/tezos/contracts/TCFBakerRegistryHelper'; | ||
@@ -16,0 +16,0 @@ export * from './chain/tezos/contracts/Tzip7ReferenceTokenHelper'; |
@@ -28,4 +28,4 @@ "use strict"; | ||
__export(require("./chain/tezos/contracts/DexterPoolHelper")); | ||
__export(require("./chain/tezos/contracts/KolibriTokenHelper")); | ||
__export(require("./chain/tezos/contracts/MurbardMultisigHelper")); | ||
__export(require("./chain/tezos/contracts/StakerDAOTokenHelper")); | ||
__export(require("./chain/tezos/contracts/TCFBakerRegistryHelper")); | ||
@@ -32,0 +32,0 @@ __export(require("./chain/tezos/contracts/Tzip7ReferenceTokenHelper")); |
{ | ||
"name": "conseiljs", | ||
"version": "5.0.7", | ||
"version": "5.0.8-1", | ||
"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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
802761
7684
1