@debridge-finance/intents-client 1.2.2 → 1.2.4
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/index.d.mts +381 -118
- package/dist/index.d.ts +381 -118
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ import { Buffer as Buffer$1 } from 'buffer';
|
|
|
9
9
|
* IDL can be found at `target/idl/intents_program.json`.
|
|
10
10
|
*/
|
|
11
11
|
type IntentsProgram = {
|
|
12
|
-
address: "
|
|
12
|
+
address: "intV2u5xDE8T2ZMFP3W3X6sVqGHBT7zvYtTW3rRLmvE";
|
|
13
13
|
metadata: {
|
|
14
14
|
name: "intentsProgram";
|
|
15
15
|
version: "0.0.0";
|
|
@@ -50,44 +50,22 @@ type IntentsProgram = {
|
|
|
50
50
|
];
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
name: "
|
|
54
|
-
discriminator: [
|
|
53
|
+
name: "cancelIntent";
|
|
54
|
+
discriminator: [67, 73, 238, 244, 208, 89, 225, 59];
|
|
55
55
|
accounts: [
|
|
56
56
|
{
|
|
57
|
-
name: "
|
|
57
|
+
name: "initiator";
|
|
58
58
|
signer: true;
|
|
59
|
-
relations: ["state"];
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "state";
|
|
63
|
-
pda: {
|
|
64
|
-
seeds: [
|
|
65
|
-
{
|
|
66
|
-
kind: "const";
|
|
67
|
-
value: [115, 116, 97, 116, 101];
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: "from";
|
|
74
59
|
},
|
|
75
60
|
{
|
|
76
|
-
name: "
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
name: "mint";
|
|
61
|
+
name: "intentStorage";
|
|
62
|
+
writable: true;
|
|
80
63
|
},
|
|
81
64
|
{
|
|
82
|
-
name: "
|
|
83
|
-
}
|
|
84
|
-
];
|
|
85
|
-
args: [
|
|
86
|
-
{
|
|
87
|
-
name: "amount";
|
|
88
|
-
type: "u64";
|
|
65
|
+
name: "state";
|
|
89
66
|
}
|
|
90
67
|
];
|
|
68
|
+
args: [];
|
|
91
69
|
},
|
|
92
70
|
{
|
|
93
71
|
name: "closeAccount";
|
|
@@ -96,7 +74,7 @@ type IntentsProgram = {
|
|
|
96
74
|
{
|
|
97
75
|
name: "programAuthority";
|
|
98
76
|
signer: true;
|
|
99
|
-
address: "
|
|
77
|
+
address: "intV2u5xDE8T2ZMFP3W3X6sVqGHBT7zvYtTW3rRLmvE";
|
|
100
78
|
},
|
|
101
79
|
{
|
|
102
80
|
name: "target";
|
|
@@ -114,9 +92,24 @@ type IntentsProgram = {
|
|
|
114
92
|
discriminator: [112, 245, 154, 249, 57, 126, 54, 122];
|
|
115
93
|
accounts: [
|
|
116
94
|
{
|
|
117
|
-
name: "
|
|
95
|
+
name: "maker";
|
|
96
|
+
docs: ["CHECK"];
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "makerInfo";
|
|
118
100
|
writable: true;
|
|
119
|
-
|
|
101
|
+
pda: {
|
|
102
|
+
seeds: [
|
|
103
|
+
{
|
|
104
|
+
kind: "const";
|
|
105
|
+
value: [109, 97, 107, 101, 114, 95, 105, 110, 102, 111];
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
kind: "account";
|
|
109
|
+
path: "maker";
|
|
110
|
+
}
|
|
111
|
+
];
|
|
112
|
+
};
|
|
120
113
|
},
|
|
121
114
|
{
|
|
122
115
|
name: "rentPayer";
|
|
@@ -231,6 +224,149 @@ type IntentsProgram = {
|
|
|
231
224
|
}
|
|
232
225
|
];
|
|
233
226
|
},
|
|
227
|
+
{
|
|
228
|
+
name: "drainClosedIntentTokenAccount";
|
|
229
|
+
discriminator: [87, 82, 87, 135, 95, 99, 78, 116];
|
|
230
|
+
accounts: [
|
|
231
|
+
{
|
|
232
|
+
name: "state";
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "maker";
|
|
236
|
+
docs: ["CHECK"];
|
|
237
|
+
relations: ["intentStorage"];
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "intentStorage";
|
|
241
|
+
writable: true;
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "intentTokenAccount";
|
|
245
|
+
writable: true;
|
|
246
|
+
pda: {
|
|
247
|
+
seeds: [
|
|
248
|
+
{
|
|
249
|
+
kind: "account";
|
|
250
|
+
path: "intentStorage";
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
kind: "account";
|
|
254
|
+
path: "tokenProgram";
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
kind: "account";
|
|
258
|
+
path: "tokenMint";
|
|
259
|
+
}
|
|
260
|
+
];
|
|
261
|
+
program: {
|
|
262
|
+
kind: "const";
|
|
263
|
+
value: [
|
|
264
|
+
140,
|
|
265
|
+
151,
|
|
266
|
+
37,
|
|
267
|
+
143,
|
|
268
|
+
78,
|
|
269
|
+
36,
|
|
270
|
+
137,
|
|
271
|
+
241,
|
|
272
|
+
187,
|
|
273
|
+
61,
|
|
274
|
+
16,
|
|
275
|
+
41,
|
|
276
|
+
20,
|
|
277
|
+
142,
|
|
278
|
+
13,
|
|
279
|
+
131,
|
|
280
|
+
11,
|
|
281
|
+
90,
|
|
282
|
+
19,
|
|
283
|
+
153,
|
|
284
|
+
218,
|
|
285
|
+
255,
|
|
286
|
+
16,
|
|
287
|
+
132,
|
|
288
|
+
4,
|
|
289
|
+
142,
|
|
290
|
+
123,
|
|
291
|
+
216,
|
|
292
|
+
219,
|
|
293
|
+
233,
|
|
294
|
+
248,
|
|
295
|
+
89
|
|
296
|
+
];
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "makerTokenAccount";
|
|
302
|
+
writable: true;
|
|
303
|
+
pda: {
|
|
304
|
+
seeds: [
|
|
305
|
+
{
|
|
306
|
+
kind: "account";
|
|
307
|
+
path: "intentStorage";
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
kind: "account";
|
|
311
|
+
path: "tokenProgram";
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
kind: "account";
|
|
315
|
+
path: "tokenMint";
|
|
316
|
+
}
|
|
317
|
+
];
|
|
318
|
+
program: {
|
|
319
|
+
kind: "const";
|
|
320
|
+
value: [
|
|
321
|
+
140,
|
|
322
|
+
151,
|
|
323
|
+
37,
|
|
324
|
+
143,
|
|
325
|
+
78,
|
|
326
|
+
36,
|
|
327
|
+
137,
|
|
328
|
+
241,
|
|
329
|
+
187,
|
|
330
|
+
61,
|
|
331
|
+
16,
|
|
332
|
+
41,
|
|
333
|
+
20,
|
|
334
|
+
142,
|
|
335
|
+
13,
|
|
336
|
+
131,
|
|
337
|
+
11,
|
|
338
|
+
90,
|
|
339
|
+
19,
|
|
340
|
+
153,
|
|
341
|
+
218,
|
|
342
|
+
255,
|
|
343
|
+
16,
|
|
344
|
+
132,
|
|
345
|
+
4,
|
|
346
|
+
142,
|
|
347
|
+
123,
|
|
348
|
+
216,
|
|
349
|
+
219,
|
|
350
|
+
233,
|
|
351
|
+
248,
|
|
352
|
+
89
|
|
353
|
+
];
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: "tokenMint";
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: "tokenProgram";
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
name: "associatedTokenProgram";
|
|
365
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
366
|
+
}
|
|
367
|
+
];
|
|
368
|
+
args: [];
|
|
369
|
+
},
|
|
234
370
|
{
|
|
235
371
|
name: "executeIntent";
|
|
236
372
|
discriminator: [53, 130, 47, 154, 227, 220, 122, 212];
|
|
@@ -253,6 +389,7 @@ type IntentsProgram = {
|
|
|
253
389
|
},
|
|
254
390
|
{
|
|
255
391
|
name: "maker";
|
|
392
|
+
relations: ["intentStorage"];
|
|
256
393
|
},
|
|
257
394
|
{
|
|
258
395
|
name: "makerInfo";
|
|
@@ -412,6 +549,10 @@ type IntentsProgram = {
|
|
|
412
549
|
name: "dlnOrderNonce";
|
|
413
550
|
type: "u64";
|
|
414
551
|
},
|
|
552
|
+
{
|
|
553
|
+
name: "dlnMetadata";
|
|
554
|
+
type: "bytes";
|
|
555
|
+
},
|
|
415
556
|
{
|
|
416
557
|
name: "tradeId";
|
|
417
558
|
type: {
|
|
@@ -442,6 +583,7 @@ type IntentsProgram = {
|
|
|
442
583
|
},
|
|
443
584
|
{
|
|
444
585
|
name: "maker";
|
|
586
|
+
relations: ["intentStorage"];
|
|
445
587
|
},
|
|
446
588
|
{
|
|
447
589
|
name: "makerInfo";
|
|
@@ -579,6 +721,9 @@ type IntentsProgram = {
|
|
|
579
721
|
},
|
|
580
722
|
{
|
|
581
723
|
name: "receiver";
|
|
724
|
+
docs: [
|
|
725
|
+
"TODO: may be optional if receiver_take_token is already initialized"
|
|
726
|
+
];
|
|
582
727
|
},
|
|
583
728
|
{
|
|
584
729
|
name: "receiverTakeToken";
|
|
@@ -745,6 +890,74 @@ type IntentsProgram = {
|
|
|
745
890
|
}
|
|
746
891
|
];
|
|
747
892
|
},
|
|
893
|
+
{
|
|
894
|
+
name: "initIntentByDelegate";
|
|
895
|
+
discriminator: [85, 140, 35, 112, 240, 67, 16, 40];
|
|
896
|
+
accounts: [
|
|
897
|
+
{
|
|
898
|
+
name: "delegate";
|
|
899
|
+
signer: true;
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
name: "maker";
|
|
903
|
+
docs: ["CHECK"];
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
name: "makerInfo";
|
|
907
|
+
writable: true;
|
|
908
|
+
pda: {
|
|
909
|
+
seeds: [
|
|
910
|
+
{
|
|
911
|
+
kind: "const";
|
|
912
|
+
value: [109, 97, 107, 101, 114, 95, 105, 110, 102, 111];
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
kind: "account";
|
|
916
|
+
path: "maker";
|
|
917
|
+
}
|
|
918
|
+
];
|
|
919
|
+
};
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
name: "rentPayer";
|
|
923
|
+
writable: true;
|
|
924
|
+
signer: true;
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
name: "state";
|
|
928
|
+
pda: {
|
|
929
|
+
seeds: [
|
|
930
|
+
{
|
|
931
|
+
kind: "const";
|
|
932
|
+
value: [115, 116, 97, 116, 101];
|
|
933
|
+
}
|
|
934
|
+
];
|
|
935
|
+
};
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
name: "intentStorage";
|
|
939
|
+
writable: true;
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
name: "systemProgram";
|
|
943
|
+
address: "11111111111111111111111111111111";
|
|
944
|
+
}
|
|
945
|
+
];
|
|
946
|
+
args: [
|
|
947
|
+
{
|
|
948
|
+
name: "intentId";
|
|
949
|
+
type: {
|
|
950
|
+
defined: {
|
|
951
|
+
name: "intentId";
|
|
952
|
+
};
|
|
953
|
+
};
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
name: "space";
|
|
957
|
+
type: "u32";
|
|
958
|
+
}
|
|
959
|
+
];
|
|
960
|
+
},
|
|
748
961
|
{
|
|
749
962
|
name: "initIntentUsingSig";
|
|
750
963
|
discriminator: [163, 186, 238, 179, 190, 181, 19, 185];
|
|
@@ -791,6 +1004,12 @@ type IntentsProgram = {
|
|
|
791
1004
|
name: "maker";
|
|
792
1005
|
type: "pubkey";
|
|
793
1006
|
},
|
|
1007
|
+
{
|
|
1008
|
+
name: "delegate";
|
|
1009
|
+
type: {
|
|
1010
|
+
option: "pubkey";
|
|
1011
|
+
};
|
|
1012
|
+
},
|
|
794
1013
|
{
|
|
795
1014
|
name: "signature";
|
|
796
1015
|
type: {
|
|
@@ -810,7 +1029,7 @@ type IntentsProgram = {
|
|
|
810
1029
|
{
|
|
811
1030
|
name: "programAuthority";
|
|
812
1031
|
signer: true;
|
|
813
|
-
address: "
|
|
1032
|
+
address: "intV2u5xDE8T2ZMFP3W3X6sVqGHBT7zvYtTW3rRLmvE";
|
|
814
1033
|
},
|
|
815
1034
|
{
|
|
816
1035
|
name: "rentPayer";
|
|
@@ -980,38 +1199,6 @@ type IntentsProgram = {
|
|
|
980
1199
|
{
|
|
981
1200
|
name: "systemProgram";
|
|
982
1201
|
address: "11111111111111111111111111111111";
|
|
983
|
-
},
|
|
984
|
-
{
|
|
985
|
-
name: "eventAuthority";
|
|
986
|
-
pda: {
|
|
987
|
-
seeds: [
|
|
988
|
-
{
|
|
989
|
-
kind: "const";
|
|
990
|
-
value: [
|
|
991
|
-
95,
|
|
992
|
-
95,
|
|
993
|
-
101,
|
|
994
|
-
118,
|
|
995
|
-
101,
|
|
996
|
-
110,
|
|
997
|
-
116,
|
|
998
|
-
95,
|
|
999
|
-
97,
|
|
1000
|
-
117,
|
|
1001
|
-
116,
|
|
1002
|
-
104,
|
|
1003
|
-
111,
|
|
1004
|
-
114,
|
|
1005
|
-
105,
|
|
1006
|
-
116,
|
|
1007
|
-
121
|
|
1008
|
-
];
|
|
1009
|
-
}
|
|
1010
|
-
];
|
|
1011
|
-
};
|
|
1012
|
-
},
|
|
1013
|
-
{
|
|
1014
|
-
name: "program";
|
|
1015
1202
|
}
|
|
1016
1203
|
];
|
|
1017
1204
|
args: [
|
|
@@ -1024,7 +1211,7 @@ type IntentsProgram = {
|
|
|
1024
1211
|
type: "u64";
|
|
1025
1212
|
},
|
|
1026
1213
|
{
|
|
1027
|
-
name: "
|
|
1214
|
+
name: "approvedTokenBudgets";
|
|
1028
1215
|
type: {
|
|
1029
1216
|
defined: {
|
|
1030
1217
|
name: "setApprovedTokenBudgets";
|
|
@@ -1190,6 +1377,7 @@ type IntentsProgram = {
|
|
|
1190
1377
|
},
|
|
1191
1378
|
{
|
|
1192
1379
|
name: "maker";
|
|
1380
|
+
relations: ["intentStorage"];
|
|
1193
1381
|
},
|
|
1194
1382
|
{
|
|
1195
1383
|
name: "makerInfo";
|
|
@@ -1220,15 +1408,11 @@ type IntentsProgram = {
|
|
|
1220
1408
|
{
|
|
1221
1409
|
name: "makerInputToken";
|
|
1222
1410
|
writable: true;
|
|
1223
|
-
},
|
|
1224
|
-
{
|
|
1225
|
-
name: "takerInputToken";
|
|
1226
|
-
writable: true;
|
|
1227
1411
|
pda: {
|
|
1228
1412
|
seeds: [
|
|
1229
1413
|
{
|
|
1230
1414
|
kind: "account";
|
|
1231
|
-
path: "
|
|
1415
|
+
path: "maker";
|
|
1232
1416
|
},
|
|
1233
1417
|
{
|
|
1234
1418
|
kind: "account";
|
|
@@ -1279,7 +1463,7 @@ type IntentsProgram = {
|
|
|
1279
1463
|
};
|
|
1280
1464
|
},
|
|
1281
1465
|
{
|
|
1282
|
-
name: "
|
|
1466
|
+
name: "takerInputToken";
|
|
1283
1467
|
writable: true;
|
|
1284
1468
|
pda: {
|
|
1285
1469
|
seeds: [
|
|
@@ -1289,11 +1473,11 @@ type IntentsProgram = {
|
|
|
1289
1473
|
},
|
|
1290
1474
|
{
|
|
1291
1475
|
kind: "account";
|
|
1292
|
-
path: "
|
|
1476
|
+
path: "inputTokenProgram";
|
|
1293
1477
|
},
|
|
1294
1478
|
{
|
|
1295
1479
|
kind: "account";
|
|
1296
|
-
path: "
|
|
1480
|
+
path: "inputMint";
|
|
1297
1481
|
}
|
|
1298
1482
|
];
|
|
1299
1483
|
program: {
|
|
@@ -1336,13 +1520,13 @@ type IntentsProgram = {
|
|
|
1336
1520
|
};
|
|
1337
1521
|
},
|
|
1338
1522
|
{
|
|
1339
|
-
name: "
|
|
1523
|
+
name: "takerOutputToken";
|
|
1340
1524
|
writable: true;
|
|
1341
1525
|
pda: {
|
|
1342
1526
|
seeds: [
|
|
1343
1527
|
{
|
|
1344
1528
|
kind: "account";
|
|
1345
|
-
path: "
|
|
1529
|
+
path: "taker";
|
|
1346
1530
|
},
|
|
1347
1531
|
{
|
|
1348
1532
|
kind: "account";
|
|
@@ -1392,6 +1576,10 @@ type IntentsProgram = {
|
|
|
1392
1576
|
};
|
|
1393
1577
|
};
|
|
1394
1578
|
},
|
|
1579
|
+
{
|
|
1580
|
+
name: "intentOutputToken";
|
|
1581
|
+
writable: true;
|
|
1582
|
+
},
|
|
1395
1583
|
{
|
|
1396
1584
|
name: "instructions";
|
|
1397
1585
|
address: "Sysvar1nstructions1111111111111111111111111";
|
|
@@ -1449,7 +1637,7 @@ type IntentsProgram = {
|
|
|
1449
1637
|
type: "u64";
|
|
1450
1638
|
},
|
|
1451
1639
|
{
|
|
1452
|
-
name: "
|
|
1640
|
+
name: "target";
|
|
1453
1641
|
type: {
|
|
1454
1642
|
defined: {
|
|
1455
1643
|
name: "targetTokenAccount";
|
|
@@ -1488,6 +1676,9 @@ type IntentsProgram = {
|
|
|
1488
1676
|
name: "intentStorage";
|
|
1489
1677
|
writable: true;
|
|
1490
1678
|
},
|
|
1679
|
+
{
|
|
1680
|
+
name: "inputMint";
|
|
1681
|
+
},
|
|
1491
1682
|
{
|
|
1492
1683
|
name: "outputMint";
|
|
1493
1684
|
},
|
|
@@ -1737,48 +1928,42 @@ type IntentsProgram = {
|
|
|
1737
1928
|
{
|
|
1738
1929
|
code: 6000;
|
|
1739
1930
|
name: "protocolIsOnPause";
|
|
1740
|
-
msg: "Protocol is on pause";
|
|
1741
1931
|
},
|
|
1742
1932
|
{
|
|
1743
1933
|
code: 6001;
|
|
1744
1934
|
name: "timeParadox";
|
|
1745
|
-
msg: "Time Paradox";
|
|
1746
1935
|
},
|
|
1747
1936
|
{
|
|
1748
1937
|
code: 6002;
|
|
1749
1938
|
name: "unknownCaller";
|
|
1750
|
-
msg: "Unknown caller";
|
|
1751
1939
|
},
|
|
1752
1940
|
{
|
|
1753
1941
|
code: 6003;
|
|
1754
|
-
name: "
|
|
1755
|
-
msg: "Ed25519 signature is invalid or does not match provided intent hash and public key";
|
|
1942
|
+
name: "unknownCancelAuthority";
|
|
1756
1943
|
},
|
|
1757
1944
|
{
|
|
1758
1945
|
code: 6004;
|
|
1759
|
-
name: "
|
|
1760
|
-
msg: "Intent storage is already initialized";
|
|
1946
|
+
name: "sigVerifyErr";
|
|
1761
1947
|
},
|
|
1762
1948
|
{
|
|
1763
1949
|
code: 6005;
|
|
1764
|
-
name: "
|
|
1765
|
-
msg: "Intent encoded data already matches expected hash";
|
|
1950
|
+
name: "intentStorageIsInitialized";
|
|
1766
1951
|
},
|
|
1767
1952
|
{
|
|
1768
1953
|
code: 6006;
|
|
1769
|
-
name: "
|
|
1954
|
+
name: "intentStorageIsSealed";
|
|
1770
1955
|
},
|
|
1771
1956
|
{
|
|
1772
1957
|
code: 6007;
|
|
1773
|
-
name: "
|
|
1958
|
+
name: "intentHashMismatch";
|
|
1774
1959
|
},
|
|
1775
1960
|
{
|
|
1776
1961
|
code: 6008;
|
|
1777
|
-
name: "
|
|
1962
|
+
name: "intentOwnerMismatchActualMaker";
|
|
1778
1963
|
},
|
|
1779
1964
|
{
|
|
1780
1965
|
code: 6009;
|
|
1781
|
-
name: "
|
|
1966
|
+
name: "intentIsCancelled";
|
|
1782
1967
|
},
|
|
1783
1968
|
{
|
|
1784
1969
|
code: 6010;
|
|
@@ -1786,55 +1971,126 @@ type IntentsProgram = {
|
|
|
1786
1971
|
},
|
|
1787
1972
|
{
|
|
1788
1973
|
code: 6011;
|
|
1789
|
-
name: "
|
|
1790
|
-
msg: "Intent is not ready for execution yet";
|
|
1974
|
+
name: "intentIsInvalidatedByUser";
|
|
1791
1975
|
},
|
|
1792
1976
|
{
|
|
1793
1977
|
code: 6012;
|
|
1794
|
-
name: "
|
|
1978
|
+
name: "intentIsInvalidatedByProtocolAuthority";
|
|
1795
1979
|
},
|
|
1796
1980
|
{
|
|
1797
1981
|
code: 6013;
|
|
1798
|
-
name: "
|
|
1982
|
+
name: "intentIsNotReadyYet";
|
|
1799
1983
|
},
|
|
1800
1984
|
{
|
|
1801
1985
|
code: 6014;
|
|
1802
|
-
name: "
|
|
1986
|
+
name: "unknownInputToken";
|
|
1803
1987
|
},
|
|
1804
1988
|
{
|
|
1805
1989
|
code: 6015;
|
|
1806
|
-
name: "
|
|
1990
|
+
name: "inputTokenAmountOutOfMinMaxRange";
|
|
1807
1991
|
},
|
|
1808
1992
|
{
|
|
1809
1993
|
code: 6016;
|
|
1810
|
-
name: "
|
|
1994
|
+
name: "insufficientInputTokenAmount";
|
|
1811
1995
|
},
|
|
1812
1996
|
{
|
|
1813
1997
|
code: 6017;
|
|
1814
|
-
name: "
|
|
1998
|
+
name: "unknownRoute";
|
|
1815
1999
|
},
|
|
1816
2000
|
{
|
|
1817
2001
|
code: 6018;
|
|
1818
|
-
name: "
|
|
2002
|
+
name: "priceViolation";
|
|
1819
2003
|
},
|
|
1820
2004
|
{
|
|
1821
2005
|
code: 6019;
|
|
1822
|
-
name: "
|
|
2006
|
+
name: "invalidReceiver";
|
|
1823
2007
|
},
|
|
1824
2008
|
{
|
|
1825
2009
|
code: 6020;
|
|
1826
|
-
name: "
|
|
2010
|
+
name: "invalidDlnSrcAllowedCancelBeneficiary";
|
|
1827
2011
|
},
|
|
1828
2012
|
{
|
|
1829
2013
|
code: 6021;
|
|
1830
|
-
name: "
|
|
2014
|
+
name: "invalidDlnDstReceiver";
|
|
1831
2015
|
},
|
|
1832
2016
|
{
|
|
1833
2017
|
code: 6022;
|
|
1834
|
-
name: "
|
|
2018
|
+
name: "invalidDlnDstOrderAuthority";
|
|
1835
2019
|
},
|
|
1836
2020
|
{
|
|
1837
2021
|
code: 6023;
|
|
2022
|
+
name: "invalidDlnMetadata";
|
|
2023
|
+
},
|
|
2024
|
+
{
|
|
2025
|
+
code: 6024;
|
|
2026
|
+
name: "invalidDlnExtcallHash";
|
|
2027
|
+
},
|
|
2028
|
+
{
|
|
2029
|
+
code: 6025;
|
|
2030
|
+
name: "tokenAccountHasNoProtocolDelegate";
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
code: 6026;
|
|
2034
|
+
name: "cantBeClosed";
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
code: 6027;
|
|
2038
|
+
name: "intentArbitraryDataOverflow";
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
code: 6028;
|
|
2042
|
+
name: "takerIsNotAllowed";
|
|
2043
|
+
},
|
|
2044
|
+
{
|
|
2045
|
+
code: 6029;
|
|
2046
|
+
name: "takerMustBeFixedWhenAnyExtcallIsAllowed";
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
code: 6030;
|
|
2050
|
+
name: "ambiguousReceivers";
|
|
2051
|
+
},
|
|
2052
|
+
{
|
|
2053
|
+
code: 6031;
|
|
2054
|
+
name: "interactionAccountNotFound";
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
code: 6032;
|
|
2058
|
+
name: "interactionProgramNotFound";
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
code: 6033;
|
|
2062
|
+
name: "interactionFixedAccountNotFound";
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
code: 6034;
|
|
2066
|
+
name: "unknownDelegate";
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
code: 6035;
|
|
2070
|
+
name: "revokedDelegate";
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
code: 6036;
|
|
2074
|
+
name: "delegateExceedsApprovedBudget";
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
code: 6037;
|
|
2078
|
+
name: "delegateApproveIsExpired";
|
|
2079
|
+
},
|
|
2080
|
+
{
|
|
2081
|
+
code: 6038;
|
|
2082
|
+
name: "delegateHasNoApprove";
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
code: 6039;
|
|
2086
|
+
name: "delegateNonceIsAdvanced";
|
|
2087
|
+
},
|
|
2088
|
+
{
|
|
2089
|
+
code: 6040;
|
|
2090
|
+
name: "crossProgramInvokeIsRestricted";
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
code: 6041;
|
|
1838
2094
|
name: "invalidDlnOrderTargetTokenOrPrice";
|
|
1839
2095
|
}
|
|
1840
2096
|
];
|
|
@@ -2140,11 +2396,11 @@ type IntentsProgram = {
|
|
|
2140
2396
|
},
|
|
2141
2397
|
{
|
|
2142
2398
|
name: "giveTokenAmount";
|
|
2143
|
-
type: "
|
|
2399
|
+
type: "u64";
|
|
2144
2400
|
},
|
|
2145
2401
|
{
|
|
2146
2402
|
name: "giveTokenFeeAmount";
|
|
2147
|
-
type: "
|
|
2403
|
+
type: "u64";
|
|
2148
2404
|
},
|
|
2149
2405
|
{
|
|
2150
2406
|
name: "takeToken";
|
|
@@ -2260,6 +2516,12 @@ type IntentsProgram = {
|
|
|
2260
2516
|
name: "maker";
|
|
2261
2517
|
type: "pubkey";
|
|
2262
2518
|
},
|
|
2519
|
+
{
|
|
2520
|
+
name: "delegate";
|
|
2521
|
+
type: {
|
|
2522
|
+
option: "pubkey";
|
|
2523
|
+
};
|
|
2524
|
+
},
|
|
2263
2525
|
{
|
|
2264
2526
|
name: "rentPayer";
|
|
2265
2527
|
type: "pubkey";
|
|
@@ -2418,7 +2680,7 @@ type IntentsProgram = {
|
|
|
2418
2680
|
name: "uninitialized";
|
|
2419
2681
|
},
|
|
2420
2682
|
{
|
|
2421
|
-
name: "
|
|
2683
|
+
name: "ready";
|
|
2422
2684
|
fields: [
|
|
2423
2685
|
{
|
|
2424
2686
|
name: "encodedIntent";
|
|
@@ -2435,7 +2697,7 @@ type IntentsProgram = {
|
|
|
2435
2697
|
];
|
|
2436
2698
|
},
|
|
2437
2699
|
{
|
|
2438
|
-
name: "
|
|
2700
|
+
name: "cancelled";
|
|
2439
2701
|
fields: [
|
|
2440
2702
|
{
|
|
2441
2703
|
name: "encodedIntent";
|
|
@@ -2450,9 +2712,6 @@ type IntentsProgram = {
|
|
|
2450
2712
|
};
|
|
2451
2713
|
}
|
|
2452
2714
|
];
|
|
2453
|
-
},
|
|
2454
|
-
{
|
|
2455
|
-
name: "terminated";
|
|
2456
2715
|
}
|
|
2457
2716
|
];
|
|
2458
2717
|
};
|
|
@@ -2651,6 +2910,7 @@ type UpdateIntentParams = UpdateIntentOffsetLength | UpdateIntentData;
|
|
|
2651
2910
|
interface InitIntentParams {
|
|
2652
2911
|
authority: PublicKey;
|
|
2653
2912
|
payer?: PublicKey;
|
|
2913
|
+
delegate?: PublicKey;
|
|
2654
2914
|
intent: {
|
|
2655
2915
|
id: Buffer;
|
|
2656
2916
|
data: Buffer;
|
|
@@ -2664,6 +2924,7 @@ interface InitIntentParams {
|
|
|
2664
2924
|
interface CreateAndUpdateIntentParams {
|
|
2665
2925
|
authority: PublicKey;
|
|
2666
2926
|
payer?: PublicKey;
|
|
2927
|
+
delegate?: PublicKey;
|
|
2667
2928
|
intent: {
|
|
2668
2929
|
inputTokensLength: number;
|
|
2669
2930
|
} & UpdateIntentParams;
|
|
@@ -2682,7 +2943,7 @@ interface UpdateRecordTxsParams {
|
|
|
2682
2943
|
ALTs?: Array<AddressLookupTableAccount>;
|
|
2683
2944
|
computeBudget?: ComputeBudget;
|
|
2684
2945
|
}
|
|
2685
|
-
type WriteIntentParams = Omit<InitIntentParams, "signature"> & {
|
|
2946
|
+
type WriteIntentParams = Omit<InitIntentParams, "signature" | "delegate"> & {
|
|
2686
2947
|
record: PublicKey;
|
|
2687
2948
|
};
|
|
2688
2949
|
interface CloseRecordParams {
|
|
@@ -2747,6 +3008,7 @@ interface SwapEndParams {
|
|
|
2747
3008
|
intentId: Buffer;
|
|
2748
3009
|
endAmount: bigint;
|
|
2749
3010
|
bps: number;
|
|
3011
|
+
inputMint: PublicKey;
|
|
2750
3012
|
outputMint: PublicKey;
|
|
2751
3013
|
outputTokenProgram?: PublicKey;
|
|
2752
3014
|
}
|
|
@@ -2775,6 +3037,7 @@ interface ExecuteIntentParams {
|
|
|
2775
3037
|
dstChainId: number;
|
|
2776
3038
|
nonce: bigint;
|
|
2777
3039
|
};
|
|
3040
|
+
dlnMetadata?: Buffer;
|
|
2778
3041
|
dlnSrc?: PublicKey;
|
|
2779
3042
|
tokenProgram?: PublicKey;
|
|
2780
3043
|
}
|
|
@@ -2816,29 +3079,29 @@ declare class IntentsClient {
|
|
|
2816
3079
|
getIntentStorage(connection: Connection, intentId: Buffer$1): Promise<IntentStorage | null>;
|
|
2817
3080
|
approveProtocolTransfersIxs({ owner, tokens, tokenProgram, }: ApproveProtocolTransfersParams): Promise<TransactionInstruction[]>;
|
|
2818
3081
|
private closeIntentIxs;
|
|
2819
|
-
executeIntentIxs({ tradeId, intentId, taker, maker, tokenMint, dlnOrder, dlnSrc, tokenProgram, }: ExecuteIntentParams): Promise<TransactionInstruction[]>;
|
|
3082
|
+
executeIntentIxs({ tradeId, intentId, taker, maker, tokenMint, dlnOrder, dlnMetadata, dlnSrc, tokenProgram, }: ExecuteIntentParams): Promise<TransactionInstruction[]>;
|
|
2820
3083
|
executeSameChainIntentIxs({ tradeId, intentId, taker, maker, tokenMint, receiver, amount, tokenProgram, }: ExecuteIntentSameChainParams): Promise<TransactionInstruction[]>;
|
|
2821
3084
|
initIntentIxs(maker: PublicKey, payer: PublicKey, id: Buffer$1, encodedIntentLength: number, inputTokensAmount: number): Promise<TransactionInstruction[]>;
|
|
2822
|
-
initIntentUsingSigIxs(maker: PublicKey, payer: PublicKey, id: Buffer$1, encodedIntentLength: number, inputTokensAmount: number, signature: Buffer$1): Promise<TransactionInstruction[]>;
|
|
3085
|
+
initIntentUsingSigIxs(maker: PublicKey, payer: PublicKey, delegate: (PublicKey | null) | undefined, id: Buffer$1, encodedIntentLength: number, inputTokensAmount: number, signature: Buffer$1): Promise<TransactionInstruction[]>;
|
|
2823
3086
|
setDelegateApprovedBudgetsIxs({ maker, payer, delegate, nonce, tokens, }: DelegateApprovedBudgetsParams): Promise<TransactionInstruction[]>;
|
|
2824
3087
|
swapBeginIxs({ taker, maker, intentId, tradeId, beginAmount, // 0 for tests // transfer from random wallet to taker output amount, input / output = intent price
|
|
2825
3088
|
target, inputMint, outputMint, inputTokenProgram, outputTokenProgram, }: SwapBeginParams): Promise<TransactionInstruction[]>;
|
|
2826
|
-
swapEndIxs({ taker, intentId, endAmount, bps, outputMint, outputTokenProgram, }: SwapEndParams): Promise<TransactionInstruction[]>;
|
|
3089
|
+
swapEndIxs({ taker, intentId, endAmount, bps, inputMint, outputMint, outputTokenProgram, }: SwapEndParams): Promise<TransactionInstruction[]>;
|
|
2827
3090
|
updateIntentIxs({ payer, record, id, offset, length, data, }: UpdateIntentParams): Promise<TransactionInstruction[]>;
|
|
2828
3091
|
closeRecordIxs({ record, authority, receiver, }: CloseRecordParams): TransactionInstruction[];
|
|
2829
3092
|
writeRecordIxs({ authority, record, buffer, offset, }: WriteRecordParams): TransactionInstruction[];
|
|
2830
3093
|
reallocRecordIxs({ authority, payer, record, buffer, offset, }: UpdateRecordParams): Promise<TransactionInstruction[]>;
|
|
2831
|
-
initIntentTxs({ authority, payer, intent, signature, blockhash, ALTs, computeBudget, }: InitIntentParams): Promise<{
|
|
3094
|
+
initIntentTxs({ authority, payer, delegate, intent, signature, blockhash, ALTs, computeBudget, }: InitIntentParams): Promise<{
|
|
2832
3095
|
record: Keypair;
|
|
2833
3096
|
txs: VersionedTransaction[];
|
|
2834
3097
|
}>;
|
|
2835
3098
|
writeIntentTxs({ authority, payer, record, intent, blockhash, ALTs, computeBudget, }: WriteIntentParams): Promise<VersionedTransaction[]>;
|
|
2836
|
-
createIntentTxs({ authority, payer, intent, signature, blockhash, ALTs, computeBudget, }: InitIntentParams): Promise<{
|
|
3099
|
+
createIntentTxs({ authority, payer, delegate, intent, signature, blockhash, ALTs, computeBudget, }: InitIntentParams): Promise<{
|
|
2837
3100
|
init: VersionedTransaction[];
|
|
2838
3101
|
write: VersionedTransaction[];
|
|
2839
3102
|
record: Keypair;
|
|
2840
3103
|
}>;
|
|
2841
|
-
createAndUpdateIntentTxs({ authority, payer, intent, signature, blockhash, ALTs, computeBudget, }: CreateAndUpdateIntentParams): Promise<VersionedTransaction[]>;
|
|
3104
|
+
createAndUpdateIntentTxs({ authority, payer, delegate, intent, signature, blockhash, ALTs, computeBudget, }: CreateAndUpdateIntentParams): Promise<VersionedTransaction[]>;
|
|
2842
3105
|
updateRecordTxs({ authority, payer, record, serializedIntent, offset, blockhash, ALTs, computeBudget, }: UpdateRecordTxsParams): Promise<VersionedTransaction[]>;
|
|
2843
3106
|
closeIntentTxs({ authority, payer, record, receiver, id, blockhash, ALTs, computeBudget, }: CloseIntentParams): Promise<VersionedTransaction[]>;
|
|
2844
3107
|
swapTxs({ taker, maker, intentId, tradeId, inputMint, outputMint, beginAmount, endAmount, bps, target, inputTokenProgram, outputTokenProgram, instructions, computeBudget, payer, blockhash, ALTs, }: SwapParams): Promise<VersionedTransaction[]>;
|