@proton/wrap-constants 0.2.79 → 0.2.81

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/dist/index.d.ts CHANGED
@@ -6476,6 +6476,9 @@ declare const orderHistoryParser: z.ZodObject<{
6476
6476
  status: z.ZodString;
6477
6477
  quantity_change: z.ZodNumber;
6478
6478
  trx_id: z.ZodString;
6479
+ filled_total: z.ZodOptional<z.ZodNumber>;
6480
+ filled_amount: z.ZodOptional<z.ZodNumber>;
6481
+ filled_fee: z.ZodOptional<z.ZodNumber>;
6479
6482
  }, "strip", z.ZodTypeAny, {
6480
6483
  status: string;
6481
6484
  price: number;
@@ -6493,6 +6496,9 @@ declare const orderHistoryParser: z.ZodObject<{
6493
6496
  quantity_change: number;
6494
6497
  trx_id: string;
6495
6498
  quantity_init?: number | undefined;
6499
+ filled_total?: number | undefined;
6500
+ filled_amount?: number | undefined;
6501
+ filled_fee?: number | undefined;
6496
6502
  }, {
6497
6503
  status: string;
6498
6504
  price: number;
@@ -6510,6 +6516,9 @@ declare const orderHistoryParser: z.ZodObject<{
6510
6516
  quantity_change: number;
6511
6517
  trx_id: string;
6512
6518
  quantity_init?: number | undefined;
6519
+ filled_total?: number | undefined;
6520
+ filled_amount?: number | undefined;
6521
+ filled_fee?: number | undefined;
6513
6522
  }>;
6514
6523
  declare type OrderHistory = z.infer<typeof orderHistoryParser>;
6515
6524
  declare const getOpenOrdersParser: z.ZodObject<{
@@ -6549,6 +6558,9 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
6549
6558
  status: z.ZodString;
6550
6559
  quantity_change: z.ZodNumber;
6551
6560
  trx_id: z.ZodString;
6561
+ filled_total: z.ZodOptional<z.ZodNumber>;
6562
+ filled_amount: z.ZodOptional<z.ZodNumber>;
6563
+ filled_fee: z.ZodOptional<z.ZodNumber>;
6552
6564
  }, "strip", z.ZodTypeAny, {
6553
6565
  status: string;
6554
6566
  price: number;
@@ -6566,6 +6578,9 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
6566
6578
  quantity_change: number;
6567
6579
  trx_id: string;
6568
6580
  quantity_init?: number | undefined;
6581
+ filled_total?: number | undefined;
6582
+ filled_amount?: number | undefined;
6583
+ filled_fee?: number | undefined;
6569
6584
  }, {
6570
6585
  status: string;
6571
6586
  price: number;
@@ -6583,6 +6598,9 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
6583
6598
  quantity_change: number;
6584
6599
  trx_id: string;
6585
6600
  quantity_init?: number | undefined;
6601
+ filled_total?: number | undefined;
6602
+ filled_amount?: number | undefined;
6603
+ filled_fee?: number | undefined;
6586
6604
  }>, "many">;
6587
6605
  }, "strip", z.ZodTypeAny, {
6588
6606
  data: {
@@ -6602,6 +6620,9 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
6602
6620
  quantity_change: number;
6603
6621
  trx_id: string;
6604
6622
  quantity_init?: number | undefined;
6623
+ filled_total?: number | undefined;
6624
+ filled_amount?: number | undefined;
6625
+ filled_fee?: number | undefined;
6605
6626
  }[];
6606
6627
  count: number;
6607
6628
  sync: number;
@@ -6623,6 +6644,9 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
6623
6644
  quantity_change: number;
6624
6645
  trx_id: string;
6625
6646
  quantity_init?: number | undefined;
6647
+ filled_total?: number | undefined;
6648
+ filled_amount?: number | undefined;
6649
+ filled_fee?: number | undefined;
6626
6650
  }[];
6627
6651
  count: number;
6628
6652
  sync: number;
@@ -6671,6 +6695,9 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
6671
6695
  status: z.ZodString;
6672
6696
  quantity_change: z.ZodNumber;
6673
6697
  trx_id: z.ZodString;
6698
+ filled_total: z.ZodOptional<z.ZodNumber>;
6699
+ filled_amount: z.ZodOptional<z.ZodNumber>;
6700
+ filled_fee: z.ZodOptional<z.ZodNumber>;
6674
6701
  }, "strip", z.ZodTypeAny, {
6675
6702
  status: string;
6676
6703
  price: number;
@@ -6688,6 +6715,9 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
6688
6715
  quantity_change: number;
6689
6716
  trx_id: string;
6690
6717
  quantity_init?: number | undefined;
6718
+ filled_total?: number | undefined;
6719
+ filled_amount?: number | undefined;
6720
+ filled_fee?: number | undefined;
6691
6721
  }, {
6692
6722
  status: string;
6693
6723
  price: number;
@@ -6705,6 +6735,9 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
6705
6735
  quantity_change: number;
6706
6736
  trx_id: string;
6707
6737
  quantity_init?: number | undefined;
6738
+ filled_total?: number | undefined;
6739
+ filled_amount?: number | undefined;
6740
+ filled_fee?: number | undefined;
6708
6741
  }>, "many">;
6709
6742
  }, "strip", z.ZodTypeAny, {
6710
6743
  data: {
@@ -6724,6 +6757,9 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
6724
6757
  quantity_change: number;
6725
6758
  trx_id: string;
6726
6759
  quantity_init?: number | undefined;
6760
+ filled_total?: number | undefined;
6761
+ filled_amount?: number | undefined;
6762
+ filled_fee?: number | undefined;
6727
6763
  }[];
6728
6764
  count: number;
6729
6765
  sync: number;
@@ -6745,6 +6781,9 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
6745
6781
  quantity_change: number;
6746
6782
  trx_id: string;
6747
6783
  quantity_init?: number | undefined;
6784
+ filled_total?: number | undefined;
6785
+ filled_amount?: number | undefined;
6786
+ filled_fee?: number | undefined;
6748
6787
  }[];
6749
6788
  count: number;
6750
6789
  sync: number;
@@ -6777,6 +6816,9 @@ declare const getOrderResponseParser: z.ZodObject<{
6777
6816
  status: z.ZodString;
6778
6817
  quantity_change: z.ZodNumber;
6779
6818
  trx_id: z.ZodString;
6819
+ filled_total: z.ZodOptional<z.ZodNumber>;
6820
+ filled_amount: z.ZodOptional<z.ZodNumber>;
6821
+ filled_fee: z.ZodOptional<z.ZodNumber>;
6780
6822
  }, "strip", z.ZodTypeAny, {
6781
6823
  status: string;
6782
6824
  price: number;
@@ -6794,6 +6836,9 @@ declare const getOrderResponseParser: z.ZodObject<{
6794
6836
  quantity_change: number;
6795
6837
  trx_id: string;
6796
6838
  quantity_init?: number | undefined;
6839
+ filled_total?: number | undefined;
6840
+ filled_amount?: number | undefined;
6841
+ filled_fee?: number | undefined;
6797
6842
  }, {
6798
6843
  status: string;
6799
6844
  price: number;
@@ -6811,6 +6856,9 @@ declare const getOrderResponseParser: z.ZodObject<{
6811
6856
  quantity_change: number;
6812
6857
  trx_id: string;
6813
6858
  quantity_init?: number | undefined;
6859
+ filled_total?: number | undefined;
6860
+ filled_amount?: number | undefined;
6861
+ filled_fee?: number | undefined;
6814
6862
  }>, "many">;
6815
6863
  }, "strip", z.ZodTypeAny, {
6816
6864
  data: {
@@ -6830,6 +6878,9 @@ declare const getOrderResponseParser: z.ZodObject<{
6830
6878
  quantity_change: number;
6831
6879
  trx_id: string;
6832
6880
  quantity_init?: number | undefined;
6881
+ filled_total?: number | undefined;
6882
+ filled_amount?: number | undefined;
6883
+ filled_fee?: number | undefined;
6833
6884
  }[];
6834
6885
  sync: number;
6835
6886
  }, {
@@ -6850,6 +6901,9 @@ declare const getOrderResponseParser: z.ZodObject<{
6850
6901
  quantity_change: number;
6851
6902
  trx_id: string;
6852
6903
  quantity_init?: number | undefined;
6904
+ filled_total?: number | undefined;
6905
+ filled_amount?: number | undefined;
6906
+ filled_fee?: number | undefined;
6853
6907
  }[];
6854
6908
  sync: number;
6855
6909
  }>;
@@ -7026,85 +7080,93 @@ declare type GetDepthResponse = z.infer<typeof getDepthResponseParser>;
7026
7080
  */
7027
7081
  declare const dailyParser: z.ZodObject<{
7028
7082
  market_id: z.ZodNumber;
7029
- first: z.ZodNumber;
7030
- last: z.ZodNumber;
7031
- bid: z.ZodNumber;
7032
- ask: z.ZodNumber;
7033
- change_percentage_24hr: z.ZodNumber;
7083
+ symbol: z.ZodString;
7084
+ open: z.ZodNumber;
7034
7085
  high: z.ZodNumber;
7035
7086
  low: z.ZodNumber;
7087
+ close: z.ZodNumber;
7088
+ volume_bid: z.ZodNumber;
7089
+ volume_ask: z.ZodNumber;
7090
+ change_percentage: z.ZodNumber;
7036
7091
  }, "strip", z.ZodTypeAny, {
7092
+ symbol: string;
7093
+ open: number;
7037
7094
  high: number;
7038
7095
  low: number;
7096
+ close: number;
7097
+ volume_bid: number;
7039
7098
  market_id: number;
7040
- ask: number;
7041
- bid: number;
7042
- first: number;
7043
- last: number;
7044
- change_percentage_24hr: number;
7099
+ volume_ask: number;
7100
+ change_percentage: number;
7045
7101
  }, {
7102
+ symbol: string;
7103
+ open: number;
7046
7104
  high: number;
7047
7105
  low: number;
7106
+ close: number;
7107
+ volume_bid: number;
7048
7108
  market_id: number;
7049
- ask: number;
7050
- bid: number;
7051
- first: number;
7052
- last: number;
7053
- change_percentage_24hr: number;
7109
+ volume_ask: number;
7110
+ change_percentage: number;
7054
7111
  }>;
7055
7112
  declare type Daily = z.infer<typeof dailyParser>;
7056
7113
  declare const getDailyResponseParser: z.ZodObject<{
7057
7114
  sync: z.ZodNumber;
7058
7115
  data: z.ZodArray<z.ZodObject<{
7059
7116
  market_id: z.ZodNumber;
7060
- first: z.ZodNumber;
7061
- last: z.ZodNumber;
7062
- bid: z.ZodNumber;
7063
- ask: z.ZodNumber;
7064
- change_percentage_24hr: z.ZodNumber;
7117
+ symbol: z.ZodString;
7118
+ open: z.ZodNumber;
7065
7119
  high: z.ZodNumber;
7066
7120
  low: z.ZodNumber;
7121
+ close: z.ZodNumber;
7122
+ volume_bid: z.ZodNumber;
7123
+ volume_ask: z.ZodNumber;
7124
+ change_percentage: z.ZodNumber;
7067
7125
  }, "strip", z.ZodTypeAny, {
7126
+ symbol: string;
7127
+ open: number;
7068
7128
  high: number;
7069
7129
  low: number;
7130
+ close: number;
7131
+ volume_bid: number;
7070
7132
  market_id: number;
7071
- ask: number;
7072
- bid: number;
7073
- first: number;
7074
- last: number;
7075
- change_percentage_24hr: number;
7133
+ volume_ask: number;
7134
+ change_percentage: number;
7076
7135
  }, {
7136
+ symbol: string;
7137
+ open: number;
7077
7138
  high: number;
7078
7139
  low: number;
7140
+ close: number;
7141
+ volume_bid: number;
7079
7142
  market_id: number;
7080
- ask: number;
7081
- bid: number;
7082
- first: number;
7083
- last: number;
7084
- change_percentage_24hr: number;
7143
+ volume_ask: number;
7144
+ change_percentage: number;
7085
7145
  }>, "many">;
7086
7146
  }, "strip", z.ZodTypeAny, {
7087
7147
  data: {
7148
+ symbol: string;
7149
+ open: number;
7088
7150
  high: number;
7089
7151
  low: number;
7152
+ close: number;
7153
+ volume_bid: number;
7090
7154
  market_id: number;
7091
- ask: number;
7092
- bid: number;
7093
- first: number;
7094
- last: number;
7095
- change_percentage_24hr: number;
7155
+ volume_ask: number;
7156
+ change_percentage: number;
7096
7157
  }[];
7097
7158
  sync: number;
7098
7159
  }, {
7099
7160
  data: {
7161
+ symbol: string;
7162
+ open: number;
7100
7163
  high: number;
7101
7164
  low: number;
7165
+ close: number;
7166
+ volume_bid: number;
7102
7167
  market_id: number;
7103
- ask: number;
7104
- bid: number;
7105
- first: number;
7106
- last: number;
7107
- change_percentage_24hr: number;
7168
+ volume_ask: number;
7169
+ change_percentage: number;
7108
7170
  }[];
7109
7171
  sync: number;
7110
7172
  }>;
package/dist/index.js CHANGED
@@ -1485,7 +1485,15 @@ var WRAP_CONTRACT = "proton.wrap";
1485
1485
  var WRAP_AUTH_ACTION = "generateauth";
1486
1486
  var FEE_FACTOR = 1e4;
1487
1487
  var initializeConstants = (chain) => {
1488
- const { swapCoins, bridgeCoins, allEnabledCoins, allCoins, lendCoins, borrowCoins, loanCoins } = initializeCoins(chain);
1488
+ const {
1489
+ swapCoins,
1490
+ bridgeCoins,
1491
+ allEnabledCoins,
1492
+ allCoins,
1493
+ lendCoins,
1494
+ borrowCoins,
1495
+ loanCoins
1496
+ } = initializeCoins(chain);
1489
1497
  const constants = {
1490
1498
  SWAP_CONTRACT: "proton.swaps",
1491
1499
  DEX_CONTRACT: "dex",
@@ -1525,7 +1533,16 @@ var initializeConstants = (chain) => {
1525
1533
  METAL_PROTON_ENDPOINT: chain === "proton" ? "https://api.protonchain.com" : "https://api-dev.protonchain.com",
1526
1534
  METAL_DEX_HTTP_ENDPOINT: chain === "proton" ? "https://metal-dexdb.global.binfra.one/dex" : "https://metallicus-dbapi-dev01.binfra.one/dex",
1527
1535
  METAL_DEX_WS_ENDPOINT: chain === "proton" ? "wss://metal-dexdb.global.binfra.one/dexws" : "wss://metallicus-dbapi-dev01.binfra.one/dexws",
1528
- PROTON_ENDPOINTS: chain === "proton" ? ["https://metal-proton-rpc.global.binfra.one", "https://proton.greymass.com", "https://proton.eoscafeblock.com", "https://proton.cryptolions.io", "https://proton.eosusa.news"] : ["https://metal-protontest-rpc.global.binfra.one", "https://testnet.protonchain.com"],
1536
+ PROTON_ENDPOINTS: chain === "proton" ? [
1537
+ "https://metal-proton-rpc.global.binfra.one",
1538
+ "https://proton.greymass.com",
1539
+ "https://proton.eoscafeblock.com",
1540
+ "https://proton.cryptolions.io",
1541
+ "https://proton.eosusa.news"
1542
+ ] : [
1543
+ "https://metal-protontest-rpc.global.binfra.one",
1544
+ "https://testnet.protonchain.com"
1545
+ ],
1529
1546
  CHAIN_ID: chain === "proton" ? "384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0" : "71ee83bcf52142d61019d95f9cc5427ba6a0d7ff8accd9e2088ae2abeaf3d3dd",
1530
1547
  DEX_PROCESS_SIZE: 30,
1531
1548
  DEX_SLTPPROCESS_SIZE: 10,
@@ -1546,10 +1563,14 @@ var initializeConstants = (chain) => {
1546
1563
  XMD_SYMBOL_CODE: "XMD",
1547
1564
  XMD_DECIMALS: 6,
1548
1565
  findBridgeCoinWalletByXtokenAndChain(xtokenSymbol, chain2) {
1549
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin2) => bridgeCoin2.xtokenSymbol === xtokenSymbol);
1566
+ const bridgeCoin = constants.BRIDGE_COINS.find(
1567
+ (bridgeCoin2) => bridgeCoin2.xtokenSymbol === xtokenSymbol
1568
+ );
1550
1569
  if (!bridgeCoin)
1551
1570
  return void 0;
1552
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet2) => bridgeWallet2.chain === chain2);
1571
+ const bridgeWallet = bridgeCoin.wallets.find(
1572
+ (bridgeWallet2) => bridgeWallet2.chain === chain2
1573
+ );
1553
1574
  if (!bridgeWallet)
1554
1575
  return void 0;
1555
1576
  return {
@@ -1558,10 +1579,14 @@ var initializeConstants = (chain) => {
1558
1579
  };
1559
1580
  },
1560
1581
  findBridgeCoinWallet(coin, wallet) {
1561
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin2) => bridgeCoin2.coin === coin);
1582
+ const bridgeCoin = constants.BRIDGE_COINS.find(
1583
+ (bridgeCoin2) => bridgeCoin2.coin === coin
1584
+ );
1562
1585
  if (!bridgeCoin)
1563
1586
  return void 0;
1564
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet2) => bridgeWallet2.wallet === wallet);
1587
+ const bridgeWallet = bridgeCoin.wallets.find(
1588
+ (bridgeWallet2) => bridgeWallet2.wallet === wallet
1589
+ );
1565
1590
  if (!bridgeWallet)
1566
1591
  return void 0;
1567
1592
  return {
@@ -1570,10 +1595,14 @@ var initializeConstants = (chain) => {
1570
1595
  };
1571
1596
  },
1572
1597
  findBridgeCoinNetwork(coin, network) {
1573
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin2) => bridgeCoin2.coin === coin);
1598
+ const bridgeCoin = constants.BRIDGE_COINS.find(
1599
+ (bridgeCoin2) => bridgeCoin2.coin === coin
1600
+ );
1574
1601
  if (!bridgeCoin)
1575
1602
  return void 0;
1576
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet2) => bridgeWallet2.network === network);
1603
+ const bridgeWallet = bridgeCoin.wallets.find(
1604
+ (bridgeWallet2) => bridgeWallet2.network === network
1605
+ );
1577
1606
  if (!bridgeWallet)
1578
1607
  return void 0;
1579
1608
  return {
@@ -1837,7 +1866,10 @@ var orderHistoryParser = z11.object({
1837
1866
  fill_type: z11.number(),
1838
1867
  status: z11.string(),
1839
1868
  quantity_change: z11.number(),
1840
- trx_id: z11.string()
1869
+ trx_id: z11.string(),
1870
+ filled_total: z11.number().optional(),
1871
+ filled_amount: z11.number().optional(),
1872
+ filled_fee: z11.number().optional()
1841
1873
  });
1842
1874
  var getOpenOrdersParser = z11.object({
1843
1875
  account: z11.string(),
@@ -1901,13 +1933,14 @@ var getDepthResponseParser = z11.object({
1901
1933
  });
1902
1934
  var dailyParser = z11.object({
1903
1935
  market_id: z11.number(),
1904
- first: z11.number(),
1905
- last: z11.number(),
1906
- bid: z11.number(),
1907
- ask: z11.number(),
1908
- change_percentage_24hr: z11.number(),
1936
+ symbol: z11.string(),
1937
+ open: z11.number(),
1909
1938
  high: z11.number(),
1910
- low: z11.number()
1939
+ low: z11.number(),
1940
+ close: z11.number(),
1941
+ volume_bid: z11.number(),
1942
+ volume_ask: z11.number(),
1943
+ change_percentage: z11.number()
1911
1944
  });
1912
1945
  var getDailyResponseParser = z11.object({
1913
1946
  sync: z11.number(),
package/dist/index.mjs CHANGED
@@ -1355,7 +1355,15 @@ var WRAP_CONTRACT = "proton.wrap";
1355
1355
  var WRAP_AUTH_ACTION = "generateauth";
1356
1356
  var FEE_FACTOR = 1e4;
1357
1357
  var initializeConstants = (chain) => {
1358
- const { swapCoins, bridgeCoins, allEnabledCoins, allCoins, lendCoins, borrowCoins, loanCoins } = initializeCoins(chain);
1358
+ const {
1359
+ swapCoins,
1360
+ bridgeCoins,
1361
+ allEnabledCoins,
1362
+ allCoins,
1363
+ lendCoins,
1364
+ borrowCoins,
1365
+ loanCoins
1366
+ } = initializeCoins(chain);
1359
1367
  const constants = {
1360
1368
  SWAP_CONTRACT: "proton.swaps",
1361
1369
  DEX_CONTRACT: "dex",
@@ -1395,7 +1403,16 @@ var initializeConstants = (chain) => {
1395
1403
  METAL_PROTON_ENDPOINT: chain === "proton" ? "https://api.protonchain.com" : "https://api-dev.protonchain.com",
1396
1404
  METAL_DEX_HTTP_ENDPOINT: chain === "proton" ? "https://metal-dexdb.global.binfra.one/dex" : "https://metallicus-dbapi-dev01.binfra.one/dex",
1397
1405
  METAL_DEX_WS_ENDPOINT: chain === "proton" ? "wss://metal-dexdb.global.binfra.one/dexws" : "wss://metallicus-dbapi-dev01.binfra.one/dexws",
1398
- PROTON_ENDPOINTS: chain === "proton" ? ["https://metal-proton-rpc.global.binfra.one", "https://proton.greymass.com", "https://proton.eoscafeblock.com", "https://proton.cryptolions.io", "https://proton.eosusa.news"] : ["https://metal-protontest-rpc.global.binfra.one", "https://testnet.protonchain.com"],
1406
+ PROTON_ENDPOINTS: chain === "proton" ? [
1407
+ "https://metal-proton-rpc.global.binfra.one",
1408
+ "https://proton.greymass.com",
1409
+ "https://proton.eoscafeblock.com",
1410
+ "https://proton.cryptolions.io",
1411
+ "https://proton.eosusa.news"
1412
+ ] : [
1413
+ "https://metal-protontest-rpc.global.binfra.one",
1414
+ "https://testnet.protonchain.com"
1415
+ ],
1399
1416
  CHAIN_ID: chain === "proton" ? "384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0" : "71ee83bcf52142d61019d95f9cc5427ba6a0d7ff8accd9e2088ae2abeaf3d3dd",
1400
1417
  DEX_PROCESS_SIZE: 30,
1401
1418
  DEX_SLTPPROCESS_SIZE: 10,
@@ -1416,10 +1433,14 @@ var initializeConstants = (chain) => {
1416
1433
  XMD_SYMBOL_CODE: "XMD",
1417
1434
  XMD_DECIMALS: 6,
1418
1435
  findBridgeCoinWalletByXtokenAndChain(xtokenSymbol, chain2) {
1419
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin2) => bridgeCoin2.xtokenSymbol === xtokenSymbol);
1436
+ const bridgeCoin = constants.BRIDGE_COINS.find(
1437
+ (bridgeCoin2) => bridgeCoin2.xtokenSymbol === xtokenSymbol
1438
+ );
1420
1439
  if (!bridgeCoin)
1421
1440
  return void 0;
1422
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet2) => bridgeWallet2.chain === chain2);
1441
+ const bridgeWallet = bridgeCoin.wallets.find(
1442
+ (bridgeWallet2) => bridgeWallet2.chain === chain2
1443
+ );
1423
1444
  if (!bridgeWallet)
1424
1445
  return void 0;
1425
1446
  return {
@@ -1428,10 +1449,14 @@ var initializeConstants = (chain) => {
1428
1449
  };
1429
1450
  },
1430
1451
  findBridgeCoinWallet(coin, wallet) {
1431
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin2) => bridgeCoin2.coin === coin);
1452
+ const bridgeCoin = constants.BRIDGE_COINS.find(
1453
+ (bridgeCoin2) => bridgeCoin2.coin === coin
1454
+ );
1432
1455
  if (!bridgeCoin)
1433
1456
  return void 0;
1434
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet2) => bridgeWallet2.wallet === wallet);
1457
+ const bridgeWallet = bridgeCoin.wallets.find(
1458
+ (bridgeWallet2) => bridgeWallet2.wallet === wallet
1459
+ );
1435
1460
  if (!bridgeWallet)
1436
1461
  return void 0;
1437
1462
  return {
@@ -1440,10 +1465,14 @@ var initializeConstants = (chain) => {
1440
1465
  };
1441
1466
  },
1442
1467
  findBridgeCoinNetwork(coin, network) {
1443
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin2) => bridgeCoin2.coin === coin);
1468
+ const bridgeCoin = constants.BRIDGE_COINS.find(
1469
+ (bridgeCoin2) => bridgeCoin2.coin === coin
1470
+ );
1444
1471
  if (!bridgeCoin)
1445
1472
  return void 0;
1446
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet2) => bridgeWallet2.network === network);
1473
+ const bridgeWallet = bridgeCoin.wallets.find(
1474
+ (bridgeWallet2) => bridgeWallet2.network === network
1475
+ );
1447
1476
  if (!bridgeWallet)
1448
1477
  return void 0;
1449
1478
  return {
@@ -1707,7 +1736,10 @@ var orderHistoryParser = z11.object({
1707
1736
  fill_type: z11.number(),
1708
1737
  status: z11.string(),
1709
1738
  quantity_change: z11.number(),
1710
- trx_id: z11.string()
1739
+ trx_id: z11.string(),
1740
+ filled_total: z11.number().optional(),
1741
+ filled_amount: z11.number().optional(),
1742
+ filled_fee: z11.number().optional()
1711
1743
  });
1712
1744
  var getOpenOrdersParser = z11.object({
1713
1745
  account: z11.string(),
@@ -1771,13 +1803,14 @@ var getDepthResponseParser = z11.object({
1771
1803
  });
1772
1804
  var dailyParser = z11.object({
1773
1805
  market_id: z11.number(),
1774
- first: z11.number(),
1775
- last: z11.number(),
1776
- bid: z11.number(),
1777
- ask: z11.number(),
1778
- change_percentage_24hr: z11.number(),
1806
+ symbol: z11.string(),
1807
+ open: z11.number(),
1779
1808
  high: z11.number(),
1780
- low: z11.number()
1809
+ low: z11.number(),
1810
+ close: z11.number(),
1811
+ volume_bid: z11.number(),
1812
+ volume_ask: z11.number(),
1813
+ change_percentage: z11.number()
1781
1814
  });
1782
1815
  var getDailyResponseParser = z11.object({
1783
1816
  sync: z11.number(),
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.2.79",
8
+ "version": "0.2.81",
9
9
  "license": "MIT",
10
10
  "main": "dist/index.js",
11
11
  "typings": "dist/index.d.ts",
@@ -40,5 +40,5 @@
40
40
  "resolutions": {
41
41
  "typescript": "4.5"
42
42
  },
43
- "gitHead": "7568a0da9b23f794f2ab2770187b655d944f9cfb"
43
+ "gitHead": "291127e1507a126eb5cd5316b3b2236f22c0549b"
44
44
  }
package/src/constants.ts CHANGED
@@ -1,139 +1,180 @@
1
- import { Coin, CoinWallet, initializeCoins, Wallet } from './coins'
1
+ import { Coin, CoinWallet, initializeCoins, Wallet } from "./coins";
2
2
 
3
- export const WRAP_CONTRACT = 'proton.wrap'
4
- export const WRAP_AUTH_ACTION = 'generateauth'
5
- export const FEE_FACTOR = 10000
3
+ export const WRAP_CONTRACT = "proton.wrap";
4
+ export const WRAP_AUTH_ACTION = "generateauth";
5
+ export const FEE_FACTOR = 10000;
6
6
 
7
7
  export const initializeConstants = (chain: string) => {
8
- const { swapCoins, bridgeCoins, allEnabledCoins, allCoins, lendCoins, borrowCoins, loanCoins } = initializeCoins(chain)
9
-
10
- const constants = {
11
- SWAP_CONTRACT: 'proton.swaps',
12
- DEX_CONTRACT: 'dex',
13
- FEE_FACTOR,
14
- GOOGLE_MAPS_KEY: 'AIzaSyDb2_CrK032kSIqBXbkdwmaLKWELl0SxVs',
15
- SWAP_URL: chain === 'proton'
16
- ? 'https://otc.protonswap.com'
17
- : 'https://otc-test.protonswap.com',
18
- WRAP_SERVER_URL: chain === 'proton'
19
- ? 'https://www.api.bloks.io/proton-wrap-public2'
20
- : 'https://www.api.bloks.io/proton-wrap-testnet-public2',
21
- WRAP_CONTRACT,
22
- WRAP_ACTIONS: {
23
- SAVE_ADDRESS: 'saveaddress2',
24
- DELETE_ADDRESS: 'deladdress2',
25
- WRAP_START: 'wrapstart2',
26
- WRAP_FINISH: 'wrapfinish2',
27
- WRAP_PROCESS: 'wrapprocess2',
28
- WRAP_SET_CONF: 'wrapsetconf2',
29
- },
30
- WRAP_TABLES: {
31
- ADDRESSES: 'addresses2',
32
- WRAPS: 'wraps2'
33
- },
34
- ADDRESSES_INDEXES: {
35
- BY_ACCOUNT: 2,
36
- BY_ADDR_HASH: 3
37
- },
38
- WRAPS_INDEXES: {
39
- BY_ACCOUNT: 2,
40
- BY_STATUS: 3,
41
- BY_WRAP_HASH: 4
42
- },
43
- WRAP_PROCESS_TIMER: 5000,
44
-
45
- FARM_CONTRACT: 'yield.farms',
46
-
47
- WEBHOOK_PERMISSION: 'webhook',
48
- PUBLIC_PERMISSION: 'public',
49
- LIGHT_PERMISSION: 'light',
50
- WRAP_AUTH_ACTION: WRAP_AUTH_ACTION,
51
-
52
- METAL_ENDPOINT: chain === 'proton'
53
- ? 'https://cirrus.metalpay.com'
54
- : 'https://cirrus-dev.metalpay.com',
55
-
56
- METAL_PROTON_ENDPOINT: chain === 'proton'
57
- ? 'https://api.protonchain.com'
58
- : 'https://api-dev.protonchain.com',
59
-
60
- METAL_DEX_HTTP_ENDPOINT: chain === 'proton'
61
- ? 'https://metal-dexdb.global.binfra.one/dex'
62
- : 'https://metallicus-dbapi-dev01.binfra.one/dex',
63
-
64
- METAL_DEX_WS_ENDPOINT: chain === 'proton'
65
- ? 'wss://metal-dexdb.global.binfra.one/dexws'
66
- : 'wss://metallicus-dbapi-dev01.binfra.one/dexws',
67
-
68
- PROTON_ENDPOINTS: chain === 'proton'
69
- ? ['https://metal-proton-rpc.global.binfra.one', 'https://proton.greymass.com', 'https://proton.eoscafeblock.com', 'https://proton.cryptolions.io', 'https://proton.eosusa.news']
70
- : ['https://metal-protontest-rpc.global.binfra.one', 'https://testnet.protonchain.com'],
71
-
72
- CHAIN_ID: chain === 'proton'
73
- ? '384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0'
74
- : '71ee83bcf52142d61019d95f9cc5427ba6a0d7ff8accd9e2088ae2abeaf3d3dd',
75
-
76
- DEX_PROCESS_SIZE: 30,
77
- DEX_SLTPPROCESS_SIZE: 10,
78
- MAX_PRICE: "9223372036854775806",
79
- MAX_ITEMS_PER_PAGE_DESKTOP: 25,
80
- MIN_PRICE: 1,
81
- DEFAULT_DEX_SYMBOL: chain === 'proton'
82
- ? 'XPR_XMD'
83
- : 'XPR_XUSDC',
84
-
85
- CHAIN: chain,
86
-
87
- SWAP_COINS: swapCoins,
88
- BRIDGE_COINS: bridgeCoins,
89
- ALL_ENABLED_COINS: allEnabledCoins,
90
- LEND_COINS: lendCoins,
91
- BORROW_COINS: borrowCoins,
92
- LOAN_COINS: loanCoins,
93
- ALL_COINS: allCoins,
94
-
95
- XMD_CONTRACT: 'xmd.treasury',
96
- XMD_TOKEN_CONTRACT: 'xmd.token',
97
- XMD_SYMBOL_CODE: 'XMD',
98
- XMD_DECIMALS: 6,
99
-
100
- findBridgeCoinWalletByXtokenAndChain (xtokenSymbol: string, chain: string): CoinWallet | undefined {
101
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin: Coin) => bridgeCoin.xtokenSymbol === xtokenSymbol)
102
- if (!bridgeCoin) return undefined
103
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet: Wallet) => bridgeWallet.chain === chain)
104
- if (!bridgeWallet) return undefined
105
-
106
- return {
107
- ...bridgeCoin,
108
- ...bridgeWallet
109
- }
110
- },
111
-
112
- findBridgeCoinWallet (coin: string, wallet: string): CoinWallet | undefined {
113
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin: Coin) => bridgeCoin.coin === coin)
114
- if (!bridgeCoin) return undefined
115
-
116
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet: Wallet) => bridgeWallet.wallet === wallet)
117
- if (!bridgeWallet) return undefined
118
-
119
- return {
120
- ...bridgeCoin,
121
- ...bridgeWallet
122
- }
123
- },
124
-
125
- findBridgeCoinNetwork (coin: string, network: string): CoinWallet | undefined {
126
- const bridgeCoin = constants.BRIDGE_COINS.find((bridgeCoin: Coin) => bridgeCoin.coin === coin)
127
- if (!bridgeCoin) return undefined
128
- const bridgeWallet = bridgeCoin.wallets.find((bridgeWallet: Wallet) => bridgeWallet.network === network)
129
- if (!bridgeWallet) return undefined
130
-
131
- return {
132
- ...bridgeCoin,
133
- ...bridgeWallet
134
- }
135
- }
136
- }
137
-
138
- return constants
139
- }
8
+ const {
9
+ swapCoins,
10
+ bridgeCoins,
11
+ allEnabledCoins,
12
+ allCoins,
13
+ lendCoins,
14
+ borrowCoins,
15
+ loanCoins,
16
+ } = initializeCoins(chain);
17
+
18
+ const constants = {
19
+ SWAP_CONTRACT: "proton.swaps",
20
+ DEX_CONTRACT: "dex",
21
+ FEE_FACTOR,
22
+ GOOGLE_MAPS_KEY: "AIzaSyDb2_CrK032kSIqBXbkdwmaLKWELl0SxVs",
23
+ SWAP_URL:
24
+ chain === "proton"
25
+ ? "https://otc.protonswap.com"
26
+ : "https://otc-test.protonswap.com",
27
+ WRAP_SERVER_URL:
28
+ chain === "proton"
29
+ ? "https://www.api.bloks.io/proton-wrap-public2"
30
+ : "https://www.api.bloks.io/proton-wrap-testnet-public2",
31
+ WRAP_CONTRACT,
32
+ WRAP_ACTIONS: {
33
+ SAVE_ADDRESS: "saveaddress2",
34
+ DELETE_ADDRESS: "deladdress2",
35
+ WRAP_START: "wrapstart2",
36
+ WRAP_FINISH: "wrapfinish2",
37
+ WRAP_PROCESS: "wrapprocess2",
38
+ WRAP_SET_CONF: "wrapsetconf2",
39
+ },
40
+ WRAP_TABLES: {
41
+ ADDRESSES: "addresses2",
42
+ WRAPS: "wraps2",
43
+ },
44
+ ADDRESSES_INDEXES: {
45
+ BY_ACCOUNT: 2,
46
+ BY_ADDR_HASH: 3,
47
+ },
48
+ WRAPS_INDEXES: {
49
+ BY_ACCOUNT: 2,
50
+ BY_STATUS: 3,
51
+ BY_WRAP_HASH: 4,
52
+ },
53
+ WRAP_PROCESS_TIMER: 5000,
54
+
55
+ FARM_CONTRACT: "yield.farms",
56
+
57
+ WEBHOOK_PERMISSION: "webhook",
58
+ PUBLIC_PERMISSION: "public",
59
+ LIGHT_PERMISSION: "light",
60
+ WRAP_AUTH_ACTION: WRAP_AUTH_ACTION,
61
+
62
+ METAL_ENDPOINT:
63
+ chain === "proton"
64
+ ? "https://cirrus.metalpay.com"
65
+ : "https://cirrus-dev.metalpay.com",
66
+
67
+ METAL_PROTON_ENDPOINT:
68
+ chain === "proton"
69
+ ? "https://api.protonchain.com"
70
+ : "https://api-dev.protonchain.com",
71
+
72
+ METAL_DEX_HTTP_ENDPOINT:
73
+ chain === "proton"
74
+ ? "https://metal-dexdb.global.binfra.one/dex"
75
+ : "https://metallicus-dbapi-dev01.binfra.one/dex",
76
+
77
+ METAL_DEX_WS_ENDPOINT:
78
+ chain === "proton"
79
+ ? "wss://metal-dexdb.global.binfra.one/dexws"
80
+ : "wss://metallicus-dbapi-dev01.binfra.one/dexws",
81
+
82
+ PROTON_ENDPOINTS:
83
+ chain === "proton"
84
+ ? [
85
+ "https://metal-proton-rpc.global.binfra.one",
86
+ "https://proton.greymass.com",
87
+ "https://proton.eoscafeblock.com",
88
+ "https://proton.cryptolions.io",
89
+ "https://proton.eosusa.news",
90
+ ]
91
+ : [
92
+ "https://metal-protontest-rpc.global.binfra.one",
93
+ "https://testnet.protonchain.com",
94
+ ],
95
+
96
+ CHAIN_ID:
97
+ chain === "proton"
98
+ ? "384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0"
99
+ : "71ee83bcf52142d61019d95f9cc5427ba6a0d7ff8accd9e2088ae2abeaf3d3dd",
100
+
101
+ DEX_PROCESS_SIZE: 30,
102
+ DEX_SLTPPROCESS_SIZE: 10,
103
+ MAX_PRICE: "9223372036854775806",
104
+ MAX_ITEMS_PER_PAGE_DESKTOP: 25,
105
+ MIN_PRICE: 1,
106
+ DEFAULT_DEX_SYMBOL: chain === "proton" ? "XPR_XMD" : "XPR_XUSDC",
107
+
108
+ CHAIN: chain,
109
+
110
+ SWAP_COINS: swapCoins,
111
+ BRIDGE_COINS: bridgeCoins,
112
+ ALL_ENABLED_COINS: allEnabledCoins,
113
+ LEND_COINS: lendCoins,
114
+ BORROW_COINS: borrowCoins,
115
+ LOAN_COINS: loanCoins,
116
+ ALL_COINS: allCoins,
117
+
118
+ XMD_CONTRACT: "xmd.treasury",
119
+ XMD_TOKEN_CONTRACT: "xmd.token",
120
+ XMD_SYMBOL_CODE: "XMD",
121
+ XMD_DECIMALS: 6,
122
+
123
+ findBridgeCoinWalletByXtokenAndChain(
124
+ xtokenSymbol: string,
125
+ chain: string
126
+ ): CoinWallet | undefined {
127
+ const bridgeCoin = constants.BRIDGE_COINS.find(
128
+ (bridgeCoin: Coin) => bridgeCoin.xtokenSymbol === xtokenSymbol
129
+ );
130
+ if (!bridgeCoin) return undefined;
131
+ const bridgeWallet = bridgeCoin.wallets.find(
132
+ (bridgeWallet: Wallet) => bridgeWallet.chain === chain
133
+ );
134
+ if (!bridgeWallet) return undefined;
135
+
136
+ return {
137
+ ...bridgeCoin,
138
+ ...bridgeWallet,
139
+ };
140
+ },
141
+
142
+ findBridgeCoinWallet(coin: string, wallet: string): CoinWallet | undefined {
143
+ const bridgeCoin = constants.BRIDGE_COINS.find(
144
+ (bridgeCoin: Coin) => bridgeCoin.coin === coin
145
+ );
146
+ if (!bridgeCoin) return undefined;
147
+
148
+ const bridgeWallet = bridgeCoin.wallets.find(
149
+ (bridgeWallet: Wallet) => bridgeWallet.wallet === wallet
150
+ );
151
+ if (!bridgeWallet) return undefined;
152
+
153
+ return {
154
+ ...bridgeCoin,
155
+ ...bridgeWallet,
156
+ };
157
+ },
158
+
159
+ findBridgeCoinNetwork(
160
+ coin: string,
161
+ network: string
162
+ ): CoinWallet | undefined {
163
+ const bridgeCoin = constants.BRIDGE_COINS.find(
164
+ (bridgeCoin: Coin) => bridgeCoin.coin === coin
165
+ );
166
+ if (!bridgeCoin) return undefined;
167
+ const bridgeWallet = bridgeCoin.wallets.find(
168
+ (bridgeWallet: Wallet) => bridgeWallet.network === network
169
+ );
170
+ if (!bridgeWallet) return undefined;
171
+
172
+ return {
173
+ ...bridgeCoin,
174
+ ...bridgeWallet,
175
+ };
176
+ },
177
+ };
178
+
179
+ return constants;
180
+ };
@@ -53,6 +53,9 @@ export const orderHistoryParser = z.object({
53
53
  status: z.string(),
54
54
  quantity_change: z.number(),
55
55
  trx_id: z.string(),
56
+ filled_total: z.number().optional(),
57
+ filled_amount: z.number().optional(),
58
+ filled_fee: z.number().optional(),
56
59
  });
57
60
  export type OrderHistory = z.infer<typeof orderHistoryParser>;
58
61
 
@@ -157,13 +160,14 @@ export type GetDepthResponse = z.infer<typeof getDepthResponseParser>;
157
160
  */
158
161
  export const dailyParser = z.object({
159
162
  market_id: z.number(),
160
- first: z.number(),
161
- last: z.number(),
162
- bid: z.number(),
163
- ask: z.number(),
164
- change_percentage_24hr: z.number(),
163
+ symbol: z.string(),
164
+ open: z.number(),
165
165
  high: z.number(),
166
166
  low: z.number(),
167
+ close: z.number(),
168
+ volume_bid: z.number(),
169
+ volume_ask: z.number(),
170
+ change_percentage: z.number(),
167
171
  });
168
172
  export type Daily = z.infer<typeof dailyParser>;
169
173