@account-kit/wallet-client 0.1.0-alpha.1 → 0.1.0-alpha.3
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/capabilities/index.d.ts +5 -2
- package/dist/esm/capabilities/index.js +1 -1
- package/dist/esm/capabilities/index.js.map +1 -1
- package/dist/esm/capabilities/overrides.js +8 -8
- package/dist/esm/capabilities/overrides.js.map +1 -1
- package/dist/esm/capabilities/permissions/index.d.ts +10 -3
- package/dist/esm/capabilities/permissions/index.js +11 -2
- package/dist/esm/capabilities/permissions/index.js.map +1 -1
- package/dist/esm/capabilities/permissions/mav2.d.ts +3 -3
- package/dist/esm/capabilities/permissions/mav2.js +9 -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 +114 -2
- package/dist/esm/client/actions/grantPermissions.js +1 -0
- 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 +21 -2
- package/dist/esm/client/actions/requestAccount.js +15 -4
- 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 +22 -2
- package/dist/esm/client/actions/signMessage.js +4 -2
- package/dist/esm/client/actions/signMessage.js.map +1 -1
- package/dist/esm/client/actions/signSignatureRequest.d.ts +34 -0
- package/dist/esm/client/actions/signSignatureRequest.js +22 -1
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/client/actions/signTypedData.d.ts +35 -2
- package/dist/esm/client/actions/signTypedData.js +3 -1
- package/dist/esm/client/actions/signTypedData.js.map +1 -1
- package/dist/esm/client/client.e2e-test.js +112 -30
- package/dist/esm/client/client.e2e-test.js.map +1 -1
- package/dist/esm/client/decorator.d.ts +7 -5
- package/dist/esm/client/decorator.js +1 -1
- package/dist/esm/client/decorator.js.map +1 -1
- package/dist/esm/client/index.d.ts +4 -4
- package/dist/esm/client/index.js +29 -3
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/exports/index.d.ts +1 -0
- package/dist/esm/exports/index.js +1 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/internal.d.ts +1 -1
- 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.js +25 -7
- package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
- package/dist/esm/isomorphic/actions/prepareCalls.js +35 -12
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +26 -6
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/isomorphic/client.d.ts +11 -5
- package/dist/esm/isomorphic/utils/7702.d.ts +11 -0
- package/dist/esm/isomorphic/utils/7702.js +26 -0
- package/dist/esm/isomorphic/utils/7702.js.map +1 -0
- package/dist/esm/isomorphic/utils/createAccount.d.ts +2 -1
- package/dist/esm/isomorphic/utils/createAccount.js +30 -5
- package/dist/esm/isomorphic/utils/createAccount.js.map +1 -1
- package/dist/esm/isomorphic/utils/createDummySigner.js +3 -3
- package/dist/esm/isomorphic/utils/createDummySigner.js.map +1 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +2 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js +17 -5
- 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 +10 -2
- package/dist/esm/local/client.js.map +1 -1
- package/dist/esm/remote/client.d.ts +1 -1
- package/dist/esm/remote/client.js +12 -3
- package/dist/esm/remote/client.js.map +1 -1
- package/dist/esm/rpc/examples.d.ts +230 -0
- package/dist/esm/rpc/examples.js +314 -0
- package/dist/esm/rpc/examples.js.map +1 -0
- package/dist/esm/rpc/request.d.ts +48 -17
- package/dist/esm/rpc/request.js +53 -14
- package/dist/esm/rpc/request.js.map +1 -1
- package/dist/esm/rpc/schema.d.ts +43 -12
- package/dist/esm/schemas.d.ts +29 -7
- package/dist/esm/schemas.js +120 -38
- package/dist/esm/schemas.js.map +1 -1
- package/dist/esm/types.d.ts +15 -4
- package/dist/esm/types.js.map +1 -1
- package/dist/types/capabilities/index.d.ts +5 -2
- package/dist/types/capabilities/index.d.ts.map +1 -1
- package/dist/types/capabilities/overrides.d.ts.map +1 -1
- package/dist/types/capabilities/permissions/index.d.ts +10 -3
- package/dist/types/capabilities/permissions/index.d.ts.map +1 -1
- package/dist/types/capabilities/permissions/mav2.d.ts +3 -3
- 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 +114 -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 +21 -2
- 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 +22 -2
- package/dist/types/client/actions/signMessage.d.ts.map +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts +34 -0
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/client/actions/signTypedData.d.ts +35 -2
- package/dist/types/client/actions/signTypedData.d.ts.map +1 -1
- package/dist/types/client/decorator.d.ts +7 -5
- package/dist/types/client/decorator.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +4 -4
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +1 -0
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/internal.d.ts +1 -1
- 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.map +1 -1
- package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/client.d.ts +11 -5
- package/dist/types/isomorphic/client.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/7702.d.ts +12 -0
- package/dist/types/isomorphic/utils/7702.d.ts.map +1 -0
- package/dist/types/isomorphic/utils/createAccount.d.ts +2 -1
- package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/createDummySigner.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +2 -1
- 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/examples.d.ts +231 -0
- package/dist/types/rpc/examples.d.ts.map +1 -0
- package/dist/types/rpc/request.d.ts +48 -17
- package/dist/types/rpc/request.d.ts.map +1 -1
- package/dist/types/rpc/schema.d.ts +43 -12
- package/dist/types/rpc/schema.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +29 -7
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/types.d.ts +15 -4
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +8 -6
- package/src/capabilities/index.ts +5 -8
- package/src/capabilities/overrides.ts +23 -8
- package/src/capabilities/permissions/index.ts +21 -5
- package/src/capabilities/permissions/mav2.ts +13 -3
- package/src/client/actions/createAccount.ts +27 -2
- package/src/client/actions/getCallsStatus.ts +21 -2
- package/src/client/actions/grantPermissions.ts +114 -2
- package/src/client/actions/listAccounts.ts +26 -2
- package/src/client/actions/prepareCalls.ts +28 -2
- package/src/client/actions/requestAccount.ts +41 -7
- package/src/client/actions/sendPreparedCalls.ts +39 -2
- package/src/client/actions/signMessage.ts +24 -4
- package/src/client/actions/signSignatureRequest.ts +61 -2
- package/src/client/actions/signTypedData.ts +39 -3
- package/src/client/client.e2e-test.ts +134 -32
- package/src/client/decorator.ts +10 -12
- package/src/client/index.ts +41 -10
- package/src/exports/index.ts +1 -0
- package/src/exports/internal.ts +1 -1
- package/src/internal/decorator.ts +12 -0
- package/src/isomorphic/actions/createSession.ts +28 -7
- package/src/isomorphic/actions/prepareCalls.ts +38 -11
- package/src/isomorphic/actions/sendPreparedCalls.ts +47 -20
- package/src/isomorphic/utils/7702.ts +58 -0
- package/src/isomorphic/utils/createAccount.ts +38 -6
- package/src/isomorphic/utils/createDummySigner.ts +3 -2
- package/src/isomorphic/utils/parsePermissionsContext.ts +23 -7
- package/src/local/client.ts +54 -45
- package/src/remote/client.ts +22 -7
- package/src/rpc/examples.ts +343 -0
- package/src/rpc/request.ts +75 -26
- package/src/schemas.ts +218 -87
- package/src/types.ts +18 -4
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AlchemyTransport } from \"@account-kit/infra\";\nimport type {\n Address,\n Chain,\n Client,\n Hex,\n IsUndefined,\n JsonRpcAccount,\n Transport,\n} from \"viem\";\nimport type {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SmartAccountSigner, SmartContractAccount } from \"@aa-sdk/core\";\nimport type { AlchemyTransport } from \"@account-kit/infra\";\nimport type {\n Address,\n Chain,\n Client,\n Hex,\n IsUndefined,\n JsonRpcAccount,\n Transport,\n} from \"viem\";\nimport type {\n GrantPermissionsParams,\n GrantPermissionsResult,\n} from \"./client/actions/grantPermissions.ts\";\nimport type { RequestAccountParams } from \"./client/actions/requestAccount.ts\";\nimport type { WalletServerViemRpcSchema } from \"./rpc/schema.ts\";\n\nexport type CreateInnerClientParams<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n> = {\n chain: Chain;\n transport: AlchemyTransport;\n policyId?: string;\n} & (IsUndefined<TAccount> extends true\n ? {\n account?: never;\n }\n : {\n account: Address;\n });\n\nexport type InnerWalletApiClientBase<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n TExtend extends { [key: string]: unknown } | undefined =\n | { [key: string]: unknown }\n | undefined,\n> = Client<\n Transport,\n Chain,\n TAccount,\n WalletServerViemRpcSchema,\n { policyId?: string } & TExtend\n>;\n\nexport type InnerClientActions = {\n grantPermissions: (\n signer: SmartAccountSigner,\n params: GrantPermissionsParams & { chainId: Hex },\n ) => Promise<GrantPermissionsResult>;\n};\n\nexport type CachedAccount = {\n account: SmartContractAccount;\n requestParams: RequestAccountParams;\n};\n\nexport type InternalState = {\n setAccount: (account: CachedAccount) => void;\n getAccount: () => CachedAccount | undefined;\n};\n\nexport type InnerWalletApiClient<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n> = InnerWalletApiClientBase<\n TAccount,\n InnerClientActions & { internal: InternalState }\n>;\n"]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export declare const Capabilities: import("@sinclair/typebox").TObject<{
|
|
2
|
-
permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
2
|
+
permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
3
3
|
context: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
4
|
-
}
|
|
4
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
5
|
+
sessionId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
6
|
+
signature: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
7
|
+
}>]>>;
|
|
5
8
|
paymasterService: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
6
9
|
policyId: import("@sinclair/typebox").TString;
|
|
7
10
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/capabilities/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/capabilities/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../../src/capabilities/overrides.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;
|
|
1
|
+
{"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../../src/capabilities/overrides.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;EAGtB,CAAC;AAGF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;EAyBvC,CAAC"}
|
|
@@ -84,9 +84,13 @@ export declare const PermissionsArray: import("@sinclair/typebox").TArray<import
|
|
|
84
84
|
export declare const PermissionsContext: TObject<{
|
|
85
85
|
context: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
86
86
|
}>;
|
|
87
|
+
export declare const RemotePermission: TObject<{
|
|
88
|
+
sessionId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
89
|
+
signature: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
90
|
+
}>;
|
|
87
91
|
export declare const PermissionsData: TObject<{
|
|
88
92
|
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
89
|
-
expiry: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
|
93
|
+
expiry: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
90
94
|
key: TObject<{
|
|
91
95
|
type: import("@sinclair/typebox").TUnion<[TLiteral<"secp256k1">, TLiteral<"contract">]>;
|
|
92
96
|
publicKey: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
@@ -133,7 +137,10 @@ export declare const PermissionsData: TObject<{
|
|
|
133
137
|
data: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
134
138
|
}>]>>;
|
|
135
139
|
}>;
|
|
136
|
-
export declare const PermissionsCapability: TObject<{
|
|
140
|
+
export declare const PermissionsCapability: import("@sinclair/typebox").TUnion<[TObject<{
|
|
137
141
|
context: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
138
|
-
}
|
|
142
|
+
}>, TObject<{
|
|
143
|
+
sessionId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
144
|
+
signature: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
145
|
+
}>]>;
|
|
139
146
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/permissions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,OAAO,EAEb,MAAM,mBAAmB,CAAC;AAwG3B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C,CAAC;AAE5E,eAAO,MAAM,kBAAkB;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/permissions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,OAAO,EAEb,MAAM,mBAAmB,CAAC;AAwG3B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C,CAAC;AAE5E,eAAO,MAAM,kBAAkB;;EAO9B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;EAQ5B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK1B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;IAKhC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Static } from "@sinclair/typebox";
|
|
2
2
|
import { type Hex } from "viem";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { KeySigner } from "../../schemas.ts";
|
|
4
|
+
import type { PermissionsCapability, PermissionsData } from "./index.ts";
|
|
5
5
|
export declare const SESSION_ID_LENGTH_BYTES = 16;
|
|
6
6
|
export declare const ENTITY_ID_LENGTH_BYTES = 4;
|
|
7
7
|
export declare const PermissionsContextVersion: {
|
|
@@ -30,7 +30,7 @@ type DecodedPermissionsContext = {
|
|
|
30
30
|
isGlobalValidation: boolean;
|
|
31
31
|
});
|
|
32
32
|
export declare const encodePermissionsContext: (context: DecodedPermissionsContext) => Hex;
|
|
33
|
-
export declare const decodePermissionsContext: (
|
|
33
|
+
export declare const decodePermissionsContext: (capability: Static<typeof PermissionsCapability>) => DecodedPermissionsContext;
|
|
34
34
|
export declare const prefixSignatureKeyType: (sig: Hex, type: KeySigner["type"]) => Hex;
|
|
35
35
|
export declare const isGlobalValidation: (data: Pick<Static<typeof PermissionsData>, "permissions">) => boolean;
|
|
36
36
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mav2.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/permissions/mav2.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"mav2.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/permissions/mav2.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzE,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAKX,KAAK,yBAAyB,GAAG;IAC/B,cAAc,EAAE,MAAM,OAAO,yBAAyB,CAAC;CACxD,GAAG,CACA;IACE,cAAc,EAAE,6BAA6B,CAAC;IAC9C,SAAS,EAAE,GAAG,CAAC;IACf,SAAS,EAAE,GAAG,CAAC;IACf,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB,GACD;IACE,cAAc,EAAE,4BAA4B,CAAC;IAC7C,cAAc,EAAE,GAAG,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GACD;IACE,cAAc,EAAE,qBAAqB,CAAC;IACtC,cAAc,CAAC,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CACJ,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,SAAS,yBAAyB,KACjC,GAsBF,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,YAAY,MAAM,CAAC,OAAO,qBAAqB,CAAC,KAC/C,yBA4CF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,KAAK,GAAG,EACR,MAAM,SAAS,CAAC,MAAM,CAAC,KACtB,GASF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,EAAE,aAAa,CAAC,KACxD,OAEF,CAAC"}
|
|
@@ -1,11 +1,36 @@
|
|
|
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
|
export type CreateAccountParams = Omit<Extract<Static<typeof wallet_createAccount>["Request"]["params"][0], {
|
|
7
7
|
signerAddress: Address;
|
|
8
8
|
}>, "signerAddress">;
|
|
9
9
|
export type CreateAccountResult = Static<typeof wallet_createAccount>["ReturnType"];
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new account for the provided signer using the wallet API client.
|
|
12
|
+
* This method is primarily used to import existing accounts.
|
|
13
|
+
* For most cases, you should use requestAccount instead.
|
|
14
|
+
* If the account already exists, an error will be thrown.
|
|
15
|
+
*
|
|
16
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
17
|
+
* @param {SmartAccountSigner} signer - The signer that will be associated with the account
|
|
18
|
+
* @param {CreateAccountParams} params - Parameters for creating the account
|
|
19
|
+
* @param {string} [params.id] - Optional UUID v4 identifier for the account
|
|
20
|
+
* @param {object} params.creationOptions - Options for account creation
|
|
21
|
+
* @param {string} [params.creationOptions.accountType] - Currently only "sma-b" (Modular Account v2) is supported
|
|
22
|
+
* @param {string} [params.creationOptions.salt] - Optional hex string to use as salt for account creation
|
|
23
|
+
* @returns {Promise<CreateAccountResult>} A Promise that resolves to the created account information
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Create a new account with a custom salt
|
|
27
|
+
* const account = await client.createAccount({
|
|
28
|
+
* creationOptions: {
|
|
29
|
+
* accountType: "sma-b",
|
|
30
|
+
* salt: "0x04"
|
|
31
|
+
* }
|
|
32
|
+
* });
|
|
33
|
+
* console.log(`Created account at address: ${account.accountAddress}`);
|
|
34
|
+
*/
|
|
10
35
|
export declare function createAccount(client: InnerWalletApiClient, signer: SmartAccountSigner, params: CreateAccountParams): Promise<CreateAccountResult>;
|
|
11
36
|
//# sourceMappingURL=createAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAccount.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/createAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"createAccount.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/createAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,OAAO,CACL,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC3D;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,CAC3B,EACD,eAAe,CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC,OAAO,oBAAoB,CAC5B,CAAC,YAAY,CAAC,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAK9B"}
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import type { Address, JsonRpcAccount } from "viem";
|
|
2
|
-
import type { GetCallsStatusParams as IsomorphicGetCallsStatusParams, GetCallsStatusResponse as IsomorphicGetCallsStatusResult } from "../../isomorphic/actions/getCallsStatus";
|
|
3
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
2
|
+
import type { GetCallsStatusParams as IsomorphicGetCallsStatusParams, GetCallsStatusResponse as IsomorphicGetCallsStatusResult } from "../../isomorphic/actions/getCallsStatus.ts";
|
|
3
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
4
4
|
export type GetCallsStatusParams = IsomorphicGetCallsStatusParams;
|
|
5
5
|
export type GetCallsStatusResult = IsomorphicGetCallsStatusResult;
|
|
6
|
+
/**
|
|
7
|
+
* Gets the status of a prepared call by its ID.
|
|
8
|
+
* This method is used to check the execution status of calls sent via sendPreparedCalls.
|
|
9
|
+
*
|
|
10
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
11
|
+
* @param {GetCallsStatusParams} params - The ID of the prepared call to check
|
|
12
|
+
* @returns {Promise<GetCallsStatusResult>} A Promise that resolves to the status information including:
|
|
13
|
+
* - id: The hex ID of the call
|
|
14
|
+
* - chainId: The chain ID in hex format
|
|
15
|
+
* - status: The current status of the batch execution
|
|
16
|
+
* - receipts: Optional array of transaction receipts if the batch has been executed
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // After sending prepared calls
|
|
20
|
+
* const sendResult = await client.sendPreparedCalls({...});
|
|
21
|
+
*
|
|
22
|
+
* // Check the status of the first call ID
|
|
23
|
+
* const status = await client.getCallsStatus(sendResult.preparedCallIds[0]);
|
|
24
|
+
*/
|
|
6
25
|
export declare function getCallsStatus<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(client: InnerWalletApiClient<TAccount>, params: GetCallsStatusParams): Promise<GetCallsStatusResult>;
|
|
7
26
|
//# sourceMappingURL=getCallsStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCallsStatus.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/getCallsStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,EACV,oBAAoB,IAAI,8BAA8B,EACtD,sBAAsB,IAAI,8BAA8B,EACzD,MAAM,
|
|
1
|
+
{"version":3,"file":"getCallsStatus.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/getCallsStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,EACV,oBAAoB,IAAI,8BAA8B,EACtD,sBAAsB,IAAI,8BAA8B,EACzD,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AAElE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAClC,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,EAEb,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EACtC,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type Address, type Hex, type IsUndefined, type JsonRpcAccount } from "viem";
|
|
2
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
2
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
3
3
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
4
|
-
import type { CreateSessionParams } from "../../isomorphic/actions/createSession";
|
|
4
|
+
import type { CreateSessionParams } from "../../isomorphic/actions/createSession.ts";
|
|
5
|
+
import { TypeEip7702AuthExtendedFields } from "../../schemas.js";
|
|
6
|
+
import type { Static } from "@sinclair/typebox";
|
|
5
7
|
export type GrantPermissionsParams<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = Omit<CreateSessionParams, "account" | "chainId"> & (IsUndefined<TAccount> extends true ? {
|
|
6
8
|
account: Address;
|
|
7
9
|
} : {
|
|
@@ -9,6 +11,116 @@ export type GrantPermissionsParams<TAccount extends JsonRpcAccount<Address> | un
|
|
|
9
11
|
});
|
|
10
12
|
export type GrantPermissionsResult = {
|
|
11
13
|
context: Hex;
|
|
14
|
+
signedAuthorization?: Static<typeof TypeEip7702AuthExtendedFields>;
|
|
12
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Grants permissions to a smart account by creating a session.
|
|
18
|
+
* This allows another key to perform operations on behalf of the account.
|
|
19
|
+
*
|
|
20
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
21
|
+
* @param {SmartAccountSigner} signer - The signer of the smart account
|
|
22
|
+
* @param {GrantPermissionsParams} params - The parameters for granting permissions
|
|
23
|
+
* @param {Address} [params.account] - The account address (required if client was not initialized with an account)
|
|
24
|
+
* @param {number} params.expiry - Unix timestamp when the permissions expire
|
|
25
|
+
* @param {object} params.key - The session key information
|
|
26
|
+
* @param {string} params.key.publicKey - The public key of the session key
|
|
27
|
+
* @param {string} params.key.type - The type of the key (e.g., "secp256k1")
|
|
28
|
+
* @param {Array} params.permissions - Array of permission objects defining what the session key can do
|
|
29
|
+
* @returns {Promise<GrantPermissionsResult>} A Promise that resolves to the result containing a context identifier
|
|
30
|
+
* @returns {Hex} result.context - A hex identifier for the granted permissions context
|
|
31
|
+
* @returns {Static<typeof TypeEip7702AuthExtendedFields>} result.signedAuthorization - The EIP-7702 authorization fields, if applicable
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* // Create a session key and grant root permissions
|
|
35
|
+
* const sessionKey = LocalAccountSigner.generatePrivateKeySigner();
|
|
36
|
+
* const account = await client.requestAccount();
|
|
37
|
+
*
|
|
38
|
+
* const permissions = await client.grantPermissions({
|
|
39
|
+
* account: account.address,
|
|
40
|
+
* expiry: Math.floor(Date.now() / 1000) + 60 * 60, // 1 hour from now
|
|
41
|
+
* key: {
|
|
42
|
+
* publicKey: await sessionKey.getAddress(),
|
|
43
|
+
* type: "secp256k1",
|
|
44
|
+
* },
|
|
45
|
+
* permissions: [{ type: "root" }],
|
|
46
|
+
* });
|
|
47
|
+
*
|
|
48
|
+
* // Use the permissions to prepare a call
|
|
49
|
+
* const preparedCall = await client.prepareCalls({
|
|
50
|
+
* calls: [{ to: zeroAddress, value: "0x0" }],
|
|
51
|
+
* from: account.address,
|
|
52
|
+
* capabilities: {
|
|
53
|
+
* paymasterService: {
|
|
54
|
+
* policyId: "your-paymaster-policy-id",
|
|
55
|
+
* },
|
|
56
|
+
* permissions,
|
|
57
|
+
* },
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* // Sign with the session key
|
|
61
|
+
* const signature = await signSignatureRequest(
|
|
62
|
+
* sessionKey,
|
|
63
|
+
* preparedCall.signatureRequest,
|
|
64
|
+
* );
|
|
65
|
+
*
|
|
66
|
+
* // Send the prepared call using the session key
|
|
67
|
+
* const result = await client.sendPreparedCalls({
|
|
68
|
+
* ...preparedCall,
|
|
69
|
+
* signature,
|
|
70
|
+
* capabilities: {
|
|
71
|
+
* permissions,
|
|
72
|
+
* },
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* // Create a session key and grant root permissions using a 7702 account
|
|
77
|
+
* const sessionKey = LocalAccountSigner.generatePrivateKeySigner();
|
|
78
|
+
* const account = await client.requestAccount({
|
|
79
|
+
* creationHint: {
|
|
80
|
+
* accountType: "7702",
|
|
81
|
+
* }
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* const permissions = await client.grantPermissions({
|
|
85
|
+
* account: account.address,
|
|
86
|
+
* expiry: Math.floor(Date.now() / 1000) + 60 * 60, // 1 hour from now
|
|
87
|
+
* key: {
|
|
88
|
+
* publicKey: await sessionKey.getAddress(),
|
|
89
|
+
* type: "secp256k1",
|
|
90
|
+
* },
|
|
91
|
+
* permissions: [{ type: "root" }],
|
|
92
|
+
* });
|
|
93
|
+
*
|
|
94
|
+
* // Use the permissions to prepare a call
|
|
95
|
+
* const preparedCall = await client.prepareCalls({
|
|
96
|
+
* calls: [{ to: zeroAddress, value: "0x0" }],
|
|
97
|
+
* from: account.address,
|
|
98
|
+
* capabilities: {
|
|
99
|
+
* paymasterService: {
|
|
100
|
+
* policyId: "your-paymaster-policy-id",
|
|
101
|
+
* },
|
|
102
|
+
* permissions,
|
|
103
|
+
* },
|
|
104
|
+
* });
|
|
105
|
+
*
|
|
106
|
+
* // Sign with the session key
|
|
107
|
+
* // If the 7702 account delegation is not yet installed, the result
|
|
108
|
+
* // here will include a `signedAuthorization` field that that
|
|
109
|
+
* // must be included when sending the account's first call.
|
|
110
|
+
* const { signedAuthorization, ...signature} = await signSignatureRequest(
|
|
111
|
+
* sessionKey,
|
|
112
|
+
* preparedCall.signatureRequest,
|
|
113
|
+
* );
|
|
114
|
+
*
|
|
115
|
+
* // Send the prepared call using the session key
|
|
116
|
+
* const result = await client.sendPreparedCalls({
|
|
117
|
+
* ...preparedCall,
|
|
118
|
+
* signature,
|
|
119
|
+
* signedAuthorization,
|
|
120
|
+
* capabilities: {
|
|
121
|
+
* permissions,
|
|
122
|
+
* },
|
|
123
|
+
* });
|
|
124
|
+
*/
|
|
13
125
|
export declare function grantPermissions<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(client: InnerWalletApiClient<TAccount>, signer: SmartAccountSigner, params: GrantPermissionsParams<TAccount>): Promise<GrantPermissionsResult>;
|
|
14
126
|
//# sourceMappingURL=grantPermissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grantPermissions.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/grantPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"grantPermissions.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/grantPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,MAAM,sBAAsB,CAChC,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,IACX,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,SAAS,CAAC,GAClD,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAC/B;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GACpB;IAAE,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAE3B,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,GAAG,CAAC;IACb,mBAAmB,CAAC,EAAE,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;CACpE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4GG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,EAEb,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EACtC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,7 +1,31 @@
|
|
|
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
|
export type ListAccountsParams = Static<typeof wallet_listAccounts>["Request"]["params"][0];
|
|
5
5
|
export type ListAccountsResult = Static<typeof wallet_listAccounts>["ReturnType"];
|
|
6
|
+
/**
|
|
7
|
+
* Lists all smart accounts for a given signer using the wallet API client.
|
|
8
|
+
*
|
|
9
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
10
|
+
* @param {ListAccountsParams} params - Parameters for listing accounts
|
|
11
|
+
* @param {string} params.signerAddress - The address of the signer to list accounts for
|
|
12
|
+
* @param {number} [params.limit] - Optional maximum number of accounts to return (default: 100, max: 100)
|
|
13
|
+
* @param {string} [params.after] - Optional pagination cursor for fetching subsequent pages
|
|
14
|
+
* @returns {Promise<ListAccountsResult>} A Promise that resolves to the list of accounts and pagination metadata
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Fetch the first page of accounts
|
|
18
|
+
* const firstPage = await client.listAccounts({
|
|
19
|
+
* signerAddress: "0x123...",
|
|
20
|
+
* limit: 10
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // If an 'after' cursor exists, use it to fetch the next page
|
|
24
|
+
* const nextPage = await client.listAccounts({
|
|
25
|
+
* signerAddress: "0x123...",
|
|
26
|
+
* limit: 10,
|
|
27
|
+
* after: firstPage.meta.after
|
|
28
|
+
* });
|
|
29
|
+
*/
|
|
6
30
|
export declare function listAccounts(client: InnerWalletApiClient, params: ListAccountsParams): Promise<ListAccountsResult>;
|
|
7
31
|
//# sourceMappingURL=listAccounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listAccounts.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/listAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"listAccounts.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/listAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG,MAAM,CACrC,OAAO,mBAAmB,CAC3B,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1B,MAAM,MAAM,kBAAkB,GAAG,MAAM,CACrC,OAAO,mBAAmB,CAC3B,CAAC,YAAY,CAAC,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAE7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address, type IsUndefined, type JsonRpcAccount } from "viem";
|
|
2
|
-
import type { PrepareCallsParams as IsomorphicPrepareCallsParams, PrepareCallsResult as IsomorphicPrepareCallsResult } from "../../isomorphic/actions/prepareCalls";
|
|
3
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
2
|
+
import type { PrepareCallsParams as IsomorphicPrepareCallsParams, PrepareCallsResult as IsomorphicPrepareCallsResult } from "../../isomorphic/actions/prepareCalls.ts";
|
|
3
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
4
4
|
export type GetAccountParam<TAccount> = IsUndefined<TAccount> extends true ? {
|
|
5
5
|
account: Address;
|
|
6
6
|
} : {
|
|
@@ -12,5 +12,31 @@ export type PrepareCallsParams<TAccount extends JsonRpcAccount<Address> | undefi
|
|
|
12
12
|
from?: never;
|
|
13
13
|
});
|
|
14
14
|
export type PrepareCallsResult = IsomorphicPrepareCallsResult;
|
|
15
|
+
/**
|
|
16
|
+
* Prepares a set of contract calls for execution by building a user operation.
|
|
17
|
+
* Returns the built user operation and a signature request that needs to be signed
|
|
18
|
+
* before submitting to sendPreparedCalls.
|
|
19
|
+
*
|
|
20
|
+
* @param {InnerWalletApiClient<TAccount>} client - The wallet API client to use for the request
|
|
21
|
+
* @param {PrepareCallsParams<TAccount>} params - Parameters for preparing calls
|
|
22
|
+
* @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute
|
|
23
|
+
* @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)
|
|
24
|
+
* @param {object} [params.capabilities] - Optional capabilities to include with the request
|
|
25
|
+
* @returns {Promise<PrepareCallsResult>} A Promise that resolves to the prepared calls result containing
|
|
26
|
+
* the user operation data and signature request
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Prepare a sponosored user operation call
|
|
30
|
+
* const result = await client.prepareCalls({
|
|
31
|
+
* calls: [{
|
|
32
|
+
* to: "0x1234...",
|
|
33
|
+
* data: "0xabcdef...",
|
|
34
|
+
* value: "0x0"
|
|
35
|
+
* }],
|
|
36
|
+
* capabilities: {
|
|
37
|
+
* paymasterService: { policyId: "your-policy-id" }
|
|
38
|
+
* }
|
|
39
|
+
* });
|
|
40
|
+
*/
|
|
15
41
|
export declare function prepareCalls<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(client: InnerWalletApiClient<TAccount>, params: PrepareCallsParams<TAccount>): Promise<PrepareCallsResult>;
|
|
16
42
|
//# sourceMappingURL=prepareCalls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/prepareCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,kBAAkB,IAAI,4BAA4B,EAClD,kBAAkB,IAAI,4BAA4B,EACnD,MAAM,
|
|
1
|
+
{"version":3,"file":"prepareCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/prepareCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,kBAAkB,IAAI,4BAA4B,EAClD,kBAAkB,IAAI,4BAA4B,EACnD,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,MAAM,eAAe,CAAC,QAAQ,IAClC,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAC9B;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GACpB;IAAE,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE1B,MAAM,MAAM,kBAAkB,CAC5B,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,IACX,IAAI,CAAC,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC,GACxD,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAE9E,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAChC,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,EAEb,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EACtC,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GACnC,OAAO,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import type { Static } from "@sinclair/typebox";
|
|
3
3
|
import type { Address } from "abitype";
|
|
4
4
|
import { type IsUndefined, type JsonRpcAccount } from "viem";
|
|
@@ -6,7 +6,26 @@ import type { wallet_requestAccount } from "../../rpc/request.js";
|
|
|
6
6
|
import type { InnerWalletApiClient } from "../../types.js";
|
|
7
7
|
export type RequestAccountParams<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = IsUndefined<TAccount> extends true ? Omit<Extract<Static<typeof wallet_requestAccount>["Request"]["params"][0], {
|
|
8
8
|
signerAddress: Address;
|
|
9
|
-
}>, "signerAddress" | "includeCounterfactualInfo">
|
|
9
|
+
}>, "signerAddress" | "includeCounterfactualInfo"> & {
|
|
10
|
+
accountAddress?: Address;
|
|
11
|
+
} : never;
|
|
10
12
|
export type RequestAccountResult = SmartContractAccount;
|
|
13
|
+
/**
|
|
14
|
+
* Requests an account for the provided signer using the wallet API client.
|
|
15
|
+
* If an account already exists for the signer, it will always return that account unless a new ID is specified.
|
|
16
|
+
* If an account already exists, the creationHint will be ignored.
|
|
17
|
+
*
|
|
18
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
19
|
+
* @param {SmartAccountSigner} signer - The signer that will be associated with the account
|
|
20
|
+
* @param {RequestAccountParams} [params] - Optional parameters for requesting a specific account
|
|
21
|
+
* @param {string} [params.id] - Optional identifier for the account. If specified, a new account with this ID will be created even if one already exists for the signer
|
|
22
|
+
* @param {object} [params.creationHint] - Optional hints to guide account creation. These are ignored if an account already exists
|
|
23
|
+
* @returns {Promise<RequestAccountResult>} A Promise that resolves to a SmartContractAccount instance
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Request an account with default parameters using a local signer
|
|
27
|
+
* const signer = LocalAccountSigner.privateKeyToAccountSigner("0x...");
|
|
28
|
+
* const account = await client.requestAccount(signer);
|
|
29
|
+
*/
|
|
11
30
|
export declare function requestAccount<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(client: InnerWalletApiClient<TAccount>, signer: SmartAccountSigner, params?: RequestAccountParams<TAccount>): Promise<RequestAccountResult>;
|
|
12
31
|
//# sourceMappingURL=requestAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestAccount.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/requestAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"requestAccount.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/requestAccount.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,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAU,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,MAAM,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAG3D,MAAM,MAAM,oBAAoB,CAC9B,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,IAEb,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAC9B,IAAI,CACF,OAAO,CACL,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC5D;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,CAC3B,EACD,eAAe,GAAG,2BAA2B,CAC9C,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAChC,KAAK,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,EAEb,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EACtC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GACtC,OAAO,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,7 +1,44 @@
|
|
|
1
1
|
import type { Static, StaticDecode } from "@sinclair/typebox";
|
|
2
|
-
import type { wallet_sendPreparedCalls } from "../../rpc/request";
|
|
3
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
2
|
+
import type { wallet_sendPreparedCalls } from "../../rpc/request.ts";
|
|
3
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
4
4
|
export type SendPreparedCallsParams = Omit<StaticDecode<typeof wallet_sendPreparedCalls>["Request"]["params"][0], "chainId">;
|
|
5
5
|
export type SendPreparedCallsResult = Static<typeof wallet_sendPreparedCalls>["ReturnType"];
|
|
6
|
+
/**
|
|
7
|
+
* Sends prepared calls by submitting a signed user operation.
|
|
8
|
+
* This method is used after signing the signature request returned from prepareCalls.
|
|
9
|
+
*
|
|
10
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
11
|
+
* @param {SendPreparedCallsParams} params - Parameters for sending prepared calls
|
|
12
|
+
* @param {string} params.type - The user operation type ('user-operation-v060' or 'user-operation-v070')
|
|
13
|
+
* @param {object} params.data - The user operation data without signature
|
|
14
|
+
* @param {string} params.chainId - The chain ID in hex format
|
|
15
|
+
* @param {object} params.signature - The signature object
|
|
16
|
+
* @param {string} params.signature.type - The signature type (must be 'ecdsa')
|
|
17
|
+
* @param {string} params.signature.signature - The hex-encoded signature value
|
|
18
|
+
* @param {object} [params.capabilities] - Optional capabilities to include with the request
|
|
19
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the prepared call IDs
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // First prepare the calls
|
|
23
|
+
* const preparedCalls = await client.prepareCalls({
|
|
24
|
+
* calls: [{
|
|
25
|
+
* to: "0x1234...",
|
|
26
|
+
* data: "0xabcdef...",
|
|
27
|
+
* value: "0x0"
|
|
28
|
+
* }],
|
|
29
|
+
* capabilities: {
|
|
30
|
+
* paymasterService: { policyId: "your-policy-id" }
|
|
31
|
+
* }
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Sign the signature request using signSignatureRequest with your signer
|
|
35
|
+
* const signedRequest = await client.signSignatureRequest(preparedCalls.signatureRequest);
|
|
36
|
+
*
|
|
37
|
+
* // Then send the prepared calls with the signature
|
|
38
|
+
* const result = await client.sendPreparedCalls({
|
|
39
|
+
* ...preparedCalls,
|
|
40
|
+
* signature: signedRequest.signature,
|
|
41
|
+
* });
|
|
42
|
+
*/
|
|
6
43
|
export declare function sendPreparedCalls(client: InnerWalletApiClient, params: SendPreparedCallsParams): Promise<SendPreparedCallsResult>;
|
|
7
44
|
//# sourceMappingURL=sendPreparedCalls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendPreparedCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/sendPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sendPreparedCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/sendPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACrE,SAAS,CACV,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,OAAO,wBAAwB,CAChC,CAAC,YAAY,CAAC,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAKlC"}
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import { type Address, type Hex, type JsonRpcAccount, type SignableMessage } from "viem";
|
|
3
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
4
|
-
export type SignMessageParams =
|
|
3
|
+
import type { InnerWalletApiClient } from "../../types.ts";
|
|
4
|
+
export type SignMessageParams = {
|
|
5
|
+
message: SignableMessage;
|
|
6
|
+
account?: Address;
|
|
7
|
+
};
|
|
5
8
|
export type SignMessageResult = Hex;
|
|
9
|
+
/**
|
|
10
|
+
* Signs a message using the smart account.
|
|
11
|
+
* This method requests the account associated with the signer and uses it to sign the message.
|
|
12
|
+
*
|
|
13
|
+
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
14
|
+
* @param {SmartAccountSigner} signer - The signer of the smart account
|
|
15
|
+
* @param {SignableMessage} message - The message to sign
|
|
16
|
+
* @returns {Promise<SignMessageResult>} A Promise that resolves to the signed message as a hex string
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Sign a simple text message
|
|
20
|
+
* const signature = await client.signMessage("Hello, world!");
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Sign a raw hex message
|
|
24
|
+
* const signature = await client.signMessage({ raw: "0x48656c6c6f2c20776f726c6421" });
|
|
25
|
+
*/
|
|
6
26
|
export declare function signMessage<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(client: InnerWalletApiClient<TAccount>, signer: SmartAccountSigner, params: SignMessageParams): Promise<SignMessageResult>;
|
|
7
27
|
//# sourceMappingURL=signMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAG3D,MAAM,MAAM,iBAAiB,GAAG;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,OAAO,CAAC,GACvB,SAAS,EAEb,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EACtC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -2,10 +2,44 @@ import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
|
2
2
|
import type { Static } from "@sinclair/typebox";
|
|
3
3
|
import { type Hex } from "viem";
|
|
4
4
|
import { TypeSignatureRequest } from "../../schemas.js";
|
|
5
|
+
import type { Eip7702ExtendedFields } from "@aa-sdk/core";
|
|
5
6
|
export type SignSignatureRequestParams = Static<typeof TypeSignatureRequest>;
|
|
6
7
|
export type SignSignatureRequestResult = {
|
|
7
8
|
type: "ecdsa";
|
|
8
9
|
signature: Hex;
|
|
10
|
+
signedAuthorization?: Eip7702ExtendedFields["eip7702Auth"];
|
|
9
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Signs a signature request using the provided signer.
|
|
14
|
+
* This method handles different types of signature requests including personal_sign and eth_signTypedData_v4.
|
|
15
|
+
*
|
|
16
|
+
* @param {SmartAccountSigner} signer - The signer to use for signing the request
|
|
17
|
+
* @param {SignSignatureRequestParams} params - The signature request parameters
|
|
18
|
+
* @param {string} params.type - The type of signature request ('personal_sign', 'eth_signTypedData_v4', or 'signature_with_authorization')
|
|
19
|
+
* @param {any} params.data - The data to sign, format depends on the signature type
|
|
20
|
+
* @returns {Promise<SignSignatureRequestResult>} A Promise that resolves to the signature result
|
|
21
|
+
* @returns {string} result.type - The signature type (currently only 'ecdsa' is supported)
|
|
22
|
+
* @returns {Hex} result.signature - The hex-encoded signature
|
|
23
|
+
* @returns {Eip7702ExtendedFields["eip7702Auth"]} result.signedAuthorization - The signed EIP-7702 authorization, if applicable
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Sign a personal message
|
|
27
|
+
* const result = await client.signSignatureRequest({
|
|
28
|
+
* type: 'personal_sign',
|
|
29
|
+
* data: 'Hello, world!'
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Sign typed data (EIP-712)
|
|
34
|
+
* const result = await client.signSignatureRequest({
|
|
35
|
+
* type: 'eth_signTypedData_v4',
|
|
36
|
+
* data: {
|
|
37
|
+
* domain: { ... },
|
|
38
|
+
* types: { ... },
|
|
39
|
+
* primaryType: '...',
|
|
40
|
+
* message: { ... }
|
|
41
|
+
* }
|
|
42
|
+
* });
|
|
43
|
+
*/
|
|
10
44
|
export declare function signSignatureRequest(signer: SmartAccountSigner, params: SignSignatureRequestParams): Promise<SignSignatureRequestResult>;
|
|
11
45
|
//# sourceMappingURL=signSignatureRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signSignatureRequest.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signSignatureRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"signSignatureRequest.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signSignatureRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,GAAG,EAAS,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE7E,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,GAAG,CAAC;IACf,mBAAmB,CAAC,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAAC"}
|