Skip to content

Commit

Permalink
Added docs for 15.1.0 and removed older docs (#2304)
Browse files Browse the repository at this point in the history
* Added docs for 15.1.0 and removed older docs

* added prepare entry in the sidebar

* Added increase paid storage examples for wallet API usage
  • Loading branch information
dsawali authored Jan 18, 2023
1 parent cb0fd1b commit d6e1d71
Show file tree
Hide file tree
Showing 75 changed files with 3,614 additions and 1,387 deletions.
50 changes: 43 additions & 7 deletions docs/increase_paid_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ This helps resolve an issue where several operations on the same contract would

For more information on this change, refer to this [MR](https://gitlab.com/tezos/tezos/-/merge_requests/5605) in the Tezos codebase.
## Examples
Similar to other operations, the Increase Paid Storage operation will be available in the Contract API (and later, the wallet API).
Similar to other operations, the Increase Paid Storage operation is available in the Contract and Wallet API

### Simple Usage
### Contract API

#### Simple Usage
```js
const op = await Tezos.contract.increasePaidStorage({
amount: 2,
Expand All @@ -25,8 +27,8 @@ await op.confirmation();

After waiting for the operation confirmation, you will also have access to various getters of the operation such as `status`, `amount`, `destination`, `fee`, `gasLimit`, `errors`, `storageLimit`, `consumedMilligas`.

### Usage in Batches
```js
#### Usage in Batches
```typescript
const op = await Tezos.contract
.batch()
.withOrigination({
Expand All @@ -45,12 +47,12 @@ const op = await Tezos.contract
destination: 'SMART_CONTRACT_ADDRESS'
})
.send();

await op.confirmation();
```

or
```js
```typescript
const op = await Tezos.contract.batch([
{
kind: 'origination',
Expand All @@ -69,4 +71,38 @@ const op = await Tezos.contract.batch([
await op.confirmation();
```

Both syntax will work fine for batching any operations, including `increase_paid_storage`.
Both syntax will work fine for batching any operations, including `increase_paid_storage`.

### Wallet API

#### Usage Example
```typescript
const op = await Tezos.wallet.increasePaidStorage({
amount: 1,
destination: simpleContractAddress
}).send();
```

#### Usage in Batches
```typescript
const batch = await Tezos.wallet
.batch()
.withOrigination({
balance: "1",
code: `parameter string;
storage string;
code {CAR;
PUSH string "Hello ";
CONCAT;
NIL operation; PAIR};
`,
init: `"test"`
})
.withIncreasePaidStorage({
amount: 1,
destination: simpleContractAddress
});

const op = await batch.send();
await op.confirmation();
```
62 changes: 62 additions & 0 deletions docs/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,68 @@
title: Versions
author: Jev Bjorsell
---
# Taquito v15.1.0
## Summary

### New Features
- `@taquito/taquito` New provider support `PrepareProvider` to facilitate preparation of operations in Taquito. #2020
- `@taquito/taquito` Support new operation `increase_paid_storage` on the wallet API #1768

### Bug Fixes
- Fixed a bug where `axios-fetch-adapter` was not returning the response body from errors, causing the wrong error to be captured by the calling method #2187

### Documentation
- Update Taquito website live code examples to use Ghostnet endpoint. #2224

### Internals
- Updated Beacon version to v3.3.1 [PR](https://github.com/ecadlabs/taquito/pull/2266)
- Updated Taquito Github Workflows to use Node LTS/Gallium (v16) [PR](https://github.com/ecadlabs/taquito/pull/2301)

## `@taquito/taquito` - Added new provider `PrepareProvider` to facilitate operation preparation

`PrepareProvider` now extends more control to the user to give them the ability to 'prepare' Tezos operations before forging and injection. The preparation step now can be done through the `TezosToolkit` class as such:

```typescript
// example of a transaction operation preparation
const prepare = await Tezos.prepare.transaction({
to: 'tz1KvJCU5cNdz5RAS3diEtdRvS9wfhRC7Cwj',
amount: 5
});
```

The expected output will look something like this:
```typescript
{
opOb: {
branch: 'BLOCK_HASH',
contents: [
{
kind: 'transaction',
fee: '391',
gas_limit: '101',
storage_limit: '1000',
amount: '5000000',
destination: 'tz1KvJCU5cNdz5RAS3diEtdRvS9wfhRC7Cwj',
source: 'PUBLIC_KEY_HASH',
counter: '1',
},
],
protocol: 'PROTOCOL_HASH',
},
counter: 0,
}
```

## `@taquito/taquito` - Increase paid storage operation support in the wallet API
Taquito now supports `increase_paid_storage` operation in the Wallet API (previously only available in the Contract API).

```typescript
const op = await Tezos.wallet.increasePaidStorage({
amount: 1,
destination: simpleContractAddress
}).send();
```

# Taquito v15.0.1
## Hotfix
- Fixed a bug where the `local-forging` package was using an outdated version of the codec when it's instantiated without passing in a protocol hash. Updated so that the default value uses the current protocol hash. #2242
Expand Down
1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const sidebars = {
'multisig_doc',
'on_chain_views',
'originate',
'prepare',
'rpc_nodes',
'rpc_package',
'signing',
Expand Down
1 change: 1 addition & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"multisig_doc",
"originate",
"global_constant",
"prepare",
"rpc_nodes",
"rpc_package",
"signing",
Expand Down
19 changes: 0 additions & 19 deletions website/versioned_docs/version-13.0.0/boilerplate.md

This file was deleted.

42 changes: 0 additions & 42 deletions website/versioned_docs/version-13.0.0/rpc_nodes.md

This file was deleted.

46 changes: 46 additions & 0 deletions website/versioned_docs/version-15.1.0/amendment_and_voting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Amendment and Voting
id: amendment_and_voting
author: Davis Sawali
---

In Tezos, the economic protocol can be amended by proposing and voting for changes. The protocol change will happen depending on the result of the votes.

## Proposals
A `Proposals` operation can be injected during a **Proposal Period**. It allows a delegate to submit a proposal identified by a protocol hash. Submitting a proposal also upvotes said proposal during the **Proposal Period**, not to be confused with *Ballot* votes in the section below.

The proposal with the most support is selected and will move on to the **Exploration Period**.

:::info
Note: Each delegate can submit a maximum of 20 proposals
:::

### Example
The `Proposals` operation is currently available in the Contract API, and can be used as such:
```typescript
const op = await Tezos.contract.proposals({
proposals: ['PROTOCOL_HASH1', 'PROTOCOL_HASH2']
});

await op.confirmation();
```
- `proposals` parameter takes in a list of Protocol hash(es) you would like to submit.

## Ballot
The `Ballot` operation allows delegates to cast one `Yay`, `Nay`, or `Pass` ballot on a selected proposal. Delegates are only able to cast their votes during the **Exploration period** and the **Promotion period**.

### Example
The `Ballot` operation is currently available in the Contract API, and can be used as such:
```typescript
const op = await Tezos.contract.ballot({
proposal: 'PROTOCOL_HASH',
ballot: 'BALLOT_VOTE_STRING'
});

await op.confirmation();
```
- `proposal` is the string that you (a delegate) would like to point your ballot towards. Information on the current proposal can be obtained by calling [this RPC endpoint](https://tezos.gitlab.io/alpha/rpc.html#get-block-id-votes-current-proposal). Alternatively, you could also get the protocol hash by using Taquito's RPC Client method `RpcClient.getCurrentProposal`. For more information on the `RpcClient` refer to [this document](https://tezostaquito.io/docs/rpc_package/)
- `ballot` is your ballot vote (`yay`, `nay`, or `pass`)


For more information in regards to the Amendment & Voting Process, refer to [this document](https://tezos.gitlab.io/alpha/voting.html)
23 changes: 23 additions & 0 deletions website/versioned_docs/version-15.1.0/ballot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Ballot Operation
id: ballot
author: Davis Sawali
---

The `Ballot` operation allows delegates to cast one `Yay`, `Nay`, or `Pass` ballot on a selected proposal. Delegates are only able to cast their votes during the **Exploration period** and the **Promotion period**

## Examples
The `Ballot` operation is currently available in the Contract API, and can be used as such:
```typescript
const op = await Tezos.contract.ballot({
proposal: 'PROPOSAL_HASH',
ballot: 'BALLOT_VOTE_STRING'
});

await op.confirmation();
```
- `proposal` is the proposal hash string that you (a delegate) would like to point your ballot towards. Information on the current proposal can be obtained by calling [this RPC endpoint](https://tezos.gitlab.io/alpha/rpc.html#get-block-id-votes-current-proposal). Alternatively, you could also get the proposal hash by using Taquito's RPC Client method `RpcClient.getCurrentProposal`. For more information on the `RpcClient` refer to [this document](https://tezostaquito.io/docs/rpc_package/)
- `ballot` is your ballot vote (`yay`, `nay`, or `pass`)


For more information in regards to the Amendment (and Voting) Process refer to [this document](https://tezos.gitlab.io/alpha/voting.html)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ await op1.confirmation();
await op2.confirmation();

/*
* Error Message returned by the node:
* Error Message returned by the node (since Kathmandu):
* Error while applying operation opHash:
* Only one manager operation per manager per block allowed (found opHash2 with Xtez fee).
*
* Error Message that was returned by the node (before Kathmandu):
* "Error while applying operation opWH2nEcmmzUwK4T6agHg3bn9GDR7fW1ynqWL58AVRAb7aZFciD:
* branch refused (Error:
* Counter 1122148 already used for contract tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb (expected 1122149))"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ title: BeaconWallet singleton
author: Claude Barde
---

:::caution Outdated documentation
Since version 14, Taquito uses the beacon-dapp's `getDAppClientInstance` method instead of the `new DAppClient`. This new method ensures that only one instance is created. The same cached instance is returned if called multiple times.
:::

# How to use a single instance of the BeaconWallet?

> TL;DR: in order to avoid unexpected problems with the Beacon wallet instance, there should be only one __new BeaconWallet(options)__ in your whole app.
Expand Down
Loading

0 comments on commit d6e1d71

Please sign in to comment.