# ExtendedSymbol
An extended symbol stores code, precision of the token amount and a contract name.
# Constructors
constructor( public sym: Symbol, public contract: Name )
sym
- TheSymbol
object. Example:Symbol("XPR", 4)
contract
- TheName
object with for the contractExample: `Name.fromString('mycontract')`
Example:
import { ExtendedSymbol, Symbol, Name } from 'proton-tsc' const symbol = new ExtendedSymbol(new Symbol("XPR", 4), Name.fromString('mycontract'))
# Instance Methods
toString(): string
Returns the extended symbol as a string in format
precision,symbol@contract
UsestoString
method onSymbol
object for the part before@
signExample:
const symbol = new ExtendedSymbol(new Symbol("XUSDC", 6), Name.fromString('mycontract')); print(symbol.toString()); // 6,XUSDC@mycontract
# Static Methods
static function eq(a: ExtendedSymbol, b: ExtendedSymbol): bool
Checks that symbols and contracts are equal for objects
Throws if:
- Symbols do not match or contracts do not match
static function neq(a: ExtendedSymbol, b: ExtendedSymbol): bool
Checks that symbols and contracts are not equal for objects
Throws if:
- Symbols are equal and contracts are equal
static function lt(a: ExtendedSymbol, b: ExtendedSymbol): bool
Checks that the symbol
a
is less thanb
and contracta
is less thanb
Throws if:
- Symbol
a
is greater or equalb
or contracta
is greater or equalb
- Symbol