SEPs / Toml
StellarToml.Resolver
Resolver allows resolving stellar.toml files.
class Resolver { constructor(); static resolve(domain: string, opts: StellarTomlResolveOptions = {}): Promise<StellarToml>;}Source: src/stellartoml/index.ts:29
new Resolver()
constructor();Resolver.resolve(domain, opts)
Returns a parsed stellar.toml file for a given domain.
static resolve(domain: string, opts: StellarTomlResolveOptions = {}): Promise<StellarToml>;Parameters
domain—string(required) — Domain to get stellar.toml file for. Must be a host name with an optional port; surrounding whitespace and a trailing/are ignored.opts—StellarTomlResolveOptions(optional) (default:{}) — (optional) Options objectallowHttp(optional): Allow connecting to http servers. This must be set to false in production deployments!timeout(optional): Allow a timeout. Allows user to avoid nasty lag due to TOML resolve issue.
Returns
A Promise that resolves to the parsed stellar.toml object
Throws
Errorifdomainis not a plain host name, before any request is made
Example
StellarSdk.StellarToml.Resolver.resolve('acme.com') .then(stellarToml => { // stellarToml in an object representing domain stellar.toml file. }) .catch(error => { // domain is invalid, or stellar.toml does not exist or is invalid });See also
Stellar.toml doc
Source: src/stellartoml/index.ts:52
StellarToml.STELLAR_TOML_MAX_SIZE
The maximum size of stellar.toml file, in bytes
const STELLAR_TOML_MAX_SIZE: numberSource: src/stellartoml/index.ts:11
Types
StellarToml.Api.ContractId
type ContractId = stringSource: src/stellartoml/index.ts:140
StellarToml.Api.Currency
interface Currency { anchor_asset?: string; anchor_asset_type?: "fiat" | "crypto" | "nft" | "stock" | "bond" | "commodity" | "realestate" | "other"; approval_criteria?: string; approval_server?: string; attestation_of_reserve?: string; attestation_of_reserve_amount?: string; attestation_of_reserve_last_audit?: string; code?: string; code_template?: string; collateral_address_messages?: string[]; collateral_address_signatures?: string[]; collateral_addresses?: string[]; conditions?: string; desc?: string; display_decimals?: number; fixed_number?: number; image?: string; is_asset_anchored?: boolean; is_unlimited?: boolean; issuer?: string; max_number?: number; name?: string; redemption_instructions?: string; regulated?: boolean; status?: "live" | "dead" | "test" | "private";}Source: src/stellartoml/index.ts:173
currency.anchor_asset
anchor_asset?: string;Source: src/stellartoml/index.ts:194
currency.anchor_asset_type
anchor_asset_type?: "fiat" | "crypto" | "nft" | "stock" | "bond" | "commodity" | "realestate" | "other";Source: src/stellartoml/index.ts:185
currency.approval_criteria
approval_criteria?: string;Source: src/stellartoml/index.ts:206
currency.approval_server
approval_server?: string;Source: src/stellartoml/index.ts:205
currency.attestation_of_reserve
attestation_of_reserve?: string;Source: src/stellartoml/index.ts:195
currency.attestation_of_reserve_amount
attestation_of_reserve_amount?: string;Source: src/stellartoml/index.ts:196
currency.attestation_of_reserve_last_audit
attestation_of_reserve_last_audit?: string;Source: src/stellartoml/index.ts:197
currency.code
code?: string;Source: src/stellartoml/index.ts:174
currency.code_template
code_template?: string;Source: src/stellartoml/index.ts:175
currency.collateral_address_messages
collateral_address_messages?: string[];Source: src/stellartoml/index.ts:203
currency.collateral_address_signatures
collateral_address_signatures?: string[];Source: src/stellartoml/index.ts:204
currency.collateral_addresses
collateral_addresses?: string[];Source: src/stellartoml/index.ts:202
currency.conditions
conditions?: string;Source: src/stellartoml/index.ts:181
currency.desc
desc?: string;Source: src/stellartoml/index.ts:180
currency.display_decimals
display_decimals?: number;Source: src/stellartoml/index.ts:177
currency.fixed_number
fixed_number?: number;Source: src/stellartoml/index.ts:182
currency.image
image?: string;Source: src/stellartoml/index.ts:200
currency.is_asset_anchored
is_asset_anchored?: boolean;Source: src/stellartoml/index.ts:184
currency.is_unlimited
is_unlimited?: boolean;Source: src/stellartoml/index.ts:198
currency.issuer
issuer?: string;Source: src/stellartoml/index.ts:176
currency.max_number
max_number?: number;Source: src/stellartoml/index.ts:183
currency.name
name?: string;Source: src/stellartoml/index.ts:179
currency.redemption_instructions
redemption_instructions?: string;Source: src/stellartoml/index.ts:199
currency.regulated
regulated?: boolean;Source: src/stellartoml/index.ts:201
currency.status
status?: "live" | "dead" | "test" | "private";Source: src/stellartoml/index.ts:178
StellarToml.Api.Documentation
interface Documentation { ORG_DBA?: string; ORG_DESCRIPTION?: string; ORG_GITHUB?: string; ORG_KEYBASE?: string; ORG_LICENSE_NUMBER?: string; ORG_LICENSE_TYPE?: string; ORG_LICENSING_AUTHORITY?: string; ORG_LOGO?: string; ORG_NAME?: string; ORG_OFFICIAL_EMAIL?: string; ORG_PHONE_NUMBER?: string; ORG_PHONE_NUMBER_ATTESTATION?: string; ORG_PHYSICAL_ADDRESS?: string; ORG_PHYSICAL_ADDRESS_ATTESTATION?: string; ORG_SUPPORT_EMAIL?: string; ORG_TWITTER?: string; ORG_URL?: string;}Source: src/stellartoml/index.ts:142
documentation.ORG_DBA
ORG_DBA?: string;Source: src/stellartoml/index.ts:144
documentation.ORG_DESCRIPTION
ORG_DESCRIPTION?: string;Source: src/stellartoml/index.ts:151
documentation.ORG_GITHUB
ORG_GITHUB?: string;Source: src/stellartoml/index.ts:159
documentation.ORG_KEYBASE
ORG_KEYBASE?: string;Source: src/stellartoml/index.ts:157
documentation.ORG_LICENSE_NUMBER
ORG_LICENSE_NUMBER?: string;Source: src/stellartoml/index.ts:148
documentation.ORG_LICENSE_TYPE
ORG_LICENSE_TYPE?: string;Source: src/stellartoml/index.ts:150
documentation.ORG_LICENSING_AUTHORITY
ORG_LICENSING_AUTHORITY?: string;Source: src/stellartoml/index.ts:149
documentation.ORG_LOGO
ORG_LOGO?: string;Source: src/stellartoml/index.ts:147
documentation.ORG_NAME
ORG_NAME?: string;Source: src/stellartoml/index.ts:143
documentation.ORG_OFFICIAL_EMAIL
ORG_OFFICIAL_EMAIL?: string;Source: src/stellartoml/index.ts:155
documentation.ORG_PHONE_NUMBER
ORG_PHONE_NUMBER?: string;Source: src/stellartoml/index.ts:146
documentation.ORG_PHONE_NUMBER_ATTESTATION
ORG_PHONE_NUMBER_ATTESTATION?: string;Source: src/stellartoml/index.ts:154
documentation.ORG_PHYSICAL_ADDRESS
ORG_PHYSICAL_ADDRESS?: string;Source: src/stellartoml/index.ts:152
documentation.ORG_PHYSICAL_ADDRESS_ATTESTATION
ORG_PHYSICAL_ADDRESS_ATTESTATION?: string;Source: src/stellartoml/index.ts:153
documentation.ORG_SUPPORT_EMAIL
ORG_SUPPORT_EMAIL?: string;Source: src/stellartoml/index.ts:156
documentation.ORG_TWITTER
ORG_TWITTER?: string;Source: src/stellartoml/index.ts:158
documentation.ORG_URL
ORG_URL?: string;Source: src/stellartoml/index.ts:145
StellarToml.Api.ISODateTime
type ISODateTime = stringSource: src/stellartoml/index.ts:141
StellarToml.Api.Principal
interface Principal { email: string; github?: string; id_photo_hash?: string; keybase?: string; name: string; telegram?: string; twitter?: string; verification_photo_hash?: string;}Source: src/stellartoml/index.ts:162
principal.email
email: string;Source: src/stellartoml/index.ts:164
principal.github
github?: string;Source: src/stellartoml/index.ts:165
principal.id_photo_hash
id_photo_hash?: string;Source: src/stellartoml/index.ts:169
principal.keybase
keybase?: string;Source: src/stellartoml/index.ts:166
principal.name
name: string;Source: src/stellartoml/index.ts:163
principal.telegram
telegram?: string;Source: src/stellartoml/index.ts:167
principal.twitter
twitter?: string;Source: src/stellartoml/index.ts:168
principal.verification_photo_hash
verification_photo_hash?: string;Source: src/stellartoml/index.ts:170
StellarToml.Api.PublicKey
type PublicKey = stringSource: src/stellartoml/index.ts:139
StellarToml.Api.StellarToml
interface StellarToml { ACCOUNTS?: string[]; ANCHOR_QUOTE_SERVER?: string; CURRENCIES?: Currency[]; DIRECT_PAYMENT_SERVER?: string; DOCUMENTATION?: Documentation; FEDERATION_SERVER?: string; HORIZON_URL?: string; KYC_SERVER?: string; NETWORK_PASSPHRASE?: Networks; PRINCIPALS?: Principal[]; SIGNING_KEY?: string; TRANSFER_SERVER?: string; TRANSFER_SERVER_SEP0024?: string; URI_REQUEST_SIGNING_KEY?: string; VALIDATORS?: Validator[]; VERSION?: string; WEB_AUTH_CONTRACT_ID?: string; WEB_AUTH_ENDPOINT?: string; WEB_AUTH_FOR_CONTRACTS_ENDPOINT?: string;}Source: src/stellartoml/index.ts:221
stellarToml.ACCOUNTS
ACCOUNTS?: string[];Source: src/stellartoml/index.ts:223
stellarToml.ANCHOR_QUOTE_SERVER
ANCHOR_QUOTE_SERVER?: string;Source: src/stellartoml/index.ts:236
stellarToml.CURRENCIES
CURRENCIES?: Currency[];Source: src/stellartoml/index.ts:239
stellarToml.DIRECT_PAYMENT_SERVER
DIRECT_PAYMENT_SERVER?: string;Source: src/stellartoml/index.ts:235
stellarToml.DOCUMENTATION
DOCUMENTATION?: Documentation;Source: src/stellartoml/index.ts:237
stellarToml.FEDERATION_SERVER
FEDERATION_SERVER?: string;Source: src/stellartoml/index.ts:231
stellarToml.HORIZON_URL
HORIZON_URL?: string;Source: src/stellartoml/index.ts:233
stellarToml.KYC_SERVER
KYC_SERVER?: string;Source: src/stellartoml/index.ts:227
stellarToml.NETWORK_PASSPHRASE
NETWORK_PASSPHRASE?: Networks;Source: src/stellartoml/index.ts:224
stellarToml.PRINCIPALS
PRINCIPALS?: Principal[];Source: src/stellartoml/index.ts:238
stellarToml.SIGNING_KEY
SIGNING_KEY?: string;Source: src/stellartoml/index.ts:232
stellarToml.TRANSFER_SERVER
TRANSFER_SERVER?: string;Source: src/stellartoml/index.ts:226
stellarToml.TRANSFER_SERVER_SEP0024
TRANSFER_SERVER_SEP0024?: string;Source: src/stellartoml/index.ts:225
stellarToml.URI_REQUEST_SIGNING_KEY
URI_REQUEST_SIGNING_KEY?: string;Source: src/stellartoml/index.ts:234
stellarToml.VALIDATORS
VALIDATORS?: Validator[];Source: src/stellartoml/index.ts:240
stellarToml.VERSION
VERSION?: string;Source: src/stellartoml/index.ts:222
stellarToml.WEB_AUTH_CONTRACT_ID
WEB_AUTH_CONTRACT_ID?: string;Source: src/stellartoml/index.ts:230
stellarToml.WEB_AUTH_ENDPOINT
WEB_AUTH_ENDPOINT?: string;Source: src/stellartoml/index.ts:228
stellarToml.WEB_AUTH_FOR_CONTRACTS_ENDPOINT
WEB_AUTH_FOR_CONTRACTS_ENDPOINT?: string;Source: src/stellartoml/index.ts:229
StellarToml.Api.StellarTomlResolveOptions
interface StellarTomlResolveOptions { allowedRedirects?: number; allowHttp?: boolean; timeout?: number;}Source: src/stellartoml/index.ts:133
stellarTomlResolveOptions.allowedRedirects
allowedRedirects?: number;Source: src/stellartoml/index.ts:136
stellarTomlResolveOptions.allowHttp
allowHttp?: boolean;Source: src/stellartoml/index.ts:134
stellarTomlResolveOptions.timeout
timeout?: number;Source: src/stellartoml/index.ts:135
StellarToml.Api.Url
type Url = stringSource: src/stellartoml/index.ts:138
StellarToml.Api.Validator
interface Validator { ALIAS?: string; DISPLAY_NAME?: string; HISTORY?: string; HOST?: string; PUBLIC_KEY?: string;}Source: src/stellartoml/index.ts:210
validator.ALIAS
ALIAS?: string;Source: src/stellartoml/index.ts:211
validator.DISPLAY_NAME
DISPLAY_NAME?: string;Source: src/stellartoml/index.ts:212
validator.HISTORY
HISTORY?: string;Source: src/stellartoml/index.ts:215
validator.HOST
HOST?: string;Source: src/stellartoml/index.ts:214
validator.PUBLIC_KEY
PUBLIC_KEY?: string;Source: src/stellartoml/index.ts:213