Operation

Operation

new Operation()

Operation class represents operations in Stellar network. Use one of static methods to create operations:

  • Operation.createAccount
  • Operation.payment
  • Operation.pathPayment
  • Operation.manageOffer
  • Operation.createPassiveOffer
  • Operation.setOptions
  • Operation.changeTrust
  • Operation.allowTrust
  • Operation.accountMerge
  • Operation.inflation
Source:

Methods

(static) cancelRequest() → {xdr.Operation}

CancelRequestOp cancels request with a given id. Only creator of the request is allowed to perform this operation.

Source:
Parameters:
Name Type Description
opts.requestId string

id of the request to cancel

opts.source string

source of the operation

Returns:
Type:
xdr.Operation

(static) closeAuction(opts) → {xdr.CloseAuctionOp}

Close the auction.

Source:
Parameters:
Name Type Description
opts object

Operation options.

Name Type Description
lotId string

ID of the lot.

action string

Auction resolution action.

Returns:
Type:
xdr.CloseAuctionOp

(static) createAccount(opts) → {xdr.CreateAccountOp}

Create and fund a non existent account.

Source:
Parameters:
Name Type Description
opts object
Name Type Attributes Description
destination string

Destination account ID to create an account for.

platformId string

id of platform account belongs to

accountType xdr.AccountType

account type

source string <optional>

The source account for the payment. Defaults to the transaction's source account.

Returns:
Type:
xdr.CreateAccountOp

(static) createBid(opts) → {Operation}

Create a bid.

Source:
Parameters:
Name Type Description
opts object

Operation options.

Name Type Description
lotId string

ID of the lot.

amount string

Amount of the bid.

Returns:
Type:
Operation

(static) createLot(opts) → {Operation}

Creates a lot.

Source:
Parameters:
Name Type Description
opts object

Operation options.

Name Type Attributes Description
requestId string

Lot creation request ID.

type string

Lot type.

startPrice string

Start price.

minStep string

Minimum bid step.

maxStep string

Maximum bid step.

duration string

Auction duration in seconds.

details string

Lot details.

buyNowSupport boolean <optional>

Allow "buy now" feature for this lot.

buyNowPrice string <optional>

"Buy now" price.

deposit string <optional>

Required deposit amount.

startTime string

Auction start time.

currency string

Lot's currency.

Returns:
Type:
Operation

(static) manageParticipant(opts) → {xdr.manageParticipantOp}

Manage participant.

Source:
Parameters:
Name Type Description
opts object

Operation options.

Name Type Description
lotId string

ID of the lot.

action string

Participant manage action.

accountId string

Participant's account ID.

Returns:
Type:
xdr.manageParticipantOp

(static) operationToObject(operation) → {Operation}

Converts the XDR Operation object to the opts object used to create the XDR operation.

Source:
Parameters:
Name Type Description
operation xdr.Operation

An XDR Operation.

Returns:
Type:
Operation

(static) recover(opts) → {xdr.RecoverOp}

Create a recovery op.

Source:
Parameters:
Name Type Description
opts object
Name Type Attributes Description
account string

The target account to recover

newSigner string

Signer to recover to.

source string <optional>

The source account for the payment. Defaults to the transaction's source account.

Returns:
Type:
xdr.RecoverOp

(static) requestBuyNow(opts) → {xdr.RequestBuyNowOp}

Request "buy now".

Source:
Parameters:
Name Type Description
opts object
Name Type Description
lotId string

ID of the lot to be bought.

Returns:
Type:
xdr.RequestBuyNowOp

(static) requestParticipation(opts) → {Operation}

Make a request to participate in an auction.

Source:
Parameters:
Name Type Description
opts object

Operation options.

Name Type Description
lotId string

ID of the lot.

isBuyNow boolean

do buy now after registration

Returns:
Type:
Operation

(static) reviewRequest(opts)

Approve or reject reviewable request

Source:
Parameters:
Name Type Description
opts object
Name Type Description
requestId string

id of reviewable request

hash string

hash of the body a request (need this to ensure that we review what we expect)

requestType string

type of the request to review

action string

on of the {approve, reject, permanentReject}

rejectReason string

reason of reject or permanent reject (for approve pass empty string)

(static) sendMessage(opts) → {Operation}

Leave a message for the lot.

Source:
Parameters:
Name Type Description
opts object

Operation options.

Name Type Description
lotId string

The lot to which this message is assigned to.

receiverId string

accountId of the receiver.

text string

Message content.

Returns:
Type:
Operation

(static) setOptions(opts) → {xdr.SetOptionsOp}

Returns an XDR SetOptionsOp. A "set options" operations set or clear account flags, set the account's inflation destination, and/or add new signers to the account. The account flags are the xdr.AccountFlags enum, which are:

  • AUTH_REQUIRED_FLAG = 0x1
  • AUTH_REVOCABLE_FLAG = 0x2
Source:
Parameters:
Name Type Description
opts object
Name Type Attributes Description
inflationDest string <optional>

Set this account ID as the account's inflation destination.

clearFlags number <optional>

Bitmap integer for which flags to clear.

setFlags number <optional>

Bitmap integer for which flags to set.

masterWeight number <optional>

The master key weight.

lowThreshold number <optional>

The sum weight for the low threshold.

medThreshold number <optional>

The sum weight for the medium threshold.

highThreshold number <optional>

The sum weight for the high threshold.

signer object <optional>

Add or remove a signer from the account. The signer is deleted if the weight is 0.

Name Type Attributes Description
address string <optional>

The address of the new signer.

weight number <optional>

The weight of the new signer (0 to delete or 1-255)

homeDomain string <optional>

sets the home domain used for reverse federation lookup.

source string <optional>

The source account (defaults to transaction source).

Returns:
Type:
xdr.SetOptionsOp