Global

Members

(constant) AuthClawbackEnabledFlag

When set using Operation.setOptions option, then any trustlines created by this account can have a ClawbackOp operation submitted for the corresponding asset.

Source:
See:

(constant) AuthImmutableFlag

When set using Operation.setOptions option, then none of the authorization flags can be set and the account can never be deleted.

Source:
See:

(constant) AuthRequiredFlag

When set using Operation.setOptions option, requires the issuing account to give other accounts permission before they can hold the issuing account’s credit.

Source:
See:

(constant) AuthRevocableFlag

When set using Operation.setOptions option, allows the issuing account to revoke its credit held by other accounts.

Source:
See:

(constant) BASE_FEE

Minimum base fee for transactions. If this fee is below the network minimum, the transaction will fail. The more operations in the transaction, the greater the required fee. Use Server#fetchBaseFee to get an accurate value of minimum transaction fee on the network.

Source:
See:

(constant) FastSigning

Use this flag to check if fast signing (provided by sodium-native package) is available. If your app is signing a large number of transaction or verifying a large number of signatures make sure sodium-native package is installed.

Source:

InvalidSep10ChallengeError

AccountRequiresMemoError is raised when a transaction is trying to submit an operation to an account which requires a memo. See SEP0029 for more information.

This error contains two attributes to help you identify the account requiring the memo and the operation where the account is the destination

console.log('The following account requires a memo ', err.accountId)
console.log('The account is used in operation: ', err.operationIndex)
Source:

(constant) MemoHash

Type of Memo.

Source:

(constant) MemoID

Type of Memo.

Source:

(constant) MemoNone

Type of Memo.

Source:

(constant) MemoReturn

Type of Memo.

Source:

(constant) MemoText

Type of Memo.

Source:

(constant) Networks :Object

Contains passphrases for common networks:

  • Networks.PUBLIC: Public Global Stellar Network ; September 2015
  • Networks.TESTNET: Test SDF Network ; September 2015
Source:
Type:
  • Object

(constant) SERVER_TIME_MAP

keep a local map of server times (export this purely for testing purposes)

each entry will map the server domain to the last-known time and the local time it was recorded, ex:

"horizon-testnet.stellar.org": {
  serverTime: 1552513039,
  localTimeRecorded: 1552513052
}
Source:

default

Given a hostname, get the current time of that server (i.e., use the last- recorded server time and offset it by the time since then.) If there IS no recorded server time, or it's been 5 minutes since the last, return null.

Source:

Methods

asciiCompare(a, b) → {number}

Compares two ASCII strings in lexographic order with uppercase precedence.

Source:
Parameters:
Name Type Description
a string

the first string to compare

b string

the second

Returns:
Type:
number

like all compare()s: -1 if a < b, 0 if a == b, and 1 if a > b

decodeAddressToMuxedAccount(address) → {xdr.MuxedAccount}

Converts a Stellar address (in G... or M... form) to an xdr.MuxedAccount structure, using the ed25519 representation when possible.

This supports full muxed accounts, where an M... address will resolve to both its underlying G... address and an integer ID.

Source:
Parameters:
Name Type Description
address string

G... or M... address to encode into XDR

Returns:
Type:
xdr.MuxedAccount

a muxed account object for this address string

encodeMuxedAccount(address, id) → {xdr.MuxedAccount}

Transform a Stellar address (G...) and an ID into its XDR representation.

Source:
Parameters:
Name Type Description
address string

a Stellar G... address

id string

a Uint64 ID represented as a string

Returns:
Type:
xdr.MuxedAccount
  • XDR representation of the above muxed account

encodeMuxedAccountToAddress(muxedAccount) → {string}

Converts an xdr.MuxedAccount to its StrKey representation.

This returns its "M..." string representation if there is a muxing ID within the object and returns the "G..." representation otherwise.

Source:
See:
Parameters:
Name Type Description
muxedAccount xdr.MuxedAccount

Raw account to stringify

Returns:
Type:
string

Stringified G... (corresponding to the underlying pubkey) or M... address (corresponding to both the key and the muxed ID)

extractBaseAddress(address) → {string}

Extracts the underlying base (G...) address from an M-address.

Source:
Parameters:
Name Type Description
address string

an account address (either M... or G...)

Returns:
Type:
string

a Stellar public key address (G...)

getLiquidityPoolId(liquidityPoolType, liquidityPoolParameters) → {Buffer}

getLiquidityPoolId computes the Pool ID for the given assets, fee and pool type.

Source:
See:
Parameters:
Name Type Description
liquidityPoolType string

– A string representing the liquidity pool type.

liquidityPoolParameters object

– The liquidity pool parameters.

Name Type Description
assetA Asset

– The first asset in the Pool, it must respect the rule assetA < assetB.

assetB Asset

– The second asset in the Pool, it must respect the rule assetA < assetB.

fee number

– The liquidity pool fee. For now the only fee supported is 30.

Returns:
Type:
Buffer

the raw Pool ID buffer, which can be stringfied with toString('hex')

isValid(versionByteName, encoded) → {Boolean}

Sanity-checks whether or not a strkey appears valid.

Source:
Parameters:
Name Type Description
versionByteName string

the type of strkey to expect in encoded

encoded string

the strkey to validate

Returns:
Type:
Boolean

whether or not the encoded strkey appears valid for the versionByteName strkey type (see versionBytes, above).

isValidDate(d) → {boolean}

Checks whether a provided object is a valid Date.

Source:
Parameters:
Name Type Description
d Date

date object

Returns:
Type:
boolean