Operation

Operation

Methods

(static) accountMerge(opts) → {xdr.Operation}

Transfers native balance to destination account.

Source:
Parameters:
Name Type Description
opts object

options object

Name Type Attributes Description
destination string

destination to merge the source account into

source string <optional>

operation source account (defaults to transaction source)

Returns:
Type:
xdr.Operation

an Account Merge operation (xdr.AccountMergeOp)

(static) allowTrust(opts) → {xdr.AllowTrustOp}

Deprecated:
  • since v5.0 Returns an XDR AllowTrustOp. An "allow trust" operation authorizes another account to hold your account's credit for a given asset.
Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
trustor string

The trusting account (the one being authorized)

assetCode string

The asset code being authorized.

authorize 0 | 1 | 2

1 to authorize, 2 to authorize to maintain liabilities, and 0 to deauthorize.

source string <optional>

The source account (defaults to transaction source).

Returns:
Type:
xdr.AllowTrustOp

Allow Trust operation

(static) beginSponsoringFutureReserves(opts) → {xdr.Operation}

Create a "begin sponsoring future reserves" operation.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
sponsoredId string

The sponsored account id.

source string <optional>

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

Returns:
Type:
xdr.Operation

xdr operation

Example
const op = Operation.beginSponsoringFutureReserves({
  sponsoredId: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
});

(static) bumpSequence(opts) → {xdr.BumpSequenceOp}

This operation bumps sequence number.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
bumpTo string

Sequence number to bump to.

source string <optional>

The optional source account.

Returns:
Type:
xdr.BumpSequenceOp

Operation

(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.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
asset Asset | LiquidityPoolAsset

The asset for the trust line.

limit string <optional>

The limit for the asset, defaults to max int64. If the limit is set to "0" it deletes the trustline.

source string <optional>

The source account (defaults to transaction source).

Returns:
Type:
xdr.ChangeTrustOp

Change Trust operation

(static) claimClaimableBalance(opts) → {xdr.Operation}

Create a new claim claimable balance operation.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
balanceId string

The claimable balance id to be claimed.

source string <optional>

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

Returns:
Type:
xdr.Operation

Claim claimable balance operation

Example
const op = Operation.claimClaimableBalance({
  balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',
});

(static) clawback(opts) → {xdr.ClawbackOp}

Creates a clawback operation.

Source:
See:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
asset Asset

The asset being clawed back.

amount string

The amount of the asset to claw back.

from string

The public key of the (optionally-muxed) account to claw back from.

source string <optional>

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

Returns:
Type:
xdr.ClawbackOp

(static) clawbackClaimableBalance(opts) → {xdr.ClawbackClaimableBalanceOp}

Creates a clawback operation for a claimable balance.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
balanceId string

The claimable balance ID to be clawed back.

source string <optional>

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

Returns:
Type:
xdr.ClawbackClaimableBalanceOp
Example
const op = Operation.clawbackClaimableBalance({
  balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',
});

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

Create and fund a non existent account.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
destination string

Destination account ID to create an account for.

startingBalance string

Amount in XLM the account should be funded for. Must be greater than the reserve balance amount.

source string <optional>

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

Returns:
Type:
xdr.CreateAccountOp

Create account operation

(static) createClaimableBalance(opts) → {xdr.Operation}

Create a new claimable balance operation.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
asset Asset

The asset for the claimable balance.

amount string

Amount.

claimants Array.<Claimant>

An array of Claimants

source string <optional>

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

Returns:
Type:
xdr.Operation

Create claimable balance operation

Example
const asset = new Asset(
  'USD',
  'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
);
const amount = '100.0000000';
const claimants = [
  new Claimant(
    'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ',
     Claimant.predicateBeforeAbsoluteTime("4102444800000")
  )
];

const op = Operation.createClaimableBalance({
  asset,
  amount,
  claimants
});

(static) createCustomContract(opts) → {xdr.Operation}

Returns an operation that creates a custom WASM contract.

Source:
See:
Parameters:
Name Type Description
opts any

the set of parameters

Name Type Attributes Description
address Address

the contract uploader address

wasmHash Uint8Array | Buffer

the SHA-256 hash of the contract WASM you're uploading (see hash and Operation.uploadContractWasm)

salt Uint8Array | Buffer <optional>

an optional, 32-byte salt to distinguish deployment instances of the same wasm from the same user (if omitted, one will be generated for you)

auth Array.<xdr.SorobanAuthorizationEntry> <optional>

an optional list outlining the tree of authorizations required for the call

source string <optional>

an optional source account

Returns:
Type:
xdr.Operation

an Invoke Host Function operation (xdr.InvokeHostFunctionOp)

(static) createPassiveSellOffer(opts) → {xdr.CreatePassiveSellOfferOp}

Returns a XDR CreatePasiveSellOfferOp. 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.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
selling Asset

What you're selling.

buying Asset

What you're buying.

amount string

The total amount you're selling. If 0, deletes the offer.

price number | string | BigNumber | Object

Price of 1 unit of selling in terms of buying.

Name Type Description
n number

If opts.price is an object: the price numerator

d number

If opts.price is an object: the price denominator

source string <optional>

The source account (defaults to transaction source).

Throws:

Throws Error when the best rational approximation of price cannot be found.

Type
Error
Returns:
Type:
xdr.CreatePassiveSellOfferOp

Create Passive Sell Offer operation

(static) createStellarAssetContract(opts) → {xdr.Operation}

Returns an operation that wraps a Stellar asset into a token contract.

Source:
See:
Parameters:
Name Type Description
opts any

the set of parameters

Name Type Attributes Description
asset Asset | string

the Stellar asset to wrap, either as an Asset object or in canonical form (SEP-11, code:issuer)

auth Array.<xdr.SorobanAuthorizationEntry> <optional>

an optional list outlining the tree of authorizations required for the call

source string <optional>

an optional source account

Returns:
Type:
xdr.Operation

an Invoke Host Function operation (xdr.InvokeHostFunctionOp)

(static) endSponsoringFutureReserves(opts) → {xdr.Operation}

Create an "end sponsoring future reserves" operation.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
source string <optional>

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

Returns:
Type:
xdr.Operation

xdr operation

Example
const op = Operation.endSponsoringFutureReserves();

(static) extendFootprintTtl(opts) → {xdr.Operation}

Builds an operation to bump the expiration of a footprint (read and written ledger keys). Its only parameter is the number of ledgers to extend expiration for.

The footprint itself is derived from the transaction (see TransactionBuilder's opts.sorobanData parameter, which is a xdr.SorobanTransactionData instance that contains fee data & resource usage as part of xdr.SorobanResources).

Source:
Parameters:
Name Type Description
opts object

object holding operation parameters

Name Type Attributes Description
extendTo number

the number of ledgers past the LCL (last closed ledger) by which to extend the validity of the ledger keys in this transaction

source string <optional>

an optional source account

Returns:
Type:
xdr.Operation

a Bump Footprint Expiration operation (xdr.ExtendFootprintTTLOp)

(static) fromXDRObject(operation) → {Operation}

Deconstructs the raw XDR operation object into the structured object that was used to create the operation (i.e. the opts parameter to most ops).

Source:
Parameters:
Name Type Description
operation xdr.Operation

An XDR Operation.

Returns:
Type:
Operation

(static) inflation(optsopt) → {xdr.InflationOp}

This operation generates the inflation.

Source:
Parameters:
Name Type Attributes Description
opts object <optional>

Options object

Name Type Attributes Description
source string <optional>

The optional source account.

Returns:
Type:
xdr.InflationOp

Inflation operation

(static) invokeContractFunction(opts) → {xdr.Operation}

Returns an operation that invokes a contract function.

Source:
See:
Parameters:
Name Type Description
opts any

the set of parameters

Name Type Attributes Description
contract string

a strkey-fied contract address (C...)

function string

the name of the contract fn to invoke

args Array.<xdr.ScVal>

parameters to pass to the function invocation (try nativeToScVal or ScInt to make building these easier)

auth Array.<xdr.SorobanAuthorizationEntry> <optional>

an optional list outlining the tree of authorizations required for the call

source string <optional>

an optional source account

Returns:
Type:
xdr.Operation

an Invoke Host Function operation (xdr.InvokeHostFunctionOp)

(static) invokeHostFunction(opts) → {xdr.Operation}

Invokes a single smart contract host function.

Source:
See:
Parameters:
Name Type Description
opts object

options object

Name Type Attributes Description
func xdr.HostFunction

host function to execute (with its wrapped parameters)

auth Array.<xdr.SorobanAuthorizationEntry> <optional>

list outlining the tree of authorizations required for the call

source string <optional>

an optional source account

Returns:
Type:
xdr.Operation

an Invoke Host Function operation (xdr.InvokeHostFunctionOp)

(static) isValidAmount(value, allowZero) → {boolean}

Validates that a given amount is possible for a Stellar asset.

Specifically, this means that the amount is well, a valid number, but also that it is within the int64 range and has no more than 7 decimal levels of precision.

Note that while smart contracts allow larger amounts, this is oriented towards validating the standard Stellar operations.

Source:
Parameters:
Name Type Default Description
value string

the amount to validate

allowZero boolean false

optionally, whether or not zero is valid (default: no)

Returns:
Type:
boolean

(static) liquidityPoolDeposit(opts) → {xdr.Operation}

Creates a liquidity pool deposit operation.

Source:
See:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
liquidityPoolId string

The liquidity pool ID.

maxAmountA string

Maximum amount of first asset to deposit.

maxAmountB string

Maximum amount of second asset to deposit.

minPrice number | string | BigNumber | Object

Minimum depositA/depositB price.

Name Type Description
n number

If opts.minPrice is an object: the price numerator

d number

If opts.minPrice is an object: the price denominator

maxPrice number | string | BigNumber | Object

Maximum depositA/depositB price.

Name Type Description
n number

If opts.maxPrice is an object: the price numerator

d number

If opts.maxPrice is an object: the price denominator

source string <optional>

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

Returns:
Type:
xdr.Operation

The resulting operation (xdr.LiquidityPoolDepositOp).

(static) liquidityPoolWithdraw(opts) → {xdr.Operation}

Creates a liquidity pool withdraw operation.

Source:
See:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
liquidityPoolId string

The liquidity pool ID.

amount string

Amount of pool shares to withdraw.

minAmountA string

Minimum amount of first asset to withdraw.

minAmountB string

Minimum amount of second asset to withdraw.

source string <optional>

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

Returns:
Type:
xdr.Operation

The resulting operation (xdr.LiquidityPoolWithdrawOp).

(static) manageBuyOffer(opts) → {xdr.ManageBuyOfferOp}

Returns a XDR ManageBuyOfferOp. A "manage buy offer" operation creates, updates, or deletes a buy offer.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
selling Asset

What you're selling.

buying Asset

What you're buying.

buyAmount string

The total amount you're buying. If 0, deletes the offer.

price number | string | BigNumber | Object

Price of 1 unit of buying in terms of selling.

Name Type Description
n number

If opts.price is an object: the price numerator

d number

If opts.price is an object: the price denominator

offerId number | string <optional>

If 0, will create a new offer (default). Otherwise, edits an exisiting offer.

source string <optional>

The source account (defaults to transaction source).

Throws:

Throws Error when the best rational approximation of price cannot be found.

Type
Error
Returns:
Type:
xdr.ManageBuyOfferOp

Manage Buy Offer operation

(static) manageData(opts) → {xdr.ManageDataOp}

This operation adds data entry to the ledger.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
name string

The name of the data entry.

value string | Buffer

The value of the data entry.

source string <optional>

The optional source account.

Returns:
Type:
xdr.ManageDataOp

Manage Data operation

(static) manageSellOffer(opts) → {xdr.ManageSellOfferOp}

Returns a XDR ManageSellOfferOp. A "manage sell offer" operation creates, updates, or deletes an offer.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
selling Asset

What you're selling.

buying Asset

What you're buying.

amount string

The total amount you're selling. If 0, deletes the offer.

price number | string | BigNumber | Object

Price of 1 unit of selling in terms of buying.

Name Type Description
n number

If opts.price is an object: the price numerator

d number

If opts.price is an object: the price denominator

offerId number | string <optional>

If 0, will create a new offer (default). Otherwise, edits an exisiting offer.

source string <optional>

The source account (defaults to transaction source).

Throws:

Throws Error when the best rational approximation of price cannot be found.

Type
Error
Returns:
Type:
xdr.ManageSellOfferOp

Manage Sell Offer operation

(static) pathPaymentStrictReceive(opts) → {xdr.PathPaymentStrictReceiveOp}

Creates a PathPaymentStrictReceive operation.

A PathPaymentStrictReceive operation sends the specified amount to the destination account. It credits the destination with destAmount of destAsset, while debiting at most sendMax of sendAsset from the source. The transfer optionally occurs through a path. XLM payments create the destination account if it does not exist.

Source:
See:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
sendAsset Asset

asset to pay with

sendMax string

maximum amount of sendAsset to send

destination string

destination account to send to

destAsset Asset

asset the destination will receive

destAmount string

amount the destination receives

path Array.<Asset>

array of Asset objects to use as the path

source string <optional>

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

Returns:
Type:
xdr.PathPaymentStrictReceiveOp

the resulting path payment op

(static) pathPaymentStrictSend(opts) → {xdr.Operation}

Creates a PathPaymentStrictSend operation.

A PathPaymentStrictSend operation sends the specified amount to the destination account crediting at least destMin of destAsset, optionally through a path. XLM payments create the destination account if it does not exist.

Source:
See:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
sendAsset Asset

asset to pay with

sendAmount string

amount of sendAsset to send (excluding fees)

destination string

destination account to send to

destAsset Asset

asset the destination will receive

destMin string

minimum amount of destAsset to be receive

path Array.<Asset>

array of Asset objects to use as the path

source string <optional>

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

Returns:
Type:
xdr.Operation

the resulting path payment operation (xdr.PathPaymentStrictSendOp)

(static) payment(opts) → {xdr.Operation}

Create a payment operation.

Source:
See:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
destination string

destination account ID

asset Asset

asset to send

amount string

amount to send

source string <optional>

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

Returns:
Type:
xdr.Operation

The resulting payment operation (xdr.PaymentOp)

(static) restoreFootprint(optsopt) → {xdr.Operation}

Builds a footprint restoration operation.

It takes no parameters because the relevant footprint is derived from the transaction itself (see TransactionBuilder's opts.sorobanData parameter (or TransactionBuilder.setSorobanData / TransactionBuilder.setLedgerKeys), which is a xdr.SorobanTransactionData instance that contains fee data & resource usage as part of xdr.SorobanTransactionData).

Source:
Parameters:
Name Type Attributes Description
opts object <optional>

an optional set of parameters

Name Type Attributes Description
source string <optional>

an optional source account

Returns:
Type:
xdr.Operation

a Bump Footprint Expiration operation (xdr.RestoreFootprintOp)

(static) revokeAccountSponsorship(opts) → {xdr.Operation}

Create a "revoke sponsorship" operation for an account.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
account string

The sponsored account ID.

source string <optional>

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

Returns:
Type:
xdr.Operation

xdr operation

Example
const op = Operation.revokeAccountSponsorship({
  account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7
});

(static) revokeClaimableBalanceSponsorship(opts) → {xdr.Operation}

Create a "revoke sponsorship" operation for a claimable balance.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
balanceId string

The sponsored claimable balance ID.

source string <optional>

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

Returns:
Type:
xdr.Operation

xdr operation

Example
const op = Operation.revokeClaimableBalanceSponsorship({
  balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',
});

(static) revokeDataSponsorship(opts) → {xdr.Operation}

Create a "revoke sponsorship" operation for a data entry.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
account string

The account ID which owns the data entry.

name string

The name of the data entry

source string <optional>

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

Returns:
Type:
xdr.Operation

xdr operation

Example
const op = Operation.revokeDataSponsorship({
  account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7
  name: 'foo'
});

(static) revokeLiquidityPoolSponsorship(opts) → {xdr.Operation}

Creates a "revoke sponsorship" operation for a liquidity pool.

Source:
Parameters:
Name Type Description
opts object

– Options object.

Name Type Attributes Description
liquidityPoolId string

The sponsored liquidity pool ID in 'hex' string.

source string <optional>

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

Returns:
Type:
xdr.Operation

xdr Operation.

Example
const op = Operation.revokeLiquidityPoolSponsorship({
  liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7',
});

(static) revokeOfferSponsorship(opts) → {xdr.Operation}

Create a "revoke sponsorship" operation for an offer.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
seller string

The account ID which created the offer.

offerId string

The offer ID.

source string <optional>

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

Returns:
Type:
xdr.Operation

xdr operation

Example
const op = Operation.revokeOfferSponsorship({
  seller: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7
  offerId: '1234'
});

(static) revokeSignerSponsorship(opts) → {xdr.Operation}

Create a "revoke sponsorship" operation for a signer.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
account string

The account ID where the signer sponsorship is being removed from.

signer object

The signer whose sponsorship is being removed.

Name Type Attributes Description
ed25519PublicKey string <optional>

The ed25519 public key of the signer.

sha256Hash Buffer | string <optional>

sha256 hash (Buffer or hex string).

preAuthTx Buffer | string <optional>

Hash (Buffer or hex string) of transaction.

source string <optional>

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

Returns:
Type:
xdr.Operation

xdr operation

Example
const op = Operation.revokeSignerSponsorship({
  account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7
  signer: {
    ed25519PublicKey: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'
  }
})

(static) revokeTrustlineSponsorship(opts) → {xdr.Operation}

Create a "revoke sponsorship" operation for a trustline.

Source:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
account string

The account ID which owns the trustline.

asset Asset | LiquidityPoolId

The trustline asset.

source string <optional>

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

Returns:
Type:
xdr.Operation

xdr operation

Example
const op = Operation.revokeTrustlineSponsorship({
  account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7
  asset: new StellarBase.LiquidityPoolId(
    'USDUSD',
    'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
  )
});

(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.

Source:
See:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
inflationDest string <optional>

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

clearFlags number | string <optional>

Bitmap integer for which account flags to clear.

setFlags number | string <optional>

Bitmap integer for which account flags to set.

masterWeight number | string <optional>

The master key weight.

lowThreshold number | string <optional>

The sum weight for the low threshold.

medThreshold number | string <optional>

The sum weight for the medium threshold.

highThreshold number | string <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. Only one of ed25519PublicKey, sha256Hash, preAuthTx should be defined.

Name Type Attributes Description
ed25519PublicKey string <optional>

The ed25519 public key of the signer.

sha256Hash Buffer | string <optional>

sha256 hash (Buffer or hex string) of preimage that will unlock funds. Preimage should be used as signature of future transaction.

preAuthTx Buffer | string <optional>

Hash (Buffer or hex string) of transaction that will unlock funds.

ed25519SignedPayload string <optional>

Signed payload signer (ed25519 public key + raw payload) for atomic transaction signature disclosure.

weight number | string <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

XDR operation

(static) setTrustLineFlags(opts) → {xdr.SetTrustLineFlagsOp}

Creates a trustline flag configuring operation.

For the flags, set them to true to enable them and false to disable them. Any unmodified operations will be marked undefined in the result.

Note that you can only clear the clawbackEnabled flag set; it must be set account-wide via operations.SetOptions (setting xdr.AccountFlags.clawbackEnabled).

Source:
See:
Parameters:
Name Type Description
opts object

Options object

Name Type Attributes Description
trustor string

the account whose trustline this is

asset Asset

the asset on the trustline

flags object

the set of flags to modify

Name Type Attributes Description
authorized bool <optional>

authorize account to perform transactions with its credit

authorizedToMaintainLiabilities bool <optional>

authorize account to maintain and reduce liabilities for its credit

clawbackEnabled bool <optional>

stop claimable balances on this trustlines from having clawbacks enabled (this flag can only be set to false!)

source string <optional>

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

Returns:
Type:
xdr.SetTrustLineFlagsOp

(static) uploadContractWasm(opts) → {xdr.Operation}

Returns an operation that uploads WASM for a contract.

Source:
See:
Parameters:
Name Type Description
opts any

the set of parameters

Name Type Attributes Description
wasm Uint8Array | Buffer

a WASM blob to upload to the ledger

auth Array.<xdr.SorobanAuthorizationEntry> <optional>

an optional list outlining the tree of authorizations required for the call

source string <optional>

an optional source account

Returns:
Type:
xdr.Operation

an Invoke Host Function operation (xdr.InvokeHostFunctionOp)