@account-kit/wallet-client 0.1.0-alpha.3 → 0.1.0-alpha.4

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.
@@ -1,8 +1,8 @@
1
1
  import type { SmartAccountSigner } from "@aa-sdk/core";
2
+ import type { AlchemyTransport } from "@account-kit/infra";
2
3
  import type { Address, Chain, IsUndefined, JsonRpcAccount, Prettify } from "viem";
3
4
  import type { InnerWalletApiClient } from "../types.ts";
4
5
  import { type SmartWalletActions } from "./decorator.js";
5
- import type { AlchemyTransport } from "@account-kit/infra";
6
6
  export type SmartWalletClientParams<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = Prettify<{
7
7
  transport: AlchemyTransport;
8
8
  chain: Chain;
@@ -14,5 +14,6 @@ export type SmartWalletClientParams<TAccount extends JsonRpcAccount<Address> | u
14
14
  } : {
15
15
  account: Address;
16
16
  })>;
17
- export declare function createSmartWalletClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(params: SmartWalletClientParams<TAccount>): InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
18
- export declare function createSmartWalletClient<TAccount extends JsonRpcAccount<Address> = JsonRpcAccount<Address>>(params: SmartWalletClientParams<TAccount>): InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
17
+ export type SmartWalletClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
18
+ export declare function createSmartWalletClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(params: SmartWalletClientParams<TAccount>): SmartWalletClient<TAccount>;
19
+ export declare function createSmartWalletClient<TAccount extends JsonRpcAccount<Address> = JsonRpcAccount<Address>>(params: SmartWalletClientParams<TAccount>): SmartWalletClient<TAccount>;
@@ -11,7 +11,7 @@ import { smartWalletClientActions, } from "./decorator.js";
11
11
  * @param {"local" | "remote"} params.mode - The client's mode (local or remote).
12
12
  * @param {string} [params.policyId] - The policy ID for gas sponsorship (optional)
13
13
  * @param {Address} [params.account] - The smart account address to use (optional)
14
- * @returns {InnerWalletApiClient & SmartWalletActions} - A viem-compatible client
14
+ * @returns {SmartWalletClient} - A viem-compatible client
15
15
  *
16
16
  * @example
17
17
  * import { LocalAccountSigner } from "@aa-sdk/core";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EACL,wBAAwB,GAEzB,MAAM,gBAAgB,CAAC;AAqCxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA+B;IAE/B,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAErE,MAAM,WAAW,GACf,IAAI,KAAK,OAAO;QACd,CAAC,CAAC,iBAAiB,CAAC;YAChB,SAAS;YACT,KAAK;YACL,QAAQ;YACR,OAAO;SACR,CAAC;QACJ,CAAC,CAAC,kBAAkB,CAAC;YACjB,SAAS;YACT,KAAK;YACL,QAAQ;YACR,OAAO;SACR,CAAC,CAAC;IAET,yCAAyC;IACzC,qDAAqD;IACrD,4JAA4J;IAC5J,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CACnC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CACzC,CAAC;AACJ,CAAC;AAED,iBAAiB;AACjB,yDAAyD;AACzD,2CAA2C;AAC3C,wBAAwB;AACxB,4CAA4C;AAC5C,mBAAmB;AACnB,MAAM;AAEN,gEAAgE;AAEhE,sDAAsD;AACtD,2CAA2C;AAC3C,wBAAwB;AACxB,4CAA4C;AAC5C,mBAAmB;AACnB,0BAA0B;AAC1B,MAAM;AAEN,6DAA6D","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type {\n Address,\n Chain,\n IsUndefined,\n JsonRpcAccount,\n Prettify,\n} from \"viem\";\nimport { createLocalClient } from \"../local/client.js\";\nimport { createRemoteClient } from \"../remote/client.js\";\nimport type { InnerWalletApiClient } from \"../types.ts\";\nimport {\n smartWalletClientActions,\n type SmartWalletActions,\n} from \"./decorator.js\";\nimport type { AlchemyTransport } from \"@account-kit/infra\";\n\nexport type SmartWalletClientParams<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n> = Prettify<\n {\n transport: AlchemyTransport;\n chain: Chain;\n signer: SmartAccountSigner;\n mode: \"local\" | \"remote\";\n policyId?: string;\n } & (IsUndefined<TAccount> extends true\n ? {\n account?: never;\n }\n : {\n account: Address;\n })\n>;\n\nexport function createSmartWalletClient<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n>(\n params: SmartWalletClientParams<TAccount>,\n): InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;\n\nexport function createSmartWalletClient<\n TAccount extends JsonRpcAccount<Address> = JsonRpcAccount<Address>,\n>(\n params: SmartWalletClientParams<TAccount>,\n): InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;\n\n/**\n * Creates a smart wallet client that can be used to interact with a smart account.\n *\n * @param {SmartWalletClientParams} params - The parameters for creating the smart wallet client\n * @param {AlchemyTransport} params.transport - The Alchemy transport to use\n * @param {Chain} params.chain - The chain to use\n * @param {SmartAccountSigner} params.signer - The signer to use for the smart account\n * @param {\"local\" | \"remote\"} params.mode - The client's mode (local or remote).\n * @param {string} [params.policyId] - The policy ID for gas sponsorship (optional)\n * @param {Address} [params.account] - The smart account address to use (optional)\n * @returns {InnerWalletApiClient & SmartWalletActions} - A viem-compatible client\n *\n * @example\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { alchemy, arbitrumSepolia } from \"@account-kit/infra\";\n * import { generatePrivateKey } from \"viem/accounts\";\n * import { createSmartWalletClient } from \"@account-kit/wallet-client\";\n *\n * const signer = LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey());\n * const transport = alchemy({\n * apiKey: \"your-alchemy-api-key\",\n * });\n * const client = createSmartWalletClient({\n * transport,\n * chain: arbitrumSepolia,\n * mode: \"remote\",\n * signer,\n * });\n */\nexport function createSmartWalletClient(\n params: SmartWalletClientParams,\n): InnerWalletApiClient & SmartWalletActions {\n const { transport, chain, policyId, mode, account, signer } = params;\n\n const innerClient =\n mode === \"local\"\n ? createLocalClient({\n transport,\n chain,\n policyId,\n account,\n })\n : createRemoteClient({\n transport,\n chain,\n policyId,\n account,\n });\n\n // TODO: we need to do a few things here:\n // 1. decorate the client with the wallet api actions\n // 2. potentially we might want to make this client async and have it use `requestAccount` so that it can create a SCA client with an account attached to it\n return innerClient.extend((client) =>\n smartWalletClientActions(client, signer),\n );\n}\n\n// Example usage:\n// const clientWithoutAccount = createSmartWalletClient({\n// transport: alchemy({ apiKey: \"123\" }),\n// chain: baseSepolia,\n// signer: createDummySigner(zeroAddress),\n// mode: \"local\",\n// });\n\n// const account1 = await clientWithoutAccount.requestAccount();\n\n// const clientWithAccount = createSmartWalletClient({\n// transport: alchemy({ apiKey: \"123\" }),\n// chain: baseSepolia,\n// signer: createDummySigner(zeroAddress),\n// mode: \"local\",\n// account: zeroAddress,\n// });\n\n// const account2 = await clientWithAccount.requestAccount();\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EACL,wBAAwB,GAEzB,MAAM,gBAAgB,CAAC;AAsCxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA+B;IAE/B,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAErE,MAAM,WAAW,GACf,IAAI,KAAK,OAAO;QACd,CAAC,CAAC,iBAAiB,CAAC;YAChB,SAAS;YACT,KAAK;YACL,QAAQ;YACR,OAAO;SACR,CAAC;QACJ,CAAC,CAAC,kBAAkB,CAAC;YACjB,SAAS;YACT,KAAK;YACL,QAAQ;YACR,OAAO;SACR,CAAC,CAAC;IAET,yCAAyC;IACzC,qDAAqD;IACrD,4JAA4J;IAC5J,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CACnC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CACzC,CAAC;AACJ,CAAC;AAED,iBAAiB;AACjB,yDAAyD;AACzD,2CAA2C;AAC3C,wBAAwB;AACxB,4CAA4C;AAC5C,mBAAmB;AACnB,MAAM;AAEN,gEAAgE;AAEhE,sDAAsD;AACtD,2CAA2C;AAC3C,wBAAwB;AACxB,4CAA4C;AAC5C,mBAAmB;AACnB,0BAA0B;AAC1B,MAAM;AAEN,6DAA6D","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { AlchemyTransport } from \"@account-kit/infra\";\nimport type {\n Address,\n Chain,\n IsUndefined,\n JsonRpcAccount,\n Prettify,\n} from \"viem\";\nimport { createLocalClient } from \"../local/client.js\";\nimport { createRemoteClient } from \"../remote/client.js\";\nimport type { InnerWalletApiClient } from \"../types.ts\";\nimport {\n smartWalletClientActions,\n type SmartWalletActions,\n} from \"./decorator.js\";\n\nexport type SmartWalletClientParams<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n> = Prettify<\n {\n transport: AlchemyTransport;\n chain: Chain;\n signer: SmartAccountSigner;\n mode: \"local\" | \"remote\";\n policyId?: string;\n } & (IsUndefined<TAccount> extends true\n ? {\n account?: never;\n }\n : {\n account: Address;\n })\n>;\n\nexport type SmartWalletClient<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n> = InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;\n\nexport function createSmartWalletClient<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n>(params: SmartWalletClientParams<TAccount>): SmartWalletClient<TAccount>;\n\nexport function createSmartWalletClient<\n TAccount extends JsonRpcAccount<Address> = JsonRpcAccount<Address>,\n>(params: SmartWalletClientParams<TAccount>): SmartWalletClient<TAccount>;\n\n/**\n * Creates a smart wallet client that can be used to interact with a smart account.\n *\n * @param {SmartWalletClientParams} params - The parameters for creating the smart wallet client\n * @param {AlchemyTransport} params.transport - The Alchemy transport to use\n * @param {Chain} params.chain - The chain to use\n * @param {SmartAccountSigner} params.signer - The signer to use for the smart account\n * @param {\"local\" | \"remote\"} params.mode - The client's mode (local or remote).\n * @param {string} [params.policyId] - The policy ID for gas sponsorship (optional)\n * @param {Address} [params.account] - The smart account address to use (optional)\n * @returns {SmartWalletClient} - A viem-compatible client\n *\n * @example\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { alchemy, arbitrumSepolia } from \"@account-kit/infra\";\n * import { generatePrivateKey } from \"viem/accounts\";\n * import { createSmartWalletClient } from \"@account-kit/wallet-client\";\n *\n * const signer = LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey());\n * const transport = alchemy({\n * apiKey: \"your-alchemy-api-key\",\n * });\n * const client = createSmartWalletClient({\n * transport,\n * chain: arbitrumSepolia,\n * mode: \"remote\",\n * signer,\n * });\n */\nexport function createSmartWalletClient(\n params: SmartWalletClientParams,\n): SmartWalletClient {\n const { transport, chain, policyId, mode, account, signer } = params;\n\n const innerClient =\n mode === \"local\"\n ? createLocalClient({\n transport,\n chain,\n policyId,\n account,\n })\n : createRemoteClient({\n transport,\n chain,\n policyId,\n account,\n });\n\n // TODO: we need to do a few things here:\n // 1. decorate the client with the wallet api actions\n // 2. potentially we might want to make this client async and have it use `requestAccount` so that it can create a SCA client with an account attached to it\n return innerClient.extend((client) =>\n smartWalletClientActions(client, signer),\n );\n}\n\n// Example usage:\n// const clientWithoutAccount = createSmartWalletClient({\n// transport: alchemy({ apiKey: \"123\" }),\n// chain: baseSepolia,\n// signer: createDummySigner(zeroAddress),\n// mode: \"local\",\n// });\n\n// const account1 = await clientWithoutAccount.requestAccount();\n\n// const clientWithAccount = createSmartWalletClient({\n// transport: alchemy({ apiKey: \"123\" }),\n// chain: baseSepolia,\n// signer: createDummySigner(zeroAddress),\n// mode: \"local\",\n// account: zeroAddress,\n// });\n\n// const account2 = await clientWithAccount.requestAccount();\n"]}
@@ -1,14 +1,14 @@
1
- export { createSmartWalletClient, type SmartWalletClientParams, } from "../client/index.js";
1
+ export { createSmartWalletClient, type SmartWalletClient, type SmartWalletClientParams, } from "../client/index.js";
2
2
  export { WalletServerRpcSchema, type WalletServerRpcSchemaType, type WalletServerViemRpcSchema, } from "../rpc/schema.js";
3
3
  export { Capabilities } from "../capabilities/index.js";
4
4
  export { PaymasterCapability } from "../capabilities/paymaster.js";
5
5
  export { PermissionsArray, PermissionsCapability, PermissionsContext, PermissionsData, } from "../capabilities/permissions/index.js";
6
6
  export { createAccount } from "../client/actions/createAccount.js";
7
7
  export { getCallsStatus } from "../client/actions/getCallsStatus.js";
8
+ export { grantPermissions } from "../client/actions/grantPermissions.js";
8
9
  export { listAccounts } from "../client/actions/listAccounts.js";
9
10
  export { prepareCalls } from "../client/actions/prepareCalls.js";
10
11
  export { requestAccount } from "../client/actions/requestAccount.js";
11
12
  export { signMessage } from "../client/actions/signMessage.js";
12
13
  export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
13
14
  export { signTypedData } from "../client/actions/signTypedData.js";
14
- export { grantPermissions } from "../client/actions/grantPermissions.js";
@@ -9,11 +9,11 @@ export { PermissionsArray, PermissionsCapability, PermissionsContext, Permission
9
9
  // client actions
10
10
  export { createAccount } from "../client/actions/createAccount.js";
11
11
  export { getCallsStatus } from "../client/actions/getCallsStatus.js";
12
+ export { grantPermissions } from "../client/actions/grantPermissions.js";
12
13
  export { listAccounts } from "../client/actions/listAccounts.js";
13
14
  export { prepareCalls } from "../client/actions/prepareCalls.js";
14
15
  export { requestAccount } from "../client/actions/requestAccount.js";
15
16
  export { signMessage } from "../client/actions/signMessage.js";
16
17
  export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
17
18
  export { signTypedData } from "../client/actions/signTypedData.js";
18
- export { grantPermissions } from "../client/actions/grantPermissions.js";
19
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,yDAAyD;AACzD,OAAO,EACL,uBAAuB,GAExB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,GAGtB,MAAM,kBAAkB,CAAC;AAE1B,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,iBAAiB;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC","sourcesContent":["// TODO: anything that we want to expose publicly should be exported from `index.ts` files in the subdirectories\n// and we shouldn't export * for the sake of tree-shaking\nexport {\n createSmartWalletClient,\n type SmartWalletClientParams,\n} from \"../client/index.js\";\n\nexport {\n WalletServerRpcSchema,\n type WalletServerRpcSchemaType,\n type WalletServerViemRpcSchema,\n} from \"../rpc/schema.js\";\n\n// capabilities: TODO: should these actually just have the types exported?\nexport { Capabilities } from \"../capabilities/index.js\";\nexport { PaymasterCapability } from \"../capabilities/paymaster.js\";\nexport {\n PermissionsArray,\n PermissionsCapability,\n PermissionsContext,\n PermissionsData,\n} from \"../capabilities/permissions/index.js\";\n\n// client actions\nexport { createAccount } from \"../client/actions/createAccount.js\";\nexport { getCallsStatus } from \"../client/actions/getCallsStatus.js\";\nexport { listAccounts } from \"../client/actions/listAccounts.js\";\nexport { prepareCalls } from \"../client/actions/prepareCalls.js\";\nexport { requestAccount } from \"../client/actions/requestAccount.js\";\nexport { signMessage } from \"../client/actions/signMessage.js\";\nexport { signSignatureRequest } from \"../client/actions/signSignatureRequest.js\";\nexport { signTypedData } from \"../client/actions/signTypedData.js\";\nexport { grantPermissions } from \"../client/actions/grantPermissions.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,yDAAyD;AACzD,OAAO,EACL,uBAAuB,GAGxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,GAGtB,MAAM,kBAAkB,CAAC;AAE1B,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,iBAAiB;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["// TODO: anything that we want to expose publicly should be exported from `index.ts` files in the subdirectories\n// and we shouldn't export * for the sake of tree-shaking\nexport {\n createSmartWalletClient,\n type SmartWalletClient,\n type SmartWalletClientParams,\n} from \"../client/index.js\";\n\nexport {\n WalletServerRpcSchema,\n type WalletServerRpcSchemaType,\n type WalletServerViemRpcSchema,\n} from \"../rpc/schema.js\";\n\n// capabilities: TODO: should these actually just have the types exported?\nexport { Capabilities } from \"../capabilities/index.js\";\nexport { PaymasterCapability } from \"../capabilities/paymaster.js\";\nexport {\n PermissionsArray,\n PermissionsCapability,\n PermissionsContext,\n PermissionsData,\n} from \"../capabilities/permissions/index.js\";\n\n// client actions\nexport { createAccount } from \"../client/actions/createAccount.js\";\nexport { getCallsStatus } from \"../client/actions/getCallsStatus.js\";\nexport { grantPermissions } from \"../client/actions/grantPermissions.js\";\nexport { listAccounts } from \"../client/actions/listAccounts.js\";\nexport { prepareCalls } from \"../client/actions/prepareCalls.js\";\nexport { requestAccount } from \"../client/actions/requestAccount.js\";\nexport { signMessage } from \"../client/actions/signMessage.js\";\nexport { signSignatureRequest } from \"../client/actions/signSignatureRequest.js\";\nexport { signTypedData } from \"../client/actions/signTypedData.js\";\n"]}
@@ -1,8 +1,8 @@
1
1
  import type { SmartAccountSigner } from "@aa-sdk/core";
2
+ import type { AlchemyTransport } from "@account-kit/infra";
2
3
  import type { Address, Chain, IsUndefined, JsonRpcAccount, Prettify } from "viem";
3
4
  import type { InnerWalletApiClient } from "../types.ts";
4
5
  import { type SmartWalletActions } from "./decorator.js";
5
- import type { AlchemyTransport } from "@account-kit/infra";
6
6
  export type SmartWalletClientParams<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = Prettify<{
7
7
  transport: AlchemyTransport;
8
8
  chain: Chain;
@@ -14,6 +14,7 @@ export type SmartWalletClientParams<TAccount extends JsonRpcAccount<Address> | u
14
14
  } : {
15
15
  account: Address;
16
16
  })>;
17
- export declare function createSmartWalletClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(params: SmartWalletClientParams<TAccount>): InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
18
- export declare function createSmartWalletClient<TAccount extends JsonRpcAccount<Address> = JsonRpcAccount<Address>>(params: SmartWalletClientParams<TAccount>): InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
17
+ export type SmartWalletClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined> = InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
18
+ export declare function createSmartWalletClient<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(params: SmartWalletClientParams<TAccount>): SmartWalletClient<TAccount>;
19
+ export declare function createSmartWalletClient<TAccount extends JsonRpcAccount<Address> = JsonRpcAccount<Address>>(params: SmartWalletClientParams<TAccount>): SmartWalletClient<TAccount>;
19
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAA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AuB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAE1E,wBAAgB,uBAAuB,CACrC,QAAQ,SAAS,cAAc,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,EAClE,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,15 +1,15 @@
1
- export { createSmartWalletClient, type SmartWalletClientParams, } from "../client/index.js";
1
+ export { createSmartWalletClient, type SmartWalletClient, type SmartWalletClientParams, } from "../client/index.js";
2
2
  export { WalletServerRpcSchema, type WalletServerRpcSchemaType, type WalletServerViemRpcSchema, } from "../rpc/schema.js";
3
3
  export { Capabilities } from "../capabilities/index.js";
4
4
  export { PaymasterCapability } from "../capabilities/paymaster.js";
5
5
  export { PermissionsArray, PermissionsCapability, PermissionsContext, PermissionsData, } from "../capabilities/permissions/index.js";
6
6
  export { createAccount } from "../client/actions/createAccount.js";
7
7
  export { getCallsStatus } from "../client/actions/getCallsStatus.js";
8
+ export { grantPermissions } from "../client/actions/grantPermissions.js";
8
9
  export { listAccounts } from "../client/actions/listAccounts.js";
9
10
  export { prepareCalls } from "../client/actions/prepareCalls.js";
10
11
  export { requestAccount } from "../client/actions/requestAccount.js";
11
12
  export { signMessage } from "../client/actions/signMessage.js";
12
13
  export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
13
14
  export { signTypedData } from "../client/actions/signTypedData.js";
14
- export { grantPermissions } from "../client/actions/grantPermissions.js";
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GAC/B,MAAM,kBA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;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC"}
package/package.json CHANGED
@@ -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.3",
5
+ "version": "0.1.0-alpha.4",
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",
@@ -70,5 +70,5 @@
70
70
  "access": "public",
71
71
  "registry": "https://registry.npmjs.org/"
72
72
  },
73
- "gitHead": "017c20b3777d96b1b4ab6f01385725aa2689416a"
73
+ "gitHead": "6c48e2daee9d8cc82ef179745d816994a359912d"
74
74
  }
@@ -1,4 +1,5 @@
1
1
  import type { SmartAccountSigner } from "@aa-sdk/core";
2
+ import type { AlchemyTransport } from "@account-kit/infra";
2
3
  import type {
3
4
  Address,
4
5
  Chain,
@@ -13,7 +14,6 @@ import {
13
14
  smartWalletClientActions,
14
15
  type SmartWalletActions,
15
16
  } from "./decorator.js";
16
- import type { AlchemyTransport } from "@account-kit/infra";
17
17
 
18
18
  export type SmartWalletClientParams<
19
19
  TAccount extends JsonRpcAccount<Address> | undefined =
@@ -35,19 +35,21 @@ export type SmartWalletClientParams<
35
35
  })
36
36
  >;
37
37
 
38
+ export type SmartWalletClient<
39
+ TAccount extends JsonRpcAccount<Address> | undefined =
40
+ | JsonRpcAccount<Address>
41
+ | undefined,
42
+ > = InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
43
+
38
44
  export function createSmartWalletClient<
39
45
  TAccount extends JsonRpcAccount<Address> | undefined =
40
46
  | JsonRpcAccount<Address>
41
47
  | undefined,
42
- >(
43
- params: SmartWalletClientParams<TAccount>,
44
- ): InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
48
+ >(params: SmartWalletClientParams<TAccount>): SmartWalletClient<TAccount>;
45
49
 
46
50
  export function createSmartWalletClient<
47
51
  TAccount extends JsonRpcAccount<Address> = JsonRpcAccount<Address>,
48
- >(
49
- params: SmartWalletClientParams<TAccount>,
50
- ): InnerWalletApiClient<TAccount> & SmartWalletActions<TAccount>;
52
+ >(params: SmartWalletClientParams<TAccount>): SmartWalletClient<TAccount>;
51
53
 
52
54
  /**
53
55
  * Creates a smart wallet client that can be used to interact with a smart account.
@@ -59,7 +61,7 @@ export function createSmartWalletClient<
59
61
  * @param {"local" | "remote"} params.mode - The client's mode (local or remote).
60
62
  * @param {string} [params.policyId] - The policy ID for gas sponsorship (optional)
61
63
  * @param {Address} [params.account] - The smart account address to use (optional)
62
- * @returns {InnerWalletApiClient & SmartWalletActions} - A viem-compatible client
64
+ * @returns {SmartWalletClient} - A viem-compatible client
63
65
  *
64
66
  * @example
65
67
  * import { LocalAccountSigner } from "@aa-sdk/core";
@@ -80,7 +82,7 @@ export function createSmartWalletClient<
80
82
  */
81
83
  export function createSmartWalletClient(
82
84
  params: SmartWalletClientParams,
83
- ): InnerWalletApiClient & SmartWalletActions {
85
+ ): SmartWalletClient {
84
86
  const { transport, chain, policyId, mode, account, signer } = params;
85
87
 
86
88
  const innerClient =
@@ -2,6 +2,7 @@
2
2
  // and we shouldn't export * for the sake of tree-shaking
3
3
  export {
4
4
  createSmartWalletClient,
5
+ type SmartWalletClient,
5
6
  type SmartWalletClientParams,
6
7
  } from "../client/index.js";
7
8
 
@@ -24,10 +25,10 @@ export {
24
25
  // client actions
25
26
  export { createAccount } from "../client/actions/createAccount.js";
26
27
  export { getCallsStatus } from "../client/actions/getCallsStatus.js";
28
+ export { grantPermissions } from "../client/actions/grantPermissions.js";
27
29
  export { listAccounts } from "../client/actions/listAccounts.js";
28
30
  export { prepareCalls } from "../client/actions/prepareCalls.js";
29
31
  export { requestAccount } from "../client/actions/requestAccount.js";
30
32
  export { signMessage } from "../client/actions/signMessage.js";
31
33
  export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
32
34
  export { signTypedData } from "../client/actions/signTypedData.js";
33
- export { grantPermissions } from "../client/actions/grantPermissions.js";