@epoch-protocol/epoch-commons-sdk 0.1.6 → 0.1.7
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/constants/compact.js +1 -4
- package/dist/constants/contractAddresses.js +36 -39
- package/dist/constants/index.js +2 -18
- package/dist/data/epochgraphtestnet.json +30 -3
- package/dist/data/index.js +3 -10
- package/dist/index.js +5 -21
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +10 -13
- package/dist/utils/compact.js +7 -11
- package/dist/utils/index.js +2 -18
- package/dist/utils/path.js +1 -4
- package/dist/web3/index.js +3 -23
- package/dist/web3/intents.js +6 -11
- package/package.json +2 -1
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COMPACT_ADDRESS = void 0;
|
|
4
1
|
// The Compact is deployed at the same address on all networks
|
|
5
|
-
|
|
2
|
+
export const COMPACT_ADDRESS = '0x00000000000000171ede64904551eeDF3C6C9788';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONTRACT_ADDRESSES = exports.SAFE_MULTISEND_CALL_ONLY_ADDRESS = exports.SAFE_MULTISEND_ADDRESS = exports.EPOCH_ESCROW_ADDRESS = exports.METAMASK_EXEC_MANAGER = exports.EIP7702_SAFE_PROXY_ADDRESS = exports.SAFE_7579_REGISTRY_ADDRESS = exports.SAFE_7579_MODULE_ADDRESS = exports.SAFE_7702_SINGLETON_ADDRESS = exports.SAFE_SINGLETON_ADDRESS = exports.SAFE_PROXY_FACTORY_ADDRESS = exports.FCLP256Verifier = exports.SAFE_WEBAUTHN_SIGNER_FACTORY = exports.SAFE_WEBAUTHN_SHARED_SIGNER = exports.SAFE_INIT_SETUP_FORWARDER = exports.EPOCH_SAFE_INIT_SETUP = exports.EPOCH_MODULE_SAFE_ADDRESS = exports.INTENT_REGISTRY_ADDRESS = void 0;
|
|
4
|
-
exports.INTENT_REGISTRY_ADDRESS = {
|
|
1
|
+
export const INTENT_REGISTRY_ADDRESS = {
|
|
5
2
|
11155111: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
6
3
|
11155420: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
7
4
|
84532: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
@@ -10,7 +7,7 @@ exports.INTENT_REGISTRY_ADDRESS = {
|
|
|
10
7
|
11155931: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
11
8
|
129399: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
export const EPOCH_MODULE_SAFE_ADDRESS = {
|
|
14
11
|
11155111: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
15
12
|
11155420: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
16
13
|
84532: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
@@ -19,7 +16,7 @@ exports.EPOCH_MODULE_SAFE_ADDRESS = {
|
|
|
19
16
|
11155931: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
20
17
|
129399: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
21
18
|
};
|
|
22
|
-
|
|
19
|
+
export const EPOCH_SAFE_INIT_SETUP = {
|
|
23
20
|
11155111: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
24
21
|
11155420: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
25
22
|
84532: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
@@ -28,7 +25,7 @@ exports.EPOCH_SAFE_INIT_SETUP = {
|
|
|
28
25
|
11155931: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
29
26
|
129399: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
30
27
|
};
|
|
31
|
-
|
|
28
|
+
export const SAFE_INIT_SETUP_FORWARDER = {
|
|
32
29
|
11155111: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
33
30
|
11155420: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
34
31
|
84532: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
@@ -37,7 +34,7 @@ exports.SAFE_INIT_SETUP_FORWARDER = {
|
|
|
37
34
|
11155931: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
38
35
|
129399: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
39
36
|
};
|
|
40
|
-
|
|
37
|
+
export const SAFE_WEBAUTHN_SHARED_SIGNER = {
|
|
41
38
|
11155111: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
42
39
|
11155420: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
43
40
|
84532: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
@@ -46,7 +43,7 @@ exports.SAFE_WEBAUTHN_SHARED_SIGNER = {
|
|
|
46
43
|
80002: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
47
44
|
11155931: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
48
45
|
};
|
|
49
|
-
|
|
46
|
+
export const SAFE_WEBAUTHN_SIGNER_FACTORY = {
|
|
50
47
|
11155111: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
51
48
|
11155420: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
52
49
|
84532: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
@@ -55,7 +52,7 @@ exports.SAFE_WEBAUTHN_SIGNER_FACTORY = {
|
|
|
55
52
|
80002: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
56
53
|
11155931: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
57
54
|
};
|
|
58
|
-
|
|
55
|
+
export const FCLP256Verifier = {
|
|
59
56
|
11155111: "0xFB5D9DAddC16Bd61566c82Bf3F0659ce2B538bEE",
|
|
60
57
|
11155420: "0xFB5D9DAddC16Bd61566c82Bf3F0659ce2B538bEE",
|
|
61
58
|
84532: "0xFB5D9DAddC16Bd61566c82Bf3F0659ce2B538bEE",
|
|
@@ -65,7 +62,7 @@ exports.FCLP256Verifier = {
|
|
|
65
62
|
11155931: "0xFB5D9DAddC16Bd61566c82Bf3F0659ce2B538bEE",
|
|
66
63
|
};
|
|
67
64
|
//todo: update for testnets
|
|
68
|
-
|
|
65
|
+
export const SAFE_PROXY_FACTORY_ADDRESS = {
|
|
69
66
|
11155111: "0x6F0035ed7325d0DAaC2eB12562422Ae53faa682C",
|
|
70
67
|
11155420: "0x6F0035ed7325d0DAaC2eB12562422Ae53faa682C",
|
|
71
68
|
84532: "0x6F0035ed7325d0DAaC2eB12562422Ae53faa682C",
|
|
@@ -75,7 +72,7 @@ exports.SAFE_PROXY_FACTORY_ADDRESS = {
|
|
|
75
72
|
11155931: "0x6F0035ed7325d0DAaC2eB12562422Ae53faa682C",
|
|
76
73
|
};
|
|
77
74
|
//todo: update for testnets
|
|
78
|
-
|
|
75
|
+
export const SAFE_SINGLETON_ADDRESS = {
|
|
79
76
|
11155111: "0x5FdB4DaE6733008c82652D4e1B4a8c02dA3F5175",
|
|
80
77
|
11155420: "0x5FdB4DaE6733008c82652D4e1B4a8c02dA3F5175",
|
|
81
78
|
84532: "0x5FdB4DaE6733008c82652D4e1B4a8c02dA3F5175",
|
|
@@ -85,7 +82,7 @@ exports.SAFE_SINGLETON_ADDRESS = {
|
|
|
85
82
|
11155931: "0x5FdB4DaE6733008c82652D4e1B4a8c02dA3F5175",
|
|
86
83
|
};
|
|
87
84
|
//todo: update for testnets
|
|
88
|
-
|
|
85
|
+
export const SAFE_7702_SINGLETON_ADDRESS = {
|
|
89
86
|
11155111: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
90
87
|
11155420: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
91
88
|
84532: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
@@ -94,7 +91,7 @@ exports.SAFE_7702_SINGLETON_ADDRESS = {
|
|
|
94
91
|
80002: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
95
92
|
11155931: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
96
93
|
};
|
|
97
|
-
|
|
94
|
+
export const SAFE_7579_MODULE_ADDRESS = {
|
|
98
95
|
11155111: "0x5f73D1792f81Ee2356f99764904Cb03956F577d0",
|
|
99
96
|
11155420: "0x5f73D1792f81Ee2356f99764904Cb03956F577d0",
|
|
100
97
|
84532: "0x5f73D1792f81Ee2356f99764904Cb03956F577d0",
|
|
@@ -104,7 +101,7 @@ exports.SAFE_7579_MODULE_ADDRESS = {
|
|
|
104
101
|
11155931: "0x5f73D1792f81Ee2356f99764904Cb03956F577d0",
|
|
105
102
|
};
|
|
106
103
|
//todo: update for testnets
|
|
107
|
-
|
|
104
|
+
export const SAFE_7579_REGISTRY_ADDRESS = {
|
|
108
105
|
11155111: "0x6F1aBD911DBec98EEd1DfA470Ee98b61D3131A55",
|
|
109
106
|
11155420: "0x6F1aBD911DBec98EEd1DfA470Ee98b61D3131A55",
|
|
110
107
|
84532: "0x6F1aBD911DBec98EEd1DfA470Ee98b61D3131A55",
|
|
@@ -114,7 +111,7 @@ exports.SAFE_7579_REGISTRY_ADDRESS = {
|
|
|
114
111
|
11155931: "0x6F1aBD911DBec98EEd1DfA470Ee98b61D3131A55",
|
|
115
112
|
};
|
|
116
113
|
//todo: update for testnets
|
|
117
|
-
|
|
114
|
+
export const EIP7702_SAFE_PROXY_ADDRESS = {
|
|
118
115
|
11155111: "0xE60EcE6588DCcFb7373538034963B4D20a280DB0",
|
|
119
116
|
11155420: "0xc8490cDee50174A00105598AD615e2d00f0Cfb10",
|
|
120
117
|
84532: "0xc8490cDee50174A00105598AD615e2d00f0Cfb10",
|
|
@@ -123,7 +120,7 @@ exports.EIP7702_SAFE_PROXY_ADDRESS = {
|
|
|
123
120
|
80002: "0xc8490cDee50174A00105598AD615e2d00f0Cfb10",
|
|
124
121
|
11155931: "0xc8490cDee50174A00105598AD615e2d00f0Cfb10",
|
|
125
122
|
};
|
|
126
|
-
|
|
123
|
+
export const METAMASK_EXEC_MANAGER = {
|
|
127
124
|
11155111: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
128
125
|
11155420: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
129
126
|
84532: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
@@ -132,7 +129,7 @@ exports.METAMASK_EXEC_MANAGER = {
|
|
|
132
129
|
80002: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
133
130
|
11155931: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
134
131
|
};
|
|
135
|
-
|
|
132
|
+
export const EPOCH_ESCROW_ADDRESS = {
|
|
136
133
|
11155111: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
137
134
|
11155420: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
138
135
|
84532: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
@@ -141,7 +138,7 @@ exports.EPOCH_ESCROW_ADDRESS = {
|
|
|
141
138
|
80002: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
142
139
|
11155931: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
143
140
|
};
|
|
144
|
-
|
|
141
|
+
export const SAFE_MULTISEND_ADDRESS = {
|
|
145
142
|
11155111: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
146
143
|
11155420: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
147
144
|
84532: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
@@ -150,7 +147,7 @@ exports.SAFE_MULTISEND_ADDRESS = {
|
|
|
150
147
|
80002: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
151
148
|
11155931: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
152
149
|
};
|
|
153
|
-
|
|
150
|
+
export const SAFE_MULTISEND_CALL_ONLY_ADDRESS = {
|
|
154
151
|
11155111: "0x944b129a384265D916fbEA3440CD2caA4925145c",
|
|
155
152
|
11155420: "0x944b129a384265D916fbEA3440CD2caA4925145c",
|
|
156
153
|
84532: "0x944b129a384265D916fbEA3440CD2caA4925145c",
|
|
@@ -160,22 +157,22 @@ exports.SAFE_MULTISEND_CALL_ONLY_ADDRESS = {
|
|
|
160
157
|
11155931: "0x944b129a384265D916fbEA3440CD2caA4925145c",
|
|
161
158
|
};
|
|
162
159
|
const CONTRACT_ADDRESSES = {
|
|
163
|
-
METAMASK_EXEC_MANAGER
|
|
164
|
-
SAFE_PROXY_FACTORY_ADDRESS
|
|
165
|
-
SAFE_SINGLETON_ADDRESS
|
|
166
|
-
SAFE_7702_SINGLETON_ADDRESS
|
|
167
|
-
SAFE_7579_MODULE_ADDRESS
|
|
168
|
-
SAFE_7579_REGISTRY_ADDRESS
|
|
169
|
-
EIP7702_SAFE_PROXY_ADDRESS
|
|
170
|
-
EPOCH_MODULE_SAFE_ADDRESS
|
|
171
|
-
EPOCH_SAFE_INIT_SETUP
|
|
172
|
-
INTENT_REGISTRY_ADDRESS
|
|
173
|
-
SAFE_INIT_SETUP_FORWARDER
|
|
174
|
-
SAFE_WEBAUTHN_SHARED_SIGNER
|
|
175
|
-
SAFE_WEBAUTHN_SIGNER_FACTORY
|
|
176
|
-
FCLP256Verifier
|
|
177
|
-
EPOCH_ESCROW_ADDRESS
|
|
178
|
-
SAFE_MULTISEND_ADDRESS
|
|
179
|
-
SAFE_MULTISEND_CALL_ONLY_ADDRESS
|
|
180
|
-
};
|
|
181
|
-
|
|
160
|
+
METAMASK_EXEC_MANAGER,
|
|
161
|
+
SAFE_PROXY_FACTORY_ADDRESS,
|
|
162
|
+
SAFE_SINGLETON_ADDRESS,
|
|
163
|
+
SAFE_7702_SINGLETON_ADDRESS,
|
|
164
|
+
SAFE_7579_MODULE_ADDRESS,
|
|
165
|
+
SAFE_7579_REGISTRY_ADDRESS,
|
|
166
|
+
EIP7702_SAFE_PROXY_ADDRESS,
|
|
167
|
+
EPOCH_MODULE_SAFE_ADDRESS,
|
|
168
|
+
EPOCH_SAFE_INIT_SETUP,
|
|
169
|
+
INTENT_REGISTRY_ADDRESS,
|
|
170
|
+
SAFE_INIT_SETUP_FORWARDER,
|
|
171
|
+
SAFE_WEBAUTHN_SHARED_SIGNER,
|
|
172
|
+
SAFE_WEBAUTHN_SIGNER_FACTORY,
|
|
173
|
+
FCLP256Verifier,
|
|
174
|
+
EPOCH_ESCROW_ADDRESS,
|
|
175
|
+
SAFE_MULTISEND_ADDRESS,
|
|
176
|
+
SAFE_MULTISEND_CALL_ONLY_ADDRESS,
|
|
177
|
+
};
|
|
178
|
+
export { CONTRACT_ADDRESSES };
|
package/dist/constants/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./contractAddresses"), exports);
|
|
18
|
-
__exportStar(require("./compact"), exports);
|
|
1
|
+
export * from "./contractAddresses";
|
|
2
|
+
export * from "./compact";
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
"*": "*"
|
|
68
68
|
},
|
|
69
69
|
"type": ["bridge"]
|
|
70
|
+
},
|
|
71
|
+
"MidenBridge": {
|
|
72
|
+
"contractAddress": {
|
|
73
|
+
"*": "*"
|
|
74
|
+
},
|
|
75
|
+
"type": ["swapandbridge", "bridge"]
|
|
70
76
|
}
|
|
71
77
|
},
|
|
72
78
|
"tokens": {
|
|
@@ -78,7 +84,8 @@
|
|
|
78
84
|
"Mainnet": "0x2BB4FfD7E2c6D432b697554Efd77fA13bdbefd69",
|
|
79
85
|
"Polygon": "0x2BB4FfD7E2c6D432b697554Efd77fA13bdbefd69",
|
|
80
86
|
"Tatara": "0x2BB4FfD7E2c6D432b697554Efd77fA13bdbefd69",
|
|
81
|
-
"Rise": "0x2BB4FfD7E2c6D432b697554Efd77fA13bdbefd69"
|
|
87
|
+
"Rise": "0x2BB4FfD7E2c6D432b697554Efd77fA13bdbefd69",
|
|
88
|
+
"Miden": "0x084dc73a23ccd5204eec98c5ed2234"
|
|
82
89
|
},
|
|
83
90
|
"decimals": 18
|
|
84
91
|
},
|
|
@@ -102,7 +109,8 @@
|
|
|
102
109
|
"Mainnet": "0xc04d2869665Be874881133943523723Be5782720",
|
|
103
110
|
"Polygon": "0xc04d2869665Be874881133943523723Be5782720",
|
|
104
111
|
"Tatara": "0xc04d2869665Be874881133943523723Be5782720",
|
|
105
|
-
"Rise": "0xc04d2869665Be874881133943523723Be5782720"
|
|
112
|
+
"Rise": "0xc04d2869665Be874881133943523723Be5782720",
|
|
113
|
+
"Miden": "0xc04d2869665Be874881133943523723Be5782720"
|
|
106
114
|
},
|
|
107
115
|
"decimals": 18
|
|
108
116
|
},
|
|
@@ -207,6 +215,10 @@
|
|
|
207
215
|
"Rise": {
|
|
208
216
|
"chainId": 11155931,
|
|
209
217
|
"explorer": "https://explorer.testnet.riselabs.xyz"
|
|
218
|
+
},
|
|
219
|
+
"Miden": {
|
|
220
|
+
"chainId": 0,
|
|
221
|
+
"explorer": "https://testnet.midenscan.com/"
|
|
210
222
|
}
|
|
211
223
|
},
|
|
212
224
|
"relationships": {
|
|
@@ -452,6 +464,11 @@
|
|
|
452
464
|
"*": {
|
|
453
465
|
"tokensInAndOut": ["*"]
|
|
454
466
|
}
|
|
467
|
+
},
|
|
468
|
+
"MidenBridge": {
|
|
469
|
+
"*": {
|
|
470
|
+
"tokensInAndOut": ["*"]
|
|
471
|
+
}
|
|
455
472
|
}
|
|
456
473
|
},
|
|
457
474
|
"tokenChains": {
|
|
@@ -464,7 +481,7 @@
|
|
|
464
481
|
"Tatara",
|
|
465
482
|
"Rise"
|
|
466
483
|
],
|
|
467
|
-
"
|
|
484
|
+
"USDT": [
|
|
468
485
|
"Base",
|
|
469
486
|
"Optimism",
|
|
470
487
|
"Mainnet",
|
|
@@ -473,6 +490,16 @@
|
|
|
473
490
|
"Tatara",
|
|
474
491
|
"Rise"
|
|
475
492
|
],
|
|
493
|
+
"USDC": [
|
|
494
|
+
"Base",
|
|
495
|
+
"Optimism",
|
|
496
|
+
"Mainnet",
|
|
497
|
+
"Monad",
|
|
498
|
+
"Polygon",
|
|
499
|
+
"Tatara",
|
|
500
|
+
"Rise",
|
|
501
|
+
"Miden"
|
|
502
|
+
],
|
|
476
503
|
"WETH": [
|
|
477
504
|
"Base",
|
|
478
505
|
"Optimism",
|
package/dist/data/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.testnetGraph = exports.mainnetGraph = void 0;
|
|
7
|
-
const epochgraphmainnet_json_1 = __importDefault(require("./epochgraphmainnet.json"));
|
|
8
|
-
exports.mainnetGraph = epochgraphmainnet_json_1.default;
|
|
9
|
-
const epochgraphtestnet_json_1 = __importDefault(require("./epochgraphtestnet.json"));
|
|
10
|
-
exports.testnetGraph = epochgraphtestnet_json_1.default;
|
|
1
|
+
import mainnetGraph from "./epochgraphmainnet.json";
|
|
2
|
+
import testnetGraph from "./epochgraphtestnet.json";
|
|
3
|
+
export { mainnetGraph, testnetGraph };
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
1
|
// Export types
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
export * from "./types";
|
|
3
|
+
export * from "./data";
|
|
4
|
+
export * from "./constants";
|
|
5
|
+
export * from "./utils";
|
|
6
|
+
export * from "./web3";
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskType = exports.QueueExecutionType = exports.TransactionStatus = exports.ProtocolType = exports.WalletType = void 0;
|
|
4
|
-
var WalletType;
|
|
1
|
+
export var WalletType;
|
|
5
2
|
(function (WalletType) {
|
|
6
3
|
WalletType["safe"] = "safe";
|
|
7
4
|
WalletType["metamask"] = "metamask";
|
|
8
|
-
})(WalletType || (
|
|
5
|
+
})(WalletType || (WalletType = {}));
|
|
9
6
|
// Define types for various entities
|
|
10
|
-
var ProtocolType;
|
|
7
|
+
export var ProtocolType;
|
|
11
8
|
(function (ProtocolType) {
|
|
12
9
|
ProtocolType["lending"] = "lending:deposit";
|
|
13
10
|
ProtocolType["bridge"] = "bridge";
|
|
@@ -16,22 +13,22 @@ var ProtocolType;
|
|
|
16
13
|
ProtocolType["yield"] = "yield";
|
|
17
14
|
ProtocolType["swapandbridge"] = "swapandbridge";
|
|
18
15
|
ProtocolType["protocolInteraction"] = "protocol-interaction";
|
|
19
|
-
})(ProtocolType || (
|
|
20
|
-
var TransactionStatus;
|
|
16
|
+
})(ProtocolType || (ProtocolType = {}));
|
|
17
|
+
export var TransactionStatus;
|
|
21
18
|
(function (TransactionStatus) {
|
|
22
19
|
TransactionStatus["PENDING"] = "pending";
|
|
23
20
|
TransactionStatus["SUCCESS"] = "success";
|
|
24
21
|
TransactionStatus["FAILED"] = "failed";
|
|
25
|
-
})(TransactionStatus || (
|
|
26
|
-
var QueueExecutionType;
|
|
22
|
+
})(TransactionStatus || (TransactionStatus = {}));
|
|
23
|
+
export var QueueExecutionType;
|
|
27
24
|
(function (QueueExecutionType) {
|
|
28
25
|
QueueExecutionType["ADD_AND_EXECUTE"] = "addAndExecute";
|
|
29
26
|
QueueExecutionType["ADD_INTENT"] = "addIntent";
|
|
30
27
|
QueueExecutionType["SIMPLE_EXECUTION"] = "simpleExecution";
|
|
31
|
-
})(QueueExecutionType || (
|
|
32
|
-
var TaskType;
|
|
28
|
+
})(QueueExecutionType || (QueueExecutionType = {}));
|
|
29
|
+
export var TaskType;
|
|
33
30
|
(function (TaskType) {
|
|
34
31
|
TaskType["GetTokenOut"] = "gettokenout";
|
|
35
32
|
TaskType["Deposit"] = "deposit";
|
|
36
33
|
TaskType["ProtocolInteraction"] = "protocol-interaction";
|
|
37
|
-
})(TaskType || (
|
|
34
|
+
})(TaskType || (TaskType = {}));
|
package/dist/utils/compact.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.getClaimHash = getClaimHash;
|
|
5
|
-
const viem_1 = require("viem");
|
|
6
|
-
const utils_1 = require("viem/utils");
|
|
7
|
-
function getCompactTypehash(witnessTypeString) {
|
|
1
|
+
import { keccak256, toBytes, } from 'viem';
|
|
2
|
+
import { hashStruct } from 'viem/utils';
|
|
3
|
+
export function getCompactTypehash(witnessTypeString) {
|
|
8
4
|
if (witnessTypeString) {
|
|
9
5
|
const typestring = `Compact(address arbiter,address sponsor,uint256 nonce,uint256 expires,bytes12 lockTag,address token,uint256 amount,Mandate mandate)Mandate(${witnessTypeString})`;
|
|
10
6
|
console.log('typestring: ', typestring);
|
|
11
|
-
return
|
|
7
|
+
return keccak256(toBytes(typestring));
|
|
12
8
|
}
|
|
13
9
|
const typestring = 'Compact(address arbiter,address sponsor,uint256 nonce,uint256 expires,bytes12 lockTag,address token,uint256 amount)';
|
|
14
10
|
console.log('typestring: ', typestring);
|
|
15
|
-
return
|
|
11
|
+
return keccak256(toBytes(typestring));
|
|
16
12
|
}
|
|
17
|
-
function getClaimHash(message, witnessTypeString) {
|
|
13
|
+
export function getClaimHash(message, witnessTypeString) {
|
|
18
14
|
// Convert lockTag bigint to bytes12 hex string and token bigint to address
|
|
19
15
|
const messageWithFormattedData = {
|
|
20
16
|
...message,
|
|
@@ -27,7 +23,7 @@ function getClaimHash(message, witnessTypeString) {
|
|
|
27
23
|
console.log('Hererererere');
|
|
28
24
|
console.log('getTypes(message): ', getTypes(message, witnessTypeString));
|
|
29
25
|
console.log('herererere: ');
|
|
30
|
-
return
|
|
26
|
+
return hashStruct({
|
|
31
27
|
types: getTypes(messageWithFormattedData, witnessTypeString),
|
|
32
28
|
primaryType: 'Compact',
|
|
33
29
|
data: messageWithFormattedData,
|
package/dist/utils/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./compact"), exports);
|
|
18
|
-
__exportStar(require("./path"), exports);
|
|
1
|
+
export * from "./compact";
|
|
2
|
+
export * from "./path";
|
package/dist/utils/path.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseQuoteFromPath = parseQuoteFromPath;
|
|
4
1
|
/**
|
|
5
2
|
* Extracts tokenIn (first token amount) and tokenOut (last token amount) from a path.
|
|
6
3
|
* Path structure: path[chainPathIndex][entityRow][item].
|
|
7
4
|
* Rows per chain: chain, protocol, tokens, calldata.
|
|
8
5
|
*/
|
|
9
|
-
function parseQuoteFromPath(path) {
|
|
6
|
+
export function parseQuoteFromPath(path) {
|
|
10
7
|
if (!path || path.length === 0)
|
|
11
8
|
return null;
|
|
12
9
|
let tokenIn;
|
package/dist/web3/index.js
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.COMPACT_ABI = void 0;
|
|
21
|
-
const COMPACT_ABI_json_1 = __importDefault(require("./abis/COMPACT_ABI.json"));
|
|
22
|
-
exports.COMPACT_ABI = COMPACT_ABI_json_1.default;
|
|
23
|
-
__exportStar(require("./intents"), exports);
|
|
1
|
+
import COMPACT_ABI from "./abis/COMPACT_ABI.json";
|
|
2
|
+
export * from "./intents";
|
|
3
|
+
export { COMPACT_ABI };
|
package/dist/web3/intents.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEIP191IntentHash = exports.getIntentHash = exports.getEncodedIntent = void 0;
|
|
4
|
-
const ethers_1 = require("ethers");
|
|
1
|
+
import { ethers } from "ethers";
|
|
5
2
|
const getEncodedIntent = (intent) => {
|
|
6
|
-
const abiCoder = new
|
|
3
|
+
const abiCoder = new ethers.AbiCoder();
|
|
7
4
|
const intentParamsType = `tuple(
|
|
8
5
|
address sender,
|
|
9
6
|
tuple(address tokenAddress, address spenderAddress, uint256 amount, uint256 chainId)[] approvals,
|
|
@@ -16,17 +13,15 @@ const getEncodedIntent = (intent) => {
|
|
|
16
13
|
tuple(address target, uint256 value, bytes data)[] calldatas
|
|
17
14
|
)`;
|
|
18
15
|
const encodedIntent = abiCoder.encode([intentParamsType], [intent]);
|
|
19
|
-
return
|
|
16
|
+
return ethers.getBytes(encodedIntent);
|
|
20
17
|
};
|
|
21
|
-
exports.getEncodedIntent = getEncodedIntent;
|
|
22
18
|
const getIntentHash = (intent) => {
|
|
23
19
|
const encodedIntent = getEncodedIntent(intent);
|
|
24
|
-
const messageHash =
|
|
20
|
+
const messageHash = ethers.keccak256(encodedIntent);
|
|
25
21
|
return messageHash;
|
|
26
22
|
};
|
|
27
|
-
exports.getIntentHash = getIntentHash;
|
|
28
23
|
const getEIP191IntentHash = (intent) => {
|
|
29
24
|
const encodedIntent = getEncodedIntent(intent);
|
|
30
|
-
return
|
|
25
|
+
return ethers.hashMessage(encodedIntent);
|
|
31
26
|
};
|
|
32
|
-
|
|
27
|
+
export { getEncodedIntent, getIntentHash, getEIP191IntentHash };
|
package/package.json
CHANGED