Skip to content

Commit

Permalink
Use beacon-types instead of beacon-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymcmackin committed Nov 15, 2023
1 parent 90796b2 commit 35644da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Part 2: Accessing wallets and minting NFTs"
authors: 'Yuxin Li'
last_update:
date: 20 October 2023
date: 15 November 2023
---

Accessing the user's wallet is essential before your application can engage with the Tezos blockchain. It enables your app to view the tokens within the wallet and request the user to initiate transactions. However, it's important to note that accessing the wallet doesn't grant your app direct control over it.
Expand Down Expand Up @@ -30,7 +30,9 @@ Creating multiple instances can cause problems in your app and with Taquito in g
try {
const newWallet = new BeaconWallet({
name: "Simple NFT app tutorial",
preferredNetwork: network,
network: {
type: NetworkType.GHOSTNET,
},
});
await newWallet.requestPermissions();
address = await newWallet.getPKH();
Expand Down
13 changes: 6 additions & 7 deletions docs/tutorials/create-an-nft/nft-web-app/setting-up-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Part 1: Setting up the application"
authors: 'Yuxin Li'
last_update:
date: 19 October 2023
date: 15 November 2023
---

You can access Tezos through any JavaScript framework.
Expand All @@ -22,7 +22,7 @@ If you are familiar with Svelte, note that this application includes its own Sve
1. Install the Tezos-related dependencies:

```bash
npm install @taquito/taquito @taquito/beacon-wallet @airgap/beacon-sdk
npm install @taquito/taquito @taquito/beacon-wallet @airgap/beacon-types
```

1. Install the `buffer`, `events`, and `vite-compatible-readable-stream` libraries:
Expand Down Expand Up @@ -57,9 +57,9 @@ If you are familiar with Svelte, note that this application includes its own Sve
},
resolve: {
alias: {
"@airgap/beacon-sdk": path.resolve(
"@airgap/beacon-types": path.resolve(
path.resolve(),
`./node_modules/@airgap/beacon-sdk/dist/${
`./node_modules/@airgap/beacon-types/dist/${
isBuild ? "esm" : "cjs"
}/index.js`
),
Expand Down Expand Up @@ -206,7 +206,7 @@ Follow these steps to set up the `src/App.svelte` file, which is the container f
```html
<script lang="ts">
import { BeaconWallet } from "@taquito/beacon-wallet";
import { NetworkType } from "@airgap/beacon-sdk";
import { NetworkType } from "@airgap/beacon-types";
import { TezosToolkit, MichelsonMap} from "@taquito/taquito";
</script>
```
Expand All @@ -218,12 +218,11 @@ Follow these steps to set up the `src/App.svelte` file, which is the container f
- `NetworkType`: The class represents the different types of networks on the Tezos blockchain. Developers can ensure that their applications communicate with the desired network version or testnet such as Ghostnet.
- `MichelsonMap`: The class helps developers work with Michelson's native map data type.

1. In the `<script lang="ts">` section, add the following code to initialize the Tezos toolkit, set your RPC URL to the Ghostnet endpoint, and define the network type:
1. In the `<script lang="ts">` section, add the following code to initialize the Tezos toolkit and set your RPC URL to the Ghostnet endpoint:

```javascript
const rpcUrl = "https://ghostnet.ecadinfra.com";
const Tezos = new TezosToolkit(rpcUrl);
const network = NetworkType.GHOSTNET;
```

This code creates an instance of the `TezosToolkit` object, which provides access to the Tezos chain itself.
Expand Down

0 comments on commit 35644da

Please sign in to comment.