@1llet.xyz/erc4337-gasless-sdk 0.4.36 → 0.4.37
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 +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ interface Token {
|
|
|
8
8
|
decimals: number;
|
|
9
9
|
address: Address;
|
|
10
10
|
}
|
|
11
|
-
interface
|
|
11
|
+
interface EvmChainConfig {
|
|
12
12
|
chain: Chain;
|
|
13
13
|
rpcUrl?: string;
|
|
14
14
|
bundlerUrl: string;
|
|
@@ -17,6 +17,17 @@ interface ChainConfig$1 {
|
|
|
17
17
|
paymasterAddress?: Address;
|
|
18
18
|
tokens: Token[];
|
|
19
19
|
}
|
|
20
|
+
interface NonEvmChainConfig {
|
|
21
|
+
chain: {
|
|
22
|
+
id: number;
|
|
23
|
+
name: string;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
rpcUrl?: string;
|
|
27
|
+
bundlerUrl?: string;
|
|
28
|
+
tokens: Token[];
|
|
29
|
+
}
|
|
30
|
+
type ChainConfig$1 = EvmChainConfig | NonEvmChainConfig;
|
|
20
31
|
interface UserOperation {
|
|
21
32
|
sender: Address;
|
|
22
33
|
nonce: bigint;
|
|
@@ -68,7 +79,7 @@ declare class AccountAbstraction {
|
|
|
68
79
|
private userOpBuilder;
|
|
69
80
|
private entryPointAddress;
|
|
70
81
|
private factoryAddress;
|
|
71
|
-
constructor(chainConfig:
|
|
82
|
+
constructor(chainConfig: EvmChainConfig);
|
|
72
83
|
/**
|
|
73
84
|
* Connect to MetaMask OR use Private Key
|
|
74
85
|
* @param privateKey (Optional) Hex string of private key. If provided, uses local signing.
|
|
@@ -151,7 +162,7 @@ declare global {
|
|
|
151
162
|
declare class BundlerClient {
|
|
152
163
|
private bundlerUrl;
|
|
153
164
|
private entryPointAddress;
|
|
154
|
-
constructor(config:
|
|
165
|
+
constructor(config: EvmChainConfig, entryPointAddress: Address);
|
|
155
166
|
private call;
|
|
156
167
|
estimateGas(userOp: Partial<UserOperation>): Promise<GasEstimate>;
|
|
157
168
|
sendUserOperation(userOp: UserOperation): Promise<Hash>;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface Token {
|
|
|
8
8
|
decimals: number;
|
|
9
9
|
address: Address;
|
|
10
10
|
}
|
|
11
|
-
interface
|
|
11
|
+
interface EvmChainConfig {
|
|
12
12
|
chain: Chain;
|
|
13
13
|
rpcUrl?: string;
|
|
14
14
|
bundlerUrl: string;
|
|
@@ -17,6 +17,17 @@ interface ChainConfig$1 {
|
|
|
17
17
|
paymasterAddress?: Address;
|
|
18
18
|
tokens: Token[];
|
|
19
19
|
}
|
|
20
|
+
interface NonEvmChainConfig {
|
|
21
|
+
chain: {
|
|
22
|
+
id: number;
|
|
23
|
+
name: string;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
rpcUrl?: string;
|
|
27
|
+
bundlerUrl?: string;
|
|
28
|
+
tokens: Token[];
|
|
29
|
+
}
|
|
30
|
+
type ChainConfig$1 = EvmChainConfig | NonEvmChainConfig;
|
|
20
31
|
interface UserOperation {
|
|
21
32
|
sender: Address;
|
|
22
33
|
nonce: bigint;
|
|
@@ -68,7 +79,7 @@ declare class AccountAbstraction {
|
|
|
68
79
|
private userOpBuilder;
|
|
69
80
|
private entryPointAddress;
|
|
70
81
|
private factoryAddress;
|
|
71
|
-
constructor(chainConfig:
|
|
82
|
+
constructor(chainConfig: EvmChainConfig);
|
|
72
83
|
/**
|
|
73
84
|
* Connect to MetaMask OR use Private Key
|
|
74
85
|
* @param privateKey (Optional) Hex string of private key. If provided, uses local signing.
|
|
@@ -151,7 +162,7 @@ declare global {
|
|
|
151
162
|
declare class BundlerClient {
|
|
152
163
|
private bundlerUrl;
|
|
153
164
|
private entryPointAddress;
|
|
154
|
-
constructor(config:
|
|
165
|
+
constructor(config: EvmChainConfig, entryPointAddress: Address);
|
|
155
166
|
private call;
|
|
156
167
|
estimateGas(userOp: Partial<UserOperation>): Promise<GasEstimate>;
|
|
157
168
|
sendUserOperation(userOp: UserOperation): Promise<Hash>;
|
package/dist/index.js
CHANGED
|
@@ -1275,7 +1275,22 @@ 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
|
+
// Valid address string
|
|
1291
|
+
}))
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1279
1294
|
if (!data.evm) throw new Error("Non-EVM config used in EVM SDK");
|
|
1280
1295
|
return {
|
|
1281
1296
|
chain: data.evm.chain,
|
|
@@ -1295,11 +1310,13 @@ var BASE_MAINNET = mapToSDKConfig(BASE);
|
|
|
1295
1310
|
var OPTIMISM_MAINNET = mapToSDKConfig(OPTIMISM);
|
|
1296
1311
|
var GNOSIS_MAINNET = mapToSDKConfig(GNOSIS);
|
|
1297
1312
|
var BASE_SEPOLIA2 = mapToSDKConfig(BASE_SEPOLIA);
|
|
1313
|
+
var STELLAR_TESTNET = mapToSDKConfig(exports.STELLAR);
|
|
1298
1314
|
var CHAIN_CONFIGS = {
|
|
1299
1315
|
[chains.base.id]: BASE_MAINNET,
|
|
1300
1316
|
[chains.baseSepolia.id]: BASE_SEPOLIA2,
|
|
1301
1317
|
[chains.gnosis.id]: GNOSIS_MAINNET,
|
|
1302
|
-
[chains.optimism.id]: OPTIMISM_MAINNET
|
|
1318
|
+
[chains.optimism.id]: OPTIMISM_MAINNET,
|
|
1319
|
+
9e3: STELLAR_TESTNET
|
|
1303
1320
|
};
|
|
1304
1321
|
|
|
1305
1322
|
// src/constants/chains.ts
|
|
@@ -1309,7 +1326,8 @@ var CHAIN_ID_TO_KEY = {
|
|
|
1309
1326
|
"100": "Gnosis",
|
|
1310
1327
|
"10": "Optimism",
|
|
1311
1328
|
"11155420": "Optimism",
|
|
1312
|
-
"42161": "Arbitrum"
|
|
1329
|
+
"42161": "Arbitrum",
|
|
1330
|
+
"9000": "Stellar"
|
|
1313
1331
|
};
|
|
1314
1332
|
|
|
1315
1333
|
// src/index.ts
|