Methods
(async) challengeExit(eUtxoPos, blkNum, txIndex, oIndex, confirmSigopt, from)
Challenge and exit object to be signed with web3.eth.accounts.signTransaction and submit with
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
eUtxoPos |
number | the eUtxoPos of the exit that you are challenging | |
blkNum |
number | the block number of the utxo to exit used to proof | |
txIndex |
number | the transaction index of the utxo to exit used to proof | |
oIndex |
number | the output index of the utxo to exit [0,1] used to proof | |
confirmSig |
string |
<optional> |
confirm signature from the owner of the input utxo in hex string, i.e., "0x..." |
from |
string | from address in hex string, i.e., "0x..." |
- Source:
(async) confirmTx(blkNum, txIndex, confirmSignature)
Submit a confirm signature for transaction txIndex in block blkNum
Parameters:
Name | Type | Description |
---|---|---|
blkNum |
number | the block number |
txIndex |
number | the transaction index in the block blkNum |
confirmSignature |
string | the confirmation signature to use to confirm the transaction in hex string, i.e., "0x..." |
- Source:
(async) deposit(address, token, amount)
Create a deposit object to be signed with web3.eth.accounts.signTransaction and submit
with submitSignedTransaction(signedTransaction)
Parameters:
Name | Type | Description |
---|---|---|
address |
string | from address in hex string, i.e., "0x..." |
token |
string | token address in hex string, i.e., "0x..." |
amount |
number | amount |
- Source:
(async) finalizeExit(address)
Finalize exit using from address and its private key object to be signed with web3.eth.accounts.signTransaction and submit with
Parameters:
Name | Type | Description |
---|---|---|
address |
string | address in hex string, i.e., "0x..." |
- Source:
(async) getBlocks(blkNumopt, fromBlkNumopt, toBlkNumopt)
Returns all the blocks or a specific block
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
blkNum |
string |
<optional> |
the block number to return |
fromBlkNum |
string |
<optional> |
the from block number to return |
toBlkNum |
string |
<optional> |
the to block number to return |
- Source:
(async) getLatestBlock()
Returns the latest block
- Source:
(async) getPendingTxs()
Returns current pending txpools
- Source:
(async) getUTXOs()
Returns current utxos
- Source:
(async) immediateExit()
Exit immediately
Child chain checks the validity of the withdraw by seeing if the utxo exists.
Child chain creates a withdrawal transaction on the chain and then submit immediate withdrawal to Ethereum main chain
- Source:
(async) startDepositExit(blkNum, token, amount, from)
Create an object that start exiting the deposit from the plasma chain to be signed with web3.eth.accounts.signTransaction and submit with submitSignedTransaction(signedTransaction)
Parameters:
Name | Type | Description |
---|---|---|
blkNum |
number | the block number of the deposit transaction |
token |
string | token address in hex string, i.e., "0x..." |
amount |
number | amount |
from |
string | from address in hex string, i.e., "0x..." |
- Source:
(async) startExit(blkNum, txIndex, oIndex, from, confirmSigsopt)
Start exiting the plasma chain object to be signed with web3.eth.accounts.signTransaction and submit with
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
blkNum |
number | the block number of the utxo to exit | |
txIndex |
number | the transaction index of the utxo to exit | |
oIndex |
number | the output index of the utxo to exit [0,1] | |
from |
string | from address in hex string, i.e., "0x..." | |
confirmSigs |
string |
<optional> |
confirm signature from the owner of the input utxo in hex string, i.e., "0x..." |
- Source:
(async) submitSignedTransaction(signedTransaction)
Submit a signed transaction to Ethereum chain
Parameters:
Name | Type | Description |
---|---|---|
signedTransaction |
string | signed transaction in hex string, i.e., "0x..." |
- Source:
(async) submitTransact(signedTransaction)
Submit a signed transaction to Plasma chain
Parameters:
Name | Type | Description |
---|---|---|
signedTransaction |
json | signed transaction json object from toJSON() function of the Transaction. |
- Source:
(async) transact(tokenopt, from, to, amount, confirmSigopt)
Create a transaction by spending from to to for amount of token using the confirm signature
To be signed before submitting
The confirm signature is optional if the input of the spending UTXO is owned by from
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
token |
string |
<optional> |
"0x0000000000000000000000000000000000000000" | token address in hex string, i.e., "0x..." |
from |
string | from address in hex string, i.e., "0x..." | ||
to |
string | to address in hex string, i.e., "0x..." | ||
amount |
number | the amount to send | ||
confirmSig |
string |
<optional> |
confirmation signature in hex string, i.e., "0x..." |
- Source:
(async) trustedChallengeExit(eUtxoPos, blkNum, txIndex, oIndex, confirmSigopt, address, key)
Challenge and exit
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
eUtxoPos |
number | the eUtxoPos of the exit that you are challenging | |
blkNum |
number | the block number of the utxo to exit used to proof | |
txIndex |
number | the transaction index of the utxo to exit used to proof | |
oIndex |
number | the output index of the utxo to exit [0,1] used to proof | |
confirmSig |
string |
<optional> |
confirm signature from the owner of the input utxo in hex string, i.e., "0x..." |
address |
string | address in hex string, i.e., "0x..." | |
key |
string | private key of address in hex string, i.e., "0x..." |
- Source:
(async) trustedConfirmTx(blkNum, txIndex, key)
Submit a confirm signature for transaction txIndex in block blkNum using the private key to sign for it
Parameters:
Name | Type | Description |
---|---|---|
blkNum |
number | the block number |
txIndex |
number | the transaction index in the block blkNum |
key |
string | the private key used to sign the confirmation in hex string, i.e., "0x..." |
- Source:
(async) trustedDeposit(address, token, amount, key)
Deposit into the plasma chain from address with token of amount using the private key of the address
Parameters:
Name | Type | Description |
---|---|---|
address |
string | from address in hex string, i.e., "0x..." |
token |
string | token address in hex string, i.e., "0x..." |
amount |
number | amount |
key |
string | private key of address in hex string, i.e., "0x..." |
- Source:
(async) trustedFinalizeExit(address, key)
Finalize exit using from address and its private key
Parameters:
Name | Type | Description |
---|---|---|
address |
string | address in hex string, i.e., "0x..." |
key |
string | private key of address in hex string, i.e., "0x..." |
- Source:
(async) trustedStartDepositExit(blkNum, token, amount, from, key)
Start exiting the deposit from the plasma chain
Parameters:
Name | Type | Description |
---|---|---|
blkNum |
number | the block number of the deposit transaction |
token |
string | token address in hex string, i.e., "0x..." |
amount |
number | amount |
from |
string | from address in hex string, i.e., "0x..." |
key |
string | private key of from address in hex string, i.e., "0x..." |
- Source:
(async) trustedStartExit(blkNum, txIndex, oIndex, confirmSigsopt, from, key)
Start exiting the plasma chain
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
blkNum |
number | the block number of the utxo to exit | |
txIndex |
number | the transaction index of the utxo to exit | |
oIndex |
number | the output index of the utxo to exit [0,1] | |
confirmSigs |
string |
<optional> |
confirm signature from the owner of the input utxo in hex string, i.e., "0x..." |
from |
string | from address in hex string, i.e., "0x..." | |
key |
string | private key of from address in hex string, i.e., "0x..." |
- Source:
(async) trustedTransact(tokenopt, from, to, amount, confirmSigopt, key)
Submit a transaction by spending from to to for amount of token using the confirm signature and the from's private key to sign.
The confirm signature is optional if the input of the spending UTXO is owned by from
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
token |
string |
<optional> |
"0x0000000000000000000000000000000000000000" | token address in hex string, i.e., "0x..." |
from |
string | from address in hex string, i.e., "0x..." | ||
to |
string | to address in hex string, i.e., "0x..." | ||
amount |
number | the amount to send | ||
confirmSig |
string |
<optional> |
confirmation signature in hex string, i.e., "0x..." | |
key |
string | private key of from in hex string, i.e., "0x..." |
- Source: