@account-kit/wallet-client 0.1.0-alpha.0 → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/abi/index.d.ts +8 -8
- package/dist/esm/abi/index.js +8 -8
- package/dist/esm/abi/index.js.map +1 -1
- package/dist/esm/capabilities/index.js +3 -3
- package/dist/esm/capabilities/index.js.map +1 -1
- package/dist/esm/capabilities/overrides.js +1 -1
- package/dist/esm/capabilities/overrides.js.map +1 -1
- package/dist/esm/capabilities/permissions/index.js +1 -1
- package/dist/esm/capabilities/permissions/index.js.map +1 -1
- package/dist/esm/capabilities/permissions/mav2.js +1 -1
- package/dist/esm/capabilities/permissions/mav2.js.map +1 -1
- package/dist/esm/client/actions/requestAccount.d.ts +2 -2
- package/dist/esm/client/actions/requestAccount.js +2 -2
- package/dist/esm/client/actions/requestAccount.js.map +1 -1
- package/dist/esm/client/actions/signMessage.d.ts +1 -1
- package/dist/esm/client/actions/signMessage.js +1 -1
- package/dist/esm/client/actions/signMessage.js.map +1 -1
- package/dist/esm/client/actions/signSignatureRequest.d.ts +1 -1
- package/dist/esm/client/actions/signSignatureRequest.js +2 -2
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/client/actions/signTypedData.d.ts +1 -1
- package/dist/esm/client/actions/signTypedData.js +1 -1
- package/dist/esm/client/actions/signTypedData.js.map +1 -1
- package/dist/esm/client/client.e2e-test.js +2 -2
- package/dist/esm/client/client.e2e-test.js.map +1 -1
- package/dist/esm/client/decorator.d.ts +7 -7
- package/dist/esm/client/decorator.js +10 -10
- package/dist/esm/client/decorator.js.map +1 -1
- package/dist/esm/client/index.d.ts +1 -1
- package/dist/esm/client/index.js +3 -3
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/exports/index.d.ts +13 -13
- package/dist/esm/exports/index.js +13 -13
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/internal.d.ts +12 -12
- package/dist/esm/exports/internal.js +11 -11
- package/dist/esm/exports/internal.js.map +1 -1
- package/dist/esm/isomorphic/actions/createSession.d.ts +3 -3
- package/dist/esm/isomorphic/actions/createSession.js +5 -5
- package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
- package/dist/esm/isomorphic/actions/getCallsStatus.d.ts +2 -2
- package/dist/esm/isomorphic/actions/getCallsStatus.js +3 -3
- package/dist/esm/isomorphic/actions/getCallsStatus.js.map +1 -1
- package/dist/esm/isomorphic/actions/prepareCalls.d.ts +2 -2
- package/dist/esm/isomorphic/actions/prepareCalls.js +2 -2
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
- package/dist/esm/isomorphic/actions/sendPreparedCalls.d.ts +2 -2
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +2 -2
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/isomorphic/client.d.ts +6 -6
- package/dist/esm/isomorphic/client.js +4 -4
- package/dist/esm/isomorphic/client.js.map +1 -1
- package/dist/esm/isomorphic/utils/createAccount.d.ts +2 -2
- package/dist/esm/isomorphic/utils/createAccount.js +1 -1
- package/dist/esm/isomorphic/utils/createAccount.js.map +1 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +4 -4
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js +1 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +1 -1
- package/dist/esm/local/client.js +4 -4
- package/dist/esm/local/client.js.map +1 -1
- package/dist/esm/remote/client.js +3 -3
- package/dist/esm/remote/client.js.map +1 -1
- package/dist/esm/rpc/request.js +3 -3
- package/dist/esm/rpc/request.js.map +1 -1
- package/dist/esm/rpc/schema.js +1 -1
- package/dist/esm/rpc/schema.js.map +1 -1
- package/dist/types/abi/index.d.ts +8 -8
- package/dist/types/abi/index.d.ts.map +1 -1
- package/dist/types/client/actions/requestAccount.d.ts +2 -2
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
- package/dist/types/client/actions/signMessage.d.ts +1 -1
- package/dist/types/client/actions/signMessage.d.ts.map +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/client/actions/signTypedData.d.ts +1 -1
- package/dist/types/client/actions/signTypedData.d.ts.map +1 -1
- package/dist/types/client/decorator.d.ts +7 -7
- package/dist/types/client/decorator.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +1 -1
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +13 -13
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/internal.d.ts +12 -12
- package/dist/types/exports/internal.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/createSession.d.ts +3 -3
- package/dist/types/isomorphic/actions/createSession.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/getCallsStatus.d.ts +2 -2
- package/dist/types/isomorphic/actions/getCallsStatus.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/prepareCalls.d.ts +2 -2
- package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts +2 -2
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/client.d.ts +6 -6
- package/dist/types/isomorphic/client.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/createAccount.d.ts +2 -2
- package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +4 -4
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +1 -1
- package/dist/types/remote/client.d.ts.map +1 -1
- package/package.json +8 -3
- package/src/abi/index.ts +8 -8
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/overrides.ts +1 -1
- package/src/capabilities/permissions/index.ts +1 -1
- package/src/capabilities/permissions/mav2.ts +1 -1
- package/src/client/actions/requestAccount.ts +4 -4
- package/src/client/actions/signMessage.ts +2 -2
- package/src/client/actions/signSignatureRequest.ts +2 -2
- package/src/client/actions/signTypedData.ts +2 -2
- package/src/client/client.e2e-test.ts +2 -2
- package/src/client/decorator.ts +18 -18
- package/src/client/index.ts +6 -3
- package/src/exports/index.ts +13 -13
- package/src/exports/internal.ts +12 -12
- package/src/isomorphic/actions/createSession.ts +15 -15
- package/src/isomorphic/actions/getCallsStatus.ts +6 -6
- package/src/isomorphic/actions/prepareCalls.ts +4 -4
- package/src/isomorphic/actions/sendPreparedCalls.ts +4 -4
- package/src/isomorphic/client.ts +8 -5
- package/src/isomorphic/utils/createAccount.ts +3 -3
- package/src/isomorphic/utils/parsePermissionsContext.ts +3 -3
- package/src/local/client.ts +4 -4
- package/src/remote/client.ts +3 -3
- package/src/rpc/request.ts +3 -3
- package/src/rpc/schema.ts +1 -1
|
@@ -3,7 +3,7 @@ import type { Static } from "@sinclair/typebox";
|
|
|
3
3
|
import { concatHex, sliceHex, type Hex } from "viem";
|
|
4
4
|
import type { PermissionsData } from ".";
|
|
5
5
|
import type { KeySigner } from "../../schemas";
|
|
6
|
-
import { assertNever } from "../../utils";
|
|
6
|
+
import { assertNever } from "../../utils.js";
|
|
7
7
|
|
|
8
8
|
export const SESSION_ID_LENGTH_BYTES = 16;
|
|
9
9
|
export const ENTITY_ID_LENGTH_BYTES = 4;
|
|
@@ -3,10 +3,10 @@ import type { Static } from "@sinclair/typebox";
|
|
|
3
3
|
import { Value } from "@sinclair/typebox/value";
|
|
4
4
|
import type { Address } from "abitype";
|
|
5
5
|
import { custom, type IsUndefined, type JsonRpcAccount } from "viem";
|
|
6
|
-
import { createAccount } from "../../isomorphic/utils/createAccount";
|
|
7
|
-
import type { wallet_requestAccount } from "../../rpc/request";
|
|
8
|
-
import { TypeSerializedInitcode } from "../../schemas";
|
|
9
|
-
import type { InnerWalletApiClient } from "../../types";
|
|
6
|
+
import { createAccount } from "../../isomorphic/utils/createAccount.js";
|
|
7
|
+
import type { wallet_requestAccount } from "../../rpc/request.js";
|
|
8
|
+
import { TypeSerializedInitcode } from "../../schemas.js";
|
|
9
|
+
import type { InnerWalletApiClient } from "../../types.js";
|
|
10
10
|
|
|
11
11
|
export type RequestAccountParams<
|
|
12
12
|
TAccount extends JsonRpcAccount<Address> | undefined =
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
1
2
|
import {
|
|
2
3
|
type Address,
|
|
3
4
|
type Hex,
|
|
@@ -5,8 +6,7 @@ import {
|
|
|
5
6
|
type SignableMessage,
|
|
6
7
|
} from "viem";
|
|
7
8
|
import type { InnerWalletApiClient } from "../../types";
|
|
8
|
-
import
|
|
9
|
-
import { requestAccount } from "./requestAccount";
|
|
9
|
+
import { requestAccount } from "./requestAccount.js";
|
|
10
10
|
|
|
11
11
|
export type SignMessageParams = SignableMessage;
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import type { Static } from "@sinclair/typebox";
|
|
3
3
|
import { type Hex } from "viem";
|
|
4
|
-
import { TypeSignatureRequest } from "../../schemas";
|
|
5
|
-
import { assertNever } from "../../utils";
|
|
4
|
+
import { TypeSignatureRequest } from "../../schemas.js";
|
|
5
|
+
import { assertNever } from "../../utils.js";
|
|
6
6
|
|
|
7
7
|
export type SignSignatureRequestParams = Static<typeof TypeSignatureRequest>;
|
|
8
8
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
1
2
|
import {
|
|
2
3
|
type Address,
|
|
3
4
|
type Hex,
|
|
@@ -5,8 +6,7 @@ import {
|
|
|
5
6
|
type TypedDataDefinition,
|
|
6
7
|
} from "viem";
|
|
7
8
|
import type { InnerWalletApiClient } from "../../types";
|
|
8
|
-
import
|
|
9
|
-
import { requestAccount } from "./requestAccount";
|
|
9
|
+
import { requestAccount } from "./requestAccount.js";
|
|
10
10
|
|
|
11
11
|
export type SignTypedDataParams = TypedDataDefinition;
|
|
12
12
|
|
|
@@ -2,8 +2,8 @@ import { LocalAccountSigner } from "@aa-sdk/core";
|
|
|
2
2
|
import { alchemy, arbitrumSepolia } from "@account-kit/infra";
|
|
3
3
|
import { describe, expect, it } from "bun:test";
|
|
4
4
|
import { createPublicClient, zeroAddress, type Address } from "viem";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { signSignatureRequest } from "./actions/signSignatureRequest.js";
|
|
6
|
+
import { createSmartWalletClient } from "./index.js";
|
|
7
7
|
|
|
8
8
|
describe("Client E2E Tests", () => {
|
|
9
9
|
const transport = alchemy(
|
package/src/client/decorator.ts
CHANGED
|
@@ -14,40 +14,40 @@ import {
|
|
|
14
14
|
createAccount,
|
|
15
15
|
type CreateAccountParams,
|
|
16
16
|
type CreateAccountResult,
|
|
17
|
-
} from "./actions/createAccount";
|
|
17
|
+
} from "./actions/createAccount.js";
|
|
18
|
+
import {
|
|
19
|
+
getCallsStatus,
|
|
20
|
+
type GetCallsStatusParams,
|
|
21
|
+
type GetCallsStatusResult,
|
|
22
|
+
} from "./actions/getCallsStatus.js";
|
|
23
|
+
import {
|
|
24
|
+
grantPermissions,
|
|
25
|
+
type GrantPermissionsParams,
|
|
26
|
+
type GrantPermissionsResult,
|
|
27
|
+
} from "./actions/grantPermissions.js";
|
|
18
28
|
import {
|
|
19
29
|
listAccounts,
|
|
20
30
|
type ListAccountsParams,
|
|
21
31
|
type ListAccountsResult,
|
|
22
|
-
} from "./actions/listAccounts";
|
|
32
|
+
} from "./actions/listAccounts.js";
|
|
23
33
|
import {
|
|
24
34
|
prepareCalls,
|
|
25
35
|
type PrepareCallsParams,
|
|
26
36
|
type PrepareCallsResult,
|
|
27
|
-
} from "./actions/prepareCalls";
|
|
37
|
+
} from "./actions/prepareCalls.js";
|
|
28
38
|
import {
|
|
29
39
|
requestAccount,
|
|
30
40
|
type RequestAccountParams,
|
|
31
41
|
type RequestAccountResult,
|
|
32
|
-
} from "./actions/requestAccount";
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
type GetCallsStatusParams,
|
|
36
|
-
type GetCallsStatusResult,
|
|
37
|
-
} from "./actions/getCallsStatus";
|
|
42
|
+
} from "./actions/requestAccount.js";
|
|
43
|
+
import { sendPreparedCalls } from "./actions/sendPreparedCalls.js";
|
|
44
|
+
import { signMessage } from "./actions/signMessage.js";
|
|
38
45
|
import {
|
|
39
46
|
signSignatureRequest,
|
|
40
47
|
type SignSignatureRequestParams,
|
|
41
48
|
type SignSignatureRequestResult,
|
|
42
|
-
} from "./actions/signSignatureRequest";
|
|
43
|
-
import {
|
|
44
|
-
import { signTypedData } from "./actions/signTypedData";
|
|
45
|
-
import {
|
|
46
|
-
grantPermissions,
|
|
47
|
-
type GrantPermissionsParams,
|
|
48
|
-
type GrantPermissionsResult,
|
|
49
|
-
} from "./actions/grantPermissions";
|
|
50
|
-
import { sendPreparedCalls } from "./actions/sendPreparedCalls";
|
|
49
|
+
} from "./actions/signSignatureRequest.js";
|
|
50
|
+
import { signTypedData } from "./actions/signTypedData.js";
|
|
51
51
|
|
|
52
52
|
export type SmartWalletActions<
|
|
53
53
|
TAccount extends JsonRpcAccount | undefined = JsonRpcAccount | undefined,
|
package/src/client/index.ts
CHANGED
|
@@ -7,10 +7,13 @@ import {
|
|
|
7
7
|
type JsonRpcAccount,
|
|
8
8
|
type Prettify,
|
|
9
9
|
} from "viem";
|
|
10
|
-
import { createLocalClient } from "../local/client";
|
|
11
|
-
import { createRemoteClient } from "../remote/client";
|
|
10
|
+
import { createLocalClient } from "../local/client.js";
|
|
11
|
+
import { createRemoteClient } from "../remote/client.js";
|
|
12
12
|
import type { InnerWalletApiClient } from "../types";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
smartWalletClientActions,
|
|
15
|
+
type SmartWalletActions,
|
|
16
|
+
} from "./decorator.js";
|
|
14
17
|
|
|
15
18
|
export type SmartWalletClientParams<
|
|
16
19
|
TAccount extends JsonRpcAccount<Address> | undefined =
|
package/src/exports/index.ts
CHANGED
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
export {
|
|
4
4
|
createSmartWalletClient,
|
|
5
5
|
type SmartWalletClientParams,
|
|
6
|
-
} from "../client";
|
|
6
|
+
} from "../client/index.js";
|
|
7
7
|
|
|
8
8
|
export {
|
|
9
9
|
WalletServerRpcSchema,
|
|
10
10
|
type WalletServerRpcSchemaType,
|
|
11
11
|
type WalletServerViemRpcSchema,
|
|
12
|
-
} from "../rpc/schema";
|
|
12
|
+
} from "../rpc/schema.js";
|
|
13
13
|
|
|
14
14
|
// capabilities: TODO: should these actually just have the types exported?
|
|
15
|
-
export { Capabilities } from "../capabilities";
|
|
16
|
-
export { PaymasterCapability } from "../capabilities/paymaster";
|
|
15
|
+
export { Capabilities } from "../capabilities/index.js";
|
|
16
|
+
export { PaymasterCapability } from "../capabilities/paymaster.js";
|
|
17
17
|
export {
|
|
18
18
|
PermissionsArray,
|
|
19
19
|
PermissionsCapability,
|
|
20
20
|
PermissionsContext,
|
|
21
21
|
PermissionsData,
|
|
22
|
-
} from "../capabilities/permissions";
|
|
22
|
+
} from "../capabilities/permissions/index.js";
|
|
23
23
|
|
|
24
24
|
// client actions
|
|
25
|
-
export { createAccount } from "../client/actions/createAccount";
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export { signTypedData } from "../client/actions/signTypedData";
|
|
25
|
+
export { createAccount } from "../client/actions/createAccount.js";
|
|
26
|
+
export { getCallsStatus } from "../client/actions/getCallsStatus.js";
|
|
27
|
+
export { listAccounts } from "../client/actions/listAccounts.js";
|
|
28
|
+
export { prepareCalls } from "../client/actions/prepareCalls.js";
|
|
29
|
+
export { requestAccount } from "../client/actions/requestAccount.js";
|
|
30
|
+
export { signMessage } from "../client/actions/signMessage.js";
|
|
31
|
+
export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
|
|
32
|
+
export { signTypedData } from "../client/actions/signTypedData.js";
|
package/src/exports/internal.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// exports from this file are meant to be imported by our packages in the monorepo
|
|
2
2
|
// we will expose this in the package.json as a named export like `this-pkg/internal`
|
|
3
3
|
// TODO: name `this-pkg`
|
|
4
|
-
export * from "../capabilities";
|
|
5
|
-
export * from "../capabilities/paymaster";
|
|
6
|
-
export * from "../capabilities/permissions";
|
|
7
|
-
export * from "../capabilities/permissions/mav2";
|
|
8
|
-
export type * from "../isomorphic/client";
|
|
9
|
-
export { createIsomorphicClient } from "../isomorphic/client";
|
|
10
|
-
export { createDummySigner } from "../isomorphic/utils/createDummySigner";
|
|
11
|
-
export * from "../rpc/request";
|
|
12
|
-
export * as RpcSchemas from "../rpc/request";
|
|
13
|
-
export * from "../rpc/schema";
|
|
14
|
-
export * from "../schemas";
|
|
4
|
+
export * from "../capabilities/index.js";
|
|
5
|
+
export * from "../capabilities/paymaster.js";
|
|
6
|
+
export * from "../capabilities/permissions/index.js";
|
|
7
|
+
export * from "../capabilities/permissions/mav2.js";
|
|
8
|
+
export type * from "../isomorphic/client.js";
|
|
9
|
+
export { createIsomorphicClient } from "../isomorphic/client.js";
|
|
10
|
+
export { createDummySigner } from "../isomorphic/utils/createDummySigner.js";
|
|
11
|
+
export * from "../rpc/request.js";
|
|
12
|
+
export * as RpcSchemas from "../rpc/request.js";
|
|
13
|
+
export * from "../rpc/schema.js";
|
|
14
|
+
export * from "../schemas.js";
|
|
15
15
|
export type * from "../types";
|
|
16
|
-
export * from "../utils";
|
|
16
|
+
export * from "../utils.js";
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
type SmartAccountClient,
|
|
4
4
|
type SmartContractAccount,
|
|
5
5
|
} from "@aa-sdk/core";
|
|
6
|
+
import {
|
|
7
|
+
deferralActions,
|
|
8
|
+
PermissionBuilder,
|
|
9
|
+
} from "@account-kit/smart-contracts/experimental";
|
|
10
|
+
import type { Static } from "@sinclair/typebox";
|
|
11
|
+
import { Value } from "@sinclair/typebox/value";
|
|
6
12
|
import {
|
|
7
13
|
ChainNotFoundError,
|
|
8
|
-
type Chain,
|
|
9
|
-
type Transport,
|
|
10
14
|
custom,
|
|
11
15
|
hexToNumber,
|
|
12
|
-
type Hex,
|
|
13
16
|
toHex,
|
|
17
|
+
type Chain,
|
|
18
|
+
type Hex,
|
|
19
|
+
type Transport,
|
|
14
20
|
} from "viem";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import type {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
PermissionBuilder,
|
|
22
|
-
} from "@account-kit/smart-contracts/experimental";
|
|
23
|
-
import { createDummySigner } from "../utils/createDummySigner";
|
|
24
|
-
import { createAccount, isModularAccountV2 } from "../utils/createAccount";
|
|
25
|
-
import { Value } from "@sinclair/typebox/value";
|
|
26
|
-
import { TypePermission } from "../../capabilities/permissions";
|
|
21
|
+
import { TypePermission } from "../../capabilities/permissions/index.js";
|
|
22
|
+
import { isGlobalValidation } from "../../capabilities/permissions/mav2.js";
|
|
23
|
+
import type { wallet_createSession } from "../../rpc/request.js";
|
|
24
|
+
import type { WalletServerViemRpcSchema } from "../../rpc/schema.js";
|
|
25
|
+
import { createAccount, isModularAccountV2 } from "../utils/createAccount.js";
|
|
26
|
+
import { createDummySigner } from "../utils/createDummySigner.js";
|
|
27
27
|
|
|
28
28
|
export type CreateSessionParams = Omit<
|
|
29
29
|
Static<
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
type SmartContractAccount,
|
|
4
4
|
} from "@aa-sdk/core";
|
|
5
5
|
import type { Static } from "@sinclair/typebox";
|
|
6
|
+
import { Value } from "@sinclair/typebox/value";
|
|
6
7
|
import {
|
|
7
8
|
ChainNotFoundError,
|
|
9
|
+
isHex,
|
|
8
10
|
type Chain,
|
|
9
11
|
type Hex,
|
|
10
12
|
type TransactionReceipt,
|
|
11
13
|
type Transport,
|
|
12
|
-
isHex,
|
|
13
14
|
} from "viem";
|
|
14
|
-
import type { wallet_getCallsStatus } from "../../rpc/request";
|
|
15
|
-
import type { WalletServerViemRpcSchema } from "../../rpc/schema";
|
|
16
|
-
import { TypeCallId } from "../../schemas";
|
|
17
|
-
import { castToHex } from "../../utils";
|
|
18
|
-
import { Value } from "@sinclair/typebox/value";
|
|
15
|
+
import type { wallet_getCallsStatus } from "../../rpc/request.js";
|
|
16
|
+
import type { WalletServerViemRpcSchema } from "../../rpc/schema.js";
|
|
17
|
+
import { TypeCallId } from "../../schemas.js";
|
|
18
|
+
import { castToHex } from "../../utils.js";
|
|
19
19
|
|
|
20
20
|
export type GetCallsStatusParams = Static<
|
|
21
21
|
(typeof wallet_getCallsStatus)["properties"]["Request"]["properties"]["params"]
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
type Chain,
|
|
14
14
|
type Transport,
|
|
15
15
|
} from "viem";
|
|
16
|
-
import type { wallet_prepareCalls } from "../../rpc/request";
|
|
17
|
-
import type { WalletServerViemRpcSchema } from "../../rpc/schema";
|
|
18
|
-
import { createAccount } from "../utils/createAccount";
|
|
19
|
-
import { createDummySigner } from "../utils/createDummySigner";
|
|
16
|
+
import type { wallet_prepareCalls } from "../../rpc/request.js";
|
|
17
|
+
import type { WalletServerViemRpcSchema } from "../../rpc/schema.js";
|
|
18
|
+
import { createAccount } from "../utils/createAccount.js";
|
|
19
|
+
import { createDummySigner } from "../utils/createDummySigner.js";
|
|
20
20
|
|
|
21
21
|
export type PrepareCallsParams = Omit<
|
|
22
22
|
Static<
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
type Hex,
|
|
15
15
|
type Transport,
|
|
16
16
|
} from "viem";
|
|
17
|
-
import { decodePermissionsContext } from "../../capabilities/permissions/mav2";
|
|
18
|
-
import type { wallet_sendPreparedCalls } from "../../rpc/request";
|
|
19
|
-
import type { WalletServerViemRpcSchema } from "../../rpc/schema";
|
|
20
|
-
import { TypeCallId } from "../../schemas";
|
|
17
|
+
import { decodePermissionsContext } from "../../capabilities/permissions/mav2.js";
|
|
18
|
+
import type { wallet_sendPreparedCalls } from "../../rpc/request.js";
|
|
19
|
+
import type { WalletServerViemRpcSchema } from "../../rpc/schema.js";
|
|
20
|
+
import { TypeCallId } from "../../schemas.js";
|
|
21
21
|
|
|
22
22
|
export type SendPreparedCallsParams = Omit<
|
|
23
23
|
StaticDecode<
|
package/src/isomorphic/client.ts
CHANGED
|
@@ -11,20 +11,23 @@ import {
|
|
|
11
11
|
type AlchemyTransport,
|
|
12
12
|
} from "@account-kit/infra";
|
|
13
13
|
import { type Chain, type Transport } from "viem";
|
|
14
|
-
import type { WalletServerViemRpcSchema } from "../rpc/schema";
|
|
14
|
+
import type { WalletServerViemRpcSchema } from "../rpc/schema.js";
|
|
15
15
|
import {
|
|
16
16
|
createSession,
|
|
17
17
|
type CreateSessionParams,
|
|
18
|
-
} from "./actions/createSession";
|
|
18
|
+
} from "./actions/createSession.js";
|
|
19
19
|
import {
|
|
20
20
|
getCallsStatus,
|
|
21
21
|
type GetCallsStatusParams,
|
|
22
|
-
} from "./actions/getCallsStatus";
|
|
23
|
-
import {
|
|
22
|
+
} from "./actions/getCallsStatus.js";
|
|
23
|
+
import {
|
|
24
|
+
prepareCalls,
|
|
25
|
+
type PrepareCallsParams,
|
|
26
|
+
} from "./actions/prepareCalls.js";
|
|
24
27
|
import {
|
|
25
28
|
sendPreparedCalls,
|
|
26
29
|
type SendPreparedCallsParams,
|
|
27
|
-
} from "./actions/sendPreparedCalls";
|
|
30
|
+
} from "./actions/sendPreparedCalls.js";
|
|
28
31
|
|
|
29
32
|
// let's start with something that takes in as many params as possible, then we can eliminate them as we don't need them
|
|
30
33
|
type ClientParams = {
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
import type { StaticDecode } from "@sinclair/typebox";
|
|
7
7
|
import type { Address, Chain, Transport } from "viem";
|
|
8
8
|
import { concatHex, hexToNumber } from "viem";
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import { parsePermissionsContext } from "./parsePermissionsContext";
|
|
9
|
+
import type { Capabilities } from "../../capabilities/index.js";
|
|
10
|
+
import type { TypeSerializedInitcode } from "../../schemas.js";
|
|
11
|
+
import { parsePermissionsContext } from "./parsePermissionsContext.js";
|
|
12
12
|
|
|
13
13
|
type CreateAccountParams = {
|
|
14
14
|
chain: Chain;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { StaticDecode } from "@sinclair/typebox";
|
|
2
|
-
import type { PrepareCallsParams } from "../actions/prepareCalls";
|
|
3
|
-
import type { TypeSerializedInitcode } from "../../schemas";
|
|
4
2
|
import { InvalidRequestError } from "ox/RpcResponse";
|
|
5
|
-
import { decodePermissionsContext } from "../../capabilities/permissions/mav2";
|
|
3
|
+
import { decodePermissionsContext } from "../../capabilities/permissions/mav2.js";
|
|
4
|
+
import type { TypeSerializedInitcode } from "../../schemas.js";
|
|
5
|
+
import type { PrepareCallsParams } from "../actions/prepareCalls.js";
|
|
6
6
|
|
|
7
7
|
export function parsePermissionsContext(
|
|
8
8
|
capabilities: PrepareCallsParams["capabilities"],
|
package/src/local/client.ts
CHANGED
|
@@ -4,19 +4,19 @@ import { createClient, custom, type Address, type JsonRpcAccount } from "viem";
|
|
|
4
4
|
import {
|
|
5
5
|
encodePermissionsContext,
|
|
6
6
|
prefixSignatureKeyType,
|
|
7
|
-
} from "../capabilities/permissions/mav2";
|
|
8
|
-
import { signSignatureRequest } from "../client/actions/signSignatureRequest";
|
|
7
|
+
} from "../capabilities/permissions/mav2.js";
|
|
8
|
+
import { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
|
|
9
9
|
import type { PrepareCallsParams } from "../isomorphic/actions/prepareCalls";
|
|
10
10
|
import {
|
|
11
11
|
createIsomorphicClient,
|
|
12
12
|
type IsomorphicClient,
|
|
13
|
-
} from "../isomorphic/client";
|
|
13
|
+
} from "../isomorphic/client.js";
|
|
14
14
|
import type {
|
|
15
15
|
CreateInnerClientParams,
|
|
16
16
|
InnerClientActions,
|
|
17
17
|
InnerWalletApiClient,
|
|
18
18
|
} from "../types";
|
|
19
|
-
import { assertNever } from "../utils";
|
|
19
|
+
import { assertNever } from "../utils.js";
|
|
20
20
|
|
|
21
21
|
const localMethods = [
|
|
22
22
|
"wallet_prepareCalls",
|
package/src/remote/client.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Provider } from "ox";
|
|
2
2
|
import { createClient, custom, type Address, type JsonRpcAccount } from "viem";
|
|
3
|
-
import {
|
|
3
|
+
import { encodePermissionsContext } from "../capabilities/permissions/mav2.js";
|
|
4
|
+
import { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
|
|
5
|
+
import { WalletServerRpcSchema } from "../rpc/schema.js";
|
|
4
6
|
import type {
|
|
5
7
|
CreateInnerClientParams,
|
|
6
8
|
InnerClientActions,
|
|
7
9
|
InnerWalletApiClient,
|
|
8
10
|
InnerWalletApiClientBase,
|
|
9
11
|
} from "../types";
|
|
10
|
-
import { signSignatureRequest } from "../client/actions/signSignatureRequest";
|
|
11
|
-
import { encodePermissionsContext } from "../capabilities/permissions/mav2";
|
|
12
12
|
|
|
13
13
|
export function createRemoteClient<
|
|
14
14
|
TAccount extends JsonRpcAccount<Address> | undefined =
|
package/src/rpc/request.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { Capabilities } from "../capabilities";
|
|
2
|
+
import { Capabilities } from "../capabilities/index.js";
|
|
3
3
|
import {
|
|
4
4
|
PermissionsContext,
|
|
5
5
|
PermissionsData,
|
|
6
|
-
} from "../capabilities/permissions";
|
|
6
|
+
} from "../capabilities/permissions/index.js";
|
|
7
7
|
import {
|
|
8
8
|
TypeAddress,
|
|
9
9
|
TypeBase64UrlEncodedString,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
TypeUserOperationRequest_v6,
|
|
15
15
|
TypeUserOperationRequest_v7,
|
|
16
16
|
TypeUuid,
|
|
17
|
-
} from "../schemas";
|
|
17
|
+
} from "../schemas.js";
|
|
18
18
|
|
|
19
19
|
export const wallet_sendPreparedCalls = Type.Object(
|
|
20
20
|
{
|
package/src/rpc/schema.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Static, type StaticDecode } from "@sinclair/typebox";
|
|
2
2
|
import { RpcSchema } from "ox";
|
|
3
|
-
import * as Requests from "./request";
|
|
3
|
+
import * as Requests from "./request.js";
|
|
4
4
|
|
|
5
5
|
export const WalletServerRpcSchema = RpcSchema.from<
|
|
6
6
|
| Static<typeof Requests.wallet_prepareCalls>
|