killswitch-wallet-mcp 0.1.1 → 0.2.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/README.md +22 -22
- package/dist/server.mjs +1788 -132
- package/package.json +1 -1
package/dist/server.mjs
CHANGED
|
@@ -110,7 +110,7 @@ var require_code = __commonJS({
|
|
|
110
110
|
}
|
|
111
111
|
exports._ = _;
|
|
112
112
|
var plus = new _Code("+");
|
|
113
|
-
function
|
|
113
|
+
function str2(strs, ...args) {
|
|
114
114
|
const expr = [safeStringify(strs[0])];
|
|
115
115
|
let i = 0;
|
|
116
116
|
while (i < args.length) {
|
|
@@ -121,7 +121,7 @@ var require_code = __commonJS({
|
|
|
121
121
|
optimize(expr);
|
|
122
122
|
return new _Code(expr);
|
|
123
123
|
}
|
|
124
|
-
exports.str =
|
|
124
|
+
exports.str = str2;
|
|
125
125
|
function addCodeArg(code, arg) {
|
|
126
126
|
if (arg instanceof _Code)
|
|
127
127
|
code.push(...arg._items);
|
|
@@ -164,7 +164,7 @@ var require_code = __commonJS({
|
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
function strConcat(c1, c2) {
|
|
167
|
-
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 :
|
|
167
|
+
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str2`${c1}${c2}`;
|
|
168
168
|
}
|
|
169
169
|
exports.strConcat = strConcat;
|
|
170
170
|
function interpolate(x) {
|
|
@@ -1126,22 +1126,22 @@ var require_util = __commonJS({
|
|
|
1126
1126
|
return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
|
|
1127
1127
|
}
|
|
1128
1128
|
exports.schemaRefOrVal = schemaRefOrVal;
|
|
1129
|
-
function unescapeFragment(
|
|
1130
|
-
return unescapeJsonPointer(decodeURIComponent(
|
|
1129
|
+
function unescapeFragment(str2) {
|
|
1130
|
+
return unescapeJsonPointer(decodeURIComponent(str2));
|
|
1131
1131
|
}
|
|
1132
1132
|
exports.unescapeFragment = unescapeFragment;
|
|
1133
|
-
function escapeFragment(
|
|
1134
|
-
return encodeURIComponent(escapeJsonPointer(
|
|
1133
|
+
function escapeFragment(str2) {
|
|
1134
|
+
return encodeURIComponent(escapeJsonPointer(str2));
|
|
1135
1135
|
}
|
|
1136
1136
|
exports.escapeFragment = escapeFragment;
|
|
1137
|
-
function escapeJsonPointer(
|
|
1138
|
-
if (typeof
|
|
1139
|
-
return `${
|
|
1140
|
-
return
|
|
1137
|
+
function escapeJsonPointer(str2) {
|
|
1138
|
+
if (typeof str2 == "number")
|
|
1139
|
+
return `${str2}`;
|
|
1140
|
+
return str2.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
1141
1141
|
}
|
|
1142
1142
|
exports.escapeJsonPointer = escapeJsonPointer;
|
|
1143
|
-
function unescapeJsonPointer(
|
|
1144
|
-
return
|
|
1143
|
+
function unescapeJsonPointer(str2) {
|
|
1144
|
+
return str2.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1145
1145
|
}
|
|
1146
1146
|
exports.unescapeJsonPointer = unescapeJsonPointer;
|
|
1147
1147
|
function eachItem(xs, f) {
|
|
@@ -2166,8 +2166,8 @@ var require_json_schema_traverse = __commonJS({
|
|
|
2166
2166
|
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
2167
2167
|
}
|
|
2168
2168
|
}
|
|
2169
|
-
function escapeJsonPtr(
|
|
2170
|
-
return
|
|
2169
|
+
function escapeJsonPtr(str2) {
|
|
2170
|
+
return str2.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2171
2171
|
}
|
|
2172
2172
|
}
|
|
2173
2173
|
});
|
|
@@ -3264,10 +3264,10 @@ var require_utils = __commonJS({
|
|
|
3264
3264
|
isIPV6: true
|
|
3265
3265
|
};
|
|
3266
3266
|
}
|
|
3267
|
-
function findToken(
|
|
3267
|
+
function findToken(str2, token) {
|
|
3268
3268
|
let ind = 0;
|
|
3269
|
-
for (let i = 0; i <
|
|
3270
|
-
if (
|
|
3269
|
+
for (let i = 0; i < str2.length; i++) {
|
|
3270
|
+
if (str2[i] === token) ind++;
|
|
3271
3271
|
}
|
|
3272
3272
|
return ind;
|
|
3273
3273
|
}
|
|
@@ -4337,7 +4337,7 @@ var require_core = __commonJS({
|
|
|
4337
4337
|
var util_1 = require_util();
|
|
4338
4338
|
var $dataRefSchema = require_data();
|
|
4339
4339
|
var uri_1 = require_uri();
|
|
4340
|
-
var defaultRegExp = (
|
|
4340
|
+
var defaultRegExp = (str2, flags) => new RegExp(str2, flags);
|
|
4341
4341
|
defaultRegExp.code = "new RegExp";
|
|
4342
4342
|
var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
|
|
4343
4343
|
var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
|
|
@@ -5132,16 +5132,16 @@ var require_ucs2length = __commonJS({
|
|
|
5132
5132
|
"node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
|
|
5133
5133
|
"use strict";
|
|
5134
5134
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5135
|
-
function ucs2length(
|
|
5136
|
-
const len =
|
|
5135
|
+
function ucs2length(str2) {
|
|
5136
|
+
const len = str2.length;
|
|
5137
5137
|
let length = 0;
|
|
5138
5138
|
let pos = 0;
|
|
5139
5139
|
let value;
|
|
5140
5140
|
while (pos < len) {
|
|
5141
5141
|
length++;
|
|
5142
|
-
value =
|
|
5142
|
+
value = str2.charCodeAt(pos++);
|
|
5143
5143
|
if (value >= 55296 && value <= 56319 && pos < len) {
|
|
5144
|
-
value =
|
|
5144
|
+
value = str2.charCodeAt(pos);
|
|
5145
5145
|
if ((value & 64512) === 56320)
|
|
5146
5146
|
pos++;
|
|
5147
5147
|
}
|
|
@@ -7024,8 +7024,8 @@ var require_formats = __commonJS({
|
|
|
7024
7024
|
}
|
|
7025
7025
|
var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
7026
7026
|
var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
7027
|
-
function date5(
|
|
7028
|
-
const matches = DATE.exec(
|
|
7027
|
+
function date5(str2) {
|
|
7028
|
+
const matches = DATE.exec(str2);
|
|
7029
7029
|
if (!matches)
|
|
7030
7030
|
return false;
|
|
7031
7031
|
const year = +matches[1];
|
|
@@ -7044,8 +7044,8 @@ var require_formats = __commonJS({
|
|
|
7044
7044
|
}
|
|
7045
7045
|
var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
7046
7046
|
function getTime(strictTimeZone) {
|
|
7047
|
-
return function time3(
|
|
7048
|
-
const matches = TIME.exec(
|
|
7047
|
+
return function time3(str2) {
|
|
7048
|
+
const matches = TIME.exec(str2);
|
|
7049
7049
|
if (!matches)
|
|
7050
7050
|
return false;
|
|
7051
7051
|
const hr = +matches[1];
|
|
@@ -7091,8 +7091,8 @@ var require_formats = __commonJS({
|
|
|
7091
7091
|
var DATE_TIME_SEPARATOR = /t|\s/i;
|
|
7092
7092
|
function getDateTime(strictTimeZone) {
|
|
7093
7093
|
const time3 = getTime(strictTimeZone);
|
|
7094
|
-
return function date_time(
|
|
7095
|
-
const dateTime =
|
|
7094
|
+
return function date_time(str2) {
|
|
7095
|
+
const dateTime = str2.split(DATE_TIME_SEPARATOR);
|
|
7096
7096
|
return dateTime.length === 2 && date5(dateTime[0]) && time3(dateTime[1]);
|
|
7097
7097
|
};
|
|
7098
7098
|
}
|
|
@@ -7117,13 +7117,13 @@ var require_formats = __commonJS({
|
|
|
7117
7117
|
}
|
|
7118
7118
|
var NOT_URI_FRAGMENT = /\/|:/;
|
|
7119
7119
|
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
7120
|
-
function uri(
|
|
7121
|
-
return NOT_URI_FRAGMENT.test(
|
|
7120
|
+
function uri(str2) {
|
|
7121
|
+
return NOT_URI_FRAGMENT.test(str2) && URI.test(str2);
|
|
7122
7122
|
}
|
|
7123
7123
|
var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
7124
|
-
function byte(
|
|
7124
|
+
function byte(str2) {
|
|
7125
7125
|
BYTE.lastIndex = 0;
|
|
7126
|
-
return BYTE.test(
|
|
7126
|
+
return BYTE.test(str2);
|
|
7127
7127
|
}
|
|
7128
7128
|
var MIN_INT32 = -(2 ** 31);
|
|
7129
7129
|
var MAX_INT32 = 2 ** 31 - 1;
|
|
@@ -7137,11 +7137,11 @@ var require_formats = __commonJS({
|
|
|
7137
7137
|
return true;
|
|
7138
7138
|
}
|
|
7139
7139
|
var Z_ANCHOR = /[^\\]\\Z/;
|
|
7140
|
-
function regex(
|
|
7141
|
-
if (Z_ANCHOR.test(
|
|
7140
|
+
function regex(str2) {
|
|
7141
|
+
if (Z_ANCHOR.test(str2))
|
|
7142
7142
|
return false;
|
|
7143
7143
|
try {
|
|
7144
|
-
new RegExp(
|
|
7144
|
+
new RegExp(str2);
|
|
7145
7145
|
return true;
|
|
7146
7146
|
} catch (e) {
|
|
7147
7147
|
return false;
|
|
@@ -9137,10 +9137,10 @@ function byteSwap32(arr) {
|
|
|
9137
9137
|
}
|
|
9138
9138
|
return arr;
|
|
9139
9139
|
}
|
|
9140
|
-
function utf8ToBytes(
|
|
9141
|
-
if (typeof
|
|
9140
|
+
function utf8ToBytes(str2) {
|
|
9141
|
+
if (typeof str2 !== "string")
|
|
9142
9142
|
throw new Error("string expected");
|
|
9143
|
-
return new Uint8Array(new TextEncoder().encode(
|
|
9143
|
+
return new Uint8Array(new TextEncoder().encode(str2));
|
|
9144
9144
|
}
|
|
9145
9145
|
function toBytes2(data) {
|
|
9146
9146
|
if (typeof data === "string")
|
|
@@ -12514,10 +12514,10 @@ function concatBytes3(...arrays) {
|
|
|
12514
12514
|
}
|
|
12515
12515
|
return res;
|
|
12516
12516
|
}
|
|
12517
|
-
function utf8ToBytes2(
|
|
12518
|
-
if (typeof
|
|
12517
|
+
function utf8ToBytes2(str2) {
|
|
12518
|
+
if (typeof str2 !== "string")
|
|
12519
12519
|
throw new Error("string expected");
|
|
12520
|
-
return new Uint8Array(new TextEncoder().encode(
|
|
12520
|
+
return new Uint8Array(new TextEncoder().encode(str2));
|
|
12521
12521
|
}
|
|
12522
12522
|
function inRange(n, min, max) {
|
|
12523
12523
|
return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;
|
|
@@ -22054,14 +22054,14 @@ function promiseAllObject(promisesObj) {
|
|
|
22054
22054
|
}
|
|
22055
22055
|
function randomString(length = 10) {
|
|
22056
22056
|
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
22057
|
-
let
|
|
22057
|
+
let str2 = "";
|
|
22058
22058
|
for (let i = 0; i < length; i++) {
|
|
22059
|
-
|
|
22059
|
+
str2 += chars[Math.floor(Math.random() * chars.length)];
|
|
22060
22060
|
}
|
|
22061
|
-
return
|
|
22061
|
+
return str2;
|
|
22062
22062
|
}
|
|
22063
|
-
function esc(
|
|
22064
|
-
return JSON.stringify(
|
|
22063
|
+
function esc(str2) {
|
|
22064
|
+
return JSON.stringify(str2);
|
|
22065
22065
|
}
|
|
22066
22066
|
function slugify(input2) {
|
|
22067
22067
|
return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -22175,8 +22175,8 @@ var primitiveTypes = /* @__PURE__ */ new Set([
|
|
|
22175
22175
|
"symbol",
|
|
22176
22176
|
"undefined"
|
|
22177
22177
|
]);
|
|
22178
|
-
function escapeRegex(
|
|
22179
|
-
return
|
|
22178
|
+
function escapeRegex(str2) {
|
|
22179
|
+
return str2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
22180
22180
|
}
|
|
22181
22181
|
function clone(inst, def, params) {
|
|
22182
22182
|
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
@@ -22442,13 +22442,13 @@ function getSizableOrigin(input2) {
|
|
|
22442
22442
|
return "unknown";
|
|
22443
22443
|
}
|
|
22444
22444
|
var highSurrogate = /[\uD800-\uDBFF]/;
|
|
22445
|
-
function codePointLength(
|
|
22446
|
-
const units =
|
|
22447
|
-
if (!highSurrogate.test(
|
|
22445
|
+
function codePointLength(str2) {
|
|
22446
|
+
const units = str2.length;
|
|
22447
|
+
if (!highSurrogate.test(str2))
|
|
22448
22448
|
return units;
|
|
22449
22449
|
let count = units;
|
|
22450
22450
|
for (let i = 0; i < units - 1; i++) {
|
|
22451
|
-
if ((
|
|
22451
|
+
if ((str2.charCodeAt(i) & 64512) === 55296 && (str2.charCodeAt(i + 1) & 64512) === 56320) {
|
|
22452
22452
|
count--;
|
|
22453
22453
|
i++;
|
|
22454
22454
|
}
|
|
@@ -51277,11 +51277,11 @@ function getHttpError(error62) {
|
|
|
51277
51277
|
return void 0;
|
|
51278
51278
|
return error62.walk((err) => err instanceof HttpRequestError || err instanceof RpcRequestError);
|
|
51279
51279
|
}
|
|
51280
|
-
function hashString(
|
|
51280
|
+
function hashString(str2, seed = 0) {
|
|
51281
51281
|
let h1 = 3735928559 ^ seed;
|
|
51282
51282
|
let h2 = 1103547991 ^ seed;
|
|
51283
|
-
for (let i = 0; i <
|
|
51284
|
-
const ch =
|
|
51283
|
+
for (let i = 0; i < str2.length; i++) {
|
|
51284
|
+
const ch = str2.charCodeAt(i);
|
|
51285
51285
|
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
51286
51286
|
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
51287
51287
|
}
|
|
@@ -56291,6 +56291,7 @@ function http(url2, config2 = {}) {
|
|
|
56291
56291
|
init_encodeAbiParameters();
|
|
56292
56292
|
init_encodeFunctionData();
|
|
56293
56293
|
init_isAddress();
|
|
56294
|
+
init_toHex();
|
|
56294
56295
|
init_keccak256();
|
|
56295
56296
|
|
|
56296
56297
|
// node_modules/viem/_esm/accounts/privateKeyToAccount.js
|
|
@@ -56433,6 +56434,1215 @@ function privateKeyToAccount(privateKey, options = {}) {
|
|
|
56433
56434
|
}
|
|
56434
56435
|
|
|
56435
56436
|
// shared/abi.ts
|
|
56437
|
+
var KillswitchAccountAbi = [
|
|
56438
|
+
{
|
|
56439
|
+
"type": "constructor",
|
|
56440
|
+
"inputs": [
|
|
56441
|
+
{
|
|
56442
|
+
"name": "owner_",
|
|
56443
|
+
"type": "address",
|
|
56444
|
+
"internalType": "address"
|
|
56445
|
+
},
|
|
56446
|
+
{
|
|
56447
|
+
"name": "guardian_",
|
|
56448
|
+
"type": "address",
|
|
56449
|
+
"internalType": "address"
|
|
56450
|
+
}
|
|
56451
|
+
],
|
|
56452
|
+
"stateMutability": "nonpayable"
|
|
56453
|
+
},
|
|
56454
|
+
{
|
|
56455
|
+
"type": "receive",
|
|
56456
|
+
"stateMutability": "payable"
|
|
56457
|
+
},
|
|
56458
|
+
{
|
|
56459
|
+
"type": "function",
|
|
56460
|
+
"name": "MAX_AUTHORIZATION_TTL",
|
|
56461
|
+
"inputs": [],
|
|
56462
|
+
"outputs": [
|
|
56463
|
+
{
|
|
56464
|
+
"name": "",
|
|
56465
|
+
"type": "uint256",
|
|
56466
|
+
"internalType": "uint256"
|
|
56467
|
+
}
|
|
56468
|
+
],
|
|
56469
|
+
"stateMutability": "view"
|
|
56470
|
+
},
|
|
56471
|
+
{
|
|
56472
|
+
"type": "function",
|
|
56473
|
+
"name": "MAX_LIMITS",
|
|
56474
|
+
"inputs": [],
|
|
56475
|
+
"outputs": [
|
|
56476
|
+
{
|
|
56477
|
+
"name": "",
|
|
56478
|
+
"type": "uint256",
|
|
56479
|
+
"internalType": "uint256"
|
|
56480
|
+
}
|
|
56481
|
+
],
|
|
56482
|
+
"stateMutability": "view"
|
|
56483
|
+
},
|
|
56484
|
+
{
|
|
56485
|
+
"type": "function",
|
|
56486
|
+
"name": "MAX_RULES",
|
|
56487
|
+
"inputs": [],
|
|
56488
|
+
"outputs": [
|
|
56489
|
+
{
|
|
56490
|
+
"name": "",
|
|
56491
|
+
"type": "uint256",
|
|
56492
|
+
"internalType": "uint256"
|
|
56493
|
+
}
|
|
56494
|
+
],
|
|
56495
|
+
"stateMutability": "view"
|
|
56496
|
+
},
|
|
56497
|
+
{
|
|
56498
|
+
"type": "function",
|
|
56499
|
+
"name": "OP_TYPEHASH",
|
|
56500
|
+
"inputs": [],
|
|
56501
|
+
"outputs": [
|
|
56502
|
+
{
|
|
56503
|
+
"name": "",
|
|
56504
|
+
"type": "bytes32",
|
|
56505
|
+
"internalType": "bytes32"
|
|
56506
|
+
}
|
|
56507
|
+
],
|
|
56508
|
+
"stateMutability": "view"
|
|
56509
|
+
},
|
|
56510
|
+
{
|
|
56511
|
+
"type": "function",
|
|
56512
|
+
"name": "agentIds",
|
|
56513
|
+
"inputs": [],
|
|
56514
|
+
"outputs": [
|
|
56515
|
+
{
|
|
56516
|
+
"name": "",
|
|
56517
|
+
"type": "bytes32[]",
|
|
56518
|
+
"internalType": "bytes32[]"
|
|
56519
|
+
}
|
|
56520
|
+
],
|
|
56521
|
+
"stateMutability": "view"
|
|
56522
|
+
},
|
|
56523
|
+
{
|
|
56524
|
+
"type": "function",
|
|
56525
|
+
"name": "authorizationDigest",
|
|
56526
|
+
"inputs": [
|
|
56527
|
+
{
|
|
56528
|
+
"name": "token",
|
|
56529
|
+
"type": "address",
|
|
56530
|
+
"internalType": "address"
|
|
56531
|
+
},
|
|
56532
|
+
{
|
|
56533
|
+
"name": "to",
|
|
56534
|
+
"type": "address",
|
|
56535
|
+
"internalType": "address"
|
|
56536
|
+
},
|
|
56537
|
+
{
|
|
56538
|
+
"name": "value",
|
|
56539
|
+
"type": "uint256",
|
|
56540
|
+
"internalType": "uint256"
|
|
56541
|
+
},
|
|
56542
|
+
{
|
|
56543
|
+
"name": "validAfter",
|
|
56544
|
+
"type": "uint256",
|
|
56545
|
+
"internalType": "uint256"
|
|
56546
|
+
},
|
|
56547
|
+
{
|
|
56548
|
+
"name": "validBefore",
|
|
56549
|
+
"type": "uint256",
|
|
56550
|
+
"internalType": "uint256"
|
|
56551
|
+
},
|
|
56552
|
+
{
|
|
56553
|
+
"name": "nonce",
|
|
56554
|
+
"type": "bytes32",
|
|
56555
|
+
"internalType": "bytes32"
|
|
56556
|
+
}
|
|
56557
|
+
],
|
|
56558
|
+
"outputs": [
|
|
56559
|
+
{
|
|
56560
|
+
"name": "",
|
|
56561
|
+
"type": "bytes32",
|
|
56562
|
+
"internalType": "bytes32"
|
|
56563
|
+
}
|
|
56564
|
+
],
|
|
56565
|
+
"stateMutability": "view"
|
|
56566
|
+
},
|
|
56567
|
+
{
|
|
56568
|
+
"type": "function",
|
|
56569
|
+
"name": "authorizeTransfer",
|
|
56570
|
+
"inputs": [
|
|
56571
|
+
{
|
|
56572
|
+
"name": "",
|
|
56573
|
+
"type": "address",
|
|
56574
|
+
"internalType": "address"
|
|
56575
|
+
},
|
|
56576
|
+
{
|
|
56577
|
+
"name": "",
|
|
56578
|
+
"type": "address",
|
|
56579
|
+
"internalType": "address"
|
|
56580
|
+
},
|
|
56581
|
+
{
|
|
56582
|
+
"name": "",
|
|
56583
|
+
"type": "uint256",
|
|
56584
|
+
"internalType": "uint256"
|
|
56585
|
+
},
|
|
56586
|
+
{
|
|
56587
|
+
"name": "",
|
|
56588
|
+
"type": "uint256",
|
|
56589
|
+
"internalType": "uint256"
|
|
56590
|
+
},
|
|
56591
|
+
{
|
|
56592
|
+
"name": "",
|
|
56593
|
+
"type": "uint256",
|
|
56594
|
+
"internalType": "uint256"
|
|
56595
|
+
},
|
|
56596
|
+
{
|
|
56597
|
+
"name": "",
|
|
56598
|
+
"type": "bytes32",
|
|
56599
|
+
"internalType": "bytes32"
|
|
56600
|
+
}
|
|
56601
|
+
],
|
|
56602
|
+
"outputs": [],
|
|
56603
|
+
"stateMutability": "pure"
|
|
56604
|
+
},
|
|
56605
|
+
{
|
|
56606
|
+
"type": "function",
|
|
56607
|
+
"name": "eip712Domain",
|
|
56608
|
+
"inputs": [],
|
|
56609
|
+
"outputs": [
|
|
56610
|
+
{
|
|
56611
|
+
"name": "fields",
|
|
56612
|
+
"type": "bytes1",
|
|
56613
|
+
"internalType": "bytes1"
|
|
56614
|
+
},
|
|
56615
|
+
{
|
|
56616
|
+
"name": "name",
|
|
56617
|
+
"type": "string",
|
|
56618
|
+
"internalType": "string"
|
|
56619
|
+
},
|
|
56620
|
+
{
|
|
56621
|
+
"name": "version",
|
|
56622
|
+
"type": "string",
|
|
56623
|
+
"internalType": "string"
|
|
56624
|
+
},
|
|
56625
|
+
{
|
|
56626
|
+
"name": "chainId",
|
|
56627
|
+
"type": "uint256",
|
|
56628
|
+
"internalType": "uint256"
|
|
56629
|
+
},
|
|
56630
|
+
{
|
|
56631
|
+
"name": "verifyingContract",
|
|
56632
|
+
"type": "address",
|
|
56633
|
+
"internalType": "address"
|
|
56634
|
+
},
|
|
56635
|
+
{
|
|
56636
|
+
"name": "salt",
|
|
56637
|
+
"type": "bytes32",
|
|
56638
|
+
"internalType": "bytes32"
|
|
56639
|
+
},
|
|
56640
|
+
{
|
|
56641
|
+
"name": "extensions",
|
|
56642
|
+
"type": "uint256[]",
|
|
56643
|
+
"internalType": "uint256[]"
|
|
56644
|
+
}
|
|
56645
|
+
],
|
|
56646
|
+
"stateMutability": "view"
|
|
56647
|
+
},
|
|
56648
|
+
{
|
|
56649
|
+
"type": "function",
|
|
56650
|
+
"name": "epoch",
|
|
56651
|
+
"inputs": [],
|
|
56652
|
+
"outputs": [
|
|
56653
|
+
{
|
|
56654
|
+
"name": "",
|
|
56655
|
+
"type": "uint64",
|
|
56656
|
+
"internalType": "uint64"
|
|
56657
|
+
}
|
|
56658
|
+
],
|
|
56659
|
+
"stateMutability": "view"
|
|
56660
|
+
},
|
|
56661
|
+
{
|
|
56662
|
+
"type": "function",
|
|
56663
|
+
"name": "execute",
|
|
56664
|
+
"inputs": [
|
|
56665
|
+
{
|
|
56666
|
+
"name": "calls",
|
|
56667
|
+
"type": "tuple[]",
|
|
56668
|
+
"internalType": "struct KillswitchAccount.Call[]",
|
|
56669
|
+
"components": [
|
|
56670
|
+
{
|
|
56671
|
+
"name": "target",
|
|
56672
|
+
"type": "address",
|
|
56673
|
+
"internalType": "address"
|
|
56674
|
+
},
|
|
56675
|
+
{
|
|
56676
|
+
"name": "value",
|
|
56677
|
+
"type": "uint256",
|
|
56678
|
+
"internalType": "uint256"
|
|
56679
|
+
},
|
|
56680
|
+
{
|
|
56681
|
+
"name": "data",
|
|
56682
|
+
"type": "bytes",
|
|
56683
|
+
"internalType": "bytes"
|
|
56684
|
+
}
|
|
56685
|
+
]
|
|
56686
|
+
}
|
|
56687
|
+
],
|
|
56688
|
+
"outputs": [],
|
|
56689
|
+
"stateMutability": "nonpayable"
|
|
56690
|
+
},
|
|
56691
|
+
{
|
|
56692
|
+
"type": "function",
|
|
56693
|
+
"name": "executeAsAgent",
|
|
56694
|
+
"inputs": [
|
|
56695
|
+
{
|
|
56696
|
+
"name": "agentId",
|
|
56697
|
+
"type": "bytes32",
|
|
56698
|
+
"internalType": "bytes32"
|
|
56699
|
+
},
|
|
56700
|
+
{
|
|
56701
|
+
"name": "calls",
|
|
56702
|
+
"type": "tuple[]",
|
|
56703
|
+
"internalType": "struct KillswitchAccount.Call[]",
|
|
56704
|
+
"components": [
|
|
56705
|
+
{
|
|
56706
|
+
"name": "target",
|
|
56707
|
+
"type": "address",
|
|
56708
|
+
"internalType": "address"
|
|
56709
|
+
},
|
|
56710
|
+
{
|
|
56711
|
+
"name": "value",
|
|
56712
|
+
"type": "uint256",
|
|
56713
|
+
"internalType": "uint256"
|
|
56714
|
+
},
|
|
56715
|
+
{
|
|
56716
|
+
"name": "data",
|
|
56717
|
+
"type": "bytes",
|
|
56718
|
+
"internalType": "bytes"
|
|
56719
|
+
}
|
|
56720
|
+
]
|
|
56721
|
+
},
|
|
56722
|
+
{
|
|
56723
|
+
"name": "deadline",
|
|
56724
|
+
"type": "uint256",
|
|
56725
|
+
"internalType": "uint256"
|
|
56726
|
+
},
|
|
56727
|
+
{
|
|
56728
|
+
"name": "agentSig",
|
|
56729
|
+
"type": "bytes",
|
|
56730
|
+
"internalType": "bytes"
|
|
56731
|
+
},
|
|
56732
|
+
{
|
|
56733
|
+
"name": "guardianSig",
|
|
56734
|
+
"type": "bytes",
|
|
56735
|
+
"internalType": "bytes"
|
|
56736
|
+
}
|
|
56737
|
+
],
|
|
56738
|
+
"outputs": [
|
|
56739
|
+
{
|
|
56740
|
+
"name": "outflows",
|
|
56741
|
+
"type": "uint256[]",
|
|
56742
|
+
"internalType": "uint256[]"
|
|
56743
|
+
}
|
|
56744
|
+
],
|
|
56745
|
+
"stateMutability": "nonpayable"
|
|
56746
|
+
},
|
|
56747
|
+
{
|
|
56748
|
+
"type": "function",
|
|
56749
|
+
"name": "getAgent",
|
|
56750
|
+
"inputs": [
|
|
56751
|
+
{
|
|
56752
|
+
"name": "agentId",
|
|
56753
|
+
"type": "bytes32",
|
|
56754
|
+
"internalType": "bytes32"
|
|
56755
|
+
}
|
|
56756
|
+
],
|
|
56757
|
+
"outputs": [
|
|
56758
|
+
{
|
|
56759
|
+
"name": "a",
|
|
56760
|
+
"type": "tuple",
|
|
56761
|
+
"internalType": "struct KillswitchAccount.Agent",
|
|
56762
|
+
"components": [
|
|
56763
|
+
{
|
|
56764
|
+
"name": "sessionKey",
|
|
56765
|
+
"type": "address",
|
|
56766
|
+
"internalType": "address"
|
|
56767
|
+
},
|
|
56768
|
+
{
|
|
56769
|
+
"name": "validUntil",
|
|
56770
|
+
"type": "uint48",
|
|
56771
|
+
"internalType": "uint48"
|
|
56772
|
+
},
|
|
56773
|
+
{
|
|
56774
|
+
"name": "epoch",
|
|
56775
|
+
"type": "uint64",
|
|
56776
|
+
"internalType": "uint64"
|
|
56777
|
+
},
|
|
56778
|
+
{
|
|
56779
|
+
"name": "nonce",
|
|
56780
|
+
"type": "uint64",
|
|
56781
|
+
"internalType": "uint64"
|
|
56782
|
+
},
|
|
56783
|
+
{
|
|
56784
|
+
"name": "paused",
|
|
56785
|
+
"type": "bool",
|
|
56786
|
+
"internalType": "bool"
|
|
56787
|
+
},
|
|
56788
|
+
{
|
|
56789
|
+
"name": "exists",
|
|
56790
|
+
"type": "bool",
|
|
56791
|
+
"internalType": "bool"
|
|
56792
|
+
}
|
|
56793
|
+
]
|
|
56794
|
+
},
|
|
56795
|
+
{
|
|
56796
|
+
"name": "active",
|
|
56797
|
+
"type": "bool",
|
|
56798
|
+
"internalType": "bool"
|
|
56799
|
+
}
|
|
56800
|
+
],
|
|
56801
|
+
"stateMutability": "view"
|
|
56802
|
+
},
|
|
56803
|
+
{
|
|
56804
|
+
"type": "function",
|
|
56805
|
+
"name": "getLimits",
|
|
56806
|
+
"inputs": [
|
|
56807
|
+
{
|
|
56808
|
+
"name": "agentId",
|
|
56809
|
+
"type": "bytes32",
|
|
56810
|
+
"internalType": "bytes32"
|
|
56811
|
+
}
|
|
56812
|
+
],
|
|
56813
|
+
"outputs": [
|
|
56814
|
+
{
|
|
56815
|
+
"name": "",
|
|
56816
|
+
"type": "tuple[]",
|
|
56817
|
+
"internalType": "struct KillswitchAccount.SpendLimit[]",
|
|
56818
|
+
"components": [
|
|
56819
|
+
{
|
|
56820
|
+
"name": "token",
|
|
56821
|
+
"type": "address",
|
|
56822
|
+
"internalType": "address"
|
|
56823
|
+
},
|
|
56824
|
+
{
|
|
56825
|
+
"name": "maxPerPeriod",
|
|
56826
|
+
"type": "uint128",
|
|
56827
|
+
"internalType": "uint128"
|
|
56828
|
+
},
|
|
56829
|
+
{
|
|
56830
|
+
"name": "cosignAbove",
|
|
56831
|
+
"type": "uint128",
|
|
56832
|
+
"internalType": "uint128"
|
|
56833
|
+
},
|
|
56834
|
+
{
|
|
56835
|
+
"name": "period",
|
|
56836
|
+
"type": "uint32",
|
|
56837
|
+
"internalType": "uint32"
|
|
56838
|
+
}
|
|
56839
|
+
]
|
|
56840
|
+
}
|
|
56841
|
+
],
|
|
56842
|
+
"stateMutability": "view"
|
|
56843
|
+
},
|
|
56844
|
+
{
|
|
56845
|
+
"type": "function",
|
|
56846
|
+
"name": "getRules",
|
|
56847
|
+
"inputs": [
|
|
56848
|
+
{
|
|
56849
|
+
"name": "agentId",
|
|
56850
|
+
"type": "bytes32",
|
|
56851
|
+
"internalType": "bytes32"
|
|
56852
|
+
}
|
|
56853
|
+
],
|
|
56854
|
+
"outputs": [
|
|
56855
|
+
{
|
|
56856
|
+
"name": "",
|
|
56857
|
+
"type": "tuple[]",
|
|
56858
|
+
"internalType": "struct KillswitchAccount.CallRule[]",
|
|
56859
|
+
"components": [
|
|
56860
|
+
{
|
|
56861
|
+
"name": "target",
|
|
56862
|
+
"type": "address",
|
|
56863
|
+
"internalType": "address"
|
|
56864
|
+
},
|
|
56865
|
+
{
|
|
56866
|
+
"name": "selector",
|
|
56867
|
+
"type": "bytes4",
|
|
56868
|
+
"internalType": "bytes4"
|
|
56869
|
+
}
|
|
56870
|
+
]
|
|
56871
|
+
}
|
|
56872
|
+
],
|
|
56873
|
+
"stateMutability": "view"
|
|
56874
|
+
},
|
|
56875
|
+
{
|
|
56876
|
+
"type": "function",
|
|
56877
|
+
"name": "grant",
|
|
56878
|
+
"inputs": [
|
|
56879
|
+
{
|
|
56880
|
+
"name": "agentId",
|
|
56881
|
+
"type": "bytes32",
|
|
56882
|
+
"internalType": "bytes32"
|
|
56883
|
+
},
|
|
56884
|
+
{
|
|
56885
|
+
"name": "label",
|
|
56886
|
+
"type": "string",
|
|
56887
|
+
"internalType": "string"
|
|
56888
|
+
},
|
|
56889
|
+
{
|
|
56890
|
+
"name": "sessionKey",
|
|
56891
|
+
"type": "address",
|
|
56892
|
+
"internalType": "address"
|
|
56893
|
+
},
|
|
56894
|
+
{
|
|
56895
|
+
"name": "validUntil",
|
|
56896
|
+
"type": "uint48",
|
|
56897
|
+
"internalType": "uint48"
|
|
56898
|
+
},
|
|
56899
|
+
{
|
|
56900
|
+
"name": "rules",
|
|
56901
|
+
"type": "tuple[]",
|
|
56902
|
+
"internalType": "struct KillswitchAccount.CallRule[]",
|
|
56903
|
+
"components": [
|
|
56904
|
+
{
|
|
56905
|
+
"name": "target",
|
|
56906
|
+
"type": "address",
|
|
56907
|
+
"internalType": "address"
|
|
56908
|
+
},
|
|
56909
|
+
{
|
|
56910
|
+
"name": "selector",
|
|
56911
|
+
"type": "bytes4",
|
|
56912
|
+
"internalType": "bytes4"
|
|
56913
|
+
}
|
|
56914
|
+
]
|
|
56915
|
+
},
|
|
56916
|
+
{
|
|
56917
|
+
"name": "limits",
|
|
56918
|
+
"type": "tuple[]",
|
|
56919
|
+
"internalType": "struct KillswitchAccount.SpendLimit[]",
|
|
56920
|
+
"components": [
|
|
56921
|
+
{
|
|
56922
|
+
"name": "token",
|
|
56923
|
+
"type": "address",
|
|
56924
|
+
"internalType": "address"
|
|
56925
|
+
},
|
|
56926
|
+
{
|
|
56927
|
+
"name": "maxPerPeriod",
|
|
56928
|
+
"type": "uint128",
|
|
56929
|
+
"internalType": "uint128"
|
|
56930
|
+
},
|
|
56931
|
+
{
|
|
56932
|
+
"name": "cosignAbove",
|
|
56933
|
+
"type": "uint128",
|
|
56934
|
+
"internalType": "uint128"
|
|
56935
|
+
},
|
|
56936
|
+
{
|
|
56937
|
+
"name": "period",
|
|
56938
|
+
"type": "uint32",
|
|
56939
|
+
"internalType": "uint32"
|
|
56940
|
+
}
|
|
56941
|
+
]
|
|
56942
|
+
}
|
|
56943
|
+
],
|
|
56944
|
+
"outputs": [],
|
|
56945
|
+
"stateMutability": "nonpayable"
|
|
56946
|
+
},
|
|
56947
|
+
{
|
|
56948
|
+
"type": "function",
|
|
56949
|
+
"name": "guardian",
|
|
56950
|
+
"inputs": [],
|
|
56951
|
+
"outputs": [
|
|
56952
|
+
{
|
|
56953
|
+
"name": "",
|
|
56954
|
+
"type": "address",
|
|
56955
|
+
"internalType": "address"
|
|
56956
|
+
}
|
|
56957
|
+
],
|
|
56958
|
+
"stateMutability": "view"
|
|
56959
|
+
},
|
|
56960
|
+
{
|
|
56961
|
+
"type": "function",
|
|
56962
|
+
"name": "isValidSignature",
|
|
56963
|
+
"inputs": [
|
|
56964
|
+
{
|
|
56965
|
+
"name": "hash",
|
|
56966
|
+
"type": "bytes32",
|
|
56967
|
+
"internalType": "bytes32"
|
|
56968
|
+
},
|
|
56969
|
+
{
|
|
56970
|
+
"name": "",
|
|
56971
|
+
"type": "bytes",
|
|
56972
|
+
"internalType": "bytes"
|
|
56973
|
+
}
|
|
56974
|
+
],
|
|
56975
|
+
"outputs": [
|
|
56976
|
+
{
|
|
56977
|
+
"name": "",
|
|
56978
|
+
"type": "bytes4",
|
|
56979
|
+
"internalType": "bytes4"
|
|
56980
|
+
}
|
|
56981
|
+
],
|
|
56982
|
+
"stateMutability": "view"
|
|
56983
|
+
},
|
|
56984
|
+
{
|
|
56985
|
+
"type": "function",
|
|
56986
|
+
"name": "killAll",
|
|
56987
|
+
"inputs": [],
|
|
56988
|
+
"outputs": [],
|
|
56989
|
+
"stateMutability": "nonpayable"
|
|
56990
|
+
},
|
|
56991
|
+
{
|
|
56992
|
+
"type": "function",
|
|
56993
|
+
"name": "opDigest",
|
|
56994
|
+
"inputs": [
|
|
56995
|
+
{
|
|
56996
|
+
"name": "agentId",
|
|
56997
|
+
"type": "bytes32",
|
|
56998
|
+
"internalType": "bytes32"
|
|
56999
|
+
},
|
|
57000
|
+
{
|
|
57001
|
+
"name": "calls",
|
|
57002
|
+
"type": "tuple[]",
|
|
57003
|
+
"internalType": "struct KillswitchAccount.Call[]",
|
|
57004
|
+
"components": [
|
|
57005
|
+
{
|
|
57006
|
+
"name": "target",
|
|
57007
|
+
"type": "address",
|
|
57008
|
+
"internalType": "address"
|
|
57009
|
+
},
|
|
57010
|
+
{
|
|
57011
|
+
"name": "value",
|
|
57012
|
+
"type": "uint256",
|
|
57013
|
+
"internalType": "uint256"
|
|
57014
|
+
},
|
|
57015
|
+
{
|
|
57016
|
+
"name": "data",
|
|
57017
|
+
"type": "bytes",
|
|
57018
|
+
"internalType": "bytes"
|
|
57019
|
+
}
|
|
57020
|
+
]
|
|
57021
|
+
},
|
|
57022
|
+
{
|
|
57023
|
+
"name": "nonce",
|
|
57024
|
+
"type": "uint256",
|
|
57025
|
+
"internalType": "uint256"
|
|
57026
|
+
},
|
|
57027
|
+
{
|
|
57028
|
+
"name": "deadline",
|
|
57029
|
+
"type": "uint256",
|
|
57030
|
+
"internalType": "uint256"
|
|
57031
|
+
}
|
|
57032
|
+
],
|
|
57033
|
+
"outputs": [
|
|
57034
|
+
{
|
|
57035
|
+
"name": "",
|
|
57036
|
+
"type": "bytes32",
|
|
57037
|
+
"internalType": "bytes32"
|
|
57038
|
+
}
|
|
57039
|
+
],
|
|
57040
|
+
"stateMutability": "view"
|
|
57041
|
+
},
|
|
57042
|
+
{
|
|
57043
|
+
"type": "function",
|
|
57044
|
+
"name": "owner",
|
|
57045
|
+
"inputs": [],
|
|
57046
|
+
"outputs": [
|
|
57047
|
+
{
|
|
57048
|
+
"name": "",
|
|
57049
|
+
"type": "address",
|
|
57050
|
+
"internalType": "address"
|
|
57051
|
+
}
|
|
57052
|
+
],
|
|
57053
|
+
"stateMutability": "view"
|
|
57054
|
+
},
|
|
57055
|
+
{
|
|
57056
|
+
"type": "function",
|
|
57057
|
+
"name": "pause",
|
|
57058
|
+
"inputs": [
|
|
57059
|
+
{
|
|
57060
|
+
"name": "agentId",
|
|
57061
|
+
"type": "bytes32",
|
|
57062
|
+
"internalType": "bytes32"
|
|
57063
|
+
}
|
|
57064
|
+
],
|
|
57065
|
+
"outputs": [],
|
|
57066
|
+
"stateMutability": "nonpayable"
|
|
57067
|
+
},
|
|
57068
|
+
{
|
|
57069
|
+
"type": "function",
|
|
57070
|
+
"name": "revoke",
|
|
57071
|
+
"inputs": [
|
|
57072
|
+
{
|
|
57073
|
+
"name": "agentId",
|
|
57074
|
+
"type": "bytes32",
|
|
57075
|
+
"internalType": "bytes32"
|
|
57076
|
+
}
|
|
57077
|
+
],
|
|
57078
|
+
"outputs": [],
|
|
57079
|
+
"stateMutability": "nonpayable"
|
|
57080
|
+
},
|
|
57081
|
+
{
|
|
57082
|
+
"type": "function",
|
|
57083
|
+
"name": "setGuardian",
|
|
57084
|
+
"inputs": [
|
|
57085
|
+
{
|
|
57086
|
+
"name": "guardian_",
|
|
57087
|
+
"type": "address",
|
|
57088
|
+
"internalType": "address"
|
|
57089
|
+
}
|
|
57090
|
+
],
|
|
57091
|
+
"outputs": [],
|
|
57092
|
+
"stateMutability": "nonpayable"
|
|
57093
|
+
},
|
|
57094
|
+
{
|
|
57095
|
+
"type": "function",
|
|
57096
|
+
"name": "simulate",
|
|
57097
|
+
"inputs": [
|
|
57098
|
+
{
|
|
57099
|
+
"name": "agentId",
|
|
57100
|
+
"type": "bytes32",
|
|
57101
|
+
"internalType": "bytes32"
|
|
57102
|
+
},
|
|
57103
|
+
{
|
|
57104
|
+
"name": "calls",
|
|
57105
|
+
"type": "tuple[]",
|
|
57106
|
+
"internalType": "struct KillswitchAccount.Call[]",
|
|
57107
|
+
"components": [
|
|
57108
|
+
{
|
|
57109
|
+
"name": "target",
|
|
57110
|
+
"type": "address",
|
|
57111
|
+
"internalType": "address"
|
|
57112
|
+
},
|
|
57113
|
+
{
|
|
57114
|
+
"name": "value",
|
|
57115
|
+
"type": "uint256",
|
|
57116
|
+
"internalType": "uint256"
|
|
57117
|
+
},
|
|
57118
|
+
{
|
|
57119
|
+
"name": "data",
|
|
57120
|
+
"type": "bytes",
|
|
57121
|
+
"internalType": "bytes"
|
|
57122
|
+
}
|
|
57123
|
+
]
|
|
57124
|
+
}
|
|
57125
|
+
],
|
|
57126
|
+
"outputs": [],
|
|
57127
|
+
"stateMutability": "nonpayable"
|
|
57128
|
+
},
|
|
57129
|
+
{
|
|
57130
|
+
"type": "function",
|
|
57131
|
+
"name": "spent",
|
|
57132
|
+
"inputs": [
|
|
57133
|
+
{
|
|
57134
|
+
"name": "agentId",
|
|
57135
|
+
"type": "bytes32",
|
|
57136
|
+
"internalType": "bytes32"
|
|
57137
|
+
},
|
|
57138
|
+
{
|
|
57139
|
+
"name": "token",
|
|
57140
|
+
"type": "address",
|
|
57141
|
+
"internalType": "address"
|
|
57142
|
+
}
|
|
57143
|
+
],
|
|
57144
|
+
"outputs": [
|
|
57145
|
+
{
|
|
57146
|
+
"name": "used",
|
|
57147
|
+
"type": "uint256",
|
|
57148
|
+
"internalType": "uint256"
|
|
57149
|
+
},
|
|
57150
|
+
{
|
|
57151
|
+
"name": "max",
|
|
57152
|
+
"type": "uint256",
|
|
57153
|
+
"internalType": "uint256"
|
|
57154
|
+
},
|
|
57155
|
+
{
|
|
57156
|
+
"name": "resetsAt",
|
|
57157
|
+
"type": "uint256",
|
|
57158
|
+
"internalType": "uint256"
|
|
57159
|
+
}
|
|
57160
|
+
],
|
|
57161
|
+
"stateMutability": "view"
|
|
57162
|
+
},
|
|
57163
|
+
{
|
|
57164
|
+
"type": "function",
|
|
57165
|
+
"name": "unpause",
|
|
57166
|
+
"inputs": [
|
|
57167
|
+
{
|
|
57168
|
+
"name": "agentId",
|
|
57169
|
+
"type": "bytes32",
|
|
57170
|
+
"internalType": "bytes32"
|
|
57171
|
+
}
|
|
57172
|
+
],
|
|
57173
|
+
"outputs": [],
|
|
57174
|
+
"stateMutability": "nonpayable"
|
|
57175
|
+
},
|
|
57176
|
+
{
|
|
57177
|
+
"type": "event",
|
|
57178
|
+
"name": "AgentExecuted",
|
|
57179
|
+
"inputs": [
|
|
57180
|
+
{
|
|
57181
|
+
"name": "agentId",
|
|
57182
|
+
"type": "bytes32",
|
|
57183
|
+
"indexed": true,
|
|
57184
|
+
"internalType": "bytes32"
|
|
57185
|
+
},
|
|
57186
|
+
{
|
|
57187
|
+
"name": "nonce",
|
|
57188
|
+
"type": "uint64",
|
|
57189
|
+
"indexed": false,
|
|
57190
|
+
"internalType": "uint64"
|
|
57191
|
+
},
|
|
57192
|
+
{
|
|
57193
|
+
"name": "submitter",
|
|
57194
|
+
"type": "address",
|
|
57195
|
+
"indexed": false,
|
|
57196
|
+
"internalType": "address"
|
|
57197
|
+
},
|
|
57198
|
+
{
|
|
57199
|
+
"name": "cosigned",
|
|
57200
|
+
"type": "bool",
|
|
57201
|
+
"indexed": false,
|
|
57202
|
+
"internalType": "bool"
|
|
57203
|
+
},
|
|
57204
|
+
{
|
|
57205
|
+
"name": "outflows",
|
|
57206
|
+
"type": "uint256[]",
|
|
57207
|
+
"indexed": false,
|
|
57208
|
+
"internalType": "uint256[]"
|
|
57209
|
+
}
|
|
57210
|
+
],
|
|
57211
|
+
"anonymous": false
|
|
57212
|
+
},
|
|
57213
|
+
{
|
|
57214
|
+
"type": "event",
|
|
57215
|
+
"name": "AgentGranted",
|
|
57216
|
+
"inputs": [
|
|
57217
|
+
{
|
|
57218
|
+
"name": "agentId",
|
|
57219
|
+
"type": "bytes32",
|
|
57220
|
+
"indexed": true,
|
|
57221
|
+
"internalType": "bytes32"
|
|
57222
|
+
},
|
|
57223
|
+
{
|
|
57224
|
+
"name": "sessionKey",
|
|
57225
|
+
"type": "address",
|
|
57226
|
+
"indexed": false,
|
|
57227
|
+
"internalType": "address"
|
|
57228
|
+
},
|
|
57229
|
+
{
|
|
57230
|
+
"name": "validUntil",
|
|
57231
|
+
"type": "uint48",
|
|
57232
|
+
"indexed": false,
|
|
57233
|
+
"internalType": "uint48"
|
|
57234
|
+
},
|
|
57235
|
+
{
|
|
57236
|
+
"name": "label",
|
|
57237
|
+
"type": "string",
|
|
57238
|
+
"indexed": false,
|
|
57239
|
+
"internalType": "string"
|
|
57240
|
+
}
|
|
57241
|
+
],
|
|
57242
|
+
"anonymous": false
|
|
57243
|
+
},
|
|
57244
|
+
{
|
|
57245
|
+
"type": "event",
|
|
57246
|
+
"name": "AgentPaused",
|
|
57247
|
+
"inputs": [
|
|
57248
|
+
{
|
|
57249
|
+
"name": "agentId",
|
|
57250
|
+
"type": "bytes32",
|
|
57251
|
+
"indexed": true,
|
|
57252
|
+
"internalType": "bytes32"
|
|
57253
|
+
},
|
|
57254
|
+
{
|
|
57255
|
+
"name": "by",
|
|
57256
|
+
"type": "address",
|
|
57257
|
+
"indexed": false,
|
|
57258
|
+
"internalType": "address"
|
|
57259
|
+
}
|
|
57260
|
+
],
|
|
57261
|
+
"anonymous": false
|
|
57262
|
+
},
|
|
57263
|
+
{
|
|
57264
|
+
"type": "event",
|
|
57265
|
+
"name": "AgentRevoked",
|
|
57266
|
+
"inputs": [
|
|
57267
|
+
{
|
|
57268
|
+
"name": "agentId",
|
|
57269
|
+
"type": "bytes32",
|
|
57270
|
+
"indexed": true,
|
|
57271
|
+
"internalType": "bytes32"
|
|
57272
|
+
}
|
|
57273
|
+
],
|
|
57274
|
+
"anonymous": false
|
|
57275
|
+
},
|
|
57276
|
+
{
|
|
57277
|
+
"type": "event",
|
|
57278
|
+
"name": "AgentUnpaused",
|
|
57279
|
+
"inputs": [
|
|
57280
|
+
{
|
|
57281
|
+
"name": "agentId",
|
|
57282
|
+
"type": "bytes32",
|
|
57283
|
+
"indexed": true,
|
|
57284
|
+
"internalType": "bytes32"
|
|
57285
|
+
}
|
|
57286
|
+
],
|
|
57287
|
+
"anonymous": false
|
|
57288
|
+
},
|
|
57289
|
+
{
|
|
57290
|
+
"type": "event",
|
|
57291
|
+
"name": "EIP712DomainChanged",
|
|
57292
|
+
"inputs": [],
|
|
57293
|
+
"anonymous": false
|
|
57294
|
+
},
|
|
57295
|
+
{
|
|
57296
|
+
"type": "event",
|
|
57297
|
+
"name": "GuardianChanged",
|
|
57298
|
+
"inputs": [
|
|
57299
|
+
{
|
|
57300
|
+
"name": "guardian",
|
|
57301
|
+
"type": "address",
|
|
57302
|
+
"indexed": false,
|
|
57303
|
+
"internalType": "address"
|
|
57304
|
+
}
|
|
57305
|
+
],
|
|
57306
|
+
"anonymous": false
|
|
57307
|
+
},
|
|
57308
|
+
{
|
|
57309
|
+
"type": "event",
|
|
57310
|
+
"name": "KilledAll",
|
|
57311
|
+
"inputs": [
|
|
57312
|
+
{
|
|
57313
|
+
"name": "newEpoch",
|
|
57314
|
+
"type": "uint64",
|
|
57315
|
+
"indexed": false,
|
|
57316
|
+
"internalType": "uint64"
|
|
57317
|
+
}
|
|
57318
|
+
],
|
|
57319
|
+
"anonymous": false
|
|
57320
|
+
},
|
|
57321
|
+
{
|
|
57322
|
+
"type": "event",
|
|
57323
|
+
"name": "OwnerExecuted",
|
|
57324
|
+
"inputs": [
|
|
57325
|
+
{
|
|
57326
|
+
"name": "calls",
|
|
57327
|
+
"type": "uint256",
|
|
57328
|
+
"indexed": false,
|
|
57329
|
+
"internalType": "uint256"
|
|
57330
|
+
}
|
|
57331
|
+
],
|
|
57332
|
+
"anonymous": false
|
|
57333
|
+
},
|
|
57334
|
+
{
|
|
57335
|
+
"type": "event",
|
|
57336
|
+
"name": "TransferAuthorized",
|
|
57337
|
+
"inputs": [
|
|
57338
|
+
{
|
|
57339
|
+
"name": "agentId",
|
|
57340
|
+
"type": "bytes32",
|
|
57341
|
+
"indexed": true,
|
|
57342
|
+
"internalType": "bytes32"
|
|
57343
|
+
},
|
|
57344
|
+
{
|
|
57345
|
+
"name": "token",
|
|
57346
|
+
"type": "address",
|
|
57347
|
+
"indexed": true,
|
|
57348
|
+
"internalType": "address"
|
|
57349
|
+
},
|
|
57350
|
+
{
|
|
57351
|
+
"name": "to",
|
|
57352
|
+
"type": "address",
|
|
57353
|
+
"indexed": true,
|
|
57354
|
+
"internalType": "address"
|
|
57355
|
+
},
|
|
57356
|
+
{
|
|
57357
|
+
"name": "value",
|
|
57358
|
+
"type": "uint256",
|
|
57359
|
+
"indexed": false,
|
|
57360
|
+
"internalType": "uint256"
|
|
57361
|
+
},
|
|
57362
|
+
{
|
|
57363
|
+
"name": "validBefore",
|
|
57364
|
+
"type": "uint256",
|
|
57365
|
+
"indexed": false,
|
|
57366
|
+
"internalType": "uint256"
|
|
57367
|
+
},
|
|
57368
|
+
{
|
|
57369
|
+
"name": "nonce",
|
|
57370
|
+
"type": "bytes32",
|
|
57371
|
+
"indexed": false,
|
|
57372
|
+
"internalType": "bytes32"
|
|
57373
|
+
},
|
|
57374
|
+
{
|
|
57375
|
+
"name": "digest",
|
|
57376
|
+
"type": "bytes32",
|
|
57377
|
+
"indexed": false,
|
|
57378
|
+
"internalType": "bytes32"
|
|
57379
|
+
}
|
|
57380
|
+
],
|
|
57381
|
+
"anonymous": false
|
|
57382
|
+
},
|
|
57383
|
+
{
|
|
57384
|
+
"type": "error",
|
|
57385
|
+
"name": "AgentIsPaused",
|
|
57386
|
+
"inputs": []
|
|
57387
|
+
},
|
|
57388
|
+
{
|
|
57389
|
+
"type": "error",
|
|
57390
|
+
"name": "AgentKilled",
|
|
57391
|
+
"inputs": []
|
|
57392
|
+
},
|
|
57393
|
+
{
|
|
57394
|
+
"type": "error",
|
|
57395
|
+
"name": "AgentOnly",
|
|
57396
|
+
"inputs": []
|
|
57397
|
+
},
|
|
57398
|
+
{
|
|
57399
|
+
"type": "error",
|
|
57400
|
+
"name": "AuthorizationWindow",
|
|
57401
|
+
"inputs": []
|
|
57402
|
+
},
|
|
57403
|
+
{
|
|
57404
|
+
"type": "error",
|
|
57405
|
+
"name": "BadAgentSignature",
|
|
57406
|
+
"inputs": []
|
|
57407
|
+
},
|
|
57408
|
+
{
|
|
57409
|
+
"type": "error",
|
|
57410
|
+
"name": "BadGuardianSignature",
|
|
57411
|
+
"inputs": []
|
|
57412
|
+
},
|
|
57413
|
+
{
|
|
57414
|
+
"type": "error",
|
|
57415
|
+
"name": "BadPeriod",
|
|
57416
|
+
"inputs": []
|
|
57417
|
+
},
|
|
57418
|
+
{
|
|
57419
|
+
"type": "error",
|
|
57420
|
+
"name": "CallFailed",
|
|
57421
|
+
"inputs": [
|
|
57422
|
+
{
|
|
57423
|
+
"name": "index",
|
|
57424
|
+
"type": "uint256",
|
|
57425
|
+
"internalType": "uint256"
|
|
57426
|
+
},
|
|
57427
|
+
{
|
|
57428
|
+
"name": "reason",
|
|
57429
|
+
"type": "bytes",
|
|
57430
|
+
"internalType": "bytes"
|
|
57431
|
+
}
|
|
57432
|
+
]
|
|
57433
|
+
},
|
|
57434
|
+
{
|
|
57435
|
+
"type": "error",
|
|
57436
|
+
"name": "CallNotAllowed",
|
|
57437
|
+
"inputs": [
|
|
57438
|
+
{
|
|
57439
|
+
"name": "target",
|
|
57440
|
+
"type": "address",
|
|
57441
|
+
"internalType": "address"
|
|
57442
|
+
},
|
|
57443
|
+
{
|
|
57444
|
+
"name": "selector",
|
|
57445
|
+
"type": "bytes4",
|
|
57446
|
+
"internalType": "bytes4"
|
|
57447
|
+
}
|
|
57448
|
+
]
|
|
57449
|
+
},
|
|
57450
|
+
{
|
|
57451
|
+
"type": "error",
|
|
57452
|
+
"name": "CapExceeded",
|
|
57453
|
+
"inputs": [
|
|
57454
|
+
{
|
|
57455
|
+
"name": "token",
|
|
57456
|
+
"type": "address",
|
|
57457
|
+
"internalType": "address"
|
|
57458
|
+
},
|
|
57459
|
+
{
|
|
57460
|
+
"name": "used",
|
|
57461
|
+
"type": "uint256",
|
|
57462
|
+
"internalType": "uint256"
|
|
57463
|
+
},
|
|
57464
|
+
{
|
|
57465
|
+
"name": "max",
|
|
57466
|
+
"type": "uint256",
|
|
57467
|
+
"internalType": "uint256"
|
|
57468
|
+
}
|
|
57469
|
+
]
|
|
57470
|
+
},
|
|
57471
|
+
{
|
|
57472
|
+
"type": "error",
|
|
57473
|
+
"name": "CosignRequired",
|
|
57474
|
+
"inputs": [
|
|
57475
|
+
{
|
|
57476
|
+
"name": "token",
|
|
57477
|
+
"type": "address",
|
|
57478
|
+
"internalType": "address"
|
|
57479
|
+
},
|
|
57480
|
+
{
|
|
57481
|
+
"name": "outflow",
|
|
57482
|
+
"type": "uint256",
|
|
57483
|
+
"internalType": "uint256"
|
|
57484
|
+
},
|
|
57485
|
+
{
|
|
57486
|
+
"name": "threshold",
|
|
57487
|
+
"type": "uint256",
|
|
57488
|
+
"internalType": "uint256"
|
|
57489
|
+
}
|
|
57490
|
+
]
|
|
57491
|
+
},
|
|
57492
|
+
{
|
|
57493
|
+
"type": "error",
|
|
57494
|
+
"name": "DanglingAllowance",
|
|
57495
|
+
"inputs": [
|
|
57496
|
+
{
|
|
57497
|
+
"name": "token",
|
|
57498
|
+
"type": "address",
|
|
57499
|
+
"internalType": "address"
|
|
57500
|
+
},
|
|
57501
|
+
{
|
|
57502
|
+
"name": "spender",
|
|
57503
|
+
"type": "address",
|
|
57504
|
+
"internalType": "address"
|
|
57505
|
+
}
|
|
57506
|
+
]
|
|
57507
|
+
},
|
|
57508
|
+
{
|
|
57509
|
+
"type": "error",
|
|
57510
|
+
"name": "DeadlinePassed",
|
|
57511
|
+
"inputs": []
|
|
57512
|
+
},
|
|
57513
|
+
{
|
|
57514
|
+
"type": "error",
|
|
57515
|
+
"name": "ECDSAInvalidSignature",
|
|
57516
|
+
"inputs": []
|
|
57517
|
+
},
|
|
57518
|
+
{
|
|
57519
|
+
"type": "error",
|
|
57520
|
+
"name": "ECDSAInvalidSignatureLength",
|
|
57521
|
+
"inputs": [
|
|
57522
|
+
{
|
|
57523
|
+
"name": "length",
|
|
57524
|
+
"type": "uint256",
|
|
57525
|
+
"internalType": "uint256"
|
|
57526
|
+
}
|
|
57527
|
+
]
|
|
57528
|
+
},
|
|
57529
|
+
{
|
|
57530
|
+
"type": "error",
|
|
57531
|
+
"name": "ECDSAInvalidSignatureS",
|
|
57532
|
+
"inputs": [
|
|
57533
|
+
{
|
|
57534
|
+
"name": "s",
|
|
57535
|
+
"type": "bytes32",
|
|
57536
|
+
"internalType": "bytes32"
|
|
57537
|
+
}
|
|
57538
|
+
]
|
|
57539
|
+
},
|
|
57540
|
+
{
|
|
57541
|
+
"type": "error",
|
|
57542
|
+
"name": "InvalidShortString",
|
|
57543
|
+
"inputs": []
|
|
57544
|
+
},
|
|
57545
|
+
{
|
|
57546
|
+
"type": "error",
|
|
57547
|
+
"name": "NativeValueNotAllowed",
|
|
57548
|
+
"inputs": []
|
|
57549
|
+
},
|
|
57550
|
+
{
|
|
57551
|
+
"type": "error",
|
|
57552
|
+
"name": "NotOwner",
|
|
57553
|
+
"inputs": []
|
|
57554
|
+
},
|
|
57555
|
+
{
|
|
57556
|
+
"type": "error",
|
|
57557
|
+
"name": "NotOwnerOrGuardian",
|
|
57558
|
+
"inputs": []
|
|
57559
|
+
},
|
|
57560
|
+
{
|
|
57561
|
+
"type": "error",
|
|
57562
|
+
"name": "PermissionExpired",
|
|
57563
|
+
"inputs": []
|
|
57564
|
+
},
|
|
57565
|
+
{
|
|
57566
|
+
"type": "error",
|
|
57567
|
+
"name": "Reentrancy",
|
|
57568
|
+
"inputs": []
|
|
57569
|
+
},
|
|
57570
|
+
{
|
|
57571
|
+
"type": "error",
|
|
57572
|
+
"name": "SelfCallForbidden",
|
|
57573
|
+
"inputs": []
|
|
57574
|
+
},
|
|
57575
|
+
{
|
|
57576
|
+
"type": "error",
|
|
57577
|
+
"name": "SimulationResult",
|
|
57578
|
+
"inputs": [
|
|
57579
|
+
{
|
|
57580
|
+
"name": "outflows",
|
|
57581
|
+
"type": "uint256[]",
|
|
57582
|
+
"internalType": "uint256[]"
|
|
57583
|
+
}
|
|
57584
|
+
]
|
|
57585
|
+
},
|
|
57586
|
+
{
|
|
57587
|
+
"type": "error",
|
|
57588
|
+
"name": "SpenderNotAllowed",
|
|
57589
|
+
"inputs": [
|
|
57590
|
+
{
|
|
57591
|
+
"name": "token",
|
|
57592
|
+
"type": "address",
|
|
57593
|
+
"internalType": "address"
|
|
57594
|
+
},
|
|
57595
|
+
{
|
|
57596
|
+
"name": "spender",
|
|
57597
|
+
"type": "address",
|
|
57598
|
+
"internalType": "address"
|
|
57599
|
+
}
|
|
57600
|
+
]
|
|
57601
|
+
},
|
|
57602
|
+
{
|
|
57603
|
+
"type": "error",
|
|
57604
|
+
"name": "StringTooLong",
|
|
57605
|
+
"inputs": [
|
|
57606
|
+
{
|
|
57607
|
+
"name": "str",
|
|
57608
|
+
"type": "string",
|
|
57609
|
+
"internalType": "string"
|
|
57610
|
+
}
|
|
57611
|
+
]
|
|
57612
|
+
},
|
|
57613
|
+
{
|
|
57614
|
+
"type": "error",
|
|
57615
|
+
"name": "TokenDomainMismatch",
|
|
57616
|
+
"inputs": [
|
|
57617
|
+
{
|
|
57618
|
+
"name": "token",
|
|
57619
|
+
"type": "address",
|
|
57620
|
+
"internalType": "address"
|
|
57621
|
+
}
|
|
57622
|
+
]
|
|
57623
|
+
},
|
|
57624
|
+
{
|
|
57625
|
+
"type": "error",
|
|
57626
|
+
"name": "TooMany",
|
|
57627
|
+
"inputs": []
|
|
57628
|
+
},
|
|
57629
|
+
{
|
|
57630
|
+
"type": "error",
|
|
57631
|
+
"name": "UncappedTokenRule",
|
|
57632
|
+
"inputs": [
|
|
57633
|
+
{
|
|
57634
|
+
"name": "token",
|
|
57635
|
+
"type": "address",
|
|
57636
|
+
"internalType": "address"
|
|
57637
|
+
}
|
|
57638
|
+
]
|
|
57639
|
+
},
|
|
57640
|
+
{
|
|
57641
|
+
"type": "error",
|
|
57642
|
+
"name": "UnknownAgent",
|
|
57643
|
+
"inputs": []
|
|
57644
|
+
}
|
|
57645
|
+
];
|
|
56436
57646
|
var MockERC20Abi = [
|
|
56437
57647
|
{
|
|
56438
57648
|
"type": "constructor",
|
|
@@ -56455,6 +57665,32 @@ var MockERC20Abi = [
|
|
|
56455
57665
|
],
|
|
56456
57666
|
"stateMutability": "nonpayable"
|
|
56457
57667
|
},
|
|
57668
|
+
{
|
|
57669
|
+
"type": "function",
|
|
57670
|
+
"name": "DOMAIN_SEPARATOR",
|
|
57671
|
+
"inputs": [],
|
|
57672
|
+
"outputs": [
|
|
57673
|
+
{
|
|
57674
|
+
"name": "",
|
|
57675
|
+
"type": "bytes32",
|
|
57676
|
+
"internalType": "bytes32"
|
|
57677
|
+
}
|
|
57678
|
+
],
|
|
57679
|
+
"stateMutability": "view"
|
|
57680
|
+
},
|
|
57681
|
+
{
|
|
57682
|
+
"type": "function",
|
|
57683
|
+
"name": "TRANSFER_WITH_AUTHORIZATION_TYPEHASH",
|
|
57684
|
+
"inputs": [],
|
|
57685
|
+
"outputs": [
|
|
57686
|
+
{
|
|
57687
|
+
"name": "",
|
|
57688
|
+
"type": "bytes32",
|
|
57689
|
+
"internalType": "bytes32"
|
|
57690
|
+
}
|
|
57691
|
+
],
|
|
57692
|
+
"stateMutability": "view"
|
|
57693
|
+
},
|
|
56458
57694
|
{
|
|
56459
57695
|
"type": "function",
|
|
56460
57696
|
"name": "allowance",
|
|
@@ -56503,6 +57739,30 @@ var MockERC20Abi = [
|
|
|
56503
57739
|
],
|
|
56504
57740
|
"stateMutability": "nonpayable"
|
|
56505
57741
|
},
|
|
57742
|
+
{
|
|
57743
|
+
"type": "function",
|
|
57744
|
+
"name": "authorizationState",
|
|
57745
|
+
"inputs": [
|
|
57746
|
+
{
|
|
57747
|
+
"name": "",
|
|
57748
|
+
"type": "address",
|
|
57749
|
+
"internalType": "address"
|
|
57750
|
+
},
|
|
57751
|
+
{
|
|
57752
|
+
"name": "",
|
|
57753
|
+
"type": "bytes32",
|
|
57754
|
+
"internalType": "bytes32"
|
|
57755
|
+
}
|
|
57756
|
+
],
|
|
57757
|
+
"outputs": [
|
|
57758
|
+
{
|
|
57759
|
+
"name": "",
|
|
57760
|
+
"type": "bool",
|
|
57761
|
+
"internalType": "bool"
|
|
57762
|
+
}
|
|
57763
|
+
],
|
|
57764
|
+
"stateMutability": "view"
|
|
57765
|
+
},
|
|
56506
57766
|
{
|
|
56507
57767
|
"type": "function",
|
|
56508
57768
|
"name": "balanceOf",
|
|
@@ -56535,6 +57795,49 @@ var MockERC20Abi = [
|
|
|
56535
57795
|
],
|
|
56536
57796
|
"stateMutability": "view"
|
|
56537
57797
|
},
|
|
57798
|
+
{
|
|
57799
|
+
"type": "function",
|
|
57800
|
+
"name": "eip712Domain",
|
|
57801
|
+
"inputs": [],
|
|
57802
|
+
"outputs": [
|
|
57803
|
+
{
|
|
57804
|
+
"name": "fields",
|
|
57805
|
+
"type": "bytes1",
|
|
57806
|
+
"internalType": "bytes1"
|
|
57807
|
+
},
|
|
57808
|
+
{
|
|
57809
|
+
"name": "name",
|
|
57810
|
+
"type": "string",
|
|
57811
|
+
"internalType": "string"
|
|
57812
|
+
},
|
|
57813
|
+
{
|
|
57814
|
+
"name": "version",
|
|
57815
|
+
"type": "string",
|
|
57816
|
+
"internalType": "string"
|
|
57817
|
+
},
|
|
57818
|
+
{
|
|
57819
|
+
"name": "chainId",
|
|
57820
|
+
"type": "uint256",
|
|
57821
|
+
"internalType": "uint256"
|
|
57822
|
+
},
|
|
57823
|
+
{
|
|
57824
|
+
"name": "verifyingContract",
|
|
57825
|
+
"type": "address",
|
|
57826
|
+
"internalType": "address"
|
|
57827
|
+
},
|
|
57828
|
+
{
|
|
57829
|
+
"name": "salt",
|
|
57830
|
+
"type": "bytes32",
|
|
57831
|
+
"internalType": "bytes32"
|
|
57832
|
+
},
|
|
57833
|
+
{
|
|
57834
|
+
"name": "extensions",
|
|
57835
|
+
"type": "uint256[]",
|
|
57836
|
+
"internalType": "uint256[]"
|
|
57837
|
+
}
|
|
57838
|
+
],
|
|
57839
|
+
"stateMutability": "view"
|
|
57840
|
+
},
|
|
56538
57841
|
{
|
|
56539
57842
|
"type": "function",
|
|
56540
57843
|
"name": "mint",
|
|
@@ -56645,6 +57948,115 @@ var MockERC20Abi = [
|
|
|
56645
57948
|
],
|
|
56646
57949
|
"stateMutability": "nonpayable"
|
|
56647
57950
|
},
|
|
57951
|
+
{
|
|
57952
|
+
"type": "function",
|
|
57953
|
+
"name": "transferWithAuthorization",
|
|
57954
|
+
"inputs": [
|
|
57955
|
+
{
|
|
57956
|
+
"name": "from",
|
|
57957
|
+
"type": "address",
|
|
57958
|
+
"internalType": "address"
|
|
57959
|
+
},
|
|
57960
|
+
{
|
|
57961
|
+
"name": "to",
|
|
57962
|
+
"type": "address",
|
|
57963
|
+
"internalType": "address"
|
|
57964
|
+
},
|
|
57965
|
+
{
|
|
57966
|
+
"name": "value",
|
|
57967
|
+
"type": "uint256",
|
|
57968
|
+
"internalType": "uint256"
|
|
57969
|
+
},
|
|
57970
|
+
{
|
|
57971
|
+
"name": "validAfter",
|
|
57972
|
+
"type": "uint256",
|
|
57973
|
+
"internalType": "uint256"
|
|
57974
|
+
},
|
|
57975
|
+
{
|
|
57976
|
+
"name": "validBefore",
|
|
57977
|
+
"type": "uint256",
|
|
57978
|
+
"internalType": "uint256"
|
|
57979
|
+
},
|
|
57980
|
+
{
|
|
57981
|
+
"name": "nonce",
|
|
57982
|
+
"type": "bytes32",
|
|
57983
|
+
"internalType": "bytes32"
|
|
57984
|
+
},
|
|
57985
|
+
{
|
|
57986
|
+
"name": "signature",
|
|
57987
|
+
"type": "bytes",
|
|
57988
|
+
"internalType": "bytes"
|
|
57989
|
+
}
|
|
57990
|
+
],
|
|
57991
|
+
"outputs": [],
|
|
57992
|
+
"stateMutability": "nonpayable"
|
|
57993
|
+
},
|
|
57994
|
+
{
|
|
57995
|
+
"type": "function",
|
|
57996
|
+
"name": "transferWithAuthorization",
|
|
57997
|
+
"inputs": [
|
|
57998
|
+
{
|
|
57999
|
+
"name": "from",
|
|
58000
|
+
"type": "address",
|
|
58001
|
+
"internalType": "address"
|
|
58002
|
+
},
|
|
58003
|
+
{
|
|
58004
|
+
"name": "to",
|
|
58005
|
+
"type": "address",
|
|
58006
|
+
"internalType": "address"
|
|
58007
|
+
},
|
|
58008
|
+
{
|
|
58009
|
+
"name": "value",
|
|
58010
|
+
"type": "uint256",
|
|
58011
|
+
"internalType": "uint256"
|
|
58012
|
+
},
|
|
58013
|
+
{
|
|
58014
|
+
"name": "validAfter",
|
|
58015
|
+
"type": "uint256",
|
|
58016
|
+
"internalType": "uint256"
|
|
58017
|
+
},
|
|
58018
|
+
{
|
|
58019
|
+
"name": "validBefore",
|
|
58020
|
+
"type": "uint256",
|
|
58021
|
+
"internalType": "uint256"
|
|
58022
|
+
},
|
|
58023
|
+
{
|
|
58024
|
+
"name": "nonce",
|
|
58025
|
+
"type": "bytes32",
|
|
58026
|
+
"internalType": "bytes32"
|
|
58027
|
+
},
|
|
58028
|
+
{
|
|
58029
|
+
"name": "v",
|
|
58030
|
+
"type": "uint8",
|
|
58031
|
+
"internalType": "uint8"
|
|
58032
|
+
},
|
|
58033
|
+
{
|
|
58034
|
+
"name": "r",
|
|
58035
|
+
"type": "bytes32",
|
|
58036
|
+
"internalType": "bytes32"
|
|
58037
|
+
},
|
|
58038
|
+
{
|
|
58039
|
+
"name": "s",
|
|
58040
|
+
"type": "bytes32",
|
|
58041
|
+
"internalType": "bytes32"
|
|
58042
|
+
}
|
|
58043
|
+
],
|
|
58044
|
+
"outputs": [],
|
|
58045
|
+
"stateMutability": "nonpayable"
|
|
58046
|
+
},
|
|
58047
|
+
{
|
|
58048
|
+
"type": "function",
|
|
58049
|
+
"name": "version",
|
|
58050
|
+
"inputs": [],
|
|
58051
|
+
"outputs": [
|
|
58052
|
+
{
|
|
58053
|
+
"name": "",
|
|
58054
|
+
"type": "string",
|
|
58055
|
+
"internalType": "string"
|
|
58056
|
+
}
|
|
58057
|
+
],
|
|
58058
|
+
"stateMutability": "pure"
|
|
58059
|
+
},
|
|
56648
58060
|
{
|
|
56649
58061
|
"type": "event",
|
|
56650
58062
|
"name": "Approval",
|
|
@@ -56670,6 +58082,31 @@ var MockERC20Abi = [
|
|
|
56670
58082
|
],
|
|
56671
58083
|
"anonymous": false
|
|
56672
58084
|
},
|
|
58085
|
+
{
|
|
58086
|
+
"type": "event",
|
|
58087
|
+
"name": "AuthorizationUsed",
|
|
58088
|
+
"inputs": [
|
|
58089
|
+
{
|
|
58090
|
+
"name": "authorizer",
|
|
58091
|
+
"type": "address",
|
|
58092
|
+
"indexed": true,
|
|
58093
|
+
"internalType": "address"
|
|
58094
|
+
},
|
|
58095
|
+
{
|
|
58096
|
+
"name": "nonce",
|
|
58097
|
+
"type": "bytes32",
|
|
58098
|
+
"indexed": true,
|
|
58099
|
+
"internalType": "bytes32"
|
|
58100
|
+
}
|
|
58101
|
+
],
|
|
58102
|
+
"anonymous": false
|
|
58103
|
+
},
|
|
58104
|
+
{
|
|
58105
|
+
"type": "event",
|
|
58106
|
+
"name": "EIP712DomainChanged",
|
|
58107
|
+
"inputs": [],
|
|
58108
|
+
"anonymous": false
|
|
58109
|
+
},
|
|
56673
58110
|
{
|
|
56674
58111
|
"type": "event",
|
|
56675
58112
|
"name": "Transfer",
|
|
@@ -56695,6 +58132,21 @@ var MockERC20Abi = [
|
|
|
56695
58132
|
],
|
|
56696
58133
|
"anonymous": false
|
|
56697
58134
|
},
|
|
58135
|
+
{
|
|
58136
|
+
"type": "error",
|
|
58137
|
+
"name": "AuthorizationExpired",
|
|
58138
|
+
"inputs": []
|
|
58139
|
+
},
|
|
58140
|
+
{
|
|
58141
|
+
"type": "error",
|
|
58142
|
+
"name": "AuthorizationNotYetValid",
|
|
58143
|
+
"inputs": []
|
|
58144
|
+
},
|
|
58145
|
+
{
|
|
58146
|
+
"type": "error",
|
|
58147
|
+
"name": "AuthorizationUsedAlready",
|
|
58148
|
+
"inputs": []
|
|
58149
|
+
},
|
|
56698
58150
|
{
|
|
56699
58151
|
"type": "error",
|
|
56700
58152
|
"name": "ERC20InsufficientAllowance",
|
|
@@ -56780,6 +58232,27 @@ var MockERC20Abi = [
|
|
|
56780
58232
|
"internalType": "address"
|
|
56781
58233
|
}
|
|
56782
58234
|
]
|
|
58235
|
+
},
|
|
58236
|
+
{
|
|
58237
|
+
"type": "error",
|
|
58238
|
+
"name": "InvalidShortString",
|
|
58239
|
+
"inputs": []
|
|
58240
|
+
},
|
|
58241
|
+
{
|
|
58242
|
+
"type": "error",
|
|
58243
|
+
"name": "InvalidSignature",
|
|
58244
|
+
"inputs": []
|
|
58245
|
+
},
|
|
58246
|
+
{
|
|
58247
|
+
"type": "error",
|
|
58248
|
+
"name": "StringTooLong",
|
|
58249
|
+
"inputs": [
|
|
58250
|
+
{
|
|
58251
|
+
"name": "str",
|
|
58252
|
+
"type": "string",
|
|
58253
|
+
"internalType": "string"
|
|
58254
|
+
}
|
|
58255
|
+
]
|
|
56783
58256
|
}
|
|
56784
58257
|
];
|
|
56785
58258
|
var MockDEXAbi = [
|
|
@@ -56959,6 +58432,87 @@ function opTypedData(p) {
|
|
|
56959
58432
|
};
|
|
56960
58433
|
}
|
|
56961
58434
|
var toWire = (calls) => calls.map((c) => ({ target: c.target, value: c.value.toString(), data: c.data }));
|
|
58435
|
+
var X402_NETWORKS = {
|
|
58436
|
+
1: "ethereum",
|
|
58437
|
+
8453: "base",
|
|
58438
|
+
84532: "base-sepolia",
|
|
58439
|
+
11155111: "sepolia",
|
|
58440
|
+
31337: "localhost"
|
|
58441
|
+
};
|
|
58442
|
+
function authorizeTransferCall(account, token, a) {
|
|
58443
|
+
return {
|
|
58444
|
+
target: account,
|
|
58445
|
+
value: 0n,
|
|
58446
|
+
data: encodeFunctionData({
|
|
58447
|
+
abi: KillswitchAccountAbi,
|
|
58448
|
+
functionName: "authorizeTransfer",
|
|
58449
|
+
args: [token, a.to, BigInt(a.value), BigInt(a.validAfter), BigInt(a.validBefore), a.nonce]
|
|
58450
|
+
})
|
|
58451
|
+
};
|
|
58452
|
+
}
|
|
58453
|
+
var b64encode = (s) => btoa(Array.from(new TextEncoder().encode(s), (b) => String.fromCharCode(b)).join(""));
|
|
58454
|
+
var b64decode = (s) => new TextDecoder().decode(Uint8Array.from(atob(s), (c) => c.charCodeAt(0)));
|
|
58455
|
+
var x402NetworkIds = (chainId) => [X402_NETWORKS[chainId], `eip155:${chainId}`].filter(Boolean);
|
|
58456
|
+
async function readX402Ask(res) {
|
|
58457
|
+
const header = res.headers.get("payment-required");
|
|
58458
|
+
if (header) {
|
|
58459
|
+
const pr = JSON.parse(b64decode(header));
|
|
58460
|
+
return {
|
|
58461
|
+
version: 2,
|
|
58462
|
+
resource: pr.resource,
|
|
58463
|
+
extensions: pr.extensions,
|
|
58464
|
+
error: pr.error,
|
|
58465
|
+
offers: (pr.accepts ?? []).map((r) => ({
|
|
58466
|
+
version: 2,
|
|
58467
|
+
scheme: r.scheme,
|
|
58468
|
+
network: r.network,
|
|
58469
|
+
asset: r.asset,
|
|
58470
|
+
amount: String(r.amount),
|
|
58471
|
+
payTo: r.payTo,
|
|
58472
|
+
maxTimeoutSeconds: r.maxTimeoutSeconds,
|
|
58473
|
+
resource: pr.resource?.url ?? "",
|
|
58474
|
+
description: pr.resource?.description,
|
|
58475
|
+
extra: r.extra,
|
|
58476
|
+
raw: r
|
|
58477
|
+
}))
|
|
58478
|
+
};
|
|
58479
|
+
}
|
|
58480
|
+
const body = await res.json().catch(() => null);
|
|
58481
|
+
if (!body || !Array.isArray(body.accepts)) return null;
|
|
58482
|
+
return {
|
|
58483
|
+
version: 1,
|
|
58484
|
+
error: body.error,
|
|
58485
|
+
offers: body.accepts.map((r) => ({
|
|
58486
|
+
version: 1,
|
|
58487
|
+
scheme: r.scheme,
|
|
58488
|
+
network: r.network,
|
|
58489
|
+
asset: r.asset,
|
|
58490
|
+
amount: String(r.maxAmountRequired),
|
|
58491
|
+
payTo: r.payTo,
|
|
58492
|
+
maxTimeoutSeconds: r.maxTimeoutSeconds,
|
|
58493
|
+
resource: r.resource ?? "",
|
|
58494
|
+
description: r.description,
|
|
58495
|
+
extra: r.extra,
|
|
58496
|
+
raw: r
|
|
58497
|
+
}))
|
|
58498
|
+
};
|
|
58499
|
+
}
|
|
58500
|
+
function x402PaymentHeaders(ask, offer, payload) {
|
|
58501
|
+
if (offer.version === 2) {
|
|
58502
|
+
const body = { x402Version: 2, payload, extensions: ask.extensions, resource: ask.resource, accepted: offer.raw };
|
|
58503
|
+
return { "PAYMENT-SIGNATURE": b64encode(JSON.stringify(body)) };
|
|
58504
|
+
}
|
|
58505
|
+
return { "X-PAYMENT": b64encode(JSON.stringify({ x402Version: 1, scheme: offer.scheme, network: offer.network, payload })) };
|
|
58506
|
+
}
|
|
58507
|
+
function readX402Receipt(res) {
|
|
58508
|
+
const h = res.headers.get("payment-response") ?? res.headers.get("x-payment-response");
|
|
58509
|
+
if (!h) return void 0;
|
|
58510
|
+
try {
|
|
58511
|
+
return JSON.parse(b64decode(h));
|
|
58512
|
+
} catch {
|
|
58513
|
+
return void 0;
|
|
58514
|
+
}
|
|
58515
|
+
}
|
|
56962
58516
|
|
|
56963
58517
|
// packages/sdk/index.ts
|
|
56964
58518
|
function createKillswitchAgent(opts) {
|
|
@@ -56988,12 +58542,12 @@ function createKillswitchAgent(opts) {
|
|
|
56988
58542
|
const c = await config2();
|
|
56989
58543
|
const out = {};
|
|
56990
58544
|
for (const [sym, raw] of Object.entries(a.balances)) {
|
|
56991
|
-
const dec = sym === "ETH" ? 18 : c.tokens[sym]?.decimals ?? 18;
|
|
58545
|
+
const dec = sym === "ETH" ? 18 : (c.tokens[sym] ?? Object.values(c.tokens).find((t) => t.symbol === sym))?.decimals ?? 18;
|
|
56992
58546
|
out[sym] = (Number(raw) / 10 ** dec).toString();
|
|
56993
58547
|
}
|
|
56994
58548
|
return out;
|
|
56995
58549
|
}
|
|
56996
|
-
async function send(calls, intent, ttlSec = 1800) {
|
|
58550
|
+
async function send(calls, intent, ttlSec = 1800, x402) {
|
|
56997
58551
|
const c = await config2();
|
|
56998
58552
|
const st = await status();
|
|
56999
58553
|
if (!st.exists) throw new Error("Killswitch: this agent has no permission on the wallet");
|
|
@@ -57003,7 +58557,7 @@ function createKillswitchAgent(opts) {
|
|
|
57003
58557
|
);
|
|
57004
58558
|
return api("/v1/ops", {
|
|
57005
58559
|
method: "POST",
|
|
57006
|
-
body: JSON.stringify({ account: opts.account, agentId: opts.agentId, calls: toWire(calls), deadline: deadline.toString(), signature, intent })
|
|
58560
|
+
body: JSON.stringify({ account: opts.account, agentId: opts.agentId, calls: toWire(calls), deadline: deadline.toString(), signature, intent, x402 })
|
|
57007
58561
|
});
|
|
57008
58562
|
}
|
|
57009
58563
|
async function transfer(symbol2, to, amount, intent) {
|
|
@@ -57037,7 +58591,179 @@ function createKillswitchAgent(opts) {
|
|
|
57037
58591
|
}
|
|
57038
58592
|
return api(`/v1/ops/${id}`);
|
|
57039
58593
|
}
|
|
57040
|
-
|
|
58594
|
+
async function payX402(url2, o = {}) {
|
|
58595
|
+
const c = await config2();
|
|
58596
|
+
const init = { method: o.method ?? "GET", headers: o.headers, body: o.body };
|
|
58597
|
+
const get = o.fetch ?? fetch;
|
|
58598
|
+
const first = await get(url2, init);
|
|
58599
|
+
if (first.status !== 402) return { paid: false, status: first.status, body: await first.text(), note: "no payment was asked" };
|
|
58600
|
+
const ask = await readX402Ask(first);
|
|
58601
|
+
const networks = x402NetworkIds(c.chainId);
|
|
58602
|
+
const tokens = Object.values(c.tokens);
|
|
58603
|
+
const req = (ask?.offers ?? []).find(
|
|
58604
|
+
(r) => r.scheme === "exact" && networks.includes(r.network) && tokens.some((t2) => t2.address.toLowerCase() === r.asset?.toLowerCase()) && (r.extra?.assetTransferMethod ?? "eip3009") === "eip3009"
|
|
58605
|
+
);
|
|
58606
|
+
if (!ask || !req) {
|
|
58607
|
+
const offered = (ask?.offers ?? []).map((r) => `${r.scheme} on ${r.network}${r.extra?.assetTransferMethod === "permit2" ? " (Permit2)" : ""}`).join(", ") || "nothing readable";
|
|
58608
|
+
return { paid: false, status: 402, body: "", note: `this site asks for a payment this wallet can't make (it offers: ${offered}; this wallet pays on ${networks.join(" / ")})` };
|
|
58609
|
+
}
|
|
58610
|
+
const t = tokens.find((x) => x.address.toLowerCase() === req.asset.toLowerCase());
|
|
58611
|
+
const value = BigInt(req.amount);
|
|
58612
|
+
const price = `${formatUnits(value, t.decimals)} ${t.symbol}`;
|
|
58613
|
+
if (o.maxAmount !== void 0 && value > parseUnits(o.maxAmount, t.decimals)) {
|
|
58614
|
+
return { paid: false, status: 402, body: "", price, note: `the site asks ${price}, more than the ${o.maxAmount} ${t.symbol} you allowed for this request` };
|
|
58615
|
+
}
|
|
58616
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
58617
|
+
const ttl = Math.min(Math.max(req.maxTimeoutSeconds ?? 300, 120), 3e3);
|
|
58618
|
+
const authorization = {
|
|
58619
|
+
from: opts.account,
|
|
58620
|
+
to: req.payTo,
|
|
58621
|
+
value: value.toString(),
|
|
58622
|
+
validAfter: "0",
|
|
58623
|
+
validBefore: String(now + ttl),
|
|
58624
|
+
nonce: toHex(crypto.getRandomValues(new Uint8Array(32)))
|
|
58625
|
+
};
|
|
58626
|
+
const intent = `x402: pay ${price} for ${req.resource || url2}${req.description ? ` (${req.description})` : ""}${o.reason ? `. ${o.reason}` : ""}`;
|
|
58627
|
+
let op = await send([authorizeTransferCall(opts.account, t.address, authorization)], intent, ttl, { url: req.resource || url2 });
|
|
58628
|
+
if (op.status === "held" && o.waitForApprovalMs) {
|
|
58629
|
+
const after = await waitForDecision(op.id, o.waitForApprovalMs);
|
|
58630
|
+
op = { ...op, status: after.status, txHash: after.tx_hash ?? void 0, reasons: after.reasons ?? op.reasons };
|
|
58631
|
+
}
|
|
58632
|
+
if (op.status !== "confirmed") return { paid: false, status: 402, body: "", price, op, note: `Killswitch did not approve the payment (${op.status})` };
|
|
58633
|
+
const payment = x402PaymentHeaders(ask, req, { authorization, signature: opts.agentId });
|
|
58634
|
+
const paidRes = await get(url2, { ...init, headers: { ...o.headers ?? {}, ...payment } });
|
|
58635
|
+
return {
|
|
58636
|
+
paid: paidRes.ok,
|
|
58637
|
+
status: paidRes.status,
|
|
58638
|
+
body: await paidRes.text(),
|
|
58639
|
+
price,
|
|
58640
|
+
payTo: req.payTo,
|
|
58641
|
+
op,
|
|
58642
|
+
settlement: readX402Receipt(paidRes),
|
|
58643
|
+
x402Version: req.version,
|
|
58644
|
+
note: paidRes.ok ? void 0 : "the site refused the payment after Killswitch approved it; the approval expires unused"
|
|
58645
|
+
};
|
|
58646
|
+
}
|
|
58647
|
+
return { address: signer.address, config: config2, status, balances, send, transfer, swap, payX402, waitForDecision };
|
|
58648
|
+
}
|
|
58649
|
+
|
|
58650
|
+
// packages/sdk/actions.ts
|
|
58651
|
+
var ACTIONS = {
|
|
58652
|
+
status: {
|
|
58653
|
+
name: "wallet_status",
|
|
58654
|
+
description: "Show what this agent is allowed to do with the user's wallet: active/paused, allowed actions, spending caps and how much is left, plus wallet balances. Call this before spending.",
|
|
58655
|
+
fields: {}
|
|
58656
|
+
},
|
|
58657
|
+
send: {
|
|
58658
|
+
name: "wallet_send",
|
|
58659
|
+
description: "Send tokens from the user's wallet. Subject to the owner's caps and guardian review. Always state the real reason in `reason`.",
|
|
58660
|
+
fields: {
|
|
58661
|
+
token: { description: "Token symbol, e.g. USDC" },
|
|
58662
|
+
to: { description: "Recipient address (0x\u2026)" },
|
|
58663
|
+
amount: { description: 'Amount in whole units, e.g. "12.5"' },
|
|
58664
|
+
reason: { description: "Why you are sending this, in plain words" }
|
|
58665
|
+
}
|
|
58666
|
+
},
|
|
58667
|
+
swap: {
|
|
58668
|
+
name: "wallet_swap",
|
|
58669
|
+
description: "Swap one token for another on the approved exchange (e.g. USDC \u2192 WETH). Subject to the owner's caps and guardian review.",
|
|
58670
|
+
fields: {
|
|
58671
|
+
from: { description: "Token to sell, e.g. USDC" },
|
|
58672
|
+
to: { description: "Token to buy, e.g. WETH" },
|
|
58673
|
+
amount: { description: "Amount of `from` to sell, in whole units" },
|
|
58674
|
+
reason: { description: "Why you are making this trade" }
|
|
58675
|
+
}
|
|
58676
|
+
},
|
|
58677
|
+
payX402: {
|
|
58678
|
+
name: "wallet_pay_x402",
|
|
58679
|
+
description: "Fetch a paid web resource or API that charges per request with x402 (it answers HTTP 402 Payment Required). The price the site asks is paid from the user's wallet only if the owner's caps and guardian review allow it, and the response is returned. Use it when a site or API asks for payment; set maxAmount to the most you would pay.",
|
|
58680
|
+
fields: {
|
|
58681
|
+
url: { description: "The URL to fetch, e.g. https://api.example.com/report" },
|
|
58682
|
+
method: { description: "HTTP method, default GET", optional: true },
|
|
58683
|
+
body: { description: "Request body for POST/PUT, as text (e.g. JSON)", optional: true },
|
|
58684
|
+
maxAmount: { description: 'The most this one request may cost, in whole token units, e.g. "0.10"', optional: true },
|
|
58685
|
+
reason: { description: "Why you are buying this, in plain words" }
|
|
58686
|
+
}
|
|
58687
|
+
}
|
|
58688
|
+
};
|
|
58689
|
+
function zodShape(z2, spec) {
|
|
58690
|
+
return Object.fromEntries(
|
|
58691
|
+
Object.entries(spec.fields).map(([k, f]) => {
|
|
58692
|
+
const s = z2.string().describe(f.description);
|
|
58693
|
+
return [k, f.optional ? s.optional() : s];
|
|
58694
|
+
})
|
|
58695
|
+
);
|
|
58696
|
+
}
|
|
58697
|
+
function explain(r) {
|
|
58698
|
+
const lines = [`status: ${r.status}`];
|
|
58699
|
+
if (r.status === "confirmed") lines.push(`done. tx ${r.txHash}`);
|
|
58700
|
+
if (r.status === "held") lines.push("The wallet owner must approve this operation. Do not retry; tell the user it is waiting for approval.");
|
|
58701
|
+
if (r.status === "blocked" || r.status === "rejected") lines.push("This operation is NOT allowed. Do not retry or try to work around it; report it to the user.");
|
|
58702
|
+
if (r.paused) lines.push("Your permission has been PAUSED by the guardian. Stop using the wallet and tell the user.");
|
|
58703
|
+
if (r.reasons?.length) lines.push("reasons:", ...r.reasons.map((x) => `- ${x}`));
|
|
58704
|
+
if (r.remaining) lines.push(`remaining allowance this period: ${Object.values(r.remaining).join(", ")}`);
|
|
58705
|
+
return lines.join("\n");
|
|
58706
|
+
}
|
|
58707
|
+
var str = (v) => typeof v === "string" ? v : JSON.stringify(v, null, 2);
|
|
58708
|
+
function walletActions(agent2, opts = {}) {
|
|
58709
|
+
const guard = (fn) => fn().catch((e) => `error: ${e.message}`);
|
|
58710
|
+
return {
|
|
58711
|
+
status: () => guard(async () => {
|
|
58712
|
+
const [s, b] = await Promise.all([agent2.status(), agent2.balances()]);
|
|
58713
|
+
return str({
|
|
58714
|
+
agent: s.label,
|
|
58715
|
+
active: s.active,
|
|
58716
|
+
paused: s.paused,
|
|
58717
|
+
killed: s.killed,
|
|
58718
|
+
expires: new Date(s.validUntil * 1e3).toISOString(),
|
|
58719
|
+
allowed: s.rules.map((r) => r.name),
|
|
58720
|
+
caps: s.limits.map((l) => `${l.text} used this period (guardian co-signs single ops above ${Number(l.cosignAbove) / 10 ** l.decimals} ${l.symbol})`),
|
|
58721
|
+
balances: b,
|
|
58722
|
+
networkFees: "Paid by the Killswitch relayer. This wallet needs no ETH for gas; the agent never pays fees."
|
|
58723
|
+
});
|
|
58724
|
+
}),
|
|
58725
|
+
send: (a) => guard(async () => {
|
|
58726
|
+
if (!isAddress(a.to)) return "invalid recipient address";
|
|
58727
|
+
return explain(await agent2.transfer(a.token, a.to, a.amount, a.reason));
|
|
58728
|
+
}),
|
|
58729
|
+
swap: (a) => guard(async () => explain(await agent2.swap(a.from, a.to, a.amount, a.reason))),
|
|
58730
|
+
payX402: (a) => guard(async () => {
|
|
58731
|
+
try {
|
|
58732
|
+
new URL(a.url);
|
|
58733
|
+
} catch {
|
|
58734
|
+
return "invalid url";
|
|
58735
|
+
}
|
|
58736
|
+
const headers = a.body ? { "content-type": "application/json" } : void 0;
|
|
58737
|
+
const r = await agent2.payX402(a.url, {
|
|
58738
|
+
method: a.method,
|
|
58739
|
+
body: a.body,
|
|
58740
|
+
headers,
|
|
58741
|
+
maxAmount: a.maxAmount,
|
|
58742
|
+
reason: a.reason,
|
|
58743
|
+
waitForApprovalMs: opts.waitForApprovalMs ?? 9e4,
|
|
58744
|
+
fetch: opts.fetch
|
|
58745
|
+
});
|
|
58746
|
+
const lines = [r.paid ? `paid ${r.price} to ${r.payTo}` : r.note ?? `not paid (HTTP ${r.status})`];
|
|
58747
|
+
if (r.op && !r.paid) lines.push(explain(r.op));
|
|
58748
|
+
if (r.op?.status === "held") lines.push("The owner has not decided yet. Tell the user the payment is waiting for approval in the Killswitch dashboard.");
|
|
58749
|
+
if (r.settlement?.transaction) lines.push(`settled on-chain: ${r.settlement.transaction}`);
|
|
58750
|
+
if (r.body) lines.push(`HTTP ${r.status} response:`, r.body.length > 6e3 ? `${r.body.slice(0, 6e3)}
|
|
58751
|
+
\u2026 (truncated)` : r.body);
|
|
58752
|
+
return lines.join("\n");
|
|
58753
|
+
})
|
|
58754
|
+
};
|
|
58755
|
+
}
|
|
58756
|
+
|
|
58757
|
+
// packages/mcp/tools.ts
|
|
58758
|
+
var SERVER_INFO = { name: "killswitch-wallet", version: "0.2.0" };
|
|
58759
|
+
var text = (t) => ({ content: [{ type: "text", text: t }] });
|
|
58760
|
+
function registerWalletTools(server2, agent2, opts = {}) {
|
|
58761
|
+
const run = walletActions(agent2, opts);
|
|
58762
|
+
const tool = (spec, fn) => server2.registerTool(spec.name, { description: spec.description, inputSchema: zodShape(external_exports, spec) }, async (a) => text(await fn(a)));
|
|
58763
|
+
tool(ACTIONS.status, () => run.status());
|
|
58764
|
+
tool(ACTIONS.send, run.send);
|
|
58765
|
+
tool(ACTIONS.swap, run.swap);
|
|
58766
|
+
tool(ACTIONS.payX402, run.payX402);
|
|
57041
58767
|
}
|
|
57042
58768
|
|
|
57043
58769
|
// packages/mcp/server.ts
|
|
@@ -57055,78 +58781,8 @@ var agent = createKillswitchAgent({
|
|
|
57055
58781
|
agentId: env("KS_AGENT_ID"),
|
|
57056
58782
|
sessionKey: env("KS_SESSION_KEY")
|
|
57057
58783
|
});
|
|
57058
|
-
var server = new McpServer(
|
|
57059
|
-
|
|
57060
|
-
function explain(r) {
|
|
57061
|
-
const lines = [`status: ${r.status}`];
|
|
57062
|
-
if (r.status === "confirmed") lines.push(`done. tx ${r.txHash}`);
|
|
57063
|
-
if (r.status === "held") lines.push("The wallet owner must approve this operation. Do not retry; tell the user it is waiting for approval.");
|
|
57064
|
-
if (r.status === "blocked" || r.status === "rejected") lines.push("This operation is NOT allowed. Do not retry or try to work around it; report it to the user.");
|
|
57065
|
-
if (r.paused) lines.push("Your permission has been PAUSED by the guardian. Stop using the wallet and tell the user.");
|
|
57066
|
-
if (r.reasons?.length) lines.push("reasons:", ...r.reasons.map((x) => `- ${x}`));
|
|
57067
|
-
if (r.remaining) lines.push(`remaining allowance this period: ${Object.values(r.remaining).join(", ")}`);
|
|
57068
|
-
return lines.join("\n");
|
|
57069
|
-
}
|
|
57070
|
-
server.registerTool(
|
|
57071
|
-
"wallet_status",
|
|
57072
|
-
{
|
|
57073
|
-
description: "Show what this agent is allowed to do with the user's wallet: active/paused, allowed actions, spending caps and how much is left, plus wallet balances. Call this before spending.",
|
|
57074
|
-
inputSchema: {}
|
|
57075
|
-
},
|
|
57076
|
-
async () => {
|
|
57077
|
-
const [s, b] = await Promise.all([agent.status(), agent.balances()]);
|
|
57078
|
-
return text({
|
|
57079
|
-
agent: s.label,
|
|
57080
|
-
active: s.active,
|
|
57081
|
-
paused: s.paused,
|
|
57082
|
-
killed: s.killed,
|
|
57083
|
-
expires: new Date(s.validUntil * 1e3).toISOString(),
|
|
57084
|
-
allowed: s.rules.map((r) => r.name),
|
|
57085
|
-
caps: s.limits.map((l) => `${l.text} used this period (guardian co-signs single ops above ${Number(l.cosignAbove) / 10 ** l.decimals} ${l.symbol})`),
|
|
57086
|
-
balances: b,
|
|
57087
|
-
networkFees: "Paid by the Killswitch relayer. This wallet needs no ETH for gas; the agent never pays fees."
|
|
57088
|
-
});
|
|
57089
|
-
}
|
|
57090
|
-
);
|
|
57091
|
-
server.registerTool(
|
|
57092
|
-
"wallet_send",
|
|
57093
|
-
{
|
|
57094
|
-
description: "Send tokens from the user's wallet. Subject to the owner's caps and guardian review. Always state the real reason in `reason`.",
|
|
57095
|
-
inputSchema: {
|
|
57096
|
-
token: external_exports.string().describe("Token symbol, e.g. USDC"),
|
|
57097
|
-
to: external_exports.string().describe("Recipient address (0x\u2026)"),
|
|
57098
|
-
amount: external_exports.string().describe('Amount in whole units, e.g. "12.5"'),
|
|
57099
|
-
reason: external_exports.string().describe("Why you are sending this, in plain words")
|
|
57100
|
-
}
|
|
57101
|
-
},
|
|
57102
|
-
async ({ token, to, amount, reason }) => {
|
|
57103
|
-
if (!isAddress(to)) return text("invalid recipient address");
|
|
57104
|
-
try {
|
|
57105
|
-
return text(explain(await agent.transfer(token, to, amount, reason)));
|
|
57106
|
-
} catch (e) {
|
|
57107
|
-
return text(`error: ${e.message}`);
|
|
57108
|
-
}
|
|
57109
|
-
}
|
|
57110
|
-
);
|
|
57111
|
-
server.registerTool(
|
|
57112
|
-
"wallet_swap",
|
|
57113
|
-
{
|
|
57114
|
-
description: "Swap one token for another on the approved exchange (e.g. USDC \u2192 WETH). Subject to the owner's caps and guardian review.",
|
|
57115
|
-
inputSchema: {
|
|
57116
|
-
from: external_exports.string().describe("Token to sell, e.g. USDC"),
|
|
57117
|
-
to: external_exports.string().describe("Token to buy, e.g. WETH"),
|
|
57118
|
-
amount: external_exports.string().describe("Amount of `from` to sell, in whole units"),
|
|
57119
|
-
reason: external_exports.string().describe("Why you are making this trade")
|
|
57120
|
-
}
|
|
57121
|
-
},
|
|
57122
|
-
async ({ from: from16, to, amount, reason }) => {
|
|
57123
|
-
try {
|
|
57124
|
-
return text(explain(await agent.swap(from16, to, amount, reason)));
|
|
57125
|
-
} catch (e) {
|
|
57126
|
-
return text(`error: ${e.message}`);
|
|
57127
|
-
}
|
|
57128
|
-
}
|
|
57129
|
-
);
|
|
58784
|
+
var server = new McpServer(SERVER_INFO);
|
|
58785
|
+
registerWalletTools(server, agent);
|
|
57130
58786
|
await server.connect(new StdioServerTransport());
|
|
57131
58787
|
console.error(`killswitch-wallet MCP ready (agent key ${agent.address})`);
|
|
57132
58788
|
/*! Bundled license information:
|