Skip to content

Commit

Permalink
Merge pull request #285 from massalabs/fix/massa-web3-cdn-link
Browse files Browse the repository at this point in the history
Fix cdn massa-web3 link
  • Loading branch information
Ben-Rey authored Feb 16, 2024
2 parents 2b10430 + 92040d3 commit 397ed85
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions docs/build/massa-web3/massa-web3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ If you want to use the library in a vanilla javascript project, please add the f
```html
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/@massalabs/massa-web3@x.x.x/bundle.js"
src="https://cdn.jsdelivr.net/npm/@massalabs/massa-web3@latest/bundle.js"
></script>
```

whereby the x.x.x is one of the available released versions under [Massa-web3's releases page](https://github.com/massalabs/massa-web3/releases):

In your code, once the script is fully loaded, just use window.massa to access all massa-web3 exports.

```ts
<script>console.log("Massa Web3 ", window.massa);</script>
console.log("Massa Web3 ", window.massa);
```

## Initialization
Expand Down Expand Up @@ -118,18 +116,19 @@ You can easily initialize a client instance using the ClientFactory class:
<TabItem value="mainnet-client" label="Mainnet" default>

```typescript
const baseAccount: IAccount = await WalletClient.getAccountFromSecretKey(
privateKey
);
const chainId = CHAIN_ID.MainNet;

const testnetClient: Client = await ClientFactory.createDefaultClient(
DefaultProviderUrls.MAINNET,
chainId,
true, // retry failed requests
baseAccount // optional parameter
);
const baseAccount: IAccount = await WalletClient.getAccountFromSecretKey(
privateKey
);
const chainId = CHAIN_ID.MainNet;

const testnetClient: Client = await ClientFactory.createDefaultClient(
DefaultProviderUrls.MAINNET,
chainId,
true, // retry failed requests
baseAccount // optional parameter
);
```

</TabItem>

<TabItem value="buildnet-client" label="Buildnet" default>
Expand All @@ -147,6 +146,7 @@ const testnetClient: Client = await ClientFactory.createDefaultClient(
baseAccount // optional parameter
);
```

</TabItem>

<TabItem value="labnet-client" label="Labnet" default>
Expand Down

0 comments on commit 397ed85

Please sign in to comment.