SecretNetworkAgent

js/SecretNetwork/Agent.js

Queries and transacts on an instance of the Secret Network

new SecretNetworkAgent(options: any)
Parameters
options (any = {})
Static Members
create($0)
Instance Members
getBuilder
getBalance(denomination)
send(recipient, amount, denom, memo)
sendMany(txs, memo, denom, fee)
block
account
balance
nextBlock
upload(pathToBinary)
instantiate($0)
query
execute

SecretNetworkContract

js/SecretNetwork/Contract.js

Interface to a contract instance. Can be subclassed with schema to auto-generate methods TODO connect to existing contract

new SecretNetworkContract(fields: any)
Parameters
fields (any = {})
Static Members
init($0)
withSchema
Instance Members
receiptPath
network
address
query
execute

Extend SecretNetworkContract class with methods automatically generated from provided JSON schema.

extendWithSchema(SecretNetworkContract: any, schema: any)
Parameters
SecretNetworkContract (any)
schema (any)

SecretNetworkBuilder

js/SecretNetwork/index.js

Builds contracts and optionally uploads them as an agent on the Secret Network. Stores upload results as receipts.

new SecretNetworkBuilder(fields: any)
Parameters
fields (any)
Instance Members
build(options)
getBuildCommand($0)
getBuildEnv
uploadCached(artifact)
upload(artifact)
new SecretNetwork($0: Object, options: Object)
Parameters
$0 (Object)
Name Description
$0.chainId any (default 'enigma-pub-testnet-3')
$0.protocol any (default 'http')
$0.host any (default 'localhost')
$0.port any (default 1337)
$0.path any (default '')
$0.stateBase any (default defaultStateBase)
$0.state any (default makeStateDir(stateBase,chainId))
$0.wallets any (default mkdir(state,'wallets'))
$0.receipts any (default mkdir(state,'uploads'))
$0.instances any (default mkdir(state,'instances'))
options (Object) the configuration options
Static Members
localnet($0)
testnet($0)
mainnet($0)
connect($0)
Instance Members
url
getAgent
getBuilder
getContract(Contract, contractAddress, agent)
Connection

Type: Object

Properties
node (SecretNetworkNode?) : (if localnet) interface to docker container
network (SecretNetwork) : interface to the node's REST API endpoint.
agent (SecretNetworkAgent) : a default agent to query and transact on that network.
builder (SecretNetworkBuilder) : can upload contracts to that network as that agent.

SecretNetworkNode

js/SecretNetwork/Node.js
new SecretNetworkNode(options: Object)
Parameters
options (Object = {}) the node options
Static Members
respawn(options)
spawn(options)
Instance Members
genesisAccount