epistery 1.5.6 → 1.5.7
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/client/witness.js +29 -0
- package/dist/chains/JapanOpenChain.js +1 -1
- package/dist/chains/JapanOpenChain.js.map +1 -1
- package/dist/chains/PolygonChain.js +4 -4
- package/dist/chains/PolygonChain.js.map +1 -1
- package/dist/utils/Config.js +2 -2
- package/package.json +1 -1
- package/scripts/deploy-agent.js +1 -1
- package/src/chains/JapanOpenChain.ts +1 -1
- package/src/chains/PolygonChain.ts +4 -4
- package/src/utils/Config.ts +2 -2
package/client/witness.js
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
Web3Wallet,
|
|
11
11
|
BrowserWallet,
|
|
12
12
|
RivetWallet,
|
|
13
|
+
FidoWallet,
|
|
13
14
|
} from "./wallet.js?v=7";
|
|
14
15
|
import NotabotTracker from "./notabot.js";
|
|
15
16
|
|
|
@@ -1133,6 +1134,34 @@ export default class Witness {
|
|
|
1133
1134
|
};
|
|
1134
1135
|
}
|
|
1135
1136
|
|
|
1137
|
+
async addFidoWallet(label = null) {
|
|
1138
|
+
await ensureEthers();
|
|
1139
|
+
const newWallet = await FidoWallet.create(ethers, {
|
|
1140
|
+
label: label || "FIDO Wallet",
|
|
1141
|
+
});
|
|
1142
|
+
|
|
1143
|
+
if (!newWallet) {
|
|
1144
|
+
throw new Error("Failed to create FIDO wallet");
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
// Temporarily set as active wallet to save it
|
|
1148
|
+
const previousWallet = this.wallet;
|
|
1149
|
+
this.wallet = newWallet;
|
|
1150
|
+
this.save();
|
|
1151
|
+
|
|
1152
|
+
// Restore previous wallet if there was one
|
|
1153
|
+
if (previousWallet) {
|
|
1154
|
+
this.wallet = previousWallet;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
return {
|
|
1158
|
+
id: newWallet.id,
|
|
1159
|
+
address: newWallet.address,
|
|
1160
|
+
source: newWallet.source,
|
|
1161
|
+
label: newWallet.label,
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1136
1165
|
async setDefaultWallet(walletId) {
|
|
1137
1166
|
const storageData = this.loadStorageData();
|
|
1138
1167
|
const walletData = storageData.wallets.find((w) => w.id === walletId);
|
|
@@ -30,7 +30,7 @@ class JapanOpenChain extends Chain_1.Chain {
|
|
|
30
30
|
const gasPrice = networkPrice.gt(floor) ? networkPrice : floor;
|
|
31
31
|
// Hard ceiling matching PolygonChain — refuse to send if the chain
|
|
32
32
|
// wants more than the operator is willing to pay. Default 200 gwei.
|
|
33
|
-
const ceiling = this.gwei(this.policy.maxGasPriceGwei ??
|
|
33
|
+
const ceiling = this.gwei(this.policy.maxGasPriceGwei ?? 1000);
|
|
34
34
|
if (gasPrice.gt(ceiling)) {
|
|
35
35
|
throw new Error(`JOC gas price ${ethers_1.ethers.utils.formatUnits(gasPrice, 'gwei')} gwei exceeds ` +
|
|
36
36
|
`cap ${ethers_1.ethers.utils.formatUnits(ceiling, 'gwei')} gwei. ` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JapanOpenChain.js","sourceRoot":"","sources":["../../src/chains/JapanOpenChain.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,mCAA8C;AAC9C,yCAA2C;AAE3C;;;;;;;;;;;GAWG;AACH,MAAa,cAAe,SAAQ,aAAK;IAUvC,eAAe;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IAES,WAAW;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,MAAM,YAAY,GAAG,E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AAM,CAAC,gBAAgB;gBAC3E,OAAO,eAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS;gBACzD,4DAA4D,CAC7D,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,CAAC;IACtB,CAAC;;AApCH,wCAqCC;AApCQ,sBAAO,GAAG,EAAE,CAAC;AACb,uBAAQ,GAAG;IAChB,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,uCAAuC;IAC5C,kBAAkB,EAAE,KAAK;IACzB,oBAAoB,EAAE,KAAK;IAC3B,sBAAsB,EAAE,EAAE;CAC3B,CAAC;AA+BJ,IAAA,wBAAa,EAAC,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC"}
|
|
@@ -31,10 +31,10 @@ class PolygonChain extends Chain_1.Chain {
|
|
|
31
31
|
const networkMax = fd.maxFeePerGas ?? minMaxFee;
|
|
32
32
|
const maxFeePerGas = networkMax.gt(minMaxFee) ? networkMax : minMaxFee;
|
|
33
33
|
// Hard ceiling: refuse to send if the chain wants more than the operator
|
|
34
|
-
// is willing to pay. Default
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
const ceiling = this.gwei(this.policy.maxFeePerGasGwei ??
|
|
34
|
+
// is willing to pay. Default 1000 gwei: real Polygon congestion can hit
|
|
35
|
+
// 500–800 gwei legitimately, so the cap should catch only catastrophic
|
|
36
|
+
// anomalies that would drain a wallet. Override via policy.maxFeePerGasGwei.
|
|
37
|
+
const ceiling = this.gwei(this.policy.maxFeePerGasGwei ?? 1000);
|
|
38
38
|
if (maxFeePerGas.gt(ceiling)) {
|
|
39
39
|
throw new Error(`Polygon fee ${ethers_1.ethers.utils.formatUnits(maxFeePerGas, 'gwei')} gwei exceeds ` +
|
|
40
40
|
`cap ${ethers_1.ethers.utils.formatUnits(ceiling, 'gwei')} gwei. ` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolygonChain.js","sourceRoot":"","sources":["../../src/chains/PolygonChain.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,mCAA8C;AAC9C,yCAA2C;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAa,YAAa,SAAQ,aAAK;IAU3B,cAAc;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAEpC,MAAM,eAAe,GAAG,EAAE,CAAC,oBAAoB,IAAI,KAAK,CAAC;QACzD,MAAM,oBAAoB,GAAG,eAAe,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC;QAEjF,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,IAAI,CAAC,CAAC;QACrD,MAAM,SAAS,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,UAAU,GAAG,EAAE,CAAC,YAAY,IAAI,SAAS,CAAC;QAChD,MAAM,YAAY,GAAG,UAAU,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;QAEvE,yEAAyE;QACzE,wEAAwE;QACxE,
|
|
1
|
+
{"version":3,"file":"PolygonChain.js","sourceRoot":"","sources":["../../src/chains/PolygonChain.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,mCAA8C;AAC9C,yCAA2C;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAa,YAAa,SAAQ,aAAK;IAU3B,cAAc;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,IAAI,EA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G,CAAC;AACd,qBAAQ,GAAG;IAChB,IAAI,EAAE,iBAAiB;IACvB,GAAG,EAAE,wCAAwC;IAC7C,kBAAkB,EAAE,KAAK;IACzB,oBAAoB,EAAE,KAAK;IAC3B,sBAAsB,EAAE,EAAE;CAC3B,CAAC;AAkCJ;;;;;;GAMG;AACH,MAAa,SAAU,SAAQ,YAAY;;AAA3C,8BASC;AARQ,iBAAO,GAAG,KAAK,CAAC;AAChB,kBAAQ,GAAG;IAChB,IAAI,EAAE,sBAAsB;IAC5B,GAAG,EAAE,qCAAqC;IAC1C,kBAAkB,EAAE,KAAK;IACzB,oBAAoB,EAAE,KAAK;IAC3B,sBAAsB,EAAE,EAAE;CAC3B,CAAC;AAGJ,IAAA,wBAAa,EAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAClD,IAAA,wBAAa,EAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC"}
|
package/dist/utils/Config.js
CHANGED
|
@@ -200,9 +200,9 @@ nativeCurrencyDecimals=18
|
|
|
200
200
|
; legitimately pushes the network past the cap; the default is meant to
|
|
201
201
|
; be a circuit-breaker, not a normal operating point.
|
|
202
202
|
; [default.rpc.137.policy]
|
|
203
|
-
; maxFeePerGasGwei=
|
|
203
|
+
; maxFeePerGasGwei=1000 ; refuse to send if Polygon wants more
|
|
204
204
|
; minPriorityFeeGwei=25 ; Polygon RPC floor (don't lower)
|
|
205
205
|
; [default.rpc.81.policy]
|
|
206
|
-
; maxGasPriceGwei=
|
|
206
|
+
; maxGasPriceGwei=1000 ; legacy-chain analogue (JOC)
|
|
207
207
|
`;
|
|
208
208
|
//# sourceMappingURL=Config.js.map
|
package/package.json
CHANGED
package/scripts/deploy-agent.js
CHANGED
|
@@ -34,7 +34,7 @@ async function polygonDeployOverrides(provider, policy) {
|
|
|
34
34
|
const maxFeePerGas = networkMax.gt(minMaxFee) ? networkMax : minMaxFee;
|
|
35
35
|
|
|
36
36
|
const ceiling = hre.ethers.utils.parseUnits(
|
|
37
|
-
String(policy.maxFeePerGasGwei ??
|
|
37
|
+
String(policy.maxFeePerGasGwei ?? 1000), "gwei"
|
|
38
38
|
);
|
|
39
39
|
if (maxFeePerGas.gt(ceiling)) {
|
|
40
40
|
throw new Error(
|
|
@@ -40,7 +40,7 @@ export class JapanOpenChain extends Chain {
|
|
|
40
40
|
|
|
41
41
|
// Hard ceiling matching PolygonChain — refuse to send if the chain
|
|
42
42
|
// wants more than the operator is willing to pay. Default 200 gwei.
|
|
43
|
-
const ceiling = this.gwei(this.policy.maxGasPriceGwei ??
|
|
43
|
+
const ceiling = this.gwei(this.policy.maxGasPriceGwei ?? 1000);
|
|
44
44
|
if (gasPrice.gt(ceiling)) {
|
|
45
45
|
throw new Error(
|
|
46
46
|
`JOC gas price ${ethers.utils.formatUnits(gasPrice, 'gwei')} gwei exceeds ` +
|
|
@@ -42,10 +42,10 @@ export class PolygonChain extends Chain {
|
|
|
42
42
|
const maxFeePerGas = networkMax.gt(minMaxFee) ? networkMax : minMaxFee;
|
|
43
43
|
|
|
44
44
|
// Hard ceiling: refuse to send if the chain wants more than the operator
|
|
45
|
-
// is willing to pay. Default
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
const ceiling = this.gwei(this.policy.maxFeePerGasGwei ??
|
|
45
|
+
// is willing to pay. Default 1000 gwei: real Polygon congestion can hit
|
|
46
|
+
// 500–800 gwei legitimately, so the cap should catch only catastrophic
|
|
47
|
+
// anomalies that would drain a wallet. Override via policy.maxFeePerGasGwei.
|
|
48
|
+
const ceiling = this.gwei(this.policy.maxFeePerGasGwei ?? 1000);
|
|
49
49
|
if (maxFeePerGas.gt(ceiling)) {
|
|
50
50
|
throw new Error(
|
|
51
51
|
`Polygon fee ${ethers.utils.formatUnits(maxFeePerGas, 'gwei')} gwei exceeds ` +
|
package/src/utils/Config.ts
CHANGED
|
@@ -220,8 +220,8 @@ nativeCurrencyDecimals=18
|
|
|
220
220
|
; legitimately pushes the network past the cap; the default is meant to
|
|
221
221
|
; be a circuit-breaker, not a normal operating point.
|
|
222
222
|
; [default.rpc.137.policy]
|
|
223
|
-
; maxFeePerGasGwei=
|
|
223
|
+
; maxFeePerGasGwei=1000 ; refuse to send if Polygon wants more
|
|
224
224
|
; minPriorityFeeGwei=25 ; Polygon RPC floor (don't lower)
|
|
225
225
|
; [default.rpc.81.policy]
|
|
226
|
-
; maxGasPriceGwei=
|
|
226
|
+
; maxGasPriceGwei=1000 ; legacy-chain analogue (JOC)
|
|
227
227
|
`
|