Constructor
new RootChain(config)
Create a RootChain to interact with Ethereum root chain
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | configuration object |
- Source:
Methods
(async) challengeWithdrawal(eUtxoPos, blkNum, txIndex, oIndex, txData, proof, confirmSig, from, key)
Challenge withdrawal
Parameters:
Name | Type | Description |
---|---|---|
eUtxoPos |
number | |
blkNum |
number | |
txIndex |
number | |
oIndex |
number | |
txData |
string | |
proof |
string | |
confirmSig |
string | |
from |
string | |
key |
string |
- Source:
confirmSig(txHash, root, key)
Create a confirmation signature
Parameters:
Name | Type | Description |
---|---|---|
txHash |
string | |
root |
string | |
key |
string |
- Source:
(async) createChallengeWithdrawal(eUtxoPos, blkNum, txIndex, oIndex, txData, proof, confirmSig, from)
Create challenge withdrawal
Parameters:
Name | Type | Description |
---|---|---|
eUtxoPos |
number | |
blkNum |
number | |
txIndex |
number | |
oIndex |
number | |
txData |
string | |
proof |
string | |
confirmSig |
string | |
from |
string |
- Source:
(async) createDeposit(address, token, amount)
Create a deposit in ether unit
Parameters:
Name | Type | Description |
---|---|---|
address |
string | |
token |
string | |
amount |
string |
- Source:
(async) createFinalizeWithdrawal(from)
Create finalize withdrawal
Parameters:
Name | Type | Description |
---|---|---|
from |
string |
- Source:
(async) createStartDepositWithdrawal(depositPos, token, amount, from)
Create start deposit withdrawal
Parameters:
Name | Type | Description |
---|---|---|
depositPos |
number | |
token |
string | |
amount |
number | |
from |
string |
- Source:
(async) createStartWithdrawal(blkNum, txIndex, oIndex, txData, proof, confirmSigs, from)
Create start withdrawal
Parameters:
Name | Type | Description |
---|---|---|
blkNum |
number | |
txIndex |
number | |
oIndex |
number | |
txData |
string | |
proof |
string | |
confirmSigs |
string | |
from |
string |
- Source:
(async) deposit(address, token, amount, key)
Deposit in ether unit
Parameters:
Name | Type | Description |
---|---|---|
address |
string | |
token |
string | |
amount |
string | |
key |
string |
- Source:
(async) finalizeWithdrawal(from, key)
Finalize withdrawal
Parameters:
Name | Type | Description |
---|---|---|
from |
string | |
key |
string |
- Source:
(async) getDeposits(blockNumber)
Get deposits
Parameters:
Name | Type | Description |
---|---|---|
blockNumber |
number |
- Source:
(async) getWithdrawals(blockNumber)
Get withdrawals from ExitStarted events.
Parameters:
Name | Type | Description |
---|---|---|
blockNumber |
number |
- Source:
isValidConfirmSig(txHash, root, sig1, confSig1, sig2, confSig2)
Check if a confirmation signature is valid
Parameters:
Name | Type | Description |
---|---|---|
txHash |
string | |
root |
string | |
sig1 |
string | |
confSig1 |
string | |
sig2 |
string | |
confSig2 |
string |
- Source:
isValidSignature(message, signature, address)
Check whether a signature is valid
Parameters:
Name | Type | Description |
---|---|---|
message |
string | hex string of the message |
signature |
string | hex string of the signature |
address |
string | hex string of the address |
- Source:
queueSubmitBlockHeader(blkNum, header)
Queue block header to be submit
Parameters:
Name | Type | Description |
---|---|---|
blkNum |
number | block nubmer |
header |
string | merkle root hex string |
- Source:
signBlock(message)
Sign a block
Parameters:
Name | Type | Description |
---|---|---|
message |
string | hex string of the message |
- Source:
signTransactionKey(message, key)
Sign a transaction with Key
Parameters:
Name | Type | Description |
---|---|---|
message |
string | hex string of the message |
key |
string | hex string of the private key |
- Source:
(async) startBlockSubmitter()
Start block submitter, checking to see block header in the queue and then append to the chain
- Source:
(async) startDepositWithdrawal(depositPos, token, amount, from, key)
Start deposit withdrawal
Parameters:
Name | Type | Description |
---|---|---|
depositPos |
number | |
token |
string | |
amount |
number | |
from |
string | |
key |
string |
- Source:
(async) startWithdrawal(blkNum, txIndex, oIndex, txData, proof, confirmSigs, from, key)
Start Withdrawal
Parameters:
Name | Type | Description |
---|---|---|
blkNum |
number | |
txIndex |
number | |
oIndex |
number | |
txData |
string | |
proof |
string | |
confirmSigs |
string | |
from |
string | |
key |
string |
- Source:
(async) submitBlockHeader(blkNum, header)
Submit block header
Parameters:
Name | Type | Description |
---|---|---|
blkNum |
number | block nubmer |
header |
string | merkle root hex string |
- Source:
(async) submitSignedTransaction(signedTransaction)
Submit signed transaction to ethereum chain
Parameters:
Name | Type | Description |
---|---|---|
signedTransaction |
string | hex string of the signed transaction |
- Source: