Skip to content

Commit

Permalink
Merge pull request #431 from alephium/fix-call-method-doc
Browse files Browse the repository at this point in the history
Fix doc for calling contract methods
  • Loading branch information
Lbqds authored Aug 20, 2024
2 parents 45692bc + 5ec0546 commit 8ac9167
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/dapps/tutorials/dapp-recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ web3.setCurrentNodeProvider(nodeProvider)

const tokenFaucetAddress = 'y1btMZHTvMvHEqLTdx1JHvEXq3tmVfqsY2rwM669upiT'
const tokenFaucet = TokenFaucet.at(tokenFaucetAddress)
const totalSupply = await tokenFaucet.methods.getTotalSupply()
const totalSupply = await tokenFaucet.view.getTotalSupply()
```

### Subscribe to contract events
Expand Down
6 changes: 3 additions & 3 deletions docs/dapps/tutorials/first-fungible-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ also enables SDK to get its information in a standard way:

```typescript
// Use SDK to call methods individually
const getDecimalResult = await shinyToken.methods.getDecimals()
const getTotalSupplyResult = await shinyToken.methods.getTotalSupply()
const getNameResult = await shinyToken.methods.getName()
const getDecimalResult = await shinyToken.view.getDecimals()
const getTotalSupplyResult = await shinyToken.view.getTotalSupply()
const getNameResult = await shinyToken.view.getName()
console.log("TokenFaucet name, decimals, totalSupply", getNameResult.returns, getDecimalResult.returns, getTotalSupplyResult.returns)

// Use SDK to call all multiple methods at the same time
Expand Down

0 comments on commit 8ac9167

Please sign in to comment.