@swapkit/core 1.0.0-rc.10 → 1.0.0-rc.101

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.
Files changed (43) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.ts +162 -28
  4. package/dist/index.es.js +6481 -1101
  5. package/dist/index.es.js.map +1 -0
  6. package/package.json +23 -30
  7. package/src/__tests__/helpers.test.ts +79 -0
  8. package/src/aggregator/contracts/avaxGeneric.ts +50 -50
  9. package/src/aggregator/contracts/avaxWoofi.ts +80 -80
  10. package/src/aggregator/contracts/bscGeneric.ts +59 -59
  11. package/src/aggregator/contracts/ethGeneric.ts +50 -50
  12. package/src/aggregator/contracts/index.ts +30 -28
  13. package/src/aggregator/contracts/pancakeV2.ts +80 -80
  14. package/src/aggregator/contracts/pangolin.ts +65 -65
  15. package/src/aggregator/contracts/routers/index.ts +58 -0
  16. package/src/aggregator/contracts/routers/kyber.ts +402 -0
  17. package/src/aggregator/contracts/routers/oneinch.ts +2188 -0
  18. package/src/aggregator/contracts/routers/pancakeswap.ts +340 -0
  19. package/src/aggregator/contracts/routers/pangolin.ts +340 -0
  20. package/src/aggregator/contracts/routers/sushiswap.ts +340 -0
  21. package/src/aggregator/contracts/routers/traderJoe.ts +340 -0
  22. package/src/aggregator/contracts/routers/uniswapv2.ts +340 -0
  23. package/src/aggregator/contracts/routers/uniswapv3.ts +254 -0
  24. package/src/aggregator/contracts/routers/woofi.ts +171 -0
  25. package/src/aggregator/contracts/sushiswap.ts +65 -65
  26. package/src/aggregator/contracts/traderJoe.ts +65 -65
  27. package/src/aggregator/contracts/uniswapV2.ts +65 -65
  28. package/src/aggregator/contracts/uniswapV2Leg.ts +70 -70
  29. package/src/aggregator/contracts/uniswapV3_100.ts +70 -70
  30. package/src/aggregator/contracts/uniswapV3_10000.ts +70 -70
  31. package/src/aggregator/contracts/uniswapV3_3000.ts +70 -70
  32. package/src/aggregator/contracts/uniswapV3_500.ts +70 -70
  33. package/src/aggregator/getSwapParams.ts +12 -12
  34. package/src/client/index.ts +212 -646
  35. package/src/client/old.ts +837 -0
  36. package/src/{client → helpers}/explorerUrls.ts +9 -10
  37. package/src/{client → helpers}/thornode.ts +5 -5
  38. package/src/index.ts +6 -4
  39. package/src/types.ts +149 -0
  40. package/dist/index-9e36735e.cjs +0 -1
  41. package/dist/index-cf1865cd.js +0 -649
  42. package/src/client/__tests__/helpers.test.ts +0 -69
  43. package/src/client/types.ts +0 -103
package/package.json CHANGED
@@ -1,33 +1,26 @@
1
1
  {
2
- "author": "swapkit-oss-team",
2
+ "author": "swapkit-oss",
3
3
  "dependencies": {
4
- "@swapkit/types": "1.0.0-rc.5",
5
- "@swapkit/helpers": "1.0.0-rc.6"
4
+ "@swapkit/helpers": "1.0.0-rc.73",
5
+ "@swapkit/types": "1.0.0-rc.39"
6
6
  },
7
7
  "description": "SwapKit Lib core",
8
8
  "devDependencies": {
9
- "@vitest/coverage-istanbul": "0.34.4",
10
- "ethers": "6.7.1",
11
- "vite": "4.4.9",
12
- "vite-plugin-top-level-await": "1.3.1",
13
- "vite-plugin-wasm": "3.2.2",
14
- "vitest": "0.34.4",
15
- "@internal/config": "0.0.0-internal.0",
16
- "@swapkit/api": "1.0.0-rc.5",
17
- "@swapkit/tokens": "1.0.0-rc.5",
18
- "@swapkit/toolbox-cosmos": "1.0.0-rc.8",
19
- "@swapkit/toolbox-evm": "1.0.0-rc.7",
20
- "@swapkit/toolbox-utxo": "1.0.0-rc.7"
9
+ "@vitest/coverage-istanbul": "1.3.1",
10
+ "vite": "5.1.3",
11
+ "vitest": "1.3.1",
12
+ "@swapkit/tokens": "1.0.0-rc.36",
13
+ "@swapkit/toolbox-cosmos": "1.0.0-rc.84",
14
+ "@swapkit/toolbox-evm": "1.0.0-rc.79",
15
+ "@swapkit/toolbox-substrate": "1.0.0-rc.7",
16
+ "@swapkit/toolbox-utxo": "1.0.0-rc.78"
21
17
  },
22
18
  "peerDependencies": {
23
- "@swapkit/api": "1.0.0-rc.5",
24
- "@swapkit/tokens": "1.0.0-rc.5",
25
- "@swapkit/toolbox-cosmos": "1.0.0-rc.8",
26
- "@swapkit/toolbox-evm": "1.0.0-rc.7",
27
- "@swapkit/toolbox-utxo": "1.0.0-rc.7"
28
- },
29
- "eslintConfig": {
30
- "extends": "../../../internal/eslint-config"
19
+ "@swapkit/tokens": "1.0.0-rc.36",
20
+ "@swapkit/toolbox-cosmos": "1.0.0-rc.84",
21
+ "@swapkit/toolbox-evm": "1.0.0-rc.79",
22
+ "@swapkit/toolbox-substrate": "1.0.0-rc.7",
23
+ "@swapkit/toolbox-utxo": "1.0.0-rc.78"
31
24
  },
32
25
  "exports": {
33
26
  ".": {
@@ -45,18 +38,18 @@
45
38
  "main": "./dist/index.cjs",
46
39
  "module": "./dist/index.es.js",
47
40
  "name": "@swapkit/core",
48
- "publishConfig": {
49
- "access": "public"
50
- },
51
41
  "react-native": "./src/index.ts",
52
- "repository": "https://github.com/thorswap/SwapKit.git",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/thorswap/SwapKit.git"
45
+ },
53
46
  "type": "module",
54
47
  "types": "./dist/index.d.ts",
55
- "version": "1.0.0-rc.10",
48
+ "version": "1.0.0-rc.101",
56
49
  "scripts": {
57
50
  "build": "NODE_OPTIONS=--max_old_space_size=16384 vite build",
58
- "clean": "rm -rf dist vite.config.ts.* .turbo node_modules",
59
- "lint": "eslint ./ --ext .ts,.tsx --fix; tsc --noEmit",
51
+ "clean": "rm -rf dist vite.config.ts.* node_modules",
52
+ "lint": "biome check --apply ./src",
60
53
  "test": "vitest --run",
61
54
  "test:coverage": "vitest run --coverage"
62
55
  }
@@ -0,0 +1,79 @@
1
+ import { Chain, ChainToExplorerUrl, CosmosChains, EVMChains, UTXOChains } from "@swapkit/types";
2
+ import { describe, expect, test } from "vitest";
3
+ import { getExplorerAddressUrl, getExplorerTxUrl } from "../helpers/explorerUrls.ts";
4
+
5
+ describe("Explorer URLs", () => {
6
+ for (const chain of CosmosChains.filter((c) => c !== Chain.Cosmos)) {
7
+ test(`getExplorerTxUrl returns correct URL for ${chain}`, () => {
8
+ expect(getExplorerTxUrl({ chain, txHash: "0x123456789" })).toBe(
9
+ `${ChainToExplorerUrl[chain]}/tx/123456789`,
10
+ );
11
+
12
+ expect(getExplorerAddressUrl({ chain, address: "asdfg" })).toBe(
13
+ `${ChainToExplorerUrl[chain]}/address/asdfg`,
14
+ );
15
+ });
16
+ }
17
+
18
+ for (const chain of EVMChains) {
19
+ test(`getExplorerTxUrl returns correct URL for ${chain}`, () => {
20
+ expect(getExplorerTxUrl({ chain, txHash: "0x123456789" })).toBe(
21
+ `${ChainToExplorerUrl[chain]}/tx/0x123456789`,
22
+ );
23
+
24
+ expect(getExplorerAddressUrl({ chain, address: "asdfg" })).toBe(
25
+ `${ChainToExplorerUrl[chain]}/address/asdfg`,
26
+ );
27
+ });
28
+ }
29
+
30
+ for (const chain of UTXOChains.filter((c) => c !== Chain.Dash)) {
31
+ test(`getExplorerTxUrl returns correct URL for ${chain}`, () => {
32
+ expect(getExplorerTxUrl({ chain, txHash: "0x123456789" })).toBe(
33
+ `${ChainToExplorerUrl[chain]}/transaction/0x123456789`,
34
+ );
35
+
36
+ expect(getExplorerAddressUrl({ chain, address: "asdfg" })).toBe(
37
+ `${ChainToExplorerUrl[chain]}/address/asdfg`,
38
+ );
39
+ });
40
+ }
41
+
42
+ test(`getExplorerTxUrl returns correct URL for ${Chain.Cosmos}`, () => {
43
+ expect(getExplorerTxUrl({ chain: Chain.Cosmos, txHash: "0x123456789" })).toBe(
44
+ `${ChainToExplorerUrl[Chain.Cosmos]}/transactions/0x123456789`,
45
+ );
46
+
47
+ expect(getExplorerAddressUrl({ chain: Chain.Cosmos, address: "asdfg" })).toBe(
48
+ `${ChainToExplorerUrl[Chain.Cosmos]}/account/asdfg`,
49
+ );
50
+ });
51
+
52
+ test("getExplorerTxUrl throws Error for unsupported Chain", () => {
53
+ expect(() =>
54
+ getExplorerTxUrl({ chain: "unsupported" as Chain, txHash: "0x12345" }),
55
+ ).toThrowError("Unsupported chain: unsupported");
56
+ });
57
+
58
+ test("getExplorerAddressUrl throws Error for unsupported Chain", () => {
59
+ expect(() =>
60
+ getExplorerAddressUrl({ chain: "unsupported" as Chain, address: "asdfg" }),
61
+ ).toThrowError("Unsupported chain: unsupported");
62
+ });
63
+ test("getExplorerTxUrl adds 0x for EVM like chains", () => {
64
+ expect(getExplorerTxUrl({ chain: Chain.Ethereum, txHash: "12345" })).toBe(
65
+ "https://etherscan.io/tx/0x12345",
66
+ );
67
+ });
68
+
69
+ test("getExplorerTxUrl returns correct URL for Cosmos", () => {
70
+ expect(getExplorerTxUrl({ chain: Chain.Cosmos, txHash: "pqrst" })).toBe(
71
+ "https://cosmos.bigdipper.live/transactions/pqrst",
72
+ );
73
+ });
74
+ test("getExplorerAddressUrl returns correct URL for Cosmos", () => {
75
+ expect(getExplorerAddressUrl({ chain: Chain.Cosmos, address: "zabcd" })).toBe(
76
+ "https://cosmos.bigdipper.live/account/zabcd",
77
+ );
78
+ });
79
+ });
@@ -1,92 +1,92 @@
1
1
  export const avaxGeneric = [
2
2
  {
3
- inputs: [{ internalType: 'address', name: '_ttp', type: 'address' }],
4
- stateMutability: 'nonpayable',
5
- type: 'constructor',
3
+ inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
4
+ stateMutability: "nonpayable",
5
+ type: "constructor",
6
6
  },
7
7
  {
8
8
  anonymous: false,
9
9
  inputs: [
10
- { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' },
11
- { indexed: false, internalType: 'address', name: 'feeRecipient', type: 'address' },
10
+ { indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
11
+ { indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
12
12
  ],
13
- name: 'FeeSet',
14
- type: 'event',
13
+ name: "FeeSet",
14
+ type: "event",
15
15
  },
16
16
  {
17
17
  anonymous: false,
18
18
  inputs: [
19
- { indexed: true, internalType: 'address', name: 'owner', type: 'address' },
20
- { indexed: false, internalType: 'bool', name: 'active', type: 'bool' },
19
+ { indexed: true, internalType: "address", name: "owner", type: "address" },
20
+ { indexed: false, internalType: "bool", name: "active", type: "bool" },
21
21
  ],
22
- name: 'OwnerSet',
23
- type: 'event',
22
+ name: "OwnerSet",
23
+ type: "event",
24
24
  },
25
25
  {
26
26
  inputs: [],
27
- name: 'fee',
28
- outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
29
- stateMutability: 'view',
30
- type: 'function',
27
+ name: "fee",
28
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
29
+ stateMutability: "view",
30
+ type: "function",
31
31
  },
32
32
  {
33
33
  inputs: [],
34
- name: 'feeRecipient',
35
- outputs: [{ internalType: 'address', name: '', type: 'address' }],
36
- stateMutability: 'view',
37
- type: 'function',
34
+ name: "feeRecipient",
35
+ outputs: [{ internalType: "address", name: "", type: "address" }],
36
+ stateMutability: "view",
37
+ type: "function",
38
38
  },
39
39
  {
40
- inputs: [{ internalType: 'address', name: '', type: 'address' }],
41
- name: 'owners',
42
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
43
- stateMutability: 'view',
44
- type: 'function',
40
+ inputs: [{ internalType: "address", name: "", type: "address" }],
41
+ name: "owners",
42
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
43
+ stateMutability: "view",
44
+ type: "function",
45
45
  },
46
46
  {
47
47
  inputs: [
48
- { internalType: 'uint256', name: '_fee', type: 'uint256' },
49
- { internalType: 'address', name: '_feeRecipient', type: 'address' },
48
+ { internalType: "uint256", name: "_fee", type: "uint256" },
49
+ { internalType: "address", name: "_feeRecipient", type: "address" },
50
50
  ],
51
- name: 'setFee',
51
+ name: "setFee",
52
52
  outputs: [],
53
- stateMutability: 'nonpayable',
54
- type: 'function',
53
+ stateMutability: "nonpayable",
54
+ type: "function",
55
55
  },
56
56
  {
57
57
  inputs: [
58
- { internalType: 'address', name: 'owner', type: 'address' },
59
- { internalType: 'bool', name: 'active', type: 'bool' },
58
+ { internalType: "address", name: "owner", type: "address" },
59
+ { internalType: "bool", name: "active", type: "bool" },
60
60
  ],
61
- name: 'setOwner',
61
+ name: "setOwner",
62
62
  outputs: [],
63
- stateMutability: 'nonpayable',
64
- type: 'function',
63
+ stateMutability: "nonpayable",
64
+ type: "function",
65
65
  },
66
66
  {
67
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' },
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
76
  ],
77
- name: 'swapIn',
77
+ name: "swapIn",
78
78
  outputs: [],
79
- stateMutability: 'nonpayable',
80
- type: 'function',
79
+ stateMutability: "nonpayable",
80
+ type: "function",
81
81
  },
82
82
  {
83
83
  inputs: [],
84
- name: 'tokenTransferProxy',
84
+ name: "tokenTransferProxy",
85
85
  outputs: [
86
- { internalType: 'contract TSAggregatorTokenTransferProxy', name: '', type: 'address' },
86
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" },
87
87
  ],
88
- stateMutability: 'view',
89
- type: 'function',
88
+ stateMutability: "view",
89
+ type: "function",
90
90
  },
91
- { stateMutability: 'payable', type: 'receive' },
91
+ { stateMutability: "payable", type: "receive" },
92
92
  ];
@@ -1,145 +1,145 @@
1
1
  export const avaxWoofi = [
2
2
  {
3
3
  inputs: [
4
- { internalType: 'address', name: '_ttp', type: 'address' },
5
- { internalType: 'address', name: '_weth', type: 'address' },
6
- { internalType: 'address', name: '_swapRouter', type: 'address' },
4
+ { internalType: "address", name: "_ttp", type: "address" },
5
+ { internalType: "address", name: "_weth", type: "address" },
6
+ { internalType: "address", name: "_swapRouter", type: "address" },
7
7
  ],
8
- stateMutability: 'nonpayable',
9
- type: 'constructor',
8
+ stateMutability: "nonpayable",
9
+ type: "constructor",
10
10
  },
11
11
  {
12
12
  anonymous: false,
13
13
  inputs: [
14
- { indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' },
15
- { indexed: false, internalType: 'address', name: 'feeRecipient', type: 'address' },
14
+ { indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
15
+ { indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
16
16
  ],
17
- name: 'FeeSet',
18
- type: 'event',
17
+ name: "FeeSet",
18
+ type: "event",
19
19
  },
20
20
  {
21
21
  anonymous: false,
22
22
  inputs: [
23
- { indexed: true, internalType: 'address', name: 'owner', type: 'address' },
24
- { indexed: false, internalType: 'bool', name: 'active', type: 'bool' },
23
+ { indexed: true, internalType: "address", name: "owner", type: "address" },
24
+ { indexed: false, internalType: "bool", name: "active", type: "bool" },
25
25
  ],
26
- name: 'OwnerSet',
27
- type: 'event',
26
+ name: "OwnerSet",
27
+ type: "event",
28
28
  },
29
29
  {
30
30
  anonymous: false,
31
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' },
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
39
  ],
40
- name: 'SwapIn',
41
- type: 'event',
40
+ name: "SwapIn",
41
+ type: "event",
42
42
  },
43
43
  {
44
44
  anonymous: false,
45
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' },
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
50
  ],
51
- name: 'SwapOut',
52
- type: 'event',
51
+ name: "SwapOut",
52
+ type: "event",
53
53
  },
54
54
  {
55
55
  inputs: [],
56
- name: 'fee',
57
- outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
58
- stateMutability: 'view',
59
- type: 'function',
56
+ name: "fee",
57
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
58
+ stateMutability: "view",
59
+ type: "function",
60
60
  },
61
61
  {
62
62
  inputs: [],
63
- name: 'feeRecipient',
64
- outputs: [{ internalType: 'address', name: '', type: 'address' }],
65
- stateMutability: 'view',
66
- type: 'function',
63
+ name: "feeRecipient",
64
+ outputs: [{ internalType: "address", name: "", type: "address" }],
65
+ stateMutability: "view",
66
+ type: "function",
67
67
  },
68
68
  {
69
- inputs: [{ internalType: 'address', name: '', type: 'address' }],
70
- name: 'owners',
71
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
72
- stateMutability: 'view',
73
- type: 'function',
69
+ inputs: [{ internalType: "address", name: "", type: "address" }],
70
+ name: "owners",
71
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
72
+ stateMutability: "view",
73
+ type: "function",
74
74
  },
75
75
  {
76
76
  inputs: [
77
- { internalType: 'uint256', name: '_fee', type: 'uint256' },
78
- { internalType: 'address', name: '_feeRecipient', type: 'address' },
77
+ { internalType: "uint256", name: "_fee", type: "uint256" },
78
+ { internalType: "address", name: "_feeRecipient", type: "address" },
79
79
  ],
80
- name: 'setFee',
80
+ name: "setFee",
81
81
  outputs: [],
82
- stateMutability: 'nonpayable',
83
- type: 'function',
82
+ stateMutability: "nonpayable",
83
+ type: "function",
84
84
  },
85
85
  {
86
86
  inputs: [
87
- { internalType: 'address', name: 'owner', type: 'address' },
88
- { internalType: 'bool', name: 'active', type: 'bool' },
87
+ { internalType: "address", name: "owner", type: "address" },
88
+ { internalType: "bool", name: "active", type: "bool" },
89
89
  ],
90
- name: 'setOwner',
90
+ name: "setOwner",
91
91
  outputs: [],
92
- stateMutability: 'nonpayable',
93
- type: 'function',
92
+ stateMutability: "nonpayable",
93
+ type: "function",
94
94
  },
95
95
  {
96
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' },
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
104
  ],
105
- name: 'swapIn',
105
+ name: "swapIn",
106
106
  outputs: [],
107
- stateMutability: 'nonpayable',
108
- type: 'function',
107
+ stateMutability: "nonpayable",
108
+ type: "function",
109
109
  },
110
110
  {
111
111
  inputs: [
112
- { internalType: 'address', name: 'token', type: 'address' },
113
- { internalType: 'address', name: 'to', type: 'address' },
114
- { internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
112
+ { internalType: "address", name: "token", type: "address" },
113
+ { internalType: "address", name: "to", type: "address" },
114
+ { internalType: "uint256", name: "amountOutMin", type: "uint256" },
115
115
  ],
116
- name: 'swapOut',
116
+ name: "swapOut",
117
117
  outputs: [],
118
- stateMutability: 'payable',
119
- type: 'function',
118
+ stateMutability: "payable",
119
+ type: "function",
120
120
  },
121
121
  {
122
122
  inputs: [],
123
- name: 'swapRouter',
124
- outputs: [{ internalType: 'contract IWoofi', name: '', type: 'address' }],
125
- stateMutability: 'view',
126
- type: 'function',
123
+ name: "swapRouter",
124
+ outputs: [{ internalType: "contract IWoofi", name: "", type: "address" }],
125
+ stateMutability: "view",
126
+ type: "function",
127
127
  },
128
128
  {
129
129
  inputs: [],
130
- name: 'tokenTransferProxy',
130
+ name: "tokenTransferProxy",
131
131
  outputs: [
132
- { internalType: 'contract TSAggregatorTokenTransferProxy', name: '', type: 'address' },
132
+ { internalType: "contract TSAggregatorTokenTransferProxy", name: "", type: "address" },
133
133
  ],
134
- stateMutability: 'view',
135
- type: 'function',
134
+ stateMutability: "view",
135
+ type: "function",
136
136
  },
137
137
  {
138
138
  inputs: [],
139
- name: 'weth',
140
- outputs: [{ internalType: 'address', name: '', type: 'address' }],
141
- stateMutability: 'view',
142
- type: 'function',
139
+ name: "weth",
140
+ outputs: [{ internalType: "address", name: "", type: "address" }],
141
+ stateMutability: "view",
142
+ type: "function",
143
143
  },
144
- { stateMutability: 'payable', type: 'receive' },
144
+ { stateMutability: "payable", type: "receive" },
145
145
  ];