-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
52 additions
and
54 deletions.
There are no files selected for viewing
52 changes: 0 additions & 52 deletions
52
apps/docs-snippets/src/guide/introduction/getting-started.test.ts
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
apps/docs-snippets2/src/introduction/connecting-to-localnode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { main } from './connecting-to-testnet.wrapped'; | ||
|
||
/** | ||
* @group node | ||
* @group browser | ||
*/ | ||
test('it works', async () => { | ||
const { balances } = await main(); | ||
expect(balances).toBeTruthy(); | ||
expect(balances).toBeInstanceOf(Array); | ||
}); |
14 changes: 14 additions & 0 deletions
14
apps/docs-snippets2/src/introduction/connecting-to-localnode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// #region main | ||
import { Provider, Wallet, LOCAL_NETWORK_URL } from 'fuels'; | ||
|
||
const ADDRESS = '0x767caf5b08eba21c561078a4d5be09bbd7f16b9eca22699a61f1edd9e456126f'; | ||
|
||
// Create a provider using the `LOCAL_NETWORK_URL` constant | ||
const provider = await Provider.create(LOCAL_NETWORK_URL); | ||
|
||
// Then use it when creating a wallet | ||
const wallet = Wallet.fromAddress(ADDRESS, provider); | ||
const balances = await wallet.getBalances(); | ||
|
||
console.log({ balances }); | ||
// #endregion main |
11 changes: 11 additions & 0 deletions
11
apps/docs-snippets2/src/introduction/connecting-to-testnet.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { main } from './connecting-to-testnet.wrapped'; | ||
|
||
/** | ||
* @group node | ||
* @group browser | ||
*/ | ||
test('it works', async () => { | ||
const { balances } = await main(); | ||
expect(balances).toBeTruthy(); | ||
expect(balances).toBeInstanceOf(Array); | ||
}); |
14 changes: 14 additions & 0 deletions
14
apps/docs-snippets2/src/introduction/connecting-to-testnet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// #region main | ||
import { Provider, Wallet, TESTNET_NETWORK_URL } from 'fuels'; | ||
|
||
const ADDRESS = '0x767caf5b08eba21c561078a4d5be09bbd7f16b9eca22699a61f1edd9e456126f'; | ||
|
||
// Create a provider using the `TESTNET_NETWORK_URL` constant | ||
const provider = await Provider.create(TESTNET_NETWORK_URL); | ||
|
||
// Then use it when creating a wallet | ||
const wallet = Wallet.fromAddress(ADDRESS, provider); | ||
const balances = await wallet.getBalances(); | ||
|
||
console.log({ balances }); | ||
// #endregion main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters