Skip to content

Commit

Permalink
Incorporate update from #167
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymcmackin committed Nov 15, 2023
1 parent 4158a4b commit d6d0e1e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions docs/dApps/taquito.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d6d0e1e

Please sign in to comment.