diff --git a/.changeset/proud-pugs-kneel.md b/.changeset/proud-pugs-kneel.md new file mode 100644 index 0000000000..2f23104bae --- /dev/null +++ b/.changeset/proud-pugs-kneel.md @@ -0,0 +1,40 @@ +--- +'@reown/appkit-wallet': patch +'@apps/demo': patch +'@apps/gallery': patch +'@apps/laboratory': patch +'@examples/html-ethers': patch +'@examples/html-ethers5': patch +'@examples/html-wagmi': patch +'@examples/next-ethers': patch +'@examples/next-wagmi': patch +'@examples/next-wagmi-app-router': patch +'@examples/next-wagmi-pages-router': patch +'@examples/react-ethers': patch +'@examples/react-ethers5': patch +'@examples/react-solana': patch +'@examples/react-wagmi': patch +'@examples/vue-ethers5': patch +'@examples/vue-solana': patch +'@examples/vue-wagmi': patch +'@reown/appkit-adapter-ethers': patch +'@reown/appkit-adapter-ethers5': patch +'@reown/appkit-adapter-polkadot': patch +'@reown/appkit-adapter-solana': patch +'@reown/appkit-adapter-wagmi': patch +'@reown/appkit': patch +'@reown/appkit-utils': patch +'@reown/appkit-cdn': patch +'@reown/appkit-common': patch +'@reown/appkit-core': patch +'@reown/appkit-ethers': patch +'@reown/appkit-ethers5': patch +'@reown/appkit-polyfills': patch +'@reown/appkit-scaffold-ui': patch +'@reown/appkit-siwe': patch +'@reown/appkit-solana': patch +'@reown/appkit-ui': patch +'@reown/appkit-wagmi': patch +--- + +Adds FRAME_READY event for W3mFrameProvider diff --git a/packages/wallet/src/W3mFrameConstants.ts b/packages/wallet/src/W3mFrameConstants.ts index 02761eb121..8f0cd8cdb4 100644 --- a/packages/wallet/src/W3mFrameConstants.ts +++ b/packages/wallet/src/W3mFrameConstants.ts @@ -88,6 +88,7 @@ export const W3mFrameConstants = { FRAME_INIT_SMART_ACCOUNT_ERROR: '@w3m-frame/INIT_SMART_ACCOUNT_ERROR', FRAME_SET_PREFERRED_ACCOUNT_SUCCESS: '@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS', FRAME_SET_PREFERRED_ACCOUNT_ERROR: '@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR', + FRAME_READY: '@w3m-frame/READY', RPC_RESPONSE_TYPE_ERROR: 'RPC_RESPONSE_ERROR', RPC_RESPONSE_TYPE_TX: 'RPC_RESPONSE_TRANSACTION_HASH', diff --git a/packages/wallet/src/W3mFrameSchema.ts b/packages/wallet/src/W3mFrameSchema.ts index 7809f9eaa0..d6a6e39b82 100644 --- a/packages/wallet/src/W3mFrameSchema.ts +++ b/packages/wallet/src/W3mFrameSchema.ts @@ -130,6 +130,12 @@ export const FrameInitSmartAccountResponse = z.object({ address: z.string(), isDeployed: z.boolean() }) + +export const FrameReadyResponse = z.object({ + // Placeholder for future data + version: z.string().optional() +}) + export const FrameSetPreferredAccountResponse = z.object({ type: z.string(), address: z.string() }) export const RpcResponse = z.any() @@ -719,4 +725,5 @@ export const W3mFrameSchema = { payload: zError }) ) + .or(EventSchema.extend({ type: zType('FRAME_READY'), payload: FrameReadyResponse })) } diff --git a/packages/wallet/src/W3mFrameTypes.ts b/packages/wallet/src/W3mFrameTypes.ts index edb103800d..186da7e8f7 100644 --- a/packages/wallet/src/W3mFrameTypes.ts +++ b/packages/wallet/src/W3mFrameTypes.ts @@ -72,7 +72,8 @@ import { RpcSolanaSignMessageRequest, RpcSolanaSignTransactionRequest, RpcSolanaSignAndSendTransactionRequest, - RpcSolanaSignAllTransactionsRequest + RpcSolanaSignAllTransactionsRequest, + FrameReadyResponse } from './W3mFrameSchema.js' import type { W3mFrameRpcConstants } from './W3mFrameConstants.js' import type { CaipNetworkId } from '@reown/appkit-common' @@ -128,6 +129,7 @@ export namespace W3mFrameTypes { FrameSetPreferredAccountResponse: z.infer FrameSignOutResponse: undefined FrameRpcResponse: RPCResponse + FrameReadyResponse: z.infer } export interface Network {