injectivejs 1.9.13 → 1.9.14

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 (40) hide show
  1. package/cosmos/base/v1beta1/coin.js +5 -4
  2. package/cosmos/distribution/v1beta1/distribution.js +11 -10
  3. package/cosmos/gov/v1beta1/gov.js +3 -2
  4. package/cosmos/staking/v1beta1/staking.js +15 -14
  5. package/cosmos/staking/v1beta1/tx.js +3 -2
  6. package/decimals.d.ts +20 -0
  7. package/decimals.js +102 -0
  8. package/esm/cosmos/base/v1beta1/coin.js +5 -4
  9. package/esm/cosmos/distribution/v1beta1/distribution.js +11 -10
  10. package/esm/cosmos/gov/v1beta1/gov.js +3 -2
  11. package/esm/cosmos/staking/v1beta1/staking.js +15 -14
  12. package/esm/cosmos/staking/v1beta1/tx.js +3 -2
  13. package/esm/decimals.js +98 -0
  14. package/esm/injective/auction/v1beta1/auction.js +3 -2
  15. package/esm/injective/exchange/v1beta1/events.js +13 -12
  16. package/esm/injective/exchange/v1beta1/exchange.js +183 -182
  17. package/esm/injective/exchange/v1beta1/genesis.js +5 -4
  18. package/esm/injective/exchange/v1beta1/proposal.js +99 -98
  19. package/esm/injective/exchange/v1beta1/query.js +89 -88
  20. package/esm/injective/exchange/v1beta1/tx.js +81 -80
  21. package/esm/injective/ocr/v1beta1/ocr.js +17 -16
  22. package/esm/injective/oracle/v1beta1/events.js +13 -12
  23. package/esm/injective/oracle/v1beta1/oracle.js +31 -30
  24. package/esm/injective/oracle/v1beta1/query.js +13 -12
  25. package/esm/injective/oracle/v1beta1/tx.js +5 -4
  26. package/esm/injective/stream/v1beta1/query.js +21 -20
  27. package/injective/auction/v1beta1/auction.js +3 -2
  28. package/injective/exchange/v1beta1/events.js +13 -12
  29. package/injective/exchange/v1beta1/exchange.js +183 -182
  30. package/injective/exchange/v1beta1/genesis.js +5 -4
  31. package/injective/exchange/v1beta1/proposal.js +99 -98
  32. package/injective/exchange/v1beta1/query.js +89 -88
  33. package/injective/exchange/v1beta1/tx.js +81 -80
  34. package/injective/ocr/v1beta1/ocr.js +17 -16
  35. package/injective/oracle/v1beta1/events.js +13 -12
  36. package/injective/oracle/v1beta1/oracle.js +31 -30
  37. package/injective/oracle/v1beta1/query.js +13 -12
  38. package/injective/oracle/v1beta1/tx.js +5 -4
  39. package/injective/stream/v1beta1/query.js +21 -20
  40. package/package.json +8 -8
@@ -1,5 +1,6 @@
1
1
  import { StorkPriceState, PythPriceState } from "./oracle";
2
2
  import { BinaryReader, BinaryWriter } from "../../../binary";
3
+ import { Decimal } from "../../../decimals";
3
4
  function createBaseSetChainlinkPriceEvent() {
4
5
  return {
5
6
  feedId: "",
@@ -20,7 +21,7 @@ export const SetChainlinkPriceEvent = {
20
21
  writer.uint32(10).string(message.feedId);
21
22
  }
22
23
  if (message.answer !== "") {
23
- writer.uint32(18).string(message.answer);
24
+ writer.uint32(18).string(Decimal.fromUserInput(message.answer, 18).atomics);
24
25
  }
25
26
  if (message.timestamp !== BigInt(0)) {
26
27
  writer.uint32(24).uint64(message.timestamp);
@@ -38,7 +39,7 @@ export const SetChainlinkPriceEvent = {
38
39
  message.feedId = reader.string();
39
40
  break;
40
41
  case 2:
41
- message.answer = reader.string();
42
+ message.answer = Decimal.fromAtomics(reader.string(), 18).toString();
42
43
  break;
43
44
  case 3:
44
45
  message.timestamp = reader.uint64();
@@ -119,7 +120,7 @@ export const SetBandPriceEvent = {
119
120
  writer.uint32(18).string(message.symbol);
120
121
  }
121
122
  if (message.price !== "") {
122
- writer.uint32(26).string(message.price);
123
+ writer.uint32(26).string(Decimal.fromUserInput(message.price, 18).atomics);
123
124
  }
124
125
  if (message.resolveTime !== BigInt(0)) {
125
126
  writer.uint32(32).uint64(message.resolveTime);
@@ -143,7 +144,7 @@ export const SetBandPriceEvent = {
143
144
  message.symbol = reader.string();
144
145
  break;
145
146
  case 3:
146
- message.price = reader.string();
147
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
147
148
  break;
148
149
  case 4:
149
150
  message.resolveTime = reader.uint64();
@@ -238,7 +239,7 @@ export const SetBandIBCPriceEvent = {
238
239
  writer.uint32(18).string(v);
239
240
  }
240
241
  for (const v of message.prices) {
241
- writer.uint32(26).string(v);
242
+ writer.uint32(26).string(Decimal.fromUserInput(v, 18).atomics);
242
243
  }
243
244
  if (message.resolveTime !== BigInt(0)) {
244
245
  writer.uint32(32).uint64(message.resolveTime);
@@ -265,7 +266,7 @@ export const SetBandIBCPriceEvent = {
265
266
  message.symbols.push(reader.string());
266
267
  break;
267
268
  case 3:
268
- message.prices.push(reader.string());
269
+ message.prices.push(Decimal.fromAtomics(reader.string(), 18).toString());
269
270
  break;
270
271
  case 4:
271
272
  message.resolveTime = reader.uint64();
@@ -609,7 +610,7 @@ export const SetPriceFeedPriceEvent = {
609
610
  writer.uint32(26).string(message.quote);
610
611
  }
611
612
  if (message.price !== "") {
612
- writer.uint32(34).string(message.price);
613
+ writer.uint32(34).string(Decimal.fromUserInput(message.price, 18).atomics);
613
614
  }
614
615
  return writer;
615
616
  },
@@ -630,7 +631,7 @@ export const SetPriceFeedPriceEvent = {
630
631
  message.quote = reader.string();
631
632
  break;
632
633
  case 4:
633
- message.price = reader.string();
634
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
634
635
  break;
635
636
  default:
636
637
  reader.skipType(tag & 7);
@@ -715,7 +716,7 @@ export const SetProviderPriceEvent = {
715
716
  writer.uint32(26).string(message.symbol);
716
717
  }
717
718
  if (message.price !== "") {
718
- writer.uint32(34).string(message.price);
719
+ writer.uint32(34).string(Decimal.fromUserInput(message.price, 18).atomics);
719
720
  }
720
721
  return writer;
721
722
  },
@@ -736,7 +737,7 @@ export const SetProviderPriceEvent = {
736
737
  message.symbol = reader.string();
737
738
  break;
738
739
  case 4:
739
- message.price = reader.string();
740
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
740
741
  break;
741
742
  default:
742
743
  reader.skipType(tag & 7);
@@ -814,7 +815,7 @@ export const SetCoinbasePriceEvent = {
814
815
  writer.uint32(10).string(message.symbol);
815
816
  }
816
817
  if (message.price !== "") {
817
- writer.uint32(18).string(message.price);
818
+ writer.uint32(18).string(Decimal.fromUserInput(message.price, 18).atomics);
818
819
  }
819
820
  if (message.timestamp !== BigInt(0)) {
820
821
  writer.uint32(24).uint64(message.timestamp);
@@ -832,7 +833,7 @@ export const SetCoinbasePriceEvent = {
832
833
  message.symbol = reader.string();
833
834
  break;
834
835
  case 2:
835
- message.price = reader.string();
836
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
836
837
  break;
837
838
  case 3:
838
839
  message.timestamp = reader.uint64();
@@ -1,6 +1,7 @@
1
1
  import { Coin } from "../../../cosmos/base/v1beta1/coin";
2
2
  import { BinaryReader, BinaryWriter } from "../../../binary";
3
3
  import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers";
4
+ import { Decimal } from "../../../decimals";
4
5
  export var OracleType;
5
6
  (function (OracleType) {
6
7
  OracleType[OracleType["Unspecified"] = 0] = "Unspecified";
@@ -279,7 +280,7 @@ export const ChainlinkPriceState = {
279
280
  writer.uint32(10).string(message.feedId);
280
281
  }
281
282
  if (message.answer !== "") {
282
- writer.uint32(18).string(message.answer);
283
+ writer.uint32(18).string(Decimal.fromUserInput(message.answer, 18).atomics);
283
284
  }
284
285
  if (message.timestamp !== BigInt(0)) {
285
286
  writer.uint32(24).uint64(message.timestamp);
@@ -300,7 +301,7 @@ export const ChainlinkPriceState = {
300
301
  message.feedId = reader.string();
301
302
  break;
302
303
  case 2:
303
- message.answer = reader.string();
304
+ message.answer = Decimal.fromAtomics(reader.string(), 18).toString();
304
305
  break;
305
306
  case 3:
306
307
  message.timestamp = reader.uint64();
@@ -951,7 +952,7 @@ export const PriceFeedPrice = {
951
952
  },
952
953
  encode(message, writer = BinaryWriter.create()) {
953
954
  if (message.price !== "") {
954
- writer.uint32(10).string(message.price);
955
+ writer.uint32(10).string(Decimal.fromUserInput(message.price, 18).atomics);
955
956
  }
956
957
  return writer;
957
958
  },
@@ -963,7 +964,7 @@ export const PriceFeedPrice = {
963
964
  const tag = reader.uint32();
964
965
  switch (tag >>> 3) {
965
966
  case 1:
966
- message.price = reader.string();
967
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
967
968
  break;
968
969
  default:
969
970
  reader.skipType(tag & 7);
@@ -1150,7 +1151,7 @@ export const StorkPriceState = {
1150
1151
  writer.uint32(18).string(message.symbol);
1151
1152
  }
1152
1153
  if (message.value !== "") {
1153
- writer.uint32(26).string(message.value);
1154
+ writer.uint32(26).string(Decimal.fromUserInput(message.value, 18).atomics);
1154
1155
  }
1155
1156
  if (message.priceState !== undefined) {
1156
1157
  PriceState.encode(message.priceState, writer.uint32(42).fork()).ldelim();
@@ -1171,7 +1172,7 @@ export const StorkPriceState = {
1171
1172
  message.symbol = reader.string();
1172
1173
  break;
1173
1174
  case 3:
1174
- message.value = reader.string();
1175
+ message.value = Decimal.fromAtomics(reader.string(), 18).toString();
1175
1176
  break;
1176
1177
  case 5:
1177
1178
  message.priceState = PriceState.decode(reader, reader.uint32());
@@ -1251,10 +1252,10 @@ export const PriceState = {
1251
1252
  },
1252
1253
  encode(message, writer = BinaryWriter.create()) {
1253
1254
  if (message.price !== "") {
1254
- writer.uint32(10).string(message.price);
1255
+ writer.uint32(10).string(Decimal.fromUserInput(message.price, 18).atomics);
1255
1256
  }
1256
1257
  if (message.cumulativePrice !== "") {
1257
- writer.uint32(18).string(message.cumulativePrice);
1258
+ writer.uint32(18).string(Decimal.fromUserInput(message.cumulativePrice, 18).atomics);
1258
1259
  }
1259
1260
  if (message.timestamp !== BigInt(0)) {
1260
1261
  writer.uint32(24).int64(message.timestamp);
@@ -1269,10 +1270,10 @@ export const PriceState = {
1269
1270
  const tag = reader.uint32();
1270
1271
  switch (tag >>> 3) {
1271
1272
  case 1:
1272
- message.price = reader.string();
1273
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
1273
1274
  break;
1274
1275
  case 2:
1275
- message.cumulativePrice = reader.string();
1276
+ message.cumulativePrice = Decimal.fromAtomics(reader.string(), 18).toString();
1276
1277
  break;
1277
1278
  case 3:
1278
1279
  message.timestamp = reader.int64();
@@ -1351,13 +1352,13 @@ export const PythPriceState = {
1351
1352
  writer.uint32(10).string(message.priceId);
1352
1353
  }
1353
1354
  if (message.emaPrice !== "") {
1354
- writer.uint32(18).string(message.emaPrice);
1355
+ writer.uint32(18).string(Decimal.fromUserInput(message.emaPrice, 18).atomics);
1355
1356
  }
1356
1357
  if (message.emaConf !== "") {
1357
- writer.uint32(26).string(message.emaConf);
1358
+ writer.uint32(26).string(Decimal.fromUserInput(message.emaConf, 18).atomics);
1358
1359
  }
1359
1360
  if (message.conf !== "") {
1360
- writer.uint32(34).string(message.conf);
1361
+ writer.uint32(34).string(Decimal.fromUserInput(message.conf, 18).atomics);
1361
1362
  }
1362
1363
  if (message.publishTime !== BigInt(0)) {
1363
1364
  writer.uint32(40).uint64(message.publishTime);
@@ -1378,13 +1379,13 @@ export const PythPriceState = {
1378
1379
  message.priceId = reader.string();
1379
1380
  break;
1380
1381
  case 2:
1381
- message.emaPrice = reader.string();
1382
+ message.emaPrice = Decimal.fromAtomics(reader.string(), 18).toString();
1382
1383
  break;
1383
1384
  case 3:
1384
- message.emaConf = reader.string();
1385
+ message.emaConf = Decimal.fromAtomics(reader.string(), 18).toString();
1385
1386
  break;
1386
1387
  case 4:
1387
- message.conf = reader.string();
1388
+ message.conf = Decimal.fromAtomics(reader.string(), 18).toString();
1388
1389
  break;
1389
1390
  case 5:
1390
1391
  message.publishTime = reader.uint64();
@@ -2064,7 +2065,7 @@ export const PriceRecord = {
2064
2065
  writer.uint32(8).int64(message.timestamp);
2065
2066
  }
2066
2067
  if (message.price !== "") {
2067
- writer.uint32(18).string(message.price);
2068
+ writer.uint32(18).string(Decimal.fromUserInput(message.price, 18).atomics);
2068
2069
  }
2069
2070
  return writer;
2070
2071
  },
@@ -2079,7 +2080,7 @@ export const PriceRecord = {
2079
2080
  message.timestamp = reader.int64();
2080
2081
  break;
2081
2082
  case 2:
2082
- message.price = reader.string();
2083
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
2083
2084
  break;
2084
2085
  default:
2085
2086
  reader.skipType(tag & 7);
@@ -2156,10 +2157,10 @@ export const MetadataStatistics = {
2156
2157
  writer.uint32(16).uint32(message.recordsSampleSize);
2157
2158
  }
2158
2159
  if (message.mean !== "") {
2159
- writer.uint32(26).string(message.mean);
2160
+ writer.uint32(26).string(Decimal.fromUserInput(message.mean, 18).atomics);
2160
2161
  }
2161
2162
  if (message.twap !== "") {
2162
- writer.uint32(34).string(message.twap);
2163
+ writer.uint32(34).string(Decimal.fromUserInput(message.twap, 18).atomics);
2163
2164
  }
2164
2165
  if (message.firstTimestamp !== BigInt(0)) {
2165
2166
  writer.uint32(40).int64(message.firstTimestamp);
@@ -2168,13 +2169,13 @@ export const MetadataStatistics = {
2168
2169
  writer.uint32(48).int64(message.lastTimestamp);
2169
2170
  }
2170
2171
  if (message.minPrice !== "") {
2171
- writer.uint32(58).string(message.minPrice);
2172
+ writer.uint32(58).string(Decimal.fromUserInput(message.minPrice, 18).atomics);
2172
2173
  }
2173
2174
  if (message.maxPrice !== "") {
2174
- writer.uint32(66).string(message.maxPrice);
2175
+ writer.uint32(66).string(Decimal.fromUserInput(message.maxPrice, 18).atomics);
2175
2176
  }
2176
2177
  if (message.medianPrice !== "") {
2177
- writer.uint32(74).string(message.medianPrice);
2178
+ writer.uint32(74).string(Decimal.fromUserInput(message.medianPrice, 18).atomics);
2178
2179
  }
2179
2180
  return writer;
2180
2181
  },
@@ -2192,10 +2193,10 @@ export const MetadataStatistics = {
2192
2193
  message.recordsSampleSize = reader.uint32();
2193
2194
  break;
2194
2195
  case 3:
2195
- message.mean = reader.string();
2196
+ message.mean = Decimal.fromAtomics(reader.string(), 18).toString();
2196
2197
  break;
2197
2198
  case 4:
2198
- message.twap = reader.string();
2199
+ message.twap = Decimal.fromAtomics(reader.string(), 18).toString();
2199
2200
  break;
2200
2201
  case 5:
2201
2202
  message.firstTimestamp = reader.int64();
@@ -2204,13 +2205,13 @@ export const MetadataStatistics = {
2204
2205
  message.lastTimestamp = reader.int64();
2205
2206
  break;
2206
2207
  case 7:
2207
- message.minPrice = reader.string();
2208
+ message.minPrice = Decimal.fromAtomics(reader.string(), 18).toString();
2208
2209
  break;
2209
2210
  case 8:
2210
- message.maxPrice = reader.string();
2211
+ message.maxPrice = Decimal.fromAtomics(reader.string(), 18).toString();
2211
2212
  break;
2212
2213
  case 9:
2213
- message.medianPrice = reader.string();
2214
+ message.medianPrice = Decimal.fromAtomics(reader.string(), 18).toString();
2214
2215
  break;
2215
2216
  default:
2216
2217
  reader.skipType(tag & 7);
@@ -2558,7 +2559,7 @@ export const SignedPriceOfAssetPair = {
2558
2559
  writer.uint32(16).uint64(message.timestamp);
2559
2560
  }
2560
2561
  if (message.price !== "") {
2561
- writer.uint32(26).string(message.price);
2562
+ writer.uint32(26).string(Decimal.fromUserInput(message.price, 18).atomics);
2562
2563
  }
2563
2564
  if (message.signature.length !== 0) {
2564
2565
  writer.uint32(34).bytes(message.signature);
@@ -2579,7 +2580,7 @@ export const SignedPriceOfAssetPair = {
2579
2580
  message.timestamp = reader.uint64();
2580
2581
  break;
2581
2582
  case 3:
2582
- message.price = reader.string();
2583
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
2583
2584
  break;
2584
2585
  case 4:
2585
2586
  message.signature = reader.bytes();
@@ -2,6 +2,7 @@ import { OracleInfo, PythPriceState, Params, BandPriceState, PriceFeedState, Coi
2
2
  import { GenesisState } from "./genesis";
3
3
  import { BinaryReader, BinaryWriter } from "../../../binary";
4
4
  import { isSet } from "../../../helpers";
5
+ import { Decimal } from "../../../decimals";
5
6
  function createBaseQueryPythPriceRequest() {
6
7
  return {
7
8
  priceId: ""
@@ -1973,7 +1974,7 @@ export const QueryOracleVolatilityResponse = {
1973
1974
  },
1974
1975
  encode(message, writer = BinaryWriter.create()) {
1975
1976
  if (message.volatility !== "") {
1976
- writer.uint32(10).string(message.volatility);
1977
+ writer.uint32(10).string(Decimal.fromUserInput(message.volatility, 18).atomics);
1977
1978
  }
1978
1979
  if (message.historyMetadata !== undefined) {
1979
1980
  MetadataStatistics.encode(message.historyMetadata, writer.uint32(18).fork()).ldelim();
@@ -1991,7 +1992,7 @@ export const QueryOracleVolatilityResponse = {
1991
1992
  const tag = reader.uint32();
1992
1993
  switch (tag >>> 3) {
1993
1994
  case 1:
1994
- message.volatility = reader.string();
1995
+ message.volatility = Decimal.fromAtomics(reader.string(), 18).toString();
1995
1996
  break;
1996
1997
  case 2:
1997
1998
  message.historyMetadata = MetadataStatistics.decode(reader, reader.uint32());
@@ -2544,19 +2545,19 @@ export const PricePairState = {
2544
2545
  },
2545
2546
  encode(message, writer = BinaryWriter.create()) {
2546
2547
  if (message.pairPrice !== "") {
2547
- writer.uint32(10).string(message.pairPrice);
2548
+ writer.uint32(10).string(Decimal.fromUserInput(message.pairPrice, 18).atomics);
2548
2549
  }
2549
2550
  if (message.basePrice !== "") {
2550
- writer.uint32(18).string(message.basePrice);
2551
+ writer.uint32(18).string(Decimal.fromUserInput(message.basePrice, 18).atomics);
2551
2552
  }
2552
2553
  if (message.quotePrice !== "") {
2553
- writer.uint32(26).string(message.quotePrice);
2554
+ writer.uint32(26).string(Decimal.fromUserInput(message.quotePrice, 18).atomics);
2554
2555
  }
2555
2556
  if (message.baseCumulativePrice !== "") {
2556
- writer.uint32(34).string(message.baseCumulativePrice);
2557
+ writer.uint32(34).string(Decimal.fromUserInput(message.baseCumulativePrice, 18).atomics);
2557
2558
  }
2558
2559
  if (message.quoteCumulativePrice !== "") {
2559
- writer.uint32(42).string(message.quoteCumulativePrice);
2560
+ writer.uint32(42).string(Decimal.fromUserInput(message.quoteCumulativePrice, 18).atomics);
2560
2561
  }
2561
2562
  if (message.baseTimestamp !== BigInt(0)) {
2562
2563
  writer.uint32(48).int64(message.baseTimestamp);
@@ -2574,19 +2575,19 @@ export const PricePairState = {
2574
2575
  const tag = reader.uint32();
2575
2576
  switch (tag >>> 3) {
2576
2577
  case 1:
2577
- message.pairPrice = reader.string();
2578
+ message.pairPrice = Decimal.fromAtomics(reader.string(), 18).toString();
2578
2579
  break;
2579
2580
  case 2:
2580
- message.basePrice = reader.string();
2581
+ message.basePrice = Decimal.fromAtomics(reader.string(), 18).toString();
2581
2582
  break;
2582
2583
  case 3:
2583
- message.quotePrice = reader.string();
2584
+ message.quotePrice = Decimal.fromAtomics(reader.string(), 18).toString();
2584
2585
  break;
2585
2586
  case 4:
2586
- message.baseCumulativePrice = reader.string();
2587
+ message.baseCumulativePrice = Decimal.fromAtomics(reader.string(), 18).toString();
2587
2588
  break;
2588
2589
  case 5:
2589
- message.quoteCumulativePrice = reader.string();
2590
+ message.quoteCumulativePrice = Decimal.fromAtomics(reader.string(), 18).toString();
2590
2591
  break;
2591
2592
  case 6:
2592
2593
  message.baseTimestamp = reader.int64();
@@ -1,5 +1,6 @@
1
1
  import { AssetPair, PriceAttestation, Params } from "./oracle";
2
2
  import { BinaryReader, BinaryWriter } from "../../../binary";
3
+ import { Decimal } from "../../../decimals";
3
4
  import { bytesFromBase64, base64FromBytes } from "../../../helpers";
4
5
  function createBaseMsgRelayProviderPrices() {
5
6
  return {
@@ -29,7 +30,7 @@ export const MsgRelayProviderPrices = {
29
30
  writer.uint32(26).string(v);
30
31
  }
31
32
  for (const v of message.prices) {
32
- writer.uint32(34).string(v);
33
+ writer.uint32(34).string(Decimal.fromUserInput(v, 18).atomics);
33
34
  }
34
35
  return writer;
35
36
  },
@@ -50,7 +51,7 @@ export const MsgRelayProviderPrices = {
50
51
  message.symbols.push(reader.string());
51
52
  break;
52
53
  case 4:
53
- message.prices.push(reader.string());
54
+ message.prices.push(Decimal.fromAtomics(reader.string(), 18).toString());
54
55
  break;
55
56
  default:
56
57
  reader.skipType(tag & 7);
@@ -205,7 +206,7 @@ export const MsgRelayPriceFeedPrice = {
205
206
  writer.uint32(26).string(v);
206
207
  }
207
208
  for (const v of message.price) {
208
- writer.uint32(34).string(v);
209
+ writer.uint32(34).string(Decimal.fromUserInput(v, 18).atomics);
209
210
  }
210
211
  return writer;
211
212
  },
@@ -226,7 +227,7 @@ export const MsgRelayPriceFeedPrice = {
226
227
  message.quote.push(reader.string());
227
228
  break;
228
229
  case 4:
229
- message.price.push(reader.string());
230
+ message.price.push(Decimal.fromAtomics(reader.string(), 18).toString());
230
231
  break;
231
232
  default:
232
233
  reader.skipType(tag & 7);
@@ -2,6 +2,7 @@ import { Level, Deposit, SpotLimitOrder, DerivativeLimitOrder, PositionDelta } f
2
2
  import { Coin } from "../../../cosmos/base/v1beta1/coin";
3
3
  import { BinaryReader, BinaryWriter } from "../../../binary";
4
4
  import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers";
5
+ import { Decimal } from "../../../decimals";
5
6
  export var OrderUpdateStatus;
6
7
  (function (OrderUpdateStatus) {
7
8
  OrderUpdateStatus[OrderUpdateStatus["Unspecified"] = 0] = "Unspecified";
@@ -1344,16 +1345,16 @@ export const Position = {
1344
1345
  writer.uint32(24).bool(message.isLong);
1345
1346
  }
1346
1347
  if (message.quantity !== "") {
1347
- writer.uint32(34).string(message.quantity);
1348
+ writer.uint32(34).string(Decimal.fromUserInput(message.quantity, 18).atomics);
1348
1349
  }
1349
1350
  if (message.entryPrice !== "") {
1350
- writer.uint32(42).string(message.entryPrice);
1351
+ writer.uint32(42).string(Decimal.fromUserInput(message.entryPrice, 18).atomics);
1351
1352
  }
1352
1353
  if (message.margin !== "") {
1353
- writer.uint32(50).string(message.margin);
1354
+ writer.uint32(50).string(Decimal.fromUserInput(message.margin, 18).atomics);
1354
1355
  }
1355
1356
  if (message.cumulativeFundingEntry !== "") {
1356
- writer.uint32(58).string(message.cumulativeFundingEntry);
1357
+ writer.uint32(58).string(Decimal.fromUserInput(message.cumulativeFundingEntry, 18).atomics);
1357
1358
  }
1358
1359
  return writer;
1359
1360
  },
@@ -1374,16 +1375,16 @@ export const Position = {
1374
1375
  message.isLong = reader.bool();
1375
1376
  break;
1376
1377
  case 4:
1377
- message.quantity = reader.string();
1378
+ message.quantity = Decimal.fromAtomics(reader.string(), 18).toString();
1378
1379
  break;
1379
1380
  case 5:
1380
- message.entryPrice = reader.string();
1381
+ message.entryPrice = Decimal.fromAtomics(reader.string(), 18).toString();
1381
1382
  break;
1382
1383
  case 6:
1383
- message.margin = reader.string();
1384
+ message.margin = Decimal.fromAtomics(reader.string(), 18).toString();
1384
1385
  break;
1385
1386
  case 7:
1386
- message.cumulativeFundingEntry = reader.string();
1387
+ message.cumulativeFundingEntry = Decimal.fromAtomics(reader.string(), 18).toString();
1387
1388
  break;
1388
1389
  default:
1389
1390
  reader.skipType(tag & 7);
@@ -1476,7 +1477,7 @@ export const OraclePrice = {
1476
1477
  writer.uint32(10).string(message.symbol);
1477
1478
  }
1478
1479
  if (message.price !== "") {
1479
- writer.uint32(18).string(message.price);
1480
+ writer.uint32(18).string(Decimal.fromUserInput(message.price, 18).atomics);
1480
1481
  }
1481
1482
  if (message.type !== "") {
1482
1483
  writer.uint32(26).string(message.type);
@@ -1494,7 +1495,7 @@ export const OraclePrice = {
1494
1495
  message.symbol = reader.string();
1495
1496
  break;
1496
1497
  case 2:
1497
- message.price = reader.string();
1498
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
1498
1499
  break;
1499
1500
  case 3:
1500
1501
  message.type = reader.string();
@@ -1584,16 +1585,16 @@ export const SpotTrade = {
1584
1585
  writer.uint32(26).string(message.executionType);
1585
1586
  }
1586
1587
  if (message.quantity !== "") {
1587
- writer.uint32(34).string(message.quantity);
1588
+ writer.uint32(34).string(Decimal.fromUserInput(message.quantity, 18).atomics);
1588
1589
  }
1589
1590
  if (message.price !== "") {
1590
- writer.uint32(42).string(message.price);
1591
+ writer.uint32(42).string(Decimal.fromUserInput(message.price, 18).atomics);
1591
1592
  }
1592
1593
  if (message.subaccountId !== "") {
1593
1594
  writer.uint32(50).string(message.subaccountId);
1594
1595
  }
1595
1596
  if (message.fee !== "") {
1596
- writer.uint32(58).string(message.fee);
1597
+ writer.uint32(58).string(Decimal.fromUserInput(message.fee, 18).atomics);
1597
1598
  }
1598
1599
  if (message.orderHash.length !== 0) {
1599
1600
  writer.uint32(66).bytes(message.orderHash);
@@ -1626,16 +1627,16 @@ export const SpotTrade = {
1626
1627
  message.executionType = reader.string();
1627
1628
  break;
1628
1629
  case 4:
1629
- message.quantity = reader.string();
1630
+ message.quantity = Decimal.fromAtomics(reader.string(), 18).toString();
1630
1631
  break;
1631
1632
  case 5:
1632
- message.price = reader.string();
1633
+ message.price = Decimal.fromAtomics(reader.string(), 18).toString();
1633
1634
  break;
1634
1635
  case 6:
1635
1636
  message.subaccountId = reader.string();
1636
1637
  break;
1637
1638
  case 7:
1638
- message.fee = reader.string();
1639
+ message.fee = Decimal.fromAtomics(reader.string(), 18).toString();
1639
1640
  break;
1640
1641
  case 8:
1641
1642
  message.orderHash = reader.bytes();
@@ -1780,10 +1781,10 @@ export const DerivativeTrade = {
1780
1781
  PositionDelta.encode(message.positionDelta, writer.uint32(42).fork()).ldelim();
1781
1782
  }
1782
1783
  if (message.payout !== "") {
1783
- writer.uint32(50).string(message.payout);
1784
+ writer.uint32(50).string(Decimal.fromUserInput(message.payout, 18).atomics);
1784
1785
  }
1785
1786
  if (message.fee !== "") {
1786
- writer.uint32(58).string(message.fee);
1787
+ writer.uint32(58).string(Decimal.fromUserInput(message.fee, 18).atomics);
1787
1788
  }
1788
1789
  if (message.orderHash !== "") {
1789
1790
  writer.uint32(66).string(message.orderHash);
@@ -1822,10 +1823,10 @@ export const DerivativeTrade = {
1822
1823
  message.positionDelta = PositionDelta.decode(reader, reader.uint32());
1823
1824
  break;
1824
1825
  case 6:
1825
- message.payout = reader.string();
1826
+ message.payout = Decimal.fromAtomics(reader.string(), 18).toString();
1826
1827
  break;
1827
1828
  case 7:
1828
- message.fee = reader.string();
1829
+ message.fee = Decimal.fromAtomics(reader.string(), 18).toString();
1829
1830
  break;
1830
1831
  case 8:
1831
1832
  message.orderHash = reader.string();
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventAuctionStart = exports.EventAuctionResult = exports.EventBid = exports.LastAuctionResult = exports.Bid = exports.Params = void 0;
4
4
  const coin_1 = require("../../../cosmos/base/v1beta1/coin");
5
5
  const binary_1 = require("../../../binary");
6
+ const decimals_1 = require("../../../decimals");
6
7
  function createBaseParams() {
7
8
  return {
8
9
  auctionPeriod: BigInt(0),
@@ -23,7 +24,7 @@ exports.Params = {
23
24
  writer.uint32(8).int64(message.auctionPeriod);
24
25
  }
25
26
  if (message.minNextBidIncrementRate !== "") {
26
- writer.uint32(18).string(message.minNextBidIncrementRate);
27
+ writer.uint32(18).string(decimals_1.Decimal.fromUserInput(message.minNextBidIncrementRate, 18).atomics);
27
28
  }
28
29
  return writer;
29
30
  },
@@ -38,7 +39,7 @@ exports.Params = {
38
39
  message.auctionPeriod = reader.int64();
39
40
  break;
40
41
  case 2:
41
- message.minNextBidIncrementRate = reader.string();
42
+ message.minNextBidIncrementRate = decimals_1.Decimal.fromAtomics(reader.string(), 18).toString();
42
43
  break;
43
44
  default:
44
45
  reader.skipType(tag & 7);