@xswap-link/sdk 0.0.8 → 0.0.10
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 +12 -0
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/package.json +1 -1
- package/src/models/Prices.ts +9 -0
- package/src/models/Route.ts +3 -0
- package/src/models/index.ts +1 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -125,6 +125,7 @@ type XSwapFees = {
|
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
type Route = {
|
|
128
|
+
type: RouteType;
|
|
128
129
|
originChainXSwapCalls: ContractCall[];
|
|
129
130
|
originProtocols: Protocol[][][];
|
|
130
131
|
destinationChainXSwapCalls: ContractCall[];
|
|
@@ -142,6 +143,7 @@ type Route = {
|
|
|
142
143
|
xSwapFees: XSwapFees;
|
|
143
144
|
message?: string;
|
|
144
145
|
};
|
|
146
|
+
type RouteType = "single-chain" | "cross-chain";
|
|
145
147
|
|
|
146
148
|
type Referral = {
|
|
147
149
|
address: string;
|
|
@@ -153,6 +155,15 @@ type ReferralInfo = {
|
|
|
153
155
|
ipAddress: string;
|
|
154
156
|
};
|
|
155
157
|
|
|
158
|
+
type Prices = {
|
|
159
|
+
blockchainId: string;
|
|
160
|
+
updatedAt: Date;
|
|
161
|
+
prices: TokenPrice;
|
|
162
|
+
};
|
|
163
|
+
type TokenPrice = {
|
|
164
|
+
[tokenAddress: string]: string;
|
|
165
|
+
};
|
|
166
|
+
|
|
156
167
|
declare const DEFAULT_API_URL = "https://xswap.link/api";
|
|
157
168
|
declare const DEFAULT_DB_ERROR = "No data for provided parameters";
|
|
158
169
|
declare const DEFAULT_ECOSYSTEM = Ecosystem.EVM;
|
|
@@ -358,4 +369,4 @@ declare const generateApproveTxData: (tokenAddress: string, spender: string, amo
|
|
|
358
369
|
data: string;
|
|
359
370
|
};
|
|
360
371
|
|
|
361
|
-
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 Protocol, type Referral, type ReferralInfo, type Route, type Token, Web3Environment, XSwapCallType, type XSwapFee, type XSwapFees, XSwapRouterAbi, generateApproveTxData, getBridgeTokens, getChainData, getChains, getRoute, getTokens, safeBigNumberFrom };
|
|
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 RouteType, type Token, type TokenPrice, Web3Environment, XSwapCallType, type XSwapFee, type XSwapFees, XSwapRouterAbi, generateApproveTxData, getBridgeTokens, getChainData, getChains, getRoute, getTokens, safeBigNumberFrom };
|
package/dist/index.d.ts
CHANGED
|
@@ -125,6 +125,7 @@ type XSwapFees = {
|
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
type Route = {
|
|
128
|
+
type: RouteType;
|
|
128
129
|
originChainXSwapCalls: ContractCall[];
|
|
129
130
|
originProtocols: Protocol[][][];
|
|
130
131
|
destinationChainXSwapCalls: ContractCall[];
|
|
@@ -142,6 +143,7 @@ type Route = {
|
|
|
142
143
|
xSwapFees: XSwapFees;
|
|
143
144
|
message?: string;
|
|
144
145
|
};
|
|
146
|
+
type RouteType = "single-chain" | "cross-chain";
|
|
145
147
|
|
|
146
148
|
type Referral = {
|
|
147
149
|
address: string;
|
|
@@ -153,6 +155,15 @@ type ReferralInfo = {
|
|
|
153
155
|
ipAddress: string;
|
|
154
156
|
};
|
|
155
157
|
|
|
158
|
+
type Prices = {
|
|
159
|
+
blockchainId: string;
|
|
160
|
+
updatedAt: Date;
|
|
161
|
+
prices: TokenPrice;
|
|
162
|
+
};
|
|
163
|
+
type TokenPrice = {
|
|
164
|
+
[tokenAddress: string]: string;
|
|
165
|
+
};
|
|
166
|
+
|
|
156
167
|
declare const DEFAULT_API_URL = "https://xswap.link/api";
|
|
157
168
|
declare const DEFAULT_DB_ERROR = "No data for provided parameters";
|
|
158
169
|
declare const DEFAULT_ECOSYSTEM = Ecosystem.EVM;
|
|
@@ -358,4 +369,4 @@ declare const generateApproveTxData: (tokenAddress: string, spender: string, amo
|
|
|
358
369
|
data: string;
|
|
359
370
|
};
|
|
360
371
|
|
|
361
|
-
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 Protocol, type Referral, type ReferralInfo, type Route, type Token, Web3Environment, XSwapCallType, type XSwapFee, type XSwapFees, XSwapRouterAbi, generateApproveTxData, getBridgeTokens, getChainData, getChains, getRoute, getTokens, safeBigNumberFrom };
|
|
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 RouteType, 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
|
@@ -5,6 +5,7 @@ import { XSwapFees } from "./XSwapFees";
|
|
|
5
5
|
import { Protocol } from "./Protocol";
|
|
6
6
|
|
|
7
7
|
export type Route = {
|
|
8
|
+
type: RouteType;
|
|
8
9
|
originChainXSwapCalls: ContractCall[];
|
|
9
10
|
originProtocols: Protocol[][][];
|
|
10
11
|
destinationChainXSwapCalls: ContractCall[];
|
|
@@ -22,3 +23,5 @@ export type Route = {
|
|
|
22
23
|
xSwapFees: XSwapFees;
|
|
23
24
|
message?: string;
|
|
24
25
|
};
|
|
26
|
+
|
|
27
|
+
export type RouteType = "single-chain" | "cross-chain";
|
package/src/models/index.ts
CHANGED