@4mica/sdk 1.2.5 → 1.2.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.
Files changed (2) hide show
  1. package/dist/contract.js +6 -5
  2. package/package.json +1 -1
package/dist/contract.js CHANGED
@@ -136,13 +136,14 @@ class ContractGateway {
136
136
  }
137
137
  // Verify the allowance was actually set on-chain. The catch path above can
138
138
  // leave allowance at 0 if the re-approve transaction fails silently.
139
- // Read at the confirmed block number so the result is consistent regardless
140
- // of RPC node propagation lag.
139
+ // Read at "latest" waitForTransactionReceipt already confirmed the block,
140
+ // and many public RPCs reject eth_call at a specific recent blockNumber.
141
141
  const account = this.walletClient.account;
142
142
  if (account) {
143
- const actual = (await erc20.read.allowance([account.address, spender], {
144
- blockNumber: txReceipt.blockNumber,
145
- }));
143
+ const actual = (await erc20.read.allowance([
144
+ account.address,
145
+ spender,
146
+ ]));
146
147
  if (actual < targetAllowance) {
147
148
  throw new errors_1.ContractError(`ERC20 allowance verification failed: on-chain allowance is ${actual} but expected ${targetAllowance}. ` +
148
149
  `Try calling approveErc20 again.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4mica/sdk",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "TypeScript SDK for interacting with the 4Mica payment network",
5
5
  "license": "MIT",
6
6
  "repository": {