@vostokplatform/signature-generator
Advanced tools
Comparing version 1.3.33 to 1.4.0
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
}; | ||
} | ||
return function (d, b) { | ||
@@ -515,10 +515,2 @@ extendStatics(d, b); | ||
return Promise.all(entries.map(function (entry) { | ||
// for docker tx data entries string and binary types have 4 byte length | ||
var byteLength; | ||
if (entry.type === 'string' || entry.type === 'binary') { | ||
byteLength = 4; | ||
} | ||
else { | ||
byteLength = 2; | ||
} | ||
var prependKeyBytes = function (valueBytes) { | ||
@@ -534,2 +526,3 @@ return StringWithLength.prototype.process.call(_this, entry.key).then(function (keyBytes) { | ||
return BooleanDataEntry.prototype.process.call(_this, entry.value).then(prependKeyBytes); | ||
// for docker tx data entries string and binary types have 4 byte length | ||
case 'binary': | ||
@@ -536,0 +529,0 @@ return BinaryDockerParamEntry.prototype.process.call(_this, entry.value).then(prependKeyBytes); |
@@ -284,2 +284,3 @@ "use strict"; | ||
exports.TX_TYPE_MAP["sponsorship" /* SPONSORSHIP */] = SPONSORSHIP; | ||
// Docker txs | ||
var DOCKER_CREATE = generate([ | ||
@@ -310,2 +311,47 @@ 103 /* DOCKER_CREATE */, | ||
exports.TX_TYPE_MAP["dockerCall" /* DOCKER_CALL */] = DOCKER_CALL; | ||
var DOCKER_DISABLE = generate([ | ||
106 /* DOCKER_DISABLE */, | ||
1 /* DOCKER_DISABLE */, | ||
new __1.Base58('senderPublicKey'), | ||
new __1.Base58WithLength('contractId'), | ||
new __1.Long('fee'), | ||
new __1.Long('timestamp') | ||
]); | ||
exports.TX_NUMBER_MAP[106 /* DOCKER_DISABLE */] = DOCKER_DISABLE; | ||
exports.TX_TYPE_MAP["dockerDisable" /* DOCKER_DISABLE */] = DOCKER_DISABLE; | ||
// Policy txs | ||
var POLICY_REGISTER_NODE = generate([ | ||
111 /* POLICY_REGISTER_NODE */, | ||
1 /* POLICY_REGISTER_NODE */, | ||
new __1.Base58('senderPublicKey'), | ||
new __1.StringWithLength('nodeName'), | ||
new __1.PermissionOpType('opType'), | ||
new __1.Long('fee'), | ||
new __1.Long('timestamp') | ||
]); | ||
exports.TX_NUMBER_MAP[111 /* POLICY_REGISTER_NODE */] = POLICY_REGISTER_NODE; | ||
exports.TX_TYPE_MAP["policyRegisterNode" /* POLICY_REGISTER_NODE */] = POLICY_REGISTER_NODE; | ||
var POLICY_CREATE = generate([ | ||
112 /* POLICY_CREATE */, | ||
1 /* POLICY_CREATE */, | ||
new __1.Base58('senderPublicKey'), | ||
new __1.StringWithLength('description'), | ||
new __1.StringWithLength('recipients'), | ||
new __1.StringWithLength('owners'), | ||
new __1.Long('timestamp') | ||
]); | ||
exports.TX_NUMBER_MAP[112 /* POLICY_CREATE */] = POLICY_CREATE; | ||
exports.TX_TYPE_MAP["policyCreate" /* POLICY_CREATE */] = POLICY_CREATE; | ||
var POLICY_UPDATE = generate([ | ||
113 /* POLICY_UPDATE */, | ||
1 /* POLICY_UPDATE */, | ||
new __1.Base58('senderPublicKey'), | ||
new __1.StringWithLength('policyId'), | ||
new __1.StringWithLength('recipients'), | ||
new __1.StringWithLength('owners'), | ||
new __1.PermissionOpType('opType'), | ||
new __1.Long('timestamp') | ||
]); | ||
exports.TX_NUMBER_MAP[113 /* POLICY_UPDATE */] = POLICY_UPDATE; | ||
exports.TX_TYPE_MAP["policyUpdate" /* POLICY_UPDATE */] = POLICY_UPDATE; | ||
//# sourceMappingURL=SignatureFactory.js.map |
{ | ||
"name": "@vostokplatform/signature-generator", | ||
"version": "1.3.33", | ||
"version": "1.4.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -362,10 +362,2 @@ "use strict"; | ||
return Promise.all(entries.map((entry) => { | ||
// for docker tx data entries string and binary types have 4 byte length | ||
let byteLength; | ||
if (entry.type === 'string' || entry.type === 'binary') { | ||
byteLength = 4; | ||
} | ||
else { | ||
byteLength = 2; | ||
} | ||
const prependKeyBytes = (valueBytes) => { | ||
@@ -381,2 +373,3 @@ return StringWithLength.prototype.process.call(this, entry.key).then((keyBytes) => { | ||
return BooleanDataEntry.prototype.process.call(this, entry.value).then(prependKeyBytes); | ||
// for docker tx data entries string and binary types have 4 byte length | ||
case 'binary': | ||
@@ -383,0 +376,0 @@ return BinaryDockerParamEntry.prototype.process.call(this, entry.value).then(prependKeyBytes); |
@@ -382,10 +382,2 @@ import {BigNumber} from '@waves/data-entities'; | ||
return Promise.all(entries.map((entry) => { | ||
// for docker tx data entries string and binary types have 4 byte length | ||
let byteLength; | ||
if (entry.type === 'string' || entry.type === 'binary') { | ||
byteLength = 4 | ||
} else { | ||
byteLength = 2; | ||
} | ||
const prependKeyBytes = (valueBytes) => { | ||
@@ -402,2 +394,3 @@ return StringWithLength.prototype.process.call(this, entry.key).then((keyBytes) => { | ||
return BooleanDataEntry.prototype.process.call(this, entry.value).then(prependKeyBytes); | ||
// for docker tx data entries string and binary types have 4 byte length | ||
case 'binary': | ||
@@ -404,0 +397,0 @@ return BinaryDockerParamEntry.prototype.process.call(this, entry.value).then(prependKeyBytes); |
@@ -52,3 +52,9 @@ export const PERMISSION_TRANSACTION_ROLE = { | ||
DOCKER_CREATE = 103, | ||
DOCKER_CALL = 104 | ||
DOCKER_CALL = 104, | ||
DOCKER_DISABLE = 106, | ||
POLICY_REGISTER_NODE = 111, | ||
POLICY_CREATE = 112, | ||
POLICY_UPDATE = 113, | ||
POLICY_DATA_HASH = 114 // not exposed | ||
} | ||
@@ -71,3 +77,8 @@ | ||
DOCKER_CREATE = 'dockerCreate', | ||
DOCKER_CALL = 'dockerCall' | ||
DOCKER_CALL = 'dockerCall', | ||
DOCKER_DISABLE = 'dockerDisable', | ||
POLICY_REGISTER_NODE = 'policyRegisterNode', | ||
POLICY_CREATE = 'policyCreate', | ||
POLICY_UPDATE = 'policyUpdate', | ||
POLICY_DATA_HASH = 'policyDataHash' // not exposed | ||
} | ||
@@ -90,3 +101,8 @@ | ||
DOCKER_CREATE = 1, | ||
DOCKER_CALL = 1 | ||
DOCKER_CALL = 1, | ||
DOCKER_DISABLE = 1, | ||
POLICY_REGISTER_NODE = 1, | ||
POLICY_CREATE = 1, | ||
POLICY_UPDATE = 1, | ||
POLICY_DATA_HASH = 1 // not exposed | ||
} | ||
@@ -93,0 +109,0 @@ |
@@ -130,3 +130,2 @@ // import {PERMISSION_TRANSACTION_ROLE, PERMISSION_TRANSACTION_OPERATION_TYPE} from '../constants' | ||
export interface IDOCKERCREATE_PROPS extends IDEFAULT_PROPS { | ||
/*todo*/ | ||
params: Array<IDATA_ENTRY>; | ||
@@ -139,3 +138,28 @@ fee: string; | ||
export interface IDOCKERDISABLE_PROPS extends IDEFAULT_PROPS { | ||
fee: string; | ||
contractId: string; | ||
} | ||
// policy | ||
export interface IPOLICY_REGISTER_NODE_PROPS extends IDEFAULT_PROPS { | ||
opType: string; | ||
nodeName: string; | ||
} | ||
export interface IPOLICY_CREATE_PROPS extends IDEFAULT_PROPS { | ||
description: string; | ||
recipients: string; | ||
owners: string; | ||
} | ||
export interface IPOLICY_UPDATE_PROPS extends IDEFAULT_PROPS { | ||
opType: string; | ||
policyId: string; | ||
recipients: string; | ||
owners: string; | ||
} | ||
export interface IDATA_ENTRY { | ||
@@ -163,2 +187,6 @@ key: string; | ||
104: ISignatureGeneratorConstructor<IDOCKERCALL_PROPS>; | ||
106: ISignatureGeneratorConstructor<IDOCKERDISABLE_PROPS>; | ||
111: ISignatureGeneratorConstructor<IPOLICY_REGISTER_NODE_PROPS>; | ||
112: ISignatureGeneratorConstructor<IPOLICY_CREATE_PROPS>; | ||
113: ISignatureGeneratorConstructor<IPOLICY_UPDATE_PROPS>; | ||
} | ||
@@ -183,2 +211,7 @@ | ||
dockerCall: ISignatureGeneratorConstructor<IDOCKERCALL_PROPS>; | ||
dockerDisable: ISignatureGeneratorConstructor<IDOCKERDISABLE_PROPS>; | ||
policyRegisterNode: ISignatureGeneratorConstructor<IPOLICY_REGISTER_NODE_PROPS>; | ||
policyCreate: ISignatureGeneratorConstructor<IPOLICY_CREATE_PROPS>; | ||
policyUpdate: ISignatureGeneratorConstructor<IPOLICY_UPDATE_PROPS>; | ||
} |
@@ -279,2 +279,3 @@ "use strict"; | ||
exports.TX_TYPE_MAP["sponsorship" /* SPONSORSHIP */] = SPONSORSHIP; | ||
// Docker txs | ||
const DOCKER_CREATE = generate([ | ||
@@ -305,1 +306,46 @@ 103 /* DOCKER_CREATE */, | ||
exports.TX_TYPE_MAP["dockerCall" /* DOCKER_CALL */] = DOCKER_CALL; | ||
const DOCKER_DISABLE = generate([ | ||
106 /* DOCKER_DISABLE */, | ||
1 /* DOCKER_DISABLE */, | ||
new __1.Base58('senderPublicKey'), | ||
new __1.Base58WithLength('contractId'), | ||
new __1.Long('fee'), | ||
new __1.Long('timestamp') | ||
]); | ||
exports.TX_NUMBER_MAP[106 /* DOCKER_DISABLE */] = DOCKER_DISABLE; | ||
exports.TX_TYPE_MAP["dockerDisable" /* DOCKER_DISABLE */] = DOCKER_DISABLE; | ||
// Policy txs | ||
const POLICY_REGISTER_NODE = generate([ | ||
111 /* POLICY_REGISTER_NODE */, | ||
1 /* POLICY_REGISTER_NODE */, | ||
new __1.Base58('senderPublicKey'), | ||
new __1.StringWithLength('nodeName'), | ||
new __1.PermissionOpType('opType'), | ||
new __1.Long('fee'), | ||
new __1.Long('timestamp') | ||
]); | ||
exports.TX_NUMBER_MAP[111 /* POLICY_REGISTER_NODE */] = POLICY_REGISTER_NODE; | ||
exports.TX_TYPE_MAP["policyRegisterNode" /* POLICY_REGISTER_NODE */] = POLICY_REGISTER_NODE; | ||
const POLICY_CREATE = generate([ | ||
112 /* POLICY_CREATE */, | ||
1 /* POLICY_CREATE */, | ||
new __1.Base58('senderPublicKey'), | ||
new __1.StringWithLength('description'), | ||
new __1.StringWithLength('recipients'), | ||
new __1.StringWithLength('owners'), | ||
new __1.Long('timestamp') | ||
]); | ||
exports.TX_NUMBER_MAP[112 /* POLICY_CREATE */] = POLICY_CREATE; | ||
exports.TX_TYPE_MAP["policyCreate" /* POLICY_CREATE */] = POLICY_CREATE; | ||
const POLICY_UPDATE = generate([ | ||
113 /* POLICY_UPDATE */, | ||
1 /* POLICY_UPDATE */, | ||
new __1.Base58('senderPublicKey'), | ||
new __1.StringWithLength('policyId'), | ||
new __1.StringWithLength('recipients'), | ||
new __1.StringWithLength('owners'), | ||
new __1.PermissionOpType('opType'), | ||
new __1.Long('timestamp') | ||
]); | ||
exports.TX_NUMBER_MAP[113 /* POLICY_UPDATE */] = POLICY_UPDATE; | ||
exports.TX_TYPE_MAP["policyUpdate" /* POLICY_UPDATE */] = POLICY_UPDATE; |
@@ -27,3 +27,8 @@ import { | ||
PermissionDueTimestamp, | ||
IDOCKERCREATE_PROPS, IDOCKERCALL_PROPS | ||
IDOCKERCREATE_PROPS, | ||
IDOCKERCALL_PROPS, | ||
IDOCKERDISABLE_PROPS, | ||
IPOLICY_UPDATE_PROPS, | ||
IPOLICY_CREATE_PROPS, | ||
IPOLICY_REGISTER_NODE_PROPS | ||
} from '..'; | ||
@@ -360,2 +365,4 @@ import { | ||
// Docker txs | ||
const DOCKER_CREATE = generate<IDOCKERCREATE_PROPS>([ | ||
@@ -388,2 +395,57 @@ constants.TRANSACTION_TYPE_NUMBER.DOCKER_CREATE, | ||
TX_NUMBER_MAP[constants.TRANSACTION_TYPE_NUMBER.DOCKER_CALL] = DOCKER_CALL; | ||
TX_TYPE_MAP[constants.TRANSACTION_TYPE.DOCKER_CALL] = DOCKER_CALL; | ||
TX_TYPE_MAP[constants.TRANSACTION_TYPE.DOCKER_CALL] = DOCKER_CALL; | ||
const DOCKER_DISABLE = generate<IDOCKERDISABLE_PROPS>([ | ||
constants.TRANSACTION_TYPE_NUMBER.DOCKER_DISABLE, | ||
constants.TRANSACTION_TYPE_VERSION.DOCKER_DISABLE, | ||
new Base58('senderPublicKey'), | ||
new Base58WithLength('contractId'), | ||
new Long('fee'), | ||
new Long('timestamp') | ||
]); | ||
TX_NUMBER_MAP[constants.TRANSACTION_TYPE_NUMBER.DOCKER_DISABLE] = DOCKER_DISABLE; | ||
TX_TYPE_MAP[constants.TRANSACTION_TYPE.DOCKER_DISABLE] = DOCKER_DISABLE; | ||
// Policy txs | ||
const POLICY_REGISTER_NODE = generate<IPOLICY_REGISTER_NODE_PROPS>([ | ||
constants.TRANSACTION_TYPE_NUMBER.POLICY_REGISTER_NODE, | ||
constants.TRANSACTION_TYPE_VERSION.POLICY_REGISTER_NODE, | ||
new Base58('senderPublicKey'), | ||
new StringWithLength('nodeName'), | ||
new PermissionOpType('opType'), // todo - rename. currently permission and policy have same op types | ||
new Long('fee'), | ||
new Long('timestamp') | ||
]); | ||
TX_NUMBER_MAP[constants.TRANSACTION_TYPE_NUMBER.POLICY_REGISTER_NODE] = POLICY_REGISTER_NODE; | ||
TX_TYPE_MAP[constants.TRANSACTION_TYPE.POLICY_REGISTER_NODE] = POLICY_REGISTER_NODE; | ||
const POLICY_CREATE = generate<IPOLICY_CREATE_PROPS>([ | ||
constants.TRANSACTION_TYPE_NUMBER.POLICY_CREATE, | ||
constants.TRANSACTION_TYPE_VERSION.POLICY_CREATE, | ||
new Base58('senderPublicKey'), | ||
new StringWithLength('description'), | ||
new StringWithLength('recipients'), // todo | ||
new StringWithLength('owners'), // todo | ||
new Long('timestamp') | ||
]); | ||
TX_NUMBER_MAP[constants.TRANSACTION_TYPE_NUMBER.POLICY_CREATE] = POLICY_CREATE; | ||
TX_TYPE_MAP[constants.TRANSACTION_TYPE.POLICY_CREATE] = POLICY_CREATE; | ||
const POLICY_UPDATE = generate<IPOLICY_UPDATE_PROPS>([ | ||
constants.TRANSACTION_TYPE_NUMBER.POLICY_UPDATE, | ||
constants.TRANSACTION_TYPE_VERSION.POLICY_UPDATE, | ||
new Base58('senderPublicKey'), | ||
new StringWithLength('policyId'), | ||
new StringWithLength('recipients'), // todo | ||
new StringWithLength('owners'), // todo | ||
new PermissionOpType('opType'), // todo - rename. currently permission and policy have same op types | ||
new Long('timestamp') | ||
]); | ||
TX_NUMBER_MAP[constants.TRANSACTION_TYPE_NUMBER.POLICY_UPDATE] = POLICY_UPDATE; | ||
TX_TYPE_MAP[constants.TRANSACTION_TYPE.POLICY_UPDATE] = POLICY_UPDATE; |
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 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
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
6283265
83
110093