hd-wallet-ui 2.0.21 → 2.0.27
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/LICENSE +190 -0
- package/README.md +101 -123
- package/data/common-passwords-sdn-v1.source.json +12 -0
- package/data/common-passwords-sdn-v1.txt +10000 -0
- package/dist/browser/sdn-wallet-callback.js +1 -0
- package/dist/browser/sdn-wallet-public-client.js +1 -0
- package/dist/browser/wallet-callback.html +6 -0
- package/dist/client/asset-review.d.ts +8 -0
- package/dist/client/asset-review.js +1570 -0
- package/dist/client/callback.d.ts +13 -0
- package/dist/client/callback.js +29 -0
- package/dist/client/index.d.ts +11 -0
- package/dist/client/index.js +1379 -0
- package/dist/client/sdn.d.ts +8 -0
- package/dist/client/sdn.js +1542 -0
- package/dist/client/style.css +32 -0
- package/dist/client/types.d.ts +278 -0
- package/dist/compat/index.d.ts +26 -0
- package/dist/compat/index.js +62 -0
- package/dist/wallet-origin/index.d.ts +21 -0
- package/dist/wallet-origin/index.js +4607 -0
- package/dist/wallet-origin-host/assets/wallet-origin.43cf84e0eba17742309357ec6bc2c544736e155ffd5d76d5024408e998500a57.wasm +0 -0
- package/dist/wallet-origin-host/assets/wallet-origin.4c9455f1a2618948e203f720485add9d8ebf77b5542b41f933594afcfbb34361.css +1 -0
- package/dist/wallet-origin-host/assets/wallet-origin.aedc355452e665e16c0f72a6597602873378dbc39d4cbf6104621c07579347e0.js +12463 -0
- package/dist/wallet-origin-host/index.html +10 -0
- package/dist/wallet-origin-host/integrity.json +1 -0
- package/package.json +46 -18
- package/src/address-derivation.js +0 -514
- package/src/app.js +0 -6008
- package/src/blockchain-trust.js +0 -752
- package/src/clipboard.js +0 -44
- package/src/constants.js +0 -66
- package/src/hash.js +0 -9
- package/src/lib.js +0 -66
- package/src/template.js +0 -626
- package/src/trust-ui.js +0 -745
- package/src/wallet-storage.js +0 -773
- package/styles/main.css +0 -6220
- package/styles/widget.css +0 -6212
package/src/clipboard.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export async function safeCopyText(value) {
|
|
2
|
-
const text = String(value ?? '');
|
|
3
|
-
if (!text) return false;
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
const writeText = globalThis.navigator?.clipboard?.writeText;
|
|
7
|
-
if (typeof writeText === 'function') {
|
|
8
|
-
await writeText.call(globalThis.navigator.clipboard, text);
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
} catch {
|
|
12
|
-
// Fall through to the legacy DOM copy path below.
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return fallbackCopyText(text);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function fallbackCopyText(text) {
|
|
19
|
-
const doc = globalThis.document;
|
|
20
|
-
if (!doc?.body || typeof doc.createElement !== 'function' || typeof doc.execCommand !== 'function') {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const textarea = doc.createElement('textarea');
|
|
25
|
-
textarea.value = text;
|
|
26
|
-
textarea.readOnly = true;
|
|
27
|
-
textarea.setAttribute('aria-hidden', 'true');
|
|
28
|
-
textarea.style.position = 'fixed';
|
|
29
|
-
textarea.style.left = '-9999px';
|
|
30
|
-
textarea.style.top = '0';
|
|
31
|
-
textarea.style.opacity = '0';
|
|
32
|
-
|
|
33
|
-
doc.body.appendChild(textarea);
|
|
34
|
-
try {
|
|
35
|
-
textarea.focus();
|
|
36
|
-
textarea.select();
|
|
37
|
-
textarea.setSelectionRange(0, textarea.value.length);
|
|
38
|
-
return Boolean(doc.execCommand('copy'));
|
|
39
|
-
} catch {
|
|
40
|
-
return false;
|
|
41
|
-
} finally {
|
|
42
|
-
textarea.remove();
|
|
43
|
-
}
|
|
44
|
-
}
|
package/src/constants.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wallet Constants
|
|
3
|
-
*
|
|
4
|
-
* Coin type configurations, explorer URLs, and derivation path helpers.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// =============================================================================
|
|
8
|
-
// Crypto Configuration
|
|
9
|
-
// =============================================================================
|
|
10
|
-
|
|
11
|
-
export const cryptoConfig = {
|
|
12
|
-
btc: {
|
|
13
|
-
name: 'Bitcoin',
|
|
14
|
-
symbol: 'BTC',
|
|
15
|
-
coinType: 0,
|
|
16
|
-
explorer: 'https://blockstream.info/address/',
|
|
17
|
-
balanceApi: 'https://blockstream.info/api/address/',
|
|
18
|
-
formatBalance: (satoshis) => `${(satoshis / 100000000).toFixed(8)} BTC`,
|
|
19
|
-
},
|
|
20
|
-
eth: {
|
|
21
|
-
name: 'Ethereum',
|
|
22
|
-
symbol: 'ETH',
|
|
23
|
-
coinType: 60,
|
|
24
|
-
explorer: 'https://etherscan.io/address/',
|
|
25
|
-
balanceApi: null,
|
|
26
|
-
formatBalance: (wei) => `${(parseFloat(wei) / 1e18).toFixed(6)} ETH`,
|
|
27
|
-
},
|
|
28
|
-
sol: {
|
|
29
|
-
name: 'Solana',
|
|
30
|
-
symbol: 'SOL',
|
|
31
|
-
coinType: 501,
|
|
32
|
-
explorer: 'https://solscan.io/account/',
|
|
33
|
-
balanceApi: null,
|
|
34
|
-
formatBalance: (lamports) => `${(lamports / 1e9).toFixed(4)} SOL`,
|
|
35
|
-
},
|
|
36
|
-
/* Commented out — BTC/ETH/SOL only for now
|
|
37
|
-
ltc: { name: 'Litecoin', symbol: 'LTC', coinType: 2, explorer: 'https://blockchair.com/litecoin/address/', balanceApi: null, formatBalance: (lits) => `${(lits / 100000000).toFixed(8)} LTC` },
|
|
38
|
-
bch: { name: 'Bitcoin Cash', symbol: 'BCH', coinType: 145, explorer: 'https://blockchair.com/bitcoin-cash/address/', balanceApi: null, formatBalance: (sats) => `${(sats / 100000000).toFixed(8)} BCH` },
|
|
39
|
-
doge: { name: 'Dogecoin', symbol: 'DOGE', coinType: 3, explorer: 'https://dogechain.info/address/', balanceApi: null, formatBalance: (sats) => `${(sats / 100000000).toFixed(4)} DOGE` },
|
|
40
|
-
atom: { name: 'Cosmos', symbol: 'ATOM', coinType: 118, explorer: 'https://www.mintscan.io/cosmos/address/', balanceApi: null, formatBalance: (uatom) => `${(uatom / 1e6).toFixed(6)} ATOM` },
|
|
41
|
-
algo: { name: 'Algorand', symbol: 'ALGO', coinType: 330, explorer: 'https://algoexplorer.io/address/', balanceApi: null, formatBalance: (microalgos) => `${(microalgos / 1e6).toFixed(6)} ALGO` },
|
|
42
|
-
dot: { name: 'Polkadot', symbol: 'DOT', coinType: 354, explorer: 'https://polkascan.io/polkadot/account/', balanceApi: null, formatBalance: (planks) => `${(planks / 1e10).toFixed(4)} DOT` },
|
|
43
|
-
ada: { name: 'Cardano', symbol: 'ADA', coinType: 1815, explorer: 'https://cardanoscan.io/address/', balanceApi: null, formatBalance: (lovelace) => `${(lovelace / 1e6).toFixed(6)} ADA` },
|
|
44
|
-
xrp: { name: 'Ripple', symbol: 'XRP', coinType: 144, explorer: 'https://xrpscan.com/account/', balanceApi: null, formatBalance: (drops) => `${(drops / 1e6).toFixed(6)} XRP` },
|
|
45
|
-
*/
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Coin type to config mapping
|
|
49
|
-
export const coinTypeToConfig = Object.fromEntries(
|
|
50
|
-
Object.entries(cryptoConfig).map(([key, config]) => [config.coinType, { key, ...config }])
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
// =============================================================================
|
|
54
|
-
// Derivation Path Helpers (re-exported from hd-wallet-wasm)
|
|
55
|
-
// =============================================================================
|
|
56
|
-
|
|
57
|
-
export { buildSigningPath, buildEncryptionPath, getSigningKey, getEncryptionKey, WellKnownCoinType } from 'hd-wallet-wasm';
|
|
58
|
-
|
|
59
|
-
// =============================================================================
|
|
60
|
-
// PKI Storage Key
|
|
61
|
-
// =============================================================================
|
|
62
|
-
|
|
63
|
-
export const PKI_STORAGE_KEY = 'wallet-pki-keys';
|
|
64
|
-
export const STORED_WALLET_KEY = 'encrypted_wallet';
|
|
65
|
-
export const PASSKEY_CREDENTIAL_KEY = 'passkey_credential';
|
|
66
|
-
export const PASSKEY_WALLET_KEY = 'passkey_wallet';
|
package/src/hash.js
DELETED
package/src/lib.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HD Wallet UI — Pure Library
|
|
3
|
-
*
|
|
4
|
-
* Re-exports all pure (non-DOM) modules for programmatic use.
|
|
5
|
-
* No UI or DOM dependencies.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Constants & configuration
|
|
9
|
-
export {
|
|
10
|
-
cryptoConfig,
|
|
11
|
-
coinTypeToConfig,
|
|
12
|
-
buildSigningPath,
|
|
13
|
-
buildEncryptionPath,
|
|
14
|
-
getSigningKey,
|
|
15
|
-
getEncryptionKey,
|
|
16
|
-
WellKnownCoinType,
|
|
17
|
-
PKI_STORAGE_KEY,
|
|
18
|
-
STORED_WALLET_KEY,
|
|
19
|
-
PASSKEY_CREDENTIAL_KEY,
|
|
20
|
-
PASSKEY_WALLET_KEY,
|
|
21
|
-
} from './constants.js';
|
|
22
|
-
|
|
23
|
-
// Address derivation & utilities
|
|
24
|
-
export {
|
|
25
|
-
toHexCompact,
|
|
26
|
-
toHex,
|
|
27
|
-
hexToBytes,
|
|
28
|
-
ensureUint8Array,
|
|
29
|
-
generateBtcAddress,
|
|
30
|
-
generateEthAddress,
|
|
31
|
-
generateSolAddress,
|
|
32
|
-
generateXrpAddress,
|
|
33
|
-
deriveEthAddress,
|
|
34
|
-
deriveSuiAddress,
|
|
35
|
-
deriveMonadAddress,
|
|
36
|
-
deriveCardanoAddress,
|
|
37
|
-
generateAddresses,
|
|
38
|
-
generateAddressForCoin,
|
|
39
|
-
truncateAddress,
|
|
40
|
-
fetchBtcBalance,
|
|
41
|
-
fetchEthBalance,
|
|
42
|
-
fetchSolBalance,
|
|
43
|
-
fetchSuiBalance,
|
|
44
|
-
fetchMonadBalance,
|
|
45
|
-
fetchAdaBalance,
|
|
46
|
-
fetchXrpBalance,
|
|
47
|
-
} from './address-derivation.js';
|
|
48
|
-
|
|
49
|
-
// Wallet storage & encryption
|
|
50
|
-
export {
|
|
51
|
-
default as WalletStorage,
|
|
52
|
-
StorageMethod,
|
|
53
|
-
isPasskeySupported,
|
|
54
|
-
isPRFLikelySupported,
|
|
55
|
-
registerPasskey,
|
|
56
|
-
authenticatePasskey,
|
|
57
|
-
getStorageMetadata,
|
|
58
|
-
hasStoredWallet,
|
|
59
|
-
getStorageMethod,
|
|
60
|
-
storeWithPIN,
|
|
61
|
-
retrieveWithPIN,
|
|
62
|
-
storeWithPasskey,
|
|
63
|
-
retrieveWithPasskey,
|
|
64
|
-
clearStorage,
|
|
65
|
-
migrateStorage,
|
|
66
|
-
} from './wallet-storage.js';
|