Methods
# async static resolve(domain, optsopt) → {Promise}
Returns a parsed stellar.toml
file for a given domain.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
domain |
string
|
Domain to get stellar.toml file for |
||
opts |
object
|
<optional> |
Options object |
|
allowHttp |
boolean
|
<optional> |
false | Allow connecting to http servers. This must be set to false in production deployments! |
timeout |
number
|
<optional> |
0 | Allow a timeout. Allows user to avoid nasty lag due to TOML resolve issue. |
A Promise
that resolves to the parsed stellar.toml object
Promise
Example
StellarSdk.StellarToml.Resolver.resolve('acme.com')
.then(stellarToml => {
// stellarToml in an object representing domain stellar.toml file.
})
.catch(error => {
// stellar.toml does not exist or is invalid
});