@0xsequence/relayer 2.3.28 → 2.3.30
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.
|
@@ -287,14 +287,14 @@ function isAbstractSigner(signer) {
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/* eslint-disable */
|
|
290
|
-
// sequence-relayer v0.4.1
|
|
290
|
+
// sequence-relayer v0.4.1 62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a
|
|
291
291
|
// --
|
|
292
|
-
// Code generated by webrpc-gen@v0.
|
|
292
|
+
// Code generated by webrpc-gen@v0.26.0 with typescript generator. DO NOT EDIT.
|
|
293
293
|
//
|
|
294
294
|
// webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
|
|
295
295
|
|
|
296
296
|
const WebrpcHeader = "Webrpc";
|
|
297
|
-
const WebrpcHeaderValue = "webrpc@v0.
|
|
297
|
+
const WebrpcHeaderValue = "webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1";
|
|
298
298
|
|
|
299
299
|
// WebRPC description and code-gen version
|
|
300
300
|
const WebRPCVersion = "v1";
|
|
@@ -303,7 +303,7 @@ const WebRPCVersion = "v1";
|
|
|
303
303
|
const WebRPCSchemaVersion = "v0.4.1";
|
|
304
304
|
|
|
305
305
|
// Schema hash generated from your RIDL schema
|
|
306
|
-
const WebRPCSchemaHash = "
|
|
306
|
+
const WebRPCSchemaHash = "62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a";
|
|
307
307
|
function VersionFromHeader(headers) {
|
|
308
308
|
const headerValue = headers.get(WebrpcHeader);
|
|
309
309
|
if (!headerValue) {
|
|
@@ -352,6 +352,7 @@ let ETHTxnStatus = /*#__PURE__*/function (ETHTxnStatus) {
|
|
|
352
352
|
ETHTxnStatus["SUCCEEDED"] = "SUCCEEDED";
|
|
353
353
|
ETHTxnStatus["PARTIALLY_FAILED"] = "PARTIALLY_FAILED";
|
|
354
354
|
ETHTxnStatus["FAILED"] = "FAILED";
|
|
355
|
+
ETHTxnStatus["PENDING_PRECONDITION"] = "PENDING_PRECONDITION";
|
|
355
356
|
return ETHTxnStatus;
|
|
356
357
|
}({});
|
|
357
358
|
let TransferType = /*#__PURE__*/function (TransferType) {
|
|
@@ -363,6 +364,15 @@ let TransferType = /*#__PURE__*/function (TransferType) {
|
|
|
363
364
|
TransferType["UNKNOWN"] = "UNKNOWN";
|
|
364
365
|
return TransferType;
|
|
365
366
|
}({});
|
|
367
|
+
let SimulateStatus = /*#__PURE__*/function (SimulateStatus) {
|
|
368
|
+
SimulateStatus["SKIPPED"] = "SKIPPED";
|
|
369
|
+
SimulateStatus["SUCCEEDED"] = "SUCCEEDED";
|
|
370
|
+
SimulateStatus["FAILED"] = "FAILED";
|
|
371
|
+
SimulateStatus["ABORTED"] = "ABORTED";
|
|
372
|
+
SimulateStatus["REVERTED"] = "REVERTED";
|
|
373
|
+
SimulateStatus["NOT_ENOUGH_GAS"] = "NOT_ENOUGH_GAS";
|
|
374
|
+
return SimulateStatus;
|
|
375
|
+
}({});
|
|
366
376
|
let FeeTokenType = /*#__PURE__*/function (FeeTokenType) {
|
|
367
377
|
FeeTokenType["UNKNOWN"] = "UNKNOWN";
|
|
368
378
|
FeeTokenType["ERC20_TOKEN"] = "ERC20_TOKEN";
|
|
@@ -500,6 +510,19 @@ class Relayer {
|
|
|
500
510
|
});
|
|
501
511
|
});
|
|
502
512
|
};
|
|
513
|
+
this.simulateV3 = (args, headers, signal) => {
|
|
514
|
+
return this.fetch(this.url('SimulateV3'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
515
|
+
return buildResponse(res).then(_data => {
|
|
516
|
+
return {
|
|
517
|
+
results: _data.results
|
|
518
|
+
};
|
|
519
|
+
});
|
|
520
|
+
}, error => {
|
|
521
|
+
throw WebrpcRequestFailedError.new({
|
|
522
|
+
cause: `fetch(): ${error.message || ''}`
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
};
|
|
503
526
|
this.updateMetaTxnGasLimits = (args, headers, signal) => {
|
|
504
527
|
return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
505
528
|
return buildResponse(res).then(_data => {
|
|
@@ -1109,6 +1132,12 @@ class NotEnoughBalanceError extends WebrpcError {
|
|
|
1109
1132
|
Object.setPrototypeOf(this, NotEnoughBalanceError.prototype);
|
|
1110
1133
|
}
|
|
1111
1134
|
}
|
|
1135
|
+
class SimulationFailedError extends WebrpcError {
|
|
1136
|
+
constructor(name = 'SimulationFailed', code = 3006, message = `Simulation failed`, status = 0, cause) {
|
|
1137
|
+
super(name, code, message, status, cause);
|
|
1138
|
+
Object.setPrototypeOf(this, SimulationFailedError.prototype);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1112
1141
|
let errors = /*#__PURE__*/function (errors) {
|
|
1113
1142
|
errors["WebrpcEndpoint"] = "WebrpcEndpoint";
|
|
1114
1143
|
errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
|
|
@@ -1147,6 +1176,7 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
1147
1176
|
errors["NotFound"] = "NotFound";
|
|
1148
1177
|
errors["InsufficientFee"] = "InsufficientFee";
|
|
1149
1178
|
errors["NotEnoughBalance"] = "NotEnoughBalance";
|
|
1179
|
+
errors["SimulationFailed"] = "SimulationFailed";
|
|
1150
1180
|
return errors;
|
|
1151
1181
|
}({});
|
|
1152
1182
|
let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
@@ -1187,6 +1217,7 @@ let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
|
1187
1217
|
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
|
|
1188
1218
|
WebrpcErrorCodes[WebrpcErrorCodes["InsufficientFee"] = 3004] = "InsufficientFee";
|
|
1189
1219
|
WebrpcErrorCodes[WebrpcErrorCodes["NotEnoughBalance"] = 3005] = "NotEnoughBalance";
|
|
1220
|
+
WebrpcErrorCodes[WebrpcErrorCodes["SimulationFailed"] = 3006] = "SimulationFailed";
|
|
1190
1221
|
return WebrpcErrorCodes;
|
|
1191
1222
|
}({});
|
|
1192
1223
|
const webrpcErrorByCode = {
|
|
@@ -1226,7 +1257,8 @@ const webrpcErrorByCode = {
|
|
|
1226
1257
|
[2003]: QueryFailedError,
|
|
1227
1258
|
[3000]: NotFoundError,
|
|
1228
1259
|
[3004]: InsufficientFeeError,
|
|
1229
|
-
[3005]: NotEnoughBalanceError
|
|
1260
|
+
[3005]: NotEnoughBalanceError,
|
|
1261
|
+
[3006]: SimulationFailedError
|
|
1230
1262
|
};
|
|
1231
1263
|
|
|
1232
1264
|
var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
@@ -1239,6 +1271,7 @@ var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
|
1239
1271
|
VersionFromHeader: VersionFromHeader,
|
|
1240
1272
|
ETHTxnStatus: ETHTxnStatus,
|
|
1241
1273
|
TransferType: TransferType,
|
|
1274
|
+
SimulateStatus: SimulateStatus,
|
|
1242
1275
|
FeeTokenType: FeeTokenType,
|
|
1243
1276
|
SortOrder: SortOrder,
|
|
1244
1277
|
Relayer: Relayer,
|
|
@@ -1280,6 +1313,7 @@ var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
|
1280
1313
|
NotFoundError: NotFoundError,
|
|
1281
1314
|
InsufficientFeeError: InsufficientFeeError,
|
|
1282
1315
|
NotEnoughBalanceError: NotEnoughBalanceError,
|
|
1316
|
+
SimulationFailedError: SimulationFailedError,
|
|
1283
1317
|
errors: errors,
|
|
1284
1318
|
WebrpcErrorCodes: WebrpcErrorCodes,
|
|
1285
1319
|
webrpcErrorByCode: webrpcErrorByCode
|
|
@@ -287,14 +287,14 @@ function isAbstractSigner(signer) {
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/* eslint-disable */
|
|
290
|
-
// sequence-relayer v0.4.1
|
|
290
|
+
// sequence-relayer v0.4.1 62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a
|
|
291
291
|
// --
|
|
292
|
-
// Code generated by webrpc-gen@v0.
|
|
292
|
+
// Code generated by webrpc-gen@v0.26.0 with typescript generator. DO NOT EDIT.
|
|
293
293
|
//
|
|
294
294
|
// webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
|
|
295
295
|
|
|
296
296
|
const WebrpcHeader = "Webrpc";
|
|
297
|
-
const WebrpcHeaderValue = "webrpc@v0.
|
|
297
|
+
const WebrpcHeaderValue = "webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1";
|
|
298
298
|
|
|
299
299
|
// WebRPC description and code-gen version
|
|
300
300
|
const WebRPCVersion = "v1";
|
|
@@ -303,7 +303,7 @@ const WebRPCVersion = "v1";
|
|
|
303
303
|
const WebRPCSchemaVersion = "v0.4.1";
|
|
304
304
|
|
|
305
305
|
// Schema hash generated from your RIDL schema
|
|
306
|
-
const WebRPCSchemaHash = "
|
|
306
|
+
const WebRPCSchemaHash = "62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a";
|
|
307
307
|
function VersionFromHeader(headers) {
|
|
308
308
|
const headerValue = headers.get(WebrpcHeader);
|
|
309
309
|
if (!headerValue) {
|
|
@@ -352,6 +352,7 @@ let ETHTxnStatus = /*#__PURE__*/function (ETHTxnStatus) {
|
|
|
352
352
|
ETHTxnStatus["SUCCEEDED"] = "SUCCEEDED";
|
|
353
353
|
ETHTxnStatus["PARTIALLY_FAILED"] = "PARTIALLY_FAILED";
|
|
354
354
|
ETHTxnStatus["FAILED"] = "FAILED";
|
|
355
|
+
ETHTxnStatus["PENDING_PRECONDITION"] = "PENDING_PRECONDITION";
|
|
355
356
|
return ETHTxnStatus;
|
|
356
357
|
}({});
|
|
357
358
|
let TransferType = /*#__PURE__*/function (TransferType) {
|
|
@@ -363,6 +364,15 @@ let TransferType = /*#__PURE__*/function (TransferType) {
|
|
|
363
364
|
TransferType["UNKNOWN"] = "UNKNOWN";
|
|
364
365
|
return TransferType;
|
|
365
366
|
}({});
|
|
367
|
+
let SimulateStatus = /*#__PURE__*/function (SimulateStatus) {
|
|
368
|
+
SimulateStatus["SKIPPED"] = "SKIPPED";
|
|
369
|
+
SimulateStatus["SUCCEEDED"] = "SUCCEEDED";
|
|
370
|
+
SimulateStatus["FAILED"] = "FAILED";
|
|
371
|
+
SimulateStatus["ABORTED"] = "ABORTED";
|
|
372
|
+
SimulateStatus["REVERTED"] = "REVERTED";
|
|
373
|
+
SimulateStatus["NOT_ENOUGH_GAS"] = "NOT_ENOUGH_GAS";
|
|
374
|
+
return SimulateStatus;
|
|
375
|
+
}({});
|
|
366
376
|
let FeeTokenType = /*#__PURE__*/function (FeeTokenType) {
|
|
367
377
|
FeeTokenType["UNKNOWN"] = "UNKNOWN";
|
|
368
378
|
FeeTokenType["ERC20_TOKEN"] = "ERC20_TOKEN";
|
|
@@ -500,6 +510,19 @@ class Relayer {
|
|
|
500
510
|
});
|
|
501
511
|
});
|
|
502
512
|
};
|
|
513
|
+
this.simulateV3 = (args, headers, signal) => {
|
|
514
|
+
return this.fetch(this.url('SimulateV3'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
515
|
+
return buildResponse(res).then(_data => {
|
|
516
|
+
return {
|
|
517
|
+
results: _data.results
|
|
518
|
+
};
|
|
519
|
+
});
|
|
520
|
+
}, error => {
|
|
521
|
+
throw WebrpcRequestFailedError.new({
|
|
522
|
+
cause: `fetch(): ${error.message || ''}`
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
};
|
|
503
526
|
this.updateMetaTxnGasLimits = (args, headers, signal) => {
|
|
504
527
|
return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
505
528
|
return buildResponse(res).then(_data => {
|
|
@@ -1109,6 +1132,12 @@ class NotEnoughBalanceError extends WebrpcError {
|
|
|
1109
1132
|
Object.setPrototypeOf(this, NotEnoughBalanceError.prototype);
|
|
1110
1133
|
}
|
|
1111
1134
|
}
|
|
1135
|
+
class SimulationFailedError extends WebrpcError {
|
|
1136
|
+
constructor(name = 'SimulationFailed', code = 3006, message = `Simulation failed`, status = 0, cause) {
|
|
1137
|
+
super(name, code, message, status, cause);
|
|
1138
|
+
Object.setPrototypeOf(this, SimulationFailedError.prototype);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1112
1141
|
let errors = /*#__PURE__*/function (errors) {
|
|
1113
1142
|
errors["WebrpcEndpoint"] = "WebrpcEndpoint";
|
|
1114
1143
|
errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
|
|
@@ -1147,6 +1176,7 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
1147
1176
|
errors["NotFound"] = "NotFound";
|
|
1148
1177
|
errors["InsufficientFee"] = "InsufficientFee";
|
|
1149
1178
|
errors["NotEnoughBalance"] = "NotEnoughBalance";
|
|
1179
|
+
errors["SimulationFailed"] = "SimulationFailed";
|
|
1150
1180
|
return errors;
|
|
1151
1181
|
}({});
|
|
1152
1182
|
let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
@@ -1187,6 +1217,7 @@ let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
|
1187
1217
|
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
|
|
1188
1218
|
WebrpcErrorCodes[WebrpcErrorCodes["InsufficientFee"] = 3004] = "InsufficientFee";
|
|
1189
1219
|
WebrpcErrorCodes[WebrpcErrorCodes["NotEnoughBalance"] = 3005] = "NotEnoughBalance";
|
|
1220
|
+
WebrpcErrorCodes[WebrpcErrorCodes["SimulationFailed"] = 3006] = "SimulationFailed";
|
|
1190
1221
|
return WebrpcErrorCodes;
|
|
1191
1222
|
}({});
|
|
1192
1223
|
const webrpcErrorByCode = {
|
|
@@ -1226,7 +1257,8 @@ const webrpcErrorByCode = {
|
|
|
1226
1257
|
[2003]: QueryFailedError,
|
|
1227
1258
|
[3000]: NotFoundError,
|
|
1228
1259
|
[3004]: InsufficientFeeError,
|
|
1229
|
-
[3005]: NotEnoughBalanceError
|
|
1260
|
+
[3005]: NotEnoughBalanceError,
|
|
1261
|
+
[3006]: SimulationFailedError
|
|
1230
1262
|
};
|
|
1231
1263
|
|
|
1232
1264
|
var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
@@ -1239,6 +1271,7 @@ var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
|
1239
1271
|
VersionFromHeader: VersionFromHeader,
|
|
1240
1272
|
ETHTxnStatus: ETHTxnStatus,
|
|
1241
1273
|
TransferType: TransferType,
|
|
1274
|
+
SimulateStatus: SimulateStatus,
|
|
1242
1275
|
FeeTokenType: FeeTokenType,
|
|
1243
1276
|
SortOrder: SortOrder,
|
|
1244
1277
|
Relayer: Relayer,
|
|
@@ -1280,6 +1313,7 @@ var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
|
1280
1313
|
NotFoundError: NotFoundError,
|
|
1281
1314
|
InsufficientFeeError: InsufficientFeeError,
|
|
1282
1315
|
NotEnoughBalanceError: NotEnoughBalanceError,
|
|
1316
|
+
SimulationFailedError: SimulationFailedError,
|
|
1283
1317
|
errors: errors,
|
|
1284
1318
|
WebrpcErrorCodes: WebrpcErrorCodes,
|
|
1285
1319
|
webrpcErrorByCode: webrpcErrorByCode
|
|
@@ -283,14 +283,14 @@ function isAbstractSigner(signer) {
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
/* eslint-disable */
|
|
286
|
-
// sequence-relayer v0.4.1
|
|
286
|
+
// sequence-relayer v0.4.1 62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a
|
|
287
287
|
// --
|
|
288
|
-
// Code generated by webrpc-gen@v0.
|
|
288
|
+
// Code generated by webrpc-gen@v0.26.0 with typescript generator. DO NOT EDIT.
|
|
289
289
|
//
|
|
290
290
|
// webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
|
|
291
291
|
|
|
292
292
|
const WebrpcHeader = "Webrpc";
|
|
293
|
-
const WebrpcHeaderValue = "webrpc@v0.
|
|
293
|
+
const WebrpcHeaderValue = "webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1";
|
|
294
294
|
|
|
295
295
|
// WebRPC description and code-gen version
|
|
296
296
|
const WebRPCVersion = "v1";
|
|
@@ -299,7 +299,7 @@ const WebRPCVersion = "v1";
|
|
|
299
299
|
const WebRPCSchemaVersion = "v0.4.1";
|
|
300
300
|
|
|
301
301
|
// Schema hash generated from your RIDL schema
|
|
302
|
-
const WebRPCSchemaHash = "
|
|
302
|
+
const WebRPCSchemaHash = "62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a";
|
|
303
303
|
function VersionFromHeader(headers) {
|
|
304
304
|
const headerValue = headers.get(WebrpcHeader);
|
|
305
305
|
if (!headerValue) {
|
|
@@ -348,6 +348,7 @@ let ETHTxnStatus = /*#__PURE__*/function (ETHTxnStatus) {
|
|
|
348
348
|
ETHTxnStatus["SUCCEEDED"] = "SUCCEEDED";
|
|
349
349
|
ETHTxnStatus["PARTIALLY_FAILED"] = "PARTIALLY_FAILED";
|
|
350
350
|
ETHTxnStatus["FAILED"] = "FAILED";
|
|
351
|
+
ETHTxnStatus["PENDING_PRECONDITION"] = "PENDING_PRECONDITION";
|
|
351
352
|
return ETHTxnStatus;
|
|
352
353
|
}({});
|
|
353
354
|
let TransferType = /*#__PURE__*/function (TransferType) {
|
|
@@ -359,6 +360,15 @@ let TransferType = /*#__PURE__*/function (TransferType) {
|
|
|
359
360
|
TransferType["UNKNOWN"] = "UNKNOWN";
|
|
360
361
|
return TransferType;
|
|
361
362
|
}({});
|
|
363
|
+
let SimulateStatus = /*#__PURE__*/function (SimulateStatus) {
|
|
364
|
+
SimulateStatus["SKIPPED"] = "SKIPPED";
|
|
365
|
+
SimulateStatus["SUCCEEDED"] = "SUCCEEDED";
|
|
366
|
+
SimulateStatus["FAILED"] = "FAILED";
|
|
367
|
+
SimulateStatus["ABORTED"] = "ABORTED";
|
|
368
|
+
SimulateStatus["REVERTED"] = "REVERTED";
|
|
369
|
+
SimulateStatus["NOT_ENOUGH_GAS"] = "NOT_ENOUGH_GAS";
|
|
370
|
+
return SimulateStatus;
|
|
371
|
+
}({});
|
|
362
372
|
let FeeTokenType = /*#__PURE__*/function (FeeTokenType) {
|
|
363
373
|
FeeTokenType["UNKNOWN"] = "UNKNOWN";
|
|
364
374
|
FeeTokenType["ERC20_TOKEN"] = "ERC20_TOKEN";
|
|
@@ -496,6 +506,19 @@ class Relayer {
|
|
|
496
506
|
});
|
|
497
507
|
});
|
|
498
508
|
};
|
|
509
|
+
this.simulateV3 = (args, headers, signal) => {
|
|
510
|
+
return this.fetch(this.url('SimulateV3'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
511
|
+
return buildResponse(res).then(_data => {
|
|
512
|
+
return {
|
|
513
|
+
results: _data.results
|
|
514
|
+
};
|
|
515
|
+
});
|
|
516
|
+
}, error => {
|
|
517
|
+
throw WebrpcRequestFailedError.new({
|
|
518
|
+
cause: `fetch(): ${error.message || ''}`
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
};
|
|
499
522
|
this.updateMetaTxnGasLimits = (args, headers, signal) => {
|
|
500
523
|
return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
501
524
|
return buildResponse(res).then(_data => {
|
|
@@ -1105,6 +1128,12 @@ class NotEnoughBalanceError extends WebrpcError {
|
|
|
1105
1128
|
Object.setPrototypeOf(this, NotEnoughBalanceError.prototype);
|
|
1106
1129
|
}
|
|
1107
1130
|
}
|
|
1131
|
+
class SimulationFailedError extends WebrpcError {
|
|
1132
|
+
constructor(name = 'SimulationFailed', code = 3006, message = `Simulation failed`, status = 0, cause) {
|
|
1133
|
+
super(name, code, message, status, cause);
|
|
1134
|
+
Object.setPrototypeOf(this, SimulationFailedError.prototype);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1108
1137
|
let errors = /*#__PURE__*/function (errors) {
|
|
1109
1138
|
errors["WebrpcEndpoint"] = "WebrpcEndpoint";
|
|
1110
1139
|
errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
|
|
@@ -1143,6 +1172,7 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
1143
1172
|
errors["NotFound"] = "NotFound";
|
|
1144
1173
|
errors["InsufficientFee"] = "InsufficientFee";
|
|
1145
1174
|
errors["NotEnoughBalance"] = "NotEnoughBalance";
|
|
1175
|
+
errors["SimulationFailed"] = "SimulationFailed";
|
|
1146
1176
|
return errors;
|
|
1147
1177
|
}({});
|
|
1148
1178
|
let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
@@ -1183,6 +1213,7 @@ let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
|
1183
1213
|
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
|
|
1184
1214
|
WebrpcErrorCodes[WebrpcErrorCodes["InsufficientFee"] = 3004] = "InsufficientFee";
|
|
1185
1215
|
WebrpcErrorCodes[WebrpcErrorCodes["NotEnoughBalance"] = 3005] = "NotEnoughBalance";
|
|
1216
|
+
WebrpcErrorCodes[WebrpcErrorCodes["SimulationFailed"] = 3006] = "SimulationFailed";
|
|
1186
1217
|
return WebrpcErrorCodes;
|
|
1187
1218
|
}({});
|
|
1188
1219
|
const webrpcErrorByCode = {
|
|
@@ -1222,7 +1253,8 @@ const webrpcErrorByCode = {
|
|
|
1222
1253
|
[2003]: QueryFailedError,
|
|
1223
1254
|
[3000]: NotFoundError,
|
|
1224
1255
|
[3004]: InsufficientFeeError,
|
|
1225
|
-
[3005]: NotEnoughBalanceError
|
|
1256
|
+
[3005]: NotEnoughBalanceError,
|
|
1257
|
+
[3006]: SimulationFailedError
|
|
1226
1258
|
};
|
|
1227
1259
|
|
|
1228
1260
|
var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
@@ -1235,6 +1267,7 @@ var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
|
1235
1267
|
VersionFromHeader: VersionFromHeader,
|
|
1236
1268
|
ETHTxnStatus: ETHTxnStatus,
|
|
1237
1269
|
TransferType: TransferType,
|
|
1270
|
+
SimulateStatus: SimulateStatus,
|
|
1238
1271
|
FeeTokenType: FeeTokenType,
|
|
1239
1272
|
SortOrder: SortOrder,
|
|
1240
1273
|
Relayer: Relayer,
|
|
@@ -1276,6 +1309,7 @@ var relayer_gen = /*#__PURE__*/Object.freeze({
|
|
|
1276
1309
|
NotFoundError: NotFoundError,
|
|
1277
1310
|
InsufficientFeeError: InsufficientFeeError,
|
|
1278
1311
|
NotEnoughBalanceError: NotEnoughBalanceError,
|
|
1312
|
+
SimulationFailedError: SimulationFailedError,
|
|
1279
1313
|
errors: errors,
|
|
1280
1314
|
WebrpcErrorCodes: WebrpcErrorCodes,
|
|
1281
1315
|
webrpcErrorByCode: webrpcErrorByCode
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const WebrpcHeader = "Webrpc";
|
|
2
|
-
export declare const WebrpcHeaderValue = "webrpc@v0.
|
|
2
|
+
export declare const WebrpcHeaderValue = "webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1";
|
|
3
3
|
export declare const WebRPCVersion = "v1";
|
|
4
4
|
export declare const WebRPCSchemaVersion = "v0.4.1";
|
|
5
|
-
export declare const WebRPCSchemaHash = "
|
|
5
|
+
export declare const WebRPCSchemaHash = "62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a";
|
|
6
6
|
type WebrpcGenVersions = {
|
|
7
7
|
webrpcGenVersion: string;
|
|
8
8
|
codeGenName: string;
|
|
@@ -18,7 +18,8 @@ export declare enum ETHTxnStatus {
|
|
|
18
18
|
SENT = "SENT",
|
|
19
19
|
SUCCEEDED = "SUCCEEDED",
|
|
20
20
|
PARTIALLY_FAILED = "PARTIALLY_FAILED",
|
|
21
|
-
FAILED = "FAILED"
|
|
21
|
+
FAILED = "FAILED",
|
|
22
|
+
PENDING_PRECONDITION = "PENDING_PRECONDITION"
|
|
22
23
|
}
|
|
23
24
|
export declare enum TransferType {
|
|
24
25
|
SEND = "SEND",
|
|
@@ -28,6 +29,14 @@ export declare enum TransferType {
|
|
|
28
29
|
BURN = "BURN",
|
|
29
30
|
UNKNOWN = "UNKNOWN"
|
|
30
31
|
}
|
|
32
|
+
export declare enum SimulateStatus {
|
|
33
|
+
SKIPPED = "SKIPPED",
|
|
34
|
+
SUCCEEDED = "SUCCEEDED",
|
|
35
|
+
FAILED = "FAILED",
|
|
36
|
+
ABORTED = "ABORTED",
|
|
37
|
+
REVERTED = "REVERTED",
|
|
38
|
+
NOT_ENOUGH_GAS = "NOT_ENOUGH_GAS"
|
|
39
|
+
}
|
|
31
40
|
export declare enum FeeTokenType {
|
|
32
41
|
UNKNOWN = "UNKNOWN",
|
|
33
42
|
ERC20_TOKEN = "ERC20_TOKEN",
|
|
@@ -160,6 +169,8 @@ export interface MetaTxnReceipt {
|
|
|
160
169
|
index: number;
|
|
161
170
|
logs: Array<MetaTxnReceiptLog>;
|
|
162
171
|
receipts: Array<MetaTxnReceipt>;
|
|
172
|
+
blockNumber: string;
|
|
173
|
+
txnHash: string;
|
|
163
174
|
txnReceipt: string;
|
|
164
175
|
}
|
|
165
176
|
export interface MetaTxnReceiptLog {
|
|
@@ -167,16 +178,26 @@ export interface MetaTxnReceiptLog {
|
|
|
167
178
|
topics: Array<string>;
|
|
168
179
|
data: string;
|
|
169
180
|
}
|
|
181
|
+
export interface IntentPrecondition {
|
|
182
|
+
type: string;
|
|
183
|
+
chainId: string;
|
|
184
|
+
data: any;
|
|
185
|
+
}
|
|
186
|
+
export interface IntentSolution {
|
|
187
|
+
transactions: Array<Transactions>;
|
|
188
|
+
}
|
|
189
|
+
export interface Transactions {
|
|
190
|
+
chainID: string;
|
|
191
|
+
transactions: Array<Transaction>;
|
|
192
|
+
preconditions?: Array<IntentPrecondition>;
|
|
193
|
+
}
|
|
170
194
|
export interface Transaction {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
[key: string]: TxnLogUser;
|
|
178
|
-
};
|
|
179
|
-
timestamp: string;
|
|
195
|
+
delegateCall: boolean;
|
|
196
|
+
revertOnError: boolean;
|
|
197
|
+
gasLimit: string;
|
|
198
|
+
target: string;
|
|
199
|
+
value: string;
|
|
200
|
+
data: string;
|
|
180
201
|
}
|
|
181
202
|
export interface TxnLogUser {
|
|
182
203
|
username: string;
|
|
@@ -201,6 +222,13 @@ export interface SimulateResult {
|
|
|
201
222
|
gasUsed: number;
|
|
202
223
|
gasLimit: number;
|
|
203
224
|
}
|
|
225
|
+
export interface SimulateV3Result {
|
|
226
|
+
status: SimulateStatus;
|
|
227
|
+
result?: string;
|
|
228
|
+
error?: string;
|
|
229
|
+
gasUsed: number;
|
|
230
|
+
gasLimit: number;
|
|
231
|
+
}
|
|
204
232
|
export interface FeeOption {
|
|
205
233
|
token: FeeToken;
|
|
206
234
|
to: string;
|
|
@@ -237,31 +265,76 @@ export interface Relayer {
|
|
|
237
265
|
runtimeStatus(headers?: object, signal?: AbortSignal): Promise<RuntimeStatusReturn>;
|
|
238
266
|
getSequenceContext(headers?: object, signal?: AbortSignal): Promise<GetSequenceContextReturn>;
|
|
239
267
|
getChainID(headers?: object, signal?: AbortSignal): Promise<GetChainIDReturn>;
|
|
268
|
+
/**
|
|
269
|
+
*
|
|
270
|
+
* Transactions
|
|
271
|
+
*
|
|
272
|
+
* TODO (future): rename this to just, 'SendTransaction(txn: MetaTransaction)' or 'SendTransaction(txn: SignedTransaction)', or something..
|
|
273
|
+
* Project ID is only used by service and admin calls. Other clients must have projectID passed via the context
|
|
274
|
+
* TODO: rename return txnHash: string to metaTxnID: string
|
|
275
|
+
*/
|
|
240
276
|
sendMetaTxn(args: SendMetaTxnArgs, headers?: object, signal?: AbortSignal): Promise<SendMetaTxnReturn>;
|
|
241
277
|
getMetaTxnNonce(args: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNonceReturn>;
|
|
278
|
+
/**
|
|
279
|
+
* TODO: one day, make GetMetaTxnReceipt respond immediately with receipt or not
|
|
280
|
+
* and add WaitTransactionReceipt method, which will block and wait, similar to how GetMetaTxnReceipt
|
|
281
|
+
* is implemented now.
|
|
282
|
+
* For backwards compat, we can leave the current GetMetaTxnReceipt how it is, an deprecate it, and introduce
|
|
283
|
+
* new, GetTransactionReceipt and WaitTransactionReceipt methods
|
|
284
|
+
* we can also accept metaTxnId and txnHash .. so can take either or.. I wonder if ERC-4337 has any convention on this?
|
|
285
|
+
*/
|
|
242
286
|
getMetaTxnReceipt(args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnReceiptReturn>;
|
|
243
287
|
simulate(args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise<SimulateReturn>;
|
|
288
|
+
simulateV3(args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise<SimulateV3Return>;
|
|
289
|
+
/**
|
|
290
|
+
* TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
|
|
291
|
+
*/
|
|
244
292
|
updateMetaTxnGasLimits(args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise<UpdateMetaTxnGasLimitsReturn>;
|
|
245
293
|
feeTokens(headers?: object, signal?: AbortSignal): Promise<FeeTokensReturn>;
|
|
246
294
|
feeOptions(args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<FeeOptionsReturn>;
|
|
295
|
+
/**
|
|
296
|
+
* TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
|
|
297
|
+
*/
|
|
247
298
|
getMetaTxnNetworkFeeOptions(args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNetworkFeeOptionsReturn>;
|
|
248
299
|
getMetaTransactions(args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTransactionsReturn>;
|
|
249
300
|
getTransactionCost(args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise<GetTransactionCostReturn>;
|
|
301
|
+
/**
|
|
302
|
+
* Sent transactions from an account. If filter is omitted then it will return all transactions.
|
|
303
|
+
*/
|
|
250
304
|
sentTransactions(args: SentTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<SentTransactionsReturn>;
|
|
305
|
+
/**
|
|
306
|
+
* Pending transactions waiting to be mined for an account. This endpoint is just a sugar of `SentTransactions`
|
|
307
|
+
* with the filter set to pending: true.
|
|
308
|
+
*/
|
|
251
309
|
pendingTransactions(args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<PendingTransactionsReturn>;
|
|
310
|
+
/**
|
|
311
|
+
* Legacy Gas Tank
|
|
312
|
+
*/
|
|
252
313
|
getGasTank(args: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankReturn>;
|
|
253
314
|
addGasTank(args: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise<AddGasTankReturn>;
|
|
254
315
|
updateGasTank(args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasTankReturn>;
|
|
316
|
+
/**
|
|
317
|
+
* Legacy Gas Adjustment
|
|
318
|
+
*/
|
|
255
319
|
nextGasTankBalanceAdjustmentNonce(args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise<NextGasTankBalanceAdjustmentNonceReturn>;
|
|
256
320
|
adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustGasTankBalanceReturn>;
|
|
257
321
|
getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankBalanceAdjustmentReturn>;
|
|
258
322
|
listGasTankBalanceAdjustments(args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasTankBalanceAdjustmentsReturn>;
|
|
323
|
+
/**
|
|
324
|
+
* Gas Sponsorship
|
|
325
|
+
*/
|
|
259
326
|
listGasSponsors(args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasSponsorsReturn>;
|
|
260
327
|
getGasSponsor(args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetGasSponsorReturn>;
|
|
261
328
|
addGasSponsor(args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddGasSponsorReturn>;
|
|
262
329
|
updateGasSponsor(args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasSponsorReturn>;
|
|
263
330
|
removeGasSponsor(args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveGasSponsorReturn>;
|
|
331
|
+
/**
|
|
332
|
+
* Gas Sponsor Lookup
|
|
333
|
+
*/
|
|
264
334
|
addressGasSponsors(args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<AddressGasSponsorsReturn>;
|
|
335
|
+
/**
|
|
336
|
+
* Project Balance
|
|
337
|
+
*/
|
|
265
338
|
getProjectBalance(args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetProjectBalanceReturn>;
|
|
266
339
|
adjustProjectBalance(args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustProjectBalanceReturn>;
|
|
267
340
|
}
|
|
@@ -294,6 +367,7 @@ export interface SendMetaTxnArgs {
|
|
|
294
367
|
call: MetaTxn;
|
|
295
368
|
quote?: string;
|
|
296
369
|
projectID?: number;
|
|
370
|
+
preconditions?: Array<IntentPrecondition>;
|
|
297
371
|
}
|
|
298
372
|
export interface SendMetaTxnReturn {
|
|
299
373
|
status: boolean;
|
|
@@ -319,6 +393,13 @@ export interface SimulateArgs {
|
|
|
319
393
|
export interface SimulateReturn {
|
|
320
394
|
results: Array<SimulateResult>;
|
|
321
395
|
}
|
|
396
|
+
export interface SimulateV3Args {
|
|
397
|
+
wallet: string;
|
|
398
|
+
calls: string;
|
|
399
|
+
}
|
|
400
|
+
export interface SimulateV3Return {
|
|
401
|
+
results: Array<SimulateV3Result>;
|
|
402
|
+
}
|
|
322
403
|
export interface UpdateMetaTxnGasLimitsArgs {
|
|
323
404
|
walletAddress: string;
|
|
324
405
|
walletConfig: any;
|
|
@@ -516,6 +597,7 @@ export declare class Relayer implements Relayer {
|
|
|
516
597
|
getMetaTxnNonce: (args: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal) => Promise<GetMetaTxnNonceReturn>;
|
|
517
598
|
getMetaTxnReceipt: (args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal) => Promise<GetMetaTxnReceiptReturn>;
|
|
518
599
|
simulate: (args: SimulateArgs, headers?: object, signal?: AbortSignal) => Promise<SimulateReturn>;
|
|
600
|
+
simulateV3: (args: SimulateV3Args, headers?: object, signal?: AbortSignal) => Promise<SimulateV3Return>;
|
|
519
601
|
updateMetaTxnGasLimits: (args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal) => Promise<UpdateMetaTxnGasLimitsReturn>;
|
|
520
602
|
feeTokens: (headers?: object, signal?: AbortSignal) => Promise<FeeTokensReturn>;
|
|
521
603
|
feeOptions: (args: FeeOptionsArgs, headers?: object, signal?: AbortSignal) => Promise<FeeOptionsReturn>;
|
|
@@ -662,6 +744,9 @@ export declare class InsufficientFeeError extends WebrpcError {
|
|
|
662
744
|
export declare class NotEnoughBalanceError extends WebrpcError {
|
|
663
745
|
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
664
746
|
}
|
|
747
|
+
export declare class SimulationFailedError extends WebrpcError {
|
|
748
|
+
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string);
|
|
749
|
+
}
|
|
665
750
|
export declare enum errors {
|
|
666
751
|
WebrpcEndpoint = "WebrpcEndpoint",
|
|
667
752
|
WebrpcRequestFailed = "WebrpcRequestFailed",
|
|
@@ -699,7 +784,8 @@ export declare enum errors {
|
|
|
699
784
|
QueryFailed = "QueryFailed",
|
|
700
785
|
NotFound = "NotFound",
|
|
701
786
|
InsufficientFee = "InsufficientFee",
|
|
702
|
-
NotEnoughBalance = "NotEnoughBalance"
|
|
787
|
+
NotEnoughBalance = "NotEnoughBalance",
|
|
788
|
+
SimulationFailed = "SimulationFailed"
|
|
703
789
|
}
|
|
704
790
|
export declare enum WebrpcErrorCodes {
|
|
705
791
|
WebrpcEndpoint = 0,
|
|
@@ -738,7 +824,8 @@ export declare enum WebrpcErrorCodes {
|
|
|
738
824
|
QueryFailed = 2003,
|
|
739
825
|
NotFound = 3000,
|
|
740
826
|
InsufficientFee = 3004,
|
|
741
|
-
NotEnoughBalance = 3005
|
|
827
|
+
NotEnoughBalance = 3005,
|
|
828
|
+
SimulationFailed = 3006
|
|
742
829
|
}
|
|
743
830
|
export declare const webrpcErrorByCode: {
|
|
744
831
|
[code: number]: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/relayer",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.30",
|
|
4
4
|
"description": "relayer sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/relayer",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"ethers": ">=6"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@0xsequence/
|
|
16
|
-
"@0xsequence/core": "2.3.
|
|
17
|
-
"@0xsequence/
|
|
15
|
+
"@0xsequence/abi": "2.3.30",
|
|
16
|
+
"@0xsequence/core": "2.3.30",
|
|
17
|
+
"@0xsequence/utils": "2.3.30"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@0xsequence/wallet-contracts": "^3.0.1",
|
|
21
21
|
"ethers": "6.13.4",
|
|
22
|
-
"@0xsequence/signhub": "2.3.
|
|
23
|
-
"@0xsequence/tests": "2.3.
|
|
22
|
+
"@0xsequence/signhub": "2.3.30",
|
|
23
|
+
"@0xsequence/tests": "2.3.30"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"src",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-relayer v0.4.1
|
|
2
|
+
// sequence-relayer v0.4.1 62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a
|
|
3
3
|
// --
|
|
4
|
-
// Code generated by webrpc-gen@v0.
|
|
4
|
+
// Code generated by webrpc-gen@v0.26.0 with typescript generator. DO NOT EDIT.
|
|
5
5
|
//
|
|
6
6
|
// webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts
|
|
7
7
|
|
|
8
8
|
export const WebrpcHeader = "Webrpc"
|
|
9
9
|
|
|
10
|
-
export const WebrpcHeaderValue = "webrpc@v0.
|
|
10
|
+
export const WebrpcHeaderValue = "webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1"
|
|
11
11
|
|
|
12
12
|
// WebRPC description and code-gen version
|
|
13
13
|
export const WebRPCVersion = "v1"
|
|
@@ -16,7 +16,7 @@ export const WebRPCVersion = "v1"
|
|
|
16
16
|
export const WebRPCSchemaVersion = "v0.4.1"
|
|
17
17
|
|
|
18
18
|
// Schema hash generated from your RIDL schema
|
|
19
|
-
export const WebRPCSchemaHash = "
|
|
19
|
+
export const WebRPCSchemaHash = "62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a"
|
|
20
20
|
|
|
21
21
|
type WebrpcGenVersions = {
|
|
22
22
|
webrpcGenVersion: string;
|
|
@@ -78,7 +78,8 @@ export enum ETHTxnStatus {
|
|
|
78
78
|
SENT = 'SENT',
|
|
79
79
|
SUCCEEDED = 'SUCCEEDED',
|
|
80
80
|
PARTIALLY_FAILED = 'PARTIALLY_FAILED',
|
|
81
|
-
FAILED = 'FAILED'
|
|
81
|
+
FAILED = 'FAILED',
|
|
82
|
+
PENDING_PRECONDITION = 'PENDING_PRECONDITION'
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
export enum TransferType {
|
|
@@ -90,6 +91,15 @@ export enum TransferType {
|
|
|
90
91
|
UNKNOWN = 'UNKNOWN'
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
export enum SimulateStatus {
|
|
95
|
+
SKIPPED = 'SKIPPED',
|
|
96
|
+
SUCCEEDED = 'SUCCEEDED',
|
|
97
|
+
FAILED = 'FAILED',
|
|
98
|
+
ABORTED = 'ABORTED',
|
|
99
|
+
REVERTED = 'REVERTED',
|
|
100
|
+
NOT_ENOUGH_GAS = 'NOT_ENOUGH_GAS'
|
|
101
|
+
}
|
|
102
|
+
|
|
93
103
|
export enum FeeTokenType {
|
|
94
104
|
UNKNOWN = 'UNKNOWN',
|
|
95
105
|
ERC20_TOKEN = 'ERC20_TOKEN',
|
|
@@ -231,6 +241,8 @@ export interface MetaTxnReceipt {
|
|
|
231
241
|
index: number
|
|
232
242
|
logs: Array<MetaTxnReceiptLog>
|
|
233
243
|
receipts: Array<MetaTxnReceipt>
|
|
244
|
+
blockNumber: string
|
|
245
|
+
txnHash: string
|
|
234
246
|
txnReceipt: string
|
|
235
247
|
}
|
|
236
248
|
|
|
@@ -240,14 +252,29 @@ export interface MetaTxnReceiptLog {
|
|
|
240
252
|
data: string
|
|
241
253
|
}
|
|
242
254
|
|
|
255
|
+
export interface IntentPrecondition {
|
|
256
|
+
type: string
|
|
257
|
+
chainId: string
|
|
258
|
+
data: any
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface IntentSolution {
|
|
262
|
+
transactions: Array<Transactions>
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export interface Transactions {
|
|
266
|
+
chainID: string
|
|
267
|
+
transactions: Array<Transaction>
|
|
268
|
+
preconditions?: Array<IntentPrecondition>
|
|
269
|
+
}
|
|
270
|
+
|
|
243
271
|
export interface Transaction {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
timestamp: string
|
|
272
|
+
delegateCall: boolean
|
|
273
|
+
revertOnError: boolean
|
|
274
|
+
gasLimit: string
|
|
275
|
+
target: string
|
|
276
|
+
value: string
|
|
277
|
+
data: string
|
|
251
278
|
}
|
|
252
279
|
|
|
253
280
|
export interface TxnLogUser {
|
|
@@ -277,6 +304,14 @@ export interface SimulateResult {
|
|
|
277
304
|
gasLimit: number
|
|
278
305
|
}
|
|
279
306
|
|
|
307
|
+
export interface SimulateV3Result {
|
|
308
|
+
status: SimulateStatus
|
|
309
|
+
result?: string
|
|
310
|
+
error?: string
|
|
311
|
+
gasUsed: number
|
|
312
|
+
gasLimit: number
|
|
313
|
+
}
|
|
314
|
+
|
|
280
315
|
export interface FeeOption {
|
|
281
316
|
token: FeeToken
|
|
282
317
|
to: string
|
|
@@ -317,31 +352,76 @@ export interface Relayer {
|
|
|
317
352
|
runtimeStatus(headers?: object, signal?: AbortSignal): Promise<RuntimeStatusReturn>
|
|
318
353
|
getSequenceContext(headers?: object, signal?: AbortSignal): Promise<GetSequenceContextReturn>
|
|
319
354
|
getChainID(headers?: object, signal?: AbortSignal): Promise<GetChainIDReturn>
|
|
355
|
+
/**
|
|
356
|
+
*
|
|
357
|
+
* Transactions
|
|
358
|
+
*
|
|
359
|
+
* TODO (future): rename this to just, 'SendTransaction(txn: MetaTransaction)' or 'SendTransaction(txn: SignedTransaction)', or something..
|
|
360
|
+
* Project ID is only used by service and admin calls. Other clients must have projectID passed via the context
|
|
361
|
+
* TODO: rename return txnHash: string to metaTxnID: string
|
|
362
|
+
*/
|
|
320
363
|
sendMetaTxn(args: SendMetaTxnArgs, headers?: object, signal?: AbortSignal): Promise<SendMetaTxnReturn>
|
|
321
364
|
getMetaTxnNonce(args: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNonceReturn>
|
|
365
|
+
/**
|
|
366
|
+
* TODO: one day, make GetMetaTxnReceipt respond immediately with receipt or not
|
|
367
|
+
* and add WaitTransactionReceipt method, which will block and wait, similar to how GetMetaTxnReceipt
|
|
368
|
+
* is implemented now.
|
|
369
|
+
* For backwards compat, we can leave the current GetMetaTxnReceipt how it is, an deprecate it, and introduce
|
|
370
|
+
* new, GetTransactionReceipt and WaitTransactionReceipt methods
|
|
371
|
+
* we can also accept metaTxnId and txnHash .. so can take either or.. I wonder if ERC-4337 has any convention on this?
|
|
372
|
+
*/
|
|
322
373
|
getMetaTxnReceipt(args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnReceiptReturn>
|
|
323
374
|
simulate(args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise<SimulateReturn>
|
|
375
|
+
simulateV3(args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise<SimulateV3Return>
|
|
376
|
+
/**
|
|
377
|
+
* TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
|
|
378
|
+
*/
|
|
324
379
|
updateMetaTxnGasLimits(args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise<UpdateMetaTxnGasLimitsReturn>
|
|
325
380
|
feeTokens(headers?: object, signal?: AbortSignal): Promise<FeeTokensReturn>
|
|
326
381
|
feeOptions(args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<FeeOptionsReturn>
|
|
382
|
+
/**
|
|
383
|
+
* TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
|
|
384
|
+
*/
|
|
327
385
|
getMetaTxnNetworkFeeOptions(args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTxnNetworkFeeOptionsReturn>
|
|
328
386
|
getMetaTransactions(args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<GetMetaTransactionsReturn>
|
|
329
387
|
getTransactionCost(args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise<GetTransactionCostReturn>
|
|
388
|
+
/**
|
|
389
|
+
* Sent transactions from an account. If filter is omitted then it will return all transactions.
|
|
390
|
+
*/
|
|
330
391
|
sentTransactions(args: SentTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<SentTransactionsReturn>
|
|
392
|
+
/**
|
|
393
|
+
* Pending transactions waiting to be mined for an account. This endpoint is just a sugar of `SentTransactions`
|
|
394
|
+
* with the filter set to pending: true.
|
|
395
|
+
*/
|
|
331
396
|
pendingTransactions(args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise<PendingTransactionsReturn>
|
|
397
|
+
/**
|
|
398
|
+
* Legacy Gas Tank
|
|
399
|
+
*/
|
|
332
400
|
getGasTank(args: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankReturn>
|
|
333
401
|
addGasTank(args: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise<AddGasTankReturn>
|
|
334
402
|
updateGasTank(args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasTankReturn>
|
|
403
|
+
/**
|
|
404
|
+
* Legacy Gas Adjustment
|
|
405
|
+
*/
|
|
335
406
|
nextGasTankBalanceAdjustmentNonce(args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise<NextGasTankBalanceAdjustmentNonceReturn>
|
|
336
407
|
adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustGasTankBalanceReturn>
|
|
337
408
|
getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise<GetGasTankBalanceAdjustmentReturn>
|
|
338
409
|
listGasTankBalanceAdjustments(args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasTankBalanceAdjustmentsReturn>
|
|
410
|
+
/**
|
|
411
|
+
* Gas Sponsorship
|
|
412
|
+
*/
|
|
339
413
|
listGasSponsors(args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<ListGasSponsorsReturn>
|
|
340
414
|
getGasSponsor(args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<GetGasSponsorReturn>
|
|
341
415
|
addGasSponsor(args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<AddGasSponsorReturn>
|
|
342
416
|
updateGasSponsor(args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<UpdateGasSponsorReturn>
|
|
343
417
|
removeGasSponsor(args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise<RemoveGasSponsorReturn>
|
|
418
|
+
/**
|
|
419
|
+
* Gas Sponsor Lookup
|
|
420
|
+
*/
|
|
344
421
|
addressGasSponsors(args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise<AddressGasSponsorsReturn>
|
|
422
|
+
/**
|
|
423
|
+
* Project Balance
|
|
424
|
+
*/
|
|
345
425
|
getProjectBalance(args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetProjectBalanceReturn>
|
|
346
426
|
adjustProjectBalance(args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise<AdjustProjectBalanceReturn>
|
|
347
427
|
}
|
|
@@ -380,6 +460,7 @@ export interface SendMetaTxnArgs {
|
|
|
380
460
|
call: MetaTxn
|
|
381
461
|
quote?: string
|
|
382
462
|
projectID?: number
|
|
463
|
+
preconditions?: Array<IntentPrecondition>
|
|
383
464
|
}
|
|
384
465
|
|
|
385
466
|
export interface SendMetaTxnReturn {
|
|
@@ -409,6 +490,14 @@ export interface SimulateArgs {
|
|
|
409
490
|
export interface SimulateReturn {
|
|
410
491
|
results: Array<SimulateResult>
|
|
411
492
|
}
|
|
493
|
+
export interface SimulateV3Args {
|
|
494
|
+
wallet: string
|
|
495
|
+
calls: string
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export interface SimulateV3Return {
|
|
499
|
+
results: Array<SimulateV3Result>
|
|
500
|
+
}
|
|
412
501
|
export interface UpdateMetaTxnGasLimitsArgs {
|
|
413
502
|
walletAddress: string
|
|
414
503
|
walletConfig: any
|
|
@@ -766,6 +855,20 @@ export class Relayer implements Relayer {
|
|
|
766
855
|
})
|
|
767
856
|
}
|
|
768
857
|
|
|
858
|
+
simulateV3 = (args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise<SimulateV3Return> => {
|
|
859
|
+
return this.fetch(
|
|
860
|
+
this.url('SimulateV3'),
|
|
861
|
+
createHTTPRequest(args, headers, signal)).then((res) => {
|
|
862
|
+
return buildResponse(res).then(_data => {
|
|
863
|
+
return {
|
|
864
|
+
results: <Array<SimulateV3Result>>(_data.results),
|
|
865
|
+
}
|
|
866
|
+
})
|
|
867
|
+
}, (error) => {
|
|
868
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
869
|
+
})
|
|
870
|
+
}
|
|
871
|
+
|
|
769
872
|
updateMetaTxnGasLimits = (args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise<UpdateMetaTxnGasLimitsReturn> => {
|
|
770
873
|
return this.fetch(
|
|
771
874
|
this.url('UpdateMetaTxnGasLimits'),
|
|
@@ -1656,6 +1759,19 @@ export class NotEnoughBalanceError extends WebrpcError {
|
|
|
1656
1759
|
}
|
|
1657
1760
|
}
|
|
1658
1761
|
|
|
1762
|
+
export class SimulationFailedError extends WebrpcError {
|
|
1763
|
+
constructor(
|
|
1764
|
+
name: string = 'SimulationFailed',
|
|
1765
|
+
code: number = 3006,
|
|
1766
|
+
message: string = `Simulation failed`,
|
|
1767
|
+
status: number = 0,
|
|
1768
|
+
cause?: string
|
|
1769
|
+
) {
|
|
1770
|
+
super(name, code, message, status, cause)
|
|
1771
|
+
Object.setPrototypeOf(this, SimulationFailedError.prototype)
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1659
1775
|
|
|
1660
1776
|
export enum errors {
|
|
1661
1777
|
WebrpcEndpoint = 'WebrpcEndpoint',
|
|
@@ -1695,6 +1811,7 @@ export enum errors {
|
|
|
1695
1811
|
NotFound = 'NotFound',
|
|
1696
1812
|
InsufficientFee = 'InsufficientFee',
|
|
1697
1813
|
NotEnoughBalance = 'NotEnoughBalance',
|
|
1814
|
+
SimulationFailed = 'SimulationFailed',
|
|
1698
1815
|
}
|
|
1699
1816
|
|
|
1700
1817
|
export enum WebrpcErrorCodes {
|
|
@@ -1735,6 +1852,7 @@ export enum WebrpcErrorCodes {
|
|
|
1735
1852
|
NotFound = 3000,
|
|
1736
1853
|
InsufficientFee = 3004,
|
|
1737
1854
|
NotEnoughBalance = 3005,
|
|
1855
|
+
SimulationFailed = 3006,
|
|
1738
1856
|
}
|
|
1739
1857
|
|
|
1740
1858
|
export const webrpcErrorByCode: { [code: number]: any } = {
|
|
@@ -1775,6 +1893,7 @@ export const webrpcErrorByCode: { [code: number]: any } = {
|
|
|
1775
1893
|
[3000]: NotFoundError,
|
|
1776
1894
|
[3004]: InsufficientFeeError,
|
|
1777
1895
|
[3005]: NotEnoughBalanceError,
|
|
1896
|
+
[3006]: SimulationFailedError,
|
|
1778
1897
|
}
|
|
1779
1898
|
|
|
1780
1899
|
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|