Skip to content

Commit

Permalink
Beacon v4.3.2 (#3107)
Browse files Browse the repository at this point in the history
* chore: updated beacon to v4.3.2

* test: updated estimate assertion

* chore(releng) bump version to 21.0.1

* ci: removed most paris tests and reference after mainnet protocol migration

* docs: updated doc of tzip12.md and metadata-tzip16.md
  • Loading branch information
hui-an-yang authored Jan 23, 2025
1 parent dd6eddb commit 6ae6898
Show file tree
Hide file tree
Showing 71 changed files with 533 additions and 779 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ jobs:
strategy:
matrix:
include:
- testnet: parisnet
testnet_uppercase: PARISNET
rpc_url: https://rpc.pariscnet.teztnets.com/
- testnet: quebecnet
testnet_uppercase: QUEBECNET
rpc_url: https://rpc.quebecnet.teztnets.com/
Expand Down
16 changes: 8 additions & 8 deletions apps/taquito-test-dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "taquito-test-dapp-vite",
"private": true,
"version": "21.0.0",
"version": "21.0.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -24,13 +24,13 @@
"vite": "^5.3.5"
},
"dependencies": {
"@airgap/beacon-sdk": "^4.3.2-beta.0",
"@airgap/beacon-types": "^4.3.2-beta.0",
"@taquito/beacon-wallet": "^21.0.0",
"@taquito/core": "^21.0.0",
"@taquito/taquito": "^21.0.0",
"@taquito/utils": "^21.0.0",
"@taquito/wallet-connect": "^21.0.0",
"@airgap/beacon-sdk": "^4.3.2",
"@airgap/beacon-types": "^4.3.2",
"@taquito/beacon-wallet": "^21.0.1",
"@taquito/core": "^21.0.1",
"@taquito/taquito": "^21.0.1",
"@taquito/utils": "^21.0.1",
"@taquito/wallet-connect": "^21.0.1",
"buffer": "^6.0.3",
"svelte-modals": "^2.0.0-beta.2",
"svelte-select": "^5.8.3",
Expand Down
4 changes: 0 additions & 4 deletions apps/taquito-test-dapp/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
let browser = "";
let availableNetworks = [
{ value: "ghostnet", label: "Ghostnet", group: "current testnets" },
{ value: "parisnet", label: "Parisnet", group: "current testnets" },
{ value: "quebecnet", label: "Quebecnet", group: "current testnets" },
{ value: "mainnet", label: "Mainnet", group: "mainnet" },
{ value: "dailynet", label: "Dailynet", group: "other testnets" },
Expand All @@ -40,9 +39,6 @@
case "ghostnet":
store.updateNetworkType(NetworkType.GHOSTNET);
break;
case "parisnet":
store.updateNetworkType(NetworkType.PARISNET);
break;
case "quebecnet":
store.updateNetworkType(NetworkType.QUEBECNET);
break;
Expand Down
7 changes: 1 addition & 6 deletions apps/taquito-test-dapp/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { NetworkType as NetworkTypeBeacon } from "@airgap/beacon-sdk";
import { NetworkType as NetworkTypeWc } from "@taquito/wallet-connect";

export type SupportedNetworks = NetworkTypeBeacon.MAINNET | NetworkTypeBeacon.GHOSTNET | NetworkTypeBeacon.PARISNET | NetworkTypeBeacon.QUEBECNET | NetworkTypeWc.MAINNET | NetworkTypeWc.GHOSTNET | NetworkTypeWc.PARISNET | NetworkTypeWc.QUEBECNET | NetworkTypeBeacon.CUSTOM;
export type SupportedNetworks = NetworkTypeBeacon.MAINNET | NetworkTypeBeacon.GHOSTNET | NetworkTypeBeacon.QUEBECNET | NetworkTypeWc.MAINNET | NetworkTypeWc.GHOSTNET | NetworkTypeWc.QUEBECNET | NetworkTypeBeacon.CUSTOM;

const rpcUrls: Record<SupportedNetworks, string> = {
[NetworkTypeBeacon.MAINNET]: "https://mainnet.tezos.ecadinfra.com",
[NetworkTypeBeacon.GHOSTNET]: "https://ghostnet.tezos.ecadinfra.com/",
[NetworkTypeBeacon.PARISNET]: "https://rpc.pariscnet.teztnets.com/",
[NetworkTypeBeacon.QUEBECNET]: "https://rpc.quebecnet.teztnets.com",
[NetworkTypeBeacon.CUSTOM]: "https://ghostnet.tezos.ecadinfra.com/",
};
Expand All @@ -23,9 +22,6 @@ export const getTzKtUrl = (networkType: SupportedNetworks): string | undefined =
case NetworkTypeBeacon.GHOSTNET:
case NetworkTypeWc.GHOSTNET:
return "https://ghostnet.tzkt.io";
case NetworkTypeBeacon.PARISNET:
case NetworkTypeWc.PARISNET:
return "https://parisnet.tzkt.io";
case NetworkTypeBeacon.QUEBECNET:
case NetworkTypeWc.QUEBECNET:
return "https://quebecnet.tzkt.io";
Expand All @@ -43,6 +39,5 @@ export const contractAddress = {
mainnet: "KT1ShtH2zCrKMuWGRejEd6RAcnePwxBQeMAN",
ghostnet: "KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5",
oxfordnet: "KT1GYx1KDhMQt2GJEztRh8EyYxJUPM6fnAMM",
parisnet: "KT1E43cQefjM8fq7B5pEJFJoGbRmuNibDoBC",
quebecnet: "KT1JZ3H8zMn6GXoftLpRzGUwRD4fP7mmxKqW"
};
6 changes: 3 additions & 3 deletions docs/metadata-tzip16.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The constructor of the `Tzip16Module` takes an optional `MetadataProvider` as a

```js
import { TezosToolkit } from '@taquito/taquito';
import { Tzip16Module } from '@taquito/tzip16';
import { Tzip16Module, tzip16 } from '@taquito/tzip16';

const Tezos = new TezosToolkit('rpcUrl');
Tezos.addExtension(new Tzip16Module());
Expand All @@ -38,13 +38,13 @@ Tezos.addExtension(new Tzip16Module());
In some cases, we may want to use a customized metadata provider. The constructor of the `Tzip16Module` class takes an optional metadata provider as a parameter. This allows to inject a custom metadata provider with custom protocol handlers if desired. For example, if we want to use a different IPFS gateway than the default one, which is `ipfs.io`, or if we want to use a different HTTP handler to support authentication or custom headers. Here is an example:

```js
import { Handler, IpfsHttpHandler, TezosStorageHandler, MetadataProvider } from '@taquito/tzip16';
import { Handler, IpfsHttpHandler, TezosStorageHandler, MetadataProvider, Tzip16Module, tzip16 } from '@taquito/tzip16';

const Tezos = new TezosToolkit('rpcUrl');

// The constructor of the `MetadataProvider` class takes a `Map<string, Handler>` as a parameter.
const customHandler = new Map<string, Handler>([
['ipfs', new IpfsHttpHandler('gateway.ipfs.io')], // Constructor of IpfsHttpHandler takes an optional gateway
['ipfs', new IpfsHttpHandler('dweb.link')], // Constructor of IpfsHttpHandler takes an optional gateway
['http', 'customHttpHandler'], // Custom HTTP(S) handler
['https', 'customHttpHandler'],
['tezos-storage', new TezosStorageHandler()],
Expand Down
2 changes: 0 additions & 2 deletions docs/rpc_nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ values={[
| SmartPy | ghostnet | https://ghostnet.smartpy.io | [Check](https://ghostnet.smartpy.io/chains/main/blocks/head/header) |
| Tezos Foundation | mainnet | https://rpc.tzbeta.net | [Check](https://rpc.tzbeta.net/chains/main/blocks/head/header) |
| Tezos Foundation | ghostnet | https://rpc.ghostnet.teztnets.com | [Check](https://rpc.ghostnet.teztnets.com/chains/main/blocks/head/header) |
| Tezos Foundation | parisnet | https://rpc.pariscnet.teztnets.com | [Check](https://rpc.pariscnet.teztnets.com/chains/main/blocks/head/header) |
| Tezos Foundation | quebecnet | https://rpc.quebecnet.teztnets.com | [Check](https://rpc.quebecnet.teztnets.com/chains/main/blocks/head/header) |
| TzKT | mainnet | https://rpc.tzkt.io/mainnet | [Check](https://rpc.tzkt.io/mainnet/chains/main/blocks/head/header) |
| TzKT | ghostnet | https://rpc.tzkt.io/ghostnet | [Check](https://rpc.tzkt.io/ghostnet/chains/main/blocks/head/header) |
| TzKT | parisnet | https://rpc.tzkt.io/parisnet | [Check](https://rpc.tzkt.io/parisnet/chains/main/blocks/head/header) |
| TzKT | quebecnet | https://rpc.tzkt.io/quebecnet | [Check](https://rpc.tzkt.io/quebecnet/chains/main/blocks/head/header) |

<!-- when updating this table make sure to update the website/static/docs/rpc_nodes.json first and rerun example/convert-rpc-json-to-md.ts to replace the output table above -->
Expand Down
4 changes: 2 additions & 2 deletions docs/staking.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Staking changes this by allowing any user to participate in the "Proof of Stake"

Users can control their staked funds using the `stake`, `unstake`, and `finalize_unstake` operations. These are implemented as pseudo-entrypoints, and the parameters are passed to a transfer operation with the same destination as the sender.

To accept staked funds, a delegate needs to have opted in to staking. This is done by `set_delegate_parameters`. This part is not supported by Taquito, as it is not a dApp operation. More information [here](https://tezos.gitlab.io/paris/adaptive_issuance.html#staking-policy-configuration).
To accept staked funds, a delegate needs to have opted in to staking. This is done by `set_delegate_parameters`. This part is not supported by Taquito, as it is not a dApp operation. More information [here](https://tezos.gitlab.io/quebec/adaptive_issuance.html#staking-policy-configuration).

# Staking Funds
To stake your funds, you need to call the `stake` operation.
Expand Down Expand Up @@ -133,7 +133,7 @@ const op = await Tezos.wallet.finalizeUnstake().send();
# Additional Info and Some Notes

## Cycle
A cycle is 24576 blocks in Paris protocol (will be 30720 in Quebec), and 10 seconds per block in Paris (will be 8 in Quebec). This means a cycle is about 2.8 days (and will stay the same after Quebec). This might change with the activation of newer protocols.
A cycle is 30720 blocks in Quebec protocol, and 8 seconds per block in Quebec. This means a cycle is about 2.8 days. This might change with the activation of newer protocols.

## Overstaking
A delegate can set the maximum amount of staking they can accept, as a multiply of their own balance. If a delegate's limit is exceeded, the exceeding stake is automatically considered as delegation for the delegate's baking and voting power calculation, but it does remain slashable. That means it's your responsibility to make sure you're not overstaking. Remember that overstaking can even happen after you have staked successfully, because your delegate changes their own balance, or their staking parameter.
Expand Down
3 changes: 2 additions & 1 deletion docs/tzip12.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The constructor of the `Tzip12Module` takes an optional `MetadataProvider` as a

```js
import { TezosToolkit } from '@taquito/taquito';
import { Tzip12Module } from '@taquito/tzip12';
import { Tzip12Module, tzip12 } from '@taquito/tzip12';

const Tezos = new TezosToolkit('rpcUrl');
Tezos.addExtension(new Tzip12Module());
Expand All @@ -38,6 +38,7 @@ Thus, all methods of the `ContractAbstraction`, `Tzip12ContractAbstraction` and

```js
import { compose } from '@taquito/taquito';
import { tzip16 } from "@taquito/tzip16";

const contract = await Tezos.contract.at('contractAddress', compose(tzip16, tzip12));

Expand Down
6 changes: 6 additions & 0 deletions docs/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: Versions
author: Jev Bjorsell
---

# Taquito v21.0.1
## Summary

### Beacon version Update
Updated Beacon version to v4.3.2 #3107

# Taquito v21.0.0
## Summary

Expand Down
4 changes: 2 additions & 2 deletions docs/wallet_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Please check out the section [Subscribing to events](#subscribing-to-events) to

In previous versions of Beacon, you were able to set the `network` property when doing `requestPermissions()`. This behavior was removed from Beacon, and you must now set the network when instantiating the wallet.

You can choose among `mainnet`, `quebecnet`, `parisnet`, `ghostnet` and `custom` to set up the network. Once the permissions have been configured, you can get the user's address by calling the `getPKH` method on the wallet:
You can choose among `mainnet`, `quebecnet`, `ghostnet` and `custom` to set up the network. Once the permissions have been configured, you can get the user's address by calling the `getPKH` method on the wallet:

```js
const userAddress = await wallet.getPKH();
Expand Down Expand Up @@ -175,7 +175,7 @@ const wallet = new TempleWallet('MyAwesomeDapp');
The class constructor takes one parameter, the name of your dapp (this will be used later in the transaction confirmation pop-up). After the instantiation, we can connect the wallet by calling the `connect` method:

```js
await wallet.connect('mainnet' | 'quebecnet' | 'parisnet' | 'ghostnet' | 'mondaynet' | 'sandbox');
await wallet.connect('mainnet' | 'quebecnet' | 'ghostnet' | 'mondaynet' | 'sandbox');
```

(Temple used to be called Thanos and some Taquito code still uses the name Thanos.)
Expand Down
22 changes: 11 additions & 11 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@taquito/example",
"private": true,
"version": "21.0.0",
"version": "21.0.1",
"scripts": {
"example": "node -r ts-node/register --preserve-symlinks example-node.ts",
"example:activation": "node -r ts-node/register --preserve-symlinks example-activate.ts",
Expand Down Expand Up @@ -42,16 +42,16 @@
},
"dependencies": {
"@ledgerhq/hw-transport-node-hid": "^6.29.5",
"@taquito/ledger-signer": "^21.0.0",
"@taquito/local-forging": "^21.0.0",
"@taquito/michel-codec": "^21.0.0",
"@taquito/michelson-encoder": "^21.0.0",
"@taquito/rpc": "^21.0.0",
"@taquito/sapling": "^21.0.0",
"@taquito/signer": "^21.0.0",
"@taquito/taquito": "^21.0.0",
"@taquito/tzip16": "^21.0.0",
"@taquito/utils": "^21.0.0",
"@taquito/ledger-signer": "^21.0.1",
"@taquito/local-forging": "^21.0.1",
"@taquito/michel-codec": "^21.0.1",
"@taquito/michelson-encoder": "^21.0.1",
"@taquito/rpc": "^21.0.1",
"@taquito/sapling": "^21.0.1",
"@taquito/signer": "^21.0.1",
"@taquito/taquito": "^21.0.1",
"@taquito/tzip16": "^21.0.1",
"@taquito/utils": "^21.0.1",
"bignumber.js": "^9.1.2"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions integration-tests/__tests__/contract/estimation-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(376);
expect(estimate.totalCost).toEqual(376);
expect(estimate.usingBaseFeeMutez).toEqual(376);
expect(estimate.consumedMilligas).toEqual(1456142);
expect(estimate.consumedMilligas).toEqual(1456228);
});

it('Verify .estimate.transfer for multiple internal transfers to unallocated account', async () => {
Expand All @@ -119,7 +119,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(447);
expect(estimate.totalCost).toEqual(133947);
expect(estimate.usingBaseFeeMutez).toEqual(447);
expect(estimate.consumedMilligas).toEqual(1570671);
expect(estimate.consumedMilligas).toEqual(1570757);
});

it('Verify .estimate.transfer for internal origination', async () => {
Expand All @@ -132,20 +132,20 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(423);
expect(estimate.totalCost).toEqual(84673);
expect(estimate.usingBaseFeeMutez).toEqual(423);
expect(estimate.consumedMilligas).toEqual(1866766);
expect(estimate.consumedMilligas).toEqual(1866852);
});

it('Verify .estimate.transfer for multiple internal originations', async () => {
const tx = contract.methods.do(originate2()).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(2392);
expect(estimate.gasLimit).toEqual(2393);
expect(estimate.storageLimit).toEqual(654);
expect(estimate.suggestedFeeMutez).toEqual(561);
expect(estimate.burnFeeMutez).toEqual(163500);
expect(estimate.minimalFeeMutez).toEqual(541);
expect(estimate.totalCost).toEqual(164041);
expect(estimate.usingBaseFeeMutez).toEqual(541);
expect(estimate.consumedMilligas).toEqual(2391919);
expect(estimate.consumedMilligas).toEqual(2392005);
// Do the actual operation
const op2 = await contract.methods.do(originate2()).send();
await op2.confirmation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ CONFIGS().forEach(({ setup, rpc, lib }) => {
const Tezos = lib
beforeAll(async () => {
setup(true)
if (rpc.includes('paris')) {
Tezos.setProvider({signer: signerAlice, rpc: 'https://rpc.tzkt.io/parisnet'})
if (rpc.includes('quebec')) {
Tezos.setProvider({signer: signerAlice, rpc: 'https://rpc.tzkt.io/quebecnet'})
} else if (rpc.includes('ghost')) {
Tezos.setProvider({signer: signerAlice, rpc: 'https://rpc.tzkt.io/ghostnet'})
}
Expand Down
Loading

0 comments on commit 6ae6898

Please sign in to comment.