Comments (13)
I created a toSpec
helper function and it worked:
public toSpec(txFilePath: string): string {
const file = JSON.parse(readFileSync(txFilePath, 'utf-8'));
const { cborHex } = file;
const decoded = cbor.decode(cborHex);
const newCborDecoded = [];
for (let i of decoded) {
if (Array.isArray(i)) {
newCborDecoded.push(new Map());
} else if (typeof i !== 'boolean') {
newCborDecoded.push(i);
}
}
const result = cbor.encode(newCborDecoded).toString('hex');
return result;
}
from nami.
The raw transaction coming from the cardano-cli does not follow the ledger specs actually. That's why Nami is complaining or better said the serialization-lib. You need to transform the cbor code a little bit. Get rid of the empty arrays at the top and replace them with a map and remove the bool in case there is one.
from nami.
Yes it's possible. I'll release a new Nami version soon, that also handles the additional bool in the transaction from the cardano-cli
from nami.
When doing the following:
const cborHex =
"83a4008182582088d9225ff5d46b0efcd56dda20f2ea93b0a5fa232e7f70ab7d626746075a20d10001828258390089b26fc0c57d636a9095e6b6fd41180f41ca8c3ec4ca05844a67358ab9fd0409f7794c48b5582359f5a0d1313bb5cdeb5557d821c8ef6bcd0a82583900a5fc3e8b211cad55c4f6ebcf4c34201ae47ed079afcd7b54c7ea0c98a32d99d656fb14c7c284c59fb01eaafbdb2b42c7394333159e3530421a3b9817a5021a0002b251031a0005a2f89ffff6";
const rawTx = CardanoWasm.Transaction.from_bytes(
Buffer.from(cborHex, "hex")
);
It gives the error:
Uncaught (in promise) Deserialization failed in Transaction.witness_set.TransactionWitnessSet because: Invalid cbor: not the right type, expected Map' byte received
Array'.
from nami.
OK, so it's possible to build an alonzo-era transaction and sign it with Nami?
I'm looking for a way to enable smart contracts in my dApp without waiting for the PAB release
from nami.
Yes, given that the PAB will be here in a few weeks, should the link handler be implemented in Nami? Or the dApp connector is made with the serialization lib?
from nami.
Yeah Nami is fully built on top of the serialization-lib. I currently use a customized version of the serialization-lib, which follows the latest specs: https://github.com/input-output-hk/cardano-ledger-specs/blob/master/eras/alonzo/test-suite/cddl-files/alonzo.cddl
The bool thing is not in the latest official release yet. The new Nami version should come these days. It's version 2.0.0
It also exposes a new endpoint called getCollateral
from nami.
What is the bool thing about?
from nami.
Oh, and where can I contact you about SpaceBudz? I tried to reach you on Discord, but you must have your dms off.
from nami.
What is the bool thing about?
I think it's an extra flag that tells if the contract evaluates to true or false. I don't know exactly the purpose of it.
from nami.
Oh, and where can I contact you about SpaceBudz? I tried to reach you on Discord, but you must have your dms off.
Yeah I'm trying to avoid some platforms atm. You can reach me on telegram @berry_ales
from nami.
I created a
toSpec
helper function and it worked:public toSpec(txFilePath: string): string { const file = JSON.parse(readFileSync(txFilePath, 'utf-8')); const { cborHex } = file; const decoded = cbor.decode(cborHex); const newCborDecoded = []; for (let i of decoded) { if (Array.isArray(i)) { newCborDecoded.push(new Map()); } else if (typeof i !== 'boolean') { newCborDecoded.push(i); } } const result = cbor.encode(newCborDecoded).toString('hex'); return result; }
This is all good until you actually have some data in those arrays that needs to be transformed. Did you by any chance come up with a way to transform arrays to maps properly?
from nami.
No, I migrated to the serialization lib because the interaction was easier.
from nami.
Related Issues (20)
- help please HOT 4
- Restoring an overwritten Brave installation and a Nami wallet plugin within that HOT 3
- Can transfer out of wallet-Transaction failed HOT 1
- Assets not showing in imported wallet HOT 1
- Couldn't access my nami wallet and now I can't recover it either HOT 9
- All tx's erroring
- Blank screen in extension HOT 8
- Nami wallet
- Help delegation transaction(delegated on yoroi then looked at nami and have a delegation transaction and my balance is lower) HOT 3
- Sending ETH away from NAMI HOT 6
- :warning: ATTENTION: DO NOT CLICK ANY LINKS IN RESPONSES
- I can
- Unable to withdraw Cardano Nami Wallet staking rewards with Trezor HOT 1
- HW wallets don't need a password HOT 1
- Blank screen in Chrome Extension HOT 2
- Token does not show HOT 3
- transfer completed not showing in nami wallet please advise?? NAMI WALLET cardano ADA HOT 1
- Funds that I transferred have disappeared.. HOT 1
- How to disconnect from dAPP using javascript? HOT 1
- Issue Regarding Ada Handles Resolving To a JPG Store Contract Address HOT 7
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 nami.