@myx-trade/sdk 0.1.178 → 0.1.182
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 +166 -81
- package/dist/index.d.ts +166 -81
- package/dist/index.js +16 -2
- package/dist/index.mjs +15 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ethers from 'ethers';
|
|
2
|
+
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
2
3
|
export { formatUnits, parseUnits } from 'ethers';
|
|
3
4
|
import { Options, Event } from 'reconnecting-websocket';
|
|
4
5
|
import { WalletClient } from 'viem';
|
|
@@ -48,49 +49,49 @@ interface CancelTpSLParams {
|
|
|
48
49
|
orderId: string;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
52
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
|
|
52
53
|
|
|
53
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
54
|
-
declare const getMarketPools: (chainId: ChainId) => Promise<
|
|
54
|
+
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<string | undefined>;
|
|
55
|
+
declare const getMarketPools: (chainId: ChainId) => Promise<string[]>;
|
|
55
56
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
56
57
|
quotePool: {
|
|
57
|
-
poolToken:
|
|
58
|
-
exchangeRate:
|
|
59
|
-
poolTokenPrice:
|
|
60
|
-
poolTokenSupply:
|
|
58
|
+
poolToken: string;
|
|
59
|
+
exchangeRate: bigint;
|
|
60
|
+
poolTokenPrice: bigint;
|
|
61
|
+
poolTokenSupply: bigint;
|
|
61
62
|
};
|
|
62
63
|
basePool: {
|
|
63
|
-
poolToken:
|
|
64
|
-
exchangeRate:
|
|
65
|
-
poolTokenPrice:
|
|
66
|
-
poolTokenSupply:
|
|
64
|
+
poolToken: string;
|
|
65
|
+
exchangeRate: bigint;
|
|
66
|
+
poolTokenPrice: bigint;
|
|
67
|
+
poolTokenSupply: bigint;
|
|
67
68
|
};
|
|
68
69
|
reserveInfo: {
|
|
69
|
-
baseTotalAmount:
|
|
70
|
-
baseReservedAmount:
|
|
71
|
-
quoteTotalAmount:
|
|
72
|
-
quoteReservedAmount:
|
|
70
|
+
baseTotalAmount: bigint;
|
|
71
|
+
baseReservedAmount: bigint;
|
|
72
|
+
quoteTotalAmount: bigint;
|
|
73
|
+
quoteReservedAmount: bigint;
|
|
73
74
|
};
|
|
74
75
|
fundingInfo: {
|
|
75
|
-
nextFundingRate:
|
|
76
|
-
lastFundingFeeTracker:
|
|
77
|
-
nextEpochTime:
|
|
76
|
+
nextFundingRate: bigint;
|
|
77
|
+
lastFundingFeeTracker: bigint;
|
|
78
|
+
nextEpochTime: bigint;
|
|
78
79
|
};
|
|
79
80
|
ioTracker: {
|
|
80
|
-
tracker:
|
|
81
|
-
longSize:
|
|
82
|
-
shortSize:
|
|
83
|
-
poolEntryPrice:
|
|
81
|
+
tracker: bigint;
|
|
82
|
+
longSize: bigint;
|
|
83
|
+
shortSize: bigint;
|
|
84
|
+
poolEntryPrice: bigint;
|
|
84
85
|
};
|
|
85
86
|
}>;
|
|
86
87
|
|
|
87
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
88
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
|
|
88
89
|
|
|
89
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
90
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
90
91
|
|
|
91
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
92
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
92
93
|
|
|
93
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
94
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
97
|
* Trading related types and enums
|
|
@@ -581,7 +582,13 @@ declare enum TradeFlowTypeEnum {
|
|
|
581
582
|
ADL = 5,
|
|
582
583
|
Liquidation = 6,
|
|
583
584
|
MarketClose = 7,
|
|
584
|
-
EarlyClose = 8
|
|
585
|
+
EarlyClose = 8,
|
|
586
|
+
AddTPSL = 9,
|
|
587
|
+
SecurityDeposit = 10,
|
|
588
|
+
TransferToWallet = 11,
|
|
589
|
+
MarginAccountDeposit = 12,
|
|
590
|
+
ReferralReward = 13,
|
|
591
|
+
ReferralRewardClaim = 14
|
|
585
592
|
}
|
|
586
593
|
declare enum TriggerTypeEnum {
|
|
587
594
|
Unknown = 0,
|
|
@@ -679,22 +686,32 @@ declare const getPositionHistory: ({ accessToken, address, ...params }: GetHisto
|
|
|
679
686
|
/**
|
|
680
687
|
* Get Trade Flow
|
|
681
688
|
*/
|
|
689
|
+
declare enum TradeFlowAccountTypeEnum {
|
|
690
|
+
MarginAccount = 1,
|
|
691
|
+
WalletAccount = 2,
|
|
692
|
+
ReferralReward = 3
|
|
693
|
+
}
|
|
682
694
|
interface TradeFlowItem {
|
|
683
695
|
chainId: number;
|
|
684
696
|
orderId: number;
|
|
685
697
|
user: Address;
|
|
686
698
|
poolId: string;
|
|
687
|
-
realizedPnl: string;
|
|
688
699
|
fundingFee: string;
|
|
689
700
|
tradingFee: string;
|
|
690
701
|
charge: string;
|
|
691
702
|
collateralAmount: string;
|
|
692
703
|
txHash: string;
|
|
693
704
|
txTime: number;
|
|
694
|
-
baseSymbol: string;
|
|
695
|
-
quoteSymbol: string;
|
|
696
|
-
executionFee: string;
|
|
697
705
|
type: TradeFlowTypeEnum;
|
|
706
|
+
accountType: TradeFlowAccountTypeEnum;
|
|
707
|
+
executionFee: string;
|
|
708
|
+
seamlessFee: string;
|
|
709
|
+
seamlessFeeSymbol: string;
|
|
710
|
+
basePnl: string;
|
|
711
|
+
quotePnl: string;
|
|
712
|
+
referrerRebate: string;
|
|
713
|
+
referralRebate: string;
|
|
714
|
+
rebateClaimedAmount: string;
|
|
698
715
|
}
|
|
699
716
|
declare const getTradeFlow: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
|
|
700
717
|
|
|
@@ -899,21 +916,21 @@ interface PreviewWithdrawDataParams {
|
|
|
899
916
|
amount: string | number;
|
|
900
917
|
}
|
|
901
918
|
|
|
902
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
903
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
919
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
920
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
904
921
|
|
|
905
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
922
|
+
declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
906
923
|
|
|
907
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
924
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
908
925
|
|
|
909
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
926
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
910
927
|
|
|
911
928
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
912
|
-
baseAmountOut:
|
|
913
|
-
rebateAmount:
|
|
929
|
+
baseAmountOut: bigint;
|
|
930
|
+
rebateAmount: bigint;
|
|
914
931
|
} | undefined>;
|
|
915
932
|
|
|
916
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
933
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
917
934
|
|
|
918
935
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
919
936
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -922,18 +939,18 @@ declare namespace index$2 {
|
|
|
922
939
|
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 };
|
|
923
940
|
}
|
|
924
941
|
|
|
925
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
942
|
+
declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
926
943
|
|
|
927
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
944
|
+
declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
928
945
|
|
|
929
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
946
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
|
|
930
947
|
|
|
931
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
948
|
+
declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
932
949
|
|
|
933
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
934
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
950
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
951
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
935
952
|
|
|
936
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
953
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
937
954
|
|
|
938
955
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
939
956
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -946,9 +963,16 @@ declare namespace index$1 {
|
|
|
946
963
|
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 };
|
|
947
964
|
}
|
|
948
965
|
|
|
949
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
966
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
|
|
967
|
+
quoteToken: string;
|
|
968
|
+
baseReserveRatio: bigint;
|
|
969
|
+
quoteReserveRatio: bigint;
|
|
970
|
+
oracleFeeUsd: bigint;
|
|
971
|
+
oracleRefundFeeUsd: bigint;
|
|
972
|
+
poolPrimeThreshold: bigint;
|
|
973
|
+
}) | undefined>;
|
|
950
974
|
|
|
951
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
975
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
|
|
952
976
|
|
|
953
977
|
declare const index_getMarket: typeof getMarket;
|
|
954
978
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -991,9 +1015,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
991
1015
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
992
1016
|
balance?: number | undefined;
|
|
993
1017
|
address: string;
|
|
994
|
-
name:
|
|
995
|
-
symbol:
|
|
996
|
-
decimals:
|
|
1018
|
+
name: string;
|
|
1019
|
+
symbol: string;
|
|
1020
|
+
decimals: bigint;
|
|
997
1021
|
icon: string;
|
|
998
1022
|
totalSupply: number;
|
|
999
1023
|
}>;
|
|
@@ -1207,7 +1231,7 @@ interface MyxClientConfig {
|
|
|
1207
1231
|
signer?: Signer;
|
|
1208
1232
|
seamlessAccount?: {
|
|
1209
1233
|
masterAddress: string;
|
|
1210
|
-
wallet: ethers.Wallet | null;
|
|
1234
|
+
wallet: ethers$1.Wallet | null;
|
|
1211
1235
|
authorized: boolean;
|
|
1212
1236
|
};
|
|
1213
1237
|
walletClient?: WalletClient;
|
|
@@ -1227,7 +1251,7 @@ declare class ConfigManager {
|
|
|
1227
1251
|
clear(): void;
|
|
1228
1252
|
startSeamlessMode(open: boolean): MyxClientConfig;
|
|
1229
1253
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1230
|
-
wallet?: ethers.Wallet;
|
|
1254
|
+
wallet?: ethers$1.Wallet;
|
|
1231
1255
|
authorized?: boolean;
|
|
1232
1256
|
masterAddress?: string;
|
|
1233
1257
|
}): void;
|
|
@@ -1335,7 +1359,7 @@ declare class Utils {
|
|
|
1335
1359
|
quoteAddress: string;
|
|
1336
1360
|
amount?: string;
|
|
1337
1361
|
spenderAddress?: string;
|
|
1338
|
-
signer?: ethers.Signer;
|
|
1362
|
+
signer?: ethers$1.Signer;
|
|
1339
1363
|
}): Promise<{
|
|
1340
1364
|
code: number;
|
|
1341
1365
|
message: any;
|
|
@@ -1378,7 +1402,68 @@ declare class Utils {
|
|
|
1378
1402
|
marketPrice: string;
|
|
1379
1403
|
}): Promise<{
|
|
1380
1404
|
code: number;
|
|
1381
|
-
data:
|
|
1405
|
+
data: [[string, bigint, bigint, bigint] & {
|
|
1406
|
+
poolToken: string;
|
|
1407
|
+
exchangeRate: bigint;
|
|
1408
|
+
poolTokenPrice: bigint;
|
|
1409
|
+
poolTokenSupply: bigint;
|
|
1410
|
+
}, [string, bigint, bigint, bigint] & {
|
|
1411
|
+
poolToken: string;
|
|
1412
|
+
exchangeRate: bigint;
|
|
1413
|
+
poolTokenPrice: bigint;
|
|
1414
|
+
poolTokenSupply: bigint;
|
|
1415
|
+
}, [bigint, bigint, bigint, bigint] & {
|
|
1416
|
+
baseTotalAmount: bigint;
|
|
1417
|
+
baseReservedAmount: bigint;
|
|
1418
|
+
quoteTotalAmount: bigint;
|
|
1419
|
+
quoteReservedAmount: bigint;
|
|
1420
|
+
}, [bigint, bigint, bigint] & {
|
|
1421
|
+
nextFundingRate: bigint;
|
|
1422
|
+
lastFundingFeeTracker: bigint;
|
|
1423
|
+
nextEpochTime: bigint;
|
|
1424
|
+
}, [bigint, bigint, bigint, bigint] & {
|
|
1425
|
+
tracker: bigint;
|
|
1426
|
+
longSize: bigint;
|
|
1427
|
+
shortSize: bigint;
|
|
1428
|
+
poolEntryPrice: bigint;
|
|
1429
|
+
}, [bigint, bigint] & {
|
|
1430
|
+
windowCaps: bigint;
|
|
1431
|
+
openInterest: bigint;
|
|
1432
|
+
}] & {
|
|
1433
|
+
basePool: [string, bigint, bigint, bigint] & {
|
|
1434
|
+
poolToken: string;
|
|
1435
|
+
exchangeRate: bigint;
|
|
1436
|
+
poolTokenPrice: bigint;
|
|
1437
|
+
poolTokenSupply: bigint;
|
|
1438
|
+
};
|
|
1439
|
+
quotePool: [string, bigint, bigint, bigint] & {
|
|
1440
|
+
poolToken: string;
|
|
1441
|
+
exchangeRate: bigint;
|
|
1442
|
+
poolTokenPrice: bigint;
|
|
1443
|
+
poolTokenSupply: bigint;
|
|
1444
|
+
};
|
|
1445
|
+
reserveInfo: [bigint, bigint, bigint, bigint] & {
|
|
1446
|
+
baseTotalAmount: bigint;
|
|
1447
|
+
baseReservedAmount: bigint;
|
|
1448
|
+
quoteTotalAmount: bigint;
|
|
1449
|
+
quoteReservedAmount: bigint;
|
|
1450
|
+
};
|
|
1451
|
+
fundingInfo: [bigint, bigint, bigint] & {
|
|
1452
|
+
nextFundingRate: bigint;
|
|
1453
|
+
lastFundingFeeTracker: bigint;
|
|
1454
|
+
nextEpochTime: bigint;
|
|
1455
|
+
};
|
|
1456
|
+
oi: [bigint, bigint, bigint, bigint] & {
|
|
1457
|
+
tracker: bigint;
|
|
1458
|
+
longSize: bigint;
|
|
1459
|
+
shortSize: bigint;
|
|
1460
|
+
poolEntryPrice: bigint;
|
|
1461
|
+
};
|
|
1462
|
+
liquidityInfo: [bigint, bigint] & {
|
|
1463
|
+
windowCaps: bigint;
|
|
1464
|
+
openInterest: bigint;
|
|
1465
|
+
};
|
|
1466
|
+
};
|
|
1382
1467
|
message?: undefined;
|
|
1383
1468
|
} | {
|
|
1384
1469
|
code: number;
|
|
@@ -1536,9 +1621,9 @@ declare class Seamless {
|
|
|
1536
1621
|
private utils;
|
|
1537
1622
|
private account;
|
|
1538
1623
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1539
|
-
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<
|
|
1624
|
+
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
|
|
1540
1625
|
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
1541
|
-
token: string | ethers.Addressable;
|
|
1626
|
+
token: string | ethers$1.Addressable;
|
|
1542
1627
|
owner: string;
|
|
1543
1628
|
spender: string;
|
|
1544
1629
|
value: bigint;
|
|
@@ -1555,7 +1640,7 @@ declare class Seamless {
|
|
|
1555
1640
|
deadline: number;
|
|
1556
1641
|
data: string;
|
|
1557
1642
|
nonce: string;
|
|
1558
|
-
}, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1643
|
+
}, chainId: number, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
|
|
1559
1644
|
authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
|
|
1560
1645
|
approve: boolean;
|
|
1561
1646
|
seamlessAddress: string;
|
|
@@ -1577,7 +1662,7 @@ declare class Seamless {
|
|
|
1577
1662
|
data: {
|
|
1578
1663
|
masterAddress: string;
|
|
1579
1664
|
seamlessAccount: string;
|
|
1580
|
-
authorized:
|
|
1665
|
+
authorized: boolean;
|
|
1581
1666
|
};
|
|
1582
1667
|
}>;
|
|
1583
1668
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1596,9 +1681,9 @@ declare class Seamless {
|
|
|
1596
1681
|
}): Promise<{
|
|
1597
1682
|
code: number;
|
|
1598
1683
|
data: {
|
|
1599
|
-
masterAddress:
|
|
1684
|
+
masterAddress: string;
|
|
1600
1685
|
seamlessAccount: string;
|
|
1601
|
-
authorized:
|
|
1686
|
+
authorized: boolean;
|
|
1602
1687
|
apiKey: string;
|
|
1603
1688
|
};
|
|
1604
1689
|
}>;
|
|
@@ -1618,7 +1703,7 @@ declare class Seamless {
|
|
|
1618
1703
|
data: {
|
|
1619
1704
|
masterAddress: string;
|
|
1620
1705
|
seamlessAccount: string;
|
|
1621
|
-
authorized:
|
|
1706
|
+
authorized: boolean;
|
|
1622
1707
|
apiKey: string;
|
|
1623
1708
|
};
|
|
1624
1709
|
message?: undefined;
|
|
@@ -1707,13 +1792,13 @@ declare class Order {
|
|
|
1707
1792
|
data: {
|
|
1708
1793
|
success: boolean;
|
|
1709
1794
|
orderId: string | null;
|
|
1710
|
-
transactionHash:
|
|
1711
|
-
blockNumber:
|
|
1712
|
-
gasUsed:
|
|
1795
|
+
transactionHash: string;
|
|
1796
|
+
blockNumber: number | undefined;
|
|
1797
|
+
gasUsed: string | undefined;
|
|
1713
1798
|
status: string;
|
|
1714
1799
|
confirmations: number;
|
|
1715
1800
|
timestamp: number;
|
|
1716
|
-
receipt:
|
|
1801
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1717
1802
|
};
|
|
1718
1803
|
} | {
|
|
1719
1804
|
code: number;
|
|
@@ -1735,13 +1820,13 @@ declare class Order {
|
|
|
1735
1820
|
code: number;
|
|
1736
1821
|
message: string;
|
|
1737
1822
|
data: string | null;
|
|
1738
|
-
transactionHash:
|
|
1739
|
-
blockNumber:
|
|
1740
|
-
gasUsed:
|
|
1823
|
+
transactionHash: string;
|
|
1824
|
+
blockNumber: number | undefined;
|
|
1825
|
+
gasUsed: string | undefined;
|
|
1741
1826
|
status: string;
|
|
1742
1827
|
confirmations: number;
|
|
1743
1828
|
timestamp: number;
|
|
1744
|
-
receipt:
|
|
1829
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1745
1830
|
} | {
|
|
1746
1831
|
code: number;
|
|
1747
1832
|
message: any;
|
|
@@ -1764,13 +1849,13 @@ declare class Order {
|
|
|
1764
1849
|
data: {
|
|
1765
1850
|
success: boolean;
|
|
1766
1851
|
orderId: string | null;
|
|
1767
|
-
transactionHash:
|
|
1768
|
-
blockNumber:
|
|
1769
|
-
gasUsed:
|
|
1852
|
+
transactionHash: string;
|
|
1853
|
+
blockNumber: number | undefined;
|
|
1854
|
+
gasUsed: string | undefined;
|
|
1770
1855
|
status: string;
|
|
1771
1856
|
confirmations: number;
|
|
1772
1857
|
timestamp: number;
|
|
1773
|
-
receipt:
|
|
1858
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1774
1859
|
};
|
|
1775
1860
|
} | {
|
|
1776
1861
|
code: number;
|
|
@@ -1787,13 +1872,13 @@ declare class Order {
|
|
|
1787
1872
|
data: {
|
|
1788
1873
|
success: boolean;
|
|
1789
1874
|
orderId: string | null;
|
|
1790
|
-
transactionHash:
|
|
1791
|
-
blockNumber:
|
|
1792
|
-
gasUsed:
|
|
1875
|
+
transactionHash: string;
|
|
1876
|
+
blockNumber: number | undefined;
|
|
1877
|
+
gasUsed: string | undefined;
|
|
1793
1878
|
status: string;
|
|
1794
1879
|
confirmations: number;
|
|
1795
1880
|
timestamp: number;
|
|
1796
|
-
receipt:
|
|
1881
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1797
1882
|
};
|
|
1798
1883
|
} | {
|
|
1799
1884
|
code: number;
|
|
@@ -1819,7 +1904,7 @@ declare class Order {
|
|
|
1819
1904
|
}>;
|
|
1820
1905
|
updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
|
|
1821
1906
|
code: number;
|
|
1822
|
-
data:
|
|
1907
|
+
data: ethers$1.ContractTransactionReceipt | null;
|
|
1823
1908
|
message: string;
|
|
1824
1909
|
} | {
|
|
1825
1910
|
code: number;
|
|
@@ -1877,4 +1962,4 @@ declare class MyxClient {
|
|
|
1877
1962
|
getAccessToken(): Promise<string | null>;
|
|
1878
1963
|
}
|
|
1879
1964
|
|
|
1880
|
-
export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address$1 as Address, type ApiResponse, type BaseDetailResponse, type BaseResponse, COMMON_LP_AMOUNT_DECIMALS, COMMON_PRICE_DECIMALS, ChainId, type ChainIdRequest, CloseTypeEnum, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type FetchForwarderGetParams, type FetchForwarderGetResponse, type FetchForwarderGetResponseData, ForwarderGetStatus, type ForwarderTxParams, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketPool, type MarketPoolResponse, MarketPoolState, MarketType, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, type NetWorkFee, type ObjectType, type OnKlineCallback, type OnOrderCallback, type OnPositionCallback, type OnTickersAllCallback, type OnTickersCallback, OperationEnum, OperationType, OracleType, type Order$1 as Order, OrderStatus, OrderStatusEnum, OrderType, OrderTypeEnum, type PlaceOrderParams, type PoolLevelConfig, type PoolOpenOrder, type PoolOpenOrdersResponse, type PoolResponse, type PoolSymbolAllResponse, type Position$1 as Position, type PositionHistoryItem, type PositionResponse, type PositionTpSlOrderParams, type PositionType, type PriceResponse, type PriceType, type RemoveFavoriteParams, type SearchMarketParams, type SearchResultContractItem, type SearchResultCookItem, type SearchResultEarnItem, type SearchResultResponse, SearchSecondTypeEnum, SearchTypeEnum, type StatDashBoardResponse, type TickerDataItem, type TickersDataResponse, TimeInForce, type TradeFlowItem, TradeFlowTypeEnum, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, addFavorite, approve, index$2 as base, baseUrl, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, fetchForwarderGetApi, forwardUrl, forwarderTxApi, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getFavoritesList, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getMarketList, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolList, getPoolOpenOrders, getPoolSymbolAll, getPositionHistory, getPositions, getPriceData, getPricesData, getTickerData, getTokenInfo, getTradeFlow, index as market, index$3 as pool, index$1 as quote, removeFavorite, searchMarket, searchMarketAuth };
|
|
1965
|
+
export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address$1 as Address, type ApiResponse, type BaseDetailResponse, type BaseResponse, COMMON_LP_AMOUNT_DECIMALS, COMMON_PRICE_DECIMALS, ChainId, type ChainIdRequest, CloseTypeEnum, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type FetchForwarderGetParams, type FetchForwarderGetResponse, type FetchForwarderGetResponseData, ForwarderGetStatus, type ForwarderTxParams, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketPool, type MarketPoolResponse, MarketPoolState, MarketType, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, type NetWorkFee, type ObjectType, type OnKlineCallback, type OnOrderCallback, type OnPositionCallback, type OnTickersAllCallback, type OnTickersCallback, OperationEnum, OperationType, OracleType, type Order$1 as Order, OrderStatus, OrderStatusEnum, OrderType, OrderTypeEnum, type PlaceOrderParams, type PoolLevelConfig, type PoolOpenOrder, type PoolOpenOrdersResponse, type PoolResponse, type PoolSymbolAllResponse, type Position$1 as Position, type PositionHistoryItem, type PositionResponse, type PositionTpSlOrderParams, type PositionType, type PriceResponse, type PriceType, type RemoveFavoriteParams, type SearchMarketParams, type SearchResultContractItem, type SearchResultCookItem, type SearchResultEarnItem, type SearchResultResponse, SearchSecondTypeEnum, SearchTypeEnum, type StatDashBoardResponse, type TickerDataItem, type TickersDataResponse, TimeInForce, TradeFlowAccountTypeEnum, type TradeFlowItem, TradeFlowTypeEnum, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, addFavorite, approve, index$2 as base, baseUrl, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, fetchForwarderGetApi, forwardUrl, forwarderTxApi, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getFavoritesList, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getMarketList, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolList, getPoolOpenOrders, getPoolSymbolAll, getPositionHistory, getPositions, getPriceData, getPricesData, getTickerData, getTokenInfo, getTradeFlow, index as market, index$3 as pool, index$1 as quote, removeFavorite, searchMarket, searchMarketAuth };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ethers from 'ethers';
|
|
2
|
+
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
2
3
|
export { formatUnits, parseUnits } from 'ethers';
|
|
3
4
|
import { Options, Event } from 'reconnecting-websocket';
|
|
4
5
|
import { WalletClient } from 'viem';
|
|
@@ -48,49 +49,49 @@ interface CancelTpSLParams {
|
|
|
48
49
|
orderId: string;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
52
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
|
|
52
53
|
|
|
53
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
54
|
-
declare const getMarketPools: (chainId: ChainId) => Promise<
|
|
54
|
+
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<string | undefined>;
|
|
55
|
+
declare const getMarketPools: (chainId: ChainId) => Promise<string[]>;
|
|
55
56
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
56
57
|
quotePool: {
|
|
57
|
-
poolToken:
|
|
58
|
-
exchangeRate:
|
|
59
|
-
poolTokenPrice:
|
|
60
|
-
poolTokenSupply:
|
|
58
|
+
poolToken: string;
|
|
59
|
+
exchangeRate: bigint;
|
|
60
|
+
poolTokenPrice: bigint;
|
|
61
|
+
poolTokenSupply: bigint;
|
|
61
62
|
};
|
|
62
63
|
basePool: {
|
|
63
|
-
poolToken:
|
|
64
|
-
exchangeRate:
|
|
65
|
-
poolTokenPrice:
|
|
66
|
-
poolTokenSupply:
|
|
64
|
+
poolToken: string;
|
|
65
|
+
exchangeRate: bigint;
|
|
66
|
+
poolTokenPrice: bigint;
|
|
67
|
+
poolTokenSupply: bigint;
|
|
67
68
|
};
|
|
68
69
|
reserveInfo: {
|
|
69
|
-
baseTotalAmount:
|
|
70
|
-
baseReservedAmount:
|
|
71
|
-
quoteTotalAmount:
|
|
72
|
-
quoteReservedAmount:
|
|
70
|
+
baseTotalAmount: bigint;
|
|
71
|
+
baseReservedAmount: bigint;
|
|
72
|
+
quoteTotalAmount: bigint;
|
|
73
|
+
quoteReservedAmount: bigint;
|
|
73
74
|
};
|
|
74
75
|
fundingInfo: {
|
|
75
|
-
nextFundingRate:
|
|
76
|
-
lastFundingFeeTracker:
|
|
77
|
-
nextEpochTime:
|
|
76
|
+
nextFundingRate: bigint;
|
|
77
|
+
lastFundingFeeTracker: bigint;
|
|
78
|
+
nextEpochTime: bigint;
|
|
78
79
|
};
|
|
79
80
|
ioTracker: {
|
|
80
|
-
tracker:
|
|
81
|
-
longSize:
|
|
82
|
-
shortSize:
|
|
83
|
-
poolEntryPrice:
|
|
81
|
+
tracker: bigint;
|
|
82
|
+
longSize: bigint;
|
|
83
|
+
shortSize: bigint;
|
|
84
|
+
poolEntryPrice: bigint;
|
|
84
85
|
};
|
|
85
86
|
}>;
|
|
86
87
|
|
|
87
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
88
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
|
|
88
89
|
|
|
89
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
90
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
90
91
|
|
|
91
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
92
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
92
93
|
|
|
93
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
94
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
97
|
* Trading related types and enums
|
|
@@ -581,7 +582,13 @@ declare enum TradeFlowTypeEnum {
|
|
|
581
582
|
ADL = 5,
|
|
582
583
|
Liquidation = 6,
|
|
583
584
|
MarketClose = 7,
|
|
584
|
-
EarlyClose = 8
|
|
585
|
+
EarlyClose = 8,
|
|
586
|
+
AddTPSL = 9,
|
|
587
|
+
SecurityDeposit = 10,
|
|
588
|
+
TransferToWallet = 11,
|
|
589
|
+
MarginAccountDeposit = 12,
|
|
590
|
+
ReferralReward = 13,
|
|
591
|
+
ReferralRewardClaim = 14
|
|
585
592
|
}
|
|
586
593
|
declare enum TriggerTypeEnum {
|
|
587
594
|
Unknown = 0,
|
|
@@ -679,22 +686,32 @@ declare const getPositionHistory: ({ accessToken, address, ...params }: GetHisto
|
|
|
679
686
|
/**
|
|
680
687
|
* Get Trade Flow
|
|
681
688
|
*/
|
|
689
|
+
declare enum TradeFlowAccountTypeEnum {
|
|
690
|
+
MarginAccount = 1,
|
|
691
|
+
WalletAccount = 2,
|
|
692
|
+
ReferralReward = 3
|
|
693
|
+
}
|
|
682
694
|
interface TradeFlowItem {
|
|
683
695
|
chainId: number;
|
|
684
696
|
orderId: number;
|
|
685
697
|
user: Address;
|
|
686
698
|
poolId: string;
|
|
687
|
-
realizedPnl: string;
|
|
688
699
|
fundingFee: string;
|
|
689
700
|
tradingFee: string;
|
|
690
701
|
charge: string;
|
|
691
702
|
collateralAmount: string;
|
|
692
703
|
txHash: string;
|
|
693
704
|
txTime: number;
|
|
694
|
-
baseSymbol: string;
|
|
695
|
-
quoteSymbol: string;
|
|
696
|
-
executionFee: string;
|
|
697
705
|
type: TradeFlowTypeEnum;
|
|
706
|
+
accountType: TradeFlowAccountTypeEnum;
|
|
707
|
+
executionFee: string;
|
|
708
|
+
seamlessFee: string;
|
|
709
|
+
seamlessFeeSymbol: string;
|
|
710
|
+
basePnl: string;
|
|
711
|
+
quotePnl: string;
|
|
712
|
+
referrerRebate: string;
|
|
713
|
+
referralRebate: string;
|
|
714
|
+
rebateClaimedAmount: string;
|
|
698
715
|
}
|
|
699
716
|
declare const getTradeFlow: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
|
|
700
717
|
|
|
@@ -899,21 +916,21 @@ interface PreviewWithdrawDataParams {
|
|
|
899
916
|
amount: string | number;
|
|
900
917
|
}
|
|
901
918
|
|
|
902
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
903
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
919
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
920
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
904
921
|
|
|
905
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
922
|
+
declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
906
923
|
|
|
907
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
924
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
908
925
|
|
|
909
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
926
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
910
927
|
|
|
911
928
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
912
|
-
baseAmountOut:
|
|
913
|
-
rebateAmount:
|
|
929
|
+
baseAmountOut: bigint;
|
|
930
|
+
rebateAmount: bigint;
|
|
914
931
|
} | undefined>;
|
|
915
932
|
|
|
916
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
933
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
917
934
|
|
|
918
935
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
919
936
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -922,18 +939,18 @@ declare namespace index$2 {
|
|
|
922
939
|
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 };
|
|
923
940
|
}
|
|
924
941
|
|
|
925
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
942
|
+
declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
926
943
|
|
|
927
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
944
|
+
declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
928
945
|
|
|
929
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
946
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
|
|
930
947
|
|
|
931
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
948
|
+
declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
932
949
|
|
|
933
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
934
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
950
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
951
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
935
952
|
|
|
936
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
953
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
937
954
|
|
|
938
955
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
939
956
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -946,9 +963,16 @@ declare namespace index$1 {
|
|
|
946
963
|
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 };
|
|
947
964
|
}
|
|
948
965
|
|
|
949
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
966
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
|
|
967
|
+
quoteToken: string;
|
|
968
|
+
baseReserveRatio: bigint;
|
|
969
|
+
quoteReserveRatio: bigint;
|
|
970
|
+
oracleFeeUsd: bigint;
|
|
971
|
+
oracleRefundFeeUsd: bigint;
|
|
972
|
+
poolPrimeThreshold: bigint;
|
|
973
|
+
}) | undefined>;
|
|
950
974
|
|
|
951
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
975
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
|
|
952
976
|
|
|
953
977
|
declare const index_getMarket: typeof getMarket;
|
|
954
978
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -991,9 +1015,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
991
1015
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
992
1016
|
balance?: number | undefined;
|
|
993
1017
|
address: string;
|
|
994
|
-
name:
|
|
995
|
-
symbol:
|
|
996
|
-
decimals:
|
|
1018
|
+
name: string;
|
|
1019
|
+
symbol: string;
|
|
1020
|
+
decimals: bigint;
|
|
997
1021
|
icon: string;
|
|
998
1022
|
totalSupply: number;
|
|
999
1023
|
}>;
|
|
@@ -1207,7 +1231,7 @@ interface MyxClientConfig {
|
|
|
1207
1231
|
signer?: Signer;
|
|
1208
1232
|
seamlessAccount?: {
|
|
1209
1233
|
masterAddress: string;
|
|
1210
|
-
wallet: ethers.Wallet | null;
|
|
1234
|
+
wallet: ethers$1.Wallet | null;
|
|
1211
1235
|
authorized: boolean;
|
|
1212
1236
|
};
|
|
1213
1237
|
walletClient?: WalletClient;
|
|
@@ -1227,7 +1251,7 @@ declare class ConfigManager {
|
|
|
1227
1251
|
clear(): void;
|
|
1228
1252
|
startSeamlessMode(open: boolean): MyxClientConfig;
|
|
1229
1253
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1230
|
-
wallet?: ethers.Wallet;
|
|
1254
|
+
wallet?: ethers$1.Wallet;
|
|
1231
1255
|
authorized?: boolean;
|
|
1232
1256
|
masterAddress?: string;
|
|
1233
1257
|
}): void;
|
|
@@ -1335,7 +1359,7 @@ declare class Utils {
|
|
|
1335
1359
|
quoteAddress: string;
|
|
1336
1360
|
amount?: string;
|
|
1337
1361
|
spenderAddress?: string;
|
|
1338
|
-
signer?: ethers.Signer;
|
|
1362
|
+
signer?: ethers$1.Signer;
|
|
1339
1363
|
}): Promise<{
|
|
1340
1364
|
code: number;
|
|
1341
1365
|
message: any;
|
|
@@ -1378,7 +1402,68 @@ declare class Utils {
|
|
|
1378
1402
|
marketPrice: string;
|
|
1379
1403
|
}): Promise<{
|
|
1380
1404
|
code: number;
|
|
1381
|
-
data:
|
|
1405
|
+
data: [[string, bigint, bigint, bigint] & {
|
|
1406
|
+
poolToken: string;
|
|
1407
|
+
exchangeRate: bigint;
|
|
1408
|
+
poolTokenPrice: bigint;
|
|
1409
|
+
poolTokenSupply: bigint;
|
|
1410
|
+
}, [string, bigint, bigint, bigint] & {
|
|
1411
|
+
poolToken: string;
|
|
1412
|
+
exchangeRate: bigint;
|
|
1413
|
+
poolTokenPrice: bigint;
|
|
1414
|
+
poolTokenSupply: bigint;
|
|
1415
|
+
}, [bigint, bigint, bigint, bigint] & {
|
|
1416
|
+
baseTotalAmount: bigint;
|
|
1417
|
+
baseReservedAmount: bigint;
|
|
1418
|
+
quoteTotalAmount: bigint;
|
|
1419
|
+
quoteReservedAmount: bigint;
|
|
1420
|
+
}, [bigint, bigint, bigint] & {
|
|
1421
|
+
nextFundingRate: bigint;
|
|
1422
|
+
lastFundingFeeTracker: bigint;
|
|
1423
|
+
nextEpochTime: bigint;
|
|
1424
|
+
}, [bigint, bigint, bigint, bigint] & {
|
|
1425
|
+
tracker: bigint;
|
|
1426
|
+
longSize: bigint;
|
|
1427
|
+
shortSize: bigint;
|
|
1428
|
+
poolEntryPrice: bigint;
|
|
1429
|
+
}, [bigint, bigint] & {
|
|
1430
|
+
windowCaps: bigint;
|
|
1431
|
+
openInterest: bigint;
|
|
1432
|
+
}] & {
|
|
1433
|
+
basePool: [string, bigint, bigint, bigint] & {
|
|
1434
|
+
poolToken: string;
|
|
1435
|
+
exchangeRate: bigint;
|
|
1436
|
+
poolTokenPrice: bigint;
|
|
1437
|
+
poolTokenSupply: bigint;
|
|
1438
|
+
};
|
|
1439
|
+
quotePool: [string, bigint, bigint, bigint] & {
|
|
1440
|
+
poolToken: string;
|
|
1441
|
+
exchangeRate: bigint;
|
|
1442
|
+
poolTokenPrice: bigint;
|
|
1443
|
+
poolTokenSupply: bigint;
|
|
1444
|
+
};
|
|
1445
|
+
reserveInfo: [bigint, bigint, bigint, bigint] & {
|
|
1446
|
+
baseTotalAmount: bigint;
|
|
1447
|
+
baseReservedAmount: bigint;
|
|
1448
|
+
quoteTotalAmount: bigint;
|
|
1449
|
+
quoteReservedAmount: bigint;
|
|
1450
|
+
};
|
|
1451
|
+
fundingInfo: [bigint, bigint, bigint] & {
|
|
1452
|
+
nextFundingRate: bigint;
|
|
1453
|
+
lastFundingFeeTracker: bigint;
|
|
1454
|
+
nextEpochTime: bigint;
|
|
1455
|
+
};
|
|
1456
|
+
oi: [bigint, bigint, bigint, bigint] & {
|
|
1457
|
+
tracker: bigint;
|
|
1458
|
+
longSize: bigint;
|
|
1459
|
+
shortSize: bigint;
|
|
1460
|
+
poolEntryPrice: bigint;
|
|
1461
|
+
};
|
|
1462
|
+
liquidityInfo: [bigint, bigint] & {
|
|
1463
|
+
windowCaps: bigint;
|
|
1464
|
+
openInterest: bigint;
|
|
1465
|
+
};
|
|
1466
|
+
};
|
|
1382
1467
|
message?: undefined;
|
|
1383
1468
|
} | {
|
|
1384
1469
|
code: number;
|
|
@@ -1536,9 +1621,9 @@ declare class Seamless {
|
|
|
1536
1621
|
private utils;
|
|
1537
1622
|
private account;
|
|
1538
1623
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1539
|
-
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<
|
|
1624
|
+
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
|
|
1540
1625
|
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
1541
|
-
token: string | ethers.Addressable;
|
|
1626
|
+
token: string | ethers$1.Addressable;
|
|
1542
1627
|
owner: string;
|
|
1543
1628
|
spender: string;
|
|
1544
1629
|
value: bigint;
|
|
@@ -1555,7 +1640,7 @@ declare class Seamless {
|
|
|
1555
1640
|
deadline: number;
|
|
1556
1641
|
data: string;
|
|
1557
1642
|
nonce: string;
|
|
1558
|
-
}, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1643
|
+
}, chainId: number, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
|
|
1559
1644
|
authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
|
|
1560
1645
|
approve: boolean;
|
|
1561
1646
|
seamlessAddress: string;
|
|
@@ -1577,7 +1662,7 @@ declare class Seamless {
|
|
|
1577
1662
|
data: {
|
|
1578
1663
|
masterAddress: string;
|
|
1579
1664
|
seamlessAccount: string;
|
|
1580
|
-
authorized:
|
|
1665
|
+
authorized: boolean;
|
|
1581
1666
|
};
|
|
1582
1667
|
}>;
|
|
1583
1668
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1596,9 +1681,9 @@ declare class Seamless {
|
|
|
1596
1681
|
}): Promise<{
|
|
1597
1682
|
code: number;
|
|
1598
1683
|
data: {
|
|
1599
|
-
masterAddress:
|
|
1684
|
+
masterAddress: string;
|
|
1600
1685
|
seamlessAccount: string;
|
|
1601
|
-
authorized:
|
|
1686
|
+
authorized: boolean;
|
|
1602
1687
|
apiKey: string;
|
|
1603
1688
|
};
|
|
1604
1689
|
}>;
|
|
@@ -1618,7 +1703,7 @@ declare class Seamless {
|
|
|
1618
1703
|
data: {
|
|
1619
1704
|
masterAddress: string;
|
|
1620
1705
|
seamlessAccount: string;
|
|
1621
|
-
authorized:
|
|
1706
|
+
authorized: boolean;
|
|
1622
1707
|
apiKey: string;
|
|
1623
1708
|
};
|
|
1624
1709
|
message?: undefined;
|
|
@@ -1707,13 +1792,13 @@ declare class Order {
|
|
|
1707
1792
|
data: {
|
|
1708
1793
|
success: boolean;
|
|
1709
1794
|
orderId: string | null;
|
|
1710
|
-
transactionHash:
|
|
1711
|
-
blockNumber:
|
|
1712
|
-
gasUsed:
|
|
1795
|
+
transactionHash: string;
|
|
1796
|
+
blockNumber: number | undefined;
|
|
1797
|
+
gasUsed: string | undefined;
|
|
1713
1798
|
status: string;
|
|
1714
1799
|
confirmations: number;
|
|
1715
1800
|
timestamp: number;
|
|
1716
|
-
receipt:
|
|
1801
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1717
1802
|
};
|
|
1718
1803
|
} | {
|
|
1719
1804
|
code: number;
|
|
@@ -1735,13 +1820,13 @@ declare class Order {
|
|
|
1735
1820
|
code: number;
|
|
1736
1821
|
message: string;
|
|
1737
1822
|
data: string | null;
|
|
1738
|
-
transactionHash:
|
|
1739
|
-
blockNumber:
|
|
1740
|
-
gasUsed:
|
|
1823
|
+
transactionHash: string;
|
|
1824
|
+
blockNumber: number | undefined;
|
|
1825
|
+
gasUsed: string | undefined;
|
|
1741
1826
|
status: string;
|
|
1742
1827
|
confirmations: number;
|
|
1743
1828
|
timestamp: number;
|
|
1744
|
-
receipt:
|
|
1829
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1745
1830
|
} | {
|
|
1746
1831
|
code: number;
|
|
1747
1832
|
message: any;
|
|
@@ -1764,13 +1849,13 @@ declare class Order {
|
|
|
1764
1849
|
data: {
|
|
1765
1850
|
success: boolean;
|
|
1766
1851
|
orderId: string | null;
|
|
1767
|
-
transactionHash:
|
|
1768
|
-
blockNumber:
|
|
1769
|
-
gasUsed:
|
|
1852
|
+
transactionHash: string;
|
|
1853
|
+
blockNumber: number | undefined;
|
|
1854
|
+
gasUsed: string | undefined;
|
|
1770
1855
|
status: string;
|
|
1771
1856
|
confirmations: number;
|
|
1772
1857
|
timestamp: number;
|
|
1773
|
-
receipt:
|
|
1858
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1774
1859
|
};
|
|
1775
1860
|
} | {
|
|
1776
1861
|
code: number;
|
|
@@ -1787,13 +1872,13 @@ declare class Order {
|
|
|
1787
1872
|
data: {
|
|
1788
1873
|
success: boolean;
|
|
1789
1874
|
orderId: string | null;
|
|
1790
|
-
transactionHash:
|
|
1791
|
-
blockNumber:
|
|
1792
|
-
gasUsed:
|
|
1875
|
+
transactionHash: string;
|
|
1876
|
+
blockNumber: number | undefined;
|
|
1877
|
+
gasUsed: string | undefined;
|
|
1793
1878
|
status: string;
|
|
1794
1879
|
confirmations: number;
|
|
1795
1880
|
timestamp: number;
|
|
1796
|
-
receipt:
|
|
1881
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1797
1882
|
};
|
|
1798
1883
|
} | {
|
|
1799
1884
|
code: number;
|
|
@@ -1819,7 +1904,7 @@ declare class Order {
|
|
|
1819
1904
|
}>;
|
|
1820
1905
|
updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
|
|
1821
1906
|
code: number;
|
|
1822
|
-
data:
|
|
1907
|
+
data: ethers$1.ContractTransactionReceipt | null;
|
|
1823
1908
|
message: string;
|
|
1824
1909
|
} | {
|
|
1825
1910
|
code: number;
|
|
@@ -1877,4 +1962,4 @@ declare class MyxClient {
|
|
|
1877
1962
|
getAccessToken(): Promise<string | null>;
|
|
1878
1963
|
}
|
|
1879
1964
|
|
|
1880
|
-
export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address$1 as Address, type ApiResponse, type BaseDetailResponse, type BaseResponse, COMMON_LP_AMOUNT_DECIMALS, COMMON_PRICE_DECIMALS, ChainId, type ChainIdRequest, CloseTypeEnum, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type FetchForwarderGetParams, type FetchForwarderGetResponse, type FetchForwarderGetResponseData, ForwarderGetStatus, type ForwarderTxParams, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketPool, type MarketPoolResponse, MarketPoolState, MarketType, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, type NetWorkFee, type ObjectType, type OnKlineCallback, type OnOrderCallback, type OnPositionCallback, type OnTickersAllCallback, type OnTickersCallback, OperationEnum, OperationType, OracleType, type Order$1 as Order, OrderStatus, OrderStatusEnum, OrderType, OrderTypeEnum, type PlaceOrderParams, type PoolLevelConfig, type PoolOpenOrder, type PoolOpenOrdersResponse, type PoolResponse, type PoolSymbolAllResponse, type Position$1 as Position, type PositionHistoryItem, type PositionResponse, type PositionTpSlOrderParams, type PositionType, type PriceResponse, type PriceType, type RemoveFavoriteParams, type SearchMarketParams, type SearchResultContractItem, type SearchResultCookItem, type SearchResultEarnItem, type SearchResultResponse, SearchSecondTypeEnum, SearchTypeEnum, type StatDashBoardResponse, type TickerDataItem, type TickersDataResponse, TimeInForce, type TradeFlowItem, TradeFlowTypeEnum, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, addFavorite, approve, index$2 as base, baseUrl, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, fetchForwarderGetApi, forwardUrl, forwarderTxApi, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getFavoritesList, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getMarketList, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolList, getPoolOpenOrders, getPoolSymbolAll, getPositionHistory, getPositions, getPriceData, getPricesData, getTickerData, getTokenInfo, getTradeFlow, index as market, index$3 as pool, index$1 as quote, removeFavorite, searchMarket, searchMarketAuth };
|
|
1965
|
+
export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address$1 as Address, type ApiResponse, type BaseDetailResponse, type BaseResponse, COMMON_LP_AMOUNT_DECIMALS, COMMON_PRICE_DECIMALS, ChainId, type ChainIdRequest, CloseTypeEnum, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type FetchForwarderGetParams, type FetchForwarderGetResponse, type FetchForwarderGetResponseData, ForwarderGetStatus, type ForwarderTxParams, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketPool, type MarketPoolResponse, MarketPoolState, MarketType, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, type NetWorkFee, type ObjectType, type OnKlineCallback, type OnOrderCallback, type OnPositionCallback, type OnTickersAllCallback, type OnTickersCallback, OperationEnum, OperationType, OracleType, type Order$1 as Order, OrderStatus, OrderStatusEnum, OrderType, OrderTypeEnum, type PlaceOrderParams, type PoolLevelConfig, type PoolOpenOrder, type PoolOpenOrdersResponse, type PoolResponse, type PoolSymbolAllResponse, type Position$1 as Position, type PositionHistoryItem, type PositionResponse, type PositionTpSlOrderParams, type PositionType, type PriceResponse, type PriceType, type RemoveFavoriteParams, type SearchMarketParams, type SearchResultContractItem, type SearchResultCookItem, type SearchResultEarnItem, type SearchResultResponse, SearchSecondTypeEnum, SearchTypeEnum, type StatDashBoardResponse, type TickerDataItem, type TickersDataResponse, TimeInForce, TradeFlowAccountTypeEnum, type TradeFlowItem, TradeFlowTypeEnum, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, addFavorite, approve, index$2 as base, baseUrl, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, fetchForwarderGetApi, forwardUrl, forwarderTxApi, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getFavoritesList, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getMarketList, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolList, getPoolOpenOrders, getPoolSymbolAll, getPositionHistory, getPositions, getPriceData, getPricesData, getTickerData, getTokenInfo, getTradeFlow, index as market, index$3 as pool, index$1 as quote, removeFavorite, searchMarket, searchMarketAuth };
|
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ __export(index_exports, {
|
|
|
54
54
|
SearchSecondTypeEnum: () => SearchSecondTypeEnum,
|
|
55
55
|
SearchTypeEnum: () => SearchTypeEnum,
|
|
56
56
|
TimeInForce: () => TimeInForce2,
|
|
57
|
+
TradeFlowAccountTypeEnum: () => TradeFlowAccountTypeEnum,
|
|
57
58
|
TradeFlowTypeEnum: () => TradeFlowTypeEnum,
|
|
58
59
|
TriggerType: () => TriggerType2,
|
|
59
60
|
TriggerTypeEnum: () => TriggerTypeEnum,
|
|
@@ -1823,7 +1824,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1823
1824
|
// package.json
|
|
1824
1825
|
var package_default = {
|
|
1825
1826
|
name: "@myx-trade/sdk",
|
|
1826
|
-
version: "0.1.
|
|
1827
|
+
version: "0.1.182",
|
|
1827
1828
|
private: false,
|
|
1828
1829
|
publishConfig: {
|
|
1829
1830
|
access: "public"
|
|
@@ -2048,6 +2049,12 @@ var TradeFlowTypeEnum = /* @__PURE__ */ ((TradeFlowTypeEnum2) => {
|
|
|
2048
2049
|
TradeFlowTypeEnum2[TradeFlowTypeEnum2["Liquidation"] = 6] = "Liquidation";
|
|
2049
2050
|
TradeFlowTypeEnum2[TradeFlowTypeEnum2["MarketClose"] = 7] = "MarketClose";
|
|
2050
2051
|
TradeFlowTypeEnum2[TradeFlowTypeEnum2["EarlyClose"] = 8] = "EarlyClose";
|
|
2052
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["AddTPSL"] = 9] = "AddTPSL";
|
|
2053
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["SecurityDeposit"] = 10] = "SecurityDeposit";
|
|
2054
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["TransferToWallet"] = 11] = "TransferToWallet";
|
|
2055
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["MarginAccountDeposit"] = 12] = "MarginAccountDeposit";
|
|
2056
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["ReferralReward"] = 13] = "ReferralReward";
|
|
2057
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["ReferralRewardClaim"] = 14] = "ReferralRewardClaim";
|
|
2051
2058
|
return TradeFlowTypeEnum2;
|
|
2052
2059
|
})(TradeFlowTypeEnum || {});
|
|
2053
2060
|
var TriggerTypeEnum = /* @__PURE__ */ ((TriggerTypeEnum2) => {
|
|
@@ -2124,6 +2131,12 @@ var getPositionHistory = async ({
|
|
|
2124
2131
|
}
|
|
2125
2132
|
);
|
|
2126
2133
|
};
|
|
2134
|
+
var TradeFlowAccountTypeEnum = /* @__PURE__ */ ((TradeFlowAccountTypeEnum2) => {
|
|
2135
|
+
TradeFlowAccountTypeEnum2[TradeFlowAccountTypeEnum2["MarginAccount"] = 1] = "MarginAccount";
|
|
2136
|
+
TradeFlowAccountTypeEnum2[TradeFlowAccountTypeEnum2["WalletAccount"] = 2] = "WalletAccount";
|
|
2137
|
+
TradeFlowAccountTypeEnum2[TradeFlowAccountTypeEnum2["ReferralReward"] = 3] = "ReferralReward";
|
|
2138
|
+
return TradeFlowAccountTypeEnum2;
|
|
2139
|
+
})(TradeFlowAccountTypeEnum || {});
|
|
2127
2140
|
var getTradeFlow = async ({
|
|
2128
2141
|
accessToken,
|
|
2129
2142
|
address,
|
|
@@ -12266,7 +12279,7 @@ var withdraw = async (params) => {
|
|
|
12266
12279
|
try {
|
|
12267
12280
|
const { chainId, poolId, amount, slippage = 0.01 } = params;
|
|
12268
12281
|
const pool = await getPoolInfo(chainId, poolId);
|
|
12269
|
-
const lpAddress = pool?.
|
|
12282
|
+
const lpAddress = pool?.basePoolToken;
|
|
12270
12283
|
const chainInfo = CHAIN_INFO[chainId];
|
|
12271
12284
|
const account = await getAccount(chainId);
|
|
12272
12285
|
const decimals = COMMON_LP_AMOUNT_DECIMALS;
|
|
@@ -21943,6 +21956,7 @@ var MyxClient = class {
|
|
|
21943
21956
|
SearchSecondTypeEnum,
|
|
21944
21957
|
SearchTypeEnum,
|
|
21945
21958
|
TimeInForce,
|
|
21959
|
+
TradeFlowAccountTypeEnum,
|
|
21946
21960
|
TradeFlowTypeEnum,
|
|
21947
21961
|
TriggerType,
|
|
21948
21962
|
TriggerTypeEnum,
|
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.182",
|
|
1735
1735
|
private: false,
|
|
1736
1736
|
publishConfig: {
|
|
1737
1737
|
access: "public"
|
|
@@ -1956,6 +1956,12 @@ var TradeFlowTypeEnum = /* @__PURE__ */ ((TradeFlowTypeEnum2) => {
|
|
|
1956
1956
|
TradeFlowTypeEnum2[TradeFlowTypeEnum2["Liquidation"] = 6] = "Liquidation";
|
|
1957
1957
|
TradeFlowTypeEnum2[TradeFlowTypeEnum2["MarketClose"] = 7] = "MarketClose";
|
|
1958
1958
|
TradeFlowTypeEnum2[TradeFlowTypeEnum2["EarlyClose"] = 8] = "EarlyClose";
|
|
1959
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["AddTPSL"] = 9] = "AddTPSL";
|
|
1960
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["SecurityDeposit"] = 10] = "SecurityDeposit";
|
|
1961
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["TransferToWallet"] = 11] = "TransferToWallet";
|
|
1962
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["MarginAccountDeposit"] = 12] = "MarginAccountDeposit";
|
|
1963
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["ReferralReward"] = 13] = "ReferralReward";
|
|
1964
|
+
TradeFlowTypeEnum2[TradeFlowTypeEnum2["ReferralRewardClaim"] = 14] = "ReferralRewardClaim";
|
|
1959
1965
|
return TradeFlowTypeEnum2;
|
|
1960
1966
|
})(TradeFlowTypeEnum || {});
|
|
1961
1967
|
var TriggerTypeEnum = /* @__PURE__ */ ((TriggerTypeEnum2) => {
|
|
@@ -2032,6 +2038,12 @@ var getPositionHistory = async ({
|
|
|
2032
2038
|
}
|
|
2033
2039
|
);
|
|
2034
2040
|
};
|
|
2041
|
+
var TradeFlowAccountTypeEnum = /* @__PURE__ */ ((TradeFlowAccountTypeEnum2) => {
|
|
2042
|
+
TradeFlowAccountTypeEnum2[TradeFlowAccountTypeEnum2["MarginAccount"] = 1] = "MarginAccount";
|
|
2043
|
+
TradeFlowAccountTypeEnum2[TradeFlowAccountTypeEnum2["WalletAccount"] = 2] = "WalletAccount";
|
|
2044
|
+
TradeFlowAccountTypeEnum2[TradeFlowAccountTypeEnum2["ReferralReward"] = 3] = "ReferralReward";
|
|
2045
|
+
return TradeFlowAccountTypeEnum2;
|
|
2046
|
+
})(TradeFlowAccountTypeEnum || {});
|
|
2035
2047
|
var getTradeFlow = async ({
|
|
2036
2048
|
accessToken,
|
|
2037
2049
|
address,
|
|
@@ -12174,7 +12186,7 @@ var withdraw = async (params) => {
|
|
|
12174
12186
|
try {
|
|
12175
12187
|
const { chainId, poolId, amount, slippage = 0.01 } = params;
|
|
12176
12188
|
const pool = await getPoolInfo(chainId, poolId);
|
|
12177
|
-
const lpAddress = pool?.
|
|
12189
|
+
const lpAddress = pool?.basePoolToken;
|
|
12178
12190
|
const chainInfo = CHAIN_INFO[chainId];
|
|
12179
12191
|
const account = await getAccount(chainId);
|
|
12180
12192
|
const decimals = COMMON_LP_AMOUNT_DECIMALS;
|
|
@@ -21850,6 +21862,7 @@ export {
|
|
|
21850
21862
|
SearchSecondTypeEnum,
|
|
21851
21863
|
SearchTypeEnum,
|
|
21852
21864
|
TimeInForce2 as TimeInForce,
|
|
21865
|
+
TradeFlowAccountTypeEnum,
|
|
21853
21866
|
TradeFlowTypeEnum,
|
|
21854
21867
|
TriggerType2 as TriggerType,
|
|
21855
21868
|
TriggerTypeEnum,
|