@roochnetwork/rooch-sdk
Version:
705 lines (702 loc) • 18.8 kB
text/typescript
// Copyright (c) RoochNetwork
// SPDX-License-Identifier: Apache-2.0
/**
* ######################################
* ### DO NOT EDIT THIS FILE DIRECTLY ###
* ######################################
*
* This file is generated from:
* /crates/rooch-open-rpc-spec/openrpc.json
*/
export interface AccumulatorInfoView {
accumulator_root: string
frozen_subtree_roots: string[]
num_leaves: string
num_nodes: string
}
export interface AnnotatedFunctionResultView {
return_values?: AnnotatedFunctionReturnValueView[] | null
vm_status: VMStatusView
}
export interface AnnotatedFunctionReturnValueView {
decoded_value: unknown
value: FunctionReturnValueView
}
export interface BalanceInfoView {
balance: string
coin_type: string
decimals: number
icon_url?: string | null
name: string
supply: string
symbol: string
fixedBalance: number
}
export interface BitcoinStatus {
confirmed_block?: BlockHeightHashView | null
pending_block?: BlockHeightHashView | null
}
export interface BlockHeightHashView {
block_hash: string
block_height: string
}
export interface DAInfoView {
avail_backends: [string, string][]
last_avail_block_number?: string | null
last_avail_block_update_time?: string | null
last_avail_tx_order?: string | null
last_block_number?: string | null
last_block_update_time?: string | null
last_tx_order?: string | null
}
export interface DisplayFieldsView {
fields: {
[key: string]: string
}
}
export interface DryRunTransactionResponseView {
raw_output: RawTransactionOutputView
vm_error_info: VMErrorInfo
}
export type EventFilterView =
| 'all' /** Query by event type with sender */
| {
event_type_with_sender: {
event_type: string
sender: string
}
} /** Query by event type. */
| {
event_type: string
} /** Query by event handle id with sender */
| {
event_handle_with_sender: {
event_handle_id: string
sender: string
}
} /** Query by event handle id. */
| {
event_handle: string
} /** Query by sender address. */
| {
sender: string
} /** Return events emitted by the given transaction hash. */
| {
tx_hash: string
} /** Return events emitted in [start_time, end_time) interval */
| {
time_range: {
/** right endpoint of time interval, milliseconds since block, exclusive */
end_time: string
/** left endpoint of time interval, milliseconds since block, inclusive */
start_time: string
}
} /** Return events emitted in [from_order, to_order) interval */
| {
tx_order_range: {
/** left endpoint of transaction order, inclusive */
from_order: string
/** right endpoint of transaction order, exclusive */
to_order: string
}
}
export interface EventIDView {
/** each event handle corresponds to a unique event handle id. event handler id equal to guid. */
event_handle_id: string
/** For expansion: The number of messages that have been emitted to the path previously */
event_seq: string
}
export interface EventOptions {
/** If true, the event is decoded and the decoded value is returned in the response. */
decode?: boolean
}
export interface EventView {
decoded_event_data?: unknown
event_data: string
event_id: EventIDView
event_index: string
event_type: string
}
export interface ExecuteTransactionResponseView {
error_info?: DryRunTransactionResponseView | null
execution_info: TransactionExecutionInfoView
output?: TransactionOutputView | null
sequence_info: TransactionSequenceInfoView
}
export type FieldFilterView =
/** Query by object ids. */
{
object_id: string
}
export interface FunctionCallView {
args: string[]
function_id: string
ty_args: string[]
}
export interface FunctionReturnValueView {
type_tag: string
value: string
}
export interface IndexerEventIDView {
event_index: string
tx_order: string
}
export interface IndexerEventView {
created_at: string
decoded_event_data?: unknown
event_data: string
event_id: EventIDView
event_type: string
indexer_event_id: IndexerEventIDView
sender: string
tx_hash: string
}
export interface IndexerFieldView {
decoded_value?: unknown
field_key: string
sort_key: string
state: ObjectStateView
}
export interface IndexerObjectStateView {
created_at: string
decoded_value?: unknown
display_fields?: DisplayFieldsView | null
flag: number
id: string
object_type: string
owner: string
owner_bitcoin_address?: string | null
size: string
state_index: string
state_root?: string | null
tx_order: string
updated_at: string
/** bcs bytes of the Object. */
value: string
}
export interface IndexerStateIDView {
state_index: string
tx_order: string
}
export type InscriptionFilterView =
/** Query by owner, support rooch address and bitcoin address */
| {
owner: string
} /** Query by inscription id, represent by bitcoin {{txid}i{index}} */
| {
inscription_id: string
} /** Query by object ids. */
| {
object_id: string
}
| 'all'
export interface InscriptionStateView {
created_at: string
flag: number
id: string
object_type: string
owner: string
owner_bitcoin_address?: string | null
size: string
state_index: string
state_root?: string | null
tx_order: string
updated_at: string
value: InscriptionView
}
export interface InscriptionView {
body: string
charms: number
content_encoding?: string | null
content_type?: string | null
id: string
inscription_number: number
location: SatPointView
metadata: string
metaprotocol?: string | null
parents: string[]
pointer?: string | null
sequence_number: number
}
export type KeptVMStatusView =
| {
type: 'executed'
}
| {
type: 'outofgas'
}
| {
abort_code: string
location: string
type: 'moveabort'
}
| {
code_offset: number
function: number
location: string
type: 'executionfailure'
}
| {
type: 'miscellaneouserror'
}
export interface LedgerTransactionView {
data: LedgerTxDataView
sequence_info: TransactionSequenceInfoView
}
export type LedgerTxDataView =
| {
bitcoin_block_hash?: string | null
block_hash: string
block_height: string
chain_id: string
type: 'l1_block'
}
| {
bitcoin_block_hash?: string | null
bitcoin_txid?: string | null
block_hash: string
chain_id: string
txid: string
type: 'l1_tx'
}
| {
action: MoveActionView
action_type: MoveActionTypeView
chain_id: string
max_gas_amount: string
raw: string
sender: string
sender_bitcoin_address?: string | null
sequence_number: string
type: 'l2_tx'
}
/** A Move module ABI */
export interface ModuleABIView {
address: string
/** Friends of the module */
friends: string[]
/** Public or entry functions of the module */
functions: MoveFunctionView[]
name: string
/** Structs of the module */
structs: MoveStructView[]
}
export type MoveActionTypeView = 'scriptcall' | 'functioncall' | 'modulebundle'
export interface MoveActionView {
function_call?: FunctionCallView | null
module_bundle?: string[] | null
script_call?: ScriptCallView | null
}
/** Move function generic type param */
export interface MoveFunctionTypeParamView {
/** Move abilities tied to the generic type param and associated with the function that uses it */
constraints: string[]
}
/** Move function */
export interface MoveFunctionView {
/** Whether the function can be called as an entry function directly in a transaction */
is_entry: boolean
name: string
/** Parameters associated with the move function */
params: string[]
/** Return type of the function */
return: string[]
/** Generic type params associated with the Move function */
type_params: MoveFunctionTypeParamView[]
}
/** Move struct field */
export interface MoveStructFieldView {
name: string
type: string
}
/** Move generic type param */
export interface MoveStructTypeParamView {
/** Move abilities tied to the generic type param and associated with the type that uses it */
constraints: string[]
/** Whether the type is a phantom type */
is_phantom: boolean
}
/** A move struct */
export interface MoveStructView {
/** Abilities associated with the struct */
abilities: string[]
/** Fields associated with the struct */
fields: MoveStructFieldView[]
/** Whether the struct is a native struct of Move */
is_native: boolean
name: string
/** Generic types associated with the struct */
type_params: MoveStructTypeParamView[]
}
export interface ObjectChangeView {
fields: ObjectChangeView[]
metadata: ObjectMetaView
value?: OpView | null
}
export interface ObjectMetaView {
created_at: string
flag: number
id: string
object_type: string
owner: string
owner_bitcoin_address?: string | null
size: string
state_root?: string | null
updated_at: string
}
export type ObjectStateFilterView =
/** Query by object value type and owner. */
| {
object_type_with_owner: {
object_type: string
owner: string
}
} /** Query by object value type. */
| {
object_type: string
} /** Query by owner. */
| {
owner: string
} /** Query by object ids. */
| {
object_id: string
}
/** Object state view. Used as return type of `getObjectStates`. */
export interface ObjectStateView {
created_at: string
decoded_value?: unknown
display_fields?: DisplayFieldsView | null
flag: number
id: string
object_type: string
owner: string
owner_bitcoin_address?: string | null
size: string
state_root?: string | null
updated_at: string
value: string
}
export type OpView =
| 'delete'
| {
new: string
}
| {
modify: string
}
export interface OutPointView {
txid: string
vout: number
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedBalanceInfoViews {
data: BalanceInfoView[]
has_next_page: boolean
next_cursor?: IndexerStateIDView | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedEventViews {
data: EventView[]
has_next_page: boolean
next_cursor?: string | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedIndexerEventViews {
data: IndexerEventView[]
has_next_page: boolean
next_cursor?: IndexerEventIDView | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedIndexerFieldViews {
data: IndexerFieldView[]
has_next_page: boolean
next_cursor?: string | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedIndexerObjectStateViews {
data: IndexerObjectStateView[]
has_next_page: boolean
next_cursor?: IndexerStateIDView | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedInscriptionStateViews {
data: InscriptionStateView[]
has_next_page: boolean
next_cursor?: IndexerStateIDView | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedStateChangeSetWithTxOrderViews {
data: StateChangeSetWithTxOrderView[]
has_next_page: boolean
next_cursor?: string | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedStateKVViews {
data: StateKVView[]
has_next_page: boolean
next_cursor?: string | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedTransactionWithInfoViews {
data: TransactionWithInfoView[]
has_next_page: boolean
next_cursor?: string | null
}
/**
* `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the
* next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first
* item.
*/
export interface PaginatedUTXOStateViews {
data: UTXOStateView[]
has_next_page: boolean
next_cursor?: IndexerStateIDView | null
}
export interface QueryOptions {
/** If true, the state is decoded and the decoded value is returned in the response. */
decode?: boolean
/** If true, return query items in descending order. */
descending?: boolean
/** If true, filter out all match items. */
filterOut?: boolean
/** If true, result with display rendered is returned */
showDisplay?: boolean
}
export interface RawTransactionOutputView {
gas_used: string
is_upgrade: boolean
state_root: string
status: KeptVMStatusView
tx_hash: string
}
export type RepairIndexerParamsView =
/** Repair by owner. */
| {
owner: string
} /** Repair by object ids. */
| {
object_id: string
}
export interface RoochStatus {
da_info: DAInfoView
root_state: RootStateView
sequencer_info: SequencerInfoView
}
export interface RootStateView {
size: string
state_root: string
}
export interface SatPointView {
offset: string
output: OutPointView
}
export interface ScriptCallView {
args: string[]
code: string
ty_args: string[]
}
export interface SequencerInfoView {
last_accumulator_info: AccumulatorInfoView
last_order: string
}
export type ServiceStatus =
| 'active'
| 'maintenance'
| 'read-only-mode'
| 'date-import-mode'
| 'sync-mode'
export interface StateChangeSetView {
changes: ObjectChangeView[]
global_size: string
state_root: string
}
export interface StateChangeSetWithTxOrderView {
state_change_set: StateChangeSetView
tx_order: string
}
export interface StateKVView {
field_key: string
state: ObjectStateView
}
export interface StateOptions {
/** If true, the state is decoded and the decoded value is returned in the response. */
decode?: boolean
/** If true, result with display rendered is returned */
showDisplay?: boolean
/** The state root of remote stateDB */
stateRoot?: string | null
}
export interface Status {
/** The status of the Bitcoin chain */
bitcoin_status: BitcoinStatus
/** The status of the Rooch chain */
rooch_status: RoochStatus
/** The status of the rpc service */
service_status: ServiceStatus
}
export type SyncStateFilterView =
/** Sync by object id. */
| {
object_i_d: string
}
| 'all'
export interface TransactionExecutionInfoView {
event_root: string
gas_used: string
state_root: string
status: KeptVMStatusView
tx_hash: string
}
export type TransactionFilterView =
| 'all' /** Query by sender address. */
| {
sender: string
} /** Query by the given transaction hash. */
| {
tx_hashes: string[]
} /** Return transactions in [start_time, end_time) interval */
| {
time_range: {
/** right endpoint of time interval, milliseconds since block, exclusive */
end_time: string
/** left endpoint of time interval, milliseconds since block, inclusive */
start_time: string
}
} /** Return events emitted in [from_order, to_order) interval */
| {
tx_order_range: {
/** left endpoint of transaction order, inclusive */
from_order: string
/** right endpoint of transaction order, exclusive */
to_order: string
}
}
export interface TransactionOutputView {
changeset: StateChangeSetView
events: EventView[]
gas_used: string
is_upgrade: boolean
status: KeptVMStatusView
}
export interface TransactionSequenceInfoView {
tx_accumulator_root: string
tx_order: string
tx_order_signature: string
tx_timestamp: string
}
export interface TransactionWithInfoView {
execution_info?: TransactionExecutionInfoView | null
transaction: LedgerTransactionView
}
export interface TxOptions {
/**
* If true, the event is decoded and the decoded value is returned in the response. Only valid when
* with_output is true.
*/
decode?: boolean
/** If true, the TransactionOutput is returned in the response. */
withOutput?: boolean
}
export type UTXOFilterView =
/** Query by owner, support rooch address and bitcoin address */
| {
owner: string
} /** Query by bitcoin outpoint, represent by bitcoin txid and vout */
| {
out_point: {
txid: string
vout: number
}
} /** Query by object ids. */
| {
object_id: string
}
| 'all'
export interface UTXOStateView {
created_at: string
flag: number
id: string
object_type: string
owner: string
owner_bitcoin_address?: string | null
size: string
state_index: string
state_root?: string | null
tx_order: string
updated_at: string
value: UTXOView
}
export interface UTXOView {
/** The txid of the UTXO */
bitcoin_txid: string
/** Protocol seals */
seals: /** Protocol seals */
{
[key: string]: string[]
}
/** The txid of the UTXO */
txid: string
/** The value of the UTXO */
value: string
/** The vout of the UTXO */
vout: number
}
export interface VMErrorInfo {
error_message: string
execution_state: string[]
}
export type VMStatusView =
| 'Executed'
| {
MoveAbort: {
abort_code: string
location: string
}
}
| {
ExecutionFailure: {
code_offset: number
function: number
location: string
status_code: string
}
}
| {
Error: string
}