@sidhujag/sysweb3-keyring 2.1.3 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +47 -47
- package/cjs/hardware-transaction-authority.js +36 -0
- package/cjs/hardware-transaction-authority.js.map +1 -0
- package/cjs/index.js +5 -5
- package/cjs/index.js.map +1 -1
- package/cjs/keyring-core.js +171 -220
- package/cjs/keyring-core.js.map +1 -1
- package/cjs/keyring-host.js +113 -0
- package/cjs/keyring-host.js.map +1 -0
- package/cjs/keyring-manager.js +15 -151
- package/cjs/keyring-manager.js.map +1 -1
- package/cjs/ledger/host-types.js.map +1 -1
- package/cjs/ledger/index.js +44 -19
- package/cjs/ledger/index.js.map +1 -1
- package/cjs/providers.js +3 -1
- package/cjs/providers.js.map +1 -1
- package/cjs/software.js +10 -56
- package/cjs/software.js.map +1 -1
- package/cjs/transactions/ethereum.js +306 -229
- package/cjs/transactions/ethereum.js.map +1 -1
- package/cjs/transactions/evm-local-signer.js +15 -0
- package/cjs/transactions/evm-local-signer.js.map +1 -1
- package/cjs/transactions/evm-submission.js +61 -65
- package/cjs/transactions/evm-submission.js.map +1 -1
- package/cjs/transactions/hardware-psbt.js +11 -8
- package/cjs/transactions/hardware-psbt.js.map +1 -1
- package/cjs/transactions/index.js +10 -2
- package/cjs/transactions/index.js.map +1 -1
- package/cjs/transactions/prepared-evm.js +10 -7
- package/cjs/transactions/prepared-evm.js.map +1 -1
- package/cjs/transactions/syscoin-core.js +308 -205
- package/cjs/transactions/syscoin-core.js.map +1 -1
- package/cjs/trezor/connect.js +19 -2
- package/cjs/trezor/connect.js.map +1 -1
- package/cjs/trezor/index.js +38 -16
- package/cjs/trezor/index.js.map +1 -1
- package/cjs/types.js.map +1 -1
- package/cjs/utils/excluded-utxos.js +6 -2
- package/cjs/utils/excluded-utxos.js.map +1 -1
- package/cjs/utils/owned-blockbook-account.js +45 -0
- package/cjs/utils/owned-blockbook-account.js.map +1 -0
- package/esm/current-vault-refusal.js +3 -0
- package/esm/current-vault-refusal.js.map +1 -0
- package/esm/evm-fees.js +242 -0
- package/esm/evm-fees.js.map +1 -0
- package/esm/hardware-transaction-authority.js +33 -0
- package/esm/hardware-transaction-authority.js.map +1 -0
- package/esm/initial-state.js +102 -0
- package/esm/initial-state.js.map +1 -0
- package/esm/keyring-core.js +2781 -0
- package/esm/keyring-core.js.map +1 -0
- package/esm/keyring-host.js +108 -0
- package/esm/keyring-host.js.map +1 -0
- package/esm/ledger/dmk-session.js +1 -0
- package/esm/ledger/dmk-session.js.map +1 -1
- package/esm/ledger/dmk-utxo.js +9 -3
- package/esm/ledger/dmk-utxo.js.map +1 -1
- package/esm/ledger/host-types.js.map +1 -1
- package/esm/ledger/index.js +44 -19
- package/esm/ledger/index.js.map +1 -1
- package/esm/network-utils.js +70 -0
- package/esm/network-utils.js.map +1 -0
- package/esm/providers.js +3 -1
- package/esm/providers.js.map +1 -1
- package/esm/software-hd-account.js +20 -0
- package/esm/software-hd-account.js.map +1 -0
- package/esm/storage-core.js +258 -0
- package/esm/storage-core.js.map +1 -0
- package/esm/transactions/ethereum.js +2753 -0
- package/esm/transactions/ethereum.js.map +1 -0
- package/esm/transactions/evm-cancellation.js +40 -0
- package/esm/transactions/evm-cancellation.js.map +1 -0
- package/esm/transactions/evm-local-signer.js +202 -0
- package/esm/transactions/evm-local-signer.js.map +1 -0
- package/esm/transactions/evm-submission.js +187 -0
- package/esm/transactions/evm-submission.js.map +1 -0
- package/esm/transactions/prepared-evm.js +194 -0
- package/esm/transactions/prepared-evm.js.map +1 -0
- package/esm/transactions/syscoin-core.js +714 -0
- package/esm/transactions/syscoin-core.js.map +1 -0
- package/esm/trezor/connect.js +19 -2
- package/esm/trezor/connect.js.map +1 -1
- package/esm/trezor/index.js +38 -16
- package/esm/trezor/index.js.map +1 -1
- package/esm/types.js.map +1 -1
- package/esm/utils/excluded-utxos.js +57 -0
- package/esm/utils/excluded-utxos.js.map +1 -0
- package/esm/utils/owned-blockbook-account.js +9 -0
- package/esm/utils/owned-blockbook-account.js.map +1 -0
- package/esm/utils/psbt.js +32 -0
- package/esm/utils/psbt.js.map +1 -0
- package/esm/utils/watch-descriptor.js +138 -0
- package/esm/utils/watch-descriptor.js.map +1 -0
- package/package.json +5 -11
- package/types/hardware-transaction-authority.d.ts +5 -0
- package/types/index.d.ts +3 -3
- package/types/keyring-core.d.ts +22 -51
- package/types/keyring-host.d.ts +46 -0
- package/types/keyring-manager.d.ts +13 -18
- package/types/ledger/host-types.d.ts +4 -1
- package/types/ledger/index.d.ts +1 -1
- package/types/ledger/types.d.ts +3 -2
- package/types/providers.d.ts +1 -1
- package/types/software.d.ts +6 -19
- package/types/transactions/ethereum.d.ts +14 -11
- package/types/transactions/evm-local-signer.d.ts +2 -2
- package/types/transactions/evm-submission.d.ts +11 -4
- package/types/transactions/hardware-psbt.d.ts +1 -1
- package/types/transactions/index.d.ts +3 -2
- package/types/transactions/prepared-evm.d.ts +4 -1
- package/types/transactions/syscoin-core.d.ts +48 -21
- package/types/trezor/connect.d.ts +6 -3
- package/types/trezor/index.d.ts +4 -3
- package/types/types.d.ts +95 -63
- package/types/utils/excluded-utxos.d.ts +1 -1
- package/types/utils/owned-blockbook-account.d.ts +3 -0
- package/cjs/hardware-wallet-manager-singleton.js +0 -34
- package/cjs/hardware-wallet-manager-singleton.js.map +0 -1
- package/cjs/storage.js +0 -20
- package/cjs/storage.js.map +0 -1
- package/cjs/transactions/syscoin.js +0 -16
- package/cjs/transactions/syscoin.js.map +0 -1
- package/cjs/utils/blockbook-cache.js +0 -76
- package/cjs/utils/blockbook-cache.js.map +0 -1
- package/types/hardware-wallet-manager-singleton.d.ts +0 -19
- package/types/storage.d.ts +0 -5
- package/types/transactions/syscoin.d.ts +0 -9
- package/types/utils/blockbook-cache.d.ts +0 -6
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.invalidateBlockbookAccountCache = exports.fetchBackendAccountCached = void 0;
|
|
37
|
-
const syscoinjs = __importStar(require("syscoinjs-lib"));
|
|
38
|
-
const inflightFetches = new Map();
|
|
39
|
-
const buildKey = (backendUrl, xpub, options) => `${backendUrl}::${xpub}::${options}`;
|
|
40
|
-
const fetchBackendAccountCached = (backendUrl, xpub, options) => {
|
|
41
|
-
const key = buildKey(backendUrl, xpub, options);
|
|
42
|
-
const inflight = inflightFetches.get(key);
|
|
43
|
-
if (inflight) {
|
|
44
|
-
return inflight.promise;
|
|
45
|
-
}
|
|
46
|
-
const promise = Promise.resolve(syscoinjs.utils.fetchBackendAccount(backendUrl, xpub, options, true));
|
|
47
|
-
inflightFetches.set(key, { promise });
|
|
48
|
-
// Drop the entry as soon as the request settles so subsequent
|
|
49
|
-
// callers always fetch fresh data
|
|
50
|
-
const dropEntry = () => {
|
|
51
|
-
const entry = inflightFetches.get(key);
|
|
52
|
-
if (entry && entry.promise === promise) {
|
|
53
|
-
inflightFetches.delete(key);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
promise.then(dropEntry, dropEntry);
|
|
57
|
-
return promise;
|
|
58
|
-
};
|
|
59
|
-
exports.fetchBackendAccountCached = fetchBackendAccountCached;
|
|
60
|
-
/**
|
|
61
|
-
* Drop in-flight account fetches. Without arguments clears everything;
|
|
62
|
-
* with an xpub only that account's entries are dropped (any backend).
|
|
63
|
-
*/
|
|
64
|
-
const invalidateBlockbookAccountCache = (xpub) => {
|
|
65
|
-
if (!xpub) {
|
|
66
|
-
inflightFetches.clear();
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
for (const key of Array.from(inflightFetches.keys())) {
|
|
70
|
-
if (key.includes(`::${xpub}::`)) {
|
|
71
|
-
inflightFetches.delete(key);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
exports.invalidateBlockbookAccountCache = invalidateBlockbookAccountCache;
|
|
76
|
-
//# sourceMappingURL=blockbook-cache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blockbook-cache.js","sourceRoot":"","sources":["../../../src/utils/blockbook-cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;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C,IAAI,EAAE,CAAC;QACV,eAAe,CAAC,KAAK,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QACrD,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC;YAChC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,+BAA+B,mCAU1C"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HardwareWalletManager } from './hardware-wallet-manager';
|
|
2
|
-
/**
|
|
3
|
-
* Singleton wrapper for HardwareWalletManager to ensure a single instance
|
|
4
|
-
* is shared across all KeyringManager instances. This prevents "device already open"
|
|
5
|
-
* errors when multiple networks try to connect to the same Ledger device.
|
|
6
|
-
*/
|
|
7
|
-
declare class HardwareWalletManagerSingleton {
|
|
8
|
-
private static instance;
|
|
9
|
-
/**
|
|
10
|
-
* Get the shared HardwareWalletManager instance
|
|
11
|
-
* Creates one if it doesn't exist
|
|
12
|
-
*/
|
|
13
|
-
static getInstance(): HardwareWalletManager;
|
|
14
|
-
/**
|
|
15
|
-
* Reset the singleton instance (useful for testing)
|
|
16
|
-
*/
|
|
17
|
-
static resetInstance(): void;
|
|
18
|
-
}
|
|
19
|
-
export { HardwareWalletManagerSingleton };
|
package/types/storage.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const setEncryptedVault: (decryptedVault: any, pwd: string, freshVaultKeys?: {
|
|
2
|
-
salt: string;
|
|
3
|
-
}, assertCurrent?: () => void) => Promise<void>;
|
|
4
|
-
export declare const getDecryptedVault: (pwd: string, legacyPassword?: string) => Promise<any>;
|
|
5
|
-
export { VaultAuthenticationError } from './storage-core';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SyscoinTransactionsCore } from './syscoin-core';
|
|
2
|
-
import type { LedgerKeyring } from '../ledger';
|
|
3
|
-
import type { TrezorKeyring } from '../trezor';
|
|
4
|
-
type CoreArguments = ConstructorParameters<typeof SyscoinTransactionsCore>;
|
|
5
|
-
/** Legacy constructor: preserve device arguments while composing shared logic. */
|
|
6
|
-
export declare class SyscoinTransactions extends SyscoinTransactionsCore {
|
|
7
|
-
constructor(getSyscoinSigner: CoreArguments[0], getReadOnlySigner: CoreArguments[1], getState: CoreArguments[2], getAddress: CoreArguments[3], ledgerSigner: LedgerKeyring, trezorSigner: TrezorKeyring, captureSigningContext?: CoreArguments[5]);
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const fetchBackendAccountCached: (backendUrl: string, xpub: string, options: string) => Promise<any>;
|
|
2
|
-
/**
|
|
3
|
-
* Drop in-flight account fetches. Without arguments clears everything;
|
|
4
|
-
* with an xpub only that account's entries are dropped (any backend).
|
|
5
|
-
*/
|
|
6
|
-
export declare const invalidateBlockbookAccountCache: (xpub?: string) => void;
|