Class

Contract

Contract(contractId)

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)

Parameters:
Name Type Description
contractId string

ID of the contract (ex. CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE).

View Source js-stellar-base/src/contract.js, line 19

Classes

Contract

Methods

# address() → {Address}

View Source js-stellar-base/src/contract.js, line 44

the wrapped address of this contract

Address

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

Returns an operation that will invoke this contract call.

Parameters:
Name Type Attributes Description
method string

name of the method to call

params xdr.ScVal <repeatable>

arguments to pass to the function call

See:

View Source js-stellar-base/src/contract.js, line 63

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

xdr.Operation

# contractId() → {string}

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

View Source js-stellar-base/src/contract.js, line 34

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.

View Source js-stellar-base/src/contract.js, line 78

the ledger key for the deployed contract instance

xdr.LedgerKey

# toString() → {string}

View Source js-stellar-base/src/contract.js, line 39

the ID as a strkey (C...)

string