@myx-trade/sdk 0.1.239-beta.1 → 0.1.240
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 +4 -66
- package/dist/index.d.ts +4 -66
- package/dist/index.js +114 -2161
- package/dist/index.mjs +114 -2161
- package/package.json +21 -18
package/dist/index.d.mts
CHANGED
|
@@ -30,8 +30,6 @@ interface ContractAddress {
|
|
|
30
30
|
readonly DATA_PROVIDER: Address$1;
|
|
31
31
|
readonly ORACLE_RESERVE: Address$1;
|
|
32
32
|
readonly FORWARDER: Address$1;
|
|
33
|
-
readonly REIMBURSEMENT: Address$1;
|
|
34
|
-
readonly DISPUTE_COURT: Address$1;
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
interface CreatePoolRequest {
|
|
@@ -1371,7 +1369,7 @@ declare class Utils {
|
|
|
1371
1369
|
code: number;
|
|
1372
1370
|
message: any;
|
|
1373
1371
|
}>;
|
|
1374
|
-
getUserTradingFeeRate(assetClass: number, riskTier: number): Promise<{
|
|
1372
|
+
getUserTradingFeeRate(assetClass: number, riskTier: number, chainId: number): Promise<{
|
|
1375
1373
|
code: number;
|
|
1376
1374
|
data: {
|
|
1377
1375
|
takerFeeRate: any;
|
|
@@ -1478,8 +1476,8 @@ declare class Utils {
|
|
|
1478
1476
|
data?: undefined;
|
|
1479
1477
|
}>;
|
|
1480
1478
|
formatErrorMessage(error: any): any;
|
|
1481
|
-
getGasPriceByRatio(): Promise<bigint>;
|
|
1482
|
-
getGasLimitByRatio(gasLimit: bigint): Promise<bigint>;
|
|
1479
|
+
getGasPriceByRatio(chainId: number): Promise<bigint>;
|
|
1480
|
+
getGasLimitByRatio(chainId: number, gasLimit: bigint): Promise<bigint>;
|
|
1483
1481
|
}
|
|
1484
1482
|
|
|
1485
1483
|
declare class Api {
|
|
@@ -1587,7 +1585,7 @@ declare class Account {
|
|
|
1587
1585
|
private utils;
|
|
1588
1586
|
private client;
|
|
1589
1587
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, client: MyxClient);
|
|
1590
|
-
getWalletQuoteTokenBalance(address?: string): Promise<{
|
|
1588
|
+
getWalletQuoteTokenBalance(chainId: number, address?: string): Promise<{
|
|
1591
1589
|
code: number;
|
|
1592
1590
|
data: any;
|
|
1593
1591
|
}>;
|
|
@@ -3353,65 +3351,6 @@ declare class BaseMyxClient {
|
|
|
3353
3351
|
protected get config(): MyxClientConfig;
|
|
3354
3352
|
}
|
|
3355
3353
|
|
|
3356
|
-
interface AppealVoteParams {
|
|
3357
|
-
caseId: number;
|
|
3358
|
-
validator: Address$2;
|
|
3359
|
-
isFor: boolean;
|
|
3360
|
-
deadline: number;
|
|
3361
|
-
v: number;
|
|
3362
|
-
r: string;
|
|
3363
|
-
s: string;
|
|
3364
|
-
}
|
|
3365
|
-
|
|
3366
|
-
declare class Appeal extends BaseMyxClient {
|
|
3367
|
-
constructor(client: MyxClient);
|
|
3368
|
-
private getDisputeCourtContract;
|
|
3369
|
-
private getReimbursementContract;
|
|
3370
|
-
/**
|
|
3371
|
-
* submit appeal
|
|
3372
|
-
* @param poolId - the pool id
|
|
3373
|
-
* @param poolToken - the pool token
|
|
3374
|
-
* @returns the transaction receipt
|
|
3375
|
-
*/
|
|
3376
|
-
submitAppeal(poolId: string, poolToken: string): Promise<ethers.ContractTransactionReceipt | null>;
|
|
3377
|
-
/**
|
|
3378
|
-
* vote for appeal
|
|
3379
|
-
* @param caseId - the case id
|
|
3380
|
-
* @param isFor - true if for the appeal, false if against the appeal
|
|
3381
|
-
* @returns the transaction receipt
|
|
3382
|
-
*/
|
|
3383
|
-
voteForAppeal({ caseId, validator, isFor, deadline, v, r, s, }: AppealVoteParams): Promise<ethers.ContractTransactionReceipt | null>;
|
|
3384
|
-
/**
|
|
3385
|
-
* claim appeal margin
|
|
3386
|
-
* @param caseId - the case id
|
|
3387
|
-
* @returns the transaction receipt
|
|
3388
|
-
*/
|
|
3389
|
-
claimAppealMargin(caseId: number): Promise<ethers.ContractTransactionReceipt | null>;
|
|
3390
|
-
/**
|
|
3391
|
-
* claim reimbursement
|
|
3392
|
-
* @param caseId - the case id
|
|
3393
|
-
* @param baseAmount - the base amount
|
|
3394
|
-
* @param quoteAmount - the quote amount
|
|
3395
|
-
* @param merkleProof - the merkle proof
|
|
3396
|
-
* @returns the transaction receipt
|
|
3397
|
-
*/
|
|
3398
|
-
claimReimbursement(caseId: number, baseAmount: number, quoteAmount: number, merkleProof: BytesLike[]): Promise<ethers.ContractTransactionReceipt | null>;
|
|
3399
|
-
/**
|
|
3400
|
-
* get dispute configuration
|
|
3401
|
-
*/
|
|
3402
|
-
getDisputeConfiguration(): Promise<[string, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint] & {
|
|
3403
|
-
appealToken: string;
|
|
3404
|
-
disputeBondUsd: bigint;
|
|
3405
|
-
appealBondUsd: bigint;
|
|
3406
|
-
disputeThresholdUsd: bigint;
|
|
3407
|
-
caseDuration: bigint;
|
|
3408
|
-
voteDuration: bigint;
|
|
3409
|
-
resolveDuration: bigint;
|
|
3410
|
-
voteCountRate: bigint;
|
|
3411
|
-
effectiveVoteRate: bigint;
|
|
3412
|
-
}>;
|
|
3413
|
-
}
|
|
3414
|
-
|
|
3415
3354
|
declare class Referrals extends BaseMyxClient {
|
|
3416
3355
|
constructor(client: MyxClient);
|
|
3417
3356
|
claimRebate(tokenAddress: Address$2): Promise<ethers.ContractTransactionReceipt | null>;
|
|
@@ -3434,7 +3373,6 @@ declare class MyxClient {
|
|
|
3434
3373
|
account: Account;
|
|
3435
3374
|
seamless: Seamless;
|
|
3436
3375
|
api: Api;
|
|
3437
|
-
appeal: Appeal;
|
|
3438
3376
|
referrals: Referrals;
|
|
3439
3377
|
/**
|
|
3440
3378
|
* 获取配置管理器(用于访问 accessToken 相关方法)
|
package/dist/index.d.ts
CHANGED
|
@@ -30,8 +30,6 @@ interface ContractAddress {
|
|
|
30
30
|
readonly DATA_PROVIDER: Address$1;
|
|
31
31
|
readonly ORACLE_RESERVE: Address$1;
|
|
32
32
|
readonly FORWARDER: Address$1;
|
|
33
|
-
readonly REIMBURSEMENT: Address$1;
|
|
34
|
-
readonly DISPUTE_COURT: Address$1;
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
interface CreatePoolRequest {
|
|
@@ -1371,7 +1369,7 @@ declare class Utils {
|
|
|
1371
1369
|
code: number;
|
|
1372
1370
|
message: any;
|
|
1373
1371
|
}>;
|
|
1374
|
-
getUserTradingFeeRate(assetClass: number, riskTier: number): Promise<{
|
|
1372
|
+
getUserTradingFeeRate(assetClass: number, riskTier: number, chainId: number): Promise<{
|
|
1375
1373
|
code: number;
|
|
1376
1374
|
data: {
|
|
1377
1375
|
takerFeeRate: any;
|
|
@@ -1478,8 +1476,8 @@ declare class Utils {
|
|
|
1478
1476
|
data?: undefined;
|
|
1479
1477
|
}>;
|
|
1480
1478
|
formatErrorMessage(error: any): any;
|
|
1481
|
-
getGasPriceByRatio(): Promise<bigint>;
|
|
1482
|
-
getGasLimitByRatio(gasLimit: bigint): Promise<bigint>;
|
|
1479
|
+
getGasPriceByRatio(chainId: number): Promise<bigint>;
|
|
1480
|
+
getGasLimitByRatio(chainId: number, gasLimit: bigint): Promise<bigint>;
|
|
1483
1481
|
}
|
|
1484
1482
|
|
|
1485
1483
|
declare class Api {
|
|
@@ -1587,7 +1585,7 @@ declare class Account {
|
|
|
1587
1585
|
private utils;
|
|
1588
1586
|
private client;
|
|
1589
1587
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, client: MyxClient);
|
|
1590
|
-
getWalletQuoteTokenBalance(address?: string): Promise<{
|
|
1588
|
+
getWalletQuoteTokenBalance(chainId: number, address?: string): Promise<{
|
|
1591
1589
|
code: number;
|
|
1592
1590
|
data: any;
|
|
1593
1591
|
}>;
|
|
@@ -3353,65 +3351,6 @@ declare class BaseMyxClient {
|
|
|
3353
3351
|
protected get config(): MyxClientConfig;
|
|
3354
3352
|
}
|
|
3355
3353
|
|
|
3356
|
-
interface AppealVoteParams {
|
|
3357
|
-
caseId: number;
|
|
3358
|
-
validator: Address$2;
|
|
3359
|
-
isFor: boolean;
|
|
3360
|
-
deadline: number;
|
|
3361
|
-
v: number;
|
|
3362
|
-
r: string;
|
|
3363
|
-
s: string;
|
|
3364
|
-
}
|
|
3365
|
-
|
|
3366
|
-
declare class Appeal extends BaseMyxClient {
|
|
3367
|
-
constructor(client: MyxClient);
|
|
3368
|
-
private getDisputeCourtContract;
|
|
3369
|
-
private getReimbursementContract;
|
|
3370
|
-
/**
|
|
3371
|
-
* submit appeal
|
|
3372
|
-
* @param poolId - the pool id
|
|
3373
|
-
* @param poolToken - the pool token
|
|
3374
|
-
* @returns the transaction receipt
|
|
3375
|
-
*/
|
|
3376
|
-
submitAppeal(poolId: string, poolToken: string): Promise<ethers.ContractTransactionReceipt | null>;
|
|
3377
|
-
/**
|
|
3378
|
-
* vote for appeal
|
|
3379
|
-
* @param caseId - the case id
|
|
3380
|
-
* @param isFor - true if for the appeal, false if against the appeal
|
|
3381
|
-
* @returns the transaction receipt
|
|
3382
|
-
*/
|
|
3383
|
-
voteForAppeal({ caseId, validator, isFor, deadline, v, r, s, }: AppealVoteParams): Promise<ethers.ContractTransactionReceipt | null>;
|
|
3384
|
-
/**
|
|
3385
|
-
* claim appeal margin
|
|
3386
|
-
* @param caseId - the case id
|
|
3387
|
-
* @returns the transaction receipt
|
|
3388
|
-
*/
|
|
3389
|
-
claimAppealMargin(caseId: number): Promise<ethers.ContractTransactionReceipt | null>;
|
|
3390
|
-
/**
|
|
3391
|
-
* claim reimbursement
|
|
3392
|
-
* @param caseId - the case id
|
|
3393
|
-
* @param baseAmount - the base amount
|
|
3394
|
-
* @param quoteAmount - the quote amount
|
|
3395
|
-
* @param merkleProof - the merkle proof
|
|
3396
|
-
* @returns the transaction receipt
|
|
3397
|
-
*/
|
|
3398
|
-
claimReimbursement(caseId: number, baseAmount: number, quoteAmount: number, merkleProof: BytesLike[]): Promise<ethers.ContractTransactionReceipt | null>;
|
|
3399
|
-
/**
|
|
3400
|
-
* get dispute configuration
|
|
3401
|
-
*/
|
|
3402
|
-
getDisputeConfiguration(): Promise<[string, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint] & {
|
|
3403
|
-
appealToken: string;
|
|
3404
|
-
disputeBondUsd: bigint;
|
|
3405
|
-
appealBondUsd: bigint;
|
|
3406
|
-
disputeThresholdUsd: bigint;
|
|
3407
|
-
caseDuration: bigint;
|
|
3408
|
-
voteDuration: bigint;
|
|
3409
|
-
resolveDuration: bigint;
|
|
3410
|
-
voteCountRate: bigint;
|
|
3411
|
-
effectiveVoteRate: bigint;
|
|
3412
|
-
}>;
|
|
3413
|
-
}
|
|
3414
|
-
|
|
3415
3354
|
declare class Referrals extends BaseMyxClient {
|
|
3416
3355
|
constructor(client: MyxClient);
|
|
3417
3356
|
claimRebate(tokenAddress: Address$2): Promise<ethers.ContractTransactionReceipt | null>;
|
|
@@ -3434,7 +3373,6 @@ declare class MyxClient {
|
|
|
3434
3373
|
account: Account;
|
|
3435
3374
|
seamless: Seamless;
|
|
3436
3375
|
api: Api;
|
|
3437
|
-
appeal: Appeal;
|
|
3438
3376
|
referrals: Referrals;
|
|
3439
3377
|
/**
|
|
3440
3378
|
* 获取配置管理器(用于访问 accessToken 相关方法)
|