@epoch-protocol/epoch-commons-sdk 0.1.5 → 0.1.6
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 +4 -1
- package/dist/constants/contractAddresses.js +39 -36
- package/dist/constants/index.js +18 -2
- package/dist/data/index.js +10 -3
- package/dist/index.js +21 -5
- package/dist/types/index.js +13 -10
- package/dist/utils/compact.js +11 -7
- package/dist/utils/index.js +18 -2
- package/dist/utils/path.js +4 -1
- package/dist/web3/index.js +23 -3
- package/dist/web3/intents.js +11 -6
- package/package.json +1 -2
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMPACT_ADDRESS = void 0;
|
|
1
4
|
// The Compact is deployed at the same address on all networks
|
|
2
|
-
|
|
5
|
+
exports.COMPACT_ADDRESS = '0x00000000000000171ede64904551eeDF3C6C9788';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
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 = {
|
|
2
5
|
11155111: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
3
6
|
11155420: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
4
7
|
84532: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
@@ -7,7 +10,7 @@ export const INTENT_REGISTRY_ADDRESS = {
|
|
|
7
10
|
11155931: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
8
11
|
129399: "0x299Ea355dBeDF225b3a88D67827a0a04dF943749",
|
|
9
12
|
};
|
|
10
|
-
|
|
13
|
+
exports.EPOCH_MODULE_SAFE_ADDRESS = {
|
|
11
14
|
11155111: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
12
15
|
11155420: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
13
16
|
84532: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
@@ -16,7 +19,7 @@ export const EPOCH_MODULE_SAFE_ADDRESS = {
|
|
|
16
19
|
11155931: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
17
20
|
129399: "0x1b4a3398102d42CA600Cb7e3f40a5495B4954071",
|
|
18
21
|
};
|
|
19
|
-
|
|
22
|
+
exports.EPOCH_SAFE_INIT_SETUP = {
|
|
20
23
|
11155111: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
21
24
|
11155420: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
22
25
|
84532: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
@@ -25,7 +28,7 @@ export const EPOCH_SAFE_INIT_SETUP = {
|
|
|
25
28
|
11155931: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
26
29
|
129399: "0xf460890181cB9C76EE404edE779555c9fEefB10e",
|
|
27
30
|
};
|
|
28
|
-
|
|
31
|
+
exports.SAFE_INIT_SETUP_FORWARDER = {
|
|
29
32
|
11155111: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
30
33
|
11155420: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
31
34
|
84532: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
@@ -34,7 +37,7 @@ export const SAFE_INIT_SETUP_FORWARDER = {
|
|
|
34
37
|
11155931: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
35
38
|
129399: "0x8c7192D248361844DBDdDa5dE58DF591996C44CB",
|
|
36
39
|
};
|
|
37
|
-
|
|
40
|
+
exports.SAFE_WEBAUTHN_SHARED_SIGNER = {
|
|
38
41
|
11155111: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
39
42
|
11155420: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
40
43
|
84532: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
@@ -43,7 +46,7 @@ export const SAFE_WEBAUTHN_SHARED_SIGNER = {
|
|
|
43
46
|
80002: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
44
47
|
11155931: "0x049b3EA3f45460dec04438312e70876f9325a737",
|
|
45
48
|
};
|
|
46
|
-
|
|
49
|
+
exports.SAFE_WEBAUTHN_SIGNER_FACTORY = {
|
|
47
50
|
11155111: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
48
51
|
11155420: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
49
52
|
84532: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
@@ -52,7 +55,7 @@ export const SAFE_WEBAUTHN_SIGNER_FACTORY = {
|
|
|
52
55
|
80002: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
53
56
|
11155931: "0xE66584AFFD075E9224d3B0f36978ec0263cEd6FD",
|
|
54
57
|
};
|
|
55
|
-
|
|
58
|
+
exports.FCLP256Verifier = {
|
|
56
59
|
11155111: "0xFB5D9DAddC16Bd61566c82Bf3F0659ce2B538bEE",
|
|
57
60
|
11155420: "0xFB5D9DAddC16Bd61566c82Bf3F0659ce2B538bEE",
|
|
58
61
|
84532: "0xFB5D9DAddC16Bd61566c82Bf3F0659ce2B538bEE",
|
|
@@ -62,7 +65,7 @@ export const FCLP256Verifier = {
|
|
|
62
65
|
11155931: "0xFB5D9DAddC16Bd61566c82Bf3F0659ce2B538bEE",
|
|
63
66
|
};
|
|
64
67
|
//todo: update for testnets
|
|
65
|
-
|
|
68
|
+
exports.SAFE_PROXY_FACTORY_ADDRESS = {
|
|
66
69
|
11155111: "0x6F0035ed7325d0DAaC2eB12562422Ae53faa682C",
|
|
67
70
|
11155420: "0x6F0035ed7325d0DAaC2eB12562422Ae53faa682C",
|
|
68
71
|
84532: "0x6F0035ed7325d0DAaC2eB12562422Ae53faa682C",
|
|
@@ -72,7 +75,7 @@ export const SAFE_PROXY_FACTORY_ADDRESS = {
|
|
|
72
75
|
11155931: "0x6F0035ed7325d0DAaC2eB12562422Ae53faa682C",
|
|
73
76
|
};
|
|
74
77
|
//todo: update for testnets
|
|
75
|
-
|
|
78
|
+
exports.SAFE_SINGLETON_ADDRESS = {
|
|
76
79
|
11155111: "0x5FdB4DaE6733008c82652D4e1B4a8c02dA3F5175",
|
|
77
80
|
11155420: "0x5FdB4DaE6733008c82652D4e1B4a8c02dA3F5175",
|
|
78
81
|
84532: "0x5FdB4DaE6733008c82652D4e1B4a8c02dA3F5175",
|
|
@@ -82,7 +85,7 @@ export const SAFE_SINGLETON_ADDRESS = {
|
|
|
82
85
|
11155931: "0x5FdB4DaE6733008c82652D4e1B4a8c02dA3F5175",
|
|
83
86
|
};
|
|
84
87
|
//todo: update for testnets
|
|
85
|
-
|
|
88
|
+
exports.SAFE_7702_SINGLETON_ADDRESS = {
|
|
86
89
|
11155111: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
87
90
|
11155420: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
88
91
|
84532: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
@@ -91,7 +94,7 @@ export const SAFE_7702_SINGLETON_ADDRESS = {
|
|
|
91
94
|
80002: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
92
95
|
11155931: "0x18F2d1EB128e64fE5EDcCa6A0Fa7702Aa44cf664",
|
|
93
96
|
};
|
|
94
|
-
|
|
97
|
+
exports.SAFE_7579_MODULE_ADDRESS = {
|
|
95
98
|
11155111: "0x5f73D1792f81Ee2356f99764904Cb03956F577d0",
|
|
96
99
|
11155420: "0x5f73D1792f81Ee2356f99764904Cb03956F577d0",
|
|
97
100
|
84532: "0x5f73D1792f81Ee2356f99764904Cb03956F577d0",
|
|
@@ -101,7 +104,7 @@ export const SAFE_7579_MODULE_ADDRESS = {
|
|
|
101
104
|
11155931: "0x5f73D1792f81Ee2356f99764904Cb03956F577d0",
|
|
102
105
|
};
|
|
103
106
|
//todo: update for testnets
|
|
104
|
-
|
|
107
|
+
exports.SAFE_7579_REGISTRY_ADDRESS = {
|
|
105
108
|
11155111: "0x6F1aBD911DBec98EEd1DfA470Ee98b61D3131A55",
|
|
106
109
|
11155420: "0x6F1aBD911DBec98EEd1DfA470Ee98b61D3131A55",
|
|
107
110
|
84532: "0x6F1aBD911DBec98EEd1DfA470Ee98b61D3131A55",
|
|
@@ -111,7 +114,7 @@ export const SAFE_7579_REGISTRY_ADDRESS = {
|
|
|
111
114
|
11155931: "0x6F1aBD911DBec98EEd1DfA470Ee98b61D3131A55",
|
|
112
115
|
};
|
|
113
116
|
//todo: update for testnets
|
|
114
|
-
|
|
117
|
+
exports.EIP7702_SAFE_PROXY_ADDRESS = {
|
|
115
118
|
11155111: "0xE60EcE6588DCcFb7373538034963B4D20a280DB0",
|
|
116
119
|
11155420: "0xc8490cDee50174A00105598AD615e2d00f0Cfb10",
|
|
117
120
|
84532: "0xc8490cDee50174A00105598AD615e2d00f0Cfb10",
|
|
@@ -120,7 +123,7 @@ export const EIP7702_SAFE_PROXY_ADDRESS = {
|
|
|
120
123
|
80002: "0xc8490cDee50174A00105598AD615e2d00f0Cfb10",
|
|
121
124
|
11155931: "0xc8490cDee50174A00105598AD615e2d00f0Cfb10",
|
|
122
125
|
};
|
|
123
|
-
|
|
126
|
+
exports.METAMASK_EXEC_MANAGER = {
|
|
124
127
|
11155111: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
125
128
|
11155420: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
126
129
|
84532: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
@@ -129,7 +132,7 @@ export const METAMASK_EXEC_MANAGER = {
|
|
|
129
132
|
80002: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
130
133
|
11155931: "0xC913903b10f8Aa3bEf3e368EbDAeb13D73603524",
|
|
131
134
|
};
|
|
132
|
-
|
|
135
|
+
exports.EPOCH_ESCROW_ADDRESS = {
|
|
133
136
|
11155111: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
134
137
|
11155420: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
135
138
|
84532: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
@@ -138,7 +141,7 @@ export const EPOCH_ESCROW_ADDRESS = {
|
|
|
138
141
|
80002: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
139
142
|
11155931: "0xA88Ea7EB5f687d05e20b7232d698864A7c17e20C",
|
|
140
143
|
};
|
|
141
|
-
|
|
144
|
+
exports.SAFE_MULTISEND_ADDRESS = {
|
|
142
145
|
11155111: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
143
146
|
11155420: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
144
147
|
84532: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
@@ -147,7 +150,7 @@ export const SAFE_MULTISEND_ADDRESS = {
|
|
|
147
150
|
80002: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
148
151
|
11155931: "0x328AB3a53287503DF0EFED81928a2b45b3205B2A",
|
|
149
152
|
};
|
|
150
|
-
|
|
153
|
+
exports.SAFE_MULTISEND_CALL_ONLY_ADDRESS = {
|
|
151
154
|
11155111: "0x944b129a384265D916fbEA3440CD2caA4925145c",
|
|
152
155
|
11155420: "0x944b129a384265D916fbEA3440CD2caA4925145c",
|
|
153
156
|
84532: "0x944b129a384265D916fbEA3440CD2caA4925145c",
|
|
@@ -157,22 +160,22 @@ export const SAFE_MULTISEND_CALL_ONLY_ADDRESS = {
|
|
|
157
160
|
11155931: "0x944b129a384265D916fbEA3440CD2caA4925145c",
|
|
158
161
|
};
|
|
159
162
|
const CONTRACT_ADDRESSES = {
|
|
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
|
-
|
|
163
|
+
METAMASK_EXEC_MANAGER: exports.METAMASK_EXEC_MANAGER,
|
|
164
|
+
SAFE_PROXY_FACTORY_ADDRESS: exports.SAFE_PROXY_FACTORY_ADDRESS,
|
|
165
|
+
SAFE_SINGLETON_ADDRESS: exports.SAFE_SINGLETON_ADDRESS,
|
|
166
|
+
SAFE_7702_SINGLETON_ADDRESS: exports.SAFE_7702_SINGLETON_ADDRESS,
|
|
167
|
+
SAFE_7579_MODULE_ADDRESS: exports.SAFE_7579_MODULE_ADDRESS,
|
|
168
|
+
SAFE_7579_REGISTRY_ADDRESS: exports.SAFE_7579_REGISTRY_ADDRESS,
|
|
169
|
+
EIP7702_SAFE_PROXY_ADDRESS: exports.EIP7702_SAFE_PROXY_ADDRESS,
|
|
170
|
+
EPOCH_MODULE_SAFE_ADDRESS: exports.EPOCH_MODULE_SAFE_ADDRESS,
|
|
171
|
+
EPOCH_SAFE_INIT_SETUP: exports.EPOCH_SAFE_INIT_SETUP,
|
|
172
|
+
INTENT_REGISTRY_ADDRESS: exports.INTENT_REGISTRY_ADDRESS,
|
|
173
|
+
SAFE_INIT_SETUP_FORWARDER: exports.SAFE_INIT_SETUP_FORWARDER,
|
|
174
|
+
SAFE_WEBAUTHN_SHARED_SIGNER: exports.SAFE_WEBAUTHN_SHARED_SIGNER,
|
|
175
|
+
SAFE_WEBAUTHN_SIGNER_FACTORY: exports.SAFE_WEBAUTHN_SIGNER_FACTORY,
|
|
176
|
+
FCLP256Verifier: exports.FCLP256Verifier,
|
|
177
|
+
EPOCH_ESCROW_ADDRESS: exports.EPOCH_ESCROW_ADDRESS,
|
|
178
|
+
SAFE_MULTISEND_ADDRESS: exports.SAFE_MULTISEND_ADDRESS,
|
|
179
|
+
SAFE_MULTISEND_CALL_ONLY_ADDRESS: exports.SAFE_MULTISEND_CALL_ONLY_ADDRESS,
|
|
180
|
+
};
|
|
181
|
+
exports.CONTRACT_ADDRESSES = CONTRACT_ADDRESSES;
|
package/dist/constants/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
__exportStar(require("./contractAddresses"), exports);
|
|
18
|
+
__exportStar(require("./compact"), exports);
|
package/dist/data/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
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;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
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 });
|
|
1
17
|
// Export types
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
__exportStar(require("./data"), exports);
|
|
20
|
+
__exportStar(require("./constants"), exports);
|
|
21
|
+
__exportStar(require("./utils"), exports);
|
|
22
|
+
__exportStar(require("./web3"), exports);
|
package/dist/types/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskType = exports.QueueExecutionType = exports.TransactionStatus = exports.ProtocolType = exports.WalletType = void 0;
|
|
4
|
+
var WalletType;
|
|
2
5
|
(function (WalletType) {
|
|
3
6
|
WalletType["safe"] = "safe";
|
|
4
7
|
WalletType["metamask"] = "metamask";
|
|
5
|
-
})(WalletType || (WalletType = {}));
|
|
8
|
+
})(WalletType || (exports.WalletType = WalletType = {}));
|
|
6
9
|
// Define types for various entities
|
|
7
|
-
|
|
10
|
+
var ProtocolType;
|
|
8
11
|
(function (ProtocolType) {
|
|
9
12
|
ProtocolType["lending"] = "lending:deposit";
|
|
10
13
|
ProtocolType["bridge"] = "bridge";
|
|
@@ -13,22 +16,22 @@ export var ProtocolType;
|
|
|
13
16
|
ProtocolType["yield"] = "yield";
|
|
14
17
|
ProtocolType["swapandbridge"] = "swapandbridge";
|
|
15
18
|
ProtocolType["protocolInteraction"] = "protocol-interaction";
|
|
16
|
-
})(ProtocolType || (ProtocolType = {}));
|
|
17
|
-
|
|
19
|
+
})(ProtocolType || (exports.ProtocolType = ProtocolType = {}));
|
|
20
|
+
var TransactionStatus;
|
|
18
21
|
(function (TransactionStatus) {
|
|
19
22
|
TransactionStatus["PENDING"] = "pending";
|
|
20
23
|
TransactionStatus["SUCCESS"] = "success";
|
|
21
24
|
TransactionStatus["FAILED"] = "failed";
|
|
22
|
-
})(TransactionStatus || (TransactionStatus = {}));
|
|
23
|
-
|
|
25
|
+
})(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
|
|
26
|
+
var QueueExecutionType;
|
|
24
27
|
(function (QueueExecutionType) {
|
|
25
28
|
QueueExecutionType["ADD_AND_EXECUTE"] = "addAndExecute";
|
|
26
29
|
QueueExecutionType["ADD_INTENT"] = "addIntent";
|
|
27
30
|
QueueExecutionType["SIMPLE_EXECUTION"] = "simpleExecution";
|
|
28
|
-
})(QueueExecutionType || (QueueExecutionType = {}));
|
|
29
|
-
|
|
31
|
+
})(QueueExecutionType || (exports.QueueExecutionType = QueueExecutionType = {}));
|
|
32
|
+
var TaskType;
|
|
30
33
|
(function (TaskType) {
|
|
31
34
|
TaskType["GetTokenOut"] = "gettokenout";
|
|
32
35
|
TaskType["Deposit"] = "deposit";
|
|
33
36
|
TaskType["ProtocolInteraction"] = "protocol-interaction";
|
|
34
|
-
})(TaskType || (TaskType = {}));
|
|
37
|
+
})(TaskType || (exports.TaskType = TaskType = {}));
|
package/dist/utils/compact.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCompactTypehash = getCompactTypehash;
|
|
4
|
+
exports.getClaimHash = getClaimHash;
|
|
5
|
+
const viem_1 = require("viem");
|
|
6
|
+
const utils_1 = require("viem/utils");
|
|
7
|
+
function getCompactTypehash(witnessTypeString) {
|
|
4
8
|
if (witnessTypeString) {
|
|
5
9
|
const typestring = `Compact(address arbiter,address sponsor,uint256 nonce,uint256 expires,bytes12 lockTag,address token,uint256 amount,Mandate mandate)Mandate(${witnessTypeString})`;
|
|
6
10
|
console.log('typestring: ', typestring);
|
|
7
|
-
return keccak256(toBytes(typestring));
|
|
11
|
+
return (0, viem_1.keccak256)((0, viem_1.toBytes)(typestring));
|
|
8
12
|
}
|
|
9
13
|
const typestring = 'Compact(address arbiter,address sponsor,uint256 nonce,uint256 expires,bytes12 lockTag,address token,uint256 amount)';
|
|
10
14
|
console.log('typestring: ', typestring);
|
|
11
|
-
return keccak256(toBytes(typestring));
|
|
15
|
+
return (0, viem_1.keccak256)((0, viem_1.toBytes)(typestring));
|
|
12
16
|
}
|
|
13
|
-
|
|
17
|
+
function getClaimHash(message, witnessTypeString) {
|
|
14
18
|
// Convert lockTag bigint to bytes12 hex string and token bigint to address
|
|
15
19
|
const messageWithFormattedData = {
|
|
16
20
|
...message,
|
|
@@ -23,7 +27,7 @@ export function getClaimHash(message, witnessTypeString) {
|
|
|
23
27
|
console.log('Hererererere');
|
|
24
28
|
console.log('getTypes(message): ', getTypes(message, witnessTypeString));
|
|
25
29
|
console.log('herererere: ');
|
|
26
|
-
return hashStruct({
|
|
30
|
+
return (0, utils_1.hashStruct)({
|
|
27
31
|
types: getTypes(messageWithFormattedData, witnessTypeString),
|
|
28
32
|
primaryType: 'Compact',
|
|
29
33
|
data: messageWithFormattedData,
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
__exportStar(require("./compact"), exports);
|
|
18
|
+
__exportStar(require("./path"), exports);
|
package/dist/utils/path.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseQuoteFromPath = parseQuoteFromPath;
|
|
1
4
|
/**
|
|
2
5
|
* Extracts tokenIn (first token amount) and tokenOut (last token amount) from a path.
|
|
3
6
|
* Path structure: path[chainPathIndex][entityRow][item].
|
|
4
7
|
* Rows per chain: chain, protocol, tokens, calldata.
|
|
5
8
|
*/
|
|
6
|
-
|
|
9
|
+
function parseQuoteFromPath(path) {
|
|
7
10
|
if (!path || path.length === 0)
|
|
8
11
|
return null;
|
|
9
12
|
let tokenIn;
|
package/dist/web3/index.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
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);
|
package/dist/web3/intents.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEIP191IntentHash = exports.getIntentHash = exports.getEncodedIntent = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
2
5
|
const getEncodedIntent = (intent) => {
|
|
3
|
-
const abiCoder = new ethers.AbiCoder();
|
|
6
|
+
const abiCoder = new ethers_1.ethers.AbiCoder();
|
|
4
7
|
const intentParamsType = `tuple(
|
|
5
8
|
address sender,
|
|
6
9
|
tuple(address tokenAddress, address spenderAddress, uint256 amount, uint256 chainId)[] approvals,
|
|
@@ -13,15 +16,17 @@ const getEncodedIntent = (intent) => {
|
|
|
13
16
|
tuple(address target, uint256 value, bytes data)[] calldatas
|
|
14
17
|
)`;
|
|
15
18
|
const encodedIntent = abiCoder.encode([intentParamsType], [intent]);
|
|
16
|
-
return ethers.getBytes(encodedIntent);
|
|
19
|
+
return ethers_1.ethers.getBytes(encodedIntent);
|
|
17
20
|
};
|
|
21
|
+
exports.getEncodedIntent = getEncodedIntent;
|
|
18
22
|
const getIntentHash = (intent) => {
|
|
19
23
|
const encodedIntent = getEncodedIntent(intent);
|
|
20
|
-
const messageHash = ethers.keccak256(encodedIntent);
|
|
24
|
+
const messageHash = ethers_1.ethers.keccak256(encodedIntent);
|
|
21
25
|
return messageHash;
|
|
22
26
|
};
|
|
27
|
+
exports.getIntentHash = getIntentHash;
|
|
23
28
|
const getEIP191IntentHash = (intent) => {
|
|
24
29
|
const encodedIntent = getEncodedIntent(intent);
|
|
25
|
-
return ethers.hashMessage(encodedIntent);
|
|
30
|
+
return ethers_1.ethers.hashMessage(encodedIntent);
|
|
26
31
|
};
|
|
27
|
-
|
|
32
|
+
exports.getEIP191IntentHash = getEIP191IntentHash;
|
package/package.json
CHANGED