Comments (7)
If I am not mistaken you can add any typesBundle
or typesSpec
fields to override certain types when instantiating the ApiPromise. And you would set TAssetConversion
to Option<AssetId>
as seen here in the PR you referenced.
Moving forward we would like to use arbitrary values like this but run into similar issues:
I don't see the api supporting an input like { ForeignAsset: 1 }
. IMO the asset passed in should always be a valid and explicit MultiLocation. Short cuts especially for something as specific as a multiLocation can cause unwanted behavior or bugs.
from api.
Is there a way to use anything else than MultiLocation
as AssetId
?
One pallet used to allow transaction fee payment with assets is a standard Substrate frame pallet pallet-asset-tx-payment
. In the transaction validation function, it uses an AssetId
that can be specified by the developer. It seems wrong to me to force the asset id type within the sdk when it is configurable in the pallet that processes the asset id on the blockchain side.
from api.
Is there a way to use anything else than MultiLocation as AssetId?
Yes, you should be able to do this by following what I wrote in the above:
If I am not mistaken you can add any typesBundle or typesSpec fields to override certain types when instantiating the ApiPromise. And you would set TAssetConversion to Option as seen here in the PR you referenced.
from api.
Thanks @TarikGul we managed to get it working with this change and signing with a keyring pair, see transaction here. However when we try to sign with an extension we get the following error:
I'm guessing this means that we need to add the overrides to this repo in a similar fashion to the asset hubs, what do you think?
from api.
Hi @TarikGul would you be able to take a look at this and let us know the best course of action?
from api.
I'm guessing this means that we need to add the overrides to this repo in a similar fashion to the asset hubs, what do you think?
I am not completely sure to be honest, what version of the extension are you using?
from api.
I'm using version 0.44.1. I think this is the issue because it looks very similar to this. It looks like the reason for it was that these changes to override the types had not yet been deployed. So it seems like we will need to add similar overrides for Zeitgeist
from api.
Related Issues (20)
- [Tracking upstream] Addition of TransactionExtension
- Support `minimumPeriod` of `0` HOT 6
- @polkadot/[email protected] references non-existing versions HOT 4
- Add decoration of runtimeApis HOT 1
- Coretime Endpoint doesn't work HOT 8
- Fix transferable balance in `api.derive.balances.all` with new formula HOT 2
- TypeError: Cannot read properties of undefined (reading 'env') HOT 1
- stakerRewards bug | Payouts HOT 19
- getblock of assethub return error HOT 5
- api.derive.staking.electedInfo returns duplicated data HOT 4
- api.at warn Unable to map [u8; 32] to a lookup index HOT 1
- Cannot read properties of undefined (reading 'toHuman') HOT 4
- error on node v22.1.0 HOT 2
- `CheckMetadataHash` SignedExtension Support
- `api.derive.accounts.identity` broken ? | People Chain HOT 2
- Augmented types for system parachains
- somthing wrong in bitvec codec HOT 1
- Polkadot xcm type cannot be parsed (Bifrost chain) HOT 3
- Support `AuraUnincludedSegmentApi` API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api.