@1llet.xyz/erc4337-gasless-sdk 0.4.39 → 0.4.40
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.js +40 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2182,6 +2182,31 @@ var NearStrategy = class {
|
|
|
2182
2182
|
const stellarService = new StellarService2();
|
|
2183
2183
|
const tx = await stellarService.server.transactions().transaction(depositTxHash).call();
|
|
2184
2184
|
if (tx.successful) {
|
|
2185
|
+
const operations = await stellarService.server.operations().forTransaction(depositTxHash).call();
|
|
2186
|
+
const paymentOp = operations.records.find((op) => op.type === "payment" || op.type === "path_payment_strict_send" || op.type === "path_payment_strict_receive");
|
|
2187
|
+
let depositAddress = "";
|
|
2188
|
+
let memo = "";
|
|
2189
|
+
if (paymentOp) {
|
|
2190
|
+
depositAddress = paymentOp.to || paymentOp.funder || "";
|
|
2191
|
+
}
|
|
2192
|
+
if (tx.memo_type === "text" || tx.memo_type === "id") {
|
|
2193
|
+
memo = tx.memo || "";
|
|
2194
|
+
}
|
|
2195
|
+
if (depositAddress) {
|
|
2196
|
+
console.log(`[NearStrategy] Submitting deposit to 1-Click: ${depositTxHash} -> ${depositAddress} (Memo: ${memo})`);
|
|
2197
|
+
try {
|
|
2198
|
+
await oneClickSdkTypescript.OneClickService.submitDepositTx({
|
|
2199
|
+
txHash: depositTxHash,
|
|
2200
|
+
depositAddress,
|
|
2201
|
+
memo: memo || void 0
|
|
2202
|
+
});
|
|
2203
|
+
console.log("[NearStrategy] Deposit submitted successfully.");
|
|
2204
|
+
} catch (e) {
|
|
2205
|
+
console.error("[NearStrategy] Failed to submit deposit to 1-Click:", e.message);
|
|
2206
|
+
}
|
|
2207
|
+
} else {
|
|
2208
|
+
console.error("[NearStrategy] Could not determine deposit address from Stellar operations.");
|
|
2209
|
+
}
|
|
2185
2210
|
return {
|
|
2186
2211
|
success: true,
|
|
2187
2212
|
transactionHash: depositTxHash,
|
|
@@ -2211,6 +2236,20 @@ var NearStrategy = class {
|
|
|
2211
2236
|
const receipt = await publicClient.waitForTransactionReceipt({ hash: depositTxHash });
|
|
2212
2237
|
console.log(`[NearStrategy] Receipt found. Status: ${receipt.status}`);
|
|
2213
2238
|
if (receipt.status === "success") {
|
|
2239
|
+
const tx = await publicClient.getTransaction({ hash: depositTxHash });
|
|
2240
|
+
const depositAddress = tx.to;
|
|
2241
|
+
if (depositAddress) {
|
|
2242
|
+
console.log(`[NearStrategy] Submitting deposit to 1-Click: ${depositTxHash} -> ${depositAddress}`);
|
|
2243
|
+
try {
|
|
2244
|
+
await oneClickSdkTypescript.OneClickService.submitDepositTx({
|
|
2245
|
+
txHash: depositTxHash,
|
|
2246
|
+
depositAddress
|
|
2247
|
+
});
|
|
2248
|
+
console.log("[NearStrategy] Deposit submitted successfully.");
|
|
2249
|
+
} catch (e) {
|
|
2250
|
+
console.error("[NearStrategy] Failed to submit deposit to 1-Click:", e.message);
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2214
2253
|
return {
|
|
2215
2254
|
success: true,
|
|
2216
2255
|
transactionHash: depositTxHash,
|
|
@@ -2301,7 +2340,7 @@ async function getNearQuote(sourceChain, destChain, amount, destToken, sourceTok
|
|
|
2301
2340
|
refundType: oneClickSdkTypescript.QuoteRequest.refundType.ORIGIN_CHAIN,
|
|
2302
2341
|
recipient,
|
|
2303
2342
|
recipientType: oneClickSdkTypescript.QuoteRequest.recipientType.DESTINATION_CHAIN,
|
|
2304
|
-
deadline: new Date(Date.now() +
|
|
2343
|
+
deadline: new Date(Date.now() + 3 * 60 * 1e3).toISOString(),
|
|
2305
2344
|
referral: "1llet",
|
|
2306
2345
|
quoteWaitingTimeMs: 1e4
|
|
2307
2346
|
};
|