ecash-lib 1.2.1-rc → 1.2.2-rc
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 +1 -0
- package/dist/ecc.d.ts.map +1 -1
- package/dist/ecc.js +1 -0
- package/dist/ecc.js.map +1 -1
- package/dist/hash.d.ts +1 -6
- package/dist/hash.d.ts.map +1 -1
- package/dist/hash.js +4 -3
- package/dist/hash.js.map +1 -1
- package/global.d.ts +21 -0
- package/package.json +4 -4
- package/tsconfig.json +1 -1
package/README.md
CHANGED
|
@@ -107,3 +107,4 @@ console.log(toHex(rawTx));
|
|
|
107
107
|
- 1.1.0 - Add support for the original pre-UAHF Bitcoin signatures, so we can sign transactions for other blockchains like BTC/DOGE/... [D17255](https://reviews.bitcoinabc.org/D17255)
|
|
108
108
|
- 1.2.0 - Add `Address` class for cashaddr and legacy addresses. [D17269](https://reviews.bitcoinabc.org/D17269)
|
|
109
109
|
- 1.2.1 - Patch type check causing txBuilder txs using change to fail in NodeJS environments [D17461](https://reviews.bitcoinabc.org/D17461)
|
|
110
|
+
- 1.2.2 - Attach `Ecc` and `HASHES` to `globalThis` instead of dependency injection, so that they can work when `ecash-lib` is a dependency of another lib [D17464](https://reviews.bitcoinabc.org/D17464)
|
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,2CA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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecc.js","sourceRoot":"","sources":["../src/ecc.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,mEAAmE;AACnE,sEAAsE;;;AAiBtE,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;AAED,SAAgB,QAAQ,CAAC,GAAoB;IACzC,WAAG,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"ecc.js","sourceRoot":"","sources":["../src/ecc.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,mEAAmE;AACnE,sEAAsE;;;AAiBtE,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;AAED,SAAgB,QAAQ,CAAC,GAAoB;IACzC,WAAG,GAAG,GAAG,CAAC;IAEV,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAEjD,CAAC,CAAC;AACP,CAAC;AAND,4BAMC"}
|
package/dist/hash.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
sha256: (data: Uint8Array) => Uint8Array;
|
|
3
|
-
sha256d: (data: Uint8Array) => Uint8Array;
|
|
4
|
-
shaRmd160: (data: Uint8Array) => Uint8Array;
|
|
5
|
-
}
|
|
1
|
+
import type { EcashLibHashes } from '../global';
|
|
6
2
|
export declare function sha256(data: Uint8Array): Uint8Array;
|
|
7
3
|
export declare function sha256d(data: Uint8Array): Uint8Array;
|
|
8
4
|
export declare function shaRmd160(data: Uint8Array): Uint8Array;
|
|
9
5
|
export declare function __setHashes(hashes: EcashLibHashes): void;
|
|
10
|
-
export {};
|
|
11
6
|
//# sourceMappingURL=hash.d.ts.map
|
package/dist/hash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAMnD;AACD,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAMpD;AACD,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAMtD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,QAMjD"}
|
package/dist/hash.js
CHANGED
|
@@ -6,19 +6,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.__setHashes = exports.shaRmd160 = exports.sha256d = exports.sha256 = void 0;
|
|
7
7
|
let HASHES;
|
|
8
8
|
function sha256(data) {
|
|
9
|
-
return HASHES.sha256(data);
|
|
9
|
+
return globalThis.ecashlib.HASHES.sha256(data);
|
|
10
10
|
}
|
|
11
11
|
exports.sha256 = sha256;
|
|
12
12
|
function sha256d(data) {
|
|
13
|
-
return HASHES.sha256d(data);
|
|
13
|
+
return globalThis.ecashlib.HASHES.sha256d(data);
|
|
14
14
|
}
|
|
15
15
|
exports.sha256d = sha256d;
|
|
16
16
|
function shaRmd160(data) {
|
|
17
|
-
return HASHES.shaRmd160(data);
|
|
17
|
+
return globalThis.ecashlib.HASHES.shaRmd160(data);
|
|
18
18
|
}
|
|
19
19
|
exports.shaRmd160 = shaRmd160;
|
|
20
20
|
function __setHashes(hashes) {
|
|
21
21
|
HASHES = hashes;
|
|
22
|
+
Object.assign(globalThis, { ecashlib: { HASHES: hashes } });
|
|
22
23
|
}
|
|
23
24
|
exports.__setHashes = __setHashes;
|
|
24
25
|
//# sourceMappingURL=hash.js.map
|
package/dist/hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,mEAAmE;AACnE,sEAAsE;;;
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,mEAAmE;AACnE,sEAAsE;;;AAItE,IAAI,MAAsB,CAAC;AAE3B,SAAgB,MAAM,CAAC,IAAgB;IACnC,OACI,UAGH,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAND,wBAMC;AACD,SAAgB,OAAO,CAAC,IAAgB;IACpC,OACI,UAGH,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAND,0BAMC;AACD,SAAgB,SAAS,CAAC,IAAgB;IACtC,OACI,UAGH,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC;AAND,8BAMC;AAED,SAAgB,WAAW,CAAC,MAAsB;IAC9C,MAAM,GAAG,MAAM,CAAC;IAEhB,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAEvD,CAAC,CAAC;AACP,CAAC;AAND,kCAMC"}
|
package/global.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) 2024 The Bitcoin developers
|
|
2
|
+
// Distributed under the MIT software license, see the accompanying
|
|
3
|
+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
4
|
+
|
|
5
|
+
import { Ecc } from './src/ecc';
|
|
6
|
+
|
|
7
|
+
export interface EcashLibHashes {
|
|
8
|
+
sha256: (data: Uint8Array) => Uint8Array;
|
|
9
|
+
sha256d: (data: Uint8Array) => Uint8Array;
|
|
10
|
+
shaRmd160: (data: Uint8Array) => Uint8Array;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Extend global this to include hashes
|
|
14
|
+
declare global {
|
|
15
|
+
interface GlobalThis {
|
|
16
|
+
ecashlib: {
|
|
17
|
+
HASHES: EcashLibHashes;
|
|
18
|
+
Ecc: { new (): Ecc };
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ecash-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2-rc",
|
|
4
4
|
"description": "Library for eCash transaction building",
|
|
5
5
|
"main": "./dist/indexNodeJs.js",
|
|
6
6
|
"browser": "./dist/indexBrowser.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/mocha": "^10.0.6",
|
|
34
34
|
"@types/node": "^20.12.7",
|
|
35
35
|
"chai": "^5.1.0",
|
|
36
|
-
"chronik-client": "
|
|
36
|
+
"chronik-client": "^2.1.1",
|
|
37
37
|
"eslint-plugin-header": "^3.1.1",
|
|
38
38
|
"mocha": "^10.4.0",
|
|
39
39
|
"mocha-junit-reporter": "^2.2.1",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typescript-eslint": "^7.6.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"b58-ts": "
|
|
50
|
-
"ecashaddrjs": "
|
|
49
|
+
"b58-ts": "^0.1.0",
|
|
50
|
+
"ecashaddrjs": "^2.0.0"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/tsconfig.json
CHANGED