@account-kit/wallet-client 4.75.1 → 4.75.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/client/actions/formatSign.d.ts +9 -4
- package/dist/esm/client/actions/formatSign.js.map +1 -1
- package/dist/esm/client/actions/getCallsStatus.d.ts +9 -4
- package/dist/esm/client/actions/getCallsStatus.js.map +1 -1
- package/dist/esm/client/actions/grantPermissions.d.ts +8 -3
- package/dist/esm/client/actions/grantPermissions.js.map +1 -1
- package/dist/esm/client/actions/listAccounts.d.ts +9 -4
- package/dist/esm/client/actions/listAccounts.js.map +1 -1
- package/dist/esm/client/actions/prepareCalls.d.ts +9 -4
- package/dist/esm/client/actions/prepareCalls.js.map +1 -1
- package/dist/esm/client/actions/prepareSign.d.ts +9 -4
- package/dist/esm/client/actions/prepareSign.js.map +1 -1
- package/dist/esm/client/actions/requestAccount.d.ts +8 -3
- package/dist/esm/client/actions/requestAccount.js.map +1 -1
- package/dist/esm/client/actions/sendPreparedCalls.d.ts +9 -4
- package/dist/esm/client/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/client/actions/signPreparedCalls.d.ts +8 -3
- package/dist/esm/client/actions/signPreparedCalls.js +0 -1
- package/dist/esm/client/actions/signPreparedCalls.js.map +1 -1
- package/dist/esm/client/actions/waitForCallsStatus.d.ts +2 -2
- package/dist/esm/experimental/actions/requestQuoteV0.d.ts +9 -4
- package/dist/esm/experimental/actions/requestQuoteV0.js.map +1 -1
- package/dist/esm/internal/account.d.ts +1 -2
- package/dist/esm/internal/account.js.map +1 -1
- package/dist/esm/metrics.d.ts +1 -2
- package/dist/esm/metrics.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/client/actions/formatSign.d.ts +9 -4
- package/dist/types/client/actions/formatSign.d.ts.map +1 -1
- package/dist/types/client/actions/getCallsStatus.d.ts +9 -4
- package/dist/types/client/actions/getCallsStatus.d.ts.map +1 -1
- package/dist/types/client/actions/grantPermissions.d.ts +8 -3
- package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
- package/dist/types/client/actions/listAccounts.d.ts +9 -4
- package/dist/types/client/actions/listAccounts.d.ts.map +1 -1
- package/dist/types/client/actions/prepareCalls.d.ts +9 -4
- package/dist/types/client/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/client/actions/prepareSign.d.ts +9 -4
- package/dist/types/client/actions/prepareSign.d.ts.map +1 -1
- package/dist/types/client/actions/requestAccount.d.ts +8 -3
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
- package/dist/types/client/actions/sendPreparedCalls.d.ts +9 -4
- package/dist/types/client/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/client/actions/signPreparedCalls.d.ts +8 -3
- package/dist/types/client/actions/signPreparedCalls.d.ts.map +1 -1
- package/dist/types/client/actions/waitForCallsStatus.d.ts +2 -2
- package/dist/types/experimental/actions/requestQuoteV0.d.ts +9 -4
- package/dist/types/experimental/actions/requestQuoteV0.d.ts.map +1 -1
- package/dist/types/internal/account.d.ts +1 -2
- package/dist/types/internal/account.d.ts.map +1 -1
- package/dist/types/metrics.d.ts +1 -2
- package/dist/types/metrics.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +5 -5
- package/src/client/actions/formatSign.ts +12 -11
- package/src/client/actions/getCallsStatus.ts +12 -8
- package/src/client/actions/grantPermissions.ts +11 -8
- package/src/client/actions/listAccounts.ts +12 -6
- package/src/client/actions/prepareCalls.ts +12 -11
- package/src/client/actions/prepareSign.ts +12 -9
- package/src/client/actions/requestAccount.ts +11 -6
- package/src/client/actions/sendPreparedCalls.ts +12 -8
- package/src/client/actions/signPreparedCalls.ts +15 -9
- package/src/experimental/actions/requestQuoteV0.ts +12 -13
- package/src/internal/account.ts +1 -2
- package/src/metrics.ts +1 -2
- package/src/version.ts +1 -1
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import type { InnerWalletApiClient } from "../../types.ts";
|
|
2
2
|
import { toHex, type Address, type IsUndefined } from "viem";
|
|
3
3
|
import { AccountNotFoundError } from "@aa-sdk/core";
|
|
4
|
-
import type {
|
|
5
|
-
import type { wallet_prepareSign } from "@alchemy/wallet-api-types/rpc";
|
|
4
|
+
import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
|
|
6
5
|
import { metrics } from "../../metrics.js";
|
|
7
6
|
|
|
7
|
+
type RpcSchema = Extract<
|
|
8
|
+
WalletServerRpcSchemaType,
|
|
9
|
+
{
|
|
10
|
+
Request: {
|
|
11
|
+
method: "wallet_prepareSign";
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
>;
|
|
15
|
+
|
|
8
16
|
export type PrepareSignParams<
|
|
9
17
|
TAccount extends Address | undefined = Address | undefined,
|
|
10
|
-
> = Omit<
|
|
11
|
-
Static<
|
|
12
|
-
(typeof wallet_prepareSign)["properties"]["Request"]["properties"]["params"]
|
|
13
|
-
>[0],
|
|
14
|
-
"from" | "chainId"
|
|
15
|
-
> &
|
|
18
|
+
> = Omit<RpcSchema["Request"]["params"][0], "from" | "chainId"> &
|
|
16
19
|
(IsUndefined<TAccount> extends true ? { from: Address } : { from?: never });
|
|
17
20
|
|
|
18
|
-
export type PrepareSignResult =
|
|
21
|
+
export type PrepareSignResult = RpcSchema["ReturnType"];
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* Prepares a signature request for signing messages or transactions.
|
|
@@ -2,19 +2,24 @@ import {
|
|
|
2
2
|
type SmartAccountSigner,
|
|
3
3
|
type SmartContractAccount,
|
|
4
4
|
} from "@aa-sdk/core";
|
|
5
|
-
import type { Static } from "typebox";
|
|
6
5
|
import type { Address } from "abitype";
|
|
7
6
|
import deepEqual from "deep-equal";
|
|
8
7
|
import { custom } from "viem";
|
|
9
|
-
import type {
|
|
8
|
+
import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
|
|
10
9
|
import type { InnerWalletApiClient } from "../../types.js";
|
|
11
10
|
import { createAccount } from "../../internal/account.js";
|
|
12
11
|
|
|
12
|
+
type RpcSchema = Extract<
|
|
13
|
+
WalletServerRpcSchemaType,
|
|
14
|
+
{
|
|
15
|
+
Request: {
|
|
16
|
+
method: "wallet_requestAccount";
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
>;
|
|
20
|
+
|
|
13
21
|
export type RequestAccountParams = Omit<
|
|
14
|
-
Extract<
|
|
15
|
-
Static<typeof wallet_requestAccount>["Request"]["params"][0],
|
|
16
|
-
{ signerAddress: Address }
|
|
17
|
-
>,
|
|
22
|
+
Extract<RpcSchema["Request"]["params"][0], { signerAddress: Address }>,
|
|
18
23
|
"signerAddress" | "includeCounterfactualInfo"
|
|
19
24
|
> & { accountAddress?: Address };
|
|
20
25
|
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import type { Static } from "typebox";
|
|
2
1
|
import { toHex } from "viem";
|
|
3
|
-
import type {
|
|
2
|
+
import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
|
|
4
3
|
import type { InnerWalletApiClient, WithoutChainId } from "../../types.ts";
|
|
5
4
|
import { metrics } from "../../metrics.js";
|
|
6
5
|
|
|
6
|
+
type RpcSchema = Extract<
|
|
7
|
+
WalletServerRpcSchemaType,
|
|
8
|
+
{
|
|
9
|
+
Request: {
|
|
10
|
+
method: "wallet_sendPreparedCalls";
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
>;
|
|
14
|
+
|
|
7
15
|
export type SendPreparedCallsParams = WithoutChainId<
|
|
8
|
-
|
|
9
|
-
(typeof wallet_sendPreparedCalls)["properties"]["Request"]["properties"]["params"]
|
|
10
|
-
>[0]
|
|
16
|
+
RpcSchema["Request"]["params"][0]
|
|
11
17
|
>;
|
|
12
18
|
|
|
13
|
-
export type SendPreparedCallsResult =
|
|
14
|
-
typeof wallet_sendPreparedCalls
|
|
15
|
-
>["ReturnType"];
|
|
19
|
+
export type SendPreparedCallsResult = RpcSchema["ReturnType"];
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* Sends prepared calls by submitting a signed user operation.
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import type { PrepareCallsResult } from "./prepareCalls.ts";
|
|
2
2
|
import { BaseError, type SmartAccountSigner } from "@aa-sdk/core";
|
|
3
3
|
import { signSignatureRequest } from "./signSignatureRequest.js";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type PreparedCall_UserOpV070,
|
|
4
|
+
import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
|
|
5
|
+
import type {
|
|
6
|
+
PreparedCall_Authorization,
|
|
7
|
+
PreparedCall_UserOpV060,
|
|
8
|
+
PreparedCall_UserOpV070,
|
|
10
9
|
} from "@alchemy/wallet-api-types";
|
|
11
10
|
import { metrics } from "../../metrics.js";
|
|
12
11
|
import { assertNever } from "../../utils.js";
|
|
13
12
|
|
|
13
|
+
type RpcSchema = Extract<
|
|
14
|
+
WalletServerRpcSchemaType,
|
|
15
|
+
{
|
|
16
|
+
Request: {
|
|
17
|
+
method: "wallet_sendPreparedCalls";
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
>;
|
|
21
|
+
|
|
14
22
|
export type SignPreparedCallsParams = PrepareCallsResult;
|
|
15
23
|
|
|
16
|
-
export type SignPreparedCallsResult =
|
|
17
|
-
(typeof wallet_sendPreparedCalls)["properties"]["Request"]["properties"]["params"]
|
|
18
|
-
>[0];
|
|
24
|
+
export type SignPreparedCallsResult = RpcSchema["Request"]["params"][0];
|
|
19
25
|
|
|
20
26
|
/**
|
|
21
27
|
* Signs prepared calls using the provided signer.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Static } from "typebox";
|
|
2
1
|
import {
|
|
3
2
|
toHex,
|
|
4
3
|
type Address,
|
|
@@ -6,26 +5,26 @@ import {
|
|
|
6
5
|
type Prettify,
|
|
7
6
|
type UnionOmit,
|
|
8
7
|
} from "viem";
|
|
9
|
-
import type {
|
|
8
|
+
import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
|
|
10
9
|
import type { InnerWalletApiClientBase } from "../../types.js";
|
|
11
10
|
import { AccountNotFoundError } from "@aa-sdk/core";
|
|
12
11
|
import { mergeClientCapabilities } from "../../internal/capabilities.js";
|
|
13
12
|
|
|
13
|
+
type RpcSchema = Extract<
|
|
14
|
+
WalletServerRpcSchemaType,
|
|
15
|
+
{
|
|
16
|
+
Request: {
|
|
17
|
+
method: "wallet_requestQuote_v0";
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
>;
|
|
21
|
+
|
|
14
22
|
export type RequestQuoteV0Params<
|
|
15
23
|
TAccount extends Address | undefined = Address | undefined,
|
|
16
|
-
> = Prettify<
|
|
17
|
-
UnionOmit<
|
|
18
|
-
Static<
|
|
19
|
-
(typeof wallet_requestQuote_v0)["properties"]["Request"]["properties"]["params"]
|
|
20
|
-
>[0],
|
|
21
|
-
"from" | "chainId"
|
|
22
|
-
>
|
|
23
|
-
> &
|
|
24
|
+
> = Prettify<UnionOmit<RpcSchema["Request"]["params"][0], "from" | "chainId">> &
|
|
24
25
|
(IsUndefined<TAccount> extends true ? { from: Address } : { from?: never });
|
|
25
26
|
|
|
26
|
-
export type RequestQuoteV0Result = Prettify<
|
|
27
|
-
Static<typeof wallet_requestQuote_v0>["ReturnType"]
|
|
28
|
-
>;
|
|
27
|
+
export type RequestQuoteV0Result = Prettify<RpcSchema["ReturnType"]>;
|
|
29
28
|
|
|
30
29
|
export async function requestQuoteV0<
|
|
31
30
|
TAccount extends Address | undefined = Address | undefined,
|
package/src/internal/account.ts
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
type Address,
|
|
13
13
|
isAddressEqual,
|
|
14
14
|
} from "viem";
|
|
15
|
-
import type { StaticDecode } from "typebox";
|
|
16
15
|
import type { SerializedInitcode } from "@alchemy/wallet-api-types";
|
|
17
16
|
import { InternalError, InvalidRequestError } from "ox/RpcResponse";
|
|
18
17
|
import { assertNever } from "../utils.js";
|
|
@@ -23,7 +22,7 @@ type CreateAccountParams = {
|
|
|
23
22
|
transport: Transport;
|
|
24
23
|
signer: SmartAccountSigner;
|
|
25
24
|
accountAddress: Address;
|
|
26
|
-
counterfactualInfo?:
|
|
25
|
+
counterfactualInfo?: SerializedInitcode; // undefined for 7702 accounts
|
|
27
26
|
delegation?: Address; // for 7702 accounts
|
|
28
27
|
};
|
|
29
28
|
|
package/src/metrics.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "@account-kit/logging";
|
|
2
2
|
import { VERSION } from "./version.js";
|
|
3
|
-
import type { StaticDecode } from "typebox";
|
|
4
3
|
import type { SerializedInitcode } from "@alchemy/wallet-api-types";
|
|
5
4
|
|
|
6
5
|
export type CoreEventsSchema = [
|
|
@@ -14,7 +13,7 @@ export type CoreEventsSchema = [
|
|
|
14
13
|
EventName: "account_initialized";
|
|
15
14
|
EventData: {
|
|
16
15
|
chainId: number;
|
|
17
|
-
factory:
|
|
16
|
+
factory: SerializedInitcode["factoryType"] | "7702";
|
|
18
17
|
};
|
|
19
18
|
},
|
|
20
19
|
{
|
package/src/version.ts
CHANGED