Skip to content

Commit 8649da7

Browse files
committed
New release: cardano-signer 1.12.1
1 parent 3a5cd2e commit 8649da7

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/cardano-signer.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//define name and version
22
const appname = "cardano-signer"
3-
const version = "1.12.0"
3+
const version = "1.12.1"
44

55
//external dependencies
66
const CardanoWasm = require("@emurgo/cardano-serialization-lib-nodejs")
@@ -13,7 +13,7 @@ const fnv32 = require('fnv32'); //used for CIP-8/CIP-30 checksum generation (fnv
1313

1414
//set the options for the command-line arguments. needed so that arguments like data-hex="001122" are not parsed as numbers
1515
const parse_options = {
16-
string: ['secret-key', 'public-key', 'signature', 'address', 'rewards-address', 'vote-public-key', 'data', 'data-hex', 'data-file', 'out-file', 'out-cbor', 'cose-sign1', 'cose-key'],
16+
string: ['secret-key', 'public-key', 'signature', 'address', 'rewards-address', 'payment-address', 'vote-public-key', 'data', 'data-hex', 'data-file', 'out-file', 'out-cbor', 'cose-sign1', 'cose-key'],
1717
number: ['nonce', 'vote-weight', 'vote-purpose'],
1818
boolean: ['json', 'json-extended', 'cip8', 'cip30', 'cip36', 'deregister', 'bech', 'hashed', 'nopayload'], //all booleans are set to false per default
1919
//adding some aliases so users can also use variants of the original parameters. for example using --signing-key instead of --secret-key
@@ -81,10 +81,10 @@ switch (topic) {
8181
console.log(` Params: [${FgGreen}--vote-public-key${Reset} "<path_to_file>|<hex>|<bech>" ${Dim}public-key-file(s) or public hex/bech-key string(s) to delegate the votingpower to (single or multiple)${Reset}`);
8282
console.log(` ${FgGreen}--vote-weight${Reset} <unsigned_int>] ${Dim}relative weight of each delegated votingpower, default: 100% for a single delegation${Reset}`);
8383
console.log(` ${FgGreen}--secret-key${Reset} "<path_to_file>|<hex>|<bech>" ${Dim}signing-key-file or a direct signing hex/bech-key string of the stake key (votingpower)${Reset}`);
84-
console.log(` ${FgGreen}--rewards-address${Reset} "<path_to_file>|<hex>|<bech>" ${Dim}rewards payout address (address-file or a direct bech/hex format 'addr1..., addr_test1...')${Reset}`);
84+
console.log(` ${FgGreen}--payment-address${Reset} "<path_to_file>|<hex>|<bech>" ${Dim}rewards payout address (address-file or a direct bech/hex format 'addr1..., addr_test1...')${Reset}`);
8585
console.log(` [${FgGreen}--nonce${Reset} <unsigned_int>] ${Dim}optional nonce value, if not provided the mainnet-slotHeight calculated from current machine-time will be used${Reset}`);
8686
console.log(` [${FgGreen}--vote-purpose${Reset} <unsigned_int>] ${Dim}optional parameter (unsigned int), default: 0 (catalyst)${Reset}`);
87-
console.log(` [${FgGreen}--deregister${Reset}] ${Dim}optional flag to generate a deregistration (no --vote-public-key/--vote-weight/--rewards-address needed${Reset}`);
87+
console.log(` [${FgGreen}--deregister${Reset}] ${Dim}optional flag to generate a deregistration (no --vote-public-key/--vote-weight/--payment-address needed${Reset}`);
8888
console.log(` [${FgGreen}--testnet-magic [xxx]${Reset}] ${Dim}optional flag to switch the address check to testnet-addresses, default: mainnet${Reset}`);
8989
console.log(` [${FgGreen}--json${Reset} |${FgGreen} --json-extended${Reset}] ${Dim}optional flag to generate output in json/json-extended format, default: cborHex(text)${Reset}`);
9090
console.log(` [${FgGreen}--out-file${Reset} "<path_to_file>"] ${Dim}path to an output file, default: standard-output${Reset}`);
@@ -139,6 +139,7 @@ switch (topic) {
139139
console.log(` ${Dim}https://github.com/gitmachtl (Cardano SPO Scripts \/\/ ATADA Stakepools Austria)${Reset}`)
140140
console.log(``)
141141

142+
142143
} //switch
143144
if ( exit ) { process.exit(1); }
144145
}
@@ -632,9 +633,9 @@ async function main() {
632633

633634
case "sign-cip36": //SIGN REGISTRATION DATA IN CIP-36 MODE (Catalyst)
634635

635-
//get rewards stakeaddress in bech format (must be a payment address again starting with catalyst fund10)
636-
var address = args['rewards-address'];
637-
if ( typeof address === 'undefined' || address === true ) { console.error(`Error: Missing rewards payout address`); showUsage(workMode); }
636+
//get rewards payoutaddress in bech format (must be a payment address again starting with catalyst fund10)
637+
var address = args['payment-address'];
638+
if ( typeof address === 'undefined' || address === true ) { console.error(`Error: Missing rewards payout address (--payment-address)`); showUsage(workMode); }
638639

639640
//read the address from a file or direct hex/bech
640641
rewards_addr = readAddr2hex(address);
@@ -737,7 +738,7 @@ async function main() {
737738
61284: {
738739
1: [[<vote_public_key_1>, <vote_weight_1>], [<vote_public_key_2>, <vote_weight_2>]], // delegations - byte array(s) of the voting_public_keys and the relative voting_weight(unsigned int)
739740
2: <stake_public_key>, // stake_pub - byte array
740-
3: <stake_rewards_address>, // reward_address - byte array
741+
3: <payment_rewards_address>, // reward_address - byte array
741742
4: <nonce> // nonce = slotHeight (tip)
742743
5: <voting_purpose> // voting_purpose: 0 = Catalyst
743744
}
@@ -776,7 +777,7 @@ async function main() {
776777
var content = `{ "61284": { "1": [ ${delegations} ], "2": "0x${pubKey}", "3": "0x${rewards_addr.hex}", "4": ${nonce}, "5": ${vote_purpose} }, "61285": { "1": "0x${signature}" } }`;
777778
} else if ( args['json-extended'] === true ) { //generate content in json format with additional fields
778779
var prvKeyHex = Buffer.from(prvKey.as_bytes()).toString('hex');
779-
var content = `{ "workMode": "${workMode}", "votePurpose": "${vote_purpose_description} (${vote_purpose})", "totalVoteWeight": ${total_vote_weight}, "rewardsAddressHex": "${rewards_addr.hex}", "rewardsAddressType": "${rewards_addr.type}", "rewardsAddressNetwork": "${rewards_addr.network}", "signDataHex": "${sign_data_hex}", "signature": "${signature}", "secretKey": "${prvKeyHex}", "publicKey": "${pubKey}", `;
780+
var content = `{ "workMode": "${workMode}", "votePurpose": "${vote_purpose_description} (${vote_purpose})", "totalVoteWeight": ${total_vote_weight}, "paymentAddressHex": "${rewards_addr.hex}", "paymentAddressType": "${rewards_addr.type}", "paymentAddressNetwork": "${rewards_addr.network}", "signDataHex": "${sign_data_hex}", "signature": "${signature}", "secretKey": "${prvKeyHex}", "publicKey": "${pubKey}", `;
780781
var delegations = [];
781782
for (let cnt = 0; cnt < all_vote_keys_array.length; cnt++) {
782783
delegations.push(`[ "0x${all_vote_keys_array[cnt]}", ${all_weights_array[cnt]} ]`)

src/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cardano-signer",
3-
"version": "1.12.0",
3+
"version": "1.12.1",
44
"description": "cardano-signer signs a given data(hex/text/file) with a signing key(hex/bech/file) or verify the signature via a public key(hex/bech/file). it can also produce a cip-8/cip-30 and cip-36 conform payload signing/verification.",
55
"main": "cardano-signer.js",
66
"scripts": {
@@ -12,11 +12,11 @@
1212
"@emurgo/cardano-serialization-lib-nodejs": "^11.1.0",
1313
"base64url": "^3.0.1",
1414
"bech32": "^2.0.0",
15-
"bip39": "^3.0.2",
1615
"blakejs": "^1.2.1",
1716
"cbor": "^8.1.0",
1817
"fnv32": "^0.0.1",
19-
"minimist": "^1.2.6"
18+
"minimist": "^1.2.6",
19+
"bip39": "^3.0.2"
2020
},
2121
"repository": {
2222
"type": "git",

0 commit comments

Comments
 (0)