@1llet.xyz/erc4337-gasless-sdk 0.4.36 → 0.4.39

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 CHANGED
@@ -6,17 +6,31 @@ import z from 'zod';
6
6
  interface Token {
7
7
  symbol: string;
8
8
  decimals: number;
9
+ address: string;
10
+ }
11
+ interface EvmToken extends Token {
9
12
  address: Address;
10
13
  }
11
- interface ChainConfig$1 {
14
+ interface EvmChainConfig {
12
15
  chain: Chain;
13
16
  rpcUrl?: string;
14
17
  bundlerUrl: string;
15
18
  entryPointAddress?: Address;
16
19
  factoryAddress?: Address;
17
20
  paymasterAddress?: Address;
21
+ tokens: EvmToken[];
22
+ }
23
+ interface NonEvmChainConfig {
24
+ chain: {
25
+ id: number;
26
+ name: string;
27
+ [key: string]: any;
28
+ };
29
+ rpcUrl?: string;
30
+ bundlerUrl?: string;
18
31
  tokens: Token[];
19
32
  }
33
+ type ChainConfig$1 = EvmChainConfig | NonEvmChainConfig;
20
34
  interface UserOperation {
21
35
  sender: Address;
22
36
  nonce: bigint;
@@ -68,7 +82,7 @@ declare class AccountAbstraction {
68
82
  private userOpBuilder;
69
83
  private entryPointAddress;
70
84
  private factoryAddress;
71
- constructor(chainConfig: ChainConfig$1);
85
+ constructor(chainConfig: EvmChainConfig);
72
86
  /**
73
87
  * Connect to MetaMask OR use Private Key
74
88
  * @param privateKey (Optional) Hex string of private key. If provided, uses local signing.
@@ -151,7 +165,7 @@ declare global {
151
165
  declare class BundlerClient {
152
166
  private bundlerUrl;
153
167
  private entryPointAddress;
154
- constructor(config: ChainConfig$1, entryPointAddress: Address);
168
+ constructor(config: EvmChainConfig, entryPointAddress: Address);
155
169
  private call;
156
170
  estimateGas(userOp: Partial<UserOperation>): Promise<GasEstimate>;
157
171
  sendUserOperation(userOp: UserOperation): Promise<Hash>;
@@ -163,6 +177,7 @@ declare const BASE_MAINNET: ChainConfig$1;
163
177
  declare const OPTIMISM_MAINNET: ChainConfig$1;
164
178
  declare const GNOSIS_MAINNET: ChainConfig$1;
165
179
  declare const BASE_SEPOLIA: ChainConfig$1;
180
+ declare const STELLAR_MAINNET: ChainConfig$1;
166
181
  declare const CHAIN_CONFIGS: Record<number, ChainConfig$1>;
167
182
 
168
183
  declare const entryPointAbi: readonly [{
@@ -451,4 +466,4 @@ declare class CCTPStrategy implements BridgeStrategy {
451
466
  execute(context: BridgeContext): Promise<SettleResponse>;
452
467
  }
453
468
 
454
- export { AccountAbstraction, type ApprovalSupportResult, BASE_MAINNET, BASE_SEPOLIA, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, type ChainConfig$1 as ChainConfig, GNOSIS_MAINNET, type GasEstimate, NearStrategy, OPTIMISM_MAINNET, STELLAR, StellarService, type Token, TransferManager, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, smartAccountAbi };
469
+ export { AccountAbstraction, type ApprovalSupportResult, BASE_MAINNET, BASE_SEPOLIA, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, type ChainConfig$1 as ChainConfig, GNOSIS_MAINNET, type GasEstimate, NearStrategy, OPTIMISM_MAINNET, STELLAR, STELLAR_MAINNET, StellarService, type Token, TransferManager, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, smartAccountAbi };
package/dist/index.d.ts CHANGED
@@ -6,17 +6,31 @@ import z from 'zod';
6
6
  interface Token {
7
7
  symbol: string;
8
8
  decimals: number;
9
+ address: string;
10
+ }
11
+ interface EvmToken extends Token {
9
12
  address: Address;
10
13
  }
11
- interface ChainConfig$1 {
14
+ interface EvmChainConfig {
12
15
  chain: Chain;
13
16
  rpcUrl?: string;
14
17
  bundlerUrl: string;
15
18
  entryPointAddress?: Address;
16
19
  factoryAddress?: Address;
17
20
  paymasterAddress?: Address;
21
+ tokens: EvmToken[];
22
+ }
23
+ interface NonEvmChainConfig {
24
+ chain: {
25
+ id: number;
26
+ name: string;
27
+ [key: string]: any;
28
+ };
29
+ rpcUrl?: string;
30
+ bundlerUrl?: string;
18
31
  tokens: Token[];
19
32
  }
33
+ type ChainConfig$1 = EvmChainConfig | NonEvmChainConfig;
20
34
  interface UserOperation {
21
35
  sender: Address;
22
36
  nonce: bigint;
@@ -68,7 +82,7 @@ declare class AccountAbstraction {
68
82
  private userOpBuilder;
69
83
  private entryPointAddress;
70
84
  private factoryAddress;
71
- constructor(chainConfig: ChainConfig$1);
85
+ constructor(chainConfig: EvmChainConfig);
72
86
  /**
73
87
  * Connect to MetaMask OR use Private Key
74
88
  * @param privateKey (Optional) Hex string of private key. If provided, uses local signing.
@@ -151,7 +165,7 @@ declare global {
151
165
  declare class BundlerClient {
152
166
  private bundlerUrl;
153
167
  private entryPointAddress;
154
- constructor(config: ChainConfig$1, entryPointAddress: Address);
168
+ constructor(config: EvmChainConfig, entryPointAddress: Address);
155
169
  private call;
156
170
  estimateGas(userOp: Partial<UserOperation>): Promise<GasEstimate>;
157
171
  sendUserOperation(userOp: UserOperation): Promise<Hash>;
@@ -163,6 +177,7 @@ declare const BASE_MAINNET: ChainConfig$1;
163
177
  declare const OPTIMISM_MAINNET: ChainConfig$1;
164
178
  declare const GNOSIS_MAINNET: ChainConfig$1;
165
179
  declare const BASE_SEPOLIA: ChainConfig$1;
180
+ declare const STELLAR_MAINNET: ChainConfig$1;
166
181
  declare const CHAIN_CONFIGS: Record<number, ChainConfig$1>;
167
182
 
168
183
  declare const entryPointAbi: readonly [{
@@ -451,4 +466,4 @@ declare class CCTPStrategy implements BridgeStrategy {
451
466
  execute(context: BridgeContext): Promise<SettleResponse>;
452
467
  }
453
468
 
454
- export { AccountAbstraction, type ApprovalSupportResult, BASE_MAINNET, BASE_SEPOLIA, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, type ChainConfig$1 as ChainConfig, GNOSIS_MAINNET, type GasEstimate, NearStrategy, OPTIMISM_MAINNET, STELLAR, StellarService, type Token, TransferManager, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, smartAccountAbi };
469
+ export { AccountAbstraction, type ApprovalSupportResult, BASE_MAINNET, BASE_SEPOLIA, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, CHAIN_ID_TO_KEY, type ChainConfig$1 as ChainConfig, GNOSIS_MAINNET, type GasEstimate, NearStrategy, OPTIMISM_MAINNET, STELLAR, STELLAR_MAINNET, StellarService, type Token, TransferManager, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, smartAccountAbi };
package/dist/index.js CHANGED
@@ -1275,7 +1275,21 @@ var BASE_SEPOLIA = {
1275
1275
  factoryAddress: "0x9406Cc6185a346906296840746125a0E44976454"
1276
1276
  // Paymaster optional
1277
1277
  }};
1278
+
1279
+ // src/chains.ts
1280
+ init_Stellar();
1278
1281
  function mapToSDKConfig(data) {
1282
+ if (data.nonEvm) {
1283
+ return {
1284
+ chain: { id: 9e3, name: "Stellar" },
1285
+ // Custom ID for Stellar
1286
+ tokens: data.assets.map((a) => ({
1287
+ symbol: a.name,
1288
+ decimals: a.decimals,
1289
+ address: a.address
1290
+ }))
1291
+ };
1292
+ }
1279
1293
  if (!data.evm) throw new Error("Non-EVM config used in EVM SDK");
1280
1294
  return {
1281
1295
  chain: data.evm.chain,
@@ -1295,11 +1309,13 @@ var BASE_MAINNET = mapToSDKConfig(BASE);
1295
1309
  var OPTIMISM_MAINNET = mapToSDKConfig(OPTIMISM);
1296
1310
  var GNOSIS_MAINNET = mapToSDKConfig(GNOSIS);
1297
1311
  var BASE_SEPOLIA2 = mapToSDKConfig(BASE_SEPOLIA);
1312
+ var STELLAR_MAINNET = mapToSDKConfig(exports.STELLAR);
1298
1313
  var CHAIN_CONFIGS = {
1299
1314
  [chains.base.id]: BASE_MAINNET,
1300
1315
  [chains.baseSepolia.id]: BASE_SEPOLIA2,
1301
1316
  [chains.gnosis.id]: GNOSIS_MAINNET,
1302
- [chains.optimism.id]: OPTIMISM_MAINNET
1317
+ [chains.optimism.id]: OPTIMISM_MAINNET,
1318
+ 9e3: STELLAR_MAINNET
1303
1319
  };
1304
1320
 
1305
1321
  // src/constants/chains.ts
@@ -1309,7 +1325,8 @@ var CHAIN_ID_TO_KEY = {
1309
1325
  "100": "Gnosis",
1310
1326
  "10": "Optimism",
1311
1327
  "11155420": "Optimism",
1312
- "42161": "Arbitrum"
1328
+ "42161": "Arbitrum",
1329
+ "9000": "Stellar"
1313
1330
  };
1314
1331
 
1315
1332
  // src/index.ts
@@ -2350,6 +2367,7 @@ exports.CHAIN_ID_TO_KEY = CHAIN_ID_TO_KEY;
2350
2367
  exports.GNOSIS_MAINNET = GNOSIS_MAINNET;
2351
2368
  exports.NearStrategy = NearStrategy;
2352
2369
  exports.OPTIMISM_MAINNET = OPTIMISM_MAINNET;
2370
+ exports.STELLAR_MAINNET = STELLAR_MAINNET;
2353
2371
  exports.TransferManager = TransferManager;
2354
2372
  exports.entryPointAbi = entryPointAbi;
2355
2373
  exports.erc20Abi = erc20Abi;