Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

chore: cleanup to metadata and extrinsic effect apis #312

Merged
merged 4 commits into from
Oct 22, 2022

Conversation

harrysolovay
Copy link
Contributor

@harrysolovay harrysolovay commented Oct 22, 2022

Now that various effects utilize Z.Name, we can attach methods to simplify their APIs.

Metadata:

const entryMetadata = new C.Metadata(T.polkadot)
  .pallet("Balances")
  .entry("Account");

Extrinsics:

const root = new C.Extrinsic(T.westend, {
  sender: {
    type: "Id",
    value: T.alice.publicKey,
  },
  palletName: "Balances",
  methodName: "transfer",
  args: {
    value: 12345n,
    dest: {
      type: "Id",
      value: T.bob.publicKey,
    },
  },
})
  .signed((message) => ({
    type: "Sr25519",
    value: T.alice.sign(message),
  }))
  .watch((stop) => {
    return (event) => {
      // ...
    };
  });

^ this paves the way for the non-watched counterpart.

@harrysolovay harrysolovay marked this pull request as ready for review October 22, 2022 17:50
tjjfvi
tjjfvi previously approved these changes Oct 22, 2022
@harrysolovay harrysolovay merged commit a72dc89 into main Oct 22, 2022
@harrysolovay harrysolovay deleted the effect-cleanup branch October 22, 2022 18:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants