Constructor
new AbstractCryptoModule(app, ticker)
Initialize CryptoModule and check that subclass overrides abstract functions
Parameters:
Name | Type | Description |
---|---|---|
app |
Object | Saito Application Context |
ticker |
String | Ticker symbol of underlying Cryptocurrency |
- Source:
Example
class DogeCrypto extends AbstractCryptoModule {
returnAddress() { ... }
async returnBalance(){ ... }
async transfer(howMuch, to) { ... }
...
}
Extends
- ModTemplate
Methods
activate()
isActivated is an optional flag that allows users to enable a crypto module.
This is needed to accomodate UX in the case that a particular module might
require significant resources.
- Source:
(async) formatBalance()
Returns balance as a formatted string
(abstract) hasPayment(howMuch, from, to, to) → {Boolean}
Searches for a payment which matches the criteria specified in the parameters.
Parameters:
Name | Type | Description |
---|---|---|
howMuch |
Number | How much of the token was transferred |
from |
String | Pubkey/address the transasction was sent from |
to |
String | Pubkey/address the transasction was sent to |
to |
timestamp | timestamp after which the transaction was sent |
Returns:
- Type
- Boolean
initialize(app)
Saito Module initialize function
Parameters:
Name | Type | Description |
---|---|---|
app |
* |
- Source:
load()
load state of this module from local storage
(abstract) renderModalSelectCrypto() → {Number}
Abstract method which should get balance from underlying crypto endpoint
Returns:
- Type
- Number
(abstract) returnAddress() → {String}
Abstract method which should get pubkey/address
Returns:
Pubkey/address
- Type
- String
(abstract) returnBalance() → {Number}
Abstract method which should get balance from underlying crypto endpoint
Returns:
- Type
- Number
returnIsActivated()
Returns a crypto modules activated status.
isActivated is an optional flag that allows users to enable a crypto module.
- Source:
(abstract) returnPrivateKey() → {String}
Abstract method which should get private key
Returns:
Private Key
- Type
- String
save()
save state of this module to local storage
(abstract) transfer(howMuch, to) → {Number}
Abstract method which should transfer tokens via the crypto endpoint
Parameters:
Name | Type | Description |
---|---|---|
howMuch |
Number | How much of the token to transfer |
to |
String | Pubkey/address to send to |
Returns:
- Type
- Number