@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @xswap-link/xswap-sdk
2
2
 
3
+ ## 0.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - e0d0400: update (simplify) Route model
8
+
3
9
  ## 0.0.10
4
10
 
5
11
  ### Patch Changes
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: string;
118
- nativeFee: string;
117
+ tokenFee?: string;
118
+ nativeFee?: string;
119
119
  };
120
120
 
121
121
  type XSwapFees = {
122
- ccipFee: string;
123
- xSwapFee: XSwapFee;
124
- expressDeliveryFee: string;
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: 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 RouteType, type Token, type TokenPrice, Web3Environment, XSwapCallType, type XSwapFee, type XSwapFees, XSwapRouterAbi, generateApproveTxData, getBridgeTokens, getChainData, getChains, getRoute, getTokens, safeBigNumberFrom };
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: string;
118
- nativeFee: string;
117
+ tokenFee?: string;
118
+ nativeFee?: string;
119
119
  };
120
120
 
121
121
  type XSwapFees = {
122
- ccipFee: string;
123
- xSwapFee: XSwapFee;
124
- expressDeliveryFee: string;
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: 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 RouteType, type Token, type TokenPrice, Web3Environment, XSwapCallType, type XSwapFee, type XSwapFees, XSwapRouterAbi, generateApproveTxData, getBridgeTokens, getChainData, getChains, getRoute, getTokens, safeBigNumberFrom };
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xswap-link/sdk",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "JavaScript SDK for XSwap platform",
5
5
  "homepage": "https://github.com/xswap-link/xswap-sdk",
6
6
  "repository": {
@@ -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: XSwapFees;
11
+ xSwapFees?: XSwapFees;
24
12
  message?: string;
25
13
  };
26
-
27
- export type RouteType = "single-chain" | "cross-chain";
@@ -1,4 +1,4 @@
1
1
  export type XSwapFee = {
2
- tokenFee: string;
3
- nativeFee: string;
2
+ tokenFee?: string;
3
+ nativeFee?: string;
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import { XSwapFee } from "./XSwapFee";
2
2
 
3
3
  export type XSwapFees = {
4
- ccipFee: string;
5
- xSwapFee: XSwapFee;
6
- expressDeliveryFee: string;
4
+ ccipFee?: string;
5
+ xSwapFee?: XSwapFee;
6
+ expressDeliveryFee?: string;
7
7
  };