[{"data":1,"prerenderedAt":1549},["ShallowReactive",2],{"navigation":3,"page-en-\u002Fresources\u002Fperformance":160,"surround-en-\u002Fresources\u002Fperformance":1544},[4,28,65,99,130,151],{"title":5,"path":6,"stem":7,"children":8,"icon":27},"Getting Started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12,17,22],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-rocket",{"title":23,"path":24,"stem":25,"icon":26},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F4.configuration","i-lucide-settings-2",false,{"title":29,"path":30,"stem":31,"children":32,"icon":34},"Guides","\u002Fguides","2.guides\u002F1.index",[33,35,40,45,50,55,60],{"title":29,"path":30,"stem":31,"icon":34},"i-lucide-book-open",{"title":36,"path":37,"stem":38,"icon":39},"Build a Wallet App","\u002Fguides\u002Fbuild-wallet-app","2.guides\u002F2.build-wallet-app","i-lucide-wallet",{"title":41,"path":42,"stem":43,"icon":44},"Building Transactions","\u002Fguides\u002Ftransactions","2.guides\u002F3.transactions","i-lucide-file-signature",{"title":46,"path":47,"stem":48,"icon":49},"Mint and Burn Tokens Guide","\u002Fguides\u002Fmint-burn-tokens","2.guides\u002F4.mint-burn-tokens","i-lucide-coins",{"title":51,"path":52,"stem":53,"icon":54},"Hydra Integration Examples","\u002Fguides\u002Fhydra-integration","2.guides\u002F5.hydra-integration","i-lucide-network",{"title":56,"path":57,"stem":58,"icon":59},"Utilities Cookbook","\u002Fguides\u002Futilities-cookbook","2.guides\u002F6.utilities-cookbook","i-lucide-wrench",{"title":61,"path":62,"stem":63,"icon":64},"Integrate from Cardano-CLI","\u002Fguides\u002Fcardano-cli-keys","2.guides\u002F7.cardano-cli-keys","i-lucide-key-round",{"title":66,"path":67,"stem":68,"children":69,"icon":98},"Concepts","\u002Fconcepts","3.concepts\u002F1.index",[70,73,78,83,88,93],{"title":71,"path":67,"stem":68,"icon":72},"Why Hydra?","i-lucide-circle-help",{"title":74,"path":75,"stem":76,"icon":77},"Commit to Hydra","\u002Fconcepts\u002Fcommit-to-hydra","3.concepts\u002F2.commit-to-hydra","i-lucide-arrow-down-to-line",{"title":79,"path":80,"stem":81,"icon":82},"Decommit from Hydra","\u002Fconcepts\u002Fdecommit-from-hydra","3.concepts\u002F3.decommit-from-hydra","i-lucide-arrow-up-from-line",{"title":84,"path":85,"stem":86,"icon":87},"Transactions in Hydra","\u002Fconcepts\u002Ftransactions-in-hydra","3.concepts\u002F4.transactions-in-hydra","i-lucide-arrow-left-right",{"title":89,"path":90,"stem":91,"icon":92},"Smart Contracts in Hydra","\u002Fconcepts\u002Fsmart-contracts-in-hydra","3.concepts\u002F5.smart-contracts-in-hydra","i-lucide-file-code-2",{"title":94,"path":95,"stem":96,"icon":97},"Hydra Protocol Versions","\u002Fconcepts\u002Fhydra-v2-changes","3.concepts\u002F6.hydra-v2-changes","i-lucide-git-compare","i-lucide-lightbulb",{"title":100,"path":101,"stem":102,"children":103,"icon":129},"API Reference","\u002Fapi","4.api\u002F1.index",[104,106,111,116,120,125],{"title":100,"path":101,"stem":102,"icon":105},"i-lucide-book-marked",{"title":107,"path":108,"stem":109,"icon":110},"@hydra-sdk\u002Fcore","\u002Fapi\u002Fcore","4.api\u002F2.core","i-lucide-box",{"title":112,"path":113,"stem":114,"icon":115},"@hydra-sdk\u002Fbridge","\u002Fapi\u002Fbridge","4.api\u002F3.bridge","i-lucide-cable",{"title":117,"path":118,"stem":119,"icon":44},"@hydra-sdk\u002Ftransaction","\u002Fapi\u002Ftransaction","4.api\u002F4.transaction",{"title":121,"path":122,"stem":123,"icon":124},"@hydra-sdk\u002Fcardano-wasm","\u002Fapi\u002Fcardano-wasm","4.api\u002F5.cardano-wasm","i-lucide-cpu",{"title":126,"path":127,"stem":128,"icon":59},"@hydra-sdk\u002Fcore - Utilities","\u002Fapi\u002Futilities","4.api\u002F6.utilities","i-lucide-braces",{"title":131,"icon":132,"path":133,"stem":134,"children":135,"page":27},"Resources","i-lucide-archive","\u002Fresources","5.resources",[136,141,146],{"title":137,"path":138,"stem":139,"icon":140},"Change Logs","\u002Fresources\u002Fchangelog","5.resources\u002F1.changelog","i-lucide-history",{"title":142,"path":143,"stem":144,"icon":145},"Migration","\u002Fresources\u002Fmigration","5.resources\u002F2.migration","i-lucide-arrow-right-left",{"title":147,"path":148,"stem":149,"icon":150},"Performance & Comparison","\u002Fresources\u002Fperformance","5.resources\u002F3.performance","i-lucide-gauge",{"title":152,"path":153,"stem":154,"children":155,"icon":159},"AI","\u002Fai","6.ai\u002F1.index",[156],{"title":157,"path":153,"stem":154,"icon":158},"Use with AI","i-lucide-bot","i-lucide-sparkles",{"id":161,"title":147,"body":162,"description":1537,"extension":1538,"links":1539,"meta":1540,"navigation":1541,"path":148,"seo":1542,"stem":149,"__hash__":1543},"docs_en\u002F5.resources\u002F3.performance.md",{"type":163,"value":164,"toc":1510},"minimark",[165,170,184,189,263,266,270,274,419,421,425,431,478,482,516,518,522,527,529,533,538,542,550,554,635,639,642,648,652,931,938,948,1017,1020,1022,1026,1049,1053,1062,1105,1109,1159,1163,1166,1476,1506],[166,167,169],"h2",{"id":168},"why-wasm-for-hydra-sdk","Why WASM for Hydra SDK?",[171,172,173,174,178,179,183],"p",{},"Hydra SDK leverages ",[175,176,177],"strong",{},"WebAssembly (WASM)"," to overcome the limitations of traditional JavaScript-based SDKs like ",[180,181,182],"code",{},"@cardano-sdk",". Here’s why WASM is the optimal choice:",[185,186,188],"h3",{"id":187},"key-advantages-of-wasm","Key Advantages of WASM",[190,191,192,220,240,250],"ol",{},[193,194,195,198,199],"li",{},[175,196,197],{},"Eliminates Node.js Core Module Dependencies",":",[200,201,202,217],"ul",{},[193,203,204,205,208,209,212,213,216],{},"WASM allows critical functionalities (e.g., cryptography, CBOR parsing, transaction building) to run in a sandboxed environment without relying on Node.js core modules like ",[180,206,207],{},"crypto",", ",[180,210,211],{},"stream",", or ",[180,214,215],{},"fs",".",[193,218,219],{},"This ensures compatibility across both browser and Node.js environments.",[193,221,222,198,225],{},[175,223,224],{},"Reduces Bundle Size",[200,226,227,237],{},[193,228,229,230,233,234,216],{},"WASM loads only the required functions, avoiding the need for polyfills like ",[180,231,232],{},"crypto-browserify"," or ",[180,235,236],{},"stream-browserify",[193,238,239],{},"This results in significantly smaller bundles compared to SDKs that rely on Node.js modules.",[193,241,242,198,245],{},[175,243,244],{},"Boosts Performance",[200,246,247],{},[193,248,249],{},"WASM executes cryptographic operations and transaction parsing at near-native speeds, reducing the overhead of JavaScript runtime.",[193,251,252,198,255],{},[175,253,254],{},"Cross-Platform Compatibility",[200,256,257,260],{},[193,258,259],{},"A single WASM binary can run seamlessly on browsers, Node.js (via WASI), and mobile platforms (via bridges).",[193,261,262],{},"This eliminates the need for complex interop between CommonJS and ESM modules.",[264,265],"hr",{},[166,267,269],{"id":268},"comparison-of-cardano-sdk-solutions","Comparison of Cardano SDK Solutions",[185,271,273],{"id":272},"detailed-comparison-table","Detailed Comparison Table",[275,276,277,298],"table",{},[278,279,280],"thead",{},[281,282,283,287,292],"tr",{},[284,285,286],"th",{},"Criteria",[284,288,289],{},[175,290,291],{},"SDKs based on @cardano-sdk",[284,293,294,297],{},[175,295,296],{},"Hydra SDK"," (WASM-based)",[299,300,301,321,334,347,367,380,393,406],"tbody",{},[281,302,303,309,318],{},[304,305,306],"td",{},[175,307,308],{},"Browser Compatibility",[304,310,311,312,208,314,317],{},"Requires polyfills for Node.js core modules; some APIs (e.g., ",[180,313,215],{},[180,315,316],{},"net",") are unavailable.",[304,319,320],{},"Native browser support; no polyfills needed.",[281,322,323,328,331],{},[304,324,325],{},[175,326,327],{},"Bundle Size",[304,329,330],{},"Very large (hundreds of KB to >1MB) due to polyfills.",[304,332,333],{},"Compact (only loads WASM + minimal JS glue code).",[281,335,336,341,344],{},[304,337,338],{},[175,339,340],{},"Node.js Dependency",[304,342,343],{},"High, with direct imports of Node.js core modules.",[304,345,346],{},"None; all core logic resides in WASM.",[281,348,349,354,364],{},[304,350,351],{},[175,352,353],{},"Interop (ESM\u002FCJS)",[304,355,356,357,208,360,363],{},"Prone to errors (",[180,358,359],{},"exports is not defined",[180,361,362],{},".default is not a function",").",[304,365,366],{},"No issues; pure ESM JavaScript.",[281,368,369,374,377],{},[304,370,371],{},[175,372,373],{},"Crypto\u002FCBOR Performance",[304,375,376],{},"Moderate (pure JS, dependent on low-performance polyfills).",[304,378,379],{},"High (WASM near-native speed).",[281,381,382,387,390],{},[304,383,384],{},[175,385,386],{},"Cross-Platform Support",[304,388,389],{},"Good for Node.js, limited for browsers.",[304,391,392],{},"Excellent; works on browsers, Node.js, and mobile.",[281,394,395,400,403],{},[304,396,397],{},[175,398,399],{},"Tree-Shaking",[304,401,402],{},"Limited, as Node.js imports are scattered, leading to unused code in bundles.",[304,404,405],{},"Excellent; only required WASM functions are bundled.",[281,407,408,413,416],{},[304,409,410],{},[175,411,412],{},"Maintenance & Scalability",[304,414,415],{},"Complex, as it requires tracking Node.js API changes and polyfills.",[304,417,418],{},"Easy to maintain; core logic is implemented in Rust\u002FC++ and exposed via WASM.",[264,420],{},[166,422,424],{"id":423},"dependency-flow-diagrams","Dependency Flow Diagrams",[185,426,428,429],{"id":427},"issues-with-sdks-based-on-cardano-sdk","Issues with SDKs based on ",[180,430,182],{},[432,433,438],"pre",{"className":434,"code":435,"language":436,"meta":437,"style":437},"language-mermaid shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","graph TD\n    A[App Browser] --> B[SDKs based on @cardano-sdk]\n    B --> C[Node Core Modules]\n    C -->|Requires Polyfill| D[crypto-browserify, stream-browserify, buffer, util...]\n    D -->|Increases Bundle Size| E[Runtime Errors without Polyfill]\n    C -->|Cannot Polyfill| F[fs, net -> Unusable Features]\n","mermaid","",[180,439,440,448,454,460,466,472],{"__ignoreMap":437},[441,442,445],"span",{"class":443,"line":444},"line",1,[441,446,447],{},"graph TD\n",[441,449,451],{"class":443,"line":450},2,[441,452,453],{},"    A[App Browser] --> B[SDKs based on @cardano-sdk]\n",[441,455,457],{"class":443,"line":456},3,[441,458,459],{},"    B --> C[Node Core Modules]\n",[441,461,463],{"class":443,"line":462},4,[441,464,465],{},"    C -->|Requires Polyfill| D[crypto-browserify, stream-browserify, buffer, util...]\n",[441,467,469],{"class":443,"line":468},5,[441,470,471],{},"    D -->|Increases Bundle Size| E[Runtime Errors without Polyfill]\n",[441,473,475],{"class":443,"line":474},6,[441,476,477],{},"    C -->|Cannot Polyfill| F[fs, net -> Unusable Features]\n",[185,479,481],{"id":480},"hydra-sdk-wasm-based","Hydra SDK (WASM-based)",[432,483,485],{"className":434,"code":484,"language":436,"meta":437,"style":437},"graph TD\n    A[App Browser] --> B[Hydra SDK]\n    B --> C[\"WASM Core (Rust\u002FC++)\"]\n    C --> D[WebAssembly Runtime]\n    D -->|Native Browser API| E[Crypto, CBOR, Tx Builder]\n    D -->|Node.js WASI| F[Crypto, CBOR, Tx Builder]\n",[180,486,487,491,496,501,506,511],{"__ignoreMap":437},[441,488,489],{"class":443,"line":444},[441,490,447],{},[441,492,493],{"class":443,"line":450},[441,494,495],{},"    A[App Browser] --> B[Hydra SDK]\n",[441,497,498],{"class":443,"line":456},[441,499,500],{},"    B --> C[\"WASM Core (Rust\u002FC++)\"]\n",[441,502,503],{"class":443,"line":462},[441,504,505],{},"    C --> D[WebAssembly Runtime]\n",[441,507,508],{"class":443,"line":468},[441,509,510],{},"    D -->|Native Browser API| E[Crypto, CBOR, Tx Builder]\n",[441,512,513],{"class":443,"line":474},[441,514,515],{},"    D -->|Node.js WASI| F[Crypto, CBOR, Tx Builder]\n",[264,517],{},[166,519,521],{"id":520},"conclusion","Conclusion",[171,523,524,525,216],{},"Hydra SDK’s WASM-based architecture provides a robust, efficient, and cross-platform solution for modern Cardano DApps. By eliminating Node.js dependencies, reducing bundle size, and boosting performance, it addresses the limitations of SDKs based on ",[180,526,182],{},[264,528],{},[166,530,532],{"id":531},"in-memory-snapshot-cache-v130","In-Memory Snapshot Cache (v1.3.0+)",[171,534,535,537],{},[180,536,112],{}," adds a two-level in-memory cache that is rebuilt once per snapshot event and read O(1) per request.",[185,539,541],{"id":540},"architecture","Architecture",[432,543,548],{"className":544,"code":546,"language":547},[545],"language-text","Hydra Node (WebSocket)\n  │\n  ├── Greetings { snapshotUtxo }\n  │     └── updateSnapshot() ← O(n) one-time rebuild\n  │\n  └── SnapshotConfirmed { snapshot.utxo }\n        └── updateSnapshot() ← O(n) one-time rebuild, only if snapNum advances\n\nGET balance \u002F query UTxO\n  └── Map.get(address) ← O(1), no I\u002FO, no WASM call\n","text",[180,549,546],{"__ignoreMap":437},[185,551,553],{"id":552},"performance-impact","Performance Impact",[275,555,556,569],{},[278,557,558],{},[281,559,560,563,566],{},[284,561,562],{},"Operation",[284,564,565],{},"Before v1.3.0",[284,567,568],{},"v1.3.0+",[299,570,571,584,597,613,624],{},[281,572,573,578,581],{},[304,574,575],{},[180,576,577],{},"getAddressBalance()",[304,579,580],{},"Not available",[304,582,583],{},"O(1) map lookup, no I\u002FO",[281,585,586,591,594],{},[304,587,588],{},[180,589,590],{},"queryAddressUTxO(address)",[304,592,593],{},"O(n) filter over all UTxOs",[304,595,596],{},"O(1) index lookup",[281,598,599,604,607],{},[304,600,601],{},[180,602,603],{},"addressesInHead()",[304,605,606],{},"O(n) + HTTP call",[304,608,609,610],{},"O(1) ",[180,611,612],{},"Map.keys()",[281,614,615,618,621],{},[304,616,617],{},"100 concurrent balance reads",[304,619,620],{},"100 × scan + alloc",[304,622,623],{},"100 × O(1)",[281,625,626,629,632],{},[304,627,628],{},"Snapshot arrival",[304,630,631],{},"O(1) (store ref)",[304,633,634],{},"O(n) rebuild — once per snapshot",[185,636,638],{"id":637},"memory-usage","Memory Usage",[171,640,641],{},"For a 5 000-UTxO snapshot with 2 000 unique addresses averaging 2 assets each:",[432,643,646],{"className":644,"code":645,"language":547},[545],"addressUtxoIndex: ~200 KB (2000 Map entries)\nbalanceCache:     ~256 KB (4000 inner Map entries)\n────────────────────────────────────────────────\nTotal overhead:   ~500 KB\n",[180,647,645],{"__ignoreMap":437},[185,649,651],{"id":650},"usage","Usage",[432,653,657],{"className":654,"code":655,"language":656,"meta":437,"style":437},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { HydraBridge } from '@hydra-sdk\u002Fbridge'\n\nconst bridge = new HydraBridge({ url: 'ws:\u002F\u002Flocalhost:4001' })\nawait bridge.connect()\n\n\u002F\u002F After Greetings arrives, cache is seeded automatically\n\nconst balance = bridge.getAddressBalance('addr_test1...')\nif (balance === null) {\n    \u002F\u002F Cold start — cache not yet seeded\n} else {\n    const lovelace = balance.get('lovelace') ?? 0n\n    console.log('Balance:', Number(lovelace) \u002F 1_000_000, 'ADA')\n}\n","typescript",[180,658,659,688,694,737,753,757,763,768,796,817,823,835,876,925],{"__ignoreMap":437},[441,660,661,665,669,673,676,679,682,685],{"class":443,"line":444},[441,662,664],{"class":663},"s7zQu","import",[441,666,668],{"class":667},"sMK4o"," {",[441,670,672],{"class":671},"sTEyZ"," HydraBridge",[441,674,675],{"class":667}," }",[441,677,678],{"class":663}," from",[441,680,681],{"class":667}," '",[441,683,112],{"class":684},"sfazB",[441,686,687],{"class":667},"'\n",[441,689,690],{"class":443,"line":450},[441,691,693],{"emptyLinePlaceholder":692},true,"\n",[441,695,696,700,703,706,709,712,715,718,722,724,726,729,732,734],{"class":443,"line":456},[441,697,699],{"class":698},"spNyl","const",[441,701,702],{"class":671}," bridge ",[441,704,705],{"class":667},"=",[441,707,708],{"class":667}," new",[441,710,672],{"class":711},"s2Zo4",[441,713,714],{"class":671},"(",[441,716,717],{"class":667},"{",[441,719,721],{"class":720},"swJcz"," url",[441,723,198],{"class":667},[441,725,681],{"class":667},[441,727,728],{"class":684},"ws:\u002F\u002Flocalhost:4001",[441,730,731],{"class":667},"'",[441,733,675],{"class":667},[441,735,736],{"class":671},")\n",[441,738,739,742,745,747,750],{"class":443,"line":462},[441,740,741],{"class":663},"await",[441,743,744],{"class":671}," bridge",[441,746,216],{"class":667},[441,748,749],{"class":711},"connect",[441,751,752],{"class":671},"()\n",[441,754,755],{"class":443,"line":468},[441,756,693],{"emptyLinePlaceholder":692},[441,758,759],{"class":443,"line":474},[441,760,762],{"class":761},"sHwdD","\u002F\u002F After Greetings arrives, cache is seeded automatically\n",[441,764,766],{"class":443,"line":765},7,[441,767,693],{"emptyLinePlaceholder":692},[441,769,771,773,776,778,780,782,785,787,789,792,794],{"class":443,"line":770},8,[441,772,699],{"class":698},[441,774,775],{"class":671}," balance ",[441,777,705],{"class":667},[441,779,744],{"class":671},[441,781,216],{"class":667},[441,783,784],{"class":711},"getAddressBalance",[441,786,714],{"class":671},[441,788,731],{"class":667},[441,790,791],{"class":684},"addr_test1...",[441,793,731],{"class":667},[441,795,736],{"class":671},[441,797,799,802,805,808,811,814],{"class":443,"line":798},9,[441,800,801],{"class":663},"if",[441,803,804],{"class":671}," (balance ",[441,806,807],{"class":667},"===",[441,809,810],{"class":667}," null",[441,812,813],{"class":671},") ",[441,815,816],{"class":667},"{\n",[441,818,820],{"class":443,"line":819},10,[441,821,822],{"class":761},"    \u002F\u002F Cold start — cache not yet seeded\n",[441,824,826,829,832],{"class":443,"line":825},11,[441,827,828],{"class":667},"}",[441,830,831],{"class":663}," else",[441,833,834],{"class":667}," {\n",[441,836,838,841,844,847,850,852,855,857,859,862,864,866,869,873],{"class":443,"line":837},12,[441,839,840],{"class":698},"    const",[441,842,843],{"class":671}," lovelace",[441,845,846],{"class":667}," =",[441,848,849],{"class":671}," balance",[441,851,216],{"class":667},[441,853,854],{"class":711},"get",[441,856,714],{"class":720},[441,858,731],{"class":667},[441,860,861],{"class":684},"lovelace",[441,863,731],{"class":667},[441,865,813],{"class":720},[441,867,868],{"class":667},"??",[441,870,872],{"class":871},"sbssI"," 0",[441,874,875],{"class":698},"n\n",[441,877,879,882,884,887,889,891,894,896,899,902,904,906,908,911,914,916,918,921,923],{"class":443,"line":878},13,[441,880,881],{"class":671},"    console",[441,883,216],{"class":667},[441,885,886],{"class":711},"log",[441,888,714],{"class":720},[441,890,731],{"class":667},[441,892,893],{"class":684},"Balance:",[441,895,731],{"class":667},[441,897,898],{"class":667},",",[441,900,901],{"class":711}," Number",[441,903,714],{"class":720},[441,905,861],{"class":671},[441,907,813],{"class":720},[441,909,910],{"class":667},"\u002F",[441,912,913],{"class":871}," 1_000_000",[441,915,898],{"class":667},[441,917,681],{"class":667},[441,919,920],{"class":684},"ADA",[441,922,731],{"class":667},[441,924,736],{"class":720},[441,926,928],{"class":443,"line":927},14,[441,929,930],{"class":667},"}\n",[185,932,934,935,937],{"id":933},"bounded-datum-cache-hydra-sdkcore","Bounded Datum Cache (",[180,936,107],{},")",[171,939,940,943,944,947],{},[180,941,942],{},"convertUTxOObjectToUTxOWithOptions"," accepts ",[180,945,946],{},"maxDatumCacheSize"," to cap the number of deserialized inline datums kept in memory:",[432,949,951],{"className":654,"code":950,"language":656,"meta":437,"style":437},"import { Converter } from '@hydra-sdk\u002Fcore'\n\nconst utxos = Converter.convertUTxOObjectToUTxOWithOptions(snapshotUtxo, {\n    maxDatumCacheSize: 1024  \u002F\u002F default; set to 0 to disable\n})\n",[180,952,953,972,976,998,1011],{"__ignoreMap":437},[441,954,955,957,959,962,964,966,968,970],{"class":443,"line":444},[441,956,664],{"class":663},[441,958,668],{"class":667},[441,960,961],{"class":671}," Converter",[441,963,675],{"class":667},[441,965,678],{"class":663},[441,967,681],{"class":667},[441,969,107],{"class":684},[441,971,687],{"class":667},[441,973,974],{"class":443,"line":450},[441,975,693],{"emptyLinePlaceholder":692},[441,977,978,980,983,985,987,989,991,994,996],{"class":443,"line":456},[441,979,699],{"class":698},[441,981,982],{"class":671}," utxos ",[441,984,705],{"class":667},[441,986,961],{"class":671},[441,988,216],{"class":667},[441,990,942],{"class":711},[441,992,993],{"class":671},"(snapshotUtxo",[441,995,898],{"class":667},[441,997,834],{"class":667},[441,999,1000,1003,1005,1008],{"class":443,"line":462},[441,1001,1002],{"class":720},"    maxDatumCacheSize",[441,1004,198],{"class":667},[441,1006,1007],{"class":871}," 1024",[441,1009,1010],{"class":761},"  \u002F\u002F default; set to 0 to disable\n",[441,1012,1013,1015],{"class":443,"line":468},[441,1014,828],{"class":667},[441,1016,736],{"class":671},[171,1018,1019],{},"Entries are evicted in insertion order (oldest first) when the limit is reached.",[264,1021],{},[166,1023,1025],{"id":1024},"txbuilder-wasm-memory-v120","TxBuilder WASM Memory (v1.2.0+)",[171,1027,1028,1029,1032,1033,1036,1037,1040,1041,1044,1045,1048],{},"Every ",[180,1030,1031],{},"@emurgo\u002Fcardano-serialization-lib"," object lives in ",[175,1034,1035],{},"WASM linear memory"," and is only reclaimed when you call ",[180,1038,1039],{},".free()",". CSL relies on a ",[180,1042,1043],{},"FinalizationRegistry"," for automatic cleanup, but that runs non-deterministically and lags far behind a tight build loop. Before v1.2.0, building thousands of transactions in a row (e.g. spike-building inside a Hydra Head) leaked the WASM heap and made each successive ",[180,1046,1047],{},"build_tx()"," slower.",[185,1050,1052],{"id":1051},"what-changed","What changed",[171,1054,1055,1058,1059,198],{},[180,1056,1057],{},"@hydra-sdk\u002Ftransaction@1.2.0"," frees the WASM objects it allocates ",[175,1060,1061],{},"deterministically",[200,1063,1064,1082,1095],{},[193,1065,1066,1067,1070,1071,1074,1075,1077,1078,1081],{},"Every internally-allocated CSL object during ",[180,1068,1069],{},"complete()"," is tracked and freed in a ",[180,1072,1073],{},"finally"," block after ",[180,1076,1047],{},". The returned ",[180,1079,1080],{},"Transaction"," is an independent struct and is unaffected; caller-supplied objects (datum \u002F redeemer \u002F script) are never freed.",[193,1083,1084,208,1087,1090,1091,1094],{},[180,1085,1086],{},"reset()",[180,1088,1089],{},"changeAddress()",", and ",[180,1092,1093],{},"updateProtocolParams()"," free the state objects they replace.",[193,1096,1097,1100,1101,1104],{},[180,1098,1099],{},"dispose()"," (and ",[180,1102,1103],{},"[Symbol.dispose]",") release everything the builder still holds.",[185,1106,1108],{"id":1107},"measured-impact","Measured impact",[275,1110,1111,1124],{},[278,1112,1113],{},[281,1114,1115,1118,1121],{},[284,1116,1117],{},"Metric",[284,1119,1120],{},"Before v1.2.0",[284,1122,1123],{},"v1.2.0+",[299,1125,1126,1137,1148],{},[281,1127,1128,1131,1134],{},[304,1129,1130],{},"WASM heap over 10,000 builds",[304,1132,1133],{},"Grows unbounded",[304,1135,1136],{},"Flat (~0 KB\u002Fiter)",[281,1138,1139,1142,1145],{},[304,1140,1141],{},"Per-transaction build time",[304,1143,1144],{},"Degrades steadily",[304,1146,1147],{},"Steady",[281,1149,1150,1153,1156],{},[304,1151,1152],{},"Existing test suite",[304,1154,1155],{},"—",[304,1157,1158],{},"280 tests unchanged",[185,1160,1162],{"id":1161},"patterns-for-high-volume-workloads","Patterns for high-volume workloads",[171,1164,1165],{},"Pick the path that frees memory for you:",[432,1167,1169],{"className":654,"code":1168,"language":656,"meta":437,"style":437},"import { TxBuilder } from '@hydra-sdk\u002Ftransaction'\n\n\u002F\u002F 1. completeCbor() — you only need the bytes; the Transaction is freed for you\nconst cbor = await new TxBuilder()\n  .setInputs(utxos)\n  .txOut(addr, [{ unit: 'lovelace', quantity: '1000000' }])\n  .changeAddress(addr)\n  .completeCbor()\n\n\u002F\u002F 2. `using` — builder disposed automatically at end of scope (TS 5.2+)\n{\n  using builder = new TxBuilder()\n  const bytes = await builder.setInputs(utxos).\u002F* … *\u002F.completeCbor()\n}\n\n\u002F\u002F 3. Reuse one builder across a spike, then dispose once\nconst builder = new TxBuilder()\nfor (const job of jobs) {\n  const bytes = await builder.reset().setInputs(job.utxos).\u002F* … *\u002F.completeCbor()\n}\nbuilder.dispose()\n",[180,1170,1171,1190,1194,1199,1217,1228,1275,1285,1294,1298,1303,1307,1323,1359,1363,1368,1374,1390,1412,1458,1463],{"__ignoreMap":437},[441,1172,1173,1175,1177,1180,1182,1184,1186,1188],{"class":443,"line":444},[441,1174,664],{"class":663},[441,1176,668],{"class":667},[441,1178,1179],{"class":671}," TxBuilder",[441,1181,675],{"class":667},[441,1183,678],{"class":663},[441,1185,681],{"class":667},[441,1187,117],{"class":684},[441,1189,687],{"class":667},[441,1191,1192],{"class":443,"line":450},[441,1193,693],{"emptyLinePlaceholder":692},[441,1195,1196],{"class":443,"line":456},[441,1197,1198],{"class":761},"\u002F\u002F 1. completeCbor() — you only need the bytes; the Transaction is freed for you\n",[441,1200,1201,1203,1206,1208,1211,1213,1215],{"class":443,"line":462},[441,1202,699],{"class":698},[441,1204,1205],{"class":671}," cbor ",[441,1207,705],{"class":667},[441,1209,1210],{"class":663}," await",[441,1212,708],{"class":667},[441,1214,1179],{"class":711},[441,1216,752],{"class":671},[441,1218,1219,1222,1225],{"class":443,"line":468},[441,1220,1221],{"class":667},"  .",[441,1223,1224],{"class":711},"setInputs",[441,1226,1227],{"class":671},"(utxos)\n",[441,1229,1230,1232,1235,1238,1240,1243,1245,1248,1250,1252,1254,1256,1258,1261,1263,1265,1268,1270,1272],{"class":443,"line":474},[441,1231,1221],{"class":667},[441,1233,1234],{"class":711},"txOut",[441,1236,1237],{"class":671},"(addr",[441,1239,898],{"class":667},[441,1241,1242],{"class":671}," [",[441,1244,717],{"class":667},[441,1246,1247],{"class":720}," unit",[441,1249,198],{"class":667},[441,1251,681],{"class":667},[441,1253,861],{"class":684},[441,1255,731],{"class":667},[441,1257,898],{"class":667},[441,1259,1260],{"class":720}," quantity",[441,1262,198],{"class":667},[441,1264,681],{"class":667},[441,1266,1267],{"class":684},"1000000",[441,1269,731],{"class":667},[441,1271,675],{"class":667},[441,1273,1274],{"class":671},"])\n",[441,1276,1277,1279,1282],{"class":443,"line":765},[441,1278,1221],{"class":667},[441,1280,1281],{"class":711},"changeAddress",[441,1283,1284],{"class":671},"(addr)\n",[441,1286,1287,1289,1292],{"class":443,"line":770},[441,1288,1221],{"class":667},[441,1290,1291],{"class":711},"completeCbor",[441,1293,752],{"class":671},[441,1295,1296],{"class":443,"line":798},[441,1297,693],{"emptyLinePlaceholder":692},[441,1299,1300],{"class":443,"line":819},[441,1301,1302],{"class":761},"\u002F\u002F 2. `using` — builder disposed automatically at end of scope (TS 5.2+)\n",[441,1304,1305],{"class":443,"line":825},[441,1306,816],{"class":667},[441,1308,1309,1312,1315,1317,1319,1321],{"class":443,"line":837},[441,1310,1311],{"class":698},"  using",[441,1313,1314],{"class":671}," builder",[441,1316,846],{"class":667},[441,1318,708],{"class":667},[441,1320,1179],{"class":711},[441,1322,752],{"class":720},[441,1324,1325,1328,1331,1333,1335,1337,1339,1341,1343,1346,1348,1350,1353,1355,1357],{"class":443,"line":878},[441,1326,1327],{"class":698},"  const",[441,1329,1330],{"class":671}," bytes",[441,1332,846],{"class":667},[441,1334,1210],{"class":663},[441,1336,1314],{"class":671},[441,1338,216],{"class":667},[441,1340,1224],{"class":711},[441,1342,714],{"class":720},[441,1344,1345],{"class":671},"utxos",[441,1347,937],{"class":720},[441,1349,216],{"class":667},[441,1351,1352],{"class":761},"\u002F* … *\u002F",[441,1354,216],{"class":667},[441,1356,1291],{"class":711},[441,1358,752],{"class":720},[441,1360,1361],{"class":443,"line":927},[441,1362,930],{"class":667},[441,1364,1366],{"class":443,"line":1365},15,[441,1367,693],{"emptyLinePlaceholder":692},[441,1369,1371],{"class":443,"line":1370},16,[441,1372,1373],{"class":761},"\u002F\u002F 3. Reuse one builder across a spike, then dispose once\n",[441,1375,1377,1379,1382,1384,1386,1388],{"class":443,"line":1376},17,[441,1378,699],{"class":698},[441,1380,1381],{"class":671}," builder ",[441,1383,705],{"class":667},[441,1385,708],{"class":667},[441,1387,1179],{"class":711},[441,1389,752],{"class":671},[441,1391,1393,1396,1399,1401,1404,1407,1410],{"class":443,"line":1392},18,[441,1394,1395],{"class":663},"for",[441,1397,1398],{"class":671}," (",[441,1400,699],{"class":698},[441,1402,1403],{"class":671}," job ",[441,1405,1406],{"class":667},"of",[441,1408,1409],{"class":671}," jobs) ",[441,1411,816],{"class":667},[441,1413,1415,1417,1419,1421,1423,1425,1427,1430,1433,1435,1437,1439,1442,1444,1446,1448,1450,1452,1454,1456],{"class":443,"line":1414},19,[441,1416,1327],{"class":698},[441,1418,1330],{"class":671},[441,1420,846],{"class":667},[441,1422,1210],{"class":663},[441,1424,1314],{"class":671},[441,1426,216],{"class":667},[441,1428,1429],{"class":711},"reset",[441,1431,1432],{"class":720},"()",[441,1434,216],{"class":667},[441,1436,1224],{"class":711},[441,1438,714],{"class":720},[441,1440,1441],{"class":671},"job",[441,1443,216],{"class":667},[441,1445,1345],{"class":671},[441,1447,937],{"class":720},[441,1449,216],{"class":667},[441,1451,1352],{"class":761},[441,1453,216],{"class":667},[441,1455,1291],{"class":711},[441,1457,752],{"class":720},[441,1459,1461],{"class":443,"line":1460},20,[441,1462,930],{"class":667},[441,1464,1466,1469,1471,1474],{"class":443,"line":1465},21,[441,1467,1468],{"class":671},"builder",[441,1470,216],{"class":667},[441,1472,1473],{"class":711},"dispose",[441,1475,752],{"class":671},[1477,1478,1479],"warning",{},[171,1480,1481,1482,1484,1485,1487,1488,1490,1491,1494,1495,1498,1499,1502,1503,216],{},"If you keep the live ",[180,1483,1080],{}," from ",[180,1486,1069],{}," (e.g. ",[180,1489,1069],{}," + ",[180,1492,1493],{},".to_hex()","), ",[175,1496,1497],{},"you"," own it — call ",[180,1500,1501],{},"tx.free()"," when done. Under high volume, prefer ",[180,1504,1505],{},"completeCbor()",[1507,1508,1509],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":437,"searchDepth":444,"depth":450,"links":1511},[1512,1515,1518,1523,1524,1532],{"id":168,"depth":450,"text":169,"children":1513},[1514],{"id":187,"depth":456,"text":188},{"id":268,"depth":450,"text":269,"children":1516},[1517],{"id":272,"depth":456,"text":273},{"id":423,"depth":450,"text":424,"children":1519},[1520,1522],{"id":427,"depth":456,"text":1521},"Issues with SDKs based on @cardano-sdk",{"id":480,"depth":456,"text":481},{"id":520,"depth":450,"text":521},{"id":531,"depth":450,"text":532,"children":1525},[1526,1527,1528,1529,1530],{"id":540,"depth":456,"text":541},{"id":552,"depth":456,"text":553},{"id":637,"depth":456,"text":638},{"id":650,"depth":456,"text":651},{"id":933,"depth":456,"text":1531},"Bounded Datum Cache (@hydra-sdk\u002Fcore)",{"id":1024,"depth":450,"text":1025,"children":1533},[1534,1535,1536],{"id":1051,"depth":456,"text":1052},{"id":1107,"depth":456,"text":1108},{"id":1161,"depth":456,"text":1162},"Why Hydra SDK uses WebAssembly, with benchmarks against JavaScript-based Cardano SDKs.","md",null,{},{"icon":150},{"title":147,"description":1537},"XvFpundmHbPduR5PH8rBQlH89AZ7osfgD-UgyMT_0IU",[1545,1547],{"title":142,"path":143,"stem":144,"description":1546,"icon":145,"children":-1},"Upgrade paths for Hydra SDK — bridge v1.x → v2.0, and the earlier v1.1.x utilities system.",{"title":157,"path":153,"stem":154,"description":1548,"icon":158,"children":-1},"Query the Hydra SDK docs from AI assistants via the built-in MCP server, llms.txt, and raw markdown endpoints.",1784812307188]