Giter VIP home page Giter VIP logo

cardano-multiplatform-lib's People

Contributors

alanverbner avatar alessandrokonrad avatar ashisherc avatar bravo-kernel avatar dependabot-preview[bot] avatar dependabot[bot] avatar dractw avatar ecioppettini avatar fell-x27 avatar gclaramunt avatar gostkin avatar joacohoyos avatar katomm avatar microproofs avatar mitchturner avatar nhaga avatar nicolasdp avatar oskin1 avatar rooooooooob avatar rvcas avatar sebastiengllmt avatar siegfried avatar stackchain avatar tenstrings avatar v-almonacid avatar vsubhuman avatar ypopovych avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cardano-multiplatform-lib's Issues

Cannot decode block CBOR I get from Oura

I got the CBOR from some blocks using Oura from TXPipe and I am trying to decode them like this:

import { Block } from '@dcspark/cardano-multiplatform-lib-nodejs';

const fileContent = fs.readFileSync('dummy-cbor4.txt');
const cborHex = fileContent.toString();
const cborBuffer = Buffer.from(cborHex, 'hex');
const block = Block.from_bytes(cborBuffer);

but this leads me to the following error

Error: the string "Deserialization failed in Block because: Definite length mismatch: found 2" was thrown, throw an Error :)

Below is a link for the file with the HEX content from the CBOR (it would be just too big to add the text here, but I can do it like this if you prefer):
https://drive.google.com/file/d/1rtLUA7DaiwfnKmj7i984GVtdJQFS0xH6/view?usp=sharing

I don't know if this CBOR is actually 100% valid, but I could manually parse it by following the Alonzo schema.

Minting NFT error "missing input or output (possibly some native asset)"

I am trying to mint an asset like this.

  let nativeScripts = WASM.NativeScripts.new();
  const scriptPubKey = WASM.NativeScript.new_script_pubkey(
    WASM.ScriptPubkey.new(pkh)
  );
  nativeScripts.add(scriptPubKey);

  const timelock = WASM.TimelockExpiry.new(
    WASM.BigNum.from_str(policyTtl.toString())
  );
  const timelockScript = WASM.NativeScript.new_timelock_expiry(timelock);
  nativeScripts.add(timelockScript);

  const nativeScript = WASM.NativeScript.new_script_all(
    WASM.ScriptAll.new(nativeScripts)
  );

  const policyId = Buffer.from(nativeScript.hash(0).to_bytes()).toString('hex');

  let multiAsset = WASM.MultiAsset.new();
  let assets = WASM.Assets.new();
  assets.insert(
    WASM.AssetName.new(Buffer.from('NFT', 'utf-8')),
    WASM.BigNum.from_str('1')
  );
  multiAsset.insert(
    WASM.ScriptHash.from_bytes(Buffer.from(policyId, 'hex')),
    assets
  );

  const utxos = await getUtxos(walletConnection);
  utxos.forEach((utxo) => {
    txBuilder.add_input(utxo);
  });

  txBuilder.add_output(
    WASM.TransactionOutputBuilder.new()
      .with_address(shelleyOutputAddress)
      .next()
      .with_asset_and_min_required_coin(
        multiAsset,
        WASM.BigNum.from_str(pps.coinsPerUtxoWord.toString())
      )
      .build()
  );

  const signedTxBuilder = txBuilder.build(0, shelleyChangeAddress);

This fails when i reach txBuilder.build() and returns the following error

missing input or output (possibly some native asset)

But when i switch the amount of asset i am sending to 0

  assets.insert(
    WASM.AssetName.new(Buffer.from('NFT', 'utf-8')),
    WASM.BigNum.from_str('0')
  );

the transaction is submitted successfully. It doesn't really help though because I am sending 0 asset if i do this.

Inline network constants?

Cardano has two kinds of constants:

  • Constants in the genesis blocks of the various epochs that can't be changed
  • Protocol parameters in the genesis blocks of the various epochs that can be changed mid-epoch

We may want to provide some of these constants as part of CML. Getting the cost model externally is kind of tedious, but at the same time providing it as part of CML is dangerous because its value could change.

I'm not particularly convinced about inlining them, but I did notice that CSL did go with this approach: Emurgo/cardano-serialization-lib#458

Expose address enum to Rust lib

Right now AddrType is private. It would be good if it was public, but we can't easily make it public now because it wouldn't be compatible with WASM compilation. Probably to properly implement this we'll need a Rust-native version of the address classes and have the WASM code just be a wrapper for it.

Once we do this, it would be good to also fixup redeem_pubkey_to_txid and non_avvm_balances

Coin selection - change output min ada

During the coin selection process it is crucial to create the change output and calculate it's min ada every time you add an input. This min ada needs to be added to the target ada in the coin selection.

Example of a broken case:

Let's say you pick a utxo with 30 ada + 150 NFTs, the current algorithm thinks: great! 30 ada! My target was 10 ada, I have triple: I am done here. And the tx breaks when building the change output.

CTL does that correctly lines 240:249 of :
https://github.com/Plutonomicon/cardano-transaction-lib/blob/develop/src/Internal/BalanceTx/BalanceTx.purs

CML would need to implement something similar so that it doesn't break on the example I explained at the beginning. A test could easily be added to ensure the fix works. That would be during the CIP-2 (ish) implementations, after you get all your Assets and during the loop that gathers Ada.

Fix compatibility with Pallas TxOut

The Pallas code for generating a TxOut can be found here: https://github.com/txpipe/pallas/blob/187245a62f071d92de26d55f01df881fa993a97b/pallas-primitives/src/byron/model.rs#L210

This is an example of a TxOut cbor generated by Pallas

8282d818584283581ccde9e14edd1bef88f693d98ac1a8362e322cde8dbfa0585e8cfad0baa101581e581c40ac845ff7ff8674f52c136eba28aafa85563db9755292bf3cae9c12001a5e68a4c51b00000098360f4780

However, parsing this with CML using

TransactionOutput::from_bytes(
    hex::decode(hash).unwrap()
).unwrap();

gives DeserializeError { location: Some("TransactionOutput.address")

If you look at cbor.me

This is what Pallas gives
image

This is what CML gives
image

I think that actually our output is wrong because we should be using the raw_with_crc32 for Byron addresses ๐Ÿค”

I don't know why this parsing error only happens as part of parsing a TransactionOutput while parsing the address itself works fine

Value derives Ord but implements PartialOrd

We rely on the automatically generated Ord implementation for Value in a few places. However, this auto-generated implementation is wrong because Values are not total which is why we had to implement PartialOrd for it. We need to fix this because it could cause subtle issues.

The same thing applies to MultiAsset

Make filling in dummy redeemers a standalone step in the tx builder

Right now we have set_exunits as a function on the tx builder that is used in combination with setting dummy exunits in inputs & a fake data script hash in the tx body

It may be more intuitive to make filling in these exunits a standalone step in the tx builder as it allows to:

  1. Remove the dummy exunits from the input (and just not allow explicitly setting exunits)
  2. Give a better in-context name for the function that gives you a tx body for exunit calculation purposes

Maybe there is a reason not to do this that I'm missing though

Plutus script addresses generated from cborhex by cardano-cli and the serialization lib do not match.

Apparently due to a bug or not supporting fee estimation inside cardano serialization library, Addresses generated from Cbor hex of Plutus Script is quit different than actual address that comes from cardano-cli.
It is an open issue on Emergo cardano serialization library for near a year and no fix for it Issue#233, But Alessandro from Nami has a patch for that.
I wonder will there be a fix for this problem or is there any other way to produce correct address by DcSpark library?

Below code is an example to reproduce the bug

// cborhex of the alwayssucceeds.plutus
const cborhex = "4E4D01000033222220051200120011";
const cbor = Buffer.from(cborhex, "hex");
const blake2bhash = blake.blake2b(cbor, 0, 28); //blake2b-224 -> 28 bytes
const scripthash = ScriptHash.from_bytes(blake2bhash);
const cred = StakeCredential.from_scripthash(scripthash);
const networkId = NetworkInfo.testnet().network_id();
const baseAddr = EnterpriseAddress.new(networkId, cred);
const addr = baseAddr.to_address();
const addrBech32 = addr.to_bech32();

// hash of the address generated from script
console.log(Buffer.from(addr.to_bytes(), "utf8").toString("hex"))

// hash of the address generated using cardano-cli
const ScriptAddress = Address.from_bech32("addr_test1wpnlxv2xv9a9ucvnvzqakwepzl9ltx7jzgm53av2e9ncv4sysemm8");
console.log(Buffer.from(ScriptAddress.to_bytes(), "utf8").toString("hex"))

And the hex outputs are:
geneated from cborhex: 70d4e0f6e402a19e086f2fb9914124604ece088db0fa5906fb0f66fc07
generated by cardano-cli: 7067f33146617a5e61936081db3b2117cbf59bd2123748f58ac9678656

The corresponding bech32 addresses are:
geneated from cborhex: addr_test1wpnlxv2xv9a9ucvnvzqakwepzl9ltx7jzgm53av2e9ncv4sysemm8
generated by cardano-cli: addr_test1wr2wpahyq2seuzr097uezsfyvp8vuzydkra9jphmpan0cpczfflxx

The blake package is npm install blakejs

Auto-calculate total_collateral in tx_builder

Right now we don't automatically set total_collateral for the user, but we should be able to do this.

This gets kind of tricky because it somewhat overlaps with the change calculation function logic. In fact, the Berry fork of this library extracts some common logic out and changes how the change calculation logic works to make this possible (see update_collateral_and_balance). We may want to do something similar

Advice for depending on the CML starting tomorrow

I've stared at this repo for a while now, and I think I've just about got the gist of what belongs to the "old" and to the "new" versions of CML.

If I were to start a project tomorrow depending on the CML, would you advise depending on ./rust and migrating in due time,
or going straight to using the new crates?
I appreciate the answer is likely "ummm. Depends on your use case" and it more an invitation to any signposting on:

  • what the architecture roadmap is
  • something akin to ADRs that motivated these
  • how painful a migration would be

This would be super helpful.

I spoke a little to txpipe people, trying to ascertain a comparison between aspects of pallas and CML,
and whether that would be a more stable dependency for a project-starting-tomorrow.

Many thanks


This Q is an abuse of the gh issues, and you may close it as you see fit - no hard feelings.

ScriptSchema::Node format not supported

utils::encode_json_str_to_native_script() does not support ScriptSchema::Node (), only ScriptSchema::Wallet.

The current behavior panics if ScriptSchema::Node is passed in which is not ideal either.

The function's documentation contains a link which details the JSON format that would be required to be implemented.

Serializing Plutus `Nothing` and `Just` Maybe values.

I am trying to utilize a contract that uses a Plutus Maybe in the Datum.

I am trying to serialize Nothing using the cardano-multiplatform-lib, when this is done in Haskell the cborHex output is "\128".

Is there any way currently to accomplish this?

Regenerate off of `babbage.cddl`

Context

We are refactoring away from a single rust with wasm_bindgen taggings directly, over to a dedicated rust crate(s) and a separate wasm bindings crate, which should vastly improve usability from rust as we don't need to conform to the limitations of wasm_bindgen. While this is happening we will take advantage of improvements to cddl-codegen to introduce CBOR encoding tracking.

We need to generate the code again using the latest version of cddl-codegen which supports both of these (split architecture + CBOR encodings) on the latest babbage.cddl. This should give us a base to start with for the refactor.

Cleaning up generated code

Context

We are refactoring away from a single rust with wasm_bindgen taggings directly, over to a dedicated rust crate(s) and a separate wasm bindings crate, which should vastly improve usability from rust as we don't need to conform to the limitations of wasm_bindgen. While this is happening we will take advantage of improvements to cddl-codegen to introduce CBOR encoding tracking.

Not all the code generated from /specs/babbage/'s CDDL files is directly usable. Some things have a very awkward generated API or had pieces removed to help with generation. These structs will need to be hand-edited.

react-native asm.js Value undefined out of range for undefined options property undefined

Is ASM.JS version supported on react-native? Importing any module gives the following error using Hermes or JSC engine:

import {Address} from '@dcspark/cardano-multiplatform-lib-asmjs/cardano_multiplatform_lib.js';

console.log('Address', Address);
error: node_modules/@dcspark/cardano-multiplatform-lib-asmjs/cardano_multiplatform_lib.asm.js: Value undefined out of range for undefined options property undefined

I can confirm it works perfectly in a browser environment: https://codesandbox.io/s/festive-shadow-9putrt?file=/src/index.js

Many thanks!

Consider changing witness types from hash to btree

Currently, in the witness builder we use HashSet. However, we've been told btrees may be easier to use

For instance I generate a tx with the tx builder. Then I take the witness set and merge it with a new one where I only added vkeys. But the order of redeemers and datums could be different now and so it would change the script data hash.
I realised it could make more sense to order Datums and redeemers in the function where I calculate the hash

to_json crash on `MIRToStakeCredentials`

Any transaction that contains a MIR certificate crashes when calling to_json. This may be caused by our good old friend linked_hash_map

Crash log:

Err` value: JsError { msg: "to_json: key must be a string" }

Steps to reproduce

#[test]
    fn foo_bar() {
        let mut cred = MIRToStakeCredentials::new();
        cred.insert(
        &StakeCredential::from_keyhash(
            &Ed25519KeyHash::from_bytes(
                hex::decode("b861eeadde300385d88aaa98cad0f0ed1f95419bbb9971a0fb7c96fb").unwrap()
            ).unwrap()
        ),
        &Int::from_str("5").unwrap()
        );
        println!("{}", cred.to_json().unwrap());
    }

PlutusData JSON conversion may fail when embedded in larger structure

PlutusData may appear in:

  • Witness
  • Redeemer
  • Inline datum

In each of these places, it may cause to_json on a transaction object to fail due to to_js_value: key must be a string as there is no guarantee a CBOR structure can be converted to JSON (same problem we had with metadata)

Here is a transaction you can try on

{
        block: {
          height: 7490347,
          hash: '7b6a6ce7804d67ec7486c8289c75e87807acdc82f5f0d9ad9d1ceff65727c938',
          epoch: 350,
          slot: 66091846,
          era: 4,
          indexInBlock: 4,
          isValid: true,
        },
        transaction: {
          hash: 'e3fb14ad8f0a243262ecfc6bd4330f5e462747d30b85017df6baf6964d21ba9b',
          payload:
            '84a80082825820026e36057852366c7942210185789d56156bd9b4844794bc3bf1fedcc819c95300825820de0e35e1e93dc3d3300c39faf6e7520884cd43a63a570fa5aeedf7c25446b21400018682583901340ebc5a2d7fdd5ad61c9461ab83a04631a1a2dd2e53dc672b57e309bc5acf6c6b031be26da4804068f5852b4f119e246d907066627a9f5f1a000f42408258390170e60f3b5ea7153e0acc7a803e4401d44b8ed1bae1c7baaad1a62a721e78aae7c90cc36d624f7b3bb6d86b52696dc84e490f343eba89005f1a000f42408258390135333ecdf7b797c40e9ec057e9a57cda4aecc6a276602306cff9048b0c785a1269d7a0b77c8ba75fe1f946eb0de65c87d40c98b9441d48071a002dc6c08258390129712990f313a18442cfb4f75ec3709ba48716867395a701a321849e31c0475de2b3cbf6c95d2ba3798b13a10ba341d1b1651c02209d3cf2821a00172698a1581c9cc83ea54377108dd022f18095040e8d5808a3061c4fe54f3fd64a7aa15048616c6c6f7765656e41706536343931018258390129712990f313a18442cfb4f75ec3709ba48716867395a701a321849e31c0475de2b3cbf6c95d2ba3798b13a10ba341d1b1651c02209d3cf21a004c4b408258390129712990f313a18442cfb4f75ec3709ba48716867395a701a321849e31c0475de2b3cbf6c95d2ba3798b13a10ba341d1b1651c02209d3cf21a0043cb10021a000ba85c031a03f08920081a03f07b100b58208a873720c096558983fd6bdb6f14de28729fda7a8eaf429307db9346cb3b6ee00d81825820de0e35e1e93dc3d3300c39faf6e7520884cd43a63a570fa5aeedf7c25446b214000e81581c29712990f313a18442cfb4f75ec3709ba48716867395a701a321849ea40081825820099b9d5dde518558e006b46d1a8d26b3f6b83b286be8ed0dc68919133ddad8235840861e29c1c4e4c7083f3270d9ef5005d5192ae7100aead45a799d2552c91fbdfc1a22c46748107388a06d9bfcee3636dd310295359de5eee92fa2c4c8f12fc8040381590fc1590fbe0100003233223232323322333222323233322232333222323332223322323322323332223232332233223232332232323332223322332233223322323232323232323232323232332232323232323232323322323232332232333322223232323232322232232325335305c33223530310012235303500222222222322235304400c23232325335306f333222533530723300300200110731074506e32353047001220023253353505a00113507649010350543800221002302e5002004107115335304a01313301b49101350033355029302f1200123535505e00122323355030335502d30331200123535506200122353550640012253353506f335503533550250490040062153353507033550363335550323039120012235355069002232233225335350770022130020011507800425335350763335502c0500040072153353080013304d0010031335503d5079300400215335308001330630010031335503d507933335502e0510053304900100300215078150773200135508601225335350680011506a2213535506e002225335308201330530020071003133506d33550710020013006003350720010022133026491023130003322333573466e200080041f41f8cc8cd54c0ec48004d40c00048004cd40c40952000335530321200123535506900122001001004133573892010231310007a133573892010231320007900233233553023120013503500135034001335038223355302c120012353550630012233550660023355302f12001235355066001223355069002333535502b0012330264800000488cc09c0080048cc09800520000013355302c1200123535506300122335506600233353550280012335530301200123535506700122335506a00235502f0010012233355502804a0020012335530301200123535506700122335506a00235502d001001333555023045002001505e33233553023120012253353506c3003002213350610010021001505f2353053001222533530763332001504100600313506f0021506e011320013333555028302f1200122353055002225335307333044002500b10031333355502c303312001235305a00122253353506e333550245042003001213333550265043004335530301200123535506700122335506a002333535502c0012001223535506b002223535506d0032233550703302c00400233553039120012353550700012233550730023335355035001200122330310020012001333555030052003001200133355502704900300100213333550255042003002001003001505b500113301b49101340033355029302f1200123530540012233043500a00250011533535058335530401200123320015051320013530460012235305100122253353506b0012321300100d3200135507f2253353506100113507d491022d310022135355067002225335307b3304c00200710011300600313507a49101370050011350744901013600221335530421200123320015053320013530480012235305300122253353506d0012321300100f32001355081012253353506300113507f491022d310022135355069002225335307d3304e00200710011300600313507c4910137005003133355301d12001225335306f335306a303e302d35304600222001207125335307033041001300401010721350764901013300133505a0020011001505900d3200135507622533535058001135074491022d31002213530470022253353072333200150710020071353063303000122335306f00223507b491022d310020011300600315335350520011306d4988854cd4d41500044008884c1c5263333573466e1d40112002203a23333573466e1d40152000203a23263530663357380b80ce0ca0c80c66666ae68cdc39aab9d5002480008cc0c4c8c8c8c8c8c8c8c8c8c8c8cccd5cd19b8735573aa01490001199999999981f99a828919191999ab9a3370e6aae7540092000233045304b35742a00460986ae84d5d1280111931a983a99ab9c06b076074073135573ca00226ea8004d5d0a80519a8288241aba1500935742a0106ae85401cd5d0a8031aba1500535742a00866a0a2eb8d5d0a80199a82899aa82b3ae200135742a0046ae84d5d1280111931a983899ab9c06707207006f135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135573ca00226ea8004d5d0a80119191999ab9a3370e6aae75400520022303a303e357426aae7940088c98d4c1a0cd5ce02f03483383309baa001357426ae8940088c98d4c194cd5ce02d833032031883289931a983219ab9c49010350543500065063135573ca00226ea80044d55ce9baa001223370000400244a66a60ac00220b0266ae7000815c4488c88c008004c8004d5417c894cd4d41040045413c884d4d5411c008894cd4c16ccc02000801c4d41500044c01800c448888c8cd54c03c480048d4d5411800488cd54124008ccd4d5402c0048004880048004ccd554018014008004c8cd40054109410c488cc008cd5411c014010004444888ccd54c0104800540fccd54c030480048d4d5410c00488cd54118008d5402c004ccd54c0104800488d4d54110008894cd4c160ccd54c06048004d4034cd403c894cd4c168008417040041648d4d5411c00488cc028008014018400c4cd410c01000d4100004cd54c030480048d4d5410c00488c8cd5411c00cc004014c8004d54184894cd4d410c0044d5402c00c884d4d54124008894cd4c174cc0300080204cd5404001c0044c01800c008c8004d5416888448894cd4d40fc0044008884cc014008ccd54c01c480040140100044484888c00c01044884888cc0080140104484888c00401044800448cd404888ccd4d401000c88008008004d4d40080048800448848cc00400c00848004c8004d541488844894cd4d40d8004540e0884cd40e4c010008cd54c018480040100044448888cccd54011403c00c0040084488cd54008c8cd403c88ccd4d401800c88008008004d4d401000488004cd401005012800448848cc00400c008480044488c0080048d4c08c00488800cc8004d5412c88c8c94cd4c114cc0a14009200213300c300433530081200150010033004335300d12001500100310031332233706004002a002900209999aa9801890009919a80511199a8040018008011a802800a8039119b800014800800520003200135504a221122253353502f00113500600322133350090053004002333553007120010050040011235350050012200112353500400122002320013550472212253353041333573466e2400920000430421502d153353502b0011502d22133502e002335300612001337020089001000899a801111180198010009000891091980080180109000990009aa821911299a9a81300108009109a980a801111a982180111299a9a8160038a99a9a8160038804110b1109a980d801111a982480111299a9824199ab9a33720010004094092266a0660186601e01601a2a66a6090666ae68cdc8804001024825099a819803198078070028a99a982419809003800899a81980619807805806899a81980319807807002990009aa82111091299a9a8130008a814110a99a981f19804002240002006266a600c240026600e00890010009119b8100200122333573466e240080040e80e4488cc00ccc01cc018008c018004cc894cd4d40c0008854cd4d40c400884cd4c0b80088cd4c0bc0088cc034008004888100888cd4c0c401081008894cd4c104ccd5cd19b87006003043042153353041333573466e1c01400810c1084cc0380100044108410840ec54cd4d40c0004840ec40ecc014008c014004894cd4c0d8008400440dc88ccd5cd19b8700200103703623530240012200123530230012200222335302d0022335302e00223300500200120352335302e002203523300500200122333573466e3c0080040cc0c8c8004d540e08844894cd4d407000454078884cd407cc010008cd54c018480040100048848cc00400c0088004888888888848cccccccccc00402c02802402001c01801401000c00880048848cc00400c0088004848c004008800448800848800480048c8c8cccd5cd19b8735573aa004900011981519191999ab9a3370e6aae75400520002375c6ae84d55cf280111931a981899ab9c02703203002f137540026ae854008dd69aba135744a004464c6a605c66ae700900bc0b40b04d55cf280089baa00123232323333573466e1cd55cea801a4000466600e602c6ae85400cccd5403dd719aa807bae75a6ae854008cd4071d71aba135744a004464c6a605c66ae700900bc0b40b04d5d1280089aab9e5001137540024442466600200800600440022464646666ae68cdc39aab9d5002480008cc88cc024008004dd71aba1500233500a232323333573466e1cd55cea80124000466446601e004002602c6ae854008ccd5403dd719aa809919299a981419805a800a40022a00226a05c921022d33001375a00266aa01eeb88c94cd4c0a0cc02d400520001500113502e491022d32001375a0026ae84d5d1280111931a981719ab9c02402f02d02c135573ca00226ea8004d5d09aba25002232635302a33573804005605205026aae7940044dd500091199ab9a33712004002040042442466002006004400244246600200600440022464460046eb0004c8004d5408c88cccd55cf80092804119a80398021aba1002300335744004048224464460046eac004c8004d5408c88c8cccd55cf80112804919a80419aa80618031aab9d5002300535573ca00460086ae8800c0944d5d0800889100109109119800802001890008891119191999ab9a3370e6aae754009200023355008300635742a004600a6ae84d5d1280111931a981099ab9c01702202001f135573ca00226ea8004448848cc00400c0084480048c8c8cccd5cd19b8735573aa004900011980318071aba1500233500a2323232323333573466e1d40052002233300e375a6ae854010dd69aba15003375a6ae84d5d1280191999ab9a3370ea004900011808180a9aba135573ca00c464c6a604666ae700640900880840804d55cea80189aba25001135573ca00226ea8004d5d09aba25002232635301c33573802403a03603426aae7940044dd5000910919800801801100090911801001911091199800802802001900089119191999ab9a3370ea002900011a80418029aba135573ca00646666ae68cdc3a801240044a010464c6a603066ae7003806405c0580544d55cea80089baa001121223002003112200112001232323333573466e1d4005200223006375c6ae84d55cf280191999ab9a3370ea0049000118041bae357426aae7940108c98d4c04ccd5ce00480a00900880809aab9d50011375400242446004006424460020064002921035054310012253353003333573466e3cd4c01800888008d4c018004880080140104ccd5cd19b873530060022200135300600122001005004100412200212200120012212330010030022001235002490101310012326353003335738002008004930900090008891918008009119801980100100081049fd8799f581c35333ecdf7b797c40e9ec057e9a57cda4aecc6a276602306cff9048b9fd8799fd8799fd8799f581c340ebc5a2d7fdd5ad61c9461ab83a04631a1a2dd2e53dc672b57e309ffd8799fd8799fd8799f581cbc5acf6c6b031be26da4804068f5852b4f119e246d907066627a9f5fffffffffa140d8799f00a1401a000f4240ffffd8799fd8799fd8799f581c70e60f3b5ea7153e0acc7a803e4401d44b8ed1bae1c7baaad1a62a72ffd8799fd8799fd8799f581c1e78aae7c90cc36d624f7b3bb6d86b52696dc84e490f343eba89005fffffffffa140d8799f00a1401a000f4240ffffd8799fd8799fd8799f581c35333ecdf7b797c40e9ec057e9a57cda4aecc6a276602306cff9048bffd8799fd8799fd8799f581c0c785a1269d7a0b77c8ba75fe1f946eb0de65c87d40c98b9441d4807ffffffffa140d8799f00a1401a002dc6c0ffffffffff0581840000d87a80821a0042a9fd1a5cc74559f5f6',
        },
      },

Regenerate off modified byron.cddl

Here is my modified byron.cddl

; Cardano Byron blockchain CBOR schema

block = [0, eb_block] ; @name ebb_wrapper
      / [1, main_block] ; @name main_block_wrapper

main_block = [ "header" : block_header
            , "body" : block_body
            , "extra" : [attributes]
            ]

eb_block = [ "header" : ebb_head
          , "body" : [+ stakeholder_id]
          , extra : [attributes]
          ]

u8 = uint .lt 256
u16 = uint .lt 65536
u32 = uint .size 4
u64 = uint .size 8

; Basic Cardano Types

blake2b_256 = bytes .size 32

txid = blake2b_256
block_id = blake2b_256
update_id = blake2b_256

blake2b_224 = bytes .size 28

address_id = blake2b_224
stakeholder_id = blake2b_224

epoch_id = u64
slot_id = [ epoch: epoch_id, slot : u64 ]

pub_key = bytes
signature = bytes

; Addresses

single_key_distr = (0, stakeholder_id)
; TODO: what is uint here?
bootstrap_era_distr = (1, uint)

stake_distribution =
  [  bootstrap_era_distr
  // single_key_distr
  ]

public_edd25519_bip32 = bytes .size 64
script = bytes .size 32
public_ed25519 = bytes .size 32

spending_data_pub_key_ASD = (0, public_edd25519_bip32)
spending_data_script_ASD = (1, script)
spending_data_redeem_ASD = (2, public_ed25519)

spendingData = [
     spending_data_pub_key_ASD
  // spending_data_script_ASD
  // spending_data_redeem_ASD
]

addrType = 0 ; Public Key
         / 1 ; Script
         / 2 ; Redeem

addr_attributes = {
             ? 0 : bytes .cbor stake_distribution ; @name stake_distribution - no value -> BootstrapEraDistr
           , ? 1 : bytes .cbor hd_address_payload ; @name hd_address_payload - strictly speaking, this may contain anything
           , ? 2 : bytes .cbor protocol_magic     ; @name protocol_magic
           }

address_content = [ address_id
                  , addr_attributes
                  , addrType
                  ]

crc32 = u32
address = [ #6.24(bytes .cbor address_content) ; @name address_content
          , crc32
          ]

; Transactions

; Attributes - at the moment we do not bother deserialising these, since they
; don't contain anything
attributes = {* any => any}

tx_output_pointer = [ txid
                    , u32 ; @name index
                    ]

tx_in_regular = [ 0
                , #6.24(bytes .cbor (tx_output_pointer))
                ]
; TODO: better type
tx_in_genesis = [ u8 .ne 0
                , encoded-cbor
                ]
tx_in = tx_in_regular / tx_in_genesis
tx_out = [ address
         , u64 ; @name amount
         ]

tx = [ [+ tx_in] ; @name inputs
     , [+ tx_out] ; @name outputs
     , attributes
]

tx_proof = [ u32 ; @name number - number of transactions in this tree
           , blake2b_256 ; @name root - root of the merkle tree of transactions
           , blake2b_256 ; @name witnesses_hash - hash of Sequence of TxWitnesses encoded in CBOR
           ]

pk_witness_entry = [pub_key, signature]
; TODO: what are these types? I think they were never used in mainnet
validator_script = [ u16
                   , bytes
                   ]
; TODO: what are these types? I think they were never used in mainnet
redeemer_script = [ u16
                  , bytes
                  ]
script_witness_entry = [validator_script, redeemer_script]
redeemer_witness_entry = [pub_key, signature]
tx_witness = [0, #6.24(bytes .cbor (pk_witness_entry))] ; @name pk_witness
     / [1, #6.24(bytes .cbor (script_witness_entry))] ; @name script_witness
     / [2, #6.24(bytes .cbor (redeemer_witness_entry))] ; @name redeem_witness

; MPC: Shared Seed Computation (ssc) - Verifiable Secret Sharing (vss)

; This is encoded using the 'Binary' instance for Scrape.PublicKey
; https://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:PublicKey
; stakeholder ids correspond to 'vcSigningKey's of associated certs
; no two certs have the same 'vcVssKey'
vss_pub_key = bytes

; This is encoded using the 'Binary' instance for Scrape.Secret.
; http://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:Secret
vsssec = bytes

; This is encoded using the 'Binary' instance for Scrape.EncryptedSi.
; http://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:EncryptedSi
; TODO work out why this seems to be in a length 1 array
vss_encrypted_share = [bytes]

; This is encoded using the 'Binary' instance for Scrape.DecryptedShare
; https://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:DecryptedShare
vss_decrypted_share = bytes

; This is encoded using the 'Binary' instance for Scrape.Proof
; http://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:ExtraGen
; http://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:Proof
; http://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:ParallelProofs
; http://hackage.haskell.org/package/pvss-0.2.0/docs/Crypto-SCRAPE.html#t:Commitment
vss_proof = [ bytes ; @name extra_gen
            , bytes ; @name proof
            , bytes ; @name parallel_proofs
            , [* bytes] ; @name commitments
            ]

vss_shares = {vss_pub_key => vss_encrypted_share}

ssc_commitment = [vss_shares, vss_proof]
ssc_signed_commitment = [ pub_key
                        , ssc_commitment
                        , signature
                        ]
ssc_signed_commitments = #6.258([* ssc_signed_commitment])

ssc_opens = {stakeholderid => vsssec}

; TODO: this is serialized as "serialize_fixed_map". Not sure if codegen does the same
ssc_shares_submap = [address_id, [* vss_decrypted_share]]
ssc_shares = {address_id => ssc_shares_submap}

ssc_cert = [vss_pub_key, pub_key, epoch_id, signature]
ssc_certs = #6.258([* ssc_cert])

ssc = [0, ssc_signed_commitments, ssc_certs] ; @name CommitmentsPayload
    / [1, ssc_opens, ssc_certs] ; @name OpeningsPayload
    / [2, ssc_shares, ssc_certs] ; @name SharesPayload
    / [3, ssc_certs] ; @name CertificatesPayload

ssc_proof = [0, blake2b_256, blake2b_256] ; @name commitments
          / [1, blake2b_256, blake2b_256] ; @name openings
          / [2, blake2b_256, blake2b_256] ; @name shares
          / [3, blake2b_256] ; @name certificates

; Delegation

delegation = [ epoch : epoch_id
             , issuer : pub_key
             , delegate : pub_key
             , certificate : signature
             ]

delegation_signature = [delegation, signature]

epoch_range = [epoch_id, epoch_id]
light_weight_dlg = [  epochRange : epoch_range
                    , issuer : pub_key
                    , delegate : pub_key
                    , certificate : signature
                   ]

light_weight_delegation_signature = [light_weight_dlg, signature]

; Updates

block_version = [
      u16 ; @name major
    , u16 ; @name minor
    , u8 ; @name alt
]

std_fee_policy = [ bigint ; @name summand
                 , bigint ; @name multiplier
                 ]
tx_fee_policy = [ 0
                , #6.24(bytes .cbor (std_fee_policy)) ; @name std_fee_policy
                ]

coin_portion = u64
soft_fork_rule = [ coin_portion ; @name init_threshold
                 , coin_portion ; @name min_threshold
                 , coin_portion ; @name threshold_decrement
                 ]
bvermod = [ scriptVersion : [? u16]
          , slotDuration : [? bigint]
          , maxBlockSize : [? bigint]
          , maxHeaderSize  : [? bigint]
          , maxTxSize : [? bigint]
          , maxProposalSize : [? bigint]
          , mpcThd : [? u64]
          , heavyDelThd : [? u64]
          , updateVoteThd : [? u64]
          , updateProposalThd : [? u64]
          , updateImplicit : [? u64]
          , softForkRule : [? soft_fork_rule]
          , txFeePolicy : [? tx_fee_policy]
          , unlockStakeEpoch : [? epoch_id]
          ]

update_data = [ blake2b_256 ; @name app_diff_hash
              , blake2b_256 ; @name pkg_hash
              , blake2b_256 ; @name updater_hash
              , blake2b_256 ; @name metadata_hash
              ]

software_version = [ text ; @name application_name
                   , u32 ; @name application_version
                   ]

update_proposal_data_entry = [ text ; @name system_tag
                             , update_data
                             ]

update_proposal = [ "blockVersion" : block_version
                  , "blockVersionMod" : bvermod
                  , "softwareVersion" : software_version
                  , "data" : #6.258(update_proposal_data_entry)
                  , "attributes" : attributes
                  , "from" : pub_key
                  , "signature" : signature
                  ]

update_vote = [ "voter" : pub_key
              , "proposalId" : update_id
              , "vote" : bool
              , "signature" : signature
              ]

update = [ "proposal" :  [? update_proposal]
         , votes : [* update_vote]
         ]

; Blocks

difficulty = [u64]

block_signature = [0, signature] ; @name Signature
         / [1, light_weight_delegation_signature] ; @name ProxyLight
         / [2, delegation_signature] ; @name ProxyHeavy

block_consensus_data = [slot_id, pub_key, difficulty, block_signature]

block_header_extra_data = [ "blockVersion" : block_version
                          , "softwareVersion" : software_version
                          , "attributes" : attributes
                          , "extraProof" : blake2b_256
                          ]

body_proof = [ "txProof" : tx_proof
             , "sscProof" : ssc_proof 
             , "dlgProof" : blake2b_256
             , "updProof" : blake2b_256
             ]

block_header = [ "protocol_magic" : u32
               , "prevBlock" : block_id
               , "bodyProof" : body_proof
               , "consensusData" : block_consensus_data
               , "extraData" : block_header_extra_data
               ]

tx_aux = [ tx
         , [* tx_witness] ; @name witness
         ]
tx_payload = [* tx_aux]
block_body = [ "txPayload" : tx_payload
            , "sscPayload" : ssc
            , "dlgPayload" : [* delegation]
            , "updPayload" : update
            ]

; Epoch Boundary Blocks

ebb_consensus_data = [ epoch_id, difficulty ]

ebb_head = [ "protocol_magic" : u32
          , "prevBlock" : block_id
          , "bodyProof" : blake2b_256
          , "consensusData" : ebb_consensus_data
          , "extraData" : [attributes]
          ]

Add is_valid function to Address

Hi! I've been having issues with the wasm-bindgen memory leak that happens when an error is thrown from rust and I got to this pr

https://github.com/input-output-hk/js-cardano-wasm/pull/84/files

Is it possible to add the same function to the Address class. Right now it's only implemented for ByronAddress. It would be good to have the same feature of validating all types of addresses with a single function

I don't have experience with rust. but I could make a try to make a pr. Would be useful to have some insights on what should I do.

I was thinking of adding something like this on src/address.rs but I'm not sure if it will fix the issue

    pub fn is_valid(bech_str: &str) => bool {
        match Self::from_bech32(bech_str) {
            Ok(v) => true,
            Err(err) => false,
        }
    }

Crash on PlutusDataEnum variant

thread '<unnamed>' panicked at 'DeserializeError { location: Some("TransactionWitnessSet.plutus_data.PlutusList.PlutusDataEnum.PlutusDataEnum"), failure: NoVariantMatched }

Block cbor

820585828f1a0036646f1a037e5eda5820e1ef53d961b282f380544071136b17992d63859d1ba92e02f25884161886c1f158209b30232b87e5568f4dd9848a0ea9d91fef54ba11bcd39121cef5e7e6e750f1575820fae4b8f31c676f58a039005d59ea1d2179a83ed2e1f0707b46c2f6c4401d72068258409aff3d1f146c458ad78362c7eda60e09b467ab96e156bc7a33fb22d0e084a57c11b847e5ce662290904068a521d58ed561803f48ca6ccc7ba496e91dcd8ee1065850fa41545a4abbb80d59198c87642f24509e41e86ade3e49e0aad6bd4cfa74fb6c8f3879b6b2fd9095b1b5330c45ed0920d63c3c8a41128d2b48325dbd708f08a5e08fd74918acbfe6d7169822cd21d80782584000216134f32705e1e5d7bf8f81a5d35ea525facc98b0c6c681dce076ff4f3c6a92ff33182c83b576f5e51cf5f969b3e7b016208b84c2e53944e4048289fb62e05850964f51d358a202607fc61999ce3f90538022b6c6c20620649b93d1e094364300eb565bde77b83d7f062ff3bec514a201d357f50bc856edfaaf6e87d604271d4589364b9797606a28d56eb17beecc100e19195c5820c4dcb7f265eb616f165a9a9f383d8c0c1170ee0629f3a64ebc425198886c1b0558209a90d51471fef8bc2d0959c2805886dc198954b8157d00117428a959325ec55e081901b958401ee49bb44464e13dea0e41b6899964940c5a090d74e320cf6382ce66d545bbb75cdf001e58bb53f8663bbffb9a2dd68f1e0cc1f4cc2a4f8d3d5009b408daf20806005901c0aabd2aec389df4c54db2f7139cc8b01f1875c40144c3f17061bcf98a833efbb6d64fb4f2a058ecaaab61a2e48454c9b7bf709360808ce3554c47d4af6e118503ede83764eb9961059e32d76777aec501ba24525afca393787ee1c1ec92efd669304930dd8330c3b3d5559f1bfad00d9506386f9a25d408ae39a8218c91ca00abad0699ab555d91beaf0d71db7b02e71483f9c6572434360b4ea6b7437ff7ab589a0f8507f49cc5570357656c28e3c4c777bd6a8d797623783710ecd592935030b21f7eaa9579b366b113500aadf6619e3307d1f1b26e3ee8f4badb10fd28ada482dca873639082ec192077f8bd552ab9a81f5ad8b2b0bbae8971bf66a614c73052c2184cb6664f9d27921b82d9d13a89f82d62fcc4c96cc2939e1cc3a37f0264341d7850932480c19531294af242cd5d7fdb92c856c73baf672eebcff2d5a3c851bd1eeb3ff675648aa8a3faf2fcaae4abc4a8e9f66594df816ca16e97a76adee94f48fce44ed277f61b5a713ddbc9ad81cf0310daf89127298fdaf99cca7303dcca2f0ea448d0b8f3f59f5fe80468198e0902a3d4686f334786c2f2f5b4d5d6aea0a9010c92c3160cec8b6178252ef9e3419269cffd536a57f3a95af71bd03f87a4008182582032979419239e27b95e1894f69bc978bd8a4a2a885e30447530795a444d9e51a3010182825839001adb6f5ae9610b8407e6181d9d23454591afef28a9bb6dd544661ae80db3289158eacbf45d16d822e2297b7d0da225f1fe6a299334eb19db1a001e8480825839009099de2ede4623f0436aef25b8dbcad88e15dea7b370008a4d2abd41d1f0119ac8c96199b78c7aad426159e5bc031fd32f5d52d8cd8ef21d1b000000015ffe2d97021a00029201031a037e5f12a300828258201124a0737314cf6aa38c4c4edaf5ea561c029618437bd4fd57dcd33ce38b8951018258201124a0737314cf6aa38c4c4edaf5ea561c029618437bd4fd57dcd33ce38b895102018383581d70ccab91fac02ceb62281d66d68e117ace2ab197fc3eb12929b999ca31821a077eb69ea05820ae7ebf3bc5d1f50cf2f12569e088dd53c89917cd71e128e7ea4c6daf59ef02b782583900139f64f546bb2b8ea827ae71423c4d3da389e1e601ad227adfc0512d77c023981d9187f73e5128bf6e23374ff5a8d848d171263a78182ce7821a0014851ea1581cb8aa6f60b48ad4cb0f623edc96eb4dffb652b3a2384287b22c8814aca14547454e53741a01dc914b82583900139f64f546bb2b8ea827ae71423c4d3da389e1e601ad227adfc0512d77c023981d9187f73e5128bf6e23374ff5a8d848d171263a78182ce71a200ba559021a0002aac1a300828258206fe19641cd3041d152d3a5a8e4297585f63bf232db4e176640a2a21db10f3568018258206fe19641cd3041d152d3a5a8e4297585f63bf232db4e176640a2a21db10f356802018383581d70ccab91fac02ceb62281d66d68e117ace2ab197fc3eb12929b999ca31821a16601558a05820ffb3b6509a7b26a10ea88a88700c1b3fb8933b2f98a01cd46a873c45e19aa4d1825839004e8b2a4398afcb339b8557890567d7145cf46f8c19bcf56d6f1c3c919e909fa249ece2c5703eeb2556e0e5551aae238de1943113da576a1e821a001be2daa3581c34250edd1e9836f5378702fbf9416b709bc140e04f668cc355208518a1494154414441636f696e191c8e581c57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522a14556414e494c1a0018adac581cd311d3488cc4fef19d05634adce8534977a3bc6fc18136ad65df1d4fa2446c71200a1a009d8e6c446c7120741a0009272c825839004e8b2a4398afcb339b8557890567d7145cf46f8c19bcf56d6f1c3c919e909fa249ece2c5703eeb2556e0e5551aae238de1943113da576a1e1a0b8582dd021a0002bb15a80081825820ad28cb51f1f36bc4f1694e20da46b4e574e77dd16a380a506d655659add859cb000d81825820ad28cb51f1f36bc4f1694e20da46b4e574e77dd16a380a506d655659add859cb00018282583900918449aae85de7248a8e0064d1b2bf9074fafec8af0e0689776af5876649e0f9b73391a3479eee54363cdfff5fbe3514d96cf18caf54ef1c821a0014851ea1581cf6f965943c738b48513277c1baf4770aa3873f2f624bfd2567322d4ba1466d4d415449431a001e84808258390017faa84c3144273ec0ed163a2a4876b6c864dc3b853adec72c7e3246c922acb2313aefd14c318d7944aa37c261d775a2e863f6964a2e7d7b1a2fd3763f021a0007eb6d031a037e7a960e81581c5098e5f901a8b45434b12be1c4700e460551967e1a07a54b0b9d887209a1581cf6f965943c738b48513277c1baf4770aa3873f2f624bfd2567322d4ba1466d4d415449431a001e84800b58202f1e614016e6863bb95bbeec2ffe4379bdead9c593111683fab60dc4d8feb23aa90081825820d3892a2e594455f5e6e0f1b0f901ab28461273c0d42f1cab0cb82ffdd5e7aab7000d80018282581d602cc2167361ba5e1371dca3cdfe119fa4303c7d7d2b35906123dff8961a39e31803825839008e112aee238679eb9c23185c224944687f18d8262f09aabbc64559831de38812b54dc47b9370d39740dc29ba3f834e0acefca7a7e18fdf67821a001e8480a1581cfd8b1cabffe4ac7b7f2c8f63d73a68c51b164f601eeb4e70adf27d51a1575370616365746f6b656e73506c616e657448656c696f7001021a00034805031a037e855a08000e8009a1581cfd8b1cabffe4ac7b7f2c8f63d73a68c51b164f601eeb4e70adf27d51a1575370616365746f6b656e73506c616e657448656c696f7001075820636e1ba4c1ec08f024d6b5d59c09223ce5ea6ba47585596c6b6c037ebaf9fa92a60082825820fa15b96689fbfa41719c13cca93b400451176cfc36c44d7651a07c2b12f3c93c00825820fa15b96689fbfa41719c13cca93b400451176cfc36c44d7651a07c2b12f3c93c01018383581d70081b23f2b3afa39a8750b282848ed9c2bcaf6a63067c517ef048420b821a003d0900a1581c648823ffdad1610b4162f4dbc87bd47f6f9cf45d772ddef661eff198a14577444f47451903e858203769e14cf91066e0b8ca4c07dcbde56d9b5cb6e21106aa19dadc45e40cb01a468258390045aaa2b8a2b997f57dca503579c1f2de11f12f409cdba2ed4e4789b275fa6855be58b262671bffe4b187d9d7b7a58fa66d0b966854c3ef8d1a3af16f2a8258390045aaa2b8a2b997f57dca503579c1f2de11f12f409cdba2ed4e4789b275fa6855be58b262671bffe4b187d9d7b7a58fa66d0b966854c3ef8d821a0017ad4aa1581c648823ffdad1610b4162f4dbc87bd47f6f9cf45d772ddef661eff198a4447742544319271044774554481a0031be604577444f47451a0050db384577555344431a000f4240021a0002f4a9031a037e6a30081a037e5c200b582061c32ff1be070e71013c5b4d4961a61f2cd9cc37918fa6823fbed89ad6aeaad2a4008182582082e9a7a802173bf2f48829fbe1829e91ea22772d904ca36ed40d6f339cdf04fe01018383581d70d3d514ade606266075a7f7efe2f3a71b6e7b1779e958c0c1be131c88821a00989680a2581c00abb5788d115386759a351d6f9d29bc7e23d5484fd67061de60fd05a1495779726d73746f6e651864581cb05fcc8a6e7e2a6e58e932fe8b70a169d975f7b7d99ac78b6c6af135a25054617665726e53717561643030303437015054617665726e537175616430303034380158201b5c3ae5c856701157aef73a8746c84f4e5422eea92346dc7bd21b4f45750043825839004a69950e6cad27ba2f7b3073230bca1885915685667f504d14ad611220168ae068455877c9157c5c31e4be15b1b5b65e3b7703b936465264821a0021ac80a2581c00abb5788d115386759a351d6f9d29bc7e23d5484fd67061de60fd05a1495779726d73746f6e651a00989234581cb05fcc8a6e7e2a6e58e932fe8b70a169d975f7b7d99ac78b6c6af135a65054617665726e53717561643030303431015054617665726e53717561643030303432015054617665726e53717561643030303433015054617665726e53717561643030303434015054617665726e53717561643030303435015054617665726e5371756164303030343601825839004a69950e6cad27ba2f7b3073230bca1885915685667f504d14ad611220168ae068455877c9157c5c31e4be15b1b5b65e3b7703b9364652641a00d68e23021a0002f1e90b5820a63a21d24e92099a849599ba14b69fcd889f10b292ff9f2b577bf2e866a4a12c87a1008182582045f394bee236a754362117fcb5eef36b59e28f86164fac5b32b41d9b6c5e86195840869f9ff5cd75ca265355041503ba43b541d7b68c09337aa9f04ff9d5d5dba7a0e273d431c6fdb41a3f0ee1ea92fec826ece6cc6054109d8046915985d64d8e00a10081825820a978ab7a70f041bab63585a064925be94626322593d061635dcaa6b0d98770a3584097bdc670da5aaf564b766d6242fe4187aeab01a176bd4c5d26c7d72f8081c3cc1b1929ec3842a03bf1187b5883950bbd475afeb0aada4da1452ede7739370607a100818258205a38cee3bf7ee173d604f3b86b17dd1854447fb5dd637c637d39c71984eca5975840ddba74d3f6f8c63686e029f685977f1315becbf394de6fecbcbf0d43e897faa502fdb1506b653cbea14f38ed79514cbdcda7d10a4dcfb61f51dfff17904f9003a30082825820a6af79ecc2c07a82d92b57387de904e7c9a145a64b27611bfaaed8cedb0bc9925840c1da2109e61fdad0e546a805eca96f4c198e3e4181caea15ee6d57e595e81bdacb8b06d790b1d694c15e9e51c44b7f05cdeadec40ad81aa6ec2d88f9edac220e8258204a9381289a9fc11d1d4f39a0f260e6b743aec748f859f47318166e4037af867758403b020349a3ae4676748eefc40d2ef7269bf8ea24e6420356ef6b846b971193aab455c9d2cf1db1e5032b044fa6075f172a87498edb443941e6a1ba735760f20703815907a75907a40100003323232323232323232332232323232332232332232323232322223232325335001101d132635335738921035054350001d01b323500122350022222222222533533355301312001321233001225335002210031001002501b25335333573466e3c04c00408c0884d40740045407000c8408c4084cccd5cd19b8735573aa004900011991091980080180119191919191919191919191999ab9a3370e6aae754029200023333333333222222222212333333333300100b00a009008007006005004003002335014232323333573466e1cd55cea8012400046644246600200600460426ae854008c064d5d09aba2500223263533573805c05a05605426aae7940044dd50009aba1500a33501401535742a012666aa02eeb94058d5d0a804199aa80bbae501635742a00e66a0280466ae854018cd4050cd54098091d69aba150053232323333573466e1cd55cea801240004664424660020060046464646666ae68cdc39aab9d5002480008cc8848cc00400c008cd409dd69aba150023028357426ae8940088c98d4cd5ce01901881781709aab9e5001137540026ae854008c8c8c8cccd5cd19b8735573aa004900011991091980080180119a813bad35742a00460506ae84d5d1280111931a99ab9c03203102f02e135573ca00226ea8004d5d09aba2500223263533573805c05a05605426aae7940044dd50009aba1500433501475c6ae85400ccd4050cd54099d710009aba15002301e357426ae8940088c98d4cd5ce01501481381309aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aab9e5001137540026ae854008c8c8c8cccd5cd19b875001480188c848888c010014c06cd5d09aab9e500323333573466e1d40092004232122223002005301d357426aae7940108cccd5cd19b875003480088c848888c004014c05cd5d09aab9e500523333573466e1d40112000232122223003005375c6ae84d55cf280311931a99ab9c02502402202102001f01e135573aa00226ea8004d5d09aba2500223263533573803c03a03603426aae7940044dd5000990009aa80c1108911299a80089a80191000910999a802910011802001199aa9803890008028020008919118011bac001320013550182233335573e0024a012466a01060086ae84008c00cd5d100100c11919191999ab9a3370e6aae75400d20002333222123330010040030023232323333573466e1cd55cea8012400046644246600200600460326ae854008cd4038060d5d09aba2500223263533573803c03a03603426aae7940044dd50009aba150033335500775ca00c6ae854008cd4029d71aba135744a004464c6a66ae7006806405c0584d5d1280089aab9e500113754002266aa002eb9d6889119118011bab00132001355016223233335573e0044a010466a00e66aa02e600c6aae754008c014d55cf280118021aba200301713574200222440042442446600200800624464646666ae68cdc3a800a400046a00e600a6ae84d55cf280191999ab9a3370ea00490011280391931a99ab9c016015013012011135573aa00226ea800448488c00800c44880048c8c8cccd5cd19b8735573aa004900011991091980080180118029aba15002375a6ae84d5d1280111931a99ab9c01101000e00d135573ca00226ea80048c8cccd5cd19b8735573aa002900011bae357426aae7940088c98d4cd5ce00780700600589baa00112232323333573466e1d400520042122200123333573466e1d40092002232122230030043006357426aae7940108cccd5cd19b87500348000848880088c98d4cd5ce00900880780700680609aab9d5001137540024646666ae68cdc3a800a4004400a46666ae68cdc3a80124000400a464c6a66ae7003803402c0280244d55ce9baa001122002122001232323232323333573466e1d4005200c21222222200323333573466e1d4009200a21222222200423333573466e1d400d2008233221222222233001009008375c6ae854014dd69aba135744a00a46666ae68cdc3a8022400c4664424444444660040120106eb8d5d0a8039bae357426ae89401c8cccd5cd19b875005480108cc8848888888cc018024020c030d5d0a8049bae357426ae8940248cccd5cd19b875006480088c848888888c01c020c034d5d09aab9e500b23333573466e1d401d2000232122222223005008300e357426aae7940308c98d4cd5ce00a00980880800780700680600580509aab9d5004135573ca00626aae7940084d55cf280089baa0012323232323333573466e1d400520022333222122333001005004003375a6ae854010dd69aba15003375a6ae84d5d1280191999ab9a3370ea0049000119091180100198041aba135573ca00c464c6a66ae700340300280240204d55cea80189aba25001135573ca00226ea80048c8c8cccd5cd19b875001480088c8488c00400cdd71aba135573ca00646666ae68cdc3a8012400046424460040066eb8d5d09aab9e500423263533573801401200e00c00a26aae7540044dd50008891119191999ab9a3370e6aae754009200023355008300635742a004600a6ae84d5d1280111931a99ab9c00a009007006135573ca00226ea80052611221233001003002120014910350543100112323001001223300330020020014891c5098e5f901a8b45434b12be1c4700e460551967e1a07a54b0b9d887200010581840100d87980821a002625a01a1dcd6500a2008182582013b5f5ed02b2aa700839f43bfe357dd290b5f4e65435e72e4be3ec48c2bf7d315840d1d2e5d52b6873e6448182dc4da7f1848b56410487e6f73c187ac65fbd80bf4a5840d9bdb7a9b6ab368dfe571962d71777aa42d176e311926eb396a8b2fc6606018182018282051a03b614408200581c2cc2167361ba5e1371dca3cdfe119fa4303c7d7d2b35906123dff896a20081825820c46b26712fefaf451327987fe95829f20f0511ace63657b93d7b43e1f5491a2a5840c815409055c588c250495f05ae2a373dc264821210253a9d1f5c01140a5f318104fdeebadfbaff7fff208d6176a12b63d8237eee4a7c64065f55041d55c723030481d8799fd8799fd8799fd8799f581c45aaa2b8a2b997f57dca503579c1f2de11f12f409cdba2ed4e4789b2ffd8799fd8799fd8799f581c75fa6855be58b262671bffe4b187d9d7b7a58fa66d0b966854c3ef8dffffffff581c45aaa2b8a2b997f57dca503579c1f2de11f12f409cdba2ed4e4789b21b00000180de155631d8799fd8799f581c22c3b86a5b88a78b5de52f4aed2831d1483b3b7681f1ee256953813058203395f36673a46e5c1e4d7ff53d96e72b34754fa912e67c0dee427d108f7618b5ffd8799f581c648823ffdad1610b4162f4dbc87bd47f6f9cf45d772ddef661eff1984577444f4745ffffffd8799fd87a801a000a1742ffffa20081825820edb8e8783f02648af956a22f2ddc2334ceab69ba1f7194e1f19d6fec508ae9fd58402fb2f20340cf78a3bda52260842d2128bd52f94ed6ed9e5930d3a8ce2e3428017ac17c673c6fb176593f143e557b5b5d21d1dc93410d4a1cce226b8c6f230803049f9f5f5840616464725f7465737431717039786e396777646a6b6a307733303076633878676374656776677479326b73346e3837357a647a6a6b6b7a7933717a3639777136582c7a3974706d756a39747574736337663073346b78366d7668336d7775706d6a646a7832666a71663071326a32ff1b00000180dd79f9005054617665726e537175616430303034385054617665726e53717561643030303437ffffa104d90103a100a11902d1a178386664386231636162666665346163376237663263386636336437336136386335316231363466363031656562346537306164663237643531a1775370616365746f6b656e73506c616e657448656c696f70a766617574686f726c537061636520546f6b656e736c636f6e74656e745f7479706569696d6167652f706e676b6465736372697074696f6e73537061636520546f6b656e7320506c616e657465696d6167657835697066733a2f2f516d56453153766559616e31707a435944736f66555678755a6471484d344e7a644731735045387376544c504654686c6f636174696f6ea2656874747073783868747470733a2f2f742e7370616365746f6b656e732e696f2f7075622f5370616365746f6b656e73506c616e657448656c696f702e706e6764697066737835697066733a2f2f516d56453153766559616e31707a435944736f66555678755a6471484d344e7a644731735045387376544c504654646e616d656648656c696f70656f74686572a76961737365745f75726c782168747470733a2f2f7777772d732e7370616365746f6b656e732e696f2f642f31316d646973636f76657265645f61747820323032322d30352d31395431373a35303a30302e3334373331312b30303a30306c646973636f766572795f6e6f0b6d65787065646974696f6e5f6e6f0b6c706c616e65745f636c617373036b706c616e65745f73697a656654657272616e6b706c616e65745f74797065654d6574616c80

Metadata parsing fails on testnet: "some complicated/unsupported type"

Specifically, this is the transaction that fails: https://explorer.cardano-testnet.iohkdev.io/en/transaction?id=b84337897280d1b93e235fba0a1bd25112715fd15906be7f680cffae9089b19b

Full error message: DuplicateKey(Str("some complicated/unsupported type"))

Full cbor

820484828f1a00264e101a0176b62c58204c5c6d677d033720587f0c22615740f830b5ad855f6f32e271d2f628639251185820e7c3155586042372b19c1fe0491b771bfb2eb04f24af76f3870cda983551f4e75820d8ae2a59f1ff6ec33d0df8161fd89d820533b9580a4e43f4e9f6a628582b10ae8258403d12e3ecf22bd2d269814132491c9b9628f8fa6134e777fc95ea179fa8cf790a657856937847a23f730288d41d8b8553aa87568b2c2d7a738f5ff97e3da2a8845850e34fe4c98f5035d7b853391ddca236d5040cba4ae5e19d0b63dc3a531ff80488ed0f37f023392b5f0bbbabf17e6f5242bc4eec2ccbb98d8a4abbbb15f9d320656aac7411e6f75a6226ee33cbb8a8720e825840001abd4458cfc43c02baab20b1bef94ee31ce2669ad45b0fbec2d4f32ac7e36e5af855f6c719edcca363f8888e9ca9f07e16aeb19b92e8ecc5f1fbd3b15d0dec5850c68b4642acfc46dce00da90a4b4eb72141e07de1441472ee3c0c86cba2bc7e95c056072385fffeaac9d0443aee62d6901dc2b9f7e4c43530a9870f44a98f934622242184774134bee3264ddcb9a4c10619475f5820225c4bbc0786ccf11667fea56c706cfc5bc1e17cd855f2cf9935d45b3c814438582009a926c53eb583b419a1dde8a86ccc86a8516f088c744cfd28a88b175317543103189b5840ea61fea6e6b92daa3863526e56f57dd1e8f0aaf8c048eec16dccf9f720b62659e223e3e3c2dcc506856ebf3fbb2d7a7c1658495fcc4001ad4e43904062d6570004005901c0530fa69a5e61ea6417251c0bfaf92cbbb234fceae8f71362d5117b2b44a9e8892c6623290f918b82139cf7737a7edc289c9c61874be6121a114f34d4d9c78906e3808daf39d8121964fde6f79f2d88dbf7cb8b265fc4b6972b8d47133342a20c366f18d2efba552bf63ed00cc9fb6b4fb5c9bb5fae5df19aae222a08169662fa380985f866370613ac1886a12fd69137edb21f319fdea478847ee5285efdcdb57567174b2ce708e44f644bb0813b248df80eb5a34b2f60a667a1f69ac983cebf71b70f7805d75de75c3c6af7b0b25269d745fbe20130940c0fafb399ca8e04011428d63557d6a7d6c481ef5090084294fce07f8a4554e323cbec3f8e84f7e812924ad3ef9ce836bee640227c674b9afb6b07dae2ad56f4ff6a6618f03ec20c89aa280898aab4757c1b54febf82a01096d157a634128ee1f1b1bafefd6f06895d5daf736786519342420a2e11315be65e1682d8911e55c4a63e4e2c091fee80f0fda52997380adb02930f4f9806a11bed1d55a3be16114a9eb4689f6d7a1fd7e911b04bd38d3d4270a8a88e560adf70f23508a1dbbc4709a08ecdf0dcdd4a4b5215f3c1200d2c52da87473215d3622e07b56ec5be08dcb3c7edac2fe1967350cc85a50082825820744516f36a1da821f798e2a4cb030211e1a172dd958d1b90a6db804f034fa69800825820744516f36a1da821f798e2a4cb030211e1a172dd958d1b90a6db804f034fa69801018282581d6052e63f22c5107ed776b70f7b92248b02552fd08f3e747bc7450994411a000f424082581d6052e63f22c5107ed776b70f7b92248b02552fd08f3e747bc7450994411b000000013c1b294c021a0002c6f1031a01783b670758208e5e2cc07704990c241c2c5731b5bde70a4c9999655e5e759dd8a8975e58c43ea50082825820548a9edf44390226bacec859c1cc4141e2ae88a8d539f8d26066a62b81b4d46a00825820ec5d5eb79de70cfe0a1e7e4e5e09c00f6a6dbc2d7c5ffaaea104f84ebeef7eb101018282583900078b9934b00b677fb977f22b99dc591f3d47af9d6befdbd28c99c00f3efc9ca02779445c3f8041d0b907247aa2393e71173ed277cfa251f71a000f424082583900ae0bd7f7a09d631faafc34e116ef812b3e1347fbe3f3326faa99e7b03efc9ca02779445c3f8041d0b907247aa2393e71173ed277cfa251f71a00333936021a0007c7c1031a0176d20e0758200765d70b1aa999f18cb75db9a9c9bf82e37047e78339bcbb49a69cc376fce649a50081825820f6681fd9b62c9f2a4346812580070ec7463ff47244f665c407a232cc33af555201018282583900c01e440c5d324b2e9a1a371d78339387c45c8857fa7b9c4dc3c07ab83efc9ca02779445c3f8041d0b907247aa2393e71173ed277cfa251f71a000f4240825839002498fe7acce3fb533d4c3ef80ed0eb754068f1b19c4561b07b508d083efc9ca02779445c3f8041d0b907247aa2393e71173ed277cfa251f71a393e8fd0021a0002f215031a0176d20f075820c23b8f3fb7d04218db1680ef84b5f5d7467bcddf7c6080dc02ef51e614c3233da50081825820a1a328f08487059d0528db94bbe21d1daf8b4218d2273542af2f9b08d837650a01018282583900f61a019558a66a5c2f08dd35dc7ed5fc368ff75d9456c389716b08da3efc9ca02779445c3f8041d0b907247aa2393e71173ed277cfa251f71a000f424082583900875782cb6fed71545f6129ce8533af88f8cee38452d354355452bf743efc9ca02779445c3f8041d0b907247aa2393e71173ed277cfa251f71a0fc56370021a0007af85031a0176d2350758200765d70b1aa999f18cb75db9a9c9bf82e37047e78339bcbb49a69cc376fce649a50083825820068a955f68972faa2e28e6d6bde8c195ead711f8c7372aa0dc47414b9b82b86b00825820228ef5509cca2420fd4072ec72d48f9e6b8656f4684af16748fa7d11c190fbdf0082582065fb82d3edab8a7406c4b402ea49d1c7aad80aba03ff018d0130415e096f764b00018282583900b7b28e0d85c17d49d8dd245d7522ed0ea39b01bb305011fd56127d113efc9ca02779445c3f8041d0b907247aa2393e71173ed277cfa251f71a000f4240825839009b18f565608635863b1dc9c57e84d6450374ac5f7e71a802487eb9813efc9ca02779445c3f8041d0b907247aa2393e71173ed277cfa251f71a001b61f3021a0003228d031a0176d237075820c23b8f3fb7d04218db1680ef84b5f5d7467bcddf7c6080dc02ef51e614c3233d85a10081825820742d8af3543349b5b18f3cba28f23b2d6e465b9c136c42e1fae6b2390f565427584053844a26ff3626e1575feb9e1cc747dc6f6600da169814dc75e77b924cf9381148657627bacb86a8ca186a7a8b576b106ddec33f433b11da278beef47129da05a10082825820322ddd0ea3f272aa8215d430a9c84d86023cdd1abfe683765736a0f1188dadf858405783c4505d9055295563254e03b5e57d3d35dd4af51494f1faddadde54f2cf0975ddd23c1c5b9d57129690ef23474dcaf16a40a98f0a29c5024b24616d5472078258209760378310a1d36809fae1923f0e168af07ad2f7ef7507c0a64491b34da329d55840def5a4bad284d657a67aff3dec9667c0c6ba2ba90683341f5e0f48fe6e3f98dfc9a641097f46aa686adb7328f671fe0a016b70f31f9c24a2defca58faf0c6c00a100818258206395cda2e6bab438fa1d0cbc52ad948022b5b575ed380ebbfa409b3a5fe1f907584066b4eb659f84b97cb3a2996a34383fcc4442c9fa096e6000815000e578710aa5afdb65a83d1cc16838f438eb21d00165ebc39fb89f649751da376bba69428f08a100818258203c231ade259d7e5c8a3b342d284d69c214059119f233d029e239ece14920d03558405f7a405de3b93584edbd5be09405d93ff6bec721783b418715a96a19da7842b52efc36117cd6ffc9395205baa1cc5ffbdab0a258b4737882ea0d9d01c54dc90da100838258208cc0f51a4c7543ccc3f228c5da059c0d1e97950f158851b9d7a084ff669d5fe458401d38556030e882319e2a22a0e97c3dcae584fac8256c4c13eaa6f05b3464b319f47192392aaa1025c8ddcc049bbdb5f355f19f4f1080a76c72148670837cce0f825820bdeee318315047926b24796efbd5c8eb9dcd53d06b8359772345b0e9b49de0715840d651b601c7166e8df69d65efc018cd510a87742b4cc822cf5f06c206c459f15a5ff5a8926280528d0232baf0d99be52bd860b46d0fde05d538a5a16e618e3c01825820d8a0ef7748f0287cd857509ae38c261b725fb9d4dfe3b89ac143303e62e858b95840309073c9178d2d36ff844b5e66c2421872bd7add6ed7a352921d46e47f899ebc435f2d455431f697b3f292d388e05e0fd552ae4f142c3e8276f5934ec3acd704a50082a219270fa16474657374747365636f6e64206d657461646174612066696c6519270fa16474657374736669727374206d657461646174612066696c65800182bf1b7fffffffffffff9b7840393232333337323033363835343737353730373932323333373230333638353437373537303739323233333732303336383534373735373037393232333337321b7fffffffffffff9c7840393232333337323033363835343737353730383932323333373230333638353437373537303839323233333732303336383534373735373038393232333337321b7fffffffffffff9d7840393232333337323033363835343737353730393932323333373230333638353437373537303939323233333732303336383534373735373039393232333337321b7fffffffffffff9e7840393232333337323033363835343737353731303932323333373230333638353437373537313039323233333732303336383534373735373130393232333337321b7fffffffffffff9f7840393232333337323033363835343737353731313932323333373230333638353437373537313139323233333732303336383534373735373131393232333337321b7fffffffffffffa07840393232333337323033363835343737353731323932323333373230333638353437373537313239323233333732303336383534373735373132393232333337321b7fffffffffffffa17840393232333337323033363835343737353731333932323333373230333638353437373537313339323233333732303336383534373735373133393232333337321b7fffffffffffffa27840393232333337323033363835343737353731343932323333373230333638353437373537313439323233333732303336383534373735373134393232333337321b7fffffffffffffa37840393232333337323033363835343737353731353932323333373230333638353437373537313539323233333732303336383534373735373135393232333337321b7fffffffffffffa47840393232333337323033363835343737353731363932323333373230333638353437373537313639323233333732303336383534373735373136393232333337321b7fffffffffffffa57840393232333337323033363835343737353731373932323333373230333638353437373537313739323233333732303336383534373735373137393232333337321b7fffffffffffffa67840393232333337323033363835343737353731383932323333373230333638353437373537313839323233333732303336383534373735373138393232333337321b7fffffffffffffa77840393232333337323033363835343737353731393932323333373230333638353437373537313939323233333732303336383534373735373139393232333337321b7fffffffffffffa87840393232333337323033363835343737353732303932323333373230333638353437373537323039323233333732303336383534373735373230393232333337321b7fffffffffffffa97840393232333337323033363835343737353732313932323333373230333638353437373537323139323233333732303336383534373735373231393232333337321b7fffffffffffffaa7840393232333337323033363835343737353732323932323333373230333638353437373537323239323233333732303336383534373735373232393232333337321b7fffffffffffffab7840393232333337323033363835343737353732333932323333373230333638353437373537323339323233333732303336383534373735373233393232333337321b7fffffffffffffac7840393232333337323033363835343737353732343932323333373230333638353437373537323439323233333732303336383534373735373234393232333337321b7fffffffffffffad7840393232333337323033363835343737353732353932323333373230333638353437373537323539323233333732303336383534373735373235393232333337321b7fffffffffffffae7840393232333337323033363835343737353732363932323333373230333638353437373537323639323233333732303336383534373735373236393232333337321b7fffffffffffffaf7840393232333337323033363835343737353732373932323333373230333638353437373537323739323233333732303336383534373735373237393232333337321b7fffffffffffffb07840393232333337323033363835343737353732383932323333373230333638353437373537323839323233333732303336383534373735373238393232333337321b7fffffffffffffb17840393232333337323033363835343737353732393932323333373230333638353437373537323939323233333732303336383534373735373239393232333337321b7fffffffffffffb27840393232333337323033363835343737353733303932323333373230333638353437373537333039323233333732303336383534373735373330393232333337321b7fffffffffffffb37840393232333337323033363835343737353733313932323333373230333638353437373537333139323233333732303336383534373735373331393232333337321b7fffffffffffffb47840393232333337323033363835343737353733323932323333373230333638353437373537333239323233333732303336383534373735373332393232333337321b7fffffffffffffb57840393232333337323033363835343737353733333932323333373230333638353437373537333339323233333732303336383534373735373333393232333337321b7fffffffffffffb67840393232333337323033363835343737353733343932323333373230333638353437373537333439323233333732303336383534373735373334393232333337321b7fffffffffffffb77840393232333337323033363835343737353733353932323333373230333638353437373537333539323233333732303336383534373735373335393232333337321b7fffffffffffffb87840393232333337323033363835343737353733363932323333373230333638353437373537333639323233333732303336383534373735373336393232333337321b7fffffffffffffb97840393232333337323033363835343737353733373932323333373230333638353437373537333739323233333732303336383534373735373337393232333337321b7fffffffffffffba7840393232333337323033363835343737353733383932323333373230333638353437373537333839323233333732303336383534373735373338393232333337321b7fffffffffffffbb7840393232333337323033363835343737353733393932323333373230333638353437373537333939323233333732303336383534373735373339393232333337321b7fffffffffffffbc7840393232333337323033363835343737353734303932323333373230333638353437373537343039323233333732303336383534373735373430393232333337321b7fffffffffffffbd7840393232333337323033363835343737353734313932323333373230333638353437373537343139323233333732303336383534373735373431393232333337321b7fffffffffffffbe7840393232333337323033363835343737353734323932323333373230333638353437373537343239323233333732303336383534373735373432393232333337321b7fffffffffffffbf7840393232333337323033363835343737353734333932323333373230333638353437373537343339323233333732303336383534373735373433393232333337321b7fffffffffffffc07840393232333337323033363835343737353734343932323333373230333638353437373537343439323233333732303336383534373735373434393232333337321b7fffffffffffffc17840393232333337323033363835343737353734353932323333373230333638353437373537343539323233333732303336383534373735373435393232333337321b7fffffffffffffc27840393232333337323033363835343737353734363932323333373230333638353437373537343639323233333732303336383534373735373436393232333337321b7fffffffffffffc37840393232333337323033363835343737353734373932323333373230333638353437373537343739323233333732303336383534373735373437393232333337321b7fffffffffffffc47840393232333337323033363835343737353734383932323333373230333638353437373537343839323233333732303336383534373735373438393232333337321b7fffffffffffffc57840393232333337323033363835343737353734393932323333373230333638353437373537343939323233333732303336383534373735373439393232333337321b7fffffffffffffc67840393232333337323033363835343737353735303932323333373230333638353437373537353039323233333732303336383534373735373530393232333337321b7fffffffffffffc77840393232333337323033363835343737353735313932323333373230333638353437373537353139323233333732303336383534373735373531393232333337321b7fffffffffffffc87840393232333337323033363835343737353735323932323333373230333638353437373537353239323233333732303336383534373735373532393232333337321b7fffffffffffffc97840393232333337323033363835343737353735333932323333373230333638353437373537353339323233333732303336383534373735373533393232333337321b7fffffffffffffca7840393232333337323033363835343737353735343932323333373230333638353437373537353439323233333732303336383534373735373534393232333337321b7fffffffffffffcb7840393232333337323033363835343737353735353932323333373230333638353437373537353539323233333732303336383534373735373535393232333337321b7fffffffffffffcc7840393232333337323033363835343737353735363932323333373230333638353437373537353639323233333732303336383534373735373536393232333337321b7fffffffffffffcd7840393232333337323033363835343737353735373932323333373230333638353437373537353739323233333732303336383534373735373537393232333337321b7fffffffffffffce7840393232333337323033363835343737353735383932323333373230333638353437373537353839323233333732303336383534373735373538393232333337321b7fffffffffffffcf7840393232333337323033363835343737353735393932323333373230333638353437373537353939323233333732303336383534373735373539393232333337321b7fffffffffffffd07840393232333337323033363835343737353736303932323333373230333638353437373537363039323233333732303336383534373735373630393232333337321b7fffffffffffffd17840393232333337323033363835343737353736313932323333373230333638353437373537363139323233333732303336383534373735373631393232333337321b7fffffffffffffd27840393232333337323033363835343737353736323932323333373230333638353437373537363239323233333732303336383534373735373632393232333337321b7fffffffffffffd37840393232333337323033363835343737353736333932323333373230333638353437373537363339323233333732303336383534373735373633393232333337321b7fffffffffffffd47840393232333337323033363835343737353736343932323333373230333638353437373537363439323233333732303336383534373735373634393232333337321b7fffffffffffffd57840393232333337323033363835343737353736353932323333373230333638353437373537363539323233333732303336383534373735373635393232333337321b7fffffffffffffd67840393232333337323033363835343737353736363932323333373230333638353437373537363639323233333732303336383534373735373636393232333337321b7fffffffffffffd77840393232333337323033363835343737353736373932323333373230333638353437373537363739323233333732303336383534373735373637393232333337321b7fffffffffffffd87840393232333337323033363835343737353736383932323333373230333638353437373537363839323233333732303336383534373735373638393232333337321b7fffffffffffffd97840393232333337323033363835343737353736393932323333373230333638353437373537363939323233333732303336383534373735373639393232333337321b7fffffffffffffda7840393232333337323033363835343737353737303932323333373230333638353437373537373039323233333732303336383534373735373730393232333337321b7fffffffffffffdb7840393232333337323033363835343737353737313932323333373230333638353437373537373139323233333732303336383534373735373731393232333337321b7fffffffffffffdc7840393232333337323033363835343737353737323932323333373230333638353437373537373239323233333732303336383534373735373732393232333337321b7fffffffffffffdd7840393232333337323033363835343737353737333932323333373230333638353437373537373339323233333732303336383534373735373733393232333337321b7fffffffffffffde7840393232333337323033363835343737353737343932323333373230333638353437373537373439323233333732303336383534373735373734393232333337321b7fffffffffffffdf7840393232333337323033363835343737353737353932323333373230333638353437373537373539323233333732303336383534373735373735393232333337321b7fffffffffffffe07840393232333337323033363835343737353737363932323333373230333638353437373537373639323233333732303336383534373735373736393232333337321b7fffffffffffffe17840393232333337323033363835343737353737373932323333373230333638353437373537373739323233333732303336383534373735373737393232333337321b7fffffffffffffe27840393232333337323033363835343737353737383932323333373230333638353437373537373839323233333732303336383534373735373738393232333337321b7fffffffffffffe37840393232333337323033363835343737353737393932323333373230333638353437373537373939323233333732303336383534373735373739393232333337321b7fffffffffffffe47840393232333337323033363835343737353738303932323333373230333638353437373537383039323233333732303336383534373735373830393232333337321b7fffffffffffffe57840393232333337323033363835343737353738313932323333373230333638353437373537383139323233333732303336383534373735373831393232333337321b7fffffffffffffe67840393232333337323033363835343737353738323932323333373230333638353437373537383239323233333732303336383534373735373832393232333337321b7fffffffffffffe77840393232333337323033363835343737353738333932323333373230333638353437373537383339323233333732303336383534373735373833393232333337321b7fffffffffffffe87840393232333337323033363835343737353738343932323333373230333638353437373537383439323233333732303336383534373735373834393232333337321b7fffffffffffffe97840393232333337323033363835343737353738353932323333373230333638353437373537383539323233333732303336383534373735373835393232333337321b7fffffffffffffea7840393232333337323033363835343737353738363932323333373230333638353437373537383639323233333732303336383534373735373836393232333337321b7fffffffffffffeb7840393232333337323033363835343737353738373932323333373230333638353437373537383739323233333732303336383534373735373837393232333337321b7fffffffffffffec7840393232333337323033363835343737353738383932323333373230333638353437373537383839323233333732303336383534373735373838393232333337321b7fffffffffffffed7840393232333337323033363835343737353738393932323333373230333638353437373537383939323233333732303336383534373735373839393232333337321b7fffffffffffffee7840393232333337323033363835343737353739303932323333373230333638353437373537393039323233333732303336383534373735373930393232333337321b7fffffffffffffef7840393232333337323033363835343737353739313932323333373230333638353437373537393139323233333732303336383534373735373931393232333337321b7ffffffffffffff07840393232333337323033363835343737353739323932323333373230333638353437373537393239323233333732303336383534373735373932393232333337321b7ffffffffffffff17840393232333337323033363835343737353739333932323333373230333638353437373537393339323233333732303336383534373735373933393232333337321b7ffffffffffffff27840393232333337323033363835343737353739343932323333373230333638353437373537393439323233333732303336383534373735373934393232333337321b7ffffffffffffff37840393232333337323033363835343737353739353932323333373230333638353437373537393539323233333732303336383534373735373935393232333337321b7ffffffffffffff47840393232333337323033363835343737353739363932323333373230333638353437373537393639323233333732303336383534373735373936393232333337321b7ffffffffffffff57840393232333337323033363835343737353739373932323333373230333638353437373537393739323233333732303336383534373735373937393232333337321b7ffffffffffffff67840393232333337323033363835343737353739383932323333373230333638353437373537393839323233333732303336383534373735373938393232333337321b7ffffffffffffff77840393232333337323033363835343737353739393932323333373230333638353437373537393939323233333732303336383534373735373939393232333337321b7ffffffffffffff87840393232333337323033363835343737353830303932323333373230333638353437373538303039323233333732303336383534373735383030393232333337321b7ffffffffffffff97840393232333337323033363835343737353830313932323333373230333638353437373538303139323233333732303336383534373735383031393232333337321b7ffffffffffffffa7840393232333337323033363835343737353830323932323333373230333638353437373538303239323233333732303336383534373735383032393232333337321b7ffffffffffffffb7840393232333337323033363835343737353830333932323333373230333638353437373538303339323233333732303336383534373735383033393232333337321b7ffffffffffffffc7840393232333337323033363835343737353830343932323333373230333638353437373538303439323233333732303336383534373735383034393232333337321b7ffffffffffffffd7840393232333337323033363835343737353830353932323333373230333638353437373538303539323233333732303336383534373735383035393232333337321b7ffffffffffffffe7840393232333337323033363835343737353830363932323333373230333638353437373538303639323233333732303336383534373735383036393232333337321b7fffffffffffffff784039323233333732303336383534373735383037393232333337323033363835343737353830373932323333373230333638353437373538303739323233333732ff800282a300815820d50f10149261a6c577b22c427b16464304071d14039fa74d7a2711ad2c39910c01827840687474703a2f2f6c6f63616c686f73743a323030352f646f776e6c6f61642f707367732e73656e6465725f696f686b2e696f2f312f6532655f746573742e74786174028c5820c8e86fcd4a1157c17ceffffc482a76269b0687beff867e41737a26a29dc32f2758207dc9000f9132131ca1e1726646a023c6e96087aad123bff7087a368be7f315a9582023e8690a48a7f58529f2025dccc072cec359bd45b431d50172807a23e2ed3b9a58200c43e7fd734e32269075b6f5b82bc282b3d3612677f5b319ac1752142d3d7d985820d305434c97d498c0e22d09b149fa193f4d4bdb09ab190a81352f533674a7ab36582016d44020432ecc3fdfa00e40a6740ed96a85a37ae0ccb5a3740debbd8b9d53825820b660c4ae4bb512cd2f95db9429bafa67559a453be7682400d5e9d4bfd48d50db58209b3b426112f6f42699547ca84cc958d117bbe05e5b6bd39a020e5176b70eccc95820b6c56f983a86454492d605228fca87fcfbe2ccdc8affcee8546cb8dc2c1cc29f582053aab0916d6e8e63c22520178d6dd83c69402c2a2cf2cdf6a20e5034c14027b758207cb171535b672c1862a85c273a09c55766886a6cd06845548c43d17ac320f6505820f575bb1e1b32dc3133a23ebfa945a00662c0466614bc31a7c63a2d2081e1bfd9800382bf1b7fffffffffffff9b7840393232333337323033363835343737353730373932323333373230333638353437373537303739323233333732303336383534373735373037393232333337321b7fffffffffffff9c7840393232333337323033363835343737353730383932323333373230333638353437373537303839323233333732303336383534373735373038393232333337321b7fffffffffffff9d7840393232333337323033363835343737353730393932323333373230333638353437373537303939323233333732303336383534373735373039393232333337321b7fffffffffffff9e7840393232333337323033363835343737353731303932323333373230333638353437373537313039323233333732303336383534373735373130393232333337321b7fffffffffffff9f7840393232333337323033363835343737353731313932323333373230333638353437373537313139323233333732303336383534373735373131393232333337321b7fffffffffffffa07840393232333337323033363835343737353731323932323333373230333638353437373537313239323233333732303336383534373735373132393232333337321b7fffffffffffffa17840393232333337323033363835343737353731333932323333373230333638353437373537313339323233333732303336383534373735373133393232333337321b7fffffffffffffa27840393232333337323033363835343737353731343932323333373230333638353437373537313439323233333732303336383534373735373134393232333337321b7fffffffffffffa37840393232333337323033363835343737353731353932323333373230333638353437373537313539323233333732303336383534373735373135393232333337321b7fffffffffffffa47840393232333337323033363835343737353731363932323333373230333638353437373537313639323233333732303336383534373735373136393232333337321b7fffffffffffffa57840393232333337323033363835343737353731373932323333373230333638353437373537313739323233333732303336383534373735373137393232333337321b7fffffffffffffa67840393232333337323033363835343737353731383932323333373230333638353437373537313839323233333732303336383534373735373138393232333337321b7fffffffffffffa77840393232333337323033363835343737353731393932323333373230333638353437373537313939323233333732303336383534373735373139393232333337321b7fffffffffffffa87840393232333337323033363835343737353732303932323333373230333638353437373537323039323233333732303336383534373735373230393232333337321b7fffffffffffffa97840393232333337323033363835343737353732313932323333373230333638353437373537323139323233333732303336383534373735373231393232333337321b7fffffffffffffaa7840393232333337323033363835343737353732323932323333373230333638353437373537323239323233333732303336383534373735373232393232333337321b7fffffffffffffab7840393232333337323033363835343737353732333932323333373230333638353437373537323339323233333732303336383534373735373233393232333337321b7fffffffffffffac7840393232333337323033363835343737353732343932323333373230333638353437373537323439323233333732303336383534373735373234393232333337321b7fffffffffffffad7840393232333337323033363835343737353732353932323333373230333638353437373537323539323233333732303336383534373735373235393232333337321b7fffffffffffffae7840393232333337323033363835343737353732363932323333373230333638353437373537323639323233333732303336383534373735373236393232333337321b7fffffffffffffaf7840393232333337323033363835343737353732373932323333373230333638353437373537323739323233333732303336383534373735373237393232333337321b7fffffffffffffb07840393232333337323033363835343737353732383932323333373230333638353437373537323839323233333732303336383534373735373238393232333337321b7fffffffffffffb17840393232333337323033363835343737353732393932323333373230333638353437373537323939323233333732303336383534373735373239393232333337321b7fffffffffffffb27840393232333337323033363835343737353733303932323333373230333638353437373537333039323233333732303336383534373735373330393232333337321b7fffffffffffffb37840393232333337323033363835343737353733313932323333373230333638353437373537333139323233333732303336383534373735373331393232333337321b7fffffffffffffb47840393232333337323033363835343737353733323932323333373230333638353437373537333239323233333732303336383534373735373332393232333337321b7fffffffffffffb57840393232333337323033363835343737353733333932323333373230333638353437373537333339323233333732303336383534373735373333393232333337321b7fffffffffffffb67840393232333337323033363835343737353733343932323333373230333638353437373537333439323233333732303336383534373735373334393232333337321b7fffffffffffffb77840393232333337323033363835343737353733353932323333373230333638353437373537333539323233333732303336383534373735373335393232333337321b7fffffffffffffb87840393232333337323033363835343737353733363932323333373230333638353437373537333639323233333732303336383534373735373336393232333337321b7fffffffffffffb97840393232333337323033363835343737353733373932323333373230333638353437373537333739323233333732303336383534373735373337393232333337321b7fffffffffffffba7840393232333337323033363835343737353733383932323333373230333638353437373537333839323233333732303336383534373735373338393232333337321b7fffffffffffffbb7840393232333337323033363835343737353733393932323333373230333638353437373537333939323233333732303336383534373735373339393232333337321b7fffffffffffffbc7840393232333337323033363835343737353734303932323333373230333638353437373537343039323233333732303336383534373735373430393232333337321b7fffffffffffffbd7840393232333337323033363835343737353734313932323333373230333638353437373537343139323233333732303336383534373735373431393232333337321b7fffffffffffffbe7840393232333337323033363835343737353734323932323333373230333638353437373537343239323233333732303336383534373735373432393232333337321b7fffffffffffffbf7840393232333337323033363835343737353734333932323333373230333638353437373537343339323233333732303336383534373735373433393232333337321b7fffffffffffffc07840393232333337323033363835343737353734343932323333373230333638353437373537343439323233333732303336383534373735373434393232333337321b7fffffffffffffc17840393232333337323033363835343737353734353932323333373230333638353437373537343539323233333732303336383534373735373435393232333337321b7fffffffffffffc27840393232333337323033363835343737353734363932323333373230333638353437373537343639323233333732303336383534373735373436393232333337321b7fffffffffffffc37840393232333337323033363835343737353734373932323333373230333638353437373537343739323233333732303336383534373735373437393232333337321b7fffffffffffffc47840393232333337323033363835343737353734383932323333373230333638353437373537343839323233333732303336383534373735373438393232333337321b7fffffffffffffc57840393232333337323033363835343737353734393932323333373230333638353437373537343939323233333732303336383534373735373439393232333337321b7fffffffffffffc67840393232333337323033363835343737353735303932323333373230333638353437373537353039323233333732303336383534373735373530393232333337321b7fffffffffffffc77840393232333337323033363835343737353735313932323333373230333638353437373537353139323233333732303336383534373735373531393232333337321b7fffffffffffffc87840393232333337323033363835343737353735323932323333373230333638353437373537353239323233333732303336383534373735373532393232333337321b7fffffffffffffc97840393232333337323033363835343737353735333932323333373230333638353437373537353339323233333732303336383534373735373533393232333337321b7fffffffffffffca7840393232333337323033363835343737353735343932323333373230333638353437373537353439323233333732303336383534373735373534393232333337321b7fffffffffffffcb7840393232333337323033363835343737353735353932323333373230333638353437373537353539323233333732303336383534373735373535393232333337321b7fffffffffffffcc7840393232333337323033363835343737353735363932323333373230333638353437373537353639323233333732303336383534373735373536393232333337321b7fffffffffffffcd7840393232333337323033363835343737353735373932323333373230333638353437373537353739323233333732303336383534373735373537393232333337321b7fffffffffffffce7840393232333337323033363835343737353735383932323333373230333638353437373537353839323233333732303336383534373735373538393232333337321b7fffffffffffffcf7840393232333337323033363835343737353735393932323333373230333638353437373537353939323233333732303336383534373735373539393232333337321b7fffffffffffffd07840393232333337323033363835343737353736303932323333373230333638353437373537363039323233333732303336383534373735373630393232333337321b7fffffffffffffd17840393232333337323033363835343737353736313932323333373230333638353437373537363139323233333732303336383534373735373631393232333337321b7fffffffffffffd27840393232333337323033363835343737353736323932323333373230333638353437373537363239323233333732303336383534373735373632393232333337321b7fffffffffffffd37840393232333337323033363835343737353736333932323333373230333638353437373537363339323233333732303336383534373735373633393232333337321b7fffffffffffffd47840393232333337323033363835343737353736343932323333373230333638353437373537363439323233333732303336383534373735373634393232333337321b7fffffffffffffd57840393232333337323033363835343737353736353932323333373230333638353437373537363539323233333732303336383534373735373635393232333337321b7fffffffffffffd67840393232333337323033363835343737353736363932323333373230333638353437373537363639323233333732303336383534373735373636393232333337321b7fffffffffffffd77840393232333337323033363835343737353736373932323333373230333638353437373537363739323233333732303336383534373735373637393232333337321b7fffffffffffffd87840393232333337323033363835343737353736383932323333373230333638353437373537363839323233333732303336383534373735373638393232333337321b7fffffffffffffd97840393232333337323033363835343737353736393932323333373230333638353437373537363939323233333732303336383534373735373639393232333337321b7fffffffffffffda7840393232333337323033363835343737353737303932323333373230333638353437373537373039323233333732303336383534373735373730393232333337321b7fffffffffffffdb7840393232333337323033363835343737353737313932323333373230333638353437373537373139323233333732303336383534373735373731393232333337321b7fffffffffffffdc7840393232333337323033363835343737353737323932323333373230333638353437373537373239323233333732303336383534373735373732393232333337321b7fffffffffffffdd7840393232333337323033363835343737353737333932323333373230333638353437373537373339323233333732303336383534373735373733393232333337321b7fffffffffffffde7840393232333337323033363835343737353737343932323333373230333638353437373537373439323233333732303336383534373735373734393232333337321b7fffffffffffffdf7840393232333337323033363835343737353737353932323333373230333638353437373537373539323233333732303336383534373735373735393232333337321b7fffffffffffffe07840393232333337323033363835343737353737363932323333373230333638353437373537373639323233333732303336383534373735373736393232333337321b7fffffffffffffe17840393232333337323033363835343737353737373932323333373230333638353437373537373739323233333732303336383534373735373737393232333337321b7fffffffffffffe27840393232333337323033363835343737353737383932323333373230333638353437373537373839323233333732303336383534373735373738393232333337321b7fffffffffffffe37840393232333337323033363835343737353737393932323333373230333638353437373537373939323233333732303336383534373735373739393232333337321b7fffffffffffffe47840393232333337323033363835343737353738303932323333373230333638353437373537383039323233333732303336383534373735373830393232333337321b7fffffffffffffe57840393232333337323033363835343737353738313932323333373230333638353437373537383139323233333732303336383534373735373831393232333337321b7fffffffffffffe67840393232333337323033363835343737353738323932323333373230333638353437373537383239323233333732303336383534373735373832393232333337321b7fffffffffffffe77840393232333337323033363835343737353738333932323333373230333638353437373537383339323233333732303336383534373735373833393232333337321b7fffffffffffffe87840393232333337323033363835343737353738343932323333373230333638353437373537383439323233333732303336383534373735373834393232333337321b7fffffffffffffe97840393232333337323033363835343737353738353932323333373230333638353437373537383539323233333732303336383534373735373835393232333337321b7fffffffffffffea7840393232333337323033363835343737353738363932323333373230333638353437373537383639323233333732303336383534373735373836393232333337321b7fffffffffffffeb7840393232333337323033363835343737353738373932323333373230333638353437373537383739323233333732303336383534373735373837393232333337321b7fffffffffffffec7840393232333337323033363835343737353738383932323333373230333638353437373537383839323233333732303336383534373735373838393232333337321b7fffffffffffffed7840393232333337323033363835343737353738393932323333373230333638353437373537383939323233333732303336383534373735373839393232333337321b7fffffffffffffee7840393232333337323033363835343737353739303932323333373230333638353437373537393039323233333732303336383534373735373930393232333337321b7fffffffffffffef7840393232333337323033363835343737353739313932323333373230333638353437373537393139323233333732303336383534373735373931393232333337321b7ffffffffffffff07840393232333337323033363835343737353739323932323333373230333638353437373537393239323233333732303336383534373735373932393232333337321b7ffffffffffffff17840393232333337323033363835343737353739333932323333373230333638353437373537393339323233333732303336383534373735373933393232333337321b7ffffffffffffff27840393232333337323033363835343737353739343932323333373230333638353437373537393439323233333732303336383534373735373934393232333337321b7ffffffffffffff37840393232333337323033363835343737353739353932323333373230333638353437373537393539323233333732303336383534373735373935393232333337321b7ffffffffffffff47840393232333337323033363835343737353739363932323333373230333638353437373537393639323233333732303336383534373735373936393232333337321b7ffffffffffffff57840393232333337323033363835343737353739373932323333373230333638353437373537393739323233333732303336383534373735373937393232333337321b7ffffffffffffff67840393232333337323033363835343737353739383932323333373230333638353437373537393839323233333732303336383534373735373938393232333337321b7ffffffffffffff77840393232333337323033363835343737353739393932323333373230333638353437373537393939323233333732303336383534373735373939393232333337321b7ffffffffffffff87840393232333337323033363835343737353830303932323333373230333638353437373538303039323233333732303336383534373735383030393232333337321b7ffffffffffffff97840393232333337323033363835343737353830313932323333373230333638353437373538303139323233333732303336383534373735383031393232333337321b7ffffffffffffffa7840393232333337323033363835343737353830323932323333373230333638353437373538303239323233333732303336383534373735383032393232333337321b7ffffffffffffffb7840393232333337323033363835343737353830333932323333373230333638353437373538303339323233333732303336383534373735383033393232333337321b7ffffffffffffffc7840393232333337323033363835343737353830343932323333373230333638353437373538303439323233333732303336383534373735383034393232333337321b7ffffffffffffffd7840393232333337323033363835343737353830353932323333373230333638353437373538303539323233333732303336383534373735383035393232333337321b7ffffffffffffffe7840393232333337323033363835343737353830363932323333373230333638353437373538303639323233333732303336383534373735383036393232333337321b7fffffffffffffff784039323233333732303336383534373735383037393232333337323033363835343737353830373932323333373230333638353437373538303739323233333732ff800482a300815820d50f10149261a6c577b22c427b16464304071d14039fa74d7a2711ad2c39910c01827840687474703a2f2f6c6f63616c686f73743a323030352f646f776e6c6f61642f707367732e73656e6465725f696f686b2e696f2f312f6532655f746573742e74786174028c5820c8e86fcd4a1157c17ceffffc482a76269b0687beff867e41737a26a29dc32f2758207dc9000f9132131ca1e1726646a023c6e96087aad123bff7087a368be7f315a9582023e8690a48a7f58529f2025dccc072cec359bd45b431d50172807a23e2ed3b9a58200c43e7fd734e32269075b6f5b82bc282b3d3612677f5b319ac1752142d3d7d985820d305434c97d498c0e22d09b149fa193f4d4bdb09ab190a81352f533674a7ab36582016d44020432ecc3fdfa00e40a6740ed96a85a37ae0ccb5a3740debbd8b9d53825820b660c4ae4bb512cd2f95db9429bafa67559a453be7682400d5e9d4bfd48d50db58209b3b426112f6f42699547ca84cc958d117bbe05e5b6bd39a020e5176b70eccc95820b6c56f983a86454492d605228fca87fcfbe2ccdc8affcee8546cb8dc2c1cc29f582053aab0916d6e8e63c22520178d6dd83c69402c2a2cf2cdf6a20e5034c14027b758207cb171535b672c1862a85c273a09c55766886a6cd06845548c43d17ac320f6505820f575bb1e1b32dc3133a23ebfa945a00662c0466614bc31a7c63a2d2081e1bfd980

Add method to add full datum to transaction in output_builder

Currently, the output builder provides a with_data_hash function. This is all you need for the majority of use cases, but in some cases people may want to provide the full Plutus datum into the transaction witness even though it only shows up in the output (communication datum)

We should enable this as a possibility while also making it clear from the function name that this isn't the usual way to do it.

Add metadata builder

Right now the tx builder is bloated with many metadata-related functions. These should all be moved out to their own builder. Notably,

  • set_metadata
  • add_metadatum
  • add_json_metadatum
  • add_json_metadatum_with_schema

React Native support?

Trying using the existing packages with React Native and got these errors:

...@dcspark/cardano-multiplatform-lib-browser/package.json was successfully found. However, this package itself specifies a mainmodule field that could not be resolved
...@dcspark/cardano-multiplatform-lib-asmjs/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved

Is there any support for React Native in the roadmap?

Many thanks

Improve coin selection

According to this issue, I'm thinking of breaking down current coin selection into these steps:

Select Native Assets

  1. Regarding the total output amount, sort the UTxOs deterministically. The priority order in the CIP issue does not look good to me. The sets 1/2/3 should be able to be quantified. And the euclidean distance described in this issue seems better.
  2. Transaction builder takes the first N UTxOs out to satisfy the assets amount needed by outputs. These UTxOs should be fixed.

Random Improvement

  1. Subtract the total ADA of outputs from total inputs. If the inputs are enough, ignore the following steps.
  2. Randomly improves the left ADA with the left UTxOs only holds ADA. If all of the remaining UTxOs contains assets, ignore.
  3. Optionally, if random improvement failed, fallback to Largest First.

The sorting and sampling logic can be implemented out of transaction builder, or maybe a separate crate if it can be shared with other projects. Builder can optionally implement a method to take the first N UTxOs to match the native assets of outputs and a method to check if a UTxO can improve. The sorting logic can be implemented by Typescript on the user side as well.

After #57 is merged I can work on this.

Refactor builders over to split architecture

Context

We are refactoring away from a single rust with wasm_bindgen taggings directly, over to a dedicated rust crate(s) and a separate wasm bindings crate, which should vastly improve usability from rust as we don't need to conform to the limitations of wasm_bindgen. While this is happening we will take advantage of improvements to cddl-codegen to introduce CBOR encoding tracking.

We will need to refactor the builders (e.g. tx builder) over to use the new rust-native structures, and then provide a WASM binding on top of this.

Figure out new Github release pipeline

Right now we have a single Github release per CML version, but this won't work as-is anymore because we've transitioned this to be a multi-repo.

As an additional note, one of the largest consumers of CML is Lucid by @alessandrokonrad which he consumed through Deno. Deno requires a special wasm-pack build command and Deno's suggestion is to publish deno package by hosting them on tags for your repo (https://deno.land/add_module).

I should note this Deno is case is not too dissimilar to the wasm-pack build --target=web case which also can't be published to npm and so is in a similar boat

Not sure what the best way to satisfy all these requirements are.

Remove `prefer_alonzo_format` from JSON output?

This field was added to help maintain round-trip deserailization until we get proper handling of it, but now it appears inside the JSON output. We may choose to ignore this as this code will be replaced eventually anyway -- especially considering how there is no clear fix to this

Double-check node handling of inline datum in inputs

I really want to believe the node implementation doesn't match what the spec implies on handling of inline datums in inputs where you'd have to duplicate inline datums inside the witness set.

See add_reference_input and input_required_wits

Change PlutusMap from BtreeMap to Vec

I noticed that Berry's fork of CML changed the PlutusMap to use a Vec instead of a BtreeMap. Not sure what the rationale for this was, but just creating an issue to track this since there may have been a good reason

Check the balance before create transaction

Now it is possible to build a transaction having the same total ADA amount between inputs and outputs. For example, a user can build a transaction sending 7 ADA out while he/she only have 7 ADA in total, which is not enough to cover the fee but the fee would be calculate as usual. How about fail the building process when the inputs cannot cover the outputs?

Improve unclear usage of set_exunits

Currently, set_exunits exists both in the regular tx builder & in TxRedeemerBuilder from build_for_evaluation

It's not clear to users that you should call the set_exunits in the main builder from the result of TxRedeemerBuilder and so instead, some people have tried building their own system for dummy witnesses to call the set_exunits in the main builder directly even though TxRedeemerBuilder was meant to handle this for them

Probably the API should be changed to make it clearer what the main path is. For example, make that the set_exunits call in the main builder only accepts a type received from a function in TxRedeemerBuilder

Standalone metadata library support

It's entirely reasonably for people to want to use standalone libraries for handling transaction metadata such as cip25_rs

The problem is that right now the main way to do this would be for cip25_rs to take CML as a dependency. You can imagine if there are many CIP standards that need to be imported in a project that this will lead to a mess with many CML dependencies of potentially different versions.

One way we could tackle this is by splitting up CML into smaller libraries. Notably, some library purely for parsing metadata would only need:

  • error.rs
  • metadata.rs
  • utils.rs

So if we cleverly setup the cargo workspaces, we could have all this cip25_rs, etc. libraries all depend on a fairly slim and stable API.

Probably we don't want to do this until the big code regeneration or we may end up duplicating work to get this properly exported as Rust libraries.

Memory managment of serialization lib on javascript

Hi, I am currently trying to implement proper memory management and disposal of the CML objects in the projects I have that use this library, but I would like to understand how far I need to go to properly dispose of all the objects, do I need to call free on every object that I create using one of the constructors, or is it enough to free the parent object?, for example, when creating a transaction we need to provide all sort of objects (redeemers, datums, signatures, input, outputs etc), is it enough to free the transaction where these objects have been added to it or we must free all of the objects individually? The same question goes for objects we get from other objects, do we need to manually free all these objects returned by the getters, or is it enough to free the parent object?.

How would I do something like emurgos: add_inputs_from(inputs: TransactionUnspentOutputs, strategy: number): void with dcsparks: select_utxos(strategy: number): void

I notice the similarity with both of these methods but I wanted to know how to switch over to dcspark using this pattern?

   const utxos = (await Wallet.getUtxos()).map(utxo => CardanoWasm.TransactionUnspentOutput.from_bytes(Buffer.from(utxo, "hex")))
    
    const utxoOut = CardanoWasm.TransactionUnspentOutputs.new();
    utxos.map((utxo) => utxoOut.add(utxo));
    
    txBuilder.add_inputs_from(
      utxoOut,
      0
  );

with dcspark :

txBuilder.select_utxos(0)

Cover Value with tests

Cover with tests the following parts:

  • checked_add
  • checked_sub
  • clamped versions of aforementioned functions

Refactor old structs over to split architecture

Context

We are refactoring away from a single rust with wasm_bindgen taggings directly, over to a dedicated rust crate(s) and a separate wasm bindings crate, which should vastly improve usability from rust as we don't need to conform to the limitations of wasm_bindgen. While this is happening we will take advantage of improvements to cddl-codegen to introduce CBOR encoding tracking.

We have many existing structs that were handwritten rather than generated from the CDDL spec. Some of these were due to overly broad definitions (e.g. address = bytes when really it's more complex), others are not specified in the spec but are needed.

Work to do

  • address.rs
  • Byron structs
  • crypto.rs
  • errors/utils

encode_json_str_to_native_script produces "RuntimeError: unreachable" in NodeJs

Package version: "^3.1.2",
Operating system: Windows 10
Node version is : v18.12.1

Example to reproduce :


const CardanoWasm  = require("@dcspark/cardano-multiplatform-lib-nodejs");

const script1 = {
  "type": "all",
  "scripts":
  [
    {
      "type": "sig",
      "keyHash": "487b9485cf18d99e875e7aef9b80c4d3a89cccddefbc2641c87da293"
    },
    {
      "type": "sig",
      "keyHash": "7190ae1c26a87ed572e8d72049454ddc874d360293c1eb43aef490e3"
    },
  ]
} 


  try {
    let nativeScript = CardanoWasm.encode_json_str_to_native_script(
      script1,
      "",
      CardanoWasm.ScriptSchema.Node
      );
  } catch (err) {
    console.error("Error encoding JSON to native script:", err);
  }

Full error message :

Error encoding JSON to native script: RuntimeError: unreachable
at wasm://wasm/00799942:wasm-function[2770]:0x162893
at wasm://wasm/00799942:wasm-function[3850]:0x18e4df
at wasm://wasm/00799942:wasm-function[5579]:0x1b9e43
at wasm://wasm/00799942:wasm-function[5598]:0x1ba268
at wasm://wasm/00799942:wasm-function[5411]:0x1b7603
at wasm://wasm/00799942:wasm-function[220]:0x801cd
at wasm://wasm/00799942:wasm-function[1220]:0x108562
at module.exports.encode_json_str_to_native_script (C:\Users\leant\node_modules@dcspark\cardano-multiplatform-lib-nodejs\cardano_multiplatform_lib.js:273:14)
at Object. (C:\Users\leant\Desktop\tmp\test.js:20:36)
at Module._compile (node:internal/modules/cjs/loader:1159:14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.