@xswap-link/sdk 0.0.10 → 0.0.11
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/CHANGELOG.md +6 -0
- package/dist/index.d.mts +8 -18
- package/dist/index.d.ts +8 -18
- package/package.json +1 -1
- package/src/models/Route.ts +1 -15
- package/src/models/XSwapFee.ts +2 -2
- package/src/models/XSwapFees.ts +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BigNumberish, BigNumber, ethers } from 'ethers';
|
|
2
1
|
import { TransactionRequest } from '@ethersproject/providers';
|
|
2
|
+
import { BigNumber, BigNumberish, ethers } from 'ethers';
|
|
3
3
|
|
|
4
4
|
type ApiOverrides = {
|
|
5
5
|
apiUrl?: string;
|
|
@@ -114,36 +114,26 @@ type Protocol = {
|
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
type XSwapFee = {
|
|
117
|
-
tokenFee
|
|
118
|
-
nativeFee
|
|
117
|
+
tokenFee?: string;
|
|
118
|
+
nativeFee?: string;
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
type XSwapFees = {
|
|
122
|
-
ccipFee
|
|
123
|
-
xSwapFee
|
|
124
|
-
expressDeliveryFee
|
|
122
|
+
ccipFee?: string;
|
|
123
|
+
xSwapFee?: XSwapFee;
|
|
124
|
+
expressDeliveryFee?: string;
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
type Route = {
|
|
128
|
-
type: RouteType;
|
|
129
|
-
originChainXSwapCalls: ContractCall[];
|
|
130
|
-
originProtocols: Protocol[][][];
|
|
131
|
-
destinationChainXSwapCalls: ContractCall[];
|
|
132
|
-
destinationProtocols: Protocol[][][];
|
|
133
|
-
originCrossChainTransferToken: string;
|
|
134
|
-
destinationCrossChainTransferToken: string;
|
|
135
|
-
amountToTransferCrossChain: BigNumberish;
|
|
136
128
|
estAmountOut: string;
|
|
137
129
|
minAmountOut: string;
|
|
138
|
-
estimatedGasDestination: number;
|
|
139
130
|
transactions: {
|
|
140
131
|
approve: TransactionRequest;
|
|
141
132
|
swap: TransactionRequest;
|
|
142
133
|
};
|
|
143
|
-
xSwapFees
|
|
134
|
+
xSwapFees?: XSwapFees;
|
|
144
135
|
message?: string;
|
|
145
136
|
};
|
|
146
|
-
type RouteType = "single-chain" | "cross-chain";
|
|
147
137
|
|
|
148
138
|
type Referral = {
|
|
149
139
|
address: string;
|
|
@@ -369,4 +359,4 @@ declare const generateApproveTxData: (tokenAddress: string, spender: string, amo
|
|
|
369
359
|
data: string;
|
|
370
360
|
};
|
|
371
361
|
|
|
372
|
-
export { type AddReferralPayload, type ApiOverrides, type BridgeToken, type Chain, type CoinTypeAddress, type CollectFees, type ContractCall, DEFAULT_API_URL, DEFAULT_DB_ERROR, DEFAULT_ECOSYSTEM, DEFAULT_GAS_LIMIT_MULTIPLIER, DEFAULT_NATIVE_FEE_MULTIPLIER_PERCENTAGE, ERC20Abi, Ecosystem, Environment, type GetRoutePayload, type Prices, type Protocol, type Referral, type ReferralInfo, type Route, type
|
|
362
|
+
export { type AddReferralPayload, type ApiOverrides, type BridgeToken, type Chain, type CoinTypeAddress, type CollectFees, type ContractCall, DEFAULT_API_URL, DEFAULT_DB_ERROR, DEFAULT_ECOSYSTEM, DEFAULT_GAS_LIMIT_MULTIPLIER, DEFAULT_NATIVE_FEE_MULTIPLIER_PERCENTAGE, ERC20Abi, Ecosystem, Environment, type GetRoutePayload, type Prices, type Protocol, type Referral, type ReferralInfo, type Route, type Token, type TokenPrice, Web3Environment, XSwapCallType, type XSwapFee, type XSwapFees, XSwapRouterAbi, generateApproveTxData, getBridgeTokens, getChainData, getChains, getRoute, getTokens, safeBigNumberFrom };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BigNumberish, BigNumber, ethers } from 'ethers';
|
|
2
1
|
import { TransactionRequest } from '@ethersproject/providers';
|
|
2
|
+
import { BigNumber, BigNumberish, ethers } from 'ethers';
|
|
3
3
|
|
|
4
4
|
type ApiOverrides = {
|
|
5
5
|
apiUrl?: string;
|
|
@@ -114,36 +114,26 @@ type Protocol = {
|
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
type XSwapFee = {
|
|
117
|
-
tokenFee
|
|
118
|
-
nativeFee
|
|
117
|
+
tokenFee?: string;
|
|
118
|
+
nativeFee?: string;
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
type XSwapFees = {
|
|
122
|
-
ccipFee
|
|
123
|
-
xSwapFee
|
|
124
|
-
expressDeliveryFee
|
|
122
|
+
ccipFee?: string;
|
|
123
|
+
xSwapFee?: XSwapFee;
|
|
124
|
+
expressDeliveryFee?: string;
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
type Route = {
|
|
128
|
-
type: RouteType;
|
|
129
|
-
originChainXSwapCalls: ContractCall[];
|
|
130
|
-
originProtocols: Protocol[][][];
|
|
131
|
-
destinationChainXSwapCalls: ContractCall[];
|
|
132
|
-
destinationProtocols: Protocol[][][];
|
|
133
|
-
originCrossChainTransferToken: string;
|
|
134
|
-
destinationCrossChainTransferToken: string;
|
|
135
|
-
amountToTransferCrossChain: BigNumberish;
|
|
136
128
|
estAmountOut: string;
|
|
137
129
|
minAmountOut: string;
|
|
138
|
-
estimatedGasDestination: number;
|
|
139
130
|
transactions: {
|
|
140
131
|
approve: TransactionRequest;
|
|
141
132
|
swap: TransactionRequest;
|
|
142
133
|
};
|
|
143
|
-
xSwapFees
|
|
134
|
+
xSwapFees?: XSwapFees;
|
|
144
135
|
message?: string;
|
|
145
136
|
};
|
|
146
|
-
type RouteType = "single-chain" | "cross-chain";
|
|
147
137
|
|
|
148
138
|
type Referral = {
|
|
149
139
|
address: string;
|
|
@@ -369,4 +359,4 @@ declare const generateApproveTxData: (tokenAddress: string, spender: string, amo
|
|
|
369
359
|
data: string;
|
|
370
360
|
};
|
|
371
361
|
|
|
372
|
-
export { type AddReferralPayload, type ApiOverrides, type BridgeToken, type Chain, type CoinTypeAddress, type CollectFees, type ContractCall, DEFAULT_API_URL, DEFAULT_DB_ERROR, DEFAULT_ECOSYSTEM, DEFAULT_GAS_LIMIT_MULTIPLIER, DEFAULT_NATIVE_FEE_MULTIPLIER_PERCENTAGE, ERC20Abi, Ecosystem, Environment, type GetRoutePayload, type Prices, type Protocol, type Referral, type ReferralInfo, type Route, type
|
|
362
|
+
export { type AddReferralPayload, type ApiOverrides, type BridgeToken, type Chain, type CoinTypeAddress, type CollectFees, type ContractCall, DEFAULT_API_URL, DEFAULT_DB_ERROR, DEFAULT_ECOSYSTEM, DEFAULT_GAS_LIMIT_MULTIPLIER, DEFAULT_NATIVE_FEE_MULTIPLIER_PERCENTAGE, ERC20Abi, Ecosystem, Environment, type GetRoutePayload, type Prices, type Protocol, type Referral, type ReferralInfo, type Route, type Token, type TokenPrice, Web3Environment, XSwapCallType, type XSwapFee, type XSwapFees, XSwapRouterAbi, generateApproveTxData, getBridgeTokens, getChainData, getChains, getRoute, getTokens, safeBigNumberFrom };
|
package/package.json
CHANGED
package/src/models/Route.ts
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import { BigNumberish } from "ethers";
|
|
2
1
|
import { TransactionRequest } from "@ethersproject/providers";
|
|
3
|
-
import { ContractCall } from "./ContractCall";
|
|
4
2
|
import { XSwapFees } from "./XSwapFees";
|
|
5
|
-
import { Protocol } from "./Protocol";
|
|
6
3
|
|
|
7
4
|
export type Route = {
|
|
8
|
-
type: RouteType;
|
|
9
|
-
originChainXSwapCalls: ContractCall[];
|
|
10
|
-
originProtocols: Protocol[][][];
|
|
11
|
-
destinationChainXSwapCalls: ContractCall[];
|
|
12
|
-
destinationProtocols: Protocol[][][];
|
|
13
|
-
originCrossChainTransferToken: string;
|
|
14
|
-
destinationCrossChainTransferToken: string;
|
|
15
|
-
amountToTransferCrossChain: BigNumberish;
|
|
16
5
|
estAmountOut: string;
|
|
17
6
|
minAmountOut: string;
|
|
18
|
-
estimatedGasDestination: number;
|
|
19
7
|
transactions: {
|
|
20
8
|
approve: TransactionRequest;
|
|
21
9
|
swap: TransactionRequest;
|
|
22
10
|
};
|
|
23
|
-
xSwapFees
|
|
11
|
+
xSwapFees?: XSwapFees;
|
|
24
12
|
message?: string;
|
|
25
13
|
};
|
|
26
|
-
|
|
27
|
-
export type RouteType = "single-chain" | "cross-chain";
|
package/src/models/XSwapFee.ts
CHANGED
package/src/models/XSwapFees.ts
CHANGED