UNPKG

rosetta-sdk-typescript

Version:

Typescript SDK to create and interact with Rosetta API implementations.

71 lines (70 loc) 3.23 kB
/** * Rosetta * Build Once. Integrate Your Blockchain Everywhere. * * The version of the OpenAPI document: 1.4.10 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { AccountIdentifier, Amount, CoinChange, OperationIdentifier } from './'; /** * Operations contain all balance-changing information within a transaction. They are always one-sided (only affect 1 AccountIdentifier) and can succeed or fail independently from a Transaction. Operations are used both to represent on-chain data (Data API) and to construct new transactions (Construction API), creating a standard interface for reading and writing to blockchains. * @export * @interface Operation */ export interface Operation { /** * * @type {OperationIdentifier} * @memberof Operation */ operation_identifier: OperationIdentifier; /** * Restrict referenced related_operations to identifier indices < the current operation_identifier.index. This ensures there exists a clear DAG-structure of relations. Since operations are one-sided, one could imagine relating operations in a single transfer or linking operations in a call tree. * @type {Array<OperationIdentifier>} * @memberof Operation */ related_operations?: Array<OperationIdentifier>; /** * Type is the network-specific type of the operation. Ensure that any type that can be returned here is also specified in the NetworkOptionsResponse. This can be very useful to downstream consumers that parse all block data. * @type {string} * @memberof Operation */ type: string; /** * Status is the network-specific status of the operation. Status is not defined on the transaction object because blockchains with smart contracts may have transactions that partially apply (some operations are successful and some are not). Blockchains with atomic transactions (all operations succeed or all operations fail) will have the same status for each operation. On-chain operations (operations retrieved in the `/block` and `/block/transaction` endpoints) MUST have a populated status field (anything on-chain must have succeeded or failed). However, operations provided during transaction construction (often times called "intent" in the documentation) MUST NOT have a populated status field (operations yet to be included on-chain have not yet succeeded or failed). * @type {string} * @memberof Operation */ status?: string; /** * * @type {AccountIdentifier} * @memberof Operation */ account?: AccountIdentifier; /** * * @type {Amount} * @memberof Operation */ amount?: Amount; /** * * @type {CoinChange} * @memberof Operation */ coin_change?: CoinChange; /** * * @type {object} * @memberof Operation */ metadata?: object; } export declare function OperationFromJSON(json: any): Operation; export declare function OperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Operation; export declare function OperationToJSON(value?: Operation | null): any;