@ckb-ccc/rei 1.0.32 → 1.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/advanced.d.mts +2 -0
  3. package/dist/advanced.mjs +1 -0
  4. package/dist/advancedBarrel-DQiM1LUp.d.mts +113 -0
  5. package/dist/advancedBarrel-DQiM1LUp.d.mts.map +1 -0
  6. package/dist/advancedBarrel.d.mts +2 -0
  7. package/dist/advancedBarrel.mjs +2 -0
  8. package/dist/advancedBarrel.mjs.map +1 -0
  9. package/dist/barrel.d.mts +99 -0
  10. package/dist/barrel.d.mts.map +1 -0
  11. package/dist/barrel.mjs +2 -0
  12. package/dist/barrel.mjs.map +1 -0
  13. package/dist/index.d.mts +2 -0
  14. package/dist/index.mjs +1 -0
  15. package/dist/rolldown-runtime-DK3Fl9T5.mjs +1 -0
  16. package/dist.commonjs/advanced.d.ts +2 -2
  17. package/dist.commonjs/advanced.js +1 -37
  18. package/dist.commonjs/advancedBarrel-BVsjztuv.d.ts +113 -0
  19. package/dist.commonjs/advancedBarrel-BVsjztuv.d.ts.map +1 -0
  20. package/dist.commonjs/advancedBarrel.d.ts +2 -106
  21. package/dist.commonjs/advancedBarrel.js +2 -2
  22. package/dist.commonjs/advancedBarrel.js.map +1 -0
  23. package/dist.commonjs/barrel.d.ts +98 -2
  24. package/dist.commonjs/barrel.d.ts.map +1 -1
  25. package/dist.commonjs/barrel.js +2 -18
  26. package/dist.commonjs/barrel.js.map +1 -0
  27. package/dist.commonjs/index.d.ts +2 -2
  28. package/dist.commonjs/index.js +1 -37
  29. package/dist.commonjs/rolldown-runtime-BIInC43l.js +1 -0
  30. package/package.json +26 -29
  31. package/tsdown.config.mts +43 -0
  32. package/dist/advanced.d.ts +0 -2
  33. package/dist/advanced.d.ts.map +0 -1
  34. package/dist/advanced.js +0 -1
  35. package/dist/advancedBarrel.d.ts +0 -106
  36. package/dist/advancedBarrel.d.ts.map +0 -1
  37. package/dist/advancedBarrel.js +0 -1
  38. package/dist/barrel.d.ts +0 -3
  39. package/dist/barrel.d.ts.map +0 -1
  40. package/dist/barrel.js +0 -2
  41. package/dist/index.d.ts +0 -2
  42. package/dist/index.d.ts.map +0 -1
  43. package/dist/index.js +0 -1
  44. package/dist/signer.d.ts +0 -83
  45. package/dist/signer.d.ts.map +0 -1
  46. package/dist/signer.js +0 -144
  47. package/dist/signersFactory.d.ts +0 -9
  48. package/dist/signersFactory.d.ts.map +0 -1
  49. package/dist/signersFactory.js +0 -19
  50. package/dist.commonjs/advanced.d.ts.map +0 -1
  51. package/dist.commonjs/advancedBarrel.d.ts.map +0 -1
  52. package/dist.commonjs/index.d.ts.map +0 -1
  53. package/dist.commonjs/signer.d.ts +0 -83
  54. package/dist.commonjs/signer.d.ts.map +0 -1
  55. package/dist.commonjs/signer.js +0 -148
  56. package/dist.commonjs/signersFactory.d.ts +0 -9
  57. package/dist.commonjs/signersFactory.d.ts.map +0 -1
  58. package/dist.commonjs/signersFactory.js +0 -22
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @ckb-ccc/rei
2
2
 
3
+ ## 1.1.0
4
+ ### Minor Changes
5
+
6
+
7
+
8
+ - [#381](https://github.com/ckb-devrel/ccc/pull/381) [`46cc045`](https://github.com/ckb-devrel/ccc/commit/46cc045a3eefe9ba6625482dc7f740a0c59c99d4) Thanks [@Hanssen0](https://github.com/Hanssen0)! - chore: bump packages
9
+
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`46cc045`](https://github.com/ckb-devrel/ccc/commit/46cc045a3eefe9ba6625482dc7f740a0c59c99d4)]:
14
+ - @ckb-ccc/core@1.14.0
15
+
16
+ ## 1.0.33
17
+ ### Patch Changes
18
+
19
+
20
+
21
+ - [#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
22
+
23
+ - 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)]:
24
+ - @ckb-ccc/core@1.13.0
25
+
3
26
  ## 1.0.32
4
27
  ### Patch Changes
5
28
 
@@ -0,0 +1,2 @@
1
+ import { i as advancedBarrel_d_exports } from "./advancedBarrel-DQiM1LUp.mjs";
2
+ export { advancedBarrel_d_exports as ReiA };
@@ -0,0 +1 @@
1
+ import{t as e}from"./advancedBarrel.mjs";export{e as ReiA};
@@ -0,0 +1,113 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ import { cccA } from "@ckb-ccc/core/advanced";
3
+
4
+ //#region src/advancedBarrel.d.ts
5
+ declare namespace advancedBarrel_d_exports {
6
+ export { OnMethod, Provider, RequestMethod };
7
+ }
8
+ /**
9
+ * Interface representing a provider for interacting with accounts and signing messages.
10
+ * @interface
11
+ */
12
+ interface Provider {
13
+ /**
14
+ * Sends a request to the provider.
15
+ * @type {RequestMethod}
16
+ */
17
+ request: RequestMethod;
18
+ /**
19
+ * Adds an event listener to the provider.
20
+ * @type {OnMethod}
21
+ */
22
+ on: OnMethod;
23
+ /**
24
+ * Checks if rei wallet is connected.
25
+ * @returns A promise that resolves to true if connected, false otherwise.
26
+ */
27
+ isConnected(): Promise<boolean>;
28
+ /**
29
+ * Removes an event listener from the provider.
30
+ * @param {string} eventName - The name of the event to remove the listener from.
31
+ * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.
32
+ * @returns {Provider} The provider instance.
33
+ */
34
+ off(eventName: string, listener: (...args: unknown[]) => unknown): void;
35
+ }
36
+ /**
37
+ * Interface representing a method to add event listeners to the provider.
38
+ * @interface
39
+ */
40
+ interface OnMethod {
41
+ /**
42
+ * Adds an event listener to the provider.
43
+ * @param {string} eventName - The name of the event.
44
+ * @param {(...args: unknown[]) => unknown} listener - The listener function.
45
+ * @returns {Provider} The provider instance.
46
+ */
47
+ (eventName: string, listener: (...args: unknown[]) => unknown): void;
48
+ }
49
+ interface RequestMethod {
50
+ /**
51
+ * Requests the accounts from the provider.
52
+ * @param request - The request object.
53
+ * @param request.method - The method name.
54
+ * @param request.data - The optional method parameters.
55
+ * @returns A promise that resolves to an array of account addresses.
56
+ */
57
+ (request: {
58
+ method: "ckb_requestAccounts";
59
+ data?: undefined;
60
+ }): Promise<string>;
61
+ /**
62
+ * Signs a message with the personal account.
63
+ * @param request - The request object.
64
+ * @param request.method - The method name.
65
+ * @param request.data - The method parameters.
66
+ * @returns A promise that resolves to the signed message.
67
+ */
68
+ (request: {
69
+ method: "ckb_signMessage";
70
+ data: {
71
+ message: string;
72
+ };
73
+ }): Promise<ccc.Hex>;
74
+ /**
75
+ * Gets the identity of the signer.
76
+ * @param request - The request object.
77
+ * @param request.method - The method name.
78
+ * @returns A promise that resolves to the signed message.
79
+ */
80
+ (request: {
81
+ method: "ckb_getPublicKey";
82
+ }): Promise<string>;
83
+ /**
84
+ * Get network.
85
+ * @param request - The request object.
86
+ * @param request.method - The method name.
87
+ * @param request.data - The method parameters.
88
+ * @returns A promise that resolves to the signed message.
89
+ */
90
+ (request: {
91
+ method: "ckb_switchNetwork";
92
+ data: string;
93
+ }): Promise<{
94
+ type: string;
95
+ network: string;
96
+ }>;
97
+ /**
98
+ * Signs transaction .
99
+ * @param request - The request object.
100
+ * @param request.method - The method name.
101
+ * @param request.data - The method parameters.
102
+ * @returns A promise that resolves to the signed message.
103
+ */
104
+ (request: {
105
+ method: "ckb_signTransaction";
106
+ data: {
107
+ txSkeleton: cccA.JsonRpcTransaction;
108
+ };
109
+ }): Promise<ccc.Transaction>;
110
+ }
111
+ //#endregion
112
+ export { advancedBarrel_d_exports as i, Provider as n, RequestMethod as r, OnMethod as t };
113
+ //# sourceMappingURL=advancedBarrel-DQiM1LUp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advancedBarrel-DQiM1LUp.d.mts","names":[],"sources":["../src/advancedBarrel.ts"],"mappings":";;;;;;;;;;;UAOiB,QAAA;;;;AAAjB;EAKE,OAAA,EAAS,aAAA;;;;;EAMT,EAAA,EAAI,QAAA;EAMkB;;;;EAAtB,WAAA,IAAe,OAAA;EAAf;;;;;;EAQA,GAAA,CAAI,SAAA,UAAmB,QAAA,MAAc,IAAA;AAAA;AAOvC;;;;AAAA,UAAiB,QAAA;EAOmB;;;AAA2B;AAG/D;;EAHoC,CAAjC,SAAA,UAAmB,QAAA,MAAc,IAAA;AAAA;AAAA,UAGnB,aAAA;EAuBX;;;;;;;EAAA,CAfH,OAAA;IACC,MAAA;IACA,IAAA;EAAA,IACE,OAAA;EAAA;;;;;;;EAAA,CASH,OAAA;IACC,MAAA;IACA,IAAA;MAAQ,OAAA;IAAA;EAAA,IACN,OAAA,CAAQ,GAAA,CAAI,GAAA;EAiBf;;;;;;EAAA,CATA,OAAA;IAAW,MAAA;EAAA,IAA+B,OAAA;EAsB1C;;;;;AAG0B;;EAH1B,CAbA,OAAA;IACC,MAAA;IACA,IAAA;EAAA,IACE,OAAA;IAAU,IAAA;IAAc,OAAA;EAAA;;;;;;;;GAU3B,OAAA;IACC,MAAA;IACA,IAAA;MAAQ,UAAA,EAAY,IAAA,CAAK,kBAAA;IAAA;EAAA,IACvB,OAAA,CAAQ,GAAA,CAAI,WAAA;AAAA"}
@@ -0,0 +1,2 @@
1
+ import { n as Provider, r as RequestMethod, t as OnMethod } from "./advancedBarrel-DQiM1LUp.mjs";
2
+ export { OnMethod, Provider, RequestMethod };
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.mjs";var t=e({});export{t};
2
+ //# sourceMappingURL=advancedBarrel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advancedBarrel.mjs","names":[],"sources":["../src/advancedBarrel.ts"],"sourcesContent":["import { ccc } from \"@ckb-ccc/core\";\nimport { cccA } from \"@ckb-ccc/core/advanced\";\n\n/**\n * Interface representing a provider for interacting with accounts and signing messages.\n * @interface\n */\nexport interface Provider {\n /**\n * Sends a request to the provider.\n * @type {RequestMethod}\n */\n request: RequestMethod;\n\n /**\n * Adds an event listener to the provider.\n * @type {OnMethod}\n */\n on: OnMethod;\n\n /**\n * Checks if rei wallet is connected.\n * @returns A promise that resolves to true if connected, false otherwise.\n */\n isConnected(): Promise<boolean>;\n\n /**\n * Removes an event listener from the provider.\n * @param {string} eventName - The name of the event to remove the listener from.\n * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.\n * @returns {Provider} The provider instance.\n */\n off(eventName: string, listener: (...args: unknown[]) => unknown): void;\n}\n\n/**\n * Interface representing a method to add event listeners to the provider.\n * @interface\n */\nexport interface OnMethod {\n /**\n * Adds an event listener to the provider.\n * @param {string} eventName - The name of the event.\n * @param {(...args: unknown[]) => unknown} listener - The listener function.\n * @returns {Provider} The provider instance.\n */\n (eventName: string, listener: (...args: unknown[]) => unknown): void;\n}\n\nexport interface RequestMethod {\n /**\n * Requests the accounts from the provider.\n * @param request - The request object.\n * @param request.method - The method name.\n * @param request.data - The optional method parameters.\n * @returns A promise that resolves to an array of account addresses.\n */\n (request: {\n method: \"ckb_requestAccounts\";\n data?: undefined;\n }): Promise<string>;\n\n /**\n * Signs a message with the personal account.\n * @param request - The request object.\n * @param request.method - The method name.\n * @param request.data - The method parameters.\n * @returns A promise that resolves to the signed message.\n */\n (request: {\n method: \"ckb_signMessage\";\n data: { message: string };\n }): Promise<ccc.Hex>;\n\n /**\n * Gets the identity of the signer.\n * @param request - The request object.\n * @param request.method - The method name.\n * @returns A promise that resolves to the signed message.\n */\n (request: { method: \"ckb_getPublicKey\" }): Promise<string>;\n\n /**\n * Get network.\n * @param request - The request object.\n * @param request.method - The method name.\n * @param request.data - The method parameters.\n * @returns A promise that resolves to the signed message.\n */\n (request: {\n method: \"ckb_switchNetwork\";\n data: string;\n }): Promise<{ type: string; network: string }>;\n\n /**\n * Signs transaction .\n * @param request - The request object.\n * @param request.method - The method name.\n * @param request.data - The method parameters.\n * @returns A promise that resolves to the signed message.\n */\n\n (request: {\n method: \"ckb_signTransaction\";\n data: { txSkeleton: cccA.JsonRpcTransaction };\n }): Promise<ccc.Transaction>;\n}\n"],"mappings":""}
@@ -0,0 +1,99 @@
1
+ import { n as Provider } from "./advancedBarrel-DQiM1LUp.mjs";
2
+ import { ccc } from "@ckb-ccc/core";
3
+
4
+ //#region src/signer.d.ts
5
+ /**
6
+ * Class representing a CKB signer that extends Signer from @ckb-ccc/core.
7
+ * @public
8
+ */
9
+ declare class ReiSigner extends ccc.Signer {
10
+ readonly provider: Provider;
11
+ /**
12
+ * Creates an instance of Signer.
13
+ * @param client - The client instance.
14
+ * @param provider - The provider instance.
15
+ */
16
+ constructor(client: ccc.Client, provider: Provider);
17
+ /**
18
+ * Register a listener to be called when this signer is replaced.
19
+ *
20
+ * @returns A function for unregister
21
+ */
22
+ onReplaced(listener: () => void): () => void;
23
+ /**
24
+ * Gets the signer type.
25
+ * @returns The type of the signer.
26
+ */
27
+ get type(): ccc.SignerType;
28
+ /**
29
+ * Gets the sign type.
30
+ * @returns The sign type.
31
+ */
32
+ get signType(): ccc.SignerSignType;
33
+ /**
34
+ * Connects to the provider by requesting authentication.
35
+ * @returns A promise that resolves when the connection is established.
36
+ */
37
+ connect(): Promise<void>;
38
+ /**
39
+ * Checks if the signer is connected.
40
+ * @returns A promise that resolves to true if connected, false otherwise.
41
+ */
42
+ isConnected(): Promise<boolean>;
43
+ _getNetworkChanged(): Promise<boolean>;
44
+ /**
45
+ * Gets the internal address.
46
+ * @returns A promise that resolves to the internal address.
47
+ */
48
+ getInternalAddress(): Promise<string>;
49
+ /**
50
+ * Gets the address object.
51
+ * @returns A promise that resolves to the address object.
52
+ */
53
+ getAddressObj(): Promise<ccc.Address>;
54
+ /**
55
+ * Gets the address objects.
56
+ * @returns A promise that resolves to an array of address objects.
57
+ */
58
+ getAddressObjs(): Promise<ccc.Address[]>;
59
+ /**
60
+ * Gets the identity of the signer.
61
+ * @returns A promise that resolves to the identity.
62
+ */
63
+ getIdentity(): Promise<string>;
64
+ /**
65
+ * Signs a raw message with the personal account.
66
+ * @param message - The message to sign.
67
+ * @returns A promise that resolves to the signed message.
68
+ */
69
+ signMessageRaw(message: string): Promise<ccc.Hex>;
70
+ /**
71
+ * prepare a transaction before signing.
72
+ *
73
+ * @param txLike - The transaction to prepare, represented as a TransactionLike object.
74
+ * @returns A promise that resolves to the prepared Transaction object.
75
+ */
76
+ prepareTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
77
+ /**
78
+ * Signs a transaction without preparing information for it.
79
+ *
80
+ * @param txLike - The transaction to sign, represented as a TransactionLike object.
81
+ * @returns A promise that resolves to the signed Transaction object.
82
+ */
83
+ signOnlyTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
84
+ }
85
+ //#endregion
86
+ //#region src/signersFactory.d.ts
87
+ /**
88
+ * Retrieves the Rei signer if available.
89
+ * @param {ccc.Client} client - The client instance.
90
+ * @returns {Signer | undefined} The Signer instance if the Rei provider is available, otherwise undefined.
91
+
92
+ */
93
+ declare function getReiSigners(client: ccc.Client): ccc.SignerInfo[];
94
+ declare namespace barrel_d_exports {
95
+ export { ReiSigner, getReiSigners };
96
+ }
97
+ //#endregion
98
+ export { ReiSigner, getReiSigners, barrel_d_exports as t };
99
+ //# sourceMappingURL=barrel.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barrel.d.mts","names":[],"sources":["../src/signer.ts","../src/signersFactory.ts","../src/barrel.ts"],"mappings":";;;;;;;AASA;cAAa,SAAA,SAAkB,GAAA,CAAI,MAAA;EAAA,SAQf,QAAA,EAAU,QAAA;EAAA;;;;;cAD1B,MAAA,EAAQ,GAAA,CAAI,MAAA,EACI,QAAA,EAAU,QAAA;EA4DP;;;;;EAjDrB,UAAA,CAAW,QAAA;EAqFa;;;;EAAA,IAjEpB,IAAA,IAAQ,GAAA,CAAI,UAAA;EAoGL;;;;EAAA,IA5FP,QAAA,IAAY,GAAA,CAAI,cAAA;EA/CS;;;;EAuDvB,OAAA,IAAW,OAAA;EA/CC;;;;EA4DZ,WAAA,IAAe,OAAA;EAQf,kBAAA,IAAsB,OAAA;EApEA;;;;EAgFtB,kBAAA,IAAsB,OAAA;EAjDhB;;;;EAyDN,aAAA,IAAiB,OAAA,CAAQ,GAAA,CAAI,OAAA;EAzC7B;;;;EAiDA,cAAA,IAAkB,OAAA,CAAQ,GAAA,CAAI,OAAA;EA5BR;;;;EAoCtB,WAAA,IAAe,OAAA;EAhBU;;;;;EA2BzB,cAAA,CAAe,OAAA,WAAkB,OAAA,CAAQ,GAAA,CAAI,GAAA;EAX7C;;;;;;EAyBA,kBAAA,CACJ,MAAA,EAAQ,GAAA,CAAI,eAAA,GACX,OAAA,CAAQ,GAAA,CAAI,WAAA;EAFT;;;;;;EAuBA,mBAAA,CACJ,MAAA,EAAQ,GAAA,CAAI,eAAA,GACX,OAAA,CAAQ,GAAA,CAAI,WAAA;AAAA;;;;;;;AAlKjB;;iBCCgB,aAAA,CAAc,MAAA,EAAQ,GAAA,CAAI,MAAA,GAAS,GAAA,CAAI,UAAU;AAAA"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.mjs";import{ccc as t}from"@ckb-ccc/core";import{cccA as n}from"@ckb-ccc/core/advanced";var r=class extends t.Signer{constructor(e,t){super(e),this.provider=t}onReplaced(e){let t=[],n=async()=>{e(),t[0]?.()};return t.push(()=>{this.provider.off(`accountsChanged`,n),this.provider.off(`chainChanged`,n)}),this.provider.on(`accountsChanged`,n),this.provider.on(`chainChanged`,n),t[0]}get type(){return t.SignerType.CKB}get signType(){return t.SignerSignType.CkbSecp256k1}async connect(){let e=this.client.addressPrefix;if(await this._getNetworkChanged()){let t=e===`ckb`?`mainnet`:`testnet`;await this.provider.request({method:`ckb_switchNetwork`,data:t})}}async isConnected(){let e=await this.provider.isConnected();return!e||await this._getNetworkChanged()?!1:e}async _getNetworkChanged(){let e=this.client.addressPrefix,t=await this.getInternalAddress(),{prefix:r}=n.addressPayloadFromString(t);return e!==r}async getInternalAddress(){return this.provider.request({method:`ckb_requestAccounts`})}async getAddressObj(){return t.Address.fromString(await this.getInternalAddress(),this.client)}async getAddressObjs(){return[await this.getAddressObj()]}async getIdentity(){return this.provider.request({method:`ckb_getPublicKey`})}async signMessageRaw(e){return this.provider.request({method:`ckb_signMessage`,data:{message:e}})}async prepareTransaction(e){let n=t.Transaction.from(e);return await n.addCellDepsOfKnownScripts(this.client,t.KnownScript.Secp256k1Blake160),t.reduceAsync(await this.getAddressObjs(),(e,{script:t})=>e.prepareSighashAllWitness(t,65,this.client),n)}async signOnlyTransaction(e){let t=n.JsonRpcTransformers.transactionFrom(e);return this.provider.request({method:`ckb_signTransaction`,data:{txSkeleton:t}})}};function i(e){let t=window;return t?.rei?.ckb===void 0?[]:[{signer:new r(e,t.rei.ckb),name:`CKB`}]}var a=e({ReiSigner:()=>r,getReiSigners:()=>i});export{r as ReiSigner,i as getReiSigners,a as t};
2
+ //# sourceMappingURL=barrel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barrel.mjs","names":[],"sources":["../src/signer.ts","../src/signersFactory.ts","../src/barrel.ts"],"sourcesContent":["import { ccc } from \"@ckb-ccc/core\";\nimport { cccA } from \"@ckb-ccc/core/advanced\";\n\nimport { Provider } from \"./advancedBarrel.js\";\n\n/**\n * Class representing a CKB signer that extends Signer from @ckb-ccc/core.\n * @public\n */\nexport class ReiSigner extends ccc.Signer {\n /**\n * Creates an instance of Signer.\n * @param client - The client instance.\n * @param provider - The provider instance.\n */\n constructor(\n client: ccc.Client,\n public readonly provider: Provider,\n ) {\n super(client);\n }\n\n /**\n * Register a listener to be called when this signer is replaced.\n *\n * @returns A function for unregister\n */\n\n onReplaced(listener: () => void): () => void {\n const stop: (() => void)[] = [];\n const replacer = async () => {\n listener();\n stop[0]?.();\n };\n stop.push(() => {\n this.provider.off(\"accountsChanged\", replacer);\n this.provider.off(\"chainChanged\", replacer);\n });\n this.provider.on(\"accountsChanged\", replacer);\n this.provider.on(\"chainChanged\", replacer);\n\n return stop[0];\n }\n\n /**\n * Gets the signer type.\n * @returns The type of the signer.\n */\n get type(): ccc.SignerType {\n return ccc.SignerType.CKB;\n }\n\n /**\n * Gets the sign type.\n * @returns The sign type.\n */\n get signType(): ccc.SignerSignType {\n return ccc.SignerSignType.CkbSecp256k1;\n }\n\n /**\n * Connects to the provider by requesting authentication.\n * @returns A promise that resolves when the connection is established.\n */\n async connect(): Promise<void> {\n const prefixClient = this.client.addressPrefix;\n const netChange = await this._getNetworkChanged();\n if (netChange) {\n const data = prefixClient === \"ckb\" ? \"mainnet\" : \"testnet\";\n await this.provider.request({ method: \"ckb_switchNetwork\", data });\n }\n }\n\n /**\n * Checks if the signer is connected.\n * @returns A promise that resolves to true if connected, false otherwise.\n */\n async isConnected(): Promise<boolean> {\n const connected = await this.provider.isConnected();\n if (!connected || (await this._getNetworkChanged())) {\n return false;\n }\n return connected;\n }\n\n async _getNetworkChanged(): Promise<boolean> {\n const prefixClient = this.client.addressPrefix;\n\n const address = await this.getInternalAddress();\n const { prefix } = cccA.addressPayloadFromString(address);\n return prefixClient !== prefix;\n }\n\n /**\n * Gets the internal address.\n * @returns A promise that resolves to the internal address.\n */\n async getInternalAddress(): Promise<string> {\n return this.provider.request({ method: \"ckb_requestAccounts\" });\n }\n\n /**\n * Gets the address object.\n * @returns A promise that resolves to the address object.\n */\n async getAddressObj(): Promise<ccc.Address> {\n return ccc.Address.fromString(await this.getInternalAddress(), this.client);\n }\n\n /**\n * Gets the address objects.\n * @returns A promise that resolves to an array of address objects.\n */\n async getAddressObjs(): Promise<ccc.Address[]> {\n return [await this.getAddressObj()];\n }\n\n /**\n * Gets the identity of the signer.\n * @returns A promise that resolves to the identity.\n */\n async getIdentity(): Promise<string> {\n return this.provider.request({\n method: \"ckb_getPublicKey\",\n });\n }\n\n /**\n * Signs a raw message with the personal account.\n * @param message - The message to sign.\n * @returns A promise that resolves to the signed message.\n */\n async signMessageRaw(message: string): Promise<ccc.Hex> {\n return this.provider.request({\n method: \"ckb_signMessage\",\n data: { message },\n });\n }\n\n /**\n * prepare a transaction before signing.\n *\n * @param txLike - The transaction to prepare, represented as a TransactionLike object.\n * @returns A promise that resolves to the prepared Transaction object.\n */\n\n async prepareTransaction(\n txLike: ccc.TransactionLike,\n ): Promise<ccc.Transaction> {\n const tx = ccc.Transaction.from(txLike);\n await tx.addCellDepsOfKnownScripts(\n this.client,\n ccc.KnownScript.Secp256k1Blake160,\n );\n return ccc.reduceAsync(\n await this.getAddressObjs(),\n (tx: ccc.Transaction, { script }) =>\n tx.prepareSighashAllWitness(script, 65, this.client),\n tx,\n );\n }\n\n /**\n * Signs a transaction without preparing information for it.\n *\n * @param txLike - The transaction to sign, represented as a TransactionLike object.\n * @returns A promise that resolves to the signed Transaction object.\n */\n\n async signOnlyTransaction(\n txLike: ccc.TransactionLike,\n ): Promise<ccc.Transaction> {\n const txFormat = cccA.JsonRpcTransformers.transactionFrom(txLike);\n\n return this.provider.request({\n method: \"ckb_signTransaction\",\n data: { txSkeleton: txFormat },\n });\n }\n}\n","import { ccc } from \"@ckb-ccc/core\";\nimport { Provider } from \"./advancedBarrel.js\";\nimport { ReiSigner } from \"./signer.js\";\n\n/**\n * Retrieves the Rei signer if available.\n * @param {ccc.Client} client - The client instance.\n * @returns {Signer | undefined} The Signer instance if the Rei provider is available, otherwise undefined.\n\n */\nexport function getReiSigners(client: ccc.Client): ccc.SignerInfo[] {\n const windowRef = window as { rei?: { ckb: Provider } };\n\n if (typeof windowRef?.rei?.ckb === \"undefined\") {\n return [];\n }\n return [\n {\n signer: new ReiSigner(client, windowRef.rei.ckb),\n name: \"CKB\",\n },\n ];\n}\n","export * from \"./signer.js\";\nexport * from \"./signersFactory.js\";\n"],"mappings":"sIASA,IAAa,EAAb,cAA+B,EAAI,MAAO,CAMxC,YACE,EACA,EACA,CACA,MAAM,CAAM,EAFI,KAAA,SAAA,CAGlB,CAQA,WAAW,EAAkC,CAC3C,IAAM,EAAuB,CAAC,EACxB,EAAW,SAAY,CAC3B,EAAS,EACT,EAAK,EAAE,GAAG,CACZ,EAQA,OAPA,EAAK,SAAW,CACd,KAAK,SAAS,IAAI,kBAAmB,CAAQ,EAC7C,KAAK,SAAS,IAAI,eAAgB,CAAQ,CAC5C,CAAC,EACD,KAAK,SAAS,GAAG,kBAAmB,CAAQ,EAC5C,KAAK,SAAS,GAAG,eAAgB,CAAQ,EAElC,EAAK,EACd,CAMA,IAAI,MAAuB,CACzB,OAAO,EAAI,WAAW,GACxB,CAMA,IAAI,UAA+B,CACjC,OAAO,EAAI,eAAe,YAC5B,CAMA,MAAM,SAAyB,CAC7B,IAAM,EAAe,KAAK,OAAO,cAEjC,GAAI,MADoB,KAAK,mBAAmB,EACjC,CACb,IAAM,EAAO,IAAiB,MAAQ,UAAY,UAClD,MAAM,KAAK,SAAS,QAAQ,CAAE,OAAQ,oBAAqB,MAAK,CAAC,CACnE,CACF,CAMA,MAAM,aAAgC,CACpC,IAAM,EAAY,MAAM,KAAK,SAAS,YAAY,EAIlD,MAHI,CAAC,GAAc,MAAM,KAAK,mBAAmB,EACxC,GAEF,CACT,CAEA,MAAM,oBAAuC,CAC3C,IAAM,EAAe,KAAK,OAAO,cAE3B,EAAU,MAAM,KAAK,mBAAmB,EACxC,CAAE,UAAW,EAAK,yBAAyB,CAAO,EACxD,OAAO,IAAiB,CAC1B,CAMA,MAAM,oBAAsC,CAC1C,OAAO,KAAK,SAAS,QAAQ,CAAE,OAAQ,qBAAsB,CAAC,CAChE,CAMA,MAAM,eAAsC,CAC1C,OAAO,EAAI,QAAQ,WAAW,MAAM,KAAK,mBAAmB,EAAG,KAAK,MAAM,CAC5E,CAMA,MAAM,gBAAyC,CAC7C,MAAO,CAAC,MAAM,KAAK,cAAc,CAAC,CACpC,CAMA,MAAM,aAA+B,CACnC,OAAO,KAAK,SAAS,QAAQ,CAC3B,OAAQ,kBACV,CAAC,CACH,CAOA,MAAM,eAAe,EAAmC,CACtD,OAAO,KAAK,SAAS,QAAQ,CAC3B,OAAQ,kBACR,KAAM,CAAE,SAAQ,CAClB,CAAC,CACH,CASA,MAAM,mBACJ,EAC0B,CAC1B,IAAM,EAAK,EAAI,YAAY,KAAK,CAAM,EAKtC,OAJA,MAAM,EAAG,0BACP,KAAK,OACL,EAAI,YAAY,iBAClB,EACO,EAAI,YACT,MAAM,KAAK,eAAe,GACzB,EAAqB,CAAE,YACtB,EAAG,yBAAyB,EAAQ,GAAI,KAAK,MAAM,EACrD,CACF,CACF,CASA,MAAM,oBACJ,EAC0B,CAC1B,IAAM,EAAW,EAAK,oBAAoB,gBAAgB,CAAM,EAEhE,OAAO,KAAK,SAAS,QAAQ,CAC3B,OAAQ,sBACR,KAAM,CAAE,WAAY,CAAS,CAC/B,CAAC,CACH,CACF,ECzKA,SAAgB,EAAc,EAAsC,CAClE,IAAM,EAAY,OAKlB,OAHW,GAAW,KAAK,MAAQ,OAC1B,CAAC,EAEH,CACL,CACE,OAAQ,IAAI,EAAU,EAAQ,EAAU,IAAI,GAAG,EAC/C,KAAM,KACR,CACF,CACF"}
@@ -0,0 +1,2 @@
1
+ import { t as barrel_d_exports } from "./barrel.mjs";
2
+ export { barrel_d_exports as Rei };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{t as e}from"./barrel.mjs";export{e as Rei};
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};export{t};
@@ -1,2 +1,2 @@
1
- export * as ReiA from "./advancedBarrel.js";
2
- //# sourceMappingURL=advanced.d.ts.map
1
+ import { i as advancedBarrel_d_exports } from "./advancedBarrel-BVsjztuv.js";
2
+ export { advancedBarrel_d_exports as ReiA };
@@ -1,37 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.ReiA = void 0;
37
- exports.ReiA = __importStar(require("./advancedBarrel.js"));
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./advancedBarrel.js");Object.defineProperty(exports,"ReiA",{enumerable:!0,get:function(){return e.t}});
@@ -0,0 +1,113 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ import { cccA } from "@ckb-ccc/core/advanced";
3
+
4
+ //#region \0rolldown/runtime.js
5
+ declare namespace advancedBarrel_d_exports {
6
+ export { OnMethod, Provider, RequestMethod };
7
+ }
8
+ /**
9
+ * Interface representing a provider for interacting with accounts and signing messages.
10
+ * @interface
11
+ */
12
+ interface Provider {
13
+ /**
14
+ * Sends a request to the provider.
15
+ * @type {RequestMethod}
16
+ */
17
+ request: RequestMethod;
18
+ /**
19
+ * Adds an event listener to the provider.
20
+ * @type {OnMethod}
21
+ */
22
+ on: OnMethod;
23
+ /**
24
+ * Checks if rei wallet is connected.
25
+ * @returns A promise that resolves to true if connected, false otherwise.
26
+ */
27
+ isConnected(): Promise<boolean>;
28
+ /**
29
+ * Removes an event listener from the provider.
30
+ * @param {string} eventName - The name of the event to remove the listener from.
31
+ * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.
32
+ * @returns {Provider} The provider instance.
33
+ */
34
+ off(eventName: string, listener: (...args: unknown[]) => unknown): void;
35
+ }
36
+ /**
37
+ * Interface representing a method to add event listeners to the provider.
38
+ * @interface
39
+ */
40
+ interface OnMethod {
41
+ /**
42
+ * Adds an event listener to the provider.
43
+ * @param {string} eventName - The name of the event.
44
+ * @param {(...args: unknown[]) => unknown} listener - The listener function.
45
+ * @returns {Provider} The provider instance.
46
+ */
47
+ (eventName: string, listener: (...args: unknown[]) => unknown): void;
48
+ }
49
+ interface RequestMethod {
50
+ /**
51
+ * Requests the accounts from the provider.
52
+ * @param request - The request object.
53
+ * @param request.method - The method name.
54
+ * @param request.data - The optional method parameters.
55
+ * @returns A promise that resolves to an array of account addresses.
56
+ */
57
+ (request: {
58
+ method: "ckb_requestAccounts";
59
+ data?: undefined;
60
+ }): Promise<string>;
61
+ /**
62
+ * Signs a message with the personal account.
63
+ * @param request - The request object.
64
+ * @param request.method - The method name.
65
+ * @param request.data - The method parameters.
66
+ * @returns A promise that resolves to the signed message.
67
+ */
68
+ (request: {
69
+ method: "ckb_signMessage";
70
+ data: {
71
+ message: string;
72
+ };
73
+ }): Promise<ccc.Hex>;
74
+ /**
75
+ * Gets the identity of the signer.
76
+ * @param request - The request object.
77
+ * @param request.method - The method name.
78
+ * @returns A promise that resolves to the signed message.
79
+ */
80
+ (request: {
81
+ method: "ckb_getPublicKey";
82
+ }): Promise<string>;
83
+ /**
84
+ * Get network.
85
+ * @param request - The request object.
86
+ * @param request.method - The method name.
87
+ * @param request.data - The method parameters.
88
+ * @returns A promise that resolves to the signed message.
89
+ */
90
+ (request: {
91
+ method: "ckb_switchNetwork";
92
+ data: string;
93
+ }): Promise<{
94
+ type: string;
95
+ network: string;
96
+ }>;
97
+ /**
98
+ * Signs transaction .
99
+ * @param request - The request object.
100
+ * @param request.method - The method name.
101
+ * @param request.data - The method parameters.
102
+ * @returns A promise that resolves to the signed message.
103
+ */
104
+ (request: {
105
+ method: "ckb_signTransaction";
106
+ data: {
107
+ txSkeleton: cccA.JsonRpcTransaction;
108
+ };
109
+ }): Promise<ccc.Transaction>;
110
+ }
111
+ //#endregion
112
+ export { __exportAll as a, advancedBarrel_d_exports as i, Provider as n, RequestMethod as r, OnMethod as t };
113
+ //# sourceMappingURL=advancedBarrel-BVsjztuv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advancedBarrel-BVsjztuv.d.ts","names":[],"sources":["../src/advancedBarrel.ts"],"mappings":";;;;;;;;;;;UAOiB,QAAA;;;;;EAKf,OAAA,EAAS,aAAA;;;;;EAMT,EAAA,EAAI,QAAA;;;;;EAMJ,WAAA,IAAe,OAAA;;;;;AAjBjB;;EAyBE,GAAA,CAAI,SAAA,UAAmB,QAAA,MAAc,IAAA;AAAA;;;;;UAOtB,QAAA;EA3BN;;;;;;EAAA,CAkCR,SAAA,UAAmB,QAAA,MAAc,IAAA;AAAA;AAAA,UAGnB,aAAA;EAjBiD;AAAA;AAOlE;;;;;EAPkE,CAyB/D,OAAA;IACC,MAAA;IACA,IAAA;EAAA,IACE,OAAA;EAXW;;;;;;;EAAA,CAoBd,OAAA;IACC,MAAA;IACA,IAAA;MAAQ,OAAA;IAAA;EAAA,IACN,OAAA,CAAQ,GAAA,CAAI,GAAA;EAdd;;;;;;EAAA,CAsBD,OAAA;IAAW,MAAA;EAAA,IAA+B,OAAA;EAR/B;;;;;;;EAAA,CAiBX,OAAA;IACC,MAAA;IACA,IAAA;EAAA,IACE,OAAA;IAAU,IAAA;IAAc,OAAA;EAAA;EAYN;;;;;;;EAAA,CAFrB,OAAA;IACC,MAAA;IACA,IAAA;MAAQ,UAAA,EAAY,IAAA,CAAK,kBAAA;IAAA;EAAA,IACvB,OAAA,CAAQ,GAAA,CAAI,WAAA;AAAA"}
@@ -1,106 +1,2 @@
1
- import { ccc } from "@ckb-ccc/core";
2
- import { cccA } from "@ckb-ccc/core/advanced";
3
- /**
4
- * Interface representing a provider for interacting with accounts and signing messages.
5
- * @interface
6
- */
7
- export interface Provider {
8
- /**
9
- * Sends a request to the provider.
10
- * @type {RequestMethod}
11
- */
12
- request: RequestMethod;
13
- /**
14
- * Adds an event listener to the provider.
15
- * @type {OnMethod}
16
- */
17
- on: OnMethod;
18
- /**
19
- * Checks if rei wallet is connected.
20
- * @returns A promise that resolves to true if connected, false otherwise.
21
- */
22
- isConnected(): Promise<boolean>;
23
- /**
24
- * Removes an event listener from the provider.
25
- * @param {string} eventName - The name of the event to remove the listener from.
26
- * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.
27
- * @returns {Provider} The provider instance.
28
- */
29
- off(eventName: string, listener: (...args: unknown[]) => unknown): void;
30
- }
31
- /**
32
- * Interface representing a method to add event listeners to the provider.
33
- * @interface
34
- */
35
- export interface OnMethod {
36
- /**
37
- * Adds an event listener to the provider.
38
- * @param {string} eventName - The name of the event.
39
- * @param {(...args: unknown[]) => unknown} listener - The listener function.
40
- * @returns {Provider} The provider instance.
41
- */
42
- (eventName: string, listener: (...args: unknown[]) => unknown): void;
43
- }
44
- export interface RequestMethod {
45
- /**
46
- * Requests the accounts from the provider.
47
- * @param request - The request object.
48
- * @param request.method - The method name.
49
- * @param request.data - The optional method parameters.
50
- * @returns A promise that resolves to an array of account addresses.
51
- */
52
- (request: {
53
- method: "ckb_requestAccounts";
54
- data?: undefined;
55
- }): Promise<string>;
56
- /**
57
- * Signs a message with the personal account.
58
- * @param request - The request object.
59
- * @param request.method - The method name.
60
- * @param request.data - The method parameters.
61
- * @returns A promise that resolves to the signed message.
62
- */
63
- (request: {
64
- method: "ckb_signMessage";
65
- data: {
66
- message: string;
67
- };
68
- }): Promise<ccc.Hex>;
69
- /**
70
- * Gets the identity of the signer.
71
- * @param request - The request object.
72
- * @param request.method - The method name.
73
- * @returns A promise that resolves to the signed message.
74
- */
75
- (request: {
76
- method: "ckb_getPublicKey";
77
- }): Promise<string>;
78
- /**
79
- * Get network.
80
- * @param request - The request object.
81
- * @param request.method - The method name.
82
- * @param request.data - The method parameters.
83
- * @returns A promise that resolves to the signed message.
84
- */
85
- (request: {
86
- method: "ckb_switchNetwork";
87
- data: string;
88
- }): Promise<{
89
- type: string;
90
- network: string;
91
- }>;
92
- /**
93
- * Signs transaction .
94
- * @param request - The request object.
95
- * @param request.method - The method name.
96
- * @param request.data - The method parameters.
97
- * @returns A promise that resolves to the signed message.
98
- */
99
- (request: {
100
- method: "ckb_signTransaction";
101
- data: {
102
- txSkeleton: cccA.JsonRpcTransaction;
103
- };
104
- }): Promise<ccc.Transaction>;
105
- }
106
- //# sourceMappingURL=advancedBarrel.d.ts.map
1
+ import { n as Provider, r as RequestMethod, t as OnMethod } from "./advancedBarrel-BVsjztuv.js";
2
+ export { OnMethod, Provider, RequestMethod };
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=require("./rolldown-runtime-BIInC43l.js").t({});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
2
+ //# sourceMappingURL=advancedBarrel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advancedBarrel.js","names":[],"sources":["../src/advancedBarrel.ts"],"sourcesContent":["import { ccc } from \"@ckb-ccc/core\";\nimport { cccA } from \"@ckb-ccc/core/advanced\";\n\n/**\n * Interface representing a provider for interacting with accounts and signing messages.\n * @interface\n */\nexport interface Provider {\n /**\n * Sends a request to the provider.\n * @type {RequestMethod}\n */\n request: RequestMethod;\n\n /**\n * Adds an event listener to the provider.\n * @type {OnMethod}\n */\n on: OnMethod;\n\n /**\n * Checks if rei wallet is connected.\n * @returns A promise that resolves to true if connected, false otherwise.\n */\n isConnected(): Promise<boolean>;\n\n /**\n * Removes an event listener from the provider.\n * @param {string} eventName - The name of the event to remove the listener from.\n * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.\n * @returns {Provider} The provider instance.\n */\n off(eventName: string, listener: (...args: unknown[]) => unknown): void;\n}\n\n/**\n * Interface representing a method to add event listeners to the provider.\n * @interface\n */\nexport interface OnMethod {\n /**\n * Adds an event listener to the provider.\n * @param {string} eventName - The name of the event.\n * @param {(...args: unknown[]) => unknown} listener - The listener function.\n * @returns {Provider} The provider instance.\n */\n (eventName: string, listener: (...args: unknown[]) => unknown): void;\n}\n\nexport interface RequestMethod {\n /**\n * Requests the accounts from the provider.\n * @param request - The request object.\n * @param request.method - The method name.\n * @param request.data - The optional method parameters.\n * @returns A promise that resolves to an array of account addresses.\n */\n (request: {\n method: \"ckb_requestAccounts\";\n data?: undefined;\n }): Promise<string>;\n\n /**\n * Signs a message with the personal account.\n * @param request - The request object.\n * @param request.method - The method name.\n * @param request.data - The method parameters.\n * @returns A promise that resolves to the signed message.\n */\n (request: {\n method: \"ckb_signMessage\";\n data: { message: string };\n }): Promise<ccc.Hex>;\n\n /**\n * Gets the identity of the signer.\n * @param request - The request object.\n * @param request.method - The method name.\n * @returns A promise that resolves to the signed message.\n */\n (request: { method: \"ckb_getPublicKey\" }): Promise<string>;\n\n /**\n * Get network.\n * @param request - The request object.\n * @param request.method - The method name.\n * @param request.data - The method parameters.\n * @returns A promise that resolves to the signed message.\n */\n (request: {\n method: \"ckb_switchNetwork\";\n data: string;\n }): Promise<{ type: string; network: string }>;\n\n /**\n * Signs transaction .\n * @param request - The request object.\n * @param request.method - The method name.\n * @param request.data - The method parameters.\n * @returns A promise that resolves to the signed message.\n */\n\n (request: {\n method: \"ckb_signTransaction\";\n data: { txSkeleton: cccA.JsonRpcTransaction };\n }): Promise<ccc.Transaction>;\n}\n"],"mappings":""}