chore(code-samples): remove all emojis

This commit is contained in:
banasa44
2025-08-25 11:27:50 +02:00
committed by akcodez
parent b94d5343bc
commit 1f3e1ee670
40 changed files with 1125 additions and 1123 deletions

View File

@@ -1,14 +1,14 @@
package main
import (
"fmt"
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
const (
@@ -32,41 +32,41 @@ func main() {
//
// Configure wallets
//
fmt.Println("Setting up wallets...")
fmt.Println("Setting up wallets...")
coldWallet, err := wallet.New(crypto.ED25519())
if err != nil {
fmt.Printf("Error creating cold wallet: %s\n", err)
fmt.Printf("Error creating cold wallet: %s\n", err)
return
}
err = client.FundWallet(&coldWallet)
if err != nil {
fmt.Printf("Error funding cold wallet: %s\n", err)
fmt.Printf("Error funding cold wallet: %s\n", err)
return
}
fmt.Println("💸 Cold wallet funded!")
fmt.Println("Cold wallet funded!")
hotWallet, err := wallet.New(crypto.ED25519())
if err != nil {
fmt.Printf("Error creating hot wallet: %s\n", err)
fmt.Printf("Error creating hot wallet: %s\n", err)
return
}
err = client.FundWallet(&hotWallet)
if err != nil {
fmt.Printf("Error funding hot wallet: %s\n", err)
fmt.Printf("Error funding hot wallet: %s\n", err)
return
}
fmt.Println("💸 Hot wallet funded!")
fmt.Println("Hot wallet funded!")
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println("💳 Cold wallet:", coldWallet.ClassicAddress)
fmt.Println("💳 Hot wallet:", hotWallet.ClassicAddress)
fmt.Println("Wallets setup complete!")
fmt.Println("Cold wallet:", coldWallet.ClassicAddress)
fmt.Println("Hot wallet:", hotWallet.ClassicAddress)
fmt.Println()
//
// Configure cold address settings
//
fmt.Println("Configuring cold address settings...")
fmt.Println("Configuring cold address settings...")
coldWalletAccountSet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
@@ -85,37 +85,37 @@ func main() {
err = client.Autofill(&flattenedTx)
if err != nil {
fmt.Printf("Error autofilling transaction: %s\n", err)
fmt.Printf("Error autofilling transaction: %s\n", err)
return
}
txBlob, _, err := coldWallet.Sign(flattenedTx)
if err != nil {
fmt.Printf("Error signing transaction: %s\n", err)
fmt.Printf("Error signing transaction: %s\n", err)
return
}
response, err := client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
fmt.Printf("Error submitting transaction: %s\n", err)
fmt.Printf("Error submitting transaction: %s\n", err)
return
}
if !response.Validated {
fmt.Println("Cold wallet unfreezing failed!")
fmt.Println("Cold wallet unfreezing failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Cold address settings configured!")
fmt.Printf("🌐 Hash: %s\n", response.Hash.String())
fmt.Println("Cold address settings configured!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Create trust line from hot to cold address
//
fmt.Println("Creating trust line from hot to cold address...")
fmt.Println("Creating trust line from hot to cold address...")
hotColdTrustSet := &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(hotWallet.ClassicAddress),
@@ -130,37 +130,37 @@ func main() {
flattenedTx = hotColdTrustSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
fmt.Printf("Error autofilling transaction: %s\n", err)
fmt.Printf("Error autofilling transaction: %s\n", err)
return
}
txBlob, _, err = hotWallet.Sign(flattenedTx)
if err != nil {
fmt.Printf("Error signing transaction: %s\n", err)
fmt.Printf("Error signing transaction: %s\n", err)
return
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
fmt.Printf("Error submitting transaction: %s\n", err)
fmt.Printf("Error submitting transaction: %s\n", err)
return
}
if !response.Validated {
fmt.Println("Trust line from hot to cold address creation failed!")
fmt.Println("Trust line from hot to cold address creation failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Trust line from hot to cold address created!")
fmt.Printf("🌐 Hash: %s\n", response.Hash.String())
fmt.Println("Trust line from hot to cold address created!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Send tokens from cold wallet to hot wallet
//
fmt.Println("Sending tokens from cold wallet to hot wallet...")
fmt.Println("Sending tokens from cold wallet to hot wallet...")
coldToHotPayment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
@@ -177,37 +177,37 @@ func main() {
flattenedTx = coldToHotPayment.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
fmt.Printf("Error autofilling transaction: %s\n", err)
fmt.Printf("Error autofilling transaction: %s\n", err)
return
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
fmt.Printf("Error signing transaction: %s\n", err)
fmt.Printf("Error signing transaction: %s\n", err)
return
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
fmt.Printf("Error submitting transaction: %s\n", err)
fmt.Printf("Error submitting transaction: %s\n", err)
return
}
if !response.Validated {
fmt.Println("Tokens not sent from cold wallet to hot wallet!")
fmt.Println("Tokens not sent from cold wallet to hot wallet!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Tokens sent from cold wallet to hot wallet!")
fmt.Printf("🌐 Hash: %s\n", response.Hash.String())
fmt.Println("Tokens sent from cold wallet to hot wallet!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Claw back tokens from customer one
//
fmt.Println("Clawing back tokens from hot wallet...")
fmt.Println("Clawing back tokens from hot wallet...")
coldWalletClawback := &transactions.Clawback{
BaseTx: transactions.BaseTx{
@@ -223,29 +223,29 @@ func main() {
flattenedTx = coldWalletClawback.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
fmt.Printf("Error autofilling transaction: %s\n", err)
fmt.Printf("Error autofilling transaction: %s\n", err)
return
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
fmt.Printf("Error signing transaction: %s\n", err)
fmt.Printf("Error signing transaction: %s\n", err)
return
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
fmt.Printf("Error submitting transaction: %s\n", err)
fmt.Printf("Error submitting transaction: %s\n", err)
return
}
if !response.Validated {
fmt.Println("Tokens not clawed back from customer one!")
fmt.Println("Tokens not clawed back from customer one!")
fmt.Println("Try again!")
return
}
fmt.Println("Tokens clawed back from customer one!")
fmt.Printf("🌐 Hash: %s\n", response.Hash.String())
fmt.Println("Tokens clawed back from customer one!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
}

View File

@@ -1,14 +1,14 @@
package main
import (
"fmt"
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
)
const (
@@ -19,13 +19,13 @@ func main() {
//
// Configure client
//
fmt.Println("Setting up client...")
fmt.Println("Setting up client...")
client := websocket.NewClient(
websocket.NewClientConfig().
WithHost("wss://s.altnet.rippletest.net").
WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
fmt.Println("Client configured!")
fmt.Println("Client configured!")
fmt.Println()
fmt.Println("Connecting to server...")
@@ -39,41 +39,41 @@ func main() {
//
// Configure wallets
//
fmt.Println("Setting up wallets...")
fmt.Println("Setting up wallets...")
coldWallet, err := wallet.New(crypto.ED25519())
if err != nil {
fmt.Printf("Error creating cold wallet: %s\n", err)
fmt.Printf("Error creating cold wallet: %s\n", err)
return
}
err = client.FundWallet(&coldWallet)
if err != nil {
fmt.Printf("Error funding cold wallet: %s\n", err)
fmt.Printf("Error funding cold wallet: %s\n", err)
return
}
fmt.Println("💸 Cold wallet funded!")
fmt.Println("Cold wallet funded!")
hotWallet, err := wallet.New(crypto.ED25519())
if err != nil {
fmt.Printf("Error creating hot wallet: %s\n", err)
fmt.Printf("Error creating hot wallet: %s\n", err)
return
}
err = client.FundWallet(&hotWallet)
if err != nil {
fmt.Printf("Error funding hot wallet: %s\n", err)
fmt.Printf("Error funding hot wallet: %s\n", err)
return
}
fmt.Println("💸 Hot wallet funded!")
fmt.Println("Hot wallet funded!")
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println("💳 Cold wallet:", coldWallet.ClassicAddress)
fmt.Println("💳 Hot wallet:", hotWallet.ClassicAddress)
fmt.Println("Wallets setup complete!")
fmt.Println("Cold wallet:", coldWallet.ClassicAddress)
fmt.Println("Hot wallet:", hotWallet.ClassicAddress)
fmt.Println()
//
// Configure cold address settings
//
fmt.Println("Configuring cold address settings...")
fmt.Println("Configuring cold address settings...")
coldWalletAccountSet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
@@ -92,37 +92,37 @@ func main() {
err = client.Autofill(&flattenedTx)
if err != nil {
fmt.Printf("Error autofilling transaction: %s\n", err)
fmt.Printf("Error autofilling transaction: %s\n", err)
return
}
txBlob, _, err := coldWallet.Sign(flattenedTx)
if err != nil {
fmt.Printf("Error signing transaction: %s\n", err)
fmt.Printf("Error signing transaction: %s\n", err)
return
}
response, err := client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
fmt.Printf("Error submitting transaction: %s\n", err)
fmt.Printf("Error submitting transaction: %s\n", err)
return
}
if !response.Validated {
fmt.Println("Cold wallet unfreezing failed!")
fmt.Println("Cold wallet unfreezing failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Cold address settings configured!")
fmt.Printf("🌐 Hash: %s\n", response.Hash.String())
fmt.Println("Cold address settings configured!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Create trust line from hot to cold address
//
fmt.Println("Creating trust line from hot to cold address...")
fmt.Println("Creating trust line from hot to cold address...")
hotColdTrustSet := &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(hotWallet.ClassicAddress),
@@ -137,37 +137,37 @@ func main() {
flattenedTx = hotColdTrustSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
fmt.Printf("Error autofilling transaction: %s\n", err)
fmt.Printf("Error autofilling transaction: %s\n", err)
return
}
txBlob, _, err = hotWallet.Sign(flattenedTx)
if err != nil {
fmt.Printf("Error signing transaction: %s\n", err)
fmt.Printf("Error signing transaction: %s\n", err)
return
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
fmt.Printf("Error submitting transaction: %s\n", err)
fmt.Printf("Error submitting transaction: %s\n", err)
return
}
if !response.Validated {
fmt.Println("Trust line from hot to cold address creation failed!")
fmt.Println("Trust line from hot to cold address creation failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Trust line from hot to cold address created!")
fmt.Printf("🌐 Hash: %s\n", response.Hash.String())
fmt.Println("Trust line from hot to cold address created!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Send tokens from cold wallet to hot wallet
//
fmt.Println("Sending tokens from cold wallet to hot wallet...")
fmt.Println("Sending tokens from cold wallet to hot wallet...")
coldToHotPayment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
@@ -184,37 +184,37 @@ func main() {
flattenedTx = coldToHotPayment.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
fmt.Printf("Error autofilling transaction: %s\n", err)
fmt.Printf("Error autofilling transaction: %s\n", err)
return
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
fmt.Printf("Error signing transaction: %s\n", err)
fmt.Printf("Error signing transaction: %s\n", err)
return
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
fmt.Printf("Error submitting transaction: %s\n", err)
fmt.Printf("Error submitting transaction: %s\n", err)
return
}
if !response.Validated {
fmt.Println("Tokens not sent from cold wallet to hot wallet!")
fmt.Println("Tokens not sent from cold wallet to hot wallet!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Tokens sent from cold wallet to hot wallet!")
fmt.Printf("🌐 Hash: %s\n", response.Hash.String())
fmt.Println("Tokens sent from cold wallet to hot wallet!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Claw back tokens from customer one
//
fmt.Println("Clawing back tokens from hot wallet...")
fmt.Println("Clawing back tokens from hot wallet...")
coldWalletClawback := &transactions.Clawback{
BaseTx: transactions.BaseTx{
@@ -230,29 +230,29 @@ func main() {
flattenedTx = coldWalletClawback.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
fmt.Printf("Error autofilling transaction: %s\n", err)
fmt.Printf("Error autofilling transaction: %s\n", err)
return
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
fmt.Printf("Error signing transaction: %s\n", err)
fmt.Printf("Error signing transaction: %s\n", err)
return
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
fmt.Printf("Error submitting transaction: %s\n", err)
fmt.Printf("Error submitting transaction: %s\n", err)
return
}
if !response.Validated {
fmt.Println("Tokens not clawed back from customer one!")
fmt.Println("Tokens not clawed back from customer one!")
fmt.Println("Try again!")
return
}
fmt.Println("Tokens clawed back from customer one!")
fmt.Printf("🌐 Hash: %s\n", response.Hash.String())
fmt.Println("Tokens clawed back from customer one!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
}