@funkit/fun-relay 2.2.0-next.5 → 2.2.0-next.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.
@@ -1 +1 @@
1
- {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/dynamicRoutes/assets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuFlD,CAAA;AAED,eAAO,MAAM,cAAc,qDAAqD,CAAA;AAEhF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,UAE7C"}
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/dynamicRoutes/assets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAwFlD,CAAA;AAED,eAAO,MAAM,cAAc,qDAAqD,CAAA;AAEhF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,UAE7C"}
@@ -9,6 +9,24 @@ export declare const tokenAddresses: {
9
9
  readonly USDC: {
10
10
  readonly 1: `0x${string}`;
11
11
  };
12
+ readonly LIT: {
13
+ readonly 1: `0x${string}`;
14
+ };
15
+ readonly LINK: {
16
+ readonly 1: `0x${string}`;
17
+ };
18
+ readonly UNI: {
19
+ readonly 1: `0x${string}`;
20
+ };
21
+ readonly AAVE: {
22
+ readonly 1: `0x${string}`;
23
+ };
24
+ readonly SKY: {
25
+ readonly 1: `0x${string}`;
26
+ };
27
+ readonly LDO: {
28
+ readonly 1: `0x${string}`;
29
+ };
12
30
  };
13
31
  export declare const UNWRAP_AND_CALL_ADDRESS: {
14
32
  readonly 1: `0x${string}`;
@@ -1 +1 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/dynamicRoutes/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,MAAM,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,MAAM,CAAA;AAG5C,eAAO,MAAM,kBAAkB,kFACsC,CAAA;AAErE,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAA;AAEV,eAAO,MAAM,uBAAuB;;CAE1B,CAAA;AAEV,eAAO,MAAM,uBAAuB;;CAE1B,CAAA;AAEV,eAAO,MAAM,uBAAuB,EAE/B,OAAO,CAAA;AAEZ,eAAO,MAAM,mBAAmB,EAAE,iBAAuB,CAAA"}
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/dynamicRoutes/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,MAAM,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,MAAM,CAAA;AAG5C,eAAO,MAAM,kBAAkB,kFACsC,CAAA;AAErE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CA0BjB,CAAA;AAEV,eAAO,MAAM,uBAAuB;;CAE1B,CAAA;AAEV,eAAO,MAAM,uBAAuB;;CAE1B,CAAA;AAEV,eAAO,MAAM,uBAAuB,EAE/B,OAAO,CAAA;AAEZ,eAAO,MAAM,mBAAmB,EAAE,iBAAuB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"lighter.d.ts","sourceRoot":"","sources":["../../../src/dynamicRoutes/lighter.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,SAAS,CAAA;AAgLvD,eAAO,MAAM,sBAAsB,EAAE,YAAY,EA2ChD,CAAA"}
1
+ {"version":3,"file":"lighter.d.ts","sourceRoot":"","sources":["../../../src/dynamicRoutes/lighter.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,SAAS,CAAA;AAiUvD,eAAO,MAAM,sBAAsB,EAAE,YAAY,EA0EhD,CAAA"}
@@ -1,5 +1,317 @@
1
+ import { type Address } from 'viem';
1
2
  import type { DynamicRoute, DynamicRouteConfig, DynamicRoutePath, DynamicRoutingConfig, IndexedDynamicRoutingConfig } from './types';
2
3
  export declare const createPath: (config: DynamicRoutePath) => DynamicRoutePath;
3
4
  export declare const createRoute: (config: DynamicRouteConfig) => DynamicRoute;
4
5
  export declare const initDynamicRouting: (dynamicRoutes: DynamicRoute[], dynamicRoutingConfig: DynamicRoutingConfig) => IndexedDynamicRoutingConfig;
6
+ export declare const MAX_APPROVAL = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
7
+ /**
8
+ * Returns args for the approve function call.
9
+ * @param tokenAddress - The address of the token to approve
10
+ * @param spenderAddress - The address of the spender to approve
11
+ * @param amount - The amount of tokens to approve
12
+ */
13
+ export declare const getApprovalCalldata: ({ tokenAddress, spenderAddress, amount, }: {
14
+ tokenAddress: Address;
15
+ spenderAddress: Address;
16
+ amount: string;
17
+ }) => {
18
+ contractAbi: readonly [{
19
+ readonly type: "event";
20
+ readonly name: "Approval";
21
+ readonly inputs: readonly [{
22
+ readonly indexed: true;
23
+ readonly name: "owner";
24
+ readonly type: "address";
25
+ }, {
26
+ readonly indexed: true;
27
+ readonly name: "spender";
28
+ readonly type: "address";
29
+ }, {
30
+ readonly indexed: false;
31
+ readonly name: "value";
32
+ readonly type: "uint256";
33
+ }];
34
+ }, {
35
+ readonly type: "event";
36
+ readonly name: "Transfer";
37
+ readonly inputs: readonly [{
38
+ readonly indexed: true;
39
+ readonly name: "from";
40
+ readonly type: "address";
41
+ }, {
42
+ readonly indexed: true;
43
+ readonly name: "to";
44
+ readonly type: "address";
45
+ }, {
46
+ readonly indexed: false;
47
+ readonly name: "value";
48
+ readonly type: "uint256";
49
+ }];
50
+ }, {
51
+ readonly type: "function";
52
+ readonly name: "allowance";
53
+ readonly stateMutability: "view";
54
+ readonly inputs: readonly [{
55
+ readonly name: "owner";
56
+ readonly type: "address";
57
+ }, {
58
+ readonly name: "spender";
59
+ readonly type: "address";
60
+ }];
61
+ readonly outputs: readonly [{
62
+ readonly type: "uint256";
63
+ }];
64
+ }, {
65
+ readonly type: "function";
66
+ readonly name: "approve";
67
+ readonly stateMutability: "nonpayable";
68
+ readonly inputs: readonly [{
69
+ readonly name: "spender";
70
+ readonly type: "address";
71
+ }, {
72
+ readonly name: "amount";
73
+ readonly type: "uint256";
74
+ }];
75
+ readonly outputs: readonly [{
76
+ readonly type: "bool";
77
+ }];
78
+ }, {
79
+ readonly type: "function";
80
+ readonly name: "balanceOf";
81
+ readonly stateMutability: "view";
82
+ readonly inputs: readonly [{
83
+ readonly name: "account";
84
+ readonly type: "address";
85
+ }];
86
+ readonly outputs: readonly [{
87
+ readonly type: "uint256";
88
+ }];
89
+ }, {
90
+ readonly type: "function";
91
+ readonly name: "decimals";
92
+ readonly stateMutability: "view";
93
+ readonly inputs: readonly [];
94
+ readonly outputs: readonly [{
95
+ readonly type: "uint8";
96
+ }];
97
+ }, {
98
+ readonly type: "function";
99
+ readonly name: "name";
100
+ readonly stateMutability: "view";
101
+ readonly inputs: readonly [];
102
+ readonly outputs: readonly [{
103
+ readonly type: "string";
104
+ }];
105
+ }, {
106
+ readonly type: "function";
107
+ readonly name: "symbol";
108
+ readonly stateMutability: "view";
109
+ readonly inputs: readonly [];
110
+ readonly outputs: readonly [{
111
+ readonly type: "string";
112
+ }];
113
+ }, {
114
+ readonly type: "function";
115
+ readonly name: "totalSupply";
116
+ readonly stateMutability: "view";
117
+ readonly inputs: readonly [];
118
+ readonly outputs: readonly [{
119
+ readonly type: "uint256";
120
+ }];
121
+ }, {
122
+ readonly type: "function";
123
+ readonly name: "transfer";
124
+ readonly stateMutability: "nonpayable";
125
+ readonly inputs: readonly [{
126
+ readonly name: "recipient";
127
+ readonly type: "address";
128
+ }, {
129
+ readonly name: "amount";
130
+ readonly type: "uint256";
131
+ }];
132
+ readonly outputs: readonly [{
133
+ readonly type: "bool";
134
+ }];
135
+ }, {
136
+ readonly type: "function";
137
+ readonly name: "transferFrom";
138
+ readonly stateMutability: "nonpayable";
139
+ readonly inputs: readonly [{
140
+ readonly name: "sender";
141
+ readonly type: "address";
142
+ }, {
143
+ readonly name: "recipient";
144
+ readonly type: "address";
145
+ }, {
146
+ readonly name: "amount";
147
+ readonly type: "uint256";
148
+ }];
149
+ readonly outputs: readonly [{
150
+ readonly type: "bool";
151
+ }];
152
+ }];
153
+ contractAddress: `0x${string}`;
154
+ functionName: "approve";
155
+ functionArgs: string[];
156
+ };
157
+ /**
158
+ * Returns args for the approve function call to reset the approval to 0.
159
+ * @param tokenAddress - The address of the token to reset the approval for
160
+ * @param spenderAddress - The address of the spender to reset the approval for
161
+ */
162
+ export declare const getResetApprovalCalldata: ({ tokenAddress, spenderAddress, }: {
163
+ tokenAddress: Address;
164
+ spenderAddress: Address;
165
+ }) => {
166
+ contractAbi: readonly [{
167
+ readonly type: "event";
168
+ readonly name: "Approval";
169
+ readonly inputs: readonly [{
170
+ readonly indexed: true;
171
+ readonly name: "owner";
172
+ readonly type: "address";
173
+ }, {
174
+ readonly indexed: true;
175
+ readonly name: "spender";
176
+ readonly type: "address";
177
+ }, {
178
+ readonly indexed: false;
179
+ readonly name: "value";
180
+ readonly type: "uint256";
181
+ }];
182
+ }, {
183
+ readonly type: "event";
184
+ readonly name: "Transfer";
185
+ readonly inputs: readonly [{
186
+ readonly indexed: true;
187
+ readonly name: "from";
188
+ readonly type: "address";
189
+ }, {
190
+ readonly indexed: true;
191
+ readonly name: "to";
192
+ readonly type: "address";
193
+ }, {
194
+ readonly indexed: false;
195
+ readonly name: "value";
196
+ readonly type: "uint256";
197
+ }];
198
+ }, {
199
+ readonly type: "function";
200
+ readonly name: "allowance";
201
+ readonly stateMutability: "view";
202
+ readonly inputs: readonly [{
203
+ readonly name: "owner";
204
+ readonly type: "address";
205
+ }, {
206
+ readonly name: "spender";
207
+ readonly type: "address";
208
+ }];
209
+ readonly outputs: readonly [{
210
+ readonly type: "uint256";
211
+ }];
212
+ }, {
213
+ readonly type: "function";
214
+ readonly name: "approve";
215
+ readonly stateMutability: "nonpayable";
216
+ readonly inputs: readonly [{
217
+ readonly name: "spender";
218
+ readonly type: "address";
219
+ }, {
220
+ readonly name: "amount";
221
+ readonly type: "uint256";
222
+ }];
223
+ readonly outputs: readonly [{
224
+ readonly type: "bool";
225
+ }];
226
+ }, {
227
+ readonly type: "function";
228
+ readonly name: "balanceOf";
229
+ readonly stateMutability: "view";
230
+ readonly inputs: readonly [{
231
+ readonly name: "account";
232
+ readonly type: "address";
233
+ }];
234
+ readonly outputs: readonly [{
235
+ readonly type: "uint256";
236
+ }];
237
+ }, {
238
+ readonly type: "function";
239
+ readonly name: "decimals";
240
+ readonly stateMutability: "view";
241
+ readonly inputs: readonly [];
242
+ readonly outputs: readonly [{
243
+ readonly type: "uint8";
244
+ }];
245
+ }, {
246
+ readonly type: "function";
247
+ readonly name: "name";
248
+ readonly stateMutability: "view";
249
+ readonly inputs: readonly [];
250
+ readonly outputs: readonly [{
251
+ readonly type: "string";
252
+ }];
253
+ }, {
254
+ readonly type: "function";
255
+ readonly name: "symbol";
256
+ readonly stateMutability: "view";
257
+ readonly inputs: readonly [];
258
+ readonly outputs: readonly [{
259
+ readonly type: "string";
260
+ }];
261
+ }, {
262
+ readonly type: "function";
263
+ readonly name: "totalSupply";
264
+ readonly stateMutability: "view";
265
+ readonly inputs: readonly [];
266
+ readonly outputs: readonly [{
267
+ readonly type: "uint256";
268
+ }];
269
+ }, {
270
+ readonly type: "function";
271
+ readonly name: "transfer";
272
+ readonly stateMutability: "nonpayable";
273
+ readonly inputs: readonly [{
274
+ readonly name: "recipient";
275
+ readonly type: "address";
276
+ }, {
277
+ readonly name: "amount";
278
+ readonly type: "uint256";
279
+ }];
280
+ readonly outputs: readonly [{
281
+ readonly type: "bool";
282
+ }];
283
+ }, {
284
+ readonly type: "function";
285
+ readonly name: "transferFrom";
286
+ readonly stateMutability: "nonpayable";
287
+ readonly inputs: readonly [{
288
+ readonly name: "sender";
289
+ readonly type: "address";
290
+ }, {
291
+ readonly name: "recipient";
292
+ readonly type: "address";
293
+ }, {
294
+ readonly name: "amount";
295
+ readonly type: "uint256";
296
+ }];
297
+ readonly outputs: readonly [{
298
+ readonly type: "bool";
299
+ }];
300
+ }];
301
+ contractAddress: `0x${string}`;
302
+ functionName: "approve";
303
+ functionArgs: string[];
304
+ };
305
+ /**
306
+ * These tokens have a brain dead implementation of the approve function.
307
+ * They require the approval to be reset to 0 before the approval can be set to a new value.
308
+ */
309
+ export declare const RESET_APPROVAL_TOKENS: string[];
310
+ /**
311
+ * Checks if a token requires approval reset before approval can be set to a new value due to non-standard implementation of the approve function.
312
+ *
313
+ * @param tokenAddress - The address of the token to check if it requires approval reset before approval can be set to a new value.
314
+ * @returns true if the token requires approval reset before approval can be set to a new value, false otherwise.
315
+ */
316
+ export declare const shouldResetApproval: (tokenAddress: Address) => boolean;
5
317
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/dynamicRoutes/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,EAE5B,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,UAAU,GAAI,QAAQ,gBAAgB,KAAG,gBAErD,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,QAAQ,kBAAkB,KAAG,YAcxD,CAAA;AASD,eAAO,MAAM,kBAAkB,GAC7B,eAAe,YAAY,EAAE,EAC7B,sBAAsB,oBAAoB,gCAkF3C,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/dynamicRoutes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,MAAM,CAA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