Skip to content

Commit

Permalink
add to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
avkos committed Apr 25, 2024
1 parent 4491afe commit 9f87de7
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ web3.defaultHardfork = 'cancun'; // set hardfork which support blob transactions
web3.defaultChain = 'sepolia'; // set chain which support blob transactions
```

### Send transaction
### Methods

#### sendTransaction
```typescript
// add account to sign transaction
const acc = web3.eth.accounts.privateKeyToAccount(String(process.env.PRIVATE_KEY));
Expand Down Expand Up @@ -68,7 +70,7 @@ const receipt = await res; // and get receipt here

```

### Estimate gas
#### estimateGas
```typescript
import {BlobTransaction} from 'web3-plugin-blob-tx';

Expand All @@ -85,9 +87,19 @@ const txData:Partial<BlobTransaction> = {
const gas = await web3.blobTx.estimateGas(txData);
```

### GetTransactionReceipt
#### getTransactionReceipt
```typescript
const receipt = await web3.blobTx.getTransactionReceipt(/* transaction hash */);
```

#### getTransaction
```typescript
const transaction = await web3.blobTx.getTransaction(/* transaction hash */);
```

#### getTransactionFromBlock
```typescript
const receipt = await web3.blobTx.getTransactionReceipt(/*transaction hash*/);
const transaction = await web3.blobTx.getTransactionFromBlock(/* block number or tag */, /* transaction index */);
```

Contributing
Expand Down

0 comments on commit 9f87de7

Please sign in to comment.