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.
- package/cosmos/base/v1beta1/coin.js +5 -4
- package/cosmos/distribution/v1beta1/distribution.js +11 -10
- package/cosmos/gov/v1beta1/gov.js +3 -2
- package/cosmos/staking/v1beta1/staking.js +15 -14
- package/cosmos/staking/v1beta1/tx.js +3 -2
- package/decimals.d.ts +20 -0
- package/decimals.js +102 -0
- package/esm/cosmos/base/v1beta1/coin.js +5 -4
- package/esm/cosmos/distribution/v1beta1/distribution.js +11 -10
- package/esm/cosmos/gov/v1beta1/gov.js +3 -2
- package/esm/cosmos/staking/v1beta1/staking.js +15 -14
- package/esm/cosmos/staking/v1beta1/tx.js +3 -2
- package/esm/decimals.js +98 -0
- package/esm/injective/auction/v1beta1/auction.js +3 -2
- package/esm/injective/exchange/v1beta1/events.js +13 -12
- package/esm/injective/exchange/v1beta1/exchange.js +183 -182
- package/esm/injective/exchange/v1beta1/genesis.js +5 -4
- package/esm/injective/exchange/v1beta1/proposal.js +99 -98
- package/esm/injective/exchange/v1beta1/query.js +89 -88
- package/esm/injective/exchange/v1beta1/tx.js +81 -80
- package/esm/injective/ocr/v1beta1/ocr.js +17 -16
- package/esm/injective/oracle/v1beta1/events.js +13 -12
- package/esm/injective/oracle/v1beta1/oracle.js +31 -30
- package/esm/injective/oracle/v1beta1/query.js +13 -12
- package/esm/injective/oracle/v1beta1/tx.js +5 -4
- package/esm/injective/stream/v1beta1/query.js +21 -20
- package/injective/auction/v1beta1/auction.js +3 -2
- package/injective/exchange/v1beta1/events.js +13 -12
- package/injective/exchange/v1beta1/exchange.js +183 -182
- package/injective/exchange/v1beta1/genesis.js +5 -4
- package/injective/exchange/v1beta1/proposal.js +99 -98
- package/injective/exchange/v1beta1/query.js +89 -88
- package/injective/exchange/v1beta1/tx.js +81 -80
- package/injective/ocr/v1beta1/ocr.js +17 -16
- package/injective/oracle/v1beta1/events.js +13 -12
- package/injective/oracle/v1beta1/oracle.js +31 -30
- package/injective/oracle/v1beta1/query.js +13 -12
- package/injective/oracle/v1beta1/tx.js +5 -4
- package/injective/stream/v1beta1/query.js +21 -20
- package/package.json +8 -8
|
@@ -2,6 +2,7 @@ import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
|
|
2
2
|
import { SpotOrder, DerivativeOrder, GrantAuthorization, PositionDelta } from "./exchange";
|
|
3
3
|
import { Params } from "../../../cosmos/distribution/v1beta1/distribution";
|
|
4
4
|
import { BinaryReader, BinaryWriter } from "../../../binary";
|
|
5
|
+
import { Decimal } from "../../../decimals";
|
|
5
6
|
import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers";
|
|
6
7
|
function createBaseMsgUpdateSpotMarket() {
|
|
7
8
|
return {
|
|
@@ -33,13 +34,13 @@ export const MsgUpdateSpotMarket = {
|
|
|
33
34
|
writer.uint32(26).string(message.newTicker);
|
|
34
35
|
}
|
|
35
36
|
if (message.newMinPriceTickSize !== "") {
|
|
36
|
-
writer.uint32(34).string(message.newMinPriceTickSize);
|
|
37
|
+
writer.uint32(34).string(Decimal.fromUserInput(message.newMinPriceTickSize, 18).atomics);
|
|
37
38
|
}
|
|
38
39
|
if (message.newMinQuantityTickSize !== "") {
|
|
39
|
-
writer.uint32(42).string(message.newMinQuantityTickSize);
|
|
40
|
+
writer.uint32(42).string(Decimal.fromUserInput(message.newMinQuantityTickSize, 18).atomics);
|
|
40
41
|
}
|
|
41
42
|
if (message.newMinNotional !== "") {
|
|
42
|
-
writer.uint32(50).string(message.newMinNotional);
|
|
43
|
+
writer.uint32(50).string(Decimal.fromUserInput(message.newMinNotional, 18).atomics);
|
|
43
44
|
}
|
|
44
45
|
return writer;
|
|
45
46
|
},
|
|
@@ -60,13 +61,13 @@ export const MsgUpdateSpotMarket = {
|
|
|
60
61
|
message.newTicker = reader.string();
|
|
61
62
|
break;
|
|
62
63
|
case 4:
|
|
63
|
-
message.newMinPriceTickSize = reader.string();
|
|
64
|
+
message.newMinPriceTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
64
65
|
break;
|
|
65
66
|
case 5:
|
|
66
|
-
message.newMinQuantityTickSize = reader.string();
|
|
67
|
+
message.newMinQuantityTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
67
68
|
break;
|
|
68
69
|
case 6:
|
|
69
|
-
message.newMinNotional = reader.string();
|
|
70
|
+
message.newMinNotional = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
70
71
|
break;
|
|
71
72
|
default:
|
|
72
73
|
reader.skipType(tag & 7);
|
|
@@ -229,19 +230,19 @@ export const MsgUpdateDerivativeMarket = {
|
|
|
229
230
|
writer.uint32(26).string(message.newTicker);
|
|
230
231
|
}
|
|
231
232
|
if (message.newMinPriceTickSize !== "") {
|
|
232
|
-
writer.uint32(34).string(message.newMinPriceTickSize);
|
|
233
|
+
writer.uint32(34).string(Decimal.fromUserInput(message.newMinPriceTickSize, 18).atomics);
|
|
233
234
|
}
|
|
234
235
|
if (message.newMinQuantityTickSize !== "") {
|
|
235
|
-
writer.uint32(42).string(message.newMinQuantityTickSize);
|
|
236
|
+
writer.uint32(42).string(Decimal.fromUserInput(message.newMinQuantityTickSize, 18).atomics);
|
|
236
237
|
}
|
|
237
238
|
if (message.newMinNotional !== "") {
|
|
238
|
-
writer.uint32(50).string(message.newMinNotional);
|
|
239
|
+
writer.uint32(50).string(Decimal.fromUserInput(message.newMinNotional, 18).atomics);
|
|
239
240
|
}
|
|
240
241
|
if (message.newInitialMarginRatio !== "") {
|
|
241
|
-
writer.uint32(58).string(message.newInitialMarginRatio);
|
|
242
|
+
writer.uint32(58).string(Decimal.fromUserInput(message.newInitialMarginRatio, 18).atomics);
|
|
242
243
|
}
|
|
243
244
|
if (message.newMaintenanceMarginRatio !== "") {
|
|
244
|
-
writer.uint32(66).string(message.newMaintenanceMarginRatio);
|
|
245
|
+
writer.uint32(66).string(Decimal.fromUserInput(message.newMaintenanceMarginRatio, 18).atomics);
|
|
245
246
|
}
|
|
246
247
|
return writer;
|
|
247
248
|
},
|
|
@@ -262,19 +263,19 @@ export const MsgUpdateDerivativeMarket = {
|
|
|
262
263
|
message.newTicker = reader.string();
|
|
263
264
|
break;
|
|
264
265
|
case 4:
|
|
265
|
-
message.newMinPriceTickSize = reader.string();
|
|
266
|
+
message.newMinPriceTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
266
267
|
break;
|
|
267
268
|
case 5:
|
|
268
|
-
message.newMinQuantityTickSize = reader.string();
|
|
269
|
+
message.newMinQuantityTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
269
270
|
break;
|
|
270
271
|
case 6:
|
|
271
|
-
message.newMinNotional = reader.string();
|
|
272
|
+
message.newMinNotional = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
272
273
|
break;
|
|
273
274
|
case 7:
|
|
274
|
-
message.newInitialMarginRatio = reader.string();
|
|
275
|
+
message.newInitialMarginRatio = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
275
276
|
break;
|
|
276
277
|
case 8:
|
|
277
|
-
message.newMaintenanceMarginRatio = reader.string();
|
|
278
|
+
message.newMaintenanceMarginRatio = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
278
279
|
break;
|
|
279
280
|
default:
|
|
280
281
|
reader.skipType(tag & 7);
|
|
@@ -1287,13 +1288,13 @@ export const MsgInstantSpotMarketLaunch = {
|
|
|
1287
1288
|
writer.uint32(34).string(message.quoteDenom);
|
|
1288
1289
|
}
|
|
1289
1290
|
if (message.minPriceTickSize !== "") {
|
|
1290
|
-
writer.uint32(42).string(message.minPriceTickSize);
|
|
1291
|
+
writer.uint32(42).string(Decimal.fromUserInput(message.minPriceTickSize, 18).atomics);
|
|
1291
1292
|
}
|
|
1292
1293
|
if (message.minQuantityTickSize !== "") {
|
|
1293
|
-
writer.uint32(50).string(message.minQuantityTickSize);
|
|
1294
|
+
writer.uint32(50).string(Decimal.fromUserInput(message.minQuantityTickSize, 18).atomics);
|
|
1294
1295
|
}
|
|
1295
1296
|
if (message.minNotional !== "") {
|
|
1296
|
-
writer.uint32(58).string(message.minNotional);
|
|
1297
|
+
writer.uint32(58).string(Decimal.fromUserInput(message.minNotional, 18).atomics);
|
|
1297
1298
|
}
|
|
1298
1299
|
return writer;
|
|
1299
1300
|
},
|
|
@@ -1317,13 +1318,13 @@ export const MsgInstantSpotMarketLaunch = {
|
|
|
1317
1318
|
message.quoteDenom = reader.string();
|
|
1318
1319
|
break;
|
|
1319
1320
|
case 5:
|
|
1320
|
-
message.minPriceTickSize = reader.string();
|
|
1321
|
+
message.minPriceTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1321
1322
|
break;
|
|
1322
1323
|
case 6:
|
|
1323
|
-
message.minQuantityTickSize = reader.string();
|
|
1324
|
+
message.minQuantityTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1324
1325
|
break;
|
|
1325
1326
|
case 7:
|
|
1326
|
-
message.minNotional = reader.string();
|
|
1327
|
+
message.minNotional = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1327
1328
|
break;
|
|
1328
1329
|
default:
|
|
1329
1330
|
reader.skipType(tag & 7);
|
|
@@ -1509,25 +1510,25 @@ export const MsgInstantPerpetualMarketLaunch = {
|
|
|
1509
1510
|
writer.uint32(56).int32(message.oracleType);
|
|
1510
1511
|
}
|
|
1511
1512
|
if (message.makerFeeRate !== "") {
|
|
1512
|
-
writer.uint32(66).string(message.makerFeeRate);
|
|
1513
|
+
writer.uint32(66).string(Decimal.fromUserInput(message.makerFeeRate, 18).atomics);
|
|
1513
1514
|
}
|
|
1514
1515
|
if (message.takerFeeRate !== "") {
|
|
1515
|
-
writer.uint32(74).string(message.takerFeeRate);
|
|
1516
|
+
writer.uint32(74).string(Decimal.fromUserInput(message.takerFeeRate, 18).atomics);
|
|
1516
1517
|
}
|
|
1517
1518
|
if (message.initialMarginRatio !== "") {
|
|
1518
|
-
writer.uint32(82).string(message.initialMarginRatio);
|
|
1519
|
+
writer.uint32(82).string(Decimal.fromUserInput(message.initialMarginRatio, 18).atomics);
|
|
1519
1520
|
}
|
|
1520
1521
|
if (message.maintenanceMarginRatio !== "") {
|
|
1521
|
-
writer.uint32(90).string(message.maintenanceMarginRatio);
|
|
1522
|
+
writer.uint32(90).string(Decimal.fromUserInput(message.maintenanceMarginRatio, 18).atomics);
|
|
1522
1523
|
}
|
|
1523
1524
|
if (message.minPriceTickSize !== "") {
|
|
1524
|
-
writer.uint32(98).string(message.minPriceTickSize);
|
|
1525
|
+
writer.uint32(98).string(Decimal.fromUserInput(message.minPriceTickSize, 18).atomics);
|
|
1525
1526
|
}
|
|
1526
1527
|
if (message.minQuantityTickSize !== "") {
|
|
1527
|
-
writer.uint32(106).string(message.minQuantityTickSize);
|
|
1528
|
+
writer.uint32(106).string(Decimal.fromUserInput(message.minQuantityTickSize, 18).atomics);
|
|
1528
1529
|
}
|
|
1529
1530
|
if (message.minNotional !== "") {
|
|
1530
|
-
writer.uint32(114).string(message.minNotional);
|
|
1531
|
+
writer.uint32(114).string(Decimal.fromUserInput(message.minNotional, 18).atomics);
|
|
1531
1532
|
}
|
|
1532
1533
|
return writer;
|
|
1533
1534
|
},
|
|
@@ -1560,25 +1561,25 @@ export const MsgInstantPerpetualMarketLaunch = {
|
|
|
1560
1561
|
message.oracleType = reader.int32();
|
|
1561
1562
|
break;
|
|
1562
1563
|
case 8:
|
|
1563
|
-
message.makerFeeRate = reader.string();
|
|
1564
|
+
message.makerFeeRate = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1564
1565
|
break;
|
|
1565
1566
|
case 9:
|
|
1566
|
-
message.takerFeeRate = reader.string();
|
|
1567
|
+
message.takerFeeRate = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1567
1568
|
break;
|
|
1568
1569
|
case 10:
|
|
1569
|
-
message.initialMarginRatio = reader.string();
|
|
1570
|
+
message.initialMarginRatio = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1570
1571
|
break;
|
|
1571
1572
|
case 11:
|
|
1572
|
-
message.maintenanceMarginRatio = reader.string();
|
|
1573
|
+
message.maintenanceMarginRatio = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1573
1574
|
break;
|
|
1574
1575
|
case 12:
|
|
1575
|
-
message.minPriceTickSize = reader.string();
|
|
1576
|
+
message.minPriceTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1576
1577
|
break;
|
|
1577
1578
|
case 13:
|
|
1578
|
-
message.minQuantityTickSize = reader.string();
|
|
1579
|
+
message.minQuantityTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1579
1580
|
break;
|
|
1580
1581
|
case 14:
|
|
1581
|
-
message.minNotional = reader.string();
|
|
1582
|
+
message.minNotional = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1582
1583
|
break;
|
|
1583
1584
|
default:
|
|
1584
1585
|
reader.skipType(tag & 7);
|
|
@@ -1797,10 +1798,10 @@ export const MsgInstantBinaryOptionsMarketLaunch = {
|
|
|
1797
1798
|
writer.uint32(48).uint32(message.oracleScaleFactor);
|
|
1798
1799
|
}
|
|
1799
1800
|
if (message.makerFeeRate !== "") {
|
|
1800
|
-
writer.uint32(58).string(message.makerFeeRate);
|
|
1801
|
+
writer.uint32(58).string(Decimal.fromUserInput(message.makerFeeRate, 18).atomics);
|
|
1801
1802
|
}
|
|
1802
1803
|
if (message.takerFeeRate !== "") {
|
|
1803
|
-
writer.uint32(66).string(message.takerFeeRate);
|
|
1804
|
+
writer.uint32(66).string(Decimal.fromUserInput(message.takerFeeRate, 18).atomics);
|
|
1804
1805
|
}
|
|
1805
1806
|
if (message.expirationTimestamp !== BigInt(0)) {
|
|
1806
1807
|
writer.uint32(72).int64(message.expirationTimestamp);
|
|
@@ -1815,13 +1816,13 @@ export const MsgInstantBinaryOptionsMarketLaunch = {
|
|
|
1815
1816
|
writer.uint32(98).string(message.quoteDenom);
|
|
1816
1817
|
}
|
|
1817
1818
|
if (message.minPriceTickSize !== "") {
|
|
1818
|
-
writer.uint32(106).string(message.minPriceTickSize);
|
|
1819
|
+
writer.uint32(106).string(Decimal.fromUserInput(message.minPriceTickSize, 18).atomics);
|
|
1819
1820
|
}
|
|
1820
1821
|
if (message.minQuantityTickSize !== "") {
|
|
1821
|
-
writer.uint32(114).string(message.minQuantityTickSize);
|
|
1822
|
+
writer.uint32(114).string(Decimal.fromUserInput(message.minQuantityTickSize, 18).atomics);
|
|
1822
1823
|
}
|
|
1823
1824
|
if (message.minNotional !== "") {
|
|
1824
|
-
writer.uint32(122).string(message.minNotional);
|
|
1825
|
+
writer.uint32(122).string(Decimal.fromUserInput(message.minNotional, 18).atomics);
|
|
1825
1826
|
}
|
|
1826
1827
|
return writer;
|
|
1827
1828
|
},
|
|
@@ -1851,10 +1852,10 @@ export const MsgInstantBinaryOptionsMarketLaunch = {
|
|
|
1851
1852
|
message.oracleScaleFactor = reader.uint32();
|
|
1852
1853
|
break;
|
|
1853
1854
|
case 7:
|
|
1854
|
-
message.makerFeeRate = reader.string();
|
|
1855
|
+
message.makerFeeRate = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1855
1856
|
break;
|
|
1856
1857
|
case 8:
|
|
1857
|
-
message.takerFeeRate = reader.string();
|
|
1858
|
+
message.takerFeeRate = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1858
1859
|
break;
|
|
1859
1860
|
case 9:
|
|
1860
1861
|
message.expirationTimestamp = reader.int64();
|
|
@@ -1869,13 +1870,13 @@ export const MsgInstantBinaryOptionsMarketLaunch = {
|
|
|
1869
1870
|
message.quoteDenom = reader.string();
|
|
1870
1871
|
break;
|
|
1871
1872
|
case 13:
|
|
1872
|
-
message.minPriceTickSize = reader.string();
|
|
1873
|
+
message.minPriceTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1873
1874
|
break;
|
|
1874
1875
|
case 14:
|
|
1875
|
-
message.minQuantityTickSize = reader.string();
|
|
1876
|
+
message.minQuantityTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1876
1877
|
break;
|
|
1877
1878
|
case 15:
|
|
1878
|
-
message.minNotional = reader.string();
|
|
1879
|
+
message.minNotional = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1879
1880
|
break;
|
|
1880
1881
|
default:
|
|
1881
1882
|
reader.skipType(tag & 7);
|
|
@@ -2105,25 +2106,25 @@ export const MsgInstantExpiryFuturesMarketLaunch = {
|
|
|
2105
2106
|
writer.uint32(64).int64(message.expiry);
|
|
2106
2107
|
}
|
|
2107
2108
|
if (message.makerFeeRate !== "") {
|
|
2108
|
-
writer.uint32(74).string(message.makerFeeRate);
|
|
2109
|
+
writer.uint32(74).string(Decimal.fromUserInput(message.makerFeeRate, 18).atomics);
|
|
2109
2110
|
}
|
|
2110
2111
|
if (message.takerFeeRate !== "") {
|
|
2111
|
-
writer.uint32(82).string(message.takerFeeRate);
|
|
2112
|
+
writer.uint32(82).string(Decimal.fromUserInput(message.takerFeeRate, 18).atomics);
|
|
2112
2113
|
}
|
|
2113
2114
|
if (message.initialMarginRatio !== "") {
|
|
2114
|
-
writer.uint32(90).string(message.initialMarginRatio);
|
|
2115
|
+
writer.uint32(90).string(Decimal.fromUserInput(message.initialMarginRatio, 18).atomics);
|
|
2115
2116
|
}
|
|
2116
2117
|
if (message.maintenanceMarginRatio !== "") {
|
|
2117
|
-
writer.uint32(98).string(message.maintenanceMarginRatio);
|
|
2118
|
+
writer.uint32(98).string(Decimal.fromUserInput(message.maintenanceMarginRatio, 18).atomics);
|
|
2118
2119
|
}
|
|
2119
2120
|
if (message.minPriceTickSize !== "") {
|
|
2120
|
-
writer.uint32(106).string(message.minPriceTickSize);
|
|
2121
|
+
writer.uint32(106).string(Decimal.fromUserInput(message.minPriceTickSize, 18).atomics);
|
|
2121
2122
|
}
|
|
2122
2123
|
if (message.minQuantityTickSize !== "") {
|
|
2123
|
-
writer.uint32(114).string(message.minQuantityTickSize);
|
|
2124
|
+
writer.uint32(114).string(Decimal.fromUserInput(message.minQuantityTickSize, 18).atomics);
|
|
2124
2125
|
}
|
|
2125
2126
|
if (message.minNotional !== "") {
|
|
2126
|
-
writer.uint32(122).string(message.minNotional);
|
|
2127
|
+
writer.uint32(122).string(Decimal.fromUserInput(message.minNotional, 18).atomics);
|
|
2127
2128
|
}
|
|
2128
2129
|
return writer;
|
|
2129
2130
|
},
|
|
@@ -2159,25 +2160,25 @@ export const MsgInstantExpiryFuturesMarketLaunch = {
|
|
|
2159
2160
|
message.expiry = reader.int64();
|
|
2160
2161
|
break;
|
|
2161
2162
|
case 9:
|
|
2162
|
-
message.makerFeeRate = reader.string();
|
|
2163
|
+
message.makerFeeRate = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2163
2164
|
break;
|
|
2164
2165
|
case 10:
|
|
2165
|
-
message.takerFeeRate = reader.string();
|
|
2166
|
+
message.takerFeeRate = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2166
2167
|
break;
|
|
2167
2168
|
case 11:
|
|
2168
|
-
message.initialMarginRatio = reader.string();
|
|
2169
|
+
message.initialMarginRatio = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2169
2170
|
break;
|
|
2170
2171
|
case 12:
|
|
2171
|
-
message.maintenanceMarginRatio = reader.string();
|
|
2172
|
+
message.maintenanceMarginRatio = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2172
2173
|
break;
|
|
2173
2174
|
case 13:
|
|
2174
|
-
message.minPriceTickSize = reader.string();
|
|
2175
|
+
message.minPriceTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2175
2176
|
break;
|
|
2176
2177
|
case 14:
|
|
2177
|
-
message.minQuantityTickSize = reader.string();
|
|
2178
|
+
message.minQuantityTickSize = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2178
2179
|
break;
|
|
2179
2180
|
case 15:
|
|
2180
|
-
message.minNotional = reader.string();
|
|
2181
|
+
message.minNotional = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2181
2182
|
break;
|
|
2182
2183
|
default:
|
|
2183
2184
|
reader.skipType(tag & 7);
|
|
@@ -2557,13 +2558,13 @@ export const SpotMarketOrderResults = {
|
|
|
2557
2558
|
},
|
|
2558
2559
|
encode(message, writer = BinaryWriter.create()) {
|
|
2559
2560
|
if (message.quantity !== "") {
|
|
2560
|
-
writer.uint32(10).string(message.quantity);
|
|
2561
|
+
writer.uint32(10).string(Decimal.fromUserInput(message.quantity, 18).atomics);
|
|
2561
2562
|
}
|
|
2562
2563
|
if (message.price !== "") {
|
|
2563
|
-
writer.uint32(18).string(message.price);
|
|
2564
|
+
writer.uint32(18).string(Decimal.fromUserInput(message.price, 18).atomics);
|
|
2564
2565
|
}
|
|
2565
2566
|
if (message.fee !== "") {
|
|
2566
|
-
writer.uint32(26).string(message.fee);
|
|
2567
|
+
writer.uint32(26).string(Decimal.fromUserInput(message.fee, 18).atomics);
|
|
2567
2568
|
}
|
|
2568
2569
|
return writer;
|
|
2569
2570
|
},
|
|
@@ -2575,13 +2576,13 @@ export const SpotMarketOrderResults = {
|
|
|
2575
2576
|
const tag = reader.uint32();
|
|
2576
2577
|
switch (tag >>> 3) {
|
|
2577
2578
|
case 1:
|
|
2578
|
-
message.quantity = reader.string();
|
|
2579
|
+
message.quantity = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2579
2580
|
break;
|
|
2580
2581
|
case 2:
|
|
2581
|
-
message.price = reader.string();
|
|
2582
|
+
message.price = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2582
2583
|
break;
|
|
2583
2584
|
case 3:
|
|
2584
|
-
message.fee = reader.string();
|
|
2585
|
+
message.fee = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2585
2586
|
break;
|
|
2586
2587
|
default:
|
|
2587
2588
|
reader.skipType(tag & 7);
|
|
@@ -4415,19 +4416,19 @@ export const DerivativeMarketOrderResults = {
|
|
|
4415
4416
|
},
|
|
4416
4417
|
encode(message, writer = BinaryWriter.create()) {
|
|
4417
4418
|
if (message.quantity !== "") {
|
|
4418
|
-
writer.uint32(10).string(message.quantity);
|
|
4419
|
+
writer.uint32(10).string(Decimal.fromUserInput(message.quantity, 18).atomics);
|
|
4419
4420
|
}
|
|
4420
4421
|
if (message.price !== "") {
|
|
4421
|
-
writer.uint32(18).string(message.price);
|
|
4422
|
+
writer.uint32(18).string(Decimal.fromUserInput(message.price, 18).atomics);
|
|
4422
4423
|
}
|
|
4423
4424
|
if (message.fee !== "") {
|
|
4424
|
-
writer.uint32(26).string(message.fee);
|
|
4425
|
+
writer.uint32(26).string(Decimal.fromUserInput(message.fee, 18).atomics);
|
|
4425
4426
|
}
|
|
4426
4427
|
if (message.positionDelta !== undefined) {
|
|
4427
4428
|
PositionDelta.encode(message.positionDelta, writer.uint32(34).fork()).ldelim();
|
|
4428
4429
|
}
|
|
4429
4430
|
if (message.payout !== "") {
|
|
4430
|
-
writer.uint32(42).string(message.payout);
|
|
4431
|
+
writer.uint32(42).string(Decimal.fromUserInput(message.payout, 18).atomics);
|
|
4431
4432
|
}
|
|
4432
4433
|
return writer;
|
|
4433
4434
|
},
|
|
@@ -4439,19 +4440,19 @@ export const DerivativeMarketOrderResults = {
|
|
|
4439
4440
|
const tag = reader.uint32();
|
|
4440
4441
|
switch (tag >>> 3) {
|
|
4441
4442
|
case 1:
|
|
4442
|
-
message.quantity = reader.string();
|
|
4443
|
+
message.quantity = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
4443
4444
|
break;
|
|
4444
4445
|
case 2:
|
|
4445
|
-
message.price = reader.string();
|
|
4446
|
+
message.price = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
4446
4447
|
break;
|
|
4447
4448
|
case 3:
|
|
4448
|
-
message.fee = reader.string();
|
|
4449
|
+
message.fee = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
4449
4450
|
break;
|
|
4450
4451
|
case 4:
|
|
4451
4452
|
message.positionDelta = PositionDelta.decode(reader, reader.uint32());
|
|
4452
4453
|
break;
|
|
4453
4454
|
case 5:
|
|
4454
|
-
message.payout = reader.string();
|
|
4455
|
+
message.payout = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
4455
4456
|
break;
|
|
4456
4457
|
default:
|
|
4457
4458
|
reader.skipType(tag & 7);
|
|
@@ -6092,7 +6093,7 @@ export const MsgIncreasePositionMargin = {
|
|
|
6092
6093
|
writer.uint32(34).string(message.marketId);
|
|
6093
6094
|
}
|
|
6094
6095
|
if (message.amount !== "") {
|
|
6095
|
-
writer.uint32(42).string(message.amount);
|
|
6096
|
+
writer.uint32(42).string(Decimal.fromUserInput(message.amount, 18).atomics);
|
|
6096
6097
|
}
|
|
6097
6098
|
return writer;
|
|
6098
6099
|
},
|
|
@@ -6116,7 +6117,7 @@ export const MsgIncreasePositionMargin = {
|
|
|
6116
6117
|
message.marketId = reader.string();
|
|
6117
6118
|
break;
|
|
6118
6119
|
case 5:
|
|
6119
|
-
message.amount = reader.string();
|
|
6120
|
+
message.amount = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
6120
6121
|
break;
|
|
6121
6122
|
default:
|
|
6122
6123
|
reader.skipType(tag & 7);
|
|
@@ -6274,7 +6275,7 @@ export const MsgDecreasePositionMargin = {
|
|
|
6274
6275
|
writer.uint32(34).string(message.marketId);
|
|
6275
6276
|
}
|
|
6276
6277
|
if (message.amount !== "") {
|
|
6277
|
-
writer.uint32(42).string(message.amount);
|
|
6278
|
+
writer.uint32(42).string(Decimal.fromUserInput(message.amount, 18).atomics);
|
|
6278
6279
|
}
|
|
6279
6280
|
return writer;
|
|
6280
6281
|
},
|
|
@@ -6298,7 +6299,7 @@ export const MsgDecreasePositionMargin = {
|
|
|
6298
6299
|
message.marketId = reader.string();
|
|
6299
6300
|
break;
|
|
6300
6301
|
case 5:
|
|
6301
|
-
message.amount = reader.string();
|
|
6302
|
+
message.amount = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
6302
6303
|
break;
|
|
6303
6304
|
default:
|
|
6304
6305
|
reader.skipType(tag & 7);
|
|
@@ -7097,7 +7098,7 @@ export const MsgAdminUpdateBinaryOptionsMarket = {
|
|
|
7097
7098
|
writer.uint32(18).string(message.marketId);
|
|
7098
7099
|
}
|
|
7099
7100
|
if (message.settlementPrice !== undefined) {
|
|
7100
|
-
writer.uint32(26).string(message.settlementPrice);
|
|
7101
|
+
writer.uint32(26).string(Decimal.fromUserInput(message.settlementPrice, 18).atomics);
|
|
7101
7102
|
}
|
|
7102
7103
|
if (message.expirationTimestamp !== BigInt(0)) {
|
|
7103
7104
|
writer.uint32(32).int64(message.expirationTimestamp);
|
|
@@ -7124,7 +7125,7 @@ export const MsgAdminUpdateBinaryOptionsMarket = {
|
|
|
7124
7125
|
message.marketId = reader.string();
|
|
7125
7126
|
break;
|
|
7126
7127
|
case 3:
|
|
7127
|
-
message.settlementPrice = reader.string();
|
|
7128
|
+
message.settlementPrice = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
7128
7129
|
break;
|
|
7129
7130
|
case 4:
|
|
7130
7131
|
message.expirationTimestamp = reader.int64();
|
|
@@ -3,6 +3,7 @@ import { Timestamp } from "../../../google/protobuf/timestamp";
|
|
|
3
3
|
import { BinaryReader, BinaryWriter } from "../../../binary";
|
|
4
4
|
import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../../helpers";
|
|
5
5
|
import { GlobalDecoderRegistry } from "../../../registry";
|
|
6
|
+
import { Decimal } from "../../../decimals";
|
|
6
7
|
function createBaseParams() {
|
|
7
8
|
return {
|
|
8
9
|
linkDenom: "",
|
|
@@ -399,10 +400,10 @@ export const ModuleParams = {
|
|
|
399
400
|
writer.uint32(10).string(message.feedId);
|
|
400
401
|
}
|
|
401
402
|
if (message.minAnswer !== "") {
|
|
402
|
-
writer.uint32(18).string(message.minAnswer);
|
|
403
|
+
writer.uint32(18).string(Decimal.fromUserInput(message.minAnswer, 18).atomics);
|
|
403
404
|
}
|
|
404
405
|
if (message.maxAnswer !== "") {
|
|
405
|
-
writer.uint32(26).string(message.maxAnswer);
|
|
406
|
+
writer.uint32(26).string(Decimal.fromUserInput(message.maxAnswer, 18).atomics);
|
|
406
407
|
}
|
|
407
408
|
if (message.linkPerObservation !== "") {
|
|
408
409
|
writer.uint32(34).string(message.linkPerObservation);
|
|
@@ -438,10 +439,10 @@ export const ModuleParams = {
|
|
|
438
439
|
message.feedId = reader.string();
|
|
439
440
|
break;
|
|
440
441
|
case 2:
|
|
441
|
-
message.minAnswer = reader.string();
|
|
442
|
+
message.minAnswer = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
442
443
|
break;
|
|
443
444
|
case 3:
|
|
444
|
-
message.maxAnswer = reader.string();
|
|
445
|
+
message.maxAnswer = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
445
446
|
break;
|
|
446
447
|
case 4:
|
|
447
448
|
message.linkPerObservation = reader.string();
|
|
@@ -843,10 +844,10 @@ export const FeedProperties = {
|
|
|
843
844
|
writer.uint32(42).bytes(message.offchainConfig);
|
|
844
845
|
}
|
|
845
846
|
if (message.minAnswer !== "") {
|
|
846
|
-
writer.uint32(50).string(message.minAnswer);
|
|
847
|
+
writer.uint32(50).string(Decimal.fromUserInput(message.minAnswer, 18).atomics);
|
|
847
848
|
}
|
|
848
849
|
if (message.maxAnswer !== "") {
|
|
849
|
-
writer.uint32(58).string(message.maxAnswer);
|
|
850
|
+
writer.uint32(58).string(Decimal.fromUserInput(message.maxAnswer, 18).atomics);
|
|
850
851
|
}
|
|
851
852
|
if (message.linkPerObservation !== "") {
|
|
852
853
|
writer.uint32(66).string(message.linkPerObservation);
|
|
@@ -885,10 +886,10 @@ export const FeedProperties = {
|
|
|
885
886
|
message.offchainConfig = reader.bytes();
|
|
886
887
|
break;
|
|
887
888
|
case 6:
|
|
888
|
-
message.minAnswer = reader.string();
|
|
889
|
+
message.minAnswer = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
889
890
|
break;
|
|
890
891
|
case 7:
|
|
891
|
-
message.maxAnswer = reader.string();
|
|
892
|
+
message.maxAnswer = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
892
893
|
break;
|
|
893
894
|
case 8:
|
|
894
895
|
message.linkPerObservation = reader.string();
|
|
@@ -1400,7 +1401,7 @@ export const Transmission = {
|
|
|
1400
1401
|
},
|
|
1401
1402
|
encode(message, writer = BinaryWriter.create()) {
|
|
1402
1403
|
if (message.answer !== "") {
|
|
1403
|
-
writer.uint32(10).string(message.answer);
|
|
1404
|
+
writer.uint32(10).string(Decimal.fromUserInput(message.answer, 18).atomics);
|
|
1404
1405
|
}
|
|
1405
1406
|
if (message.observationsTimestamp !== BigInt(0)) {
|
|
1406
1407
|
writer.uint32(16).int64(message.observationsTimestamp);
|
|
@@ -1418,7 +1419,7 @@ export const Transmission = {
|
|
|
1418
1419
|
const tag = reader.uint32();
|
|
1419
1420
|
switch (tag >>> 3) {
|
|
1420
1421
|
case 1:
|
|
1421
|
-
message.answer = reader.string();
|
|
1422
|
+
message.answer = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
1422
1423
|
break;
|
|
1423
1424
|
case 2:
|
|
1424
1425
|
message.observationsTimestamp = reader.int64();
|
|
@@ -1582,7 +1583,7 @@ export const Report = {
|
|
|
1582
1583
|
writer.uint32(18).bytes(message.observers);
|
|
1583
1584
|
}
|
|
1584
1585
|
for (const v of message.observations) {
|
|
1585
|
-
writer.uint32(26).string(v);
|
|
1586
|
+
writer.uint32(26).string(Decimal.fromUserInput(v, 18).atomics);
|
|
1586
1587
|
}
|
|
1587
1588
|
return writer;
|
|
1588
1589
|
},
|
|
@@ -1600,7 +1601,7 @@ export const Report = {
|
|
|
1600
1601
|
message.observers = reader.bytes();
|
|
1601
1602
|
break;
|
|
1602
1603
|
case 3:
|
|
1603
|
-
message.observations.push(reader.string());
|
|
1604
|
+
message.observations.push(Decimal.fromAtomics(reader.string(), 18).toString());
|
|
1604
1605
|
break;
|
|
1605
1606
|
default:
|
|
1606
1607
|
reader.skipType(tag & 7);
|
|
@@ -2169,7 +2170,7 @@ export const EventNewTransmission = {
|
|
|
2169
2170
|
writer.uint32(16).uint32(message.aggregatorRoundId);
|
|
2170
2171
|
}
|
|
2171
2172
|
if (message.answer !== "") {
|
|
2172
|
-
writer.uint32(26).string(message.answer);
|
|
2173
|
+
writer.uint32(26).string(Decimal.fromUserInput(message.answer, 18).atomics);
|
|
2173
2174
|
}
|
|
2174
2175
|
if (message.transmitter !== "") {
|
|
2175
2176
|
writer.uint32(34).string(message.transmitter);
|
|
@@ -2178,7 +2179,7 @@ export const EventNewTransmission = {
|
|
|
2178
2179
|
writer.uint32(40).int64(message.observationsTimestamp);
|
|
2179
2180
|
}
|
|
2180
2181
|
for (const v of message.observations) {
|
|
2181
|
-
writer.uint32(50).string(v);
|
|
2182
|
+
writer.uint32(50).string(Decimal.fromUserInput(v, 18).atomics);
|
|
2182
2183
|
}
|
|
2183
2184
|
if (message.observers.length !== 0) {
|
|
2184
2185
|
writer.uint32(58).bytes(message.observers);
|
|
@@ -2205,7 +2206,7 @@ export const EventNewTransmission = {
|
|
|
2205
2206
|
message.aggregatorRoundId = reader.uint32();
|
|
2206
2207
|
break;
|
|
2207
2208
|
case 3:
|
|
2208
|
-
message.answer = reader.string();
|
|
2209
|
+
message.answer = Decimal.fromAtomics(reader.string(), 18).toString();
|
|
2209
2210
|
break;
|
|
2210
2211
|
case 4:
|
|
2211
2212
|
message.transmitter = reader.string();
|
|
@@ -2214,7 +2215,7 @@ export const EventNewTransmission = {
|
|
|
2214
2215
|
message.observationsTimestamp = reader.int64();
|
|
2215
2216
|
break;
|
|
2216
2217
|
case 6:
|
|
2217
|
-
message.observations.push(reader.string());
|
|
2218
|
+
message.observations.push(Decimal.fromAtomics(reader.string(), 18).toString());
|
|
2218
2219
|
break;
|
|
2219
2220
|
case 7:
|
|
2220
2221
|
message.observers = reader.bytes();
|