From d6d0e1e07b3f184e9a196b29a8c4b49b28afeead Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Wed, 15 Nov 2023 10:06:48 -0500 Subject: [PATCH] Incorporate update from https://github.com/trilitech/tezos-developer-docs/pull/167 --- docs/dApps/taquito.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/dApps/taquito.md b/docs/dApps/taquito.md index 51a1ce4fe..bf5d17cee 100644 --- a/docs/dApps/taquito.md +++ b/docs/dApps/taquito.md @@ -60,30 +60,26 @@ const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com') ### Wallet setup -First, download the `@taquito/beacon-wallet` package from NPM: +First, download the `@taquito/beacon-wallet` and `@airgap/beacon-types` packages from NPM: ``` -npm install @taquito/beacon-wallet +npm install @taquito/beacon-wallet @airgap/beacon-types ``` Next, import the `BeaconWallet` class and create a new instance by passing an object with the different options required by the Beacon SDK. After creating the instance of the wallet, you can request permission from the user to connect their wallet before passing the wallet instance to the wallet provider in the TezosToolkit provided by Taquito: ```typescript -import { TezosToolkit } from '@taquito/taquito' -import { BeaconWallet, NetworkType } from '@taquito/beacon-wallet' +import { BeaconWallet } from "@taquito/beacon-wallet"; +import { NetworkType } from "@airgap/beacon-types"; +import { TezosToolkit } from "@taquito/taquito"; const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com') const options = { name: 'MyAwesomeDapp', iconUrl: 'https://tezostaquito.io/img/favicon.svg', - preferredNetwork: 'ghostnet', - eventHandlers: { - PERMISSION_REQUEST_SUCCESS: { - handler: async (data) => { - console.log('permission data:', data) - }, - }, + network: { + type: NetworkType.GHOSTNET, }, } const wallet = new BeaconWallet(options)