- ethereum-input-data-decoder
- express
- web3
- axios
Ethereum provider must be set, Infura API and BSC public RPC used in this example (global constant "InfuraAPI" and "BSCHttpAPI")
Private key must be securely saved (global constants "privateKey*")
Soon...
Full istructions how to use deta at https://docs.deta.sh/docs/home/ In this variant you have to take care of privateKey because it is not cyphered!!!
Make a new project
deta new --node eth-bsc-bridge
cd eth-bsc-bridge
npm i
Copy index_node.js and package.json to project root then run following command
npm i
Deploy project to Deta
deta deploy
await getTransactionSign(
transactionHash,
abiMethodToCheck,
contractToCheck,
contractABI,
privateKey,
httpAPIURL
)
.then((result) => {
// Signed message
})
.catch((error) => {
// Error message
});
Checks transaction data to meet defined conditions then signs arbitrary data
String
- The transaction hash.String
- The ABI method to check.String
- The contract address to check.Object
- The ABI object.String
- Private key used to sign message.String
- The RPC service URL.
Promise
returns Object
: The signature object
message
-String
: The the given message.messageHash
-String
: The hash of the given message.r
-String
: First 32 bytes of the signatures
-String
: Next 32 bytes of the signaturev
-String
: Recovery value + 27
String
- The transaction hash.String
- The RPC service URL.
Promise
returns Object
- A transaction object its hash transactionHash
:
hash
32 Bytes -String
: Hash of the transaction.nonce
-Number
: The number of transactions made by the sender prior to this one.blockHash
32 Bytes -String
: Hash of the block where this transaction was in.null
when its pending.blockNumber
-Number
: Block number where this transaction was in.null
when its pending.transactionIndex
-Number
: Integer of the transactions index position in the block.null
when its pending.from
-String
: Address of the sender.to
-String
: Address of the receiver.null
when its a contract creation transaction.value
-String
: Value transferred in :ref:wei <what-is-wei>
.gasPrice
-String
: Gas price provided by the sender in :ref:wei <what-is-wei>
.gas
-Number
: Gas provided by the sender.input
-String
: The data sent along with the transaction.
String
- The transaction input.Object
- The ABI object.
Object
- A result transaction input decoding :
method
-String
: The the given message.types
-Object
: tuples are represented as a string containing types contained in the tuple.inputs
-Object
: tuples are represented as an array containing values contained in the tuplenames
-Object
: tuples are represented as an array with 2 items. Item 1 is the name of the tuple, item 2 is an array containing the names of the values contained in the tuple.
String
- The transaction hash.String
- The RPC service URL.
Promise
returns boolean
- A result of checking transaction hash transactionHash
String
- The RPC service URL.
Promise
returns number
- latest block number
String
- The contract address from transaction.String
- The contract address.
Promise
resolve if address is ok, reject if address is not.
number
- The transaction block number.String
- The RPC service URL.number
- ( Optional ) The minimum amount of transaction to check
Promise
returns boolean
- A result of checking minimum amount of confirmations
Signs arbitrary data
number
- The transaction amount.String
- The transaction block number.String
- The transaction adress amount send from.String
- Private key used to sign message
Object
: The signature object
message
-String
: The the given message.messageHash
-String
: The hash of the given message.r
-String
: First 32 bytes of the signatures
-String
: Next 32 bytes of the signaturev
-String
: Recovery value + 27