conseiljs
Advanced tools
Comparing version 5.0.7 to 5.0.8-beta.0
@@ -52,8 +52,8 @@ "use strict"; | ||
return { | ||
mapid: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[0].int', json: storageResult })[0]), | ||
council: jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].args[1]..string', json: storageResult }), | ||
stage: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[0].int', json: storageResult })[0]), | ||
phase: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[0].int', json: storageResult })[0]) % 4, | ||
supply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[1].int', json: storageResult })[0]), | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[1].args[0].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t') | ||
mapid: Number(jsonpath_plus_1.JSONPath({ path: '$.args[2].int', json: storageResult })[0]), | ||
council: jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0]..string', json: storageResult }), | ||
stage: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].int', json: storageResult })[0]), | ||
phase: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].int', json: storageResult })[0]) % 4, | ||
supply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].int', json: storageResult })[0]), | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[3].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t') | ||
}; | ||
@@ -60,0 +60,0 @@ }); |
@@ -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 @@ }); |
@@ -59,9 +59,9 @@ "use strict"; | ||
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]) | ||
@@ -68,0 +68,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 |
@@ -10,2 +10,3 @@ export * from './chain/tezos/TezosContractIntrospector'; | ||
export * from './chain/tezos/contracts/DexterPoolHelper'; | ||
export * from './chain/tezos/contracts/KolibriTokenHelper'; | ||
export * from './chain/tezos/contracts/MurbardMultisigHelper'; | ||
@@ -12,0 +13,0 @@ export * from './chain/tezos/contracts/StakerDAOTokenHelper'; |
@@ -22,2 +22,3 @@ "use strict"; | ||
__export(require("./chain/tezos/contracts/DexterPoolHelper")); | ||
__export(require("./chain/tezos/contracts/KolibriTokenHelper")); | ||
__export(require("./chain/tezos/contracts/MurbardMultisigHelper")); | ||
@@ -24,0 +25,0 @@ __export(require("./chain/tezos/contracts/StakerDAOTokenHelper")); |
@@ -12,2 +12,3 @@ 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'; | ||
@@ -14,0 +15,0 @@ export * from './chain/tezos/contracts/StakerDAOTokenHelper'; |
@@ -28,2 +28,3 @@ "use strict"; | ||
__export(require("./chain/tezos/contracts/DexterPoolHelper")); | ||
__export(require("./chain/tezos/contracts/KolibriTokenHelper")); | ||
__export(require("./chain/tezos/contracts/MurbardMultisigHelper")); | ||
@@ -30,0 +31,0 @@ __export(require("./chain/tezos/contracts/StakerDAOTokenHelper")); |
{ | ||
"name": "conseiljs", | ||
"version": "5.0.7", | ||
"version": "5.0.8-beta.0", | ||
"description": "Client-side library for Tezos dApp development.", | ||
@@ -108,4 +108,4 @@ "browser": "dist/index-web.js", | ||
"engines": { | ||
"node": ">=12.18.3", | ||
"npm": ">=6.14.6" | ||
"node": ">=12.21.0", | ||
"npm": ">=6.14.11" | ||
}, | ||
@@ -112,0 +112,0 @@ "eslintConfig": { |
@@ -62,3 +62,3 @@ # ConseilJS-core | ||
<script src="https://cdn.jsdelivr.net/gh/cryptonomic/conseiljs/dist-web/conseiljs.min.js" | ||
integrity="sha384-sEYMVfIFpMORsZMgO4YyC0/fVSRBZjbkCYnA5A6HxBpKbxhbLG475Ru1hOjWSK7f" | ||
integrity="sha384-bEmr9fQOeqqFlnjH8Xk1rJ5CVyml3xsspAYmkG8Yd+qFFFK7vacpsbK2QenOdev7" | ||
crossorigin="anonymous"></script> | ||
@@ -65,0 +65,0 @@ <script src="https://cdn.jsdelivr.net/gh/cryptonomic/conseiljs-softsigner/dist-web/conseiljs-softsigner.min.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
809800
139
7761
1