Documentation
¶
Index ¶
- type Key
- func (key Key) Account() string
- func (key Key) GetPublic() ed25519.PublicKey
- func (key Key) ID() string
- func (key Key) PublicKeyStr() string
- func (key Key) Raw() internal.Raw
- func (key Key) Sign(msg []byte) ([]byte, error)
- func (key Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key represents a Stellar (Soroban) key.
Stellar accounts use ed25519 (same primitive as Solana/Aptos), but the account identifier is a StrKey-encoded "G..." address: base32 of (versionByte || ed25519-pubkey || crc16). Using the canonical StrKey encoding is load-bearing: the Stellar relayer/TXM looks signing keys up by that exact "G..." address (loop.Keystore.Sign(account, data)), so ID() must match it byte-for-byte.
func FromEncryptedJSON ¶
FromEncryptedJSON gets key from json and password
func MustNewInsecure ¶
MustNewInsecure returns a Key if no error
func (Key) PublicKeyStr ¶
PublicKeyStr returns the StrKey "G..." account address (canonical string form).
func (Key) Sign ¶
Sign signs a message with the ed25519 private key. For Stellar the caller passes the transaction hash; the returned 64-byte signature is wrapped into an xdr.DecoratedSignature by the relayer/TXM.
func (Key) ToEncryptedJSON ¶
func (key Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error)
ToEncryptedJSON returns encrypted JSON representing key