# Computer

The Computer class has the methods listed below.

# Basic

You can build almost all smart contracts with these.

Method Description
constructor Creates an instance of class Computer
new Creates a smart object from a smart contract
query Finds the latest revisions of smart object
sync Computes the state of a smart object from a given revision

# Modules

Deploy JavaScript modules to avoid redundant storage smart contract storage on chain and reduce transaction fees.

Method Description
deploy Deploys a JavaScript module on the blockchain
load Loads a JavaScript module from the blockchain

# Advanced

For advanced applications that require control over how the transaction is signed, the UTXOs to be spent, custom scripts, or collaborative transaction building.

Method Description
encode Encodes a JavaScript expression into a Bitcoin transaction
encodeNew Encodes a constructor call into a Bitcoin transaction
encodeCall Encodes a function call into a Bitcoin transaction
decode Parses a Bitcoin transaction and returns JavaScript expression
faucet Fund a computer object on Regtest

# Wallet

Access the client side wallet.

Method Description
sign Signs a Bitcoin transaction
broadcast Broadcasts a Bitcoin transaction
send Sends satoshis to an address
rpcCall Access Bitcoin's RPC interface
getAddress Returns the Bitcoin address of the computer wallet
getBalance Confirmed, unconfirmed and total balance in sats
getChain Returns the blockchain
getNetwork Returns the network
getMnemonic Returns a BIP39 mnemonic sentence
getPassphrase Returns the passphrase
getPrivateKey Returns the private key
getPublicKey Returns the public key
getUtxos Returns an array of unspent transaction outputs