@0xsequence/relayer 0.0.0-20240123145607 → 0.0.0-20240123153410
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.
|
@@ -338,6 +338,8 @@ class Relayer {
|
|
|
338
338
|
});
|
|
339
339
|
};
|
|
340
340
|
this.sendMetaTxn = (args, headers) => {
|
|
341
|
+
console.log("/SendMetaTxn");
|
|
342
|
+
console.log(JSON.stringify(args, undefined, 2));
|
|
341
343
|
return this.fetch(this.url('SendMetaTxn'), createHTTPRequest(args, headers)).then(res => {
|
|
342
344
|
return buildResponse(res).then(_data => {
|
|
343
345
|
return {
|
|
@@ -394,6 +396,8 @@ class Relayer {
|
|
|
394
396
|
});
|
|
395
397
|
};
|
|
396
398
|
this.feeOptions = (args, headers) => {
|
|
399
|
+
console.log('/FeeOptions');
|
|
400
|
+
console.log(JSON.stringify(args, undefined, 2));
|
|
397
401
|
return this.fetch(this.url('FeeOptions'), createHTTPRequest(args, headers)).then(res => {
|
|
398
402
|
return buildResponse(res).then(_data => {
|
|
399
403
|
return {
|
|
@@ -587,7 +591,6 @@ const buildResponse = res => {
|
|
|
587
591
|
if (!res.ok) {
|
|
588
592
|
throw data; // webrpc error response
|
|
589
593
|
}
|
|
590
|
-
|
|
591
594
|
return data;
|
|
592
595
|
});
|
|
593
596
|
};
|
|
@@ -853,6 +856,7 @@ class MetaTransactionResponseException {
|
|
|
853
856
|
//
|
|
854
857
|
// This interface exists for type-safety purposes to protect against passing non-FeeQuotes to
|
|
855
858
|
// Relayer.relay(), or any other functions that call it indirectly (e.g. Account.sendTransaction).
|
|
859
|
+
|
|
856
860
|
function isRelayer(cand) {
|
|
857
861
|
return typeof cand === 'object' && typeof cand.simulate === 'function' && typeof cand.getFeeOptions === 'function' && typeof cand.gasRefundOptions === 'function' && typeof cand.getNonce === 'function' && typeof cand.relay === 'function' && typeof cand.wait === 'function';
|
|
858
862
|
}
|
|
@@ -338,6 +338,8 @@ class Relayer {
|
|
|
338
338
|
});
|
|
339
339
|
};
|
|
340
340
|
this.sendMetaTxn = (args, headers) => {
|
|
341
|
+
console.log("/SendMetaTxn");
|
|
342
|
+
console.log(JSON.stringify(args, undefined, 2));
|
|
341
343
|
return this.fetch(this.url('SendMetaTxn'), createHTTPRequest(args, headers)).then(res => {
|
|
342
344
|
return buildResponse(res).then(_data => {
|
|
343
345
|
return {
|
|
@@ -394,6 +396,8 @@ class Relayer {
|
|
|
394
396
|
});
|
|
395
397
|
};
|
|
396
398
|
this.feeOptions = (args, headers) => {
|
|
399
|
+
console.log('/FeeOptions');
|
|
400
|
+
console.log(JSON.stringify(args, undefined, 2));
|
|
397
401
|
return this.fetch(this.url('FeeOptions'), createHTTPRequest(args, headers)).then(res => {
|
|
398
402
|
return buildResponse(res).then(_data => {
|
|
399
403
|
return {
|
|
@@ -587,7 +591,6 @@ const buildResponse = res => {
|
|
|
587
591
|
if (!res.ok) {
|
|
588
592
|
throw data; // webrpc error response
|
|
589
593
|
}
|
|
590
|
-
|
|
591
594
|
return data;
|
|
592
595
|
});
|
|
593
596
|
};
|
|
@@ -853,6 +856,7 @@ class MetaTransactionResponseException {
|
|
|
853
856
|
//
|
|
854
857
|
// This interface exists for type-safety purposes to protect against passing non-FeeQuotes to
|
|
855
858
|
// Relayer.relay(), or any other functions that call it indirectly (e.g. Account.sendTransaction).
|
|
859
|
+
|
|
856
860
|
function isRelayer(cand) {
|
|
857
861
|
return typeof cand === 'object' && typeof cand.simulate === 'function' && typeof cand.getFeeOptions === 'function' && typeof cand.gasRefundOptions === 'function' && typeof cand.getNonce === 'function' && typeof cand.relay === 'function' && typeof cand.wait === 'function';
|
|
858
862
|
}
|
|
@@ -334,6 +334,8 @@ class Relayer {
|
|
|
334
334
|
});
|
|
335
335
|
};
|
|
336
336
|
this.sendMetaTxn = (args, headers) => {
|
|
337
|
+
console.log("/SendMetaTxn");
|
|
338
|
+
console.log(JSON.stringify(args, undefined, 2));
|
|
337
339
|
return this.fetch(this.url('SendMetaTxn'), createHTTPRequest(args, headers)).then(res => {
|
|
338
340
|
return buildResponse(res).then(_data => {
|
|
339
341
|
return {
|
|
@@ -390,6 +392,8 @@ class Relayer {
|
|
|
390
392
|
});
|
|
391
393
|
};
|
|
392
394
|
this.feeOptions = (args, headers) => {
|
|
395
|
+
console.log('/FeeOptions');
|
|
396
|
+
console.log(JSON.stringify(args, undefined, 2));
|
|
393
397
|
return this.fetch(this.url('FeeOptions'), createHTTPRequest(args, headers)).then(res => {
|
|
394
398
|
return buildResponse(res).then(_data => {
|
|
395
399
|
return {
|
|
@@ -583,7 +587,6 @@ const buildResponse = res => {
|
|
|
583
587
|
if (!res.ok) {
|
|
584
588
|
throw data; // webrpc error response
|
|
585
589
|
}
|
|
586
|
-
|
|
587
590
|
return data;
|
|
588
591
|
});
|
|
589
592
|
};
|
|
@@ -849,6 +852,7 @@ class MetaTransactionResponseException {
|
|
|
849
852
|
//
|
|
850
853
|
// This interface exists for type-safety purposes to protect against passing non-FeeQuotes to
|
|
851
854
|
// Relayer.relay(), or any other functions that call it indirectly (e.g. Account.sendTransaction).
|
|
855
|
+
|
|
852
856
|
function isRelayer(cand) {
|
|
853
857
|
return typeof cand === 'object' && typeof cand.simulate === 'function' && typeof cand.getFeeOptions === 'function' && typeof cand.gasRefundOptions === 'function' && typeof cand.getNonce === 'function' && typeof cand.relay === 'function' && typeof cand.wait === 'function';
|
|
854
858
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/relayer",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20240123153410",
|
|
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",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"author": "Horizon Blockchain Games",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@0xsequence/abi": "0.0.0-
|
|
13
|
-
"@0xsequence/
|
|
14
|
-
"@0xsequence/
|
|
12
|
+
"@0xsequence/abi": "0.0.0-20240123153410",
|
|
13
|
+
"@0xsequence/core": "0.0.0-20240123153410",
|
|
14
|
+
"@0xsequence/utils": "0.0.0-20240123153410"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"ethers": ">=5.5 < 6"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@0xsequence/wallet-contracts": "^1.10.0",
|
|
21
21
|
"ethers": "^5.7.2",
|
|
22
|
-
"@0xsequence/signhub": "0.0.0-
|
|
23
|
-
"@0xsequence/tests": "0.0.0-
|
|
22
|
+
"@0xsequence/signhub": "0.0.0-20240123153410",
|
|
23
|
+
"@0xsequence/tests": "0.0.0-20240123153410"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"src",
|
|
@@ -591,6 +591,8 @@ export class Relayer implements Relayer {
|
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
sendMetaTxn = (args: SendMetaTxnArgs, headers?: object): Promise<SendMetaTxnReturn> => {
|
|
594
|
+
console.log("/SendMetaTxn")
|
|
595
|
+
console.log(JSON.stringify(args, undefined, 2))
|
|
594
596
|
return this.fetch(this.url('SendMetaTxn'), createHTTPRequest(args, headers)).then(res => {
|
|
595
597
|
return buildResponse(res).then(_data => {
|
|
596
598
|
return {
|
|
@@ -653,6 +655,8 @@ export class Relayer implements Relayer {
|
|
|
653
655
|
}
|
|
654
656
|
|
|
655
657
|
feeOptions = (args: FeeOptionsArgs, headers?: object): Promise<FeeOptionsReturn> => {
|
|
658
|
+
console.log('/FeeOptions')
|
|
659
|
+
console.log(JSON.stringify(args, undefined, 2))
|
|
656
660
|
return this.fetch(this.url('FeeOptions'), createHTTPRequest(args, headers)).then(res => {
|
|
657
661
|
return buildResponse(res).then(_data => {
|
|
658
662
|
return {
|