Constructor
new Asset(code, issuer)
Parameters:
Name | Type | Description |
---|---|---|
code |
string
|
The asset code. |
issuer |
string
|
The account ID of the issuer. |
Methods
(static) fromOperation(assetXdr) → {Asset}
Returns an asset object from its XDR object representation.
Parameters:
Name | Type | Description |
---|---|---|
assetXdr |
xdr.Asset
|
The asset xdr object. |
Returns:
- Type:
-
Asset
equals(asset) → {boolean}
Returns true if this asset equals the given asset.
Parameters:
Name | Type | Description |
---|---|---|
asset |
Asset
|
Asset to compare |
Returns:
- Type:
-
boolean
getAssetType() → {string}
Return the asset type. Can be one of following types:
native
credit_alphanum4
credit_alphanum12
- Source:
- See:
Returns:
- Type:
-
string
getCode() → {string}
Return the asset code
Returns:
- Type:
-
string
getIssuer() → {string}
Return the asset issuer
Returns:
- Type:
-
string
isNative() → {boolean}
Returns true if this asset object is the native asset.
Returns:
- Type:
-
boolean
toXDRObject() → {xdr.Asset}
Returns the xdr object for this asset.
Returns:
- Type:
-
xdr.Asset