@openzeppelin/relayer-plugin-channels 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin/build.d.ts.map +1 -1
- package/dist/plugin/build.js +7 -0
- package/dist/plugin/constants.d.ts +3 -3
- package/dist/plugin/constants.js +3 -3
- package/dist/plugin/tx.d.ts.map +1 -1
- package/dist/plugin/tx.js +15 -5
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/plugin/build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAe,MAAM,sBAAsB,CAAC;AAIhE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/plugin/build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAe,MAAM,sBAAsB,CAAC;AAIhE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,CAmGrE"}
|
package/dist/plugin/build.js
CHANGED
|
@@ -45,6 +45,13 @@ function rebuildWithChannel(params) {
|
|
|
45
45
|
const now = Math.floor(Date.now() / 1000);
|
|
46
46
|
const maxTime = Number(inputTx.timeBounds.maxTime);
|
|
47
47
|
if (maxTime > 0) {
|
|
48
|
+
if (maxTime < now) {
|
|
49
|
+
throw (0, relayer_sdk_1.pluginError)('Transaction has expired: maxTime is in the past', {
|
|
50
|
+
code: 'TIMEBOUNDS_EXPIRED',
|
|
51
|
+
status: constants_1.HTTP_STATUS.BAD_REQUEST,
|
|
52
|
+
details: { maxTime, now },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
48
55
|
const maxAllowedTime = now + constants_1.TIME.MAX_TIME_BOUND_OFFSET_SECONDS;
|
|
49
56
|
if (maxTime > maxAllowedTime) {
|
|
50
57
|
throw (0, relayer_sdk_1.pluginError)(`Transaction maxTime is too far in the future. Max allowed: ${constants_1.TIME.MAX_TIME_BOUND_OFFSET_SECONDS} seconds from now`, {
|
|
@@ -27,13 +27,13 @@ export declare const POOL: {
|
|
|
27
27
|
readonly MUTEX_RETRY_MAX_MS: 30;
|
|
28
28
|
};
|
|
29
29
|
export declare const TIME: {
|
|
30
|
-
readonly MAX_TIME_BOUND_OFFSET_SECONDS:
|
|
30
|
+
readonly MAX_TIME_BOUND_OFFSET_SECONDS: 120;
|
|
31
31
|
};
|
|
32
32
|
export declare const SIMULATION: {
|
|
33
33
|
readonly DEFAULT_FEE: "100";
|
|
34
34
|
readonly MIN_TIME_BOUND: 0;
|
|
35
|
-
readonly MAX_TIME_BOUND_OFFSET_SECONDS:
|
|
36
|
-
readonly MAX_FUTURE_TIME_BOUND_SECONDS:
|
|
35
|
+
readonly MAX_TIME_BOUND_OFFSET_SECONDS: 120;
|
|
36
|
+
readonly MAX_FUTURE_TIME_BOUND_SECONDS: 120;
|
|
37
37
|
};
|
|
38
38
|
export declare const POLLING: {
|
|
39
39
|
readonly INTERVAL_MS: 1000;
|
package/dist/plugin/constants.js
CHANGED
|
@@ -36,14 +36,14 @@ exports.POOL = {
|
|
|
36
36
|
};
|
|
37
37
|
// Time Constants
|
|
38
38
|
exports.TIME = {
|
|
39
|
-
MAX_TIME_BOUND_OFFSET_SECONDS:
|
|
39
|
+
MAX_TIME_BOUND_OFFSET_SECONDS: 120,
|
|
40
40
|
};
|
|
41
41
|
// Simulation-related defaults
|
|
42
42
|
exports.SIMULATION = {
|
|
43
43
|
DEFAULT_FEE: '100',
|
|
44
44
|
MIN_TIME_BOUND: 0,
|
|
45
|
-
MAX_TIME_BOUND_OFFSET_SECONDS:
|
|
46
|
-
MAX_FUTURE_TIME_BOUND_SECONDS:
|
|
45
|
+
MAX_TIME_BOUND_OFFSET_SECONDS: 120,
|
|
46
|
+
MAX_FUTURE_TIME_BOUND_SECONDS: 120,
|
|
47
47
|
};
|
|
48
48
|
// Polling for transactionWait
|
|
49
49
|
exports.POLLING = {
|
package/dist/plugin/tx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../src/plugin/tx.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAO,MAAM,sBAAsB,CAAC;AAIxD,wBAAgB,wCAAwC,CAAC,EAAE,EAAE,WAAW,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../src/plugin/tx.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAO,MAAM,sBAAsB,CAAC;AAIxD,wBAAgB,wCAAwC,CAAC,EAAE,EAAE,WAAW,GAAG,WAAW,CAkDrF"}
|
package/dist/plugin/tx.js
CHANGED
|
@@ -33,11 +33,21 @@ function validateExistingTransactionForSubmitOnly(tx) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
// Time bounds sanity
|
|
36
|
-
if (tx.timeBounds?.maxTime && Number(tx.timeBounds.maxTime)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
if (tx.timeBounds?.maxTime && Number(tx.timeBounds.maxTime) > 0) {
|
|
37
|
+
const maxTime = Number(tx.timeBounds.maxTime);
|
|
38
|
+
if (maxTime < now) {
|
|
39
|
+
throw (0, relayer_sdk_1.pluginError)('Transaction has expired: `timeBounds.maxTime` is in the past', {
|
|
40
|
+
code: 'TIMEBOUNDS_EXPIRED',
|
|
41
|
+
status: constants_1.HTTP_STATUS.BAD_REQUEST,
|
|
42
|
+
details: { maxTime, now },
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (maxTime - now > constants_1.SIMULATION.MAX_FUTURE_TIME_BOUND_SECONDS) {
|
|
46
|
+
throw (0, relayer_sdk_1.pluginError)(`Transaction \`timeBounds.maxTime\` too far into the future. Must be no greater than ${constants_1.SIMULATION.MAX_FUTURE_TIME_BOUND_SECONDS} seconds`, {
|
|
47
|
+
code: 'TIMEBOUNDS_TOO_FAR',
|
|
48
|
+
status: constants_1.HTTP_STATUS.BAD_REQUEST,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
41
51
|
}
|
|
42
52
|
return tx;
|
|
43
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openzeppelin/relayer-plugin-channels",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "OpenZeppelin Relayer Plugin for Stellar Channel Accounts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,22 +20,22 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@actions/exec": "^1.1.1",
|
|
23
|
-
"@openzeppelin/relayer-sdk": "^1.
|
|
24
|
-
"@stellar/stellar-sdk": "^14.
|
|
25
|
-
"axios": "^1.13.
|
|
23
|
+
"@openzeppelin/relayer-sdk": "^1.9.0",
|
|
24
|
+
"@stellar/stellar-sdk": "^14.5.0",
|
|
25
|
+
"axios": "^1.13.5"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@changesets/cli": "^2.29.8",
|
|
29
|
-
"@types/node": "^22.19.
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
31
|
-
"@typescript-eslint/parser": "^8.
|
|
32
|
-
"eslint": "^9.39.
|
|
29
|
+
"@types/node": "^22.19.11",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
31
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
32
|
+
"eslint": "^9.39.2",
|
|
33
33
|
"eslint-config-prettier": "^9.1.2",
|
|
34
|
-
"eslint-plugin-prettier": "^5.5.
|
|
35
|
-
"prettier": "^3.
|
|
34
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
35
|
+
"prettier": "^3.8.1",
|
|
36
36
|
"typescript": "5.8.3",
|
|
37
37
|
"typescript-eslint": "8.27.0",
|
|
38
|
-
"vitest": "^4.0.
|
|
38
|
+
"vitest": "^4.0.18"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=22.18.0",
|