Skip to content

Commit

Permalink
Merge pull request #397 from alephium/improve-contract-doc
Browse files Browse the repository at this point in the history
Improve contract doc
  • Loading branch information
polarker authored Jun 26, 2024
2 parents a602fc4 + 3ac4b45 commit df16823
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/sdk/interact-with-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ script source code**, please refer to the [Load contract/script from
artifacts](/dapps/tutorials/dapp-recipes#load-contractscript-from-artifacts)
guide.

## Fetching Contract State

You can use `<contractInstance>.fetchState()` to get the current fields of the target contract.

```typescript
const state = await tokenFaucet.fetchState()
```

## Contract Views

Inside of the `TokenFaucet` typescript class, [Typescript
Expand Down Expand Up @@ -218,7 +226,7 @@ non-deterministic depending on the future state of the blockchain when
the transaction is mined. `Events` are instead often used to gain insights
into the contract activities.

### Contract Transact Methods
## Contract Transact Methods

[Typescript SDK](/sdk/getting-started) also generates the `transact`
methods for all functions in the `TokenFaucet` contract to simplify
Expand Down

0 comments on commit df16823

Please sign in to comment.