Bindings
Note
The bindings module is auto-generated from the Saline blockchain’s codebase. This documentation is applied at documentation build time and does not modify the original source code.
Python bindings for the Saline blockchain transaction types and operations.
This module is auto-generated from the Saline codebase and provides the necessary classes and functions to interact with the Saline blockchain at a low level.
The module includes: - Data structures for transactions, instructions, and intents - Serialization and deserialization functions - Enumeration types for tokens, relations, etc.
- class saline_sdk.transaction.bindings.All(children)[source]
Bases:
IntentAn intent that requires all child intents to be satisfied.
This is similar to an AND logical operation for intents.
- children
List of child intents that must all be satisfied
- class saline_sdk.transaction.bindings.AllW(children)[source]
Bases:
WitnessA witness for an All intent
- children
List of child witnesses
- class saline_sdk.transaction.bindings.Any(threshold, children)[source]
Bases:
IntentAn intent that requires a threshold number of child intents to be satisfied.
- threshold
Minimum number of child intents that must be satisfied
- children
List of child intents
- class saline_sdk.transaction.bindings.AnyW(children)[source]
Bases:
WitnessA witness for an Any intent. Should have exactly as many children as the required threshold
- children
Dictionary of child witnesses keyed by the index of the matching intent
- class saline_sdk.transaction.bindings.Arithmetic(*values)[source]
Bases:
EnumEnumeration of arithmetic operations used in expressions.
- Members:
Add: Addition (+) Div: Division (/) Mul: Multiplication (*) Sub: Subtraction (-)
- static to_json(x)[source]
- Parameters:
x (Arithmetic)
- Add = 0
- Div = 1
- Mul = 2
- Sub = 3
- class saline_sdk.transaction.bindings.Arithmetic2(lhs, operation, rhs)[source]
Bases:
ExprAn arithmetic operation between two expressions.
- Parameters:
lhs (Expr)
operation (Arithmetic)
rhs (Expr)
- lhs
Left-hand side expression
- operation
The arithmetic operation type
- rhs
Right-hand side expression
- static to_json(x)[source]
- Parameters:
x (Arithmetic2)
- class saline_sdk.transaction.bindings.AutoW[source]
Bases:
WitnessA witness to prove validation of trivial or unambiguous intents
- class saline_sdk.transaction.bindings.Bridge(bridgedAccount, instruction)[source]
Bases:
InstructionAn instruction to perform a bridge operation.
- Parameters:
bridgedAccount (G2Element)
instruction (BridgeInstruction)
- bridgedAccount
The account involved in the bridge operation
- instruction
The bridge instruction to execute
- class saline_sdk.transaction.bindings.BridgeInstruction[source]
Bases:
objectBase class for bridge instructions in the Saline blockchain.
Bridge instructions allow interaction with other blockchains.
- class saline_sdk.transaction.bindings.Burn(token, amount)[source]
Bases:
BridgeInstructionA bridge instruction to burn tokens.
- Parameters:
token (Token)
amount (float64)
- token
The token type to burn
- amount
The amount to burn
- class saline_sdk.transaction.bindings.Counterparty(address)[source]
Bases:
Intent- Parameters:
address (G2Element)
- static to_json(x)[source]
- Parameters:
x (Counterparty)
- class saline_sdk.transaction.bindings.Delete(host)[source]
Bases:
InstructionAn instruction to reset an account to the default intent.
- Parameters:
host (G2Element)
- host
The account whose intent will be deleted
- class saline_sdk.transaction.bindings.Expr[source]
Bases:
objectBase class for expressions in the Saline blockchain.
Expressions represent values, variables, calculations, as well as references to data from transactions, wallets or oracles, that can be evaluated at the time of verification.
- class saline_sdk.transaction.bindings.Finite(uses, inner)[source]
Bases:
Intent- Parameters:
uses (uint64)
inner (Intent)
- class saline_sdk.transaction.bindings.Instruction[source]
Bases:
objectBase class for instructions in the Saline blockchain.
Instructions are the fundamental operations that can be performed in transactions.
- static to_json(x)[source]
- Parameters:
x (Instruction)
- class saline_sdk.transaction.bindings.Intent[source]
Bases:
objectBase class for intents in the Saline blockchain.
Intents represent conditions or requirements that must be satisfied for a transaction to be valid.
- class saline_sdk.transaction.bindings.Lit(value)[source]
Bases:
ExprA literal value expression.
- Parameters:
value (Any)
- value
The literal value (number, string, etc.)
- class saline_sdk.transaction.bindings.Mint(prover, token, amount)[source]
Bases:
BridgeInstructionA bridge instruction to mint tokens.
- Parameters:
prover (G2Element)
token (Token)
amount (float64)
- prover
The account that proves the minting operation
- token
The token type to mint
- amount
The amount to mint
- class saline_sdk.transaction.bindings.NonEmpty(head, tail)[source]
Bases:
GenericA non-empty list type that guarantees at least one element.
This type is used in many Saline data structures where an empty collection is invalid, such as transaction instructions or signers lists.
- list
The internal standard python list
Initialize a new NonEmpty collection.
- Parameters:
- static from_list(elements)[source]
Create a NonEmpty collection from a regular list.
- Parameters:
elements (
list[TypeVar(T)]) – A list with at least one element- Returns:
A new NonEmpty collection
- Raises:
ValueError – If the input list is empty
- class saline_sdk.transaction.bindings.OrIntent(host, intent)[source]
Bases:
InstructionAn instruction to add to, rather than replace an account’s intent. For instance, to post multiple limit orders.
- Parameters:
host (G2Element)
intent (Intent)
- host
The account to add the intent to
- intent
The intent to add
- class saline_sdk.transaction.bindings.Receive(token)[source]
Bases:
ExprAn expression representing the amount of tokens received
- Parameters:
token (Token)
- token
The selected token
- class saline_sdk.transaction.bindings.Relation(*values)[source]
Bases:
EnumEnumeration of comparison relations used in conditional expressions.
- Members:
EQ: Equal to (==) LT: Less than (<) LE: Less than or equal to (<=) GT: Greater than (>) GE: Greater than or equal to (>=)
- EQ = 0
- GE = 4
- GT = 3
- LE = 2
- LT = 1
- class saline_sdk.transaction.bindings.Restriction(lhs, relation, rhs)[source]
Bases:
IntentAn intent that enforces a specific relationship between expressions.
- lhs
Left-hand side expression
- relation
The relation type (e.g., EQ, LT, GT)
- rhs
Right-hand side expression
- static to_json(x)[source]
- Parameters:
x (Restriction)
- class saline_sdk.transaction.bindings.Send(token)[source]
Bases:
ExprAn expression representing the amount of tokens sent
- Parameters:
token (Token)
- token
The selected token
- class saline_sdk.transaction.bindings.SetIntent(host, intent)[source]
Bases:
InstructionAn instruction to set the intent for an account.
- Parameters:
host (G2Element)
intent (Intent)
- host
The account to set the intent for
- intent
The intent to set
- class saline_sdk.transaction.bindings.Signature(signer)[source]
Bases:
IntentAn intent that requires a specific signature.
- Parameters:
signer (G2Element)
- signer
The public key of the required signer
- class saline_sdk.transaction.bindings.Signed(nonce, signature, signee, signers)[source]
Bases:
objectRepresents a signed transaction ready for submission.
- Parameters:
nonce (str) – Unique identifier for this transaction
signature (str) – The cryptographic signature
signee (Transaction) – The transaction being signed
signers (List[str]) – List of public keys that signed the transaction
- nonce
Unique identifier for this transaction
- signature
The cryptographic signature
- signee
The transaction being signed
- signers
Non-empty list of public keys that signed the transaction
- class saline_sdk.transaction.bindings.Temporary(duration, availableAfter, inner)[source]
Bases:
Intent
- class saline_sdk.transaction.bindings.Token(*values)[source]
Bases:
EnumEnumeration of supported token types in the Saline blockchain.
- Members:
BTC: Bitcoin ETH: Ethereum USDC: USD Coin USDT: Tether SALT: Saline native token
- BTC = 0
- ETH = 1
- SALT = 4
- USDC = 2
- USDT = 3
- class saline_sdk.transaction.bindings.Transaction(instructions)[source]
Bases:
objectRepresents a transaction on the Saline blockchain.
A transaction consists of one or more instructions to be executed atomically.
- Parameters:
instructions (List[Instruction]) – List of instructions to execute
- instructions
Non-empty list of instructions to execute
- static to_json(x)[source]
- Parameters:
x (Transaction)
- class saline_sdk.transaction.bindings.TransferFunds(source, target, funds)[source]
Bases:
InstructionAn instruction to transfer funds between accounts.
- Parameters:
- source
The sender account
- target
The recipient account
- funds
Dictionary mapping token types to amounts
- static to_json(x)[source]
- Parameters:
x (TransferFunds)
- class saline_sdk.transaction.bindings.Var(var)[source]
Bases:
ExprA variable reference expression.
- Parameters:
var (Variable)
- class saline_sdk.transaction.bindings.Variable(kind, name)[source]
Bases:
object- Parameters:
kind (VariableTag)
name (str)
- class saline_sdk.transaction.bindings.VariableTag(*values)[source]
Bases:
Enum- static to_json(x)[source]
- Parameters:
x (VariableTag)
- Address = 0
- Amount = 1
- Count = 2
- List = 3
- class saline_sdk.transaction.bindings.Witness[source]
Bases:
objectBase class for transaction witnesses.
Witnesses are used to provide evidence for non-trivial validations. For instance, given a multi-level multi-sig, witnesses specify the paths of the tree that are valid, which means the verification engine can avoid evaluating all the false paths. This allows doing less computation on-chain, where it’s more expensive.
Core Classes
Transaction and Signing
- class saline_sdk.transaction.bindings.Transaction(instructions)[source]
Bases:
objectRepresents a transaction on the Saline blockchain.
A transaction consists of one or more instructions to be executed atomically.
- Parameters:
instructions (List[Instruction]) – List of instructions to execute
- instructions
Non-empty list of instructions to execute
- static to_json(x)[source]
- Parameters:
x (Transaction)
- class saline_sdk.transaction.bindings.Signed(nonce, signature, signee, signers)[source]
Bases:
objectRepresents a signed transaction ready for submission.
- Parameters:
nonce (str) – Unique identifier for this transaction
signature (str) – The cryptographic signature
signee (Transaction) – The transaction being signed
signers (List[str]) – List of public keys that signed the transaction
- nonce
Unique identifier for this transaction
- signature
The cryptographic signature
- signee
The transaction being signed
- signers
Non-empty list of public keys that signed the transaction
Instructions
- class saline_sdk.transaction.bindings.Instruction[source]
Bases:
objectBase class for instructions in the Saline blockchain.
Instructions are the fundamental operations that can be performed in transactions.
- static to_json(x)[source]
- Parameters:
x (Instruction)
- class saline_sdk.transaction.bindings.TransferFunds(source, target, funds)[source]
Bases:
InstructionAn instruction to transfer funds between accounts.
- Parameters:
- source
The sender account
- target
The recipient account
- funds
Dictionary mapping token types to amounts
- static to_json(x)[source]
- Parameters:
x (TransferFunds)
Intents
- class saline_sdk.transaction.bindings.Intent[source]
Bases:
objectBase class for intents in the Saline blockchain.
Intents represent conditions or requirements that must be satisfied for a transaction to be valid.
- class saline_sdk.transaction.bindings.All(children)[source]
Bases:
IntentAn intent that requires all child intents to be satisfied.
This is similar to an AND logical operation for intents.
- children
List of child intents that must all be satisfied
Enumerations
- class saline_sdk.transaction.bindings.Token(*values)[source]
Bases:
EnumEnumeration of supported token types in the Saline blockchain.
- Members:
BTC: Bitcoin ETH: Ethereum USDC: USD Coin USDT: Tether SALT: Saline native token
- BTC = 0
- ETH = 1
- SALT = 4
- USDC = 2
- USDT = 3
- class saline_sdk.transaction.bindings.Relation(*values)[source]
Bases:
EnumEnumeration of comparison relations used in conditional expressions.
- Members:
EQ: Equal to (==) LT: Less than (<) LE: Less than or equal to (<=) GT: Greater than (>) GE: Greater than or equal to (>=)
- EQ = 0
- GE = 4
- GT = 3
- LE = 2
- LT = 1
- class saline_sdk.transaction.bindings.Arithmetic(*values)[source]
Bases:
EnumEnumeration of arithmetic operations used in expressions.
- Members:
Add: Addition (+) Div: Division (/) Mul: Multiplication (*) Sub: Subtraction (-)
- static to_json(x)[source]
- Parameters:
x (Arithmetic)
- Add = 0
- Div = 1
- Mul = 2
- Sub = 3