Class

StrKey

StrKey()

StrKey is a helper class that allows encoding and decoding Stellar keys to/from strings, i.e. between their binary (Buffer, xdr.PublicKey, etc.) and string (i.e. "GABCD...", etc.) representations.

Methods

# static decodeClaimableBalance(address) → {Buffer}

Decodes strkey contract (B...) to raw data.

Parameters:
Name Type Description
address string

balance to decode

View Source js-stellar-base/src/strkey.js, line 228

Buffer

# static decodeContract(address) → {Buffer}

Decodes strkey contract (C...) to raw data.

Parameters:
Name Type Description
address string

address to decode

View Source js-stellar-base/src/strkey.js, line 201

Buffer

# static decodeEd25519PublicKey(data) → {Buffer}

Decodes strkey ed25519 public key to raw data.

If the parameter is a muxed account key ("M..."), this will only encode it as a basic Ed25519 key (as if in "G..." format).

Parameters:
Name Type Description
data string

"G..." (or "M...") key representation to decode

View Source js-stellar-base/src/strkey.js, line 57

raw key

Buffer

# static decodeEd25519SecretSeed(address) → {Buffer}

Decodes strkey ed25519 seed to raw data.

Parameters:
Name Type Description
address string

data to decode

View Source js-stellar-base/src/strkey.js, line 84

Buffer

# static decodeLiquidityPool(address) → {Buffer}

Decodes strkey liquidity pool (L...) to raw data.

Parameters:
Name Type Description
address string

address to decode

View Source js-stellar-base/src/strkey.js, line 255

Buffer

# static decodeMed25519PublicKey(address) → {Buffer}

Decodes strkey med25519 public key to raw data.

Parameters:
Name Type Description
address string

data to decode

View Source js-stellar-base/src/strkey.js, line 111

Buffer

# static decodePreAuthTx(address) → {Buffer}

Decodes strkey PreAuthTx to raw data.

Parameters:
Name Type Description
address string

data to decode

View Source js-stellar-base/src/strkey.js, line 138

Buffer

# static decodeSha256Hash(address) → {Buffer}

Decodes strkey sha256 hash to raw data.

Parameters:
Name Type Description
address string

data to decode

View Source js-stellar-base/src/strkey.js, line 156

Buffer

# static decodeSignedPayload(address) → {Buffer}

Decodes strkey signed payload (P...) to raw data.

Parameters:
Name Type Description
address string

address to decode

View Source js-stellar-base/src/strkey.js, line 174

Buffer

# static encodeClaimableBalance(data) → {string}

Encodes raw data to strkey claimable balance (B...).

Parameters:
Name Type Description
data Buffer

data to encode

View Source js-stellar-base/src/strkey.js, line 219

string

# static encodeContract(data) → {string}

Encodes raw data to strkey contract (C...).

Parameters:
Name Type Description
data Buffer

data to encode

View Source js-stellar-base/src/strkey.js, line 192

string

# static encodeEd25519PublicKey(data) → {string}

Encodes data to strkey ed25519 public key.

Parameters:
Name Type Description
data Buffer

raw data to encode

View Source js-stellar-base/src/strkey.js, line 44

"G..." representation of the key

string

# static encodeEd25519SecretSeed(data) → {string}

Encodes data to strkey ed25519 seed.

Parameters:
Name Type Description
data Buffer

data to encode

View Source js-stellar-base/src/strkey.js, line 75

string

# static encodeLiquidityPool(data) → {string}

Encodes raw data to strkey liquidity pool (L...).

Parameters:
Name Type Description
data Buffer

data to encode

View Source js-stellar-base/src/strkey.js, line 246

string

# static encodeMed25519PublicKey(data) → {string}

Encodes data to strkey med25519 public key.

Parameters:
Name Type Description
data Buffer

data to encode

View Source js-stellar-base/src/strkey.js, line 102

string

# static encodePreAuthTx(data) → {string}

Encodes data to strkey preAuthTx.

Parameters:
Name Type Description
data Buffer

data to encode

View Source js-stellar-base/src/strkey.js, line 129

string

# static encodeSha256Hash(data) → {string}

Encodes data to strkey sha256 hash.

Parameters:
Name Type Description
data Buffer

data to encode

View Source js-stellar-base/src/strkey.js, line 147

string

# static encodeSignedPayload(data) → {string}

Encodes raw data to strkey signed payload (P...).

Parameters:
Name Type Description
data Buffer

data to encode

View Source js-stellar-base/src/strkey.js, line 165

string

# static isValidClaimableBalance(address) → {boolean}

Checks validity of alleged claimable balance (B...) strkey address.

Parameters:
Name Type Description
address string

balance to check

View Source js-stellar-base/src/strkey.js, line 237

boolean

# static isValidContract(address) → {boolean}

Checks validity of alleged contract (C...) strkey address.

Parameters:
Name Type Description
address string

signer key to check

View Source js-stellar-base/src/strkey.js, line 210

boolean

# static isValidEd25519PublicKey(publicKey) → {boolean}

Returns true if the given Stellar public key is a valid ed25519 public key.

Parameters:
Name Type Description
publicKey string

public key to check

View Source js-stellar-base/src/strkey.js, line 66

boolean

# static isValidEd25519SecretSeed(seed) → {boolean}

Returns true if the given Stellar secret key is a valid ed25519 secret seed.

Parameters:
Name Type Description
seed string

seed to check

View Source js-stellar-base/src/strkey.js, line 93

boolean

# static isValidLiquidityPool(address) → {boolean}

Checks validity of alleged liquidity pool (L...) strkey address.

Parameters:
Name Type Description
address string

pool to check

View Source js-stellar-base/src/strkey.js, line 264

boolean

# static isValidMed25519PublicKey(publicKey) → {boolean}

Returns true if the given Stellar public key is a valid med25519 public key.

Parameters:
Name Type Description
publicKey string

public key to check

View Source js-stellar-base/src/strkey.js, line 120

boolean

# static isValidSignedPayload(address) → {boolean}

Checks validity of alleged signed payload (P...) strkey address.

Parameters:
Name Type Description
address string

signer key to check

View Source js-stellar-base/src/strkey.js, line 183

boolean