ecash-lib 1.5.2-rc → 2.1.0
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 +5 -40
- package/dist/address/legacyaddr.d.ts +1 -1
- package/dist/ecc.d.ts +9 -25
- package/dist/ecc.d.ts.map +1 -1
- package/dist/ecc.js +40 -56
- package/dist/ecc.js.map +1 -1
- package/dist/ffi/ecash_lib_wasm_bg_browser.d.ts +1 -0
- package/dist/ffi/ecash_lib_wasm_bg_browser.js +1707 -0
- package/dist/ffi/ecash_lib_wasm_bg_browser.wasm +0 -0
- package/dist/ffi/ecash_lib_wasm_bg_browser.wasm.d.ts +2 -0
- package/dist/ffi/ecash_lib_wasm_bg_nodejs.wasm +0 -0
- package/dist/ffi/ecash_lib_wasm_bg_nodejs.wasm.d.ts +2 -0
- package/dist/ffi/ecash_lib_wasm_browser.d.ts +24 -0
- package/dist/ffi/ecash_lib_wasm_browser.js +64 -0
- package/dist/ffi/ecash_lib_wasm_nodejs.d.ts +22 -0
- package/dist/ffi/ecash_lib_wasm_nodejs.js +64 -0
- package/dist/hash.d.ts +6 -16
- package/dist/hash.d.ts.map +1 -1
- package/dist/hash.js +18 -18
- package/dist/hash.js.map +1 -1
- package/dist/hdwallet.d.ts +2 -4
- package/dist/hdwallet.d.ts.map +1 -1
- package/dist/hdwallet.js +6 -7
- package/dist/hdwallet.js.map +1 -1
- package/dist/hmac.js +3 -3
- package/dist/hmac.js.map +1 -1
- package/dist/initBrowser.d.ts +1 -11
- package/dist/initBrowser.d.ts.map +1 -1
- package/dist/initBrowser.js +21 -41
- package/dist/initBrowser.js.map +1 -1
- package/dist/initNodeJs.d.ts +1 -2
- package/dist/initNodeJs.d.ts.map +1 -1
- package/dist/initNodeJs.js +16 -30
- package/dist/initNodeJs.js.map +1 -1
- package/dist/io/bytes.js +2 -2
- package/dist/io/bytes.js.map +1 -1
- package/dist/io/hex.js +5 -4
- package/dist/io/hex.js.map +1 -1
- package/dist/io/str.js +3 -2
- package/dist/io/str.js.map +1 -1
- package/dist/io/varsize.js +3 -2
- package/dist/io/varsize.js.map +1 -1
- package/dist/mnemonic.js +4 -3
- package/dist/mnemonic.js.map +1 -1
- package/dist/op.js +6 -5
- package/dist/op.js.map +1 -1
- package/dist/pbkdf2.js +2 -1
- package/dist/pbkdf2.js.map +1 -1
- package/dist/test/testRunner.d.ts +1 -2
- package/dist/test/testRunner.d.ts.map +1 -1
- package/dist/test/testRunner.js +10 -23
- package/dist/test/testRunner.js.map +1 -1
- package/dist/token/alp.d.ts +1 -1
- package/dist/token/alp.d.ts.map +1 -1
- package/dist/token/alp.js +5 -5
- package/dist/token/alp.js.map +1 -1
- package/dist/token/common.d.ts +4 -4
- package/dist/token/common.d.ts.map +1 -1
- package/dist/token/empp.js +2 -1
- package/dist/token/empp.js.map +1 -1
- package/dist/token/slp.d.ts +1 -1
- package/dist/token/slp.d.ts.map +1 -1
- package/dist/token/slp.js +7 -7
- package/dist/token/slp.js.map +1 -1
- package/dist/tx.js +7 -7
- package/dist/tx.js.map +1 -1
- package/dist/txBuilder.d.ts +5 -1
- package/dist/txBuilder.d.ts.map +1 -1
- package/dist/txBuilder.js +12 -11
- package/dist/txBuilder.js.map +1 -1
- package/package.json +1 -1
- package/src/ecc.ts +47 -59
- package/src/ffi/ecash_lib_wasm_bg_browser.d.ts +1 -0
- package/src/ffi/ecash_lib_wasm_bg_browser.js +1707 -0
- package/src/ffi/ecash_lib_wasm_bg_browser.wasm +0 -0
- package/src/ffi/ecash_lib_wasm_bg_browser.wasm.d.ts +2 -0
- package/src/ffi/ecash_lib_wasm_bg_nodejs.wasm +0 -0
- package/src/ffi/ecash_lib_wasm_bg_nodejs.wasm.d.ts +2 -0
- package/src/ffi/ecash_lib_wasm_browser.d.ts +24 -0
- package/src/ffi/ecash_lib_wasm_browser.js +64 -0
- package/src/ffi/ecash_lib_wasm_nodejs.d.ts +22 -0
- package/src/ffi/ecash_lib_wasm_nodejs.js +64 -0
- package/src/hash.ts +19 -38
- package/src/hdwallet.ts +4 -8
- package/src/initBrowser.ts +18 -25
- package/src/initNodeJs.ts +9 -12
- package/src/test/testRunner.ts +3 -11
- package/src/txBuilder.ts +12 -7
- package/.nyc_output/0fc40ca6-d52c-45eb-b31b-2601ce70b887.json +0 -1
- package/.nyc_output/ac5be6db-4e40-41f8-8b84-7598d4747e57.json +0 -1
- package/.nyc_output/b316d46f-5ea0-4e98-884a-bfbf9cc1d0f8.json +0 -1
- package/.nyc_output/f965566b-9422-4874-b45e-9eefda9c769c.json +0 -1
- package/.nyc_output/processinfo/0fc40ca6-d52c-45eb-b31b-2601ce70b887.json +0 -1
- package/.nyc_output/processinfo/ac5be6db-4e40-41f8-8b84-7598d4747e57.json +0 -1
- package/.nyc_output/processinfo/b316d46f-5ea0-4e98-884a-bfbf9cc1d0f8.json +0 -1
- package/.nyc_output/processinfo/f965566b-9422-4874-b45e-9eefda9c769c.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/dist/address/cashaddr.d.ts +0 -78
- package/dist/address/cashaddr.d.ts.map +0 -1
- package/dist/address/cashaddr.js +0 -543
- package/dist/address/cashaddr.js.map +0 -1
- package/dist/cashaddr/cashaddr.d.ts +0 -23
- package/dist/cashaddr/cashaddr.d.ts.map +0 -1
- package/dist/cashaddr/cashaddr.js +0 -325
- package/dist/cashaddr/cashaddr.js.map +0 -1
- package/test.log +0 -82
package/README.md
CHANGED
|
@@ -18,27 +18,9 @@ This library works for both browser and NodeJS.
|
|
|
18
18
|
|
|
19
19
|
`npm install --save ecash-lib`
|
|
20
20
|
|
|
21
|
-
### Setup
|
|
22
|
-
|
|
23
|
-
To use this library, you first have to initialize the WebAssembly module:
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
import { initWasm } from 'ecash-lib';
|
|
27
|
-
await initWasm();
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
After that, to sign signatures, you need an "Ecc" instance:
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
import { Ecc } from 'ecash-lib';
|
|
34
|
-
const ecc = new Ecc();
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**Note: You should only call this function once, as it's fairly expensive to setup, it internally precomputes some elliptic curve field elements, which takes some time**
|
|
38
|
-
|
|
39
21
|
### Usage
|
|
40
22
|
|
|
41
|
-
|
|
23
|
+
Here's how to sign your first transaction:
|
|
42
24
|
|
|
43
25
|
```ts
|
|
44
26
|
import {
|
|
@@ -47,20 +29,15 @@ import {
|
|
|
47
29
|
Script,
|
|
48
30
|
TxBuilder,
|
|
49
31
|
fromHex,
|
|
50
|
-
initWasm,
|
|
51
32
|
shaRmd160,
|
|
52
33
|
toHex,
|
|
53
34
|
ALL_BIP143,
|
|
54
35
|
} from 'ecash-lib';
|
|
55
36
|
|
|
56
|
-
// Download and compile WebAssembly
|
|
57
|
-
await initWasm();
|
|
58
|
-
// Build a signature context for elliptic curve cryptography (ECC)
|
|
59
|
-
const ecc = new Ecc();
|
|
60
37
|
const walletSk = fromHex(
|
|
61
38
|
'e6ae1669c47d092eff3eb652bea535331c338e29f34be709bc4055655cd0e950',
|
|
62
39
|
);
|
|
63
|
-
const walletPk =
|
|
40
|
+
const walletPk = new Ecc().derivePubkey(walletSk);
|
|
64
41
|
const walletPkh = shaRmd160(walletPk);
|
|
65
42
|
const walletP2pkh = Script.p2pkh(walletPkh);
|
|
66
43
|
// TxId with unspent funds for the above wallet
|
|
@@ -90,24 +67,11 @@ const txBuild = new TxBuilder({
|
|
|
90
67
|
walletP2pkh,
|
|
91
68
|
],
|
|
92
69
|
});
|
|
93
|
-
const tx = txBuild.sign(
|
|
70
|
+
const tx = txBuild.sign({ feePerKb: 1000, dustLimit: 546 });
|
|
94
71
|
const rawTx = tx.ser();
|
|
95
72
|
console.log(toHex(rawTx));
|
|
96
73
|
```
|
|
97
74
|
|
|
98
|
-
### Troubleshooting
|
|
99
|
-
|
|
100
|
-
#### Can't load WebAssembly
|
|
101
|
-
|
|
102
|
-
Some bundlers can't handle WebAssembly yet (at the time of writing, vite).
|
|
103
|
-
If you run into "CompileError: expected magic word 00 61 73 6d", you can
|
|
104
|
-
provide a custom WASM URL or module:
|
|
105
|
-
|
|
106
|
-
```ts
|
|
107
|
-
import ecashLibWasmUrl from 'ecash-lib/dist/ffi/ecash_lib_wasm_bg_browser.wasm?url';
|
|
108
|
-
await initWasm(ecashLibWasmUrl);
|
|
109
|
-
```
|
|
110
|
-
|
|
111
75
|
## Changelog
|
|
112
76
|
|
|
113
77
|
- 0.1.1 - Validation that feePerKb is an integer
|
|
@@ -125,4 +89,5 @@ await initWasm(ecashLibWasmUrl);
|
|
|
125
89
|
- 1.4.1 - Patch import in `mnemonic.ts` [D17621](https://reviews.bitcoinabc.org/D17621)
|
|
126
90
|
- 1.5.0 - Support custom WASM URL and module [D17622](https://reviews.bitcoinabc.org/D17622)
|
|
127
91
|
- 1.5.1 - `Address.withPrefix()` returns same prefix if unchanged (instead of throwing an error) [D17623](https://reviews.bitcoinabc.org/D17623)
|
|
128
|
-
-
|
|
92
|
+
- 2.0.0 - Remove `initWasm`, auto-load the WebAssembly instead. Remove unneeded `ecc` parameters, esp. in `TxBuilder.sign` and `HdNode.fromSeed` [D17639](https://reviews.bitcoinabc.org/D17639) [D17640](https://reviews.bitcoinabc.org/D17640)
|
|
93
|
+
- 2.1.0 - Add `signRecoverable` and `recoverSig` to `Ecc` [D17667](https://reviews.bitcoinabc.org/D17667)
|
|
@@ -26,6 +26,6 @@ export declare const decodeLegacyAddress: (address: string) => DecodedLegacyAddr
|
|
|
26
26
|
* Encode a legacy address given type and hash
|
|
27
27
|
* For now, this is a stub method that supports only BTC p2pkh and p2sh
|
|
28
28
|
*/
|
|
29
|
-
export declare const encodeLegacyAddress: (hash: Uint8Array, type:
|
|
29
|
+
export declare const encodeLegacyAddress: (hash: Uint8Array, type: 'p2pkh' | 'p2sh', network?: NetworkType) => string;
|
|
30
30
|
export {};
|
|
31
31
|
//# sourceMappingURL=legacyaddr.d.ts.map
|
package/dist/ecc.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ export interface Ecc {
|
|
|
15
15
|
seckeyAdd(a: Uint8Array, b: Uint8Array): Uint8Array;
|
|
16
16
|
/** Add a scalar to a public key (adding G*b) */
|
|
17
17
|
pubkeyAdd(a: Uint8Array, b: Uint8Array): Uint8Array;
|
|
18
|
+
/** Sign a ECDSA recoverable signature, includes the recovery ID */
|
|
19
|
+
signRecoverable(seckey: Uint8Array, msg: Uint8Array): Uint8Array;
|
|
20
|
+
/** Recover the public key of an ECDSA signed signature (with recovery ID) */
|
|
21
|
+
recoverSig(sig: Uint8Array, msg: Uint8Array): Uint8Array;
|
|
18
22
|
}
|
|
19
23
|
/** Dummy Ecc impl that always returns 0, useful for measuring tx size */
|
|
20
24
|
export declare class EccDummy implements Ecc {
|
|
@@ -24,30 +28,10 @@ export declare class EccDummy implements Ecc {
|
|
|
24
28
|
isValidSeckey(_seckey: Uint8Array): boolean;
|
|
25
29
|
seckeyAdd(_a: Uint8Array, _b: Uint8Array): Uint8Array;
|
|
26
30
|
pubkeyAdd(_a: Uint8Array, _b: Uint8Array): Uint8Array;
|
|
31
|
+
signRecoverable(_seckey: Uint8Array, _msg: Uint8Array): Uint8Array;
|
|
32
|
+
recoverSig(_sig: Uint8Array, _msg: Uint8Array): Uint8Array;
|
|
33
|
+
}
|
|
34
|
+
export declare function __setEcc(ecc: Ecc): void;
|
|
35
|
+
export declare class Ecc implements Ecc {
|
|
27
36
|
}
|
|
28
|
-
/**
|
|
29
|
-
* We define Ecc as a proxy
|
|
30
|
-
* This is done to solve a specific problem
|
|
31
|
-
* If we have this kind of app structure:
|
|
32
|
-
* - AppOne has ecash-lib as a dependency
|
|
33
|
-
* - AppTwo has ecash-lib as a dependency
|
|
34
|
-
* - AppOne has AppTwo as a dependency
|
|
35
|
-
*
|
|
36
|
-
* So, we expect AppOne to use AppTwo methods that need initWasm()
|
|
37
|
-
* However, if we initWasm() in AppOne, these methods are not available in AppTwo
|
|
38
|
-
*
|
|
39
|
-
* We can get them into the globalThis with initWasm, but we still need Ecc to dynamically
|
|
40
|
-
* check the globalThis and realize it is there --- to preserve lib syntax
|
|
41
|
-
*
|
|
42
|
-
* In this way, users can still call "new Ecc()"
|
|
43
|
-
*
|
|
44
|
-
* With just globalThis, users must call "new (globalThis as unknown as GlobalThis).ecashlib.Ecc()"
|
|
45
|
-
*
|
|
46
|
-
* Note that we "redefine" EccUninitialized in the implementation, because we do not want
|
|
47
|
-
* console.log(Ecc) to give "EccUnitialized" even when it works; "EccProxy" is more accurate
|
|
48
|
-
*/
|
|
49
|
-
export declare const Ecc: new () => Ecc;
|
|
50
|
-
export declare function __setEcc(ecc: {
|
|
51
|
-
new (): Ecc;
|
|
52
|
-
}): void;
|
|
53
37
|
//# sourceMappingURL=ecc.d.ts.map
|
package/dist/ecc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecc.d.ts","sourceRoot":"","sources":["../src/ecc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ecc.d.ts","sourceRoot":"","sources":["../src/ecc.ts"],"names":[],"mappings":"AAIA,6DAA6D;AAC7D,MAAM,WAAW,GAAG;IAChB,2CAA2C;IAC3C,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;IAE7C,8DAA8D;IAC9D,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC;IAE3D,+DAA+D;IAC/D,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC;IAE7D;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IAE3C,mCAAmC;IACnC,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAEpD,gDAAgD;IAChD,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAEpD,mEAAmE;IACnE,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC;IAEjE,6EAA6E;IAC7E,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC;CAC5D;AAED,yEAAyE;AACzE,qBAAa,QAAS,YAAW,GAAG;IAChC,YAAY,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU;IAI7C,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU;IAI5D,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU;IAI9D,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO;IAI3C,SAAS,CAAC,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,GAAG,UAAU;IAIrD,SAAS,CAAC,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,GAAG,UAAU;IAIrD,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU;IAIlE,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU;CAG7D;AAID,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,QAEhC;AAED,qBAAa,GAAI,YAAW,GAAG;CAyC9B"}
|
package/dist/ecc.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
// Distributed under the MIT software license, see the accompanying
|
|
4
4
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Ecc = exports.EccDummy = void 0;
|
|
7
|
-
exports.__setEcc = __setEcc;
|
|
6
|
+
exports.Ecc = exports.__setEcc = exports.EccDummy = void 0;
|
|
8
7
|
/** Dummy Ecc impl that always returns 0, useful for measuring tx size */
|
|
9
8
|
class EccDummy {
|
|
10
9
|
derivePubkey(_seckey) {
|
|
@@ -25,68 +24,53 @@ class EccDummy {
|
|
|
25
24
|
pubkeyAdd(_a, _b) {
|
|
26
25
|
return new Uint8Array(32);
|
|
27
26
|
}
|
|
27
|
+
signRecoverable(_seckey, _msg) {
|
|
28
|
+
return new Uint8Array(65);
|
|
29
|
+
}
|
|
30
|
+
recoverSig(_sig, _msg) {
|
|
31
|
+
return new Uint8Array(33);
|
|
32
|
+
}
|
|
28
33
|
}
|
|
29
34
|
exports.EccDummy = EccDummy;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
const ECC = {};
|
|
36
|
+
function __setEcc(ecc) {
|
|
37
|
+
ECC.ecc = ecc;
|
|
38
|
+
}
|
|
39
|
+
exports.__setEcc = __setEcc;
|
|
40
|
+
class Ecc {
|
|
41
|
+
/** Derive a public key from secret key. */
|
|
42
|
+
derivePubkey(seckey) {
|
|
43
|
+
return ECC.ecc.derivePubkey(seckey);
|
|
36
44
|
}
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
/** Sign an ECDSA signature. msg needs to be a 32-byte hash */
|
|
46
|
+
ecdsaSign(seckey, msg) {
|
|
47
|
+
return ECC.ecc.ecdsaSign(seckey, msg);
|
|
39
48
|
}
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
/** Sign a Schnorr signature. msg needs to be a 32-byte hash */
|
|
50
|
+
schnorrSign(seckey, msg) {
|
|
51
|
+
return ECC.ecc.schnorrSign(seckey, msg);
|
|
42
52
|
}
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Return whether the given secret key is valid, i.e. whether is of correct
|
|
55
|
+
* length (32 bytes) and is on the curve.
|
|
56
|
+
*/
|
|
57
|
+
isValidSeckey(seckey) {
|
|
58
|
+
return ECC.ecc.isValidSeckey(seckey);
|
|
45
59
|
}
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
/** Add a scalar to a secret key */
|
|
61
|
+
seckeyAdd(a, b) {
|
|
62
|
+
return ECC.ecc.seckeyAdd(a, b);
|
|
48
63
|
}
|
|
49
|
-
|
|
50
|
-
|
|
64
|
+
/** Add a scalar to a public key (adding G*b) */
|
|
65
|
+
pubkeyAdd(a, b) {
|
|
66
|
+
return ECC.ecc.pubkeyAdd(a, b);
|
|
51
67
|
}
|
|
52
|
-
|
|
53
|
-
|
|
68
|
+
signRecoverable(seckey, msg) {
|
|
69
|
+
return ECC.ecc.signRecoverable(seckey, msg);
|
|
70
|
+
}
|
|
71
|
+
recoverSig(sig, msg) {
|
|
72
|
+
return ECC.ecc.recoverSig(sig, msg);
|
|
54
73
|
}
|
|
55
74
|
}
|
|
56
|
-
|
|
57
|
-
* We define Ecc as a proxy
|
|
58
|
-
* This is done to solve a specific problem
|
|
59
|
-
* If we have this kind of app structure:
|
|
60
|
-
* - AppOne has ecash-lib as a dependency
|
|
61
|
-
* - AppTwo has ecash-lib as a dependency
|
|
62
|
-
* - AppOne has AppTwo as a dependency
|
|
63
|
-
*
|
|
64
|
-
* So, we expect AppOne to use AppTwo methods that need initWasm()
|
|
65
|
-
* However, if we initWasm() in AppOne, these methods are not available in AppTwo
|
|
66
|
-
*
|
|
67
|
-
* We can get them into the globalThis with initWasm, but we still need Ecc to dynamically
|
|
68
|
-
* check the globalThis and realize it is there --- to preserve lib syntax
|
|
69
|
-
*
|
|
70
|
-
* In this way, users can still call "new Ecc()"
|
|
71
|
-
*
|
|
72
|
-
* With just globalThis, users must call "new (globalThis as unknown as GlobalThis).ecashlib.Ecc()"
|
|
73
|
-
*
|
|
74
|
-
* Note that we "redefine" EccUninitialized in the implementation, because we do not want
|
|
75
|
-
* console.log(Ecc) to give "EccUnitialized" even when it works; "EccProxy" is more accurate
|
|
76
|
-
*/
|
|
77
|
-
exports.Ecc = function () {
|
|
78
|
-
const currentEcc = 'ecashlib' in globalThis &&
|
|
79
|
-
'Ecc' in globalThis.ecashlib
|
|
80
|
-
? globalThis.ecashlib.Ecc
|
|
81
|
-
: EccUninitialized;
|
|
82
|
-
return new currentEcc();
|
|
83
|
-
};
|
|
84
|
-
function __setEcc(ecc) {
|
|
85
|
-
Object.assign(globalThis, {
|
|
86
|
-
ecashlib: {
|
|
87
|
-
...(globalThis.ecashlib || {}),
|
|
88
|
-
Ecc: ecc,
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
}
|
|
75
|
+
exports.Ecc = Ecc;
|
|
92
76
|
//# sourceMappingURL=ecc.js.map
|
package/dist/ecc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecc.js","sourceRoot":"","sources":["../src/ecc.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,mEAAmE;AACnE,sEAAsE;;;
|
|
1
|
+
{"version":3,"file":"ecc.js","sourceRoot":"","sources":["../src/ecc.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,mEAAmE;AACnE,sEAAsE;;;AAgCtE,yEAAyE;AACzE,MAAa,QAAQ;IACjB,YAAY,CAAC,OAAmB;QAC5B,OAAO,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,SAAS,CAAC,OAAmB,EAAE,IAAgB;QAC3C,OAAO,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,WAAW,CAAC,OAAmB,EAAE,IAAgB;QAC7C,OAAO,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,aAAa,CAAC,OAAmB;QAC7B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,SAAS,CAAC,EAAc,EAAE,EAAc;QACpC,OAAO,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,SAAS,CAAC,EAAc,EAAE,EAAc;QACpC,OAAO,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IA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