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

Version 2.0 #403

Draft
wants to merge 6 commits into
base: v2.0
Choose a base branch
from
Draft

Version 2.0 #403

wants to merge 6 commits into from

Conversation

arjanz
Copy link
Member

@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