Skip to Content
dApps

Firma

Detecta el proveedor y solicita una dirección antes de firmar. Usa la passphrase de red que devuelve la red seleccionada en la cartera y datos XDR completos construidos con el SDK de Stellar.

Ejemplos de firma con window.$onekey.stellar.


Firmar una transacción (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 })

Firmar una entrada de autorización (Soroban / entrada de autorización)

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

Firmar un mensaje

const { address } = await stellar.getAddress() const { networkPassphrase } = await stellar.getNetwork() const { signedMessage, signerAddress } = await stellar.signMessage('hello stellar', { networkPassphrase, address, }) console.log({ signedMessage, signerAddress })
Última actualización el