@myx-trade/sdk 0.1.154 → 0.1.156
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.mts +75 -144
- package/dist/index.d.ts +75 -144
- package/dist/index.js +9 -2
- package/dist/index.mjs +9 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
1
|
+
import { AddressLike, Signer, ethers } from 'ethers';
|
|
3
2
|
export { formatUnits, parseUnits } from 'ethers';
|
|
4
3
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
4
|
import { WalletClient } from 'viem';
|
|
@@ -49,49 +48,49 @@ interface CancelTpSLParams {
|
|
|
49
48
|
orderId: string;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
51
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<any>;
|
|
53
52
|
|
|
54
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
55
|
-
declare const getMarketPools: (chainId: ChainId) => Promise<
|
|
53
|
+
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<any>;
|
|
54
|
+
declare const getMarketPools: (chainId: ChainId) => Promise<any>;
|
|
56
55
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
57
56
|
quotePool: {
|
|
58
|
-
poolToken:
|
|
59
|
-
exchangeRate:
|
|
60
|
-
poolTokenPrice:
|
|
61
|
-
poolTokenSupply:
|
|
57
|
+
poolToken: any;
|
|
58
|
+
exchangeRate: any;
|
|
59
|
+
poolTokenPrice: any;
|
|
60
|
+
poolTokenSupply: any;
|
|
62
61
|
};
|
|
63
62
|
basePool: {
|
|
64
|
-
poolToken:
|
|
65
|
-
exchangeRate:
|
|
66
|
-
poolTokenPrice:
|
|
67
|
-
poolTokenSupply:
|
|
63
|
+
poolToken: any;
|
|
64
|
+
exchangeRate: any;
|
|
65
|
+
poolTokenPrice: any;
|
|
66
|
+
poolTokenSupply: any;
|
|
68
67
|
};
|
|
69
68
|
reserveInfo: {
|
|
70
|
-
baseTotalAmount:
|
|
71
|
-
baseReservedAmount:
|
|
72
|
-
quoteTotalAmount:
|
|
73
|
-
quoteReservedAmount:
|
|
69
|
+
baseTotalAmount: any;
|
|
70
|
+
baseReservedAmount: any;
|
|
71
|
+
quoteTotalAmount: any;
|
|
72
|
+
quoteReservedAmount: any;
|
|
74
73
|
};
|
|
75
74
|
fundingInfo: {
|
|
76
|
-
nextFundingRate:
|
|
77
|
-
lastFundingFeeTracker:
|
|
78
|
-
nextEpochTime:
|
|
75
|
+
nextFundingRate: any;
|
|
76
|
+
lastFundingFeeTracker: any;
|
|
77
|
+
nextEpochTime: any;
|
|
79
78
|
};
|
|
80
79
|
ioTracker: {
|
|
81
|
-
tracker:
|
|
82
|
-
longSize:
|
|
83
|
-
shortSize:
|
|
84
|
-
poolEntryPrice:
|
|
80
|
+
tracker: any;
|
|
81
|
+
longSize: any;
|
|
82
|
+
shortSize: any;
|
|
83
|
+
poolEntryPrice: any;
|
|
85
84
|
};
|
|
86
85
|
}>;
|
|
87
86
|
|
|
88
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
87
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
|
|
89
88
|
|
|
90
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
89
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
|
|
91
90
|
|
|
92
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
91
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
|
|
93
92
|
|
|
94
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
93
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
96
|
* Trading related types and enums
|
|
@@ -888,21 +887,21 @@ interface PreviewWithdrawDataParams {
|
|
|
888
887
|
amount: string | number;
|
|
889
888
|
}
|
|
890
889
|
|
|
891
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
892
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
890
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
891
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
|
|
893
892
|
|
|
894
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
893
|
+
declare const deposit$1: (params: Deposit) => Promise<any>;
|
|
895
894
|
|
|
896
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
895
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
|
|
897
896
|
|
|
898
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
897
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<any>;
|
|
899
898
|
|
|
900
899
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
901
|
-
baseAmountOut:
|
|
902
|
-
rebateAmount:
|
|
900
|
+
baseAmountOut: any;
|
|
901
|
+
rebateAmount: any;
|
|
903
902
|
} | undefined>;
|
|
904
903
|
|
|
905
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
904
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
906
905
|
|
|
907
906
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
908
907
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -911,18 +910,18 @@ declare namespace index$2 {
|
|
|
911
910
|
export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw };
|
|
912
911
|
}
|
|
913
912
|
|
|
914
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
913
|
+
declare const deposit: (params: Deposit) => Promise<any>;
|
|
915
914
|
|
|
916
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
915
|
+
declare const withdraw: (params: WithdrawParams) => Promise<any>;
|
|
917
916
|
|
|
918
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
917
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
|
|
919
918
|
|
|
920
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
919
|
+
declare const getRewards: (params: RewardsParams) => Promise<any>;
|
|
921
920
|
|
|
922
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
923
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
921
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
922
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
|
|
924
923
|
|
|
925
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
924
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
926
925
|
|
|
927
926
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
928
927
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -935,16 +934,9 @@ declare namespace index$1 {
|
|
|
935
934
|
export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw };
|
|
936
935
|
}
|
|
937
936
|
|
|
938
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
939
|
-
quoteToken: string;
|
|
940
|
-
baseReserveRatio: bigint;
|
|
941
|
-
quoteReserveRatio: bigint;
|
|
942
|
-
oracleFeeUsd: bigint;
|
|
943
|
-
oracleRefundFeeUsd: bigint;
|
|
944
|
-
poolPrimeThreshold: bigint;
|
|
945
|
-
}) | undefined>;
|
|
937
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
946
938
|
|
|
947
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
939
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
948
940
|
|
|
949
941
|
declare const index_getMarket: typeof getMarket;
|
|
950
942
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -987,9 +979,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
987
979
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
988
980
|
balance?: number | undefined;
|
|
989
981
|
address: string;
|
|
990
|
-
name:
|
|
991
|
-
symbol:
|
|
992
|
-
decimals:
|
|
982
|
+
name: any;
|
|
983
|
+
symbol: any;
|
|
984
|
+
decimals: any;
|
|
993
985
|
icon: string;
|
|
994
986
|
totalSupply: number;
|
|
995
987
|
}>;
|
|
@@ -1203,7 +1195,7 @@ interface MyxClientConfig {
|
|
|
1203
1195
|
signer?: Signer;
|
|
1204
1196
|
seamlessAccount?: {
|
|
1205
1197
|
masterAddress: string;
|
|
1206
|
-
wallet: ethers
|
|
1198
|
+
wallet: ethers.Wallet | null;
|
|
1207
1199
|
authorized: boolean;
|
|
1208
1200
|
};
|
|
1209
1201
|
walletClient?: WalletClient;
|
|
@@ -1223,7 +1215,7 @@ declare class ConfigManager {
|
|
|
1223
1215
|
clear(): void;
|
|
1224
1216
|
startSeamlessMode(open: boolean): MyxClientConfig;
|
|
1225
1217
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1226
|
-
wallet?: ethers
|
|
1218
|
+
wallet?: ethers.Wallet;
|
|
1227
1219
|
authorized?: boolean;
|
|
1228
1220
|
masterAddress?: string;
|
|
1229
1221
|
}): void;
|
|
@@ -1331,7 +1323,7 @@ declare class Utils {
|
|
|
1331
1323
|
quoteAddress: string;
|
|
1332
1324
|
amount?: string;
|
|
1333
1325
|
spenderAddress?: string;
|
|
1334
|
-
signer?: ethers
|
|
1326
|
+
signer?: ethers.Signer;
|
|
1335
1327
|
}): Promise<{
|
|
1336
1328
|
code: number;
|
|
1337
1329
|
message: any;
|
|
@@ -1374,68 +1366,7 @@ declare class Utils {
|
|
|
1374
1366
|
marketPrice: string;
|
|
1375
1367
|
}): Promise<{
|
|
1376
1368
|
code: number;
|
|
1377
|
-
data:
|
|
1378
|
-
poolToken: string;
|
|
1379
|
-
exchangeRate: bigint;
|
|
1380
|
-
poolTokenPrice: bigint;
|
|
1381
|
-
poolTokenSupply: bigint;
|
|
1382
|
-
}, [string, bigint, bigint, bigint] & {
|
|
1383
|
-
poolToken: string;
|
|
1384
|
-
exchangeRate: bigint;
|
|
1385
|
-
poolTokenPrice: bigint;
|
|
1386
|
-
poolTokenSupply: bigint;
|
|
1387
|
-
}, [bigint, bigint, bigint, bigint] & {
|
|
1388
|
-
baseTotalAmount: bigint;
|
|
1389
|
-
baseReservedAmount: bigint;
|
|
1390
|
-
quoteTotalAmount: bigint;
|
|
1391
|
-
quoteReservedAmount: bigint;
|
|
1392
|
-
}, [bigint, bigint, bigint] & {
|
|
1393
|
-
nextFundingRate: bigint;
|
|
1394
|
-
lastFundingFeeTracker: bigint;
|
|
1395
|
-
nextEpochTime: bigint;
|
|
1396
|
-
}, [bigint, bigint, bigint, bigint] & {
|
|
1397
|
-
tracker: bigint;
|
|
1398
|
-
longSize: bigint;
|
|
1399
|
-
shortSize: bigint;
|
|
1400
|
-
poolEntryPrice: bigint;
|
|
1401
|
-
}, [bigint, bigint] & {
|
|
1402
|
-
windowCaps: bigint;
|
|
1403
|
-
openInterest: bigint;
|
|
1404
|
-
}] & {
|
|
1405
|
-
basePool: [string, bigint, bigint, bigint] & {
|
|
1406
|
-
poolToken: string;
|
|
1407
|
-
exchangeRate: bigint;
|
|
1408
|
-
poolTokenPrice: bigint;
|
|
1409
|
-
poolTokenSupply: bigint;
|
|
1410
|
-
};
|
|
1411
|
-
quotePool: [string, bigint, bigint, bigint] & {
|
|
1412
|
-
poolToken: string;
|
|
1413
|
-
exchangeRate: bigint;
|
|
1414
|
-
poolTokenPrice: bigint;
|
|
1415
|
-
poolTokenSupply: bigint;
|
|
1416
|
-
};
|
|
1417
|
-
reserveInfo: [bigint, bigint, bigint, bigint] & {
|
|
1418
|
-
baseTotalAmount: bigint;
|
|
1419
|
-
baseReservedAmount: bigint;
|
|
1420
|
-
quoteTotalAmount: bigint;
|
|
1421
|
-
quoteReservedAmount: bigint;
|
|
1422
|
-
};
|
|
1423
|
-
fundingInfo: [bigint, bigint, bigint] & {
|
|
1424
|
-
nextFundingRate: bigint;
|
|
1425
|
-
lastFundingFeeTracker: bigint;
|
|
1426
|
-
nextEpochTime: bigint;
|
|
1427
|
-
};
|
|
1428
|
-
oi: [bigint, bigint, bigint, bigint] & {
|
|
1429
|
-
tracker: bigint;
|
|
1430
|
-
longSize: bigint;
|
|
1431
|
-
shortSize: bigint;
|
|
1432
|
-
poolEntryPrice: bigint;
|
|
1433
|
-
};
|
|
1434
|
-
liquidityInfo: [bigint, bigint] & {
|
|
1435
|
-
windowCaps: bigint;
|
|
1436
|
-
openInterest: bigint;
|
|
1437
|
-
};
|
|
1438
|
-
};
|
|
1369
|
+
data: any;
|
|
1439
1370
|
message?: undefined;
|
|
1440
1371
|
} | {
|
|
1441
1372
|
code: number;
|
|
@@ -1589,9 +1520,9 @@ declare class Seamless {
|
|
|
1589
1520
|
private utils;
|
|
1590
1521
|
private account;
|
|
1591
1522
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1592
|
-
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<
|
|
1523
|
+
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
|
|
1593
1524
|
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
1594
|
-
token: string | ethers
|
|
1525
|
+
token: string | ethers.Addressable;
|
|
1595
1526
|
owner: string;
|
|
1596
1527
|
spender: string;
|
|
1597
1528
|
value: bigint;
|
|
@@ -1608,7 +1539,7 @@ declare class Seamless {
|
|
|
1608
1539
|
deadline: number;
|
|
1609
1540
|
data: string;
|
|
1610
1541
|
nonce: string;
|
|
1611
|
-
}, chainId: number, provider?: ethers
|
|
1542
|
+
}, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1612
1543
|
authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
|
|
1613
1544
|
approve: boolean;
|
|
1614
1545
|
seamlessAddress: string;
|
|
@@ -1630,7 +1561,7 @@ declare class Seamless {
|
|
|
1630
1561
|
data: {
|
|
1631
1562
|
masterAddress: string;
|
|
1632
1563
|
seamlessAccount: string;
|
|
1633
|
-
authorized:
|
|
1564
|
+
authorized: any;
|
|
1634
1565
|
};
|
|
1635
1566
|
}>;
|
|
1636
1567
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1649,9 +1580,9 @@ declare class Seamless {
|
|
|
1649
1580
|
}): Promise<{
|
|
1650
1581
|
code: number;
|
|
1651
1582
|
data: {
|
|
1652
|
-
masterAddress:
|
|
1583
|
+
masterAddress: any;
|
|
1653
1584
|
seamlessAccount: string;
|
|
1654
|
-
authorized:
|
|
1585
|
+
authorized: any;
|
|
1655
1586
|
apiKey: string;
|
|
1656
1587
|
};
|
|
1657
1588
|
}>;
|
|
@@ -1671,7 +1602,7 @@ declare class Seamless {
|
|
|
1671
1602
|
data: {
|
|
1672
1603
|
masterAddress: string;
|
|
1673
1604
|
seamlessAccount: string;
|
|
1674
|
-
authorized:
|
|
1605
|
+
authorized: any;
|
|
1675
1606
|
apiKey: string;
|
|
1676
1607
|
};
|
|
1677
1608
|
message?: undefined;
|
|
@@ -1758,13 +1689,13 @@ declare class Order {
|
|
|
1758
1689
|
data: {
|
|
1759
1690
|
success: boolean;
|
|
1760
1691
|
orderId: string | null;
|
|
1761
|
-
transactionHash:
|
|
1762
|
-
blockNumber:
|
|
1763
|
-
gasUsed:
|
|
1692
|
+
transactionHash: any;
|
|
1693
|
+
blockNumber: any;
|
|
1694
|
+
gasUsed: any;
|
|
1764
1695
|
status: string;
|
|
1765
1696
|
confirmations: number;
|
|
1766
1697
|
timestamp: number;
|
|
1767
|
-
receipt:
|
|
1698
|
+
receipt: any;
|
|
1768
1699
|
};
|
|
1769
1700
|
} | {
|
|
1770
1701
|
code: number;
|
|
@@ -1786,13 +1717,13 @@ declare class Order {
|
|
|
1786
1717
|
code: number;
|
|
1787
1718
|
message: string;
|
|
1788
1719
|
data: string | null;
|
|
1789
|
-
transactionHash:
|
|
1790
|
-
blockNumber:
|
|
1791
|
-
gasUsed:
|
|
1720
|
+
transactionHash: any;
|
|
1721
|
+
blockNumber: any;
|
|
1722
|
+
gasUsed: any;
|
|
1792
1723
|
status: string;
|
|
1793
1724
|
confirmations: number;
|
|
1794
1725
|
timestamp: number;
|
|
1795
|
-
receipt:
|
|
1726
|
+
receipt: any;
|
|
1796
1727
|
} | {
|
|
1797
1728
|
code: number;
|
|
1798
1729
|
message: any;
|
|
@@ -1815,13 +1746,13 @@ declare class Order {
|
|
|
1815
1746
|
data: {
|
|
1816
1747
|
success: boolean;
|
|
1817
1748
|
orderId: string | null;
|
|
1818
|
-
transactionHash:
|
|
1819
|
-
blockNumber:
|
|
1820
|
-
gasUsed:
|
|
1749
|
+
transactionHash: any;
|
|
1750
|
+
blockNumber: any;
|
|
1751
|
+
gasUsed: any;
|
|
1821
1752
|
status: string;
|
|
1822
1753
|
confirmations: number;
|
|
1823
1754
|
timestamp: number;
|
|
1824
|
-
receipt:
|
|
1755
|
+
receipt: any;
|
|
1825
1756
|
};
|
|
1826
1757
|
} | {
|
|
1827
1758
|
code: number;
|
|
@@ -1838,13 +1769,13 @@ declare class Order {
|
|
|
1838
1769
|
data: {
|
|
1839
1770
|
success: boolean;
|
|
1840
1771
|
orderId: string | null;
|
|
1841
|
-
transactionHash:
|
|
1842
|
-
blockNumber:
|
|
1843
|
-
gasUsed:
|
|
1772
|
+
transactionHash: any;
|
|
1773
|
+
blockNumber: any;
|
|
1774
|
+
gasUsed: any;
|
|
1844
1775
|
status: string;
|
|
1845
1776
|
confirmations: number;
|
|
1846
1777
|
timestamp: number;
|
|
1847
|
-
receipt:
|
|
1778
|
+
receipt: any;
|
|
1848
1779
|
};
|
|
1849
1780
|
} | {
|
|
1850
1781
|
code: number;
|
|
@@ -1870,7 +1801,7 @@ declare class Order {
|
|
|
1870
1801
|
}>;
|
|
1871
1802
|
updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
|
|
1872
1803
|
code: number;
|
|
1873
|
-
data:
|
|
1804
|
+
data: any;
|
|
1874
1805
|
message: string;
|
|
1875
1806
|
} | {
|
|
1876
1807
|
code: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
1
|
+
import { AddressLike, Signer, ethers } from 'ethers';
|
|
3
2
|
export { formatUnits, parseUnits } from 'ethers';
|
|
4
3
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
4
|
import { WalletClient } from 'viem';
|
|
@@ -49,49 +48,49 @@ interface CancelTpSLParams {
|
|
|
49
48
|
orderId: string;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
51
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<any>;
|
|
53
52
|
|
|
54
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
55
|
-
declare const getMarketPools: (chainId: ChainId) => Promise<
|
|
53
|
+
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<any>;
|
|
54
|
+
declare const getMarketPools: (chainId: ChainId) => Promise<any>;
|
|
56
55
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
57
56
|
quotePool: {
|
|
58
|
-
poolToken:
|
|
59
|
-
exchangeRate:
|
|
60
|
-
poolTokenPrice:
|
|
61
|
-
poolTokenSupply:
|
|
57
|
+
poolToken: any;
|
|
58
|
+
exchangeRate: any;
|
|
59
|
+
poolTokenPrice: any;
|
|
60
|
+
poolTokenSupply: any;
|
|
62
61
|
};
|
|
63
62
|
basePool: {
|
|
64
|
-
poolToken:
|
|
65
|
-
exchangeRate:
|
|
66
|
-
poolTokenPrice:
|
|
67
|
-
poolTokenSupply:
|
|
63
|
+
poolToken: any;
|
|
64
|
+
exchangeRate: any;
|
|
65
|
+
poolTokenPrice: any;
|
|
66
|
+
poolTokenSupply: any;
|
|
68
67
|
};
|
|
69
68
|
reserveInfo: {
|
|
70
|
-
baseTotalAmount:
|
|
71
|
-
baseReservedAmount:
|
|
72
|
-
quoteTotalAmount:
|
|
73
|
-
quoteReservedAmount:
|
|
69
|
+
baseTotalAmount: any;
|
|
70
|
+
baseReservedAmount: any;
|
|
71
|
+
quoteTotalAmount: any;
|
|
72
|
+
quoteReservedAmount: any;
|
|
74
73
|
};
|
|
75
74
|
fundingInfo: {
|
|
76
|
-
nextFundingRate:
|
|
77
|
-
lastFundingFeeTracker:
|
|
78
|
-
nextEpochTime:
|
|
75
|
+
nextFundingRate: any;
|
|
76
|
+
lastFundingFeeTracker: any;
|
|
77
|
+
nextEpochTime: any;
|
|
79
78
|
};
|
|
80
79
|
ioTracker: {
|
|
81
|
-
tracker:
|
|
82
|
-
longSize:
|
|
83
|
-
shortSize:
|
|
84
|
-
poolEntryPrice:
|
|
80
|
+
tracker: any;
|
|
81
|
+
longSize: any;
|
|
82
|
+
shortSize: any;
|
|
83
|
+
poolEntryPrice: any;
|
|
85
84
|
};
|
|
86
85
|
}>;
|
|
87
86
|
|
|
88
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
87
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
|
|
89
88
|
|
|
90
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
89
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
|
|
91
90
|
|
|
92
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
91
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
|
|
93
92
|
|
|
94
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
93
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
96
|
* Trading related types and enums
|
|
@@ -888,21 +887,21 @@ interface PreviewWithdrawDataParams {
|
|
|
888
887
|
amount: string | number;
|
|
889
888
|
}
|
|
890
889
|
|
|
891
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
892
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
890
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
891
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
|
|
893
892
|
|
|
894
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
893
|
+
declare const deposit$1: (params: Deposit) => Promise<any>;
|
|
895
894
|
|
|
896
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
895
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
|
|
897
896
|
|
|
898
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
897
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<any>;
|
|
899
898
|
|
|
900
899
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
901
|
-
baseAmountOut:
|
|
902
|
-
rebateAmount:
|
|
900
|
+
baseAmountOut: any;
|
|
901
|
+
rebateAmount: any;
|
|
903
902
|
} | undefined>;
|
|
904
903
|
|
|
905
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
904
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
906
905
|
|
|
907
906
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
908
907
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -911,18 +910,18 @@ declare namespace index$2 {
|
|
|
911
910
|
export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw };
|
|
912
911
|
}
|
|
913
912
|
|
|
914
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
913
|
+
declare const deposit: (params: Deposit) => Promise<any>;
|
|
915
914
|
|
|
916
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
915
|
+
declare const withdraw: (params: WithdrawParams) => Promise<any>;
|
|
917
916
|
|
|
918
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
917
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
|
|
919
918
|
|
|
920
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
919
|
+
declare const getRewards: (params: RewardsParams) => Promise<any>;
|
|
921
920
|
|
|
922
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
923
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
921
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
922
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
|
|
924
923
|
|
|
925
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
924
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
926
925
|
|
|
927
926
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
928
927
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -935,16 +934,9 @@ declare namespace index$1 {
|
|
|
935
934
|
export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw };
|
|
936
935
|
}
|
|
937
936
|
|
|
938
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
939
|
-
quoteToken: string;
|
|
940
|
-
baseReserveRatio: bigint;
|
|
941
|
-
quoteReserveRatio: bigint;
|
|
942
|
-
oracleFeeUsd: bigint;
|
|
943
|
-
oracleRefundFeeUsd: bigint;
|
|
944
|
-
poolPrimeThreshold: bigint;
|
|
945
|
-
}) | undefined>;
|
|
937
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
946
938
|
|
|
947
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
939
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
948
940
|
|
|
949
941
|
declare const index_getMarket: typeof getMarket;
|
|
950
942
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -987,9 +979,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
987
979
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
988
980
|
balance?: number | undefined;
|
|
989
981
|
address: string;
|
|
990
|
-
name:
|
|
991
|
-
symbol:
|
|
992
|
-
decimals:
|
|
982
|
+
name: any;
|
|
983
|
+
symbol: any;
|
|
984
|
+
decimals: any;
|
|
993
985
|
icon: string;
|
|
994
986
|
totalSupply: number;
|
|
995
987
|
}>;
|
|
@@ -1203,7 +1195,7 @@ interface MyxClientConfig {
|
|
|
1203
1195
|
signer?: Signer;
|
|
1204
1196
|
seamlessAccount?: {
|
|
1205
1197
|
masterAddress: string;
|
|
1206
|
-
wallet: ethers
|
|
1198
|
+
wallet: ethers.Wallet | null;
|
|
1207
1199
|
authorized: boolean;
|
|
1208
1200
|
};
|
|
1209
1201
|
walletClient?: WalletClient;
|
|
@@ -1223,7 +1215,7 @@ declare class ConfigManager {
|
|
|
1223
1215
|
clear(): void;
|
|
1224
1216
|
startSeamlessMode(open: boolean): MyxClientConfig;
|
|
1225
1217
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1226
|
-
wallet?: ethers
|
|
1218
|
+
wallet?: ethers.Wallet;
|
|
1227
1219
|
authorized?: boolean;
|
|
1228
1220
|
masterAddress?: string;
|
|
1229
1221
|
}): void;
|
|
@@ -1331,7 +1323,7 @@ declare class Utils {
|
|
|
1331
1323
|
quoteAddress: string;
|
|
1332
1324
|
amount?: string;
|
|
1333
1325
|
spenderAddress?: string;
|
|
1334
|
-
signer?: ethers
|
|
1326
|
+
signer?: ethers.Signer;
|
|
1335
1327
|
}): Promise<{
|
|
1336
1328
|
code: number;
|
|
1337
1329
|
message: any;
|
|
@@ -1374,68 +1366,7 @@ declare class Utils {
|
|
|
1374
1366
|
marketPrice: string;
|
|
1375
1367
|
}): Promise<{
|
|
1376
1368
|
code: number;
|
|
1377
|
-
data:
|
|
1378
|
-
poolToken: string;
|
|
1379
|
-
exchangeRate: bigint;
|
|
1380
|
-
poolTokenPrice: bigint;
|
|
1381
|
-
poolTokenSupply: bigint;
|
|
1382
|
-
}, [string, bigint, bigint, bigint] & {
|
|
1383
|
-
poolToken: string;
|
|
1384
|
-
exchangeRate: bigint;
|
|
1385
|
-
poolTokenPrice: bigint;
|
|
1386
|
-
poolTokenSupply: bigint;
|
|
1387
|
-
}, [bigint, bigint, bigint, bigint] & {
|
|
1388
|
-
baseTotalAmount: bigint;
|
|
1389
|
-
baseReservedAmount: bigint;
|
|
1390
|
-
quoteTotalAmount: bigint;
|
|
1391
|
-
quoteReservedAmount: bigint;
|
|
1392
|
-
}, [bigint, bigint, bigint] & {
|
|
1393
|
-
nextFundingRate: bigint;
|
|
1394
|
-
lastFundingFeeTracker: bigint;
|
|
1395
|
-
nextEpochTime: bigint;
|
|
1396
|
-
}, [bigint, bigint, bigint, bigint] & {
|
|
1397
|
-
tracker: bigint;
|
|
1398
|
-
longSize: bigint;
|
|
1399
|
-
shortSize: bigint;
|
|
1400
|
-
poolEntryPrice: bigint;
|
|
1401
|
-
}, [bigint, bigint] & {
|
|
1402
|
-
windowCaps: bigint;
|
|
1403
|
-
openInterest: bigint;
|
|
1404
|
-
}] & {
|
|
1405
|
-
basePool: [string, bigint, bigint, bigint] & {
|
|
1406
|
-
poolToken: string;
|
|
1407
|
-
exchangeRate: bigint;
|
|
1408
|
-
poolTokenPrice: bigint;
|
|
1409
|
-
poolTokenSupply: bigint;
|
|
1410
|
-
};
|
|
1411
|
-
quotePool: [string, bigint, bigint, bigint] & {
|
|
1412
|
-
poolToken: string;
|
|
1413
|
-
exchangeRate: bigint;
|
|
1414
|
-
poolTokenPrice: bigint;
|
|
1415
|
-
poolTokenSupply: bigint;
|
|
1416
|
-
};
|
|
1417
|
-
reserveInfo: [bigint, bigint, bigint, bigint] & {
|
|
1418
|
-
baseTotalAmount: bigint;
|
|
1419
|
-
baseReservedAmount: bigint;
|
|
1420
|
-
quoteTotalAmount: bigint;
|
|
1421
|
-
quoteReservedAmount: bigint;
|
|
1422
|
-
};
|
|
1423
|
-
fundingInfo: [bigint, bigint, bigint] & {
|
|
1424
|
-
nextFundingRate: bigint;
|
|
1425
|
-
lastFundingFeeTracker: bigint;
|
|
1426
|
-
nextEpochTime: bigint;
|
|
1427
|
-
};
|
|
1428
|
-
oi: [bigint, bigint, bigint, bigint] & {
|
|
1429
|
-
tracker: bigint;
|
|
1430
|
-
longSize: bigint;
|
|
1431
|
-
shortSize: bigint;
|
|
1432
|
-
poolEntryPrice: bigint;
|
|
1433
|
-
};
|
|
1434
|
-
liquidityInfo: [bigint, bigint] & {
|
|
1435
|
-
windowCaps: bigint;
|
|
1436
|
-
openInterest: bigint;
|
|
1437
|
-
};
|
|
1438
|
-
};
|
|
1369
|
+
data: any;
|
|
1439
1370
|
message?: undefined;
|
|
1440
1371
|
} | {
|
|
1441
1372
|
code: number;
|
|
@@ -1589,9 +1520,9 @@ declare class Seamless {
|
|
|
1589
1520
|
private utils;
|
|
1590
1521
|
private account;
|
|
1591
1522
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1592
|
-
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<
|
|
1523
|
+
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
|
|
1593
1524
|
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
1594
|
-
token: string | ethers
|
|
1525
|
+
token: string | ethers.Addressable;
|
|
1595
1526
|
owner: string;
|
|
1596
1527
|
spender: string;
|
|
1597
1528
|
value: bigint;
|
|
@@ -1608,7 +1539,7 @@ declare class Seamless {
|
|
|
1608
1539
|
deadline: number;
|
|
1609
1540
|
data: string;
|
|
1610
1541
|
nonce: string;
|
|
1611
|
-
}, chainId: number, provider?: ethers
|
|
1542
|
+
}, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1612
1543
|
authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
|
|
1613
1544
|
approve: boolean;
|
|
1614
1545
|
seamlessAddress: string;
|
|
@@ -1630,7 +1561,7 @@ declare class Seamless {
|
|
|
1630
1561
|
data: {
|
|
1631
1562
|
masterAddress: string;
|
|
1632
1563
|
seamlessAccount: string;
|
|
1633
|
-
authorized:
|
|
1564
|
+
authorized: any;
|
|
1634
1565
|
};
|
|
1635
1566
|
}>;
|
|
1636
1567
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1649,9 +1580,9 @@ declare class Seamless {
|
|
|
1649
1580
|
}): Promise<{
|
|
1650
1581
|
code: number;
|
|
1651
1582
|
data: {
|
|
1652
|
-
masterAddress:
|
|
1583
|
+
masterAddress: any;
|
|
1653
1584
|
seamlessAccount: string;
|
|
1654
|
-
authorized:
|
|
1585
|
+
authorized: any;
|
|
1655
1586
|
apiKey: string;
|
|
1656
1587
|
};
|
|
1657
1588
|
}>;
|
|
@@ -1671,7 +1602,7 @@ declare class Seamless {
|
|
|
1671
1602
|
data: {
|
|
1672
1603
|
masterAddress: string;
|
|
1673
1604
|
seamlessAccount: string;
|
|
1674
|
-
authorized:
|
|
1605
|
+
authorized: any;
|
|
1675
1606
|
apiKey: string;
|
|
1676
1607
|
};
|
|
1677
1608
|
message?: undefined;
|
|
@@ -1758,13 +1689,13 @@ declare class Order {
|
|
|
1758
1689
|
data: {
|
|
1759
1690
|
success: boolean;
|
|
1760
1691
|
orderId: string | null;
|
|
1761
|
-
transactionHash:
|
|
1762
|
-
blockNumber:
|
|
1763
|
-
gasUsed:
|
|
1692
|
+
transactionHash: any;
|
|
1693
|
+
blockNumber: any;
|
|
1694
|
+
gasUsed: any;
|
|
1764
1695
|
status: string;
|
|
1765
1696
|
confirmations: number;
|
|
1766
1697
|
timestamp: number;
|
|
1767
|
-
receipt:
|
|
1698
|
+
receipt: any;
|
|
1768
1699
|
};
|
|
1769
1700
|
} | {
|
|
1770
1701
|
code: number;
|
|
@@ -1786,13 +1717,13 @@ declare class Order {
|
|
|
1786
1717
|
code: number;
|
|
1787
1718
|
message: string;
|
|
1788
1719
|
data: string | null;
|
|
1789
|
-
transactionHash:
|
|
1790
|
-
blockNumber:
|
|
1791
|
-
gasUsed:
|
|
1720
|
+
transactionHash: any;
|
|
1721
|
+
blockNumber: any;
|
|
1722
|
+
gasUsed: any;
|
|
1792
1723
|
status: string;
|
|
1793
1724
|
confirmations: number;
|
|
1794
1725
|
timestamp: number;
|
|
1795
|
-
receipt:
|
|
1726
|
+
receipt: any;
|
|
1796
1727
|
} | {
|
|
1797
1728
|
code: number;
|
|
1798
1729
|
message: any;
|
|
@@ -1815,13 +1746,13 @@ declare class Order {
|
|
|
1815
1746
|
data: {
|
|
1816
1747
|
success: boolean;
|
|
1817
1748
|
orderId: string | null;
|
|
1818
|
-
transactionHash:
|
|
1819
|
-
blockNumber:
|
|
1820
|
-
gasUsed:
|
|
1749
|
+
transactionHash: any;
|
|
1750
|
+
blockNumber: any;
|
|
1751
|
+
gasUsed: any;
|
|
1821
1752
|
status: string;
|
|
1822
1753
|
confirmations: number;
|
|
1823
1754
|
timestamp: number;
|
|
1824
|
-
receipt:
|
|
1755
|
+
receipt: any;
|
|
1825
1756
|
};
|
|
1826
1757
|
} | {
|
|
1827
1758
|
code: number;
|
|
@@ -1838,13 +1769,13 @@ declare class Order {
|
|
|
1838
1769
|
data: {
|
|
1839
1770
|
success: boolean;
|
|
1840
1771
|
orderId: string | null;
|
|
1841
|
-
transactionHash:
|
|
1842
|
-
blockNumber:
|
|
1843
|
-
gasUsed:
|
|
1772
|
+
transactionHash: any;
|
|
1773
|
+
blockNumber: any;
|
|
1774
|
+
gasUsed: any;
|
|
1844
1775
|
status: string;
|
|
1845
1776
|
confirmations: number;
|
|
1846
1777
|
timestamp: number;
|
|
1847
|
-
receipt:
|
|
1778
|
+
receipt: any;
|
|
1848
1779
|
};
|
|
1849
1780
|
} | {
|
|
1850
1781
|
code: number;
|
|
@@ -1870,7 +1801,7 @@ declare class Order {
|
|
|
1870
1801
|
}>;
|
|
1871
1802
|
updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
|
|
1872
1803
|
code: number;
|
|
1873
|
-
data:
|
|
1804
|
+
data: any;
|
|
1874
1805
|
message: string;
|
|
1875
1806
|
} | {
|
|
1876
1807
|
code: number;
|
package/dist/index.js
CHANGED
|
@@ -1821,7 +1821,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1821
1821
|
// package.json
|
|
1822
1822
|
var package_default = {
|
|
1823
1823
|
name: "@myx-trade/sdk",
|
|
1824
|
-
version: "0.1.
|
|
1824
|
+
version: "0.1.156",
|
|
1825
1825
|
private: false,
|
|
1826
1826
|
publishConfig: {
|
|
1827
1827
|
access: "public"
|
|
@@ -14372,14 +14372,21 @@ var Order = class {
|
|
|
14372
14372
|
params.executionFeeToken,
|
|
14373
14373
|
params.collateralAmount
|
|
14374
14374
|
);
|
|
14375
|
-
const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
|
|
14376
14375
|
const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId: params.poolId, chainId: params.chainId, address: params.address });
|
|
14376
|
+
const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
|
|
14377
|
+
this.logger.info("availableAccountMarginBalance-->", availableAccountMarginBalance.toString());
|
|
14378
|
+
this.logger.info("totalCollateralAmount-->", totalCollateralAmount.toString());
|
|
14379
|
+
this.logger.info("totalNetWorkFee-->", totalNetWorkFee.toString());
|
|
14377
14380
|
const needAmount = BigInt(tradingFee) + BigInt(params.collateralAmount) + totalNetWorkFee;
|
|
14381
|
+
this.logger.info("needAmount-->", needAmount.toString());
|
|
14378
14382
|
let depositAmount = BigInt(0);
|
|
14383
|
+
this.logger.info("availableAccountMarginBalance-->", availableAccountMarginBalance.toString());
|
|
14379
14384
|
const diff = needAmount - availableAccountMarginBalance;
|
|
14385
|
+
this.logger.info("diff-->", diff.toString());
|
|
14380
14386
|
if (diff > BigInt(0)) {
|
|
14381
14387
|
depositAmount = diff;
|
|
14382
14388
|
}
|
|
14389
|
+
this.logger.info("depositAmount-->", depositAmount.toString());
|
|
14383
14390
|
const depositData = {
|
|
14384
14391
|
token: params.executionFeeToken,
|
|
14385
14392
|
amount: depositAmount.toString()
|
package/dist/index.mjs
CHANGED
|
@@ -1731,7 +1731,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1731
1731
|
// package.json
|
|
1732
1732
|
var package_default = {
|
|
1733
1733
|
name: "@myx-trade/sdk",
|
|
1734
|
-
version: "0.1.
|
|
1734
|
+
version: "0.1.156",
|
|
1735
1735
|
private: false,
|
|
1736
1736
|
publishConfig: {
|
|
1737
1737
|
access: "public"
|
|
@@ -14282,14 +14282,21 @@ var Order = class {
|
|
|
14282
14282
|
params.executionFeeToken,
|
|
14283
14283
|
params.collateralAmount
|
|
14284
14284
|
);
|
|
14285
|
-
const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
|
|
14286
14285
|
const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId: params.poolId, chainId: params.chainId, address: params.address });
|
|
14286
|
+
const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
|
|
14287
|
+
this.logger.info("availableAccountMarginBalance-->", availableAccountMarginBalance.toString());
|
|
14288
|
+
this.logger.info("totalCollateralAmount-->", totalCollateralAmount.toString());
|
|
14289
|
+
this.logger.info("totalNetWorkFee-->", totalNetWorkFee.toString());
|
|
14287
14290
|
const needAmount = BigInt(tradingFee) + BigInt(params.collateralAmount) + totalNetWorkFee;
|
|
14291
|
+
this.logger.info("needAmount-->", needAmount.toString());
|
|
14288
14292
|
let depositAmount = BigInt(0);
|
|
14293
|
+
this.logger.info("availableAccountMarginBalance-->", availableAccountMarginBalance.toString());
|
|
14289
14294
|
const diff = needAmount - availableAccountMarginBalance;
|
|
14295
|
+
this.logger.info("diff-->", diff.toString());
|
|
14290
14296
|
if (diff > BigInt(0)) {
|
|
14291
14297
|
depositAmount = diff;
|
|
14292
14298
|
}
|
|
14299
|
+
this.logger.info("depositAmount-->", depositAmount.toString());
|
|
14293
14300
|
const depositData = {
|
|
14294
14301
|
token: params.executionFeeToken,
|
|
14295
14302
|
amount: depositAmount.toString()
|