On this page
Getting Started
Detect the provider and request an address before signing. Use the network passphrase returned by the selected wallet network and complete XDR payloads built by the Stellar SDK.
Learn how to detect OneKey’s Stellar provider and request a Stellar address.
Stellar signing typically depends on the correct network passphrase (e.g. Public or Testnet). Make sure you pass the right one when signing.
Provider Detection
const stellar = window.$onekey?.stellar
if (!stellar?.isOneKey) {
throw new Error('OneKey Stellar provider not detected')
}Get Address (Connect)
// Triggers wallet permission / connect flow and returns the address (G...)
const { address } = await stellar.getAddress()
console.log('Address:', address)Get Network
const { network, networkPassphrase } = await stellar.getNetwork()
console.log({ network, networkPassphrase })Last updated on