Parses REV address from ETH address.
Parses REV address (with ETH address and public key) from private key.
Parses REV address (with ETH address) from public key.
Generates a new REV address with corresponding private, public key and ETH address.
Parses REV address from different sources in string hex format. (private key -> public key -> ETH address -> REV address)
Converts Par
object to JSON returned from the RNode gRPC API.
Example of Rholang return values.
new return(`rho:rchain:deployId`) in {
return!("One argument") | // monadic
return!((true, "A", "B")) | // monadic as tuple
return!(true, "A", "B") | // polyadic
return!(true) | return!("A") // multiple values
}
And the corresponding converted JSON objects.
[ 'One argument' ] // return!("One argument")
[ [ true, 'A', 'B' ] ] // return!((true, "A", "B"))
[ true, 'A', 'B' ] // return!(true, "A", "B")
[ true, 'A' ] // return!(true) | return!("A")
Signs deploy data.
The private key for signing can be in different formats supported by elliptic library.
NOTE: Signing function can be used independently without this library and JS generated code (see rnode-sign.ts source).
// Generate new key pair
const { ec } = require('elliptic')
const secp256k1 = new ec('secp256k1')
const key = secp256k1.genKeyPair()
// Or use existing private key as hex string, Uint8Array, Buffer or ec.KeyPair
const key = '1bf36a3d89c27ddef7955684b97667c75454317d8964528e57b2308947b250b0'
const deployData = {
term: 'new out(`rho:io:stdout`) in { out!("Browser deploy test") }',
timestamp: Date.now(), // nonce
phloprice: 1, // price of tinny REV for phlogiston (gas)
phlolimit: 10e3, // max phlogiston (gas) for deploy execution
validafterblocknumber: 123, // latest block number
shardid: 'testnet', // shard name
}
// Signed deploy with deployer, sig and sigalgorithm fields populated
const signed = signDeploy(key, deployData)
Verifies deploy for a valid signature.
Verifes REV address as hex string.
Generated using TypeDoc
Serialization of DeployDataProto object without generated JS code.