Skip to content
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
33 changes: 14 additions & 19 deletions source/mainnet/docs/plt/examples/rust-sdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Before using this example, make sure your Cargo.toml includes:
.. code-block:: toml

# Concordium dependencies
concordium-rust-sdk = "=7.0.0"
concordium_base = "=8.0.0"
concordium-rust-sdk = "=8.0.0"
concordium_base = "=9.0.0"


Available examples
Expand Down Expand Up @@ -114,7 +114,6 @@ Optionally specify a block hash for historical token lists.
Ok(())
}


.. _rust-get-token-info:

Get token information
Expand Down Expand Up @@ -202,7 +201,7 @@ Set the account address to query and optionally specify a block hash for histori
use std::str::FromStr;

// CONFIGURATION - Modify these values for your use case
const ACCOUNT_ADDRESS: &str = "ACCOUNT_ADDRESS"; // Replace with the actual account address you want to query
const ACCOUNT_ADDRESS: &str = "TARGET_ADDRESS"; // Replace with the actual account address you want to query
const BLOCK_HASH: Option<&str> = None; // Set to Some("blockhash") for specific block, None for latest

#[tokio::main]
Expand Down Expand Up @@ -294,14 +293,13 @@ Configure the recipient address and amount to complete the transfer.
use std::{path::PathBuf, str::FromStr}; // Added PathBuf import

// CONFIGURATION - Modify these values for your use case
const WALLET_FILE: &str = "wallet.export";
const WALLET_FILE: &str = "keys/wallet.export";
const TOKEN_ID: &str = "TOKEN_ID"; // Replace with the actual token ID you want to transfer
const RECIPIENT_ADDRESS: &str = "RECIPIENT_ADDRESS"; // Replace with the actual recipient address
const TOKEN_AMOUNT: &str = "12"; // Amount to transfer as decimal string
const TOKEN_AMOUNT: &str = "1"; // Amount to transfer as decimal string

#[tokio::main]
async fn main() -> anyhow::Result<()> {
println!("Connecting to Concordium testnet...");
let mut client = v2::Client::new(v2::Endpoint::from_str(
"https://grpc.testnet.concordium.com:20000",
)?)
Expand Down Expand Up @@ -372,7 +370,6 @@ Configure the recipient address and amount to complete the transfer.
Ok(())
}


.. _rust-mint-tokens:

Mint tokens
Expand Down Expand Up @@ -408,7 +405,7 @@ Only the token issuer can perform mint operations, adding new tokens to circulat
use std::{path::PathBuf, str::FromStr};

// CONFIGURATION - Modify these values for your use case
const WALLET_FILE: &str = "wallet.export";
const WALLET_FILE: &str = "keys/wallet.export";
const TOKEN_ID: &str = "TOKEN_ID"; // Replace with your token ID
const TOKEN_AMOUNT: &str = "10"; // Amount to mint as decimal string

Expand Down Expand Up @@ -501,7 +498,7 @@ Only the token issuer can perform burn operations, removing tokens from circulat
use std::{path::PathBuf, str::FromStr};

// CONFIGURATION - Modify these values for your use case
const WALLET_FILE: &str = "wallet.export";
const WALLET_FILE: &str = "keys/wallet.export";
const TOKEN_ID: &str = "TOKEN_ID"; // Replace with your token ID
const TOKEN_AMOUNT: &str = "10"; // Amount to burn as decimal string

Expand Down Expand Up @@ -558,7 +555,6 @@ Only the token issuer can perform burn operations, removing tokens from circulat
Ok(())
}


Token governance operations
===========================

Expand Down Expand Up @@ -598,7 +594,7 @@ Only the token issuer can modify the allow list.
use std::{path::PathBuf, str::FromStr};

// CONFIGURATION - Modify these values for your use case
const WALLET_FILE: &str = "wallet.export";
const WALLET_FILE: &str = "keys/wallet.export";
const TOKEN_ID: &str = "TOKEN_ID"; // Replace with the actual token ID
const TARGET_ADDRESS: &str = "TARGET_ADDRESS"; // Replace with the actual target address

Expand Down Expand Up @@ -685,7 +681,7 @@ Only the token issuer can modify the allow list.
use std::{path::PathBuf, str::FromStr};

// CONFIGURATION - Modify these values for your use case
const WALLET_FILE: &str = "wallet.export";
const WALLET_FILE: &str = "keys/wallet.export";
const TOKEN_ID: &str = "TOKEN_ID"; // Replace with the actual token ID
const TARGET_ADDRESS: &str = "TARGET_ADDRESS"; // Replace with the actual target address

Expand Down Expand Up @@ -736,7 +732,6 @@ Only the token issuer can modify the allow list.
Ok(())
}


.. _rust-add-to-deny-list:

Add account to deny list
Expand Down Expand Up @@ -860,7 +855,7 @@ Only the token issuer can modify the deny list.
use std::{path::PathBuf, str::FromStr};

// CONFIGURATION - Modify these values for your use case
const WALLET_FILE: &str = "wallet.export";
const WALLET_FILE: &str = "keys/wallet.export";
const TOKEN_ID: &str = "TOKEN_ID"; // Replace with the actual token ID
const TARGET_ADDRESS: &str = "TARGET_ADDRESS"; // Replace with the actual target address

Expand Down Expand Up @@ -942,8 +937,8 @@ This example demonstrates how to suspend balance transfer operations for a Proto
use std::{path::PathBuf, str::FromStr};

// CONFIGURATION - Modify these values for your use case
const WALLET_FILE: &str = "wallet.export";
const TOKEN_ID: &str = "TOKEN_SYMBOL"; // Replace with the actual token ID
const WALLET_FILE: &str = "keys/wallet.export";
const TOKEN_ID: &str = "TOKEN_ID"; // Replace with the actual token ID

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand Down Expand Up @@ -1019,8 +1014,8 @@ This example demonstrates how to resume balance transfer operations for a Protoc
use std::{path::PathBuf, str::FromStr};

// CONFIGURATION - Modify these values for your use case
const WALLET_FILE: &str = "wallet.export";
const TOKEN_ID: &str = "TOKEN_SYMBOL"; // Replace with the actual token ID
const WALLET_FILE: &str = "keys/wallet.export";
const TOKEN_ID: &str = "TOKEN_ID"; // Replace with the actual token ID

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand Down
Loading