@streamflow/distributor 11.4.0 → 12.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.
@@ -8,7 +8,7 @@ type MerkleDistributor = {
8
8
  "address": "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N";
9
9
  "metadata": {
10
10
  "name": "merkleDistributor";
11
- "version": "2.0.0";
11
+ "version": "1.9.0";
12
12
  "spec": "0.1.0";
13
13
  "description": "A Solana program for distributing tokens according to a Merkle root.";
14
14
  "repository": "https://github.com/streamflow-finance/distributor";
@@ -578,6 +578,67 @@ type MerkleDistributor = {
578
578
  82,
579
579
  27
580
580
  ];
581
+ "accounts": [
582
+ {
583
+ "name": "distributor";
584
+ "docs": [
585
+ "The [MerkleDistributor]."
586
+ ];
587
+ "writable": true;
588
+ },
589
+ {
590
+ "name": "from";
591
+ "docs": [
592
+ "Distributor ATA containing the tokens to distribute."
593
+ ];
594
+ "writable": true;
595
+ },
596
+ {
597
+ "name": "to";
598
+ "docs": [
599
+ "The Clawback token account."
600
+ ];
601
+ "writable": true;
602
+ },
603
+ {
604
+ "name": "authority";
605
+ "docs": [
606
+ "Signer that authorizes the clawback execution."
607
+ ];
608
+ "writable": true;
609
+ "signer": true;
610
+ },
611
+ {
612
+ "name": "mint";
613
+ },
614
+ {
615
+ "name": "systemProgram";
616
+ "docs": [
617
+ "The [System] program."
618
+ ];
619
+ "address": "11111111111111111111111111111111";
620
+ },
621
+ {
622
+ "name": "tokenProgram";
623
+ "docs": [
624
+ "SPL [Token] program."
625
+ ];
626
+ }
627
+ ];
628
+ "args": [];
629
+ },
630
+ {
631
+ "name": "clawbackV2";
632
+ "discriminator": [
633
+ 21,
634
+ 210,
635
+ 60,
636
+ 179,
637
+ 193,
638
+ 134,
639
+ 82,
640
+ 155
641
+ ];
581
642
  "accounts": [
582
643
  {
583
644
  "name": "distributor";
@@ -603,7 +664,14 @@ type MerkleDistributor = {
603
664
  {
604
665
  "name": "admin";
605
666
  "docs": [
606
- "Only Admin can trigger the clawback of funds"
667
+ "even when the caller is `CANCEL_AUTHORITY`."
668
+ ];
669
+ "writable": true;
670
+ },
671
+ {
672
+ "name": "authority";
673
+ "docs": [
674
+ "Signer that authorizes the clawback execution."
607
675
  ];
608
676
  "writable": true;
609
677
  "signer": true;
@@ -611,6 +679,32 @@ type MerkleDistributor = {
611
679
  {
612
680
  "name": "mint";
613
681
  },
682
+ {
683
+ "name": "autoClaimState";
684
+ "writable": true;
685
+ "pda": {
686
+ "seeds": [
687
+ {
688
+ "kind": "const";
689
+ "value": [
690
+ 65,
691
+ 117,
692
+ 116,
693
+ 111,
694
+ 67,
695
+ 108,
696
+ 97,
697
+ 105,
698
+ 109
699
+ ];
700
+ },
701
+ {
702
+ "kind": "account";
703
+ "path": "distributor";
704
+ }
705
+ ];
706
+ };
707
+ },
614
708
  {
615
709
  "name": "systemProgram";
616
710
  "docs": [
@@ -1046,96 +1140,71 @@ type MerkleDistributor = {
1046
1140
  ];
1047
1141
  },
1048
1142
  {
1049
- "name": "newDistributor";
1050
- "docs": [
1051
- "READ THE FOLLOWING:",
1052
- "",
1053
- "This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
1054
- "",
1055
- "An attack could look like:",
1056
- "- A legitimate user opens a new distributor.",
1057
- "- Someone observes the call to this instruction.",
1058
- "- They replace the clawback_receiver, admin, or time parameters with their own.",
1059
- "",
1060
- "One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
1061
- "and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
1062
- "the attacker can steal all funds from the distributor to their own clawback_receiver account.",
1063
- "",
1064
- "HOW TO AVOID:",
1065
- "- When you call into this instruction, ensure your transaction succeeds.",
1066
- "- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
1067
- "assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
1068
- "- If your transaction fails, double check the value on-chain matches what you expect."
1069
- ];
1143
+ "name": "newClaimByWorker";
1070
1144
  "discriminator": [
1071
- 32,
1072
- 139,
1073
- 112,
1074
- 171,
1075
- 0,
1076
- 2,
1077
- 225,
1078
- 155
1145
+ 181,
1146
+ 133,
1147
+ 223,
1148
+ 117,
1149
+ 188,
1150
+ 131,
1151
+ 243,
1152
+ 158
1079
1153
  ];
1080
1154
  "accounts": [
1081
1155
  {
1082
1156
  "name": "distributor";
1083
1157
  "docs": [
1084
- "[MerkleDistributor]."
1158
+ "The [MerkleDistributor]."
1159
+ ];
1160
+ "writable": true;
1161
+ "relations": [
1162
+ "autoClaimState"
1163
+ ];
1164
+ },
1165
+ {
1166
+ "name": "autoClaimState";
1167
+ "docs": [
1168
+ "Auto-claim SOL reserve for the distributor."
1085
1169
  ];
1086
1170
  "writable": true;
1171
+ },
1172
+ {
1173
+ "name": "claimStatus";
1174
+ "writable": true;
1087
1175
  "pda": {
1088
1176
  "seeds": [
1089
1177
  {
1090
1178
  "kind": "const";
1091
1179
  "value": [
1092
- 77,
1093
- 101,
1094
- 114,
1095
- 107,
1180
+ 67,
1096
1181
  108,
1097
- 101,
1098
- 68,
1182
+ 97,
1099
1183
  105,
1100
- 115,
1184
+ 109,
1185
+ 83,
1101
1186
  116,
1102
- 114,
1103
- 105,
1104
- 98,
1105
- 117,
1187
+ 97,
1106
1188
  116,
1107
- 111,
1108
- 114
1189
+ 117,
1190
+ 115
1109
1191
  ];
1110
1192
  },
1111
1193
  {
1112
1194
  "kind": "account";
1113
- "path": "mint";
1195
+ "path": "claimant";
1114
1196
  },
1115
1197
  {
1116
- "kind": "arg";
1117
- "path": "version";
1198
+ "kind": "account";
1199
+ "path": "distributor";
1118
1200
  }
1119
1201
  ];
1120
1202
  };
1121
1203
  },
1122
1204
  {
1123
- "name": "clawbackReceiver";
1124
- "docs": [
1125
- "Clawback receiver token account"
1126
- ];
1127
- "writable": true;
1128
- },
1129
- {
1130
- "name": "mint";
1131
- "docs": [
1132
- "The mint to distribute."
1133
- ];
1134
- },
1135
- {
1136
- "name": "tokenVault";
1205
+ "name": "from";
1137
1206
  "docs": [
1138
- "Token vault"
1207
+ "Distributor ATA containing the tokens to distribute."
1139
1208
  ];
1140
1209
  "writable": true;
1141
1210
  "pda": {
@@ -1150,7 +1219,8 @@ type MerkleDistributor = {
1150
1219
  },
1151
1220
  {
1152
1221
  "kind": "account";
1153
- "path": "mint";
1222
+ "path": "distributor.mint";
1223
+ "account": "merkleDistributor";
1154
1224
  }
1155
1225
  ];
1156
1226
  "program": {
@@ -1192,21 +1262,33 @@ type MerkleDistributor = {
1192
1262
  };
1193
1263
  };
1194
1264
  },
1265
+ {
1266
+ "name": "to";
1267
+ "writable": true;
1268
+ },
1269
+ {
1270
+ "name": "claimant";
1271
+ },
1195
1272
  {
1196
1273
  "name": "admin";
1274
+ "writable": true;
1275
+ },
1276
+ {
1277
+ "name": "worker";
1197
1278
  "docs": [
1198
- "Admin wallet, responsible for creating the distributor and paying for the transaction.",
1199
- "Also has the authority to set the clawback receiver and change itself."
1279
+ "Worker account, anyone can execute the instruction since distribution is validated by the protocol"
1200
1280
  ];
1201
1281
  "writable": true;
1202
1282
  "signer": true;
1203
1283
  },
1204
1284
  {
1205
- "name": "systemProgram";
1285
+ "name": "mint";
1206
1286
  "docs": [
1207
- "The [System] program."
1287
+ "The mint to claim."
1288
+ ];
1289
+ "relations": [
1290
+ "distributor"
1208
1291
  ];
1209
- "address": "11111111111111111111111111111111";
1210
1292
  },
1211
1293
  {
1212
1294
  "name": "associatedTokenProgram";
@@ -1218,54 +1300,619 @@ type MerkleDistributor = {
1218
1300
  {
1219
1301
  "name": "tokenProgram";
1220
1302
  "docs": [
1221
- "The [Token] program."
1303
+ "SPL [Token] program."
1222
1304
  ];
1223
1305
  },
1224
1306
  {
1225
- "name": "partnerOracleConfig";
1307
+ "name": "systemProgram";
1308
+ "docs": [
1309
+ "The [System] program."
1310
+ ];
1311
+ "address": "11111111111111111111111111111111";
1312
+ },
1313
+ {
1314
+ "name": "eventAuthority";
1226
1315
  "pda": {
1227
1316
  "seeds": [
1228
1317
  {
1229
1318
  "kind": "const";
1230
1319
  "value": [
1231
- 97,
1232
- 105,
1233
- 114,
1234
- 100,
1235
- 114,
1236
- 111,
1237
- 112,
1238
1320
  95,
1239
- 99,
1240
- 111,
1321
+ 95,
1322
+ 101,
1323
+ 118,
1324
+ 101,
1241
1325
  110,
1242
- 102,
1326
+ 116,
1327
+ 95,
1328
+ 97,
1329
+ 117,
1330
+ 116,
1331
+ 104,
1332
+ 111,
1333
+ 114,
1243
1334
  105,
1244
- 103
1335
+ 116,
1336
+ 121
1245
1337
  ];
1246
1338
  }
1247
1339
  ];
1248
- "program": {
1249
- "kind": "const";
1250
- "value": [
1251
- 12,
1252
- 48,
1253
- 148,
1254
- 48,
1255
- 221,
1256
- 89,
1257
- 2,
1258
- 209,
1259
- 180,
1260
- 126,
1261
- 151,
1262
- 216,
1263
- 166,
1264
- 3,
1265
- 112,
1266
- 50,
1267
- 177,
1268
- 192,
1340
+ };
1341
+ },
1342
+ {
1343
+ "name": "program";
1344
+ }
1345
+ ];
1346
+ "args": [
1347
+ {
1348
+ "name": "amountUnlocked";
1349
+ "type": "u64";
1350
+ },
1351
+ {
1352
+ "name": "amountLocked";
1353
+ "type": "u64";
1354
+ },
1355
+ {
1356
+ "name": "proof";
1357
+ "type": {
1358
+ "vec": {
1359
+ "array": [
1360
+ "u8",
1361
+ 32
1362
+ ];
1363
+ };
1364
+ };
1365
+ }
1366
+ ];
1367
+ },
1368
+ {
1369
+ "name": "newDistributor";
1370
+ "docs": [
1371
+ "READ THE FOLLOWING:",
1372
+ "",
1373
+ "This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
1374
+ "",
1375
+ "An attack could look like:",
1376
+ "- A legitimate user opens a new distributor.",
1377
+ "- Someone observes the call to this instruction.",
1378
+ "- They replace the clawback_receiver, admin, or time parameters with their own.",
1379
+ "",
1380
+ "One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
1381
+ "and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
1382
+ "the attacker can steal all funds from the distributor to their own clawback_receiver account.",
1383
+ "",
1384
+ "HOW TO AVOID:",
1385
+ "- When you call into this instruction, ensure your transaction succeeds.",
1386
+ "- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
1387
+ "assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
1388
+ "- If your transaction fails, double check the value on-chain matches what you expect."
1389
+ ];
1390
+ "discriminator": [
1391
+ 32,
1392
+ 139,
1393
+ 112,
1394
+ 171,
1395
+ 0,
1396
+ 2,
1397
+ 225,
1398
+ 155
1399
+ ];
1400
+ "accounts": [
1401
+ {
1402
+ "name": "distributor";
1403
+ "docs": [
1404
+ "[MerkleDistributor]."
1405
+ ];
1406
+ "writable": true;
1407
+ "pda": {
1408
+ "seeds": [
1409
+ {
1410
+ "kind": "const";
1411
+ "value": [
1412
+ 77,
1413
+ 101,
1414
+ 114,
1415
+ 107,
1416
+ 108,
1417
+ 101,
1418
+ 68,
1419
+ 105,
1420
+ 115,
1421
+ 116,
1422
+ 114,
1423
+ 105,
1424
+ 98,
1425
+ 117,
1426
+ 116,
1427
+ 111,
1428
+ 114
1429
+ ];
1430
+ },
1431
+ {
1432
+ "kind": "account";
1433
+ "path": "mint";
1434
+ },
1435
+ {
1436
+ "kind": "arg";
1437
+ "path": "version";
1438
+ }
1439
+ ];
1440
+ };
1441
+ },
1442
+ {
1443
+ "name": "clawbackReceiver";
1444
+ "docs": [
1445
+ "Clawback receiver token account"
1446
+ ];
1447
+ "writable": true;
1448
+ },
1449
+ {
1450
+ "name": "mint";
1451
+ "docs": [
1452
+ "The mint to distribute."
1453
+ ];
1454
+ },
1455
+ {
1456
+ "name": "tokenVault";
1457
+ "docs": [
1458
+ "Token vault"
1459
+ ];
1460
+ "writable": true;
1461
+ "pda": {
1462
+ "seeds": [
1463
+ {
1464
+ "kind": "account";
1465
+ "path": "distributor";
1466
+ },
1467
+ {
1468
+ "kind": "account";
1469
+ "path": "tokenProgram";
1470
+ },
1471
+ {
1472
+ "kind": "account";
1473
+ "path": "mint";
1474
+ }
1475
+ ];
1476
+ "program": {
1477
+ "kind": "const";
1478
+ "value": [
1479
+ 140,
1480
+ 151,
1481
+ 37,
1482
+ 143,
1483
+ 78,
1484
+ 36,
1485
+ 137,
1486
+ 241,
1487
+ 187,
1488
+ 61,
1489
+ 16,
1490
+ 41,
1491
+ 20,
1492
+ 142,
1493
+ 13,
1494
+ 131,
1495
+ 11,
1496
+ 90,
1497
+ 19,
1498
+ 153,
1499
+ 218,
1500
+ 255,
1501
+ 16,
1502
+ 132,
1503
+ 4,
1504
+ 142,
1505
+ 123,
1506
+ 216,
1507
+ 219,
1508
+ 233,
1509
+ 248,
1510
+ 89
1511
+ ];
1512
+ };
1513
+ };
1514
+ },
1515
+ {
1516
+ "name": "admin";
1517
+ "docs": [
1518
+ "Admin wallet, responsible for creating the distributor and paying for the transaction.",
1519
+ "Also has the authority to set the clawback receiver and change itself."
1520
+ ];
1521
+ "writable": true;
1522
+ "signer": true;
1523
+ },
1524
+ {
1525
+ "name": "systemProgram";
1526
+ "docs": [
1527
+ "The [System] program."
1528
+ ];
1529
+ "address": "11111111111111111111111111111111";
1530
+ },
1531
+ {
1532
+ "name": "associatedTokenProgram";
1533
+ "docs": [
1534
+ "The [Associated Token] program."
1535
+ ];
1536
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1537
+ },
1538
+ {
1539
+ "name": "tokenProgram";
1540
+ "docs": [
1541
+ "The [Token] program."
1542
+ ];
1543
+ },
1544
+ {
1545
+ "name": "partnerOracleConfig";
1546
+ "pda": {
1547
+ "seeds": [
1548
+ {
1549
+ "kind": "const";
1550
+ "value": [
1551
+ 97,
1552
+ 105,
1553
+ 114,
1554
+ 100,
1555
+ 114,
1556
+ 111,
1557
+ 112,
1558
+ 95,
1559
+ 99,
1560
+ 111,
1561
+ 110,
1562
+ 102,
1563
+ 105,
1564
+ 103
1565
+ ];
1566
+ }
1567
+ ];
1568
+ "program": {
1569
+ "kind": "const";
1570
+ "value": [
1571
+ 12,
1572
+ 48,
1573
+ 148,
1574
+ 48,
1575
+ 221,
1576
+ 89,
1577
+ 2,
1578
+ 209,
1579
+ 180,
1580
+ 126,
1581
+ 151,
1582
+ 216,
1583
+ 166,
1584
+ 3,
1585
+ 112,
1586
+ 50,
1587
+ 177,
1588
+ 192,
1589
+ 141,
1590
+ 218,
1591
+ 37,
1592
+ 78,
1593
+ 51,
1594
+ 109,
1595
+ 243,
1596
+ 106,
1597
+ 174,
1598
+ 122,
1599
+ 93,
1600
+ 121,
1601
+ 191,
1602
+ 119
1603
+ ];
1604
+ };
1605
+ };
1606
+ },
1607
+ {
1608
+ "name": "partnerOracle";
1609
+ "docs": [
1610
+ "Partner Oracle program that stores fees"
1611
+ ];
1612
+ "address": "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa";
1613
+ }
1614
+ ];
1615
+ "args": [
1616
+ {
1617
+ "name": "version";
1618
+ "type": "u64";
1619
+ },
1620
+ {
1621
+ "name": "root";
1622
+ "type": {
1623
+ "array": [
1624
+ "u8",
1625
+ 32
1626
+ ];
1627
+ };
1628
+ },
1629
+ {
1630
+ "name": "maxTotalClaim";
1631
+ "type": "u64";
1632
+ },
1633
+ {
1634
+ "name": "maxNumNodes";
1635
+ "type": "u64";
1636
+ },
1637
+ {
1638
+ "name": "unlockPeriod";
1639
+ "type": "u64";
1640
+ },
1641
+ {
1642
+ "name": "startVestingTs";
1643
+ "type": "u64";
1644
+ },
1645
+ {
1646
+ "name": "endVestingTs";
1647
+ "type": "u64";
1648
+ },
1649
+ {
1650
+ "name": "clawbackStartTs";
1651
+ "type": "u64";
1652
+ },
1653
+ {
1654
+ "name": "claimsClosableByAdmin";
1655
+ "type": "bool";
1656
+ },
1657
+ {
1658
+ "name": "canUpdateDuration";
1659
+ "type": {
1660
+ "option": "bool";
1661
+ };
1662
+ },
1663
+ {
1664
+ "name": "totalAmountUnlocked";
1665
+ "type": {
1666
+ "option": "u64";
1667
+ };
1668
+ },
1669
+ {
1670
+ "name": "totalAmountLocked";
1671
+ "type": {
1672
+ "option": "u64";
1673
+ };
1674
+ },
1675
+ {
1676
+ "name": "claimsClosableByClaimant";
1677
+ "type": {
1678
+ "option": "bool";
1679
+ };
1680
+ },
1681
+ {
1682
+ "name": "claimsLimit";
1683
+ "type": {
1684
+ "option": "u16";
1685
+ };
1686
+ }
1687
+ ];
1688
+ },
1689
+ {
1690
+ "name": "newDistributorV2";
1691
+ "discriminator": [
1692
+ 45,
1693
+ 79,
1694
+ 3,
1695
+ 238,
1696
+ 185,
1697
+ 37,
1698
+ 253,
1699
+ 179
1700
+ ];
1701
+ "accounts": [
1702
+ {
1703
+ "name": "distributor";
1704
+ "docs": [
1705
+ "[MerkleDistributor]."
1706
+ ];
1707
+ "writable": true;
1708
+ "pda": {
1709
+ "seeds": [
1710
+ {
1711
+ "kind": "const";
1712
+ "value": [
1713
+ 77,
1714
+ 101,
1715
+ 114,
1716
+ 107,
1717
+ 108,
1718
+ 101,
1719
+ 68,
1720
+ 105,
1721
+ 115,
1722
+ 116,
1723
+ 114,
1724
+ 105,
1725
+ 98,
1726
+ 117,
1727
+ 116,
1728
+ 111,
1729
+ 114
1730
+ ];
1731
+ },
1732
+ {
1733
+ "kind": "account";
1734
+ "path": "mint";
1735
+ },
1736
+ {
1737
+ "kind": "arg";
1738
+ "path": "version";
1739
+ }
1740
+ ];
1741
+ };
1742
+ },
1743
+ {
1744
+ "name": "clawbackReceiver";
1745
+ "docs": [
1746
+ "Clawback receiver token account"
1747
+ ];
1748
+ "writable": true;
1749
+ },
1750
+ {
1751
+ "name": "mint";
1752
+ "docs": [
1753
+ "The mint to distribute."
1754
+ ];
1755
+ },
1756
+ {
1757
+ "name": "tokenVault";
1758
+ "docs": [
1759
+ "Token vault"
1760
+ ];
1761
+ "writable": true;
1762
+ "pda": {
1763
+ "seeds": [
1764
+ {
1765
+ "kind": "account";
1766
+ "path": "distributor";
1767
+ },
1768
+ {
1769
+ "kind": "account";
1770
+ "path": "tokenProgram";
1771
+ },
1772
+ {
1773
+ "kind": "account";
1774
+ "path": "mint";
1775
+ }
1776
+ ];
1777
+ "program": {
1778
+ "kind": "const";
1779
+ "value": [
1780
+ 140,
1781
+ 151,
1782
+ 37,
1783
+ 143,
1784
+ 78,
1785
+ 36,
1786
+ 137,
1787
+ 241,
1788
+ 187,
1789
+ 61,
1790
+ 16,
1791
+ 41,
1792
+ 20,
1793
+ 142,
1794
+ 13,
1795
+ 131,
1796
+ 11,
1797
+ 90,
1798
+ 19,
1799
+ 153,
1800
+ 218,
1801
+ 255,
1802
+ 16,
1803
+ 132,
1804
+ 4,
1805
+ 142,
1806
+ 123,
1807
+ 216,
1808
+ 219,
1809
+ 233,
1810
+ 248,
1811
+ 89
1812
+ ];
1813
+ };
1814
+ };
1815
+ },
1816
+ {
1817
+ "name": "admin";
1818
+ "docs": [
1819
+ "Admin wallet, responsible for creating the distributor and paying for the transaction.",
1820
+ "Also has the authority to set the clawback receiver and change itself."
1821
+ ];
1822
+ "writable": true;
1823
+ "signer": true;
1824
+ },
1825
+ {
1826
+ "name": "autoClaimState";
1827
+ "writable": true;
1828
+ "pda": {
1829
+ "seeds": [
1830
+ {
1831
+ "kind": "const";
1832
+ "value": [
1833
+ 65,
1834
+ 117,
1835
+ 116,
1836
+ 111,
1837
+ 67,
1838
+ 108,
1839
+ 97,
1840
+ 105,
1841
+ 109
1842
+ ];
1843
+ },
1844
+ {
1845
+ "kind": "account";
1846
+ "path": "distributor";
1847
+ }
1848
+ ];
1849
+ };
1850
+ },
1851
+ {
1852
+ "name": "systemProgram";
1853
+ "docs": [
1854
+ "The [System] program."
1855
+ ];
1856
+ "address": "11111111111111111111111111111111";
1857
+ },
1858
+ {
1859
+ "name": "associatedTokenProgram";
1860
+ "docs": [
1861
+ "The [Associated Token] program."
1862
+ ];
1863
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1864
+ },
1865
+ {
1866
+ "name": "tokenProgram";
1867
+ "docs": [
1868
+ "The [Token] program."
1869
+ ];
1870
+ },
1871
+ {
1872
+ "name": "partnerOracleConfig";
1873
+ "pda": {
1874
+ "seeds": [
1875
+ {
1876
+ "kind": "const";
1877
+ "value": [
1878
+ 97,
1879
+ 105,
1880
+ 114,
1881
+ 100,
1882
+ 114,
1883
+ 111,
1884
+ 112,
1885
+ 95,
1886
+ 99,
1887
+ 111,
1888
+ 110,
1889
+ 102,
1890
+ 105,
1891
+ 103
1892
+ ];
1893
+ }
1894
+ ];
1895
+ "program": {
1896
+ "kind": "const";
1897
+ "value": [
1898
+ 12,
1899
+ 48,
1900
+ 148,
1901
+ 48,
1902
+ 221,
1903
+ 89,
1904
+ 2,
1905
+ 209,
1906
+ 180,
1907
+ 126,
1908
+ 151,
1909
+ 216,
1910
+ 166,
1911
+ 3,
1912
+ 112,
1913
+ 50,
1914
+ 177,
1915
+ 192,
1269
1916
  141,
1270
1917
  218,
1271
1918
  37,
@@ -1310,6 +1957,14 @@ type MerkleDistributor = {
1310
1957
  "name": "maxTotalClaim";
1311
1958
  "type": "u64";
1312
1959
  },
1960
+ {
1961
+ "name": "totalAmountUnlocked";
1962
+ "type": "u64";
1963
+ },
1964
+ {
1965
+ "name": "totalAmountLocked";
1966
+ "type": "u64";
1967
+ },
1313
1968
  {
1314
1969
  "name": "maxNumNodes";
1315
1970
  "type": "u64";
@@ -1333,36 +1988,93 @@ type MerkleDistributor = {
1333
1988
  {
1334
1989
  "name": "claimsClosableByAdmin";
1335
1990
  "type": "bool";
1336
- },
1991
+ },
1992
+ {
1993
+ "name": "claimsClosableByClaimant";
1994
+ "type": "bool";
1995
+ },
1996
+ {
1997
+ "name": "canUpdateDuration";
1998
+ "type": "bool";
1999
+ },
2000
+ {
2001
+ "name": "claimsLimit";
2002
+ "type": "u16";
2003
+ },
2004
+ {
2005
+ "name": "autoClaim";
2006
+ "type": "bool";
2007
+ }
2008
+ ];
2009
+ },
2010
+ {
2011
+ "name": "reallocDistributor";
2012
+ "discriminator": [
2013
+ 167,
2014
+ 165,
2015
+ 22,
2016
+ 244,
2017
+ 248,
2018
+ 99,
2019
+ 33,
2020
+ 42
2021
+ ];
2022
+ "accounts": [
1337
2023
  {
1338
- "name": "canUpdateDuration";
1339
- "type": {
1340
- "option": "bool";
1341
- };
2024
+ "name": "payer";
2025
+ "writable": true;
2026
+ "signer": true;
1342
2027
  },
1343
2028
  {
1344
- "name": "totalAmountUnlocked";
1345
- "type": {
1346
- "option": "u64";
1347
- };
2029
+ "name": "mint";
1348
2030
  },
1349
2031
  {
1350
- "name": "totalAmountLocked";
1351
- "type": {
1352
- "option": "u64";
2032
+ "name": "distributor";
2033
+ "writable": true;
2034
+ "pda": {
2035
+ "seeds": [
2036
+ {
2037
+ "kind": "const";
2038
+ "value": [
2039
+ 77,
2040
+ 101,
2041
+ 114,
2042
+ 107,
2043
+ 108,
2044
+ 101,
2045
+ 68,
2046
+ 105,
2047
+ 115,
2048
+ 116,
2049
+ 114,
2050
+ 105,
2051
+ 98,
2052
+ 117,
2053
+ 116,
2054
+ 111,
2055
+ 114
2056
+ ];
2057
+ },
2058
+ {
2059
+ "kind": "account";
2060
+ "path": "mint";
2061
+ },
2062
+ {
2063
+ "kind": "arg";
2064
+ "path": "version";
2065
+ }
2066
+ ];
1353
2067
  };
1354
2068
  },
1355
2069
  {
1356
- "name": "claimsClosableByClaimant";
1357
- "type": {
1358
- "option": "bool";
1359
- };
1360
- },
2070
+ "name": "systemProgram";
2071
+ "address": "11111111111111111111111111111111";
2072
+ }
2073
+ ];
2074
+ "args": [
1361
2075
  {
1362
- "name": "claimsLimit";
1363
- "type": {
1364
- "option": "u16";
1365
- };
2076
+ "name": "version";
2077
+ "type": "u64";
1366
2078
  }
1367
2079
  ];
1368
2080
  },
@@ -1444,6 +2156,36 @@ type MerkleDistributor = {
1444
2156
  ];
1445
2157
  "args": [];
1446
2158
  },
2159
+ {
2160
+ "name": "requestClawback";
2161
+ "discriminator": [
2162
+ 57,
2163
+ 57,
2164
+ 31,
2165
+ 191,
2166
+ 239,
2167
+ 66,
2168
+ 54,
2169
+ 8
2170
+ ];
2171
+ "accounts": [
2172
+ {
2173
+ "name": "distributor";
2174
+ "docs": [
2175
+ "The [MerkleDistributor]."
2176
+ ];
2177
+ "writable": true;
2178
+ },
2179
+ {
2180
+ "name": "authority";
2181
+ "docs": [
2182
+ "Fee partner signer that may initiate the delayed clawback flow."
2183
+ ];
2184
+ "signer": true;
2185
+ }
2186
+ ];
2187
+ "args": [];
2188
+ },
1447
2189
  {
1448
2190
  "name": "setAdmin";
1449
2191
  "discriminator": [
@@ -1600,9 +2342,52 @@ type MerkleDistributor = {
1600
2342
  };
1601
2343
  }
1602
2344
  ];
2345
+ },
2346
+ {
2347
+ "name": "withdrawClawbackRequest";
2348
+ "discriminator": [
2349
+ 149,
2350
+ 159,
2351
+ 253,
2352
+ 249,
2353
+ 226,
2354
+ 250,
2355
+ 21,
2356
+ 8
2357
+ ];
2358
+ "accounts": [
2359
+ {
2360
+ "name": "distributor";
2361
+ "docs": [
2362
+ "The [MerkleDistributor]."
2363
+ ];
2364
+ "writable": true;
2365
+ },
2366
+ {
2367
+ "name": "authority";
2368
+ "docs": [
2369
+ "Fee partner signer that may initiate the delayed clawback flow."
2370
+ ];
2371
+ "signer": true;
2372
+ }
2373
+ ];
2374
+ "args": [];
1603
2375
  }
1604
2376
  ];
1605
2377
  "accounts": [
2378
+ {
2379
+ "name": "autoClaimState";
2380
+ "discriminator": [
2381
+ 216,
2382
+ 43,
2383
+ 239,
2384
+ 75,
2385
+ 58,
2386
+ 129,
2387
+ 132,
2388
+ 12
2389
+ ];
2390
+ },
1606
2391
  {
1607
2392
  "name": "claimStatus";
1608
2393
  "discriminator": [
@@ -1819,9 +2604,142 @@ type MerkleDistributor = {
1819
2604
  "code": 6026;
1820
2605
  "name": "noFeesToClaim";
1821
2606
  "msg": "No fees to claim";
2607
+ },
2608
+ {
2609
+ "code": 6027;
2610
+ "name": "autoClaimNotPossible";
2611
+ "msg": "Auto-claim is available only for instant airdrops";
2612
+ },
2613
+ {
2614
+ "code": 6028;
2615
+ "name": "autoClaimEnabled";
2616
+ "msg": "Auto-claim is enabled for this airdrop, manual claims are not possible, clawback v2 is required";
2617
+ },
2618
+ {
2619
+ "code": 6029;
2620
+ "name": "autoClaimNotEnabled";
2621
+ "msg": "Auto-claim is not enabled for this airdrop";
2622
+ },
2623
+ {
2624
+ "code": 6030;
2625
+ "name": "invalidAutoClaimTokenAccount";
2626
+ "msg": "Invalid auto-claim recipient token account";
2627
+ },
2628
+ {
2629
+ "code": 6031;
2630
+ "name": "clawbackRequestAlreadyRequested";
2631
+ "msg": "Clawback has already been requested";
2632
+ },
2633
+ {
2634
+ "code": 6032;
2635
+ "name": "clawbackRequestNotRequested";
2636
+ "msg": "Clawback has not been requested";
2637
+ },
2638
+ {
2639
+ "code": 6033;
2640
+ "name": "clawbackRequestDelayPending";
2641
+ "msg": "Clawback request delay has not passed yet";
1822
2642
  }
1823
2643
  ];
1824
2644
  "types": [
2645
+ {
2646
+ "name": "autoClaimState";
2647
+ "docs": [
2648
+ "Tracks reserved and spent SOL for worker auto-claims."
2649
+ ];
2650
+ "type": {
2651
+ "kind": "struct";
2652
+ "fields": [
2653
+ {
2654
+ "name": "bump";
2655
+ "docs": [
2656
+ "Bump seed."
2657
+ ];
2658
+ "type": "u8";
2659
+ },
2660
+ {
2661
+ "name": "distributor";
2662
+ "docs": [
2663
+ "Distributor account this state belongs to."
2664
+ ];
2665
+ "type": "pubkey";
2666
+ },
2667
+ {
2668
+ "name": "txFeeLamports";
2669
+ "docs": [
2670
+ "Fixed reimbursement for transaction processing."
2671
+ ];
2672
+ "type": "u64";
2673
+ },
2674
+ {
2675
+ "name": "ataRentLamports";
2676
+ "docs": [
2677
+ "Fixed reimbursement for ATA creation when it is needed."
2678
+ ];
2679
+ "type": "u64";
2680
+ },
2681
+ {
2682
+ "name": "claimStatusRentLamports";
2683
+ "docs": [
2684
+ "Fixed reimbursement tom cover ClaimStatus account creation."
2685
+ ];
2686
+ "type": "u64";
2687
+ },
2688
+ {
2689
+ "name": "totalFunded";
2690
+ "docs": [
2691
+ "Total SOL funded for reimbursements."
2692
+ ];
2693
+ "type": "u64";
2694
+ },
2695
+ {
2696
+ "name": "totalSpent";
2697
+ "docs": [
2698
+ "Total SOL reimbursed so far."
2699
+ ];
2700
+ "type": "u64";
2701
+ },
2702
+ {
2703
+ "name": "claimsProcessed";
2704
+ "docs": [
2705
+ "Number of claims processed by the worker."
2706
+ ];
2707
+ "type": "u64";
2708
+ },
2709
+ {
2710
+ "name": "ataCreations";
2711
+ "docs": [
2712
+ "Number of ATAs funded by the worker path."
2713
+ ];
2714
+ "type": "u64";
2715
+ },
2716
+ {
2717
+ "name": "buffer1";
2718
+ "docs": [
2719
+ "Buffer for additional fields"
2720
+ ];
2721
+ "type": {
2722
+ "array": [
2723
+ "u8",
2724
+ 32
2725
+ ];
2726
+ };
2727
+ },
2728
+ {
2729
+ "name": "buffer2";
2730
+ "docs": [
2731
+ "Buffer for additional fields"
2732
+ ];
2733
+ "type": {
2734
+ "array": [
2735
+ "u8",
2736
+ 32
2737
+ ];
2738
+ };
2739
+ }
2740
+ ];
2741
+ };
2742
+ },
1825
2743
  {
1826
2744
  "name": "claimClosedEvent";
1827
2745
  "docs": [
@@ -2243,14 +3161,56 @@ type MerkleDistributor = {
2243
3161
  "type": "u8";
2244
3162
  },
2245
3163
  {
2246
- "name": "buffer";
3164
+ "name": "autoClaim";
2247
3165
  "docs": [
2248
- "Buffer for additional fields"
3166
+ "Whether Distributor supports auto-claim"
3167
+ ];
3168
+ "type": "bool";
3169
+ },
3170
+ {
3171
+ "name": "alignBuffer1";
3172
+ "docs": [
3173
+ "Extra buffer to keep alignment, may be reused"
3174
+ ];
3175
+ "type": {
3176
+ "array": [
3177
+ "u8",
3178
+ 4
3179
+ ];
3180
+ };
3181
+ },
3182
+ {
3183
+ "name": "feePartner";
3184
+ "docs": [
3185
+ "Partner wallet whose fee schedule was applied, if different from the creator"
3186
+ ];
3187
+ "type": "pubkey";
3188
+ },
3189
+ {
3190
+ "name": "clawbackRequestTs";
3191
+ "docs": [
3192
+ "Timestamp when clawback was requested by the fee partner"
3193
+ ];
3194
+ "type": "u64";
3195
+ },
3196
+ {
3197
+ "name": "buffer1";
3198
+ "docs": [
3199
+ "Buffers for additional fields"
2249
3200
  ];
2250
3201
  "type": {
2251
3202
  "array": [
2252
3203
  "u8",
2253
- 13
3204
+ 32
3205
+ ];
3206
+ };
3207
+ },
3208
+ {
3209
+ "name": "buffer2";
3210
+ "type": {
3211
+ "array": [
3212
+ "u8",
3213
+ 32
2254
3214
  ];
2255
3215
  };
2256
3216
  }