@axonfi/sdk 0.5.4 → 0.5.5

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.cjs CHANGED
@@ -1019,6 +1019,118 @@ var AxonVaultAbi = [
1019
1019
  ],
1020
1020
  "stateMutability": "view"
1021
1021
  },
1022
+ {
1023
+ "type": "function",
1024
+ "name": "onERC1155BatchReceived",
1025
+ "inputs": [
1026
+ {
1027
+ "name": "",
1028
+ "type": "address",
1029
+ "internalType": "address"
1030
+ },
1031
+ {
1032
+ "name": "",
1033
+ "type": "address",
1034
+ "internalType": "address"
1035
+ },
1036
+ {
1037
+ "name": "",
1038
+ "type": "uint256[]",
1039
+ "internalType": "uint256[]"
1040
+ },
1041
+ {
1042
+ "name": "",
1043
+ "type": "uint256[]",
1044
+ "internalType": "uint256[]"
1045
+ },
1046
+ {
1047
+ "name": "",
1048
+ "type": "bytes",
1049
+ "internalType": "bytes"
1050
+ }
1051
+ ],
1052
+ "outputs": [
1053
+ {
1054
+ "name": "",
1055
+ "type": "bytes4",
1056
+ "internalType": "bytes4"
1057
+ }
1058
+ ],
1059
+ "stateMutability": "pure"
1060
+ },
1061
+ {
1062
+ "type": "function",
1063
+ "name": "onERC1155Received",
1064
+ "inputs": [
1065
+ {
1066
+ "name": "",
1067
+ "type": "address",
1068
+ "internalType": "address"
1069
+ },
1070
+ {
1071
+ "name": "",
1072
+ "type": "address",
1073
+ "internalType": "address"
1074
+ },
1075
+ {
1076
+ "name": "",
1077
+ "type": "uint256",
1078
+ "internalType": "uint256"
1079
+ },
1080
+ {
1081
+ "name": "",
1082
+ "type": "uint256",
1083
+ "internalType": "uint256"
1084
+ },
1085
+ {
1086
+ "name": "",
1087
+ "type": "bytes",
1088
+ "internalType": "bytes"
1089
+ }
1090
+ ],
1091
+ "outputs": [
1092
+ {
1093
+ "name": "",
1094
+ "type": "bytes4",
1095
+ "internalType": "bytes4"
1096
+ }
1097
+ ],
1098
+ "stateMutability": "pure"
1099
+ },
1100
+ {
1101
+ "type": "function",
1102
+ "name": "onERC721Received",
1103
+ "inputs": [
1104
+ {
1105
+ "name": "",
1106
+ "type": "address",
1107
+ "internalType": "address"
1108
+ },
1109
+ {
1110
+ "name": "",
1111
+ "type": "address",
1112
+ "internalType": "address"
1113
+ },
1114
+ {
1115
+ "name": "",
1116
+ "type": "uint256",
1117
+ "internalType": "uint256"
1118
+ },
1119
+ {
1120
+ "name": "",
1121
+ "type": "bytes",
1122
+ "internalType": "bytes"
1123
+ }
1124
+ ],
1125
+ "outputs": [
1126
+ {
1127
+ "name": "",
1128
+ "type": "bytes4",
1129
+ "internalType": "bytes4"
1130
+ }
1131
+ ],
1132
+ "stateMutability": "pure"
1133
+ },
1022
1134
  {
1023
1135
  "type": "function",
1024
1136
  "name": "operator",
@@ -1244,7 +1356,7 @@ var AxonVaultAbi = [
1244
1356
  "name": "renounceOwnership",
1245
1357
  "inputs": [],
1246
1358
  "outputs": [],
1247
- "stateMutability": "nonpayable"
1359
+ "stateMutability": "pure"
1248
1360
  },
1249
1361
  {
1250
1362
  "type": "function",
@@ -1312,6 +1424,25 @@ var AxonVaultAbi = [
1312
1424
  "outputs": [],
1313
1425
  "stateMutability": "nonpayable"
1314
1426
  },
1427
+ {
1428
+ "type": "function",
1429
+ "name": "supportsInterface",
1430
+ "inputs": [
1431
+ {
1432
+ "name": "interfaceId",
1433
+ "type": "bytes4",
1434
+ "internalType": "bytes4"
1435
+ }
1436
+ ],
1437
+ "outputs": [
1438
+ {
1439
+ "name": "",
1440
+ "type": "bool",
1441
+ "internalType": "bool"
1442
+ }
1443
+ ],
1444
+ "stateMutability": "view"
1445
+ },
1315
1446
  {
1316
1447
  "type": "function",
1317
1448
  "name": "transferOwnership",
@@ -1436,6 +1567,57 @@ var AxonVaultAbi = [
1436
1567
  "outputs": [],
1437
1568
  "stateMutability": "nonpayable"
1438
1569
  },
1570
+ {
1571
+ "type": "function",
1572
+ "name": "withdrawERC1155",
1573
+ "inputs": [
1574
+ {
1575
+ "name": "token",
1576
+ "type": "address",
1577
+ "internalType": "address"
1578
+ },
1579
+ {
1580
+ "name": "id",
1581
+ "type": "uint256",
1582
+ "internalType": "uint256"
1583
+ },
1584
+ {
1585
+ "name": "amount",
1586
+ "type": "uint256",
1587
+ "internalType": "uint256"
1588
+ },
1589
+ {
1590
+ "name": "to",
1591
+ "type": "address",
1592
+ "internalType": "address"
1593
+ }
1594
+ ],
1595
+ "outputs": [],
1596
+ "stateMutability": "nonpayable"
1597
+ },
1598
+ {
1599
+ "type": "function",
1600
+ "name": "withdrawERC721",
1601
+ "inputs": [
1602
+ {
1603
+ "name": "nft",
1604
+ "type": "address",
1605
+ "internalType": "address"
1606
+ },
1607
+ {
1608
+ "name": "tokenId",
1609
+ "type": "uint256",
1610
+ "internalType": "uint256"
1611
+ },
1612
+ {
1613
+ "name": "to",
1614
+ "type": "address",
1615
+ "internalType": "address"
1616
+ }
1617
+ ],
1618
+ "outputs": [],
1619
+ "stateMutability": "nonpayable"
1620
+ },
1439
1621
  {
1440
1622
  "type": "event",
1441
1623
  "name": "BotAdded",
@@ -1568,6 +1750,62 @@ var AxonVaultAbi = [
1568
1750
  "inputs": [],
1569
1751
  "anonymous": false
1570
1752
  },
1753
+ {
1754
+ "type": "event",
1755
+ "name": "ERC1155Withdrawn",
1756
+ "inputs": [
1757
+ {
1758
+ "name": "token",
1759
+ "type": "address",
1760
+ "indexed": true,
1761
+ "internalType": "address"
1762
+ },
1763
+ {
1764
+ "name": "id",
1765
+ "type": "uint256",
1766
+ "indexed": true,
1767
+ "internalType": "uint256"
1768
+ },
1769
+ {
1770
+ "name": "amount",
1771
+ "type": "uint256",
1772
+ "indexed": false,
1773
+ "internalType": "uint256"
1774
+ },
1775
+ {
1776
+ "name": "to",
1777
+ "type": "address",
1778
+ "indexed": true,
1779
+ "internalType": "address"
1780
+ }
1781
+ ],
1782
+ "anonymous": false
1783
+ },
1784
+ {
1785
+ "type": "event",
1786
+ "name": "ERC721Withdrawn",
1787
+ "inputs": [
1788
+ {
1789
+ "name": "nft",
1790
+ "type": "address",
1791
+ "indexed": true,
1792
+ "internalType": "address"
1793
+ },
1794
+ {
1795
+ "name": "tokenId",
1796
+ "type": "uint256",
1797
+ "indexed": true,
1798
+ "internalType": "uint256"
1799
+ },
1800
+ {
1801
+ "name": "to",
1802
+ "type": "address",
1803
+ "indexed": true,
1804
+ "internalType": "address"
1805
+ }
1806
+ ],
1807
+ "anonymous": false
1808
+ },
1571
1809
  {
1572
1810
  "type": "event",
1573
1811
  "name": "GlobalBlacklistAdded",
@@ -2026,6 +2264,11 @@ var AxonVaultAbi = [
2026
2264
  "name": "DeadlineExpired",
2027
2265
  "inputs": []
2028
2266
  },
2267
+ {
2268
+ "type": "error",
2269
+ "name": "DefaultTokenCallRestricted",
2270
+ "inputs": []
2271
+ },
2029
2272
  {
2030
2273
  "type": "error",
2031
2274
  "name": "DestinationBlacklisted",
@@ -2408,7 +2651,7 @@ var AxonVaultFactoryAbi = [
2408
2651
  "name": "renounceOwnership",
2409
2652
  "inputs": [],
2410
2653
  "outputs": [],
2411
- "stateMutability": "nonpayable"
2654
+ "stateMutability": "pure"
2412
2655
  },
2413
2656
  {
2414
2657
  "type": "function",
@@ -3345,6 +3588,19 @@ async function signPermit2WitnessTransfer(privateKey, chainId, permit) {
3345
3588
  }
3346
3589
 
3347
3590
  // src/client.ts
3591
+ var BURN_ADDRESSES = /* @__PURE__ */ new Set([
3592
+ "0x0000000000000000000000000000000000000000",
3593
+ "0x0000000000000000000000000000000000000001",
3594
+ "0x000000000000000000000000000000000000dead",
3595
+ "0xdead000000000000000000000000000000000000",
3596
+ "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000",
3597
+ "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
3598
+ ]);
3599
+ function _rejectBurnAddress(address, label) {
3600
+ if (BURN_ADDRESSES.has(address.toLowerCase())) {
3601
+ throw new Error(`${label} cannot be a burn/dead address (${address})`);
3602
+ }
3603
+ }
3348
3604
  var AxonClient = class {
3349
3605
  constructor(config) {
3350
3606
  // ============================================================================
@@ -3772,9 +4028,7 @@ Timestamp: ${timestamp}`;
3772
4028
  return "0x0000000000000000000000000000000000000000000000000000000000000000";
3773
4029
  }
3774
4030
  _buildPaymentIntent(input) {
3775
- if (input.to === "0x0000000000000000000000000000000000000000") {
3776
- throw new Error("Payment recipient cannot be the zero address");
3777
- }
4031
+ _rejectBurnAddress(input.to, "Payment recipient");
3778
4032
  return {
3779
4033
  bot: this.botAddress,
3780
4034
  to: input.to,
@@ -3785,6 +4039,7 @@ Timestamp: ${timestamp}`;
3785
4039
  };
3786
4040
  }
3787
4041
  _buildExecuteIntent(input) {
4042
+ _rejectBurnAddress(input.protocol, "Protocol address");
3788
4043
  return {
3789
4044
  bot: this.botAddress,
3790
4045
  protocol: input.protocol,
@@ -4189,7 +4444,7 @@ var AxonRegistryAbi = [
4189
4444
  "name": "renounceOwnership",
4190
4445
  "inputs": [],
4191
4446
  "outputs": [],
4192
- "stateMutability": "nonpayable"
4447
+ "stateMutability": "pure"
4193
4448
  },
4194
4449
  {
4195
4450
  "type": "function",