@xswap-link/sdk 0.0.10 → 0.0.12

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,17 @@
1
1
  # @xswap-link/xswap-sdk
2
2
 
3
+ ## 0.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 1c756ea: make Route fees mandatory
8
+
9
+ ## 0.0.11
10
+
11
+ ### Patch Changes
12
+
13
+ - e0d0400: update (simplify) Route model
14
+
3
15
  ## 0.0.10
4
16
 
5
17
  ### 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;
@@ -119,23 +119,14 @@ type XSwapFee = {
119
119
  };
120
120
 
121
121
  type XSwapFees = {
122
- ccipFee: string;
122
+ ccipFee?: string;
123
123
  xSwapFee: XSwapFee;
124
- expressDeliveryFee: string;
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;
@@ -143,7 +134,6 @@ type Route = {
143
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;
@@ -119,23 +119,14 @@ type XSwapFee = {
119
119
  };
120
120
 
121
121
  type XSwapFees = {
122
- ccipFee: string;
122
+ ccipFee?: string;
123
123
  xSwapFee: XSwapFee;
124
- expressDeliveryFee: string;
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;
@@ -143,7 +134,6 @@ type Route = {
143
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.12",
4
4
  "description": "JavaScript SDK for XSwap platform",
5
5
  "homepage": "https://github.com/xswap-link/xswap-sdk",
6
6
  "repository": {
@@ -1,21 +1,9 @@
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;
@@ -23,5 +11,3 @@ export type Route = {
23
11
  xSwapFees: XSwapFees;
24
12
  message?: string;
25
13
  };
26
-
27
- export type RouteType = "single-chain" | "cross-chain";
@@ -1,7 +1,7 @@
1
1
  import { XSwapFee } from "./XSwapFee";
2
2
 
3
3
  export type XSwapFees = {
4
- ccipFee: string;
4
+ ccipFee?: string;
5
5
  xSwapFee: XSwapFee;
6
- expressDeliveryFee: string;
6
+ expressDeliveryFee?: string;
7
7
  };