@1llet.xyz/erc4337-gasless-sdk 0.4.26 → 0.4.27
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.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -51,7 +51,7 @@ var init_facilitator = __esm({
|
|
|
51
51
|
rpcUrl: "https://opt-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN"
|
|
52
52
|
// Assuming same key works or public
|
|
53
53
|
},
|
|
54
|
-
|
|
54
|
+
Gnosis: {
|
|
55
55
|
chainId: 100,
|
|
56
56
|
chain: gnosis,
|
|
57
57
|
usdc: "0x2a22f9c3b48403ebD92cF06fF916b322a30dB834",
|
|
@@ -900,6 +900,16 @@ var CHAIN_CONFIGS = {
|
|
|
900
900
|
[optimism.id]: OPTIMISM_MAINNET
|
|
901
901
|
};
|
|
902
902
|
|
|
903
|
+
// src/constants/chains.ts
|
|
904
|
+
var CHAIN_ID_TO_KEY = {
|
|
905
|
+
"8453": "Base",
|
|
906
|
+
"84532": "Base",
|
|
907
|
+
"100": "Gnosis",
|
|
908
|
+
"10": "Optimism",
|
|
909
|
+
"11155420": "Optimism",
|
|
910
|
+
"42161": "Arbitrum"
|
|
911
|
+
};
|
|
912
|
+
|
|
903
913
|
// src/services/gasless.ts
|
|
904
914
|
init_facilitator();
|
|
905
915
|
init_facilitator();
|
|
@@ -1007,6 +1017,9 @@ var GaslessStrategy = class {
|
|
|
1007
1017
|
}
|
|
1008
1018
|
async execute(context) {
|
|
1009
1019
|
const { paymentPayload, sourceChain, amount, recipient } = context;
|
|
1020
|
+
if (!paymentPayload) {
|
|
1021
|
+
return { success: false, errorReason: "Payment payload is required for Gasless Strategy" };
|
|
1022
|
+
}
|
|
1010
1023
|
return processGaslessSettlement(
|
|
1011
1024
|
paymentPayload,
|
|
1012
1025
|
sourceChain,
|
|
@@ -1831,7 +1844,10 @@ async function processCCTPSettlement(context, crossChainConfig) {
|
|
|
1831
1844
|
};
|
|
1832
1845
|
}
|
|
1833
1846
|
const facilitatorAccount = privateKeyToAccount(facilitatorPrivateKey);
|
|
1834
|
-
const
|
|
1847
|
+
const fromAddress = context.senderAddress || paymentPayload?.authorization?.from;
|
|
1848
|
+
if (!fromAddress) {
|
|
1849
|
+
return { success: false, errorReason: "Sender address is missing" };
|
|
1850
|
+
}
|
|
1835
1851
|
const usdcAddress = networkConfig.usdc;
|
|
1836
1852
|
const amountBigInt = BigInt(Math.floor(parseFloat(amount) * 1e6));
|
|
1837
1853
|
const publicClient = createPublicClient({
|
|
@@ -1886,7 +1902,7 @@ async function processCCTPSettlement(context, crossChainConfig) {
|
|
|
1886
1902
|
};
|
|
1887
1903
|
}
|
|
1888
1904
|
const transferHash = depositTxHash || "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
1889
|
-
return executeCCTPBridge(sourceChain, amount, crossChainConfig, facilitatorPrivateKey, recipient, transferHash,
|
|
1905
|
+
return executeCCTPBridge(sourceChain, amount, crossChainConfig, facilitatorPrivateKey, recipient, transferHash, fromAddress);
|
|
1890
1906
|
}
|
|
1891
1907
|
async function executeCCTPBridge(sourceChain, amount, crossChainConfig, facilitatorPrivateKey, recipient, transferHash, payerAddress) {
|
|
1892
1908
|
if (!facilitatorPrivateKey) {
|
|
@@ -2265,6 +2281,6 @@ var BridgeManager = class {
|
|
|
2265
2281
|
}
|
|
2266
2282
|
};
|
|
2267
2283
|
|
|
2268
|
-
export { AccountAbstraction, BASE_MAINNET, BASE_SEPOLIA, BridgeManager, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, GNOSIS_MAINNET, GaslessStrategy, NearStrategy, OPTIMISM_MAINNET, StandardBridgeStrategy, entryPointAbi, erc20Abi, smartAccountAbi };
|
|
2284
|
+
export { AccountAbstraction, BASE_MAINNET, BASE_SEPOLIA, BridgeManager, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, GNOSIS_MAINNET, GaslessStrategy, NearStrategy, OPTIMISM_MAINNET, StandardBridgeStrategy, entryPointAbi, erc20Abi, smartAccountAbi };
|
|
2269
2285
|
//# sourceMappingURL=index.mjs.map
|
|
2270
2286
|
//# sourceMappingURL=index.mjs.map
|