Comments (2)
Hi, I solved this issue.
We can do this using lucid-cardano
.
The cardano zero address is here
addr1vyqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkdl5mw
const inputs = C.TransactionInputs.new();
inputs.add(
C.TransactionInput.new(
C.TransactionHash.from_hex(
'706f481e44126b9de1c394e1ade248b15c435216fba3ecfb40d21c5c291be75d',
),
C.BigNum.zero(),
),
);
const outputs = C.TransactionOutputs.new();
outputs.add(
C.TransactionOutput.new(
C.Address.from_bech32(
'addr1qx2vnfzpeuvdcym8y7v5qnz2mc289ue6tfr0xynyaqnm0rhuanngtqdu53qy0c0zxxed8hdnmkl66l0uvw68q8elp4nsxyap30',
),
C.Value.new(C.BigNum.from_str('1000000')),
),
);
const fee = C.BigNum.from_str('500000');
const witnessSet = C.TransactionWitnessSet.new();
const auxData = C.AuxiliaryData.new();
const metadata = C.GeneralTransactionMetadata.new();
const metadataMap = C.MetadataMap.new();
const metadataList = C.MetadataList.new();
metadataList.add(C.TransactionMetadatum.new_text('Hello World'));
metadataMap.insert(
C.TransactionMetadatum.new_text('msg'),
C.TransactionMetadatum.new_list(metadataList),
);
const metadataum = C.TransactionMetadatum.new_map(metadataMap);
metadata.insert(C.BigNum.from_str('674'), metadataum);
auxData.set_metadata(metadata);
const transaction = C.Transaction.new(
C.TransactionBody.new(inputs, outputs, fee),
witnessSet,
auxData,
);
from lucid.
Here is easier way for this.
const lucid = await Lucid.new(blockfrostProvider, 'Mainnet');
const utxos = await lucid.utxosAt(zeroAddress);
lucid.selectWalletFrom({
address: zeroAddress,
utxos,
});
const tx = await lucid
.newTx()
.payToAddress(bech32Address, {
lovelace: 2000000n,
})
.addSigner(bech32Address)
.validTo(Date.now() + 1000 * 120)
.attachMetadata(674, {
msg: [
'Only for verification',
],
})
.complete();
from lucid.
Related Issues (20)
- getUtxosByOutRef consistency across providers
- Attaching a datum to genesis UTxOs in Emulator
- Unable to build a "Bid transaction" of an english auction with lucid API HOT 2
- Wallet from seed doesn't sign transaction spending only UTXOs locked with enterprise address HOT 1
- Potential External Memory Leak - External Resources not being collected. HOT 2
- Unclear mapping of data structures between lucid and aiken HOT 1
- Add Docs for Vite/SvelteKit HOT 1
- Nami requests signature fee instead of requesting payment?
- Nami requests signature fee instead of requesting payment? HOT 1
- next 13 and lucid HOT 2
- No "exports" main defined in package.json HOT 2
- Fee Estimation issue when building contract remdemption TX on the backend. HOT 1
- `'amounts-as-strings': 'true'` for Maestro provider endpoints
- "Max collateral inputs reached" HOT 2
- Merging change utxos in minting transaction HOT 1
- No "exports" main defined while using lucid-cardano with typescript.
- vite node vue3 http://127.0.0.1:4001/node_modules/.vite/deps/cardano_multiplatform_lib_bg.wasm 404 (Not Found) HOT 1
- Unlock transaction: Uncaught (in promise) Redeemer (Spend, 0): Failed to deserialise PlutusData using UnConstrData: HOT 7
- Nextjs 14 and context
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 lucid.