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 +1 -0
- package/dist/config.js +1 -0
- package/dist/gokite-aa-sdk.d.ts +1 -0
- package/dist/gokite-aa-sdk.js +6 -4
- package/dist/utils.js +1 -1
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
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 },
|
package/dist/gokite-aa-sdk.d.ts
CHANGED
|
@@ -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
|
/**
|
package/dist/gokite-aa-sdk.js
CHANGED
|
@@ -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
|
|
258
|
-
const
|
|
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
|
|
287
|
-
finalRequest = this.prependAddSupportedToken(request, accountAddress
|
|
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(
|
|
133
|
+
return BigInt(2);
|
|
134
134
|
}
|
|
135
135
|
exports.generateSalt = generateSalt;
|
|
136
136
|
/**
|