epistery 1.5.6 → 1.5.8

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 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 ?? 500);
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,EAAE,CAAC,QAAQ,IAAI,KAAK,CAAC;QAC1C,MAAM,QAAQ,GAAG,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC;QAE/D,mEAAmE;QACnE,oEAAoE;QACpE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,IAAI,GAAG,CAAC,CAAC;QAC9D,IAAI,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,iBAAiB,eAAM,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,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;AApC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AC,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 500 gwei is high enough for normal Polygon
35
- // congestion but catches anomalies that would drain a wallet on a single
36
- // contract deploy. Override via policy.maxFeePerGasGwei in config.ini.
37
- const ceiling = this.gwei(this.policy.maxFeePerGasGwei ?? 500);
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":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;;;;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"}
@@ -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=500 ; refuse to send if Polygon wants more
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=500 ; legacy-chain analogue (JOC)
206
+ ; maxGasPriceGwei=1000 ; legacy-chain analogue (JOC)
207
207
  `;
208
208
  //# sourceMappingURL=Config.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epistery",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "Epistery brings blockchain capabilities to mundane web tasks like engagement metrics, authentication and commerce of all sorts.",
5
5
  "author": "Rootz Corp.",
6
6
  "license": "MIT",
@@ -15,6 +15,32 @@ function loadChainPolicy(chainId) {
15
15
  return data?.default?.rpc?.[String(chainId)]?.policy || {};
16
16
  }
17
17
 
18
+ /**
19
+ * Build legacy gasPrice overrides for JOC (81): apply the 30 gwei minimum
20
+ * (JOC RPC enforces this), enforce the same ceiling as Polygon, and force
21
+ * type=0 so hardhat doesn't construct an EIP-1559 typed tx — JOC doesn't
22
+ * honor maxFeePerGas/maxPriorityFeePerGas and the tx will sit in mempool.
23
+ */
24
+ async function jocDeployOverrides(provider, policy) {
25
+ const fd = await provider.getFeeData();
26
+ const minPrice = hre.ethers.utils.parseUnits(
27
+ String(policy.minGasPriceGwei ?? 30), "gwei"
28
+ );
29
+ const networkPrice = fd.gasPrice || minPrice;
30
+ const gasPrice = networkPrice.gt(minPrice) ? networkPrice : minPrice;
31
+
32
+ const ceiling = hre.ethers.utils.parseUnits(
33
+ String(policy.maxGasPriceGwei ?? 1000), "gwei"
34
+ );
35
+ if (gasPrice.gt(ceiling)) {
36
+ throw new Error(
37
+ `Aborting deploy: JOC gas price ${hre.ethers.utils.formatUnits(gasPrice, "gwei")} gwei ` +
38
+ `exceeds cap ${hre.ethers.utils.formatUnits(ceiling, "gwei")} gwei.`
39
+ );
40
+ }
41
+ return { gasPrice, type: 0 };
42
+ }
43
+
18
44
  /**
19
45
  * Build EIP-1559 overrides for Polygon (137) and Amoy (80002): apply the
20
46
  * 25 gwei priority floor, then enforce a configurable ceiling so a base-fee
@@ -34,7 +60,7 @@ async function polygonDeployOverrides(provider, policy) {
34
60
  const maxFeePerGas = networkMax.gt(minMaxFee) ? networkMax : minMaxFee;
35
61
 
36
62
  const ceiling = hre.ethers.utils.parseUnits(
37
- String(policy.maxFeePerGasGwei ?? 500), "gwei"
63
+ String(policy.maxFeePerGasGwei ?? 1000), "gwei"
38
64
  );
39
65
  if (maxFeePerGas.gt(ceiling)) {
40
66
  throw new Error(
@@ -85,19 +111,27 @@ async function main() {
85
111
  console.log("\nDeploying Agent contract...");
86
112
  const Agent = await hre.ethers.getContractFactory("Agent");
87
113
 
88
- // Apply fee cap on Polygon family protects against base-fee spikes or
89
- // RPC misreports that would otherwise drain the deployer wallet.
114
+ // Apply fee cap and per-chain tx-type. Without this, hardhat builds an
115
+ // EIP-1559 tx by default fine for Polygon, but JOC rejects/drops those
116
+ // because it only honors legacy gasPrice.
90
117
  const chainId = hre.network.config.chainId;
91
118
  let overrides = {};
92
119
  if (chainId === 137 || chainId === 80002) {
93
120
  const policy = loadChainPolicy(chainId);
94
121
  overrides = await polygonDeployOverrides(deployer.provider, policy);
95
122
  console.log(
96
- "Gas overrides: maxFeePerGas=" +
123
+ "Gas overrides (EIP-1559): maxFeePerGas=" +
97
124
  hre.ethers.utils.formatUnits(overrides.maxFeePerGas, "gwei") + " gwei, " +
98
125
  "maxPriorityFeePerGas=" +
99
126
  hre.ethers.utils.formatUnits(overrides.maxPriorityFeePerGas, "gwei") + " gwei"
100
127
  );
128
+ } else if (chainId === 81) {
129
+ const policy = loadChainPolicy(chainId);
130
+ overrides = await jocDeployOverrides(deployer.provider, policy);
131
+ console.log(
132
+ "Gas overrides (legacy): gasPrice=" +
133
+ hre.ethers.utils.formatUnits(overrides.gasPrice, "gwei") + " gwei"
134
+ );
101
135
  }
102
136
 
103
137
  const agent = await Agent.deploy(domain, sponsor, overrides);
@@ -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 ?? 500);
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 500 gwei is high enough for normal Polygon
46
- // congestion but catches anomalies that would drain a wallet on a single
47
- // contract deploy. Override via policy.maxFeePerGasGwei in config.ini.
48
- const ceiling = this.gwei(this.policy.maxFeePerGasGwei ?? 500);
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 ` +
@@ -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=500 ; refuse to send if Polygon wants more
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=500 ; legacy-chain analogue (JOC)
226
+ ; maxGasPriceGwei=1000 ; legacy-chain analogue (JOC)
227
227
  `