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

feat: raw metadata chain config + rename chain #923

Merged
merged 18 commits into from
Apr 25, 2023

Conversation

harrysolovay
Copy link
Contributor

@harrysolovay harrysolovay commented Apr 21, 2023

Resolves #621
Resolves #861
Resolves #927

  1. exposes API under a chain-specific name instead of chain. This helps us forgo the excessive aliasing.

Before:

import { chain as rococo } from "@capi/rococo-dev-xcm"
import { chain as statemine } from "@capi/rococo-dev-xcm/statemine"
import { chain as trappist } from "@capi/rococo-dev-xcm/trappist"

After:

import { rococoDevXcm } from "@capi/rococo-dev-xcm"
import { statemine } from "@capi/rococo-dev-xcm/statemine"
import { trappist } from "@capi/rococo-dev-xcm/trappist"
  1. one can use the codegen with raw metadata.
// ...

export const config: Config = {
  server: "https://capi.dev/",
  chains: {
    polkadotFromMetadata: {
      metadata: await Deno.readFile("metadata"),
    },
  },
}

... then...

import { PolkadotRune } from "@capi/polkadot-from-metadata"

const chain = PolkadotRune.from(connect)

In this case, no chain instance is exposed, as one needs to construct it themselves.

@harrysolovay harrysolovay changed the title feat: raw metadata chain config feat: raw metadata chain config + rename chain Apr 21, 2023
Readme.md Outdated Show resolved Hide resolved
Readme.md Outdated Show resolved Hide resolved
Readme.md Outdated Show resolved Hide resolved
Readme.md Outdated Show resolved Hide resolved
tjjfvi
tjjfvi previously approved these changes Apr 25, 2023
@harrysolovay harrysolovay added this pull request to the merge queue Apr 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2023
@harrysolovay harrysolovay added this pull request to the merge queue Apr 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2023
@harrysolovay harrysolovay added this pull request to the merge queue Apr 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2023
kratico
kratico previously approved these changes Apr 25, 2023
cspell.json Show resolved Hide resolved
@harrysolovay harrysolovay added this pull request to the merge queue Apr 25, 2023
Merged via the queue into main with commit a7e0fe3 Apr 25, 2023
@harrysolovay harrysolovay deleted the scale-bytes-chain-config branch April 25, 2023 22:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants