@axonfi/sdk 0.5.3 → 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
@@ -49,32 +49,19 @@ var CHAIN_NAMES = {
49
49
  [8453 /* Base */]: "Base",
50
50
  [84532 /* BaseSepolia */]: "Base Sepolia",
51
51
  [42161 /* Arbitrum */]: "Arbitrum One",
52
- [421614 /* ArbitrumSepolia */]: "Arbitrum Sepolia",
53
- // Future v1 chains (metadata only — not in SUPPORTED_CHAIN_IDS yet)
54
- 10: "Optimism",
55
- 11155420: "OP Sepolia",
56
- 137: "Polygon",
57
- 80002: "Polygon Amoy"
52
+ [421614 /* ArbitrumSepolia */]: "Arbitrum Sepolia"
58
53
  };
59
54
  var EXPLORER_TX = {
60
55
  [8453 /* Base */]: "https://basescan.org/tx/",
61
56
  [84532 /* BaseSepolia */]: "https://sepolia.basescan.org/tx/",
62
57
  [42161 /* Arbitrum */]: "https://arbiscan.io/tx/",
63
- [421614 /* ArbitrumSepolia */]: "https://sepolia.arbiscan.io/tx/",
64
- 10: "https://optimistic.etherscan.io/tx/",
65
- 11155420: "https://sepolia-optimism.etherscan.io/tx/",
66
- 137: "https://polygonscan.com/tx/",
67
- 80002: "https://amoy.polygonscan.com/tx/"
58
+ [421614 /* ArbitrumSepolia */]: "https://sepolia.arbiscan.io/tx/"
68
59
  };
69
60
  var EXPLORER_ADDR = {
70
61
  [8453 /* Base */]: "https://basescan.org/address/",
71
62
  [84532 /* BaseSepolia */]: "https://sepolia.basescan.org/address/",
72
63
  [42161 /* Arbitrum */]: "https://arbiscan.io/address/",
73
- [421614 /* ArbitrumSepolia */]: "https://sepolia.arbiscan.io/address/",
74
- 10: "https://optimistic.etherscan.io/address/",
75
- 11155420: "https://sepolia-optimism.etherscan.io/address/",
76
- 137: "https://polygonscan.com/address/",
77
- 80002: "https://amoy.polygonscan.com/address/"
64
+ [421614 /* ArbitrumSepolia */]: "https://sepolia.arbiscan.io/address/"
78
65
  };
79
66
  var DEFAULT_DEADLINE_SECONDS = 300;
80
67
  var WINDOW = {
@@ -1032,6 +1019,118 @@ var AxonVaultAbi = [
1032
1019
  ],
1033
1020
  "stateMutability": "view"
1034
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
+ },
1035
1134
  {
1036
1135
  "type": "function",
1037
1136
  "name": "operator",
@@ -1257,7 +1356,7 @@ var AxonVaultAbi = [
1257
1356
  "name": "renounceOwnership",
1258
1357
  "inputs": [],
1259
1358
  "outputs": [],
1260
- "stateMutability": "nonpayable"
1359
+ "stateMutability": "pure"
1261
1360
  },
1262
1361
  {
1263
1362
  "type": "function",
@@ -1325,6 +1424,25 @@ var AxonVaultAbi = [
1325
1424
  "outputs": [],
1326
1425
  "stateMutability": "nonpayable"
1327
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
+ },
1328
1446
  {
1329
1447
  "type": "function",
1330
1448
  "name": "transferOwnership",
@@ -1449,6 +1567,57 @@ var AxonVaultAbi = [
1449
1567
  "outputs": [],
1450
1568
  "stateMutability": "nonpayable"
1451
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
+ },
1452
1621
  {
1453
1622
  "type": "event",
1454
1623
  "name": "BotAdded",
@@ -1581,6 +1750,62 @@ var AxonVaultAbi = [
1581
1750
  "inputs": [],
1582
1751
  "anonymous": false
1583
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
+ },
1584
1809
  {
1585
1810
  "type": "event",
1586
1811
  "name": "GlobalBlacklistAdded",
@@ -2039,6 +2264,11 @@ var AxonVaultAbi = [
2039
2264
  "name": "DeadlineExpired",
2040
2265
  "inputs": []
2041
2266
  },
2267
+ {
2268
+ "type": "error",
2269
+ "name": "DefaultTokenCallRestricted",
2270
+ "inputs": []
2271
+ },
2042
2272
  {
2043
2273
  "type": "error",
2044
2274
  "name": "DestinationBlacklisted",
@@ -2421,7 +2651,7 @@ var AxonVaultFactoryAbi = [
2421
2651
  "name": "renounceOwnership",
2422
2652
  "inputs": [],
2423
2653
  "outputs": [],
2424
- "stateMutability": "nonpayable"
2654
+ "stateMutability": "pure"
2425
2655
  },
2426
2656
  {
2427
2657
  "type": "function",
@@ -2565,8 +2795,6 @@ var Token = /* @__PURE__ */ ((Token2) => {
2565
2795
  Token2["COMP"] = "COMP";
2566
2796
  Token2["CRV"] = "CRV";
2567
2797
  Token2["SNX"] = "SNX";
2568
- Token2["ARB"] = "ARB";
2569
- Token2["AERO"] = "AERO";
2570
2798
  Token2["GMX"] = "GMX";
2571
2799
  return Token2;
2572
2800
  })(Token || {});
@@ -2724,23 +2952,6 @@ var KNOWN_TOKENS = {
2724
2952
  8453: "0x22e6966B799c4D5B13BE962E1D117b56327FDa66"
2725
2953
  }
2726
2954
  },
2727
- // ── Chain-native governance ─────────────────────────────
2728
- ARB: {
2729
- symbol: "ARB",
2730
- name: "Arbitrum",
2731
- decimals: 18,
2732
- addresses: {
2733
- 42161: "0x912CE59144191C1204E64559FE8253a0e49E6548"
2734
- }
2735
- },
2736
- AERO: {
2737
- symbol: "AERO",
2738
- name: "Aerodrome",
2739
- decimals: 18,
2740
- addresses: {
2741
- 8453: "0x940181a94A35A4569E4529A3CDfB74e38FD98631"
2742
- }
2743
- },
2744
2955
  GMX: {
2745
2956
  symbol: "GMX",
2746
2957
  name: "GMX",
@@ -3377,6 +3588,19 @@ async function signPermit2WitnessTransfer(privateKey, chainId, permit) {
3377
3588
  }
3378
3589
 
3379
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
+ }
3380
3604
  var AxonClient = class {
3381
3605
  constructor(config) {
3382
3606
  // ============================================================================
@@ -3804,9 +4028,7 @@ Timestamp: ${timestamp}`;
3804
4028
  return "0x0000000000000000000000000000000000000000000000000000000000000000";
3805
4029
  }
3806
4030
  _buildPaymentIntent(input) {
3807
- if (input.to === "0x0000000000000000000000000000000000000000") {
3808
- throw new Error("Payment recipient cannot be the zero address");
3809
- }
4031
+ _rejectBurnAddress(input.to, "Payment recipient");
3810
4032
  return {
3811
4033
  bot: this.botAddress,
3812
4034
  to: input.to,
@@ -3817,6 +4039,7 @@ Timestamp: ${timestamp}`;
3817
4039
  };
3818
4040
  }
3819
4041
  _buildExecuteIntent(input) {
4042
+ _rejectBurnAddress(input.protocol, "Protocol address");
3820
4043
  return {
3821
4044
  bot: this.botAddress,
3822
4045
  protocol: input.protocol,
@@ -4221,7 +4444,7 @@ var AxonRegistryAbi = [
4221
4444
  "name": "renounceOwnership",
4222
4445
  "inputs": [],
4223
4446
  "outputs": [],
4224
- "stateMutability": "nonpayable"
4447
+ "stateMutability": "pure"
4225
4448
  },
4226
4449
  {
4227
4450
  "type": "function",