quantumcoin 6.14.2 → 6.14.4
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/README.md +12 -22
- package/dist/README.md +1 -1
- package/lib.commonjs/_version.js +1 -1
- package/lib.commonjs/crypto/signing-key.d.ts +1 -1
- package/lib.commonjs/crypto/signing-key.d.ts.map +1 -1
- package/lib.commonjs/crypto/signing-key.js +14 -8
- package/lib.commonjs/crypto/signing-key.js.map +1 -1
- package/lib.commonjs/quantumcoin.d.ts +2 -0
- package/lib.commonjs/quantumcoin.d.ts.map +1 -1
- package/lib.commonjs/quantumcoin.js +11 -5
- package/lib.commonjs/quantumcoin.js.map +1 -1
- package/lib.commonjs/transaction/address.d.ts.map +1 -1
- package/lib.commonjs/transaction/address.js +8 -3
- package/lib.commonjs/transaction/address.js.map +1 -1
- package/lib.commonjs/wallet/json-keystore.d.ts.map +1 -1
- package/lib.commonjs/wallet/json-keystore.js +7 -7
- package/lib.commonjs/wallet/json-keystore.js.map +1 -1
- package/lib.commonjs/wallet/wallet.d.ts.map +1 -1
- package/lib.commonjs/wallet/wallet.js +2 -2
- package/lib.commonjs/wallet/wallet.js.map +1 -1
- package/lib.esm/_version.js +1 -1
- package/lib.esm/crypto/signing-key.d.ts +1 -1
- package/lib.esm/crypto/signing-key.d.ts.map +1 -1
- package/lib.esm/crypto/signing-key.js +15 -8
- package/lib.esm/crypto/signing-key.js.map +1 -1
- package/lib.esm/quantumcoin.d.ts +2 -0
- package/lib.esm/quantumcoin.d.ts.map +1 -1
- package/lib.esm/quantumcoin.js +6 -0
- package/lib.esm/quantumcoin.js.map +1 -1
- package/lib.esm/transaction/address.d.ts.map +1 -1
- package/lib.esm/transaction/address.js +8 -2
- package/lib.esm/transaction/address.js.map +1 -1
- package/lib.esm/wallet/json-keystore.d.ts.map +1 -1
- package/lib.esm/wallet/json-keystore.js +11 -5
- package/lib.esm/wallet/json-keystore.js.map +1 -1
- package/lib.esm/wallet/wallet.d.ts.map +1 -1
- package/lib.esm/wallet/wallet.js +3 -1
- package/lib.esm/wallet/wallet.js.map +1 -1
- package/package.json +6 -5
- package/src.ts/_version.ts +1 -1
- package/src.ts/crypto/signing-key.ts +14 -9
- package/src.ts/quantumcoin.ts +10 -2
- package/src.ts/transaction/address.ts +7 -3
- package/src.ts/wallet/json-keystore.ts +8 -6
- package/src.ts/wallet/wallet.ts +2 -3
- package/dist/quantumcoin.js +0 -21137
- package/dist/quantumcoin.js.map +0 -1
- package/dist/quantumcoin.min.js +0 -1
- package/dist/quantumcoin.min.js'.gz' +0 -0
- package/dist/quantumcoin.umd.js +0 -21316
- package/dist/quantumcoin.umd.js.map +0 -1
- package/dist/quantumcoin.umd.min.js +0 -1
- package/dist/quantumcoin.umd.min.js'.gz' +0 -0
- package/dist/wordlists-extra.js +0 -1500
- package/dist/wordlists-extra.js.map +0 -1
- package/dist/wordlists-extra.min.js +0 -1
- package/dist/wordlists-extra.min.js'.gz' +0 -0
- package/lib.commonjs/providers/provider-alchemy.d.ts +0 -50
- package/lib.commonjs/providers/provider-alchemy.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-alchemy.js +0 -151
- package/lib.commonjs/providers/provider-alchemy.js.map +0 -1
- package/lib.commonjs/providers/provider-ankr.d.ts +0 -61
- package/lib.commonjs/providers/provider-ankr.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-ankr.js +0 -137
- package/lib.commonjs/providers/provider-ankr.js.map +0 -1
- package/lib.commonjs/providers/provider-blockscout.d.ts +0 -59
- package/lib.commonjs/providers/provider-blockscout.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-blockscout.js +0 -145
- package/lib.commonjs/providers/provider-blockscout.js.map +0 -1
- package/lib.commonjs/providers/provider-chainstack.d.ts +0 -46
- package/lib.commonjs/providers/provider-chainstack.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-chainstack.js +0 -102
- package/lib.commonjs/providers/provider-chainstack.js.map +0 -1
- package/lib.commonjs/providers/provider-cloudflare.d.ts +0 -14
- package/lib.commonjs/providers/provider-cloudflare.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-cloudflare.js +0 -26
- package/lib.commonjs/providers/provider-cloudflare.js.map +0 -1
- package/lib.commonjs/providers/provider-etherscan.d.ts +0 -147
- package/lib.commonjs/providers/provider-etherscan.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-etherscan.js +0 -587
- package/lib.commonjs/providers/provider-etherscan.js.map +0 -1
- package/lib.commonjs/providers/provider-infura.d.ts +0 -101
- package/lib.commonjs/providers/provider-infura.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-infura.js +0 -206
- package/lib.commonjs/providers/provider-infura.js.map +0 -1
- package/lib.commonjs/providers/provider-pocket.d.ts +0 -54
- package/lib.commonjs/providers/provider-pocket.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-pocket.js +0 -109
- package/lib.commonjs/providers/provider-pocket.js.map +0 -1
- package/lib.commonjs/providers/provider-quicknode.d.ts +0 -59
- package/lib.commonjs/providers/provider-quicknode.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-quicknode.js +0 -163
- package/lib.commonjs/providers/provider-quicknode.js.map +0 -1
- package/lib.commonjs/wallet/hdwallet.d.ts +0 -248
- package/lib.commonjs/wallet/hdwallet.d.ts.map +0 -1
- package/lib.commonjs/wallet/hdwallet.js +0 -505
- package/lib.commonjs/wallet/hdwallet.js.map +0 -1
- package/lib.commonjs/wallet/json-crowdsale.d.ts +0 -27
- package/lib.commonjs/wallet/json-crowdsale.d.ts.map +0 -1
- package/lib.commonjs/wallet/json-crowdsale.js +0 -60
- package/lib.commonjs/wallet/json-crowdsale.js.map +0 -1
- package/lib.commonjs/wallet/mnemonic.d.ts +0 -65
- package/lib.commonjs/wallet/mnemonic.d.ts.map +0 -1
- package/lib.commonjs/wallet/mnemonic.js +0 -169
- package/lib.commonjs/wallet/mnemonic.js.map +0 -1
- package/lib.commonjs/wallet/seedwallet.d.ts +0 -4
- package/lib.commonjs/wallet/seedwallet.d.ts.map +0 -1
- package/lib.commonjs/wallet/seedwallet.js +0 -8
- package/lib.commonjs/wallet/seedwallet.js.map +0 -1
- package/lib.esm/providers/provider-alchemy.d.ts +0 -50
- package/lib.esm/providers/provider-alchemy.d.ts.map +0 -1
- package/lib.esm/providers/provider-alchemy.js +0 -147
- package/lib.esm/providers/provider-alchemy.js.map +0 -1
- package/lib.esm/providers/provider-ankr.d.ts +0 -61
- package/lib.esm/providers/provider-ankr.d.ts.map +0 -1
- package/lib.esm/providers/provider-ankr.js +0 -133
- package/lib.esm/providers/provider-ankr.js.map +0 -1
- package/lib.esm/providers/provider-blockscout.d.ts +0 -59
- package/lib.esm/providers/provider-blockscout.d.ts.map +0 -1
- package/lib.esm/providers/provider-blockscout.js +0 -141
- package/lib.esm/providers/provider-blockscout.js.map +0 -1
- package/lib.esm/providers/provider-chainstack.d.ts +0 -46
- package/lib.esm/providers/provider-chainstack.d.ts.map +0 -1
- package/lib.esm/providers/provider-chainstack.js +0 -98
- package/lib.esm/providers/provider-chainstack.js.map +0 -1
- package/lib.esm/providers/provider-cloudflare.d.ts +0 -14
- package/lib.esm/providers/provider-cloudflare.d.ts.map +0 -1
- package/lib.esm/providers/provider-cloudflare.js +0 -22
- package/lib.esm/providers/provider-cloudflare.js.map +0 -1
- package/lib.esm/providers/provider-etherscan.d.ts +0 -147
- package/lib.esm/providers/provider-etherscan.d.ts.map +0 -1
- package/lib.esm/providers/provider-etherscan.js +0 -584
- package/lib.esm/providers/provider-etherscan.js.map +0 -1
- package/lib.esm/providers/provider-infura.d.ts +0 -101
- package/lib.esm/providers/provider-infura.d.ts.map +0 -1
- package/lib.esm/providers/provider-infura.js +0 -201
- package/lib.esm/providers/provider-infura.js.map +0 -1
- package/lib.esm/providers/provider-pocket.d.ts +0 -54
- package/lib.esm/providers/provider-pocket.d.ts.map +0 -1
- package/lib.esm/providers/provider-pocket.js +0 -105
- package/lib.esm/providers/provider-pocket.js.map +0 -1
- package/lib.esm/providers/provider-quicknode.d.ts +0 -59
- package/lib.esm/providers/provider-quicknode.d.ts.map +0 -1
- package/lib.esm/providers/provider-quicknode.js +0 -159
- package/lib.esm/providers/provider-quicknode.js.map +0 -1
- package/lib.esm/wallet/hdwallet.d.ts +0 -248
- package/lib.esm/wallet/hdwallet.d.ts.map +0 -1
- package/lib.esm/wallet/hdwallet.js +0 -498
- package/lib.esm/wallet/hdwallet.js.map +0 -1
- package/lib.esm/wallet/json-crowdsale.d.ts +0 -27
- package/lib.esm/wallet/json-crowdsale.d.ts.map +0 -1
- package/lib.esm/wallet/json-crowdsale.js +0 -55
- package/lib.esm/wallet/json-crowdsale.js.map +0 -1
- package/lib.esm/wallet/mnemonic.d.ts +0 -65
- package/lib.esm/wallet/mnemonic.d.ts.map +0 -1
- package/lib.esm/wallet/mnemonic.js +0 -165
- package/lib.esm/wallet/mnemonic.js.map +0 -1
- package/lib.esm/wallet/seedwallet.d.ts +0 -4
- package/lib.esm/wallet/seedwallet.d.ts.map +0 -1
- package/lib.esm/wallet/seedwallet.js +0 -4
- package/lib.esm/wallet/seedwallet.js.map +0 -1
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [[link-quicknode]] provides a third-party service for connecting to
|
|
3
|
-
* various blockchains over JSON-RPC.
|
|
4
|
-
*
|
|
5
|
-
* **Supported Networks**
|
|
6
|
-
*
|
|
7
|
-
* - Ethereum Mainnet (``mainnet``)
|
|
8
|
-
* - Goerli Testnet (``goerli``)
|
|
9
|
-
* - Sepolia Testnet (``sepolia``)
|
|
10
|
-
* - Holesky Testnet (``holesky``)
|
|
11
|
-
* - Arbitrum (``arbitrum``)
|
|
12
|
-
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
|
13
|
-
* - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)
|
|
14
|
-
* - Base Mainnet (``base``);
|
|
15
|
-
* - Base Goerli Testnet (``base-goerli``);
|
|
16
|
-
* - Base Sepolia Testnet (``base-sepolia``);
|
|
17
|
-
* - BNB Smart Chain Mainnet (``bnb``)
|
|
18
|
-
* - BNB Smart Chain Testnet (``bnbt``)
|
|
19
|
-
* - Optimism (``optimism``)
|
|
20
|
-
* - Optimism Goerli Testnet (``optimism-goerli``)
|
|
21
|
-
* - Optimism Sepolia Testnet (``optimism-sepolia``)
|
|
22
|
-
* - Polygon (``matic``)
|
|
23
|
-
* - Polygon Mumbai Testnet (``matic-mumbai``)
|
|
24
|
-
*
|
|
25
|
-
* @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]
|
|
26
|
-
*/
|
|
27
|
-
import { defineProperties, FetchRequest, assertArgument } from "../utils/index.js";
|
|
28
|
-
import { showThrottleMessage } from "./community.js";
|
|
29
|
-
import { Network } from "./network.js";
|
|
30
|
-
import { JsonRpcProvider } from "./provider-jsonrpc.js";
|
|
31
|
-
const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb";
|
|
32
|
-
function getHost(name) {
|
|
33
|
-
switch (name) {
|
|
34
|
-
case "mainnet":
|
|
35
|
-
return "ethers.quiknode.pro";
|
|
36
|
-
case "goerli":
|
|
37
|
-
return "ethers.ethereum-goerli.quiknode.pro";
|
|
38
|
-
case "sepolia":
|
|
39
|
-
return "ethers.ethereum-sepolia.quiknode.pro";
|
|
40
|
-
case "holesky":
|
|
41
|
-
return "ethers.ethereum-holesky.quiknode.pro";
|
|
42
|
-
case "arbitrum":
|
|
43
|
-
return "ethers.arbitrum-mainnet.quiknode.pro";
|
|
44
|
-
case "arbitrum-goerli":
|
|
45
|
-
return "ethers.arbitrum-goerli.quiknode.pro";
|
|
46
|
-
case "arbitrum-sepolia":
|
|
47
|
-
return "ethers.arbitrum-sepolia.quiknode.pro";
|
|
48
|
-
case "base":
|
|
49
|
-
return "ethers.base-mainnet.quiknode.pro";
|
|
50
|
-
case "base-goerli":
|
|
51
|
-
return "ethers.base-goerli.quiknode.pro";
|
|
52
|
-
case "base-spolia":
|
|
53
|
-
return "ethers.base-sepolia.quiknode.pro";
|
|
54
|
-
case "bnb":
|
|
55
|
-
return "ethers.bsc.quiknode.pro";
|
|
56
|
-
case "bnbt":
|
|
57
|
-
return "ethers.bsc-testnet.quiknode.pro";
|
|
58
|
-
case "matic":
|
|
59
|
-
return "ethers.matic.quiknode.pro";
|
|
60
|
-
case "matic-mumbai":
|
|
61
|
-
return "ethers.matic-testnet.quiknode.pro";
|
|
62
|
-
case "optimism":
|
|
63
|
-
return "ethers.optimism.quiknode.pro";
|
|
64
|
-
case "optimism-goerli":
|
|
65
|
-
return "ethers.optimism-goerli.quiknode.pro";
|
|
66
|
-
case "optimism-sepolia":
|
|
67
|
-
return "ethers.optimism-sepolia.quiknode.pro";
|
|
68
|
-
case "xdai":
|
|
69
|
-
return "ethers.xdai.quiknode.pro";
|
|
70
|
-
}
|
|
71
|
-
assertArgument(false, "unsupported network", "network", name);
|
|
72
|
-
}
|
|
73
|
-
/*
|
|
74
|
-
@TODO:
|
|
75
|
-
These networks are not currently present in the Network
|
|
76
|
-
default included networks. Research them and ensure they
|
|
77
|
-
are EVM compatible and work with ethers
|
|
78
|
-
|
|
79
|
-
http://ethers.matic-amoy.quiknode.pro
|
|
80
|
-
|
|
81
|
-
http://ethers.avalanche-mainnet.quiknode.pro
|
|
82
|
-
http://ethers.avalanche-testnet.quiknode.pro
|
|
83
|
-
http://ethers.blast-sepolia.quiknode.pro
|
|
84
|
-
http://ethers.celo-mainnet.quiknode.pro
|
|
85
|
-
http://ethers.fantom.quiknode.pro
|
|
86
|
-
http://ethers.imx-demo.quiknode.pro
|
|
87
|
-
http://ethers.imx-mainnet.quiknode.pro
|
|
88
|
-
http://ethers.imx-testnet.quiknode.pro
|
|
89
|
-
http://ethers.near-mainnet.quiknode.pro
|
|
90
|
-
http://ethers.near-testnet.quiknode.pro
|
|
91
|
-
http://ethers.nova-mainnet.quiknode.pro
|
|
92
|
-
http://ethers.scroll-mainnet.quiknode.pro
|
|
93
|
-
http://ethers.scroll-testnet.quiknode.pro
|
|
94
|
-
http://ethers.tron-mainnet.quiknode.pro
|
|
95
|
-
http://ethers.zkevm-mainnet.quiknode.pro
|
|
96
|
-
http://ethers.zkevm-testnet.quiknode.pro
|
|
97
|
-
http://ethers.zksync-mainnet.quiknode.pro
|
|
98
|
-
http://ethers.zksync-testnet.quiknode.pro
|
|
99
|
-
*/
|
|
100
|
-
/**
|
|
101
|
-
* The **QuickNodeProvider** connects to the [[link-quicknode]]
|
|
102
|
-
* JSON-RPC end-points.
|
|
103
|
-
*
|
|
104
|
-
* By default, a highly-throttled API token is used, which is
|
|
105
|
-
* appropriate for quick prototypes and simple scripts. To
|
|
106
|
-
* gain access to an increased rate-limit, it is highly
|
|
107
|
-
* recommended to [sign up here](link-quicknode).
|
|
108
|
-
*/
|
|
109
|
-
export class QuickNodeProvider extends JsonRpcProvider {
|
|
110
|
-
/**
|
|
111
|
-
* The API token.
|
|
112
|
-
*/
|
|
113
|
-
token;
|
|
114
|
-
/**
|
|
115
|
-
* Creates a new **QuickNodeProvider**.
|
|
116
|
-
*/
|
|
117
|
-
constructor(_network, token) {
|
|
118
|
-
if (_network == null) {
|
|
119
|
-
_network = "mainnet";
|
|
120
|
-
}
|
|
121
|
-
const network = Network.from(_network);
|
|
122
|
-
if (token == null) {
|
|
123
|
-
token = defaultToken;
|
|
124
|
-
}
|
|
125
|
-
const request = QuickNodeProvider.getRequest(network, token);
|
|
126
|
-
super(request, network, { staticNetwork: network });
|
|
127
|
-
defineProperties(this, { token });
|
|
128
|
-
}
|
|
129
|
-
_getProvider(chainId) {
|
|
130
|
-
try {
|
|
131
|
-
return new QuickNodeProvider(chainId, this.token);
|
|
132
|
-
}
|
|
133
|
-
catch (error) { }
|
|
134
|
-
return super._getProvider(chainId);
|
|
135
|
-
}
|
|
136
|
-
isCommunityResource() {
|
|
137
|
-
return (this.token === defaultToken);
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Returns a new request prepared for %%network%% and the
|
|
141
|
-
* %%token%%.
|
|
142
|
-
*/
|
|
143
|
-
static getRequest(network, token) {
|
|
144
|
-
if (token == null) {
|
|
145
|
-
token = defaultToken;
|
|
146
|
-
}
|
|
147
|
-
const request = new FetchRequest(`https:/\/${getHost(network.name)}/${token}`);
|
|
148
|
-
request.allowGzip = true;
|
|
149
|
-
//if (projectSecret) { request.setCredentials("", projectSecret); }
|
|
150
|
-
if (token === defaultToken) {
|
|
151
|
-
request.retryFunc = async (request, response, attempt) => {
|
|
152
|
-
showThrottleMessage("QuickNodeProvider");
|
|
153
|
-
return true;
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
return request;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
//# sourceMappingURL=provider-quicknode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,cAAc,EACjD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAEhE,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,qBAAqB,CAAC;QACjC,KAAK,QAAQ;YACT,OAAO,qCAAqC,CAAC;QACjD,KAAK,SAAS;YACV,OAAO,sCAAsC,CAAC;QAClD,KAAK,SAAS;YACV,OAAO,sCAAsC,CAAC;QAElD,KAAK,UAAU;YACX,OAAO,sCAAsC,CAAC;QAClD,KAAK,iBAAiB;YAClB,OAAO,qCAAqC,CAAC;QACjD,KAAK,kBAAkB;YACnB,OAAO,sCAAsC,CAAC;Q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,OAAe;QACxB,IAAI;YACA,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SACrD;QAAC,OAAO,KAAK,EAAE,GAAG;QACnB,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,KAAqB;QACrD,IAAI,KAAK,IAAI,IAAI,EAAE;YAAE,KAAK,GAAG,YAAY,CAAC;SAAE;QAE5C,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,IAAK,KAAM,EAAE,CAAC,CAAC;QACnF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,mEAAmE;QAEnE,IAAI,KAAK,KAAK,YAAY,EAAE;YACxB,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Explain HD Wallets..
|
|
3
|
-
*
|
|
4
|
-
* @_subsection: api/wallet:HD Wallets [hd-wallets]
|
|
5
|
-
*/
|
|
6
|
-
import { SigningKey } from "../crypto/index.js";
|
|
7
|
-
import { VoidSigner } from "../providers/index.js";
|
|
8
|
-
import { BaseWallet } from "./base-wallet.js";
|
|
9
|
-
import { Mnemonic } from "./mnemonic.js";
|
|
10
|
-
import type { ProgressCallback } from "../crypto/index.js";
|
|
11
|
-
import type { Provider } from "../providers/index.js";
|
|
12
|
-
import type { BytesLike, Numeric } from "../utils/index.js";
|
|
13
|
-
import type { Wordlist } from "../wordlists/index.js";
|
|
14
|
-
/**
|
|
15
|
-
* The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``)
|
|
16
|
-
*/
|
|
17
|
-
export declare const defaultPath: string;
|
|
18
|
-
/**
|
|
19
|
-
* An **HDNodeWallet** is a [[Signer]] backed by the private key derived
|
|
20
|
-
* from an HD Node using the [[link-bip-32]] stantard.
|
|
21
|
-
*
|
|
22
|
-
* An HD Node forms a hierarchal structure with each HD Node having a
|
|
23
|
-
* private key and the ability to derive child HD Nodes, defined by
|
|
24
|
-
* a path indicating the index of each child.
|
|
25
|
-
*/
|
|
26
|
-
export declare class HDNodeWallet extends BaseWallet {
|
|
27
|
-
#private;
|
|
28
|
-
/**
|
|
29
|
-
* The compressed public key.
|
|
30
|
-
*/
|
|
31
|
-
readonly publicKey: string;
|
|
32
|
-
/**
|
|
33
|
-
* The fingerprint.
|
|
34
|
-
*
|
|
35
|
-
* A fingerprint allows quick qay to detect parent and child nodes,
|
|
36
|
-
* but developers should be prepared to deal with collisions as it
|
|
37
|
-
* is only 4 bytes.
|
|
38
|
-
*/
|
|
39
|
-
readonly fingerprint: string;
|
|
40
|
-
/**
|
|
41
|
-
* The parent fingerprint.
|
|
42
|
-
*/
|
|
43
|
-
readonly parentFingerprint: string;
|
|
44
|
-
/**
|
|
45
|
-
* The mnemonic used to create this HD Node, if available.
|
|
46
|
-
*
|
|
47
|
-
* Sources such as extended keys do not encode the mnemonic, in
|
|
48
|
-
* which case this will be ``null``.
|
|
49
|
-
*/
|
|
50
|
-
readonly mnemonic: null | Mnemonic;
|
|
51
|
-
/**
|
|
52
|
-
* The chaincode, which is effectively a public key used
|
|
53
|
-
* to derive children.
|
|
54
|
-
*/
|
|
55
|
-
readonly chainCode: string;
|
|
56
|
-
/**
|
|
57
|
-
* The derivation path of this wallet.
|
|
58
|
-
*
|
|
59
|
-
* Since extended keys do not provide full path details, this
|
|
60
|
-
* may be ``null``, if instantiated from a source that does not
|
|
61
|
-
* encode it.
|
|
62
|
-
*/
|
|
63
|
-
readonly path: null | string;
|
|
64
|
-
/**
|
|
65
|
-
* The child index of this wallet. Values over ``2 *\* 31`` indicate
|
|
66
|
-
* the node is hardened.
|
|
67
|
-
*/
|
|
68
|
-
readonly index: number;
|
|
69
|
-
/**
|
|
70
|
-
* The depth of this wallet, which is the number of components
|
|
71
|
-
* in its path.
|
|
72
|
-
*/
|
|
73
|
-
readonly depth: number;
|
|
74
|
-
/**
|
|
75
|
-
* @private
|
|
76
|
-
*/
|
|
77
|
-
constructor(guard: any, signingKey: SigningKey, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, mnemonic: null | Mnemonic, provider: null | Provider);
|
|
78
|
-
connect(provider: null | Provider): HDNodeWallet;
|
|
79
|
-
/**
|
|
80
|
-
* Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with
|
|
81
|
-
* %%password%%.
|
|
82
|
-
*
|
|
83
|
-
* If %%progressCallback%% is specified, it will receive periodic
|
|
84
|
-
* updates as the encryption process progreses.
|
|
85
|
-
*/
|
|
86
|
-
encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise<string>;
|
|
87
|
-
/**
|
|
88
|
-
* Returns a [JSON Keystore Wallet](json-wallets) encryped with
|
|
89
|
-
* %%password%%.
|
|
90
|
-
*
|
|
91
|
-
* It is preferred to use the [async version](encrypt) instead,
|
|
92
|
-
* which allows a [[ProgressCallback]] to keep the user informed.
|
|
93
|
-
*
|
|
94
|
-
* This method will block the event loop (freezing all UI) until
|
|
95
|
-
* it is complete, which may be a non-trivial duration.
|
|
96
|
-
*/
|
|
97
|
-
encryptSync(password: Uint8Array | string): string;
|
|
98
|
-
/**
|
|
99
|
-
* The extended key.
|
|
100
|
-
*
|
|
101
|
-
* This key will begin with the prefix ``xpriv`` and can be used to
|
|
102
|
-
* reconstruct this HD Node to derive its children.
|
|
103
|
-
*/
|
|
104
|
-
get extendedKey(): string;
|
|
105
|
-
/**
|
|
106
|
-
* Returns true if this wallet has a path, providing a Type Guard
|
|
107
|
-
* that the path is non-null.
|
|
108
|
-
*/
|
|
109
|
-
hasPath(): this is {
|
|
110
|
-
path: string;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Returns a neutered HD Node, which removes the private details
|
|
114
|
-
* of an HD Node.
|
|
115
|
-
*
|
|
116
|
-
* A neutered node has no private key, but can be used to derive
|
|
117
|
-
* child addresses and other public data about the HD Node.
|
|
118
|
-
*/
|
|
119
|
-
neuter(): HDNodeVoidWallet;
|
|
120
|
-
/**
|
|
121
|
-
* Return the child for %%index%%.
|
|
122
|
-
*/
|
|
123
|
-
deriveChild(_index: Numeric): HDNodeWallet;
|
|
124
|
-
/**
|
|
125
|
-
* Return the HDNode for %%path%% from this node.
|
|
126
|
-
*/
|
|
127
|
-
derivePath(path: string): HDNodeWallet;
|
|
128
|
-
/**
|
|
129
|
-
* Creates a new HD Node from %%extendedKey%%.
|
|
130
|
-
*
|
|
131
|
-
* If the %%extendedKey%% will either have a prefix or ``xpub`` or
|
|
132
|
-
* ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]])
|
|
133
|
-
* or full HD Node ([[HDNodeWallet) respectively.
|
|
134
|
-
*/
|
|
135
|
-
static fromExtendedKey(extendedKey: string): HDNodeWallet | HDNodeVoidWallet;
|
|
136
|
-
/**
|
|
137
|
-
* Creates a new random HDNode.
|
|
138
|
-
*/
|
|
139
|
-
static createRandom(password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet;
|
|
140
|
-
/**
|
|
141
|
-
* Create an HD Node from %%mnemonic%%.
|
|
142
|
-
*/
|
|
143
|
-
static fromMnemonic(mnemonic: Mnemonic, path?: string): HDNodeWallet;
|
|
144
|
-
/**
|
|
145
|
-
* Creates an HD Node from a mnemonic %%phrase%%.
|
|
146
|
-
*/
|
|
147
|
-
static fromPhrase(phrase: string, password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet;
|
|
148
|
-
/**
|
|
149
|
-
* Creates an HD Node from a %%seed%%.
|
|
150
|
-
*/
|
|
151
|
-
static fromSeed(seed: BytesLike): HDNodeWallet;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* A **HDNodeVoidWallet** cannot sign, but provides access to
|
|
155
|
-
* the children nodes of a [[link-bip-32]] HD wallet addresses.
|
|
156
|
-
*
|
|
157
|
-
* The can be created by using an extended ``xpub`` key to
|
|
158
|
-
* [[HDNodeWallet_fromExtendedKey]] or by
|
|
159
|
-
* [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]].
|
|
160
|
-
*/
|
|
161
|
-
export declare class HDNodeVoidWallet extends VoidSigner {
|
|
162
|
-
/**
|
|
163
|
-
* The compressed public key.
|
|
164
|
-
*/
|
|
165
|
-
readonly publicKey: string;
|
|
166
|
-
/**
|
|
167
|
-
* The fingerprint.
|
|
168
|
-
*
|
|
169
|
-
* A fingerprint allows quick qay to detect parent and child nodes,
|
|
170
|
-
* but developers should be prepared to deal with collisions as it
|
|
171
|
-
* is only 4 bytes.
|
|
172
|
-
*/
|
|
173
|
-
readonly fingerprint: string;
|
|
174
|
-
/**
|
|
175
|
-
* The parent node fingerprint.
|
|
176
|
-
*/
|
|
177
|
-
readonly parentFingerprint: string;
|
|
178
|
-
/**
|
|
179
|
-
* The chaincode, which is effectively a public key used
|
|
180
|
-
* to derive children.
|
|
181
|
-
*/
|
|
182
|
-
readonly chainCode: string;
|
|
183
|
-
/**
|
|
184
|
-
* The derivation path of this wallet.
|
|
185
|
-
*
|
|
186
|
-
* Since extended keys do not provider full path details, this
|
|
187
|
-
* may be ``null``, if instantiated from a source that does not
|
|
188
|
-
* enocde it.
|
|
189
|
-
*/
|
|
190
|
-
readonly path: null | string;
|
|
191
|
-
/**
|
|
192
|
-
* The child index of this wallet. Values over ``2 *\* 31`` indicate
|
|
193
|
-
* the node is hardened.
|
|
194
|
-
*/
|
|
195
|
-
readonly index: number;
|
|
196
|
-
/**
|
|
197
|
-
* The depth of this wallet, which is the number of components
|
|
198
|
-
* in its path.
|
|
199
|
-
*/
|
|
200
|
-
readonly depth: number;
|
|
201
|
-
/**
|
|
202
|
-
* @private
|
|
203
|
-
*/
|
|
204
|
-
constructor(guard: any, address: string, publicKey: string, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, provider: null | Provider);
|
|
205
|
-
connect(provider: null | Provider): HDNodeVoidWallet;
|
|
206
|
-
/**
|
|
207
|
-
* The extended key.
|
|
208
|
-
*
|
|
209
|
-
* This key will begin with the prefix ``xpub`` and can be used to
|
|
210
|
-
* reconstruct this neutered key to derive its children addresses.
|
|
211
|
-
*/
|
|
212
|
-
get extendedKey(): string;
|
|
213
|
-
/**
|
|
214
|
-
* Returns true if this wallet has a path, providing a Type Guard
|
|
215
|
-
* that the path is non-null.
|
|
216
|
-
*/
|
|
217
|
-
hasPath(): this is {
|
|
218
|
-
path: string;
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* Return the child for %%index%%.
|
|
222
|
-
*/
|
|
223
|
-
deriveChild(_index: Numeric): HDNodeVoidWallet;
|
|
224
|
-
/**
|
|
225
|
-
* Return the signer for %%path%% from this node.
|
|
226
|
-
*/
|
|
227
|
-
derivePath(path: string): HDNodeVoidWallet;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Returns the [[link-bip-32]] path for the account at %%index%%.
|
|
231
|
-
*
|
|
232
|
-
* This is the pattern used by wallets like Ledger.
|
|
233
|
-
*
|
|
234
|
-
* There is also an [alternate pattern](getIndexedAccountPath) used by
|
|
235
|
-
* some software.
|
|
236
|
-
*/
|
|
237
|
-
export declare function getAccountPath(_index: Numeric): string;
|
|
238
|
-
/**
|
|
239
|
-
* Returns the path using an alternative pattern for deriving accounts,
|
|
240
|
-
* at %%index%%.
|
|
241
|
-
*
|
|
242
|
-
* This derivation path uses the //index// component rather than the
|
|
243
|
-
* //account// component to derive sequential accounts.
|
|
244
|
-
*
|
|
245
|
-
* This is the pattern used by wallets like MetaMask.
|
|
246
|
-
*/
|
|
247
|
-
export declare function getIndexedAccountPath(_index: Numeric): string;
|
|
248
|
-
//# sourceMappingURL=hdwallet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hdwallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAuC,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAUnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAA2B,CAAC;AAsFtD;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,UAAU;;IACxC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,EAAG,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAG,MAAM,CAAC;IAEpC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAG,IAAI,GAAG,QAAQ,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAG,IAAI,GAAG,MAAM,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,KAAK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