Function getContractInstance
get Contract Instance( options: { aci?: <internal> . Aci ; bytecode?: ` cb_ ${ string } ` ; contractAddress?: ` ct_ ${ string } ` | ` ${ string } .chain ` ; fileSystem?: Record < string , string > ; onAccount?: AccountBase ; onCompiler: Compiler ; onNode: Node ; source?: string ; validateBytecode?: boolean ; [key: string ]: any } ) : Promise < ContractInstance >
Parameters
options: { aci?: <internal> . Aci ; bytecode?: ` cb_ ${ string } ` ; contractAddress?: ` ct_ ${ string } ` | ` ${ string } .chain ` ; fileSystem?: Record < string , string > ; onAccount?: AccountBase ; onCompiler: Compiler ; onNode: Node ; source?: string ; validateBytecode?: boolean ; [key: string ]: any }
[ key: string ]: any
Optional
bytecode?: ` cb_ ${ string } `
Optional
contract Address?: ` ct_ ${ string } ` | ` ${ string } .chain `
Optional
file System?: Record < string , string >
Optional
source?: string
Optional
validate Bytecode?: boolean
Generate contract ACI object with predefined js methods for contract usage - can be used for creating a reference to already deployed contracts
Returns
JS Contract API
Example
Also you can call contract like:
await contractIns.methods.setState(123, options)
Then sdk decide to make on-chain or static call(dry-run API) transaction based on function is stateful or not