Code Monkey home page Code Monkey logo

asset-transfer-api's People

Contributors

bee344 avatar curlybracketeffect avatar dependabot[bot] avatar gavofyork avatar ikeralus avatar imod7 avatar marshacb avatar rymul avatar sergejparity avatar tarikgul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

asset-transfer-api's Issues

Create functionality for Native Assets

The transfer of native assets to its origin chain involve using a teleportAssets or limited call. There needs to be some sort of logic where we can check if the passed in asset is a Native asset. Ex: GML not 18

This can involve some sort of registry, and lookup using the assets pallet.

For now this support should only be for system parachain directions.

Find a reliable way to establish what the relay chain is for a given chain.

This is important for when we are declaring how we should search through the registry.

Since the layout of the registry works like:

const registry = {
    polkadot: { ... },
    kusama: { ... },
    westend: { ... },
}

We want to ensure we connect to the correct chain. One solution would be to make a map of each key. So for example:

polkadot = [
    'acala',
    'moonbeam',
    ...
]

And check the specName we have locally against the registry. If it does not exist then we need to throw an error.

Investigating a different return value for `createTransferTransaction`

Currently createTransferTransaction 3 different values in 2 formats depending on the format option. The options are call, payload, and submittable. Either a hex will be returned or a polkadot-js Submittable type.

This has been on my mind since designing and implementing the API, but to make errors clearing and following a more rust like syntax return a Result, that either has the return value or an error attached. Along with that should we change that return value to be a object with the following metadata attached:

If the Result is ok, it would need to be unwrapped using unwrap.

{
    xcmVersion: string,
    direction: This will be the xcmDirection or local for a local transaction.
    result: (This will be the call payload or submittable)
}

If the Result is an err, it would have the following structure:
{
type: The type of error this is
msg: The error message.
}

Open to adding more information as well.

@IkerAlus Curious on your thoughts.

Add createFormat

This should take in a SubmittableExtrinsic and return either payload | call | polkadot- js

Check AssetId inputs

If you are given assets such as ['1', '2', '3', 'TST', 'GLMR'] this would be the correct format.

If you are given assets such as ['1', '2', '3', 'TST', 'hello'] this would be incorrect.

If the value is a token we want to check that against the registry. We can use findRelayChain function to help establish which relay chain is on our network and then we can check all the tokens under that object.

You may need to also pass in the specName and registry to checkXcmTxInputs

Remove All V0 support and replace with V2.

We should remove any support for V0 and replace it with V2. This also means when we start adding V3 it should replace V1 and that should be removed for the long term and or be deprecated.

Dynamically construct the type of account for the xcm message

Ex: Between a AccountId32 and AccountId20

This has to do with ethereum addresses, and should be taken into account when constructing the xcm message. createXcmTypes is where we pass in the accountId, and we should have some process in place to ensure its the correct type.

Handle unreliableId's better in the createRegistry script

Currently the unreliable Id's that i inputted are from a local testing standpoint and were manually added to those arrays, but it would be a great improvement to remove those values and have a timer on each api connection and when the timer is surpassed to skip adding that chains tokens to the registry.

Sanitize SS58 addresses to Hex.

Right now main is broken because I switched over addresses to be only SS58 and have rejected hexes, but that breaks the api. Polkadot-js only accepts a hex value for constructing xcm messages.

Search for correct call on parachain pallets

Since not all parachains are created equal we need to ensure we can find the correct call in the pallet.

This is not an immediate need, but should be taken into account when we implement ParaTo* cases

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.