@orderly.network/core 2.4.1 → 2.5.0-alpha.1
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 +70 -31
- package/dist/index.d.ts +70 -31
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -731,6 +731,14 @@ declare class Assets {
|
|
|
731
731
|
private readonly contractManger;
|
|
732
732
|
private readonly account;
|
|
733
733
|
constructor(configStore: ConfigStore, contractManger: IContract, account: Account);
|
|
734
|
+
/**
|
|
735
|
+
* Convert non-USDC asset to USDC manually
|
|
736
|
+
*/
|
|
737
|
+
convert(inputs: {
|
|
738
|
+
slippage: number;
|
|
739
|
+
amount: number;
|
|
740
|
+
converted_asset: string;
|
|
741
|
+
}): Promise<any>;
|
|
734
742
|
withdraw(inputs: {
|
|
735
743
|
chainId: number;
|
|
736
744
|
token: string;
|
|
@@ -741,58 +749,82 @@ declare class Assets {
|
|
|
741
749
|
}): Promise<any>;
|
|
742
750
|
private getWithdrawalNonce;
|
|
743
751
|
getNativeBalance(options?: {
|
|
752
|
+
/** token decimals on chain, default is 18 */
|
|
744
753
|
decimals?: number;
|
|
745
754
|
}): Promise<string>;
|
|
746
|
-
getBalance(
|
|
755
|
+
getBalance(
|
|
756
|
+
/** token address */
|
|
757
|
+
address: string, options: {
|
|
758
|
+
/** token decimals on chain, default is 18 */
|
|
747
759
|
decimals?: number;
|
|
748
760
|
}): Promise<string>;
|
|
749
|
-
|
|
761
|
+
/**
|
|
762
|
+
* @deprecated use getBalance instead, will be removed in the future
|
|
763
|
+
*/
|
|
764
|
+
getBalanceByAddress(
|
|
765
|
+
/** token address */
|
|
766
|
+
address: string, options?: {
|
|
767
|
+
/** token decimals on chain, default is 18 */
|
|
750
768
|
decimals?: number;
|
|
751
769
|
}): Promise<string>;
|
|
752
|
-
getAllowance(
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
address
|
|
770
|
+
getAllowance(inputs: {
|
|
771
|
+
/** token address */
|
|
772
|
+
address: string;
|
|
773
|
+
/** vault address */
|
|
756
774
|
vaultAddress?: string;
|
|
775
|
+
/** token decimals on chain, default is 18 */
|
|
757
776
|
decimals?: number;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
approve(
|
|
762
|
-
/** please use object inputs instead, string inputs will be removed in the future */
|
|
763
|
-
inputs: string | {
|
|
777
|
+
}): Promise<string>;
|
|
778
|
+
approve(inputs: {
|
|
779
|
+
/** token address */
|
|
764
780
|
address?: string;
|
|
765
|
-
|
|
781
|
+
/** vault address */
|
|
766
782
|
vaultAddress?: string;
|
|
783
|
+
/** token amount */
|
|
784
|
+
amount?: string;
|
|
785
|
+
/** token decimals on chain, default is 18 */
|
|
767
786
|
decimals: number;
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
_vaultAddress?: string): Promise<any>;
|
|
787
|
+
}): Promise<any>;
|
|
788
|
+
/**
|
|
789
|
+
* @deprecated use approve instead, will be removed in the future
|
|
790
|
+
*/
|
|
773
791
|
approveByAddress(inputs: {
|
|
792
|
+
/** token address */
|
|
774
793
|
address: string;
|
|
794
|
+
/** token amount */
|
|
775
795
|
amount?: string;
|
|
796
|
+
/** token decimals on chain, default is 18 */
|
|
776
797
|
decimals: number;
|
|
777
798
|
}): Promise<any>;
|
|
778
|
-
getDepositFee(
|
|
779
|
-
/** please use object inputs instead, string inputs will be removed in the future */
|
|
780
|
-
inputs: string | {
|
|
799
|
+
getDepositFee(inputs: {
|
|
781
800
|
amount: string;
|
|
801
|
+
/** chain info */
|
|
782
802
|
chain: API.NetworkInfos;
|
|
803
|
+
/** token decimals on chain, default is 18 */
|
|
783
804
|
decimals: number;
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
inputs:
|
|
805
|
+
token?: string;
|
|
806
|
+
/** token address */
|
|
807
|
+
address?: string;
|
|
808
|
+
}): Promise<any>;
|
|
809
|
+
/** deposit native token */
|
|
810
|
+
depositNativeToken(inputs: {
|
|
811
|
+
amount: string;
|
|
812
|
+
fee: bigint;
|
|
813
|
+
/** token decimals on chain, default is 18 */
|
|
814
|
+
decimals: number;
|
|
815
|
+
token?: string;
|
|
816
|
+
}): Promise<any>;
|
|
817
|
+
deposit(inputs: {
|
|
790
818
|
amount: string;
|
|
791
819
|
fee: bigint;
|
|
820
|
+
/** token decimals on chain, default is 18 */
|
|
792
821
|
decimals: number;
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
822
|
+
token?: string;
|
|
823
|
+
/** token address */
|
|
824
|
+
address?: string;
|
|
825
|
+
/** vault address */
|
|
826
|
+
vaultAddress?: string;
|
|
827
|
+
}): Promise<any>;
|
|
796
828
|
private _simpleFetch;
|
|
797
829
|
get usdcAddress(): string;
|
|
798
830
|
}
|
|
@@ -1062,7 +1094,14 @@ declare class Account {
|
|
|
1062
1094
|
* */
|
|
1063
1095
|
subAccountId?: string;
|
|
1064
1096
|
}): Promise<any>;
|
|
1065
|
-
|
|
1097
|
+
/** set main account pnl */
|
|
1098
|
+
settle(options?: {
|
|
1099
|
+
/**
|
|
1100
|
+
* if you are main account, you don't need to pass the accountId
|
|
1101
|
+
* if you are sub account and you want to settle the main account, you need to pass main account id
|
|
1102
|
+
* */
|
|
1103
|
+
accountId?: string;
|
|
1104
|
+
}): Promise<any>;
|
|
1066
1105
|
private signData;
|
|
1067
1106
|
destroyOrderlyKey(): Promise<void>;
|
|
1068
1107
|
disconnect(): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -731,6 +731,14 @@ declare class Assets {
|
|
|
731
731
|
private readonly contractManger;
|
|
732
732
|
private readonly account;
|
|
733
733
|
constructor(configStore: ConfigStore, contractManger: IContract, account: Account);
|
|
734
|
+
/**
|
|
735
|
+
* Convert non-USDC asset to USDC manually
|
|
736
|
+
*/
|
|
737
|
+
convert(inputs: {
|
|
738
|
+
slippage: number;
|
|
739
|
+
amount: number;
|
|
740
|
+
converted_asset: string;
|
|
741
|
+
}): Promise<any>;
|
|
734
742
|
withdraw(inputs: {
|
|
735
743
|
chainId: number;
|
|
736
744
|
token: string;
|
|
@@ -741,58 +749,82 @@ declare class Assets {
|
|
|
741
749
|
}): Promise<any>;
|
|
742
750
|
private getWithdrawalNonce;
|
|
743
751
|
getNativeBalance(options?: {
|
|
752
|
+
/** token decimals on chain, default is 18 */
|
|
744
753
|
decimals?: number;
|
|
745
754
|
}): Promise<string>;
|
|
746
|
-
getBalance(
|
|
755
|
+
getBalance(
|
|
756
|
+
/** token address */
|
|
757
|
+
address: string, options: {
|
|
758
|
+
/** token decimals on chain, default is 18 */
|
|
747
759
|
decimals?: number;
|
|
748
760
|
}): Promise<string>;
|
|
749
|
-
|
|
761
|
+
/**
|
|
762
|
+
* @deprecated use getBalance instead, will be removed in the future
|
|
763
|
+
*/
|
|
764
|
+
getBalanceByAddress(
|
|
765
|
+
/** token address */
|
|
766
|
+
address: string, options?: {
|
|
767
|
+
/** token decimals on chain, default is 18 */
|
|
750
768
|
decimals?: number;
|
|
751
769
|
}): Promise<string>;
|
|
752
|
-
getAllowance(
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
address
|
|
770
|
+
getAllowance(inputs: {
|
|
771
|
+
/** token address */
|
|
772
|
+
address: string;
|
|
773
|
+
/** vault address */
|
|
756
774
|
vaultAddress?: string;
|
|
775
|
+
/** token decimals on chain, default is 18 */
|
|
757
776
|
decimals?: number;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
approve(
|
|
762
|
-
/** please use object inputs instead, string inputs will be removed in the future */
|
|
763
|
-
inputs: string | {
|
|
777
|
+
}): Promise<string>;
|
|
778
|
+
approve(inputs: {
|
|
779
|
+
/** token address */
|
|
764
780
|
address?: string;
|
|
765
|
-
|
|
781
|
+
/** vault address */
|
|
766
782
|
vaultAddress?: string;
|
|
783
|
+
/** token amount */
|
|
784
|
+
amount?: string;
|
|
785
|
+
/** token decimals on chain, default is 18 */
|
|
767
786
|
decimals: number;
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
_vaultAddress?: string): Promise<any>;
|
|
787
|
+
}): Promise<any>;
|
|
788
|
+
/**
|
|
789
|
+
* @deprecated use approve instead, will be removed in the future
|
|
790
|
+
*/
|
|
773
791
|
approveByAddress(inputs: {
|
|
792
|
+
/** token address */
|
|
774
793
|
address: string;
|
|
794
|
+
/** token amount */
|
|
775
795
|
amount?: string;
|
|
796
|
+
/** token decimals on chain, default is 18 */
|
|
776
797
|
decimals: number;
|
|
777
798
|
}): Promise<any>;
|
|
778
|
-
getDepositFee(
|
|
779
|
-
/** please use object inputs instead, string inputs will be removed in the future */
|
|
780
|
-
inputs: string | {
|
|
799
|
+
getDepositFee(inputs: {
|
|
781
800
|
amount: string;
|
|
801
|
+
/** chain info */
|
|
782
802
|
chain: API.NetworkInfos;
|
|
803
|
+
/** token decimals on chain, default is 18 */
|
|
783
804
|
decimals: number;
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
inputs:
|
|
805
|
+
token?: string;
|
|
806
|
+
/** token address */
|
|
807
|
+
address?: string;
|
|
808
|
+
}): Promise<any>;
|
|
809
|
+
/** deposit native token */
|
|
810
|
+
depositNativeToken(inputs: {
|
|
811
|
+
amount: string;
|
|
812
|
+
fee: bigint;
|
|
813
|
+
/** token decimals on chain, default is 18 */
|
|
814
|
+
decimals: number;
|
|
815
|
+
token?: string;
|
|
816
|
+
}): Promise<any>;
|
|
817
|
+
deposit(inputs: {
|
|
790
818
|
amount: string;
|
|
791
819
|
fee: bigint;
|
|
820
|
+
/** token decimals on chain, default is 18 */
|
|
792
821
|
decimals: number;
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
822
|
+
token?: string;
|
|
823
|
+
/** token address */
|
|
824
|
+
address?: string;
|
|
825
|
+
/** vault address */
|
|
826
|
+
vaultAddress?: string;
|
|
827
|
+
}): Promise<any>;
|
|
796
828
|
private _simpleFetch;
|
|
797
829
|
get usdcAddress(): string;
|
|
798
830
|
}
|
|
@@ -1062,7 +1094,14 @@ declare class Account {
|
|
|
1062
1094
|
* */
|
|
1063
1095
|
subAccountId?: string;
|
|
1064
1096
|
}): Promise<any>;
|
|
1065
|
-
|
|
1097
|
+
/** set main account pnl */
|
|
1098
|
+
settle(options?: {
|
|
1099
|
+
/**
|
|
1100
|
+
* if you are main account, you don't need to pass the accountId
|
|
1101
|
+
* if you are sub account and you want to settle the main account, you need to pass main account id
|
|
1102
|
+
* */
|
|
1103
|
+
accountId?: string;
|
|
1104
|
+
}): Promise<any>;
|
|
1066
1105
|
private signData;
|
|
1067
1106
|
destroyOrderlyKey(): Promise<void>;
|
|
1068
1107
|
disconnect(): Promise<void>;
|