new Operation()
Operation
class represents operations in DigitalBits network.
Use one of static methods to create operations:
Methods
(static) accountMerge(opts) → {xdr.AccountMergeOp}
Transfers native balance to destination account.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Returns:
- Type:
-
xdr.AccountMergeOp
(static) allowTrust(opts) → {xdr.AllowTrustOp}
Returns an XDR AllowTrustOp. An "allow trust" operation authorizes another account to hold your account's credit for a given asset.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Returns:
- Type:
-
xdr.AllowTrustOp
(static) changeTrust(opts) → {xdr.ChangeTrustOp}
Returns an XDR ChangeTrustOp. A "change trust" operation adds, removes, or updates a trust line for a given asset from the source account to another. The issuer being trusted and the asset code are in the given Asset object.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Returns:
- Type:
-
xdr.ChangeTrustOp
(static) createAccount(opts) → {xdr.CreateAccountOp}
Create and fund a non existent account.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Returns:
- Type:
-
xdr.CreateAccountOp
(static) createPassiveOffer(opts) → {xdr.CreatePassiveOfferOp}
Returns a XDR CreatePasiveOfferOp. A "create passive offer" operation creates an offer that won't consume a counter offer that exactly matches this offer. This is useful for offers just used as 1:1 exchanges for path payments. Use manage offer to manage this offer after using this operation to create it.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Throws:
-
Throws
Error
when the best rational approximation ofprice
cannot be found. - Type
-
Error
Returns:
- Type:
-
xdr.CreatePassiveOfferOp
(static) fromXDRObject(operation) → {Operation}
Converts the XDR Operation object to the opts object used to create the XDR operation.
Parameters:
Name | Type | Description |
---|---|---|
operation |
xdr.Operation
|
An XDR Operation. |
Returns:
- Type:
-
Operation
(static) inflation(optsopt) → {xdr.InflationOp}
This operation generates the inflation.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
<optional> |
|
Returns:
- Type:
-
xdr.InflationOp
(static) manageData(opts) → {xdr.ManageDataOp}
This operation adds data entry to the ledger.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Returns:
- Type:
-
xdr.ManageDataOp
(static) manageOffer(opts) → {xdr.ManageOfferOp}
Returns a XDR ManageOfferOp. A "manage offer" operation creates, updates, or deletes an offer.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Throws:
-
Throws
Error
when the best rational approximation ofprice
cannot be found. - Type
-
Error
Returns:
- Type:
-
xdr.ManageOfferOp
(static) pathPayment(opts) → {xdr.PathPaymentOp}
Returns a XDR PaymentOp. A "payment" operation send the specified amount to the destination account, optionally through a path. XLM payments create the destination account if it does not exist.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Returns:
- Type:
-
xdr.PathPaymentOp
(static) payment(opts) → {xdr.PaymentOp}
Create a payment operation.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Returns:
- Type:
-
xdr.PaymentOp
(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 flags used in opts.clearFlags
and opts.setFlags
can be the following:
It's possible to set/clear multiple flags at once using logical or.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object
|
|
Returns:
- Type:
-
xdr.SetOptionsOp