Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
[Unity] Document new static methods (tx/blocks)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed Nov 27, 2023
1 parent 10d705f commit 263d04f
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/unity/blocks/GetBlock.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Get Block
slug: /blocks/getblock
---

Get block data by block number.

## Usage

```csharp
BigInteger blockNumber = 1234567;
var block = await Blocks.GetBlock(blockNumber);
```

14 changes: 14 additions & 0 deletions docs/unity/blocks/GetBlockWithTransactions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Get Block With Transactions
slug: /blocks/getblockwithtransactions
---

Get block data by block number, including transaction data.

## Usage

```csharp
BigInteger blockNumber = 1234567;
var blockWithTransactions = await Blocks.GetBlockWithTransactions(blockNumber);
```

13 changes: 13 additions & 0 deletions docs/unity/blocks/GetLatestBlockNumber.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Get Latest Block Number
slug: /blocks/getlatestblocknumber
---

Get the latest block number.

## Usage

```csharp
BigInteger blockNumber = await Blocks.GetLatestBlockNumber();
```

13 changes: 13 additions & 0 deletions docs/unity/blocks/GetLatestBlockTimestamp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Get Latest Block Timestamp
slug: /blocks/getlatestblocktimestamp
---

Get the latest block timestamp.

## Usage

```csharp
BigInteger blocktimestamp = await Blocks.GetLatestBlockTimestamp();
```

24 changes: 24 additions & 0 deletions docs/unity/interacting-with-contracts/prepare.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,27 @@ TransactionResult;

</div>
</details>

## Static Methods

Useful static methods for working with transactions.

```csharp
string txHash = "your_tx_hash";
TransactionResult result = await Transaction.WaitForTransactionResult(txHash);
```

<details>
<summary>Configuration</summary>
<div>

### Return Value

Returns the transaction result as a <see cref="TransactionResult"/> object.

```csharp
TransactionResult;
```

</div>
</details>
13 changes: 13 additions & 0 deletions sidebars/unity.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,19 @@ const sidebars = {
],
},

// Blocks

{
type: "category",
label: "Blocks",
items: [
{
type: "autogenerated",
dirName: "blocks",
}
]
},

// Storage
{
type: "doc",
Expand Down

0 comments on commit 263d04f

Please sign in to comment.