JavaScript utilities for the banano cryptocurrency.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Converts a banoshi amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the banoshi, as a string. |
|
amountPrefix |
string
|
the amount prefix, as a string. |
string
the banano as a raw value.
Get the banano parts (banano, banoshi, raw) for a given raw value.
Name | Type | Description | |
---|---|---|---|
amountRawStr |
string
|
the raw amount, as a string. |
|
amountPrefix |
string
|
the amount prefix, as a string. |
BananoParts
the banano parts.
Get the public key for a given account.
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account. |
string
the public key.
Get the account suffix for a given public key (everything but ban_ or camo_ or nano_).
Name | Type | Description | |
---|---|---|---|
publicKey |
string
|
the public key. |
string
the account suffix.
Get the account for a given public key.
Name | Type | Description | |
---|---|---|---|
publicKey |
string
|
the public key. |
|
accountPrefix |
string
|
the prefix. ban_ or nano_. |
string
the account.
returns true if the work (in bytes) for the hash (in bytes) is valid.
Name | Type | Description | |
---|---|---|---|
hashBytes |
string
|
the hash bytes to check. |
|
workBytes |
string
|
the work bytes to check. |
boolean
true if the work is valid for the hash.
creates a new Uint8Array(8) to calculate work bytes.
Uint8Array
the bytes in a Uint8Array.
Get the public key for a given private key.
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key. |
string
the public key.
validates a seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to validate. |
|
seedIx |
string
|
the index to use with the seed. |
object
{valid:[true/false] message:[if false, why]}.
Get the private key for a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
string
the private key.
Returns an object saying if the banano account is valid or not.
If the account is not valid, the message describes why it is not valid.
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account. |
AccountValidationInfo
an object saying if the account is valid, and why.
Returns an object saying if the nano account is valid or not. If the account is not valid, the message describes why it is not valid.
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account. |
AccountValidationInfo
an object saying if the account is valid, and why.
Gets the camo public key from a private key.
a normal banano public key is used in ECDSA.
a camo public key is used in ECDH.
this is why the derivation is different for the two keys.
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key. |
string
the camo public key.
Gets the shared secret from a camo public key and a private key.
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key. |
|
publicKey |
string
|
the public key. |
string
the shared secret.
Get the camo account for a given camo public key.
Name | Type | Description | |
---|---|---|---|
camoPublicKey |
string
|
the camo public key. |
string
the camo account.
Name | Type | Description | |
---|---|---|---|
camoAccount |
string
|
the camo account. |
boolean
true if the camo account is valid.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Converts a banoshi amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the banoshi, as a string. |
|
amountPrefix |
string
|
the amount prefix, as a string. |
string
the banano as a raw value.
Get the banano parts (banano, banoshi, raw) for a given raw value.
Name | Type | Description | |
---|---|---|---|
amountRawStr |
string
|
the raw amount, as a string. |
|
amountPrefix |
string
|
the amount prefix, as a string. |
BananoParts
the banano parts.
Get the public key for a given account.
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account. |
string
the public key.
Get the account suffix for a given public key (everything but ban_ or camo_ or nano_).
Name | Type | Description | |
---|---|---|---|
publicKey |
string
|
the public key. |
string
the account suffix.
Get the account for a given public key.
Name | Type | Description | |
---|---|---|---|
publicKey |
string
|
the public key. |
|
accountPrefix |
string
|
the prefix. ban_ or nano_. |
string
the account.
returns true if the work (in bytes) for the hash (in bytes) is valid.
Name | Type | Description | |
---|---|---|---|
hashBytes |
string
|
the hash bytes to check. |
|
workBytes |
string
|
the work bytes to check. |
boolean
true if the work is valid for the hash.
creates a new Uint8Array(8) to calculate work bytes.
Uint8Array
the bytes in a Uint8Array.
Get the public key for a given private key.
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key. |
string
the public key.
validates a seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to validate. |
|
seedIx |
string
|
the index to use with the seed. |
object
{valid:[true/false] message:[if false, why]}.
Get the private key for a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
string
the private key.
Returns an object saying if the banano account is valid or not.
If the account is not valid, the message describes why it is not valid.
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account. |
AccountValidationInfo
an object saying if the account is valid, and why.
Returns an object saying if the nano account is valid or not. If the account is not valid, the message describes why it is not valid.
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account. |
AccountValidationInfo
an object saying if the account is valid, and why.
Gets the camo public key from a private key.
a normal banano public key is used in ECDSA.
a camo public key is used in ECDH.
this is why the derivation is different for the two keys.
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key. |
string
the camo public key.
Gets the shared secret from a camo public key and a private key.
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key. |
|
publicKey |
string
|
the public key. |
string
the shared secret.
Get the camo account for a given camo public key.
Name | Type | Description | |
---|---|---|---|
camoPublicKey |
string
|
the camo public key. |
string
the camo account.
Name | Type | Description | |
---|---|---|---|
camoAccount |
string
|
the camo account. |
boolean
true if the camo account is valid.
Sets the Bananode Api (useful for overriding some methods)
Name | Type | Description | |
---|---|---|---|
_bananodeApi |
string
|
the new bananodeApi |
returns nothing.
converts amount from decimal to bananoParts.
Name | Type | Description | |
---|---|---|---|
decimalAmount |
string
|
the decimal amount of bananos. |
BananoParts
returns the banano parts of the decimal amount.
converts amount from bananoParts to decimal.
Name | Type | Description | |
---|---|---|---|
bananoParts |
BananoParts
|
the banano parts to describe. |
string
returns the decimal amount of bananos.
converts amount from decimal to raw.
Name | Type | Description | |
---|---|---|---|
amount |
string
|
the decimal amount. |
string
returns amount in raw.
describes the banano parts in an english description.
Name | Type | Description | |
---|---|---|---|
bananoParts |
BananoParts
|
the banano parts to describe. |
string
returns the description of the banano parts.
Sends the amount to the account with an optional representative and previous block hash. If the representative is not sent, it will be pulled from the api. If the previous is not sent, it will be pulled from the api. Be very careful with previous, as setting it incorrectly can cause an incorrect amount of funds to be sent.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
destAccount |
string
|
the destination account. |
|
amountRaw |
string
|
the amount to send, in raw. |
|
representative |
string
|
the representative (optional). |
|
previousHash |
string
|
the previous hash (optional). |
string
returns the hash returned by the send.
Sends the amount to the account with an optional representative and previous block hash. If the representative is not sent, it will be pulled from the api. If the previous is not sent, it will be pulled from the api. Be very careful with previous, as setting it incorrectly can cause an incorrect amount of funds to be sent.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
destAccount |
string
|
the destination account. |
|
amountRaw |
string
|
the amount to send, in raw. |
|
representative |
string
|
the representative (optional). |
|
previousHash |
string
|
the previous hash (optional). |
string
returns the hash returned by the send.
Sends the amount to the banano account with a callback for success and failure.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
destAccount |
string
|
the destination account. |
|
amountRaw |
string
|
the amount to send, in raw. |
|
successCallback |
string
|
the callback to call upon success. |
|
failureCallback |
string
|
the callback to call upon failure. |
string
returns the hash returned by the send.
Sends the amount to the nano account with a callback for success and failure.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
destAccount |
string
|
the destination account. |
|
amountRaw |
string
|
the amount to send, in raw. |
|
successCallback |
string
|
the callback to call upon success. |
|
failureCallback |
string
|
the callback to call upon failure. |
string
returns the hash returned by the send.
Sets the rep for an account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
string
returns the hash returned by the change.
Sets the rep for an account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
string
returns the hash returned by the change.
Recieve deposits for a nano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
|
specificPendingBlockHash |
string
|
a specific block hash to receive (optional). |
object
returns the response returned by the receive.
Recieve deposits for a nano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
|
specificPendingBlockHash |
string
|
a specific block hash to receive (optional). |
object
returns the response returned by the receive.
Send a withdrawal from a banano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
toAccount |
string
|
the account to send to. |
|
amountBananos |
string
|
the amount of bananos. |
object
returns the response returned by the withdraw.
Send a withdrawal from a nano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
toAccount |
string
|
the account to send to. |
|
amountBananos |
string
|
the amount of bananos. |
object
returns the response returned by the withdraw.
Get the balance, in raw, for an account.
(use other methods like getBananoPartsFromRaw to convert to banano or banoshi)
Calls {@link https://docs.nano.org/commands/rpc-protocol/#accounts_balances}
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to use. |
string
the account's balance, in raw.
Get the balance and pending values, in raw, as an object like this one: { balance: '123', pending: '123' } for an account.
(use other methods like getBananoPartsFromRaw to convert to banano or banoshi)
Calls {@link https://docs.nano.org/commands/rpc-protocol/#accounts_balances}
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to use. |
object
the account's balances, in raw.
Get the history for an account.
Calls {@link https://docs.nano.org/commands/rpc-protocol/#account_history}
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to use. |
|
count |
string
|
the count to use (use -1 for all). |
|
head |
string
|
the head to start at (optional). |
|
raw |
string
|
if true, return raw history (optional). |
object
the account's history.
Get the banano account with a given seed and index.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
string
the account.
Get the banano account with a given seed and index.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
string
the account.
Sets the URL to use for the node behind the Bananode Api
Name | Type | Description | |
---|---|---|---|
url |
string
|
the new url |
returns nothing.
Get the account info for an account.
Calls {@link https://docs.nano.org/commands/rpc-protocol/#account_info}
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to use. |
|
representativeFlag |
boolean
|
the representativeFlag to use (optional). |
object
the account's info.
Get the network block count.
Calls {@link https://docs.nano.org/commands/rpc-protocol/#block_count}
object
the block count.
Open a banano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
|
pendingBlockHash |
string
|
the pending block hash. |
|
pendingValueRaw |
string
|
the pending block hash. |
string
returns the hash returned by the open.
Open a nano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
|
pendingBlockHash |
string
|
the pending block hash. |
|
pendingValueRaw |
string
|
the pending block hash. |
string
returns the hash returned by the open.
Get the hash for a given block.
Name | Type | Description | |
---|---|---|---|
block |
string
|
the seed to use to find the account. |
string
the block's hash.
signs a hash.
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key to use to sign. |
|
hash |
string
|
the hash to sign. |
string
the block's hash.
verifys a hash.
Name | Type | Description | |
---|---|---|---|
hash |
string
|
the hash to verify. |
|
signature |
string
|
the signature to verify. |
|
publicKey |
string
|
the public key to use to sign. |
string
true if verification passed.
Get the signature for a given block (gets the hash of the block, and signs the hash).
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key used to sign the block. |
|
block |
string
|
the block to sign. |
string
the block's signature.
Converts a hex string to bytes in a Uint8Array.
Name | Type | Description | |
---|---|---|---|
hex |
string
|
the hex string to use. |
Uint8Array
the bytes in a Uint8Array.
gets work bytes using the CPU.
Name | Type | Description | |
---|---|---|---|
hash |
string
|
the hash to use to calculate work bytes. |
|
workBytes |
Uint8Array
|
the Uint8Array(8) used to store temporary calculations. |
string
the work bytes as a hex string.
receives banano funds at a camo address.
Name | Type | Description | |
---|---|---|---|
toPrivateKey |
string
|
the private key that receives the funds. |
|
fromPublicKey |
string
|
the public key that sent the funds. |
string_array
the received hashes in an array.
receives nano funds at a camo address.
Name | Type | Description | |
---|---|---|---|
toPrivateKey |
string
|
the private key that receives the funds. |
|
fromPublicKey |
string
|
the public key that sent the funds. |
string_array
the received hashes in an array.
finds a new private key to recieve more banano funds. the key would have no history.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
string
the private key to use.
finds a new private key to recieve more banano funds. the key would have no history.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
string
the private key to use.
sends banano funds to a camo address.
Name | Type | Description | |
---|---|---|---|
fundingPrivateKey |
string
|
the private key that sends the funds. |
|
fromCamoPrivateKey |
string
|
the private key used to generate the shared seed. |
|
toCamoPublicKey |
string
|
the public key that receives the funds. |
|
amountBananos |
string
|
the amount of bananos. |
string_array
the sent hashes in an array.
sends camo funds to a camo address.
Name | Type | Description | |
---|---|---|---|
fundingPrivateKey |
string
|
the private key that sends the funds. |
|
fromCamoPrivateKey |
string
|
the private key used to generate the shared seed. |
|
toCamoPublicKey |
string
|
the public key that receives the funds. |
|
amountBananos |
string
|
the amount of bananos. |
string_array
the sent hashes in an array.
sends banano funds to a camo account. This function uses seed index 0 to generate the shared secret, and seed index "seedIx" to get the private key that contains funds to send.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
toAccount |
string
|
the account to send to. |
|
amountBananos |
string
|
the amount of bananos. |
string_array
the sent hashes in an array.
sends nano funds to a camo account. This function uses seed index 0 to generate the shared secret, and seed index "seedIx" to get the private key that contains funds to send.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
toAccount |
string
|
the account to send to. |
|
amountBananos |
string
|
the amount of bananos. |
string_array
the sent hashes in an array.
get the pending blocks for the camo banano account.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
fromAccount |
string
|
the account to recieve from. |
|
sharedSeedIx |
number
|
the index to use with the shared seed. |
|
count |
number
|
the max count to get. |
string_array
the pending hashes in an array.
get the pending blocks for the camo nano account.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
fromAccount |
string
|
the account to recieve from. |
|
sharedSeedIx |
number
|
the index to use with the shared seed. |
|
count |
number
|
the max count to get. |
string_array
the pending hashes in an array.
returns data on whether a camo account is valid or not, and why.
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to check. |
object
the account validity data.
get the banano shared account, used as an intermediary to send finds between the seed and the camo account.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
account |
string
|
the camo account to send or recieve from. |
|
sharedSeedIx |
string
|
the index to use with the shared seed. |
string
the shared account.
get the nano shared account, used as an intermediary to send finds between the seed and the camo account.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
account |
string
|
the camo account to send or recieve from. |
|
sharedSeedIx |
string
|
the index to use with the shared seed. |
string
the shared account.
Recieve banano deposits for a camo account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
account |
string
|
the camo account to send or recieve from. |
|
sharedSeedIx |
string
|
the index to use with the shared seed. |
|
specificPendingBlockHash |
string
|
the pending block to recieve. |
string
the response from receiving the block.
Recieve nano deposits for a camo account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
account |
string
|
the camo account to send or recieve from. |
|
sharedSeedIx |
string
|
the index to use with the shared seed. |
|
specificPendingBlockHash |
string
|
the pending block to recieve. |
string
the response from receiving the block.
gets the total banano account balance, in raw.
Name | Type | Description | |
---|---|---|---|
toPrivateKey |
string
|
the private key that receives the funds. |
|
fromPublicKey |
string
|
the public key that sent the funds. |
string
the account balance, in raw.
gets the total nano account balance, in raw.
Name | Type | Description | |
---|---|---|---|
toPrivateKey |
string
|
the private key that receives the funds. |
|
fromPublicKey |
string
|
the public key that sent the funds. |
string
the account balance, in raw.
Get the network block count.
Calls {@link https://docs.nano.org/commands/rpc-protocol/#accounts_pending}
Name | Type | Description | |
---|---|---|---|
accounts |
string_array
|
the array of pending accounts. |
|
count |
number
|
the max count to get. |
|
source |
string
|
if true, get source. |
object
the account's pending blocks.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Get the banano account for a given public key.
Name | Type | Description | |
---|---|---|---|
publicKey |
string
|
the public key. |
string
the account.
Get the banano account for a given public key.
Name | Type | Description | |
---|---|---|---|
publicKey |
string
|
the public key. |
string
the account.
Get the banano parts (banano, banoshi, raw) for a given raw value.
Name | Type | Description | |
---|---|---|---|
amountRawStr |
string
|
the raw amount, as a string. |
BananoParts
the banano parts.
Get the nano parts nano, nanoshi, raw) for a given raw value.
Name | Type | Description | |
---|---|---|---|
amountRawStr |
string
|
the raw amount, as a string. |
BananoParts
the banano parts.
Sets the Bananode Api (useful for overriding some methods)
Name | Type | Description | |
---|---|---|---|
_bananodeApi |
string
|
the new bananodeApi |
returns nothing.
converts amount from decimal to bananoParts.
Name | Type | Description | |
---|---|---|---|
decimalAmount |
string
|
the decimal amount of bananos. |
BananoParts
returns the banano parts of the decimal amount.
converts amount from bananoParts to decimal.
Name | Type | Description | |
---|---|---|---|
bananoParts |
BananoParts
|
the banano parts to describe. |
string
returns the decimal amount of bananos.
converts amount from decimal to raw.
Name | Type | Description | |
---|---|---|---|
amount |
string
|
the decimal amount. |
string
returns amount in raw.
describes the banano parts in an english description.
Name | Type | Description | |
---|---|---|---|
bananoParts |
BananoParts
|
the banano parts to describe. |
string
returns the description of the banano parts.
Sends the amount to the account with an optional representative and previous block hash. If the representative is not sent, it will be pulled from the api. If the previous is not sent, it will be pulled from the api. Be very careful with previous, as setting it incorrectly can cause an incorrect amount of funds to be sent.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
destAccount |
string
|
the destination account. |
|
amountRaw |
string
|
the amount to send, in raw. |
|
representative |
string
|
the representative (optional). |
|
previousHash |
string
|
the previous hash (optional). |
string
returns the hash returned by the send.
Sends the amount to the account with an optional representative and previous block hash. If the representative is not sent, it will be pulled from the api. If the previous is not sent, it will be pulled from the api. Be very careful with previous, as setting it incorrectly can cause an incorrect amount of funds to be sent.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
destAccount |
string
|
the destination account. |
|
amountRaw |
string
|
the amount to send, in raw. |
|
representative |
string
|
the representative (optional). |
|
previousHash |
string
|
the previous hash (optional). |
string
returns the hash returned by the send.
Sends the amount to the banano account with a callback for success and failure.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
destAccount |
string
|
the destination account. |
|
amountRaw |
string
|
the amount to send, in raw. |
|
successCallback |
string
|
the callback to call upon success. |
|
failureCallback |
string
|
the callback to call upon failure. |
string
returns the hash returned by the send.
Sends the amount to the nano account with a callback for success and failure.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
destAccount |
string
|
the destination account. |
|
amountRaw |
string
|
the amount to send, in raw. |
|
successCallback |
string
|
the callback to call upon success. |
|
failureCallback |
string
|
the callback to call upon failure. |
string
returns the hash returned by the send.
Sets the rep for an account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
string
returns the hash returned by the change.
Sets the rep for an account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
string
returns the hash returned by the change.
Recieve deposits for a nano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
|
specificPendingBlockHash |
string
|
a specific block hash to receive (optional). |
object
returns the response returned by the receive.
Recieve deposits for a nano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
|
specificPendingBlockHash |
string
|
a specific block hash to receive (optional). |
object
returns the response returned by the receive.
Send a withdrawal from a banano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
toAccount |
string
|
the account to send to. |
|
amountBananos |
string
|
the amount of bananos. |
object
returns the response returned by the withdraw.
Send a withdrawal from a nano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
toAccount |
string
|
the account to send to. |
|
amountBananos |
string
|
the amount of bananos. |
object
returns the response returned by the withdraw.
Get the balance, in raw, for an account.
(use other methods like getBananoPartsFromRaw to convert to banano or banoshi)
Calls {@link https://docs.nano.org/commands/rpc-protocol/#accounts_balances}
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to use. |
string
the account's balance, in raw.
Get the balance and pending values, in raw, as an object like this one: { balance: '123', pending: '123' } for an account.
(use other methods like getBananoPartsFromRaw to convert to banano or banoshi)
Calls {@link https://docs.nano.org/commands/rpc-protocol/#accounts_balances}
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to use. |
object
the account's balances, in raw.
Get the history for an account.
Calls {@link https://docs.nano.org/commands/rpc-protocol/#account_history}
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to use. |
|
count |
string
|
the count to use (use -1 for all). |
|
head |
string
|
the head to start at (optional). |
|
raw |
string
|
if true, return raw history (optional). |
object
the account's history.
Get the banano account with a given seed and index.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
string
the account.
Get the banano account with a given seed and index.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
string
the account.
Sets the URL to use for the node behind the Bananode Api
Name | Type | Description | |
---|---|---|---|
url |
string
|
the new url |
returns nothing.
Get the account info for an account.
Calls {@link https://docs.nano.org/commands/rpc-protocol/#account_info}
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to use. |
|
representativeFlag |
boolean
|
the representativeFlag to use (optional). |
object
the account's info.
Get the network block count.
Calls {@link https://docs.nano.org/commands/rpc-protocol/#block_count}
object
the block count.
Open a banano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
|
pendingBlockHash |
string
|
the pending block hash. |
|
pendingValueRaw |
string
|
the pending block hash. |
string
returns the hash returned by the open.
Open a nano account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
representative |
string
|
the representative. |
|
pendingBlockHash |
string
|
the pending block hash. |
|
pendingValueRaw |
string
|
the pending block hash. |
string
returns the hash returned by the open.
Get the hash for a given block.
Name | Type | Description | |
---|---|---|---|
block |
string
|
the seed to use to find the account. |
string
the block's hash.
signs a hash.
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key to use to sign. |
|
hash |
string
|
the hash to sign. |
string
the block's hash.
verifys a hash.
Name | Type | Description | |
---|---|---|---|
hash |
string
|
the hash to verify. |
|
signature |
string
|
the signature to verify. |
|
publicKey |
string
|
the public key to use to sign. |
string
true if verification passed.
Get the signature for a given block (gets the hash of the block, and signs the hash).
Name | Type | Description | |
---|---|---|---|
privateKey |
string
|
the private key used to sign the block. |
|
block |
string
|
the block to sign. |
string
the block's signature.
Converts a hex string to bytes in a Uint8Array.
Name | Type | Description | |
---|---|---|---|
hex |
string
|
the hex string to use. |
Uint8Array
the bytes in a Uint8Array.
gets work bytes using the CPU.
Name | Type | Description | |
---|---|---|---|
hash |
string
|
the hash to use to calculate work bytes. |
|
workBytes |
Uint8Array
|
the Uint8Array(8) used to store temporary calculations. |
string
the work bytes as a hex string.
receives banano funds at a camo address.
Name | Type | Description | |
---|---|---|---|
toPrivateKey |
string
|
the private key that receives the funds. |
|
fromPublicKey |
string
|
the public key that sent the funds. |
string_array
the received hashes in an array.
receives nano funds at a camo address.
Name | Type | Description | |
---|---|---|---|
toPrivateKey |
string
|
the private key that receives the funds. |
|
fromPublicKey |
string
|
the public key that sent the funds. |
string_array
the received hashes in an array.
finds a new private key to recieve more banano funds. the key would have no history.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
string
the private key to use.
finds a new private key to recieve more banano funds. the key would have no history.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
string
the private key to use.
sends banano funds to a camo address.
Name | Type | Description | |
---|---|---|---|
fundingPrivateKey |
string
|
the private key that sends the funds. |
|
fromCamoPrivateKey |
string
|
the private key used to generate the shared seed. |
|
toCamoPublicKey |
string
|
the public key that receives the funds. |
|
amountBananos |
string
|
the amount of bananos. |
string_array
the sent hashes in an array.
sends camo funds to a camo address.
Name | Type | Description | |
---|---|---|---|
fundingPrivateKey |
string
|
the private key that sends the funds. |
|
fromCamoPrivateKey |
string
|
the private key used to generate the shared seed. |
|
toCamoPublicKey |
string
|
the public key that receives the funds. |
|
amountBananos |
string
|
the amount of bananos. |
string_array
the sent hashes in an array.
sends banano funds to a camo account. This function uses seed index 0 to generate the shared secret, and seed index "seedIx" to get the private key that contains funds to send.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
toAccount |
string
|
the account to send to. |
|
amountBananos |
string
|
the amount of bananos. |
string_array
the sent hashes in an array.
sends nano funds to a camo account. This function uses seed index 0 to generate the shared secret, and seed index "seedIx" to get the private key that contains funds to send.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
toAccount |
string
|
the account to send to. |
|
amountBananos |
string
|
the amount of bananos. |
string_array
the sent hashes in an array.
get the pending blocks for the camo banano account.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
fromAccount |
string
|
the account to recieve from. |
|
sharedSeedIx |
number
|
the index to use with the shared seed. |
|
count |
number
|
the max count to get. |
string_array
the pending hashes in an array.
get the pending blocks for the camo nano account.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
fromAccount |
string
|
the account to recieve from. |
|
sharedSeedIx |
number
|
the index to use with the shared seed. |
|
count |
number
|
the max count to get. |
string_array
the pending hashes in an array.
returns data on whether a camo account is valid or not, and why.
Name | Type | Description | |
---|---|---|---|
account |
string
|
the account to check. |
object
the account validity data.
get the banano shared account, used as an intermediary to send finds between the seed and the camo account.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
account |
string
|
the camo account to send or recieve from. |
|
sharedSeedIx |
string
|
the index to use with the shared seed. |
string
the shared account.
get the nano shared account, used as an intermediary to send finds between the seed and the camo account.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
account |
string
|
the camo account to send or recieve from. |
|
sharedSeedIx |
string
|
the index to use with the shared seed. |
string
the shared account.
Recieve banano deposits for a camo account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
account |
string
|
the camo account to send or recieve from. |
|
sharedSeedIx |
string
|
the index to use with the shared seed. |
|
specificPendingBlockHash |
string
|
the pending block to recieve. |
string
the response from receiving the block.
Recieve nano deposits for a camo account with a given seed.
Name | Type | Description | |
---|---|---|---|
seed |
string
|
the seed to use to find the account. |
|
seedIx |
string
|
the index to use with the seed. |
|
account |
string
|
the camo account to send or recieve from. |
|
sharedSeedIx |
string
|
the index to use with the shared seed. |
|
specificPendingBlockHash |
string
|
the pending block to recieve. |
string
the response from receiving the block.
gets the total banano account balance, in raw.
Name | Type | Description | |
---|---|---|---|
toPrivateKey |
string
|
the private key that receives the funds. |
|
fromPublicKey |
string
|
the public key that sent the funds. |
string
the account balance, in raw.
gets the total nano account balance, in raw.
Name | Type | Description | |
---|---|---|---|
toPrivateKey |
string
|
the private key that receives the funds. |
|
fromPublicKey |
string
|
the public key that sent the funds. |
string
the account balance, in raw.
Get the network block count.
Calls {@link https://docs.nano.org/commands/rpc-protocol/#accounts_pending}
Name | Type | Description | |
---|---|---|---|
accounts |
string_array
|
the array of pending accounts. |
|
count |
number
|
the max count to get. |
|
source |
string
|
if true, get source. |
object
the account's pending blocks.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Converts an amount into a raw amount.
Name | Type | Description | |
---|---|---|---|
amountStr |
string
|
the amount, as a string. |
|
amountPrefix |
string
|
the amount, as a string. |
string
the banano as a raw value.
Get the banano account for a given public key.
Name | Type | Description | |
---|---|---|---|
publicKey |
string
|
the public key. |
string
the account.
Get the banano account for a given public key.
Name | Type | Description | |
---|---|---|---|
publicKey |
string
|
the public key. |
string
the account.
Get the banano parts (banano, banoshi, raw) for a given raw value.
Name | Type | Description | |
---|---|---|---|
amountRawStr |
string
|
the raw amount, as a string. |
BananoParts
the banano parts.
Get the nano parts nano, nanoshi, raw) for a given raw value.
Name | Type | Description | |
---|---|---|---|
amountRawStr |
string
|
the raw amount, as a string. |
BananoParts
the banano parts.