gokite-aa-sdk 1.0.11 → 1.0.13

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/config.d.ts CHANGED
@@ -5,6 +5,7 @@ export interface NetworkConfig {
5
5
  accountImplementation: string;
6
6
  bundlerUrl?: string;
7
7
  paymaster?: string;
8
+ settlementToken: string;
8
9
  supportedTokens: {
9
10
  address: string;
10
11
  symbol: string;
package/dist/config.js CHANGED
@@ -8,6 +8,7 @@ exports.NETWORKS = {
8
8
  accountFactory: '0xAba80c4c8748c114Ba8b61cda3b0112333C3b96E',
9
9
  accountImplementation: '0x376c32FcE28aa8496465a9E5C8a03ED8B1a7fB4D',
10
10
  paymaster: '0x9Adcbf85D5c724611a490Ba9eDc4d38d6F39e92d',
11
+ settlementToken: '0x0fF5393387ad2f9f691FD6Fd28e07E3969e27e63',
11
12
  supportedTokens: [
12
13
  { address: '0x0000000000000000000000000000000000000000', symbol: 'KITE', decimals: 18 },
13
14
  { address: '0x0fF5393387ad2f9f691FD6Fd28e07E3969e27e63', symbol: 'Test USD', decimals: 18 },
@@ -37,6 +37,7 @@ export declare class GokiteAASDK {
37
37
  buildBatchCallData(request: BatchUserOperationRequest): string;
38
38
  /**
39
39
  * Prepend addSupportedToken call to request for first transaction (wallet deployment)
40
+ * Uses settlement token from config (supportedTokens[1])
40
41
  */
41
42
  private prependAddSupportedToken;
42
43
  /**
@@ -253,9 +253,11 @@ class GokiteAASDK {
253
253
  }
254
254
  /**
255
255
  * Prepend addSupportedToken call to request for first transaction (wallet deployment)
256
+ * Uses settlement token from config (supportedTokens[1])
256
257
  */
257
- prependAddSupportedToken(request, accountAddress, tokenAddress) {
258
- const addTokenCallData = (0, utils_1.encodeFunctionCall)(['function addSupportedToken(address)'], 'addSupportedToken', [tokenAddress]);
258
+ prependAddSupportedToken(request, accountAddress) {
259
+ const settlementToken = this.config.settlementToken;
260
+ const addTokenCallData = (0, utils_1.encodeFunctionCall)(['function addSupportedToken(address)'], 'addSupportedToken', [settlementToken]);
259
261
  if ('target' in request) {
260
262
  // Convert single request to batch with addSupportedToken prepended
261
263
  return {
@@ -283,8 +285,8 @@ class GokiteAASDK {
283
285
  const isDeployed = await this.isAccountDeloyed(accountAddress);
284
286
  // If wallet not deployed, batch addSupportedToken into first transaction
285
287
  let finalRequest = request;
286
- if (!isDeployed && tokenAddress && tokenAddress !== '0x0000000000000000000000000000000000000000') {
287
- finalRequest = this.prependAddSupportedToken(request, accountAddress, tokenAddress);
288
+ if (!isDeployed) {
289
+ finalRequest = this.prependAddSupportedToken(request, accountAddress);
288
290
  }
289
291
  const callData = 'targets' in finalRequest
290
292
  ? this.buildBatchCallData(finalRequest)
package/dist/utils.js CHANGED
@@ -130,7 +130,7 @@ function serializeUserOperation(userOp) {
130
130
  exports.serializeUserOperation = serializeUserOperation;
131
131
  // default salt is 0
132
132
  function generateSalt() {
133
- return BigInt(1);
133
+ return BigInt(2);
134
134
  }
135
135
  exports.generateSalt = generateSalt;
136
136
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gokite-aa-sdk",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Simple and clean Account Abstraction SDK for Gokite",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",