Comments (6)
Hey!
cardano.signTx
takes a raw cbor string as argument. Did you create the tx with the cardano-cli?
from nami.
Yes! I built the transaction and then used the 'cborHex' argument
from nami.
For some reason the cli creates an empty witness set in form of an array, although in the ledger specs it's a map. You can make a small transformation from an array to a map with this function:
const cbor = require("cbor");
const convertCbor = (txRaw) => {
const decoded = cbor.decode(txRaw);
decoded.splice(1, 1, new Map());
return Buffer.from(cbor.encode(decoded), "hex").toString("hex");
};
The result you can then use as argument for cardano.signTx
The cbor library you can get here: https://www.npmjs.com/package/cbor
from nami.
Ok almost there, I have been able to get a uint8 array, here the encoded form '84a30081825820745084b076a17275916921ad4cadbda2ef071587fe0b2cda80e14df5a2848a83000182825839011c471b31ea0b04c652bd8f76b239aea5f57139bdc5a2b28ab1e69175fd3a6bfce30d7744ac55e9cf9146d8a2a04ec7fb2ce2ee69862606531a000c917b825839010d50033b5cfc6177d1bf3fdfc958fc0112b4ec3ba12960df29cebfe39500d456024a38c1658ff57ba22f2f91612aad725ad26a1d2daf00f31a001e8480021a0002b0c5a080f6'
Unfortunately the error keeps being the same
const signedTx=await cardano.signTx(tx: uint8Array);
from nami.
You simply take the raw cbor string from the cli and pass it in the convertCbor
function. The return value you then put in the cardano.signTx
function. That's all you need to do.
from nami.
Thanks a lot @alessandrokonrad, as you told me the working code is:
const convertCbor = (txRaw) => {
const decoded = cbor.decode(txRaw);
decoded.splice(1, 1, new Map());
return Buffer.from(cbor.encode(decoded), "hex").toString("hex");
};
from nami.
Related Issues (20)
- 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
- Infinity Loading Send Screen Preprod HOT 7
- Nami Misinterprets Transfer, Incorrectly Displays no assets HOT 5
- 524 Timeout on isAddressAllowed call, unable to make transactions HOT 1
- Issues with Ledger Nano X
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.