ecash-lib 1.2.2-rc11 → 1.2.2-rc13
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/dist/ecc.d.ts +4 -9
- package/dist/ecc.d.ts.map +1 -1
- package/dist/ecc.js +5 -21
- package/dist/ecc.js.map +1 -1
- package/package.json +1 -1
package/dist/ecc.d.ts
CHANGED
|
@@ -7,22 +7,17 @@ export interface Ecc {
|
|
|
7
7
|
/** Sign a Schnorr signature. msg needs to be a 32-byte hash */
|
|
8
8
|
schnorrSign(seckey: Uint8Array, msg: Uint8Array): Uint8Array;
|
|
9
9
|
}
|
|
10
|
-
/** Ecc implementation using WebAssembly */
|
|
11
|
-
declare class EccUninitialized implements Ecc {
|
|
12
|
-
constructor();
|
|
13
|
-
derivePubkey(_seckey: Uint8Array): Uint8Array;
|
|
14
|
-
ecdsaSign(_seckey: Uint8Array, _msg: Uint8Array): Uint8Array;
|
|
15
|
-
schnorrSign(_seckey: Uint8Array, _msg: Uint8Array): Uint8Array;
|
|
16
|
-
}
|
|
17
10
|
/** Dummy Ecc impl that always returns 0, useful for measuring tx size */
|
|
18
11
|
export declare class EccDummy implements Ecc {
|
|
19
12
|
derivePubkey(_seckey: Uint8Array): Uint8Array;
|
|
20
13
|
ecdsaSign(_seckey: Uint8Array, _msg: Uint8Array): Uint8Array;
|
|
21
14
|
schnorrSign(_seckey: Uint8Array, _msg: Uint8Array): Uint8Array;
|
|
22
15
|
}
|
|
23
|
-
|
|
16
|
+
/** Ecc implementation using WebAssembly */
|
|
17
|
+
export declare let Ecc: {
|
|
18
|
+
new (): Ecc;
|
|
19
|
+
};
|
|
24
20
|
export declare function __setEcc(ecc: {
|
|
25
21
|
new (): Ecc;
|
|
26
22
|
}): void;
|
|
27
|
-
export {};
|
|
28
23
|
//# 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":"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;CAChE;AAED,
|
|
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;CAChE;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;CAGjE;AAED,2CAA2C;AAC3C,eAAO,IAAI,GAAG,EAAE;IAAE,QAAQ,GAAG,CAAA;CAAE,CAAC;AAEhC,wBAAgB,QAAQ,CAAC,GAAG,EAAE;IAAE,QAAQ,GAAG,CAAA;CAAE,QAe5C"}
|
package/dist/ecc.js
CHANGED
|
@@ -4,23 +4,6 @@
|
|
|
4
4
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.__setEcc = exports.Ecc = exports.EccDummy = void 0;
|
|
7
|
-
/** Ecc implementation using WebAssembly */
|
|
8
|
-
class EccUninitialized {
|
|
9
|
-
constructor() {
|
|
10
|
-
if (!exports.Ecc.prototype.derivePubkey) {
|
|
11
|
-
throw new Error('Ecc not initialized. Call initWasm first.');
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
derivePubkey(_seckey) {
|
|
15
|
-
throw new Error('Ecc not initialized. Call initWasm first.');
|
|
16
|
-
}
|
|
17
|
-
ecdsaSign(_seckey, _msg) {
|
|
18
|
-
throw new Error('Ecc not initialized. Call initWasm first.');
|
|
19
|
-
}
|
|
20
|
-
schnorrSign(_seckey, _msg) {
|
|
21
|
-
throw new Error('Ecc not initialized. Call initWasm first.');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
7
|
/** Dummy Ecc impl that always returns 0, useful for measuring tx size */
|
|
25
8
|
class EccDummy {
|
|
26
9
|
derivePubkey(_seckey) {
|
|
@@ -34,19 +17,20 @@ class EccDummy {
|
|
|
34
17
|
}
|
|
35
18
|
}
|
|
36
19
|
exports.EccDummy = EccDummy;
|
|
37
|
-
// Ecc is EccUninitialized if not available in globalThis
|
|
38
|
-
exports.Ecc = (() => {
|
|
39
|
-
return EccUninitialized;
|
|
40
|
-
})();
|
|
41
20
|
function __setEcc(ecc) {
|
|
21
|
+
console.log(`globalThis before injection`, globalThis);
|
|
42
22
|
Object.assign(globalThis, {
|
|
43
23
|
ecashlib: {
|
|
44
24
|
...(globalThis.ecashlib || {}),
|
|
45
25
|
Ecc: ecc,
|
|
46
26
|
},
|
|
47
27
|
});
|
|
28
|
+
console.log(`globalThis after injection`, globalThis);
|
|
48
29
|
// Update Ecc now that we know it is available in globalThis
|
|
30
|
+
console.log(`updating Ecc`);
|
|
31
|
+
console.log(`Ecc before update`, exports.Ecc);
|
|
49
32
|
exports.Ecc = globalThis.ecashlib.Ecc;
|
|
33
|
+
console.log(`Ecc after update`, exports.Ecc);
|
|
50
34
|
}
|
|
51
35
|
exports.__setEcc = __setEcc;
|
|
52
36
|
//# 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;;;AActE,
|
|
1
|
+
{"version":3,"file":"ecc.js","sourceRoot":"","sources":["../src/ecc.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,mEAAmE;AACnE,sEAAsE;;;AActE,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;CACJ;AAZD,4BAYC;AAKD,SAAgB,QAAQ,CAAC,GAAoB;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,UAAU,CAAC,CAAC;IACvD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;QACtB,QAAQ,EAAE;YACN,GAAG,CAAE,UAAkC,CAAC,QAAQ,IAAI,EAAE,CAAC;YACvD,GAAG,EAAE,GAAG;SACX;KAC0B,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,UAAU,CAAC,CAAC;IAEtD,4DAA4D;IAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,WAAG,CAAC,CAAC;IACtC,WAAG,GAAI,UAAoC,CAAC,QAAQ,CAAC,GAAG,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,WAAG,CAAC,CAAC;AACzC,CAAC;AAfD,4BAeC"}
|