Compare commits

..
52 Commits
Author SHA1 Message Date
github-actions[bot] 9281daa14c [CI Skip] release/stable 14.0.3
Lock Threads / lock (push) Has been cancelled
skip-checks: true
2026-03-23 12:53:26 +00:00
Tarik Gul c7ed69fe55 14.0.3 (#2025) 2026-03-23 14:48:13 +02:00
github-actions[bot] 22a1246672 [CI Skip] bump/beta 14.0.3-0-x
skip-checks: true
2026-03-22 21:42:26 +00:00
Francis O'Brien 4a5b6acc78 Fix(hw-ledger): reset transport on operation errors and add explicit disconnect API (#2024)
* fix(hw-ledger): close transport on withApp errors

* feat(hw-ledger): add disconnect method to close active transport connection
2026-03-22 17:37:13 -04:00
github-actions[bot] 152d4609a4 [CI Skip] release/stable 14.0.2
skip-checks: true
2026-03-16 18:24:20 +00:00
Tarik Gul 4ab957e568 14.0.2 (#2023) 2026-03-16 20:19:11 +02:00
github-actions[bot] 610c8bb15f [CI Skip] bump/beta 14.0.2-1-x
skip-checks: true
2026-03-13 20:55:22 +00:00
AndreasGassmann 372d460f1a fix(util-crypto): use correct x/y getters in secp256k1Expand (#2018) 2026-03-13 16:50:22 -04:00
github-actions[bot] a8732a99aa [CI Skip] bump/beta 14.0.2-0-x
skip-checks: true
2026-03-12 16:59:11 +00:00
Tarik Gul 8d3cb0eb6b Set headers to 2026 (#2021) 2026-03-12 18:53:56 +02:00
github-actions[bot] fe0886be23 [CI Skip] release/stable 14.0.1
skip-checks: true
2025-12-09 08:34:53 +00:00
rajk93 bac357ae10 14.0.1 (#2014)
* 14.0.1

* chore: update CHANGELOG.md
2025-12-09 14:01:18 +05:30
github-actions[bot] 4ab7a5bfe0 [CI Skip] bump/beta 13.5.10-1-x
skip-checks: true
2025-12-09 07:34:50 +00:00
rajk93 440b146a24 fix(x-randomvalues): prioritize native RN modules over polyfilled crypto (#2013) 2025-12-09 13:01:07 +05:30
github-actions[bot] ae0735ccda [CI Skip] bump/beta 13.5.10-0-x
skip-checks: true
2025-12-08 13:13:55 +00:00
Paul Miller 57551b38a0 sr25519: switch from wasm to micro-sr25519 (#1971)
* sr25519: switch from wasm to micro-sr25519

* commit yarn lockfile

* Update to scure/sr25519 v0.2

* Fix build

* Commit
2025-12-08 18:40:16 +05:30
github-actions[bot] bf63a0ebf6 [CI Skip] release/stable 13.5.9
skip-checks: true
2025-11-25 08:17:11 +00:00
rajk93 d78344d000 13.5.9 (#2012) 2025-11-25 13:43:32 +05:30
github-actions[bot] 169a702c88 [CI Skip] bump/beta 13.5.9-0-x
skip-checks: true
2025-11-25 08:02:38 +00:00
rajk93 b4d73ef49a chore: bump polkadot dependencies (#2011) 2025-11-25 13:28:57 +05:30
github-actions[bot] 21ef853fbd [CI Skip] release/stable 13.5.8
skip-checks: true
2025-11-11 06:04:48 +00:00
rajk93 a4d940cb69 13.5.8 (#2010) 2025-11-11 11:31:13 +05:30
github-actions[bot] 6423537dbe [CI Skip] bump/beta 13.5.8-0-x
skip-checks: true
2025-11-11 04:05:17 +00:00
rajk93 61125b3582 chore: bump polkadot dependencies (#2009) 2025-11-11 09:31:28 +05:30
github-actions[bot] 7d77f89f34 [CI Skip] release/stable 13.5.7
skip-checks: true
2025-10-13 14:54:53 +00:00
Valentin Fernandez bee7204f95 13.5.7 (#2008) 2025-10-13 11:51:23 -03:00
github-actions[bot] bb0715ec2f [CI Skip] bump/beta 13.5.7-0-x
skip-checks: true
2025-10-13 14:24:21 +00:00
Valentin Fernandez 2212f31f9a Revert "Set pbkdf2Encode rounds to default to 210,000 (#1983)" (#2007)
This reverts commit e5e6bdd814.
2025-10-13 11:20:32 -03:00
github-actions[bot] 047840319e [CI Skip] release/stable 13.5.6
skip-checks: true
2025-08-26 16:49:24 +00:00
Arjun Porwal 3fbf0b98c2 13.5.6 (#2004) 2025-08-26 13:45:40 -03:00
github-actions[bot] e6b0411e9c [CI Skip] bump/beta 13.5.6-2-x
skip-checks: true
2025-08-26 14:00:47 +00:00
Valentin Fernandez 6e8199bab7 Bump @polkadot/wasm deps (#2002)
* bump  deps

* small tweak
2025-08-26 10:56:53 -03:00
github-actions[bot] 8ca4525570 [CI Skip] bump/beta 13.5.6-1-x
skip-checks: true
2025-08-22 14:13:55 +00:00
henrikdent 0c3a71145a Add DENTNet ledger support (via generic Polkadot app) (#1942) 2025-08-22 11:10:05 -03:00
github-actions[bot] 9c1be4f19b [CI Skip] bump/beta 13.5.6-0-x
skip-checks: true
2025-08-20 15:59:22 +00:00
Tarik GulandValentin Fernandez e5e6bdd814 Set pbkdf2Encode rounds to default to 210,000 (#1983)
* Set pbkdf2Encode rounds to default to 210,000

* Cap amount of rounds to 2048 when onlyJS = true to prevent overflow issues.

* Patch tests to use a consistent amount of encoding rounds.

* lint

* Add additional docs

* lint

---------

Co-authored-by: Valentin Fernandez <tinchofernandez8@gmail.com>
2025-08-20 12:55:25 -03:00
github-actions[bot] 55a3201bd5 [CI Skip] release/stable 13.5.5
skip-checks: true
2025-08-11 15:47:48 +00:00
Valentin Fernandez de2538c18d 13.5.5. (#2000) 2025-08-11 12:44:05 -03:00
github-actions[bot] e8dced9fed [CI Skip] bump/beta 13.5.5-0-x
skip-checks: true
2025-08-04 17:54:26 +00:00
José Molina ColmeneroandValentin Fernandez 0afe1144d1 Add ledger support for Mythos (#1969)
* Add ledger support for Mythos

* Fix linting issues

* Remove Mythos from prevLedgerRecord

* allow mythos ss58

* ss58 Exceptions list

---------

Co-authored-by: Valentin Fernandez <tinchofernandez8@gmail.com>
2025-08-04 14:50:37 -03:00
github-actions[bot] 5a04d67bb2 [CI Skip] release/stable 13.5.4
skip-checks: true
2025-07-28 16:16:48 +00:00
Arjun Porwal 41481c1e3a 13.5.4 (#1999) 2025-07-28 21:43:02 +05:30
github-actions[bot] 8a8b583f81 [CI Skip] bump/beta 13.5.4-0-x
skip-checks: true
2025-07-28 15:59:37 +00:00
SalinaandBeqa Abuladze 03c8169cd9 Add Creditcoin3 support to Generic Ledger App (#1985)
* Update genesis.ts with creditcoin3 geneis hash

* Update defaults.ts with a Creditcoin3

* Update ledger.ts with creditcoin3

* Update defaults.ts to move creditcoin3 in sorted order

* chore: move creditcoin3 to genericLedgerApps

* chore: add cc3 testnet, drynet and devnet

* chore: yarn lint

---------

Co-authored-by: Beqa Abuladze <beqaabuladze.00@gmail.com>
2025-07-28 21:25:51 +05:30
github-actions[bot] f9ee358442 [CI Skip] release/stable 13.5.3
skip-checks: true
2025-07-01 15:36:43 +00:00
rajk93 ef5cfc728c 13.5.3 (#1996) 2025-07-01 12:32:55 -03:00
github-actions[bot] 88b8a54018 [CI Skip] bump/beta 13.5.3-2-x
skip-checks: true
2025-07-01 14:46:07 +00:00
rajk93 8c666725b2 chore: update polkadot dependencies (#1995) 2025-07-01 11:42:12 -03:00
github-actions[bot] daabdfac45 [CI Skip] bump/beta 13.5.3-1-x
skip-checks: true
2025-06-30 10:23:33 +00:00
Arjun Porwal 538359fd49 Add Optional Strict Input Checking to u8aToU8a (#1994)
* fix: add error handling for null and undefined inputs in u8aToU8a function

* fix: update u8aToU8a function to handle null/undefined inputs with strict checking

* docs: update documentation for u8aToU8a
2025-06-30 15:49:42 +05:30
github-actions[bot] df044669e2 [CI Skip] bump/beta 13.5.3-0-x
skip-checks: true
2025-06-18 16:10:04 +00:00
Arjun Porwal 60374f417a Update scrypt parameter validation (#1993)
* feat: update scrypt parameter validation to use ALLOWED_PARAMS

* fix: lint
2025-06-18 21:36:13 +05:30
622 changed files with 1046 additions and 847 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util authors & contributors
// Copyright 2017-2026 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = require('@polkadot/dev/config/prettier.cjs');
+78
View File
@@ -1,5 +1,83 @@
# CHANGELOG
## 14.0.3 Mar 23, 2026
Changes:
- Fix(hw-ledger): reset transport on operation errors and add explicit disconnect API ([#2024](https://github.com/polkadot-js/common/pull/2024))
## 14.0.2 Mar 16, 2026
Changes:
- Set headers to 2026 ([#2021](https://github.com/polkadot-js/common/pull/2021))
Contributed:
- fix(util-crypto): use correct x/y getters in secp256k1Expand ([#2018](https://github.com/polkadot-js/common/pull/2018)) (Thanks to https://github.com/AndreasGassmann)
## 14.0.1 Dec 9, 2025
Changes:
- fix(x-randomvalues): prioritize native RN modules over polyfilled crypto ([#2013](https://github.com/polkadot-js/common/pull/2013))
- sr25519: switch from wasm to micro-sr25519 ([#1971](https://github.com/polkadot-js/common/pull/1971))
## 13.5.9 Nov 25, 2025
Changes:
- Bump polkadot dependencies ([#2011](https://github.com/polkadot-js/common/pull/2011))
## 13.5.8 Nov 11, 2025
Changes:
- Bump @polkadot dependencies ([#2009](https://github.com/polkadot-js/common/pull/2009))
## 13.5.7 Oct 13, 2025
Changes:
- Revert "Set pbkdf2Encode rounds to default to 210,000" ([#2007](https://github.com/polkadot-js/common/pull/2007))
## 13.5.6 Aug 26, 2025
Changes:
- Set pbkdf2Encode rounds to default to 210,000 ([#1983](https://github.com/polkadot-js/common/pull/1983))
- Bump @polkadot/wasm deps ([#2002](https://github.com/polkadot-js/common/pull/2002))
Contributed:
- Add DENTNet to generic Polkadot app supported chains ([#1942](https://github.com/polkadot-js/common/pull/1942))
## 13.5.5 Aug 11, 2025
Changes:
- Add ledger support for Mythos ([#1969](https://github.com/polkadot-js/common/pull/1969))
## 13.5.4 July 28, 2025
Changes:
- Add Creditcoin3 support to Generic Ledger App ([#1985](https://github.com/polkadot-js/common/pull/1985))
## 13.5.3 July 1, 2025
Changes:
- Update polkadot dependencies ([#1995](https://github.com/polkadot-js/common/pull/1995))
- Add Optional Strict Input Checking to u8aToU8a ([#1994](https://github.com/polkadot-js/common/pull/1994))
- Update scrypt parameter validation ([#1993](https://github.com/polkadot-js/common/pull/1993))
## 13.5.2 Jun 17, 2025
Changes:
+10 -5
View File
@@ -1,15 +1,17 @@
1674 Jaco Bump deps (#1912)
43 Tarik Gul 13.5.1 (#1988)
47 Tarik Gul 14.0.3 (#2025)
13 Carlo Sala feat(networks): add zeitgeist Ledger support (#1840)
11 Valentin Fernandez 13.5.7 (#2008)
9 Antoine Estienne Add eth uri keyring test (#1291)
7 Valentin Fernandez 13.5.2 (#1992)
9 rajk93 14.0.1 (#2014)
6 Amaury Martiny Add tests from Rust (#283)
6 Jakub Pánik HydraDX -> Hydration rebrand (#1923)
5 Arjun Porwal 13.5.6 (#2004)
5 kwingram25 Add BN consts and timeToString (#610)
4 Adam Dossa Update Polymesh Genesis Hash (#1193)
4 pan add bifrost kusama (#1626)
3 AndreasGassmann fix(util-crypto): use correct x/y getters in secp256k1Expand (#2018)
3 Luke Schoen docs: Fix example in readme since we use default imports (#243)
2 AndreasGassmann feat(dependencies): remove moment.js (#530)
2 Cameron Fairchild Add bittensor details (#1783)
2 Gav Wood Fix stake:unstake (#182)
2 Hyungsuk Kang Add cross client Encryption/Decryption (#496)
@@ -24,22 +26,24 @@
1 Alexander Krupenkin Added ECDSA keypair support (#589)
1 alexdniep added equilibrium slip44; added equilibrium genesis hash (#984)
1 amphineko chore: fix typo in versionDetect messages (#941)
1 Arjun Porwal Add input length validation in `scryptFromU8a` function (#1990)
1 Axel Chalon Simplify @polkadot/keyring KeyringPair (#419)
1 Brad Larson [FIX] Adjust error message (#646)
1 Carlos Medeiros add hydradx to knownLedger (#1647)
1 Chris Get rid of warnings for dual esm and cjs packages of the same version (#1890)
1 Dmitrii Novikov Add `Vara` support to Generic Ledger App (#1958)
1 Eliott Teissonniere add nodle ledger specs (#1089)
1 Francis O'Brien Fix(hw-ledger): reset transport on operation errors and add explicit disconnect API (#2024)
1 Guilane DENGUIR feat(VTB): Added support for VTB blockchain (#1651)
1 h4x3rotab Throws an error when signing with a locked keypair (#578)
1 Harry Liu Update README.md (#446)
1 henrikdent Add DENTNet ledger support (via generic Polkadot app) (#1942)
1 Hoon Kim replace plasm genesis with astar (#1397)
1 Hussein Ait-Lahcen Add Picasso Genesis Hash (#1261)
1 Igor Support genshiro network (#1148)
1 Jake Naviasky Add evmToAddress and addressToEvm crypto utils. (#705)
1 JesseAbram added check if valid address to docs (#440)
1 joe petrowski Add example for multisig address creation (#590)
1 José Molina Colmenero Add ledger support for Mythos (#1969)
1 kaelnew add ledger support for stafi (#1569)
1 Leonardo Custodio Ledger support (#1879)
1 Leonardo Razovic feat: add Polimec (#1945)
@@ -51,14 +55,15 @@
1 Mohsan Riaz Add Ternoa for ledger hardware support (#1711)
1 nahuseyoum Reserving 65 for Aventus based on the new extended range (#871)
1 Nantian add acala ledger config (#1485)
1 Paul Miller sr25519: switch from wasm to micro-sr25519 (#1971)
1 peetzweg/ adds `isRiscV` guard function similar to isWasm (#1878)
1 qwer951123 Add acala genesis (#1161)
1 Radek Bochenek feat: add Liberland support to Generic Ledger App (#1989)
1 rajk93 chore: add error handling for secure rng in react native (#1991)
1 Raoul Millais Fix yarn add instructions in x-global README (#873)
1 Raymond Zhong Add Edgeware ledger app (#1006)
1 Reto Trinkler Adding 4 as address type of ss58 for Katal Chain (#639)
1 Rocco Musolino remove doc broken link (#697)
1 Salina Add Creditcoin3 support to Generic Ledger App (#1985)
1 Shamilkhan Add genesis hash for Cere Network (#1806)
1 Song Zhou Add in ability to encrypt/decrypt msg with keyring (#1070)
1 Thibaut Sardan add hasLedgerSupport prop to networks (#835)
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util authors & contributors
// Copyright 2017-2026 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import baseConfig from '@polkadot/dev/config/eslint';
+4 -4
View File
@@ -14,10 +14,10 @@
},
"sideEffects": false,
"type": "module",
"version": "13.5.2",
"version": "14.0.3",
"versions": {
"git": "13.5.2",
"npm": "13.5.2"
"git": "14.0.3",
"npm": "14.0.3"
},
"workspaces": [
"packages/*"
@@ -37,7 +37,7 @@
"test:one": "polkadot-dev-run-test --env browser"
},
"devDependencies": {
"@polkadot/dev": "^0.83.2",
"@polkadot/dev": "^0.83.3",
"@types/node": "^22.7.5"
},
"resolutions": {
+2 -2
View File
@@ -14,7 +14,7 @@
},
"sideEffects": false,
"type": "module",
"version": "13.5.2",
"version": "14.0.3",
"browser": "browser.js",
"main": "node.js",
"react-native": "react-native.js",
@@ -22,7 +22,7 @@
"@ledgerhq/hw-transport": "^6.31.4",
"@ledgerhq/hw-transport-webhid": "^6.29.4",
"@ledgerhq/hw-transport-webusb": "^6.29.4",
"@polkadot/util": "13.5.2",
"@polkadot/util": "14.0.3",
"tslib": "^2.8.0"
},
"optionalDependencies": {
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
import LedgerHid from '@ledgerhq/hw-transport-webhid';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { createDefs } from './util.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './empty.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
import LedgerHid from '@ledgerhq/hw-transport-node-hid-singleton';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger-transports authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger-transports authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
@@ -1,6 +1,6 @@
// Copyright 2017-2025 @polkadot/hw-ledger-transports authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger-transports authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/hw-ledger-transports', path: 'auto', type: 'auto', version: '13.5.2' };
export const packageInfo = { name: '@polkadot/hw-ledger-transports', path: 'auto', type: 'auto', version: '14.0.3' };
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './empty.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
// CJS, so we use import * syntax
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Transport, TransportDef, TransportType } from './types.js';
+3 -3
View File
@@ -17,11 +17,11 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.5.2",
"version": "14.0.3",
"main": "index.js",
"dependencies": {
"@polkadot/hw-ledger-transports": "13.5.2",
"@polkadot/util": "13.5.2",
"@polkadot/hw-ledger-transports": "14.0.3",
"@polkadot/util": "14.0.3",
"@zondax/ledger-substrate": "1.1.1",
"tslib": "^2.8.0"
}
+29 -4
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { SubstrateApp } from '@zondax/ledger-substrate';
import type { TransportDef, TransportType } from '@polkadot/hw-ledger-transports/types';
import type { Transport, TransportDef, TransportType } from '@polkadot/hw-ledger-transports/types';
import type { AccountOptions, LedgerAddress, LedgerSignature, LedgerVersion } from './types.js';
import { newSubstrateApp } from '@zondax/ledger-substrate';
@@ -30,6 +30,17 @@ async function wrapError <T extends WrappedResult> (promise: Promise<T>): Promis
return result;
}
/** @internal Best-effort transport cleanup after failed operations */
async function closeTransport (transport: Transport | null): Promise<void> {
if (transport) {
try {
await transport.close();
} catch {
// Ignore cleanup errors so the original failure is preserved.
}
}
}
/** @internal Wraps a sign/signRaw call and returns the associated signature */
function sign (method: 'sign' | 'signRaw', message: Uint8Array, accountOffset = 0, addressOffset = 0, { account = LEDGER_DEFAULT_ACCOUNT, addressIndex = LEDGER_DEFAULT_INDEX, change = LEDGER_DEFAULT_CHANGE }: Partial<AccountOptions> = {}): (app: SubstrateApp) => Promise<LedgerSignature> {
return async (app: SubstrateApp): Promise<LedgerSignature> => {
@@ -114,16 +125,29 @@ export class Ledger {
return this.withApp(sign('signRaw', u8aWrapBytes(message), accountOffset, addressOffset, options));
}
/**
* Closes any active transport connection
*/
public async disconnect (): Promise<void> {
const app = this.#app;
this.#app = null;
await closeTransport(app?.transport || null);
}
/**
* @internal
*
* Returns a created SubstrateApp to perform operations against. Generally
* this is only used internally, to ensure consistent bahavior.
* this is only used internally, to ensure consistent behavior.
*/
async withApp <T> (fn: (app: SubstrateApp) => Promise<T>): Promise<T> {
let transport: Transport | null = null;
try {
if (!this.#app) {
const transport = await this.#transportDef.create();
transport = await this.#transportDef.create();
// We need this override for the actual type passing - the Deno environment
// is quite a bit stricter and it yields invalids between the two (specifically
@@ -136,6 +160,7 @@ export class Ledger {
return await fn(this.#app);
} catch (error) {
await closeTransport(this.#app?.transport || transport);
this.#app = null;
throw error;
+29 -4
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { TransportDef, TransportType } from '@polkadot/hw-ledger-transports/types';
import type { Transport, TransportDef, TransportType } from '@polkadot/hw-ledger-transports/types';
import type { AccountOptionsGeneric, LedgerAddress, LedgerSignature, LedgerVersion } from './types.js';
import { PolkadotGenericApp } from '@zondax/ledger-substrate';
@@ -33,7 +33,7 @@ async function wrapError <T extends WrappedResult> (promise: Promise<T>): Promis
try {
result = await promise;
} catch (e: unknown) {
// We check to see if the propogated error is the newer ResponseError type.
// We check to see if the propagated error is the newer ResponseError type.
// The response code use to be part of the result, but with the latest breaking changes from 0.42.x
// the interface and it's types have completely changed.
if ((e as ResponseError).returnCode) {
@@ -46,6 +46,17 @@ async function wrapError <T extends WrappedResult> (promise: Promise<T>): Promis
return result;
}
/** @internal Best-effort transport cleanup after failed operations */
async function closeTransport (transport: Transport | null): Promise<void> {
if (transport) {
try {
await transport.close();
} catch {
// Ignore cleanup errors so the original failure is preserved.
}
}
}
/** @internal Wraps a signEd25519/signRawEd25519 call and returns the associated signature */
function sign (method: 'signEd25519' | 'signRawEd25519', message: Uint8Array, slip44: number, accountIndex = 0, addressOffset = 0): (app: PolkadotGenericApp) => Promise<LedgerSignature> {
const bip42Path = `m/44'/${slip44}'/${accountIndex}'/${0}'/${addressOffset}'`;
@@ -245,6 +256,17 @@ export class LedgerGeneric {
return this.withApp(signWithMetadataEcdsa(message, this.#slip44, accountIndex, addressOffset, options));
}
/**
* Closes any active transport connection
*/
public async disconnect (): Promise<void> {
const app = this.#app;
this.#app = null;
await closeTransport(app?.transport || null);
}
/**
* @internal
*
@@ -252,9 +274,11 @@ export class LedgerGeneric {
* this is only used internally, to ensure consistent bahavior.
*/
async withApp <T> (fn: (app: PolkadotGenericApp) => Promise<T>): Promise<T> {
let transport: Transport | null = null;
try {
if (!this.#app) {
const transport = await this.#transportDef.create();
transport = await this.#transportDef.create();
// We need this override for the actual type passing - the Deno environment
// is quite a bit stricter and it yields invalids between the two (specifically
@@ -267,6 +291,7 @@ export class LedgerGeneric {
return await fn(this.#app);
} catch (error) {
await closeTransport(this.#app?.transport || transport);
this.#app = null;
throw error;
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
// This is necessary to ensure users still have access to class Ledger even though its deprecated.
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
export const LEDGER_DEFAULT_ACCOUNT = 0x80000000;
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+4 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
// These map to the known name in the @zondax/ledger-substrate/supported_apps package
@@ -51,10 +51,13 @@ export const prevLedgerRecord: Record<string, string> = {
// Any chains moving forward that are supported by the PolkadotGenericApp from ledger will input their names below.
export const genericLedgerApps = {
bittensor: 'Bittensor',
creditcoin3: 'Creditcoin3',
dentnet: 'DENTNet',
encointer: 'Encointer',
frequency: 'Frequency',
integritee: 'Integritee',
liberland: 'Liberland',
mythos: 'Mythos',
polimec: 'Polimec',
vara: 'Vara'
};
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './packageDetect.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
+2 -2
View File
@@ -1,6 +1,6 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/hw-ledger', path: 'auto', type: 'auto', version: '13.5.2' };
export const packageInfo = { name: '@polkadot/hw-ledger', path: 'auto', type: 'auto', version: '14.0.3' };
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// Copyright 2017-2026 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
+5 -5
View File
@@ -18,15 +18,15 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.5.2",
"version": "14.0.3",
"main": "index.js",
"dependencies": {
"@polkadot/util": "13.5.2",
"@polkadot/util-crypto": "13.5.2",
"@polkadot/util": "14.0.3",
"@polkadot/util-crypto": "14.0.3",
"tslib": "^2.8.0"
},
"peerDependencies": {
"@polkadot/util": "13.5.2",
"@polkadot/util-crypto": "13.5.2"
"@polkadot/util": "14.0.3",
"@polkadot/util-crypto": "14.0.3"
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
// all external
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
// default substrate dev phrase
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './packageDetect.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { EncryptedJsonEncoding, Keypair, KeypairType } from '@polkadot/util-crypto/types';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
+2 -2
View File
@@ -1,6 +1,6 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/keyring', path: 'auto', type: 'auto', version: '13.5.2' };
export const packageInfo = { name: '@polkadot/keyring', path: 'auto', type: 'auto', version: '14.0.3' };
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { EncryptedJsonEncoding } from '@polkadot/util-crypto/types';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/** public/secret section divider (generation 1-3, will change in 4, don't rely on value) */
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { PairInfo } from './types.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { EncryptedJsonEncoding, Keypair, KeypairType } from '@polkadot/util-crypto/types';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '../types.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KeypairType } from '@polkadot/util-crypto/types';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
export interface PairInfo {
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KeyringPair, KeyringPairs } from './types.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KeypairType } from '@polkadot/util-crypto/types';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
+3 -3
View File
@@ -15,14 +15,14 @@
},
"sideEffects": false,
"type": "module",
"version": "13.5.2",
"version": "14.0.3",
"main": "index.js",
"dependencies": {
"@polkadot/util": "13.5.2",
"@polkadot/util": "14.0.3",
"@substrate/ss58-registry": "^1.51.0",
"tslib": "^2.8.0"
},
"devDependencies": {
"@polkadot/hw-ledger": "13.5.2"
"@polkadot/hw-ledger": "14.0.3"
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+12 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KnownGenesis } from '../types.js';
@@ -46,9 +46,17 @@ export const knownGenesis: KnownGenesis = {
composable: [
'0xdaab8df776eb52ec604a5df5d388bb62a050a0aaec4556a64265b9d42755552d'
],
creditcoin3: [
'0x4436a7d64e363df85e065a894721002a86643283f9707338bf195d360ba2ee71', // cc3 mainnet
'0xfc4ec97a1c1f119c4353aecb4a17c7c0cf7b40d5d660143d8bad9117e9866572', // cc3 testnet/drynet
'0xfc9df99a665f964aed6649f275055e54df5e3420489538ed31d7788f53d11ef6' // cc3 devnet
],
darwinia: [
'0xe71578b37a7c799b0ab4ee87ffa6f059a6b98f71f06fb8c84a8d88013a548ad6'
],
dentnet: [
'0x0313f6a011d128d22f996703cbab05162e2fdc9e031493314fe6db79979c5ca7'
],
'dock-mainnet': [
'0x6bfe24dca2a3be10f22212678ac13a6446ec764103c0f3471c71609eac384aae',
'0xf73467c6544aa68df2ee546b135f955c46b90fa627e9b5d7935f41061bb8a5a9'
@@ -105,6 +113,9 @@ export const knownGenesis: KnownGenesis = {
matrixchain: [
'0x3af4ff48ec76d2efc8476730f423ac07e25ad48f5f4c9dc39c778b164d808615'
],
mythos: [
'0xf6ee56e9c5277df5b4ce6ae9983ee88f3cbed27d31beeb98f9f84f997a1ab0b9'
],
nodle: [
'0x97da7ede98d7bad4e36b4d734b6055425a3be036da2a332ea5a7037656427a21'
],
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KnownIcon } from '../types.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { knownGenesis } from './genesis.js';
+4 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KnownLedger } from '../types.js';
@@ -17,7 +17,9 @@ export const knownLedger: KnownLedger = {
bittensor: 0x00000162,
centrifuge: 0x000002eb,
composable: 0x00000162,
creditcoin3: 0x00000162,
darwinia: 0x00000162,
dentnet: 0x000002de,
'dock-mainnet': 0x00000252,
edgeware: 0x0000020b,
encointer: 0x000001b2,
@@ -33,6 +35,7 @@ export const knownLedger: KnownLedger = {
kusama: 0x000001b2,
liberland: 0x000002ff,
matrixchain: 0x00000483,
mythos: 0x0000003c,
nodle: 0x000003eb,
origintrail: 0x00000162,
parallel: 0x00000162,
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KnownTestnet } from '../types.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
// TODO: This was removed, really cannot recall the reason...
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KnownSubstrate, Network, SubstrateNetwork } from './types.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
+2 -2
View File
@@ -1,6 +1,6 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/networks', path: 'auto', type: 'auto', version: '13.5.2' };
export const packageInfo = { name: '@polkadot/networks', path: 'auto', type: 'auto', version: '14.0.3' };
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/networks authors & contributors
// Copyright 2017-2026 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/keyring authors & contributors
// Copyright 2017-2026 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { RegistryEntry } from '@substrate/ss58-registry';
+9 -8
View File
@@ -20,7 +20,7 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.5.2",
"version": "14.0.3",
"browser": {
"crypto": false,
"stream": false
@@ -29,16 +29,17 @@
"dependencies": {
"@noble/curves": "^1.3.0",
"@noble/hashes": "^1.3.3",
"@polkadot/networks": "13.5.2",
"@polkadot/util": "13.5.2",
"@polkadot/wasm-crypto": "^7.4.1",
"@polkadot/wasm-util": "^7.4.1",
"@polkadot/x-bigint": "13.5.2",
"@polkadot/x-randomvalues": "13.5.2",
"@polkadot/networks": "14.0.3",
"@polkadot/util": "14.0.3",
"@polkadot/wasm-crypto": "^7.5.3",
"@polkadot/wasm-util": "^7.5.3",
"@polkadot/x-bigint": "14.0.3",
"@polkadot/x-randomvalues": "14.0.3",
"@scure/base": "^1.1.7",
"@scure/sr25519": "^0.2.0",
"tslib": "^2.8.0"
},
"peerDependencies": {
"@polkadot/util": "13.5.2"
"@polkadot/util": "14.0.3"
}
}
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { decodeAddress } from './decode.js';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Prefix } from './types.js';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { sshash } from './sshash.js';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Prefix } from './types.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { availableNetworks } from '../networks.js';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DeriveJunction } from '../key/DeriveJunction.js';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+5 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Prefix } from './types.js';
@@ -15,7 +15,7 @@ export function encodeAddress (key: string | Uint8Array, ss58Format: Prefix = de
// decode it, this means we can re-encode an address
const u8a = decodeAddress(key);
if ((ss58Format < 0) || (ss58Format > 16383) || [46, 47].includes(ss58Format)) {
if ((ss58Format < 0) || (ss58Format > 16383 && !ss58Exceptions.includes(ss58Format)) || [46, 47].includes(ss58Format)) {
throw new Error('Out of range ss58Format specified');
} else if (!defaults.allowedDecodedLengths.includes(u8a.length)) {
throw new Error(`Expected a valid key to convert, with length ${defaults.allowedDecodedLengths.join(', ')}`);
@@ -38,3 +38,6 @@ export function encodeAddress (key: string | Uint8Array, ss58Format: Prefix = de
)
);
}
// Exceptions like 29972 (Mythos chain) which uses Ethereum style account (not ss58 Encoded)
const ss58Exceptions = [29972];
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BN } from '@polkadot/util';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BN } from '@polkadot/util';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { u8aEq } from '@polkadot/util';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { HashType } from '../secp256k1/types.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { addressToEvm } from './addressToEvm.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Prefix } from './types.js';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BN } from '@polkadot/util';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BN } from '@polkadot/util';
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
@@ -1,4 +1,4 @@
// Copyright 2017-2025 @polkadot/util-crypto authors & contributors
// Copyright 2017-2026 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Prefix } from './types.js';

Some files were not shown because too many files have changed in this diff Show More