Comments (4)
Great investigation! We are seeing the same issue at Zeitgeist, we have added ChargeAssetTxPayment
to our runtime but are unable to get it to work on our frontend with assetIds other than 0
from api.
TLDR:
api.createType('Option<AssetId>', 1).toHex() returns ‘0x01000000’.
api.createType('Option<AssetId>', '0x01000000').toString() returns 16777216
from api.
As a possible solution we can apply a fix here:
if (!isOption || value.isSome) {
result[key] = isOption ? value.unwrap().toHex() : value.toHex();
}
By unwrapping the optional value we'll get the proper value we need:
api.createType('Option<AssetId>', 1).toHex() returns ‘0x01000000’
api.createType('Option<AssetId>', 1).unwrap().toHex() returns ‘0x00000001’
from api.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
from api.
Related Issues (20)
- endianness problem in assetId in signAndSend HOT 2
- Deno, rpc staking.validators error: API-WS: disconnected from wss://rpc.polkadot.io: 1000:: Normal Closure HOT 1
- Multisig contract transaction via api/apps
- API accepting undefined destination for transfer
- TypeError: Converting circular structure to JSON - Uploading Contract HOT 4
- Import error import { ApiPromise } from '@polkadot/api'; HOT 3
- Incorrect decoding of signed integers `i8`/`i16` HOT 3
- Need new release HOT 4
- Discussion: Switch from `bn.js` to new `BigInt` primitive? HOT 2
- Import broken for CJS-targeted TypeScript projects
- Incorrect handling of revert flag in pallet-contracts query HOT 3
- Signing multiplies `assetId` by `2^24` HOT 3
- `.entries()` and `.keys()` are not auto-updating on changes. There is no map-subscription RPC. HOT 2
- Adjust v15 usage to use exposed extrinsic, Call & Event fields
- [BUG] Contract missing from signAndSend method HOT 4
- Expose runtime methods from metadata V15 HOT 1
- `wasm-crypto` not loading in environments where `wasm-unsafe-eval` CSP is not allowed HOT 2
- Initialization error when running with `bun` (1001:: Going Away) HOT 6
- Change RISC-V magic
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.