Skip to content

generateNEARStealthMetaAddress()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / generateNEARStealthMetaAddress

Function: generateNEARStealthMetaAddress()

Section titled “Function: generateNEARStealthMetaAddress()”

generateNEARStealthMetaAddress(label?): NEARStealthMetaAddressResult

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:18126

Generate a new NEAR stealth meta-address keypair

The meta-address can be shared publicly. It contains:

  • spendingKey: Used to derive stealth private keys (keep corresponding private key secret!)
  • viewingKey: Used to scan for incoming payments (can share private key with auditors)

string

Optional human-readable label for this meta-address

NEARStealthMetaAddressResult

Meta-address and private keys

const result = generateNEARStealthMetaAddress('My NEAR Wallet')
// Share metaAddress publicly
console.log(result.metaAddress)
// Store private keys securely
saveSecurely(result.spendingPrivateKey)
saveSecurely(result.viewingPrivateKey)