Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mk 566 update taquito website live code examples to edonet #687

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ jobs:
- run: npm ci
- run: npm run lerna -- bootstrap
- run: npm run build
- run: cd integration-tests && npm run test:edonet -- --maxWorkers=${{ secrets.NPM_JEST_MAX_WORKERS }}
- run: cd integration-tests && npm run test:edonet -- --maxWorkers=8
env:
CI: true
TEZOS_RPC_EDONET: ${{ secrets.TEZOS_RPC_EDONET }}
TEZOS_RPC_FLORENCENET: ${{ secrets.TEZOS_RPC_FLORENCENET }}
2 changes: 1 addition & 1 deletion docs/batch-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Taquito provides a simple way of forging and sending transactions to the blockch

```js
/*
* ONE OF THESE TRANSACTIONS WILL FAIL
* ONE OF THESE TRANSACTIONS WILL FAIL
* AND YOU WILL GET AN ERROR MESSAGE
*/
const op1 = await contract.methods.interact('tezos').send();
Expand Down
18 changes: 9 additions & 9 deletions docs/complex_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ An annotation identifies every argument. Therefore we can ignore optional values
```js live noInline
// import { TezosToolkit, MichelsonMap } from '@taquito/taquito';
// import { importKey } from '@taquito/signer';
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

//%data
const dataMap = new MichelsonMap();
Expand Down Expand Up @@ -131,12 +131,12 @@ The way to write the parameter when calling the function of a contract with Taqu

```js live noInline
// import { TezosToolkit, MichelsonMap } from '@taquito/taquito';
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet')
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet')
// import { importKey } from '@taquito/signer';

importKey(Tezos, emailExample, passwordExample, mnemonicExample, secretExample)
.then(signer => {
return Tezos.contract.at('KT1Guzg4pWj5BEyc8qtoicNsuPCYfjRbYLZc')
return Tezos.contract.at('KT1AS2FUKNHChjQTeVWep2KnHZoThbUKubi4')
}).then(myContract => {
const dataMap = new MichelsonMap();
dataMap.set("Hello World", { bool : true })
Expand All @@ -149,12 +149,12 @@ importKey(Tezos, emailExample, passwordExample, mnemonicExample, secretExample)

```js live noInline
// import { TezosToolkit, MichelsonMap } from '@taquito/taquito';
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet')
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet')
// import { importKey } from '@taquito/signer';

importKey(Tezos, emailExample, passwordExample, mnemonicExample, secretExample)
.then(signer => {
return Tezos.contract.at('KT1Guzg4pWj5BEyc8qtoicNsuPCYfjRbYLZc')
return Tezos.contract.at('KT1AS2FUKNHChjQTeVWep2KnHZoThbUKubi4')
}).then(myContract => {
const dataMap = new MichelsonMap();
dataMap.set("Hello World", { bool : true })
Expand All @@ -171,7 +171,7 @@ importKey(Tezos, emailExample, passwordExample, mnemonicExample, secretExample)
println(`Waiting for ${op.hash} to be confirmed...`);
return op.confirmation(1).then(() => op.hash);
}).then(hash => {
println(`Operation injected: https://better-call.dev/delphinet/KT1Guzg4pWj5BEyc8qtoicNsuPCYfjRbYLZc/operations`);
println(`Operation injected: https://better-call.dev/edo2net/KT1AS2FUKNHChjQTeVWep2KnHZoThbUKubi4/operations`);
}).catch(error => println(`Error: ${JSON.stringify(error, null, 2)}`));
```
#### Call the set_child_record function when optional arguments are null
Expand All @@ -180,12 +180,12 @@ The `address %address` and the `nat %ttl` of the `set_child_record` function are

```js live noInline
// import { TezosToolkit, MichelsonMap } from '@taquito/taquito';
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet')
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet')
// import { importKey } from '@taquito/signer';

importKey(Tezos, emailExample, passwordExample, mnemonicExample, secretExample)
.then(signer => {
return Tezos.contract.at('KT1Guzg4pWj5BEyc8qtoicNsuPCYfjRbYLZc')
return Tezos.contract.at('KT1AS2FUKNHChjQTeVWep2KnHZoThbUKubi4')
}).then(myContract => {
const dataMap = new MichelsonMap();
dataMap.set("Hello World", { nat : '3' })
Expand All @@ -202,6 +202,6 @@ importKey(Tezos, emailExample, passwordExample, mnemonicExample, secretExample)
println(`Waiting for ${op.hash} to be confirmed...`);
return op.confirmation(1).then(() => op.hash);
}).then(hash => {
println(`Operation injected: https://better-call.dev/delphinet/KT1Guzg4pWj5BEyc8qtoicNsuPCYfjRbYLZc/operations`);
println(`Operation injected: https://better-call.dev/edo2net/KT1AS2FUKNHChjQTeVWep2KnHZoThbUKubi4/operations`);
}).catch(error => println(`Error: ${JSON.stringify(error, null, 2)}`));
```
4 changes: 2 additions & 2 deletions docs/drain_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In the following example, we have not revealed the account that we want to empty
:::

```js live noInline
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

Tezos.signer
.publicKeyHash()
Expand Down Expand Up @@ -83,7 +83,7 @@ The contract we originate is a `manager contract.` It has a `do` method taking a
In the example, we estimate the transfer operation before doing it. The associated fees are deducted from the manager's address when draining the account. Thus, for the operation to be successful, the manager's address for that account must contain funds to cover the gas.

```js live noInline
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

function transferImplicit(key, mutez) {
return [
Expand Down
8 changes: 4 additions & 4 deletions docs/estimate.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following example shows an estimate of the fees associated with transferring

```js live noInline
// import { TezosToolkit } from '@taquito/taquito';
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

const amount = 2;
const address = 'tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY';
Expand All @@ -53,10 +53,10 @@ This example will demonstrate how to estimate the fees related to calling a smar

```js live noInline
// import { TezosToolkit } from '@taquito/taquito';
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

Tezos.contract
.at('KT1PupyraehzPEjTKJgY2qmZHXdP5pQUyGgC')
.at('KT1MZR1g3jZCU6itoyEZ7u91hyJMG2efgmwu')
.then((contract) => {
const i = 7;

Expand Down Expand Up @@ -84,7 +84,7 @@ In this example, we will use the estimate method of Taquito on a contract origin

```js live noInline
// import { TezosToolkit } from '@taquito/taquito';
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

println(`Estimating the contract origination : `);
Tezos.estimate
Expand Down
12 changes: 6 additions & 6 deletions docs/inmemory_signer.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The `fromSecretKey` method takes a secret that is base58 encoded as a parameter.
```js live noInline
// import { TezosToolkit } from '@taquito/taquito'
// import { InMemorySigner } from '@taquito/signer'
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

InMemorySigner.fromSecretKey('edsk2rKA8YEExg9Zo2qNPiQnnYheF1DhqjLVmfKdxiFfu5GyGRZRnb')
.then((theSigner) => {
Expand All @@ -57,7 +57,7 @@ InMemorySigner.fromSecretKey('edsk2rKA8YEExg9Zo2qNPiQnnYheF1DhqjLVmfKdxiFfu5GyGR
```js live noInline
// import { TezosToolkit } from '@taquito/taquito'
// import { InMemorySigner } from '@taquito/signer'
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

InMemorySigner.fromSecretKey('spsk2Fiz7sGP5fNMJrokp6ynTa4bcFbsRhw58FHXbNf5ProDNFJ5Xq')
.then((theSigner) => {
Expand All @@ -77,7 +77,7 @@ When required, Taquito offers the `b58cencode` function allowing to encode the s
// import { b58cencode, prefix, Prefix } from '@taquito/utils';
// import { TezosToolkit } from '@taquito/taquito'
// import { InMemorySigner } from '@taquito/signer'
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

const b58encodedSecret = b58cencode(
'7c842c15c8b0c8fd228e6cb5302a50201f41642dd36b699003fb3c857920bc9d',
Expand Down Expand Up @@ -118,7 +118,7 @@ Here are three examples with encrypted private keys where the passphrase used is
```js live noInline
// import { TezosToolkit } from '@taquito/taquito'
// import { InMemorySigner } from '@taquito/signer'
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

InMemorySigner.fromSecretKey(
'edesk1GXwWmGjXiLHBKxGBxwmNvG21vKBh6FBxc4CyJ8adQQE2avP5vBB57ZUZ93Anm7i4k8RmsHaPzVAvpnHkFF',
Expand All @@ -138,7 +138,7 @@ InMemorySigner.fromSecretKey(
```js live noInline
// import { TezosToolkit } from '@taquito/taquito'
// import { InMemorySigner } from '@taquito/signer'
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

InMemorySigner.fromSecretKey(
'spesk24UQkAiJk8X6AufNtRv1WWPp2BAssEgmijCTQPMgUXweSKPmLdbyAjPmCG1pR2dC9P5UZZVeZcb7zVodUHZ',
Expand All @@ -158,7 +158,7 @@ InMemorySigner.fromSecretKey(
```js live noInline
// import { TezosToolkit } from '@taquito/taquito'
// import { InMemorySigner } from '@taquito/signer'
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

InMemorySigner.fromSecretKey(
'p2esk28hoUE2J88QNFj2aDX2pjzL7wcVh2g8tkEwtWWguby9M3FHUgSbzvF2Sd7wQ4Kd8crFwvto6gF3otcBuo4T',
Expand Down
12 changes: 6 additions & 6 deletions docs/lambda_view.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Then we call the `read()` method, which takes an optional lambda contract addres

```js live noInline
Tezos.contract
.at('KT1Bki1YP1JdykrMH4iTTt7bguHsbeuUAbpG')
.at('KT1PXAEiDAMhFGdAao6Jp8tixcMkMbecx2ay')
.then((contract) => {
return contract.views.getTotalSupply([['Unit']]).read();
})
Expand All @@ -87,7 +87,7 @@ Tezos.contract

```js live noInline
Tezos.contract
.at('KT1Bki1YP1JdykrMH4iTTt7bguHsbeuUAbpG')
.at('KT1PXAEiDAMhFGdAao6Jp8tixcMkMbecx2ay')
.then((contract) => {
return contract.views.getBalance('tz1c1X8vD4pKV9TgV1cyosR7qdnkc8FTEyM1').read();
})
Expand All @@ -112,14 +112,14 @@ const lambdaContractAddress = lambdaContract.address;
```

:::note
Taquito internally contains a list of lambda contracts. Thus, no need to deploy a lambda contract if you are using Mainnet, Delphinet, or Carthagenet. Taquito will detect the current network and use the appropriate lambda contract.
Taquito internally contains a list of lambda contracts. Thus, no need to deploy a lambda contract if you are using Mainnet, Edonet, Delphinet, or Carthagenet. Taquito will detect the current network and use the appropriate lambda contract.
:::

**More examples:**

```js live noInline
Tezos.contract
.at('KT1MB4fe2b9euiMk1W4evxnfQHbq8FB5Yrbe')
.at('KT191SkRuPDBFpxYRczEB2N1DVXk8ETrHUd5')
.then((contract) => {
return contract.views
.balance_of([{ owner: 'tz1c1X8vD4pKV9TgV1cyosR7qdnkc8FTEyM1', token_id: '0' }])
Expand All @@ -133,9 +133,9 @@ Tezos.contract

```js live noInline
Tezos.contract
.at('KT1MeKubyqYXaXqEdjZmaxJffeMz5oAvnRrV')
.at('KT1KoCq7qbmo8nFmiXxaDYZtmXxnquBGnGzH')
.then((contract) => {
return contract.views.getBalance('tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY').read();
return contract.views.getBalance('tz1XTyqBn4xi9tkRDutpRyQwHxfF8ar4i4Wq').read();
})
.then((response) => {
println(JSON.stringify(response, null, 2));
Expand Down
2 changes: 1 addition & 1 deletion docs/ledger_signer.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ _Note that this example is not intended to be a complete example of paths scanni
//import { LedgerSigner, DerivationType, HDPathTemplate } from '@taquito/ledger-signer';
//import { TezosToolkit } from '@taquito/taquito';
//import TransportU2F from "@ledgerhq/hw-transport-u2f";
//const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
//const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

TransportU2F.create().then((transport) => {
for (let index = 0, p = Promise.resolve(); index < 10; index++) {
Expand Down
10 changes: 5 additions & 5 deletions docs/making_transfers.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ In the following example, we transfer 0.5ꜩ from a `tz1aaYoabvj2DQtpHz74Z83fSNj

```js live noInline
// import { TezosToolkit } from '@taquito/taquito';
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/delphinet');
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/edonet');

render(`Fetching a private key...`);
fetch('https://api.tez.ie/keys/delphinet/', {
fetch('https://api.tez.ie/keys/edonet/', {
method: 'POST',
headers: { Authorization: 'Bearer taquito-example' },
})
Expand All @@ -46,7 +46,7 @@ fetch('https://api.tez.ie/keys/delphinet/', {
render(`Waiting for ${op.hash} to be confirmed...`);
return op.confirmation(1).then(() => op.hash);
})
.then((hash) => render(`Operation injected: https://delphi.tzstats.com/${hash}`))
.then((hash) => render(`Operation injected: https://edonet.tzstats.com/${hash}`))
.catch((error) => render(`Error: ${JSON.stringify(error, null, 2)}`));
```

Expand Down Expand Up @@ -98,14 +98,14 @@ export const transferImplicit = (key: string, mutez: number) => {

## Transfer 0.000001 (1 mutez) tokens from a KT1 address to a KT1 address

Sending 1 mutez to `KT1EKZshRTnJQoA6ojbRisiiGwSB5kKNmZSt` from `KT1...`
Sending 1 mutez to `KT1KLbEeEgW5h1QLkPuPvqdgurHx6v4hGyic` from `KT1...`

### Example for Babylon/Proto005 or higher

```js
const contract = await Tezos.contract.at('KT1...');
await contract.methods
.do(transferToContract('KT1EKZshRTnJQoA6ojbRisiiGwSB5kKNmZSt', 1))
.do(transferToContract('KT1KLbEeEgW5h1QLkPuPvqdgurHx6v4hGyic', 1))
.send({ amount: 0 });
```

Expand Down
8 changes: 4 additions & 4 deletions docs/maps_bigmaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ The example calls the Contracts `main` function of the contract using the key `1

```js live noInline
Tezos.contract
.at('KT1HLBq2HJJQ4uhPnSEDgQsiKaQzNzqF1xXH')
.at('KT1DVGnhDBCQuVC61Q38gmDZspnTzX2xvfG3')
.then((myContract) => {
return myContract
.storage()
Expand Down Expand Up @@ -201,7 +201,7 @@ Recall that this contract does not annotate the pairs of the key pair either. We

```js live noInline
Tezos.contract
.at('KT1BUL5zDMSYdPxuYVV2qJasuzKtXgBNzpXd')
.at('KT1DJCtBhx579koVCXW5dgqjX1p9UyyJwAYE')
.then((myContract) => {
return myContract.storage();
})
Expand Down Expand Up @@ -293,7 +293,7 @@ The `get` method of the `MichelsonMap` class accesses values of the map for a sp

```js live noInline
Tezos.contract
.at('KT1M95NdJa5B3zNT2eQhk31gzYzPJzbSV4ya')
.at('KT1EtGEMF1uVqPHmsC2iR2wVXf41JGRuzJCC')
.then((myContract) => {
return myContract.storage();
})
Expand Down Expand Up @@ -387,7 +387,7 @@ The `get` method of the `MichelsonMap` class accesses the values of the map and

```js live noInline
Tezos.contract
.at('KT1MyhAuf2V7HZSa9MaAKF1JKtnYG9ArQihW')
.at('KT1HBAKtTECxgK1SEy2UqgZxKGL1hiGxJywZ')
.then((myContract) => {
return myContract
.storage()
Expand Down
Loading