Contract

Contract

Create a new Contract object.

Contract represents a single contract in the Stellar network, embodying the interface of the contract. See Contracts for more information about how contracts work in Stellar.

Constructor

new Contract(contractId)

Source:
Parameters:
Name Type Description
contractId string

ID of the contract (ex. CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE).

Classes

Contract

Methods

address() → {Address}

Source:
Returns:
Type:
Address

the wrapped address of this contract

call(method, …params) → {xdr.Operation}

Returns an operation that will invoke this contract call.

Source:
See:
Parameters:
Name Type Attributes Description
method string

name of the method to call

params xdr.ScVal <repeatable>

arguments to pass to the function call

Returns:
Type:
xdr.Operation

an InvokeHostFunctionOp operation to call the contract with the given method and parameters

contractId() → {string}

Returns Stellar contract ID as a strkey, ex. CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE.

Source:
Returns:
Type:
string

getFootprint() → {xdr.LedgerKey}

Returns the read-only footprint entries necessary for any invocations to this contract, for convenience when manually adding it to your transaction's overall footprint or doing bump/restore operations.

Source:
Returns:
Type:
xdr.LedgerKey

the ledger key for the deployed contract instance

toString() → {string}

Source:
Returns:
Type:
string

the ID as a strkey (C...)