@orbs-network/twap 2.0.1 → 2.1.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/configs.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "chainId": 250,
5
5
  "twapVersion": 4,
6
6
  "twapAddress": "0xdb55107c17Cb433D322052BFA36069fDf7Cb1031",
7
- "lensAddress": "0x55A35fCa403E13E34891684bFc9E94c44F3a099e",
7
+ "lensAddress": "0x0628DC34b758AC652bf64fFe924e6B62F136dE3c",
8
8
  "bidDelaySeconds": 60,
9
9
  "minChunkSizeUsd": 10,
10
10
  "name": "SpookySwap",
@@ -19,7 +19,7 @@
19
19
  "chainId": 43114,
20
20
  "twapVersion": 4,
21
21
  "twapAddress": "0xF2687e119B0A4aB00bED9c9F425403566D605020",
22
- "lensAddress": "0xFa977dbDAc6B0d15B6C066221f0d6b4A6488dCaE",
22
+ "lensAddress": "0x2C5E9Aa3631106DaE1B7420347577974b162548f",
23
23
  "bidDelaySeconds": 60,
24
24
  "minChunkSizeUsd": 100,
25
25
  "name": "Pangolin",
@@ -34,7 +34,7 @@
34
34
  "chainId": 43114,
35
35
  "twapVersion": 4,
36
36
  "twapAddress": "0xF2687e119B0A4aB00bED9c9F425403566D605020",
37
- "lensAddress": "0xFa977dbDAc6B0d15B6C066221f0d6b4A6488dCaE",
37
+ "lensAddress": "0x2C5E9Aa3631106DaE1B7420347577974b162548f",
38
38
  "bidDelaySeconds": 60,
39
39
  "minChunkSizeUsd": 100,
40
40
  "name": "PangolinDaas",
@@ -49,7 +49,7 @@
49
49
  "chainId": 137,
50
50
  "twapVersion": 4,
51
51
  "twapAddress": "0xceFf098C9199c5d9cf24078dc14Eb8F787631cC0",
52
- "lensAddress": "0xaC2eCaDBCF1C58a645361DA97Bc5726975aE2EF3",
52
+ "lensAddress": "0xd68676ABd169bDcAE3CAF2D474A5C3759B140C0B",
53
53
  "bidDelaySeconds": 60,
54
54
  "minChunkSizeUsd": 10,
55
55
  "name": "QuickSwap",
@@ -64,7 +64,7 @@
64
64
  "chainId": 42161,
65
65
  "twapVersion": 4,
66
66
  "twapAddress": "0xD63430c74C8E70D9dbdCA04C6a9E6E9E929028DA",
67
- "lensAddress": "0x044D636781d3d767E7f60316E76eF705fCF44e2E",
67
+ "lensAddress": "0x7eD30e55FF792816Ba88f42b43ee0c4512302152",
68
68
  "bidDelaySeconds": 60,
69
69
  "minChunkSizeUsd": 50,
70
70
  "name": "Chronos",
@@ -79,7 +79,7 @@
79
79
  "chainId": 8453,
80
80
  "twapVersion": 4,
81
81
  "twapAddress": "0x25a0A78f5ad07b2474D3D42F1c1432178465936d",
82
- "lensAddress": "0x2872c71e5A72CbBd1C81334824d8ff7B7c37357f",
82
+ "lensAddress": "0xFaB090A976c61FAfc2bAf91f04222fea42A42257",
83
83
  "bidDelaySeconds": 60,
84
84
  "minChunkSizeUsd": 50,
85
85
  "name": "BaseSwap",
@@ -94,7 +94,7 @@
94
94
  "chainId": 42161,
95
95
  "twapVersion": 4,
96
96
  "twapAddress": "0xD63430c74C8E70D9dbdCA04C6a9E6E9E929028DA",
97
- "lensAddress": "0x044D636781d3d767E7f60316E76eF705fCF44e2E",
97
+ "lensAddress": "0x7eD30e55FF792816Ba88f42b43ee0c4512302152",
98
98
  "bidDelaySeconds": 60,
99
99
  "minChunkSizeUsd": 50,
100
100
  "name": "Arbidex",
@@ -109,7 +109,7 @@
109
109
  "chainId": 56,
110
110
  "twapVersion": 4,
111
111
  "twapAddress": "0x25a0A78f5ad07b2474D3D42F1c1432178465936d",
112
- "lensAddress": "0x2872c71e5A72CbBd1C81334824d8ff7B7c37357f",
112
+ "lensAddress": "0xFaB090A976c61FAfc2bAf91f04222fea42A42257",
113
113
  "bidDelaySeconds": 60,
114
114
  "minChunkSizeUsd": 50,
115
115
  "name": "Thena",
@@ -124,7 +124,7 @@
124
124
  "chainId": 56,
125
125
  "twapVersion": 4,
126
126
  "twapAddress": "0x25a0A78f5ad07b2474D3D42F1c1432178465936d",
127
- "lensAddress": "0x2872c71e5A72CbBd1C81334824d8ff7B7c37357f",
127
+ "lensAddress": "0xFaB090A976c61FAfc2bAf91f04222fea42A42257",
128
128
  "bidDelaySeconds": 60,
129
129
  "minChunkSizeUsd": 50,
130
130
  "name": "PancakeSwap",
@@ -139,7 +139,7 @@
139
139
  "chainId": 59144,
140
140
  "twapVersion": 4,
141
141
  "twapAddress": "0xbE7984eb48E2102549338B533dcF68035e413F66",
142
- "lensAddress": "0x507c0097896750Ce04a9F3b857d1BB37BBCCb47B",
142
+ "lensAddress": "0x7a2885a470a96995Fa99177e068fd554e3aCAbB3",
143
143
  "bidDelaySeconds": 60,
144
144
  "minChunkSizeUsd": 100,
145
145
  "name": "Lynex",
@@ -154,7 +154,7 @@
154
154
  "chainId": 324,
155
155
  "twapVersion": 4,
156
156
  "twapAddress": "0x971f855C98f45fcdD2782f03bD80Cf6C146Cf123",
157
- "lensAddress": "0x3a661ACA20Cb9Ff8551D1F100cBCE4683fa31Af7",
157
+ "lensAddress": "0x1157A4A2517Aa3471B08FE076eE3a2DF49EA449D",
158
158
  "bidDelaySeconds": 60,
159
159
  "minChunkSizeUsd": 100,
160
160
  "name": "SyncSwap",
@@ -169,7 +169,7 @@
169
169
  "chainId": 137,
170
170
  "twapVersion": 4,
171
171
  "twapAddress": "0xceFf098C9199c5d9cf24078dc14Eb8F787631cC0",
172
- "lensAddress": "0xaC2eCaDBCF1C58a645361DA97Bc5726975aE2EF3",
172
+ "lensAddress": "0xd68676ABd169bDcAE3CAF2D474A5C3759B140C0B",
173
173
  "bidDelaySeconds": 60,
174
174
  "minChunkSizeUsd": 10,
175
175
  "name": "Retro",
@@ -184,7 +184,7 @@
184
184
  "chainId": 42161,
185
185
  "twapVersion": 4,
186
186
  "twapAddress": "0xD63430c74C8E70D9dbdCA04C6a9E6E9E929028DA",
187
- "lensAddress": "0x044D636781d3d767E7f60316E76eF705fCF44e2E",
187
+ "lensAddress": "0x7eD30e55FF792816Ba88f42b43ee0c4512302152",
188
188
  "bidDelaySeconds": 60,
189
189
  "minChunkSizeUsd": 50,
190
190
  "name": "SushiArb",
@@ -199,7 +199,7 @@
199
199
  "chainId": 8453,
200
200
  "twapVersion": 4,
201
201
  "twapAddress": "0x25a0A78f5ad07b2474D3D42F1c1432178465936d",
202
- "lensAddress": "0x2872c71e5A72CbBd1C81334824d8ff7B7c37357f",
202
+ "lensAddress": "0xFaB090A976c61FAfc2bAf91f04222fea42A42257",
203
203
  "bidDelaySeconds": 60,
204
204
  "minChunkSizeUsd": 50,
205
205
  "name": "SushiBase",
package/index.js ADDED
@@ -0,0 +1,12 @@
1
+ const configs = require('./configs.json');
2
+ const twapAbi = require('./twap.abi.json');
3
+ const lensAbi = require('./lens.abi.json');
4
+ const takerAbi = require('./taker.abi.json');
5
+
6
+ Object.keys(configs).forEach((key) => {
7
+ if (!configs[key].twapAbi) configs[key].twapAbi = twapAbi;
8
+ if (!configs[key].lensAbi) configs[key].lensAbi = lensAbi;
9
+ if (!configs[key].takerAbi) configs[key].takerAbi = takerAbi;
10
+ });
11
+
12
+ module.exports = { configs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbs-network/twap",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/orbs-network/twap.git"
@@ -8,18 +8,21 @@
8
8
  "author": "Orbs",
9
9
  "license": "MIT",
10
10
  "dependencies": {},
11
+ "main": "index.js",
11
12
  "files": [
13
+ "index.js",
12
14
  "configs.json",
13
15
  "twap.abi.json",
14
16
  "lens.abi.json",
17
+ "taker.abi.json",
15
18
  "LICENSE",
16
19
  "TOS.md",
17
20
  "README.md"
18
21
  ],
19
22
  "scripts": {
20
- "clean": "",
21
- "build": "npm run clean",
23
+ "clean": "forge clean",
24
+ "build": "npm run clean && forge build",
22
25
  "prepublishOnly": "npm run build",
23
- "test": ""
26
+ "test": "forge test"
24
27
  }
25
28
  }
package/taker.abi.json ADDED
@@ -0,0 +1,133 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "contract TWAP",
6
+ "name": "_twap",
7
+ "type": "address"
8
+ },
9
+ {
10
+ "internalType": "contract ITreasury",
11
+ "name": "_treasury",
12
+ "type": "address"
13
+ }
14
+ ],
15
+ "stateMutability": "nonpayable",
16
+ "type": "constructor"
17
+ },
18
+ {
19
+ "inputs": [
20
+ {
21
+ "internalType": "address",
22
+ "name": "caller",
23
+ "type": "address"
24
+ }
25
+ ],
26
+ "name": "NotAllowed",
27
+ "type": "error"
28
+ },
29
+ {
30
+ "inputs": [
31
+ {
32
+ "internalType": "uint64",
33
+ "name": "id",
34
+ "type": "uint64"
35
+ },
36
+ {
37
+ "internalType": "address",
38
+ "name": "exchange",
39
+ "type": "address"
40
+ },
41
+ {
42
+ "internalType": "uint256",
43
+ "name": "dstFee",
44
+ "type": "uint256"
45
+ },
46
+ {
47
+ "internalType": "uint32",
48
+ "name": "slippagePercent",
49
+ "type": "uint32"
50
+ },
51
+ {
52
+ "internalType": "bytes",
53
+ "name": "data",
54
+ "type": "bytes"
55
+ }
56
+ ],
57
+ "name": "bid",
58
+ "outputs": [],
59
+ "stateMutability": "nonpayable",
60
+ "type": "function"
61
+ },
62
+ {
63
+ "inputs": [
64
+ {
65
+ "internalType": "uint64",
66
+ "name": "id",
67
+ "type": "uint64"
68
+ },
69
+ {
70
+ "internalType": "address",
71
+ "name": "feeExchange",
72
+ "type": "address"
73
+ },
74
+ {
75
+ "internalType": "uint256",
76
+ "name": "feeMinAmountOut",
77
+ "type": "uint256"
78
+ },
79
+ {
80
+ "internalType": "bytes",
81
+ "name": "feeData",
82
+ "type": "bytes"
83
+ }
84
+ ],
85
+ "name": "fill",
86
+ "outputs": [],
87
+ "stateMutability": "nonpayable",
88
+ "type": "function"
89
+ },
90
+ {
91
+ "inputs": [
92
+ {
93
+ "internalType": "address",
94
+ "name": "token",
95
+ "type": "address"
96
+ }
97
+ ],
98
+ "name": "rescue",
99
+ "outputs": [],
100
+ "stateMutability": "nonpayable",
101
+ "type": "function"
102
+ },
103
+ {
104
+ "inputs": [],
105
+ "name": "treasury",
106
+ "outputs": [
107
+ {
108
+ "internalType": "contract ITreasury",
109
+ "name": "",
110
+ "type": "address"
111
+ }
112
+ ],
113
+ "stateMutability": "view",
114
+ "type": "function"
115
+ },
116
+ {
117
+ "inputs": [],
118
+ "name": "twap",
119
+ "outputs": [
120
+ {
121
+ "internalType": "contract TWAP",
122
+ "name": "",
123
+ "type": "address"
124
+ }
125
+ ],
126
+ "stateMutability": "view",
127
+ "type": "function"
128
+ },
129
+ {
130
+ "stateMutability": "payable",
131
+ "type": "receive"
132
+ }
133
+ ]