Skip to content

Conversation

arjanz
Copy link
Contributor

@arjanz arjanz commented Jul 22, 2024

Todos

  • Runtime call interfaces
  • Storage interface
  • keyring interface
  • Runtime API interface
  • Ink contract interface
  • scalecodec 2.0 integration
  • Move Substrate SCALE types to library
  • Migrate unit tests
  • refactor decode to _decode
  • replace setup.py with pyproject.toml
  • Update documentation
  • Document upgrade path

New code examples

Balance information of an account

result = substrate.runtime.pallet('System').storage('Account').get('F4xQKRUagnSGjFqafyhajLs94e7Vvzvr8ebwYJceKpr8R7T')
print(result.value['data']['free']) # 635278638077956496

Create balance transfer extrinsic

receipt = substrate.runtime.pallet("Balances").call("transfer_keep_alive").create_extrinsic(
    dest='5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
    value=1 * 10**15
).sign_and_submit(keypair=keypair, era={'period': 64}, wait_for_inclusion=True)

print(f"Extrinsic '{receipt.extrinsic_hash}' sent and included in block '{receipt.block_hash}'")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant