Sign Universal Message
Overview
Sign arbitrary data with your universal signer, across EVM, Solana, or any supported chain.
Sign Universal Message
pushChainClient.universal.signMessage(message): Promise<string>
// Create message data
const message = new TextEncoder().encode('Hello, Push Chain!')
// Sign the message
const signature = await pushChainClient.universal.signMessage(message)
Returns `signedMessage` <string>
// Signed Message
'0xf10cabddd923cf05578dd253c0642009e7651286171a17b3d40f270f42e97aff56f8941ff9989333c23edb82ae1fad11b1e82b939b9e74a96ae6e3db9ae63e0b1c'
Live Playground: Get back Signed Message
VIRTUAL NODE IDE
Sign Typed Data
pushChainClient.universal.signTypedData({typedData}): Promise<string>
The signTypedData
function signs structured data following the EIP-712 standard. This function is only supported when connected to an EVM compatible chain.
// Sign the message
const signature = await pushChainClient.universal.signTypedData({<TYPED_DATA>})
Returns `signedTypedData` <string>
// Signed Message
'0x9356ffe552cf0bdaa624c5121b1da0598a65b6bba357ba33868f92c9dedd490e1b9757b64af7dd16d5797e0e151fe731858c49defcc04894f53a4ab10429499f1c'
Live Playground: Get back Signed Typed Data
VIRTUAL NODE IDE
Next Steps
- Query on-chain data with our Utility Functions
- Read contract state using the Blockchain State Reader
- Build rich UIs around your signer using the UI Kit