@ckb-ccc/utxo-global 1.0.32 → 1.0.33
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/CHANGELOG.md +16 -0
- package/dist/btc/index.d.ts +16 -0
- package/dist/btc/index.d.ts.map +1 -1
- package/dist/btc/index.js +20 -0
- package/dist.commonjs/btc/index.d.ts +16 -0
- package/dist.commonjs/btc/index.d.ts.map +1 -1
- package/dist.commonjs/btc/index.js +20 -0
- package/package.json +2 -2
- package/src/btc/index.ts +28 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ckb-ccc/utxo-global
|
|
2
2
|
|
|
3
|
+
## 1.0.33
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#346](https://github.com/ckb-devrel/ccc/pull/346) [`a803d5f`](https://github.com/ckb-devrel/ccc/commit/a803d5fba8d0e082c6aba14db156856025402e72) Thanks [@fghdotio](https://github.com/fghdotio)! - feat(core): add BTC PSBT signing support
|
|
9
|
+
|
|
10
|
+
- Add `SignerBtc.signPsbt()`, `signAndBroadcastPsbt()`, and `broadcastPsbt()` for signing and broadcasting PSBTs
|
|
11
|
+
- Add `SignPsbtOptions` and `InputToSign` for configuring PSBT signing
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- [#379](https://github.com/ckb-devrel/ccc/pull/379) [`f01a05b`](https://github.com/ckb-devrel/ccc/commit/f01a05bab332d9f4e0cf7f84aecfd688f8e9f346) Thanks [@Hanssen0](https://github.com/Hanssen0)! - chore: bump pnpm to v11.8.0
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`1148a5c`](https://github.com/ckb-devrel/ccc/commit/1148a5c403cde985fb4ba713ccfa0c163d287174), [`bf0f8d8`](https://github.com/ckb-devrel/ccc/commit/bf0f8d8ca011e627821445a10bc38519510e5b9d), [`a803d5f`](https://github.com/ckb-devrel/ccc/commit/a803d5fba8d0e082c6aba14db156856025402e72), [`bf0f8d8`](https://github.com/ckb-devrel/ccc/commit/bf0f8d8ca011e627821445a10bc38519510e5b9d), [`6727ffe`](https://github.com/ckb-devrel/ccc/commit/6727ffe05f60e6bfb2060a565c19acb0fd0f375e), [`f01a05b`](https://github.com/ckb-devrel/ccc/commit/f01a05bab332d9f4e0cf7f84aecfd688f8e9f346), [`a526890`](https://github.com/ckb-devrel/ccc/commit/a5268909ea9d61c4e2f5187a43e2318327b27cae), [`4bb3d9d`](https://github.com/ckb-devrel/ccc/commit/4bb3d9d2ef36b3ee8820036625abd9befb1980c4), [`9f7ecb6`](https://github.com/ckb-devrel/ccc/commit/9f7ecb6ab8db9c6866dad029f2888e1e5cfcbe7d)]:
|
|
17
|
+
- @ckb-ccc/core@1.13.0
|
|
18
|
+
|
|
3
19
|
## 1.0.32
|
|
4
20
|
### Patch Changes
|
|
5
21
|
|
package/dist/btc/index.d.ts
CHANGED
|
@@ -19,5 +19,21 @@ export declare class SignerBtc extends ccc.SignerBtc {
|
|
|
19
19
|
connect(): Promise<void>;
|
|
20
20
|
isConnected(): Promise<boolean>;
|
|
21
21
|
signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Signs a PSBT using UTXO Global wallet.
|
|
24
|
+
*
|
|
25
|
+
* @param psbtHex - The hex string of PSBT to sign.
|
|
26
|
+
* @param options - Options for signing the PSBT
|
|
27
|
+
* @returns A promise that resolves to the signed PSBT as a Hex string
|
|
28
|
+
*/
|
|
29
|
+
signPsbt(_psbtHex: ccc.HexLike, _options?: ccc.SignPsbtOptionsLike): Promise<ccc.Hex>;
|
|
30
|
+
/**
|
|
31
|
+
* Broadcasts a signed PSBT to the Bitcoin network.
|
|
32
|
+
*
|
|
33
|
+
* @param psbtHex - The hex string of signed PSBT to broadcast.
|
|
34
|
+
* @returns A promise that resolves to the transaction ID as a Hex string
|
|
35
|
+
* @todo Implement PSBT broadcasting with UTXO Global
|
|
36
|
+
*/
|
|
37
|
+
broadcastPsbt(_psbtHex: ccc.HexLike, _options?: ccc.SignPsbtOptionsLike): Promise<ccc.Hex>;
|
|
22
38
|
}
|
|
23
39
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/btc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;GAEG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;aAKxB,QAAQ,EAAE,QAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IALpC,OAAO,CAAC,YAAY,CAAqB;gBAGvC,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ,EACjB,iBAAiB,GAAE,GAAG,CAAC,iBAAiB,EAWxD;IAKG,aAAa;IAMb,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAYzC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB9B,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmBxD,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAiBtC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ/B,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;GAEG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;aAKxB,QAAQ,EAAE,QAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IALpC,OAAO,CAAC,YAAY,CAAqB;gBAGvC,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ,EACjB,iBAAiB,GAAE,GAAG,CAAC,iBAAiB,EAWxD;IAKG,aAAa;IAMb,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAYzC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB9B,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmBxD,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAiBtC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ/B,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAStE;;;;;;OAMG;IACG,QAAQ,CACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,EACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,mBAAmB,GACjC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAInB;;;;;;OAMG;IACG,aAAa,CACjB,QAAQ,EAAE,GAAG,CAAC,OAAO,EACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,mBAAmB,GACjC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;CAGpB"}
|
package/dist/btc/index.js
CHANGED
|
@@ -94,4 +94,24 @@ export class SignerBtc extends ccc.SignerBtc {
|
|
|
94
94
|
const challenge = typeof message === "string" ? message : ccc.hexFrom(message).slice(2);
|
|
95
95
|
return this.provider.signMessage(challenge, this.accountCache ?? (await this.getBtcAccount()));
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Signs a PSBT using UTXO Global wallet.
|
|
99
|
+
*
|
|
100
|
+
* @param psbtHex - The hex string of PSBT to sign.
|
|
101
|
+
* @param options - Options for signing the PSBT
|
|
102
|
+
* @returns A promise that resolves to the signed PSBT as a Hex string
|
|
103
|
+
*/
|
|
104
|
+
async signPsbt(_psbtHex, _options) {
|
|
105
|
+
throw new Error("UTXO Global PSBT signing not implemented yet");
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Broadcasts a signed PSBT to the Bitcoin network.
|
|
109
|
+
*
|
|
110
|
+
* @param psbtHex - The hex string of signed PSBT to broadcast.
|
|
111
|
+
* @returns A promise that resolves to the transaction ID as a Hex string
|
|
112
|
+
* @todo Implement PSBT broadcasting with UTXO Global
|
|
113
|
+
*/
|
|
114
|
+
async broadcastPsbt(_psbtHex, _options) {
|
|
115
|
+
throw new Error("UTXO Global PSBT broadcasting not implemented yet");
|
|
116
|
+
}
|
|
97
117
|
}
|
|
@@ -19,5 +19,21 @@ export declare class SignerBtc extends ccc.SignerBtc {
|
|
|
19
19
|
connect(): Promise<void>;
|
|
20
20
|
isConnected(): Promise<boolean>;
|
|
21
21
|
signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Signs a PSBT using UTXO Global wallet.
|
|
24
|
+
*
|
|
25
|
+
* @param psbtHex - The hex string of PSBT to sign.
|
|
26
|
+
* @param options - Options for signing the PSBT
|
|
27
|
+
* @returns A promise that resolves to the signed PSBT as a Hex string
|
|
28
|
+
*/
|
|
29
|
+
signPsbt(_psbtHex: ccc.HexLike, _options?: ccc.SignPsbtOptionsLike): Promise<ccc.Hex>;
|
|
30
|
+
/**
|
|
31
|
+
* Broadcasts a signed PSBT to the Bitcoin network.
|
|
32
|
+
*
|
|
33
|
+
* @param psbtHex - The hex string of signed PSBT to broadcast.
|
|
34
|
+
* @returns A promise that resolves to the transaction ID as a Hex string
|
|
35
|
+
* @todo Implement PSBT broadcasting with UTXO Global
|
|
36
|
+
*/
|
|
37
|
+
broadcastPsbt(_psbtHex: ccc.HexLike, _options?: ccc.SignPsbtOptionsLike): Promise<ccc.Hex>;
|
|
22
38
|
}
|
|
23
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;GAEG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;aAKxB,QAAQ,EAAE,QAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IALpC,OAAO,CAAC,YAAY,CAAqB;gBAGvC,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ,EACjB,iBAAiB,GAAE,GAAG,CAAC,iBAAiB,EAWxD;IAKG,aAAa;IAMb,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAYzC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB9B,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmBxD,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAiBtC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ/B,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;GAEG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;aAKxB,QAAQ,EAAE,QAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IALpC,OAAO,CAAC,YAAY,CAAqB;gBAGvC,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ,EACjB,iBAAiB,GAAE,GAAG,CAAC,iBAAiB,EAWxD;IAKG,aAAa;IAMb,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAYzC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB9B,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmBxD,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAiBtC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ/B,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAStE;;;;;;OAMG;IACG,QAAQ,CACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,EACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,mBAAmB,GACjC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAInB;;;;;;OAMG;IACG,aAAa,CACjB,QAAQ,EAAE,GAAG,CAAC,OAAO,EACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,mBAAmB,GACjC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;CAGpB"}
|
|
@@ -97,5 +97,25 @@ class SignerBtc extends core_1.ccc.SignerBtc {
|
|
|
97
97
|
const challenge = typeof message === "string" ? message : core_1.ccc.hexFrom(message).slice(2);
|
|
98
98
|
return this.provider.signMessage(challenge, this.accountCache ?? (await this.getBtcAccount()));
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Signs a PSBT using UTXO Global wallet.
|
|
102
|
+
*
|
|
103
|
+
* @param psbtHex - The hex string of PSBT to sign.
|
|
104
|
+
* @param options - Options for signing the PSBT
|
|
105
|
+
* @returns A promise that resolves to the signed PSBT as a Hex string
|
|
106
|
+
*/
|
|
107
|
+
async signPsbt(_psbtHex, _options) {
|
|
108
|
+
throw new Error("UTXO Global PSBT signing not implemented yet");
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Broadcasts a signed PSBT to the Bitcoin network.
|
|
112
|
+
*
|
|
113
|
+
* @param psbtHex - The hex string of signed PSBT to broadcast.
|
|
114
|
+
* @returns A promise that resolves to the transaction ID as a Hex string
|
|
115
|
+
* @todo Implement PSBT broadcasting with UTXO Global
|
|
116
|
+
*/
|
|
117
|
+
async broadcastPsbt(_psbtHex, _options) {
|
|
118
|
+
throw new Error("UTXO Global PSBT broadcasting not implemented yet");
|
|
119
|
+
}
|
|
100
120
|
}
|
|
101
121
|
exports.SignerBtc = SignerBtc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/utxo-global",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"description": "Common Chains Connector's support for UTXO Global",
|
|
5
5
|
"author": "Trong Dinh <trong@nexm.io>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@ckb-ccc/core": "1.
|
|
54
|
+
"@ckb-ccc/core": "1.13.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .",
|
package/src/btc/index.ts
CHANGED
|
@@ -127,4 +127,32 @@ export class SignerBtc extends ccc.SignerBtc {
|
|
|
127
127
|
this.accountCache ?? (await this.getBtcAccount()),
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Signs a PSBT using UTXO Global wallet.
|
|
133
|
+
*
|
|
134
|
+
* @param psbtHex - The hex string of PSBT to sign.
|
|
135
|
+
* @param options - Options for signing the PSBT
|
|
136
|
+
* @returns A promise that resolves to the signed PSBT as a Hex string
|
|
137
|
+
*/
|
|
138
|
+
async signPsbt(
|
|
139
|
+
_psbtHex: ccc.HexLike,
|
|
140
|
+
_options?: ccc.SignPsbtOptionsLike,
|
|
141
|
+
): Promise<ccc.Hex> {
|
|
142
|
+
throw new Error("UTXO Global PSBT signing not implemented yet");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Broadcasts a signed PSBT to the Bitcoin network.
|
|
147
|
+
*
|
|
148
|
+
* @param psbtHex - The hex string of signed PSBT to broadcast.
|
|
149
|
+
* @returns A promise that resolves to the transaction ID as a Hex string
|
|
150
|
+
* @todo Implement PSBT broadcasting with UTXO Global
|
|
151
|
+
*/
|
|
152
|
+
async broadcastPsbt(
|
|
153
|
+
_psbtHex: ccc.HexLike,
|
|
154
|
+
_options?: ccc.SignPsbtOptionsLike,
|
|
155
|
+
): Promise<ccc.Hex> {
|
|
156
|
+
throw new Error("UTXO Global PSBT broadcasting not implemented yet");
|
|
157
|
+
}
|
|
130
158
|
}
|