quantumcoin 6.14.1 → 6.14.2
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 +2 -0
- package/dist/quantumcoin.js +2697 -7812
- package/dist/quantumcoin.js.map +1 -1
- package/dist/quantumcoin.min.js +1 -1
- package/dist/quantumcoin.min.js'.gz' +0 -0
- package/dist/quantumcoin.umd.js +2698 -7835
- package/dist/quantumcoin.umd.js.map +1 -1
- package/dist/quantumcoin.umd.min.js +1 -1
- package/dist/quantumcoin.umd.min.js'.gz' +0 -0
- package/dist/wordlists-extra.min.js'.gz' +0 -0
- package/lib.commonjs/address/address.d.ts +1 -21
- package/lib.commonjs/address/address.d.ts.map +1 -1
- package/lib.commonjs/address/address.js +2 -30
- package/lib.commonjs/address/address.js.map +1 -1
- package/lib.commonjs/address/index.d.ts +1 -1
- package/lib.commonjs/address/index.d.ts.map +1 -1
- package/lib.commonjs/address/index.js +1 -2
- package/lib.commonjs/address/index.js.map +1 -1
- package/lib.commonjs/crypto/signature.d.ts +4 -17
- package/lib.commonjs/crypto/signature.d.ts.map +1 -1
- package/lib.commonjs/crypto/signature.js +57 -60
- package/lib.commonjs/crypto/signature.js.map +1 -1
- package/lib.commonjs/crypto/signing-key.d.ts +5 -64
- package/lib.commonjs/crypto/signing-key.d.ts.map +1 -1
- package/lib.commonjs/crypto/signing-key.js +27 -101
- package/lib.commonjs/crypto/signing-key.js.map +1 -1
- package/lib.commonjs/providers/default-provider.d.ts +0 -8
- package/lib.commonjs/providers/default-provider.d.ts.map +1 -1
- package/lib.commonjs/providers/default-provider.js +0 -108
- package/lib.commonjs/providers/default-provider.js.map +1 -1
- package/lib.commonjs/providers/index.d.ts +0 -9
- package/lib.commonjs/providers/index.d.ts.map +1 -1
- package/lib.commonjs/providers/index.js +1 -21
- package/lib.commonjs/providers/index.js.map +1 -1
- package/lib.commonjs/providers/network.js +1 -99
- package/lib.commonjs/providers/network.js.map +1 -1
- package/lib.commonjs/quantumcoin.d.ts +4 -4
- package/lib.commonjs/quantumcoin.d.ts.map +1 -1
- package/lib.commonjs/quantumcoin.js +4 -26
- package/lib.commonjs/quantumcoin.js.map +1 -1
- package/lib.commonjs/transaction/address.d.ts +1 -1
- package/lib.commonjs/transaction/address.d.ts.map +1 -1
- package/lib.commonjs/transaction/address.js +9 -5
- package/lib.commonjs/transaction/address.js.map +1 -1
- package/lib.commonjs/wallet/hdwallet.d.ts.map +1 -1
- package/lib.commonjs/wallet/hdwallet.js +4 -5
- package/lib.commonjs/wallet/hdwallet.js.map +1 -1
- package/lib.commonjs/wallet/index.d.ts +2 -6
- package/lib.commonjs/wallet/index.d.ts.map +1 -1
- package/lib.commonjs/wallet/index.js +1 -14
- package/lib.commonjs/wallet/index.js.map +1 -1
- package/lib.commonjs/wallet/json-keystore.d.ts +3 -52
- package/lib.commonjs/wallet/json-keystore.d.ts.map +1 -1
- package/lib.commonjs/wallet/json-keystore.js +41 -246
- package/lib.commonjs/wallet/json-keystore.js.map +1 -1
- package/lib.commonjs/wallet/seedwallet.d.ts +4 -0
- package/lib.commonjs/wallet/seedwallet.d.ts.map +1 -0
- package/lib.commonjs/wallet/seedwallet.js +8 -0
- package/lib.commonjs/wallet/seedwallet.js.map +1 -0
- package/lib.commonjs/wallet/wallet.d.ts +5 -14
- package/lib.commonjs/wallet/wallet.d.ts.map +1 -1
- package/lib.commonjs/wallet/wallet.js +12 -51
- package/lib.commonjs/wallet/wallet.js.map +1 -1
- package/lib.esm/address/address.d.ts +1 -21
- package/lib.esm/address/address.d.ts.map +1 -1
- package/lib.esm/address/address.js +1 -28
- package/lib.esm/address/address.js.map +1 -1
- package/lib.esm/address/index.d.ts +1 -1
- package/lib.esm/address/index.d.ts.map +1 -1
- package/lib.esm/address/index.js +1 -1
- package/lib.esm/address/index.js.map +1 -1
- package/lib.esm/crypto/signature.d.ts +4 -17
- package/lib.esm/crypto/signature.d.ts.map +1 -1
- package/lib.esm/crypto/signature.js +45 -46
- package/lib.esm/crypto/signature.js.map +1 -1
- package/lib.esm/crypto/signing-key.d.ts +5 -64
- package/lib.esm/crypto/signing-key.d.ts.map +1 -1
- package/lib.esm/crypto/signing-key.js +26 -102
- package/lib.esm/crypto/signing-key.js.map +1 -1
- package/lib.esm/providers/default-provider.d.ts +0 -8
- package/lib.esm/providers/default-provider.d.ts.map +1 -1
- package/lib.esm/providers/default-provider.js +0 -108
- package/lib.esm/providers/default-provider.js.map +1 -1
- package/lib.esm/providers/index.d.ts +0 -9
- package/lib.esm/providers/index.d.ts.map +1 -1
- package/lib.esm/providers/index.js +0 -9
- package/lib.esm/providers/index.js.map +1 -1
- package/lib.esm/providers/network.js +3 -101
- package/lib.esm/providers/network.js.map +1 -1
- package/lib.esm/quantumcoin.d.ts +4 -4
- package/lib.esm/quantumcoin.d.ts.map +1 -1
- package/lib.esm/quantumcoin.js +3 -3
- package/lib.esm/quantumcoin.js.map +1 -1
- package/lib.esm/transaction/address.d.ts +1 -1
- package/lib.esm/transaction/address.d.ts.map +1 -1
- package/lib.esm/transaction/address.js +7 -4
- package/lib.esm/transaction/address.js.map +1 -1
- package/lib.esm/wallet/hdwallet.d.ts.map +1 -1
- package/lib.esm/wallet/hdwallet.js +4 -5
- package/lib.esm/wallet/hdwallet.js.map +1 -1
- package/lib.esm/wallet/index.d.ts +2 -6
- package/lib.esm/wallet/index.d.ts.map +1 -1
- package/lib.esm/wallet/index.js +1 -4
- package/lib.esm/wallet/index.js.map +1 -1
- package/lib.esm/wallet/json-keystore.d.ts +3 -52
- package/lib.esm/wallet/json-keystore.d.ts.map +1 -1
- package/lib.esm/wallet/json-keystore.js +32 -241
- package/lib.esm/wallet/json-keystore.js.map +1 -1
- package/lib.esm/wallet/seedwallet.d.ts +4 -0
- package/lib.esm/wallet/seedwallet.d.ts.map +1 -0
- package/lib.esm/wallet/seedwallet.js +4 -0
- package/lib.esm/wallet/seedwallet.js.map +1 -0
- package/lib.esm/wallet/wallet.d.ts +5 -14
- package/lib.esm/wallet/wallet.d.ts.map +1 -1
- package/lib.esm/wallet/wallet.js +12 -53
- package/lib.esm/wallet/wallet.js.map +1 -1
- package/package.json +5 -2
- package/src.ts/address/address.ts +2 -27
- package/src.ts/address/index.ts +1 -1
- package/src.ts/crypto/signature.ts +31 -45
- package/src.ts/crypto/signing-key.ts +31 -109
- package/src.ts/providers/default-provider.ts +0 -106
- package/src.ts/providers/index.ts +0 -10
- package/src.ts/providers/network.ts +3 -111
- package/src.ts/quantumcoin.ts +7 -17
- package/src.ts/transaction/address.ts +8 -5
- package/src.ts/wallet/index.ts +2 -17
- package/src.ts/wallet/json-keystore.ts +42 -325
- package/src.ts/wallet/wallet.ts +23 -47
- package/src.ts/providers/provider-alchemy.ts +0 -166
- package/src.ts/providers/provider-ankr.ts +0 -153
- package/src.ts/providers/provider-blockscout.ts +0 -167
- package/src.ts/providers/provider-chainstack.ts +0 -113
- package/src.ts/providers/provider-cloudflare.ts +0 -24
- package/src.ts/providers/provider-etherscan.ts +0 -671
- package/src.ts/providers/provider-infura.ts +0 -220
- package/src.ts/providers/provider-pocket.ts +0 -121
- package/src.ts/providers/provider-quicknode.ts +0 -177
- package/src.ts/wallet/hdwallet.ts +0 -586
- package/src.ts/wallet/json-crowdsale.ts +0 -74
- package/src.ts/wallet/mnemonic.ts +0 -203
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/address/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/address/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,IAAI,GA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;YAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC;SAAE;QAE5D,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAE3C,kDAAkD;QAClD,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,IAAI,MAAM,KAAK,OAAO,EAChF,sBAAsB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAEhD,OAAO,MAAM,CAAC;KACjB;IAED,4CAA4C;IAC5C,IAAI,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,EAAE;QACjD,4CAA4C;QAC5C,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAE3G,IAAI,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE;YAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;SAAE;QACrD,OAAQ,kBAAkB,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;KAC7C;IAED,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -43,7 +43,7 @@ export interface NameResolver {
|
|
|
43
43
|
*/
|
|
44
44
|
resolveName(name: string): Promise<null | string>;
|
|
45
45
|
}
|
|
46
|
-
export { getAddress
|
|
46
|
+
export { getAddress } from "./address.js";
|
|
47
47
|
export { getCreateAddress, getCreate2Address } from "./contract-address.js";
|
|
48
48
|
export { isAddressable, isAddress, resolveAddress } from "./checks.js";
|
|
49
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CACrD;AAED,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CACrD;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/lib.esm/address/index.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @_section: api/address:Addresses [about-addresses]
|
|
14
14
|
*/
|
|
15
15
|
null;
|
|
16
|
-
export { getAddress
|
|
16
|
+
export { getAddress } from "./address.js";
|
|
17
17
|
export { getCreateAddress, getCreate2Address } from "./contract-address.js";
|
|
18
18
|
export { isAddressable, isAddress, resolveAddress } from "./checks.js";
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,IAAI,CAAC;AAoCL,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,IAAI,CAAC;AAoCL,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -8,20 +8,14 @@ export type SignatureLike = Signature | string | {
|
|
|
8
8
|
r: string;
|
|
9
9
|
s: string;
|
|
10
10
|
v: BigNumberish;
|
|
11
|
-
yParity?: 0 | 1;
|
|
12
|
-
yParityAndS?: string;
|
|
13
11
|
} | {
|
|
14
12
|
r: string;
|
|
15
|
-
yParityAndS: string;
|
|
16
|
-
yParity?: 0 | 1;
|
|
17
13
|
s?: string;
|
|
18
14
|
v?: number;
|
|
19
15
|
} | {
|
|
20
16
|
r: string;
|
|
21
17
|
s: string;
|
|
22
|
-
yParity: 0 | 1;
|
|
23
18
|
v?: BigNumberish;
|
|
24
|
-
yParityAndS?: string;
|
|
25
19
|
};
|
|
26
20
|
/**
|
|
27
21
|
* A Signature @TODO
|
|
@@ -51,10 +45,10 @@ export declare class Signature {
|
|
|
51
45
|
* its correspondin ``y``, the ``v`` indicates which of the two ``y``
|
|
52
46
|
* values to use.
|
|
53
47
|
*
|
|
54
|
-
* It is normalized to the values ``
|
|
48
|
+
* It is normalized to the values ``28`` or ``28`` for legacy
|
|
55
49
|
* purposes.
|
|
56
50
|
*/
|
|
57
|
-
get v():
|
|
51
|
+
get v(): 28 | 28;
|
|
58
52
|
set v(value: BigNumberish);
|
|
59
53
|
/**
|
|
60
54
|
* The EIP-155 ``v`` for legacy transactions. For non-legacy
|
|
@@ -88,7 +82,7 @@ export declare class Signature {
|
|
|
88
82
|
/**
|
|
89
83
|
* @private
|
|
90
84
|
*/
|
|
91
|
-
constructor(guard: any, r: string, s: string, v:
|
|
85
|
+
constructor(guard: any, r: string, s: string, v: 28);
|
|
92
86
|
/**
|
|
93
87
|
* Returns a new identical [[Signature]].
|
|
94
88
|
*/
|
|
@@ -115,14 +109,12 @@ export declare class Signature {
|
|
|
115
109
|
* property to include the chain ID.
|
|
116
110
|
*
|
|
117
111
|
* @example:
|
|
118
|
-
* Signature.getChainIdV(5, 27)
|
|
119
|
-
* //_result:
|
|
120
112
|
*
|
|
121
113
|
* Signature.getChainIdV(5, 28)
|
|
122
114
|
* //_result:
|
|
123
115
|
*
|
|
124
116
|
*/
|
|
125
|
-
static getChainIdV(chainId: BigNumberish, v:
|
|
117
|
+
static getChainIdV(chainId: BigNumberish, v: 28): bigint;
|
|
126
118
|
/**
|
|
127
119
|
* Compute the normalized legacy transaction ``v`` from a ``yParirty``,
|
|
128
120
|
* a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.
|
|
@@ -132,10 +124,6 @@ export declare class Signature {
|
|
|
132
124
|
* Signature.getNormalizedV(0)
|
|
133
125
|
* //_result:
|
|
134
126
|
*
|
|
135
|
-
* // Legacy non-EIP-1559 transaction (i.e. 27 or 28)
|
|
136
|
-
* Signature.getNormalizedV(27)
|
|
137
|
-
* //_result:
|
|
138
|
-
*
|
|
139
127
|
* // Legacy EIP-155 transaction (i.e. >= 35)
|
|
140
128
|
* Signature.getNormalizedV(46)
|
|
141
129
|
* //_result:
|
|
@@ -144,7 +132,6 @@ export declare class Signature {
|
|
|
144
132
|
* Signature.getNormalizedV(5)
|
|
145
133
|
* //_error:
|
|
146
134
|
*/
|
|
147
|
-
static getNormalizedV(v: BigNumberish): 27 | 28;
|
|
148
135
|
/**
|
|
149
136
|
* Creates a new [[Signature]].
|
|
150
137
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAER,YAAY,EAAE,SAAS,EAC1B,MAAM,mBAAmB,CAAC;AAe3B;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG;IAC7C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,YAAY,CAAC;CACnB,GAAG;IACA,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACd,GAAG;IACA,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,YAAY,CAAC;CACpB,CAAC;AAMF;;;;;GAKG;AACH,qBAAa,SAAS;;IAMlB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,MAAM,CAAoB;IACnC,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAErB;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,MAAM,CAAoB;IACnC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAGtB;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAoB;IACpC,IAAI,CAAC,CAAC,KAAK,EAAE,YAAY,EAIxB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,GAAG,MAAM,CAA2B;IAExD;;;OAGG;IACH,IAAI,aAAa,IAAI,IAAI,GAAG,MAAM,CAIjC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAKxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;IAYnD;;OAEG;IACH,KAAK,IAAI,SAAS;IAMlB;;OAEG;IACH,MAAM,IAAI,GAAG;IASb;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM;IAY1C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,MAAM;IAIxD;;;;;;;;;;;;;;;;OAgBG;IAYH;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,SAAS;CAyF9C"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { ZeroHash } from "../constants/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
//isHexString, toBeArray, zeroPadValue,
|
|
4
|
+
concat, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate } from "../utils/index.js";
|
|
3
5
|
// Constants
|
|
4
6
|
const BN_0 = BigInt(0);
|
|
5
|
-
const BN_1 = BigInt(1);
|
|
7
|
+
//const BN_1 = BigInt(1);
|
|
6
8
|
const BN_2 = BigInt(2);
|
|
7
|
-
const BN_27 = BigInt(27);
|
|
8
9
|
const BN_28 = BigInt(28);
|
|
9
10
|
const BN_35 = BigInt(35);
|
|
10
11
|
const _guard = {};
|
|
11
|
-
|
|
12
|
+
/*
|
|
13
|
+
function toUint256(value: BigNumberish): string {
|
|
12
14
|
return zeroPadValue(toBeArray(value), 32);
|
|
13
|
-
}
|
|
15
|
+
}*/
|
|
14
16
|
/**
|
|
15
17
|
* A Signature @TODO
|
|
16
18
|
*
|
|
@@ -30,7 +32,6 @@ export class Signature {
|
|
|
30
32
|
*/
|
|
31
33
|
get r() { return this.#r; }
|
|
32
34
|
set r(value) {
|
|
33
|
-
assertArgument(dataLength(value) === 32, "invalid r", "value", value);
|
|
34
35
|
this.#r = hexlify(value);
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
@@ -38,9 +39,7 @@ export class Signature {
|
|
|
38
39
|
*/
|
|
39
40
|
get s() { return this.#s; }
|
|
40
41
|
set s(_value) {
|
|
41
|
-
assertArgument(dataLength(_value) === 32, "invalid s", "value", _value);
|
|
42
42
|
const value = hexlify(_value);
|
|
43
|
-
assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value);
|
|
44
43
|
this.#s = value;
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
@@ -50,13 +49,13 @@ export class Signature {
|
|
|
50
49
|
* its correspondin ``y``, the ``v`` indicates which of the two ``y``
|
|
51
50
|
* values to use.
|
|
52
51
|
*
|
|
53
|
-
* It is normalized to the values ``
|
|
52
|
+
* It is normalized to the values ``28`` or ``28`` for legacy
|
|
54
53
|
* purposes.
|
|
55
54
|
*/
|
|
56
55
|
get v() { return this.#v; }
|
|
57
56
|
set v(value) {
|
|
58
57
|
const v = getNumber(value, "value");
|
|
59
|
-
assertArgument(v ===
|
|
58
|
+
assertArgument(v === 28, "invalid v", "v", value);
|
|
60
59
|
this.#v = v;
|
|
61
60
|
}
|
|
62
61
|
/**
|
|
@@ -81,7 +80,7 @@ export class Signature {
|
|
|
81
80
|
* See ``v`` for more details on how this value is used.
|
|
82
81
|
*/
|
|
83
82
|
get yParity() {
|
|
84
|
-
return (this.v ===
|
|
83
|
+
return (this.v === 28) ? 0 : 1;
|
|
85
84
|
}
|
|
86
85
|
/**
|
|
87
86
|
* The [[link-eip-2098]] compact representation of the ``yParity``
|
|
@@ -154,7 +153,7 @@ export class Signature {
|
|
|
154
153
|
static getChainId(v) {
|
|
155
154
|
const bv = getBigInt(v, "v");
|
|
156
155
|
// The v is not an EIP-155 v, so it is the unspecified chain ID
|
|
157
|
-
if ((bv ==
|
|
156
|
+
if ((bv == BN_28) || (bv == BN_28)) {
|
|
158
157
|
return BN_0;
|
|
159
158
|
}
|
|
160
159
|
// Bad value for an EIP-155 v
|
|
@@ -168,15 +167,13 @@ export class Signature {
|
|
|
168
167
|
* property to include the chain ID.
|
|
169
168
|
*
|
|
170
169
|
* @example:
|
|
171
|
-
* Signature.getChainIdV(5, 27)
|
|
172
|
-
* //_result:
|
|
173
170
|
*
|
|
174
171
|
* Signature.getChainIdV(5, 28)
|
|
175
172
|
* //_result:
|
|
176
173
|
*
|
|
177
174
|
*/
|
|
178
175
|
static getChainIdV(chainId, v) {
|
|
179
|
-
return (getBigInt(chainId) * BN_2) + BigInt(35 + v -
|
|
176
|
+
return (getBigInt(chainId) * BN_2) + BigInt(35 + v - 28);
|
|
180
177
|
}
|
|
181
178
|
/**
|
|
182
179
|
* Compute the normalized legacy transaction ``v`` from a ``yParirty``,
|
|
@@ -187,10 +184,6 @@ export class Signature {
|
|
|
187
184
|
* Signature.getNormalizedV(0)
|
|
188
185
|
* //_result:
|
|
189
186
|
*
|
|
190
|
-
* // Legacy non-EIP-1559 transaction (i.e. 27 or 28)
|
|
191
|
-
* Signature.getNormalizedV(27)
|
|
192
|
-
* //_result:
|
|
193
|
-
*
|
|
194
187
|
* // Legacy EIP-155 transaction (i.e. >= 35)
|
|
195
188
|
* Signature.getNormalizedV(46)
|
|
196
189
|
* //_result:
|
|
@@ -199,18 +192,16 @@ export class Signature {
|
|
|
199
192
|
* Signature.getNormalizedV(5)
|
|
200
193
|
* //_error:
|
|
201
194
|
*/
|
|
202
|
-
static getNormalizedV(v) {
|
|
195
|
+
/*static getNormalizedV(v: BigNumberish): 28 {
|
|
203
196
|
const bv = getBigInt(v);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (bv === BN_1 || bv === BN_28) {
|
|
208
|
-
return 28;
|
|
209
|
-
}
|
|
197
|
+
|
|
198
|
+
if (bv === BN_1 || bv === BN_28) { return 28; }
|
|
199
|
+
|
|
210
200
|
assertArgument(bv >= BN_35, "invalid v", "v", v);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
201
|
+
|
|
202
|
+
// Otherwise, EIP-155 v means odd is 28 and even is 28
|
|
203
|
+
return (bv & BN_1) ? 28: 28;
|
|
204
|
+
}*/
|
|
214
205
|
/**
|
|
215
206
|
* Creates a new [[Signature]].
|
|
216
207
|
*
|
|
@@ -225,77 +216,85 @@ export class Signature {
|
|
|
225
216
|
}
|
|
226
217
|
;
|
|
227
218
|
if (sig == null) {
|
|
228
|
-
return new Signature(_guard, ZeroHash, ZeroHash,
|
|
219
|
+
return new Signature(_guard, ZeroHash, ZeroHash, 28);
|
|
229
220
|
}
|
|
230
221
|
if (typeof (sig) === "string") {
|
|
231
|
-
const bytes = getBytes(sig, "signature");
|
|
222
|
+
/*const bytes = getBytes(sig, "signature");
|
|
232
223
|
if (bytes.length === 64) {
|
|
233
224
|
const r = hexlify(bytes.slice(0, 32));
|
|
234
225
|
const s = bytes.slice(32, 64);
|
|
235
|
-
const v = (s[0] & 0x80) ? 28
|
|
226
|
+
const v = (s[0] & 0x80) ? 28: 28;
|
|
236
227
|
s[0] &= 0x7f;
|
|
237
228
|
return new Signature(_guard, r, hexlify(s), v);
|
|
238
229
|
}
|
|
230
|
+
|
|
239
231
|
if (bytes.length === 65) {
|
|
240
232
|
const r = hexlify(bytes.slice(0, 32));
|
|
241
233
|
const s = bytes.slice(32, 64);
|
|
242
234
|
assertError((s[0] & 0x80) === 0, "non-canonical s");
|
|
243
235
|
const v = Signature.getNormalizedV(bytes[64]);
|
|
244
236
|
return new Signature(_guard, r, hexlify(s), v);
|
|
245
|
-
}
|
|
237
|
+
}*/
|
|
246
238
|
assertError(false, "invalid raw signature length");
|
|
247
239
|
}
|
|
248
240
|
if (sig instanceof Signature) {
|
|
249
241
|
return sig.clone();
|
|
250
242
|
}
|
|
251
|
-
|
|
243
|
+
return new Signature(_guard, ZeroHash, ZeroHash, 28); //todo
|
|
244
|
+
/*// Get r
|
|
252
245
|
const _r = sig.r;
|
|
253
246
|
assertError(_r != null, "missing r");
|
|
254
247
|
const r = toUint256(_r);
|
|
248
|
+
|
|
255
249
|
// Get s; by any means necessary (we check consistency below)
|
|
256
|
-
const s = (function
|
|
257
|
-
if (s != null) {
|
|
258
|
-
|
|
259
|
-
}
|
|
250
|
+
const s = (function(s?: string, yParityAndS?: string) {
|
|
251
|
+
if (s != null) { return toUint256(s); }
|
|
252
|
+
|
|
260
253
|
if (yParityAndS != null) {
|
|
261
254
|
assertError(isHexString(yParityAndS, 32), "invalid yParityAndS");
|
|
262
255
|
const bytes = getBytes(yParityAndS);
|
|
263
256
|
bytes[0] &= 0x7f;
|
|
264
257
|
return hexlify(bytes);
|
|
265
258
|
}
|
|
259
|
+
|
|
266
260
|
assertError(false, "missing s");
|
|
267
261
|
})(sig.s, sig.yParityAndS);
|
|
268
262
|
assertError((getBytes(s)[0] & 0x80) == 0, "non-canonical s");
|
|
263
|
+
|
|
269
264
|
// Get v; by any means necessary (we check consistency below)
|
|
270
|
-
const { networkV, v } = (function
|
|
265
|
+
const { networkV, v } = (function(_v?: BigNumberish, yParityAndS?: string, yParity?: Numeric): { networkV?: bigint, v: 28 | 28 } {
|
|
271
266
|
if (_v != null) {
|
|
272
267
|
const v = getBigInt(_v);
|
|
273
268
|
return {
|
|
274
|
-
networkV: ((v >= BN_35) ? v
|
|
269
|
+
networkV: ((v >= BN_35) ? v: undefined),
|
|
275
270
|
v: Signature.getNormalizedV(v)
|
|
276
271
|
};
|
|
277
272
|
}
|
|
273
|
+
|
|
278
274
|
if (yParityAndS != null) {
|
|
279
275
|
assertError(isHexString(yParityAndS, 32), "invalid yParityAndS");
|
|
280
|
-
return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28
|
|
276
|
+
return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28: 28) };
|
|
281
277
|
}
|
|
278
|
+
|
|
282
279
|
if (yParity != null) {
|
|
283
280
|
switch (getNumber(yParity, "sig.yParity")) {
|
|
284
|
-
case 0: return { v:
|
|
281
|
+
case 0: return { v: 28 };
|
|
285
282
|
case 1: return { v: 28 };
|
|
286
283
|
}
|
|
287
284
|
assertError(false, "invalid yParity");
|
|
288
285
|
}
|
|
286
|
+
|
|
289
287
|
assertError(false, "missing v");
|
|
290
288
|
})(sig.v, sig.yParityAndS, sig.yParity);
|
|
289
|
+
|
|
291
290
|
const result = new Signature(_guard, r, s, v);
|
|
292
|
-
if (networkV) {
|
|
293
|
-
|
|
294
|
-
}
|
|
291
|
+
if (networkV) { result.#networkV = networkV; }
|
|
292
|
+
|
|
295
293
|
// If multiple of v, yParity, yParityAndS we given, check they match
|
|
296
294
|
assertError(sig.yParity == null || getNumber(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch");
|
|
297
295
|
assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch");
|
|
298
|
-
|
|
296
|
+
|
|
297
|
+
return result;*/
|
|
299
298
|
}
|
|
300
299
|
}
|
|
301
300
|
//# sourceMappingURL=signature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAu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|
@@ -7,8 +7,7 @@ import { Signature } from "./signature.js";
|
|
|
7
7
|
import type { BytesLike } from "../utils/index.js";
|
|
8
8
|
import type { SignatureLike } from "./index.js";
|
|
9
9
|
/**
|
|
10
|
-
* A **SigningKey** provides high-level access to
|
|
11
|
-
* cryptography (ECC) operations and key management.
|
|
10
|
+
* A **SigningKey** provides high-level access to cryptography operations and key management.
|
|
12
11
|
*/
|
|
13
12
|
export declare class SigningKey {
|
|
14
13
|
#private;
|
|
@@ -21,73 +20,26 @@ export declare class SigningKey {
|
|
|
21
20
|
*/
|
|
22
21
|
get privateKey(): string;
|
|
23
22
|
/**
|
|
24
|
-
* The
|
|
23
|
+
* The public key.
|
|
25
24
|
*
|
|
26
|
-
* This will always begin with the prefix ``0x04`` and be 132
|
|
27
|
-
* characters long (the ``0x`` prefix and 130 hexadecimal nibbles).
|
|
28
25
|
*/
|
|
29
26
|
get publicKey(): string;
|
|
30
|
-
/**
|
|
31
|
-
* The compressed public key.
|
|
32
|
-
*
|
|
33
|
-
* This will always begin with either the prefix ``0x02`` or ``0x03``
|
|
34
|
-
* and be 68 characters long (the ``0x`` prefix and 33 hexadecimal
|
|
35
|
-
* nibbles)
|
|
36
|
-
*/
|
|
37
|
-
get compressedPublicKey(): string;
|
|
38
27
|
/**
|
|
39
28
|
* Return the signature of the signed %%digest%%.
|
|
40
29
|
*/
|
|
41
30
|
sign(digest: BytesLike): Signature;
|
|
42
31
|
/**
|
|
43
|
-
*
|
|
44
|
-
* private key and the %%other%% key.
|
|
32
|
+
* Compute the public key for a private %%key%%.
|
|
45
33
|
*
|
|
46
|
-
* The %%other%% key may be any type of key, a raw public key,
|
|
47
|
-
* a compressed/uncompressed pubic key or aprivate key.
|
|
48
|
-
*
|
|
49
|
-
* Best practice is usually to use a cryptographic hash on the
|
|
50
|
-
* returned value before using it as a symetric secret.
|
|
51
|
-
*
|
|
52
|
-
* @example:
|
|
53
|
-
* sign1 = new SigningKey(id("some-secret-1"))
|
|
54
|
-
* sign2 = new SigningKey(id("some-secret-2"))
|
|
55
|
-
*
|
|
56
|
-
* // Notice that privA.computeSharedSecret(pubB)...
|
|
57
|
-
* sign1.computeSharedSecret(sign2.publicKey)
|
|
58
|
-
* //_result:
|
|
59
|
-
*
|
|
60
|
-
* // ...is equal to privB.computeSharedSecret(pubA).
|
|
61
|
-
* sign2.computeSharedSecret(sign1.publicKey)
|
|
62
|
-
* //_result:
|
|
63
|
-
*/
|
|
64
|
-
computeSharedSecret(other: BytesLike): string;
|
|
65
|
-
/**
|
|
66
|
-
* Compute the public key for %%key%%, optionally %%compressed%%.
|
|
67
|
-
*
|
|
68
|
-
* The %%key%% may be any type of key, a raw public key, a
|
|
69
|
-
* compressed/uncompressed public key or private key.
|
|
70
34
|
*
|
|
71
35
|
* @example:
|
|
72
36
|
* sign = new SigningKey(id("some-secret"));
|
|
73
37
|
*
|
|
74
|
-
* // Compute the
|
|
38
|
+
* // Compute the public key for a private key
|
|
75
39
|
* SigningKey.computePublicKey(sign.privateKey)
|
|
76
40
|
* //_result:
|
|
77
|
-
*
|
|
78
|
-
* // Compute the compressed public key for a private key
|
|
79
|
-
* SigningKey.computePublicKey(sign.privateKey, true)
|
|
80
|
-
* //_result:
|
|
81
|
-
*
|
|
82
|
-
* // Compute the uncompressed public key
|
|
83
|
-
* SigningKey.computePublicKey(sign.publicKey, false);
|
|
84
|
-
* //_result:
|
|
85
|
-
*
|
|
86
|
-
* // Compute the Compressed a public key
|
|
87
|
-
* SigningKey.computePublicKey(sign.publicKey, true);
|
|
88
|
-
* //_result:
|
|
89
41
|
*/
|
|
90
|
-
static computePublicKey(key: BytesLike
|
|
42
|
+
static computePublicKey(key: BytesLike): string;
|
|
91
43
|
/**
|
|
92
44
|
* Returns the public key for the private key which produced the
|
|
93
45
|
* %%signature%% for the given %%digest%%.
|
|
@@ -107,16 +59,5 @@ export declare class SigningKey {
|
|
|
107
59
|
*
|
|
108
60
|
*/
|
|
109
61
|
static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string;
|
|
110
|
-
/**
|
|
111
|
-
* Returns the point resulting from adding the ellipic curve points
|
|
112
|
-
* %%p0%% and %%p1%%.
|
|
113
|
-
*
|
|
114
|
-
* This is not a common function most developers should require, but
|
|
115
|
-
* can be useful for certain privacy-specific techniques.
|
|
116
|
-
*
|
|
117
|
-
* For example, it is used by [[HDNodeWallet]] to compute child
|
|
118
|
-
* addresses from parent public keys and chain codes.
|
|
119
|
-
*/
|
|
120
|
-
static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string;
|
|
121
62
|
}
|
|
122
63
|
//# sourceMappingURL=signing-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAMhD;;GAEG;AACH,qBAAa,UAAU;;IAGnB;;OAEG;gBACS,UAAU,EAAE,SAAS;IAKjC;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAA6B;IAErD;;;OAGG;IACH,IAAI,SAAS,IAAI,MAAM,CAA0D;IAEjF;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS;IAclC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM;IAS/C;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM;CAW/E"}
|