injectivejs 0.0.1-beta.30

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 (181) hide show
  1. package/.eslintignore +1 -0
  2. package/CHANGELOG.md +176 -0
  3. package/README.md +21 -0
  4. package/jest.starship.config.js +18 -0
  5. package/package.json +48 -0
  6. package/src/amino/amino.ts +1 -0
  7. package/src/binary.ts +534 -0
  8. package/src/cosmos/auth/v1beta1/auth.ts +550 -0
  9. package/src/cosmos/auth/v1beta1/query.rpc.func.ts +72 -0
  10. package/src/cosmos/auth/v1beta1/query.ts +2034 -0
  11. package/src/cosmos/authz/v1beta1/authz.ts +477 -0
  12. package/src/cosmos/authz/v1beta1/tx.rpc.func.ts +21 -0
  13. package/src/cosmos/authz/v1beta1/tx.ts +647 -0
  14. package/src/cosmos/bank/v1beta1/bank.ts +974 -0
  15. package/src/cosmos/bank/v1beta1/query.rpc.func.ts +93 -0
  16. package/src/cosmos/bank/v1beta1/query.ts +3027 -0
  17. package/src/cosmos/bank/v1beta1/tx.rpc.func.ts +27 -0
  18. package/src/cosmos/bank/v1beta1/tx.ts +861 -0
  19. package/src/cosmos/base/abci/v1beta1/abci.ts +1698 -0
  20. package/src/cosmos/base/query/v1beta1/pagination.ts +361 -0
  21. package/src/cosmos/base/v1beta1/coin.ts +439 -0
  22. package/src/cosmos/crypto/ed25519/keys.ts +209 -0
  23. package/src/cosmos/crypto/multisig/v1beta1/multisig.ts +225 -0
  24. package/src/cosmos/crypto/secp256k1/keys.ts +203 -0
  25. package/src/cosmos/crypto/secp256r1/keys.ts +201 -0
  26. package/src/cosmos/distribution/v1beta1/distribution.ts +1494 -0
  27. package/src/cosmos/distribution/v1beta1/tx.rpc.func.ts +45 -0
  28. package/src/cosmos/distribution/v1beta1/tx.ts +1478 -0
  29. package/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts +21 -0
  30. package/src/cosmos/feegrant/v1beta1/tx.ts +596 -0
  31. package/src/cosmos/gov/v1/gov.ts +1843 -0
  32. package/src/cosmos/gov/v1/tx.rpc.func.ts +45 -0
  33. package/src/cosmos/gov/v1/tx.ts +1660 -0
  34. package/src/cosmos/gov/v1beta1/gov.ts +1428 -0
  35. package/src/cosmos/gov/v1beta1/query.rpc.func.ts +58 -0
  36. package/src/cosmos/gov/v1beta1/query.ts +1749 -0
  37. package/src/cosmos/gov/v1beta1/tx.rpc.func.ts +27 -0
  38. package/src/cosmos/gov/v1beta1/tx.ts +884 -0
  39. package/src/cosmos/group/v1/tx.rpc.func.ts +87 -0
  40. package/src/cosmos/group/v1/tx.ts +3207 -0
  41. package/src/cosmos/group/v1/types.ts +2081 -0
  42. package/src/cosmos/ics23/v1/proofs.ts +2060 -0
  43. package/src/cosmos/msg/v1/msg.ts +1 -0
  44. package/src/cosmos/query/v1/query.ts +1 -0
  45. package/src/cosmos/staking/v1beta1/query.rpc.func.ts +100 -0
  46. package/src/cosmos/staking/v1beta1/query.ts +3073 -0
  47. package/src/cosmos/staking/v1beta1/staking.ts +3005 -0
  48. package/src/cosmos/staking/v1beta1/tx.rpc.func.ts +45 -0
  49. package/src/cosmos/staking/v1beta1/tx.ts +1638 -0
  50. package/src/cosmos/tx/signing/v1beta1/signing.ts +688 -0
  51. package/src/cosmos/tx/v1beta1/service.rpc.func.ts +65 -0
  52. package/src/cosmos/tx/v1beta1/service.ts +2294 -0
  53. package/src/cosmos/tx/v1beta1/tx.ts +2029 -0
  54. package/src/cosmos/upgrade/v1beta1/upgrade.ts +591 -0
  55. package/src/cosmos/vesting/v1beta1/tx.rpc.func.ts +21 -0
  56. package/src/cosmos/vesting/v1beta1/tx.ts +698 -0
  57. package/src/cosmos/vesting/v1beta1/vesting.ts +735 -0
  58. package/src/cosmos_proto/cosmos.ts +341 -0
  59. package/src/cosmwasm/wasm/v1/proposal_legacy.ts +2432 -0
  60. package/src/cosmwasm/wasm/v1/query.rpc.func.ts +100 -0
  61. package/src/cosmwasm/wasm/v1/query.ts +3235 -0
  62. package/src/cosmwasm/wasm/v1/tx.rpc.func.ts +105 -0
  63. package/src/cosmwasm/wasm/v1/tx.ts +4191 -0
  64. package/src/cosmwasm/wasm/v1/types.ts +1120 -0
  65. package/src/extern.ts +38 -0
  66. package/src/gogoproto/gogo.ts +1 -0
  67. package/src/google/api/annotations.ts +1 -0
  68. package/src/google/api/http.ts +1069 -0
  69. package/src/google/protobuf/any.ts +331 -0
  70. package/src/google/protobuf/descriptor.ts +7177 -0
  71. package/src/google/protobuf/duration.ts +225 -0
  72. package/src/google/protobuf/timestamp.ts +281 -0
  73. package/src/helper-func-types.ts +191 -0
  74. package/src/helpers.ts +259 -0
  75. package/src/ibc/applications/transfer/v1/transfer.ts +373 -0
  76. package/src/ibc/applications/transfer/v1/tx.rpc.func.ts +15 -0
  77. package/src/ibc/applications/transfer/v1/tx.ts +569 -0
  78. package/src/ibc/core/channel/v1/channel.ts +1510 -0
  79. package/src/ibc/core/channel/v1/tx.rpc.func.ts +117 -0
  80. package/src/ibc/core/channel/v1/tx.ts +4866 -0
  81. package/src/ibc/core/channel/v1/upgrade.ts +388 -0
  82. package/src/ibc/core/client/v1/client.ts +602 -0
  83. package/src/ibc/core/client/v1/tx.rpc.func.ts +45 -0
  84. package/src/ibc/core/client/v1/tx.ts +1560 -0
  85. package/src/ibc/core/commitment/v1/commitment.ts +314 -0
  86. package/src/ibc/core/connection/v1/connection.ts +1010 -0
  87. package/src/ibc/core/connection/v1/tx.rpc.func.ts +33 -0
  88. package/src/ibc/core/connection/v1/tx.ts +1393 -0
  89. package/src/injective/auction/v1beta1/auction.ts +692 -0
  90. package/src/injective/auction/v1beta1/genesis.ts +156 -0
  91. package/src/injective/auction/v1beta1/query.rpc.func.ts +30 -0
  92. package/src/injective/auction/v1beta1/query.ts +726 -0
  93. package/src/injective/auction/v1beta1/tx.rpc.func.ts +15 -0
  94. package/src/injective/auction/v1beta1/tx.ts +383 -0
  95. package/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts +205 -0
  96. package/src/injective/exchange/v1beta1/authz.ts +1213 -0
  97. package/src/injective/exchange/v1beta1/events.ts +4016 -0
  98. package/src/injective/exchange/v1beta1/exchange.ts +7789 -0
  99. package/src/injective/exchange/v1beta1/genesis.ts +2460 -0
  100. package/src/injective/exchange/v1beta1/proposal.ts +4383 -0
  101. package/src/injective/exchange/v1beta1/query.rpc.func.ts +422 -0
  102. package/src/injective/exchange/v1beta1/query.ts +13590 -0
  103. package/src/injective/exchange/v1beta1/tx.rpc.func.ts +213 -0
  104. package/src/injective/exchange/v1beta1/tx.ts +9492 -0
  105. package/src/injective/insurance/v1beta1/events.ts +521 -0
  106. package/src/injective/insurance/v1beta1/genesis.ts +178 -0
  107. package/src/injective/insurance/v1beta1/insurance.ts +531 -0
  108. package/src/injective/insurance/v1beta1/query.rpc.func.ts +44 -0
  109. package/src/injective/insurance/v1beta1/query.ts +1095 -0
  110. package/src/injective/insurance/v1beta1/tx.rpc.func.ts +27 -0
  111. package/src/injective/insurance/v1beta1/tx.ts +892 -0
  112. package/src/injective/ocr/v1beta1/genesis.ts +945 -0
  113. package/src/injective/ocr/v1beta1/ocr.ts +3044 -0
  114. package/src/injective/ocr/v1beta1/query.rpc.func.ts +51 -0
  115. package/src/injective/ocr/v1beta1/query.ts +1218 -0
  116. package/src/injective/ocr/v1beta1/tx.rpc.func.ts +57 -0
  117. package/src/injective/ocr/v1beta1/tx.ts +1900 -0
  118. package/src/injective/oracle/v1beta1/events.ts +1234 -0
  119. package/src/injective/oracle/v1beta1/genesis.ts +440 -0
  120. package/src/injective/oracle/v1beta1/oracle.ts +3206 -0
  121. package/src/injective/oracle/v1beta1/proposal.ts +1449 -0
  122. package/src/injective/oracle/v1beta1/query.rpc.func.ts +121 -0
  123. package/src/injective/oracle/v1beta1/query.ts +3446 -0
  124. package/src/injective/oracle/v1beta1/tx.rpc.func.ts +51 -0
  125. package/src/injective/oracle/v1beta1/tx.ts +1605 -0
  126. package/src/injective/peggy/v1/attestation.ts +333 -0
  127. package/src/injective/peggy/v1/batch.ts +290 -0
  128. package/src/injective/peggy/v1/ethereum_signer.ts +38 -0
  129. package/src/injective/peggy/v1/events.ts +2274 -0
  130. package/src/injective/peggy/v1/genesis.ts +308 -0
  131. package/src/injective/peggy/v1/msgs.rpc.func.ts +87 -0
  132. package/src/injective/peggy/v1/msgs.ts +3087 -0
  133. package/src/injective/peggy/v1/params.ts +392 -0
  134. package/src/injective/peggy/v1/pool.ts +198 -0
  135. package/src/injective/peggy/v1/proposal.ts +231 -0
  136. package/src/injective/peggy/v1/query.rpc.func.ts +149 -0
  137. package/src/injective/peggy/v1/query.ts +3578 -0
  138. package/src/injective/peggy/v1/types.ts +575 -0
  139. package/src/injective/permissions/v1beta1/events.ts +102 -0
  140. package/src/injective/permissions/v1beta1/genesis.ts +109 -0
  141. package/src/injective/permissions/v1beta1/params.ts +97 -0
  142. package/src/injective/permissions/v1beta1/permissions.ts +709 -0
  143. package/src/injective/permissions/v1beta1/query.rpc.func.ts +44 -0
  144. package/src/injective/permissions/v1beta1/query.ts +1084 -0
  145. package/src/injective/permissions/v1beta1/tx.rpc.func.ts +45 -0
  146. package/src/injective/permissions/v1beta1/tx.ts +1682 -0
  147. package/src/injective/stream/v1beta1/query.ts +2870 -0
  148. package/src/injective/tokenfactory/v1beta1/authorityMetadata.ts +99 -0
  149. package/src/injective/tokenfactory/v1beta1/events.ts +495 -0
  150. package/src/injective/tokenfactory/v1beta1/genesis.ts +259 -0
  151. package/src/injective/tokenfactory/v1beta1/params.ts +100 -0
  152. package/src/injective/tokenfactory/v1beta1/query.rpc.func.ts +30 -0
  153. package/src/injective/tokenfactory/v1beta1/query.ts +714 -0
  154. package/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts +39 -0
  155. package/src/injective/tokenfactory/v1beta1/tx.ts +1208 -0
  156. package/src/injective/types/v1beta1/account.ts +110 -0
  157. package/src/injective/types/v1beta1/tx_ext.ts +139 -0
  158. package/src/injective/types/v1beta1/tx_response.ts +197 -0
  159. package/src/injective/wasmx/v1/events.ts +396 -0
  160. package/src/injective/wasmx/v1/genesis.ts +214 -0
  161. package/src/injective/wasmx/v1/proposal.ts +769 -0
  162. package/src/injective/wasmx/v1/query.rpc.func.ts +23 -0
  163. package/src/injective/wasmx/v1/query.ts +509 -0
  164. package/src/injective/wasmx/v1/tx.rpc.func.ts +39 -0
  165. package/src/injective/wasmx/v1/tx.ts +1174 -0
  166. package/src/injective/wasmx/v1/wasmx.ts +379 -0
  167. package/src/registry.ts +218 -0
  168. package/src/tendermint/abci/types.ts +6283 -0
  169. package/src/tendermint/crypto/keys.ts +103 -0
  170. package/src/tendermint/crypto/proof.ts +555 -0
  171. package/src/tendermint/types/block.ts +131 -0
  172. package/src/tendermint/types/evidence.ts +476 -0
  173. package/src/tendermint/types/params.ts +814 -0
  174. package/src/tendermint/types/types.ts +2157 -0
  175. package/src/tendermint/types/validator.ts +389 -0
  176. package/src/tendermint/version/types.ts +219 -0
  177. package/src/types.ts +155 -0
  178. package/src/utf8.ts +148 -0
  179. package/src/varint.ts +488 -0
  180. package/tsconfig.esm.json +9 -0
  181. package/tsconfig.json +9 -0
@@ -0,0 +1,531 @@
1
+ import { Duration, DurationAmino } from "../../../google/protobuf/duration";
2
+ import { OracleType } from "../../oracle/v1beta1/oracle";
3
+ import { Timestamp } from "../../../google/protobuf/timestamp";
4
+ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin";
5
+ import { BinaryReader, BinaryWriter } from "../../../binary";
6
+ import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers";
7
+ import { GlobalDecoderRegistry } from "../../../registry";
8
+ export interface Params {
9
+ /**
10
+ * default_redemption_notice_period_duration defines the default minimum
11
+ * notice period duration that must pass after an underwriter sends a
12
+ * redemption request before the underwriter can claim his tokens
13
+ */
14
+ defaultRedemptionNoticePeriodDuration: Duration;
15
+ }
16
+ export interface ParamsProtoMsg {
17
+ typeUrl: "/injective.insurance.v1beta1.Params";
18
+ value: Uint8Array;
19
+ }
20
+ export interface ParamsAmino {
21
+ /**
22
+ * default_redemption_notice_period_duration defines the default minimum
23
+ * notice period duration that must pass after an underwriter sends a
24
+ * redemption request before the underwriter can claim his tokens
25
+ */
26
+ default_redemption_notice_period_duration: DurationAmino;
27
+ }
28
+ export interface ParamsAminoMsg {
29
+ type: "insurance/Params";
30
+ value: ParamsAmino;
31
+ }
32
+ export interface InsuranceFund {
33
+ /** deposit denomination for the given insurance fund */
34
+ depositDenom: string;
35
+ /** insurance fund pool token denomination for the given insurance fund */
36
+ insurancePoolTokenDenom: string;
37
+ /**
38
+ * redemption_notice_period_duration defines the minimum notice period
39
+ * duration that must pass after an underwriter sends a redemption request
40
+ * before the underwriter can claim his tokens
41
+ */
42
+ redemptionNoticePeriodDuration: Duration;
43
+ /** balance of fund */
44
+ balance: string;
45
+ /** total share tokens minted */
46
+ totalShare: string;
47
+ /** marketID of the derivative market */
48
+ marketId: string;
49
+ /** ticker of the derivative market */
50
+ marketTicker: string;
51
+ /**
52
+ * Oracle base currency of the derivative market OR the oracle symbol for the
53
+ * binary options market.
54
+ */
55
+ oracleBase: string;
56
+ /**
57
+ * Oracle quote currency of the derivative market OR the oracle provider for
58
+ * the binary options market.
59
+ */
60
+ oracleQuote: string;
61
+ /** Oracle type of the binary options or derivative market */
62
+ oracleType: OracleType;
63
+ /**
64
+ * Expiration time of the derivative market. Should be -1 for perpetual or -2
65
+ * for binary options markets.
66
+ */
67
+ expiry: bigint;
68
+ }
69
+ export interface InsuranceFundProtoMsg {
70
+ typeUrl: "/injective.insurance.v1beta1.InsuranceFund";
71
+ value: Uint8Array;
72
+ }
73
+ export interface InsuranceFundAmino {
74
+ /** deposit denomination for the given insurance fund */
75
+ deposit_denom: string;
76
+ /** insurance fund pool token denomination for the given insurance fund */
77
+ insurance_pool_token_denom: string;
78
+ /**
79
+ * redemption_notice_period_duration defines the minimum notice period
80
+ * duration that must pass after an underwriter sends a redemption request
81
+ * before the underwriter can claim his tokens
82
+ */
83
+ redemption_notice_period_duration: DurationAmino;
84
+ /** balance of fund */
85
+ balance: string;
86
+ /** total share tokens minted */
87
+ total_share: string;
88
+ /** marketID of the derivative market */
89
+ market_id: string;
90
+ /** ticker of the derivative market */
91
+ market_ticker: string;
92
+ /**
93
+ * Oracle base currency of the derivative market OR the oracle symbol for the
94
+ * binary options market.
95
+ */
96
+ oracle_base: string;
97
+ /**
98
+ * Oracle quote currency of the derivative market OR the oracle provider for
99
+ * the binary options market.
100
+ */
101
+ oracle_quote: string;
102
+ /** Oracle type of the binary options or derivative market */
103
+ oracle_type: OracleType;
104
+ /**
105
+ * Expiration time of the derivative market. Should be -1 for perpetual or -2
106
+ * for binary options markets.
107
+ */
108
+ expiry: string;
109
+ }
110
+ export interface InsuranceFundAminoMsg {
111
+ type: "/injective.insurance.v1beta1.InsuranceFund";
112
+ value: InsuranceFundAmino;
113
+ }
114
+ export interface RedemptionSchedule {
115
+ /** id of redemption schedule */
116
+ id: bigint;
117
+ /** marketId of insurance fund for the redemption */
118
+ marketId: string;
119
+ /** address of the redeemer */
120
+ redeemer: string;
121
+ /** the time after which the redemption can be claimed */
122
+ claimableRedemptionTime: Date;
123
+ /** the insurance_pool_token amount to redeem */
124
+ redemptionAmount: Coin;
125
+ }
126
+ export interface RedemptionScheduleProtoMsg {
127
+ typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule";
128
+ value: Uint8Array;
129
+ }
130
+ export interface RedemptionScheduleAmino {
131
+ /** id of redemption schedule */
132
+ id: string;
133
+ /** marketId of insurance fund for the redemption */
134
+ marketId: string;
135
+ /** address of the redeemer */
136
+ redeemer: string;
137
+ /** the time after which the redemption can be claimed */
138
+ claimable_redemption_time: string;
139
+ /** the insurance_pool_token amount to redeem */
140
+ redemption_amount: CoinAmino;
141
+ }
142
+ export interface RedemptionScheduleAminoMsg {
143
+ type: "/injective.insurance.v1beta1.RedemptionSchedule";
144
+ value: RedemptionScheduleAmino;
145
+ }
146
+ function createBaseParams(): Params {
147
+ return {
148
+ defaultRedemptionNoticePeriodDuration: Duration.fromPartial({})
149
+ };
150
+ }
151
+ export const Params = {
152
+ typeUrl: "/injective.insurance.v1beta1.Params",
153
+ aminoType: "insurance/Params",
154
+ is(o: any): o is Params {
155
+ return o && (o.$typeUrl === Params.typeUrl || Duration.is(o.defaultRedemptionNoticePeriodDuration));
156
+ },
157
+ isAmino(o: any): o is ParamsAmino {
158
+ return o && (o.$typeUrl === Params.typeUrl || Duration.isAmino(o.default_redemption_notice_period_duration));
159
+ },
160
+ encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
161
+ if (message.defaultRedemptionNoticePeriodDuration !== undefined) {
162
+ Duration.encode(message.defaultRedemptionNoticePeriodDuration, writer.uint32(10).fork()).ldelim();
163
+ }
164
+ return writer;
165
+ },
166
+ decode(input: BinaryReader | Uint8Array, length?: number): Params {
167
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
168
+ let end = length === undefined ? reader.len : reader.pos + length;
169
+ const message = createBaseParams();
170
+ while (reader.pos < end) {
171
+ const tag = reader.uint32();
172
+ switch (tag >>> 3) {
173
+ case 1:
174
+ message.defaultRedemptionNoticePeriodDuration = Duration.decode(reader, reader.uint32());
175
+ break;
176
+ default:
177
+ reader.skipType(tag & 7);
178
+ break;
179
+ }
180
+ }
181
+ return message;
182
+ },
183
+ fromPartial(object: DeepPartial<Params>): Params {
184
+ const message = createBaseParams();
185
+ message.defaultRedemptionNoticePeriodDuration = object.defaultRedemptionNoticePeriodDuration !== undefined && object.defaultRedemptionNoticePeriodDuration !== null ? Duration.fromPartial(object.defaultRedemptionNoticePeriodDuration) : undefined;
186
+ return message;
187
+ },
188
+ fromAmino(object: ParamsAmino): Params {
189
+ const message = createBaseParams();
190
+ if (object.default_redemption_notice_period_duration !== undefined && object.default_redemption_notice_period_duration !== null) {
191
+ message.defaultRedemptionNoticePeriodDuration = Duration.fromAmino(object.default_redemption_notice_period_duration);
192
+ }
193
+ return message;
194
+ },
195
+ toAmino(message: Params): ParamsAmino {
196
+ const obj: any = {};
197
+ obj.default_redemption_notice_period_duration = message.defaultRedemptionNoticePeriodDuration ? Duration.toAmino(message.defaultRedemptionNoticePeriodDuration) : undefined;
198
+ return obj;
199
+ },
200
+ fromAminoMsg(object: ParamsAminoMsg): Params {
201
+ return Params.fromAmino(object.value);
202
+ },
203
+ toAminoMsg(message: Params): ParamsAminoMsg {
204
+ return {
205
+ type: "insurance/Params",
206
+ value: Params.toAmino(message)
207
+ };
208
+ },
209
+ fromProtoMsg(message: ParamsProtoMsg): Params {
210
+ return Params.decode(message.value);
211
+ },
212
+ toProto(message: Params): Uint8Array {
213
+ return Params.encode(message).finish();
214
+ },
215
+ toProtoMsg(message: Params): ParamsProtoMsg {
216
+ return {
217
+ typeUrl: "/injective.insurance.v1beta1.Params",
218
+ value: Params.encode(message).finish()
219
+ };
220
+ }
221
+ };
222
+ GlobalDecoderRegistry.register(Params.typeUrl, Params);
223
+ GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl);
224
+ function createBaseInsuranceFund(): InsuranceFund {
225
+ return {
226
+ depositDenom: "",
227
+ insurancePoolTokenDenom: "",
228
+ redemptionNoticePeriodDuration: Duration.fromPartial({}),
229
+ balance: "",
230
+ totalShare: "",
231
+ marketId: "",
232
+ marketTicker: "",
233
+ oracleBase: "",
234
+ oracleQuote: "",
235
+ oracleType: 0,
236
+ expiry: BigInt(0)
237
+ };
238
+ }
239
+ export const InsuranceFund = {
240
+ typeUrl: "/injective.insurance.v1beta1.InsuranceFund",
241
+ is(o: any): o is InsuranceFund {
242
+ return o && (o.$typeUrl === InsuranceFund.typeUrl || typeof o.depositDenom === "string" && typeof o.insurancePoolTokenDenom === "string" && Duration.is(o.redemptionNoticePeriodDuration) && typeof o.balance === "string" && typeof o.totalShare === "string" && typeof o.marketId === "string" && typeof o.marketTicker === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.expiry === "bigint");
243
+ },
244
+ isAmino(o: any): o is InsuranceFundAmino {
245
+ return o && (o.$typeUrl === InsuranceFund.typeUrl || typeof o.deposit_denom === "string" && typeof o.insurance_pool_token_denom === "string" && Duration.isAmino(o.redemption_notice_period_duration) && typeof o.balance === "string" && typeof o.total_share === "string" && typeof o.market_id === "string" && typeof o.market_ticker === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.expiry === "bigint");
246
+ },
247
+ encode(message: InsuranceFund, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
248
+ if (message.depositDenom !== "") {
249
+ writer.uint32(10).string(message.depositDenom);
250
+ }
251
+ if (message.insurancePoolTokenDenom !== "") {
252
+ writer.uint32(18).string(message.insurancePoolTokenDenom);
253
+ }
254
+ if (message.redemptionNoticePeriodDuration !== undefined) {
255
+ Duration.encode(message.redemptionNoticePeriodDuration, writer.uint32(26).fork()).ldelim();
256
+ }
257
+ if (message.balance !== "") {
258
+ writer.uint32(34).string(message.balance);
259
+ }
260
+ if (message.totalShare !== "") {
261
+ writer.uint32(42).string(message.totalShare);
262
+ }
263
+ if (message.marketId !== "") {
264
+ writer.uint32(50).string(message.marketId);
265
+ }
266
+ if (message.marketTicker !== "") {
267
+ writer.uint32(58).string(message.marketTicker);
268
+ }
269
+ if (message.oracleBase !== "") {
270
+ writer.uint32(66).string(message.oracleBase);
271
+ }
272
+ if (message.oracleQuote !== "") {
273
+ writer.uint32(74).string(message.oracleQuote);
274
+ }
275
+ if (message.oracleType !== 0) {
276
+ writer.uint32(80).int32(message.oracleType);
277
+ }
278
+ if (message.expiry !== BigInt(0)) {
279
+ writer.uint32(88).int64(message.expiry);
280
+ }
281
+ return writer;
282
+ },
283
+ decode(input: BinaryReader | Uint8Array, length?: number): InsuranceFund {
284
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
285
+ let end = length === undefined ? reader.len : reader.pos + length;
286
+ const message = createBaseInsuranceFund();
287
+ while (reader.pos < end) {
288
+ const tag = reader.uint32();
289
+ switch (tag >>> 3) {
290
+ case 1:
291
+ message.depositDenom = reader.string();
292
+ break;
293
+ case 2:
294
+ message.insurancePoolTokenDenom = reader.string();
295
+ break;
296
+ case 3:
297
+ message.redemptionNoticePeriodDuration = Duration.decode(reader, reader.uint32());
298
+ break;
299
+ case 4:
300
+ message.balance = reader.string();
301
+ break;
302
+ case 5:
303
+ message.totalShare = reader.string();
304
+ break;
305
+ case 6:
306
+ message.marketId = reader.string();
307
+ break;
308
+ case 7:
309
+ message.marketTicker = reader.string();
310
+ break;
311
+ case 8:
312
+ message.oracleBase = reader.string();
313
+ break;
314
+ case 9:
315
+ message.oracleQuote = reader.string();
316
+ break;
317
+ case 10:
318
+ message.oracleType = (reader.int32() as any);
319
+ break;
320
+ case 11:
321
+ message.expiry = reader.int64();
322
+ break;
323
+ default:
324
+ reader.skipType(tag & 7);
325
+ break;
326
+ }
327
+ }
328
+ return message;
329
+ },
330
+ fromPartial(object: DeepPartial<InsuranceFund>): InsuranceFund {
331
+ const message = createBaseInsuranceFund();
332
+ message.depositDenom = object.depositDenom ?? "";
333
+ message.insurancePoolTokenDenom = object.insurancePoolTokenDenom ?? "";
334
+ message.redemptionNoticePeriodDuration = object.redemptionNoticePeriodDuration !== undefined && object.redemptionNoticePeriodDuration !== null ? Duration.fromPartial(object.redemptionNoticePeriodDuration) : undefined;
335
+ message.balance = object.balance ?? "";
336
+ message.totalShare = object.totalShare ?? "";
337
+ message.marketId = object.marketId ?? "";
338
+ message.marketTicker = object.marketTicker ?? "";
339
+ message.oracleBase = object.oracleBase ?? "";
340
+ message.oracleQuote = object.oracleQuote ?? "";
341
+ message.oracleType = object.oracleType ?? 0;
342
+ message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0);
343
+ return message;
344
+ },
345
+ fromAmino(object: InsuranceFundAmino): InsuranceFund {
346
+ const message = createBaseInsuranceFund();
347
+ if (object.deposit_denom !== undefined && object.deposit_denom !== null) {
348
+ message.depositDenom = object.deposit_denom;
349
+ }
350
+ if (object.insurance_pool_token_denom !== undefined && object.insurance_pool_token_denom !== null) {
351
+ message.insurancePoolTokenDenom = object.insurance_pool_token_denom;
352
+ }
353
+ if (object.redemption_notice_period_duration !== undefined && object.redemption_notice_period_duration !== null) {
354
+ message.redemptionNoticePeriodDuration = Duration.fromAmino(object.redemption_notice_period_duration);
355
+ }
356
+ if (object.balance !== undefined && object.balance !== null) {
357
+ message.balance = object.balance;
358
+ }
359
+ if (object.total_share !== undefined && object.total_share !== null) {
360
+ message.totalShare = object.total_share;
361
+ }
362
+ if (object.market_id !== undefined && object.market_id !== null) {
363
+ message.marketId = object.market_id;
364
+ }
365
+ if (object.market_ticker !== undefined && object.market_ticker !== null) {
366
+ message.marketTicker = object.market_ticker;
367
+ }
368
+ if (object.oracle_base !== undefined && object.oracle_base !== null) {
369
+ message.oracleBase = object.oracle_base;
370
+ }
371
+ if (object.oracle_quote !== undefined && object.oracle_quote !== null) {
372
+ message.oracleQuote = object.oracle_quote;
373
+ }
374
+ if (object.oracle_type !== undefined && object.oracle_type !== null) {
375
+ message.oracleType = object.oracle_type;
376
+ }
377
+ if (object.expiry !== undefined && object.expiry !== null) {
378
+ message.expiry = BigInt(object.expiry);
379
+ }
380
+ return message;
381
+ },
382
+ toAmino(message: InsuranceFund): InsuranceFundAmino {
383
+ const obj: any = {};
384
+ obj.deposit_denom = message.depositDenom === "" ? undefined : message.depositDenom;
385
+ obj.insurance_pool_token_denom = message.insurancePoolTokenDenom === "" ? undefined : message.insurancePoolTokenDenom;
386
+ obj.redemption_notice_period_duration = message.redemptionNoticePeriodDuration ? Duration.toAmino(message.redemptionNoticePeriodDuration) : undefined;
387
+ obj.balance = message.balance === "" ? undefined : message.balance;
388
+ obj.total_share = message.totalShare === "" ? undefined : message.totalShare;
389
+ obj.market_id = message.marketId === "" ? undefined : message.marketId;
390
+ obj.market_ticker = message.marketTicker === "" ? undefined : message.marketTicker;
391
+ obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase;
392
+ obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote;
393
+ obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType;
394
+ obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined;
395
+ return obj;
396
+ },
397
+ fromAminoMsg(object: InsuranceFundAminoMsg): InsuranceFund {
398
+ return InsuranceFund.fromAmino(object.value);
399
+ },
400
+ fromProtoMsg(message: InsuranceFundProtoMsg): InsuranceFund {
401
+ return InsuranceFund.decode(message.value);
402
+ },
403
+ toProto(message: InsuranceFund): Uint8Array {
404
+ return InsuranceFund.encode(message).finish();
405
+ },
406
+ toProtoMsg(message: InsuranceFund): InsuranceFundProtoMsg {
407
+ return {
408
+ typeUrl: "/injective.insurance.v1beta1.InsuranceFund",
409
+ value: InsuranceFund.encode(message).finish()
410
+ };
411
+ }
412
+ };
413
+ GlobalDecoderRegistry.register(InsuranceFund.typeUrl, InsuranceFund);
414
+ function createBaseRedemptionSchedule(): RedemptionSchedule {
415
+ return {
416
+ id: BigInt(0),
417
+ marketId: "",
418
+ redeemer: "",
419
+ claimableRedemptionTime: new Date(),
420
+ redemptionAmount: Coin.fromPartial({})
421
+ };
422
+ }
423
+ export const RedemptionSchedule = {
424
+ typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule",
425
+ is(o: any): o is RedemptionSchedule {
426
+ return o && (o.$typeUrl === RedemptionSchedule.typeUrl || typeof o.id === "bigint" && typeof o.marketId === "string" && typeof o.redeemer === "string" && Timestamp.is(o.claimableRedemptionTime) && Coin.is(o.redemptionAmount));
427
+ },
428
+ isAmino(o: any): o is RedemptionScheduleAmino {
429
+ return o && (o.$typeUrl === RedemptionSchedule.typeUrl || typeof o.id === "bigint" && typeof o.marketId === "string" && typeof o.redeemer === "string" && Timestamp.isAmino(o.claimable_redemption_time) && Coin.isAmino(o.redemption_amount));
430
+ },
431
+ encode(message: RedemptionSchedule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
432
+ if (message.id !== BigInt(0)) {
433
+ writer.uint32(8).uint64(message.id);
434
+ }
435
+ if (message.marketId !== "") {
436
+ writer.uint32(18).string(message.marketId);
437
+ }
438
+ if (message.redeemer !== "") {
439
+ writer.uint32(26).string(message.redeemer);
440
+ }
441
+ if (message.claimableRedemptionTime !== undefined) {
442
+ Timestamp.encode(toTimestamp(message.claimableRedemptionTime), writer.uint32(34).fork()).ldelim();
443
+ }
444
+ if (message.redemptionAmount !== undefined) {
445
+ Coin.encode(message.redemptionAmount, writer.uint32(42).fork()).ldelim();
446
+ }
447
+ return writer;
448
+ },
449
+ decode(input: BinaryReader | Uint8Array, length?: number): RedemptionSchedule {
450
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
451
+ let end = length === undefined ? reader.len : reader.pos + length;
452
+ const message = createBaseRedemptionSchedule();
453
+ while (reader.pos < end) {
454
+ const tag = reader.uint32();
455
+ switch (tag >>> 3) {
456
+ case 1:
457
+ message.id = reader.uint64();
458
+ break;
459
+ case 2:
460
+ message.marketId = reader.string();
461
+ break;
462
+ case 3:
463
+ message.redeemer = reader.string();
464
+ break;
465
+ case 4:
466
+ message.claimableRedemptionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
467
+ break;
468
+ case 5:
469
+ message.redemptionAmount = Coin.decode(reader, reader.uint32());
470
+ break;
471
+ default:
472
+ reader.skipType(tag & 7);
473
+ break;
474
+ }
475
+ }
476
+ return message;
477
+ },
478
+ fromPartial(object: DeepPartial<RedemptionSchedule>): RedemptionSchedule {
479
+ const message = createBaseRedemptionSchedule();
480
+ message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0);
481
+ message.marketId = object.marketId ?? "";
482
+ message.redeemer = object.redeemer ?? "";
483
+ message.claimableRedemptionTime = object.claimableRedemptionTime ?? undefined;
484
+ message.redemptionAmount = object.redemptionAmount !== undefined && object.redemptionAmount !== null ? Coin.fromPartial(object.redemptionAmount) : undefined;
485
+ return message;
486
+ },
487
+ fromAmino(object: RedemptionScheduleAmino): RedemptionSchedule {
488
+ const message = createBaseRedemptionSchedule();
489
+ if (object.id !== undefined && object.id !== null) {
490
+ message.id = BigInt(object.id);
491
+ }
492
+ if (object.marketId !== undefined && object.marketId !== null) {
493
+ message.marketId = object.marketId;
494
+ }
495
+ if (object.redeemer !== undefined && object.redeemer !== null) {
496
+ message.redeemer = object.redeemer;
497
+ }
498
+ if (object.claimable_redemption_time !== undefined && object.claimable_redemption_time !== null) {
499
+ message.claimableRedemptionTime = fromTimestamp(Timestamp.fromAmino(object.claimable_redemption_time));
500
+ }
501
+ if (object.redemption_amount !== undefined && object.redemption_amount !== null) {
502
+ message.redemptionAmount = Coin.fromAmino(object.redemption_amount);
503
+ }
504
+ return message;
505
+ },
506
+ toAmino(message: RedemptionSchedule): RedemptionScheduleAmino {
507
+ const obj: any = {};
508
+ obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined;
509
+ obj.marketId = message.marketId === "" ? undefined : message.marketId;
510
+ obj.redeemer = message.redeemer === "" ? undefined : message.redeemer;
511
+ obj.claimable_redemption_time = message.claimableRedemptionTime ? Timestamp.toAmino(toTimestamp(message.claimableRedemptionTime)) : undefined;
512
+ obj.redemption_amount = message.redemptionAmount ? Coin.toAmino(message.redemptionAmount) : undefined;
513
+ return obj;
514
+ },
515
+ fromAminoMsg(object: RedemptionScheduleAminoMsg): RedemptionSchedule {
516
+ return RedemptionSchedule.fromAmino(object.value);
517
+ },
518
+ fromProtoMsg(message: RedemptionScheduleProtoMsg): RedemptionSchedule {
519
+ return RedemptionSchedule.decode(message.value);
520
+ },
521
+ toProto(message: RedemptionSchedule): Uint8Array {
522
+ return RedemptionSchedule.encode(message).finish();
523
+ },
524
+ toProtoMsg(message: RedemptionSchedule): RedemptionScheduleProtoMsg {
525
+ return {
526
+ typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule",
527
+ value: RedemptionSchedule.encode(message).finish()
528
+ };
529
+ }
530
+ };
531
+ GlobalDecoderRegistry.register(RedemptionSchedule.typeUrl, RedemptionSchedule);
@@ -0,0 +1,44 @@
1
+ import { RpcResolver, buildQuery } from "../../../helper-func-types";
2
+ import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query";
3
+ export const createGetInsuranceParams = (clientResolver?: RpcResolver) => buildQuery<QueryInsuranceParamsRequest, QueryInsuranceParamsResponse>({
4
+ encode: QueryInsuranceParamsRequest.encode,
5
+ decode: QueryInsuranceParamsResponse.decode,
6
+ service: "injective.insurance.v1beta1.Query",
7
+ method: "InsuranceParams",
8
+ clientResolver
9
+ });
10
+ export const createGetInsuranceFund = (clientResolver?: RpcResolver) => buildQuery<QueryInsuranceFundRequest, QueryInsuranceFundResponse>({
11
+ encode: QueryInsuranceFundRequest.encode,
12
+ decode: QueryInsuranceFundResponse.decode,
13
+ service: "injective.insurance.v1beta1.Query",
14
+ method: "InsuranceFund",
15
+ clientResolver
16
+ });
17
+ export const createGetInsuranceFunds = (clientResolver?: RpcResolver) => buildQuery<QueryInsuranceFundsRequest, QueryInsuranceFundsResponse>({
18
+ encode: QueryInsuranceFundsRequest.encode,
19
+ decode: QueryInsuranceFundsResponse.decode,
20
+ service: "injective.insurance.v1beta1.Query",
21
+ method: "InsuranceFunds",
22
+ clientResolver
23
+ });
24
+ export const createGetEstimatedRedemptions = (clientResolver?: RpcResolver) => buildQuery<QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse>({
25
+ encode: QueryEstimatedRedemptionsRequest.encode,
26
+ decode: QueryEstimatedRedemptionsResponse.decode,
27
+ service: "injective.insurance.v1beta1.Query",
28
+ method: "EstimatedRedemptions",
29
+ clientResolver
30
+ });
31
+ export const createGetPendingRedemptions = (clientResolver?: RpcResolver) => buildQuery<QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse>({
32
+ encode: QueryPendingRedemptionsRequest.encode,
33
+ decode: QueryPendingRedemptionsResponse.decode,
34
+ service: "injective.insurance.v1beta1.Query",
35
+ method: "PendingRedemptions",
36
+ clientResolver
37
+ });
38
+ export const createGetInsuranceModuleState = (clientResolver?: RpcResolver) => buildQuery<QueryModuleStateRequest, QueryModuleStateResponse>({
39
+ encode: QueryModuleStateRequest.encode,
40
+ decode: QueryModuleStateResponse.decode,
41
+ service: "injective.insurance.v1beta1.Query",
42
+ method: "InsuranceModuleState",
43
+ clientResolver
44
+ });