@axonfi/sdk 0.5.4 → 0.6.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.
- package/dist/index.cjs +473 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +361 -23
- package/dist/index.d.ts +361 -23
- package/dist/index.js +473 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -18,7 +18,7 @@ var PAYMENT_INTENT_TYPEHASH = viem.keccak256(
|
|
|
18
18
|
);
|
|
19
19
|
var EXECUTE_INTENT_TYPEHASH = viem.keccak256(
|
|
20
20
|
viem.stringToBytes(
|
|
21
|
-
"ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 deadline,bytes32 ref)"
|
|
21
|
+
"ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 value,uint256 deadline,bytes32 ref)"
|
|
22
22
|
)
|
|
23
23
|
);
|
|
24
24
|
var SWAP_INTENT_TYPEHASH = viem.keccak256(
|
|
@@ -155,6 +155,7 @@ var EXECUTE_INTENT_TYPES = {
|
|
|
155
155
|
{ name: "calldataHash", type: "bytes32" },
|
|
156
156
|
{ name: "token", type: "address" },
|
|
157
157
|
{ name: "amount", type: "uint256" },
|
|
158
|
+
{ name: "value", type: "uint256" },
|
|
158
159
|
{ name: "deadline", type: "uint256" },
|
|
159
160
|
{ name: "ref", type: "bytes32" }
|
|
160
161
|
]
|
|
@@ -210,6 +211,7 @@ async function signExecuteIntent(walletClient, vaultAddress, chainId, intent) {
|
|
|
210
211
|
calldataHash: intent.calldataHash,
|
|
211
212
|
token: intent.token,
|
|
212
213
|
amount: intent.amount,
|
|
214
|
+
value: intent.value,
|
|
213
215
|
deadline: intent.deadline,
|
|
214
216
|
ref: intent.ref
|
|
215
217
|
}
|
|
@@ -241,18 +243,7 @@ function encodeRef(memo) {
|
|
|
241
243
|
var AxonVaultAbi = [
|
|
242
244
|
{
|
|
243
245
|
"type": "constructor",
|
|
244
|
-
"inputs": [
|
|
245
|
-
{
|
|
246
|
-
"name": "_owner",
|
|
247
|
-
"type": "address",
|
|
248
|
-
"internalType": "address"
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"name": "_axonRegistry",
|
|
252
|
-
"type": "address",
|
|
253
|
-
"internalType": "address"
|
|
254
|
-
}
|
|
255
|
-
],
|
|
246
|
+
"inputs": [],
|
|
256
247
|
"stateMutability": "nonpayable"
|
|
257
248
|
},
|
|
258
249
|
{
|
|
@@ -727,6 +718,11 @@ var AxonVaultAbi = [
|
|
|
727
718
|
"type": "uint256",
|
|
728
719
|
"internalType": "uint256"
|
|
729
720
|
},
|
|
721
|
+
{
|
|
722
|
+
"name": "value",
|
|
723
|
+
"type": "uint256",
|
|
724
|
+
"internalType": "uint256"
|
|
725
|
+
},
|
|
730
726
|
{
|
|
731
727
|
"name": "deadline",
|
|
732
728
|
"type": "uint256",
|
|
@@ -981,6 +977,24 @@ var AxonVaultAbi = [
|
|
|
981
977
|
],
|
|
982
978
|
"stateMutability": "view"
|
|
983
979
|
},
|
|
980
|
+
{
|
|
981
|
+
"type": "function",
|
|
982
|
+
"name": "initialize",
|
|
983
|
+
"inputs": [
|
|
984
|
+
{
|
|
985
|
+
"name": "_owner",
|
|
986
|
+
"type": "address",
|
|
987
|
+
"internalType": "address"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"name": "_axonRegistry",
|
|
991
|
+
"type": "address",
|
|
992
|
+
"internalType": "address"
|
|
993
|
+
}
|
|
994
|
+
],
|
|
995
|
+
"outputs": [],
|
|
996
|
+
"stateMutability": "nonpayable"
|
|
997
|
+
},
|
|
984
998
|
{
|
|
985
999
|
"type": "function",
|
|
986
1000
|
"name": "isBotActive",
|
|
@@ -1019,6 +1033,142 @@ var AxonVaultAbi = [
|
|
|
1019
1033
|
],
|
|
1020
1034
|
"stateMutability": "view"
|
|
1021
1035
|
},
|
|
1036
|
+
{
|
|
1037
|
+
"type": "function",
|
|
1038
|
+
"name": "isValidSignature",
|
|
1039
|
+
"inputs": [
|
|
1040
|
+
{
|
|
1041
|
+
"name": "hash",
|
|
1042
|
+
"type": "bytes32",
|
|
1043
|
+
"internalType": "bytes32"
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
"name": "signature",
|
|
1047
|
+
"type": "bytes",
|
|
1048
|
+
"internalType": "bytes"
|
|
1049
|
+
}
|
|
1050
|
+
],
|
|
1051
|
+
"outputs": [
|
|
1052
|
+
{
|
|
1053
|
+
"name": "",
|
|
1054
|
+
"type": "bytes4",
|
|
1055
|
+
"internalType": "bytes4"
|
|
1056
|
+
}
|
|
1057
|
+
],
|
|
1058
|
+
"stateMutability": "view"
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
"type": "function",
|
|
1062
|
+
"name": "onERC1155BatchReceived",
|
|
1063
|
+
"inputs": [
|
|
1064
|
+
{
|
|
1065
|
+
"name": "",
|
|
1066
|
+
"type": "address",
|
|
1067
|
+
"internalType": "address"
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
"name": "",
|
|
1071
|
+
"type": "address",
|
|
1072
|
+
"internalType": "address"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
"name": "",
|
|
1076
|
+
"type": "uint256[]",
|
|
1077
|
+
"internalType": "uint256[]"
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"name": "",
|
|
1081
|
+
"type": "uint256[]",
|
|
1082
|
+
"internalType": "uint256[]"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
"name": "",
|
|
1086
|
+
"type": "bytes",
|
|
1087
|
+
"internalType": "bytes"
|
|
1088
|
+
}
|
|
1089
|
+
],
|
|
1090
|
+
"outputs": [
|
|
1091
|
+
{
|
|
1092
|
+
"name": "",
|
|
1093
|
+
"type": "bytes4",
|
|
1094
|
+
"internalType": "bytes4"
|
|
1095
|
+
}
|
|
1096
|
+
],
|
|
1097
|
+
"stateMutability": "pure"
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
"type": "function",
|
|
1101
|
+
"name": "onERC1155Received",
|
|
1102
|
+
"inputs": [
|
|
1103
|
+
{
|
|
1104
|
+
"name": "",
|
|
1105
|
+
"type": "address",
|
|
1106
|
+
"internalType": "address"
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
"name": "",
|
|
1110
|
+
"type": "address",
|
|
1111
|
+
"internalType": "address"
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
"name": "",
|
|
1115
|
+
"type": "uint256",
|
|
1116
|
+
"internalType": "uint256"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"name": "",
|
|
1120
|
+
"type": "uint256",
|
|
1121
|
+
"internalType": "uint256"
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
"name": "",
|
|
1125
|
+
"type": "bytes",
|
|
1126
|
+
"internalType": "bytes"
|
|
1127
|
+
}
|
|
1128
|
+
],
|
|
1129
|
+
"outputs": [
|
|
1130
|
+
{
|
|
1131
|
+
"name": "",
|
|
1132
|
+
"type": "bytes4",
|
|
1133
|
+
"internalType": "bytes4"
|
|
1134
|
+
}
|
|
1135
|
+
],
|
|
1136
|
+
"stateMutability": "pure"
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
"type": "function",
|
|
1140
|
+
"name": "onERC721Received",
|
|
1141
|
+
"inputs": [
|
|
1142
|
+
{
|
|
1143
|
+
"name": "",
|
|
1144
|
+
"type": "address",
|
|
1145
|
+
"internalType": "address"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
"name": "",
|
|
1149
|
+
"type": "address",
|
|
1150
|
+
"internalType": "address"
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
"name": "",
|
|
1154
|
+
"type": "uint256",
|
|
1155
|
+
"internalType": "uint256"
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"name": "",
|
|
1159
|
+
"type": "bytes",
|
|
1160
|
+
"internalType": "bytes"
|
|
1161
|
+
}
|
|
1162
|
+
],
|
|
1163
|
+
"outputs": [
|
|
1164
|
+
{
|
|
1165
|
+
"name": "",
|
|
1166
|
+
"type": "bytes4",
|
|
1167
|
+
"internalType": "bytes4"
|
|
1168
|
+
}
|
|
1169
|
+
],
|
|
1170
|
+
"stateMutability": "pure"
|
|
1171
|
+
},
|
|
1022
1172
|
{
|
|
1023
1173
|
"type": "function",
|
|
1024
1174
|
"name": "operator",
|
|
@@ -1244,7 +1394,7 @@ var AxonVaultAbi = [
|
|
|
1244
1394
|
"name": "renounceOwnership",
|
|
1245
1395
|
"inputs": [],
|
|
1246
1396
|
"outputs": [],
|
|
1247
|
-
"stateMutability": "
|
|
1397
|
+
"stateMutability": "pure"
|
|
1248
1398
|
},
|
|
1249
1399
|
{
|
|
1250
1400
|
"type": "function",
|
|
@@ -1312,6 +1462,25 @@ var AxonVaultAbi = [
|
|
|
1312
1462
|
"outputs": [],
|
|
1313
1463
|
"stateMutability": "nonpayable"
|
|
1314
1464
|
},
|
|
1465
|
+
{
|
|
1466
|
+
"type": "function",
|
|
1467
|
+
"name": "supportsInterface",
|
|
1468
|
+
"inputs": [
|
|
1469
|
+
{
|
|
1470
|
+
"name": "interfaceId",
|
|
1471
|
+
"type": "bytes4",
|
|
1472
|
+
"internalType": "bytes4"
|
|
1473
|
+
}
|
|
1474
|
+
],
|
|
1475
|
+
"outputs": [
|
|
1476
|
+
{
|
|
1477
|
+
"name": "",
|
|
1478
|
+
"type": "bool",
|
|
1479
|
+
"internalType": "bool"
|
|
1480
|
+
}
|
|
1481
|
+
],
|
|
1482
|
+
"stateMutability": "view"
|
|
1483
|
+
},
|
|
1315
1484
|
{
|
|
1316
1485
|
"type": "function",
|
|
1317
1486
|
"name": "transferOwnership",
|
|
@@ -1436,6 +1605,57 @@ var AxonVaultAbi = [
|
|
|
1436
1605
|
"outputs": [],
|
|
1437
1606
|
"stateMutability": "nonpayable"
|
|
1438
1607
|
},
|
|
1608
|
+
{
|
|
1609
|
+
"type": "function",
|
|
1610
|
+
"name": "withdrawERC1155",
|
|
1611
|
+
"inputs": [
|
|
1612
|
+
{
|
|
1613
|
+
"name": "token",
|
|
1614
|
+
"type": "address",
|
|
1615
|
+
"internalType": "address"
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
"name": "id",
|
|
1619
|
+
"type": "uint256",
|
|
1620
|
+
"internalType": "uint256"
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
"name": "amount",
|
|
1624
|
+
"type": "uint256",
|
|
1625
|
+
"internalType": "uint256"
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"name": "to",
|
|
1629
|
+
"type": "address",
|
|
1630
|
+
"internalType": "address"
|
|
1631
|
+
}
|
|
1632
|
+
],
|
|
1633
|
+
"outputs": [],
|
|
1634
|
+
"stateMutability": "nonpayable"
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
"type": "function",
|
|
1638
|
+
"name": "withdrawERC721",
|
|
1639
|
+
"inputs": [
|
|
1640
|
+
{
|
|
1641
|
+
"name": "nft",
|
|
1642
|
+
"type": "address",
|
|
1643
|
+
"internalType": "address"
|
|
1644
|
+
},
|
|
1645
|
+
{
|
|
1646
|
+
"name": "tokenId",
|
|
1647
|
+
"type": "uint256",
|
|
1648
|
+
"internalType": "uint256"
|
|
1649
|
+
},
|
|
1650
|
+
{
|
|
1651
|
+
"name": "to",
|
|
1652
|
+
"type": "address",
|
|
1653
|
+
"internalType": "address"
|
|
1654
|
+
}
|
|
1655
|
+
],
|
|
1656
|
+
"outputs": [],
|
|
1657
|
+
"stateMutability": "nonpayable"
|
|
1658
|
+
},
|
|
1439
1659
|
{
|
|
1440
1660
|
"type": "event",
|
|
1441
1661
|
"name": "BotAdded",
|
|
@@ -1568,6 +1788,62 @@ var AxonVaultAbi = [
|
|
|
1568
1788
|
"inputs": [],
|
|
1569
1789
|
"anonymous": false
|
|
1570
1790
|
},
|
|
1791
|
+
{
|
|
1792
|
+
"type": "event",
|
|
1793
|
+
"name": "ERC1155Withdrawn",
|
|
1794
|
+
"inputs": [
|
|
1795
|
+
{
|
|
1796
|
+
"name": "token",
|
|
1797
|
+
"type": "address",
|
|
1798
|
+
"indexed": true,
|
|
1799
|
+
"internalType": "address"
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
"name": "id",
|
|
1803
|
+
"type": "uint256",
|
|
1804
|
+
"indexed": true,
|
|
1805
|
+
"internalType": "uint256"
|
|
1806
|
+
},
|
|
1807
|
+
{
|
|
1808
|
+
"name": "amount",
|
|
1809
|
+
"type": "uint256",
|
|
1810
|
+
"indexed": false,
|
|
1811
|
+
"internalType": "uint256"
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
"name": "to",
|
|
1815
|
+
"type": "address",
|
|
1816
|
+
"indexed": true,
|
|
1817
|
+
"internalType": "address"
|
|
1818
|
+
}
|
|
1819
|
+
],
|
|
1820
|
+
"anonymous": false
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
"type": "event",
|
|
1824
|
+
"name": "ERC721Withdrawn",
|
|
1825
|
+
"inputs": [
|
|
1826
|
+
{
|
|
1827
|
+
"name": "nft",
|
|
1828
|
+
"type": "address",
|
|
1829
|
+
"indexed": true,
|
|
1830
|
+
"internalType": "address"
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
"name": "tokenId",
|
|
1834
|
+
"type": "uint256",
|
|
1835
|
+
"indexed": true,
|
|
1836
|
+
"internalType": "uint256"
|
|
1837
|
+
},
|
|
1838
|
+
{
|
|
1839
|
+
"name": "to",
|
|
1840
|
+
"type": "address",
|
|
1841
|
+
"indexed": true,
|
|
1842
|
+
"internalType": "address"
|
|
1843
|
+
}
|
|
1844
|
+
],
|
|
1845
|
+
"anonymous": false
|
|
1846
|
+
},
|
|
1571
1847
|
{
|
|
1572
1848
|
"type": "event",
|
|
1573
1849
|
"name": "GlobalBlacklistAdded",
|
|
@@ -1620,6 +1896,19 @@ var AxonVaultAbi = [
|
|
|
1620
1896
|
],
|
|
1621
1897
|
"anonymous": false
|
|
1622
1898
|
},
|
|
1899
|
+
{
|
|
1900
|
+
"type": "event",
|
|
1901
|
+
"name": "Initialized",
|
|
1902
|
+
"inputs": [
|
|
1903
|
+
{
|
|
1904
|
+
"name": "version",
|
|
1905
|
+
"type": "uint64",
|
|
1906
|
+
"indexed": false,
|
|
1907
|
+
"internalType": "uint64"
|
|
1908
|
+
}
|
|
1909
|
+
],
|
|
1910
|
+
"anonymous": false
|
|
1911
|
+
},
|
|
1623
1912
|
{
|
|
1624
1913
|
"type": "event",
|
|
1625
1914
|
"name": "OperatorCeilingsUpdated",
|
|
@@ -2026,6 +2315,11 @@ var AxonVaultAbi = [
|
|
|
2026
2315
|
"name": "DeadlineExpired",
|
|
2027
2316
|
"inputs": []
|
|
2028
2317
|
},
|
|
2318
|
+
{
|
|
2319
|
+
"type": "error",
|
|
2320
|
+
"name": "DefaultTokenCallRestricted",
|
|
2321
|
+
"inputs": []
|
|
2322
|
+
},
|
|
2029
2323
|
{
|
|
2030
2324
|
"type": "error",
|
|
2031
2325
|
"name": "DestinationBlacklisted",
|
|
@@ -2090,7 +2384,7 @@ var AxonVaultAbi = [
|
|
|
2090
2384
|
},
|
|
2091
2385
|
{
|
|
2092
2386
|
"type": "error",
|
|
2093
|
-
"name": "
|
|
2387
|
+
"name": "InvalidInitialization",
|
|
2094
2388
|
"inputs": []
|
|
2095
2389
|
},
|
|
2096
2390
|
{
|
|
@@ -2123,6 +2417,11 @@ var AxonVaultAbi = [
|
|
|
2123
2417
|
"name": "NotAuthorizedRelayer",
|
|
2124
2418
|
"inputs": []
|
|
2125
2419
|
},
|
|
2420
|
+
{
|
|
2421
|
+
"type": "error",
|
|
2422
|
+
"name": "NotInitializing",
|
|
2423
|
+
"inputs": []
|
|
2424
|
+
},
|
|
2126
2425
|
{
|
|
2127
2426
|
"type": "error",
|
|
2128
2427
|
"name": "OperatorBotLimitReached",
|
|
@@ -2221,17 +2520,6 @@ var AxonVaultAbi = [
|
|
|
2221
2520
|
"name": "SelfPayment",
|
|
2222
2521
|
"inputs": []
|
|
2223
2522
|
},
|
|
2224
|
-
{
|
|
2225
|
-
"type": "error",
|
|
2226
|
-
"name": "StringTooLong",
|
|
2227
|
-
"inputs": [
|
|
2228
|
-
{
|
|
2229
|
-
"name": "str",
|
|
2230
|
-
"type": "string",
|
|
2231
|
-
"internalType": "string"
|
|
2232
|
-
}
|
|
2233
|
-
]
|
|
2234
|
-
},
|
|
2235
2523
|
{
|
|
2236
2524
|
"type": "error",
|
|
2237
2525
|
"name": "SwapFailed",
|
|
@@ -2334,6 +2622,19 @@ var AxonVaultFactoryAbi = [
|
|
|
2334
2622
|
],
|
|
2335
2623
|
"stateMutability": "nonpayable"
|
|
2336
2624
|
},
|
|
2625
|
+
{
|
|
2626
|
+
"type": "function",
|
|
2627
|
+
"name": "implementation",
|
|
2628
|
+
"inputs": [],
|
|
2629
|
+
"outputs": [
|
|
2630
|
+
{
|
|
2631
|
+
"name": "",
|
|
2632
|
+
"type": "address",
|
|
2633
|
+
"internalType": "address"
|
|
2634
|
+
}
|
|
2635
|
+
],
|
|
2636
|
+
"stateMutability": "view"
|
|
2637
|
+
},
|
|
2337
2638
|
{
|
|
2338
2639
|
"type": "function",
|
|
2339
2640
|
"name": "owner",
|
|
@@ -2403,12 +2704,36 @@ var AxonVaultFactoryAbi = [
|
|
|
2403
2704
|
],
|
|
2404
2705
|
"stateMutability": "view"
|
|
2405
2706
|
},
|
|
2707
|
+
{
|
|
2708
|
+
"type": "function",
|
|
2709
|
+
"name": "predictVaultAddress",
|
|
2710
|
+
"inputs": [
|
|
2711
|
+
{
|
|
2712
|
+
"name": "owner",
|
|
2713
|
+
"type": "address",
|
|
2714
|
+
"internalType": "address"
|
|
2715
|
+
},
|
|
2716
|
+
{
|
|
2717
|
+
"name": "nonce",
|
|
2718
|
+
"type": "uint256",
|
|
2719
|
+
"internalType": "uint256"
|
|
2720
|
+
}
|
|
2721
|
+
],
|
|
2722
|
+
"outputs": [
|
|
2723
|
+
{
|
|
2724
|
+
"name": "",
|
|
2725
|
+
"type": "address",
|
|
2726
|
+
"internalType": "address"
|
|
2727
|
+
}
|
|
2728
|
+
],
|
|
2729
|
+
"stateMutability": "view"
|
|
2730
|
+
},
|
|
2406
2731
|
{
|
|
2407
2732
|
"type": "function",
|
|
2408
2733
|
"name": "renounceOwnership",
|
|
2409
2734
|
"inputs": [],
|
|
2410
2735
|
"outputs": [],
|
|
2411
|
-
"stateMutability": "
|
|
2736
|
+
"stateMutability": "pure"
|
|
2412
2737
|
},
|
|
2413
2738
|
{
|
|
2414
2739
|
"type": "function",
|
|
@@ -2505,6 +2830,27 @@ var AxonVaultFactoryAbi = [
|
|
|
2505
2830
|
],
|
|
2506
2831
|
"anonymous": false
|
|
2507
2832
|
},
|
|
2833
|
+
{
|
|
2834
|
+
"type": "error",
|
|
2835
|
+
"name": "FailedDeployment",
|
|
2836
|
+
"inputs": []
|
|
2837
|
+
},
|
|
2838
|
+
{
|
|
2839
|
+
"type": "error",
|
|
2840
|
+
"name": "InsufficientBalance",
|
|
2841
|
+
"inputs": [
|
|
2842
|
+
{
|
|
2843
|
+
"name": "balance",
|
|
2844
|
+
"type": "uint256",
|
|
2845
|
+
"internalType": "uint256"
|
|
2846
|
+
},
|
|
2847
|
+
{
|
|
2848
|
+
"name": "needed",
|
|
2849
|
+
"type": "uint256",
|
|
2850
|
+
"internalType": "uint256"
|
|
2851
|
+
}
|
|
2852
|
+
]
|
|
2853
|
+
},
|
|
2508
2854
|
{
|
|
2509
2855
|
"type": "error",
|
|
2510
2856
|
"name": "OwnableInvalidOwner",
|
|
@@ -3048,6 +3394,16 @@ async function deployVault(walletClient, publicClient, relayerUrl) {
|
|
|
3048
3394
|
}
|
|
3049
3395
|
throw new Error("VaultDeployed event not found in transaction receipt");
|
|
3050
3396
|
}
|
|
3397
|
+
async function predictVaultAddress(publicClient, owner, nonce, relayerUrl) {
|
|
3398
|
+
const chainId = await publicClient.getChainId();
|
|
3399
|
+
const factoryAddress = await getFactoryAddress(chainId, relayerUrl);
|
|
3400
|
+
return publicClient.readContract({
|
|
3401
|
+
address: factoryAddress,
|
|
3402
|
+
abi: AxonVaultFactoryAbi,
|
|
3403
|
+
functionName: "predictVaultAddress",
|
|
3404
|
+
args: [owner, BigInt(nonce)]
|
|
3405
|
+
});
|
|
3406
|
+
}
|
|
3051
3407
|
async function addBot(walletClient, publicClient, vaultAddress, botAddress, config) {
|
|
3052
3408
|
if (!walletClient.account) {
|
|
3053
3409
|
throw new Error("walletClient has no account attached");
|
|
@@ -3345,6 +3701,19 @@ async function signPermit2WitnessTransfer(privateKey, chainId, permit) {
|
|
|
3345
3701
|
}
|
|
3346
3702
|
|
|
3347
3703
|
// src/client.ts
|
|
3704
|
+
var BURN_ADDRESSES = /* @__PURE__ */ new Set([
|
|
3705
|
+
"0x0000000000000000000000000000000000000000",
|
|
3706
|
+
"0x0000000000000000000000000000000000000001",
|
|
3707
|
+
"0x000000000000000000000000000000000000dead",
|
|
3708
|
+
"0xdead000000000000000000000000000000000000",
|
|
3709
|
+
"0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000",
|
|
3710
|
+
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
|
|
3711
|
+
]);
|
|
3712
|
+
function _rejectBurnAddress(address, label) {
|
|
3713
|
+
if (BURN_ADDRESSES.has(address.toLowerCase())) {
|
|
3714
|
+
throw new Error(`${label} cannot be a burn/dead address (${address})`);
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3348
3717
|
var AxonClient = class {
|
|
3349
3718
|
constructor(config) {
|
|
3350
3719
|
// ============================================================================
|
|
@@ -3772,9 +4141,7 @@ Timestamp: ${timestamp}`;
|
|
|
3772
4141
|
return "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
3773
4142
|
}
|
|
3774
4143
|
_buildPaymentIntent(input) {
|
|
3775
|
-
|
|
3776
|
-
throw new Error("Payment recipient cannot be the zero address");
|
|
3777
|
-
}
|
|
4144
|
+
_rejectBurnAddress(input.to, "Payment recipient");
|
|
3778
4145
|
return {
|
|
3779
4146
|
bot: this.botAddress,
|
|
3780
4147
|
to: input.to,
|
|
@@ -3785,12 +4152,14 @@ Timestamp: ${timestamp}`;
|
|
|
3785
4152
|
};
|
|
3786
4153
|
}
|
|
3787
4154
|
_buildExecuteIntent(input) {
|
|
4155
|
+
_rejectBurnAddress(input.protocol, "Protocol address");
|
|
3788
4156
|
return {
|
|
3789
4157
|
bot: this.botAddress,
|
|
3790
4158
|
protocol: input.protocol,
|
|
3791
4159
|
calldataHash: viem.keccak256(input.callData),
|
|
3792
4160
|
token: resolveToken(input.token, this.chainId),
|
|
3793
4161
|
amount: parseAmount(input.amount, input.token, this.chainId),
|
|
4162
|
+
value: input.value ?? 0n,
|
|
3794
4163
|
deadline: input.deadline ?? this._defaultDeadline(),
|
|
3795
4164
|
ref: this._resolveRef(input.memo, input.ref)
|
|
3796
4165
|
};
|
|
@@ -3843,6 +4212,7 @@ Timestamp: ${timestamp}`;
|
|
|
3843
4212
|
calldataHash: intent.calldataHash,
|
|
3844
4213
|
token: intent.token,
|
|
3845
4214
|
amount: intent.amount.toString(),
|
|
4215
|
+
value: intent.value.toString(),
|
|
3846
4216
|
deadline: intent.deadline.toString(),
|
|
3847
4217
|
ref: intent.ref,
|
|
3848
4218
|
signature,
|
|
@@ -4075,6 +4445,38 @@ var AxonRegistryAbi = [
|
|
|
4075
4445
|
"outputs": [],
|
|
4076
4446
|
"stateMutability": "nonpayable"
|
|
4077
4447
|
},
|
|
4448
|
+
{
|
|
4449
|
+
"type": "function",
|
|
4450
|
+
"name": "approveProtocol",
|
|
4451
|
+
"inputs": [
|
|
4452
|
+
{
|
|
4453
|
+
"name": "protocol",
|
|
4454
|
+
"type": "address",
|
|
4455
|
+
"internalType": "address"
|
|
4456
|
+
}
|
|
4457
|
+
],
|
|
4458
|
+
"outputs": [],
|
|
4459
|
+
"stateMutability": "nonpayable"
|
|
4460
|
+
},
|
|
4461
|
+
{
|
|
4462
|
+
"type": "function",
|
|
4463
|
+
"name": "isApprovedProtocol",
|
|
4464
|
+
"inputs": [
|
|
4465
|
+
{
|
|
4466
|
+
"name": "protocol",
|
|
4467
|
+
"type": "address",
|
|
4468
|
+
"internalType": "address"
|
|
4469
|
+
}
|
|
4470
|
+
],
|
|
4471
|
+
"outputs": [
|
|
4472
|
+
{
|
|
4473
|
+
"name": "",
|
|
4474
|
+
"type": "bool",
|
|
4475
|
+
"internalType": "bool"
|
|
4476
|
+
}
|
|
4477
|
+
],
|
|
4478
|
+
"stateMutability": "view"
|
|
4479
|
+
},
|
|
4078
4480
|
{
|
|
4079
4481
|
"type": "function",
|
|
4080
4482
|
"name": "isApprovedSwapRouter",
|
|
@@ -4189,7 +4591,7 @@ var AxonRegistryAbi = [
|
|
|
4189
4591
|
"name": "renounceOwnership",
|
|
4190
4592
|
"inputs": [],
|
|
4191
4593
|
"outputs": [],
|
|
4192
|
-
"stateMutability": "
|
|
4594
|
+
"stateMutability": "pure"
|
|
4193
4595
|
},
|
|
4194
4596
|
{
|
|
4195
4597
|
"type": "function",
|
|
@@ -4204,6 +4606,19 @@ var AxonRegistryAbi = [
|
|
|
4204
4606
|
"outputs": [],
|
|
4205
4607
|
"stateMutability": "nonpayable"
|
|
4206
4608
|
},
|
|
4609
|
+
{
|
|
4610
|
+
"type": "function",
|
|
4611
|
+
"name": "revokeProtocol",
|
|
4612
|
+
"inputs": [
|
|
4613
|
+
{
|
|
4614
|
+
"name": "protocol",
|
|
4615
|
+
"type": "address",
|
|
4616
|
+
"internalType": "address"
|
|
4617
|
+
}
|
|
4618
|
+
],
|
|
4619
|
+
"outputs": [],
|
|
4620
|
+
"stateMutability": "nonpayable"
|
|
4621
|
+
},
|
|
4207
4622
|
{
|
|
4208
4623
|
"type": "function",
|
|
4209
4624
|
"name": "setOracleConfig",
|
|
@@ -4368,6 +4783,32 @@ var AxonRegistryAbi = [
|
|
|
4368
4783
|
],
|
|
4369
4784
|
"anonymous": false
|
|
4370
4785
|
},
|
|
4786
|
+
{
|
|
4787
|
+
"type": "event",
|
|
4788
|
+
"name": "ProtocolApproved",
|
|
4789
|
+
"inputs": [
|
|
4790
|
+
{
|
|
4791
|
+
"name": "protocol",
|
|
4792
|
+
"type": "address",
|
|
4793
|
+
"indexed": true,
|
|
4794
|
+
"internalType": "address"
|
|
4795
|
+
}
|
|
4796
|
+
],
|
|
4797
|
+
"anonymous": false
|
|
4798
|
+
},
|
|
4799
|
+
{
|
|
4800
|
+
"type": "event",
|
|
4801
|
+
"name": "ProtocolRevoked",
|
|
4802
|
+
"inputs": [
|
|
4803
|
+
{
|
|
4804
|
+
"name": "protocol",
|
|
4805
|
+
"type": "address",
|
|
4806
|
+
"indexed": true,
|
|
4807
|
+
"internalType": "address"
|
|
4808
|
+
}
|
|
4809
|
+
],
|
|
4810
|
+
"anonymous": false
|
|
4811
|
+
},
|
|
4371
4812
|
{
|
|
4372
4813
|
"type": "event",
|
|
4373
4814
|
"name": "RelayerAdded",
|
|
@@ -4526,6 +4967,7 @@ exports.operatorMaxDrainPerDay = operatorMaxDrainPerDay;
|
|
|
4526
4967
|
exports.parseAmount = parseAmount;
|
|
4527
4968
|
exports.parseChainId = parseChainId;
|
|
4528
4969
|
exports.parsePaymentRequired = parsePaymentRequired;
|
|
4970
|
+
exports.predictVaultAddress = predictVaultAddress;
|
|
4529
4971
|
exports.randomNonce = randomNonce;
|
|
4530
4972
|
exports.randomPermit2Nonce = randomPermit2Nonce;
|
|
4531
4973
|
exports.removeBot = removeBot;
|