#ethereum #transaction #builder #chain

rosetta-tx-ethereum

Ethereum交易构建器

3个版本 (破坏性更新)

0.4.0 2023年6月29日
0.2.5 2023年5月1日
0.1.0 2023年3月30日

#231#chain

Download history 25/week @ 2024-03-14 27/week @ 2024-03-21 57/week @ 2024-03-28 34/week @ 2024-04-04 16/week @ 2024-04-11 25/week @ 2024-04-18 21/week @ 2024-04-25 17/week @ 2024-05-02 26/week @ 2024-05-09 22/week @ 2024-05-16 23/week @ 2024-05-23 34/week @ 2024-05-30 16/week @ 2024-06-06 19/week @ 2024-06-13 28/week @ 2024-06-20 12/week @ 2024-06-27

每月 80 次下载
9 个crate中使用 (通过 rosetta-client)

MIT 许可证

16KB
274

本项目用于构建以太坊链的交易。

EthereumTransactionBuilder:

Its implementation of `TransactionBuilder` and implements the following methods:
1. `transfer`
2. `method_call`
3. `create_and_sign`

转账:

Creates `EthereumMetadataParams` for transfer call.

方法调用:

Creates `EthereumMetadataParams` for contract calls. It takes 
`method`: this is a string contraining contract address and method signature with `-` seperation.
`params`: array of json_value with params taken by contract methods in string format.

It returns `EthereumMetadataParams` with `data` field set to the encoded contract call params.

创建并签名:

When `metadata` is created we use this call to create Ethereum Transaction and sign it. It takes following arguments.
`config`: chain sepecific config.
`metadata_params`: Metadata params which created metadata for this call.
`metadata`: Metadata required make transaction.
`secret_key`: wallet's secret key (used to sign the transaction).

It creates the transaction and signs it and then returns its bytes.

依赖项

~15–28MB
~432K SLoC