@1llet.xyz/erc4337-gasless-sdk 0.4.23 → 0.4.25

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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { optimism, gnosis, baseSepolia, base, avalanche, worldchain, monad, bsc, polygon, unichain, arbitrum } from 'viem/chains';
1
+ import { optimism, gnosis, baseSepolia, base, avalanche, worldchain, monad, polygon, arbitrum, bsc, unichain } from 'viem/chains';
2
2
  import { createPublicClient, http, createWalletClient, decodeErrorResult, parseSignature, maxUint256, encodeFunctionData, encodeAbiParameters, keccak256, padHex } from 'viem';
3
3
  import { privateKeyToAccount } from 'viem/accounts';
4
4
  import axios from 'axios';
@@ -50,6 +50,45 @@ var init_facilitator = __esm({
50
50
  messageTransmitter: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64",
51
51
  rpcUrl: "https://opt-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN"
52
52
  // Assuming same key works or public
53
+ },
54
+ Gnosis: {
55
+ chainId: 100,
56
+ chain: gnosis,
57
+ usdc: "0x2a22f9c3b48403ebD92cF06fF916b322a30dB834",
58
+ // EURe (or USDC on Gnosis? The user is swapping USDT -> USDC, wait. The user log says GNOSIS -> Optimism (USDT -> USDC).
59
+ // For verification, we just need RPC. The 'usdc' field is for CCTP, but verify logic just needs `rpcUrl`.
60
+ // I will populate others as placeholders if unknown.
61
+ usdcName: "USDC",
62
+ // Placeholder
63
+ usdcVersion: "2",
64
+ domain: 0,
65
+ // Placeholder
66
+ tokenMessenger: "0x0000000000000000000000000000000000000000",
67
+ messageTransmitter: "0x0000000000000000000000000000000000000000",
68
+ rpcUrl: "https://rpc.gnosischain.com"
69
+ },
70
+ Arbitrum: {
71
+ chainId: 42161,
72
+ chain: arbitrum,
73
+ usdc: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
74
+ usdcName: "USD Coin",
75
+ usdcVersion: "2",
76
+ domain: 3,
77
+ tokenMessenger: "0x19330d10D9Cc8751218eaf51E8885D058642E08A",
78
+ messageTransmitter: "0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca",
79
+ rpcUrl: "https://arb-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN"
80
+ },
81
+ Polygon: {
82
+ chainId: 137,
83
+ chain: polygon,
84
+ usdc: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
85
+ usdcName: "USD Coin",
86
+ usdcVersion: "2",
87
+ domain: 7,
88
+ // Placeholder? CCTP domain for Polygon is 7? I should check if I had it elsewhere.
89
+ tokenMessenger: "0x0000000000000000000000000000000000000000",
90
+ messageTransmitter: "0x0000000000000000000000000000000000000000",
91
+ rpcUrl: "https://polygon-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN"
53
92
  }
54
93
  };
55
94
  }
@@ -2050,7 +2089,9 @@ var NearStrategy = class {
2050
2089
  transport: http4(networkConfig.rpcUrl)
2051
2090
  });
2052
2091
  try {
2092
+ console.log(`[NearStrategy] Waiting for receipt...`);
2053
2093
  const receipt = await publicClient.waitForTransactionReceipt({ hash: depositTxHash });
2094
+ console.log(`[NearStrategy] Receipt found. Status: ${receipt.status}`);
2054
2095
  if (receipt.status === "success") {
2055
2096
  return {
2056
2097
  success: true,
@@ -2062,9 +2103,13 @@ var NearStrategy = class {
2062
2103
  completed: true
2063
2104
  }
2064
2105
  };
2106
+ } else {
2107
+ console.error(`[NearStrategy] Transaction failed. Status: ${receipt.status}`);
2108
+ return { success: false, errorReason: `Transaction Reverted on-chain (Status: ${receipt.status})` };
2065
2109
  }
2066
2110
  } catch (e) {
2067
- return { success: false, errorReason: `Invalid deposit transaction: ${e.message}` };
2111
+ console.error(`[NearStrategy] Verification Error:`, e);
2112
+ return { success: false, errorReason: `Verification Error: ${e.message}` };
2068
2113
  }
2069
2114
  }
2070
2115
  try {