@helios-lang/effect 0.1.15 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Cardano/CoinSelection.js +130 -0
- package/dist/Cardano/CoinSelection.js.map +1 -0
- package/dist/{Ledger → Cardano/Ledger}/Address.js +31 -21
- package/dist/Cardano/Ledger/Address.js.map +1 -0
- package/dist/{Ledger → Cardano/Ledger}/AssetClass.js +16 -11
- package/dist/Cardano/Ledger/AssetClass.js.map +1 -0
- package/dist/Cardano/Ledger/Assets.js +235 -0
- package/dist/Cardano/Ledger/Assets.js.map +1 -0
- package/dist/Cardano/Ledger/Credential.js +53 -0
- package/dist/Cardano/Ledger/Credential.js.map +1 -0
- package/dist/Cardano/Ledger/DCert.js +117 -0
- package/dist/Cardano/Ledger/DCert.js.map +1 -0
- package/dist/Cardano/Ledger/DatumHash.js +25 -0
- package/dist/Cardano/Ledger/DatumHash.js.map +1 -0
- package/dist/Cardano/Ledger/MintingPolicy.js +40 -0
- package/dist/Cardano/Ledger/MintingPolicy.js.map +1 -0
- package/dist/Cardano/Ledger/NativeScript.js +140 -0
- package/dist/Cardano/Ledger/NativeScript.js.map +1 -0
- package/dist/Cardano/Ledger/PubKey.js +24 -0
- package/dist/Cardano/Ledger/PubKey.js.map +1 -0
- package/dist/{Ledger → Cardano/Ledger}/PubKeyHash.js +5 -5
- package/dist/Cardano/Ledger/PubKeyHash.js.map +1 -0
- package/dist/Cardano/Ledger/Redeemer.js +155 -0
- package/dist/Cardano/Ledger/Redeemer.js.map +1 -0
- package/dist/Cardano/Ledger/RewardAddress.js +93 -0
- package/dist/Cardano/Ledger/RewardAddress.js.map +1 -0
- package/dist/Cardano/Ledger/Signature.js +23 -0
- package/dist/Cardano/Ledger/Signature.js.map +1 -0
- package/dist/Cardano/Ledger/Tx.js +498 -0
- package/dist/Cardano/Ledger/Tx.js.map +1 -0
- package/dist/Cardano/Ledger/TxHash.js +38 -0
- package/dist/Cardano/Ledger/TxHash.js.map +1 -0
- package/dist/Cardano/Ledger/TxOutput.js +167 -0
- package/dist/Cardano/Ledger/TxOutput.js.map +1 -0
- package/dist/{Ledger → Cardano/Ledger}/TxOutputDatum.js +44 -8
- package/dist/Cardano/Ledger/TxOutputDatum.js.map +1 -0
- package/dist/Cardano/Ledger/UTxO.js +100 -0
- package/dist/Cardano/Ledger/UTxO.js.map +1 -0
- package/dist/{Ledger → Cardano/Ledger}/UTxORef.js +28 -6
- package/dist/Cardano/Ledger/UTxORef.js.map +1 -0
- package/dist/{Ledger → Cardano/Ledger}/ValidatorHash.js +5 -5
- package/dist/Cardano/Ledger/ValidatorHash.js.map +1 -0
- package/dist/{Ledger → Cardano/Ledger}/index.js +6 -0
- package/dist/Cardano/Ledger/index.js.map +1 -0
- package/dist/Cardano/Network/IsMainnet.js.map +1 -0
- package/dist/{Network → Cardano/Network}/Params.js +27 -3
- package/dist/Cardano/Network/Params.js.map +1 -0
- package/dist/Cardano/Network/UTxO.js +20 -0
- package/dist/Cardano/Network/UTxO.js.map +1 -0
- package/dist/Cardano/Network/UTxOsAt.js +4 -0
- package/dist/Cardano/Network/UTxOsAt.js.map +1 -0
- package/dist/Cardano/Network/errors.js +33 -0
- package/dist/Cardano/Network/errors.js.map +1 -0
- package/dist/{Network → Cardano/Network}/index.js +1 -0
- package/dist/Cardano/Network/index.js.map +1 -0
- package/dist/Cardano/TxBuilder.js +963 -0
- package/dist/Cardano/TxBuilder.js.map +1 -0
- package/dist/Cardano/Uplc/Builtins.js +1820 -0
- package/dist/Cardano/Uplc/Builtins.js.map +1 -0
- package/dist/Cardano/Uplc/Cek.js +716 -0
- package/dist/Cardano/Uplc/Cek.js.map +1 -0
- package/dist/Cardano/Uplc/Cost.js +956 -0
- package/dist/Cardano/Uplc/Cost.js.map +1 -0
- package/dist/{Uplc → Cardano/Uplc}/Data.js +143 -22
- package/dist/Cardano/Uplc/Data.js.map +1 -0
- package/dist/Cardano/Uplc/Script.js +118 -0
- package/dist/Cardano/Uplc/Script.js.map +1 -0
- package/dist/Cardano/Uplc/ScriptContext.js +259 -0
- package/dist/Cardano/Uplc/ScriptContext.js.map +1 -0
- package/dist/Cardano/Uplc/Term.js +384 -0
- package/dist/Cardano/Uplc/Term.js.map +1 -0
- package/dist/Cardano/Uplc/Type.js +131 -0
- package/dist/Cardano/Uplc/Type.js.map +1 -0
- package/dist/Cardano/Uplc/Value.js +315 -0
- package/dist/Cardano/Uplc/Value.js.map +1 -0
- package/dist/Cardano/Uplc/index.js +7 -0
- package/dist/Cardano/Uplc/index.js.map +1 -0
- package/dist/Cardano/Wallet.js +48 -0
- package/dist/Cardano/Wallet.js.map +1 -0
- package/dist/Cardano/index.js +7 -0
- package/dist/Cardano/index.js.map +1 -0
- package/dist/{internal → Codecs}/Base32.js +2 -2
- package/dist/Codecs/Base32.js.map +1 -0
- package/dist/{Bech32.js → Codecs/Bech32.js} +2 -2
- package/dist/Codecs/Bech32.js.map +1 -0
- package/dist/Codecs/BigEndian.js.map +1 -0
- package/dist/Codecs/Bits.js.map +1 -0
- package/dist/{internal → Codecs}/Bytes.js +23 -12
- package/dist/Codecs/Bytes.js.map +1 -0
- package/dist/{Cbor.js → Codecs/Cbor.js} +559 -328
- package/dist/Codecs/Cbor.js.map +1 -0
- package/dist/{internal → Codecs}/Flat.js +16 -0
- package/dist/Codecs/Flat.js.map +1 -0
- package/dist/Codecs/Float.js.map +1 -0
- package/dist/Codecs/LittleEndian.js +31 -0
- package/dist/Codecs/LittleEndian.js.map +1 -0
- package/dist/Codecs/Uint64.js +89 -0
- package/dist/Codecs/Uint64.js.map +1 -0
- package/dist/{internal → Codecs}/Utf8.js +7 -2
- package/dist/Codecs/Utf8.js.map +1 -0
- package/dist/Codecs/ZigZag.js +26 -0
- package/dist/Codecs/ZigZag.js.map +1 -0
- package/dist/Codecs/index.js +8 -0
- package/dist/Codecs/index.js.map +1 -0
- package/dist/Crypto/Bip32.js +131 -0
- package/dist/Crypto/Bip32.js.map +1 -0
- package/dist/Crypto/Bip39.js +2176 -0
- package/dist/Crypto/Bip39.js.map +1 -0
- package/dist/Crypto/Blake2b.js +156 -0
- package/dist/Crypto/Blake2b.js.map +1 -0
- package/dist/Crypto/Curve.js +92 -0
- package/dist/Crypto/Curve.js.map +1 -0
- package/dist/Crypto/Ed25519.js +323 -0
- package/dist/Crypto/Ed25519.js.map +1 -0
- package/dist/Crypto/EdDSA.js +222 -0
- package/dist/Crypto/EdDSA.js.map +1 -0
- package/dist/Crypto/Field.js +323 -0
- package/dist/Crypto/Field.js.map +1 -0
- package/dist/Crypto/Hmac.js +51 -0
- package/dist/Crypto/Hmac.js.map +1 -0
- package/dist/Crypto/Keccak.js +167 -0
- package/dist/Crypto/Keccak.js.map +1 -0
- package/dist/Crypto/Pbkdf2.js +45 -0
- package/dist/Crypto/Pbkdf2.js.map +1 -0
- package/dist/Crypto/Sha2_256.js +200 -0
- package/dist/Crypto/Sha2_256.js.map +1 -0
- package/dist/Crypto/Sha2_512.js +264 -0
- package/dist/Crypto/Sha2_512.js.map +1 -0
- package/dist/Crypto/Sha3_256.js +10 -0
- package/dist/Crypto/Sha3_256.js.map +1 -0
- package/dist/Crypto/errors.js +9 -0
- package/dist/Crypto/errors.js.map +1 -0
- package/dist/Crypto/index.js +12 -0
- package/dist/Crypto/index.js.map +1 -0
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/package.json +24 -6
- package/tsconfig.build.json +1 -1
- package/types/Cardano/CoinSelection.d.ts +26 -0
- package/types/Cardano/CoinSelection.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/Address.d.ts +8 -7
- package/types/Cardano/Ledger/Address.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/AssetClass.d.ts +2 -2
- package/types/Cardano/Ledger/AssetClass.d.ts.map +1 -0
- package/types/Cardano/Ledger/Assets.d.ts +114 -0
- package/types/Cardano/Ledger/Assets.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/Credential.d.ts +10 -4
- package/types/Cardano/Ledger/Credential.d.ts.map +1 -0
- package/types/Cardano/Ledger/DCert.d.ts +40 -0
- package/types/Cardano/Ledger/DCert.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/DatumHash.d.ts +6 -5
- package/types/Cardano/Ledger/DatumHash.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/MintingPolicy.d.ts +11 -8
- package/types/Cardano/Ledger/MintingPolicy.d.ts.map +1 -0
- package/types/Cardano/Ledger/NativeScript.d.ts +105 -0
- package/types/Cardano/Ledger/NativeScript.d.ts.map +1 -0
- package/types/Cardano/Ledger/PubKey.d.ts +45 -0
- package/types/Cardano/Ledger/PubKey.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/PubKeyHash.d.ts +5 -5
- package/types/Cardano/Ledger/PubKeyHash.d.ts.map +1 -0
- package/types/Cardano/Ledger/Redeemer.d.ts +303 -0
- package/types/Cardano/Ledger/Redeemer.d.ts.map +1 -0
- package/types/Cardano/Ledger/RewardAddress.d.ts +60 -0
- package/types/Cardano/Ledger/RewardAddress.d.ts.map +1 -0
- package/types/Cardano/Ledger/Signature.d.ts +13 -0
- package/types/Cardano/Ledger/Signature.d.ts.map +1 -0
- package/types/Cardano/Ledger/Tx.d.ts +375 -0
- package/types/Cardano/Ledger/Tx.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/TxHash.d.ts +35 -5
- package/types/Cardano/Ledger/TxHash.d.ts.map +1 -0
- package/types/Cardano/Ledger/TxOutput.d.ts +438 -0
- package/types/Cardano/Ledger/TxOutput.d.ts.map +1 -0
- package/types/Cardano/Ledger/TxOutputDatum.d.ts +98 -0
- package/types/Cardano/Ledger/TxOutputDatum.d.ts.map +1 -0
- package/types/Cardano/Ledger/UTxO.d.ts +1420 -0
- package/types/Cardano/Ledger/UTxO.d.ts.map +1 -0
- package/types/Cardano/Ledger/UTxORef.d.ts +222 -0
- package/types/Cardano/Ledger/UTxORef.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/ValidatorHash.d.ts +5 -5
- package/types/Cardano/Ledger/ValidatorHash.d.ts.map +1 -0
- package/types/{Ledger → Cardano/Ledger}/index.d.ts +6 -0
- package/types/Cardano/Ledger/index.d.ts.map +1 -0
- package/types/Cardano/Network/IsMainnet.d.ts.map +1 -0
- package/types/{Network → Cardano/Network}/Params.d.ts +32 -4
- package/types/Cardano/Network/Params.d.ts.map +1 -0
- package/types/Cardano/Network/UTxO.d.ts +15 -0
- package/types/Cardano/Network/UTxO.d.ts.map +1 -0
- package/types/Cardano/Network/UTxOsAt.d.ts +9 -0
- package/types/Cardano/Network/UTxOsAt.d.ts.map +1 -0
- package/types/Cardano/Network/errors.d.ts +39 -0
- package/types/Cardano/Network/errors.d.ts.map +1 -0
- package/types/{Network → Cardano/Network}/index.d.ts +1 -0
- package/types/Cardano/Network/index.d.ts.map +1 -0
- package/types/Cardano/TxBuilder.d.ts +232 -0
- package/types/Cardano/TxBuilder.d.ts.map +1 -0
- package/types/Cardano/Uplc/Builtins.d.ts +163 -0
- package/types/Cardano/Uplc/Builtins.d.ts.map +1 -0
- package/types/Cardano/Uplc/Cek.d.ts +165 -0
- package/types/Cardano/Uplc/Cek.d.ts.map +1 -0
- package/types/Cardano/Uplc/Cost.d.ts +93 -0
- package/types/Cardano/Uplc/Cost.d.ts.map +1 -0
- package/types/{Uplc → Cardano/Uplc}/Data.d.ts +149 -15
- package/types/Cardano/Uplc/Data.d.ts.map +1 -0
- package/types/Cardano/Uplc/Script.d.ts +87 -0
- package/types/Cardano/Uplc/Script.d.ts.map +1 -0
- package/types/Cardano/Uplc/ScriptContext.d.ts +21 -0
- package/types/Cardano/Uplc/ScriptContext.d.ts.map +1 -0
- package/types/Cardano/Uplc/Term.d.ts +454 -0
- package/types/Cardano/Uplc/Term.d.ts.map +1 -0
- package/types/Cardano/Uplc/Type.d.ts +29 -0
- package/types/Cardano/Uplc/Type.d.ts.map +1 -0
- package/types/Cardano/Uplc/Value.d.ts +152 -0
- package/types/Cardano/Uplc/Value.d.ts.map +1 -0
- package/types/Cardano/Uplc/index.d.ts +7 -0
- package/types/Cardano/Uplc/index.d.ts.map +1 -0
- package/types/Cardano/Wallet.d.ts +73 -0
- package/types/Cardano/Wallet.d.ts.map +1 -0
- package/types/Cardano/index.d.ts +7 -0
- package/types/Cardano/index.d.ts.map +1 -0
- package/types/Codecs/Base32.d.ts.map +1 -0
- package/types/Codecs/Bech32.d.ts.map +1 -0
- package/types/Codecs/BigEndian.d.ts.map +1 -0
- package/types/Codecs/Bits.d.ts.map +1 -0
- package/types/{internal → Codecs}/Bytes.d.ts +7 -6
- package/types/Codecs/Bytes.d.ts.map +1 -0
- package/types/{Cbor.d.ts → Codecs/Cbor.d.ts} +77 -55
- package/types/Codecs/Cbor.d.ts.map +1 -0
- package/types/{internal → Codecs}/Flat.d.ts +2 -0
- package/types/Codecs/Flat.d.ts.map +1 -0
- package/types/Codecs/Float.d.ts.map +1 -0
- package/types/Codecs/LittleEndian.d.ts +19 -0
- package/types/Codecs/LittleEndian.d.ts.map +1 -0
- package/types/Codecs/Uint64.d.ts +16 -0
- package/types/Codecs/Uint64.d.ts.map +1 -0
- package/types/{internal → Codecs}/Utf8.d.ts +2 -2
- package/types/Codecs/Utf8.d.ts.map +1 -0
- package/types/Codecs/ZigZag.d.ts +3 -0
- package/types/Codecs/ZigZag.d.ts.map +1 -0
- package/types/Codecs/index.d.ts +8 -0
- package/types/Codecs/index.d.ts.map +1 -0
- package/types/Crypto/Bip32.d.ts +29 -0
- package/types/Crypto/Bip32.d.ts.map +1 -0
- package/types/Crypto/Bip39.d.ts +43 -0
- package/types/Crypto/Bip39.d.ts.map +1 -0
- package/types/Crypto/Blake2b.d.ts +16 -0
- package/types/Crypto/Blake2b.d.ts.map +1 -0
- package/types/Crypto/Curve.d.ts +161 -0
- package/types/Crypto/Curve.d.ts.map +1 -0
- package/types/Crypto/Ed25519.d.ts +155 -0
- package/types/Crypto/Ed25519.d.ts.map +1 -0
- package/types/Crypto/EdDSA.d.ts +159 -0
- package/types/Crypto/EdDSA.d.ts.map +1 -0
- package/types/Crypto/Field.d.ts +273 -0
- package/types/Crypto/Field.d.ts.map +1 -0
- package/types/Crypto/Hmac.d.ts +20 -0
- package/types/Crypto/Hmac.d.ts.map +1 -0
- package/types/Crypto/Keccak.d.ts +16 -0
- package/types/Crypto/Keccak.d.ts.map +1 -0
- package/types/Crypto/Pbkdf2.d.ts +15 -0
- package/types/Crypto/Pbkdf2.d.ts.map +1 -0
- package/types/Crypto/Sha2_256.d.ts +36 -0
- package/types/Crypto/Sha2_256.d.ts.map +1 -0
- package/types/Crypto/Sha2_512.d.ts +31 -0
- package/types/Crypto/Sha2_512.d.ts.map +1 -0
- package/types/Crypto/Sha3_256.d.ts +8 -0
- package/types/Crypto/Sha3_256.d.ts.map +1 -0
- package/types/Crypto/errors.d.ts +10 -0
- package/types/Crypto/errors.d.ts.map +1 -0
- package/types/Crypto/index.d.ts +12 -0
- package/types/Crypto/index.d.ts.map +1 -0
- package/types/index.d.ts +3 -5
- package/types/index.d.ts.map +1 -1
- package/dist/Address.js +0 -13
- package/dist/Address.js.map +0 -1
- package/dist/Bech32.js.map +0 -1
- package/dist/Cbor.js.map +0 -1
- package/dist/Ledger/Address.js.map +0 -1
- package/dist/Ledger/AssetClass.js.map +0 -1
- package/dist/Ledger/Assets.js +0 -120
- package/dist/Ledger/Assets.js.map +0 -1
- package/dist/Ledger/Credential.js +0 -17
- package/dist/Ledger/Credential.js.map +0 -1
- package/dist/Ledger/DatumHash.js +0 -21
- package/dist/Ledger/DatumHash.js.map +0 -1
- package/dist/Ledger/IsMainnet.js +0 -4
- package/dist/Ledger/IsMainnet.js.map +0 -1
- package/dist/Ledger/MintingPolicy.js +0 -45
- package/dist/Ledger/MintingPolicy.js.map +0 -1
- package/dist/Ledger/NetworkParams.js +0 -40
- package/dist/Ledger/NetworkParams.js.map +0 -1
- package/dist/Ledger/PubKeyHash.js.map +0 -1
- package/dist/Ledger/TxHash.js +0 -23
- package/dist/Ledger/TxHash.js.map +0 -1
- package/dist/Ledger/TxId.js +0 -23
- package/dist/Ledger/TxId.js.map +0 -1
- package/dist/Ledger/TxInput.js +0 -51
- package/dist/Ledger/TxInput.js.map +0 -1
- package/dist/Ledger/TxOutput.js +0 -118
- package/dist/Ledger/TxOutput.js.map +0 -1
- package/dist/Ledger/TxOutputDatum.js.map +0 -1
- package/dist/Ledger/TxOutputId.js +0 -55
- package/dist/Ledger/TxOutputId.js.map +0 -1
- package/dist/Ledger/UTxO.js +0 -43
- package/dist/Ledger/UTxO.js.map +0 -1
- package/dist/Ledger/UTxORef.js.map +0 -1
- package/dist/Ledger/ValidatorHash.js.map +0 -1
- package/dist/Ledger/index.js.map +0 -1
- package/dist/Network/IsMainnet.js.map +0 -1
- package/dist/Network/Params.js.map +0 -1
- package/dist/Network/UTxOsAt.js +0 -4
- package/dist/Network/UTxOsAt.js.map +0 -1
- package/dist/Network/errors.js +0 -16
- package/dist/Network/errors.js.map +0 -1
- package/dist/Network/index.js.map +0 -1
- package/dist/Uplc/Cek.js +0 -3
- package/dist/Uplc/Cek.js.map +0 -1
- package/dist/Uplc/Data.js.map +0 -1
- package/dist/Uplc/DataSchema.js +0 -118
- package/dist/Uplc/DataSchema.js.map +0 -1
- package/dist/Uplc/Primitive.js +0 -23
- package/dist/Uplc/Primitive.js.map +0 -1
- package/dist/Uplc/index.js +0 -3
- package/dist/Uplc/index.js.map +0 -1
- package/dist/internal/Base32.js.map +0 -1
- package/dist/internal/BigEndian.js.map +0 -1
- package/dist/internal/Bits.js.map +0 -1
- package/dist/internal/Bytes.js.map +0 -1
- package/dist/internal/Flat.js.map +0 -1
- package/dist/internal/Float.js.map +0 -1
- package/dist/internal/Utf8.js.map +0 -1
- package/tsconfig.build.tsbuildinfo +0 -1
- package/tsconfig.check.tsbuildinfo +0 -1
- package/tsconfig.tsbuildinfo +0 -1
- package/types/Address.d.ts +0 -5
- package/types/Address.d.ts.map +0 -1
- package/types/Bech32.d.ts.map +0 -1
- package/types/Cbor.d.ts.map +0 -1
- package/types/Ledger/Address.d.ts.map +0 -1
- package/types/Ledger/AssetClass.d.ts.map +0 -1
- package/types/Ledger/Assets.d.ts +0 -70
- package/types/Ledger/Assets.d.ts.map +0 -1
- package/types/Ledger/Credential.d.ts.map +0 -1
- package/types/Ledger/DatumHash.d.ts.map +0 -1
- package/types/Ledger/IsMainnet.d.ts +0 -6
- package/types/Ledger/IsMainnet.d.ts.map +0 -1
- package/types/Ledger/MintingPolicy.d.ts.map +0 -1
- package/types/Ledger/NetworkParams.d.ts +0 -40
- package/types/Ledger/NetworkParams.d.ts.map +0 -1
- package/types/Ledger/PubKeyHash.d.ts.map +0 -1
- package/types/Ledger/TxHash.d.ts.map +0 -1
- package/types/Ledger/TxId.d.ts +0 -70
- package/types/Ledger/TxId.d.ts.map +0 -1
- package/types/Ledger/TxInput.d.ts +0 -55
- package/types/Ledger/TxInput.d.ts.map +0 -1
- package/types/Ledger/TxOutput.d.ts +0 -63
- package/types/Ledger/TxOutput.d.ts.map +0 -1
- package/types/Ledger/TxOutputDatum.d.ts +0 -41
- package/types/Ledger/TxOutputDatum.d.ts.map +0 -1
- package/types/Ledger/TxOutputId.d.ts +0 -133
- package/types/Ledger/TxOutputId.d.ts.map +0 -1
- package/types/Ledger/UTxO.d.ts +0 -55
- package/types/Ledger/UTxO.d.ts.map +0 -1
- package/types/Ledger/UTxORef.d.ts +0 -133
- package/types/Ledger/UTxORef.d.ts.map +0 -1
- package/types/Ledger/ValidatorHash.d.ts.map +0 -1
- package/types/Ledger/index.d.ts.map +0 -1
- package/types/Network/IsMainnet.d.ts.map +0 -1
- package/types/Network/Params.d.ts.map +0 -1
- package/types/Network/UTxOsAt.d.ts +0 -9
- package/types/Network/UTxOsAt.d.ts.map +0 -1
- package/types/Network/errors.d.ts +0 -18
- package/types/Network/errors.d.ts.map +0 -1
- package/types/Network/index.d.ts.map +0 -1
- package/types/Uplc/Cek.d.ts +0 -72
- package/types/Uplc/Cek.d.ts.map +0 -1
- package/types/Uplc/Data.d.ts.map +0 -1
- package/types/Uplc/DataSchema.d.ts +0 -227
- package/types/Uplc/DataSchema.d.ts.map +0 -1
- package/types/Uplc/Primitive.d.ts +0 -26
- package/types/Uplc/Primitive.d.ts.map +0 -1
- package/types/Uplc/index.d.ts +0 -3
- package/types/Uplc/index.d.ts.map +0 -1
- package/types/internal/Base32.d.ts.map +0 -1
- package/types/internal/BigEndian.d.ts.map +0 -1
- package/types/internal/Bits.d.ts.map +0 -1
- package/types/internal/Bytes.d.ts.map +0 -1
- package/types/internal/Flat.d.ts.map +0 -1
- package/types/internal/Float.d.ts.map +0 -1
- package/types/internal/Utf8.d.ts.map +0 -1
- /package/dist/{Network → Cardano/Network}/IsMainnet.js +0 -0
- /package/dist/{internal → Codecs}/BigEndian.js +0 -0
- /package/dist/{internal → Codecs}/Bits.js +0 -0
- /package/dist/{internal → Codecs}/Float.js +0 -0
- /package/types/{Network → Cardano/Network}/IsMainnet.d.ts +0 -0
- /package/types/{internal → Codecs}/Base32.d.ts +0 -0
- /package/types/{Bech32.d.ts → Codecs/Bech32.d.ts} +0 -0
- /package/types/{internal → Codecs}/BigEndian.d.ts +0 -0
- /package/types/{internal → Codecs}/Bits.d.ts +0 -0
- /package/types/{internal → Codecs}/Float.d.ts +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Context, Effect } from "effect";
|
|
2
|
+
import * as Bip39 from "../Crypto/Bip39.js";
|
|
3
|
+
import * as Address from "./Ledger/Address.js";
|
|
4
|
+
import * as Signature from "./Ledger/Signature.js";
|
|
5
|
+
import * as Tx from "./Ledger/Tx.js";
|
|
6
|
+
import * as UTxO from "./Ledger/UTxO.js";
|
|
7
|
+
import * as Network from "./Network";
|
|
8
|
+
declare const Balancing_base: Context.TagClass<Balancing, "Cardano.Wallet.Balancing", {
|
|
9
|
+
changeAddress: Effect.Effect<Address.Address>;
|
|
10
|
+
utxos: Effect.Effect<UTxO.UTxO[], Error>;
|
|
11
|
+
signTx(tx: Tx.Tx): Effect.Effect<Signature.Signature[], Error>;
|
|
12
|
+
}>;
|
|
13
|
+
export declare class Balancing extends Balancing_base {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @param phrase
|
|
17
|
+
* Space separated
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
export declare const Phrase: (phrase: string | string[], account?: number, subAccount?: number) => Effect.Effect<{
|
|
21
|
+
changeAddress: Effect.Effect<string & import("effect/Brand").Brand<"Cardano.Ledger.Address">, never, never>;
|
|
22
|
+
utxos: Effect.Effect<{
|
|
23
|
+
readonly output: {
|
|
24
|
+
readonly address: string & import("effect/Brand").Brand<"Cardano.Ledger.Address">;
|
|
25
|
+
readonly assets: {
|
|
26
|
+
readonly [x: string]: bigint;
|
|
27
|
+
};
|
|
28
|
+
readonly datum?: {
|
|
29
|
+
readonly _tag: "Inline";
|
|
30
|
+
readonly data: {
|
|
31
|
+
readonly bytes: Uint8Array<ArrayBufferLike>;
|
|
32
|
+
} | {
|
|
33
|
+
readonly int: bigint;
|
|
34
|
+
} | {
|
|
35
|
+
readonly list: readonly import("./Uplc/Data.js").Data[];
|
|
36
|
+
} | {
|
|
37
|
+
readonly map: readonly {
|
|
38
|
+
readonly k: import("./Uplc/Data.js").Data;
|
|
39
|
+
readonly v: import("./Uplc/Data.js").Data;
|
|
40
|
+
}[];
|
|
41
|
+
} | {
|
|
42
|
+
readonly fields: readonly import("./Uplc/Data.js").Data[];
|
|
43
|
+
readonly constructor: number;
|
|
44
|
+
};
|
|
45
|
+
} | {
|
|
46
|
+
readonly _tag: "Hash";
|
|
47
|
+
readonly hash: string & import("effect/Brand").Brand<"DatumHash">;
|
|
48
|
+
} | undefined;
|
|
49
|
+
readonly refScript?: ({
|
|
50
|
+
readonly root: Uint8Array<ArrayBufferLike>;
|
|
51
|
+
readonly verbose?: Uint8Array<ArrayBufferLike> | undefined;
|
|
52
|
+
} & {
|
|
53
|
+
readonly version: 2;
|
|
54
|
+
}) | ({
|
|
55
|
+
readonly root: Uint8Array<ArrayBufferLike>;
|
|
56
|
+
readonly verbose?: Uint8Array<ArrayBufferLike> | undefined;
|
|
57
|
+
} & {
|
|
58
|
+
readonly version: 3;
|
|
59
|
+
}) | undefined;
|
|
60
|
+
readonly encodingConfig?: {
|
|
61
|
+
readonly strictBabbage?: boolean | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
};
|
|
64
|
+
readonly ref: string & import("effect/Brand").Brand<"UTxORef">;
|
|
65
|
+
}[], Error, never>;
|
|
66
|
+
signTx: (tx: Tx.Tx) => Effect.Effect<{
|
|
67
|
+
pubKey: string & import("effect/Brand").Brand<"Crypto.Bip32.VerificationKey">;
|
|
68
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
69
|
+
}[], never, never>;
|
|
70
|
+
}, Bip39.InvalidPhraseLength | Bip39.InvalidWord | Bip39.InvalidChecksum, Network.IsMainnet | Network.UTxOsAt>;
|
|
71
|
+
export declare const Browser: (_handle: unknown) => never;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=Wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wallet.d.ts","sourceRoot":"","sources":["../../src/Cardano/Wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAExC,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAA;AAE9C,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAA;AACxC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;;mBAKjB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;WACtC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC;eAC7B,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC;;AALlE,qBAAa,SAAU,SAAQ,cAO5B;CAAG;AAEN;;;;GAIG;AACH,eAAO,MAAM,MAAM,GACjB,QAAQ,MAAM,GAAG,MAAM,EAAE,EACzB,UAAS,MAAU,EACnB,aAAY,MAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCL,EAAE,CAAC,EAAE;;;;8GAGpB,CAAA;AAEJ,eAAO,MAAM,OAAO,GAAI,SAAS,OAAO,UAEvC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * as CoinSelection from "./CoinSelection.js";
|
|
2
|
+
export * as Ledger from "./Ledger";
|
|
3
|
+
export * as Network from "./Network";
|
|
4
|
+
export * as TxBuilder from "./TxBuilder.js";
|
|
5
|
+
export * as Uplc from "./Uplc";
|
|
6
|
+
export * as Wallet from "./Wallet.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Cardano/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base32.d.ts","sourceRoot":"","sources":["../../src/Codecs/Base32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAA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"","sources":["../../src/Codecs/Bech32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAYzC;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,CACd;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,EACnC,QAAQ,CAAC,eAAe,CACzB,CAgBA;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CACpB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GACtC,MAAM,CAiBR;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAIhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BigEndian.d.ts","sourceRoot":"","sources":["../../src/Codecs/BigEndian.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAGzC;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,GAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAuBjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAkBnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bits.d.ts","sourceRoot":"","sources":["../../src/Codecs/Bits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAG/B;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,OAAO,IAAI,OAAO,CAAA;IAClB,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO,GAA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ACT,CAAC,GAAE,MAAU,EACb,MAAM,GAAE,OAAc,GACrB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAsBnC;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,CAExD;AAOD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAQ9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAenD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Either, Encoding } from "effect";
|
|
2
2
|
export type BytesLike = string | number[] | Uint8Array | Stream;
|
|
3
3
|
declare const EndOfStreamError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
4
4
|
readonly _tag: "EndOfStreamError";
|
|
@@ -20,17 +20,17 @@ export declare function toHex(bytes: string | number[] | Uint8Array | Stream): s
|
|
|
20
20
|
* @param bytes
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
|
-
export declare function toUint8Array(bytes: string | number[] | Uint8Array | Stream): Uint8Array
|
|
23
|
+
export declare function toUint8Array(bytes: string | number[] | Uint8Array | Stream): Uint8Array<ArrayBuffer>;
|
|
24
24
|
export interface Stream {
|
|
25
25
|
readonly bytes: Uint8Array;
|
|
26
26
|
readonly pos: number;
|
|
27
27
|
copy(): Stream;
|
|
28
28
|
isAtEnd(): boolean;
|
|
29
|
-
peekOne():
|
|
30
|
-
peekMany(n: number):
|
|
29
|
+
peekOne(): Either.Either<number, EndOfStreamError>;
|
|
30
|
+
peekMany(n: number): Either.Either<number[], EndOfStreamError>;
|
|
31
31
|
peekRemaining(): number[];
|
|
32
|
-
shiftOne():
|
|
33
|
-
shiftMany(n: number):
|
|
32
|
+
shiftOne(): Either.Either<number, EndOfStreamError>;
|
|
33
|
+
shiftMany(n: number): Either.Either<number[], EndOfStreamError>;
|
|
34
34
|
shiftRemaining(): number[];
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -48,6 +48,7 @@ export declare function makeStream(arg: string | number[] | Uint8Array | Stream
|
|
|
48
48
|
* -1 if a < b, 0 if a == b, 1 if a > b
|
|
49
49
|
*/
|
|
50
50
|
export declare function compare(a: string | number[] | Uint8Array | Stream, b: string | number[] | Uint8Array | Stream, shortestFirst?: boolean): -1 | 0 | 1;
|
|
51
|
+
export declare function concat(...a: BytesLike[]): Uint8Array;
|
|
51
52
|
/**
|
|
52
53
|
* Used to create dummy hashes for testing
|
|
53
54
|
* @param n
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bytes.d.ts","sourceRoot":"","sources":["../../src/Codecs/Bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAG/C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,MAAM,CAAA;;;;AAE/D,qBAAa,gBAAiB,SAAQ,sBAAqC;IACzE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAC;gBACY,MAAM,EAAE,MAAM;CAG3B;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,UAAU,GAAG,MAAM,GACtD,MAAM,EAAE,CAkBV;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAY5E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1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AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,GAAG,MAAM,EAAE,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CACpB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,MAAM,EAC1C,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,MAAM,GACzC,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAexD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAgB3D;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,MAAM,EAC9C,OAAO,EAAE,MAAM,4BAGhB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as Bytes from "./
|
|
3
|
-
export type Decoder<T> = (stream: Bytes.Stream) =>
|
|
4
|
-
export type IndexedDecoder<T> = (stream: Bytes.Stream, index: number) =>
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
1
|
+
import { Either } from "effect";
|
|
2
|
+
import * as Bytes from "./Bytes.js";
|
|
3
|
+
export type Decoder<T> = (stream: Bytes.Stream) => Either.Either<T, Bytes.EndOfStreamError | DecodeError>;
|
|
4
|
+
export type IndexedDecoder<T> = (stream: Bytes.Stream, index: number) => Either.Either<T, Bytes.EndOfStreamError | DecodeError>;
|
|
5
|
+
export type DecodeResult<T> = Either.Either<T, Bytes.EndOfStreamError | DecodeError>;
|
|
6
|
+
export type PeekResult<T> = Either.Either<T, Bytes.EndOfStreamError>;
|
|
7
7
|
declare const DecodeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
8
8
|
readonly _tag: "Cbor.DecodeError";
|
|
9
9
|
} & Readonly<A>;
|
|
@@ -18,7 +18,7 @@ export declare class DecodeError extends DecodeError_base<{
|
|
|
18
18
|
* @param bytes
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
|
-
export declare const decodeBool: (bytes: Bytes.BytesLike) =>
|
|
21
|
+
export declare const decodeBool: (bytes: Bytes.BytesLike) => DecodeResult<boolean>;
|
|
22
22
|
/**
|
|
23
23
|
* Encodes a `boolean` into its CBOR representation.
|
|
24
24
|
* @param b
|
|
@@ -29,14 +29,14 @@ export declare function encodeBool(b: boolean): number[];
|
|
|
29
29
|
* @param bytes
|
|
30
30
|
* @returns
|
|
31
31
|
*/
|
|
32
|
-
export declare const isBool: (bytes: Bytes.BytesLike) =>
|
|
32
|
+
export declare const isBool: (bytes: Bytes.BytesLike) => boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Unwraps a CBOR encoded list of bytes
|
|
35
35
|
* @param bytes
|
|
36
36
|
* cborbytes, mutated to form remaining
|
|
37
37
|
* @returns byteArray
|
|
38
38
|
*/
|
|
39
|
-
export declare const decodeBytes: (bytes: Bytes.BytesLike) =>
|
|
39
|
+
export declare const decodeBytes: (bytes: Bytes.BytesLike) => DecodeResult<number[]>;
|
|
40
40
|
/**
|
|
41
41
|
* Wraps a list of bytes using CBOR. Optionally splits the bytes into chunks.
|
|
42
42
|
* @example
|
|
@@ -46,22 +46,22 @@ export declare const decodeBytes: (bytes: Bytes.BytesLike) => DecodeEffect<numbe
|
|
|
46
46
|
* @returns
|
|
47
47
|
* cbor bytes
|
|
48
48
|
*/
|
|
49
|
-
export declare function encodeBytes(
|
|
49
|
+
export declare function encodeBytes(bs: string | readonly number[] | Uint8Array, splitIntoChunks?: boolean): number[];
|
|
50
50
|
/**
|
|
51
51
|
* @param bytes
|
|
52
52
|
* @returns
|
|
53
53
|
*/
|
|
54
|
-
export declare const isBytes: (bytes: Bytes.BytesLike) =>
|
|
54
|
+
export declare const isBytes: (bytes: Bytes.BytesLike) => boolean;
|
|
55
55
|
/**
|
|
56
56
|
* @param bytes
|
|
57
57
|
* @returns
|
|
58
58
|
*/
|
|
59
|
-
export declare const isDefBytes: (bytes: Bytes.BytesLike) =>
|
|
59
|
+
export declare const isDefBytes: (bytes: Bytes.BytesLike) => boolean;
|
|
60
60
|
/**
|
|
61
61
|
* @param bytes
|
|
62
62
|
* @returns
|
|
63
63
|
*/
|
|
64
|
-
export declare const isIndefBytes: (bytes: Bytes.BytesLike) =>
|
|
64
|
+
export declare const isIndefBytes: (bytes: Bytes.BytesLike) => boolean;
|
|
65
65
|
/**
|
|
66
66
|
* The homogenous field type case is used by the uplc ConstrData (undetermined number of UplcData items)
|
|
67
67
|
* @template Decoders
|
|
@@ -70,12 +70,12 @@ export declare const isIndefBytes: (bytes: Bytes.BytesLike) => PeekEffect<boolea
|
|
|
70
70
|
* Array for heterogenous item types, single function for homogenous item types
|
|
71
71
|
* @returns
|
|
72
72
|
*/
|
|
73
|
-
export declare const decodeConstr: <Decoders extends [Decoder<any>, ...Decoder<any>[]] | Array<Decoder<any>> | Decoder<any>>(fieldDecoder: Decoders extends [Decoder<any>, ...Decoder<any>[]] ? [...Decoders] : Decoders extends Array<any> ? [...Decoders] : Decoders) => (bytes: Bytes.BytesLike) =>
|
|
73
|
+
export declare const decodeConstr: <Decoders extends [Decoder<any>, ...Decoder<any>[]] | Array<Decoder<any>> | Decoder<any>>(fieldDecoder: Decoders extends [Decoder<any>, ...Decoder<any>[]] ? [...Decoders] : Decoders extends Array<any> ? [...Decoders] : Decoders) => (bytes: Bytes.BytesLike) => DecodeResult<[number, Decoders extends Array<any> ? { [D in keyof Decoders]: Decoders[D] extends Decoder<infer T> ? T : never; } : Decoders extends Decoder<infer T> ? T[] : never]>;
|
|
74
74
|
/**
|
|
75
75
|
* @param bytes
|
|
76
76
|
* @returns
|
|
77
77
|
*/
|
|
78
|
-
export declare const decodeConstrLazy: (bytes: Bytes.BytesLike) =>
|
|
78
|
+
export declare const decodeConstrLazy: (bytes: Bytes.BytesLike) => DecodeResult<[number, <T>(itemDecoder: Decoder<T>) => DecodeResult<T>]>;
|
|
79
79
|
/**
|
|
80
80
|
* Note: internally the indef list format is used if the number of fields is > 0, if the number of fields is 0 the def list format is used
|
|
81
81
|
* see [well-typed/cborg/serialise/src/Codec/Serialise/Class.hs](https://github.com/well-typed/cborg/blob/4bdc818a1f0b35f38bc118a87944630043b58384/serialise/src/Codec/Serialise/Class.hs#L181).
|
|
@@ -88,27 +88,27 @@ export declare function encodeConstr(tag: number, fields: readonly number[][]):
|
|
|
88
88
|
* @param bytes
|
|
89
89
|
* @returns
|
|
90
90
|
*/
|
|
91
|
-
export declare const isConstr: (bytes: Bytes.BytesLike) =>
|
|
91
|
+
export declare const isConstr: (bytes: Bytes.BytesLike) => boolean;
|
|
92
92
|
/**
|
|
93
93
|
* @param bytes
|
|
94
94
|
* @returns
|
|
95
95
|
*/
|
|
96
|
-
export declare const decodeFloat: (bytes: Bytes.BytesLike) =>
|
|
96
|
+
export declare const decodeFloat: (bytes: Bytes.BytesLike) => DecodeResult<number>;
|
|
97
97
|
/**
|
|
98
98
|
* @param bytes
|
|
99
99
|
* @returns
|
|
100
100
|
*/
|
|
101
|
-
export declare const decodeFloat16: (bytes: Bytes.BytesLike) =>
|
|
101
|
+
export declare const decodeFloat16: (bytes: Bytes.BytesLike) => DecodeResult<number>;
|
|
102
102
|
/**
|
|
103
103
|
* @param bytes
|
|
104
104
|
* @returns
|
|
105
105
|
*/
|
|
106
|
-
export declare const decodeFloat32: (bytes: Bytes.BytesLike) =>
|
|
106
|
+
export declare const decodeFloat32: (bytes: Bytes.BytesLike) => DecodeResult<number>;
|
|
107
107
|
/**
|
|
108
108
|
* @param bytes
|
|
109
109
|
* @returns
|
|
110
110
|
*/
|
|
111
|
-
export declare const decodeFloat64: (bytes: Bytes.BytesLike) =>
|
|
111
|
+
export declare const decodeFloat64: (bytes: Bytes.BytesLike) => DecodeResult<number>;
|
|
112
112
|
/**
|
|
113
113
|
* @param f
|
|
114
114
|
* @returns
|
|
@@ -128,28 +128,28 @@ export declare function encodeFloat64(f: number): number[];
|
|
|
128
128
|
* @param bytes
|
|
129
129
|
* @returns
|
|
130
130
|
*/
|
|
131
|
-
export declare const isFloat: (bytes: Bytes.BytesLike) =>
|
|
131
|
+
export declare const isFloat: (bytes: Bytes.BytesLike) => boolean;
|
|
132
132
|
/**
|
|
133
133
|
* @param bytes
|
|
134
134
|
* @returns
|
|
135
135
|
*/
|
|
136
|
-
export declare const isFloat16: (bytes: Bytes.BytesLike) =>
|
|
136
|
+
export declare const isFloat16: (bytes: Bytes.BytesLike) => boolean;
|
|
137
137
|
/**
|
|
138
138
|
* @param bytes
|
|
139
139
|
* @returns
|
|
140
140
|
*/
|
|
141
|
-
export declare const isFloat32: (bytes: Bytes.BytesLike) =>
|
|
141
|
+
export declare const isFloat32: (bytes: Bytes.BytesLike) => boolean;
|
|
142
142
|
/**
|
|
143
143
|
* @param bytes
|
|
144
144
|
* @returns
|
|
145
145
|
*/
|
|
146
|
-
export declare const isFloat64: (bytes: Bytes.BytesLike) =>
|
|
146
|
+
export declare const isFloat64: (bytes: Bytes.BytesLike) => boolean;
|
|
147
147
|
/**
|
|
148
148
|
* @param bytes
|
|
149
149
|
* @returns
|
|
150
150
|
* [majorType, n]
|
|
151
151
|
*/
|
|
152
|
-
export declare const decodeDefHead: (bytes: Bytes.BytesLike) =>
|
|
152
|
+
export declare const decodeDefHead: (bytes: Bytes.BytesLike) => DecodeResult<[number, bigint]>;
|
|
153
153
|
/**
|
|
154
154
|
* @param m major type
|
|
155
155
|
* @param n size parameter
|
|
@@ -167,18 +167,19 @@ export declare function encodeIndefHead(m: number): number[];
|
|
|
167
167
|
* @param bytes
|
|
168
168
|
* @returns
|
|
169
169
|
*/
|
|
170
|
-
export declare const peekMajorType: (bytes: Bytes.BytesLike) =>
|
|
170
|
+
export declare const peekMajorType: (bytes: Bytes.BytesLike) => PeekResult<number>;
|
|
171
171
|
/**
|
|
172
172
|
* @param bytes
|
|
173
173
|
* @returns
|
|
174
174
|
*/
|
|
175
|
-
export declare const peekMajorAndSimpleMinorType: (bytes: Bytes.BytesLike) =>
|
|
175
|
+
export declare const peekMajorAndSimpleMinorType: (bytes: Bytes.BytesLike) => PeekResult<[number, number]>;
|
|
176
176
|
/**
|
|
177
177
|
* Decodes a CBOR encoded bigint integer.
|
|
178
178
|
* @param bytes
|
|
179
179
|
* @returns
|
|
180
180
|
*/
|
|
181
|
-
export declare const decodeInt: (bytes: Bytes.BytesLike) =>
|
|
181
|
+
export declare const decodeInt: (bytes: Bytes.BytesLike) => DecodeResult<bigint>;
|
|
182
|
+
export declare const decodeIntAsNumber: (bytes: Bytes.BytesLike) => DecodeResult<number>;
|
|
182
183
|
/**
|
|
183
184
|
* Encodes a bigint integer using CBOR.
|
|
184
185
|
* @param n
|
|
@@ -189,7 +190,7 @@ export declare function encodeInt(n: number | bigint): number[];
|
|
|
189
190
|
* @param bytes
|
|
190
191
|
* @returns
|
|
191
192
|
*/
|
|
192
|
-
export declare const isInt: (bytes: Bytes.BytesLike) =>
|
|
193
|
+
export declare const isInt: (bytes: Bytes.BytesLike) => boolean;
|
|
193
194
|
/**
|
|
194
195
|
* Decodes a CBOR encoded list.
|
|
195
196
|
* A decoder function is called with the bytes of every contained item (nothing is returning directly).
|
|
@@ -197,19 +198,17 @@ export declare const isInt: (bytes: Bytes.BytesLike) => PeekEffect<boolean>;
|
|
|
197
198
|
* @param itemDecoder
|
|
198
199
|
* @returns
|
|
199
200
|
*/
|
|
200
|
-
export declare const decodeList: <T>(itemDecoder: IndexedDecoder<T>) => ((bytes: Bytes.BytesLike) =>
|
|
201
|
+
export declare const decodeList: <T>(itemDecoder: IndexedDecoder<T>) => ((bytes: Bytes.BytesLike) => DecodeResult<T[]>);
|
|
201
202
|
/**
|
|
202
203
|
* @param bytes
|
|
203
204
|
* @returns
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
205
|
*/
|
|
207
|
-
export declare const decodeListLazy: (bytes: Bytes.BytesLike) =>
|
|
206
|
+
export declare const decodeListLazy: (bytes: Bytes.BytesLike) => DecodeResult<(<T>(itemDecoder: IndexedDecoder<T>) => DecodeResult<T>)>;
|
|
208
207
|
/**
|
|
209
208
|
* @param bytes
|
|
210
209
|
* @returns
|
|
211
210
|
*/
|
|
212
|
-
export declare const decodeListLazyOption: (bytes: Bytes.BytesLike) =>
|
|
211
|
+
export declare const decodeListLazyOption: (bytes: Bytes.BytesLike) => DecodeResult<(<T>(itemDecoder: IndexedDecoder<T>) => DecodeResult<T | undefined>)>;
|
|
213
212
|
/**
|
|
214
213
|
* This follows the serialization format that the Haskell input-output-hk/plutus UPLC evaluator (i.e. empty lists use `encodeDefList`, non-empty lists use `encodeIndefList`).
|
|
215
214
|
* See [well-typed/cborg/serialise/src/Codec/Serialise/Class.hs](https://github.com/well-typed/cborg/blob/4bdc818a1f0b35f38bc118a87944630043b58384/serialise/src/Codec/Serialise/Class.hs#L181).
|
|
@@ -234,17 +233,17 @@ export declare function encodeDefList(items: readonly number[][]): number[];
|
|
|
234
233
|
* @param bytes
|
|
235
234
|
* @returns
|
|
236
235
|
*/
|
|
237
|
-
export declare const isList: (bytes: Bytes.BytesLike) =>
|
|
236
|
+
export declare const isList: (bytes: Bytes.BytesLike) => boolean;
|
|
238
237
|
/**
|
|
239
238
|
* @param bytes
|
|
240
239
|
* @returns
|
|
241
240
|
*/
|
|
242
|
-
export declare const isDefList: (bytes: Bytes.BytesLike) =>
|
|
241
|
+
export declare const isDefList: (bytes: Bytes.BytesLike) => boolean;
|
|
243
242
|
/**
|
|
244
243
|
* @param bytes
|
|
245
244
|
* @returns
|
|
246
245
|
*/
|
|
247
|
-
export declare const isIndefList: (bytes: Bytes.BytesLike) =>
|
|
246
|
+
export declare const isIndefList: (bytes: Bytes.BytesLike) => boolean;
|
|
248
247
|
/**
|
|
249
248
|
* Decodes a CBOR encoded map.
|
|
250
249
|
* Calls a decoder function for each key-value pair (nothing is returned directly).
|
|
@@ -255,7 +254,7 @@ export declare const isIndefList: (bytes: Bytes.BytesLike) => PeekEffect<boolean
|
|
|
255
254
|
* @param valueDecoder
|
|
256
255
|
* @returns
|
|
257
256
|
*/
|
|
258
|
-
export declare const decodeMap: <TKey, TValue>(keyDecoder: Decoder<TKey>, valueDecoder: Decoder<TValue>) => (bytes: Bytes.BytesLike) =>
|
|
257
|
+
export declare const decodeMap: <TKey, TValue>(keyDecoder: Decoder<TKey>, valueDecoder: Decoder<TValue>) => (bytes: Bytes.BytesLike) => DecodeResult<[TKey, TValue][]>;
|
|
259
258
|
/**
|
|
260
259
|
* Unlike lists, the default serialization format for maps seems to always be the defined format
|
|
261
260
|
* @param pairs already encoded
|
|
@@ -280,14 +279,14 @@ export declare function encodeIndefMap(pairs: [number[], number[]][]): number[];
|
|
|
280
279
|
* @param bytes
|
|
281
280
|
* @returns
|
|
282
281
|
*/
|
|
283
|
-
export declare const isMap: (bytes: Bytes.BytesLike) =>
|
|
282
|
+
export declare const isMap: (bytes: Bytes.BytesLike) => boolean;
|
|
284
283
|
/**
|
|
285
284
|
* Checks if next element in `bytes` is a `null`.
|
|
286
285
|
* Throws an error if it isn't.
|
|
287
286
|
* @param bytes
|
|
288
287
|
* @returns
|
|
289
288
|
*/
|
|
290
|
-
export declare const decodeNull: (bytes: Bytes.BytesLike) =>
|
|
289
|
+
export declare const decodeNull: (bytes: Bytes.BytesLike) => DecodeResult<null>;
|
|
291
290
|
/**
|
|
292
291
|
* Encode `null` into its CBOR representation.
|
|
293
292
|
* @param _null ignored
|
|
@@ -298,7 +297,30 @@ export declare function encodeNull(_null?: null): number[];
|
|
|
298
297
|
* @param bytes
|
|
299
298
|
* @returns
|
|
300
299
|
*/
|
|
301
|
-
export declare const isNull: (bytes: Bytes.BytesLike) =>
|
|
300
|
+
export declare const isNull: (bytes: Bytes.BytesLike) => boolean;
|
|
301
|
+
/**
|
|
302
|
+
* @template T
|
|
303
|
+
* @param decodeSome
|
|
304
|
+
* @returns
|
|
305
|
+
*/
|
|
306
|
+
export declare const decodeNullOption: <T>(decodeSome: Decoder<T>) => (bytes: Bytes.BytesLike) => DecodeResult<T | undefined>;
|
|
307
|
+
/**
|
|
308
|
+
* @param option
|
|
309
|
+
* @returns
|
|
310
|
+
*/
|
|
311
|
+
export declare function encodeNullOption(option: number[] | undefined): number[];
|
|
312
|
+
/**
|
|
313
|
+
* @template T
|
|
314
|
+
* @param bytes
|
|
315
|
+
* @param decodeSome
|
|
316
|
+
* @returns
|
|
317
|
+
*/
|
|
318
|
+
export declare const decodeListOption: <T>(decodeSome: Decoder<T>) => (bytes: Bytes.BytesLike) => DecodeResult<T | undefined>;
|
|
319
|
+
/**
|
|
320
|
+
* @param option
|
|
321
|
+
* @returns
|
|
322
|
+
*/
|
|
323
|
+
export declare function encodeListOption(option: number[] | undefined): number[];
|
|
302
324
|
/**
|
|
303
325
|
* Decodes a CBOR encoded object with integer keys.
|
|
304
326
|
* For each field a decoder is called which takes the field index and the field bytes as arguments.
|
|
@@ -308,7 +330,7 @@ export declare const isNull: (bytes: Bytes.BytesLike) => PeekEffect<boolean>;
|
|
|
308
330
|
*/
|
|
309
331
|
export declare const decodeObjectIKey: <Decoders extends {
|
|
310
332
|
[key: number]: Decoder<any>;
|
|
311
|
-
}>(fieldDecoders: Decoders) => (bytes: Bytes.BytesLike) =>
|
|
333
|
+
}>(fieldDecoders: Decoders) => (bytes: Bytes.BytesLike) => DecodeResult<{ [D in keyof Decoders]+?: Decoders[D] extends Decoder<infer T> ? T : never; }>;
|
|
312
334
|
/**
|
|
313
335
|
* Decodes a CBOR encoded object with string keys.
|
|
314
336
|
* For each field a decoder is called which takes the field index and the field bytes as arguments.
|
|
@@ -318,7 +340,7 @@ export declare const decodeObjectIKey: <Decoders extends {
|
|
|
318
340
|
*/
|
|
319
341
|
export declare const decodeObjectSKey: <Decoders extends {
|
|
320
342
|
[key: string]: Decoder<any>;
|
|
321
|
-
}>(fieldDecoders: Decoders) => (bytes: Bytes.BytesLike) =>
|
|
343
|
+
}>(fieldDecoders: Decoders) => (bytes: Bytes.BytesLike) => DecodeResult<{ [D in keyof Decoders]+?: Decoders[D] extends Decoder<infer T> ? T : never; }>;
|
|
322
344
|
/**
|
|
323
345
|
* Encodes an object with optional fields using integer keys.
|
|
324
346
|
* @param object
|
|
@@ -337,7 +359,7 @@ export declare function encodeObjectSKey(object: Map<string, number[]> | Record<
|
|
|
337
359
|
* @param bytes
|
|
338
360
|
* @returns
|
|
339
361
|
*/
|
|
340
|
-
export declare const isObject: (bytes: Bytes.BytesLike) =>
|
|
362
|
+
export declare const isObject: (bytes: Bytes.BytesLike) => boolean;
|
|
341
363
|
/**
|
|
342
364
|
* Like a list, but with an optional 258 tag
|
|
343
365
|
* See: https://github.com/Emurgo/cardano-serialization-lib/releases/tag/13.0.0
|
|
@@ -345,7 +367,7 @@ export declare const isObject: (bytes: Bytes.BytesLike) => PeekEffect<boolean>;
|
|
|
345
367
|
* @param itemDecoder
|
|
346
368
|
* @returns
|
|
347
369
|
*/
|
|
348
|
-
export declare const decodeSet: <T>(itemDecoder: Decoder<T>) => (bytes: Bytes.BytesLike) =>
|
|
370
|
+
export declare const decodeSet: <T>(itemDecoder: Decoder<T>) => (bytes: Bytes.BytesLike) => DecodeResult<T[]>;
|
|
349
371
|
/**
|
|
350
372
|
* A tagged def list (tag 258n)
|
|
351
373
|
* @param items
|
|
@@ -356,12 +378,12 @@ export declare function encodeSet(items: number[][]): number[];
|
|
|
356
378
|
* @param bytes
|
|
357
379
|
* @returns
|
|
358
380
|
*/
|
|
359
|
-
export declare const isSet: (bytes: Bytes.BytesLike) =>
|
|
381
|
+
export declare const isSet: (bytes: Bytes.BytesLike) => boolean;
|
|
360
382
|
/**
|
|
361
383
|
* @param bytes
|
|
362
384
|
* @returns
|
|
363
385
|
*/
|
|
364
|
-
export declare const decodeString: (bytes: Bytes.BytesLike) =>
|
|
386
|
+
export declare const decodeString: (bytes: Bytes.BytesLike) => DecodeResult<string>;
|
|
365
387
|
/**
|
|
366
388
|
* Encodes a Utf8 string into Cbor bytes.
|
|
367
389
|
* Strings can be split into lists with chunks of up to 64 bytes
|
|
@@ -375,12 +397,12 @@ export declare function encodeString(str: string, split?: boolean): number[];
|
|
|
375
397
|
* @param bytes
|
|
376
398
|
* @returns
|
|
377
399
|
*/
|
|
378
|
-
export declare const isString: (bytes: Bytes.BytesLike) =>
|
|
400
|
+
export declare const isString: (bytes: Bytes.BytesLike) => boolean;
|
|
379
401
|
/**
|
|
380
402
|
* @param bytes
|
|
381
403
|
* @returns
|
|
382
404
|
*/
|
|
383
|
-
export declare const decodeTag: (bytes: Bytes.BytesLike) =>
|
|
405
|
+
export declare const decodeTag: (bytes: Bytes.BytesLike) => DecodeResult<bigint>;
|
|
384
406
|
/**
|
|
385
407
|
* Unrelated to constructor
|
|
386
408
|
* @param tag
|
|
@@ -391,17 +413,17 @@ export declare function encodeTag(tag: number | bigint): number[];
|
|
|
391
413
|
* @param bytes
|
|
392
414
|
* @returns
|
|
393
415
|
*/
|
|
394
|
-
export declare const isTag: (bytes: Bytes.BytesLike) =>
|
|
416
|
+
export declare const isTag: (bytes: Bytes.BytesLike) => boolean;
|
|
395
417
|
/**
|
|
396
418
|
* @param bytes
|
|
397
419
|
* @returns
|
|
398
420
|
*/
|
|
399
|
-
export declare const peekTag: (bytes: Bytes.BytesLike) =>
|
|
421
|
+
export declare const peekTag: (bytes: Bytes.BytesLike) => PeekResult<bigint | undefined>;
|
|
400
422
|
/**
|
|
401
423
|
* @param bytes
|
|
402
424
|
* @returns
|
|
403
425
|
*/
|
|
404
|
-
export declare const decodeTagged: (bytes: Bytes.BytesLike) =>
|
|
426
|
+
export declare const decodeTagged: (bytes: Bytes.BytesLike) => DecodeResult<[number, <T>(itemDecoder: Decoder<T>) => DecodeResult<T>]>;
|
|
405
427
|
/**
|
|
406
428
|
* @template Decoders
|
|
407
429
|
* @template OptionalDecoders
|
|
@@ -410,12 +432,12 @@ export declare const decodeTagged: (bytes: Bytes.BytesLike) => DecodeEffect<[num
|
|
|
410
432
|
* Defaults to empty tuple
|
|
411
433
|
* @returns
|
|
412
434
|
*/
|
|
413
|
-
export declare const decodeTuple: <Decoders extends Array<Decoder<any>>, OptionalDecoders extends Array<Decoder<any>>>(itemDecoders: [...Decoders], optionalDecoders?: [...OptionalDecoders] | []) => (bytes: Bytes.BytesLike) =>
|
|
435
|
+
export declare const decodeTuple: <Decoders extends Array<Decoder<any>>, OptionalDecoders extends Array<Decoder<any>>>(itemDecoders: [...Decoders], optionalDecoders?: [...OptionalDecoders] | []) => (bytes: Bytes.BytesLike) => DecodeResult<[...{ [D in keyof Decoders]: Decoders[D] extends Decoder<infer T> ? T : never; }, ...{ [D in keyof OptionalDecoders]: OptionalDecoders[D] extends Decoder<infer T> ? T | undefined : never; }]>;
|
|
414
436
|
/**
|
|
415
437
|
* @param bytes
|
|
416
438
|
* @returns
|
|
417
439
|
*/
|
|
418
|
-
export declare function decodeTupleLazy(bytes: Bytes.BytesLike):
|
|
440
|
+
export declare function decodeTupleLazy(bytes: Bytes.BytesLike): DecodeResult<(<T>(itemDecoder: Decoder<T>) => DecodeResult<T>)>;
|
|
419
441
|
/**
|
|
420
442
|
* @param tuple
|
|
421
443
|
* @returns
|
|
@@ -425,6 +447,6 @@ export declare function encodeTuple(tuple: number[][]): number[];
|
|
|
425
447
|
* @param bytes
|
|
426
448
|
* @returns
|
|
427
449
|
*/
|
|
428
|
-
export declare function isTuple(bytes: Bytes.BytesLike):
|
|
450
|
+
export declare function isTuple(bytes: Bytes.BytesLike): boolean;
|
|
429
451
|
export {};
|
|
430
452
|
//# sourceMappingURL=Cbor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cbor.d.ts","sourceRoot":"","sources":["../../src/Codecs/Cbor.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AC,CAarE,CAAA;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAEpB,QAAQ,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EACpC,gBAAgB,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAE5C,cAAc,CAAC,GAAG,QAAQ,CAAC,EAC3B,mBAAkB,CAAC,GAAG,gBAAgB,CAAC,GAAG,EAAO,MAGjD,OAAO,KAAK,CAAC,SAAS,KACrB,YAAY,CACb,CACE,GAAG,GACA,CAAC,IAAI,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,GACxE,EACD,GAAG,GACA,CAAC,IAAI,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAC,SAAS,OAAO,CAChE,MAAM,CAAC,CACR,GACG,CAAC,GAAG,SAAS,GACb,KAAK,GACV,CACF,CAwDC,CAAA;AAEN;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,GACrB,YAAY,EAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,EAAC,CAE/D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAEvD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,OAAO,CAEvD"}
|
|
@@ -62,10 +62,12 @@ export declare function bytesSize(n: number): number;
|
|
|
62
62
|
* @returns
|
|
63
63
|
*/
|
|
64
64
|
export declare function decodeInt(reader: Bits.Reader): bigint;
|
|
65
|
+
export declare function intSize(x: bigint | number, signed?: boolean): number;
|
|
65
66
|
/**
|
|
66
67
|
* @param bitWriter
|
|
67
68
|
* @param x
|
|
68
69
|
* positive number
|
|
69
70
|
*/
|
|
70
71
|
export declare function encodeInt(bitWriter: Bits.Writer, x: bigint): void;
|
|
72
|
+
export declare function listSize<T>(items: readonly T[], itemSize: (item: T) => number): number;
|
|
71
73
|
//# sourceMappingURL=Flat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flat.d.ts","sourceRoot":"","sources":["../../src/Codecs/Flat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,OAAO,IAAI,OAAO,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,QAAQ,IAAI,OAAO,CAAA;IACnB,aAAa,IAAI,MAAM,CAAA;IACvB,SAAS,IAAI,MAAM,EAAE,CAAA;IACrB,OAAO,IAAI,MAAM,CAAA;IACjB,OAAO,IAAI,MAAM,CAAA;IACjB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,CAAA;CAC7C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,MAAM,CAExE;AAoED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC7B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;IACnC,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IACpC,aAAa,IAAI,MAAM,CAAA;IACvB,YAAY,IAAI,MAAM,CAAA;IACtB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACjC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;IACvC,cAAc,CAAC,EAAE,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,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAkCjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EAAE,GACd,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAajD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAMjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EAAE,GACd,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAYjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAMjD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Either, Encoding } from "effect";
|
|
2
|
+
import * as Bytes from "./Bytes.js";
|
|
3
|
+
/**
|
|
4
|
+
* @import { IntLike } from "../index.js"
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Little Endian bytes to bigint (doesnt need to be 32 bytes long)
|
|
8
|
+
* @param bytes
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function decode(bytes: Bytes.BytesLike): Either.Either<bigint, Encoding.DecodeException>;
|
|
12
|
+
export declare function decodeOrThrow(bytes: Bytes.BytesLike): bigint;
|
|
13
|
+
/**
|
|
14
|
+
* Little Endian 32 bytes
|
|
15
|
+
* @param {IntLike} x
|
|
16
|
+
* @returns {number[]}
|
|
17
|
+
*/
|
|
18
|
+
export declare function encode32(x: number | bigint): number[];
|
|
19
|
+
//# sourceMappingURL=LittleEndian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LittleEndian.d.ts","sourceRoot":"","sources":["../../src/Codecs/LittleEndian.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEzC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,KAAK,CAAC,SAAS,GACrB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAEjD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAMrD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Uint64 = {
|
|
2
|
+
high: number;
|
|
3
|
+
low: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const Zero: Uint64;
|
|
6
|
+
export declare function fromBytes(bytes: number[], littleEndian?: boolean): Uint64;
|
|
7
|
+
export declare function fromHex(hex: string): Uint64;
|
|
8
|
+
export declare function toBytes(x: Uint64, littleEndian?: boolean): number[];
|
|
9
|
+
export declare function equals(a: Uint64, b: Uint64): boolean;
|
|
10
|
+
export declare function not(x: Uint64): Uint64;
|
|
11
|
+
export declare function and(a: Uint64, b: Uint64): Uint64;
|
|
12
|
+
export declare function xor(a: Uint64, b: Uint64): Uint64;
|
|
13
|
+
export declare function add(a: Uint64, b: Uint64): Uint64;
|
|
14
|
+
export declare function rotr(x: Uint64, n: number): Uint64;
|
|
15
|
+
export declare function shiftr(x: Uint64, n: number): Uint64;
|
|
16
|
+
//# sourceMappingURL=Uint64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Uint64.d.ts","sourceRoot":"","sources":["../../src/Codecs/Uint64.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,eAAO,MAAM,IAAI,EAAE,MAA4B,CAAA;AAE/C,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EAAE,EACf,YAAY,GAAE,OAAc,GAC3B,MAAM,CAiBR;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK3C;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,GAAE,OAAc,GAAG,MAAM,EAAE,CAiBzE;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAErC;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAShD;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAejD;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CASnD"}
|