stableflow-ai-sdk 2.0.2 → 2.0.3
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/README.md +484 -17
- package/dist/index.d.mts +152 -68
- package/dist/index.d.ts +152 -68
- package/dist/index.js +1097 -352
- package/dist/index.mjs +1082 -339
- package/package.json +5 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
1
2
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
3
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
|
-
import { ethers } from 'ethers';
|
|
4
4
|
|
|
5
5
|
type ApiRequestOptions = {
|
|
6
6
|
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
@@ -521,10 +521,11 @@ interface ChainConfig {
|
|
|
521
521
|
symbol: string;
|
|
522
522
|
decimals: number;
|
|
523
523
|
};
|
|
524
|
-
|
|
524
|
+
rpcUrls: string[];
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
interface TokenConfig extends ChainConfig {
|
|
528
|
+
name: string;
|
|
528
529
|
symbol: string;
|
|
529
530
|
decimals: number;
|
|
530
531
|
icon: string;
|
|
@@ -594,10 +595,14 @@ interface GetAllQuoteParams {
|
|
|
594
595
|
amountWei: string;
|
|
595
596
|
slippageTolerance: number;
|
|
596
597
|
minInputAmount?: string;
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
598
|
+
oneclickParams?: {
|
|
599
|
+
appFees?: {
|
|
600
|
+
recipient: string;
|
|
601
|
+
fee: number;
|
|
602
|
+
}[];
|
|
603
|
+
swapType?: "EXACT_INPUT" | "EXACT_OUTPUT";
|
|
604
|
+
isProxy?: boolean;
|
|
605
|
+
};
|
|
601
606
|
}
|
|
602
607
|
/**
|
|
603
608
|
* StableFlow AI Service
|
|
@@ -698,6 +703,135 @@ declare class SFA {
|
|
|
698
703
|
}>;
|
|
699
704
|
}
|
|
700
705
|
|
|
706
|
+
declare class EVMWallet {
|
|
707
|
+
provider: any;
|
|
708
|
+
signer: any;
|
|
709
|
+
constructor(_provider: any, _signer?: any);
|
|
710
|
+
transfer(data: {
|
|
711
|
+
originAsset: string;
|
|
712
|
+
depositAddress: string;
|
|
713
|
+
amount: string;
|
|
714
|
+
}): Promise<any>;
|
|
715
|
+
getBalance(token: any, account: string): Promise<any>;
|
|
716
|
+
balanceOf(token: any, account: string): Promise<any>;
|
|
717
|
+
/**
|
|
718
|
+
* Estimate gas limit for transfer transaction
|
|
719
|
+
* @param data Transfer data
|
|
720
|
+
* @returns Gas limit estimate, gas price, and estimated gas cost
|
|
721
|
+
*/
|
|
722
|
+
estimateTransferGas(data: {
|
|
723
|
+
originAsset: string;
|
|
724
|
+
depositAddress: string;
|
|
725
|
+
amount: string;
|
|
726
|
+
}): Promise<{
|
|
727
|
+
gasLimit: bigint;
|
|
728
|
+
gasPrice: bigint;
|
|
729
|
+
estimateGas: bigint;
|
|
730
|
+
}>;
|
|
731
|
+
getContract(params: any): ethers.Contract;
|
|
732
|
+
allowance(params: any): Promise<{
|
|
733
|
+
contract: ethers.Contract;
|
|
734
|
+
allowance: string;
|
|
735
|
+
needApprove: boolean;
|
|
736
|
+
}>;
|
|
737
|
+
approve(params: any): Promise<boolean>;
|
|
738
|
+
getEstimateGas(params: any): Promise<{
|
|
739
|
+
gasPrice: any;
|
|
740
|
+
usd: string;
|
|
741
|
+
wei: bigint;
|
|
742
|
+
amount: string;
|
|
743
|
+
}>;
|
|
744
|
+
quoteOFT(params: any): Promise<any>;
|
|
745
|
+
sendTransaction(params: any): Promise<any>;
|
|
746
|
+
/**
|
|
747
|
+
* Unified quote method that routes to specific quote methods based on type
|
|
748
|
+
* @param type Service type from ServiceType
|
|
749
|
+
* @param params Parameters for the quote
|
|
750
|
+
*/
|
|
751
|
+
quote(type: ServiceType, params: any): Promise<any>;
|
|
752
|
+
/**
|
|
753
|
+
* Unified send method that routes to specific send methods based on type
|
|
754
|
+
* @param type Send type from SendType enum
|
|
755
|
+
* @param params Parameters for the send transaction
|
|
756
|
+
*/
|
|
757
|
+
send(type: SendType, params: any): Promise<any>;
|
|
758
|
+
quoteCCTP(params: any): Promise<any>;
|
|
759
|
+
quoteOneClickProxy(params: any): Promise<any>;
|
|
760
|
+
signTypedData(params: any): Promise<any>;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
declare class HyperliquidService {
|
|
764
|
+
quote(params: HyperliquidQuoteParams): Promise<{
|
|
765
|
+
quote: any;
|
|
766
|
+
error: string | null;
|
|
767
|
+
}>;
|
|
768
|
+
transfer(params: HyperliquidTransferParams): Promise<string>;
|
|
769
|
+
deposit(params: HyperliquidDepositParams): Promise<HyperliquidDepositResponse>;
|
|
770
|
+
getStatus(params: HyperliquidGetStatusParams): Promise<HyperliquidDepositStatusResponse>;
|
|
771
|
+
protected generatePermit(params: HyperliquidGeneratePermitParams): Promise<{
|
|
772
|
+
amount: string;
|
|
773
|
+
deadline: number;
|
|
774
|
+
owner: string;
|
|
775
|
+
r: string;
|
|
776
|
+
s: string;
|
|
777
|
+
spender: string;
|
|
778
|
+
token: string;
|
|
779
|
+
v: 28 | 27;
|
|
780
|
+
nonce: number;
|
|
781
|
+
}>;
|
|
782
|
+
}
|
|
783
|
+
declare const Hyperliquid: HyperliquidService;
|
|
784
|
+
declare const HyperliquidFromTokens: TokenConfig[];
|
|
785
|
+
declare const HyperliuquidToToken: TokenConfig;
|
|
786
|
+
declare const HyperliuquidMinAmount: string;
|
|
787
|
+
interface HyperliquidQuoteParams {
|
|
788
|
+
slippageTolerance: number;
|
|
789
|
+
refundTo: string;
|
|
790
|
+
recipient: string;
|
|
791
|
+
wallet: WalletConfig;
|
|
792
|
+
fromToken: TokenConfig;
|
|
793
|
+
prices: Record<string, string>;
|
|
794
|
+
amountWei: string;
|
|
795
|
+
dry?: boolean;
|
|
796
|
+
oneclickParams?: {
|
|
797
|
+
appFees?: {
|
|
798
|
+
recipient: string;
|
|
799
|
+
fee: number;
|
|
800
|
+
}[];
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
interface HyperliquidTransferParams {
|
|
804
|
+
wallet: WalletConfig;
|
|
805
|
+
evmWallet: EVMWallet;
|
|
806
|
+
evmWalletAddress: string;
|
|
807
|
+
quote: any;
|
|
808
|
+
}
|
|
809
|
+
interface HyperliquidGeneratePermitParams {
|
|
810
|
+
address: string;
|
|
811
|
+
evmWallet: EVMWallet;
|
|
812
|
+
amountWei: string;
|
|
813
|
+
}
|
|
814
|
+
interface HyperliquidDepositParams extends HyperliquidTransferParams {
|
|
815
|
+
txhash: string;
|
|
816
|
+
}
|
|
817
|
+
interface HyperliquidGetStatusParams {
|
|
818
|
+
depositId: string;
|
|
819
|
+
}
|
|
820
|
+
interface HyperliquidResponse<T> {
|
|
821
|
+
code: number;
|
|
822
|
+
data: T;
|
|
823
|
+
}
|
|
824
|
+
interface HyperliquidDepositResponseData {
|
|
825
|
+
depositId: number;
|
|
826
|
+
}
|
|
827
|
+
type HyperliquidDepositResponse = HyperliquidResponse<HyperliquidDepositResponseData>;
|
|
828
|
+
type HyperliquidDepositStatus = "PROCESSING" | "SUCCESS" | "REFUNDED" | "FAILED";
|
|
829
|
+
interface HyperliquidDepositStatusResponseData {
|
|
830
|
+
status: HyperliquidDepositStatus;
|
|
831
|
+
txHash: string;
|
|
832
|
+
}
|
|
833
|
+
type HyperliquidDepositStatusResponse = HyperliquidResponse<HyperliquidDepositStatusResponseData>;
|
|
834
|
+
|
|
701
835
|
declare const tokens: TokenConfig[];
|
|
702
836
|
declare const usdtTokens: TokenConfig[];
|
|
703
837
|
declare const usdcTokens: TokenConfig[];
|
|
@@ -806,67 +940,13 @@ declare class SolanaWallet {
|
|
|
806
940
|
send(type: SendType, params: any): Promise<string>;
|
|
807
941
|
quoteOneClickProxy(params: any): Promise<any>;
|
|
808
942
|
quoteCCTP(params: any): Promise<any>;
|
|
809
|
-
createAssociatedTokenAddress(params: any): Promise<PublicKey>;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
declare class EVMWallet {
|
|
813
|
-
provider: any;
|
|
814
|
-
signer: any;
|
|
815
|
-
constructor(_provider: any, _signer?: any);
|
|
816
|
-
transfer(data: {
|
|
817
|
-
originAsset: string;
|
|
818
|
-
depositAddress: string;
|
|
819
|
-
amount: string;
|
|
820
|
-
}): Promise<any>;
|
|
821
|
-
getBalance(token: any, account: string): Promise<any>;
|
|
822
|
-
balanceOf(token: any, account: string): Promise<any>;
|
|
823
|
-
/**
|
|
824
|
-
* Estimate gas limit for transfer transaction
|
|
825
|
-
* @param data Transfer data
|
|
826
|
-
* @returns Gas limit estimate, gas price, and estimated gas cost
|
|
827
|
-
*/
|
|
828
|
-
estimateTransferGas(data: {
|
|
829
|
-
originAsset: string;
|
|
830
|
-
depositAddress: string;
|
|
831
|
-
amount: string;
|
|
832
|
-
}): Promise<{
|
|
833
|
-
gasLimit: bigint;
|
|
834
|
-
gasPrice: bigint;
|
|
835
|
-
estimateGas: bigint;
|
|
836
|
-
}>;
|
|
837
|
-
getContract(params: any): ethers.Contract;
|
|
838
|
-
allowance(params: any): Promise<{
|
|
839
|
-
contract: ethers.Contract;
|
|
840
|
-
allowance: string;
|
|
841
|
-
needApprove: boolean;
|
|
842
|
-
}>;
|
|
843
|
-
approve(params: any): Promise<boolean>;
|
|
844
|
-
getEstimateGas(params: any): Promise<{
|
|
845
|
-
gasPrice: any;
|
|
846
|
-
usd: string;
|
|
847
|
-
wei: bigint;
|
|
848
|
-
amount: string;
|
|
849
|
-
}>;
|
|
850
943
|
quoteOFT(params: any): Promise<any>;
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* Unified quote method that routes to specific quote methods based on type
|
|
854
|
-
* @param type Service type from ServiceType
|
|
855
|
-
* @param params Parameters for the quote
|
|
856
|
-
*/
|
|
857
|
-
quote(type: ServiceType, params: any): Promise<any>;
|
|
858
|
-
/**
|
|
859
|
-
* Unified send method that routes to specific send methods based on type
|
|
860
|
-
* @param type Send type from SendType enum
|
|
861
|
-
* @param params Parameters for the send transaction
|
|
862
|
-
*/
|
|
863
|
-
send(type: SendType, params: any): Promise<any>;
|
|
864
|
-
quoteCCTP(params: any): Promise<any>;
|
|
865
|
-
quoteOneClickProxy(params: any): Promise<any>;
|
|
944
|
+
createAssociatedTokenAddress(params: any): Promise<PublicKey>;
|
|
866
945
|
}
|
|
867
946
|
|
|
868
947
|
declare class TronWallet {
|
|
869
948
|
private signAndSendTransaction;
|
|
949
|
+
private address;
|
|
870
950
|
private tronWeb;
|
|
871
951
|
constructor(options: any);
|
|
872
952
|
waitForTronWeb(): Promise<unknown>;
|
|
@@ -882,10 +962,10 @@ declare class TronWallet {
|
|
|
882
962
|
getTokenBalance(contractAddress: string, account: string): Promise<any>;
|
|
883
963
|
balanceOf(token: any, account: string): Promise<any>;
|
|
884
964
|
/**
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
965
|
+
* Estimate gas limit for transfer transaction
|
|
966
|
+
* @param data Transfer data
|
|
967
|
+
* @returns Gas limit estimate (bandwidth or energy), gas price, and estimated gas cost
|
|
968
|
+
*/
|
|
889
969
|
estimateTransferGas(data: {
|
|
890
970
|
originAsset: string;
|
|
891
971
|
depositAddress: string;
|
|
@@ -896,6 +976,7 @@ declare class TronWallet {
|
|
|
896
976
|
estimateGas: bigint;
|
|
897
977
|
}>;
|
|
898
978
|
checkTransactionStatus(txHash: string): Promise<boolean>;
|
|
979
|
+
getTransactionResult(txHash: string): Promise<any>;
|
|
899
980
|
allowance(params: any): Promise<{
|
|
900
981
|
contract: any;
|
|
901
982
|
allowance: string;
|
|
@@ -919,6 +1000,7 @@ declare class TronWallet {
|
|
|
919
1000
|
*/
|
|
920
1001
|
send(type: SendType, params: any): Promise<any>;
|
|
921
1002
|
quoteOneClickProxy(params: any): Promise<any>;
|
|
1003
|
+
getAccountResources(params: any): Promise<any>;
|
|
922
1004
|
}
|
|
923
1005
|
|
|
924
1006
|
declare class AptosWallet {
|
|
@@ -972,6 +1054,8 @@ declare class AptosWallet {
|
|
|
972
1054
|
send(type: SendType, params: any): Promise<any>;
|
|
973
1055
|
}
|
|
974
1056
|
|
|
975
|
-
declare const
|
|
1057
|
+
declare const NetworkRpcUrlsMap: Record<string, string[]>;
|
|
1058
|
+
declare const getRpcUrls: (blockchain: string) => string[];
|
|
1059
|
+
declare const setRpcUrls: (urls: Record<string, string[]>) => Record<string, string[]>;
|
|
976
1060
|
|
|
977
|
-
export { ApiError, type AppFee, AptosWallet, type BadRequestResponse, CancelError, CancelablePromise, EVMWallet, type GetAllQuoteParams, GetExecutionStatusResponse, NearWallet, OpenAPI, type OpenAPIConfig, type Quote, QuoteRequest, type QuoteResponse, SFA, Service, type ServiceType, SolanaWallet, type SubmitDepositTxRequest, SubmitDepositTxResponse, type SwapDetails, type TokenConfig, TokenResponse, type TransactionDetails, TransactionStatus, TronWallet,
|
|
1061
|
+
export { ApiError, type AppFee, AptosWallet, type BadRequestResponse, CancelError, CancelablePromise, EVMWallet, type GetAllQuoteParams, GetExecutionStatusResponse, Hyperliquid, type HyperliquidDepositParams, type HyperliquidDepositResponse, type HyperliquidDepositResponseData, type HyperliquidDepositStatusResponse, type HyperliquidDepositStatusResponseData, HyperliquidFromTokens, type HyperliquidGetStatusParams, type HyperliquidQuoteParams, type HyperliquidTransferParams, HyperliuquidMinAmount, HyperliuquidToToken, NearWallet, NetworkRpcUrlsMap, OpenAPI, type OpenAPIConfig, type Quote, QuoteRequest, type QuoteResponse, SFA, Service, type ServiceType, SolanaWallet, type SubmitDepositTxRequest, SubmitDepositTxResponse, type SwapDetails, type TokenConfig, TokenResponse, type TransactionDetails, TransactionStatus, TronWallet, getRpcUrls, setRpcUrls, tokens, usdcChains, usdcTokens, usdtChains, usdtTokens };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
1
2
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
3
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
|
-
import { ethers } from 'ethers';
|
|
4
4
|
|
|
5
5
|
type ApiRequestOptions = {
|
|
6
6
|
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
@@ -521,10 +521,11 @@ interface ChainConfig {
|
|
|
521
521
|
symbol: string;
|
|
522
522
|
decimals: number;
|
|
523
523
|
};
|
|
524
|
-
|
|
524
|
+
rpcUrls: string[];
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
interface TokenConfig extends ChainConfig {
|
|
528
|
+
name: string;
|
|
528
529
|
symbol: string;
|
|
529
530
|
decimals: number;
|
|
530
531
|
icon: string;
|
|
@@ -594,10 +595,14 @@ interface GetAllQuoteParams {
|
|
|
594
595
|
amountWei: string;
|
|
595
596
|
slippageTolerance: number;
|
|
596
597
|
minInputAmount?: string;
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
598
|
+
oneclickParams?: {
|
|
599
|
+
appFees?: {
|
|
600
|
+
recipient: string;
|
|
601
|
+
fee: number;
|
|
602
|
+
}[];
|
|
603
|
+
swapType?: "EXACT_INPUT" | "EXACT_OUTPUT";
|
|
604
|
+
isProxy?: boolean;
|
|
605
|
+
};
|
|
601
606
|
}
|
|
602
607
|
/**
|
|
603
608
|
* StableFlow AI Service
|
|
@@ -698,6 +703,135 @@ declare class SFA {
|
|
|
698
703
|
}>;
|
|
699
704
|
}
|
|
700
705
|
|
|
706
|
+
declare class EVMWallet {
|
|
707
|
+
provider: any;
|
|
708
|
+
signer: any;
|
|
709
|
+
constructor(_provider: any, _signer?: any);
|
|
710
|
+
transfer(data: {
|
|
711
|
+
originAsset: string;
|
|
712
|
+
depositAddress: string;
|
|
713
|
+
amount: string;
|
|
714
|
+
}): Promise<any>;
|
|
715
|
+
getBalance(token: any, account: string): Promise<any>;
|
|
716
|
+
balanceOf(token: any, account: string): Promise<any>;
|
|
717
|
+
/**
|
|
718
|
+
* Estimate gas limit for transfer transaction
|
|
719
|
+
* @param data Transfer data
|
|
720
|
+
* @returns Gas limit estimate, gas price, and estimated gas cost
|
|
721
|
+
*/
|
|
722
|
+
estimateTransferGas(data: {
|
|
723
|
+
originAsset: string;
|
|
724
|
+
depositAddress: string;
|
|
725
|
+
amount: string;
|
|
726
|
+
}): Promise<{
|
|
727
|
+
gasLimit: bigint;
|
|
728
|
+
gasPrice: bigint;
|
|
729
|
+
estimateGas: bigint;
|
|
730
|
+
}>;
|
|
731
|
+
getContract(params: any): ethers.Contract;
|
|
732
|
+
allowance(params: any): Promise<{
|
|
733
|
+
contract: ethers.Contract;
|
|
734
|
+
allowance: string;
|
|
735
|
+
needApprove: boolean;
|
|
736
|
+
}>;
|
|
737
|
+
approve(params: any): Promise<boolean>;
|
|
738
|
+
getEstimateGas(params: any): Promise<{
|
|
739
|
+
gasPrice: any;
|
|
740
|
+
usd: string;
|
|
741
|
+
wei: bigint;
|
|
742
|
+
amount: string;
|
|
743
|
+
}>;
|
|
744
|
+
quoteOFT(params: any): Promise<any>;
|
|
745
|
+
sendTransaction(params: any): Promise<any>;
|
|
746
|
+
/**
|
|
747
|
+
* Unified quote method that routes to specific quote methods based on type
|
|
748
|
+
* @param type Service type from ServiceType
|
|
749
|
+
* @param params Parameters for the quote
|
|
750
|
+
*/
|
|
751
|
+
quote(type: ServiceType, params: any): Promise<any>;
|
|
752
|
+
/**
|
|
753
|
+
* Unified send method that routes to specific send methods based on type
|
|
754
|
+
* @param type Send type from SendType enum
|
|
755
|
+
* @param params Parameters for the send transaction
|
|
756
|
+
*/
|
|
757
|
+
send(type: SendType, params: any): Promise<any>;
|
|
758
|
+
quoteCCTP(params: any): Promise<any>;
|
|
759
|
+
quoteOneClickProxy(params: any): Promise<any>;
|
|
760
|
+
signTypedData(params: any): Promise<any>;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
declare class HyperliquidService {
|
|
764
|
+
quote(params: HyperliquidQuoteParams): Promise<{
|
|
765
|
+
quote: any;
|
|
766
|
+
error: string | null;
|
|
767
|
+
}>;
|
|
768
|
+
transfer(params: HyperliquidTransferParams): Promise<string>;
|
|
769
|
+
deposit(params: HyperliquidDepositParams): Promise<HyperliquidDepositResponse>;
|
|
770
|
+
getStatus(params: HyperliquidGetStatusParams): Promise<HyperliquidDepositStatusResponse>;
|
|
771
|
+
protected generatePermit(params: HyperliquidGeneratePermitParams): Promise<{
|
|
772
|
+
amount: string;
|
|
773
|
+
deadline: number;
|
|
774
|
+
owner: string;
|
|
775
|
+
r: string;
|
|
776
|
+
s: string;
|
|
777
|
+
spender: string;
|
|
778
|
+
token: string;
|
|
779
|
+
v: 28 | 27;
|
|
780
|
+
nonce: number;
|
|
781
|
+
}>;
|
|
782
|
+
}
|
|
783
|
+
declare const Hyperliquid: HyperliquidService;
|
|
784
|
+
declare const HyperliquidFromTokens: TokenConfig[];
|
|
785
|
+
declare const HyperliuquidToToken: TokenConfig;
|
|
786
|
+
declare const HyperliuquidMinAmount: string;
|
|
787
|
+
interface HyperliquidQuoteParams {
|
|
788
|
+
slippageTolerance: number;
|
|
789
|
+
refundTo: string;
|
|
790
|
+
recipient: string;
|
|
791
|
+
wallet: WalletConfig;
|
|
792
|
+
fromToken: TokenConfig;
|
|
793
|
+
prices: Record<string, string>;
|
|
794
|
+
amountWei: string;
|
|
795
|
+
dry?: boolean;
|
|
796
|
+
oneclickParams?: {
|
|
797
|
+
appFees?: {
|
|
798
|
+
recipient: string;
|
|
799
|
+
fee: number;
|
|
800
|
+
}[];
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
interface HyperliquidTransferParams {
|
|
804
|
+
wallet: WalletConfig;
|
|
805
|
+
evmWallet: EVMWallet;
|
|
806
|
+
evmWalletAddress: string;
|
|
807
|
+
quote: any;
|
|
808
|
+
}
|
|
809
|
+
interface HyperliquidGeneratePermitParams {
|
|
810
|
+
address: string;
|
|
811
|
+
evmWallet: EVMWallet;
|
|
812
|
+
amountWei: string;
|
|
813
|
+
}
|
|
814
|
+
interface HyperliquidDepositParams extends HyperliquidTransferParams {
|
|
815
|
+
txhash: string;
|
|
816
|
+
}
|
|
817
|
+
interface HyperliquidGetStatusParams {
|
|
818
|
+
depositId: string;
|
|
819
|
+
}
|
|
820
|
+
interface HyperliquidResponse<T> {
|
|
821
|
+
code: number;
|
|
822
|
+
data: T;
|
|
823
|
+
}
|
|
824
|
+
interface HyperliquidDepositResponseData {
|
|
825
|
+
depositId: number;
|
|
826
|
+
}
|
|
827
|
+
type HyperliquidDepositResponse = HyperliquidResponse<HyperliquidDepositResponseData>;
|
|
828
|
+
type HyperliquidDepositStatus = "PROCESSING" | "SUCCESS" | "REFUNDED" | "FAILED";
|
|
829
|
+
interface HyperliquidDepositStatusResponseData {
|
|
830
|
+
status: HyperliquidDepositStatus;
|
|
831
|
+
txHash: string;
|
|
832
|
+
}
|
|
833
|
+
type HyperliquidDepositStatusResponse = HyperliquidResponse<HyperliquidDepositStatusResponseData>;
|
|
834
|
+
|
|
701
835
|
declare const tokens: TokenConfig[];
|
|
702
836
|
declare const usdtTokens: TokenConfig[];
|
|
703
837
|
declare const usdcTokens: TokenConfig[];
|
|
@@ -806,67 +940,13 @@ declare class SolanaWallet {
|
|
|
806
940
|
send(type: SendType, params: any): Promise<string>;
|
|
807
941
|
quoteOneClickProxy(params: any): Promise<any>;
|
|
808
942
|
quoteCCTP(params: any): Promise<any>;
|
|
809
|
-
createAssociatedTokenAddress(params: any): Promise<PublicKey>;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
declare class EVMWallet {
|
|
813
|
-
provider: any;
|
|
814
|
-
signer: any;
|
|
815
|
-
constructor(_provider: any, _signer?: any);
|
|
816
|
-
transfer(data: {
|
|
817
|
-
originAsset: string;
|
|
818
|
-
depositAddress: string;
|
|
819
|
-
amount: string;
|
|
820
|
-
}): Promise<any>;
|
|
821
|
-
getBalance(token: any, account: string): Promise<any>;
|
|
822
|
-
balanceOf(token: any, account: string): Promise<any>;
|
|
823
|
-
/**
|
|
824
|
-
* Estimate gas limit for transfer transaction
|
|
825
|
-
* @param data Transfer data
|
|
826
|
-
* @returns Gas limit estimate, gas price, and estimated gas cost
|
|
827
|
-
*/
|
|
828
|
-
estimateTransferGas(data: {
|
|
829
|
-
originAsset: string;
|
|
830
|
-
depositAddress: string;
|
|
831
|
-
amount: string;
|
|
832
|
-
}): Promise<{
|
|
833
|
-
gasLimit: bigint;
|
|
834
|
-
gasPrice: bigint;
|
|
835
|
-
estimateGas: bigint;
|
|
836
|
-
}>;
|
|
837
|
-
getContract(params: any): ethers.Contract;
|
|
838
|
-
allowance(params: any): Promise<{
|
|
839
|
-
contract: ethers.Contract;
|
|
840
|
-
allowance: string;
|
|
841
|
-
needApprove: boolean;
|
|
842
|
-
}>;
|
|
843
|
-
approve(params: any): Promise<boolean>;
|
|
844
|
-
getEstimateGas(params: any): Promise<{
|
|
845
|
-
gasPrice: any;
|
|
846
|
-
usd: string;
|
|
847
|
-
wei: bigint;
|
|
848
|
-
amount: string;
|
|
849
|
-
}>;
|
|
850
943
|
quoteOFT(params: any): Promise<any>;
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* Unified quote method that routes to specific quote methods based on type
|
|
854
|
-
* @param type Service type from ServiceType
|
|
855
|
-
* @param params Parameters for the quote
|
|
856
|
-
*/
|
|
857
|
-
quote(type: ServiceType, params: any): Promise<any>;
|
|
858
|
-
/**
|
|
859
|
-
* Unified send method that routes to specific send methods based on type
|
|
860
|
-
* @param type Send type from SendType enum
|
|
861
|
-
* @param params Parameters for the send transaction
|
|
862
|
-
*/
|
|
863
|
-
send(type: SendType, params: any): Promise<any>;
|
|
864
|
-
quoteCCTP(params: any): Promise<any>;
|
|
865
|
-
quoteOneClickProxy(params: any): Promise<any>;
|
|
944
|
+
createAssociatedTokenAddress(params: any): Promise<PublicKey>;
|
|
866
945
|
}
|
|
867
946
|
|
|
868
947
|
declare class TronWallet {
|
|
869
948
|
private signAndSendTransaction;
|
|
949
|
+
private address;
|
|
870
950
|
private tronWeb;
|
|
871
951
|
constructor(options: any);
|
|
872
952
|
waitForTronWeb(): Promise<unknown>;
|
|
@@ -882,10 +962,10 @@ declare class TronWallet {
|
|
|
882
962
|
getTokenBalance(contractAddress: string, account: string): Promise<any>;
|
|
883
963
|
balanceOf(token: any, account: string): Promise<any>;
|
|
884
964
|
/**
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
965
|
+
* Estimate gas limit for transfer transaction
|
|
966
|
+
* @param data Transfer data
|
|
967
|
+
* @returns Gas limit estimate (bandwidth or energy), gas price, and estimated gas cost
|
|
968
|
+
*/
|
|
889
969
|
estimateTransferGas(data: {
|
|
890
970
|
originAsset: string;
|
|
891
971
|
depositAddress: string;
|
|
@@ -896,6 +976,7 @@ declare class TronWallet {
|
|
|
896
976
|
estimateGas: bigint;
|
|
897
977
|
}>;
|
|
898
978
|
checkTransactionStatus(txHash: string): Promise<boolean>;
|
|
979
|
+
getTransactionResult(txHash: string): Promise<any>;
|
|
899
980
|
allowance(params: any): Promise<{
|
|
900
981
|
contract: any;
|
|
901
982
|
allowance: string;
|
|
@@ -919,6 +1000,7 @@ declare class TronWallet {
|
|
|
919
1000
|
*/
|
|
920
1001
|
send(type: SendType, params: any): Promise<any>;
|
|
921
1002
|
quoteOneClickProxy(params: any): Promise<any>;
|
|
1003
|
+
getAccountResources(params: any): Promise<any>;
|
|
922
1004
|
}
|
|
923
1005
|
|
|
924
1006
|
declare class AptosWallet {
|
|
@@ -972,6 +1054,8 @@ declare class AptosWallet {
|
|
|
972
1054
|
send(type: SendType, params: any): Promise<any>;
|
|
973
1055
|
}
|
|
974
1056
|
|
|
975
|
-
declare const
|
|
1057
|
+
declare const NetworkRpcUrlsMap: Record<string, string[]>;
|
|
1058
|
+
declare const getRpcUrls: (blockchain: string) => string[];
|
|
1059
|
+
declare const setRpcUrls: (urls: Record<string, string[]>) => Record<string, string[]>;
|
|
976
1060
|
|
|
977
|
-
export { ApiError, type AppFee, AptosWallet, type BadRequestResponse, CancelError, CancelablePromise, EVMWallet, type GetAllQuoteParams, GetExecutionStatusResponse, NearWallet, OpenAPI, type OpenAPIConfig, type Quote, QuoteRequest, type QuoteResponse, SFA, Service, type ServiceType, SolanaWallet, type SubmitDepositTxRequest, SubmitDepositTxResponse, type SwapDetails, type TokenConfig, TokenResponse, type TransactionDetails, TransactionStatus, TronWallet,
|
|
1061
|
+
export { ApiError, type AppFee, AptosWallet, type BadRequestResponse, CancelError, CancelablePromise, EVMWallet, type GetAllQuoteParams, GetExecutionStatusResponse, Hyperliquid, type HyperliquidDepositParams, type HyperliquidDepositResponse, type HyperliquidDepositResponseData, type HyperliquidDepositStatusResponse, type HyperliquidDepositStatusResponseData, HyperliquidFromTokens, type HyperliquidGetStatusParams, type HyperliquidQuoteParams, type HyperliquidTransferParams, HyperliuquidMinAmount, HyperliuquidToToken, NearWallet, NetworkRpcUrlsMap, OpenAPI, type OpenAPIConfig, type Quote, QuoteRequest, type QuoteResponse, SFA, Service, type ServiceType, SolanaWallet, type SubmitDepositTxRequest, SubmitDepositTxResponse, type SwapDetails, type TokenConfig, TokenResponse, type TransactionDetails, TransactionStatus, TronWallet, getRpcUrls, setRpcUrls, tokens, usdcChains, usdcTokens, usdtChains, usdtTokens };
|