Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sidan-lab/sidan-csl-rs-browser

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sidan-lab/sidan-csl-rs-browser

Wrapper around the cardano-serialization-lib for easier transaction building, heavily inspired by cardano-cli APIs

  • 0.2.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
698
decreased by-29.85%
Maintainers
1
Weekly downloads
 
Created
Source

sidan-csl-rs

This is a library for building off-chain code on Cardano. It is a cardano-cli like wrapper on cardano-serialization-lib (equivalent on MeshJS’s lower level APIs), supporting serious DApps’ backend on rust codebase. It has an active F11 proposal for supporting the development.

Installation

Rust Library

cargo add sidan-csl-rs

JS / TS WASM Lib

  • To be added

APIs

The APIs of sidan-csl-rs consists of 3 parts:

1. APIs on core CSL logics

TypeNameDescription
MeshCSL Propertytx_hexThis is the transaction hex, used for storing the transaction in hexadecimal format.
MeshCSL Propertytx_builderThis is the transaction builder, used for building transactions.
MeshCSL Propertytx_inputs_builderThis is the transaction inputs builder, used for building the inputs of a transaction.
MeshCSL Methodadd_tx_inThis method is used to add a transaction input.
MeshCSL Methodadd_script_tx_inThis method is used to add a script transaction input.
MeshCSL Methodadd_outputThis method is used to add an output.
MeshCSL Methodadd_collateralThis method is used to add collateral.
MeshCSL Methodadd_reference_inputThis method is used to add a reference input.
MeshCSL Methodadd_plutus_mintThis method is used to add a Plutus mint.
MeshCSL Methodadd_native_mintThis method is used to add a native mint.
MeshCSL Methodadd_invalid_beforeThis method is used to add an invalid before condition.
MeshCSL Methodadd_invalid_hereafterThis method is used to add an invalid hereafter condition.
MeshCSL Methodadd_changeThis method is used to add change.
MeshCSL Methodadd_signing_keysThis method is used to add signing keys.
MeshCSL Methodadd_required_signatureThis method is used to add a required signature.
MeshCSL Methodadd_metadataThis method is used to add metadata.
MeshCSL Methodadd_script_hashThis method is used to add a script hash.
MeshCSL Methodbuild_txThis method is used to build the transaction to hex in CSL.
Util Functionapply_params_to_scriptTo compile Aiken parameterized scripts.
Util Functionscript_to_addressTo obtain script address with provided hash and stake cred
Util Functionserialize_bech32_addressTo obtain pub key hash, script hash and stake cred from bech32 address
Util Functionget_v2_script_hashTo obtain script hash from script cbor
Util Functioncalculate_tx_hashTo calculate the transaction hash from signed or unsigned hex
Util Functionsign_transactionTo add private key signature to current tx_hex
Util FunctionmeshToPlutusDataTo be added -To serialize plutus data from mesh data type
Util FunctionjsonToPlutusDataTo be added -To serialize plutus data from json
Util FunctioncborToPlutusDataTo be added -To serialize plutus data from cbor
Util FunctionTo be addedTo be added - A bunch of other methods that need CSL to serialized / deserialized

2. MeshTxBuilderCore

2.1 User-facing wrapper APIs
TypeMethodDescription
MeshTxBuilderCore User-facing Methodtx_inSets the input for the transaction.
MeshTxBuilderCore User-facing Methodtx_in_scriptSets the script for the transaction input.
MeshTxBuilderCore User-facing Methodtx_in_datum_valueSets the input datum for the transaction input.
MeshTxBuilderCore User-facing Methodtx_in_inline_datum_presentIndicates that the input UTxO has inlined datum.
MeshTxBuilderCore User-facing Methodtx_in_redeemer_valueSets the redeemer for the reference input to be spent in the same transaction.
MeshTxBuilderCore User-facing Methodtx_outSets the output for the transaction.
MeshTxBuilderCore User-facing Methodtx_out_datum_hash_valueSets the output datum hash for the transaction.
MeshTxBuilderCore User-facing Methodtx_out_inline_datum_valueSets the output inline datum for the transaction.
MeshTxBuilderCore User-facing Methodtx_out_reference_scriptSets the reference script to be attached with the output.
MeshTxBuilderCore User-facing Methodspending_plutus_script_v2Indicates that it is currently using V2 Plutus spending scripts.
MeshTxBuilderCore User-facing Methodspending_tx_in_referenceSets the reference input where it would also be spent in the transaction.
MeshTxBuilderCore User-facing Methodspending_reference_tx_in_inline_datum_presentIndicates that the reference input has inline datum.
MeshTxBuilderCore User-facing Methodspending_reference_tx_in_redeemer_valueSets the redeemer for the reference input to be spent in the same transaction.
MeshTxBuilderCore User-facing Methodread_only_tx_in_referenceSpecifies a read-only reference input.
MeshTxBuilderCore User-facing Methodmint_plutus_script_v2Indicates that it is currently using V2 Plutus minting scripts.
MeshTxBuilderCore User-facing MethodmintSets the minting value of the transaction.
MeshTxBuilderCore User-facing Methodminting_scriptSets the minting script of the current mint.
MeshTxBuilderCore User-facing Methodmint_tx_in_referenceUses reference script for minting.
MeshTxBuilderCore User-facing Methodmint_redeemer_valueSets the redeemer for the reference input to be spent in the same transaction.
MeshTxBuilderCore User-facing Methodmint_reference_tx_in_redeemer_valueSets the redeemer for minting.
MeshTxBuilderCore User-facing Methodrequired_signer_hashSets the required signer of the transaction.
MeshTxBuilderCore User-facing Methodtx_in_collateralSets the collateral UTxO for the transaction.
MeshTxBuilderCore User-facing Methodchange_addressConfigures the address to accept change UTxO.
MeshTxBuilderCore User-facing Methodchange_output_datum[To be implemented]
MeshTxBuilderCore User-facing Methodinvalid_beforeSets the transaction valid interval to be valid only after the slot.
MeshTxBuilderCore User-facing Methodinvalid_hereafterSets the transaction valid interval to be valid only before the slot.
MeshTxBuilderCore User-facing Methodmetadata_valueAdds metadata to the transaction.
MeshTxBuilderCore User-facing Methodsigning_keySigns the transaction with the private key.
MeshTxBuilderCore User-facing Methodtx_hexObtain the current transaction hex from build
MeshTxBuilderCore User-facing Methodreset[To be implemented] Resetting the whole MeshTxBuilderCore
MeshTxBuilderCore User-facing MethodemptyTxBuilderBody[To be implemented] Resetting the body object
MeshTxBuilderCore User-facing Methodcomplete_syncDetermine whether using customizedTx, if not queue all last items then serialize the tx
MeshTxBuilderCore User-facing Methodcomplete_signingAdding signing keys and return txHex
MeshTxBuilderCore Internal Methodserialize_tx_bodyTake the tx object and serialized it to txHex
MeshTxBuilderCore Internal MethodupdateRedeemer[To be implemented] Update SPEND and MINT exUnits
MeshTxBuilderCore Internal Methodqueue_input[To be implemented]
MeshTxBuilderCore Internal Methodqueue_mint[To be implemented]
MeshTxBuilderCore Internal Methodqueue_all_last_item[To be implemented]
MeshTxBuilderCore Internal Methodadd_all_signing_keys[To be implemented]
MeshTxBuilderCore Internal Methodadd_all_inputs[To be implemented]
MeshTxBuilderCore Internal Methodadd_all_outputs[To be implemented]
MeshTxBuilderCore Internal Methodadd_all_collaterals[To be implemented]
MeshTxBuilderCore Internal Methodadd_all_reference_inputs[To be implemented]
MeshTxBuilderCore Internal Methodadd_all_mints[To be implemented]
MeshTxBuilderCore Internal MethodcastRawDataToJsonString[To be implemented] Turn object to string, keep string as string
MeshTxBuilderCore Internal MethodcastDataToPlutusData[To be implemented]

FAQs

Package last updated on 20 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc