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