Skip to Content
dApp Integration

Signing

Examples for signing with window.$onekey.stellar.


Sign Transaction (XDR)

const { address } = await stellar.getAddress() const { networkPassphrase } = await stellar.getNetwork() const { signedTxXdr, signerAddress } = await stellar.signTransaction(unsignedXdr, { networkPassphrase, address, // submit: false, // submitUrl: 'https://horizon.stellar.org/transactions', }) console.log({ signedTxXdr, signerAddress })

Sign Auth Entry (Soroban / Authorization Entry)

const { address } = await stellar.getAddress() const { networkPassphrase } = await stellar.getNetwork() const { signedAuthEntry, signerAddress } = await stellar.signAuthEntry(authEntryXdr, { networkPassphrase, address, }) console.log({ signedAuthEntry, signerAddress })

Sign Message

const { address } = await stellar.getAddress() const { networkPassphrase } = await stellar.getNetwork() const { signedMessage, signerAddress } = await stellar.signMessage('hello stellar', { networkPassphrase, address, }) console.log({ signedMessage, signerAddress })
Last updated on