@gnolang/tm2-js-client 1.3.2 → 2.0.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 (312) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.cjs +12 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.mjs +12 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.cjs +14 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.mjs +14 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.cjs +9 -0
  7. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.mjs +9 -0
  8. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.cjs +16 -0
  9. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.mjs +11 -0
  10. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  11. package/dist/index.cjs +92 -0
  12. package/dist/index.cjs.map +1 -0
  13. package/dist/index.d.cts +23 -0
  14. package/dist/index.d.cts.map +1 -0
  15. package/dist/index.d.mts +23 -0
  16. package/dist/index.d.mts.map +1 -0
  17. package/dist/index.mjs +22 -0
  18. package/dist/index.mjs.map +1 -0
  19. package/dist/proto/google/protobuf/any.cjs +84 -0
  20. package/dist/proto/google/protobuf/any.cjs.map +1 -0
  21. package/dist/proto/google/protobuf/any.d.cts +141 -0
  22. package/dist/proto/google/protobuf/any.d.cts.map +1 -0
  23. package/dist/proto/google/protobuf/any.d.mts +141 -0
  24. package/dist/proto/google/protobuf/any.d.mts.map +1 -0
  25. package/dist/proto/google/protobuf/any.mjs +83 -0
  26. package/dist/proto/google/protobuf/any.mjs.map +1 -0
  27. package/dist/proto/index.cjs +2 -0
  28. package/dist/proto/index.d.cts +2 -0
  29. package/dist/proto/index.d.mts +2 -0
  30. package/dist/proto/index.mjs +3 -0
  31. package/dist/proto/tm2/abci.cjs +182 -0
  32. package/dist/proto/tm2/abci.cjs.map +1 -0
  33. package/dist/proto/tm2/abci.d.cts +33 -0
  34. package/dist/proto/tm2/abci.d.cts.map +1 -0
  35. package/dist/proto/tm2/abci.d.mts +33 -0
  36. package/dist/proto/tm2/abci.d.mts.map +1 -0
  37. package/dist/proto/tm2/abci.mjs +181 -0
  38. package/dist/proto/tm2/abci.mjs.map +1 -0
  39. package/dist/proto/tm2/tx.cjs +263 -0
  40. package/dist/proto/tm2/tx.cjs.map +1 -0
  41. package/dist/proto/tm2/tx.d.cts +49 -0
  42. package/dist/proto/tm2/tx.d.cts.map +1 -0
  43. package/dist/proto/tm2/tx.d.mts +49 -0
  44. package/dist/proto/tm2/tx.d.mts.map +1 -0
  45. package/dist/proto/tm2/tx.mjs +258 -0
  46. package/dist/proto/tm2/tx.mjs.map +1 -0
  47. package/dist/provider/endpoints.cjs +43 -0
  48. package/dist/provider/endpoints.cjs.map +1 -0
  49. package/dist/provider/endpoints.d.cts +33 -0
  50. package/dist/provider/endpoints.d.cts.map +1 -0
  51. package/dist/provider/endpoints.d.mts +33 -0
  52. package/dist/provider/endpoints.d.mts.map +1 -0
  53. package/dist/provider/endpoints.mjs +39 -0
  54. package/dist/provider/endpoints.mjs.map +1 -0
  55. package/dist/provider/errors/errors.cjs +122 -0
  56. package/dist/provider/errors/errors.cjs.map +1 -0
  57. package/dist/provider/errors/errors.d.cts +62 -0
  58. package/dist/provider/errors/errors.d.cts.map +1 -0
  59. package/dist/provider/errors/errors.d.mts +62 -0
  60. package/dist/provider/errors/errors.d.mts.map +1 -0
  61. package/dist/provider/errors/errors.mjs +104 -0
  62. package/dist/provider/errors/errors.mjs.map +1 -0
  63. package/dist/provider/errors/messages.cjs +40 -0
  64. package/dist/provider/errors/messages.cjs.map +1 -0
  65. package/dist/provider/errors/messages.mjs +23 -0
  66. package/dist/provider/errors/messages.mjs.map +1 -0
  67. package/dist/provider/index.cjs +12 -0
  68. package/dist/provider/index.d.cts +11 -0
  69. package/dist/provider/index.d.mts +11 -0
  70. package/dist/provider/index.mjs +13 -0
  71. package/dist/provider/jsonrpc/index.cjs +1 -0
  72. package/dist/provider/jsonrpc/index.d.cts +1 -0
  73. package/dist/provider/jsonrpc/index.d.mts +1 -0
  74. package/dist/provider/jsonrpc/index.mjs +2 -0
  75. package/dist/provider/jsonrpc/jsonrpc.cjs +20 -0
  76. package/dist/provider/jsonrpc/jsonrpc.cjs.map +1 -0
  77. package/dist/provider/jsonrpc/jsonrpc.d.cts +16 -0
  78. package/dist/provider/jsonrpc/jsonrpc.d.cts.map +1 -0
  79. package/dist/provider/jsonrpc/jsonrpc.d.mts +16 -0
  80. package/dist/provider/jsonrpc/jsonrpc.d.mts.map +1 -0
  81. package/dist/provider/jsonrpc/jsonrpc.mjs +19 -0
  82. package/dist/provider/jsonrpc/jsonrpc.mjs.map +1 -0
  83. package/dist/provider/provider.cjs +130 -0
  84. package/dist/provider/provider.cjs.map +1 -0
  85. package/dist/provider/provider.d.cts +130 -0
  86. package/dist/provider/provider.d.cts.map +1 -0
  87. package/dist/provider/provider.d.mts +130 -0
  88. package/dist/provider/provider.d.mts.map +1 -0
  89. package/dist/provider/provider.mjs +130 -0
  90. package/dist/provider/provider.mjs.map +1 -0
  91. package/dist/provider/types/abci.cjs +6 -0
  92. package/dist/provider/types/abci.cjs.map +1 -0
  93. package/dist/provider/types/abci.d.cts +42 -0
  94. package/dist/provider/types/abci.d.cts.map +1 -0
  95. package/dist/provider/types/abci.d.mts +42 -0
  96. package/dist/provider/types/abci.d.mts.map +1 -0
  97. package/dist/provider/types/abci.mjs +6 -0
  98. package/dist/provider/types/abci.mjs.map +1 -0
  99. package/dist/provider/types/common.d.cts +186 -0
  100. package/dist/provider/types/common.d.cts.map +1 -0
  101. package/dist/provider/types/common.d.mts +186 -0
  102. package/dist/provider/types/common.d.mts.map +1 -0
  103. package/dist/provider/types/jsonrpc.d.cts +30 -0
  104. package/dist/provider/types/jsonrpc.d.cts.map +1 -0
  105. package/dist/provider/types/jsonrpc.d.mts +30 -0
  106. package/dist/provider/types/jsonrpc.d.mts.map +1 -0
  107. package/dist/provider/utility/adapters.cjs +241 -0
  108. package/dist/provider/utility/adapters.cjs.map +1 -0
  109. package/dist/provider/utility/adapters.d.cts +19 -0
  110. package/dist/provider/utility/adapters.d.cts.map +1 -0
  111. package/dist/provider/utility/adapters.d.mts +19 -0
  112. package/dist/provider/utility/adapters.d.mts.map +1 -0
  113. package/dist/provider/utility/adapters.mjs +231 -0
  114. package/dist/provider/utility/adapters.mjs.map +1 -0
  115. package/dist/provider/utility/errors.utility.cjs +38 -0
  116. package/dist/provider/utility/errors.utility.cjs.map +1 -0
  117. package/dist/provider/utility/errors.utility.mjs +38 -0
  118. package/dist/provider/utility/errors.utility.mjs.map +1 -0
  119. package/dist/provider/utility/index.cjs +3 -0
  120. package/dist/provider/utility/index.d.cts +3 -0
  121. package/dist/provider/utility/index.d.mts +3 -0
  122. package/dist/provider/utility/index.mjs +4 -0
  123. package/dist/provider/utility/provider.utility.cjs +122 -0
  124. package/dist/provider/utility/provider.utility.cjs.map +1 -0
  125. package/{bin/provider/utility/provider.utility.d.ts → dist/provider/utility/provider.utility.d.cts} +15 -10
  126. package/dist/provider/utility/provider.utility.d.cts.map +1 -0
  127. package/dist/provider/utility/provider.utility.d.mts +45 -0
  128. package/dist/provider/utility/provider.utility.d.mts.map +1 -0
  129. package/dist/provider/utility/provider.utility.mjs +116 -0
  130. package/dist/provider/utility/provider.utility.mjs.map +1 -0
  131. package/dist/provider/utility/requests.utility.cjs +75 -0
  132. package/dist/provider/utility/requests.utility.cjs.map +1 -0
  133. package/dist/provider/utility/requests.utility.d.cts +40 -0
  134. package/dist/provider/utility/requests.utility.d.cts.map +1 -0
  135. package/dist/provider/utility/requests.utility.d.mts +40 -0
  136. package/dist/provider/utility/requests.utility.d.mts.map +1 -0
  137. package/dist/provider/utility/requests.utility.mjs +68 -0
  138. package/dist/provider/utility/requests.utility.mjs.map +1 -0
  139. package/dist/provider/websocket/index.cjs +1 -0
  140. package/dist/provider/websocket/index.d.cts +1 -0
  141. package/dist/provider/websocket/index.d.mts +1 -0
  142. package/dist/provider/websocket/index.mjs +2 -0
  143. package/dist/provider/websocket/ws.cjs +27 -0
  144. package/dist/provider/websocket/ws.cjs.map +1 -0
  145. package/dist/provider/websocket/ws.d.cts +21 -0
  146. package/dist/provider/websocket/ws.d.cts.map +1 -0
  147. package/dist/provider/websocket/ws.d.mts +21 -0
  148. package/dist/provider/websocket/ws.d.mts.map +1 -0
  149. package/dist/provider/websocket/ws.mjs +26 -0
  150. package/dist/provider/websocket/ws.mjs.map +1 -0
  151. package/dist/services/index.cjs +1 -0
  152. package/dist/services/index.d.cts +2 -0
  153. package/dist/services/index.d.mts +2 -0
  154. package/dist/services/index.mjs +2 -0
  155. package/dist/services/rest/restService.cjs +16 -0
  156. package/dist/services/rest/restService.cjs.map +1 -0
  157. package/dist/services/rest/restService.d.cts +9 -0
  158. package/dist/services/rest/restService.d.cts.map +1 -0
  159. package/dist/services/rest/restService.d.mts +9 -0
  160. package/dist/services/rest/restService.d.mts.map +1 -0
  161. package/dist/services/rest/restService.mjs +14 -0
  162. package/dist/services/rest/restService.mjs.map +1 -0
  163. package/dist/services/rest/restService.types.d.cts +11 -0
  164. package/dist/services/rest/restService.types.d.cts.map +1 -0
  165. package/dist/services/rest/restService.types.d.mts +11 -0
  166. package/dist/services/rest/restService.types.d.mts.map +1 -0
  167. package/dist/wallet/index.cjs +8 -0
  168. package/dist/wallet/index.d.cts +7 -0
  169. package/dist/wallet/index.d.mts +7 -0
  170. package/dist/wallet/index.mjs +9 -0
  171. package/dist/wallet/key/index.cjs +1 -0
  172. package/dist/wallet/key/index.mjs +2 -0
  173. package/dist/wallet/key/key.cjs +46 -0
  174. package/dist/wallet/key/key.cjs.map +1 -0
  175. package/dist/wallet/key/key.d.cts +26 -0
  176. package/dist/wallet/key/key.d.cts.map +1 -0
  177. package/dist/wallet/key/key.d.mts +26 -0
  178. package/dist/wallet/key/key.d.mts.map +1 -0
  179. package/dist/wallet/key/key.mjs +45 -0
  180. package/dist/wallet/key/key.mjs.map +1 -0
  181. package/dist/wallet/ledger/index.cjs +1 -0
  182. package/dist/wallet/ledger/index.d.cts +1 -0
  183. package/dist/wallet/ledger/index.d.mts +1 -0
  184. package/dist/wallet/ledger/index.mjs +2 -0
  185. package/dist/wallet/ledger/ledger.cjs +49 -0
  186. package/dist/wallet/ledger/ledger.cjs.map +1 -0
  187. package/dist/wallet/ledger/ledger.d.cts +27 -0
  188. package/dist/wallet/ledger/ledger.d.cts.map +1 -0
  189. package/dist/wallet/ledger/ledger.d.mts +27 -0
  190. package/dist/wallet/ledger/ledger.d.mts.map +1 -0
  191. package/dist/wallet/ledger/ledger.mjs +48 -0
  192. package/dist/wallet/ledger/ledger.mjs.map +1 -0
  193. package/dist/wallet/signer.d.cts +33 -0
  194. package/dist/wallet/signer.d.cts.map +1 -0
  195. package/dist/wallet/signer.d.mts +33 -0
  196. package/dist/wallet/signer.d.mts.map +1 -0
  197. package/dist/wallet/types/sign.cjs +6 -0
  198. package/dist/wallet/types/sign.cjs.map +1 -0
  199. package/dist/wallet/types/sign.d.cts +20 -0
  200. package/dist/wallet/types/sign.d.cts.map +1 -0
  201. package/dist/wallet/types/sign.d.mts +20 -0
  202. package/dist/wallet/types/sign.d.mts.map +1 -0
  203. package/dist/wallet/types/sign.mjs +6 -0
  204. package/dist/wallet/types/sign.mjs.map +1 -0
  205. package/dist/wallet/types/wallet.d.cts +9 -0
  206. package/dist/wallet/types/wallet.d.cts.map +1 -0
  207. package/dist/wallet/types/wallet.d.mts +9 -0
  208. package/dist/wallet/types/wallet.d.mts.map +1 -0
  209. package/dist/wallet/utility/index.cjs +1 -0
  210. package/dist/wallet/utility/index.d.cts +1 -0
  211. package/dist/wallet/utility/index.d.mts +1 -0
  212. package/dist/wallet/utility/index.mjs +2 -0
  213. package/dist/wallet/utility/utility.cjs +83 -0
  214. package/dist/wallet/utility/utility.cjs.map +1 -0
  215. package/dist/wallet/utility/utility.d.cts +42 -0
  216. package/dist/wallet/utility/utility.d.cts.map +1 -0
  217. package/dist/wallet/utility/utility.d.mts +42 -0
  218. package/dist/wallet/utility/utility.d.mts.map +1 -0
  219. package/dist/wallet/utility/utility.mjs +75 -0
  220. package/dist/wallet/utility/utility.mjs.map +1 -0
  221. package/dist/wallet/wallet.cjs +223 -0
  222. package/dist/wallet/wallet.cjs.map +1 -0
  223. package/dist/wallet/wallet.d.cts +113 -0
  224. package/dist/wallet/wallet.d.cts.map +1 -0
  225. package/dist/wallet/wallet.d.mts +113 -0
  226. package/dist/wallet/wallet.d.mts.map +1 -0
  227. package/dist/wallet/wallet.mjs +222 -0
  228. package/dist/wallet/wallet.mjs.map +1 -0
  229. package/package.json +57 -38
  230. package/bin/index.d.ts +0 -4
  231. package/bin/index.js +0 -20
  232. package/bin/proto/google/protobuf/any.d.ts +0 -145
  233. package/bin/proto/google/protobuf/any.js +0 -113
  234. package/bin/proto/index.d.ts +0 -2
  235. package/bin/proto/index.js +0 -20
  236. package/bin/proto/tm2/abci.d.ts +0 -37
  237. package/bin/proto/tm2/abci.js +0 -277
  238. package/bin/proto/tm2/tx.d.ts +0 -52
  239. package/bin/proto/tm2/tx.js +0 -360
  240. package/bin/provider/endpoints.d.ts +0 -29
  241. package/bin/provider/endpoints.js +0 -37
  242. package/bin/provider/errors/errors.d.ts +0 -59
  243. package/bin/provider/errors/errors.js +0 -173
  244. package/bin/provider/errors/index.d.ts +0 -1
  245. package/bin/provider/errors/index.js +0 -17
  246. package/bin/provider/errors/messages.d.ts +0 -19
  247. package/bin/provider/errors/messages.js +0 -41
  248. package/bin/provider/index.d.ts +0 -7
  249. package/bin/provider/index.js +0 -23
  250. package/bin/provider/jsonrpc/index.d.ts +0 -1
  251. package/bin/provider/jsonrpc/index.js +0 -17
  252. package/bin/provider/jsonrpc/jsonrpc.d.ts +0 -31
  253. package/bin/provider/jsonrpc/jsonrpc.js +0 -327
  254. package/bin/provider/jsonrpc/jsonrpc.test.d.ts +0 -1
  255. package/bin/provider/jsonrpc/jsonrpc.test.js +0 -488
  256. package/bin/provider/provider.d.ts +0 -98
  257. package/bin/provider/provider.js +0 -2
  258. package/bin/provider/types/abci.d.ts +0 -39
  259. package/bin/provider/types/abci.js +0 -4
  260. package/bin/provider/types/common.d.ts +0 -184
  261. package/bin/provider/types/common.js +0 -3
  262. package/bin/provider/types/index.d.ts +0 -3
  263. package/bin/provider/types/index.js +0 -19
  264. package/bin/provider/types/jsonrpc.d.ts +0 -26
  265. package/bin/provider/types/jsonrpc.js +0 -2
  266. package/bin/provider/utility/errors.utility.d.ts +0 -11
  267. package/bin/provider/utility/errors.utility.js +0 -56
  268. package/bin/provider/utility/index.d.ts +0 -2
  269. package/bin/provider/utility/index.js +0 -18
  270. package/bin/provider/utility/provider.utility.js +0 -244
  271. package/bin/provider/utility/requests.utility.d.ts +0 -35
  272. package/bin/provider/utility/requests.utility.js +0 -80
  273. package/bin/provider/websocket/index.d.ts +0 -1
  274. package/bin/provider/websocket/index.js +0 -17
  275. package/bin/provider/websocket/ws.d.ts +0 -58
  276. package/bin/provider/websocket/ws.js +0 -415
  277. package/bin/provider/websocket/ws.test.d.ts +0 -1
  278. package/bin/provider/websocket/ws.test.js +0 -648
  279. package/bin/services/index.d.ts +0 -2
  280. package/bin/services/index.js +0 -18
  281. package/bin/services/rest/restService.d.ts +0 -4
  282. package/bin/services/rest/restService.js +0 -72
  283. package/bin/services/rest/restService.types.d.ts +0 -6
  284. package/bin/services/rest/restService.types.js +0 -2
  285. package/bin/wallet/index.d.ts +0 -6
  286. package/bin/wallet/index.js +0 -22
  287. package/bin/wallet/key/index.d.ts +0 -1
  288. package/bin/wallet/key/index.js +0 -17
  289. package/bin/wallet/key/key.d.ts +0 -21
  290. package/bin/wallet/key/key.js +0 -102
  291. package/bin/wallet/key/key.test.d.ts +0 -1
  292. package/bin/wallet/key/key.test.js +0 -121
  293. package/bin/wallet/ledger/index.d.ts +0 -1
  294. package/bin/wallet/ledger/index.js +0 -17
  295. package/bin/wallet/ledger/ledger.d.ts +0 -22
  296. package/bin/wallet/ledger/ledger.js +0 -109
  297. package/bin/wallet/signer.d.ts +0 -29
  298. package/bin/wallet/signer.js +0 -2
  299. package/bin/wallet/types/index.d.ts +0 -2
  300. package/bin/wallet/types/index.js +0 -18
  301. package/bin/wallet/types/sign.d.ts +0 -16
  302. package/bin/wallet/types/sign.js +0 -4
  303. package/bin/wallet/types/wallet.d.ts +0 -5
  304. package/bin/wallet/types/wallet.js +0 -2
  305. package/bin/wallet/utility/index.d.ts +0 -1
  306. package/bin/wallet/utility/index.js +0 -17
  307. package/bin/wallet/utility/utility.d.ts +0 -36
  308. package/bin/wallet/utility/utility.js +0 -117
  309. package/bin/wallet/wallet.d.ts +0 -102
  310. package/bin/wallet/wallet.js +0 -354
  311. package/bin/wallet/wallet.test.d.ts +0 -1
  312. package/bin/wallet/wallet.test.js +0 -352
@@ -1,17 +0,0 @@
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("./utility"), exports);
@@ -1,36 +0,0 @@
1
- import { HdPath } from '@cosmjs/crypto';
2
- /**
3
- * Generates the HD path, for the specified index, in the form 'm/44'/118'/0'/0/i',
4
- * where 'i' is the account index
5
- * @param {number} [index=0] the account index
6
- */
7
- export declare const generateHDPath: (index?: number) => HdPath;
8
- /**
9
- * Generates random entropy of the specified size (in B)
10
- * @param {number} [size=32] the entropy size in bytes
11
- */
12
- export declare const generateEntropy: (size?: number) => Uint8Array;
13
- interface keyPair {
14
- privateKey: Uint8Array;
15
- publicKey: Uint8Array;
16
- }
17
- /**
18
- * Generates a new Secp256k1 key-pair using
19
- * the provided English mnemonic and account index
20
- * @param {string} mnemonic the English mnemonic
21
- * @param {number} [accountIndex=0] the account index
22
- */
23
- export declare const generateKeyPair: (mnemonic: string, accountIndex?: number) => Promise<keyPair>;
24
- export declare const defaultAddressPrefix = "g";
25
- /**
26
- * Encodes a string into a Uint8Array
27
- * @param {string} str the string to be encoded
28
- */
29
- export declare const stringToUTF8: (str: string) => Uint8Array;
30
- /**
31
- * Escapes <,>,& in string.
32
- * Golang's json marshaller escapes <,>,& by default.
33
- * https://cs.opensource.google/go/go/+/refs/tags/go1.20.6:src/encoding/json/encode.go;l=46-53
34
- */
35
- export declare function encodeCharacterSet(data: string): string;
36
- export {};
@@ -1,117 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.stringToUTF8 = exports.defaultAddressPrefix = exports.generateKeyPair = exports.generateEntropy = exports.generateHDPath = void 0;
43
- exports.encodeCharacterSet = encodeCharacterSet;
44
- var crypto_1 = require("@cosmjs/crypto");
45
- var crypto_2 = __importDefault(require("crypto"));
46
- /**
47
- * Generates the HD path, for the specified index, in the form 'm/44'/118'/0'/0/i',
48
- * where 'i' is the account index
49
- * @param {number} [index=0] the account index
50
- */
51
- var generateHDPath = function (index) {
52
- return [
53
- crypto_1.Slip10RawIndex.hardened(44),
54
- crypto_1.Slip10RawIndex.hardened(118),
55
- crypto_1.Slip10RawIndex.hardened(0),
56
- crypto_1.Slip10RawIndex.normal(0),
57
- crypto_1.Slip10RawIndex.normal(index ? index : 0),
58
- ];
59
- };
60
- exports.generateHDPath = generateHDPath;
61
- /**
62
- * Generates random entropy of the specified size (in B)
63
- * @param {number} [size=32] the entropy size in bytes
64
- */
65
- var generateEntropy = function (size) {
66
- var array = new Uint8Array(size ? size : 32);
67
- // Generate random data
68
- crypto_2.default.randomFillSync(array);
69
- return array;
70
- };
71
- exports.generateEntropy = generateEntropy;
72
- /**
73
- * Generates a new Secp256k1 key-pair using
74
- * the provided English mnemonic and account index
75
- * @param {string} mnemonic the English mnemonic
76
- * @param {number} [accountIndex=0] the account index
77
- */
78
- var generateKeyPair = function (mnemonic, accountIndex) { return __awaiter(void 0, void 0, void 0, function () {
79
- var seed, privateKey, publicKey;
80
- return __generator(this, function (_a) {
81
- switch (_a.label) {
82
- case 0: return [4 /*yield*/, crypto_1.Bip39.mnemonicToSeed(new crypto_1.EnglishMnemonic(mnemonic))];
83
- case 1:
84
- seed = _a.sent();
85
- privateKey = crypto_1.Slip10.derivePath(crypto_1.Slip10Curve.Secp256k1, seed, (0, exports.generateHDPath)(accountIndex)).privkey;
86
- return [4 /*yield*/, crypto_1.Secp256k1.makeKeypair(privateKey)];
87
- case 2:
88
- publicKey = (_a.sent()).pubkey;
89
- return [2 /*return*/, {
90
- publicKey: publicKey,
91
- privateKey: privateKey,
92
- }];
93
- }
94
- });
95
- }); };
96
- exports.generateKeyPair = generateKeyPair;
97
- // Address prefix for TM2 networks
98
- exports.defaultAddressPrefix = 'g';
99
- /**
100
- * Encodes a string into a Uint8Array
101
- * @param {string} str the string to be encoded
102
- */
103
- var stringToUTF8 = function (str) {
104
- return new TextEncoder().encode(str);
105
- };
106
- exports.stringToUTF8 = stringToUTF8;
107
- /**
108
- * Escapes <,>,& in string.
109
- * Golang's json marshaller escapes <,>,& by default.
110
- * https://cs.opensource.google/go/go/+/refs/tags/go1.20.6:src/encoding/json/encode.go;l=46-53
111
- */
112
- function encodeCharacterSet(data) {
113
- return data
114
- .replace(/</g, '\\u003c')
115
- .replace(/>/g, '\\u003e')
116
- .replace(/&/g, '\\u0026');
117
- }
@@ -1,102 +0,0 @@
1
- import { BroadcastTransactionMap, Provider } from '../provider';
2
- import { Signer } from './signer';
3
- import { LedgerConnector } from '@cosmjs/ledger-amino';
4
- import { Any, Tx } from '../proto';
5
- import { AccountWalletOption, CreateWalletOptions } from './types';
6
- /**
7
- * Wallet is a single account abstraction
8
- * that can interact with the blockchain
9
- */
10
- export declare class Wallet {
11
- protected provider: Provider;
12
- protected signer: Signer;
13
- /**
14
- * Connects the wallet to the specified {@link Provider}
15
- * @param {Provider} provider the active {@link Provider}, if any
16
- */
17
- connect: (provider: Provider) => void;
18
- /**
19
- * Generates a private key-based wallet, using a random seed
20
- * @param {AccountWalletOption} options the account options
21
- */
22
- static createRandom: (options?: AccountWalletOption) => Promise<Wallet>;
23
- /**
24
- * Generates a custom signer-based wallet
25
- * @param {Signer} signer the custom signer implementing the Signer interface
26
- * @param {CreateWalletOptions} options the wallet generation options
27
- */
28
- static fromSigner: (signer: Signer) => Promise<Wallet>;
29
- /**
30
- * Generates a bip39 mnemonic-based wallet
31
- * @param {string} mnemonic the bip39 mnemonic
32
- * @param {CreateWalletOptions} options the wallet generation options
33
- */
34
- static fromMnemonic: (mnemonic: string, options?: CreateWalletOptions) => Promise<Wallet>;
35
- /**
36
- * Generates a private key-based wallet
37
- * @param {string} privateKey the private key
38
- * @param {AccountWalletOption} options the account options
39
- */
40
- static fromPrivateKey: (privateKey: Uint8Array, options?: AccountWalletOption) => Promise<Wallet>;
41
- /**
42
- * Creates a Ledger-based wallet
43
- * @param {LedgerConnector} connector the Ledger device connector
44
- * @param {CreateWalletOptions} options the wallet generation options
45
- */
46
- static fromLedger: (connector: LedgerConnector, options?: CreateWalletOptions) => Wallet;
47
- /**
48
- * Fetches the address associated with the wallet
49
- */
50
- getAddress: () => Promise<string>;
51
- /**
52
- * Fetches the account sequence for the wallet
53
- * @param {number} [height=latest] the block height
54
- */
55
- getAccountSequence: (height?: number) => Promise<number>;
56
- /**
57
- * Fetches the account number for the wallet. Errors out if the
58
- * account is not initialized
59
- * @param {number} [height=latest] the block height
60
- */
61
- getAccountNumber: (height?: number) => Promise<number>;
62
- /**
63
- * Fetches the account balance for the specific denomination
64
- * @param {string} [denomination=ugnot] the fund denomination
65
- */
66
- getBalance: (denomination?: string) => Promise<number>;
67
- /**
68
- * Fetches the current (recommended) average gas price
69
- */
70
- getGasPrice: () => Promise<number>;
71
- /**
72
- * Estimates the gas limit for the transaction
73
- * @param {Tx} tx the transaction that needs estimating
74
- */
75
- estimateGas: (tx: Tx) => Promise<number>;
76
- /**
77
- * Returns the connected provider, if any
78
- */
79
- getProvider: () => Provider;
80
- /**
81
- * Generates a transaction signature, and appends it to the transaction
82
- * @param {Tx} tx the transaction to be signed
83
- * @param {(messages: Any[]) => any[]} decodeTxMessages tx message decode callback
84
- * that should expand the concrete message fields into an object. Required because
85
- * the transaction sign bytes are generated using sorted JSON, which requires
86
- * encoded message values to be decoded for sorting
87
- */
88
- signTransaction: (tx: Tx, decodeTxMessages: (messages: Any[]) => any[]) => Promise<Tx>;
89
- /**
90
- * Encodes and sends the transaction. If the type of endpoint
91
- * is a broadcast commit, waits for the transaction to be committed to the chain.
92
- * The transaction needs to be signed beforehand.
93
- * Returns the transaction hash (base-64)
94
- * @param {Tx} tx the signed transaction
95
- * @param {BroadcastType} endpoint the transaction broadcast type (sync / commit)
96
- */
97
- sendTransaction<K extends keyof BroadcastTransactionMap>(tx: Tx, endpoint: K): Promise<BroadcastTransactionMap[K]['result']>;
98
- /**
99
- * Returns the associated signer
100
- */
101
- getSigner: () => Signer;
102
- }
@@ -1,354 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
50
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
51
- if (ar || !(i in from)) {
52
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
53
- ar[i] = from[i];
54
- }
55
- }
56
- return to.concat(ar || Array.prototype.slice.call(from));
57
- };
58
- Object.defineProperty(exports, "__esModule", { value: true });
59
- exports.Wallet = void 0;
60
- var provider_1 = require("../provider");
61
- var ledger_1 = require("./ledger");
62
- var key_1 = require("./key");
63
- var crypto_1 = require("@cosmjs/crypto");
64
- var utility_1 = require("./utility");
65
- var bip39_1 = require("@cosmjs/crypto/build/bip39");
66
- var proto_1 = require("../proto");
67
- var types_1 = require("./types");
68
- var signdoc_1 = require("@cosmjs/amino/build/signdoc");
69
- /**
70
- * Wallet is a single account abstraction
71
- * that can interact with the blockchain
72
- */
73
- var Wallet = /** @class */ (function () {
74
- function Wallet() {
75
- var _this = this;
76
- /**
77
- * Connects the wallet to the specified {@link Provider}
78
- * @param {Provider} provider the active {@link Provider}, if any
79
- */
80
- this.connect = function (provider) {
81
- _this.provider = provider;
82
- };
83
- // Account manipulation //
84
- /**
85
- * Fetches the address associated with the wallet
86
- */
87
- this.getAddress = function () {
88
- return _this.signer.getAddress();
89
- };
90
- /**
91
- * Fetches the account sequence for the wallet
92
- * @param {number} [height=latest] the block height
93
- */
94
- this.getAccountSequence = function (height) { return __awaiter(_this, void 0, void 0, function () {
95
- var address;
96
- return __generator(this, function (_b) {
97
- switch (_b.label) {
98
- case 0:
99
- if (!this.provider) {
100
- throw new Error('provider not connected');
101
- }
102
- return [4 /*yield*/, this.getAddress()];
103
- case 1:
104
- address = _b.sent();
105
- return [2 /*return*/, this.provider.getAccountSequence(address, height)];
106
- }
107
- });
108
- }); };
109
- /**
110
- * Fetches the account number for the wallet. Errors out if the
111
- * account is not initialized
112
- * @param {number} [height=latest] the block height
113
- */
114
- this.getAccountNumber = function (height) { return __awaiter(_this, void 0, void 0, function () {
115
- var address;
116
- return __generator(this, function (_b) {
117
- switch (_b.label) {
118
- case 0:
119
- if (!this.provider) {
120
- throw new Error('provider not connected');
121
- }
122
- return [4 /*yield*/, this.getAddress()];
123
- case 1:
124
- address = _b.sent();
125
- return [2 /*return*/, this.provider.getAccountNumber(address, height)];
126
- }
127
- });
128
- }); };
129
- /**
130
- * Fetches the account balance for the specific denomination
131
- * @param {string} [denomination=ugnot] the fund denomination
132
- */
133
- this.getBalance = function (denomination) { return __awaiter(_this, void 0, void 0, function () {
134
- var address;
135
- return __generator(this, function (_b) {
136
- switch (_b.label) {
137
- case 0:
138
- if (!this.provider) {
139
- throw new Error('provider not connected');
140
- }
141
- return [4 /*yield*/, this.getAddress()];
142
- case 1:
143
- address = _b.sent();
144
- return [2 /*return*/, this.provider.getBalance(address, denomination ? denomination : 'ugnot')];
145
- }
146
- });
147
- }); };
148
- /**
149
- * Fetches the current (recommended) average gas price
150
- */
151
- this.getGasPrice = function () { return __awaiter(_this, void 0, void 0, function () {
152
- return __generator(this, function (_b) {
153
- if (!this.provider) {
154
- throw new Error('provider not connected');
155
- }
156
- return [2 /*return*/, this.provider.getGasPrice()];
157
- });
158
- }); };
159
- /**
160
- * Estimates the gas limit for the transaction
161
- * @param {Tx} tx the transaction that needs estimating
162
- */
163
- this.estimateGas = function (tx) { return __awaiter(_this, void 0, void 0, function () {
164
- return __generator(this, function (_b) {
165
- if (!this.provider) {
166
- throw new Error('provider not connected');
167
- }
168
- return [2 /*return*/, this.provider.estimateGas(tx)];
169
- });
170
- }); };
171
- /**
172
- * Returns the connected provider, if any
173
- */
174
- this.getProvider = function () {
175
- return _this.provider;
176
- };
177
- /**
178
- * Generates a transaction signature, and appends it to the transaction
179
- * @param {Tx} tx the transaction to be signed
180
- * @param {(messages: Any[]) => any[]} decodeTxMessages tx message decode callback
181
- * that should expand the concrete message fields into an object. Required because
182
- * the transaction sign bytes are generated using sorted JSON, which requires
183
- * encoded message values to be decoded for sorting
184
- */
185
- this.signTransaction = function (tx, decodeTxMessages) { return __awaiter(_this, void 0, void 0, function () {
186
- var status, chainID, address, accountNumber, accountSequence, publicKey, signPayload, signBytes, wrappedKey, txSignature;
187
- var _b;
188
- return __generator(this, function (_c) {
189
- switch (_c.label) {
190
- case 0:
191
- if (!this.provider) {
192
- throw new Error('provider not connected');
193
- }
194
- // Make sure the tx fee is initialized
195
- if (!tx.fee) {
196
- throw new Error('invalid transaction fee provided');
197
- }
198
- return [4 /*yield*/, this.provider.getStatus()];
199
- case 1:
200
- status = _c.sent();
201
- chainID = status.node_info.network;
202
- return [4 /*yield*/, this.getAddress()];
203
- case 2:
204
- address = _c.sent();
205
- return [4 /*yield*/, this.provider.getAccountNumber(address)];
206
- case 3:
207
- accountNumber = _c.sent();
208
- return [4 /*yield*/, this.provider.getAccountSequence(address)];
209
- case 4:
210
- accountSequence = _c.sent();
211
- return [4 /*yield*/, this.signer.getPublicKey()];
212
- case 5:
213
- publicKey = _c.sent();
214
- signPayload = {
215
- chain_id: chainID,
216
- account_number: accountNumber.toString(10),
217
- sequence: accountSequence.toString(10),
218
- fee: {
219
- gas_fee: tx.fee.gas_fee,
220
- gas_wanted: tx.fee.gas_wanted.toString(10),
221
- },
222
- msgs: decodeTxMessages(tx.messages), // unrolled message objects
223
- memo: tx.memo,
224
- };
225
- signBytes = (0, utility_1.stringToUTF8)((0, utility_1.encodeCharacterSet)((0, signdoc_1.sortedJsonStringify)(signPayload)));
226
- wrappedKey = {
227
- key: publicKey,
228
- };
229
- _b = {
230
- pub_key: {
231
- type_url: types_1.Secp256k1PubKeyType,
232
- value: proto_1.PubKeySecp256k1.encode(wrappedKey).finish(),
233
- }
234
- };
235
- return [4 /*yield*/, this.getSigner().signData(signBytes)];
236
- case 6:
237
- txSignature = (_b.signature = _c.sent(),
238
- _b);
239
- // Append the signature
240
- return [2 /*return*/, __assign(__assign({}, tx), { signatures: __spreadArray(__spreadArray([], tx.signatures, true), [txSignature], false) })];
241
- }
242
- });
243
- }); };
244
- /**
245
- * Returns the associated signer
246
- */
247
- this.getSigner = function () {
248
- return _this.signer;
249
- };
250
- }
251
- /**
252
- * Encodes and sends the transaction. If the type of endpoint
253
- * is a broadcast commit, waits for the transaction to be committed to the chain.
254
- * The transaction needs to be signed beforehand.
255
- * Returns the transaction hash (base-64)
256
- * @param {Tx} tx the signed transaction
257
- * @param {BroadcastType} endpoint the transaction broadcast type (sync / commit)
258
- */
259
- Wallet.prototype.sendTransaction = function (tx, endpoint) {
260
- return __awaiter(this, void 0, void 0, function () {
261
- var encodedTx;
262
- return __generator(this, function (_b) {
263
- if (!this.provider) {
264
- throw new Error('provider not connected');
265
- }
266
- encodedTx = (0, provider_1.uint8ArrayToBase64)(proto_1.Tx.encode(tx).finish());
267
- // Send the encoded transaction
268
- return [2 /*return*/, this.provider.sendTransaction(encodedTx, endpoint)];
269
- });
270
- });
271
- };
272
- var _a;
273
- _a = Wallet;
274
- // Wallet initialization //
275
- /**
276
- * Generates a private key-based wallet, using a random seed
277
- * @param {AccountWalletOption} options the account options
278
- */
279
- Wallet.createRandom = function (options) { return __awaiter(void 0, void 0, void 0, function () {
280
- var _b, publicKey, privateKey, wallet;
281
- return __generator(_a, function (_c) {
282
- switch (_c.label) {
283
- case 0: return [4 /*yield*/, (0, utility_1.generateKeyPair)((0, bip39_1.entropyToMnemonic)((0, utility_1.generateEntropy)()), 0)];
284
- case 1:
285
- _b = _c.sent(), publicKey = _b.publicKey, privateKey = _b.privateKey;
286
- wallet = new _a();
287
- wallet.signer = new key_1.KeySigner(privateKey, crypto_1.Secp256k1.compressPubkey(publicKey), options === null || options === void 0 ? void 0 : options.addressPrefix);
288
- return [2 /*return*/, wallet];
289
- }
290
- });
291
- }); };
292
- /**
293
- * Generates a custom signer-based wallet
294
- * @param {Signer} signer the custom signer implementing the Signer interface
295
- * @param {CreateWalletOptions} options the wallet generation options
296
- */
297
- Wallet.fromSigner = function (signer) { return __awaiter(void 0, void 0, void 0, function () {
298
- var wallet;
299
- return __generator(_a, function (_b) {
300
- wallet = new _a();
301
- wallet.signer = signer;
302
- return [2 /*return*/, wallet];
303
- });
304
- }); };
305
- /**
306
- * Generates a bip39 mnemonic-based wallet
307
- * @param {string} mnemonic the bip39 mnemonic
308
- * @param {CreateWalletOptions} options the wallet generation options
309
- */
310
- Wallet.fromMnemonic = function (mnemonic, options) { return __awaiter(void 0, void 0, void 0, function () {
311
- var _b, publicKey, privateKey, wallet;
312
- return __generator(_a, function (_c) {
313
- switch (_c.label) {
314
- case 0: return [4 /*yield*/, (0, utility_1.generateKeyPair)(mnemonic, options === null || options === void 0 ? void 0 : options.accountIndex)];
315
- case 1:
316
- _b = _c.sent(), publicKey = _b.publicKey, privateKey = _b.privateKey;
317
- wallet = new _a();
318
- wallet.signer = new key_1.KeySigner(privateKey, crypto_1.Secp256k1.compressPubkey(publicKey), options === null || options === void 0 ? void 0 : options.addressPrefix);
319
- return [2 /*return*/, wallet];
320
- }
321
- });
322
- }); };
323
- /**
324
- * Generates a private key-based wallet
325
- * @param {string} privateKey the private key
326
- * @param {AccountWalletOption} options the account options
327
- */
328
- Wallet.fromPrivateKey = function (privateKey, options) { return __awaiter(void 0, void 0, void 0, function () {
329
- var publicKey, wallet;
330
- return __generator(_a, function (_b) {
331
- switch (_b.label) {
332
- case 0: return [4 /*yield*/, crypto_1.Secp256k1.makeKeypair(privateKey)];
333
- case 1:
334
- publicKey = (_b.sent()).pubkey;
335
- wallet = new _a();
336
- wallet.signer = new key_1.KeySigner(privateKey, crypto_1.Secp256k1.compressPubkey(publicKey), options === null || options === void 0 ? void 0 : options.addressPrefix);
337
- return [2 /*return*/, wallet];
338
- }
339
- });
340
- }); };
341
- /**
342
- * Creates a Ledger-based wallet
343
- * @param {LedgerConnector} connector the Ledger device connector
344
- * @param {CreateWalletOptions} options the wallet generation options
345
- */
346
- Wallet.fromLedger = function (connector, options) {
347
- var _b;
348
- var wallet = new _a();
349
- wallet.signer = new ledger_1.LedgerSigner(connector, (_b = options === null || options === void 0 ? void 0 : options.accountIndex) !== null && _b !== void 0 ? _b : 0, options === null || options === void 0 ? void 0 : options.addressPrefix);
350
- return wallet;
351
- };
352
- return Wallet;
353
- }());
354
- exports.Wallet = Wallet;
@@ -1 +0,0 @@
1
- export {};