diff --git a/packages/blockchain-sdk-solana/examples/e2e-dapp-server.ts b/packages/blockchain-sdk-solana/examples/e2e-dapp-server.ts index 78436e24..f43cf281 100644 --- a/packages/blockchain-sdk-solana/examples/e2e-dapp-server.ts +++ b/packages/blockchain-sdk-solana/examples/e2e-dapp-server.ts @@ -50,6 +50,12 @@ async function main() { .send({ title: 'New notification', message: message.toString(), + actions: [ + { + label: 'Open Dialect', + url: 'https://dialect.io', + }, + ], }) .catch((e) => console.error(e)); } @@ -79,5 +85,5 @@ async function getOrRegisterDapp() { return createdDapp; } - return dapp.messages.send({}); + return dapp; } diff --git a/packages/blockchain-sdk-solana/examples/send-solana-dapp-message.ts b/packages/blockchain-sdk-solana/examples/send-solana-dapp-message.ts index 792c9896..5e7a9161 100644 --- a/packages/blockchain-sdk-solana/examples/send-solana-dapp-message.ts +++ b/packages/blockchain-sdk-solana/examples/send-solana-dapp-message.ts @@ -42,6 +42,15 @@ import { message: 'Hello, world', }); + // Broadcast with metadata + await dapp.messages.send({ + title: 'Hello', + message: 'Hello, world', + // Actions will be displayed in the notification as buttons, e.g. "Demo CTA" button will open "https://dialect.io" in the browser + // NB: Only one action is supported at the moment + actions: [{ label: 'Demo CTA', url: 'https://dialect.io' }], + }); + // Unicast, but only to wallet channel (Dialect, Solflare or Step inboxes) await dapp.messages.send({ title: 'Hello, dialectooooor',