@1llet.xyz/erc4337-gasless-sdk 0.4.29 → 0.4.31
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/README.md +79 -195
- package/dist/index.d.mts +1 -10
- package/dist/index.d.ts +1 -10
- package/dist/index.js +234 -329
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +235 -330
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gnosis, optimism, baseSepolia, base, avalanche, worldchain, monad, polygon, arbitrum, bsc, unichain } from 'viem/chains';
|
|
2
2
|
import { createPublicClient, http, createWalletClient, decodeErrorResult, maxUint256, encodeFunctionData, encodeAbiParameters, keccak256, padHex } from 'viem';
|
|
3
3
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
4
4
|
import axios from 'axios';
|
|
@@ -225,7 +225,6 @@ var erc20Abi = [
|
|
|
225
225
|
var BundlerClient = class {
|
|
226
226
|
constructor(config, entryPointAddress) {
|
|
227
227
|
this.bundlerUrl = config.bundlerUrl;
|
|
228
|
-
this.chainId = config.chain.id;
|
|
229
228
|
this.entryPointAddress = entryPointAddress;
|
|
230
229
|
}
|
|
231
230
|
async call(method, params) {
|
|
@@ -308,9 +307,6 @@ var TokenService = class {
|
|
|
308
307
|
* Resolve token address from symbol or return address if provided
|
|
309
308
|
*/
|
|
310
309
|
getTokenAddress(token) {
|
|
311
|
-
if (token === "ETH") {
|
|
312
|
-
return "0x0000000000000000000000000000000000000000";
|
|
313
|
-
}
|
|
314
310
|
if (token.startsWith("0x")) return token;
|
|
315
311
|
const info = this.tokens.get(token.toUpperCase());
|
|
316
312
|
if (!info) throw new Error(`Token ${token} not found in chain config`);
|
|
@@ -580,13 +576,6 @@ var AccountAbstraction = class {
|
|
|
580
576
|
});
|
|
581
577
|
return address;
|
|
582
578
|
}
|
|
583
|
-
/**
|
|
584
|
-
* Check if the Smart Account is deployed
|
|
585
|
-
*/
|
|
586
|
-
async isAccountDeployed() {
|
|
587
|
-
if (!this.smartAccountAddress) throw new Error("Not connected");
|
|
588
|
-
return this.userOpBuilder.isAccountDeployed(this.smartAccountAddress);
|
|
589
|
-
}
|
|
590
579
|
// --- Token Methods (Delegated) ---
|
|
591
580
|
getTokenAddress(token) {
|
|
592
581
|
return this.tokenService.getTokenAddress(token);
|
|
@@ -599,29 +588,11 @@ var AccountAbstraction = class {
|
|
|
599
588
|
if (!this.owner) throw new Error("Not connected");
|
|
600
589
|
return this.tokenService.getBalance(token, this.owner);
|
|
601
590
|
}
|
|
602
|
-
// Deprecated helpers maintained for compatibility
|
|
603
|
-
async getUsdcBalance() {
|
|
604
|
-
return this.getBalance("USDC");
|
|
605
|
-
}
|
|
606
|
-
async getEoaUsdcBalance() {
|
|
607
|
-
return this.getEoaBalance("USDC");
|
|
608
|
-
}
|
|
609
591
|
async getAllowance(token = "USDC") {
|
|
610
592
|
if (!this.owner || !this.smartAccountAddress) throw new Error("Not connected");
|
|
611
593
|
return this.tokenService.getAllowance(token, this.owner, this.smartAccountAddress);
|
|
612
594
|
}
|
|
613
595
|
// --- Transactions ---
|
|
614
|
-
async deployAccount() {
|
|
615
|
-
if (!this.owner || !this.smartAccountAddress) throw new Error("Not connected");
|
|
616
|
-
try {
|
|
617
|
-
const userOp = await this.userOpBuilder.buildDeployUserOp(this.owner, this.smartAccountAddress);
|
|
618
|
-
const signed = await this.signUserOperation(userOp);
|
|
619
|
-
const hash = await this.sendUserOperation(signed);
|
|
620
|
-
return await this.waitForUserOperation(hash);
|
|
621
|
-
} catch (error) {
|
|
622
|
-
throw this.decodeError(error);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
596
|
async sendTransaction(tx) {
|
|
626
597
|
return this.sendBatchTransaction([tx]);
|
|
627
598
|
}
|
|
@@ -653,10 +624,9 @@ var AccountAbstraction = class {
|
|
|
653
624
|
to: this.smartAccountAddress,
|
|
654
625
|
value: amount,
|
|
655
626
|
chain: this.chainConfig.chain
|
|
656
|
-
// Explicit chain
|
|
657
627
|
});
|
|
658
628
|
}
|
|
659
|
-
|
|
629
|
+
return await window.ethereum.request({
|
|
660
630
|
method: "eth_sendTransaction",
|
|
661
631
|
params: [{
|
|
662
632
|
from: this.owner,
|
|
@@ -664,7 +634,6 @@ var AccountAbstraction = class {
|
|
|
664
634
|
value: "0x" + amount.toString(16)
|
|
665
635
|
}]
|
|
666
636
|
});
|
|
667
|
-
return txHash;
|
|
668
637
|
}
|
|
669
638
|
async transfer(token, recipient, amount) {
|
|
670
639
|
const tokenAddress = this.getTokenAddress(token);
|
|
@@ -698,7 +667,7 @@ var AccountAbstraction = class {
|
|
|
698
667
|
chain: this.chainConfig.chain
|
|
699
668
|
});
|
|
700
669
|
}
|
|
701
|
-
|
|
670
|
+
return await window.ethereum.request({
|
|
702
671
|
method: "eth_sendTransaction",
|
|
703
672
|
params: [{
|
|
704
673
|
from: this.owner,
|
|
@@ -706,22 +675,11 @@ var AccountAbstraction = class {
|
|
|
706
675
|
data
|
|
707
676
|
}]
|
|
708
677
|
});
|
|
709
|
-
return txHash;
|
|
710
678
|
}
|
|
711
679
|
if (support.type === "permit") throw new Error("Permit not yet supported");
|
|
712
680
|
return "NOT_NEEDED";
|
|
713
681
|
}
|
|
714
682
|
// --- Core Bridge to Bundler/UserOp ---
|
|
715
|
-
// Deprecated/Legacy but kept for compatibility or advanced usage?
|
|
716
|
-
// buildUserOperationBatch moved to internal usage mostly, but maybe exposed?
|
|
717
|
-
// If I remove them from public API, that is a BREAKING change if user used them.
|
|
718
|
-
// User requested "modularize", but usually expects same public API.
|
|
719
|
-
// I will expose them as simple delegates if needed, or assume they primarily use sendBatchTransaction.
|
|
720
|
-
// The previous implementation exposed `buildUserOperationBatch`.
|
|
721
|
-
async buildUserOperationBatch(transactions) {
|
|
722
|
-
if (!this.owner || !this.smartAccountAddress) throw new Error("Not connected");
|
|
723
|
-
return this.userOpBuilder.buildUserOperationBatch(this.owner, this.smartAccountAddress, transactions);
|
|
724
|
-
}
|
|
725
683
|
async signUserOperation(userOp) {
|
|
726
684
|
if (!this.owner) throw new Error("Not connected");
|
|
727
685
|
const userOpHash = this.userOpBuilder.getUserOpHash(userOp);
|
|
@@ -777,125 +735,282 @@ var AccountAbstraction = class {
|
|
|
777
735
|
return this.smartAccountAddress;
|
|
778
736
|
}
|
|
779
737
|
};
|
|
738
|
+
|
|
739
|
+
// src/constants/bundler.ts
|
|
780
740
|
var DEFAULT_BUNDLER_URL = "https://bundler-erc-4337.vercel.app";
|
|
781
741
|
var BUNDLER_URL = process.env.NEXT_PUBLIC_BUNDLER_URL || process.env.BUNDLER_URL || DEFAULT_BUNDLER_URL;
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
// Addresses
|
|
787
|
-
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
788
|
-
factoryAddress: "0xe2584152891E4769025807DEa0cD611F135aDC68",
|
|
789
|
-
paymasterAddress: "0x1e13Eb16C565E3f3FDe49A011755e50410bb1F95",
|
|
790
|
-
tokens: [
|
|
742
|
+
|
|
743
|
+
// src/chains/Evm/Base.ts
|
|
744
|
+
var BASE = {
|
|
745
|
+
assets: [
|
|
791
746
|
{
|
|
792
|
-
|
|
747
|
+
name: "USDC",
|
|
793
748
|
decimals: 6,
|
|
794
|
-
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
|
|
749
|
+
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
750
|
+
coingeckoId: "usd-coin"
|
|
795
751
|
},
|
|
796
752
|
{
|
|
797
|
-
|
|
753
|
+
name: "ETH",
|
|
798
754
|
decimals: 18,
|
|
799
|
-
address: "0x0000000000000000000000000000000000000000"
|
|
755
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
756
|
+
coingeckoId: "ethereum"
|
|
800
757
|
}
|
|
801
|
-
]
|
|
758
|
+
],
|
|
759
|
+
evm: {
|
|
760
|
+
chain: base,
|
|
761
|
+
rpcUrl: "https://base-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
|
|
762
|
+
supports7702: true,
|
|
763
|
+
erc4337: false,
|
|
764
|
+
bundlerUrl: `${BUNDLER_URL}/rpc?chain=base`,
|
|
765
|
+
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
766
|
+
factoryAddress: "0xe2584152891E4769025807DEa0cD611F135aDC68",
|
|
767
|
+
paymasterAddress: "0x1e13Eb16C565E3f3FDe49A011755e50410bb1F95"
|
|
768
|
+
},
|
|
769
|
+
crossChainInformation: {
|
|
770
|
+
circleInformation: {
|
|
771
|
+
supportCirclePaymaster: true,
|
|
772
|
+
cCTPInformation: {
|
|
773
|
+
supportCCTP: true,
|
|
774
|
+
domain: 6
|
|
775
|
+
},
|
|
776
|
+
aproxFromFee: 0
|
|
777
|
+
},
|
|
778
|
+
nearIntentInformation: {
|
|
779
|
+
support: true,
|
|
780
|
+
assetsId: [
|
|
781
|
+
{
|
|
782
|
+
assetId: "nep141:base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913.omft.near",
|
|
783
|
+
name: "USDC",
|
|
784
|
+
decimals: 6
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
assetId: "nep141:base.omft.near",
|
|
788
|
+
name: "ETH",
|
|
789
|
+
decimals: 18
|
|
790
|
+
}
|
|
791
|
+
],
|
|
792
|
+
needMemo: false
|
|
793
|
+
}
|
|
794
|
+
}
|
|
802
795
|
};
|
|
803
|
-
var
|
|
804
|
-
|
|
805
|
-
bundlerUrl: `${BUNDLER_URL}/rpc?chain=optimism`,
|
|
806
|
-
// Dynamic Bundler URL
|
|
807
|
-
// Addresses
|
|
808
|
-
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
809
|
-
factoryAddress: "0x3CE963866d3Be7Fe4354DBe892Aab52a0a18aeb2",
|
|
810
|
-
paymasterAddress: "0x0dB771d11F84E8541AA651363DF14E4401d01216",
|
|
811
|
-
tokens: [
|
|
796
|
+
var GNOSIS = {
|
|
797
|
+
assets: [
|
|
812
798
|
{
|
|
813
|
-
|
|
799
|
+
name: "USDC",
|
|
814
800
|
decimals: 6,
|
|
815
|
-
address: "
|
|
801
|
+
address: "0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0",
|
|
802
|
+
coingeckoId: "usd-coin"
|
|
816
803
|
},
|
|
817
804
|
{
|
|
818
|
-
|
|
805
|
+
name: "USDT",
|
|
819
806
|
decimals: 6,
|
|
820
|
-
address: "
|
|
807
|
+
address: "0x4ECaBa5870353805a9F068101A40E0f32ed605C6",
|
|
808
|
+
coingeckoId: "tether"
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
name: "EURe",
|
|
812
|
+
decimals: 18,
|
|
813
|
+
address: "0x420CA0f9B9b604cE0fd9C18EF134C705e5Fa3430",
|
|
814
|
+
coingeckoId: "monerium-eur-money"
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
name: "GNO",
|
|
818
|
+
decimals: 18,
|
|
819
|
+
address: "0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",
|
|
820
|
+
coingeckoId: "gnosis"
|
|
821
821
|
},
|
|
822
822
|
{
|
|
823
|
-
|
|
823
|
+
name: "WETH",
|
|
824
824
|
decimals: 18,
|
|
825
|
-
address: "
|
|
825
|
+
address: "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1",
|
|
826
|
+
coingeckoId: "ethereum"
|
|
826
827
|
},
|
|
827
828
|
{
|
|
828
|
-
|
|
829
|
+
name: "XDAI",
|
|
829
830
|
decimals: 18,
|
|
830
|
-
address: "0x0000000000000000000000000000000000000000"
|
|
831
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
832
|
+
coingeckoId: "xdai"
|
|
833
|
+
}
|
|
834
|
+
],
|
|
835
|
+
evm: {
|
|
836
|
+
chain: gnosis,
|
|
837
|
+
rpcUrl: gnosis.rpcUrls.default.http[0],
|
|
838
|
+
supports7702: true,
|
|
839
|
+
erc4337: true,
|
|
840
|
+
bundlerUrl: `${BUNDLER_URL}/rpc?chain=gnosis`,
|
|
841
|
+
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
842
|
+
factoryAddress: "0xC8a2Fb1f2E686417A131E09be3320cb5431CcD90",
|
|
843
|
+
paymasterAddress: "0x4C36C70d68a7c26326711e8268bb163E3784fA96"
|
|
844
|
+
},
|
|
845
|
+
crossChainInformation: {
|
|
846
|
+
circleInformation: {
|
|
847
|
+
supportCirclePaymaster: false,
|
|
848
|
+
aproxFromFee: 0,
|
|
849
|
+
cCTPInformation: {
|
|
850
|
+
supportCCTP: false,
|
|
851
|
+
domain: 0
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
nearIntentInformation: {
|
|
855
|
+
support: true,
|
|
856
|
+
assetsId: [
|
|
857
|
+
{
|
|
858
|
+
assetId: "nep141:gnosis-0x2a22f9c3b484c3629090feed35f17ff8f88f76f0.omft.near",
|
|
859
|
+
name: "USDC",
|
|
860
|
+
decimals: 6
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
assetId: "nep141:gnosis-0x4ecaba5870353805a9f068101a40e0f32ed605c6.omft.near",
|
|
864
|
+
name: "USDT",
|
|
865
|
+
decimals: 6
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
assetId: "nep141:gnosis-0x420ca0f9b9b604ce0fd9c18ef134c705e5fa3430.omft.near",
|
|
869
|
+
name: "EURe",
|
|
870
|
+
decimals: 18
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
assetId: "nep141:gnosis-0x9c58bacc331c9aa871afd802db6379a98e80cedb.omft.near",
|
|
874
|
+
name: "GNO",
|
|
875
|
+
decimals: 18
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
assetId: "nep141:gnosis-0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1.omft.near",
|
|
879
|
+
name: "WETH",
|
|
880
|
+
decimals: 18
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
assetId: "nep141:gnosis.omft.near",
|
|
884
|
+
name: "XDAI",
|
|
885
|
+
decimals: 18
|
|
886
|
+
}
|
|
887
|
+
],
|
|
888
|
+
needMemo: false
|
|
831
889
|
}
|
|
832
|
-
|
|
890
|
+
}
|
|
833
891
|
};
|
|
834
|
-
var
|
|
835
|
-
|
|
836
|
-
bundlerUrl: `${BUNDLER_URL}/rpc?chain=gnosis`,
|
|
837
|
-
// Dynamic Bundler URL
|
|
838
|
-
// Addresses
|
|
839
|
-
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
840
|
-
factoryAddress: "0xC8a2Fb1f2E686417A131E09be3320cb5431CcD90",
|
|
841
|
-
paymasterAddress: "0x4C36C70d68a7c26326711e8268bb163E3784fA96",
|
|
842
|
-
tokens: [
|
|
892
|
+
var OPTIMISM = {
|
|
893
|
+
assets: [
|
|
843
894
|
{
|
|
844
|
-
|
|
895
|
+
name: "USDC",
|
|
845
896
|
decimals: 6,
|
|
846
|
-
address: "
|
|
897
|
+
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
898
|
+
coingeckoId: "usd-coin"
|
|
847
899
|
},
|
|
848
900
|
{
|
|
849
|
-
|
|
901
|
+
name: "USDT",
|
|
850
902
|
decimals: 6,
|
|
851
|
-
address: "
|
|
852
|
-
|
|
853
|
-
{
|
|
854
|
-
symbol: "EURe",
|
|
855
|
-
decimals: 18,
|
|
856
|
-
address: "0x420CA0f9B9b604cE0fd9C18EF134C705e5Fa3430"
|
|
903
|
+
address: "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58",
|
|
904
|
+
coingeckoId: "tether"
|
|
857
905
|
},
|
|
858
906
|
{
|
|
859
|
-
|
|
907
|
+
name: "OP",
|
|
860
908
|
decimals: 18,
|
|
861
|
-
address: "
|
|
909
|
+
address: "0x4200000000000000000000000000000000000042",
|
|
910
|
+
coingeckoId: "optimism"
|
|
862
911
|
},
|
|
863
912
|
{
|
|
864
|
-
|
|
913
|
+
name: "ETH",
|
|
865
914
|
decimals: 18,
|
|
866
|
-
address: "
|
|
915
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
916
|
+
coingeckoId: "ethereum"
|
|
917
|
+
}
|
|
918
|
+
],
|
|
919
|
+
evm: {
|
|
920
|
+
chain: optimism,
|
|
921
|
+
rpcUrl: "https://opt-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
|
|
922
|
+
supports7702: false,
|
|
923
|
+
erc4337: false,
|
|
924
|
+
bundlerUrl: `${BUNDLER_URL}/rpc?chain=optimism`,
|
|
925
|
+
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
926
|
+
factoryAddress: "0x3CE963866d3Be7Fe4354DBe892Aab52a0a18aeb2",
|
|
927
|
+
paymasterAddress: "0x0dB771d11F84E8541AA651363DF14E4401d01216"
|
|
928
|
+
},
|
|
929
|
+
crossChainInformation: {
|
|
930
|
+
circleInformation: {
|
|
931
|
+
supportCirclePaymaster: true,
|
|
932
|
+
cCTPInformation: {
|
|
933
|
+
supportCCTP: true,
|
|
934
|
+
domain: 2
|
|
935
|
+
},
|
|
936
|
+
aproxFromFee: 0
|
|
867
937
|
},
|
|
868
|
-
{
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
938
|
+
nearIntentInformation: {
|
|
939
|
+
support: true,
|
|
940
|
+
assetsId: [
|
|
941
|
+
{
|
|
942
|
+
assetId: "nep245:v2_1.omni.hot.tg:10_A2ewyUyDp6qsue1jqZsGypkCxRJ",
|
|
943
|
+
name: "USDC",
|
|
944
|
+
decimals: 6
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
assetId: "nep245:v2_1.omni.hot.tg:10_359RPSJVdTxwTJT9TyGssr2rFoWo",
|
|
948
|
+
name: "USDT",
|
|
949
|
+
decimals: 6
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
assetId: "nep245:v2_1.omni.hot.tg:10_vLAiSt9KfUGKpw5cD3vsSyNYBo7",
|
|
953
|
+
name: "OP",
|
|
954
|
+
decimals: 18
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
assetId: "nep245:v2_1.omni.hot.tg:10_11111111111111111111",
|
|
958
|
+
name: "ETH",
|
|
959
|
+
decimals: 18
|
|
960
|
+
}
|
|
961
|
+
],
|
|
962
|
+
needMemo: false
|
|
872
963
|
}
|
|
873
|
-
|
|
964
|
+
}
|
|
874
965
|
};
|
|
875
966
|
var BASE_SEPOLIA = {
|
|
876
|
-
|
|
877
|
-
bundlerUrl: `${BUNDLER_URL}/rpc?chain=baseSepolia`,
|
|
878
|
-
// Dynamic Bundler URL
|
|
879
|
-
// Addresses
|
|
880
|
-
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
881
|
-
factoryAddress: "0x9406Cc6185a346906296840746125a0E44976454",
|
|
882
|
-
// Paymaster not configured in deployments.ts for Sepolia?
|
|
883
|
-
tokens: [
|
|
967
|
+
assets: [
|
|
884
968
|
{
|
|
885
|
-
|
|
969
|
+
name: "USDC",
|
|
886
970
|
decimals: 6,
|
|
887
|
-
address: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
|
|
971
|
+
address: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
|
|
972
|
+
coingeckoId: "usd-coin"
|
|
888
973
|
},
|
|
889
974
|
{
|
|
890
|
-
|
|
975
|
+
name: "ETH",
|
|
891
976
|
decimals: 18,
|
|
892
|
-
address: "0x0000000000000000000000000000000000000000"
|
|
977
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
978
|
+
coingeckoId: "ethereum"
|
|
893
979
|
}
|
|
894
|
-
]
|
|
895
|
-
|
|
980
|
+
],
|
|
981
|
+
evm: {
|
|
982
|
+
chain: baseSepolia,
|
|
983
|
+
rpcUrl: "https://sepolia.base.org",
|
|
984
|
+
supports7702: true,
|
|
985
|
+
erc4337: true,
|
|
986
|
+
bundlerUrl: `${BUNDLER_URL}/rpc?chain=baseSepolia`,
|
|
987
|
+
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
|
|
988
|
+
factoryAddress: "0x9406Cc6185a346906296840746125a0E44976454"
|
|
989
|
+
// Paymaster optional
|
|
990
|
+
}};
|
|
991
|
+
function mapToSDKConfig(data) {
|
|
992
|
+
if (!data.evm) throw new Error("Non-EVM config used in EVM SDK");
|
|
993
|
+
return {
|
|
994
|
+
chain: data.evm.chain,
|
|
995
|
+
rpcUrl: data.evm.rpcUrl || void 0,
|
|
996
|
+
bundlerUrl: data.evm.bundlerUrl,
|
|
997
|
+
entryPointAddress: data.evm.entryPointAddress,
|
|
998
|
+
factoryAddress: data.evm.factoryAddress,
|
|
999
|
+
paymasterAddress: data.evm.paymasterAddress,
|
|
1000
|
+
tokens: data.assets.map((a) => ({
|
|
1001
|
+
symbol: a.name,
|
|
1002
|
+
decimals: a.decimals,
|
|
1003
|
+
address: a.address
|
|
1004
|
+
}))
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
var BASE_MAINNET = mapToSDKConfig(BASE);
|
|
1008
|
+
var OPTIMISM_MAINNET = mapToSDKConfig(OPTIMISM);
|
|
1009
|
+
var GNOSIS_MAINNET = mapToSDKConfig(GNOSIS);
|
|
1010
|
+
var BASE_SEPOLIA2 = mapToSDKConfig(BASE_SEPOLIA);
|
|
896
1011
|
var CHAIN_CONFIGS = {
|
|
897
1012
|
[base.id]: BASE_MAINNET,
|
|
898
|
-
[baseSepolia.id]:
|
|
1013
|
+
[baseSepolia.id]: BASE_SEPOLIA2,
|
|
899
1014
|
[gnosis.id]: GNOSIS_MAINNET,
|
|
900
1015
|
[optimism.id]: OPTIMISM_MAINNET
|
|
901
1016
|
};
|
|
@@ -1036,76 +1151,6 @@ var createRetrieveAttestation = async (transactionHash, chainId, timeout = 6e4)
|
|
|
1036
1151
|
await new Promise((resolve) => setTimeout(resolve, FIVE_SECONDS));
|
|
1037
1152
|
}
|
|
1038
1153
|
};
|
|
1039
|
-
var OPTIMISM = {
|
|
1040
|
-
assets: [
|
|
1041
|
-
{
|
|
1042
|
-
name: "USDC",
|
|
1043
|
-
decimals: 6,
|
|
1044
|
-
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
1045
|
-
coingeckoId: "usd-coin"
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
name: "USDT",
|
|
1049
|
-
decimals: 6,
|
|
1050
|
-
address: "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58",
|
|
1051
|
-
coingeckoId: "tether"
|
|
1052
|
-
},
|
|
1053
|
-
{
|
|
1054
|
-
name: "OP",
|
|
1055
|
-
decimals: 18,
|
|
1056
|
-
address: "0x4200000000000000000000000000000000000042",
|
|
1057
|
-
coingeckoId: "optimism"
|
|
1058
|
-
},
|
|
1059
|
-
{
|
|
1060
|
-
name: "ETH",
|
|
1061
|
-
decimals: 18,
|
|
1062
|
-
address: "0x0000000000000000000000000000000000000000",
|
|
1063
|
-
coingeckoId: "ethereum"
|
|
1064
|
-
}
|
|
1065
|
-
],
|
|
1066
|
-
evm: {
|
|
1067
|
-
chain: optimism,
|
|
1068
|
-
rpcUrl: "https://opt-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
|
|
1069
|
-
supports7702: false,
|
|
1070
|
-
erc4337: false
|
|
1071
|
-
},
|
|
1072
|
-
crossChainInformation: {
|
|
1073
|
-
circleInformation: {
|
|
1074
|
-
supportCirclePaymaster: true,
|
|
1075
|
-
cCTPInformation: {
|
|
1076
|
-
supportCCTP: true,
|
|
1077
|
-
domain: 2
|
|
1078
|
-
},
|
|
1079
|
-
aproxFromFee: 0
|
|
1080
|
-
},
|
|
1081
|
-
nearIntentInformation: {
|
|
1082
|
-
support: true,
|
|
1083
|
-
assetsId: [
|
|
1084
|
-
{
|
|
1085
|
-
assetId: "nep245:v2_1.omni.hot.tg:10_A2ewyUyDp6qsue1jqZsGypkCxRJ",
|
|
1086
|
-
name: "USDC",
|
|
1087
|
-
decimals: 6
|
|
1088
|
-
},
|
|
1089
|
-
{
|
|
1090
|
-
assetId: "nep245:v2_1.omni.hot.tg:10_359RPSJVdTxwTJT9TyGssr2rFoWo",
|
|
1091
|
-
name: "USDT",
|
|
1092
|
-
decimals: 6
|
|
1093
|
-
},
|
|
1094
|
-
{
|
|
1095
|
-
assetId: "nep245:v2_1.omni.hot.tg:10_vLAiSt9KfUGKpw5cD3vsSyNYBo7",
|
|
1096
|
-
name: "OP",
|
|
1097
|
-
decimals: 18
|
|
1098
|
-
},
|
|
1099
|
-
{
|
|
1100
|
-
assetId: "nep245:v2_1.omni.hot.tg:10_11111111111111111111",
|
|
1101
|
-
name: "ETH",
|
|
1102
|
-
decimals: 18
|
|
1103
|
-
}
|
|
1104
|
-
],
|
|
1105
|
-
needMemo: false
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
};
|
|
1109
1154
|
var ARBITRUM = {
|
|
1110
1155
|
assets: [
|
|
1111
1156
|
{
|
|
@@ -1176,54 +1221,6 @@ var ARBITRUM = {
|
|
|
1176
1221
|
}
|
|
1177
1222
|
}
|
|
1178
1223
|
};
|
|
1179
|
-
var BASE = {
|
|
1180
|
-
assets: [
|
|
1181
|
-
{
|
|
1182
|
-
name: "USDC",
|
|
1183
|
-
decimals: 6,
|
|
1184
|
-
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
1185
|
-
coingeckoId: "usd-coin"
|
|
1186
|
-
},
|
|
1187
|
-
{
|
|
1188
|
-
name: "ETH",
|
|
1189
|
-
decimals: 18,
|
|
1190
|
-
address: "0x0000000000000000000000000000000000000000",
|
|
1191
|
-
coingeckoId: "ethereum"
|
|
1192
|
-
}
|
|
1193
|
-
],
|
|
1194
|
-
evm: {
|
|
1195
|
-
chain: base,
|
|
1196
|
-
rpcUrl: "https://base-mainnet.g.alchemy.com/v2/49fUGmuW05ynCui0VEvDN",
|
|
1197
|
-
supports7702: true,
|
|
1198
|
-
erc4337: false
|
|
1199
|
-
},
|
|
1200
|
-
crossChainInformation: {
|
|
1201
|
-
circleInformation: {
|
|
1202
|
-
supportCirclePaymaster: true,
|
|
1203
|
-
cCTPInformation: {
|
|
1204
|
-
supportCCTP: true,
|
|
1205
|
-
domain: 6
|
|
1206
|
-
},
|
|
1207
|
-
aproxFromFee: 0
|
|
1208
|
-
},
|
|
1209
|
-
nearIntentInformation: {
|
|
1210
|
-
support: true,
|
|
1211
|
-
assetsId: [
|
|
1212
|
-
{
|
|
1213
|
-
assetId: "nep141:base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913.omft.near",
|
|
1214
|
-
name: "USDC",
|
|
1215
|
-
decimals: 6
|
|
1216
|
-
},
|
|
1217
|
-
{
|
|
1218
|
-
assetId: "nep141:base.omft.near",
|
|
1219
|
-
name: "ETH",
|
|
1220
|
-
decimals: 18
|
|
1221
|
-
}
|
|
1222
|
-
],
|
|
1223
|
-
needMemo: false
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
};
|
|
1227
1224
|
var UNICHAIN = {
|
|
1228
1225
|
assets: [
|
|
1229
1226
|
{
|
|
@@ -1559,98 +1556,6 @@ var BNB = {
|
|
|
1559
1556
|
}
|
|
1560
1557
|
}
|
|
1561
1558
|
};
|
|
1562
|
-
var GNOSIS = {
|
|
1563
|
-
assets: [
|
|
1564
|
-
{
|
|
1565
|
-
name: "USDC",
|
|
1566
|
-
decimals: 6,
|
|
1567
|
-
address: "0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0",
|
|
1568
|
-
coingeckoId: "usd-coin"
|
|
1569
|
-
},
|
|
1570
|
-
{
|
|
1571
|
-
name: "USDT",
|
|
1572
|
-
decimals: 6,
|
|
1573
|
-
address: "0x4ECaBa5870353805a9F068101A40E0f32ed605C6",
|
|
1574
|
-
coingeckoId: "tether"
|
|
1575
|
-
},
|
|
1576
|
-
{
|
|
1577
|
-
name: "EURe",
|
|
1578
|
-
decimals: 18,
|
|
1579
|
-
address: "0x420CA0f9B9b604cE0fd9C18EF134C705e5Fa3430",
|
|
1580
|
-
coingeckoId: "monerium-eur-money"
|
|
1581
|
-
},
|
|
1582
|
-
{
|
|
1583
|
-
name: "GNO",
|
|
1584
|
-
decimals: 18,
|
|
1585
|
-
address: "0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",
|
|
1586
|
-
coingeckoId: "gnosis"
|
|
1587
|
-
},
|
|
1588
|
-
{
|
|
1589
|
-
name: "WETH",
|
|
1590
|
-
decimals: 18,
|
|
1591
|
-
address: "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1",
|
|
1592
|
-
coingeckoId: "ethereum"
|
|
1593
|
-
},
|
|
1594
|
-
{
|
|
1595
|
-
name: "XDAI",
|
|
1596
|
-
decimals: 18,
|
|
1597
|
-
address: "0x0000000000000000000000000000000000000000",
|
|
1598
|
-
coingeckoId: "xdai"
|
|
1599
|
-
}
|
|
1600
|
-
],
|
|
1601
|
-
evm: {
|
|
1602
|
-
chain: gnosis,
|
|
1603
|
-
rpcUrl: gnosis.rpcUrls.default.http[0],
|
|
1604
|
-
supports7702: true,
|
|
1605
|
-
erc4337: true
|
|
1606
|
-
},
|
|
1607
|
-
crossChainInformation: {
|
|
1608
|
-
circleInformation: {
|
|
1609
|
-
supportCirclePaymaster: false,
|
|
1610
|
-
aproxFromFee: 0,
|
|
1611
|
-
cCTPInformation: {
|
|
1612
|
-
supportCCTP: false,
|
|
1613
|
-
domain: 0
|
|
1614
|
-
}
|
|
1615
|
-
},
|
|
1616
|
-
nearIntentInformation: {
|
|
1617
|
-
support: true,
|
|
1618
|
-
assetsId: [
|
|
1619
|
-
{
|
|
1620
|
-
assetId: "nep141:gnosis-0x2a22f9c3b484c3629090feed35f17ff8f88f76f0.omft.near",
|
|
1621
|
-
name: "USDC",
|
|
1622
|
-
decimals: 6
|
|
1623
|
-
},
|
|
1624
|
-
{
|
|
1625
|
-
assetId: "nep141:gnosis-0x4ecaba5870353805a9f068101a40e0f32ed605c6.omft.near",
|
|
1626
|
-
name: "USDT",
|
|
1627
|
-
decimals: 6
|
|
1628
|
-
},
|
|
1629
|
-
{
|
|
1630
|
-
assetId: "nep141:gnosis-0x420ca0f9b9b604ce0fd9c18ef134c705e5fa3430.omft.near",
|
|
1631
|
-
name: "EURe",
|
|
1632
|
-
decimals: 18
|
|
1633
|
-
},
|
|
1634
|
-
{
|
|
1635
|
-
assetId: "nep141:gnosis-0x9c58bacc331c9aa871afd802db6379a98e80cedb.omft.near",
|
|
1636
|
-
name: "GNO",
|
|
1637
|
-
decimals: 18
|
|
1638
|
-
},
|
|
1639
|
-
{
|
|
1640
|
-
assetId: "nep141:gnosis-0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1.omft.near",
|
|
1641
|
-
name: "WETH",
|
|
1642
|
-
decimals: 18
|
|
1643
|
-
},
|
|
1644
|
-
{
|
|
1645
|
-
assetId: "nep141:gnosis.omft.near",
|
|
1646
|
-
name: "XDAI",
|
|
1647
|
-
decimals: 18
|
|
1648
|
-
}
|
|
1649
|
-
],
|
|
1650
|
-
needMemo: false
|
|
1651
|
-
}
|
|
1652
|
-
}
|
|
1653
|
-
};
|
|
1654
1559
|
|
|
1655
1560
|
// src/constants/chainsInformation.ts
|
|
1656
1561
|
var NETWORKS = {
|
|
@@ -2141,6 +2046,6 @@ var TransferManager = class {
|
|
|
2141
2046
|
}
|
|
2142
2047
|
};
|
|
2143
2048
|
|
|
2144
|
-
export { AccountAbstraction, BASE_MAINNET, BASE_SEPOLIA, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, GNOSIS_MAINNET, NearStrategy, OPTIMISM_MAINNET, TransferManager, entryPointAbi, erc20Abi, smartAccountAbi };
|
|
2049
|
+
export { AccountAbstraction, BASE_MAINNET, BASE_SEPOLIA2 as BASE_SEPOLIA, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, GNOSIS_MAINNET, NearStrategy, OPTIMISM_MAINNET, TransferManager, entryPointAbi, erc20Abi, smartAccountAbi };
|
|
2145
2050
|
//# sourceMappingURL=index.mjs.map
|
|
2146
2051
|
//# sourceMappingURL=index.mjs.map
|