@1llet.xyz/erc4337-gasless-sdk 0.4.50 → 0.4.52

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,6 +1,6 @@
1
1
  import * as StellarSdk from 'stellar-sdk';
2
2
  import { Networks } from 'stellar-sdk';
3
- import { gnosis, optimism, baseSepolia, base, avalanche, worldchain, monad, polygon, arbitrum, bsc, unichain } from 'viem/chains';
3
+ import { gnosis, avalanche, monad, unichain, arbitrum, polygon, bsc, optimism, baseSepolia, base, optimismSepolia, worldchain } from 'viem/chains';
4
4
  import { createPublicClient, http, createWalletClient, decodeErrorResult, maxUint256, encodeFunctionData, encodeAbiParameters, keccak256, padHex } from 'viem';
5
5
  import { privateKeyToAccount } from 'viem/accounts';
6
6
  import axios from 'axios';
@@ -399,7 +399,7 @@ var BundlerClient = class {
399
399
  return result.result;
400
400
  }
401
401
  async estimateGas(userOp) {
402
- return await this.call("eth_estimateUserOperationGas", [
402
+ const result = await this.call("eth_estimateUserOperationGas", [
403
403
  {
404
404
  sender: userOp.sender,
405
405
  nonce: userOp.nonce ? "0x" + userOp.nonce.toString(16) : "0x0",
@@ -410,6 +410,15 @@ var BundlerClient = class {
410
410
  },
411
411
  this.entryPointAddress
412
412
  ]);
413
+ console.log("DEBUG: estimateGas result:", result);
414
+ return {
415
+ callGasLimit: result.callGasLimit,
416
+ verificationGasLimit: result.verificationGasLimit,
417
+ preVerificationGas: result.preVerificationGas,
418
+ maxFeePerGas: result.maxFeePerGas,
419
+ maxPriorityFeePerGas: result.maxPriorityFeePerGas,
420
+ paymasterAndData: result.paymasterAndData
421
+ };
413
422
  }
414
423
  async sendUserOperation(userOp) {
415
424
  return await this.call("eth_sendUserOperation", [
@@ -584,6 +593,7 @@ var UserOpBuilder = class {
584
593
  preVerificationGas: BigInt(gasEstimate.preVerificationGas),
585
594
  maxFeePerGas: BigInt(gasEstimate.maxFeePerGas),
586
595
  maxPriorityFeePerGas: BigInt(gasEstimate.maxPriorityFeePerGas),
596
+ paymasterAndData: gasEstimate.paymasterAndData || partialOp.paymasterAndData,
587
597
  signature: "0x"
588
598
  };
589
599
  }
@@ -608,6 +618,7 @@ var UserOpBuilder = class {
608
618
  preVerificationGas: BigInt(gasEstimate.preVerificationGas),
609
619
  maxFeePerGas: BigInt(gasEstimate.maxFeePerGas),
610
620
  maxPriorityFeePerGas: BigInt(gasEstimate.maxPriorityFeePerGas),
621
+ paymasterAndData: gasEstimate.paymasterAndData || partialOp.paymasterAndData,
611
622
  signature: "0x"
612
623
  };
613
624
  }
@@ -1261,285 +1272,131 @@ var BASE_SEPOLIA = {
1261
1272
  factoryAddress: "0x9406Cc6185a346906296840746125a0E44976454"
1262
1273
  // Paymaster optional
1263
1274
  }};
1264
-
1265
- // src/chains.ts
1266
- init_Stellar();
1267
- function mapToSDKConfig(data) {
1268
- if (data.nonEvm) {
1269
- return {
1270
- chain: { id: 9e3, name: "Stellar" },
1271
- // Custom ID for Stellar
1272
- tokens: data.assets.map((a) => ({
1273
- symbol: a.name,
1274
- decimals: a.decimals,
1275
- address: a.address
1276
- }))
1277
- };
1278
- }
1279
- if (!data.evm) throw new Error("Non-EVM config used in EVM SDK");
1280
- return {
1281
- chain: data.evm.chain,
1282
- rpcUrl: data.evm.rpcUrl || void 0,
1283
- bundlerUrl: data.evm.bundlerUrl,
1284
- entryPointAddress: data.evm.entryPointAddress,
1285
- factoryAddress: data.evm.factoryAddress,
1286
- paymasterAddress: data.evm.paymasterAddress,
1287
- tokens: data.assets.map((a) => ({
1288
- symbol: a.name,
1289
- decimals: a.decimals,
1290
- address: a.address
1291
- }))
1292
- };
1293
- }
1294
- var BASE_MAINNET = mapToSDKConfig(BASE);
1295
- var OPTIMISM_MAINNET = mapToSDKConfig(OPTIMISM);
1296
- var GNOSIS_MAINNET = mapToSDKConfig(GNOSIS);
1297
- var BASE_SEPOLIA2 = mapToSDKConfig(BASE_SEPOLIA);
1298
- var STELLAR_MAINNET = mapToSDKConfig(STELLAR);
1299
- var CHAIN_CONFIGS = {
1300
- [base.id]: BASE_MAINNET,
1301
- [baseSepolia.id]: BASE_SEPOLIA2,
1302
- [gnosis.id]: GNOSIS_MAINNET,
1303
- [optimism.id]: OPTIMISM_MAINNET,
1304
- 9e3: STELLAR_MAINNET
1305
- };
1306
-
1307
- // src/constants/chains.ts
1308
- var CHAIN_ID_TO_KEY = {
1309
- "8453": "Base",
1310
- "84532": "Base",
1311
- "100": "Gnosis",
1312
- "10": "Optimism",
1313
- "11155420": "Optimism",
1314
- "42161": "Arbitrum",
1315
- "9000": "Stellar"
1316
- };
1317
-
1318
- // src/index.ts
1319
- init_StellarService();
1320
- init_Stellar();
1321
-
1322
- // src/services/cctp.ts
1323
- init_facilitator();
1324
- init_facilitator();
1325
-
1326
- // src/constants/abis.ts
1327
- var usdcErc3009Abi = [
1328
- {
1329
- inputs: [
1330
- { name: "from", type: "address" },
1331
- { name: "to", type: "address" },
1332
- { name: "value", type: "uint256" },
1333
- { name: "validAfter", type: "uint256" },
1334
- { name: "validBefore", type: "uint256" },
1335
- { name: "nonce", type: "bytes32" },
1336
- { name: "v", type: "uint8" },
1337
- { name: "r", type: "bytes32" },
1338
- { name: "s", type: "bytes32" }
1339
- ],
1340
- name: "transferWithAuthorization",
1341
- outputs: [],
1342
- stateMutability: "nonpayable",
1343
- type: "function"
1344
- },
1345
- {
1346
- inputs: [{ name: "account", type: "address" }],
1347
- name: "balanceOf",
1348
- outputs: [{ name: "", type: "uint256" }],
1349
- stateMutability: "view",
1350
- type: "function"
1351
- },
1352
- {
1353
- inputs: [
1354
- { name: "spender", type: "address" },
1355
- { name: "amount", type: "uint256" }
1356
- ],
1357
- name: "approve",
1358
- outputs: [{ name: "", type: "bool" }],
1359
- stateMutability: "nonpayable",
1360
- type: "function"
1361
- },
1362
- {
1363
- inputs: [
1364
- { name: "to", type: "address" },
1365
- { name: "amount", type: "uint256" }
1366
- ],
1367
- name: "transfer",
1368
- outputs: [{ name: "", type: "bool" }],
1369
- stateMutability: "nonpayable",
1370
- type: "function"
1371
- }
1372
- ];
1373
- var tokenMessengerAbi = [
1374
- {
1375
- inputs: [
1376
- { name: "amount", type: "uint256" },
1377
- { name: "destinationDomain", type: "uint32" },
1378
- { name: "mintRecipient", type: "bytes32" },
1379
- { name: "burnToken", type: "address" },
1380
- { name: "destinationCaller", type: "bytes32" },
1381
- { name: "maxFee", type: "uint256" },
1382
- // Suspected wrapper arg
1383
- { name: "minFinalityThreshold", type: "uint32" }
1384
- // Suspected wrapper arg
1385
- ],
1386
- name: "depositForBurn",
1387
- outputs: [{ name: "_nonce", type: "uint64" }],
1388
- stateMutability: "nonpayable",
1389
- type: "function"
1390
- },
1391
- // Alternative overload often used:
1392
- {
1393
- inputs: [
1394
- { name: "amount", type: "uint256" },
1395
- { name: "destinationDomain", type: "uint32" },
1396
- { name: "mintRecipient", type: "bytes32" },
1397
- { name: "burnToken", type: "address" }
1398
- ],
1399
- name: "depositForBurn",
1400
- outputs: [{ name: "_nonce", type: "uint64" }],
1401
- stateMutability: "nonpayable",
1402
- type: "function"
1403
- }
1404
- ];
1405
- var messageTransmitterAbi = [
1406
- {
1407
- inputs: [
1408
- { name: "message", type: "bytes" },
1409
- { name: "attestation", type: "bytes" }
1410
- ],
1411
- name: "receiveMessage",
1412
- outputs: [{ name: "success", type: "bool" }],
1413
- stateMutability: "nonpayable",
1414
- type: "function"
1415
- }
1416
- ];
1417
- var createRetrieveAttestation = async (transactionHash, chainId, timeout = 6e4) => {
1418
- const baseUrl = "https://iris-api.circle.com";
1419
- const url = `${baseUrl}/v2/messages/${chainId}?transactionHash=${transactionHash}`;
1420
- const start = Date.now();
1421
- const FIVE_SECONDS = 5e3;
1422
- while (true) {
1423
- const elapsed = Date.now() - start;
1424
- if (elapsed > timeout) {
1425
- throw new Error(
1426
- "Timeout: Attestation not retrieved within the expected time."
1427
- );
1428
- }
1429
- try {
1430
- const response = await axios.get(url);
1431
- const message = response.data?.messages?.[0];
1432
- if (message?.status === "complete") {
1433
- console.log("Attestation retrieved successfully!");
1434
- return message;
1435
- }
1436
- console.log("Waiting for attestation...");
1437
- } catch (error) {
1438
- const status = error.response?.status;
1439
- if (status === 404) {
1440
- console.log("Waiting for attestation...");
1441
- } else {
1442
- console.error("Error fetching attestation:", error.message);
1443
- }
1444
- }
1445
- await new Promise((resolve) => setTimeout(resolve, FIVE_SECONDS));
1446
- }
1447
- };
1448
- var ARBITRUM = {
1275
+ var AVALANCHE = {
1449
1276
  assets: [
1450
1277
  {
1451
1278
  name: "USDC",
1452
1279
  decimals: 6,
1453
- address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
1280
+ address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
1454
1281
  coingeckoId: "usd-coin"
1455
1282
  },
1456
1283
  {
1457
- name: "USDT",
1458
- decimals: 6,
1459
- address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
1460
- coingeckoId: "tether"
1461
- },
1462
- {
1463
- name: "ARB",
1284
+ name: "AVAX",
1464
1285
  decimals: 18,
1465
- address: "0x912CE59144191C1204E64559FE8253a0e49E6548",
1466
- coingeckoId: "arbitrum"
1286
+ address: "0x0000000000000000000000000000000000000000",
1287
+ coingeckoId: "avalanche-2"
1467
1288
  },
1468
1289
  {
1469
- name: "ETH",
1470
- decimals: 18,
1471
- address: "0x0000000000000000000000000000000000000000",
1472
- coingeckoId: "ethereum"
1290
+ name: "USDT",
1291
+ decimals: 6,
1292
+ address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",
1293
+ coingeckoId: "tether"
1473
1294
  }
1474
1295
  ],
1475
1296
  evm: {
1476
- chain: arbitrum,
1477
- rpcUrl: "https://arb-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
1478
- supports7702: true,
1479
- erc4337: false
1297
+ chain: avalanche,
1298
+ rpcUrl: avalanche.rpcUrls.default.http[0],
1299
+ supports7702: false,
1300
+ erc4337: false,
1301
+ entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
1302
+ factoryAddress: "0x5D1D71FE2De5D1C52c7c11311332eC7f0CBf88aF",
1303
+ paymasterAddress: "0x6c0de464F2203FE089FF719Acf425dFfE6ac1EE5"
1480
1304
  },
1481
1305
  crossChainInformation: {
1482
1306
  circleInformation: {
1483
1307
  supportCirclePaymaster: true,
1484
- aproxFromFee: 0,
1485
1308
  cCTPInformation: {
1486
1309
  supportCCTP: true,
1487
- domain: 3
1488
- }
1310
+ domain: 1
1311
+ },
1312
+ aproxFromFee: 0
1489
1313
  },
1490
1314
  nearIntentInformation: {
1491
1315
  support: true,
1492
1316
  assetsId: [
1493
1317
  {
1494
- assetId: "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
1318
+ assetId: "nep245:v2_1.omni.hot.tg:43114_3atVJH3r5c4GqiSYmg9fECvjc47o",
1495
1319
  name: "USDC",
1496
1320
  decimals: 6
1497
1321
  },
1498
1322
  {
1499
- assetId: "nep141:arb-0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9.omft.near",
1500
- name: "USDT",
1501
- decimals: 6
1502
- },
1503
- {
1504
- assetId: "nep141:arb.omft.near",
1505
- name: "ETH",
1323
+ assetId: "nep245:v2_1.omni.hot.tg:43114_11111111111111111111",
1324
+ name: "AVAX",
1506
1325
  decimals: 18
1507
1326
  },
1508
1327
  {
1509
- assetId: "nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near",
1510
- name: "ARB",
1511
- decimals: 18
1328
+ assetId: "nep245:v2_1.omni.hot.tg:43114_372BeH7ENZieCaabwkbWkBiTTgXp",
1329
+ name: "USDT",
1330
+ decimals: 6
1512
1331
  }
1513
1332
  ],
1514
1333
  needMemo: false
1515
1334
  }
1516
1335
  }
1517
1336
  };
1518
- var UNICHAIN = {
1337
+ var BNB = {
1519
1338
  assets: [
1520
1339
  {
1521
1340
  name: "USDC",
1522
- decimals: 6,
1523
- address: "0x078D782b760474a361dDA0AF3839290b0EF57AD6",
1341
+ decimals: 18,
1342
+ address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
1343
+ // BSC Mainnet USDC
1524
1344
  coingeckoId: "usd-coin"
1345
+ },
1346
+ {
1347
+ name: "USDT",
1348
+ decimals: 18,
1349
+ address: "0x55d398326f99059fF775485246999027B3197955",
1350
+ // BSC Mainnet USDT
1351
+ coingeckoId: "tether"
1352
+ },
1353
+ {
1354
+ name: "BNB",
1355
+ decimals: 18,
1356
+ address: "0x0000000000000000000000000000000000000000",
1357
+ // Native
1358
+ coingeckoId: "binancecoin"
1525
1359
  }
1526
1360
  ],
1527
1361
  evm: {
1528
- chain: unichain,
1529
- rpcUrl: "https://unichain-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
1362
+ chain: bsc,
1363
+ rpcUrl: "https://bsc-dataseed.binance.org",
1530
1364
  supports7702: true,
1531
- erc4337: false
1365
+ erc4337: false,
1366
+ entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
1367
+ factoryAddress: "0x2d5dBD90d3aB35614cdf686a67A9889E56B20b27",
1368
+ paymasterAddress: "0x460593321DdbE4e1038666Ad07Fc1F817dfA02DB"
1532
1369
  },
1533
1370
  crossChainInformation: {
1534
1371
  circleInformation: {
1535
- supportCirclePaymaster: true,
1372
+ supportCirclePaymaster: false,
1373
+ aproxFromFee: 0,
1536
1374
  cCTPInformation: {
1537
- supportCCTP: true,
1538
- domain: 10
1539
- },
1540
- aproxFromFee: 0
1375
+ supportCCTP: false,
1376
+ domain: 0
1377
+ }
1541
1378
  },
1542
- nearIntentInformation: null
1379
+ nearIntentInformation: {
1380
+ support: true,
1381
+ needMemo: false,
1382
+ assetsId: [
1383
+ {
1384
+ name: "USDC",
1385
+ assetId: "nep245:v2_1.omni.hot.tg:56_2w93GqMcEmQFDru84j3HZZWt557r",
1386
+ decimals: 18
1387
+ },
1388
+ {
1389
+ name: "USDT",
1390
+ assetId: "nep245:v2_1.omni.hot.tg:56_2CMMyVTGZkeyNZTSvS5sarzfir6g",
1391
+ decimals: 18
1392
+ },
1393
+ {
1394
+ name: "BNB",
1395
+ assetId: "nep245:v2_1.omni.hot.tg:56_11111111111111111111",
1396
+ decimals: 18
1397
+ }
1398
+ ]
1399
+ }
1543
1400
  }
1544
1401
  };
1545
1402
  var POLYGON = {
@@ -1567,7 +1424,10 @@ var POLYGON = {
1567
1424
  chain: polygon,
1568
1425
  rpcUrl: "https://polygon-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
1569
1426
  supports7702: true,
1570
- erc4337: false
1427
+ erc4337: false,
1428
+ entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
1429
+ factoryAddress: "0x31D1C59fcf5B78FE2a86187a53c84DcDa5B80EF6",
1430
+ paymasterAddress: "0x24C82C9381F4615f1a73a5CdBB0Ffd5a432fA54C"
1571
1431
  },
1572
1432
  crossChainInformation: {
1573
1433
  circleInformation: {
@@ -1601,95 +1461,109 @@ var POLYGON = {
1601
1461
  }
1602
1462
  }
1603
1463
  };
1604
- var AVALANCHE = {
1464
+ var ARBITRUM = {
1605
1465
  assets: [
1606
1466
  {
1607
1467
  name: "USDC",
1608
1468
  decimals: 6,
1609
- address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
1469
+ address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
1610
1470
  coingeckoId: "usd-coin"
1611
1471
  },
1612
- {
1613
- name: "AVAX",
1614
- decimals: 18,
1615
- address: "0x0000000000000000000000000000000000000000",
1616
- coingeckoId: "avalanche-2"
1617
- },
1618
1472
  {
1619
1473
  name: "USDT",
1620
1474
  decimals: 6,
1621
- address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",
1475
+ address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
1622
1476
  coingeckoId: "tether"
1477
+ },
1478
+ {
1479
+ name: "ARB",
1480
+ decimals: 18,
1481
+ address: "0x912CE59144191C1204E64559FE8253a0e49E6548",
1482
+ coingeckoId: "arbitrum"
1483
+ },
1484
+ {
1485
+ name: "ETH",
1486
+ decimals: 18,
1487
+ address: "0x0000000000000000000000000000000000000000",
1488
+ coingeckoId: "ethereum"
1623
1489
  }
1624
1490
  ],
1625
1491
  evm: {
1626
- chain: avalanche,
1627
- rpcUrl: avalanche.rpcUrls.default.http[0],
1628
- supports7702: false,
1629
- erc4337: false
1492
+ chain: arbitrum,
1493
+ rpcUrl: "https://arb-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
1494
+ supports7702: true,
1495
+ erc4337: false,
1496
+ entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
1497
+ factoryAddress: "0xEEba846e0177CD7b2F023feaa44F9B2a9183327A",
1498
+ paymasterAddress: "0x41d236E76eCEC3b90554d0b504ac2EEce93A2AE1"
1630
1499
  },
1631
1500
  crossChainInformation: {
1632
1501
  circleInformation: {
1633
1502
  supportCirclePaymaster: true,
1503
+ aproxFromFee: 0,
1634
1504
  cCTPInformation: {
1635
1505
  supportCCTP: true,
1636
- domain: 1
1637
- },
1638
- aproxFromFee: 0
1506
+ domain: 3
1507
+ }
1639
1508
  },
1640
1509
  nearIntentInformation: {
1641
1510
  support: true,
1642
1511
  assetsId: [
1643
1512
  {
1644
- assetId: "nep245:v2_1.omni.hot.tg:43114_3atVJH3r5c4GqiSYmg9fECvjc47o",
1513
+ assetId: "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
1645
1514
  name: "USDC",
1646
1515
  decimals: 6
1647
1516
  },
1648
1517
  {
1649
- assetId: "nep245:v2_1.omni.hot.tg:43114_11111111111111111111",
1650
- name: "AVAX",
1518
+ assetId: "nep141:arb-0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9.omft.near",
1519
+ name: "USDT",
1520
+ decimals: 6
1521
+ },
1522
+ {
1523
+ assetId: "nep141:arb.omft.near",
1524
+ name: "ETH",
1651
1525
  decimals: 18
1652
1526
  },
1653
1527
  {
1654
- assetId: "nep245:v2_1.omni.hot.tg:43114_372BeH7ENZieCaabwkbWkBiTTgXp",
1655
- name: "USDT",
1656
- decimals: 6
1528
+ assetId: "nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near",
1529
+ name: "ARB",
1530
+ decimals: 18
1657
1531
  }
1658
1532
  ],
1659
1533
  needMemo: false
1660
1534
  }
1661
1535
  }
1662
1536
  };
1663
- var WORLD_CHAIN = {
1537
+ var UNICHAIN = {
1664
1538
  assets: [
1665
1539
  {
1666
1540
  name: "USDC",
1667
1541
  decimals: 6,
1668
- address: "0x79A02482A880bCe3F13E09da970dC34dB4cD24D1",
1542
+ address: "0x078D782b760474a361dDA0AF3839290b0EF57AD6",
1669
1543
  coingeckoId: "usd-coin"
1670
1544
  }
1671
1545
  ],
1672
1546
  evm: {
1673
- chain: worldchain,
1674
- rpcUrl: worldchain.rpcUrls.default.http[0],
1547
+ chain: unichain,
1548
+ rpcUrl: "https://unichain-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
1675
1549
  supports7702: true,
1676
- erc4337: false
1550
+ erc4337: false,
1551
+ entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
1552
+ factoryAddress: "0xB2E45aCbB68f3e98C87B6df16625f22e11728556",
1553
+ paymasterAddress: "0x7A92b3Fee017E3E181a51D9045AACE30eC2B387D"
1677
1554
  },
1678
1555
  crossChainInformation: {
1679
1556
  circleInformation: {
1680
- supportCirclePaymaster: false,
1557
+ supportCirclePaymaster: true,
1681
1558
  cCTPInformation: {
1682
1559
  supportCCTP: true,
1683
- domain: 14
1560
+ domain: 10
1684
1561
  },
1685
1562
  aproxFromFee: 0
1686
1563
  },
1687
1564
  nearIntentInformation: null
1688
1565
  }
1689
1566
  };
1690
-
1691
- // src/chains/index.ts
1692
- init_Stellar();
1693
1567
  var Monad = {
1694
1568
  assets: [
1695
1569
  {
@@ -1715,7 +1589,10 @@ var Monad = {
1715
1589
  chain: monad,
1716
1590
  rpcUrl: monad.rpcUrls.default.http[0],
1717
1591
  supports7702: true,
1718
- erc4337: false
1592
+ erc4337: false,
1593
+ entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
1594
+ factoryAddress: "0xaaeA6D8f377e62599Aad75376F0C5e4F7EBF8f84",
1595
+ paymasterAddress: "0xeA82B63e8dE3BFBd321A681D4511BC596E323162"
1719
1596
  },
1720
1597
  crossChainInformation: {
1721
1598
  circleInformation: {
@@ -1749,69 +1626,236 @@ var Monad = {
1749
1626
  }
1750
1627
  }
1751
1628
  };
1752
- var BNB = {
1629
+
1630
+ // src/chains.ts
1631
+ init_Stellar();
1632
+ function mapToSDKConfig(data) {
1633
+ if (data.nonEvm) {
1634
+ return {
1635
+ chain: { id: 9e3, name: "Stellar" },
1636
+ // Custom ID for Stellar
1637
+ tokens: data.assets.map((a) => ({
1638
+ symbol: a.name,
1639
+ decimals: a.decimals,
1640
+ address: a.address
1641
+ }))
1642
+ };
1643
+ }
1644
+ if (!data.evm) throw new Error("Non-EVM config used in EVM SDK");
1645
+ return {
1646
+ chain: data.evm.chain,
1647
+ rpcUrl: data.evm.rpcUrl || void 0,
1648
+ bundlerUrl: data.evm.bundlerUrl,
1649
+ entryPointAddress: data.evm.entryPointAddress,
1650
+ factoryAddress: data.evm.factoryAddress,
1651
+ paymasterAddress: data.evm.paymasterAddress,
1652
+ tokens: data.assets.map((a) => ({
1653
+ symbol: a.name,
1654
+ decimals: a.decimals,
1655
+ address: a.address
1656
+ }))
1657
+ };
1658
+ }
1659
+ var BASE_MAINNET = mapToSDKConfig(BASE);
1660
+ var OPTIMISM_MAINNET = mapToSDKConfig(OPTIMISM);
1661
+ var GNOSIS_MAINNET = mapToSDKConfig(GNOSIS);
1662
+ var BASE_SEPOLIA2 = mapToSDKConfig(BASE_SEPOLIA);
1663
+ var AVALANCHE_MAINNET = mapToSDKConfig(AVALANCHE);
1664
+ var BSC_MAINNET = mapToSDKConfig(BNB);
1665
+ var POLYGON_MAINNET = mapToSDKConfig(POLYGON);
1666
+ var ARBITRUM_MAINNET = mapToSDKConfig(ARBITRUM);
1667
+ var UNICHAIN_MAINNET = mapToSDKConfig(UNICHAIN);
1668
+ var MONAD_MAINNET = mapToSDKConfig(Monad);
1669
+ var STELLAR_MAINNET = mapToSDKConfig(STELLAR);
1670
+ var CHAIN_CONFIGS = {
1671
+ [base.id]: BASE_MAINNET,
1672
+ [baseSepolia.id]: BASE_SEPOLIA2,
1673
+ [gnosis.id]: GNOSIS_MAINNET,
1674
+ [optimism.id]: OPTIMISM_MAINNET,
1675
+ [avalanche.id]: AVALANCHE_MAINNET,
1676
+ [bsc.id]: BSC_MAINNET,
1677
+ [polygon.id]: POLYGON_MAINNET,
1678
+ [arbitrum.id]: ARBITRUM_MAINNET,
1679
+ [unichain.id]: UNICHAIN_MAINNET,
1680
+ [monad.id]: MONAD_MAINNET,
1681
+ 9e3: STELLAR_MAINNET
1682
+ };
1683
+ var CHAIN_ID_TO_KEY = {
1684
+ [base.id]: "Base",
1685
+ [baseSepolia.id]: "Base",
1686
+ [gnosis.id]: "Gnosis",
1687
+ [optimism.id]: "Optimism",
1688
+ [optimismSepolia.id]: "Optimism",
1689
+ [arbitrum.id]: "Arbitrum",
1690
+ [polygon.id]: "Polygon",
1691
+ [bsc.id]: "Binance",
1692
+ [avalanche.id]: "Avalanche",
1693
+ [unichain.id]: "Unichain",
1694
+ [monad.id]: "Monad",
1695
+ "9000": "Stellar"
1696
+ };
1697
+
1698
+ // src/index.ts
1699
+ init_StellarService();
1700
+ init_Stellar();
1701
+
1702
+ // src/services/cctp.ts
1703
+ init_facilitator();
1704
+ init_facilitator();
1705
+
1706
+ // src/constants/abis.ts
1707
+ var usdcErc3009Abi = [
1708
+ {
1709
+ inputs: [
1710
+ { name: "from", type: "address" },
1711
+ { name: "to", type: "address" },
1712
+ { name: "value", type: "uint256" },
1713
+ { name: "validAfter", type: "uint256" },
1714
+ { name: "validBefore", type: "uint256" },
1715
+ { name: "nonce", type: "bytes32" },
1716
+ { name: "v", type: "uint8" },
1717
+ { name: "r", type: "bytes32" },
1718
+ { name: "s", type: "bytes32" }
1719
+ ],
1720
+ name: "transferWithAuthorization",
1721
+ outputs: [],
1722
+ stateMutability: "nonpayable",
1723
+ type: "function"
1724
+ },
1725
+ {
1726
+ inputs: [{ name: "account", type: "address" }],
1727
+ name: "balanceOf",
1728
+ outputs: [{ name: "", type: "uint256" }],
1729
+ stateMutability: "view",
1730
+ type: "function"
1731
+ },
1732
+ {
1733
+ inputs: [
1734
+ { name: "spender", type: "address" },
1735
+ { name: "amount", type: "uint256" }
1736
+ ],
1737
+ name: "approve",
1738
+ outputs: [{ name: "", type: "bool" }],
1739
+ stateMutability: "nonpayable",
1740
+ type: "function"
1741
+ },
1742
+ {
1743
+ inputs: [
1744
+ { name: "to", type: "address" },
1745
+ { name: "amount", type: "uint256" }
1746
+ ],
1747
+ name: "transfer",
1748
+ outputs: [{ name: "", type: "bool" }],
1749
+ stateMutability: "nonpayable",
1750
+ type: "function"
1751
+ }
1752
+ ];
1753
+ var tokenMessengerAbi = [
1754
+ {
1755
+ inputs: [
1756
+ { name: "amount", type: "uint256" },
1757
+ { name: "destinationDomain", type: "uint32" },
1758
+ { name: "mintRecipient", type: "bytes32" },
1759
+ { name: "burnToken", type: "address" },
1760
+ { name: "destinationCaller", type: "bytes32" },
1761
+ { name: "maxFee", type: "uint256" },
1762
+ // Suspected wrapper arg
1763
+ { name: "minFinalityThreshold", type: "uint32" }
1764
+ // Suspected wrapper arg
1765
+ ],
1766
+ name: "depositForBurn",
1767
+ outputs: [{ name: "_nonce", type: "uint64" }],
1768
+ stateMutability: "nonpayable",
1769
+ type: "function"
1770
+ },
1771
+ // Alternative overload often used:
1772
+ {
1773
+ inputs: [
1774
+ { name: "amount", type: "uint256" },
1775
+ { name: "destinationDomain", type: "uint32" },
1776
+ { name: "mintRecipient", type: "bytes32" },
1777
+ { name: "burnToken", type: "address" }
1778
+ ],
1779
+ name: "depositForBurn",
1780
+ outputs: [{ name: "_nonce", type: "uint64" }],
1781
+ stateMutability: "nonpayable",
1782
+ type: "function"
1783
+ }
1784
+ ];
1785
+ var messageTransmitterAbi = [
1786
+ {
1787
+ inputs: [
1788
+ { name: "message", type: "bytes" },
1789
+ { name: "attestation", type: "bytes" }
1790
+ ],
1791
+ name: "receiveMessage",
1792
+ outputs: [{ name: "success", type: "bool" }],
1793
+ stateMutability: "nonpayable",
1794
+ type: "function"
1795
+ }
1796
+ ];
1797
+ var createRetrieveAttestation = async (transactionHash, chainId, timeout = 6e4) => {
1798
+ const baseUrl = "https://iris-api.circle.com";
1799
+ const url = `${baseUrl}/v2/messages/${chainId}?transactionHash=${transactionHash}`;
1800
+ const start = Date.now();
1801
+ const FIVE_SECONDS = 5e3;
1802
+ while (true) {
1803
+ const elapsed = Date.now() - start;
1804
+ if (elapsed > timeout) {
1805
+ throw new Error(
1806
+ "Timeout: Attestation not retrieved within the expected time."
1807
+ );
1808
+ }
1809
+ try {
1810
+ const response = await axios.get(url);
1811
+ const message = response.data?.messages?.[0];
1812
+ if (message?.status === "complete") {
1813
+ console.log("Attestation retrieved successfully!");
1814
+ return message;
1815
+ }
1816
+ console.log("Waiting for attestation...");
1817
+ } catch (error) {
1818
+ const status = error.response?.status;
1819
+ if (status === 404) {
1820
+ console.log("Waiting for attestation...");
1821
+ } else {
1822
+ console.error("Error fetching attestation:", error.message);
1823
+ }
1824
+ }
1825
+ await new Promise((resolve) => setTimeout(resolve, FIVE_SECONDS));
1826
+ }
1827
+ };
1828
+ var WORLD_CHAIN = {
1753
1829
  assets: [
1754
1830
  {
1755
1831
  name: "USDC",
1756
- decimals: 18,
1757
- address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
1758
- // BSC Mainnet USDC
1832
+ decimals: 6,
1833
+ address: "0x79A02482A880bCe3F13E09da970dC34dB4cD24D1",
1759
1834
  coingeckoId: "usd-coin"
1760
- },
1761
- {
1762
- name: "USDT",
1763
- decimals: 18,
1764
- address: "0x55d398326f99059fF775485246999027B3197955",
1765
- // BSC Mainnet USDT
1766
- coingeckoId: "tether"
1767
- },
1768
- {
1769
- name: "BNB",
1770
- decimals: 18,
1771
- address: "0x0000000000000000000000000000000000000000",
1772
- // Native
1773
- coingeckoId: "binancecoin"
1774
1835
  }
1775
1836
  ],
1776
1837
  evm: {
1777
- chain: bsc,
1778
- rpcUrl: "https://bsc-dataseed.binance.org",
1838
+ chain: worldchain,
1839
+ rpcUrl: worldchain.rpcUrls.default.http[0],
1779
1840
  supports7702: true,
1780
1841
  erc4337: false
1781
1842
  },
1782
1843
  crossChainInformation: {
1783
1844
  circleInformation: {
1784
1845
  supportCirclePaymaster: false,
1785
- aproxFromFee: 0,
1786
1846
  cCTPInformation: {
1787
- supportCCTP: false,
1788
- domain: 0
1789
- }
1847
+ supportCCTP: true,
1848
+ domain: 14
1849
+ },
1850
+ aproxFromFee: 0
1790
1851
  },
1791
- nearIntentInformation: {
1792
- support: true,
1793
- needMemo: false,
1794
- assetsId: [
1795
- {
1796
- name: "USDC",
1797
- assetId: "nep245:v2_1.omni.hot.tg:56_2w93GqMcEmQFDru84j3HZZWt557r",
1798
- decimals: 18
1799
- },
1800
- {
1801
- name: "USDT",
1802
- assetId: "nep245:v2_1.omni.hot.tg:56_2CMMyVTGZkeyNZTSvS5sarzfir6g",
1803
- decimals: 18
1804
- },
1805
- {
1806
- name: "BNB",
1807
- assetId: "nep245:v2_1.omni.hot.tg:56_11111111111111111111",
1808
- decimals: 18
1809
- }
1810
- ]
1811
- }
1852
+ nearIntentInformation: null
1812
1853
  }
1813
1854
  };
1814
1855
 
1856
+ // src/chains/index.ts
1857
+ init_Stellar();
1858
+
1815
1859
  // src/constants/chainsInformation.ts
1816
1860
  var NETWORKS = {
1817
1861
  Optimism: OPTIMISM,