@alchemy/wallet-apis 5.0.0-beta.28 → 5.0.0-beta.29

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.
Files changed (171) hide show
  1. package/dist/esm/actions/prepareCalls.d.ts +8 -3
  2. package/dist/esm/actions/prepareCalls.js +8 -0
  3. package/dist/esm/actions/prepareCalls.js.map +1 -1
  4. package/dist/esm/actions/requestAccount.d.ts +4 -3
  5. package/dist/esm/actions/requestAccount.js.map +1 -1
  6. package/dist/esm/actions/sendPreparedCalls.d.ts +3 -1
  7. package/dist/esm/actions/sendPreparedCalls.js.map +1 -1
  8. package/dist/esm/actions/signPreparedCalls.js +1 -1
  9. package/dist/esm/actions/signPreparedCalls.js.map +1 -1
  10. package/dist/esm/actions/signSignatureRequest.d.ts +4 -4
  11. package/dist/esm/actions/signSignatureRequest.js +1 -1
  12. package/dist/esm/actions/signSignatureRequest.js.map +1 -1
  13. package/dist/esm/actions/signTypedData.d.ts +14 -4
  14. package/dist/esm/actions/signTypedData.js.map +1 -1
  15. package/dist/esm/actions/solana/getCallsStatus.d.ts +24 -0
  16. package/dist/esm/actions/solana/getCallsStatus.js +44 -0
  17. package/dist/esm/actions/solana/getCallsStatus.js.map +1 -0
  18. package/dist/esm/actions/solana/prepareCalls.d.ts +46 -0
  19. package/dist/esm/actions/solana/prepareCalls.js +70 -0
  20. package/dist/esm/actions/solana/prepareCalls.js.map +1 -0
  21. package/dist/esm/actions/solana/sendCalls.d.ts +34 -0
  22. package/dist/esm/actions/solana/sendCalls.js +44 -0
  23. package/dist/esm/actions/solana/sendCalls.js.map +1 -0
  24. package/dist/esm/actions/solana/sendPreparedCalls.d.ts +24 -0
  25. package/dist/esm/actions/solana/sendPreparedCalls.js +32 -0
  26. package/dist/esm/actions/solana/sendPreparedCalls.js.map +1 -0
  27. package/dist/esm/actions/solana/signPreparedCalls.d.ts +23 -0
  28. package/dist/esm/actions/solana/signPreparedCalls.js +24 -0
  29. package/dist/esm/actions/solana/signPreparedCalls.js.map +1 -0
  30. package/dist/esm/actions/solana/signSignatureRequest.d.ts +10 -0
  31. package/dist/esm/actions/solana/signSignatureRequest.js +33 -0
  32. package/dist/esm/actions/solana/signSignatureRequest.js.map +1 -0
  33. package/dist/esm/actions/solana/waitForCallsStatus.d.ts +24 -0
  34. package/dist/esm/actions/solana/waitForCallsStatus.js +46 -0
  35. package/dist/esm/actions/solana/waitForCallsStatus.js.map +1 -0
  36. package/dist/esm/adapters/SolanaSignerError.d.ts +4 -0
  37. package/dist/esm/adapters/SolanaSignerError.js +13 -0
  38. package/dist/esm/adapters/SolanaSignerError.js.map +1 -0
  39. package/dist/esm/adapters/fromKeypair.d.ts +21 -0
  40. package/dist/esm/adapters/fromKeypair.js +46 -0
  41. package/dist/esm/adapters/fromKeypair.js.map +1 -0
  42. package/dist/esm/adapters/fromKitSigner.d.ts +21 -0
  43. package/dist/esm/adapters/fromKitSigner.js +61 -0
  44. package/dist/esm/adapters/fromKitSigner.js.map +1 -0
  45. package/dist/esm/adapters/fromWalletAdapter.d.ts +26 -0
  46. package/dist/esm/adapters/fromWalletAdapter.js +45 -0
  47. package/dist/esm/adapters/fromWalletAdapter.js.map +1 -0
  48. package/dist/esm/adapters/fromWalletStandard.d.ts +31 -0
  49. package/dist/esm/adapters/fromWalletStandard.js +53 -0
  50. package/dist/esm/adapters/fromWalletStandard.js.map +1 -0
  51. package/dist/esm/adapters/resolveSignerSlot.d.ts +10 -0
  52. package/dist/esm/adapters/resolveSignerSlot.js +39 -0
  53. package/dist/esm/adapters/resolveSignerSlot.js.map +1 -0
  54. package/dist/esm/client.d.ts +29 -14
  55. package/dist/esm/client.js +63 -19
  56. package/dist/esm/client.js.map +1 -1
  57. package/dist/esm/decorators/smartWalletActions.js +2 -2
  58. package/dist/esm/decorators/smartWalletActions.js.map +1 -1
  59. package/dist/esm/decorators/solanaSmartWalletActions.d.ts +16 -0
  60. package/dist/esm/decorators/solanaSmartWalletActions.js +16 -0
  61. package/dist/esm/decorators/solanaSmartWalletActions.js.map +1 -0
  62. package/dist/esm/experimental/actions/requestQuoteV0.d.ts +34 -7
  63. package/dist/esm/experimental/actions/requestQuoteV0.js.map +1 -1
  64. package/dist/esm/exports/index.d.ts +3 -3
  65. package/dist/esm/exports/index.js.map +1 -1
  66. package/dist/esm/exports/solana.d.ts +24 -0
  67. package/dist/esm/exports/solana.js +15 -0
  68. package/dist/esm/exports/solana.js.map +1 -0
  69. package/dist/esm/types.d.ts +28 -4
  70. package/dist/esm/types.js.map +1 -1
  71. package/dist/esm/utils/assertions.d.ts +4 -2
  72. package/dist/esm/utils/assertions.js +6 -0
  73. package/dist/esm/utils/assertions.js.map +1 -1
  74. package/dist/esm/utils/capabilities.d.ts +22 -6
  75. package/dist/esm/utils/capabilities.js +19 -2
  76. package/dist/esm/utils/capabilities.js.map +1 -1
  77. package/dist/esm/utils/format.js +1 -1
  78. package/dist/esm/utils/format.js.map +1 -1
  79. package/dist/esm/utils/schema.d.ts +14 -14
  80. package/dist/esm/utils/schema.js +35 -39
  81. package/dist/esm/utils/schema.js.map +1 -1
  82. package/dist/esm/version.d.ts +1 -1
  83. package/dist/esm/version.js +1 -1
  84. package/dist/esm/version.js.map +1 -1
  85. package/dist/types/actions/prepareCalls.d.ts +8 -3
  86. package/dist/types/actions/prepareCalls.d.ts.map +1 -1
  87. package/dist/types/actions/requestAccount.d.ts +4 -3
  88. package/dist/types/actions/requestAccount.d.ts.map +1 -1
  89. package/dist/types/actions/sendPreparedCalls.d.ts +3 -1
  90. package/dist/types/actions/sendPreparedCalls.d.ts.map +1 -1
  91. package/dist/types/actions/signSignatureRequest.d.ts +4 -4
  92. package/dist/types/actions/signSignatureRequest.d.ts.map +1 -1
  93. package/dist/types/actions/signTypedData.d.ts +14 -4
  94. package/dist/types/actions/signTypedData.d.ts.map +1 -1
  95. package/dist/types/actions/solana/getCallsStatus.d.ts +25 -0
  96. package/dist/types/actions/solana/getCallsStatus.d.ts.map +1 -0
  97. package/dist/types/actions/solana/prepareCalls.d.ts +47 -0
  98. package/dist/types/actions/solana/prepareCalls.d.ts.map +1 -0
  99. package/dist/types/actions/solana/sendCalls.d.ts +35 -0
  100. package/dist/types/actions/solana/sendCalls.d.ts.map +1 -0
  101. package/dist/types/actions/solana/sendPreparedCalls.d.ts +25 -0
  102. package/dist/types/actions/solana/sendPreparedCalls.d.ts.map +1 -0
  103. package/dist/types/actions/solana/signPreparedCalls.d.ts +24 -0
  104. package/dist/types/actions/solana/signPreparedCalls.d.ts.map +1 -0
  105. package/dist/types/actions/solana/signSignatureRequest.d.ts +11 -0
  106. package/dist/types/actions/solana/signSignatureRequest.d.ts.map +1 -0
  107. package/dist/types/actions/solana/waitForCallsStatus.d.ts +25 -0
  108. package/dist/types/actions/solana/waitForCallsStatus.d.ts.map +1 -0
  109. package/dist/types/adapters/SolanaSignerError.d.ts +5 -0
  110. package/dist/types/adapters/SolanaSignerError.d.ts.map +1 -0
  111. package/dist/types/adapters/fromKeypair.d.ts +22 -0
  112. package/dist/types/adapters/fromKeypair.d.ts.map +1 -0
  113. package/dist/types/adapters/fromKitSigner.d.ts +22 -0
  114. package/dist/types/adapters/fromKitSigner.d.ts.map +1 -0
  115. package/dist/types/adapters/fromWalletAdapter.d.ts +27 -0
  116. package/dist/types/adapters/fromWalletAdapter.d.ts.map +1 -0
  117. package/dist/types/adapters/fromWalletStandard.d.ts +32 -0
  118. package/dist/types/adapters/fromWalletStandard.d.ts.map +1 -0
  119. package/dist/types/adapters/resolveSignerSlot.d.ts +11 -0
  120. package/dist/types/adapters/resolveSignerSlot.d.ts.map +1 -0
  121. package/dist/types/client.d.ts +29 -14
  122. package/dist/types/client.d.ts.map +1 -1
  123. package/dist/types/decorators/solanaSmartWalletActions.d.ts +17 -0
  124. package/dist/types/decorators/solanaSmartWalletActions.d.ts.map +1 -0
  125. package/dist/types/experimental/actions/requestQuoteV0.d.ts +34 -7
  126. package/dist/types/experimental/actions/requestQuoteV0.d.ts.map +1 -1
  127. package/dist/types/exports/index.d.ts +3 -3
  128. package/dist/types/exports/index.d.ts.map +1 -1
  129. package/dist/types/exports/solana.d.ts +25 -0
  130. package/dist/types/exports/solana.d.ts.map +1 -0
  131. package/dist/types/types.d.ts +28 -4
  132. package/dist/types/types.d.ts.map +1 -1
  133. package/dist/types/utils/assertions.d.ts +4 -2
  134. package/dist/types/utils/assertions.d.ts.map +1 -1
  135. package/dist/types/utils/capabilities.d.ts +22 -6
  136. package/dist/types/utils/capabilities.d.ts.map +1 -1
  137. package/dist/types/utils/schema.d.ts +14 -14
  138. package/dist/types/utils/schema.d.ts.map +1 -1
  139. package/dist/types/version.d.ts +1 -1
  140. package/package.json +26 -9
  141. package/src/actions/prepareCalls.ts +21 -3
  142. package/src/actions/requestAccount.ts +7 -5
  143. package/src/actions/sendPreparedCalls.ts +4 -1
  144. package/src/actions/signPreparedCalls.ts +1 -1
  145. package/src/actions/signSignatureRequest.ts +8 -8
  146. package/src/actions/signTypedData.ts +15 -12
  147. package/src/actions/solana/getCallsStatus.ts +79 -0
  148. package/src/actions/solana/prepareCalls.ts +120 -0
  149. package/src/actions/solana/sendCalls.ts +66 -0
  150. package/src/actions/solana/sendPreparedCalls.ts +65 -0
  151. package/src/actions/solana/signPreparedCalls.ts +50 -0
  152. package/src/actions/solana/signSignatureRequest.ts +63 -0
  153. package/src/actions/solana/waitForCallsStatus.ts +84 -0
  154. package/src/adapters/SolanaSignerError.ts +5 -0
  155. package/src/adapters/fromKeypair.ts +58 -0
  156. package/src/adapters/fromKitSigner.ts +82 -0
  157. package/src/adapters/fromWalletAdapter.ts +58 -0
  158. package/src/adapters/fromWalletStandard.ts +100 -0
  159. package/src/adapters/resolveSignerSlot.ts +46 -0
  160. package/src/client.ts +131 -18
  161. package/src/decorators/smartWalletActions.ts +2 -2
  162. package/src/decorators/solanaSmartWalletActions.ts +62 -0
  163. package/src/experimental/actions/requestQuoteV0.ts +26 -11
  164. package/src/exports/index.ts +8 -4
  165. package/src/exports/solana.ts +36 -0
  166. package/src/types.ts +38 -7
  167. package/src/utils/assertions.ts +17 -2
  168. package/src/utils/capabilities.ts +40 -8
  169. package/src/utils/format.ts +1 -1
  170. package/src/utils/schema.ts +58 -69
  171. package/src/version.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AACA,mBAAmB,0BAA0B,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,mBAAmB,+BAA+B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,mBAAmB,gCAAgC,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,mBAAmB,4BAA4B,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,mBAAmB,4BAA4B,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,mBAAmB,2BAA2B,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,mBAAmB,8BAA8B,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,mBAAmB,yBAAyB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,mBAAmB,iCAAiC,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,mBAAmB,2BAA2B,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,mBAAmB,iCAAiC,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,mBAAmB,oCAAoC,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,mBAAmB,6BAA6B,CAA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E,MAAM,iCAAiC,CAAC;AACpE,mBAAmB,2BAA2B,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,mBAAmB,iCAAiC,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,mBAAmB,oCAAoC,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,mBAAmB,6BAA6B,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,mBAAmB,iCAAiC,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGzE,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,gCAAgC,EAChC,mCAAmC,EACnC,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,25 @@
1
+ export type * from "../actions/solana/prepareCalls.js";
2
+ export { prepareCalls } from "../actions/solana/prepareCalls.js";
3
+ export type * from "../actions/solana/signPreparedCalls.js";
4
+ export { signPreparedCalls } from "../actions/solana/signPreparedCalls.js";
5
+ export type * from "../actions/solana/sendPreparedCalls.js";
6
+ export { sendPreparedCalls } from "../actions/solana/sendPreparedCalls.js";
7
+ export type * from "../actions/solana/sendCalls.js";
8
+ export { sendCalls } from "../actions/solana/sendCalls.js";
9
+ export type * from "../actions/solana/getCallsStatus.js";
10
+ export { getCallsStatus } from "../actions/solana/getCallsStatus.js";
11
+ export type * from "../actions/solana/waitForCallsStatus.js";
12
+ export { waitForCallsStatus } from "../actions/solana/waitForCallsStatus.js";
13
+ export type { SolanaSmartWalletActions } from "../decorators/solanaSmartWalletActions.js";
14
+ export { solanaSmartWalletActions } from "../decorators/solanaSmartWalletActions.js";
15
+ export { SolanaSignerError } from "../adapters/SolanaSignerError.js";
16
+ export { fromKeypair } from "../adapters/fromKeypair.js";
17
+ export type { SolanaKeypairSigner } from "../adapters/fromKeypair.js";
18
+ export { fromKitSigner } from "../adapters/fromKitSigner.js";
19
+ export type { SolanaTransactionPartialSigner } from "../adapters/fromKitSigner.js";
20
+ export { fromWalletAdapter } from "../adapters/fromWalletAdapter.js";
21
+ export type { WalletAdapterSigner } from "../adapters/fromWalletAdapter.js";
22
+ export { fromWalletStandard } from "../adapters/fromWalletStandard.js";
23
+ export type { WalletStandardWallet, WalletStandardAccount, } from "../adapters/fromWalletStandard.js";
24
+ export type { SolanaSigner, SolanaSmartWalletClient } from "../types.js";
25
+ //# sourceMappingURL=solana.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../src/exports/solana.ts"],"names":[],"mappings":"AACA,mBAAmB,mCAAmC,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,mBAAmB,wCAAwC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,mBAAmB,wCAAwC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,mBAAmB,gCAAgC,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,mBAAmB,qCAAqC,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,mBAAmB,yCAAyC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAG7E,YAAY,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAGrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,YAAY,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,YAAY,EACV,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,mCAAmC,CAAC;AAG3C,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,20 +1,44 @@
1
1
  import type { WalletServerViemRpcSchema } from "@alchemy/wallet-api-types/rpc";
2
+ import type { SolanaChainId } from "@alchemy/wallet-api-types";
2
3
  import type { Account, Address, Chain, Client, Hex, JsonRpcAccount, Transport, WalletClient, LocalAccount } from "viem";
3
4
  import type { InternalState } from "./internal";
4
5
  import type { SmartWalletActions } from "./decorators/smartWalletActions";
6
+ import type { SolanaSmartWalletActions } from "./decorators/solanaSmartWalletActions";
5
7
  export type BaseWalletClient<TExtend extends {
6
8
  [key: string]: unknown;
7
9
  } | undefined = {
8
10
  [key: string]: unknown;
9
- } | undefined> = Client<Transport<"alchemyHttp">, Chain, JsonRpcAccount<Address>, WalletServerViemRpcSchema, TExtend>;
11
+ } | undefined, TAccount extends Account | undefined = JsonRpcAccount<Address>> = Client<Transport<"alchemyHttp">, Chain, TAccount, WalletServerViemRpcSchema, TExtend>;
12
+ export type SignerClient = WalletClient<Transport, Chain | undefined, Account>;
13
+ export type SmartWalletSigner = LocalAccount | SignerClient;
14
+ export type SmartWalletClient = BaseWalletClient<SmartWalletActions>;
15
+ export type SolanaSmartWalletClient = BaseWalletClient<SolanaSmartWalletActions & {
16
+ solanaAccount: string;
17
+ }, undefined>;
18
+ /** Solana signer interface. Takes serialized tx bytes, returns signed serialized tx bytes. */
19
+ export interface SolanaSigner {
20
+ address: string;
21
+ signTransaction(input: {
22
+ transaction: Uint8Array;
23
+ [key: string]: unknown;
24
+ }): Promise<{
25
+ signedTransaction: Uint8Array;
26
+ }>;
27
+ }
28
+ export interface SolanaChainDef extends Chain {
29
+ solanaChainId: SolanaChainId;
30
+ }
10
31
  export type InnerWalletApiClient = BaseWalletClient<{
11
32
  internal: InternalState | undefined;
12
33
  owner: SmartWalletSigner;
13
34
  policyIds?: string[];
14
35
  }>;
15
- export type SignerClient = WalletClient<Transport, Chain | undefined, Account>;
16
- export type SmartWalletSigner = LocalAccount | SignerClient;
17
- export type SmartWalletClient = BaseWalletClient<SmartWalletActions>;
36
+ export type InnerSolanaWalletApiClient = BaseWalletClient<{
37
+ internal: InternalState | undefined;
38
+ owner: SolanaSigner;
39
+ solanaAccount: string;
40
+ policyIds?: string[];
41
+ }, undefined>;
18
42
  export type OptionalChainId<T> = T extends {
19
43
  chainId: number;
20
44
  } ? Omit<T, "chainId"> & {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EACH,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,EACb,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE1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;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACrD,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GAChD,CAAC,CAAC;AAEN,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,UAAU,EAAE,GAAG,CAAA;CAAE,GAC5D,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,GACrB,CAAC,CAAC;AAEN,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAEvC,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,GAChE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,KAAK,CAAC"}
@@ -1,5 +1,5 @@
1
- import type { Client, LocalAccount } from "viem";
2
- import type { InnerWalletApiClient, SignerClient } from "../types.js";
1
+ import type { Chain, Client, LocalAccount } from "viem";
2
+ import type { InnerWalletApiClient, InnerSolanaWalletApiClient, SignerClient, SolanaChainDef } from "../types.js";
3
3
  /**
4
4
  * Type guard function to check if a client is an Alchemy Smart Wallet Client.
5
5
  *
@@ -7,6 +7,7 @@ import type { InnerWalletApiClient, SignerClient } from "../types.js";
7
7
  * @returns {boolean} True if the client is an Alchemy Smart Wallet Client
8
8
  */
9
9
  export declare function isSmartWalletClient(client: Client): client is InnerWalletApiClient;
10
+ export declare function isSolanaClient(client: Client): client is InnerSolanaWalletApiClient;
10
11
  /**
11
12
  * Assertion function that throws an error if the client is not an Alchemy Smart Wallet Client.
12
13
  * After this function returns successfully, TypeScript will narrow the client type.
@@ -16,6 +17,7 @@ export declare function isSmartWalletClient(client: Client): client is InnerWall
16
17
  * @throws {Error} Throws an error if the client is not an Alchemy Smart Wallet Client
17
18
  */
18
19
  export declare function assertSmartWalletClient(client: Client, message?: string): asserts client is InnerWalletApiClient;
20
+ export declare function isSolanaChain(chain: Chain): chain is SolanaChainDef;
19
21
  export declare function isLocalAccount(signer: LocalAccount | SignerClient): signer is LocalAccount;
20
22
  export declare function isSignerClient(signer: LocalAccount | SignerClient): signer is SignerClient;
21
23
  //# sourceMappingURL=assertions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../../src/utils/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGtE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,GACb,MAAM,IAAI,oBAAoB,CAEhC;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,SAA4C,GAClD,OAAO,CAAC,MAAM,IAAI,oBAAoB,CAIxC;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,GAAG,YAAY,GAClC,MAAM,IAAI,YAAY,CAExB;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,GAAG,YAAY,GAClC,MAAM,IAAI,YAAY,CAExB"}
1
+ {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../../src/utils/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,YAAY,EACZ,cAAc,EACf,MAAM,aAAa,CAAC;AAGrB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,GACb,MAAM,IAAI,oBAAoB,CAEhC;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GACb,MAAM,IAAI,0BAA0B,CAEtC;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,SAA4C,GAClD,OAAO,CAAC,MAAM,IAAI,oBAAoB,CAIxC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAEnE;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,GAAG,YAAY,GAClC,MAAM,IAAI,YAAY,CAExB;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,GAAG,YAAY,GAClC,MAAM,IAAI,YAAY,CAExB"}
@@ -1,12 +1,12 @@
1
1
  import { PrepareCallsCapabilities as PrepareCallsCapabilitiesSchema, SendPreparedCallsCapabilities as SendPreparedCallsCapabilitiesSchema } from "@alchemy/wallet-api-types/capabilities";
2
- import type { StaticDecode } from "typebox";
3
- import type { InnerWalletApiClient } from "../types.js";
2
+ import type { z } from "zod";
3
+ import type { InnerWalletApiClient, InnerSolanaWalletApiClient } from "../types.js";
4
4
  /**
5
5
  * Decoded capabilities matching the schema shape (uses `paymasterService` key).
6
6
  * `ResolveCapabilities` renames this to `paymaster` for client-facing types.
7
7
  */
8
- type DecodedPrepareCallsCaps = StaticDecode<typeof PrepareCallsCapabilitiesSchema>;
9
- type DecodedSendPreparedCallsCaps = StaticDecode<typeof SendPreparedCallsCapabilitiesSchema>;
8
+ type DecodedPrepareCallsCaps = z.output<typeof PrepareCallsCapabilitiesSchema>;
9
+ type DecodedSendPreparedCallsCaps = z.output<typeof SendPreparedCallsCapabilitiesSchema>;
10
10
  /**
11
11
  * Renames `paymasterService` (RPC) to `paymaster` in a capabilities type. This
12
12
  * is because our RPC schema's paymasterService capability does not exactly match
@@ -31,14 +31,14 @@ export type WithCapabilities<T> = T extends {
31
31
  } : T;
32
32
  /**
33
33
  * Converts capabilities (with `paymaster`) to RPC capabilities (with `paymasterService`)
34
- * for use with Value.Encode before sending to the RPC.
34
+ * for use with `encode` before sending to the RPC.
35
35
  *
36
36
  * @param {PrepareCallsCapabilities | SendPreparedCallsCapabilities | undefined} capabilities - Capabilities object containing a `paymaster` field
37
37
  * @returns {DecodedPrepareCallsCaps | DecodedSendPreparedCallsCaps | undefined} RPC capabilities with `paymasterService`, or undefined if input is undefined
38
38
  */
39
39
  export declare function toRpcCapabilities(capabilities: PrepareCallsCapabilities | SendPreparedCallsCapabilities | undefined): DecodedPrepareCallsCaps | DecodedSendPreparedCallsCaps | undefined;
40
40
  /**
41
- * Converts RPC capabilities (with `paymasterService`) from Value.Decode
41
+ * Converts RPC capabilities (with `paymasterService`) from `decode`
42
42
  * to capabilities (with `paymaster`).
43
43
  *
44
44
  * @param {DecodedPrepareCallsCaps | DecodedSendPreparedCallsCaps | undefined} capabilities - RPC capabilities object containing a `paymasterService` field
@@ -54,6 +54,22 @@ export declare function fromRpcCapabilities(capabilities: DecodedPrepareCallsCap
54
54
  * @returns {T | undefined} The merged capabilities object, or original capabilities if no capability configuration exists on the client
55
55
  */
56
56
  export declare const mergeClientCapabilities: <T extends PrepareCallsCapabilities | SendPreparedCallsCapabilities>(client: InnerWalletApiClient, capabilities: T | undefined) => T | undefined;
57
+ export type SolanaPaymasterCapability = {
58
+ policyId: string;
59
+ webhookData?: string;
60
+ };
61
+ export type SolanaPrepareCallsCapabilities = {
62
+ paymaster?: SolanaPaymasterCapability;
63
+ };
64
+ /**
65
+ * Merges Solana client-level capabilities (policyId from factory) with
66
+ * request-level capabilities. Request-level takes priority if provided.
67
+ *
68
+ * @param {InnerSolanaWalletApiClient} client - The Solana wallet API client
69
+ * @param {SolanaPrepareCallsCapabilities | undefined} capabilities - Request capabilities to merge with
70
+ * @returns {SolanaPrepareCallsCapabilities | undefined} The merged capabilities
71
+ */
72
+ export declare const mergeSolanaClientCapabilities: (client: InnerSolanaWalletApiClient, capabilities: SolanaPrepareCallsCapabilities | undefined) => SolanaPrepareCallsCapabilities | undefined;
57
73
  /**
58
74
  * Extracts capabilities from prepareCalls that are usable for sendPreparedCalls.
59
75
  * Only permissions and paymaster (policyId/policyIds & webhookData) are supported.
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/utils/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,IAAI,8BAA8B,EAC1D,6BAA6B,IAAI,mCAAmC,EACrE,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD;;;GAGG;AACH,KAAK,uBAAuB,GAAG,YAAY,CACzC,OAAO,8BAA8B,CACtC,CAAC;AACF,KAAK,4BAA4B,GAAG,YAAY,CAC9C,OAAO,mCAAmC,CAC3C,CAAC;AAEF;;;;;GAKG;AACH,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAC;CAC5B,GACG,IAAI,CAAC,CAAC,EAAE,kBAAkB,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,CAAC,CAAA;CAAE,GAC/C,CAAC,CAAC;AAEN,MAAM,MAAM,wBAAwB,GAClC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC;AAE/C,MAAM,MAAM,6BAA6B,GACvC,mBAAmB,CAAC,4BAA4B,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;CACxB,GACG,IAAI,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG;IACxB,YAAY,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CACpD,GACD,CAAC,CAAC;AAcN;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EACR,wBAAwB,GACxB,6BAA6B,GAC7B,SAAS,GACZ,uBAAuB,GAAG,4BAA4B,GA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uple, StaticDecode, StaticEncode } from "typebox";
1
+ import { z } from "zod";
2
2
  /** Constraint for RPC method schemas from `@alchemy/wallet-api-types/rpc`. */
3
- type RpcMethodSchema = TObject<{
4
- Request: TObject<{
5
- method: TSchema;
6
- params: TTuple<[TSchema, ...TSchema[]]>;
3
+ type RpcMethodSchema = z.ZodObject<{
4
+ Request: z.ZodObject<{
5
+ method: z.ZodType;
6
+ params: z.ZodTuple<[z.ZodType, ...z.ZodType[]]>;
7
7
  }>;
8
- ReturnType: TSchema;
8
+ ReturnType: z.ZodType;
9
9
  }>;
10
- export declare function methodSchema<TReq extends TSchema, TRes extends TSchema>(schema: TObject<{
11
- Request: TObject<{
12
- method: TSchema;
13
- params: TTuple<[TReq, ...TSchema[]]>;
10
+ export declare function methodSchema<TReq extends z.ZodType, TRes extends z.ZodType>(schema: z.ZodObject<{
11
+ Request: z.ZodObject<{
12
+ method: z.ZodType;
13
+ params: z.ZodTuple<[TReq, ...z.ZodType[]]>;
14
14
  }>;
15
15
  ReturnType: TRes;
16
16
  }>): {
@@ -18,10 +18,10 @@ export declare function methodSchema<TReq extends TSchema, TRes extends TSchema>
18
18
  response: TRes;
19
19
  };
20
20
  /** Extracts the decoded params type from a method schema. */
21
- export type MethodParams<T extends RpcMethodSchema> = StaticDecode<T["properties"]["Request"]["properties"]["params"]["items"][0]>;
21
+ export type MethodParams<T extends RpcMethodSchema> = z.output<T["shape"]["Request"]["shape"]["params"]["def"]["items"][0]>;
22
22
  /** Extracts the decoded response type from a method schema. */
23
- export type MethodResponse<T extends RpcMethodSchema> = StaticDecode<T["properties"]["ReturnType"]>;
24
- export declare function encode<const T extends TSchema>(schema: T, value: StaticDecode<T>): StaticEncode<T>;
25
- export declare function decode<const T extends TSchema>(schema: T, value: StaticEncode<T>): StaticDecode<T>;
23
+ export type MethodResponse<T extends RpcMethodSchema> = z.output<T["shape"]["ReturnType"]>;
24
+ export declare function encode<const T extends z.ZodType>(schema: T, value: z.output<T>): z.input<T>;
25
+ export declare function decode<const T extends z.ZodType>(schema: T, value: z.input<T>): z.output<T>;
26
26
  export {};
27
27
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,YAAY,EACZ,YAAY,EACb,MAAM,SAAS,CAAC;AAIjB,8EAA8E;AAC9E,KAAK,eAAe,GAAG,OAAO,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;QACf,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;KACzC,CAAC,CAAC;IACH,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,IAAI,SAAS,OAAO,EACrE,MAAM,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAA;KAAE,CAAC,CAAC;IAC5E,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC,GACD;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,CAKnC;AAED,6DAA6D;AAC7D,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,eAAe,IAAI,YAAY,CAChE,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAC/D,CAAC;AAEF,+DAA+D;AAC/D,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,eAAe,IAAI,YAAY,CAClE,CAAC,CAAC,YAAY,CAAC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E,IAAI,CAAC;IAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,CAKnC;AAED,6DAA6D;AAC7D,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,CAAC,MAAM,CAC5D,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC;AAEF,+DAA+D;AAC/D,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,CAAC,MAAM,CAC9D,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CACzB,CAAC;AAiCF,wBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAC9C,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GACjB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAWZ;AAED,wBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAC9C,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAChB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAWb"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.0.0-beta.27";
1
+ export declare const VERSION = "5.0.0-beta.28";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@alchemy/wallet-apis",
3
- "version": "5.0.0-beta.28",
3
+ "version": "5.0.0-beta.29",
4
4
  "description": "Alchemy Wallet APIs",
5
5
  "author": "Alchemy",
6
6
  "license": "MIT",
7
7
  "private": false,
8
8
  "type": "module",
9
- "main": "./dist/esm/index.js",
10
- "module": "./dist/esm/index.js",
11
- "types": "./dist/types/index.d.ts",
12
- "typings": "./dist/types/index.d.ts",
9
+ "main": "./dist/esm/exports/index.js",
10
+ "module": "./dist/esm/exports/index.js",
11
+ "types": "./dist/types/exports/index.d.ts",
12
+ "typings": "./dist/types/exports/index.d.ts",
13
13
  "sideEffects": false,
14
14
  "files": [
15
15
  "dist",
@@ -37,6 +37,11 @@
37
37
  "import": "./dist/esm/exports/internal.js",
38
38
  "default": "./dist/esm/exports/internal.js"
39
39
  },
40
+ "./solana": {
41
+ "types": "./dist/types/exports/solana.d.ts",
42
+ "import": "./dist/esm/exports/solana.js",
43
+ "default": "./dist/esm/exports/solana.js"
44
+ },
40
45
  "./package.json": "./package.json"
41
46
  },
42
47
  "scripts": {
@@ -49,21 +54,33 @@
49
54
  "test:run": "vitest run"
50
55
  },
51
56
  "devDependencies": {
57
+ "@solana/kit": "^6.8.0",
58
+ "@solana/web3.js": "^1.98.4",
52
59
  "@types/deep-equal": "^1.0.4",
53
60
  "abitype": "^1.0.0",
54
61
  "typescript-template": "workspace:*",
55
62
  "viem": "^2.45.0"
56
63
  },
57
64
  "dependencies": {
58
- "@alchemy/common": "5.0.0-beta.28",
59
- "@alchemy/wallet-api-types": "0.1.0-alpha.27",
65
+ "@alchemy/common": "5.0.0-beta.29",
66
+ "@alchemy/wallet-api-types": "0.2.0-alpha.1",
60
67
  "deep-equal": "^2.2.3",
61
68
  "ox": "^0.11.1",
62
- "typebox": "1.0.81"
69
+ "zod": "^4.4.1"
63
70
  },
64
71
  "peerDependencies": {
72
+ "@solana/kit": ">=6.0.0",
73
+ "@solana/web3.js": "^1.95.0",
65
74
  "viem": "^2.45.0"
66
75
  },
76
+ "peerDependenciesMeta": {
77
+ "@solana/kit": {
78
+ "optional": true
79
+ },
80
+ "@solana/web3.js": {
81
+ "optional": true
82
+ }
83
+ },
67
84
  "publishConfig": {
68
85
  "access": "public",
69
86
  "registry": "https://registry.npmjs.org/"
@@ -76,5 +93,5 @@
76
93
  "url": "https://github.com/alchemyplatform/aa-sdk/issues"
77
94
  },
78
95
  "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
79
- "gitHead": "cda39f81987f118b0a910a934b4b140b9e08c62f"
96
+ "gitHead": "a4870f6b5f53640ef54b18618053ff8771eea024"
80
97
  }
@@ -1,5 +1,6 @@
1
1
  import type { Address, Prettify } from "viem";
2
2
  import type { DistributiveOmit, InnerWalletApiClient } from "../types.ts";
3
+ import { BaseError } from "@alchemy/common";
3
4
  import { LOGGER } from "../logger.js";
4
5
  import {
5
6
  fromRpcCapabilities,
@@ -9,18 +10,29 @@ import {
9
10
  type WithCapabilities,
10
11
  } from "../utils/capabilities.js";
11
12
  import { resolveAddress, type AccountParam } from "../utils/resolve.js";
13
+ import { PrepareCallsParams as EvmPrepareCallsSchema } from "@alchemy/wallet-api-types";
14
+ import type { z } from "zod";
12
15
  import { wallet_prepareCalls as MethodSchema } from "@alchemy/wallet-api-types/rpc";
13
16
  import {
14
17
  methodSchema,
15
18
  encode,
16
19
  decode,
17
- type MethodParams,
18
20
  type MethodResponse,
19
21
  } from "../utils/schema.js";
20
22
 
21
23
  const schema = methodSchema(MethodSchema);
22
- type BasePrepareCallsParams = MethodParams<typeof MethodSchema>;
23
- type PrepareCallsResponse = MethodResponse<typeof MethodSchema>;
24
+ type BasePrepareCallsParams = z.output<typeof EvmPrepareCallsSchema>;
25
+ type FullPrepareCallsResponse = MethodResponse<typeof MethodSchema>;
26
+ type PrepareCallsResponse = Exclude<
27
+ FullPrepareCallsResponse,
28
+ { type: "solana-transaction-v0" }
29
+ >;
30
+
31
+ function isEvmResponse(
32
+ response: FullPrepareCallsResponse,
33
+ ): response is PrepareCallsResponse {
34
+ return response.type !== "solana-transaction-v0";
35
+ }
24
36
 
25
37
  export type PrepareCallsParams = Prettify<
26
38
  WithCapabilities<
@@ -112,6 +124,12 @@ export async function prepareCalls(
112
124
  LOGGER.debug("prepareCalls:done");
113
125
  const decoded = decode(schema.response, rpcResp);
114
126
 
127
+ if (!isEvmResponse(decoded)) {
128
+ throw new BaseError(
129
+ `Unexpected Solana response from EVM prepareCalls: ${decoded.type}`,
130
+ );
131
+ }
132
+
115
133
  // Transform paymaster-permit modifiedRequest from RPC format to client format:
116
134
  // - `from` (RPC) → `account` (client)
117
135
  // - `capabilities.paymasterService` (RPC) → `capabilities.paymaster` (client)
@@ -2,7 +2,7 @@ import type { Address } from "abitype";
2
2
  import { isAddressEqual, type JsonRpcAccount, type Prettify } from "viem";
3
3
  import { wallet_requestAccount as MethodSchema } from "@alchemy/wallet-api-types/rpc";
4
4
  import deepEqual from "deep-equal";
5
- import type { DistributiveOmit, InnerWalletApiClient } from "../types";
5
+ import type { InnerWalletApiClient } from "../types";
6
6
  import { LOGGER } from "../logger.js";
7
7
  import { isLocalAccount } from "../utils/assertions.js";
8
8
  import {
@@ -15,11 +15,13 @@ import {
15
15
  const schema = methodSchema(MethodSchema);
16
16
  type BaseRequestAccountParams = MethodParams<typeof MethodSchema>;
17
17
 
18
+ type SignerAddressParams = Extract<
19
+ BaseRequestAccountParams,
20
+ { signerAddress: Address }
21
+ >;
22
+
18
23
  export type RequestAccountParams = Prettify<
19
- DistributiveOmit<
20
- Extract<BaseRequestAccountParams, { signerAddress: Address }>,
21
- "signerAddress" | "includeCounterfactualInfo"
22
- > &
24
+ Pick<SignerAddressParams, "id" | "creationHint"> &
23
25
  (
24
26
  | { signerAddress?: Address; accountAddress?: never }
25
27
  | { signerAddress?: never; accountAddress: Address }
@@ -16,7 +16,10 @@ import {
16
16
  } from "../utils/schema.js";
17
17
 
18
18
  const schema = methodSchema(MethodSchema);
19
- type BaseSendPreparedCallsParams = MethodParams<typeof MethodSchema>;
19
+ type BaseSendPreparedCallsParams = Exclude<
20
+ MethodParams<typeof MethodSchema>,
21
+ { type: "solana-transaction-v0" }
22
+ >;
20
23
  type SendPreparedCallsResponse = MethodResponse<typeof MethodSchema>;
21
24
 
22
25
  export type SendPreparedCallsParams = Prettify<
@@ -86,7 +86,7 @@ export async function signPreparedCalls(
86
86
  };
87
87
 
88
88
  const signUserOperationCall = async (call: UserOpCall) => {
89
- const { signatureRequest, ...rest } = call;
89
+ const { signatureRequest, feePayment: _feePayment, ...rest } = call;
90
90
 
91
91
  if (!signatureRequest) {
92
92
  LOGGER.warn("signPreparedCalls:missing-signatureRequest", {
@@ -1,8 +1,8 @@
1
1
  import { type Hex, type Prettify, serializeSignature } from "viem";
2
2
  import {
3
- type PersonalSignSignatureRequest,
4
- type TypedDataSignatureRequest,
5
- type AuthorizationSignatureRequest,
3
+ PersonalSignSignatureRequest,
4
+ TypedDataSignatureRequest,
5
+ AuthorizationSignatureRequest,
6
6
  Eip7702UnsignedAuth,
7
7
  } from "@alchemy/wallet-api-types";
8
8
  import { vToYParity } from "ox/Signature";
@@ -17,14 +17,14 @@ import { isLocalAccount } from "../utils/assertions.js";
17
17
  import { getAction } from "viem/utils";
18
18
  import { signAuthorization, signMessage, signTypedData } from "viem/actions";
19
19
  import type { LocalAccount } from "viem";
20
- import type { StaticDecode } from "typebox";
20
+ import type { z } from "zod";
21
21
 
22
22
  export type SignSignatureRequestParams = Prettify<
23
23
  WithoutRawPayload<
24
- | PersonalSignSignatureRequest
25
- | TypedDataSignatureRequest
26
- | (AuthorizationSignatureRequest & {
27
- data: StaticDecode<typeof Eip7702UnsignedAuth>;
24
+ | z.output<typeof PersonalSignSignatureRequest>
25
+ | z.output<typeof TypedDataSignatureRequest>
26
+ | (z.output<typeof AuthorizationSignatureRequest> & {
27
+ data: z.output<typeof Eip7702UnsignedAuth>;
28
28
  })
29
29
  >
30
30
  >;
@@ -1,9 +1,4 @@
1
- import {
2
- type Hex,
3
- type Prettify,
4
- type TypedData,
5
- type TypedDataDefinition,
6
- } from "viem";
1
+ import { type Address as ViemAddress, type Hex, type TypedData } from "viem";
7
2
  import type { InnerWalletApiClient } from "../types.ts";
8
3
  import { prepareSign } from "./prepareSign.js";
9
4
  import { signSignatureRequest } from "./signSignatureRequest.js";
@@ -12,13 +7,21 @@ import { typedDataToJsonSafe } from "../utils/format.js";
12
7
  import { LOGGER } from "../logger.js";
13
8
  import { resolveAddress, type AccountParam } from "../utils/resolve.js";
14
9
 
15
- export type SignTypedDataParams = Prettify<
16
- TypedDataDefinition<TypedData | Record<string, unknown>> & {
17
- account?: AccountParam;
18
- }
19
- >;
10
+ export type SignTypedDataParams = {
11
+ domain?: {
12
+ name?: string;
13
+ version?: string;
14
+ chainId?: number | bigint;
15
+ verifyingContract?: ViemAddress;
16
+ salt?: Hex;
17
+ };
18
+ types: TypedData | Record<string, unknown>;
19
+ primaryType: string;
20
+ message: Record<string, unknown>;
21
+ account?: AccountParam;
22
+ };
20
23
 
21
- export type SignTypedDataResult = Prettify<Hex>;
24
+ export type SignTypedDataResult = Hex;
22
25
 
23
26
  /**
24
27
  * Signs typed data (EIP-712) using the smart account.
@@ -0,0 +1,79 @@
1
+ import type { Hex } from "viem";
2
+ import { BaseError } from "@alchemy/common";
3
+ import type { InnerSolanaWalletApiClient } from "../../types.js";
4
+ import { LOGGER } from "../../logger.js";
5
+ import { wallet_getCallsStatus as MethodSchema } from "@alchemy/wallet-api-types/rpc";
6
+ import {
7
+ methodSchema,
8
+ decode,
9
+ type MethodResponse,
10
+ } from "../../utils/schema.js";
11
+
12
+ const schema = methodSchema(MethodSchema);
13
+ type GetCallsStatusResponse = MethodResponse<typeof MethodSchema>;
14
+
15
+ type SolanaGetCallsStatusResponse = Extract<
16
+ GetCallsStatusResponse,
17
+ { chainId: `solana:${string}` }
18
+ >;
19
+
20
+ function isSolanaResponse(
21
+ response: GetCallsStatusResponse,
22
+ ): response is SolanaGetCallsStatusResponse {
23
+ return (
24
+ typeof response.chainId === "string" &&
25
+ response.chainId.startsWith("solana:")
26
+ );
27
+ }
28
+
29
+ export type SolanaGetCallsStatusParams = {
30
+ id: Hex;
31
+ };
32
+
33
+ export type SolanaGetCallsStatusResult = Omit<
34
+ SolanaGetCallsStatusResponse,
35
+ "status"
36
+ > & {
37
+ status: "pending" | "success" | "failure";
38
+ statusCode: number;
39
+ };
40
+
41
+ /**
42
+ * Gets the status of a Solana call bundle.
43
+ *
44
+ * @param {InnerSolanaWalletApiClient} client - The Solana wallet API client
45
+ * @param {SolanaGetCallsStatusParams} params - The call ID to check
46
+ * @returns {Promise<SolanaGetCallsStatusResult>} The status of the call
47
+ */
48
+ export async function getCallsStatus(
49
+ client: InnerSolanaWalletApiClient,
50
+ params: SolanaGetCallsStatusParams,
51
+ ): Promise<SolanaGetCallsStatusResult> {
52
+ LOGGER.debug("solana:getCallsStatus:start", { id: params.id });
53
+
54
+ const rpcResp = await client.request({
55
+ method: "wallet_getCallsStatus",
56
+ params: [params.id],
57
+ });
58
+
59
+ const decoded = decode(schema.response, rpcResp);
60
+
61
+ if (!isSolanaResponse(decoded)) {
62
+ throw new BaseError(`Unexpected EVM response from Solana getCallsStatus`);
63
+ }
64
+ const statusCode = decoded.status;
65
+ const status = (() => {
66
+ if (statusCode >= 100 && statusCode < 200) return "pending" as const;
67
+ if (statusCode >= 200 && statusCode < 300) return "success" as const;
68
+ if (statusCode >= 300 && statusCode < 700) return "failure" as const;
69
+ throw new BaseError(`Unknown Solana call status code: ${statusCode}`);
70
+ })();
71
+
72
+ LOGGER.debug("solana:getCallsStatus:done", { status, statusCode });
73
+
74
+ return {
75
+ ...decoded,
76
+ status,
77
+ statusCode,
78
+ };
79
+ }