@cosmjs/amino
Advanced tools
Comparing version 0.27.1 to 0.28.0-rc1
@@ -44,5 +44,5 @@ "use strict"; | ||
function pubkeyToAddress(pubkey, prefix) { | ||
return encoding_1.Bech32.encode(prefix, pubkeyToRawAddress(pubkey)); | ||
return (0, encoding_1.toBech32)(prefix, pubkeyToRawAddress(pubkey)); | ||
} | ||
exports.pubkeyToAddress = pubkeyToAddress; | ||
//# sourceMappingURL=addresses.js.map |
@@ -13,3 +13,3 @@ "use strict"; | ||
}; | ||
expect((0, addresses_1.pubkeyToRawAddress)(pubkey)).toEqual(encoding_1.Bech32.decode("cosmos1h806c7khnvmjlywdrkdgk2vrayy2mmvf9rxk2r").data); | ||
expect((0, addresses_1.pubkeyToRawAddress)(pubkey)).toEqual((0, encoding_1.fromBech32)("cosmos1h806c7khnvmjlywdrkdgk2vrayy2mmvf9rxk2r").data); | ||
}); | ||
@@ -21,3 +21,3 @@ it("works for Ed25519", () => { | ||
}; | ||
expect((0, addresses_1.pubkeyToRawAddress)(pubkey)).toEqual(encoding_1.Bech32.decode("cosmos1pfq05em6sfkls66ut4m2257p7qwlk448h8mysz").data); | ||
expect((0, addresses_1.pubkeyToRawAddress)(pubkey)).toEqual((0, encoding_1.fromBech32)("cosmos1pfq05em6sfkls66ut4m2257p7qwlk448h8mysz").data); | ||
}); | ||
@@ -24,0 +24,0 @@ it("works for multisig", () => { |
@@ -76,3 +76,3 @@ "use strict"; | ||
function decodeBech32Pubkey(bechEncoded) { | ||
const { data } = encoding_1.Bech32.decode(bechEncoded); | ||
const { data } = (0, encoding_1.fromBech32)(bechEncoded); | ||
return decodeAminoPubkey(data); | ||
@@ -188,5 +188,5 @@ } | ||
function encodeBech32Pubkey(pubkey, prefix) { | ||
return encoding_1.Bech32.encode(prefix, encodeAminoPubkey(pubkey)); | ||
return (0, encoding_1.toBech32)(prefix, encodeAminoPubkey(pubkey)); | ||
} | ||
exports.encodeBech32Pubkey = encodeBech32Pubkey; | ||
//# sourceMappingURL=encoding.js.map |
@@ -22,3 +22,3 @@ "use strict"; | ||
it("works for secp256k1", () => { | ||
const amino = encoding_1.Bech32.decode("cosmospub1addwnpepqd8sgxq7aw348ydctp3n5ajufgxp395hksxjzc6565yfp56scupfqhlgyg5").data; | ||
const amino = (0, encoding_1.fromBech32)("cosmospub1addwnpepqd8sgxq7aw348ydctp3n5ajufgxp395hksxjzc6565yfp56scupfqhlgyg5").data; | ||
expect((0, encoding_2.decodeAminoPubkey)(amino)).toEqual({ | ||
@@ -32,3 +32,3 @@ type: "tendermint/PubKeySecp256k1", | ||
// Decoded from http://localhost:26657/validators | ||
const amino = encoding_1.Bech32.decode("coralvalconspub1zcjduepqvxg72ccnl9r65fv0wn3amlk4sfzqfe2k36l073kjx2qyaf6sk23qw7j8wq").data; | ||
const amino = (0, encoding_1.fromBech32)("coralvalconspub1zcjduepqvxg72ccnl9r65fv0wn3amlk4sfzqfe2k36l073kjx2qyaf6sk23qw7j8wq").data; | ||
expect((0, encoding_2.decodeAminoPubkey)(amino)).toEqual({ | ||
@@ -43,3 +43,3 @@ type: "tendermint/PubKeyEd25519", | ||
it("works for multisig", () => { | ||
const pubkeyData = encoding_1.Bech32.decode("cosmospub1addwnpepqd8sgxq7aw348ydctp3n5ajufgxp395hksxjzc6565yfp56scupfqhlgyg5").data; | ||
const pubkeyData = (0, encoding_1.fromBech32)("cosmospub1addwnpepqd8sgxq7aw348ydctp3n5ajufgxp395hksxjzc6565yfp56scupfqhlgyg5").data; | ||
const pubkey = { | ||
@@ -118,3 +118,3 @@ type: "tendermint/PubKeySecp256k1", | ||
}; | ||
const expected = encoding_1.Bech32.decode("cosmospub1addwnpepqd8sgxq7aw348ydctp3n5ajufgxp395hksxjzc6565yfp56scupfqhlgyg5").data; | ||
const expected = (0, encoding_1.fromBech32)("cosmospub1addwnpepqd8sgxq7aw348ydctp3n5ajufgxp395hksxjzc6565yfp56scupfqhlgyg5").data; | ||
expect((0, encoding_2.encodeAminoPubkey)(pubkey)).toEqual(expected); | ||
@@ -129,3 +129,3 @@ }); | ||
}; | ||
const expected = encoding_1.Bech32.decode("coralvalconspub1zcjduepqvxg72ccnl9r65fv0wn3amlk4sfzqfe2k36l073kjx2qyaf6sk23qw7j8wq").data; | ||
const expected = (0, encoding_1.fromBech32)("coralvalconspub1zcjduepqvxg72ccnl9r65fv0wn3amlk4sfzqfe2k36l073kjx2qyaf6sk23qw7j8wq").data; | ||
expect((0, encoding_2.encodeAminoPubkey)(pubkey)).toEqual(expected); | ||
@@ -152,9 +152,9 @@ }); | ||
it("works for multisig", () => { | ||
const expected1 = encoding_1.Bech32.decode(testutils_spec_1.testgroup1PubkeyBech32).data; | ||
const expected1 = (0, encoding_1.fromBech32)(testutils_spec_1.testgroup1PubkeyBech32).data; | ||
expect((0, encoding_2.encodeAminoPubkey)(testutils_spec_1.testgroup1)).toEqual(expected1); | ||
const expected2 = encoding_1.Bech32.decode(testutils_spec_1.testgroup2PubkeyBech32).data; | ||
const expected2 = (0, encoding_1.fromBech32)(testutils_spec_1.testgroup2PubkeyBech32).data; | ||
expect((0, encoding_2.encodeAminoPubkey)(testutils_spec_1.testgroup2)).toEqual(expected2); | ||
const expected3 = encoding_1.Bech32.decode(testutils_spec_1.testgroup3PubkeyBech32).data; | ||
const expected3 = (0, encoding_1.fromBech32)(testutils_spec_1.testgroup3PubkeyBech32).data; | ||
expect((0, encoding_2.encodeAminoPubkey)(testutils_spec_1.testgroup3)).toEqual(expected3); | ||
const expected4 = encoding_1.Bech32.decode(testutils_spec_1.testgroup4PubkeyBech32).data; | ||
const expected4 = (0, encoding_1.fromBech32)(testutils_spec_1.testgroup4PubkeyBech32).data; | ||
expect((0, encoding_2.encodeAminoPubkey)(testutils_spec_1.testgroup4)).toEqual(expected4); | ||
@@ -161,0 +161,0 @@ }); |
@@ -75,3 +75,6 @@ "use strict"; | ||
const seed = await crypto_1.Bip39.mnemonicToSeed(mnemonicChecked, options.bip39Password); | ||
return new Secp256k1HdWallet(mnemonicChecked, Object.assign(Object.assign({}, options), { seed: seed })); | ||
return new Secp256k1HdWallet(mnemonicChecked, { | ||
...options, | ||
seed: seed, | ||
}); | ||
} | ||
@@ -231,3 +234,3 @@ /** | ||
const { privkey, pubkey } = await this.getKeyPair(hdPath); | ||
const address = encoding_1.Bech32.encode(prefix, (0, addresses_1.rawSecp256k1PubkeyToRawAddress)(pubkey)); | ||
const address = (0, encoding_1.toBech32)(prefix, (0, addresses_1.rawSecp256k1PubkeyToRawAddress)(pubkey)); | ||
return { | ||
@@ -234,0 +237,0 @@ algo: "secp256k1", |
@@ -31,3 +31,3 @@ "use strict"; | ||
get address() { | ||
return encoding_1.Bech32.encode(this.prefix, (0, addresses_1.rawSecp256k1PubkeyToRawAddress)(this.pubkey)); | ||
return (0, encoding_1.toBech32)(this.prefix, (0, addresses_1.rawSecp256k1PubkeyToRawAddress)(this.pubkey)); | ||
} | ||
@@ -34,0 +34,0 @@ async getAccounts() { |
@@ -8,3 +8,3 @@ "use strict"; | ||
function makeRandomAddress() { | ||
return encoding_1.Bech32.encode("cosmos", crypto_1.Random.getBytes(20)); | ||
return (0, encoding_1.toBech32)("cosmos", crypto_1.Random.getBytes(20)); | ||
} | ||
@@ -11,0 +11,0 @@ const testAddress = "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6"; |
{ | ||
"name": "@cosmjs/amino", | ||
"version": "0.27.1", | ||
"description": "Helpers for Amino based signing which are shared between @cosmjs/launchpad and @cosmjs/stargate.", | ||
"version": "0.28.0-rc1", | ||
"description": "Helpers for Amino based signing.", | ||
"contributors": [ | ||
@@ -43,6 +43,6 @@ "Simon Warta <webmaster128@users.noreply.github.com>" | ||
"dependencies": { | ||
"@cosmjs/crypto": "0.27.1", | ||
"@cosmjs/encoding": "0.27.1", | ||
"@cosmjs/math": "0.27.1", | ||
"@cosmjs/utils": "0.27.1" | ||
"@cosmjs/crypto": "0.28.0-rc1", | ||
"@cosmjs/encoding": "0.28.0-rc1", | ||
"@cosmjs/math": "0.28.0-rc1", | ||
"@cosmjs/utils": "0.28.0-rc1" | ||
}, | ||
@@ -69,3 +69,3 @@ "devDependencies": { | ||
"jasmine-spec-reporter": "^6", | ||
"karma": "^6.1.1", | ||
"karma": "^6.3.14", | ||
"karma-chrome-launcher": "^3.1.0", | ||
@@ -79,3 +79,2 @@ "karma-firefox-launcher": "^2.1.0", | ||
"source-map-support": "^0.5.19", | ||
"stream-browserify": "^3.0.0", | ||
"ts-node": "^8", | ||
@@ -86,3 +85,4 @@ "typedoc": "^0.22", | ||
"webpack-cli": "^4.6.0" | ||
} | ||
}, | ||
"stableVersion": "0.27.1" | ||
} |
@@ -5,4 +5,3 @@ # @cosmjs/amino | ||
Helpers for Amino based signing which are shared between @cosmjs/launchpad and | ||
@cosmjs/stargate. | ||
Helpers for Amino for @cosmjs/stargate. | ||
@@ -9,0 +8,0 @@ ## License |
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
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
33
2378
186638
12
+ Added@cosmjs/crypto@0.28.0-rc1(transitive)
+ Added@cosmjs/encoding@0.28.0-rc1(transitive)
+ Added@cosmjs/math@0.28.0-rc1(transitive)
+ Added@cosmjs/utils@0.28.0-rc1(transitive)
- Removed@cosmjs/crypto@0.27.1(transitive)
- Removed@cosmjs/encoding@0.27.1(transitive)
- Removed@cosmjs/math@0.27.1(transitive)
- Removed@cosmjs/utils@0.27.1(transitive)
- Removedbip39@3.1.0(transitive)
- Removedhash-base@3.1.0(transitive)
- Removedjs-sha3@0.8.0(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updated@cosmjs/crypto@0.28.0-rc1
Updated@cosmjs/encoding@0.28.0-rc1
Updated@cosmjs/math@0.28.0-rc1
Updated@cosmjs/utils@0.28.0-rc1