Lista de Operaciones
Las operaciones son objetos que representan un cambio deseado en el ledger y se envían a la red agrupadas en una transacción. Para cada operación, hay un tipo de resultado exitoso o fallido. En caso de éxito, el usuario puede reunir información sobre el efecto de la operación. En caso de fallo, el usuario puede aprender más sobre el error.
Aprende más sobre transacciones y operaciones en nuestra sección de Operaciones y Transacciones.
Actualmente hay 26 operaciones que puedes utilizar en la red Stellar, estas operaciones, sus definiciones, SDKs, umbrales, parámetros y errores se enumeran a continuación.
Crear cuenta
Crea y financia una nueva cuenta con el saldo inicial especificado
SDKs: JavaScript | Java | Go
Umbral: Medio
Resultado: CreateAccountResult
Parámetros:
Parámetro | Tipo | Descripción |
---|---|---|
Destino | ID de cuenta | Dirección de cuenta que se crea y se financia. |
Saldo inicial | entero | Cantidad de XLM a enviar a la cuenta recién creada. Este XLM proviene de la cuenta fuente. |
Posibles errores:
Error | Código | Descripción |
---|---|---|
CREAR_CUENTA_MALFORMADA | -1 | El destino es inválido. |
CREAR_CUENTA_SIN_FONDOS | -2 | La cuenta fuente que realiza el comando no tiene suficientes fondos para darle al destino el saldo inicial de XLM y todavía mantener su reserva mínima de XLM más satisfacer sus obligaciones de venta de XLM. |
CREAR_CUENTA_BAJA_RESERVA | -3 | Esta operación crearía una cuenta con menos del número mínimo de XLM que una cuenta debe mantener. |
CREAR_CUENTA_YA_EXISTE | -4 | La cuenta destino ya existe. |
Pago
Envía una cantidad en un activo específico a una cuenta de destino
SDKs: JavaScript | Java | Go
Umbral: Medio
Resultado: PaymentResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Destino | ID de cuenta | Dirección de cuenta que recibe el pago. |
Activo | activo | Activo a enviar a la cuenta de destino. |
Cantidad | entero | Cantidad del activo mencionado a enviar. |
Posibles errores:
Error | Código | Descripción |
---|---|---|
PAGO_MALFORMADO | -1 | La entrada para el pago es inválida. |
PAGO_SIN_FONDOS | -2 | La cuenta fuente (remitente) no tiene suficientes fondos para enviar cantidad y todavía satisfacer sus obligaciones de venta. Ten en cuenta que si envías XLM, entonces el remitente debe además mantener su reserva mínima de XLM. Ten en cuenta que este error no se devolverá si la cuenta receptora es el emisor de activo . |
PAGO_SRC_NO_CONFIANZA | -3 | La cuenta fuente no confía en el emisor del activo que está tratando de enviar. |
PAGO_SRC_NO_AUTORIZADO | -4 | La cuenta fuente no está autorizada para enviar este pago. |
PAGO_SIN_DESTINO | -5 | La cuenta receptora no existe. Ten en cuenta que este error no se devolverá si la cuenta receptora es el emisor del activo . |
PAGO_SIN_CONFIANZA | -6 | El receptor no confía en el emisor del activo que se envía. Para más información, consulta la sección de Activos. |
PAGO_NO_AUTORIZADO | -7 | La cuenta de destino no está autorizada por el emisor del activo para mantener el activo. |
PAGO_LINEA_LLENA | -8 | La cuenta de destino (receptora) no tiene suficientes límites para recibir cantidad y aún satisfacer sus obligaciones de compra. |
Pago estricto de ruta
Un pago en el que el activo enviado puede ser diferente del activo recibido; permite al usuario especificar la cantidad del activo a enviar
Aprende más sobre pagos de ruta: Entrada de Enciclopedia de Pagos de Ruta
SDKs: JavaScript | Java | Go
Umbral: Medio
Resultado: PathPaymentStrictSendResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Enviar activo | activo | El activo descontado de la cuenta del remitente. |
Enviar cantidad | entero | La cantidad de enviar activo a descontar (excluyendo tarifas). |
Destino | ID de cuenta | ID de cuenta del destinatario. |
Activo de destino | activo | El activo que recibe la cuenta de destino. |
Mínimo de destino | entero | La cantidad mínima de activo de destino que la cuenta de destino puede recibir. |
Ruta | lista de activos | Los activos (además de enviar activo y activo de destino ) involucrados en las ofertas que toma la ruta. Por ejemplo, si solo puedes encontrar una ruta de USD a EUR a través de XLM y BTC, la ruta sería USD -> XLM -> BTC -> EUR y el campo ruta contendría XLM y BTC. |
Posibles errores:
Error | Código | Descripción |
---|---|---|
RUTA_PAGO_ESTRICTO_ENVIAR_MALFORMADO | -1 | La entrada a este pago de ruta es inválida. |
RUTA_PAGO_ESTRICTO_ENVIAR_SIN_FONDOS | -2 | La cuenta fuente (remitente) no tiene suficientes fondos para enviar y aún satisfacer sus obligaciones de venta. Ten en cuenta que si envías XLM, entonces el remitente debe además mantener su reserva mínima de XLM. Ten en cuenta que si envías XLM, entonces el remitente debe además mantener su reserva mínima de XLM. |
RUTA_PAGO_ESTRICTO_SRC_NO_CONFIANZA | -3 | La cuenta fuente no confía en el emisor del activo que está tratando de enviar. |
RUTA_PAGO_ESTRICTO_SRC_NO_AUTORIZADO | -4 | La cuenta fuente no está autorizada para enviar este pago. |
RUTA_PAGO_ESTRICTO_SIN_DESTINO | -5 | La cuenta de destino no existe. |
RUTA_PAGO_ESTRICTO_SIN_CONFIANZA | -6 | La cuenta de destino no confía en el emisor del activo que se envía. Para más información, consulta la sección de Activos. |
RUTA_PAGO_ESTRICTO_NO_AUTORIZADO | -7 | La cuenta de destino no está autorizada por el emisor del activo para mantener el activo. |
RUTA_PAGO_ESTRICTO_LINEA_LLENA | -8 | La cuenta de destino no tiene límites suficientes para recibir importe de destino y aún satisfacer sus obligaciones de compra. |
RUTA_PAGO_ESTRICTO_MUY_POCAS_OFERTAS | -10 | No hay una ruta de ofertas conectando el enviar activo y el activo de destino . Stellar solo considera rutas de longitud 5 o más cortas. |
RUTA_PAGO_ESTRICTO_OFERTA_CRUZAR_AUTOS | -11 | El pago cruzaría una de sus propias ofertas. |
RUTA_PAGO_ESTRICTO_ENVIAR_BAJO_DESTMIN | -12 | Las rutas que podrían enviar importe de destino de activo de destino serían insuficientes para mínimo de destino . |
Pago estricto de ruta recibir
Un pago en el que el activo recibido puede ser diferente del activo enviado; permite al usuario especificar la cantidad del activo recibido
Aprende más sobre pagos de ruta: Entrada de Enciclopedia de Pagos de Ruta
SDKs: JavaScript | Java | Go
Umbral: Medio
Resultado: PathPaymentStrictReceiveResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Enviar activo | activo | El activo descontado de la cuenta del remitente. |
Enviar máximo | entero | La cantidad máxima de enviar activo a descontar (excluyendo tarifas). |
Destino | ID de cuenta | ID de cuenta del destinatario. |
Activo de destino | activo | El activo que recibe la cuenta de destino. |
Cantidad de destino | entero | The amount of destination asset the destination account receives. |
Path | list of assets | The assets (other than send asset and destination asset ) involved in the offers the path takes. For example, if you can only find a path from USD to EUR through XLM and BTC, the path would be USD -> XLM -> BTC -> EUR and the path field would contain XLM and BTC. |
Possible errors:
Error | Code | Description |
---|---|---|
PATH_PAYMENT_STRICT_RECEIVE_MALFORMED | -1 | The input to this path payment is invalid. |
PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED | -2 | The source account (sender) does not have enough funds to send and still satisfy its selling liabilities. Note that if sending XLM then the sender must additionally maintain its minimum XLM reserve. |
PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST | -3 | The source account does not trust the issuer of the asset it is trying to send. |
PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED | -4 | The source account is not authorized to send this payment. |
PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION | -5 | The destination account does not exist. |
PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST | -6 | The destination account does not trust the issuer of the asset being sent. For more, see the Assets section. |
PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED | -7 | The destination account is not authorized by the asset's issuer to hold the asset. |
PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL | -8 | The destination account does not have sufficient limits to receive destination amount and still satisfy its buying liabilities. |
PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS | -10 | There is no path of offers connecting the send asset and destination asset . Stellar only considers paths of length 5 or shorter. |
PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF | -11 | The payment would cross one of its own offers. |
PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX | -12 | The paths that could send destination amount of destination asset would exceed send max . |
Manage buy offer
Creates, updates, or deletes an offer to buy a specific amount of an asset for another
Learn more about passive sell offers: Liquidity on Stellar: SDEX and Liquidity Pools
SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ManageBuyOfferResult
Parameters:
Parameters | Type | Description |
---|---|---|
Selling | asset | Asset the offer creator is selling. |
Buying | asset | Asset the offer creator is buying. |
Amount | integer | Amount of buying being bought. Set to 0 if you want to delete an existing offer. |
Price | {numerator, denominator} | Price of 1 unit of buying in terms of selling . For example, if you wanted to buy 30 XLM and sell 5 BTC, the price would be {5,30}. |
Offer ID | unsigned integer | The ID of the offer. 0 for new offer. Set to existing offer ID to update or delete. |
Possible errors:
Error | Code | Description |
---|---|---|
MANAGE_BUY_OFFER_MALFORMED | -1 | The input is incorrect and would result in an invalid offer. |
MANAGE_BUY_OFFER_SELL_NO_TRUST | -2 | The account creating the offer does not have a trustline for the asset it is selling. |
MANAGE_BUY_OFFER_BUY_NO_TRUST | -3 | The account creating the offer does not have a trustline for the asset it is buying. |
MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED | -4 | The account creating the offer is not authorized to sell this asset. |
MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED | -5 | The account creating the offer is not authorized to buy this asset. |
MANAGE_BUY_OFFER_LINE_FULL | -6 | The account creating the offer does not have sufficient limits to receive buying and still satisfy its buying liabilities. |
MANAGE_BUY_OFFER_UNDERFUNDED | -7 | The account creating the offer does not have sufficient limits to send selling and still satisfy its selling liabilities. Note that if selling XLM then the account must additionally maintain its minimum XLM reserve, which is calculated assuming this offer will not completely execute immediately. |
MANAGE_BUY_OFFER_CROSS_SELF | -8 | The account has opposite offer of equal or lesser price active, so the account creating this offer would immediately cross itself. |
MANAGE_BUY_OFFER_NOT_FOUND | -11 | An offer with that offerID cannot be found. |
MANAGE_BUY_OFFER_LOW_RESERVE | -12 | The account creating this offer does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every offer an account creates, the minimum amount of XLM that account must hold will increase. |
Manage sell offer
Creates, updates, or deletes an offer to sell a specific amount of an asset for another
Learn more about passive sell offers: Liquidity on Stellar: SDEX and Liquidity Pools
SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ManageSellOfferResult
Parameters:
Parameters | Type | Description |
---|---|---|
Selling | asset | Asset the offer creator is selling. |
Buying | asset | Asset the offer creator is buying. |
Amount | integer | Amount of selling being sold. Set to 0 if you want to delete an existing offer. |
Price | {numerator, denominator} | Price of 1 unit of selling in terms of buying . For example, if you wanted to sell 30 XLM and buy 5 BTC, the price would be {5,30}. |
Offer ID | unsigned integer | The ID of the offer. 0 for new offer. Set to existing offer ID to update or delete. |
Possible errors:
Error | Code | Description |
---|---|---|
MANAGE_SELL_OFFER_MALFORMED | -1 | The input is incorrect and would result in an invalid offer. |
MANAGE_SELL_OFFER_SELL_NO_TRUST | -2 | The account creating the offer does not have a trustline for the asset it is selling. |
MANAGE_SELL_OFFER_BUY_NO_TRUST | -3 | The account creating the offer does not have a trustline for the asset it is buying. |
MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED | -4 | The account creating the offer is not authorized to sell this asset. |
MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED | -5 | The account creating the offer is not authorized to buy this asset. |
MANAGE_SELL_OFFER_LINE_FULL | -6 | The account creating the offer does not have sufficient limits to receive buying and still satisfy its buying liabilities. |
MANAGE_SELL_OFFER_UNDERFUNDED | -7 | The account creating the offer does not have sufficient limits to send selling and still satisfy its selling liabilities. Note that if selling XLM then the account must additionally maintain its minimum XLM reserve, which is calculated assuming this offer will not completely execute immediately. |
MANAGE_SELL_OFFER_CROSS_SELF | -8 | The account has opposite offer of equal or lesser price active, so the account creating this offer would immediately cross itself. |
MANAGE_SELL_OFFER_NOT_FOUND | -11 | An offer with that offerID cannot be found. |
MANAGE_SELL_OFFER_LOW_RESERVE | -12 | The account creating this offer does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every offer an account creates, the minimum amount of XLM that account must hold will increase. |
Create passive sell offer
Creates an offer to sell one asset for another without taking a reverse offer of equal price
Learn more about passive sell offers: Liquidity on Stellar: SDEX and Liquidity Pools
SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ManageSellOfferResult
Parameters:
Parameters | Type | Description |
---|---|---|
Selling | asset | Asset the offer creator is selling. |
Buying | asset | Asset the offer creator is buying. |
Amount | integer | Amount of selling being sold. |
Price | {numerator, denominator} | Price of 1 unit of selling in terms of buying . For example, if you wanted to sell 30 XLM and buy 5 BTC, the price would be {5,30}. |
Possible errors:
Error | Code | Description |
---|---|---|
MANAGE_SELL_OFFER_MALFORMED | -1 | The input is incorrect and would result in an invalid offer. |
MANAGE_SELL_OFFER_SELL_NO_TRUST | -2 | The account creating the offer does not have a trustline for the asset it is selling. |
MANAGE_SELL_OFFER_BUY_NO_TRUST | -3 | The account creating the offer does not have a trustline for the asset it is buying. |
MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED | -4 | The account creating the offer is not authorized to sell this asset. |
MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED | -5 | The account creating the offer is not authorized to buy this asset. |
MANAGE_SELL_OFFER_LINE_FULL | -6 | The account creating the offer does not have sufficient limits to receive buying and still satisfy its buying liabilities. |
MANAGE_SELL_OFFER_UNDERFUNDED | -7 | The account creating the offer does not have sufficient limits to send selling and still satisfy its selling liabilities. Note that if selling XLM then the account must additionally maintain its minimum XLM reserve, which is calculated assuming this offer will not completely execute immediately. |
MANAGE_SELL_OFFER_CROSS_SELF | -8 | The account has opposite offer of equal or lesser price active, so the account creating this offer would immediately cross itself. |
MANAGE_SELL_OFFER_NOT_FOUND | -11 | An offer with that offerID cannot be found. |
MANAGE_SELL_OFFER_LOW_RESERVE | -12 | The account creating this offer does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every offer an account creates, the minimum amount of XLM that account must hold will increase. |
Set options
Set options for an account such as flags, inflation destination, signers, home domain, and master key weight
Learn more about flags: Flags Encyclopedia Entry
Learn more about the home domain: Stellar Ecosystem Proposals SEP-0001
Learn more about signers operations and key weight: Signature and Multisignature Encyclopedia Entry
SDKs: JavaScript | Java | Go
Threshold: High (when updating signers or other thresholds) or Medium (when updating everything else)
Result: SetOptionsResult
Parameters:
Parameters | Type | Description |
---|---|---|
Inflation Destination | account ID | Account of the inflation destination. |
Clear flags | integer | Indicates which account flags to clear. These account-level flags are primarily used by asset issuers; for details about the flags, please refer to the Asset Design Considerations page. The bit mask integer subtracts from the existing flags of the account. This allows for setting specific bits without knowledge of existing flags. |
Set flags | integer | Indicates which account flags to set. These account-level flags are primarily used by asset issuers; for details about the flags, please refer to the Asset Design Considerations page The bit mask integer adds onto the existing flags of the account. This allows for setting specific bits without knowledge of existing flags. |
Master weight | integer | A number from 0-255 (inclusive) representing the weight of the master key. If the weight of the master key is updated to 0, it is effectively disabled. |
Low threshold | integer | A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a low threshold. |
Medium threshold | integer | A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a medium threshold. |
High threshold | integer | A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a high threshold. |
Home domain | string | Sets the home domain of an account. See Federation. |
Signer | {Public Key, weight} | Add, update, or remove a signer from an account. Signer weight is a number from 0-255 (inclusive). The signer is deleted if the weight is 0. |
Possible errors:
Error | Code | Description |
---|---|---|
SET_OPTIONS_LOW_RESERVE | -1 | This account does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every new signer added to an account, the minimum reserve of XLM that account must hold increases. |
SET_OPTIONS_TOO_MANY_SIGNERS | -2 | 20 is the maximum number of signers an account can have, and adding another signer would exceed that. |
SET_OPTIONS_BAD_FLAGS | -3 | The flags set and/or cleared are invalid by themselves or in combination. |
SET_OPTIONS_INVALID_INFLATION | -4 | The destination account set in the inflation field does not exist. |
SET_OPTIONS_CANT_CHANGE | -5 | This account can no longer change the option it wants to change. |
SET_OPTIONS_UNKNOWN_FLAG | -6 | The account is trying to set a flag that is unknown. |
SET_OPTIONS_THRESHOLD_OUT_OF_RANGE | -7 | The value for a key weight or threshold is invalid. |
SET_OPTIONS_BAD_SIGNER | -8 | Any additional signers added to the account cannot be the master key. |
SET_OPTIONS_INVALID_HOME_DOMAIN | -9 | Home domain is malformed. |
Change trust
Creates, updates, or deletes a trustline
Learn more about trustlines: Trustlines section
SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ChangeTrustResult
Parameters:
Parameters | Type | Description |
---|---|---|
Line | ChangeTrustAsset | The asset of the trustline. For example, if a user extends a trustline of up to 200 USD to an anchor, the line is USD:anchor. |
Limit | integer | The limit of the trustline. In the previous example, the limit would be 200. |
Possible errors:
Error | Code | Description |
---|---|---|
CHANGE_TRUST_MALFORMED | -1 | The input to this operation is invalid. |
CHANGE_TRUST_NO_ISSUER | -2 | The issuer of the asset cannot be found. |
CHANGE_TRUST_INVALID_LIMIT | -3 | The limit is not sufficient to hold the current balance of the trustline and still satisfy its buying liabilities. This error occurs when attempting to remove a trustline with a non-zero asset balance. |
CHANGE_TRUST_LOW_RESERVE | -4 | Esta cuenta no tiene suficiente XLM para satisfacer el aumento de la reserva mínima de XLM causado por la adición de una subentrada y aún así satisfacer sus responsabilidades de venta de XLM. Por cada nueva línea de confianza agregada a una cuenta, la reserva mínima de XLM que esa cuenta debe mantener aumenta. |
CAMBIO_DE_CONFIANZA_NO_PERMITIDO_PARA_SÍ | -5 | La cuenta de origen intentó crear una línea de confianza para sí misma, lo cual no está permitido. |
CAMBIO_DE_CONFIANZA_LÍNEA_DE_CONFIANZA_FALTANTE | -6 | Falta la línea de confianza del activo para el fondo de liquidez. |
CAMBIO_DE_CONFIANZA_NO_SE_PUEDE_ELIMINAR | -7 | La línea de confianza del activo todavía está referenciada por un fondo de liquidez. |
CAMBIO_DE_CONFIANZA_NO_AUTORIZADO_MANTENER_LIABILIDADES | -8 | La línea de confianza del activo está desautorizada. |
Permitir confianza
Actualiza la bandera autorizada de una línea de confianza existente
Esta operación está en desuso desde el Protocolo 17; preferir SetTrustlineFlags en su lugar
SDKs: JavaScript | Java | Go
Umbral: Bajo
Resultado: AllowTrustResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Confiador | ID de cuenta | La cuenta del destinatario de la línea de confianza. |
Tipo | código de activo | El código de activo de un máximo de 4 o 12 caracteres de la línea de confianza que la cuenta de origen está autorizando. Por ejemplo, si una cuenta emisora quiere permitir que otra cuenta mantenga su crédito en USD, el tipo es USD . |
Autorizar | entero | Bandera que indica si la línea de confianza está autorizada. 1 si la cuenta está autorizada para transaccionar con el activo. 2 si la cuenta está autorizada para mantener ofertas, pero no para realizar otras transacciones |
Posibles errores:
Error | Código | Descripción |
---|---|---|
PERMITIR_CONFIANZA_MALFORMADO | -1 | El activo especificado en tipo no es válido. Además, este error ocurre cuando se especifica el activo nativo. |
PERMITIR_CONFIANZA_SIN_LÍNEA_DE_CONFIANZA | -2 | El confiador no tiene una línea de confianza con el emisor que realiza esta operación. |
PERMITIR_CONFIANZA_NO_REQUERIDO | -3 | La cuenta de origen (emisor que realiza esta operación) no requiere confianza. En otras palabras, no tiene la bandera AUTH_REQUIRED_FLAG establecida. |
PERMITIR_CONFIANZA_NO_SE_PUEDE_REVOKAR | -4 | La cuenta de origen está intentando revocar la línea de confianza del confiador , pero no puede hacerlo. |
PERMITIR_CONFIANZA_NO_PERMITIDO_PARA_SÍ | -5 | La cuenta de origen intentó permitir una línea de confianza para sí misma, lo cual no está permitido porque una cuenta no puede crear una línea de confianza consigo misma. |
PERMITIR_CONFIANZA_BAJO_RESERVA | -6 | Los saldos reclamables no pueden ser creados tras la revocación de líneas de confianza de activos (o acciones de fondos) asociadas con un fondo de liquidez debido a reservas bajas. |
Fusión de cuentas
Transfiere el saldo de XLM de una cuenta a otra cuenta y elimina la cuenta de origen del ledger.
SDKs: JavaScript | Java | Go
Umbral: Alto
Resultado: AccountMergeResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Destino | ID de cuenta | La cuenta que recibe el saldo restante de XLM de la cuenta de origen. |
Posibles errores:
Error | Código | Descripción |
---|---|---|
CUENTA_MERGE_MALFORMADO | -1 | La operación está malformada porque la cuenta de origen no puede fusionarse consigo misma. La destino debe ser una cuenta diferente. El destino debe ser una cuenta diferente. |
CUENTA_MERGE_NO_CUENTA | -2 | La cuenta destino no existe. |
CUENTA_MERGE_CONJUNTO_INMUTABLE | -3 | La cuenta de origen tiene la bandera AUTH_IMMUTABLE establecida. |
CUENTA_MERGE_TIENDE_SUB_ENTRADAS | -4 | La cuenta de origen tiene líneas de confianza/ofertas. |
CUENTA_MERGE_NUMERO_DE_SECUENCIA_MUY_ALTO | -5 | El número de secuencia de la cuenta de origen es demasiado alto. Debe ser menor que (ledgerSeq << 32) = (ledgerSeq * 0x100000000) . |
CUENTA_MERGE_DESTINO_LLENO | -6 | La cuenta destino no puede recibir el saldo de la cuenta de origen y aún así satisfacer sus responsabilidades de compra de lumen. |
CUENTA_MERGE_ES_PATROCINADOR | -7 | La cuenta de origen es un patrocinador. |
Administrar datos
Establece, modifica o elimina una entrada de datos (par nombre/valor) que está adjunta a una cuenta.
Aprende más sobre entradas y subentradas: Sección de cuentas
SDKs: JavaScript | Java | Go
Umbral: Medio
Resultado: ManageDataResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Nombre | cadena | Cadena de hasta 64 bytes de longitud. Si este es un nuevo nombre, se añadirá el par nombre/valor dado a la cuenta. Si este nombre ya está presente, entonces el valor asociado será modificado. |
Valor | datos binarios | (opcional) Si no está presente, entonces el nombre existente será eliminado. Si está presente, entonces este valor será establecido en la entrada de datos. De hasta 64 bytes de longitud. |
Posibles errores:
Error | Código | Descripción |
---|---|---|
GESTIONAR_DATOS_NO_SOPORTADO_AÚN | -1 | La red aún no ha cambiado a este cambio de protocolo. Este error significa que la red no soporta esta función todavía. |
GESTIONAR_DATOS_NOMBRE_NO_ENCONTRADO | -2 | Intentando eliminar una entrada de datos que no está allí. Esto sucederá si el nombre está establecido (y el valor no) pero la cuenta no tiene una entrada de datos con ese nombre. |
GESTIONAR_DATOS_BAJO_RESERVA | -3 | Esta cuenta no tiene suficiente XLM para satisfacer el aumento de la reserva mínima de XLM causado por la adición de una subentrada y aún así satisfacer sus responsabilidades de venta de XLM. Por cada nueva entrada de datos agregada a una cuenta, la reserva mínima de XLM que esa cuenta debe mantener aumenta. |
GESTIONAR_DATOS_NOMBRE_NO_VÁLIDO | -4 | Nombre no es una cadena válida. |
Aumentar secuencia
Aumenta hacia adelante el número de secuencia de la cuenta de origen al número de secuencia dado, invalidando cualquier transacción con un número de secuencia más pequeño.
SDKs: JavaScript | Java | Go
Umbral: Bajo
Resultado: BumpSequenceResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
bumpTo | Número de secuencia | valor deseado para el número de secuencia de la cuenta de origen de la operación. |
Posibles errores:
Error | Código | Descripción |
---|---|---|
BUMP_SEQUENCE_MALFORMADO | -1 | El número de secuencia bumpTo especificado no es un número de secuencia válido. Debe estar entre 0 y INT64_MAX (9223372036854775807 o 0x7fffffffffffffff). |
Crear saldo reclamable
Mueve una cantidad de activo de la cuenta fuente de la operación a una nueva ClaimableBalanceEntry.
Aprende más sobre saldos reclamables: Entrada de enciclopedia de saldos reclamables
SDKs: Java
Umbral: Medio
Resultado: CreateClaimableBalanceResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Activo | activo | Activo que se mantendrá en la ClaimableBalanceEntry en la forma asset_code:issuing_address o native (XLM). |
Cantidad | entero | Cantidad de activo almacenada en la ClaimableBalanceEntry. |
Reclamantes | lista de reclamantes | Lista de reclamantes (dirección de la cuenta y par ClaimPredicate) que pueden reclamar esta ClaimableBalanceEntry. |
Posibles errores:
Error | Código | Descripción |
---|---|---|
CREATE_CLAIMABLE_BALANCE_MALFORMED | -1 | The input to this operation is invalid. |
CREATE_CLAIMABLE_BALANCE_LOW_RESERVE | -2 | The account creating this entry does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a ClaimableBalanceEntry. For every claimant in the list, the minimum amount of XLM this account must hold will increase by baseReserve. |
CREATE_CLAIMABLE_BALANCE_NO_TRUST | -3 | The source account does not trust the issuer of the asset it is trying to include in the ClaimableBalanceEntry. |
CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED | -4 | The source account is not authorized to transfer this asset. |
CREATE_CLAIMABLE_BALANCE_UNDERFUNDED | -5 | The source account does not have enough funds to transfer amount of this asset to the ClaimableBalanceEntry. |
Claim claimable balance
Claims a ClaimableBalanceEntry that corresponds to the BalanceID and adds the amount of an asset on the entry to the source account
Learn more about claimable balances and view more parameters: Claimable Balances Encyclopedia Entry
SDKs: Java
Threshold: Low
Result: ClaimClaimableBalanceResult
Parameters:
Parameters | Type | Description |
---|---|---|
BalanceID | claimableBalanceID | BalanceID on the ClaimableBalanceEntry that the source account is claiming. The balanceID can be retrieved from a successful CreateClaimableBalanceResult . See Claimable Balance Encyclopedia Entry for more information. |
Possible errors:
Error | Code | Description |
---|---|---|
CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST | -1 | There is no existing ClaimableBalanceEntry that matches the input BalanceID. |
CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM | -2 | There is no claimant that matches the source account, or the claimants predicate is not satisfied. |
CLAIM_CLAIMABLE_BALANCE_LINE_FULL | -3 | The account claiming the ClaimableBalanceEntry does not have sufficient limits to receive amount of the asset and still satisfy its buying liabilities. |
CLAIM_CLAIMABLE_BALANCE_NO_TRUST | -4 | The source account does not trust the issuer of the asset it is trying to claim in the ClaimableBalanceEntry. |
CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED | -5 | The source account is not authorized to claim the asset in the ClaimableBalanceEntry. |
Begin sponsoring future reserves
Allows an account to pay the base reserves for another account; sponsoring account establishes the is-sponsoring-future-reserves relationship
There must also be an end sponsoring future reserves operation in the same transaction
Learn more about sponsored reserves: Sponsored Reserves Encyclopedia Entry
SDKs: Java
Threshold: Medium
Result: BeginSponsoringFutureReservesResult
Parameters:
Parameters | Type | Description |
---|---|---|
SponsoredID | account ID | Account that will have its reserves sponsored. |
Possible errors:
Error | Code | Description |
---|---|---|
BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED | -1 | Source account is equal to sponsoredID. |
BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED | -2 | Source account is already sponsoring sponsoredID. |
BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE | -3 | Either source account is currently being sponsored, or sponsoredID is sponsoring another account. |
End sponsoring future reserves
Terminates the current is-sponsoring-future-reserves relationship in which the source account is sponsored
Learn more about sponsored reserves: Sponsored Reserves Encyclopedia Entry
SDKs: Java
Threshold: Medium
Result: EndSponsoringFutureReservesResult
Parameters:
Parameters | Type | Description |
---|---|---|
begin_sponsor | account ID | The id of the account which initiated the sponsorship. |
Possible errors:
Error | Code | Description |
---|---|---|
END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED | -1 | Source account is not sponsored. |
Revoke sponsorship
Sponsoring account can remove or transfer sponsorships of existing ledgerEntries and signers; the logic of this operation depends on the state of the source account
Learn more about sponsored reserves: Sponsored Reserves Encyclopedia Entry
Threshold: Medium
Result: RevokeSponsorshipResult
This operation is a union with two possible types:
Union Type | Parameters | Type | Description |
---|---|---|---|
REVOKE_SPONSORSHIP_LEDGER_ENTRY | LedgerKey | ledgerKey | Ledger key that holds information to identify a specific ledgerEntry that may have its sponsorship modified. See LedgerKey for more information. |
Or
Union Type | Parameters | Type | Description |
---|---|---|---|
REVOKE_SPONSORSHIP_SIGNER | Signer | {account ID, Signer Key} | Signer that may have its sponsorship modified. |
Possible errors:
Error | Code | Description |
---|---|---|
REVOKE_SPONSORSHIP_DOES_NOT_EXIST | -1 | The ledgerEntry for LedgerKey doesn’t exist, the account ID on signer doesn’t exist, or the Signer Key doesn’t exist on account ID’s account. |
REVOKE_SPONSORSHIP_NOT_SPONSOR | -2 | If the ledgerEntry/signer is sponsored, then the source account must be the sponsor. If the ledgerEntry/signer is not sponsored, the source account must be the owner. This error will be thrown otherwise. |
REVOKE_SPONSORSHIP_LOW_RESERVE | -3 | The sponsored account does not have enough XLM to satisfy the minimum balance increase caused by revoking sponsorship on a ledgerEntry/signer it owns, or the sponsor of the source account doesn’t have enough XLM to satisfy the minimum balance increase caused by sponsoring a transferred ledgerEntry/signer. |
REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE | -4 | Sponsorship cannot be removed from this ledgerEntry. This error will happen if the user tries to remove the sponsorship from a ClaimableBalanceEntry. |
REVOKE_SPONSORSHIP_MALFORMED | -5 | One or more of the inputs to the operation was malformed. |
Clawback
Burns an amount in a specific asset from a receiving account
Learn more about clawbacks: Clawback Encyclopedia Entry
SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ClawbackResult
Parameters:
Parameters | Type | Description |
---|---|---|
From | account ID | Account address that receives the clawback. |
Asset | asset | Asset held by the destination account. |
Amount | integer | Amount of the aforementioned asset to burn. |
Possible errors:
Error | Code | Description |
---|---|---|
CLAWBACK_MALFORMED | -1 | The input to the clawback is invalid. |
CLAWBACK_NOT_CLAWBACK_ENABLED | -2 | The trustline between From and the issuer account for this Asset does not have clawback enabled. |
CLAWBACK_NO_TRUST | -3 | The From account does not trust the issuer of the asset. |
CLAWBACK_UNDERFUNDED | -4 | The From account does not have a sufficient available balance of the asset (after accounting for selling liabilities). |
Clawback claimable balance
Claws back an unclaimed ClaimableBalanceEntry, burning the pending amount of the asset
Learn more about clawbacks: Clawback Encyclopedia Entry
Learn more about claimable balances: Claimable Balances Encyclopedia Entry
SDKs: Java
Threshold: Medium
Result: ClaimClaimableBalanceResult
Parameters:
Parameters | Type | Description |
---|---|---|
BalanceID | claimableBalanceID | The BalanceID on the ClaimableBalanceEntry that the source account is claiming, which can be retrieved from a succesful CreateClaimableBalanceResult |
Possible errors:
Error | Code | Description |
---|---|---|
CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST | -1 | There is no existing ClaimableBalanceEntry that matches the input BalanceID. |
CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER | -2 | The source account is not the issuer of the asset in the claimable balance. |
CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED | -3 | The CLAIMABLE_BALANCE_CLAWBACK_ENABLED_FLAG is not set for this trustline. |
Set trustline flags
Allows issuing account to configure authorization and trustline flags to an asset
The Asset parameter is of the TrustLineAsset
type. If you are modifying a trustline to a regular asset (i.e. one in a Code:Issuer format), this is equivalent to the Asset type. If you are modifying a trustline to a pool share, however, this is composed of the liquidity pool's unique ID.
Learn more about flags: Flags Glossary Entry
SDKs: Java
Threshold: Low
Result: SetTrustLineFlagsResult
Parameters:
Parameters | Type | Description |
---|---|---|
Trustor | account ID | The account that established this trustline. |
Asset | TrustLineAsset | The asset trustline whose flags are being modified. |
SetFlags | integer | One or more flags (combined via bitwise-OR) indicating which flags to set. Possible flags are: 1 if the trustor is authorized to transact with the asset or 2 if the trustor is authorized to maintain offers but not to perform other transactions. |
ClearFlags | integer | One or more flags (combined via bitwise OR) indicating which flags to clear. Possibilities include those for SetFlags as well as 4, which prevents the issuer from clawing back its asset (both from accounts and claimable balances). |
Possible errors:
Error | Code | Description |
---|---|---|
SET_TRUST_LINE_FLAGS_MALFORMED | -1 | This can happen for a number of reasons: the asset specified by AssetCode and AssetIssuer is invalid; the asset issuer isn't the source account; the Trustor is the source account; the native asset is specified; or the flags being set/cleared conflict or are otherwise invalid. |
SET_TRUST_LINE_FLAGS_NO_TRUST_LINE | -2 | The Trustor does not have a trustline with the issuer performing this operation. |
SET_TRUST_LINE_FLAGS_CANT_REVOKE | -3 | The issuer is trying to revoke the trustline authorization of Trustor, but it cannot do so because AUTH_REVOCABLE_FLAG is not set on the account. |
SET_TRUST_LINE_FLAGS_INVALID_STATE | -4 | If the final state of the trustline has both AUTHORIZED_FLAG (1) and AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG (2) set, which are mutually exclusive. |
SET_TRUST_LINE_FLAGS_LOW_RESERVE | -5 | Claimable balances can't be created on revocation of asset (or pool share) trustlines associated with a liquidity pool due to low reserves. |
Liquidity pool deposit
Deposits assets into a liquidity pool, increasing the reserves of a liquidity pool in exchange for pool shares
Parameters to this operation depend on the ordering of assets in the liquidity pool: “A” refers to the first asset in the liquidity pool, and “B” refers to the second asset in the liquidity pool.
If the pool is empty, then this operation deposits maxAmountA of A and maxAmountB of B into the pool. If the pool is not empty, then this operation deposits at most maxAmountA of A and maxAmountB of B into the pool. The actual amounts deposited are determined using the current reserves of the pool. You can use these parameters to control a percentage of slippage.
Learn more about liquidity pools: Liquidity Pools Encyclopedia Entry
SDKs: Java
Threshold: Medium
Result: LiquidityPoolDepositResult
Parameters:
Parameters | Type | Description |
---|---|---|
Liquidity Pool ID | liquidityPoolID | The PoolID for the Liquidity Pool to deposit into. |
Max Amount A | integer | Maximum amount of first asset to deposit. |
Max Amount B | integer | Maximum amount of second asset to deposit. |
Min Price | {numerator, denominator} | Minimum depositA/depositB. |
Max Price | {numerator, denominator} | Maximum depositA/depositB. |
Possible errors:
Error | Code | Description |
---|---|---|
LIQUIDITY_POOL_DEPOSIT_MALFORMED | -1 | One or more of the inputs to the operation was malformed. |
LIQUIDITY_POOL_DEPOSIT_NO_TRUST | -2 | No trustline exists for one of the assets being deposited. |
LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED | -3 | The account does not have authorization for one of the assets. |
LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED | -4 | There is not enough balance of one of the assets to perform the deposit. |
LIQUIDITY_POOL_DEPOSIT_LINE_FULL | -5 | The pool share trustline does not have a sufficient limit. |
LIQUIDITY_POOL_DEPOSIT_BAD_PRICE | -6 | The deposit price is outside of the given bounds. |
LIQUIDITY_POOL_DEPOSIT_POOL_FULL | -7 | The liquidity pool reserves are full. |
Liquidity pool withdraw
Withdraw assets from a liquidity pool, reducing the number of pool shares in exchange for reserves of a liquidity pool
The minAmountA and minAmountB parameters can be used to control a percentage of slippage from the "spot price" on the pool.
Learn more about liquidity pools: Liquidity Pools Encyclopedia Entry
SDKs: Java
Threshold: Medium
Result: LiquidityPoolWithdrawResult
Parameters:
Parameters | Type | Description |
---|---|---|
Liquidity Pool ID | liquidityPoolID | The PoolID for the Liquidity Pool to withdraw from. |
Amount | integer | Amount of pool shares to withdraw. |
Min Amount A | integer | Minimum amount of the first asset to withdraw. |
Min Amount B | integer | Minimum amount of the second asset to withdraw. |
Possible errors:
Error | Code | Description |
---|---|---|
LIQUIDITY_POOL_WITHDRAW_MALFORMED | -1 | One or more of the inputs to the operation was malformed. |
LIQUIDITY_POOL_WITHDRAW_NO_TRUST | -2 | There is no trustline for one of the assets. |
LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED | -3 | Insufficient balance for the pool shares. |
LIQUIDITY_POOL_WITHDRAW_LINE_FULL | -4 | The withdrawal would exceed the trustline limit for one of the assets. |
LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM | -5 | Unable to withdraw enough to satisfy the minimum price. |
Invoke Host Function
Invoke and deploy Soroban smart contracts with InvokeHostFunctionOp
.
The InvokeHostFunctionOp
can be used to perform the following Soroban operations:
- Invoke contract functions:
HOST_FUNCTION_TYPE_INVOKE_CONTRACT
- Upload Wasm of the contracts:
HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM
- Deploy new contracts using the uploaded Wasm or built-in implementations:
HOST_FUNCTION_TYPE_CREATE_CONTRACT
Note that Soroban transactions can only contain one operation per transaction.
Learn more here.
SDKs: Java
Threshold: Medium
Result: InvokeHostFunctionResult
Parameters:
Parameters | Tipo | Descripción |
---|---|---|
Función del Host | FunciónDelHost | La función del host a invocar |
Autenticación | Entrada de Autorización de Soroban | Autorizaciones por dirección para esta función del host. |
Errores posibles:
Error | Código | Descripción |
---|---|---|
INVOKE_HOST_FUNCTION_MALFORMADO | -1 | Uno o más de los inputs de la operación estaban malformados. |
INVOKE_HOST_FUNCTION_TRAPPING | -2 | La invocación de la función se atrapó en la ejecución de Soroban. |
INVOKE_HOST_FUNCTION_LIMITE_RECURSOS_EXCEDIDO | -3 | La invocación de la función no pudo completarse dentro de las restricciones de recursos actualmente configuradas de la red. |
INVOKE_HOST_FUNCTION_ENTRADA_ARCHIVADA | -4 | Una entrada de ledger requerida para la huella de esta función está en estado archivado y debe ser restaurada. |
INVOKE_HOST_FUNCTION_TARIFA_REEMBOLSABLE_INSUFICIENTE | -5 | La tarifa reembolsable de Soroban proporcionada no fue suficiente para pagar por los recursos computacionales requeridos por esta invocación de función. |
Extender TTL de Huella
Extender el tiempo de vida (TTL) de las entradas para contratos inteligentes de Soroban con la ExtendFootprintTTLOp
. Esta operación extiende el TTL de las entradas especificadas en la huella readOnly
de la transacción para que vivan al menos hasta que se alcance el número de secuencia del ledger extendTo
.
Ten en cuenta que las transacciones de Soroban solo pueden contener una operación por transacción.
Aprende más en la sección de Archivo de Estado.
SDKs: Java
Umbral: Medio
Resultado: ExtendFootprintTTLResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Ext | Punto de Extensión | Reservado para uso futuro. |
Extender Hasta | entero | El número de secuencia del ledger hasta el que las entradas vivirán. |
Errores posibles:
Error | Código | Descripción |
---|---|---|
EXTEND_FOOTPRINT_TTL_MALFORMED | -1 | Uno o más de los inputs de la operación estaban malformados. |
EXTEND_FOOTPRINT_TTL_LIMITE_RECURSOS_EXCEDIDO | -2 | La extensión TTL no pudo completarse dentro de las restricciones de recursos actualmente configuradas de la red. |
EXTEND_FOOTPRINT_TTL_TARIFA_REEMBOLSABLE_INSUFICIENTE | -3 | La tarifa reembolsable de Soroban proporcionada no fue suficiente para pagar por la extensión TTL de las entradas del ledger especificadas. |
Restaurar Huella
Hacer que las entradas archivadas de contratos inteligentes de Soroban sean accesibles nuevamente restaurándolas con RestoreFootprintOp
. Esta operación restaura las entradas archivadas especificadas en la huella readWrite
.
Ten en cuenta que las transacciones de Soroban solo pueden contener una operación por transacción.
Aprende más en la sección de Archivo de Estado.
SDKs: JavaScript | Java
Umbral: Medio
Resultado: RestoreFootprintResult
Parámetros:
Parámetros | Tipo | Descripción |
---|---|---|
Ext | Punto de Extensión | Reservado para uso futuro. |
Errores posibles:
Error | Código | Descripción |
---|---|---|
RESTORE_FOOTPRINT_MALFORMED | -1 | Uno o más de los inputs de la operación estaban malformados. |
RESTORE_FOOTPRINT_LIMITE_RECURSOS_EXCEDIDO | -2 | La restauración del archivo no pudo completarse dentro de las restricciones de recursos actualmente configuradas de la red. |
RESTORE_FOOTPRINT_TARIFA_REEMBOLSABLE_INSUFICIENTE | -3 | La tarifa reembolsable de Soroban proporcionada no fue suficiente para pagar por la restauración del archivo de las entradas del ledger especificadas. |