XdrSCAddress
extends XdrSCAddressBase
in package
SCAddress union, with the factory methods that take an id in the spelling the SDK's callers use and the strkey rendering that gives one back.
The generated base holds the contract id and the liquidity pool id as hexadecimal and accepts their strkey spelling as well; every reader resolves those two fields through XdrSCAddressBase::getCanonicalContractIdHex() and XdrSCAddressBase::getCanonicalLiquidityPoolIdHex(), so no reader takes what another refuses.
Table of Contents
Properties
- $accountId : XdrAccountID|null
- $claimableBalanceId : XdrClaimableBalanceID|null
- $contractId : string|null
- $liquidityPoolId : string|null
- $muxedAccount : XdrMuxedAccountMed25519|null
- $type : XdrSCAddressType
Methods
- __construct() : mixed
- decode() : static
- encode() : string
- forAccountId() : XdrSCAddress
- Accepts ed25519 "G..." and muxed ("M...") account ids.
- forClaimableBalanceId() : XdrSCAddress
- Accepts strkey ("B...") and hex values. The hexadecimal form is the balance hash on its own, or the hash behind its type discriminant, as the SDK's getPaddedBalanceIdHex() and Horizon spell it.
- forContractId() : XdrSCAddress
- Accepts hex or strkey values ("C...")
- forLiquidityPoolId() : XdrSCAddress
- Accepts strkey ("L...") and hex values.
- fromBase64Xdr() : static
- fromJson() : static
- fromJsonValue() : static
- fromTxRep() : static
- getAccountId() : XdrAccountID|null
- getCanonicalContractIdHex() : string
- Returns the 32-byte contract id as 64 lower case hexadecimal characters, whichever of the accepted spellings the field holds.
- getCanonicalLiquidityPoolIdHex() : string
- Returns the 32-byte liquidity pool id as 64 lower case hexadecimal characters, whichever of the accepted spellings the field holds.
- getClaimableBalanceId() : XdrClaimableBalanceID|null
- getContractId() : string|null
- getLiquidityPoolId() : string|null
- getMuxedAccount() : XdrMuxedAccountMed25519|null
- getType() : XdrSCAddressType
- setAccountId() : void
- setClaimableBalanceId() : void
- setContractId() : void
- setLiquidityPoolId() : void
- setMuxedAccount() : void
- setType() : void
- toBase64Xdr() : string
- toJson() : string
- toJsonValue() : string
- toStrKey() : string
- Returns the StrKey representation of the address.
- toTxRep() : void
Properties
$accountId
public
XdrAccountID|null
$accountId
= null
$claimableBalanceId
public
XdrClaimableBalanceID|null
$claimableBalanceId
= null
$contractId
public
string|null
$contractId
= null
$liquidityPoolId
public
string|null
$liquidityPoolId
= null
$muxedAccount
public
XdrMuxedAccountMed25519|null
$muxedAccount
= null
$type
public
XdrSCAddressType
$type
Methods
__construct()
public
__construct([XdrSCAddressType|null $type = null ]) : mixed
Parameters
- $type : XdrSCAddressType|null = null
decode()
public
static decode(XdrBuffer $xdr) : static
Parameters
- $xdr : XdrBuffer
Return values
staticencode()
public
encode() : string
Return values
stringforAccountId()
Accepts ed25519 "G..." and muxed ("M...") account ids.
public
static forAccountId(string $accountId) : XdrSCAddress
Parameters
- $accountId : string
-
"G..." or "M..."
Return values
XdrSCAddressforClaimableBalanceId()
Accepts strkey ("B...") and hex values. The hexadecimal form is the balance hash on its own, or the hash behind its type discriminant, as the SDK's getPaddedBalanceIdHex() and Horizon spell it.
public
static forClaimableBalanceId(string $claimableBalanceId) : XdrSCAddress
Parameters
- $claimableBalanceId : string
-
"B..." or hex string
Return values
XdrSCAddressforContractId()
Accepts hex or strkey values ("C...")
public
static forContractId(string $contractId) : XdrSCAddress
Parameters
- $contractId : string
-
hex or "C..."
Return values
XdrSCAddressforLiquidityPoolId()
Accepts strkey ("L...") and hex values.
public
static forLiquidityPoolId(string $liquidityPoolId) : XdrSCAddress
Parameters
- $liquidityPoolId : string
-
"L..." or the pool hash as 64 hex characters
Return values
XdrSCAddressfromBase64Xdr()
public
static fromBase64Xdr(string $xdr) : static
Parameters
- $xdr : string
Return values
staticfromJson()
public
static fromJson(string $json) : static
Parameters
- $json : string
Tags
Return values
staticfromJsonValue()
public
static fromJsonValue(mixed $value) : static
Parameters
- $value : mixed
Return values
staticfromTxRep()
public
static fromTxRep(array<string|int, mixed> $map, string $prefix) : static
Parameters
- $map : array<string|int, mixed>
- $prefix : string
Return values
staticgetAccountId()
public
getAccountId() : XdrAccountID|null
Return values
XdrAccountID|nullgetCanonicalContractIdHex()
Returns the 32-byte contract id as 64 lower case hexadecimal characters, whichever of the accepted spellings the field holds.
public
getCanonicalContractIdHex() : string
A contract id is accepted as its strkey form "C..." or as the bare hash in hexadecimal. Every reader of the field resolves it through here, so none takes what another refuses.
Tags
Return values
string —the contract id as 64 lower case hexadecimal characters
getCanonicalLiquidityPoolIdHex()
Returns the 32-byte liquidity pool id as 64 lower case hexadecimal characters, whichever of the accepted spellings the field holds.
public
getCanonicalLiquidityPoolIdHex() : string
A pool id is accepted as its strkey form "L..." or as the bare hash in hexadecimal. PoolID is a plain 32-byte hash on the wire with no discriminant ahead of it, so there is no prefixed spelling to accept. Every reader of the field resolves it through here, so none takes what another refuses.
Tags
Return values
string —the pool id as 64 lower case hexadecimal characters
getClaimableBalanceId()
public
getClaimableBalanceId() : XdrClaimableBalanceID|null
Return values
XdrClaimableBalanceID|nullgetContractId()
public
getContractId() : string|null
Return values
string|nullgetLiquidityPoolId()
public
getLiquidityPoolId() : string|null
Return values
string|nullgetMuxedAccount()
public
getMuxedAccount() : XdrMuxedAccountMed25519|null
Return values
XdrMuxedAccountMed25519|nullgetType()
public
getType() : XdrSCAddressType
Return values
XdrSCAddressTypesetAccountId()
public
setAccountId(XdrAccountID|null $accountId) : void
Parameters
- $accountId : XdrAccountID|null
setClaimableBalanceId()
public
setClaimableBalanceId(XdrClaimableBalanceID|null $claimableBalanceId) : void
Parameters
- $claimableBalanceId : XdrClaimableBalanceID|null
setContractId()
public
setContractId(string|null $contractId) : void
Parameters
- $contractId : string|null
setLiquidityPoolId()
public
setLiquidityPoolId(string|null $liquidityPoolId) : void
Parameters
- $liquidityPoolId : string|null
setMuxedAccount()
public
setMuxedAccount(XdrMuxedAccountMed25519|null $muxedAccount) : void
Parameters
- $muxedAccount : XdrMuxedAccountMed25519|null
setType()
public
setType(XdrSCAddressType $type) : void
Parameters
- $type : XdrSCAddressType
toBase64Xdr()
public
toBase64Xdr() : string
Return values
stringtoJson()
public
toJson() : string
Tags
Return values
stringtoJsonValue()
public
toJsonValue() : string
Return values
stringtoStrKey()
Returns the StrKey representation of the address.
public
toStrKey() : string
Tags
Return values
stringtoTxRep()
public
toTxRep(string $prefix, array<string|int, mixed> &$lines) : void
Parameters
- $prefix : string
- $lines : array<string|int, mixed>