@ckb-ccc/core 0.0.4-alpha.8 → 0.0.5-alpha.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 (209) hide show
  1. package/README.md +6 -0
  2. package/dist/ckb/transaction.d.ts +85 -2
  3. package/dist/ckb/transaction.d.ts.map +1 -1
  4. package/dist/ckb/transaction.js +152 -7
  5. package/dist/client/client.d.ts +8 -3
  6. package/dist/client/client.d.ts.map +1 -1
  7. package/dist/client/client.js +29 -2
  8. package/dist/client/clientPublicMainnet.advanced.d.ts.map +1 -1
  9. package/dist/client/clientPublicMainnet.advanced.js +4 -0
  10. package/dist/client/clientPublicTestnet.advanced.d.ts.map +1 -1
  11. package/dist/client/clientPublicTestnet.advanced.js +4 -0
  12. package/dist/client/clientTypes.d.ts +48 -1
  13. package/dist/client/clientTypes.d.ts.map +1 -1
  14. package/dist/client/clientTypes.js +27 -1
  15. package/dist/client/jsonRpc/index.d.ts +9 -1
  16. package/dist/client/jsonRpc/index.d.ts.map +1 -1
  17. package/dist/client/jsonRpc/index.js +15 -1
  18. package/dist/client/jsonRpc/transformers.d.ts +17 -3
  19. package/dist/client/jsonRpc/transformers.d.ts.map +1 -1
  20. package/dist/client/jsonRpc/transformers.js +37 -3
  21. package/dist/client/jsonRpc/types.d.ts +15 -0
  22. package/dist/client/jsonRpc/types.d.ts.map +1 -1
  23. package/dist/fixedPoint/index.d.ts.map +1 -1
  24. package/dist/fixedPoint/index.js +4 -1
  25. package/dist/fixedPoint/index.test.d.ts +2 -0
  26. package/dist/fixedPoint/index.test.d.ts.map +1 -0
  27. package/dist/fixedPoint/index.test.js +43 -0
  28. package/dist/signer/btc/signerBtc.d.ts.map +1 -1
  29. package/dist/signer/btc/signerBtc.js +2 -3
  30. package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts +12 -0
  31. package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
  32. package/dist/signer/btc/signerBtcPublicKeyReadonly.js +16 -0
  33. package/dist/signer/ckb/signerCkbScriptReadonly.d.ts +12 -0
  34. package/dist/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
  35. package/dist/signer/ckb/signerCkbScriptReadonly.js +16 -0
  36. package/dist/signer/evm/signerEvm.d.ts +5 -1
  37. package/dist/signer/evm/signerEvm.d.ts.map +1 -1
  38. package/dist/signer/evm/signerEvm.js +21 -8
  39. package/dist/signer/evm/signerEvmAddressReadonly.d.ts +13 -1
  40. package/dist/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
  41. package/dist/signer/evm/signerEvmAddressReadonly.js +16 -0
  42. package/dist/signer/index.d.ts +0 -1
  43. package/dist/signer/index.d.ts.map +1 -1
  44. package/dist/signer/index.js +0 -1
  45. package/dist/signer/signer.d.ts +26 -6
  46. package/dist/signer/signer.d.ts.map +1 -1
  47. package/dist/signer/signer.js +14 -3
  48. package/dist.commonjs/address/address.advanced.d.ts +65 -0
  49. package/dist.commonjs/address/address.advanced.d.ts.map +1 -0
  50. package/dist.commonjs/address/address.advanced.js +149 -0
  51. package/dist.commonjs/address/advanced.d.ts +2 -0
  52. package/dist.commonjs/address/advanced.d.ts.map +1 -0
  53. package/dist.commonjs/address/advanced.js +17 -0
  54. package/dist.commonjs/address/index.d.ts +54 -0
  55. package/dist.commonjs/address/index.d.ts.map +1 -0
  56. package/dist.commonjs/address/index.js +84 -0
  57. package/dist.commonjs/advanced.d.ts +3 -0
  58. package/dist.commonjs/advanced.d.ts.map +1 -0
  59. package/dist.commonjs/advanced.js +31 -0
  60. package/dist.commonjs/advancedBarrel.d.ts +5 -0
  61. package/dist.commonjs/advancedBarrel.d.ts.map +1 -0
  62. package/dist.commonjs/advancedBarrel.js +20 -0
  63. package/dist.commonjs/barrel.d.ts +11 -0
  64. package/dist.commonjs/barrel.d.ts.map +1 -0
  65. package/dist.commonjs/barrel.js +26 -0
  66. package/dist.commonjs/bytes/advanced.d.ts +5 -0
  67. package/dist.commonjs/bytes/advanced.d.ts.map +1 -0
  68. package/dist.commonjs/bytes/advanced.js +2 -0
  69. package/dist.commonjs/bytes/index.d.ts +64 -0
  70. package/dist.commonjs/bytes/index.d.ts.map +1 -0
  71. package/dist.commonjs/bytes/index.js +97 -0
  72. package/dist.commonjs/ckb/advanced.d.ts +4 -0
  73. package/dist.commonjs/ckb/advanced.d.ts.map +1 -0
  74. package/dist.commonjs/ckb/advanced.js +32 -0
  75. package/dist.commonjs/ckb/index.d.ts +3 -0
  76. package/dist.commonjs/ckb/index.d.ts.map +1 -0
  77. package/dist.commonjs/ckb/index.js +18 -0
  78. package/dist.commonjs/ckb/molecule.advanced/generated.d.ts +355 -0
  79. package/dist.commonjs/ckb/molecule.advanced/generated.d.ts.map +1 -0
  80. package/dist.commonjs/ckb/molecule.advanced/generated.js +1536 -0
  81. package/dist.commonjs/ckb/molecule.advanced/index.d.ts +6 -0
  82. package/dist.commonjs/ckb/molecule.advanced/index.d.ts.map +1 -0
  83. package/dist.commonjs/ckb/molecule.advanced/index.js +25 -0
  84. package/dist.commonjs/ckb/script.advanced.d.ts +5 -0
  85. package/dist.commonjs/ckb/script.advanced.d.ts.map +1 -0
  86. package/dist.commonjs/ckb/script.advanced.js +16 -0
  87. package/dist.commonjs/ckb/script.d.ts +126 -0
  88. package/dist.commonjs/ckb/script.d.ts.map +1 -0
  89. package/dist.commonjs/ckb/script.js +188 -0
  90. package/dist.commonjs/ckb/transaction.advanced.d.ts +5 -0
  91. package/dist.commonjs/ckb/transaction.advanced.d.ts.map +1 -0
  92. package/dist.commonjs/ckb/transaction.advanced.js +12 -0
  93. package/dist.commonjs/ckb/transaction.d.ts +616 -0
  94. package/dist.commonjs/ckb/transaction.d.ts.map +1 -0
  95. package/dist.commonjs/ckb/transaction.js +810 -0
  96. package/dist.commonjs/client/advanced.d.ts +4 -0
  97. package/dist.commonjs/client/advanced.d.ts.map +1 -0
  98. package/dist.commonjs/client/advanced.js +19 -0
  99. package/dist.commonjs/client/client.d.ts +24 -0
  100. package/dist.commonjs/client/client.d.ts.map +1 -0
  101. package/dist.commonjs/client/client.js +57 -0
  102. package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts +4 -0
  103. package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts.map +1 -0
  104. package/dist.commonjs/client/clientPublicMainnet.advanced.js +30 -0
  105. package/dist.commonjs/client/clientPublicMainnet.d.ts +9 -0
  106. package/dist.commonjs/client/clientPublicMainnet.d.ts.map +1 -0
  107. package/dist.commonjs/client/clientPublicMainnet.js +17 -0
  108. package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts +4 -0
  109. package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts.map +1 -0
  110. package/dist.commonjs/client/clientPublicTestnet.advanced.js +30 -0
  111. package/dist.commonjs/client/clientPublicTestnet.d.ts +9 -0
  112. package/dist.commonjs/client/clientPublicTestnet.d.ts.map +1 -0
  113. package/dist.commonjs/client/clientPublicTestnet.js +17 -0
  114. package/dist.commonjs/client/clientTypes.d.ts +55 -0
  115. package/dist.commonjs/client/clientTypes.d.ts.map +1 -0
  116. package/dist.commonjs/client/clientTypes.js +31 -0
  117. package/dist.commonjs/client/index.d.ts +6 -0
  118. package/dist.commonjs/client/index.d.ts.map +1 -0
  119. package/dist.commonjs/client/index.js +21 -0
  120. package/dist.commonjs/client/jsonRpc/advanced.d.ts +3 -0
  121. package/dist.commonjs/client/jsonRpc/advanced.d.ts.map +1 -0
  122. package/dist.commonjs/client/jsonRpc/advanced.js +18 -0
  123. package/dist.commonjs/client/jsonRpc/index.d.ts +76 -0
  124. package/dist.commonjs/client/jsonRpc/index.d.ts.map +1 -0
  125. package/dist.commonjs/client/jsonRpc/index.js +142 -0
  126. package/dist.commonjs/client/jsonRpc/transformers.d.ts +42 -0
  127. package/dist.commonjs/client/jsonRpc/transformers.d.ts.map +1 -0
  128. package/dist.commonjs/client/jsonRpc/transformers.js +160 -0
  129. package/dist.commonjs/client/jsonRpc/types.d.ts +56 -0
  130. package/dist.commonjs/client/jsonRpc/types.d.ts.map +1 -0
  131. package/dist.commonjs/client/jsonRpc/types.js +2 -0
  132. package/dist.commonjs/fixedPoint/index.d.ts +49 -0
  133. package/dist.commonjs/fixedPoint/index.d.ts.map +1 -0
  134. package/dist.commonjs/fixedPoint/index.js +68 -0
  135. package/dist.commonjs/fixedPoint/index.test.d.ts +2 -0
  136. package/dist.commonjs/fixedPoint/index.test.d.ts.map +1 -0
  137. package/dist.commonjs/fixedPoint/index.test.js +45 -0
  138. package/dist.commonjs/hasher/advanced.d.ts +2 -0
  139. package/dist.commonjs/hasher/advanced.d.ts.map +1 -0
  140. package/dist.commonjs/hasher/advanced.js +4 -0
  141. package/dist.commonjs/hasher/index.d.ts +52 -0
  142. package/dist.commonjs/hasher/index.d.ts.map +1 -0
  143. package/dist.commonjs/hasher/index.js +68 -0
  144. package/dist.commonjs/hex/index.d.ts +24 -0
  145. package/dist.commonjs/hex/index.d.ts.map +1 -0
  146. package/dist.commonjs/hex/index.js +20 -0
  147. package/dist.commonjs/index.d.ts +3 -0
  148. package/dist.commonjs/index.d.ts.map +1 -0
  149. package/dist.commonjs/index.js +31 -0
  150. package/dist.commonjs/num/index.d.ts +112 -0
  151. package/dist.commonjs/num/index.d.ts.map +1 -0
  152. package/dist.commonjs/num/index.js +139 -0
  153. package/dist.commonjs/signer/btc/index.d.ts +3 -0
  154. package/dist.commonjs/signer/btc/index.d.ts.map +1 -0
  155. package/dist.commonjs/signer/btc/index.js +18 -0
  156. package/dist.commonjs/signer/btc/signerBtc.d.ts +50 -0
  157. package/dist.commonjs/signer/btc/signerBtc.d.ts.map +1 -0
  158. package/dist.commonjs/signer/btc/signerBtc.js +70 -0
  159. package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +60 -0
  160. package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -0
  161. package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +72 -0
  162. package/dist.commonjs/signer/ckb/index.d.ts +2 -0
  163. package/dist.commonjs/signer/ckb/index.d.ts.map +1 -0
  164. package/dist.commonjs/signer/ckb/index.js +17 -0
  165. package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +59 -0
  166. package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -0
  167. package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +71 -0
  168. package/dist.commonjs/signer/evm/index.d.ts +3 -0
  169. package/dist.commonjs/signer/evm/index.d.ts.map +1 -0
  170. package/dist.commonjs/signer/evm/index.js +18 -0
  171. package/dist.commonjs/signer/evm/signerEvm.d.ts +46 -0
  172. package/dist.commonjs/signer/evm/signerEvm.d.ts.map +1 -0
  173. package/dist.commonjs/signer/evm/signerEvm.js +82 -0
  174. package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +52 -0
  175. package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -0
  176. package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +62 -0
  177. package/dist.commonjs/signer/index.d.ts +5 -0
  178. package/dist.commonjs/signer/index.d.ts.map +1 -0
  179. package/dist.commonjs/signer/index.js +20 -0
  180. package/dist.commonjs/signer/signer.d.ts +133 -0
  181. package/dist.commonjs/signer/signer.d.ts.map +1 -0
  182. package/dist.commonjs/signer/signer.js +117 -0
  183. package/dist.commonjs/tsconfig.commonjs.tsbuildinfo +1 -0
  184. package/dist.commonjs/utils/index.d.ts +7 -0
  185. package/dist.commonjs/utils/index.d.ts.map +1 -0
  186. package/dist.commonjs/utils/index.js +10 -0
  187. package/jest.config.js +5 -0
  188. package/package.json +24 -7
  189. package/src/ckb/transaction.ts +198 -3
  190. package/src/client/client.ts +64 -3
  191. package/src/client/clientPublicMainnet.advanced.ts +5 -0
  192. package/src/client/clientPublicTestnet.advanced.ts +5 -0
  193. package/src/client/clientTypes.ts +70 -1
  194. package/src/client/jsonRpc/index.ts +38 -2
  195. package/src/client/jsonRpc/transformers.ts +73 -4
  196. package/src/client/jsonRpc/types.ts +16 -0
  197. package/src/fixedPoint/index.test.ts +55 -0
  198. package/src/fixedPoint/index.ts +7 -1
  199. package/src/signer/btc/signerBtc.ts +6 -3
  200. package/src/signer/btc/signerBtcPublicKeyReadonly.ts +18 -0
  201. package/src/signer/ckb/signerCkbScriptReadonly.ts +18 -0
  202. package/src/signer/evm/signerEvm.ts +56 -14
  203. package/src/signer/evm/signerEvmAddressReadonly.ts +19 -1
  204. package/src/signer/index.ts +0 -1
  205. package/src/signer/signer.ts +29 -3
  206. package/dist/signer/helpers.d.ts +0 -40
  207. package/dist/signer/helpers.d.ts.map +0 -1
  208. package/dist/signer/helpers.js +0 -90
  209. package/src/signer/helpers.ts +0 -122
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignerCkbScriptReadonly = void 0;
4
+ const address_1 = require("../../address");
5
+ const ckb_1 = require("../../ckb");
6
+ const signer_1 = require("../signer");
7
+ /**
8
+ * A class extending Signer that provides read-only access to a CKB script.
9
+ * This class does not support signing operations.
10
+ */
11
+ class SignerCkbScriptReadonly extends signer_1.Signer {
12
+ /**
13
+ * Creates an instance of SignerCkbScriptReadonly.
14
+ *
15
+ * @param client - The client instance used for communication.
16
+ * @param script - The script associated with the signer.
17
+ */
18
+ constructor(client, script) {
19
+ super(client);
20
+ this.script = ckb_1.Script.from(script);
21
+ }
22
+ /**
23
+ * Construct a new signer with the client replaced.
24
+ *
25
+ * @returns A promise that resolves the new Signer.
26
+ */
27
+ async replaceClient(client) {
28
+ return new SignerCkbScriptReadonly(client, this.script);
29
+ }
30
+ /**
31
+ * Connects to the client. This implementation does nothing as the class is read-only.
32
+ *
33
+ * @returns A promise that resolves when the connection is complete.
34
+ */
35
+ async connect() { }
36
+ /**
37
+ * Check if the signer is connected.
38
+ *
39
+ * @returns A promise that resolves the connection status.
40
+ */
41
+ async isConnected() {
42
+ return true;
43
+ }
44
+ /**
45
+ * Gets the internal address for the script.
46
+ *
47
+ * @returns A promise that resolves to a string representing the internal address.
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * const internalAddress = await signer.getInternalAddress(); // Outputs the internal address
52
+ * ```
53
+ */
54
+ async getInternalAddress() {
55
+ return this.getRecommendedAddress();
56
+ }
57
+ /**
58
+ * Gets an array of Address objects representing the script address.
59
+ *
60
+ * @returns A promise that resolves to an array of Address objects.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * const addressObjs = await signer.getAddressObjs(); // Outputs the array of Address objects
65
+ * ```
66
+ */
67
+ async getAddressObjs() {
68
+ return [await address_1.Address.fromScript(this.script, this.client)];
69
+ }
70
+ }
71
+ exports.SignerCkbScriptReadonly = SignerCkbScriptReadonly;
@@ -0,0 +1,3 @@
1
+ export * from "./signerEvm";
2
+ export * from "./signerEvmAddressReadonly";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./signerEvm"), exports);
18
+ __exportStar(require("./signerEvmAddressReadonly"), exports);
@@ -0,0 +1,46 @@
1
+ import { Address } from "../../address";
2
+ import { BytesLike } from "../../bytes";
3
+ import { Script, Transaction, TransactionLike } from "../../ckb";
4
+ import { Signer } from "../signer";
5
+ /**
6
+ * An abstract class extending Signer for Ethereum Virtual Machine (EVM) based signing operations.
7
+ * This class provides methods to get EVM account, internal address, and signing transactions.
8
+ */
9
+ export declare abstract class SignerEvm extends Signer {
10
+ /**
11
+ * Gets the EVM account associated with the signer.
12
+ *
13
+ * @returns A promise that resolves to a string representing the EVM account.
14
+ */
15
+ abstract getEvmAccount(): Promise<string>;
16
+ /**
17
+ * Gets the internal address, which is the EVM account in this case.
18
+ *
19
+ * @returns A promise that resolves to a string representing the internal address.
20
+ */
21
+ getInternalAddress(): Promise<string>;
22
+ /**
23
+ * Gets an array of Address objects representing the known script addresses for the signer.
24
+ *
25
+ * @returns A promise that resolves to an array of Address objects.
26
+ */
27
+ getAddressObjs(): Promise<Address[]>;
28
+ _getOmniLockEvmAddressObj(account: string): Promise<Address>;
29
+ _getOmniLockOldEvmAddressObj(account: string): Promise<Address>;
30
+ /**
31
+ * prepare a transaction before signing. This method is not implemented and should be overridden by subclasses.
32
+ *
33
+ * @param txLike - The transaction to prepare, represented as a TransactionLike object.
34
+ * @returns A promise that resolves to the prepared Transaction object.
35
+ */
36
+ prepareTransaction(txLike: TransactionLike): Promise<Transaction>;
37
+ /**
38
+ * Signs a transaction without modifying it.
39
+ *
40
+ * @param txLike - The transaction to sign, represented as a TransactionLike object.
41
+ * @returns A promise that resolves to a signed Transaction object.
42
+ */
43
+ signOnlyTransaction(txLike: TransactionLike): Promise<Transaction>;
44
+ _signOmniLockScriptForTransaction(tx: Transaction, script: Script, messageTransformer: (hash: string) => BytesLike): Promise<Transaction>;
45
+ }
46
+ //# sourceMappingURL=signerEvm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signerEvm.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/signerEvm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAA0B,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,WAAW,CAAC;AAI9E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;GAGG;AACH,8BAAsB,SAAU,SAAQ,MAAM;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAEzC;;;;OAIG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAQpC,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ5D,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQrE;;;;;OAKG;IACG,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAYvE;;;;;OAKG;IACG,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAsBlE,iCAAiC,CACrC,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,GAC9C,OAAO,CAAC,WAAW,CAAC;CA6BxB"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignerEvm = void 0;
4
+ const address_1 = require("../../address");
5
+ const bytes_1 = require("../../bytes");
6
+ const ckb_1 = require("../../ckb");
7
+ const client_1 = require("../../client");
8
+ const hex_1 = require("../../hex");
9
+ const num_1 = require("../../num");
10
+ const signer_1 = require("../signer");
11
+ /**
12
+ * An abstract class extending Signer for Ethereum Virtual Machine (EVM) based signing operations.
13
+ * This class provides methods to get EVM account, internal address, and signing transactions.
14
+ */
15
+ class SignerEvm extends signer_1.Signer {
16
+ /**
17
+ * Gets the internal address, which is the EVM account in this case.
18
+ *
19
+ * @returns A promise that resolves to a string representing the internal address.
20
+ */
21
+ async getInternalAddress() {
22
+ return this.getEvmAccount();
23
+ }
24
+ /**
25
+ * Gets an array of Address objects representing the known script addresses for the signer.
26
+ *
27
+ * @returns A promise that resolves to an array of Address objects.
28
+ */
29
+ async getAddressObjs() {
30
+ const account = await this.getEvmAccount();
31
+ return [
32
+ await this._getOmniLockEvmAddressObj(account),
33
+ await this._getOmniLockOldEvmAddressObj(account),
34
+ ];
35
+ }
36
+ async _getOmniLockEvmAddressObj(account) {
37
+ return address_1.Address.fromKnownScript(client_1.KnownScript.OmniLock, (0, hex_1.hexFrom)([0x12, ...(0, bytes_1.bytesFrom)(account), 0x00]), this.client);
38
+ }
39
+ async _getOmniLockOldEvmAddressObj(account) {
40
+ return address_1.Address.fromKnownScript(client_1.KnownScript.OmniLock, (0, hex_1.hexFrom)([0x1, ...(0, bytes_1.bytesFrom)(account), 0x00]), this.client);
41
+ }
42
+ /**
43
+ * prepare a transaction before signing. This method is not implemented and should be overridden by subclasses.
44
+ *
45
+ * @param txLike - The transaction to prepare, represented as a TransactionLike object.
46
+ * @returns A promise that resolves to the prepared Transaction object.
47
+ */
48
+ async prepareTransaction(txLike) {
49
+ const addresses = await this.getAddressObjs();
50
+ return addresses.reduce((txPromise, { script }) => txPromise.then((tx) => tx.prepareSighashAllWitness(script, 85, this.client)), Promise.resolve(ckb_1.Transaction.from(txLike)));
51
+ }
52
+ /**
53
+ * Signs a transaction without modifying it.
54
+ *
55
+ * @param txLike - The transaction to sign, represented as a TransactionLike object.
56
+ * @returns A promise that resolves to a signed Transaction object.
57
+ */
58
+ async signOnlyTransaction(txLike) {
59
+ let tx = ckb_1.Transaction.from(txLike);
60
+ const account = await this.getEvmAccount();
61
+ const { script: evmScript } = await this._getOmniLockEvmAddressObj(account);
62
+ const { script: oldEvmScript } = await this._getOmniLockOldEvmAddressObj(account);
63
+ tx = await this._signOmniLockScriptForTransaction(tx, evmScript, (hash) => `CKB transaction: ${hash}`);
64
+ tx = await this._signOmniLockScriptForTransaction(tx, oldEvmScript, (hash) => (0, bytes_1.bytesFrom)(hash));
65
+ return tx;
66
+ }
67
+ async _signOmniLockScriptForTransaction(tx, script, messageTransformer) {
68
+ const info = await tx.getSignHashInfo(script, this.client);
69
+ if (!info) {
70
+ return tx;
71
+ }
72
+ const signature = (0, bytes_1.bytesFrom)(await this.signMessage(messageTransformer(info.message)));
73
+ if (signature[signature.length - 1] >= 27) {
74
+ signature[signature.length - 1] -= 27;
75
+ }
76
+ const witness = ckb_1.WitnessArgs.fromBytes(tx.witnesses[info.position]);
77
+ witness.lock = (0, hex_1.hexFrom)((0, bytes_1.bytesConcat)((0, num_1.numToBytes)(5 * 4 + signature.length, 4), (0, num_1.numToBytes)(4 * 4, 4), (0, num_1.numToBytes)(5 * 4 + signature.length, 4), (0, num_1.numToBytes)(5 * 4 + signature.length, 4), (0, num_1.numToBytes)(signature.length, 4), signature));
78
+ tx.witnesses[info.position] = (0, hex_1.hexFrom)(witness.toBytes());
79
+ return tx;
80
+ }
81
+ }
82
+ exports.SignerEvm = SignerEvm;
@@ -0,0 +1,52 @@
1
+ import { Client } from "../../client";
2
+ import { HexLike } from "../../hex";
3
+ import { SignerEvm } from "./signerEvm";
4
+ /**
5
+ * A class extending SignerEvm that provides read-only access to an EVM address.
6
+ * This class does not support signing operations.
7
+ */
8
+ export declare class SignerEvmAddressReadonly extends SignerEvm {
9
+ private readonly address;
10
+ /**
11
+ * Creates an instance of SignerEvmAddressReadonly.
12
+ *
13
+ * @param client - The client instance used for communication.
14
+ * @param address - The EVM address associated with the signer.
15
+ */
16
+ constructor(client: Client, address: HexLike);
17
+ /**
18
+ * Construct a new signer with the client replaced.
19
+ *
20
+ * @returns A promise that resolves the new Signer.
21
+ */
22
+ replaceClient(client: Client): Promise<SignerEvmAddressReadonly>;
23
+ /**
24
+ * Connects to the client. This implementation does nothing as the class is read-only.
25
+ *
26
+ * @returns A promise that resolves when the connection is complete.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * await signer.connect();
31
+ * ```
32
+ */
33
+ connect(): Promise<void>;
34
+ /**
35
+ * Check if the signer is connected.
36
+ *
37
+ * @returns A promise that resolves the connection status.
38
+ */
39
+ isConnected(): Promise<boolean>;
40
+ /**
41
+ * Gets the EVM account associated with the signer.
42
+ *
43
+ * @returns A promise that resolves to a string representing the EVM account.
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * const account = await signer.getEvmAccount(); // Outputs the EVM account
48
+ * ```
49
+ */
50
+ getEvmAccount(): Promise<string>;
51
+ }
52
+ //# sourceMappingURL=signerEvmAddressReadonly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signerEvmAddressReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/signerEvmAddressReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAO,OAAO,EAAW,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,SAAS;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAM;IAE9B;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAM5C;;;;OAIG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAItE;;;;;;;;;OASG;IAEG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;CAGvC"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignerEvmAddressReadonly = void 0;
4
+ const hex_1 = require("../../hex");
5
+ const signerEvm_1 = require("./signerEvm");
6
+ /**
7
+ * A class extending SignerEvm that provides read-only access to an EVM address.
8
+ * This class does not support signing operations.
9
+ */
10
+ class SignerEvmAddressReadonly extends signerEvm_1.SignerEvm {
11
+ /**
12
+ * Creates an instance of SignerEvmAddressReadonly.
13
+ *
14
+ * @param client - The client instance used for communication.
15
+ * @param address - The EVM address associated with the signer.
16
+ */
17
+ constructor(client, address) {
18
+ super(client);
19
+ this.address = (0, hex_1.hexFrom)(address);
20
+ }
21
+ /**
22
+ * Construct a new signer with the client replaced.
23
+ *
24
+ * @returns A promise that resolves the new Signer.
25
+ */
26
+ async replaceClient(client) {
27
+ return new SignerEvmAddressReadonly(client, this.address);
28
+ }
29
+ /**
30
+ * Connects to the client. This implementation does nothing as the class is read-only.
31
+ *
32
+ * @returns A promise that resolves when the connection is complete.
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * await signer.connect();
37
+ * ```
38
+ */
39
+ async connect() { }
40
+ /**
41
+ * Check if the signer is connected.
42
+ *
43
+ * @returns A promise that resolves the connection status.
44
+ */
45
+ async isConnected() {
46
+ return true;
47
+ }
48
+ /**
49
+ * Gets the EVM account associated with the signer.
50
+ *
51
+ * @returns A promise that resolves to a string representing the EVM account.
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const account = await signer.getEvmAccount(); // Outputs the EVM account
56
+ * ```
57
+ */
58
+ async getEvmAccount() {
59
+ return this.address;
60
+ }
61
+ }
62
+ exports.SignerEvmAddressReadonly = SignerEvmAddressReadonly;
@@ -0,0 +1,5 @@
1
+ export * from "./btc";
2
+ export * from "./ckb";
3
+ export * from "./evm";
4
+ export * from "./signer";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signer/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,20 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./btc"), exports);
18
+ __exportStar(require("./ckb"), exports);
19
+ __exportStar(require("./evm"), exports);
20
+ __exportStar(require("./signer"), exports);
@@ -0,0 +1,133 @@
1
+ import { Address } from "../address";
2
+ import { BytesLike } from "../bytes";
3
+ import { Transaction, TransactionLike } from "../ckb";
4
+ import { Client } from "../client";
5
+ import { Hex } from "../hex";
6
+ /**
7
+ * An abstract class representing a generic signer.
8
+ * This class provides methods to connect, get addresses, and sign transactions.
9
+ */
10
+ export declare abstract class Signer {
11
+ protected client_: Client;
12
+ constructor(client_: Client);
13
+ get client(): Client;
14
+ /**
15
+ * Construct a new signer with the client replaced.
16
+ *
17
+ * @returns A promise that resolves the new Signer.
18
+ */
19
+ abstract replaceClient(client: Client): Promise<Signer>;
20
+ /**
21
+ * Connects to the signer.
22
+ *
23
+ * @returns A promise that resolves when the connection is complete.
24
+ */
25
+ abstract connect(): Promise<void>;
26
+ /**
27
+ * Disconnects to the signer.
28
+ *
29
+ * @returns A promise that resolves when disconnected.
30
+ */
31
+ disconnect(): Promise<void>;
32
+ /**
33
+ * Check if the signer is connected.
34
+ *
35
+ * @returns A promise that resolves the connection status.
36
+ */
37
+ abstract isConnected(): Promise<boolean>;
38
+ /**
39
+ * Gets the internal address associated with the signer.
40
+ *
41
+ * @returns A promise that resolves to a string representing the internal address.
42
+ */
43
+ abstract getInternalAddress(): Promise<string>;
44
+ /**
45
+ * Gets an array of Address objects associated with the signer.
46
+ *
47
+ * @returns A promise that resolves to an array of Address objects.
48
+ */
49
+ abstract getAddressObjs(): Promise<Address[]>;
50
+ /**
51
+ * Gets the recommended Address object for the signer.
52
+ *
53
+ * @param _preference - Optional preference parameter.
54
+ * @returns A promise that resolves to the recommended Address object.
55
+ */
56
+ getRecommendedAddressObj(_preference?: unknown): Promise<Address>;
57
+ /**
58
+ * Gets the recommended address for the signer as a string.
59
+ *
60
+ * @param preference - Optional preference parameter.
61
+ * @returns A promise that resolves to the recommended address as a string.
62
+ */
63
+ getRecommendedAddress(preference?: unknown): Promise<string>;
64
+ /**
65
+ * Gets an array of addresses associated with the signer as strings.
66
+ *
67
+ * @returns A promise that resolves to an array of addresses as strings.
68
+ */
69
+ getAddresses(): Promise<string[]>;
70
+ /**
71
+ * Signs a message. This method is not implemented and should be overridden by subclasses.
72
+ *
73
+ * @param _ - The message to sign, as a string or BytesLike object.
74
+ * @returns A promise that resolves to the signed message as a string.
75
+ * @throws Will throw an error if not implemented.
76
+ */
77
+ signMessage(_: string | BytesLike): Promise<string>;
78
+ /**
79
+ * Sends a transaction after signing it.
80
+ *
81
+ * @param tx - The transaction to send, represented as a TransactionLike object.
82
+ * @returns A promise that resolves to the transaction hash as a Hex string.
83
+ */
84
+ sendTransaction(tx: TransactionLike): Promise<Hex>;
85
+ /**
86
+ * Signs a transaction.
87
+ *
88
+ * @param tx - The transaction to sign, represented as a TransactionLike object.
89
+ * @returns A promise that resolves to the signed Transaction object.
90
+ */
91
+ signTransaction(tx: TransactionLike): Promise<Transaction>;
92
+ /**
93
+ * prepare a transaction before signing. This method is not implemented and should be overridden by subclasses.
94
+ *
95
+ * @param _ - The transaction to prepare, represented as a TransactionLike object.
96
+ * @returns A promise that resolves to the prepared Transaction object.
97
+ * @throws Will throw an error if not implemented.
98
+ */
99
+ prepareTransaction(_: TransactionLike): Promise<Transaction>;
100
+ /**
101
+ * Signs a transaction without sending it. This method is not implemented and should be overridden by subclasses.
102
+ *
103
+ * @param _ - The transaction to sign, represented as a TransactionLike object.
104
+ * @returns A promise that resolves to the signed Transaction object.
105
+ * @throws Will throw an error if not implemented.
106
+ */
107
+ signOnlyTransaction(_: TransactionLike): Promise<Transaction>;
108
+ }
109
+ /**
110
+ * An enumeration of signer types.
111
+ */
112
+ export declare enum SignerType {
113
+ EVM = "EVM",
114
+ BTC = "BTC",
115
+ CKB = "CKB"
116
+ }
117
+ /**
118
+ * A class representing information about a signer, including its type and the signer instance.
119
+ */
120
+ export declare class SignerInfo {
121
+ name: string;
122
+ type: SignerType;
123
+ signer: Signer;
124
+ constructor(name: string, type: SignerType, signer: Signer);
125
+ }
126
+ /**
127
+ * Represents a wallet with a name, icon, and an array of signer information.
128
+ */
129
+ export type Wallet = {
130
+ name: string;
131
+ icon: string;
132
+ };
133
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/signer/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B;;;GAGG;AACH,8BAAsB,MAAM;IACd,SAAS,CAAC,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;IAErC,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAEvD;;;;OAIG;IACH,QAAQ,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAEjC;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAE9C;;;;OAIG;IACH,QAAQ,CAAC,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAE7C;;;;;OAKG;IACG,wBAAwB,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvE;;;;;OAKG;IACG,qBAAqB,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAIlE;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAMvC;;;;;;OAMG;IACH,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAInD;;;;;OAKG;IACG,eAAe,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC;IAIxD;;;;;OAKG;IACG,eAAe,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAKhE;;;;;;OAMG;IACH,kBAAkB,CAAC,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAI5D;;;;;;OAMG;IACH,mBAAmB,CAAC,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CAG9D;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,qBAAa,UAAU;IAEZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,MAAM;gBAFd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM;CAExB;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignerInfo = exports.SignerType = exports.Signer = void 0;
4
+ /**
5
+ * An abstract class representing a generic signer.
6
+ * This class provides methods to connect, get addresses, and sign transactions.
7
+ */
8
+ class Signer {
9
+ constructor(client_) {
10
+ this.client_ = client_;
11
+ }
12
+ get client() {
13
+ return this.client_;
14
+ }
15
+ /**
16
+ * Disconnects to the signer.
17
+ *
18
+ * @returns A promise that resolves when disconnected.
19
+ */
20
+ async disconnect() { }
21
+ /**
22
+ * Gets the recommended Address object for the signer.
23
+ *
24
+ * @param _preference - Optional preference parameter.
25
+ * @returns A promise that resolves to the recommended Address object.
26
+ */
27
+ async getRecommendedAddressObj(_preference) {
28
+ return (await this.getAddressObjs())[0];
29
+ }
30
+ /**
31
+ * Gets the recommended address for the signer as a string.
32
+ *
33
+ * @param preference - Optional preference parameter.
34
+ * @returns A promise that resolves to the recommended address as a string.
35
+ */
36
+ async getRecommendedAddress(preference) {
37
+ return (await this.getRecommendedAddressObj(preference)).toString();
38
+ }
39
+ /**
40
+ * Gets an array of addresses associated with the signer as strings.
41
+ *
42
+ * @returns A promise that resolves to an array of addresses as strings.
43
+ */
44
+ async getAddresses() {
45
+ return this.getAddressObjs().then((addresses) => addresses.map((address) => address.toString()));
46
+ }
47
+ /**
48
+ * Signs a message. This method is not implemented and should be overridden by subclasses.
49
+ *
50
+ * @param _ - The message to sign, as a string or BytesLike object.
51
+ * @returns A promise that resolves to the signed message as a string.
52
+ * @throws Will throw an error if not implemented.
53
+ */
54
+ signMessage(_) {
55
+ throw Error("Signer.signMessage not implemented");
56
+ }
57
+ /**
58
+ * Sends a transaction after signing it.
59
+ *
60
+ * @param tx - The transaction to send, represented as a TransactionLike object.
61
+ * @returns A promise that resolves to the transaction hash as a Hex string.
62
+ */
63
+ async sendTransaction(tx) {
64
+ return this.client.sendTransaction(await this.signTransaction(tx));
65
+ }
66
+ /**
67
+ * Signs a transaction.
68
+ *
69
+ * @param tx - The transaction to sign, represented as a TransactionLike object.
70
+ * @returns A promise that resolves to the signed Transaction object.
71
+ */
72
+ async signTransaction(tx) {
73
+ const preparedTx = await this.prepareTransaction(tx);
74
+ return this.signOnlyTransaction(preparedTx);
75
+ }
76
+ /**
77
+ * prepare a transaction before signing. This method is not implemented and should be overridden by subclasses.
78
+ *
79
+ * @param _ - The transaction to prepare, represented as a TransactionLike object.
80
+ * @returns A promise that resolves to the prepared Transaction object.
81
+ * @throws Will throw an error if not implemented.
82
+ */
83
+ prepareTransaction(_) {
84
+ throw Error("Signer.prepareTransaction not implemented");
85
+ }
86
+ /**
87
+ * Signs a transaction without sending it. This method is not implemented and should be overridden by subclasses.
88
+ *
89
+ * @param _ - The transaction to sign, represented as a TransactionLike object.
90
+ * @returns A promise that resolves to the signed Transaction object.
91
+ * @throws Will throw an error if not implemented.
92
+ */
93
+ signOnlyTransaction(_) {
94
+ throw Error("Signer.signOnlyTransaction not implemented");
95
+ }
96
+ }
97
+ exports.Signer = Signer;
98
+ /**
99
+ * An enumeration of signer types.
100
+ */
101
+ var SignerType;
102
+ (function (SignerType) {
103
+ SignerType["EVM"] = "EVM";
104
+ SignerType["BTC"] = "BTC";
105
+ SignerType["CKB"] = "CKB";
106
+ })(SignerType || (exports.SignerType = SignerType = {}));
107
+ /**
108
+ * A class representing information about a signer, including its type and the signer instance.
109
+ */
110
+ class SignerInfo {
111
+ constructor(name, type, signer) {
112
+ this.name = name;
113
+ this.type = type;
114
+ this.signer = signer;
115
+ }
116
+ }
117
+ exports.SignerInfo = SignerInfo;