@account-kit/wallet-client 0.1.0-alpha.0 → 0.1.0-alpha.2
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/esm/abi/index.d.ts +8 -8
- package/dist/esm/abi/index.js +8 -8
- package/dist/esm/abi/index.js.map +1 -1
- package/dist/esm/capabilities/index.js +3 -3
- package/dist/esm/capabilities/index.js.map +1 -1
- package/dist/esm/capabilities/overrides.js +1 -1
- package/dist/esm/capabilities/overrides.js.map +1 -1
- package/dist/esm/capabilities/permissions/index.js +1 -1
- package/dist/esm/capabilities/permissions/index.js.map +1 -1
- package/dist/esm/capabilities/permissions/mav2.d.ts +2 -2
- package/dist/esm/capabilities/permissions/mav2.js +1 -1
- package/dist/esm/capabilities/permissions/mav2.js.map +1 -1
- package/dist/esm/client/actions/createAccount.d.ts +27 -2
- package/dist/esm/client/actions/createAccount.js +25 -0
- package/dist/esm/client/actions/createAccount.js.map +1 -1
- package/dist/esm/client/actions/getCallsStatus.d.ts +21 -2
- package/dist/esm/client/actions/getCallsStatus.js.map +1 -1
- package/dist/esm/client/actions/grantPermissions.d.ts +60 -2
- package/dist/esm/client/actions/grantPermissions.js.map +1 -1
- package/dist/esm/client/actions/listAccounts.d.ts +26 -2
- package/dist/esm/client/actions/listAccounts.js +24 -0
- package/dist/esm/client/actions/listAccounts.js.map +1 -1
- package/dist/esm/client/actions/prepareCalls.d.ts +28 -2
- package/dist/esm/client/actions/prepareCalls.js.map +1 -1
- package/dist/esm/client/actions/requestAccount.d.ts +23 -4
- package/dist/esm/client/actions/requestAccount.js +16 -5
- package/dist/esm/client/actions/requestAccount.js.map +1 -1
- package/dist/esm/client/actions/sendPreparedCalls.d.ts +39 -2
- package/dist/esm/client/actions/sendPreparedCalls.js +37 -0
- package/dist/esm/client/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/client/actions/signMessage.d.ts +23 -3
- package/dist/esm/client/actions/signMessage.js +5 -3
- package/dist/esm/client/actions/signMessage.js.map +1 -1
- package/dist/esm/client/actions/signSignatureRequest.d.ts +32 -1
- package/dist/esm/client/actions/signSignatureRequest.js +2 -2
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/client/actions/signTypedData.d.ts +36 -3
- package/dist/esm/client/actions/signTypedData.js +4 -2
- package/dist/esm/client/actions/signTypedData.js.map +1 -1
- package/dist/esm/client/client.e2e-test.js +101 -13
- package/dist/esm/client/client.e2e-test.js.map +1 -1
- package/dist/esm/client/decorator.d.ts +14 -12
- package/dist/esm/client/decorator.js +10 -10
- package/dist/esm/client/decorator.js.map +1 -1
- package/dist/esm/client/index.d.ts +5 -5
- package/dist/esm/client/index.js +32 -6
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/exports/index.d.ts +14 -13
- package/dist/esm/exports/index.js +14 -13
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/internal.d.ts +13 -13
- package/dist/esm/exports/internal.js +11 -11
- package/dist/esm/exports/internal.js.map +1 -1
- package/dist/esm/internal/decorator.d.ts +2 -0
- package/dist/esm/internal/decorator.js +10 -0
- package/dist/esm/internal/decorator.js.map +1 -0
- package/dist/esm/isomorphic/actions/createSession.d.ts +3 -3
- package/dist/esm/isomorphic/actions/createSession.js +5 -5
- package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
- package/dist/esm/isomorphic/actions/getCallsStatus.d.ts +2 -2
- package/dist/esm/isomorphic/actions/getCallsStatus.js +3 -3
- package/dist/esm/isomorphic/actions/getCallsStatus.js.map +1 -1
- package/dist/esm/isomorphic/actions/prepareCalls.d.ts +2 -2
- package/dist/esm/isomorphic/actions/prepareCalls.js +2 -2
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
- package/dist/esm/isomorphic/actions/sendPreparedCalls.d.ts +2 -2
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +2 -2
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/isomorphic/client.d.ts +6 -6
- package/dist/esm/isomorphic/client.js +4 -4
- package/dist/esm/isomorphic/client.js.map +1 -1
- package/dist/esm/isomorphic/utils/createAccount.d.ts +2 -2
- package/dist/esm/isomorphic/utils/createAccount.js +1 -1
- package/dist/esm/isomorphic/utils/createAccount.js.map +1 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +4 -4
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js +1 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +1 -1
- package/dist/esm/local/client.d.ts +1 -1
- package/dist/esm/local/client.js +12 -5
- package/dist/esm/local/client.js.map +1 -1
- package/dist/esm/remote/client.d.ts +1 -1
- package/dist/esm/remote/client.js +9 -4
- package/dist/esm/remote/client.js.map +1 -1
- package/dist/esm/rpc/request.js +3 -3
- package/dist/esm/rpc/request.js.map +1 -1
- package/dist/esm/rpc/schema.d.ts +1 -1
- package/dist/esm/rpc/schema.js +1 -1
- package/dist/esm/rpc/schema.js.map +1 -1
- package/dist/esm/types.d.ts +15 -4
- package/dist/esm/types.js.map +1 -1
- package/dist/types/abi/index.d.ts +8 -8
- package/dist/types/abi/index.d.ts.map +1 -1
- package/dist/types/capabilities/permissions/mav2.d.ts +2 -2
- package/dist/types/capabilities/permissions/mav2.d.ts.map +1 -1
- package/dist/types/client/actions/createAccount.d.ts +27 -2
- package/dist/types/client/actions/createAccount.d.ts.map +1 -1
- package/dist/types/client/actions/getCallsStatus.d.ts +21 -2
- package/dist/types/client/actions/getCallsStatus.d.ts.map +1 -1
- package/dist/types/client/actions/grantPermissions.d.ts +60 -2
- package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
- package/dist/types/client/actions/listAccounts.d.ts +26 -2
- package/dist/types/client/actions/listAccounts.d.ts.map +1 -1
- package/dist/types/client/actions/prepareCalls.d.ts +28 -2
- package/dist/types/client/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/client/actions/requestAccount.d.ts +23 -4
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
- package/dist/types/client/actions/sendPreparedCalls.d.ts +39 -2
- package/dist/types/client/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/client/actions/signMessage.d.ts +23 -3
- package/dist/types/client/actions/signMessage.d.ts.map +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts +32 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/client/actions/signTypedData.d.ts +36 -3
- package/dist/types/client/actions/signTypedData.d.ts.map +1 -1
- package/dist/types/client/decorator.d.ts +14 -12
- package/dist/types/client/decorator.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +5 -5
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +14 -13
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/internal.d.ts +13 -13
- package/dist/types/exports/internal.d.ts.map +1 -1
- package/dist/types/internal/decorator.d.ts +3 -0
- package/dist/types/internal/decorator.d.ts.map +1 -0
- package/dist/types/isomorphic/actions/createSession.d.ts +3 -3
- package/dist/types/isomorphic/actions/createSession.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/getCallsStatus.d.ts +2 -2
- package/dist/types/isomorphic/actions/getCallsStatus.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/prepareCalls.d.ts +2 -2
- package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts +2 -2
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/client.d.ts +6 -6
- package/dist/types/isomorphic/client.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/createAccount.d.ts +2 -2
- package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +4 -4
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +1 -1
- package/dist/types/local/client.d.ts +1 -1
- package/dist/types/local/client.d.ts.map +1 -1
- package/dist/types/remote/client.d.ts +1 -1
- package/dist/types/remote/client.d.ts.map +1 -1
- package/dist/types/rpc/schema.d.ts +1 -1
- package/dist/types/types.d.ts +15 -4
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +14 -7
- package/src/abi/index.ts +8 -8
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/overrides.ts +1 -1
- package/src/capabilities/permissions/index.ts +1 -1
- package/src/capabilities/permissions/mav2.ts +3 -3
- package/src/client/actions/createAccount.ts +27 -2
- package/src/client/actions/getCallsStatus.ts +21 -2
- package/src/client/actions/grantPermissions.ts +60 -2
- package/src/client/actions/listAccounts.ts +26 -2
- package/src/client/actions/prepareCalls.ts +28 -2
- package/src/client/actions/requestAccount.ts +44 -9
- package/src/client/actions/sendPreparedCalls.ts +39 -2
- package/src/client/actions/signMessage.ts +26 -6
- package/src/client/actions/signSignatureRequest.ts +33 -2
- package/src/client/actions/signTypedData.ts +41 -5
- package/src/client/client.e2e-test.ts +122 -13
- package/src/client/decorator.ts +25 -27
- package/src/client/index.ts +47 -13
- package/src/exports/index.ts +14 -13
- package/src/exports/internal.ts +13 -13
- package/src/internal/decorator.ts +12 -0
- package/src/isomorphic/actions/createSession.ts +15 -15
- package/src/isomorphic/actions/getCallsStatus.ts +6 -6
- package/src/isomorphic/actions/prepareCalls.ts +4 -4
- package/src/isomorphic/actions/sendPreparedCalls.ts +4 -4
- package/src/isomorphic/client.ts +8 -5
- package/src/isomorphic/utils/createAccount.ts +3 -3
- package/src/isomorphic/utils/parsePermissionsContext.ts +3 -3
- package/src/local/client.ts +56 -46
- package/src/remote/client.ts +13 -8
- package/src/rpc/request.ts +3 -3
- package/src/rpc/schema.ts +1 -1
- package/src/types.ts +18 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type SmartAccountClient, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import type { Static } from "@sinclair/typebox";
|
|
3
3
|
import { type Chain, type Transport } from "viem";
|
|
4
|
-
import type { wallet_getCallsStatus } from "../../rpc/request";
|
|
5
|
-
import type { WalletServerViemRpcSchema } from "../../rpc/schema";
|
|
4
|
+
import type { wallet_getCallsStatus } from "../../rpc/request.js";
|
|
5
|
+
import type { WalletServerViemRpcSchema } from "../../rpc/schema.js";
|
|
6
6
|
export type GetCallsStatusParams = Static<(typeof wallet_getCallsStatus)["properties"]["Request"]["properties"]["params"]>[0];
|
|
7
7
|
export type GetCallsStatusResponse = Static<(typeof wallet_getCallsStatus)["properties"]["ReturnType"]>;
|
|
8
8
|
/** EIP-5792 call status codes */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCallsStatus.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/actions/getCallsStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"getCallsStatus.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/actions/getCallsStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAGL,KAAK,KAAK,EAGV,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAIrE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CACvC,CAAC,OAAO,qBAAqB,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAChF,CAAC,CAAC,CAAC,CAAC;AAEL,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACzC,CAAC,OAAO,qBAAqB,CAAC,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3D,CAAC;AAOF,iCAAiC;AACjC,eAAO,MAAM,cAAc;IACzB,oFAAoF;;IAEpF,iGAAiG;;IAEjG,oEAAoE;;IAEpE,wGAAwG;;IAExG,wGAAwG;;CAEhG,CAAC;AAEX,wBAAsB,cAAc,CAClC,MAAM,EAAE,kBAAkB,CACxB,SAAS,EACT,KAAK,EACL,oBAAoB,GAAG,SAAS,EAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,yBAAyB,CAC1B,EACD,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CAoBjC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type SmartAccountClient, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import type { Static } from "@sinclair/typebox";
|
|
3
3
|
import { type Chain, type Transport } from "viem";
|
|
4
|
-
import type { wallet_prepareCalls } from "../../rpc/request";
|
|
5
|
-
import type { WalletServerViemRpcSchema } from "../../rpc/schema";
|
|
4
|
+
import type { wallet_prepareCalls } from "../../rpc/request.js";
|
|
5
|
+
import type { WalletServerViemRpcSchema } from "../../rpc/schema.js";
|
|
6
6
|
export type PrepareCallsParams = Omit<Static<(typeof wallet_prepareCalls)["properties"]["Request"]["properties"]["params"]>[0], "chainId">;
|
|
7
7
|
export type PrepareCallsResult = Static<(typeof wallet_prepareCalls)["properties"]["ReturnType"]>;
|
|
8
8
|
export declare function prepareCalls(client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>, params: PrepareCallsParams): Promise<PrepareCallsResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareCalls.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/actions/prepareCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAA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
|
import { type SmartAccountClient, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import type { Static, StaticDecode } from "@sinclair/typebox";
|
|
3
3
|
import { type Chain, type Transport } from "viem";
|
|
4
|
-
import type { wallet_sendPreparedCalls } from "../../rpc/request";
|
|
5
|
-
import type { WalletServerViemRpcSchema } from "../../rpc/schema";
|
|
4
|
+
import type { wallet_sendPreparedCalls } from "../../rpc/request.js";
|
|
5
|
+
import type { WalletServerViemRpcSchema } from "../../rpc/schema.js";
|
|
6
6
|
export type SendPreparedCallsParams = Omit<StaticDecode<(typeof wallet_sendPreparedCalls)["properties"]["Request"]["properties"]["params"]>[0], "chainId">;
|
|
7
7
|
export type SendPreparedCallsResult = Static<(typeof wallet_sendPreparedCalls)["properties"]["ReturnType"]>;
|
|
8
8
|
export declare function sendPreparedCalls(client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>, params: SendPreparedCallsParams): Promise<SendPreparedCallsResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendPreparedCalls.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/actions/sendPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAKL,KAAK,KAAK,EAEV,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sendPreparedCalls.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/actions/sendPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAKL,KAAK,KAAK,EAEV,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGrE,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,YAAY,CACV,CAAC,OAAO,wBAAwB,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CACnF,CAAC,CAAC,CAAC,EACJ,SAAS,CACV,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,CAAC,OAAO,wBAAwB,CAAC,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAC9D,CAAC;AAGF,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,kBAAkB,CACxB,SAAS,EACT,KAAK,EACL,oBAAoB,GAAG,SAAS,EAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,yBAAyB,CAC1B,EACD,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAoDlC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type SmartAccountClient, type SmartAccountClientRpcSchema, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import { type Chain, type Transport } from "viem";
|
|
3
|
-
import type { WalletServerViemRpcSchema } from "../rpc/schema";
|
|
4
|
-
import { type CreateSessionParams } from "./actions/createSession";
|
|
5
|
-
import { type GetCallsStatusParams } from "./actions/getCallsStatus";
|
|
6
|
-
import { type PrepareCallsParams } from "./actions/prepareCalls";
|
|
7
|
-
import { type SendPreparedCallsParams } from "./actions/sendPreparedCalls";
|
|
3
|
+
import type { WalletServerViemRpcSchema } from "../rpc/schema.js";
|
|
4
|
+
import { type CreateSessionParams } from "./actions/createSession.js";
|
|
5
|
+
import { type GetCallsStatusParams } from "./actions/getCallsStatus.js";
|
|
6
|
+
import { type PrepareCallsParams } from "./actions/prepareCalls.js";
|
|
7
|
+
import { type SendPreparedCallsParams } from "./actions/sendPreparedCalls.js";
|
|
8
8
|
type ClientParams = {
|
|
9
9
|
chain: Chain;
|
|
10
10
|
transport: Transport;
|
|
@@ -91,7 +91,7 @@ export declare function isomorphicClientActions(client: SmartAccountClient<Trans
|
|
|
91
91
|
atomic: boolean;
|
|
92
92
|
status: 100 | 200 | 400 | 500 | 600;
|
|
93
93
|
}>;
|
|
94
|
-
createSession: (params: CreateSessionParams) => Promise<import("./actions/createSession").CreateSessionResult>;
|
|
94
|
+
createSession: (params: CreateSessionParams) => Promise<import("./actions/createSession.js").CreateSessionResult>;
|
|
95
95
|
};
|
|
96
96
|
export declare function createIsomorphicClient({ chain, transport, policyId, useErc7677middleware, }: ClientParams): SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, ReturnType<typeof isomorphicClientActions>, WalletServerViemRpcSchema & SmartAccountClientRpcSchema>;
|
|
97
97
|
export type IsomorphicClient = ReturnType<typeof createIsomorphicClient>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/isomorphic/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/isomorphic/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,KAA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
|
import { type ModularAccountV2 } from "@account-kit/smart-contracts";
|
|
3
3
|
import type { StaticDecode } from "@sinclair/typebox";
|
|
4
4
|
import type { Address, Chain, Transport } from "viem";
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
5
|
+
import type { Capabilities } from "../../capabilities/index.js";
|
|
6
|
+
import type { TypeSerializedInitcode } from "../../schemas.js";
|
|
7
7
|
type CreateAccountParams = {
|
|
8
8
|
chain: Chain;
|
|
9
9
|
transport: Transport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAccount.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/utils/createAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEtD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"createAccount.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/utils/createAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC;IAChE,YAAY,CAAC,EAAE,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CAuB/B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,IAAI,gBAAgB,CAE7B"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { StaticDecode } from "@sinclair/typebox";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { TypeSerializedInitcode } from "../../schemas.js";
|
|
3
|
+
import type { PrepareCallsParams } from "../actions/prepareCalls.js";
|
|
4
4
|
export declare function parsePermissionsContext(capabilities: PrepareCallsParams["capabilities"], parsedCi: StaticDecode<typeof TypeSerializedInitcode>): ({
|
|
5
|
-
contextVersion: keyof typeof import("../../exports/internal").PermissionsContextVersion;
|
|
5
|
+
contextVersion: keyof typeof import("../../exports/internal.js").PermissionsContextVersion;
|
|
6
6
|
} & {
|
|
7
7
|
contextVersion: "LOCAL_MODE_DEFERRED_ACTION";
|
|
8
8
|
deferredAction: import("viem").Hex;
|
|
9
9
|
sessionId?: never;
|
|
10
10
|
signature?: never;
|
|
11
11
|
}) | ({
|
|
12
|
-
contextVersion: keyof typeof import("../../exports/internal").PermissionsContextVersion;
|
|
12
|
+
contextVersion: keyof typeof import("../../exports/internal.js").PermissionsContextVersion;
|
|
13
13
|
} & {
|
|
14
14
|
contextVersion: "NON_DEFERRED_ACTION";
|
|
15
15
|
deferredAction?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsePermissionsContext.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/utils/parsePermissionsContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"parsePermissionsContext.d.ts","sourceRoot":"","sources":["../../../../src/isomorphic/utils/parsePermissionsContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,kBAAkB,CAAC,cAAc,CAAC,EAChD,QAAQ,EAAE,YAAY,CAAC,OAAO,sBAAsB,CAAC;;;;;;;;;;;;;;;;eAwBtD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Address, type JsonRpcAccount } from "viem";
|
|
2
|
-
import type { CreateInnerClientParams, InnerWalletApiClient } from "../types";
|
|
2
|
+
import type { CreateInnerClientParams, InnerWalletApiClient } from "../types.ts";
|
|
3
3
|
export declare function createLocalClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(params: CreateInnerClientParams<TAccount>): InnerWalletApiClient<TAccount>;
|
|
4
4
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/local/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/local/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,MAAM,CAAC;AAY/E,OAAO,KAAK,EACV,uBAAuB,EAEvB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAWrB,wBAAgB,iBAAiB,CAC/B,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,EACb,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Address, type JsonRpcAccount } from "viem";
|
|
2
|
-
import type { CreateInnerClientParams, InnerWalletApiClient } from "../types";
|
|
2
|
+
import type { CreateInnerClientParams, InnerWalletApiClient } from "../types.ts";
|
|
3
3
|
export declare function createRemoteClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(params: CreateInnerClientParams<TAccount>): InnerWalletApiClient<TAccount>;
|
|
4
4
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/remote/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/remote/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,MAAM,CAAC;AAK/E,OAAO,KAAK,EACV,uBAAuB,EAEvB,oBAAoB,EAErB,MAAM,aAAa,CAAC;AAErB,wBAAgB,kBAAkB,CAChC,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,EACb,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -263,6 +263,7 @@ export declare const WalletServerRpcSchema: {
|
|
|
263
263
|
method: "wallet_createSession";
|
|
264
264
|
};
|
|
265
265
|
ReturnType: {
|
|
266
|
+
sessionId: `0x${string}`;
|
|
266
267
|
signatureRequest: {
|
|
267
268
|
type: "personal_sign";
|
|
268
269
|
data: string | {
|
|
@@ -290,7 +291,6 @@ export declare const WalletServerRpcSchema: {
|
|
|
290
291
|
};
|
|
291
292
|
};
|
|
292
293
|
};
|
|
293
|
-
sessionId: `0x${string}`;
|
|
294
294
|
};
|
|
295
295
|
} | {
|
|
296
296
|
Request: {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { SmartAccountSigner, SmartContractAccount } from "@aa-sdk/core";
|
|
1
2
|
import type { AlchemyTransport } from "@account-kit/infra";
|
|
2
3
|
import type { Address, Chain, Client, Hex, IsUndefined, JsonRpcAccount, Transport } from "viem";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
4
|
+
import type { GrantPermissionsParams, GrantPermissionsResult } from "./client/actions/grantPermissions.ts";
|
|
5
|
+
import type { RequestAccountParams } from "./client/actions/requestAccount.ts";
|
|
6
|
+
import type { WalletServerViemRpcSchema } from "./rpc/schema.ts";
|
|
6
7
|
export type CreateInnerClientParams<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = {
|
|
7
8
|
chain: Chain;
|
|
8
9
|
transport: AlchemyTransport;
|
|
@@ -24,5 +25,15 @@ export type InnerClientActions = {
|
|
|
24
25
|
chainId: Hex;
|
|
25
26
|
}) => Promise<GrantPermissionsResult>;
|
|
26
27
|
};
|
|
27
|
-
export type
|
|
28
|
+
export type CachedAccount = {
|
|
29
|
+
account: SmartContractAccount;
|
|
30
|
+
requestParams: RequestAccountParams;
|
|
31
|
+
};
|
|
32
|
+
export type InternalState = {
|
|
33
|
+
setAccount: (account: CachedAccount) => void;
|
|
34
|
+
getAccount: () => CachedAccount | undefined;
|
|
35
|
+
};
|
|
36
|
+
export type InnerWalletApiClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = InnerWalletApiClientBase<TAccount, InnerClientActions & {
|
|
37
|
+
internal: InternalState;
|
|
38
|
+
}>;
|
|
28
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EACH,WAAW,EACX,cAAc,EACd,SAAS,EACV,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EACH,WAAW,EACX,cAAc,EACd,SAAS,EACV,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,uBAAuB,CACjC,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,IACX;IACF,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,CAAC,WAAW,CAAC,QAAQ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GED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@account-kit/wallet-client",
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.1.0-alpha.
|
|
5
|
+
"version": "0.1.0-alpha.2",
|
|
6
6
|
"main": "./dist/esm/exports/index.js",
|
|
7
7
|
"module": "./dist/esm/exports/index.js",
|
|
8
8
|
"types": "./dist/types/exports/index.d.ts",
|
|
@@ -42,26 +42,33 @@
|
|
|
42
42
|
"clean": "rm -rf dist",
|
|
43
43
|
"compile": "bun clean && bun compile:esm && bun compile:types",
|
|
44
44
|
"compile:esm": "bunx tsc --project tsconfig.build.json --outDir ./dist/esm",
|
|
45
|
+
"lint": "eslint .",
|
|
46
|
+
"lint:fix": "eslint --fix .",
|
|
47
|
+
"format": "prettier --check .",
|
|
48
|
+
"format:fix": "prettier --log-level warn --write --ignore-unknown .",
|
|
45
49
|
"compile:types": "bunx tsc --project tsconfig.build.json --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
|
|
46
50
|
"test:e2e": "bun test ./src/**/*.e2e-test.*"
|
|
47
51
|
},
|
|
48
52
|
"devDependencies": {
|
|
49
|
-
"@repo/configs": "workspace:*"
|
|
53
|
+
"@repo/configs": "workspace:*",
|
|
54
|
+
"@types/deep-equal": "^1.0.4",
|
|
55
|
+
"eslint-plugin-import": "^2.31.0"
|
|
50
56
|
},
|
|
51
57
|
"peerDependencies": {
|
|
52
58
|
"typescript": "^5.8.2"
|
|
53
59
|
},
|
|
54
60
|
"dependencies": {
|
|
55
|
-
"@aa-sdk/core": "^4.
|
|
56
|
-
"@account-kit/infra": "^4.
|
|
57
|
-
"@account-kit/smart-contracts": "^4.
|
|
61
|
+
"@aa-sdk/core": "^4.34.0",
|
|
62
|
+
"@account-kit/infra": "^4.34.0",
|
|
63
|
+
"@account-kit/smart-contracts": "^4.34.0",
|
|
58
64
|
"@sinclair/typebox": "^0.34.33",
|
|
65
|
+
"deep-equal": "^2.2.3",
|
|
59
66
|
"ox": "^0.6.12",
|
|
60
|
-
"viem": "
|
|
67
|
+
"viem": "2.29.2"
|
|
61
68
|
},
|
|
62
69
|
"publishConfig": {
|
|
63
70
|
"access": "public",
|
|
64
71
|
"registry": "https://registry.npmjs.org/"
|
|
65
72
|
},
|
|
66
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "435c18e58616f1f0706d6e4df6f23c7676062191"
|
|
67
74
|
}
|
package/src/abi/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { LightAccountFactoryAbi_V1_0_1 } from "./LightAccountFactoryAbi_V1_0_1";
|
|
2
|
-
export { LightAccountFactoryAbi_V1_0_2 } from "./LightAccountFactoryAbi_V1_0_2";
|
|
3
|
-
export { LightAccountFactoryAbi_V1_1_0 } from "./LightAccountFactoryAbi_V1_1_0";
|
|
4
|
-
export { LightAccountFactoryAbi_V2_0_0 } from "./LightAccountFactoryAbi_V2_0_0";
|
|
5
|
-
export { ModularAccountFactoryAbi_V2_0_0 } from "./ModularAccountFactoryAbi_V2_0_0";
|
|
6
|
-
export { MultiOwnerLightAccountFactoryAbi_V2_0_0 } from "./MultiOwnerLightAccountFactoryAbi_V2_0_0";
|
|
7
|
-
export { MultiOwnerModularAccountFactoryAbi_V1_0_0 } from "./MultiOwnerModularAccountFactoryAbi_V1_0_0";
|
|
8
|
-
export { MultisigModularAccountFactoryAbi_V1_0_0 } from "./MultisigModularAccountFactoryAbi_V1_0_0";
|
|
1
|
+
export { LightAccountFactoryAbi_V1_0_1 } from "./LightAccountFactoryAbi_V1_0_1.js";
|
|
2
|
+
export { LightAccountFactoryAbi_V1_0_2 } from "./LightAccountFactoryAbi_V1_0_2.js";
|
|
3
|
+
export { LightAccountFactoryAbi_V1_1_0 } from "./LightAccountFactoryAbi_V1_1_0.js";
|
|
4
|
+
export { LightAccountFactoryAbi_V2_0_0 } from "./LightAccountFactoryAbi_V2_0_0.js";
|
|
5
|
+
export { ModularAccountFactoryAbi_V2_0_0 } from "./ModularAccountFactoryAbi_V2_0_0.js";
|
|
6
|
+
export { MultiOwnerLightAccountFactoryAbi_V2_0_0 } from "./MultiOwnerLightAccountFactoryAbi_V2_0_0.js";
|
|
7
|
+
export { MultiOwnerModularAccountFactoryAbi_V1_0_0 } from "./MultiOwnerModularAccountFactoryAbi_V1_0_0.js";
|
|
8
|
+
export { MultisigModularAccountFactoryAbi_V1_0_0 } from "./MultisigModularAccountFactoryAbi_V1_0_0.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { GasParamsOverrideCapability } from "./overrides";
|
|
3
|
-
import { PaymasterCapability } from "./paymaster";
|
|
4
|
-
import { PermissionsCapability } from "./permissions";
|
|
2
|
+
import { GasParamsOverrideCapability } from "./overrides.js";
|
|
3
|
+
import { PaymasterCapability } from "./paymaster.js";
|
|
4
|
+
import { PermissionsCapability } from "./permissions/index.js";
|
|
5
5
|
|
|
6
6
|
export const Capabilities = Type.Object(
|
|
7
7
|
{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PermissionType } from "@account-kit/smart-contracts/experimental";
|
|
2
2
|
import type { Static } from "@sinclair/typebox";
|
|
3
3
|
import { concatHex, sliceHex, type Hex } from "viem";
|
|
4
|
-
import type { PermissionsData } from ".";
|
|
5
|
-
import type { KeySigner } from "../../schemas";
|
|
6
|
-
import { assertNever } from "../../utils";
|
|
4
|
+
import type { PermissionsData } from "./index.ts";
|
|
5
|
+
import type { KeySigner } from "../../schemas.ts";
|
|
6
|
+
import { assertNever } from "../../utils.js";
|
|
7
7
|
|
|
8
8
|
export const SESSION_ID_LENGTH_BYTES = 16;
|
|
9
9
|
export const ENTITY_ID_LENGTH_BYTES = 4;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import type { Static } from "@sinclair/typebox";
|
|
3
3
|
import type { Address } from "abitype";
|
|
4
|
-
import type { wallet_createAccount } from "../../rpc/request";
|
|
5
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
4
|
+
import type { wallet_createAccount } from "../../rpc/request.ts";
|
|
5
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
6
6
|
|
|
7
7
|
export type CreateAccountParams = Omit<
|
|
8
8
|
Extract<
|
|
@@ -16,6 +16,31 @@ export type CreateAccountResult = Static<
|
|
|
16
16
|
typeof wallet_createAccount
|
|
17
17
|
>["ReturnType"];
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new account for the provided signer using the wallet API client.
|
|
21
|
+
* This method is primarily used to import existing accounts.
|
|
22
|
+
* For most cases, you should use requestAccount instead.
|
|
23
|
+
* If the account already exists, an error will be thrown.
|
|
24
|
+
*
|
|
25
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
26
|
+
* @param {SmartAccountSigner} signer - The signer that will be associated with the account
|
|
27
|
+
* @param {CreateAccountParams} params - Parameters for creating the account
|
|
28
|
+
* @param {string} [params.id] - Optional UUID v4 identifier for the account
|
|
29
|
+
* @param {object} params.creationOptions - Options for account creation
|
|
30
|
+
* @param {string} [params.creationOptions.accountType] - Currently only "sma-b" (Modular Account v2) is supported
|
|
31
|
+
* @param {string} [params.creationOptions.salt] - Optional hex string to use as salt for account creation
|
|
32
|
+
* @returns {Promise<CreateAccountResult>} A Promise that resolves to the created account information
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Create a new account with a custom salt
|
|
36
|
+
* const account = await client.createAccount({
|
|
37
|
+
* creationOptions: {
|
|
38
|
+
* accountType: "sma-b",
|
|
39
|
+
* salt: "0x04"
|
|
40
|
+
* }
|
|
41
|
+
* });
|
|
42
|
+
* console.log(`Created account at address: ${account.accountAddress}`);
|
|
43
|
+
*/
|
|
19
44
|
export async function createAccount(
|
|
20
45
|
client: InnerWalletApiClient,
|
|
21
46
|
signer: SmartAccountSigner,
|
|
@@ -2,13 +2,32 @@ import type { Address, JsonRpcAccount } from "viem";
|
|
|
2
2
|
import type {
|
|
3
3
|
GetCallsStatusParams as IsomorphicGetCallsStatusParams,
|
|
4
4
|
GetCallsStatusResponse as IsomorphicGetCallsStatusResult,
|
|
5
|
-
} from "../../isomorphic/actions/getCallsStatus";
|
|
6
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
5
|
+
} from "../../isomorphic/actions/getCallsStatus.ts";
|
|
6
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
7
7
|
|
|
8
8
|
export type GetCallsStatusParams = IsomorphicGetCallsStatusParams;
|
|
9
9
|
|
|
10
10
|
export type GetCallsStatusResult = IsomorphicGetCallsStatusResult;
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Gets the status of a prepared call by its ID.
|
|
14
|
+
* This method is used to check the execution status of calls sent via sendPreparedCalls.
|
|
15
|
+
*
|
|
16
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
17
|
+
* @param {GetCallsStatusParams} params - The ID of the prepared call to check
|
|
18
|
+
* @returns {Promise<GetCallsStatusResult>} A Promise that resolves to the status information including:
|
|
19
|
+
* - id: The hex ID of the call
|
|
20
|
+
* - chainId: The chain ID in hex format
|
|
21
|
+
* - status: The current status of the batch execution
|
|
22
|
+
* - receipts: Optional array of transaction receipts if the batch has been executed
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // After sending prepared calls
|
|
26
|
+
* const sendResult = await client.sendPreparedCalls({...});
|
|
27
|
+
*
|
|
28
|
+
* // Check the status of the first call ID
|
|
29
|
+
* const status = await client.getCallsStatus(sendResult.preparedCallIds[0]);
|
|
30
|
+
*/
|
|
12
31
|
export async function getCallsStatus<
|
|
13
32
|
TAccount extends JsonRpcAccount<Address> | undefined =
|
|
14
33
|
| JsonRpcAccount<Address>
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
type JsonRpcAccount,
|
|
6
6
|
toHex,
|
|
7
7
|
} from "viem";
|
|
8
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
8
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
9
9
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
10
|
-
import type { CreateSessionParams } from "../../isomorphic/actions/createSession";
|
|
10
|
+
import type { CreateSessionParams } from "../../isomorphic/actions/createSession.ts";
|
|
11
11
|
|
|
12
12
|
export type GrantPermissionsParams<
|
|
13
13
|
TAccount extends JsonRpcAccount<Address> | undefined =
|
|
@@ -22,6 +22,64 @@ export type GrantPermissionsResult = {
|
|
|
22
22
|
context: Hex;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Grants permissions to a smart account by creating a session.
|
|
27
|
+
* This allows another key to perform operations on behalf of the account.
|
|
28
|
+
*
|
|
29
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
30
|
+
* @param {SmartAccountSigner} signer - The signer of the smart account
|
|
31
|
+
* @param {GrantPermissionsParams} params - The parameters for granting permissions
|
|
32
|
+
* @param {Address} [params.account] - The account address (required if client was not initialized with an account)
|
|
33
|
+
* @param {number} params.expiry - Unix timestamp when the permissions expire
|
|
34
|
+
* @param {object} params.key - The session key information
|
|
35
|
+
* @param {string} params.key.publicKey - The public key of the session key
|
|
36
|
+
* @param {string} params.key.type - The type of the key (e.g., "secp256k1")
|
|
37
|
+
* @param {Array} params.permissions - Array of permission objects defining what the session key can do
|
|
38
|
+
* @returns {Promise<GrantPermissionsResult>} A Promise that resolves to the result containing a context identifier
|
|
39
|
+
* @returns {Hex} result.context - A hex identifier for the granted permissions context
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // Create a session key and grant root permissions
|
|
43
|
+
* const sessionKey = LocalAccountSigner.generatePrivateKeySigner();
|
|
44
|
+
* const account = await client.requestAccount();
|
|
45
|
+
*
|
|
46
|
+
* const permissions = await client.grantPermissions({
|
|
47
|
+
* account: account.address,
|
|
48
|
+
* expiry: Math.floor(Date.now() / 1000) + 60 * 60, // 1 hour from now
|
|
49
|
+
* key: {
|
|
50
|
+
* publicKey: await sessionKey.getAddress(),
|
|
51
|
+
* type: "secp256k1",
|
|
52
|
+
* },
|
|
53
|
+
* permissions: [{ type: "root" }],
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* // Use the permissions to prepare a call
|
|
57
|
+
* const preparedUO = await client.prepareCalls({
|
|
58
|
+
* calls: [{ to: zeroAddress, value: "0x0" }],
|
|
59
|
+
* from: account.address,
|
|
60
|
+
* capabilities: {
|
|
61
|
+
* paymasterService: {
|
|
62
|
+
* policyId: "your-paymaster-policy-id",
|
|
63
|
+
* },
|
|
64
|
+
* permissions,
|
|
65
|
+
* },
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* // Sign with the session key
|
|
69
|
+
* const signature = await signSignatureRequest(
|
|
70
|
+
* sessionKey,
|
|
71
|
+
* preparedUO.signatureRequest,
|
|
72
|
+
* );
|
|
73
|
+
*
|
|
74
|
+
* // Send the prepared call using the session key
|
|
75
|
+
* const result = await client.sendPreparedCalls({
|
|
76
|
+
* ...preparedUO,
|
|
77
|
+
* signature,
|
|
78
|
+
* capabilities: {
|
|
79
|
+
* permissions,
|
|
80
|
+
* },
|
|
81
|
+
* });
|
|
82
|
+
*/
|
|
25
83
|
export async function grantPermissions<
|
|
26
84
|
TAccount extends JsonRpcAccount<Address> | undefined =
|
|
27
85
|
| JsonRpcAccount<Address>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import type { wallet_listAccounts } from "../../rpc/request";
|
|
3
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
2
|
+
import type { wallet_listAccounts } from "../../rpc/request.ts";
|
|
3
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
4
4
|
|
|
5
5
|
export type ListAccountsParams = Static<
|
|
6
6
|
typeof wallet_listAccounts
|
|
@@ -10,6 +10,30 @@ export type ListAccountsResult = Static<
|
|
|
10
10
|
typeof wallet_listAccounts
|
|
11
11
|
>["ReturnType"];
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Lists all smart accounts for a given signer using the wallet API client.
|
|
15
|
+
*
|
|
16
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
17
|
+
* @param {ListAccountsParams} params - Parameters for listing accounts
|
|
18
|
+
* @param {string} params.signerAddress - The address of the signer to list accounts for
|
|
19
|
+
* @param {number} [params.limit] - Optional maximum number of accounts to return (default: 100, max: 100)
|
|
20
|
+
* @param {string} [params.after] - Optional pagination cursor for fetching subsequent pages
|
|
21
|
+
* @returns {Promise<ListAccountsResult>} A Promise that resolves to the list of accounts and pagination metadata
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Fetch the first page of accounts
|
|
25
|
+
* const firstPage = await client.listAccounts({
|
|
26
|
+
* signerAddress: "0x123...",
|
|
27
|
+
* limit: 10
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* // If an 'after' cursor exists, use it to fetch the next page
|
|
31
|
+
* const nextPage = await client.listAccounts({
|
|
32
|
+
* signerAddress: "0x123...",
|
|
33
|
+
* limit: 10,
|
|
34
|
+
* after: firstPage.meta.after
|
|
35
|
+
* });
|
|
36
|
+
*/
|
|
13
37
|
export async function listAccounts(
|
|
14
38
|
client: InnerWalletApiClient,
|
|
15
39
|
params: ListAccountsParams,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
import type {
|
|
8
8
|
PrepareCallsParams as IsomorphicPrepareCallsParams,
|
|
9
9
|
PrepareCallsResult as IsomorphicPrepareCallsResult,
|
|
10
|
-
} from "../../isomorphic/actions/prepareCalls";
|
|
11
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
10
|
+
} from "../../isomorphic/actions/prepareCalls.ts";
|
|
11
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
12
12
|
|
|
13
13
|
export type GetAccountParam<TAccount> =
|
|
14
14
|
IsUndefined<TAccount> extends true
|
|
@@ -24,6 +24,32 @@ export type PrepareCallsParams<
|
|
|
24
24
|
|
|
25
25
|
export type PrepareCallsResult = IsomorphicPrepareCallsResult;
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Prepares a set of contract calls for execution by building a user operation.
|
|
29
|
+
* Returns the built user operation and a signature request that needs to be signed
|
|
30
|
+
* before submitting to sendPreparedCalls.
|
|
31
|
+
*
|
|
32
|
+
* @param {InnerWalletApiClient<TAccount>} client - The wallet API client to use for the request
|
|
33
|
+
* @param {PrepareCallsParams<TAccount>} params - Parameters for preparing calls
|
|
34
|
+
* @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute
|
|
35
|
+
* @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)
|
|
36
|
+
* @param {object} [params.capabilities] - Optional capabilities to include with the request
|
|
37
|
+
* @returns {Promise<PrepareCallsResult>} A Promise that resolves to the prepared calls result containing
|
|
38
|
+
* the user operation data and signature request
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Prepare a sponosored user operation call
|
|
42
|
+
* const result = await client.prepareCalls({
|
|
43
|
+
* calls: [{
|
|
44
|
+
* to: "0x1234...",
|
|
45
|
+
* data: "0xabcdef...",
|
|
46
|
+
* value: "0x0"
|
|
47
|
+
* }],
|
|
48
|
+
* capabilities: {
|
|
49
|
+
* paymasterService: { policyId: "your-policy-id" }
|
|
50
|
+
* }
|
|
51
|
+
* });
|
|
52
|
+
*/
|
|
27
53
|
export async function prepareCalls<
|
|
28
54
|
TAccount extends JsonRpcAccount<Address> | undefined =
|
|
29
55
|
| JsonRpcAccount<Address>
|