@shapeshiftoss/swapper 17.4.2 → 17.5.0
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/dist/api.d.ts
CHANGED
|
@@ -44,6 +44,12 @@ declare type ChainSpecificQuoteFeeData<T extends ChainId> = ChainSpecific<T, {
|
|
|
44
44
|
approvalFeeCryptoBaseUnit?: string;
|
|
45
45
|
totalFee?: string;
|
|
46
46
|
};
|
|
47
|
+
[KnownChainIds.BnbSmartChainMainnet]: {
|
|
48
|
+
estimatedGas?: string;
|
|
49
|
+
gasPriceCryptoBaseUnit?: string;
|
|
50
|
+
approvalFeeCryptoBaseUnit?: string;
|
|
51
|
+
totalFee?: string;
|
|
52
|
+
};
|
|
47
53
|
[KnownChainIds.BitcoinMainnet]: {
|
|
48
54
|
byteCount: string;
|
|
49
55
|
satsPerByte: string;
|
|
@@ -175,7 +181,8 @@ export declare enum SwapperName {
|
|
|
175
181
|
Osmosis = "Osmosis",
|
|
176
182
|
CowSwap = "CoW Swap",
|
|
177
183
|
Zrx = "0x",
|
|
178
|
-
Test = "Test"
|
|
184
|
+
Test = "Test",
|
|
185
|
+
LIFI = "LI.FI"
|
|
179
186
|
}
|
|
180
187
|
export declare enum SwapperType {
|
|
181
188
|
ZrxEthereum = "0xEthereum",
|
|
@@ -184,7 +191,8 @@ export declare enum SwapperType {
|
|
|
184
191
|
Thorchain = "Thorchain",
|
|
185
192
|
Osmosis = "Osmosis",
|
|
186
193
|
CowSwap = "CoW Swap",
|
|
187
|
-
Test = "Test"
|
|
194
|
+
Test = "Test",
|
|
195
|
+
LIFI = "LI.FI"
|
|
188
196
|
}
|
|
189
197
|
export declare type TradeTxs = {
|
|
190
198
|
sellTxid: string;
|
package/dist/api.js
CHANGED
|
@@ -11,6 +11,7 @@ var SwapperName;
|
|
|
11
11
|
SwapperName["CowSwap"] = "CoW Swap";
|
|
12
12
|
SwapperName["Zrx"] = "0x";
|
|
13
13
|
SwapperName["Test"] = "Test";
|
|
14
|
+
SwapperName["LIFI"] = "LI.FI";
|
|
14
15
|
})(SwapperName = exports.SwapperName || (exports.SwapperName = {}));
|
|
15
16
|
var SwapperType;
|
|
16
17
|
(function (SwapperType) {
|
|
@@ -21,6 +22,7 @@ var SwapperType;
|
|
|
21
22
|
SwapperType["Osmosis"] = "Osmosis";
|
|
22
23
|
SwapperType["CowSwap"] = "CoW Swap";
|
|
23
24
|
SwapperType["Test"] = "Test";
|
|
25
|
+
SwapperType["LIFI"] = "LI.FI";
|
|
24
26
|
})(SwapperType = exports.SwapperType || (exports.SwapperType = {}));
|
|
25
27
|
// Swap Errors
|
|
26
28
|
var SwapErrorType;
|
|
@@ -35,7 +35,7 @@ declare type GrantAllowanceArgs<T extends EvmChainId> = {
|
|
|
35
35
|
};
|
|
36
36
|
export declare const getERC20Allowance: ({ erc20AllowanceAbi, web3, sellAssetErc20Address, ownerAddress, spenderAddress, }: GetERC20AllowanceArgs) => Promise<any>;
|
|
37
37
|
export declare const isApprovalRequired: ({ adapter, receiveAddress, allowanceContract, sellAsset, sellAmountExcludeFeeCryptoBaseUnit, web3, erc20AllowanceAbi, }: IsApprovalRequiredArgs) => Promise<boolean>;
|
|
38
|
-
export declare const grantAllowance: <T extends import("@shapeshiftoss/types").KnownChainIds.EthereumMainnet | import("@shapeshiftoss/types").KnownChainIds.AvalancheMainnet | import("@shapeshiftoss/types").KnownChainIds.OptimismMainnet>({ quote, wallet, adapter, erc20Abi, web3, }: GrantAllowanceArgs<T>) => Promise<string>;
|
|
38
|
+
export declare const grantAllowance: <T extends import("@shapeshiftoss/types").KnownChainIds.EthereumMainnet | import("@shapeshiftoss/types").KnownChainIds.AvalancheMainnet | import("@shapeshiftoss/types").KnownChainIds.OptimismMainnet | import("@shapeshiftoss/types").KnownChainIds.BnbSmartChainMainnet>({ quote, wallet, adapter, erc20Abi, web3, }: GrantAllowanceArgs<T>) => Promise<string>;
|
|
39
39
|
/**
|
|
40
40
|
* This function keeps 17 significant digits, so even if we try to trade 1 Billion of an
|
|
41
41
|
* ETH or ERC20, we still keep 7 decimal places.
|
|
@@ -63,7 +63,7 @@ const grantAllowance = async ({ quote, wallet, adapter, erc20Abi, web3, }) => {
|
|
|
63
63
|
accountNumber,
|
|
64
64
|
value: '0',
|
|
65
65
|
chainSpecific: {
|
|
66
|
-
|
|
66
|
+
tokenContractAddress: sellAssetErc20Address,
|
|
67
67
|
gasPrice: (0, web3_utils_1.numberToHex)(((_b = (_a = quote.feeData) === null || _a === void 0 ? void 0 : _a.chainSpecific) === null || _b === void 0 ? void 0 : _b.gasPriceCryptoBaseUnit) || 0),
|
|
68
68
|
gasLimit: (0, web3_utils_1.numberToHex)(((_d = (_c = quote.feeData) === null || _c === void 0 ? void 0 : _c.chainSpecific) === null || _d === void 0 ? void 0 : _d.estimatedGas) || 0),
|
|
69
69
|
},
|
|
@@ -18,7 +18,7 @@ export declare const setupBuildTrade: () => {
|
|
|
18
18
|
accountNumber: number;
|
|
19
19
|
receiveAccountNumber?: number | undefined;
|
|
20
20
|
} & {
|
|
21
|
-
chainId: KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet;
|
|
21
|
+
chainId: KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet;
|
|
22
22
|
} & {
|
|
23
23
|
slippage?: string | undefined;
|
|
24
24
|
wallet: HDWallet;
|
package/package.json
CHANGED