@injectivelabs/sdk-ts 1.0.320 → 1.0.321

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 (203) hide show
  1. package/dist/core/accounts/AccountParser.d.ts +4 -0
  2. package/dist/core/accounts/AccountParser.d.ts.map +1 -0
  3. package/dist/core/accounts/AccountParser.js +22 -0
  4. package/dist/core/accounts/AccountParser.js.map +1 -0
  5. package/dist/core/accounts/index.d.ts +2 -0
  6. package/dist/core/accounts/index.d.ts.map +1 -1
  7. package/dist/core/accounts/index.js +4 -0
  8. package/dist/core/accounts/index.js.map +1 -1
  9. package/dist/core/accounts/signers/OfflineAminoSigner.d.ts +19 -0
  10. package/dist/core/accounts/signers/OfflineAminoSigner.d.ts.map +1 -0
  11. package/dist/core/accounts/signers/OfflineAminoSigner.js +71 -0
  12. package/dist/core/accounts/signers/OfflineAminoSigner.js.map +1 -0
  13. package/dist/core/accounts/signers/OfflineDirectSigner.d.ts +20 -0
  14. package/dist/core/accounts/signers/OfflineDirectSigner.d.ts.map +1 -0
  15. package/dist/core/accounts/signers/OfflineDirectSigner.js +71 -0
  16. package/dist/core/accounts/signers/OfflineDirectSigner.js.map +1 -0
  17. package/dist/core/accounts/signers/index.d.ts +3 -0
  18. package/dist/core/accounts/signers/index.d.ts.map +1 -0
  19. package/dist/core/accounts/signers/index.js +8 -0
  20. package/dist/core/accounts/signers/index.js.map +1 -0
  21. package/dist/core/accounts/signers/types/amino-signer.d.ts +9 -0
  22. package/dist/core/accounts/signers/types/amino-signer.d.ts.map +1 -0
  23. package/dist/core/accounts/signers/types/amino-signer.js +3 -0
  24. package/dist/core/accounts/signers/types/amino-signer.js.map +1 -0
  25. package/dist/core/accounts/signers/types/index.d.ts +4 -0
  26. package/dist/core/accounts/signers/types/index.d.ts.map +1 -0
  27. package/dist/core/{transaction/client/types.js → accounts/signers/types/index.js} +1 -1
  28. package/dist/core/accounts/signers/types/index.js.map +1 -0
  29. package/dist/core/accounts/signers/types/proto-signer.d.ts +9 -0
  30. package/dist/core/accounts/signers/types/proto-signer.d.ts.map +1 -0
  31. package/dist/core/accounts/signers/types/proto-signer.js +3 -0
  32. package/dist/core/accounts/signers/types/proto-signer.js.map +1 -0
  33. package/dist/core/index.d.ts +1 -2
  34. package/dist/core/index.d.ts.map +1 -1
  35. package/dist/core/index.js +1 -2
  36. package/dist/core/index.js.map +1 -1
  37. package/dist/core/modules/MsgBase.d.ts +1 -1
  38. package/dist/core/modules/MsgBase.d.ts.map +1 -1
  39. package/dist/core/modules/MsgBase.js +1 -2
  40. package/dist/core/modules/MsgBase.js.map +1 -1
  41. package/dist/core/modules/exchange/index.d.ts +1 -0
  42. package/dist/core/modules/exchange/index.d.ts.map +1 -1
  43. package/dist/core/modules/exchange/index.js +15 -0
  44. package/dist/core/modules/exchange/index.js.map +1 -1
  45. package/dist/core/modules/exchange/utils/classes/OrderHashManager.d.ts +3 -0
  46. package/dist/core/modules/exchange/utils/classes/OrderHashManager.d.ts.map +1 -0
  47. package/dist/core/modules/exchange/utils/classes/OrderHashManager.js +7 -0
  48. package/dist/core/modules/exchange/utils/classes/OrderHashManager.js.map +1 -0
  49. package/dist/core/modules/exchange/utils/classes/index.d.ts +2 -0
  50. package/dist/core/modules/exchange/utils/classes/index.d.ts.map +1 -0
  51. package/dist/core/modules/exchange/utils/classes/index.js +6 -0
  52. package/dist/core/modules/exchange/utils/classes/index.js.map +1 -0
  53. package/dist/core/modules/exchange/utils/index.d.ts +2 -0
  54. package/dist/core/modules/exchange/utils/index.d.ts.map +1 -0
  55. package/dist/core/{transaction → modules/exchange}/utils/index.js +1 -1
  56. package/dist/core/modules/exchange/utils/index.js.map +1 -0
  57. package/dist/core/modules/index.d.ts +1 -0
  58. package/dist/core/modules/index.d.ts.map +1 -1
  59. package/dist/core/modules/index.js +1 -0
  60. package/dist/core/modules/index.js.map +1 -1
  61. package/dist/core/{transaction/client → modules/tx/api}/TxGrpcApi.d.ts +1 -1
  62. package/dist/core/modules/tx/api/TxGrpcApi.d.ts.map +1 -0
  63. package/dist/core/{transaction/client → modules/tx/api}/TxGrpcApi.js +10 -10
  64. package/dist/core/modules/tx/api/TxGrpcApi.js.map +1 -0
  65. package/dist/core/{transaction/client → modules/tx/api}/TxRestApi.d.ts +1 -1
  66. package/dist/core/modules/tx/api/TxRestApi.d.ts.map +1 -0
  67. package/dist/core/{transaction/client → modules/tx/api}/TxRestApi.js +5 -5
  68. package/dist/core/modules/tx/api/TxRestApi.js.map +1 -0
  69. package/dist/core/{transaction/client → modules/tx/api}/index.d.ts +2 -4
  70. package/dist/core/modules/tx/api/index.d.ts.map +1 -0
  71. package/dist/core/{transaction/client → modules/tx/api}/index.js +2 -4
  72. package/dist/core/modules/tx/api/index.js.map +1 -0
  73. package/dist/core/{transaction → modules/tx/broadcaster}/MsgBroadcasterWithPk.d.ts +4 -4
  74. package/dist/core/modules/tx/broadcaster/MsgBroadcasterWithPk.d.ts.map +1 -0
  75. package/dist/core/{transaction → modules/tx/broadcaster}/MsgBroadcasterWithPk.js +8 -8
  76. package/dist/core/modules/tx/broadcaster/MsgBroadcasterWithPk.js.map +1 -0
  77. package/dist/core/modules/tx/broadcaster/index.d.ts +2 -0
  78. package/dist/core/modules/tx/broadcaster/index.d.ts.map +1 -0
  79. package/dist/core/modules/tx/broadcaster/index.js +18 -0
  80. package/dist/core/modules/tx/broadcaster/index.js.map +1 -0
  81. package/dist/core/modules/tx/eip712/eip712.d.ts +144 -0
  82. package/dist/core/modules/tx/eip712/eip712.d.ts.map +1 -0
  83. package/dist/core/{eip712 → modules/tx/eip712}/eip712.js +0 -0
  84. package/dist/core/modules/tx/eip712/eip712.js.map +1 -0
  85. package/dist/core/{eip712 → modules/tx/eip712}/index.d.ts +0 -0
  86. package/dist/core/modules/tx/eip712/index.d.ts.map +1 -0
  87. package/dist/core/{eip712 → modules/tx/eip712}/index.js +0 -0
  88. package/dist/core/modules/tx/eip712/index.js.map +1 -0
  89. package/dist/core/{eip712 → modules/tx/eip712}/maps.d.ts +0 -0
  90. package/dist/core/modules/tx/eip712/maps.d.ts.map +1 -0
  91. package/dist/core/{eip712 → modules/tx/eip712}/maps.js +1 -1
  92. package/dist/core/modules/tx/eip712/maps.js.map +1 -0
  93. package/dist/core/{eip712 → modules/tx/eip712}/types.d.ts +0 -0
  94. package/dist/core/modules/tx/eip712/types.d.ts.map +1 -0
  95. package/dist/core/{eip712 → modules/tx/eip712}/types.js +0 -0
  96. package/dist/core/modules/tx/eip712/types.js.map +1 -0
  97. package/dist/core/{eip712 → modules/tx/eip712}/utils.d.ts +0 -0
  98. package/dist/core/modules/tx/eip712/utils.d.ts.map +1 -0
  99. package/dist/core/{eip712 → modules/tx/eip712}/utils.js +0 -0
  100. package/dist/core/modules/tx/eip712/utils.js.map +1 -0
  101. package/dist/core/modules/tx/index.d.ts +7 -0
  102. package/dist/core/modules/tx/index.d.ts.map +1 -0
  103. package/dist/core/{transaction → modules/tx}/index.js +3 -2
  104. package/dist/core/modules/tx/index.js.map +1 -0
  105. package/dist/core/{transaction → modules/tx}/tx.d.ts +63 -92
  106. package/dist/core/modules/tx/tx.d.ts.map +1 -0
  107. package/dist/core/modules/tx/tx.js +201 -0
  108. package/dist/core/modules/tx/tx.js.map +1 -0
  109. package/dist/core/{transaction → modules/tx}/types/index.d.ts +0 -0
  110. package/dist/core/modules/tx/types/index.d.ts.map +1 -0
  111. package/dist/core/{transaction → modules/tx}/types/index.js +0 -0
  112. package/dist/core/modules/tx/types/index.js.map +1 -0
  113. package/dist/core/{transaction → modules/tx}/types/tx-rest-client.d.ts +0 -0
  114. package/dist/core/modules/tx/types/tx-rest-client.d.ts.map +1 -0
  115. package/dist/core/{transaction → modules/tx}/types/tx-rest-client.js +0 -0
  116. package/dist/core/modules/tx/types/tx-rest-client.js.map +1 -0
  117. package/dist/core/modules/tx/types/tx.d.ts +101 -0
  118. package/dist/core/modules/tx/types/tx.d.ts.map +1 -0
  119. package/dist/core/{transaction → modules/tx}/types/tx.js +0 -0
  120. package/dist/core/modules/tx/types/tx.js.map +1 -0
  121. package/dist/core/{transaction/client/utils.d.ts → modules/tx/utils/api.d.ts} +1 -1
  122. package/dist/core/modules/tx/utils/api.d.ts.map +1 -0
  123. package/dist/core/{transaction/client/utils.js → modules/tx/utils/api.js} +1 -1
  124. package/dist/core/modules/tx/utils/api.js.map +1 -0
  125. package/dist/core/{transaction/client → modules/tx/utils/classes}/TxClient.d.ts +0 -0
  126. package/dist/core/modules/tx/utils/classes/TxClient.d.ts.map +1 -0
  127. package/dist/core/{transaction/client → modules/tx/utils/classes}/TxClient.js +1 -1
  128. package/dist/core/modules/tx/utils/classes/TxClient.js.map +1 -0
  129. package/dist/core/modules/tx/utils/constants.d.ts +3 -0
  130. package/dist/core/modules/tx/utils/constants.d.ts.map +1 -0
  131. package/dist/core/modules/tx/utils/constants.js +7 -0
  132. package/dist/core/modules/tx/utils/constants.js.map +1 -0
  133. package/dist/core/modules/tx/utils/helpers.d.ts +7 -0
  134. package/dist/core/modules/tx/utils/helpers.d.ts.map +1 -0
  135. package/dist/core/modules/tx/utils/helpers.js +46 -0
  136. package/dist/core/modules/tx/utils/helpers.js.map +1 -0
  137. package/dist/core/modules/tx/utils/index.d.ts +6 -0
  138. package/dist/core/modules/tx/utils/index.d.ts.map +1 -0
  139. package/dist/core/modules/tx/utils/index.js +22 -0
  140. package/dist/core/modules/tx/utils/index.js.map +1 -0
  141. package/dist/core/modules/tx/utils/tx.d.ts +64 -0
  142. package/dist/core/modules/tx/utils/tx.d.ts.map +1 -0
  143. package/dist/core/modules/tx/utils/tx.js +134 -0
  144. package/dist/core/modules/tx/utils/tx.js.map +1 -0
  145. package/dist/core/stargate/SigningStargateClient.d.ts +1 -0
  146. package/dist/core/stargate/SigningStargateClient.d.ts.map +1 -0
  147. package/dist/core/stargate/SigningStargateClient.js +32 -0
  148. package/dist/core/stargate/SigningStargateClient.js.map +1 -0
  149. package/dist/core/stargate/StargateClient.d.ts +5 -0
  150. package/dist/core/stargate/StargateClient.d.ts.map +1 -0
  151. package/dist/core/stargate/StargateClient.js +40 -0
  152. package/dist/core/stargate/StargateClient.js.map +1 -0
  153. package/dist/core/stargate/index.d.ts +2 -0
  154. package/dist/core/stargate/index.d.ts.map +1 -0
  155. package/dist/core/stargate/index.js +6 -0
  156. package/dist/core/stargate/index.js.map +1 -0
  157. package/package.json +6 -5
  158. package/dist/core/eip712/eip712.d.ts +0 -144
  159. package/dist/core/eip712/eip712.d.ts.map +0 -1
  160. package/dist/core/eip712/eip712.js.map +0 -1
  161. package/dist/core/eip712/index.d.ts.map +0 -1
  162. package/dist/core/eip712/index.js.map +0 -1
  163. package/dist/core/eip712/maps.d.ts.map +0 -1
  164. package/dist/core/eip712/maps.js.map +0 -1
  165. package/dist/core/eip712/types.d.ts.map +0 -1
  166. package/dist/core/eip712/types.js.map +0 -1
  167. package/dist/core/eip712/utils.d.ts.map +0 -1
  168. package/dist/core/eip712/utils.js.map +0 -1
  169. package/dist/core/transaction/MsgBroadcasterWithPk.d.ts.map +0 -1
  170. package/dist/core/transaction/MsgBroadcasterWithPk.js.map +0 -1
  171. package/dist/core/transaction/client/TxClient.d.ts.map +0 -1
  172. package/dist/core/transaction/client/TxClient.js.map +0 -1
  173. package/dist/core/transaction/client/TxGrpcApi.d.ts.map +0 -1
  174. package/dist/core/transaction/client/TxGrpcApi.js.map +0 -1
  175. package/dist/core/transaction/client/TxRestApi.d.ts.map +0 -1
  176. package/dist/core/transaction/client/TxRestApi.js.map +0 -1
  177. package/dist/core/transaction/client/index.d.ts.map +0 -1
  178. package/dist/core/transaction/client/index.js.map +0 -1
  179. package/dist/core/transaction/client/types.d.ts +0 -15
  180. package/dist/core/transaction/client/types.d.ts.map +0 -1
  181. package/dist/core/transaction/client/types.js.map +0 -1
  182. package/dist/core/transaction/client/utils.d.ts.map +0 -1
  183. package/dist/core/transaction/client/utils.js.map +0 -1
  184. package/dist/core/transaction/index.d.ts +0 -6
  185. package/dist/core/transaction/index.d.ts.map +0 -1
  186. package/dist/core/transaction/index.js.map +0 -1
  187. package/dist/core/transaction/tx.d.ts.map +0 -1
  188. package/dist/core/transaction/tx.js +0 -202
  189. package/dist/core/transaction/tx.js.map +0 -1
  190. package/dist/core/transaction/types/index.d.ts.map +0 -1
  191. package/dist/core/transaction/types/index.js.map +0 -1
  192. package/dist/core/transaction/types/tx-rest-client.d.ts.map +0 -1
  193. package/dist/core/transaction/types/tx-rest-client.js.map +0 -1
  194. package/dist/core/transaction/types/tx.d.ts +0 -43
  195. package/dist/core/transaction/types/tx.d.ts.map +0 -1
  196. package/dist/core/transaction/types/tx.js.map +0 -1
  197. package/dist/core/transaction/utils/helpers.d.ts +0 -84
  198. package/dist/core/transaction/utils/helpers.d.ts.map +0 -1
  199. package/dist/core/transaction/utils/helpers.js +0 -177
  200. package/dist/core/transaction/utils/helpers.js.map +0 -1
  201. package/dist/core/transaction/utils/index.d.ts +0 -2
  202. package/dist/core/transaction/utils/index.d.ts.map +0 -1
  203. package/dist/core/transaction/utils/index.js.map +0 -1
@@ -1,91 +1,8 @@
1
- import { StdFee } from '@cosmjs/amino';
2
- import { TxBody, SignDoc, SignerInfo, AuthInfo, Fee, TxRaw } from '@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb';
3
- import { SignModeMap } from '@injectivelabs/chain-api/cosmos/tx/signing/v1beta1/signing_pb';
4
- export type MsgArg = {
5
- type: string;
6
- message: any;
7
- };
8
- export interface SignerDetails {
9
- pubKey: string;
10
- sequence: number;
11
- accountNumber: number;
12
- }
13
- /** @type {CreateTransactionWithSignersArgs} */
14
- export interface CreateTransactionWithSignersArgs {
15
- fee?: StdFee;
16
- memo?: string;
17
- chainId: string;
18
- message: MsgArg | MsgArg[];
19
- signers: SignerDetails | SignerDetails[];
20
- signMode?: SignModeMap[keyof SignModeMap];
21
- timeoutHeight?: number;
22
- }
23
- /** @type {CreateTransactionArgs} */
24
- export interface CreateTransactionArgs {
25
- fee?: StdFee;
26
- memo?: string;
27
- chainId: string;
28
- message: MsgArg | MsgArg[];
29
- pubKey: string;
30
- sequence: number;
31
- accountNumber: number;
32
- signMode?: SignModeMap[keyof SignModeMap];
33
- timeoutHeight?: number;
34
- }
35
- /** @type {CreateTransactionResult} */
36
- export interface CreateTransactionResult {
37
- txRaw: TxRaw;
38
- signDoc: SignDoc;
39
- bodyBytes: Uint8Array;
40
- signers: SignerDetails | SignerDetails[];
41
- signer: SignerDetails;
42
- authInfoBytes: Uint8Array;
43
- signBytes: Uint8Array;
44
- signHashedBytes: Uint8Array;
45
- }
46
- export declare const SIGN_DIRECT: 1;
47
- export declare const SIGN_AMINO: 127;
48
- export declare const getPublicKey: ({ chainId, key, }: {
49
- chainId: string;
50
- key: string;
51
- }) => import("google-protobuf/google/protobuf/any_pb").Any;
52
- export declare const createBody: ({ message, memo, timeoutHeight, }: {
53
- message: MsgArg | MsgArg[];
54
- memo?: string | undefined;
55
- timeoutHeight?: number | undefined;
56
- }) => TxBody;
57
- export declare const createFee: ({ fee, payer, gasLimit, }: {
58
- fee: {
59
- amount: string;
60
- denom: string;
61
- };
62
- payer?: string | undefined;
63
- gasLimit: number;
64
- }) => Fee;
65
- export declare const createSigners: ({ chainId, mode, signers, }: {
66
- chainId: string;
67
- signers: {
68
- pubKey: string;
69
- sequence: number;
70
- }[];
71
- mode: SignModeMap[keyof SignModeMap];
72
- }) => SignerInfo[];
73
- export declare const createSignerInfo: ({ chainId, publicKey, sequence, mode, }: {
74
- chainId: string;
75
- publicKey: string;
76
- sequence: number;
77
- mode: SignModeMap[keyof SignModeMap];
78
- }) => SignerInfo;
79
- export declare const createAuthInfo: ({ signerInfo, fee, }: {
80
- signerInfo: SignerInfo[];
81
- fee: Fee;
82
- }) => AuthInfo;
83
- export declare const createSigDoc: ({ bodyBytes, authInfoBytes, chainId, accountNumber, }: {
84
- bodyBytes: Uint8Array;
85
- authInfoBytes: Uint8Array;
86
- chainId: string;
87
- accountNumber: number;
88
- }) => SignDoc;
1
+ import { TxRaw } from '@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb';
2
+ import { CreateTransactionArgs, CreateTransactionResult, CreateTransactionWithSignersArgs } from './types';
3
+ import { DirectSignResponse } from '@cosmjs/proto-signing';
4
+ import { Msgs } from '../..';
5
+ import { SignDoc as CosmosSignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
89
6
  /**
90
7
  * @typedef {Object} CreateTransactionWithSignersArgs
91
8
  * @param {CreateTransactionWithSignersArgs} params
@@ -130,9 +47,63 @@ export declare const createTransactionWithSigners: ({ signers, chainId, message,
130
47
  * @returns {CreateTransactionResult} result
131
48
  */
132
49
  export declare const createTransaction: (args: CreateTransactionArgs) => CreateTransactionResult;
133
- export declare const getTransactionPartsFromTxRaw: (txRaw: TxRaw) => {
134
- authInfo: AuthInfo;
135
- body: TxBody;
136
- signatures: Uint8Array[];
50
+ /**
51
+ * Used when we want to pass a Msg class instead of the {type, message}
52
+ * object of the Message (using the toDirectSign() method)
53
+ * @returns
54
+ */
55
+ export declare const createTransactionFromMsg: (params: Omit<CreateTransactionArgs, 'message'> & {
56
+ message: Msgs | Msgs[];
57
+ }) => CreateTransactionResult;
58
+ /**
59
+ * Used when we get a DirectSignResponse from
60
+ * Cosmos native wallets like Keplr, Leap, etc after
61
+ * the TxRaw has been signed.
62
+ *
63
+ * The reason why we need to create a new TxRaw and
64
+ * not use the one that we passed to signing is that the users
65
+ * can change the gas fees and that will alter the original
66
+ * TxRaw which will cause signature miss match if we broadcast
67
+ * that transaction on chain
68
+ * @returns TxRaw
69
+ */
70
+ export declare const createTxRawFromSigResponse: (signatureResponse: DirectSignResponse) => TxRaw;
71
+ /**
72
+ * Used when we don't have account details and block details
73
+ * and we pass the message and the user's address only
74
+ * @returns
75
+ */
76
+ export declare const createTransactionForAddressAndMsg: (params: Omit<CreateTransactionArgs, 'message' | 'sequence' | 'pubKey' | 'accountNumber'> & {
77
+ message: Msgs | Msgs[];
78
+ address: string;
79
+ pubKey?: string;
80
+ endpoint: string;
81
+ }) => Promise<CreateTransactionResult>;
82
+ export declare const createTransactionAndCosmosSignDoc: (args: CreateTransactionArgs) => {
83
+ cosmosSignDoc: CosmosSignDoc;
84
+ txRaw: TxRaw;
85
+ signDoc: import("@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb").SignDoc;
86
+ bodyBytes: Uint8Array;
87
+ signers: import("./types").SignerDetails | import("./types").SignerDetails[];
88
+ signer: import("./types").SignerDetails;
89
+ authInfoBytes: Uint8Array;
90
+ signBytes: Uint8Array;
91
+ signHashedBytes: Uint8Array;
137
92
  };
93
+ export declare const createTransactionAndCosmosSignDocForAddressAndMsg: (params: Omit<CreateTransactionArgs, 'message' | 'sequence' | 'pubKey' | 'accountNumber'> & {
94
+ message: Msgs | Msgs[];
95
+ address: string;
96
+ pubKey?: string;
97
+ endpoint: string;
98
+ }) => Promise<{
99
+ cosmosSignDoc: CosmosSignDoc;
100
+ txRaw: TxRaw;
101
+ signDoc: import("@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb").SignDoc;
102
+ bodyBytes: Uint8Array;
103
+ signers: import("./types").SignerDetails | import("./types").SignerDetails[];
104
+ signer: import("./types").SignerDetails;
105
+ authInfoBytes: Uint8Array;
106
+ signBytes: Uint8Array;
107
+ signHashedBytes: Uint8Array;
108
+ }>;
138
109
  //# sourceMappingURL=tx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/core/modules/tx/tx.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAA;AAUxE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,gCAAgC,EACjC,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE1D,OAAO,EAAe,IAAI,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAK5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,4BAA4B,uEAQtC,gCAAgC,KAAG,uBA8CrC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB,SACtB,qBAAqB,KAC1B,uBASF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,WAC3B,KAAK,qBAAqB,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,CAAA;CAAE,4BAU5E,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,sBAClB,kBAAkB,UAQtC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,WACpC,KACN,qBAAqB,EACrB,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,eAAe,CACpD,GAAG;IACF,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB,qCAwCF,CAAA;AAED,eAAO,MAAM,iCAAiC,SACtC,qBAAqB;;;;;;;;;;CAgB5B,CAAA;AAED,eAAO,MAAM,iDAAiD,WACpD,KACN,qBAAqB,EACrB,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,eAAe,CACpD,GAAG;IACF,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;;;;;;;;;;EAgBF,CAAA"}
@@ -0,0 +1,201 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.createTransactionAndCosmosSignDocForAddressAndMsg = exports.createTransactionAndCosmosSignDoc = exports.createTransactionForAddressAndMsg = exports.createTxRawFromSigResponse = exports.createTransactionFromMsg = exports.createTransaction = exports.createTransactionWithSigners = void 0;
16
+ const keccak256_1 = __importDefault(require("keccak256"));
17
+ const tx_pb_1 = require("@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb");
18
+ const utils_1 = require("@injectivelabs/utils");
19
+ const utils_2 = require("./utils");
20
+ const utils_3 = require("@injectivelabs/utils");
21
+ const __1 = require("../..");
22
+ const tx_1 = require("cosmjs-types/cosmos/tx/v1beta1/tx");
23
+ const exceptions_1 = require("@injectivelabs/exceptions");
24
+ const utils_4 = require("@injectivelabs/utils");
25
+ const client_1 = require("../../../client");
26
+ /**
27
+ * @typedef {Object} CreateTransactionWithSignersArgs
28
+ * @param {CreateTransactionWithSignersArgs} params
29
+ * @property {MsgArg | MsgArg[]} message - the Cosmos messages to wrap them in a transaction
30
+ * @property {string} memo - the memo to attach to the transaction
31
+ * @property {StdFee} fee - the fee to attach to the transaction
32
+ * @property {SignerDetails} signers - the signers of the transaction
33
+ * @property {number} number - the account number to attach to the transaction
34
+ * @property {number} chainId - the chain-id to attach to the transaction
35
+ * @property {string} pubKey - the account pubKey to attach to the transaction (in base64)
36
+ *
37
+ * @typedef {Object} CreateTransactionResult
38
+ * @property {TxRaw} txRaw - the Tx raw that was created
39
+ * @property {SignDoc} signDoc - the SignDoc that was created - used for signing of the transaction
40
+ * @property {SignerDetails} signers - the signers of the transaction
41
+ * @property {Uint8Array} bodyBytes - the body bytes of the transaction
42
+ * @property {Uint8Array} authInfoBytes - the auth info bytes of the transaction
43
+ * @property {Uint8Array} signBytes - the sign bytes of the transaction (SignDoc serialized to binary)
44
+ * @property {Uint8Array} signHashedBytes - the sign bytes of the transaction (SignDoc serialized to binary) and hashed using keccak256
45
+ * @returns {CreateTransactionResult} result
46
+ */
47
+ const createTransactionWithSigners = ({ signers, chainId, message, timeoutHeight, memo = '', fee = utils_1.DEFAULT_STD_FEE, signMode = utils_2.SIGN_DIRECT, }) => {
48
+ const actualSigners = Array.isArray(signers) ? signers : [signers];
49
+ const [signer] = actualSigners;
50
+ const body = (0, utils_2.createBody)({ message, memo, timeoutHeight });
51
+ const feeMessage = (0, utils_2.createFee)({
52
+ fee: fee.amount[0],
53
+ payer: fee.payer,
54
+ gasLimit: parseInt(fee.gas, 10),
55
+ });
56
+ const signInfo = (0, utils_2.createSigners)({
57
+ chainId,
58
+ mode: signMode,
59
+ signers: actualSigners,
60
+ });
61
+ const authInfo = (0, utils_2.createAuthInfo)({
62
+ signerInfo: signInfo,
63
+ fee: feeMessage,
64
+ });
65
+ const signDoc = (0, utils_2.createSigDoc)({
66
+ chainId,
67
+ bodyBytes: body.serializeBinary(),
68
+ authInfoBytes: authInfo.serializeBinary(),
69
+ accountNumber: signer.accountNumber,
70
+ });
71
+ const toSignBytes = Buffer.from(signDoc.serializeBinary());
72
+ const toSignHash = (0, keccak256_1.default)(Buffer.from(signDoc.serializeBinary()));
73
+ const txRaw = new tx_pb_1.TxRaw();
74
+ txRaw.setAuthInfoBytes(authInfo.serializeBinary());
75
+ txRaw.setBodyBytes(body.serializeBinary());
76
+ return {
77
+ txRaw,
78
+ signDoc,
79
+ signers,
80
+ signer,
81
+ signBytes: toSignBytes,
82
+ signHashedBytes: toSignHash,
83
+ bodyBytes: body.serializeBinary(),
84
+ authInfoBytes: authInfo.serializeBinary(),
85
+ };
86
+ };
87
+ exports.createTransactionWithSigners = createTransactionWithSigners;
88
+ /**
89
+ * @typedef {Object} CreateTransactionArgs
90
+ * @param {CreateTransactionArgs} params
91
+ * @property {MsgArg | MsgArg[]} message - the Cosmos messages to wrap them in a transaction
92
+ * @property {string} memo - the memo to attach to the transaction
93
+ * @property {StdFee} fee - the fee to attach to the transaction
94
+ * @property {string} sequence - the account sequence to attach to the transaction
95
+ * @property {number} number - the account number to attach to the transaction
96
+ * @property {number} chainId - the chain-id to attach to the transaction
97
+ * @property {string} pubKey - the account pubKey to attach to the transaction (in base64)
98
+ *
99
+ * @typedef {Object} CreateTransactionResult
100
+ * @property {TxRaw} txRaw // the Tx raw that was created
101
+ * @property {SignDoc} signDoc // the SignDoc that was created - used for signing of the transaction
102
+ * @property {number} accountNumber // the account number of the signer of the transaction
103
+ * @property {Uint8Array} bodyBytes // the body bytes of the transaction
104
+ * @property {Uint8Array} authInfoBytes // the auth info bytes of the transaction
105
+ * @property {Uint8Array} signBytes // the sign bytes of the transaction (SignDoc serialized to binary)
106
+ * @property {Uint8Array} signHashedBytes // the sign bytes of the transaction (SignDoc serialized to binary) and hashed using keccak256
107
+ * @returns {CreateTransactionResult} result
108
+ */
109
+ const createTransaction = (args) => {
110
+ return (0, exports.createTransactionWithSigners)(Object.assign(Object.assign({}, args), { signers: {
111
+ pubKey: args.pubKey,
112
+ accountNumber: args.accountNumber,
113
+ sequence: args.sequence,
114
+ } }));
115
+ };
116
+ exports.createTransaction = createTransaction;
117
+ /**
118
+ * Used when we want to pass a Msg class instead of the {type, message}
119
+ * object of the Message (using the toDirectSign() method)
120
+ * @returns
121
+ */
122
+ const createTransactionFromMsg = (params) => {
123
+ const messages = Array.isArray(params.message)
124
+ ? params.message
125
+ : [params.message];
126
+ return (0, exports.createTransaction)(Object.assign(Object.assign({}, params), { message: messages.map((m) => m.toDirectSign()) }));
127
+ };
128
+ exports.createTransactionFromMsg = createTransactionFromMsg;
129
+ /**
130
+ * Used when we get a DirectSignResponse from
131
+ * Cosmos native wallets like Keplr, Leap, etc after
132
+ * the TxRaw has been signed.
133
+ *
134
+ * The reason why we need to create a new TxRaw and
135
+ * not use the one that we passed to signing is that the users
136
+ * can change the gas fees and that will alter the original
137
+ * TxRaw which will cause signature miss match if we broadcast
138
+ * that transaction on chain
139
+ * @returns TxRaw
140
+ */
141
+ const createTxRawFromSigResponse = (signatureResponse) => {
142
+ const txRaw = new tx_pb_1.TxRaw();
143
+ txRaw.setAuthInfoBytes(signatureResponse.signed.authInfoBytes);
144
+ txRaw.setBodyBytes(signatureResponse.signed.bodyBytes);
145
+ txRaw.setSignaturesList([signatureResponse.signature.signature]);
146
+ return txRaw;
147
+ };
148
+ exports.createTxRawFromSigResponse = createTxRawFromSigResponse;
149
+ /**
150
+ * Used when we don't have account details and block details
151
+ * and we pass the message and the user's address only
152
+ * @returns
153
+ */
154
+ const createTransactionForAddressAndMsg = (params) => __awaiter(void 0, void 0, void 0, function* () {
155
+ const messages = Array.isArray(params.message)
156
+ ? params.message
157
+ : [params.message];
158
+ // Clients
159
+ const chainRestAuthApi = new client_1.ChainRestAuthApi(params.endpoint);
160
+ const tendermintRestApi = new client_1.ChainRestTendermintApi(params.endpoint);
161
+ /** Account Details * */
162
+ const accountDetails = yield chainRestAuthApi.fetchCosmosAccount(params.address);
163
+ const baseAccount = __1.BaseAccount.fromRestCosmosApi(accountDetails);
164
+ /** Block Details */
165
+ const latestBlock = yield tendermintRestApi.fetchLatestBlock();
166
+ const latestHeight = latestBlock.header.height;
167
+ const timeoutHeight = new utils_3.BigNumberInBase(latestHeight).plus(utils_4.DEFAULT_BLOCK_TIMEOUT_HEIGHT);
168
+ const pubKey = params.pubKey || baseAccount.pubKey.key;
169
+ if (!pubKey) {
170
+ throw new exceptions_1.GeneralException(new Error(`The pubKey for ${params.address} is missing.`));
171
+ }
172
+ return (0, exports.createTransaction)(Object.assign(Object.assign({}, params), { pubKey: params.pubKey || Buffer.from(baseAccount.pubKey.key).toString('base64'), sequence: Number(baseAccount.sequence), accountNumber: Number(baseAccount.accountNumber), timeoutHeight: timeoutHeight.toNumber(), message: messages.map((m) => m.toDirectSign()) }));
173
+ });
174
+ exports.createTransactionForAddressAndMsg = createTransactionForAddressAndMsg;
175
+ const createTransactionAndCosmosSignDoc = (args) => {
176
+ const result = (0, exports.createTransaction)(args);
177
+ const [signer] = Array.isArray(result.signers)
178
+ ? result.signers
179
+ : [result.signers];
180
+ return Object.assign(Object.assign({}, result), { cosmosSignDoc: tx_1.SignDoc.fromPartial({
181
+ bodyBytes: result.bodyBytes,
182
+ authInfoBytes: result.authInfoBytes,
183
+ accountNumber: signer.accountNumber,
184
+ chainId: args.chainId,
185
+ }) });
186
+ };
187
+ exports.createTransactionAndCosmosSignDoc = createTransactionAndCosmosSignDoc;
188
+ const createTransactionAndCosmosSignDocForAddressAndMsg = (params) => __awaiter(void 0, void 0, void 0, function* () {
189
+ const result = yield (0, exports.createTransactionForAddressAndMsg)(params);
190
+ const [signer] = Array.isArray(result.signers)
191
+ ? result.signers
192
+ : [result.signers];
193
+ return Object.assign(Object.assign({}, result), { cosmosSignDoc: tx_1.SignDoc.fromPartial({
194
+ bodyBytes: result.bodyBytes,
195
+ authInfoBytes: result.authInfoBytes,
196
+ accountNumber: signer.accountNumber,
197
+ chainId: params.chainId,
198
+ }) });
199
+ });
200
+ exports.createTransactionAndCosmosSignDocForAddressAndMsg = createTransactionAndCosmosSignDocForAddressAndMsg;
201
+ //# sourceMappingURL=tx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx.js","sourceRoot":"","sources":["../../../../src/core/modules/tx/tx.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAiC;AACjC,4EAAwE;AACxE,gDAAsD;AACtD,mCAOgB;AAOhB,gDAAsD;AACtD,6BAAyC;AACzC,0DAA4E;AAC5E,0DAA4D;AAC5D,gDAAmE;AACnE,4CAA0E;AAE1E;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,4BAA4B,GAAG,CAAC,E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AAA;AAjBY,QAAA,iCAAiC,qCAiB7C;AAEM,MAAM,iDAAiD,GAAG,CAC/D,MAQC,EACD,EAAE;IACF,MAAM,MAAM,GAAG,MAAM,IAAA,yCAAiC,EAAC,MAAM,CAAC,CAAA;IAC9D,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QAC5C,CAAC,CAAC,MAAM,CAAC,OAAO;QAChB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAEpB,uCACK,MAAM,KACT,aAAa,EAAE,YAAa,CAAC,WAAW,CAAC;YACvC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,IACH;AACH,CAAC,CAAA,CAAA;AAzBY,QAAA,iDAAiD,qDAyB7D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/modules/tx/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C,cAAc,MAAM,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAEhC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/modules/tx/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,uCAAoB;AACpB,mDAAgC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx-rest-client.d.ts","sourceRoot":"","sources":["../../../../../src/core/modules/tx/types/tx-rest-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,kDAAkD,CAAA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,"file":"tx-rest-client.js","sourceRoot":"","sources":["../../../../../src/core/modules/tx/types/tx-rest-client.ts"],"names":[],"mappings":";;;AA+DA,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,6CAA4B,CAAA;IAC5B,+CAA8B,CAAA;IAC9B,+CAA8B,CAAA;AAChC,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
@@ -0,0 +1,101 @@
1
+ import { BroadcastModeMap } from '@injectivelabs/chain-api/cosmos/tx/v1beta1/service_pb';
2
+ import { SignDoc, TxRaw } from '@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb';
3
+ import { StdFee } from '@cosmjs/amino';
4
+ import { SignModeMap } from '@injectivelabs/chain-api/cosmos/tx/signing/v1beta1/signing_pb';
5
+ export interface TxClientBroadcastOptions {
6
+ mode: BroadcastModeMap[keyof BroadcastModeMap];
7
+ timeout: number;
8
+ }
9
+ export interface TxClientBroadcastResponse {
10
+ height: number;
11
+ txHash: string;
12
+ codespace: string;
13
+ code: number;
14
+ data?: string;
15
+ rawLog: string;
16
+ logs?: any[];
17
+ info?: string;
18
+ gasWanted: number;
19
+ gasUsed: number;
20
+ timestamp: string;
21
+ events?: any[];
22
+ }
23
+ export interface TxClientSimulateResponse {
24
+ result: {
25
+ data: Uint8Array | string;
26
+ log: string;
27
+ eventsList: any[];
28
+ };
29
+ gasInfo: {
30
+ gasWanted: number;
31
+ gasUsed: number;
32
+ };
33
+ }
34
+ export interface TxConcreteApi {
35
+ broadcast(txRaw: TxRaw, options?: TxClientBroadcastOptions): Promise<TxClientBroadcastResponse>;
36
+ broadcastBlock(txRaw: TxRaw): Promise<TxClientBroadcastResponse>;
37
+ fetchTx(txHash: string): Promise<TxClientBroadcastResponse | undefined>;
38
+ fetchTxPoll(txHash: string): Promise<TxClientBroadcastResponse | undefined>;
39
+ simulate(txRaw: TxRaw): Promise<TxClientSimulateResponse>;
40
+ }
41
+ export declare enum TxClientMode {
42
+ gRpc = "grpc",
43
+ rest = "rest"
44
+ }
45
+ export type MsgArg = {
46
+ type: string;
47
+ message: any;
48
+ };
49
+ export interface SignerDetails {
50
+ pubKey: string;
51
+ sequence: number;
52
+ accountNumber: number;
53
+ }
54
+ /** @type {CreateTransactionWithSignersArgs} */
55
+ export interface CreateTransactionWithSignersArgs {
56
+ fee?: StdFee;
57
+ memo?: string;
58
+ chainId: string;
59
+ message: MsgArg | MsgArg[];
60
+ signers: SignerDetails | SignerDetails[];
61
+ signMode?: SignModeMap[keyof SignModeMap];
62
+ timeoutHeight?: number;
63
+ }
64
+ /** @type {CreateTransactionArgs} */
65
+ export interface CreateTransactionArgs {
66
+ fee?: StdFee;
67
+ memo?: string;
68
+ chainId: string;
69
+ message: MsgArg | MsgArg[];
70
+ pubKey: string;
71
+ sequence: number;
72
+ accountNumber: number;
73
+ signMode?: SignModeMap[keyof SignModeMap];
74
+ timeoutHeight?: number;
75
+ }
76
+ /** @type {CreateTransactionResult} */
77
+ export interface CreateTransactionResult {
78
+ txRaw: TxRaw;
79
+ signDoc: SignDoc;
80
+ bodyBytes: Uint8Array;
81
+ signers: SignerDetails | SignerDetails[];
82
+ signer: SignerDetails;
83
+ authInfoBytes: Uint8Array;
84
+ signBytes: Uint8Array;
85
+ signHashedBytes: Uint8Array;
86
+ }
87
+ export interface TxResponse {
88
+ height: number;
89
+ txHash: string;
90
+ codespace: string;
91
+ code: number;
92
+ data?: string;
93
+ rawLog: string;
94
+ logs?: any[];
95
+ info?: string;
96
+ gasWanted: number;
97
+ gasUsed: number;
98
+ timestamp: string;
99
+ events?: any[];
100
+ }
101
+ //# sourceMappingURL=tx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../../src/core/modules/tx/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAA;AACxF,OAAO,EACL,OAAO,EACP,KAAK,EACN,MAAM,kDAAkD,CAAA;AACzD,O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S,EAAE,UAAU,CAAA;IACrB,OAAO,EAAE,aAAa,GAAG,aAAa,EAAE,CAAA;IACxC,MAAM,EAAE,aAAa,CAAA;IACrB,aAAa,EAAE,UAAU,CAAA;IACzB,SAAS,EAAE,UAAU,CAAA;IACrB,eAAe,EAAE,UAAU,CAAA;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;CACf"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx.js","sourceRoot":"","sources":["../../../../../src/core/modules/tx/types/tx.ts"],"names":[],"mappings":";;;AAmDA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,6BAAa,CAAA;AACf,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
@@ -1,3 +1,3 @@
1
1
  export declare const isTxNotFoundError: (error: any) => boolean;
2
2
  export declare const errorToErrorMessage: (error: any) => any;
3
- //# sourceMappingURL=utils.d.ts.map
3
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/core/modules/tx/utils/api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,UAAW,GAAG,YAqB3C,CAAA;AAED,eAAO,MAAM,mBAAmB,UAAW,GAAG,QAU7C,CAAA"}
@@ -29,4 +29,4 @@ const errorToErrorMessage = (error) => {
29
29
  return message;
30
30
  };
31
31
  exports.errorToErrorMessage = errorToErrorMessage;
32
- //# sourceMappingURL=utils.js.map
32
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/core/modules/tx/utils/api.ts"],"names":[],"mappings":";;;AAAO,MAAM,iBAAiB,GAAG,CAAC,KAAU,EAAE,EAAE;IAC9C,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;QACnB,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;QACtC,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,CAAA;QAE9D,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;KAC3E;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI;QACjC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO;QAC7B,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;IAEpB,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC3B,OAAO,IAAI,CAAA;KACZ;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACjC,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AArBY,QAAA,iBAAiB,qBAqB7B;AAEM,MAAM,mBAAmB,GAAG,CAAC,KAAU,EAAE,EAAE;IAChD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;QACnB,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;KACxB;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI;QACjC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO;QAC7B,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;IAEpB,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAVY,QAAA,mBAAmB,uBAU/B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TxClient.d.ts","sourceRoot":"","sources":["../../../../../../src/core/modules/tx/utils/classes/TxClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAA;AAGxE,qBAAa,QAAQ;IACnB;;;OAGG;WACW,MAAM,CAAC,EAAE,EAAE,KAAK,GAAG,MAAM;IAIvC;;;OAGG;WACW,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK;IAI9C;;;OAGG;WACW,IAAI,CAAC,EAAE,EAAE,KAAK,GAAG,MAAM;CAGtC"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TxClient = void 0;
4
4
  const tx_pb_1 = require("@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb");
5
- const crypto_1 = require("../../../utils/crypto");
5
+ const crypto_1 = require("../../../../../utils/crypto");
6
6
  class TxClient {
7
7
  /**
8
8
  * Encode a transaction to base64-encoded protobuf
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TxClient.js","sourceRoot":"","sources":["../../../../../../src/core/modules/tx/utils/classes/TxClient.ts"],"names":[],"mappings":";;;AAAA,4EAAwE;AACxE,wDAAuD;AAEvD,MAAa,QAAQ;IACnB;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,EAAS;QAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC7D,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,SAAiB;QACpC,OAAO,aAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAA;IAClE,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAI,CAAC,EAAS;QAC1B,OAAO,IAAA,kBAAS,EAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;CACF;AAxBD,4BAwBC"}
@@ -0,0 +1,3 @@
1
+ export declare const SIGN_DIRECT: 1;
2
+ export declare const SIGN_AMINO: 127;
3
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/core/modules/tx/utils/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAA4B,CAAA;AACpD,eAAO,MAAM,UAAU,KAAuC,CAAA"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SIGN_AMINO = exports.SIGN_DIRECT = void 0;
4
+ const signing_pb_1 = require("@injectivelabs/chain-api/cosmos/tx/signing/v1beta1/signing_pb");
5
+ exports.SIGN_DIRECT = signing_pb_1.SignMode.SIGN_MODE_DIRECT;
6
+ exports.SIGN_AMINO = signing_pb_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/core/modules/tx/utils/constants.ts"],"names":[],"mappings":";;;AAAA,8FAAwF;AAE3E,QAAA,WAAW,GAAG,qBAAQ,CAAC,gBAAgB,CAAA;AACvC,QAAA,UAAU,GAAG,qBAAQ,CAAC,2BAA2B,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { Any } from 'google-protobuf/google/protobuf/any_pb';
2
+ import { MessageGenerated } from '../types';
3
+ export declare const createAnyMessage: (msg: MessageGenerated) => Any;
4
+ export declare const createAny: (value: any, type: string) => Any;
5
+ export declare const getInjectiveSignerAddress: (address: string | undefined) => string;
6
+ export declare const getEthereumSignerAddress: (address: string | undefined) => string;
7
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/core/modules/tx/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,wCAAwC,CAAA;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE3C,eAAO,MAAM,gBAAgB,QAAS,gBAAgB,QAMrD,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,GAAG,QAAQ,MAAM,QAMjD,CAAA;AAED,eAAO,MAAM,yBAAyB,YAAa,MAAM,GAAG,SAAS,WAcpE,CAAA;AAED,eAAO,MAAM,wBAAwB,YAAa,MAAM,GAAG,SAAS,WAcnE,CAAA"}