@swapkit/core 1.0.0-rc.170 → 1.0.0-rc.171
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/index.js +2 -2
- package/dist/index.js.map +5 -30
- package/package.json +11 -9
- package/src/client.ts +72 -53
- package/src/helpers/explorerUrls.ts +2 -2
- package/src/aggregator/contracts/avaxGeneric.ts +0 -92
- package/src/aggregator/contracts/avaxWoofi.ts +0 -145
- package/src/aggregator/contracts/bscGeneric.ts +0 -106
- package/src/aggregator/contracts/ethGeneric.ts +0 -92
- package/src/aggregator/contracts/index.ts +0 -76
- package/src/aggregator/contracts/pancakeV2.ts +0 -145
- package/src/aggregator/contracts/pangolin.ts +0 -120
- package/src/aggregator/contracts/routers/index.ts +0 -58
- package/src/aggregator/contracts/routers/kyber.ts +0 -402
- package/src/aggregator/contracts/routers/oneinch.ts +0 -2188
- package/src/aggregator/contracts/routers/pancakeswap.ts +0 -340
- package/src/aggregator/contracts/routers/pangolin.ts +0 -340
- package/src/aggregator/contracts/routers/sushiswap.ts +0 -340
- package/src/aggregator/contracts/routers/traderJoe.ts +0 -340
- package/src/aggregator/contracts/routers/uniswapv2.ts +0 -340
- package/src/aggregator/contracts/routers/uniswapv3.ts +0 -254
- package/src/aggregator/contracts/routers/woofi.ts +0 -171
- package/src/aggregator/contracts/sushiswap.ts +0 -120
- package/src/aggregator/contracts/traderJoe.ts +0 -120
- package/src/aggregator/contracts/uniswapV2.ts +0 -120
- package/src/aggregator/contracts/uniswapV2Leg.ts +0 -128
- package/src/aggregator/contracts/uniswapV3_100.ts +0 -128
- package/src/aggregator/contracts/uniswapV3_10000.ts +0 -128
- package/src/aggregator/contracts/uniswapV3_3000.ts +0 -128
- package/src/aggregator/contracts/uniswapV3_500.ts +0 -128
- package/src/aggregator/getSwapParams.ts +0 -70
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-oss",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@swapkit/api": "
|
|
5
|
-
"@swapkit/
|
|
6
|
-
"@swapkit/
|
|
7
|
-
"@swapkit/
|
|
8
|
-
"@swapkit/toolbox-
|
|
9
|
-
"@swapkit/toolbox-
|
|
10
|
-
"@swapkit/toolbox-
|
|
4
|
+
"@swapkit/api": "undefined",
|
|
5
|
+
"@swapkit/contracts": "undefined",
|
|
6
|
+
"@swapkit/helpers": "undefined",
|
|
7
|
+
"@swapkit/plugin-evm": "1.0.0-rc.16",
|
|
8
|
+
"@swapkit/toolbox-cosmos": "1.0.0-rc.143",
|
|
9
|
+
"@swapkit/toolbox-evm": "1.0.0-rc.123",
|
|
10
|
+
"@swapkit/toolbox-solana": "1.0.0-rc.4",
|
|
11
|
+
"@swapkit/toolbox-substrate": "1.0.0-rc.51",
|
|
12
|
+
"@swapkit/toolbox-utxo": "1.0.0-rc.127"
|
|
11
13
|
},
|
|
12
14
|
"devDependencies": {
|
|
13
|
-
"@swapkit/tokens": "
|
|
15
|
+
"@swapkit/tokens": "undefined"
|
|
14
16
|
},
|
|
15
17
|
"description": "SwapKit - Core",
|
|
16
18
|
"files": [
|
|
@@ -36,5 +38,5 @@
|
|
|
36
38
|
},
|
|
37
39
|
"type": "module",
|
|
38
40
|
"types": "./src/index.ts",
|
|
39
|
-
"version": "1.0.0-rc.
|
|
41
|
+
"version": "1.0.0-rc.171"
|
|
40
42
|
}
|
package/src/client.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { lowercasedContractAbiMapping } from "@swapkit/contracts";
|
|
1
2
|
import {
|
|
2
3
|
type AddChainWalletParams,
|
|
3
4
|
ApproveMode,
|
|
@@ -15,20 +16,19 @@ import {
|
|
|
15
16
|
type WalletChain,
|
|
16
17
|
isGasAsset,
|
|
17
18
|
} from "@swapkit/helpers";
|
|
18
|
-
import {
|
|
19
|
-
type BaseEVMWallet,
|
|
20
|
-
type TransferParams as EVMTransferParams,
|
|
21
|
-
evmValidateAddress,
|
|
22
|
-
} from "@swapkit/toolbox-evm";
|
|
23
|
-
|
|
24
19
|
import {
|
|
25
20
|
type TransferParams as CosmosTransferParams,
|
|
26
21
|
estimateTransactionFee as cosmosTransactionFee,
|
|
27
22
|
cosmosValidateAddress,
|
|
28
23
|
} from "@swapkit/toolbox-cosmos";
|
|
24
|
+
import {
|
|
25
|
+
type BaseEVMWallet,
|
|
26
|
+
type TransferParams as EVMTransferParams,
|
|
27
|
+
evmValidateAddress,
|
|
28
|
+
} from "@swapkit/toolbox-evm";
|
|
29
29
|
import { substrateValidateAddress } from "@swapkit/toolbox-substrate";
|
|
30
30
|
import { type UTXOTransferParams, utxoValidateAddress } from "@swapkit/toolbox-utxo";
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
import {
|
|
33
33
|
getExplorerAddressUrl as getAddressUrl,
|
|
34
34
|
getExplorerTxUrl as getTxUrl,
|
|
@@ -335,6 +335,9 @@ export function SwapKit<
|
|
|
335
335
|
const { assetValue } = params;
|
|
336
336
|
const chain = params.assetValue.chain as WalletChain;
|
|
337
337
|
if (!connectedWallets[chain]) throw new SwapKitError("core_wallet_connection_not_found");
|
|
338
|
+
|
|
339
|
+
const baseValue = AssetValue.fromChainOrSignature(chain, 0);
|
|
340
|
+
|
|
338
341
|
switch (chain) {
|
|
339
342
|
case Chain.Arbitrum:
|
|
340
343
|
case Chain.Avalanche:
|
|
@@ -342,76 +345,92 @@ export function SwapKit<
|
|
|
342
345
|
case Chain.BinanceSmartChain:
|
|
343
346
|
case Chain.Polygon: {
|
|
344
347
|
const wallet = connectedWallets[chain as Exclude<EVMChain, Chain.Optimism>];
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
if (type === "approve" && !isGasAsset(assetValue)) {
|
|
350
|
-
wallet.estimateTransactionFee(
|
|
351
|
-
await wallet.createApprovalTx({
|
|
352
|
-
assetAddress: assetValue.address as string,
|
|
353
|
-
spenderAddress: params.contractAddress as string,
|
|
354
|
-
amount: assetValue.getBaseValue("bigint"),
|
|
355
|
-
from: wallet.address,
|
|
356
|
-
}),
|
|
357
|
-
feeOptionKey,
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
|
-
if (type === "swap") {
|
|
361
|
-
const plugin = params.route.providers[0] as PluginNameEnum;
|
|
362
|
-
if (plugin === PluginNameEnum.CHAINFLIP) {
|
|
363
|
-
const txObject = await wallet.createTransferTx({
|
|
364
|
-
from: wallet.address,
|
|
365
|
-
recipient: wallet.address,
|
|
366
|
-
assetValue,
|
|
367
|
-
});
|
|
348
|
+
switch (type) {
|
|
349
|
+
case "transfer": {
|
|
350
|
+
const txObject = await wallet.createTransferTx(params);
|
|
368
351
|
return wallet.estimateTransactionFee(txObject, feeOptionKey);
|
|
369
352
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
353
|
+
|
|
354
|
+
case "approve": {
|
|
355
|
+
if (isGasAsset(assetValue)) return baseValue;
|
|
356
|
+
|
|
357
|
+
return wallet.estimateTransactionFee(
|
|
358
|
+
await wallet.createApprovalTx({
|
|
359
|
+
assetAddress: assetValue.address as string,
|
|
360
|
+
spenderAddress: params.contractAddress as string,
|
|
361
|
+
amount: assetValue.getBaseValue("bigint"),
|
|
362
|
+
from: wallet.address,
|
|
363
|
+
}),
|
|
364
|
+
feeOptionKey,
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
case "swap": {
|
|
369
|
+
const plugin = params.route.providers[0] as PluginNameEnum;
|
|
370
|
+
if (plugin === PluginNameEnum.CHAINFLIP) {
|
|
371
|
+
const txObject = await wallet.createTransferTx({
|
|
372
|
+
from: wallet.address,
|
|
373
|
+
recipient: wallet.address,
|
|
374
|
+
assetValue,
|
|
375
|
+
});
|
|
376
|
+
return wallet.estimateTransactionFee(txObject, feeOptionKey);
|
|
377
|
+
}
|
|
378
|
+
const { evmTransactionDetails } = params.route;
|
|
379
|
+
|
|
380
|
+
if (
|
|
381
|
+
!(
|
|
382
|
+
evmTransactionDetails &&
|
|
383
|
+
lowercasedContractAbiMapping[evmTransactionDetails.contractAddress]
|
|
384
|
+
)
|
|
385
|
+
) {
|
|
386
|
+
return undefined;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const estimate = await wallet.estimateCall({
|
|
390
|
+
contractAddress: evmTransactionDetails.contractAddress,
|
|
391
|
+
// biome-ignore lint/style/noNonNullAssertion: TS cant infer the type
|
|
392
|
+
abi: lowercasedContractAbiMapping[evmTransactionDetails.contractAddress]!,
|
|
393
|
+
funcName: evmTransactionDetails.contractMethod,
|
|
394
|
+
funcParams: evmTransactionDetails.contractParams,
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
return AssetValue.fromChainOrSignature(chain, estimate);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
default:
|
|
401
|
+
return baseValue;
|
|
387
402
|
}
|
|
388
|
-
return AssetValue.fromChainOrSignature(chain, 0);
|
|
389
403
|
}
|
|
404
|
+
|
|
390
405
|
case Chain.Bitcoin:
|
|
391
406
|
case Chain.BitcoinCash:
|
|
392
407
|
case Chain.Dogecoin:
|
|
393
408
|
case Chain.Dash:
|
|
394
409
|
case Chain.Litecoin: {
|
|
395
|
-
const
|
|
396
|
-
|
|
410
|
+
const { estimateMaxSendableAmount, address } = connectedWallets[chain as UTXOChain];
|
|
411
|
+
|
|
412
|
+
return estimateMaxSendableAmount({
|
|
397
413
|
...params,
|
|
398
414
|
feeOptionKey,
|
|
399
|
-
from:
|
|
400
|
-
recipient:
|
|
415
|
+
from: address,
|
|
416
|
+
recipient: address,
|
|
401
417
|
});
|
|
402
418
|
}
|
|
419
|
+
|
|
403
420
|
case Chain.THORChain:
|
|
404
421
|
case Chain.Maya:
|
|
405
422
|
case Chain.Kujira:
|
|
406
423
|
case Chain.Cosmos: {
|
|
407
424
|
return cosmosTransactionFee(params);
|
|
408
425
|
}
|
|
426
|
+
|
|
409
427
|
case Chain.Polkadot: {
|
|
410
428
|
const wallet = connectedWallets[chain as Chain.Polkadot];
|
|
411
429
|
return wallet.estimateTransactionFee({ ...params, recipient: wallet.address });
|
|
412
430
|
}
|
|
431
|
+
|
|
413
432
|
default:
|
|
414
|
-
return
|
|
433
|
+
return baseValue;
|
|
415
434
|
}
|
|
416
435
|
}
|
|
417
436
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chain, ChainToExplorerUrl } from "@swapkit/helpers";
|
|
1
|
+
import { Chain, ChainToExplorerUrl, SwapKitError } from "@swapkit/helpers";
|
|
2
2
|
|
|
3
3
|
export function getExplorerTxUrl({ chain, txHash }: { txHash: string; chain: Chain }) {
|
|
4
4
|
const baseUrl = ChainToExplorerUrl[chain];
|
|
@@ -28,7 +28,7 @@ export function getExplorerTxUrl({ chain, txHash }: { txHash: string; chain: Cha
|
|
|
28
28
|
return `${baseUrl}/transaction/${txHash.toLowerCase()}`;
|
|
29
29
|
|
|
30
30
|
default:
|
|
31
|
-
throw new
|
|
31
|
+
throw new SwapKitError({ errorKey: "core_explorer_unsupported_chain", info: { chain } });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
export const avaxGeneric = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
4
|
-
stateMutability: "nonpayable",
|
|
5
|
-
type: "constructor",
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
anonymous: false,
|
|
9
|
-
inputs: [
|
|
10
|
-
{ indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
|
|
11
|
-
{ indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
|
|
12
|
-
],
|
|
13
|
-
name: "FeeSet",
|
|
14
|
-
type: "event",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
anonymous: false,
|
|
18
|
-
inputs: [
|
|
19
|
-
{ indexed: true, internalType: "address", name: "owner", type: "address" },
|
|
20
|
-
{ indexed: false, internalType: "bool", name: "active", type: "bool" },
|
|
21
|
-
],
|
|
22
|
-
name: "OwnerSet",
|
|
23
|
-
type: "event",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
inputs: [],
|
|
27
|
-
name: "fee",
|
|
28
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
29
|
-
stateMutability: "view",
|
|
30
|
-
type: "function",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
inputs: [],
|
|
34
|
-
name: "feeRecipient",
|
|
35
|
-
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
36
|
-
stateMutability: "view",
|
|
37
|
-
type: "function",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
41
|
-
name: "owners",
|
|
42
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
43
|
-
stateMutability: "view",
|
|
44
|
-
type: "function",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
inputs: [
|
|
48
|
-
{ internalType: "uint256", name: "_fee", type: "uint256" },
|
|
49
|
-
{ internalType: "address", name: "_feeRecipient", type: "address" },
|
|
50
|
-
],
|
|
51
|
-
name: "setFee",
|
|
52
|
-
outputs: [],
|
|
53
|
-
stateMutability: "nonpayable",
|
|
54
|
-
type: "function",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
inputs: [
|
|
58
|
-
{ internalType: "address", name: "owner", type: "address" },
|
|
59
|
-
{ internalType: "bool", name: "active", type: "bool" },
|
|
60
|
-
],
|
|
61
|
-
name: "setOwner",
|
|
62
|
-
outputs: [],
|
|
63
|
-
stateMutability: "nonpayable",
|
|
64
|
-
type: "function",
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
inputs: [
|
|
68
|
-
{ internalType: "address", name: "tcRouter", type: "address" },
|
|
69
|
-
{ internalType: "address", name: "tcVault", type: "address" },
|
|
70
|
-
{ internalType: "string", name: "tcMemo", type: "string" },
|
|
71
|
-
{ internalType: "address", name: "token", type: "address" },
|
|
72
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
73
|
-
{ internalType: "address", name: "router", type: "address" },
|
|
74
|
-
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
75
|
-
{ internalType: "uint256", name: "deadline", type: "uint256" },
|
|
76
|
-
],
|
|
77
|
-
name: "swapIn",
|
|
78
|
-
outputs: [],
|
|
79
|
-
stateMutability: "nonpayable",
|
|
80
|
-
type: "function",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
inputs: [],
|
|
84
|
-
name: "tokenTransferProxy",
|
|
85
|
-
outputs: [
|
|
86
|
-
{ internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" },
|
|
87
|
-
],
|
|
88
|
-
stateMutability: "view",
|
|
89
|
-
type: "function",
|
|
90
|
-
},
|
|
91
|
-
{ stateMutability: "payable", type: "receive" },
|
|
92
|
-
];
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
export const avaxWoofi = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [
|
|
4
|
-
{ internalType: "address", name: "_ttp", type: "address" },
|
|
5
|
-
{ internalType: "address", name: "_weth", type: "address" },
|
|
6
|
-
{ internalType: "address", name: "_swapRouter", type: "address" },
|
|
7
|
-
],
|
|
8
|
-
stateMutability: "nonpayable",
|
|
9
|
-
type: "constructor",
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
anonymous: false,
|
|
13
|
-
inputs: [
|
|
14
|
-
{ indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
|
|
15
|
-
{ indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
|
|
16
|
-
],
|
|
17
|
-
name: "FeeSet",
|
|
18
|
-
type: "event",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
anonymous: false,
|
|
22
|
-
inputs: [
|
|
23
|
-
{ indexed: true, internalType: "address", name: "owner", type: "address" },
|
|
24
|
-
{ indexed: false, internalType: "bool", name: "active", type: "bool" },
|
|
25
|
-
],
|
|
26
|
-
name: "OwnerSet",
|
|
27
|
-
type: "event",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
anonymous: false,
|
|
31
|
-
inputs: [
|
|
32
|
-
{ indexed: false, internalType: "address", name: "from", type: "address" },
|
|
33
|
-
{ indexed: false, internalType: "address", name: "token", type: "address" },
|
|
34
|
-
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
35
|
-
{ indexed: false, internalType: "uint256", name: "out", type: "uint256" },
|
|
36
|
-
{ indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
|
|
37
|
-
{ indexed: false, internalType: "address", name: "vault", type: "address" },
|
|
38
|
-
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
39
|
-
],
|
|
40
|
-
name: "SwapIn",
|
|
41
|
-
type: "event",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
anonymous: false,
|
|
45
|
-
inputs: [
|
|
46
|
-
{ indexed: false, internalType: "address", name: "to", type: "address" },
|
|
47
|
-
{ indexed: false, internalType: "address", name: "token", type: "address" },
|
|
48
|
-
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
49
|
-
{ indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
|
|
50
|
-
],
|
|
51
|
-
name: "SwapOut",
|
|
52
|
-
type: "event",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
inputs: [],
|
|
56
|
-
name: "fee",
|
|
57
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
58
|
-
stateMutability: "view",
|
|
59
|
-
type: "function",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
inputs: [],
|
|
63
|
-
name: "feeRecipient",
|
|
64
|
-
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
65
|
-
stateMutability: "view",
|
|
66
|
-
type: "function",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
70
|
-
name: "owners",
|
|
71
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
72
|
-
stateMutability: "view",
|
|
73
|
-
type: "function",
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
inputs: [
|
|
77
|
-
{ internalType: "uint256", name: "_fee", type: "uint256" },
|
|
78
|
-
{ internalType: "address", name: "_feeRecipient", type: "address" },
|
|
79
|
-
],
|
|
80
|
-
name: "setFee",
|
|
81
|
-
outputs: [],
|
|
82
|
-
stateMutability: "nonpayable",
|
|
83
|
-
type: "function",
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
inputs: [
|
|
87
|
-
{ internalType: "address", name: "owner", type: "address" },
|
|
88
|
-
{ internalType: "bool", name: "active", type: "bool" },
|
|
89
|
-
],
|
|
90
|
-
name: "setOwner",
|
|
91
|
-
outputs: [],
|
|
92
|
-
stateMutability: "nonpayable",
|
|
93
|
-
type: "function",
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
inputs: [
|
|
97
|
-
{ internalType: "address", name: "router", type: "address" },
|
|
98
|
-
{ internalType: "address", name: "vault", type: "address" },
|
|
99
|
-
{ internalType: "string", name: "memo", type: "string" },
|
|
100
|
-
{ internalType: "address", name: "token", type: "address" },
|
|
101
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
102
|
-
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
|
103
|
-
{ internalType: "uint256", name: "deadline", type: "uint256" },
|
|
104
|
-
],
|
|
105
|
-
name: "swapIn",
|
|
106
|
-
outputs: [],
|
|
107
|
-
stateMutability: "nonpayable",
|
|
108
|
-
type: "function",
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
inputs: [
|
|
112
|
-
{ internalType: "address", name: "token", type: "address" },
|
|
113
|
-
{ internalType: "address", name: "to", type: "address" },
|
|
114
|
-
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
|
115
|
-
],
|
|
116
|
-
name: "swapOut",
|
|
117
|
-
outputs: [],
|
|
118
|
-
stateMutability: "payable",
|
|
119
|
-
type: "function",
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
inputs: [],
|
|
123
|
-
name: "swapRouter",
|
|
124
|
-
outputs: [{ internalType: "contract IWoofi", name: "", type: "address" }],
|
|
125
|
-
stateMutability: "view",
|
|
126
|
-
type: "function",
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
inputs: [],
|
|
130
|
-
name: "tokenTransferProxy",
|
|
131
|
-
outputs: [
|
|
132
|
-
{ internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" },
|
|
133
|
-
],
|
|
134
|
-
stateMutability: "view",
|
|
135
|
-
type: "function",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
inputs: [],
|
|
139
|
-
name: "weth",
|
|
140
|
-
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
141
|
-
stateMutability: "view",
|
|
142
|
-
type: "function",
|
|
143
|
-
},
|
|
144
|
-
{ stateMutability: "payable", type: "receive" },
|
|
145
|
-
];
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
export const bscGeneric = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
4
|
-
stateMutability: "nonpayable",
|
|
5
|
-
type: "constructor",
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
anonymous: false,
|
|
9
|
-
inputs: [
|
|
10
|
-
{ indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
|
|
11
|
-
{ indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
|
|
12
|
-
],
|
|
13
|
-
name: "FeeSet",
|
|
14
|
-
type: "event",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
anonymous: false,
|
|
18
|
-
inputs: [
|
|
19
|
-
{ indexed: true, internalType: "address", name: "owner", type: "address" },
|
|
20
|
-
{ indexed: false, internalType: "bool", name: "active", type: "bool" },
|
|
21
|
-
],
|
|
22
|
-
name: "OwnerSet",
|
|
23
|
-
type: "event",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
anonymous: false,
|
|
27
|
-
inputs: [
|
|
28
|
-
{ indexed: false, internalType: "address", name: "from", type: "address" },
|
|
29
|
-
{ indexed: false, internalType: "address", name: "token", type: "address" },
|
|
30
|
-
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
31
|
-
{ indexed: false, internalType: "uint256", name: "out", type: "uint256" },
|
|
32
|
-
{ indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
|
|
33
|
-
{ indexed: false, internalType: "address", name: "vault", type: "address" },
|
|
34
|
-
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
35
|
-
],
|
|
36
|
-
name: "SwapIn",
|
|
37
|
-
type: "event",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
inputs: [],
|
|
41
|
-
name: "fee",
|
|
42
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
43
|
-
stateMutability: "view",
|
|
44
|
-
type: "function",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
inputs: [],
|
|
48
|
-
name: "feeRecipient",
|
|
49
|
-
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
50
|
-
stateMutability: "view",
|
|
51
|
-
type: "function",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
55
|
-
name: "owners",
|
|
56
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
57
|
-
stateMutability: "view",
|
|
58
|
-
type: "function",
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
inputs: [
|
|
62
|
-
{ internalType: "uint256", name: "_fee", type: "uint256" },
|
|
63
|
-
{ internalType: "address", name: "_feeRecipient", type: "address" },
|
|
64
|
-
],
|
|
65
|
-
name: "setFee",
|
|
66
|
-
outputs: [],
|
|
67
|
-
stateMutability: "nonpayable",
|
|
68
|
-
type: "function",
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
inputs: [
|
|
72
|
-
{ internalType: "address", name: "owner", type: "address" },
|
|
73
|
-
{ internalType: "bool", name: "active", type: "bool" },
|
|
74
|
-
],
|
|
75
|
-
name: "setOwner",
|
|
76
|
-
outputs: [],
|
|
77
|
-
stateMutability: "nonpayable",
|
|
78
|
-
type: "function",
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
inputs: [
|
|
82
|
-
{ internalType: "address", name: "router", type: "address" },
|
|
83
|
-
{ internalType: "address", name: "vault", type: "address" },
|
|
84
|
-
{ internalType: "string", name: "memo", type: "string" },
|
|
85
|
-
{ internalType: "address", name: "token", type: "address" },
|
|
86
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
87
|
-
{ internalType: "address", name: "swapRouter", type: "address" },
|
|
88
|
-
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
89
|
-
{ internalType: "uint256", name: "deadline", type: "uint256" },
|
|
90
|
-
],
|
|
91
|
-
name: "swapIn",
|
|
92
|
-
outputs: [],
|
|
93
|
-
stateMutability: "nonpayable",
|
|
94
|
-
type: "function",
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
inputs: [],
|
|
98
|
-
name: "tokenTransferProxy",
|
|
99
|
-
outputs: [
|
|
100
|
-
{ internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" },
|
|
101
|
-
],
|
|
102
|
-
stateMutability: "view",
|
|
103
|
-
type: "function",
|
|
104
|
-
},
|
|
105
|
-
{ stateMutability: "payable", type: "receive" },
|
|
106
|
-
];
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
export const ethGeneric = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
4
|
-
stateMutability: "nonpayable",
|
|
5
|
-
type: "constructor",
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
anonymous: false,
|
|
9
|
-
inputs: [
|
|
10
|
-
{ indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
|
|
11
|
-
{ indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
|
|
12
|
-
],
|
|
13
|
-
name: "FeeSet",
|
|
14
|
-
type: "event",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
anonymous: false,
|
|
18
|
-
inputs: [
|
|
19
|
-
{ indexed: true, internalType: "address", name: "owner", type: "address" },
|
|
20
|
-
{ indexed: false, internalType: "bool", name: "active", type: "bool" },
|
|
21
|
-
],
|
|
22
|
-
name: "OwnerSet",
|
|
23
|
-
type: "event",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
inputs: [],
|
|
27
|
-
name: "fee",
|
|
28
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
29
|
-
stateMutability: "view",
|
|
30
|
-
type: "function",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
inputs: [],
|
|
34
|
-
name: "feeRecipient",
|
|
35
|
-
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
36
|
-
stateMutability: "view",
|
|
37
|
-
type: "function",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
41
|
-
name: "owners",
|
|
42
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
43
|
-
stateMutability: "view",
|
|
44
|
-
type: "function",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
inputs: [
|
|
48
|
-
{ internalType: "uint256", name: "_fee", type: "uint256" },
|
|
49
|
-
{ internalType: "address", name: "_feeRecipient", type: "address" },
|
|
50
|
-
],
|
|
51
|
-
name: "setFee",
|
|
52
|
-
outputs: [],
|
|
53
|
-
stateMutability: "nonpayable",
|
|
54
|
-
type: "function",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
inputs: [
|
|
58
|
-
{ internalType: "address", name: "owner", type: "address" },
|
|
59
|
-
{ internalType: "bool", name: "active", type: "bool" },
|
|
60
|
-
],
|
|
61
|
-
name: "setOwner",
|
|
62
|
-
outputs: [],
|
|
63
|
-
stateMutability: "nonpayable",
|
|
64
|
-
type: "function",
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
inputs: [
|
|
68
|
-
{ internalType: "address", name: "tcRouter", type: "address" },
|
|
69
|
-
{ internalType: "address", name: "tcVault", type: "address" },
|
|
70
|
-
{ internalType: "string", name: "tcMemo", type: "string" },
|
|
71
|
-
{ internalType: "address", name: "token", type: "address" },
|
|
72
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
73
|
-
{ internalType: "address", name: "router", type: "address" },
|
|
74
|
-
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
75
|
-
{ internalType: "uint256", name: "deadline", type: "uint256" },
|
|
76
|
-
],
|
|
77
|
-
name: "swapIn",
|
|
78
|
-
outputs: [],
|
|
79
|
-
stateMutability: "nonpayable",
|
|
80
|
-
type: "function",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
inputs: [],
|
|
84
|
-
name: "tokenTransferProxy",
|
|
85
|
-
outputs: [
|
|
86
|
-
{ internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" },
|
|
87
|
-
],
|
|
88
|
-
stateMutability: "view",
|
|
89
|
-
type: "function",
|
|
90
|
-
},
|
|
91
|
-
{ stateMutability: "payable", type: "receive" },
|
|
92
|
-
];
|