Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conway #636

Merged
merged 370 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
370 commits
Select commit Hold shift + click to select a range
1ec90ed
rename macro
lisicky Sep 1, 2023
f3d6d9d
move tx builder + fmt
lisicky Sep 8, 2023
0f4e333
move builders + fmt
lisicky Sep 8, 2023
fa3cd23
fix voting builder api + fmt
lisicky Sep 8, 2023
7b39c75
move to another module + fmt
lisicky Sep 8, 2023
b54661b
move fixed tx tests + fmt
lisicky Sep 8, 2023
890c05e
certificates fmt
lisicky Sep 8, 2023
33fbeae
fmt
lisicky Sep 8, 2023
91554dd
fmt
lisicky Sep 8, 2023
8f4149e
fmt
lisicky Sep 8, 2023
8cf0d0b
move tx builder tests
lisicky Sep 8, 2023
9542270
add voting builder tests
lisicky Sep 8, 2023
b30a94e
fmt
lisicky Sep 8, 2023
24f07ff
add new mocks
lisicky Sep 8, 2023
7eca123
fmt
lisicky Sep 8, 2023
15beef1
add voting proposal builder tests
lisicky Sep 9, 2023
025c59b
rename struct_checks.rs to utils.rs
lisicky Sep 9, 2023
633ac4f
add plutus v3 support
lisicky Sep 9, 2023
8fff6d5
add new field to tx body and params update
lisicky Sep 9, 2023
62af761
update schema gen
lisicky Sep 9, 2023
6b4a97e
add mint zero check
lisicky Sep 9, 2023
62d9c77
add mint zero check
lisicky Sep 9, 2023
85edb9a
multiasset can't be empty
lisicky Sep 9, 2023
6ea9932
fix for flowgen
lisicky Sep 9, 2023
98d4c0e
fix test
lisicky Sep 9, 2023
21a9bb9
prevent Int destroy in mint types
lisicky Sep 9, 2023
8e4d9b7
fix modules import
lisicky Sep 9, 2023
0859f87
update js flow
lisicky Sep 9, 2023
c1531a0
deprecate protocol version setter in the protocol param update
lisicky Sep 9, 2023
8243082
add tests for cert builder
lisicky Sep 10, 2023
7532419
Merge branch 'evgenii/conway_certs' into evgenii/conway_donation_and_…
lisicky Sep 10, 2023
132e57d
rename stakeCred to cred
lisicky Sep 10, 2023
5486a6c
Merge branch 'evgenii/conway_certs' into evgenii/conway_donation_and_…
lisicky Sep 10, 2023
686cd41
merge fix
lisicky Sep 10, 2023
0f07db0
version bump
lisicky Sep 10, 2023
52f6882
flow update
lisicky Sep 10, 2023
867ee69
rename 'new committee' to 'update committee'
lisicky Sep 18, 2023
d82c1b4
updated new committee serialization
lisicky Sep 18, 2023
c3160c3
update new committee serialization
lisicky Sep 18, 2023
6f71cc2
rename committee certs
lisicky Sep 18, 2023
7198449
Merge branch 'evgenii/conway_certs' into evgenii/conway_donation_and_…
lisicky Sep 19, 2023
4e4456b
do not serialize empty withdrawals, certs, req signers, voting proced…
lisicky Sep 19, 2023
a7bb4ca
version bump
lisicky Sep 19, 2023
35549bd
remove unnecessary brackets
lisicky Sep 19, 2023
4d7f878
add auto delete to schema gen
lisicky Sep 19, 2023
320d1c6
flow update
lisicky Sep 19, 2023
112d980
update schema to ts gen
lisicky Sep 23, 2023
46689dc
fix MIR schema name
lisicky Sep 23, 2023
06a18c3
flow update
lisicky Sep 23, 2023
39cdd40
version bump
lisicky Sep 23, 2023
6ce6c91
rename proposal to action
lisicky Oct 5, 2023
13f6c0a
add voting proposal
lisicky Oct 5, 2023
7668162
fix naming
lisicky Oct 5, 2023
dfcea17
update for new structure
lisicky Oct 5, 2023
6beb5ca
add deserialization tests
lisicky Oct 5, 2023
09747a8
update json gen
lisicky Oct 5, 2023
7c3fda7
Merge branch 'evgenii/conway_certs' into evgenii/conway_donation_and_…
lisicky Oct 5, 2023
b7bb0a1
fix test
lisicky Oct 5, 2023
c69fd8b
flow update
lisicky Oct 5, 2023
dc9335a
version bump
lisicky Oct 5, 2023
1839cb3
add new function for utxo selection and change
twwu123 Oct 10, 2023
e4eb274
fix schema gen
lisicky Oct 10, 2023
d9f428d
flow update
lisicky Oct 10, 2023
3d68d75
version bump
lisicky Oct 10, 2023
1ea9862
add docs for new function
twwu123 Oct 10, 2023
51e0a84
fix drep serialisation
lisicky Oct 10, 2023
5fbd175
Merge branch 'evgenii/conway_certs' into evgenii/conway_donation_and_…
lisicky Oct 10, 2023
449ce6d
version bump
lisicky Oct 10, 2023
a3bde58
fix info action serialization
lisicky Oct 16, 2023
feb6368
fmt
lisicky Oct 16, 2023
2859e06
Merge branch 'evgenii/conway_certs' into evgenii/conway_donation_and_…
lisicky Oct 16, 2023
4463f52
version bump
lisicky Oct 16, 2023
93d423e
Merge branch 'master' into evgenii/conway_certs
vsubhuman Oct 26, 2023
7d053ee
add req witness for reg cert
lisicky Nov 1, 2023
2089e96
add anchor for committee_cold_resign
lisicky Nov 1, 2023
b21a39d
Merge remote-tracking branch 'origin/evgenii/conway_certs' into evgen…
lisicky Nov 1, 2023
40db08a
Merge branch 'evgenii/conway_certs' into evgenii/conway_donation_and_…
lisicky Nov 1, 2023
ecb65e2
version bump
lisicky Nov 1, 2023
b9d182b
update flow
lisicky Nov 1, 2023
7a618a2
update set deserialization (tag 258)
lisicky Nov 3, 2023
2fb40b7
Merge remote-tracking branch 'origin/evgenii/conway_certs' into evgen…
lisicky Nov 3, 2023
bfe72bb
version bump
lisicky Nov 3, 2023
e28f482
fix committee certs naming
lisicky Nov 7, 2023
cb28ef4
Merge remote-tracking branch 'origin/evgenii/conway_certs' into evgen…
lisicky Nov 7, 2023
4ba6547
replace new_ref_input_with_lang_ver by new_ref_input
lisicky Nov 13, 2023
177774e
remove ability to add a script input without witness
lisicky Nov 14, 2023
3ebe73b
remove deprecated testnet from NetworkInfo
lisicky Nov 14, 2023
71e0ea8
remove coins_per_utxo_byte from tx builder config
lisicky Nov 14, 2023
65136fa
remove deprecated functions that uses coins per word
lisicky Nov 15, 2023
ca1f54b
remove wrong named function
lisicky Nov 15, 2023
3de15cd
serialization mod visibility fix
lisicky Nov 28, 2023
fe491d3
update js flow
lisicky Nov 28, 2023
a2c0a3c
bump version
lisicky Nov 28, 2023
a1e7acc
update import scheme
lisicky Nov 28, 2023
58dcd11
version bump
lisicky Nov 28, 2023
82672d4
replace get by get_all in MintsAssets
lisicky Nov 28, 2023
6a58860
fix test
lisicky Nov 28, 2023
190b825
js flow update
lisicky Nov 28, 2023
bdf07d9
add set structures
lisicky Dec 5, 2023
2ff9449
add remove apis for option variables in tx builder
twwu123 Dec 25, 2023
3366f0f
implement change function with collateral return
twwu123 Jan 1, 2024
6d25074
add comment for utxo select and collateral return method
twwu123 Jan 8, 2024
258e092
improve utxo selection and change test
twwu123 Jan 8, 2024
5c34324
add test for utxo selection with collat return
twwu123 Jan 9, 2024
bfcc896
Merge branch 'master' into evgenii/conway_certs
lisicky Jan 29, 2024
0526604
Merge branch 'evgenii/csl_12_breaking_changes' into evgenii/conway_certs
lisicky Jan 29, 2024
71dba6d
flow update
lisicky Jan 29, 2024
45413f1
package-lock update
lisicky Jan 29, 2024
e835403
bump wasm bingen version, add explicit enum args in .flow file
lisicky Feb 1, 2024
aeb99cf
add script size protocol param
lisicky Feb 9, 2024
81c6621
change url max len
lisicky Feb 9, 2024
16f905c
fix certs witnesses and refund value
lisicky Feb 9, 2024
c8e48c0
remove set types, moving out types from crypto.rs
lisicky Feb 10, 2024
304e79d
split plutus.rs into separate files
lisicky Feb 10, 2024
4aaec2e
move native scripts into separate module
lisicky Feb 10, 2024
78f65a2
revert build.sh
lisicky Feb 10, 2024
66f4429
add dedup to native scripts
lisicky Feb 10, 2024
a882a7e
Revert "add dedup to native scripts"
lisicky Feb 10, 2024
36800a1
deduplication for witnesses set
lisicky Feb 10, 2024
47d37d9
switch from linked-hash-map to hashlink
lisicky Feb 10, 2024
9af7fab
add script hash for parameter_change_action and treasury_withdrawals_…
lisicky Feb 10, 2024
5859bd4
add mandatory script witness for a voting proposal that have a policy…
lisicky Feb 10, 2024
befe1cc
update js.flow file
lisicky Feb 10, 2024
70a1803
cargo lock update
lisicky Feb 10, 2024
4f77f7f
bump csl version
lisicky Feb 10, 2024
fc55197
fix cert script check
lisicky Feb 16, 2024
3756903
add block_from_wrapped_bytes function
lisicky Feb 16, 2024
e391f57
bingen fix
lisicky Feb 16, 2024
e4a4721
js.flow update
lisicky Feb 16, 2024
e260fcf
version bump
lisicky Feb 16, 2024
55c3f47
fix collections deserialization
lisicky Feb 19, 2024
c624c22
js flow update
lisicky Feb 19, 2024
157d933
version bump
lisicky Feb 19, 2024
ff57056
fix hf initiation serialization
lisicky Mar 5, 2024
c7159d3
bump version
lisicky Mar 5, 2024
0ee2fab
security_relevant_threshold to PoolVotingThresholds
lisicky Mar 8, 2024
ddcb25f
bump version
lisicky Mar 8, 2024
4ba8973
plutus int json serialization fix
lisicky Mar 12, 2024
2a43f48
version bump
lisicky Mar 12, 2024
494bbcc
fix serde version
lisicky Mar 12, 2024
76adf12
flow update
lisicky Mar 12, 2024
af70ebf
version bump
lisicky Mar 12, 2024
9f81842
fix MintsAssets js interface
lisicky Mar 13, 2024
3e3380c
version bump
lisicky Mar 13, 2024
ece4031
temp fix for multiple keys in plutus map
lisicky Mar 26, 2024
d384fb7
add redeemer flag, and malformed address
lisicky Mar 28, 2024
16eed22
fix MintsAssets.add type
lisicky Apr 3, 2024
735c54c
fix fee calculation for extra datum
lisicky Apr 3, 2024
4a464a0
version bump
lisicky Apr 3, 2024
c7fb324
add redeemers map serialization/deserialization
lisicky Apr 4, 2024
0e221be
revert release.sh
lisicky Apr 4, 2024
d128301
Merge branch 'evgenii/script-size-pp' into evgenii/conway_certs
lisicky Apr 5, 2024
196f25f
fix address deserialization
lisicky Apr 10, 2024
53558f3
version bump
lisicky Apr 10, 2024
3707b43
flow update
lisicky Apr 10, 2024
5833519
Merge remote-tracking branch 'origin/evgenii/conway_certs' into evgen…
lisicky Apr 10, 2024
11440b6
fix pointer address decoder
lisicky Apr 11, 2024
b88dce3
version bump
lisicky Apr 11, 2024
8275f3d
Merge remote-tracking branch 'origin/evgenii/conway_certs' into evgen…
lisicky Apr 11, 2024
a58bd59
add ref_script_coins_per_byte parameter
lisicky Apr 12, 2024
0e648d1
update test
lisicky Apr 12, 2024
a070d49
add Address.kind() and Address.payment_cred()
lisicky Apr 12, 2024
0be14e4
add prevention of empty witness serialization
lisicky Apr 12, 2024
f3f909d
switch malformed address deserilization logic
lisicky Apr 12, 2024
ac4d587
Merge branch 'evgenii/conway_certs' into tszwai/add_inputs_from_and_c…
lisicky Apr 12, 2024
3760469
merge fix
lisicky Apr 12, 2024
9903f88
Merge pull request #652 from Emurgo/tszwai/add_inputs_from_and_change
lisicky Apr 12, 2024
e88da28
remove unwrap
lisicky Apr 12, 2024
6182d69
Merge branch 'tszwai/add_inputs_from_and_change' into evgenii/conway_…
lisicky Apr 12, 2024
aeeb11f
version bump
lisicky Apr 12, 2024
8aa9d9f
add redeemers map deserialization test
lisicky Apr 12, 2024
d9aad56
fix MintBuilder for multiple different redeemers, add ref input suppo…
lisicky May 7, 2024
102b8dc
version bump
lisicky May 7, 2024
09e1621
remove old tx builder file
lisicky May 25, 2024
72d4bfc
change percentage type for add_inputs_from_and_change_with_collateral…
lisicky May 30, 2024
5a87e3c
fix add_inputs_from_and_change_with_collateral_return corner case
lisicky May 31, 2024
dcc4ed1
add security_relevant_threshold getter, fix committee_term_limit type…
lisicky Jun 3, 2024
3eb7107
bump version
lisicky Jun 5, 2024
e810801
replace NativeScript by NativeScriptSource in add_native_script_input…
lisicky Jun 16, 2024
3d324d1
add duplicated keys support for plutus maps
lisicky Jun 19, 2024
f1169e6
add VersionedBlock struct
lisicky Jun 20, 2024
328e218
move ScriptRef into separate file, add to_unwrapped_bytes function
lisicky Jun 21, 2024
ed55b45
update js flow file
lisicky Jun 21, 2024
ee2cde4
add test for RefScript serialization
lisicky Jun 21, 2024
8b29815
add test for RefScript serialization
lisicky Jun 21, 2024
5f31653
add network_id getter for address types
lisicky Jun 21, 2024
59323e6
add network_id getter for address types
lisicky Jun 21, 2024
e5d1b67
revert wrong changes
lisicky Jun 21, 2024
9e9cdfe
warnings cleanup
lisicky Jun 21, 2024
27fe24c
warnings cleanup
lisicky Jun 21, 2024
2034cc2
fixed set serialization
lisicky Jun 21, 2024
f19a893
add error on duplicated keyhash in Ed25519KeyHash
lisicky Jun 21, 2024
7848f43
add error on duplicated credential in Credentials
lisicky Jun 21, 2024
9715325
return bool on "add" for struct with deduplication
lisicky Jun 22, 2024
ec86a0f
move utils tests
lisicky Jun 22, 2024
9d2393a
tx witnesses set fields deduplication, tests
lisicky Jun 22, 2024
5591034
add tests for address payment_cred(), kind(), network_id()
lisicky Jun 22, 2024
27a7902
fix structs that marked as "set" in cddl
lisicky Jun 22, 2024
988feed
tx inputs as set
lisicky Jun 22, 2024
90cefe5
fix json serialization, add round-trip tests
lisicky Jun 22, 2024
62a6a06
flow update
lisicky Jun 22, 2024
e056c45
warnings cleanup
lisicky Jun 22, 2024
4840c51
bump node version in nvmrc, bump dev dependencies
lisicky Jun 23, 2024
b5686ba
bump csl version
lisicky Jun 23, 2024
197c456
add packages with finalization registry
lisicky Jun 24, 2024
b374e35
move fakes into test submodule
lisicky Jun 24, 2024
3900785
fakes generator functions unification
lisicky Jun 24, 2024
29e316b
move fees tests to test module
lisicky Jun 24, 2024
216c907
move emip3 and tx_builder_constants tests to test module
lisicky Jun 24, 2024
d104ff7
fix redeemer indexing for mint builder
lisicky Jul 2, 2024
f240365
version bump
lisicky Jul 2, 2024
fa6db4c
fix naming consistency
lisicky Jul 29, 2024
995017a
add new_from_credential and to/from bech32 for DRep
lisicky Jul 29, 2024
1da6da9
add tiers calculator for ref script fee
lisicky Jul 29, 2024
044021e
fix warning
lisicky Jul 29, 2024
4666a9a
make certificates builder to respect insertion order
lisicky Jul 29, 2024
ad2671a
update js flow file
lisicky Jul 29, 2024
eb1b085
bump version
lisicky Jul 29, 2024
6d79164
remove comments
lisicky Jul 30, 2024
cb1d0f1
rename new_with_coin to new_with_explicit_deposit and new_with_explic…
lisicky Aug 2, 2024
500f144
add specific constructors for reg_cert and unreg_cert into certificat…
lisicky Aug 2, 2024
9bbb7dc
fix max dns name len
lisicky Aug 2, 2024
b765c78
fix tests
lisicky Aug 2, 2024
0287a6a
fix memory management for set_asset
lisicky Aug 7, 2024
1d69741
fix memory management for set_asset
lisicky Aug 7, 2024
97d8be2
add fixed block
lisicky Aug 7, 2024
89cbeea
add preview cost models for conway
lisicky Aug 7, 2024
242abc1
fix types for wasm
lisicky Aug 7, 2024
2d91fde
bump version
lisicky Aug 7, 2024
b9f2b00
bump bindgen version
lisicky Aug 7, 2024
0bdbdc3
add from_hex for "fixed" structs
lisicky Aug 7, 2024
889764f
bump version
lisicky Aug 7, 2024
5f3b18c
drep naming unification
lisicky Aug 12, 2024
9c1de59
update flow file
lisicky Aug 12, 2024
1155ade
fix coin selection to have at least one input
lisicky Aug 13, 2024
539f23c
update flow file
lisicky Aug 13, 2024
479879b
version bump
lisicky Aug 13, 2024
e47682c
fix warnings
lisicky Aug 13, 2024
96f2467
add ref inputs and tx inputs debuplication
lisicky Aug 16, 2024
dd18a8e
flow update
lisicky Aug 16, 2024
57c9dc1
version bump
lisicky Aug 16, 2024
b5013dd
add script size parameter for native script source with reference input
lisicky Aug 19, 2024
01ca02d
version bump
lisicky Aug 19, 2024
1675fe0
flow update
lisicky Aug 19, 2024
ca0db79
version bump
lisicky Aug 20, 2024
7e54491
naming unification
lisicky Aug 26, 2024
ad4b118
version bump
lisicky Aug 26, 2024
ed8c448
fix plutus map serialization for multiple keys
lisicky Aug 28, 2024
f111d76
version bump
lisicky Aug 28, 2024
a2774f6
flow update
lisicky Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
submodules: 'recursive'
- uses: actions/setup-node@v1
with:
node-version: '12.18.1'
node-version: '18'
- name: Cache node modules
uses: actions/cache@v1
with:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
submodules: 'recursive'
- uses: actions/setup-node@v1
with:
node-version: '12.18.1'
node-version: '18'
- name: Cache node modules
uses: actions/cache@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.18.1
v18
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ This is a library, written in Rust, for serialization & deserialization of data
- [Browser (chrome/firefox) WASM package](https://www.npmjs.com/package/@emurgo/cardano-serialization-lib-browser)
- [Browser (pure JS - no WASM) ASM.js package](https://www.npmjs.com/package/@emurgo/cardano-serialization-lib-asmjs)

##### NPM packages with GC support
Note: This package uses [weak references flag from wasm-bindgen](https://rustwasm.github.io/wasm-bindgen/reference/weak-references.html).
It uses `FinalizationRegistry` under the hood to automatically call "free" for each CSL struct when it is no longer needed. However, use this feature with caution as it may have unpredictable behaviors.
- [NodeJS WASM package with GC](https://www.npmjs.com/package/@emurgo/cardano-serialization-lib-nodejs-gc)
- [Browser (chrome/firefox) WASM package with GC](https://www.npmjs.com/package/@emurgo/cardano-serialization-lib-browser-gc)
- [Browser (pure JS - no WASM) ASM.js package with GC](https://www.npmjs.com/package/@emurgo/cardano-serialization-lib-asmjs-gc)


##### Rust crates

- [cardano-serialization-lib](https://crates.io/crates/cardano-serialization-lib)
Expand Down
2 changes: 1 addition & 1 deletion build-and-test.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
. test.sh && npm run rust:build-nodejs
. test.sh && npm run rust:build-nodejs
50 changes: 50 additions & 0 deletions doc/getting-started/generating-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,53 @@ const transaction = CardanoWasm.Transaction.new(
## A note on fees

Fees is Cardano Shelley are based directly on the size of the final encoded transaction. It is important to note that a transaction created by this library potentially can vary in size compared to one built with other tools. This is because transactions, as well as other Cardano Shelley structures, are encoded using [CBOR](https://cbor.io/) a binary JSON-like encoding. Due to arrays and maps allowing both definite or indefinite length encoding in the encoded transaction created by the library, the size can vary. This is because definite encoding consists of a tag containing the size of the array/map which can be 1 or more bytes long depending on the number of elements the size of the encoded structure, while indefinite length encoding consists of a 1 byte starting tag and after all elements are listed, a 1 byte ending tag. These variances should should only be a couple bytes and cardano-serialization-lib uses definite encoding which is the same length or smaller for any reasonable sized transaction.

## UTxO Selection

The `TransactionBuilder` struct allows you to manually enter inputs and outputs to create a valid transaction, of course, this means that you'll have to calculate things such as fees, change outputs, and perform UTxO selection on the inputs yourself.

The `TransactionBuilder` struct has some exposed APIs that may be helpful in performing these actions. Namely the `builder.add_inputs_from_and_change` function. The function first looks at the outputs that already exists in the `builder`, then attempts to balance the transaction using `inputs` that are given in the arguments of the function. The function will set `inputs`, `outputs` and `fees` in the `builder`.

The reason why all 3 have to be set within a single function, is because unfortunately, they all affect each other. Performing UTxO selection on some given `outputs` may result in some extra `change output`, which maybe increase the `fees` needed, which in turn, may change the `inputs` required, thereby changing what's required in the `change output`, and so on.

Further complications arise due to the `minimum UTxO value` requirements on the Cardano network, which is tied to the size of the output. Tokens significantly increase the size of each output, and so any inputs with tokens complicates UTxO selection somewhat.

`builder.add_inputs_from_and_change` should correctly perform UTxO selection, add these into the `builder.inputs`, add one extra output for `change`, and set the `builder.fee`.

## Example Code
Here is a quick example of how it might be used

```javascript
const txBuilder = wasm.TransactionBuilder.new(
wasm.TransactionBuilderConfigBuilder.new()
.fee_algo(wasm.LinearFee.new(wasm.BigNum.from_str('44'), wasm.BigNum.from_str('155381')))
.coins_per_utxo_word(wasm.BigNum.from_str('34482'))
.pool_deposit(wasm.BigNum.from_str('500000000'))
.key_deposit(wasm.BigNum.from_str('2000000'))
.ex_unit_prices(
wasm.ExUnitPrices.new(
wasm.UnitInterval.new(wasm.BigNum.from_str('577'), wasm.BigNum.from_str('10000')),
wasm.UnitInterval.new(wasm.BigNum.from_str('721'), wasm.BigNum.from_str('10000000')),
),
)
.max_value_size(5000)
.max_tx_size(16384)
.build(),
)
const utxos = [
"82825820731224c9d2bc3528578009fec9f9e34a67110aca2bd4dde0f050845a2daf660d0082583900436075347d6a452eba4289ae345a8eb15e73eb80979a7e817d988fc56c8e2cfd5a9478355fa1d60759f93751237af3299d7faa947023e493821a001deabfa1581c9a5e0d55cdf4ce4e19c8acbff7b4dafc890af67a594a4c46d7dd1c0fa14001",
"82825820a04996d5ef87fdece0c74625f02ee5c1497a06e0e476c5095a6b0626b295074a00825839001772f234940519e71318bb9c5c8ad6eacfe8fd91a509050624e3855e6c8e2cfd5a9478355fa1d60759f93751237af3299d7faa947023e4931a0016e360"
]
const output = wasm.TransactionOutput.new(wasm.Address.from_bech32("addr_test1qppkqaf5044y2t46g2y6udz636c4uultszte5l5p0kvgl3tv3ck06k550q64lgwkqavljd63yda0x2va074fguprujfsjre4xh"), wasm.Value.new(wasm.BigNum.from_str("969750")))
txBuilder.add_output(output)

const wasmUtxos = wasm.TransactionUnspentOutputs.new();
for (let i = 0; i < utxos.length; i++) {
wasmUtxos.add(wasm.TransactionUnspentOutput.from_hex(utxos[i]));
}
const wasmChangeConfig = wasm.ChangeConfig.new(wasm.Address.from_bech32("addr_test1qqzf7fhgm0gf370ngxgpskg5c3kgp2g0u4ltxlrmsvumaztv3ck06k550q64lgwkqavljd63yda0x2va074fguprujfs43mc83"))

txBuilder.add_inputs_from_and_change(wasmUtxos, wasm.CoinSelectionStrategyCIP2.LargestFirstMultiAsset, wasmChangeConfig)

const transaction = txBuilder.build_tx()
```
Loading
Loading