Algodot

by lucasvanmol

1

algodot

Algorand integration in Godot

Download the addon

Link coming soon!

Usage

Initializing the Algod object

algod = Algod.new()
algod.url = "http://localhost:4001"
algod.token = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
add_child(algod)

Test connections using .health()

assert(yield(algod.health(), "completed") == OK)

Sending transactions

var from_mnemonic = "your twenty five word mnemonic ..."
var from_address = algod.get_address(from_mnemonic)

# Get suggested parameters
var params = yield(algod.suggested_transaction_params(), "completed")

# Generate a new account
var to_account = algod.generate_key()

# Create and sign transaction
var tx = algod.construct_payment(params, from_address, account[0], 123456789)
var stx = algod.sign_transaction(tx, from_mnemonic)
var txid = yield(algod.send_transaction(stx), "completed")

# Wait for confirmation
yield(algod.wait_for_transaction(txid), "completed")
var info = yield(algod.account_information(account[0]), "completed")

assert(info.amount == 123456789)

For more examples, check out the test script.

Version

0.3

Engine

3.4

Category

Scripts

Download

Version0.3
Download

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author