Skip to content

Commit

Permalink
Update for HIP-583 feature (#67)
Browse files Browse the repository at this point in the history
* Update AccountCreateTransaction.md

Signed-off-by: SimiHunjan <simi.hunjan.k@gmail.com>

* Update AccountId.md

Signed-off-by: SimiHunjan <simi.hunjan.k@gmail.com>

* Update TransactionRecord.md

Signed-off-by: SimiHunjan <simi.hunjan.k@gmail.com>

* Update PublicKey.md

Signed-off-by: SimiHunjan <simi.hunjan.k@gmail.com>

* Update AccountId.md

Signed-off-by: SimiHunjan <simi.hunjan.k@gmail.com>

---------

Signed-off-by: SimiHunjan <simi.hunjan.k@gmail.com>
  • Loading branch information
SimiHunjan committed Feb 27, 2023
1 parent 335062f commit 997f430
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
6 changes: 6 additions & 0 deletions reference/core/TransactionRecord.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,9 @@ top-level id, in consensus order. Always empty if the top-level status is UNKNOW
List of accounts with the corresponding staking rewards paid as a result of a transaction.

---

### `evmAddress`: `Bytes`

The EOA 20-byte address to create that is derived from the keccak-256 hash of a ECDSA_SECP256K1 primitive key.

---
8 changes: 8 additions & 0 deletions reference/cryptocurrency/AccountCreateTransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var key = PrivateKey.generate();
var fileId = new AccountCreateTransaction()
.setKey(key)
.setInitialBalance(new Hbar(10)) // 10 hbars
.setEvmAddress(evmAddress) // bytes
.execute(client) // TransactionResponse
.getReceipt(client) // TransactionReceipt
.accountId // Nullable<AccountId>
Expand All @@ -57,6 +58,8 @@ const key = PrivateKey.generate();
const transaction = new AccountCreateTransaction({
key: newKey,
initialBalance: new Hbar(10),
evmAddress: evmAddress,

});

const response = await accountCreateTransaction.execute(client) // TransactionResponse;
Expand All @@ -74,6 +77,7 @@ newKey := hedera.GeneratePrivateKey()
response, err := hedera.NewAccountCreateTransaction().
SetKey(newKey).
SetInitialBalance(10 * hedera.Hbar) // 10 Hbars
SetEvmAddress(evmAddress) // bytes
Execute(client) // TransactionResponse
if err != nil {
println(err.Error())
Expand Down Expand Up @@ -172,4 +176,8 @@ ID of the node this contract is staked to.

If true, the account declines receiving a staking reward. The default value is false.

##### `evmAddress`: `bytes`

EOA 20-byte address to create that is derived from the keccak-256 hash of a ECDSA_SECP256K1 primitive key.

---
14 changes: 14 additions & 0 deletions reference/cryptocurrency/AccountId.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ Note: If the account ID has an `aliasKey`, `toStringWithChecksum` will throw an

---

##### `toEvmAddress` ( ): `String`

Returns "0x_____" string Ethereum public address.

##### `fromEvmAddress` ( ): `String`

Accepts "0x___" or "___" Ethereum public address.

### Properties

##### `shard`: `Uint64`
Expand All @@ -102,3 +110,9 @@ A nonnegative account number unique within its realm
An alias for the `num` of the account if the account was created from a public key directly.

---

##### `evmAddress`: `Bytes`

The EOA 20-byte address to create that is derived from the keccak-256 hash of a ECDSA_SECP256K1 primitive key.

---
6 changes: 3 additions & 3 deletions reference/cryptography/PublicKey.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A public key on the Hedera™ network.

<!-- tabs:start -->

###### ** Java **
### ** Java **

```java
var publicKey = PublicKey.fromString("...");
Expand All @@ -16,7 +16,7 @@ var publicKey = PublicKey.fromString("...");
const publicKey = PublicKey.fromString("...");
```

###### ** Go **
### ** Go **

```go
publicKey, err := hedera.PublicKeyFromString("...")
Expand Down Expand Up @@ -154,6 +154,6 @@ Convert this public key into an account ID with a given shard and realm.

##### `toEvmAddress` (): `string`

Convert this public key into an account ID with a given shard and realm.
Convert this public key into an evm address. The EVM address is This is the rightmost 20 bytes of the 32 byte Keccak-256 hash of the ECDSA public key.

---

0 comments on commit 997f430

Please sign in to comment.