Core API Reference¶
Bool
¶
Bytes
¶
Construction Examples:
0xC0FFEE(hex)0zSGVsbG8gV29ybGQ=(base64,=is optional)bytes("Hello")bytes($tx)bytes(xpub661MyMwAZ92K…cotpLmSkMxrp99L)cf24d08f2d5b63cc564ad83a4e6e1bae359a049c(0xis optional for lengths20/32/33)
Coerces from:
StringInt|Bool– usingCScriptNumserializationScript|Transaction– using consensus serializationPsbt– using the BIP 174 serialization formatPubKey<Xpub>|SecKey<Xpriv>– using the BIP 32 serialization format (78 bytes, key origin information is lost)PubKey<SingleKey>|SecKey<SingleKey>– encoded as raw key (32/33 bytes, key origin information is lost)
Underlying type: Vec<u8>
Rust source code: src/stdlib/mod.rs:222
String
¶
Rust source code: src/stdlib/mod.rs:205
Int
¶
Rust source code: src/stdlib/mod.rs:180
Float
¶
Rust source code: src/stdlib/mod.rs:191
Not a Number. Returned by some floating-point operations, like 0.0/0.0.
Point at Infinity. Returned by some floating-point operations, like 1.0/0.0.
Symbol
¶
Rust source code: src/stdlib/mod.rs:215
Function
¶
Array
¶
Array->(𝘢𝘯𝘺)
¶
ArrayLike
¶
The types listed below are Array-like – they have a len(),
can be used with the . index access operator,
work with array utility functions like map(),
and can be unpacked using destructuring assignment.
Bytes($bytes.NreturnsInt<u8>)String($str.NreturnsString)PubKey<MultiPath>($pubkey.NreturnsPubKey<SinglePath>)SecKey<MultiPath>($seckey.NreturnsSecKey<SinglePath>)Descriptor<MultiPath>($descriptor.NreturnsDescriptor<SinglePath>)
Policy<MultiPath>should be array-like too, but currently isn't.
General¶
One of: int, float, bool, bytes, string, array, function, symbol, pubkey, seckey, policy, withprob, descriptor, address, script, transaction, network, tapinfo, wshinfo or psbt
Rust source code: src/stdlib/mod.rs:113
len()
¶
Rust source code: src/stdlib/mod.rs:119
Rust source code: src/stdlib/mod.rs:292
concat()
¶
Concatenates array elements by applying the + operator.
If there are no elements, null is returned.
Can be used with an explicit initial element to force a return type and avoid nulls.
For example: concat([0x]+$maybe_empty_array_of_bytes) or concat([""]+$array_to_stringify)
Works with all +-supporting types (Bytes|String|Array|Int|Float),
however the specialized join()/flatten()/sum()/fsum() functions on top of concat() should be preferred
since they return ""/[]/0/0.0 for empty arrays rather than null.
Minsc source code: src/stdlib/stdlib.minsc:42
Numeric¶
Minsc source code: src/stdlib/stdlib.minsc:68
Minsc source code: src/stdlib/stdlib.minsc:70
Minsc source code: src/stdlib/stdlib.minsc:69
Minsc source code: src/stdlib/stdlib.minsc:71
Minsc source code: src/stdlib/stdlib.minsc:72
String¶
Minsc source code: src/stdlib/stdlib.minsc:79
Array¶
Minsc source code: src/stdlib/stdlib.minsc:24
Minsc source code: src/stdlib/stdlib.minsc:26
Minsc source code: src/stdlib/stdlib.minsc:25
Minsc source code: src/stdlib/stdlib.minsc:31
Minsc source code: src/stdlib/stdlib.minsc:27
Minsc source code: src/stdlib/stdlib.minsc:29
Rust source code: src/stdlib/mod.rs:135
Rust source code: src/stdlib/mod.rs:148
Minsc source code: src/stdlib/stdlib.minsc:18
Minsc source code: src/stdlib/stdlib.minsc:19
Minsc source code: src/stdlib/stdlib.minsc:20
Minsc source code: src/stdlib/stdlib.minsc:15
Minsc source code: src/stdlib/stdlib.minsc:34
Minsc source code: src/stdlib/stdlib.minsc:35
Minsc source code: src/stdlib/stdlib.minsc:36
Minsc source code: src/stdlib/stdlib.minsc:38
Minsc source code: src/stdlib/stdlib.minsc:40
Minsc source code: src/stdlib/stdlib.minsc:17
Minsc source code: src/stdlib/stdlib.minsc:21
Minsc source code: src/stdlib/stdlib.minsc:39
Minsc source code: src/stdlib/stdlib.minsc:43
Rust source code: src/stdlib/mod.rs:168
Minsc source code: src/stdlib/stdlib.minsc:16
Tagged Arrays¶
Minsc source code: src/stdlib/stdlib.minsc:52
Minsc source code: src/stdlib/stdlib.minsc:53
Get the value for key, or the default_val (null) if it does not exists.
Typically the $tagged->key field getter syntax can be used instead, however it throws an error when the field doesn't exists rather than return a default.
If the key has multiple values, returns MULTIVAL_TAG. Use mget() to get the actual values as an array.
Minsc source code: src/stdlib/stdlib.minsc:49
Get the value(s) for the given key as an array. Returns an empty array if none exists.
To get a single value, use the $tagged->key field getter syntax or get().
Minsc source code: src/stdlib/stdlib.minsc:50
Minsc source code: src/stdlib/stdlib.minsc:55
Minsc source code: src/stdlib/stdlib.minsc:61
A sentinel value returned by get() and $tagged->key to indicate the requested key has multiple values. mget() can be used to get them.
Encoding¶
Rust source code: src/stdlib/mod.rs:251
Rust source code: src/stdlib/mod.rs:259
Also see: compactsize() and scriptnum()
Rust source code: src/stdlib/mod.rs:229
Logging¶
Rust source code: src/stdlib/mod.rs:298
Rust source code: src/stdlib/mod.rs:310
Rust source code: src/stdlib/mod.rs:317
Symbols¶
Dev Utils¶
Get the debug representation of the given value in Rust's std::fmt::Debug formatting
Rust source code: src/stdlib/mod.rs:236
Rust source code: src/stdlib/mod.rs:279
Minsc source code: src/stdlib/stdlib.minsc:104
Minsc source code: src/stdlib/stdlib.minsc:103
Minsc source code: src/stdlib/stdlib.minsc:102