All files / src/endpoints/v2 types.ts

100% Statements 266/266
75% Branches 6/8
100% Functions 1/1
100% Lines 198/198

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 3201589x                           1x   1x 1x 1x 1x       1x 1x 1x 1x       1x   1x       1x 1x 1x 1x 1x 1x 1x 1x       1x 1x 1x       1x 1x 1x 1x 1x 1x 1x       1x 1x 1x 1x       1x 1x 1x 1x 1x 1x 1x 1x       1x 1x 1x 1x 1x 1x       1x 1x 1x 1x 1x       1x 1x 1x       1x 1x 1x 1x 1x       1x 1x 1x       1x 1x 1x 1x 1x 1x   1x   1x 1x 1x 1x 1x 1x 1x 1x 1x       1x 1x 1x 1x 1x 1x       1x 1x 1x 1x       1x 1x 1x       1x 1x 1x 1x 1x 1x 1x       1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x       1x 1x 1x 1x       1x 1x 1x 1x 1x 1x 1x 1x       1x 1x       1x 1x 1x 1x 1x 1x     1x 1x 1x 1x       1x 1x 1x 1x 1x 1x 1x     1x 1x 1x 1x 1x       1x 1x 1x 1x 1x 1x 1x         1x 1x 1x 1x     1x       1x 1x 1x 1x 1x 1x       1x 1x 1x 1x 1x 1x 1x 1x         1x 1x 1x 1x       1x 1x 1x 1x         1x 1x 1x 1x 1x 1x 1x 1x 1x 1x         2x 1x 1x 1x 1x 1x 1x    
import {
    ABI,
    API,
    BlockTimestamp,
    Checksum256,
    Float64,
    Int64,
    Name,
    PermissionLevel,
    Struct,
    TimePoint,
    UInt32,
    UInt64,
    UInt8,
} from '@wharfkit/antelope'
@Struct.type('get_abi_snapshot_response')
export class GetABISnapshotResponse extends Struct {
    @Struct.field(UInt32) declare block_num: UInt32
    @Struct.field(ABI) declare abi: ABI
    @Struct.field(Float64) declare query_time_ms: Float64
}
 
@Struct.type('get_voters_response_voter')
export class GetVotersResponseVoter extends Struct {
    @Struct.field(Name) declare account: Name
    @Struct.field(Float64) declare weight: Float64
    @Struct.field(UInt32) declare last_vote: UInt32
}
 
@Struct.type('get_voters_response')
export class GetVotersResponse extends Struct {
    @Struct.field(GetVotersResponseVoter, {array: true})
    declare voters: GetVotersResponseVoter[]
}
 
@Struct.type('get_links_response_link')
export class GetLinksResponseLink extends Struct {
    @Struct.field(UInt32) declare block_num: UInt32
    @Struct.field(BlockTimestamp) declare timestamp: BlockTimestamp
    @Struct.field(Name) declare account: Name
    @Struct.field('string') declare permission: string
    @Struct.field('string') declare code: string
    @Struct.field('string') declare action: string
    @Struct.field('bool', {optional: true}) declare irreversible?: boolean
}
 
@Struct.type('total_count')
export class TotalCount extends Struct {
    @Struct.field(UInt32) declare value: UInt32
    @Struct.field('string') declare relation: string
}
 
@Struct.type('get_links_response')
export class GetLinksResponse extends Struct {
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field('bool') declare cached: boolean
    @Struct.field('bool', {optional: true}) declare hot_only?: boolean
    @Struct.field(UInt32, {optional: true}) declare lib?: UInt32
    @Struct.field(TotalCount) declare total: TotalCount
    @Struct.field(GetLinksResponseLink, {array: true}) declare links: GetLinksResponseLink[]
}
 
@Struct.type('approval')
export class Approval extends Struct {
    @Struct.field(Name) declare actor: Name
    @Struct.field(Name) declare permission: Name
    @Struct.field(TimePoint) declare time: TimePoint
}
 
@Struct.type('proposal')
export class Proposal extends Struct {
    @Struct.field(Approval, {array: true}) declare provided_approvals: Approval[]
    @Struct.field(Approval, {array: true}) declare requested_approvals: Approval[]
    @Struct.field(UInt32) declare block_num: UInt32
    @Struct.field(Name) declare proposer: Name
    @Struct.field(Name) declare proposal_name: Name
    @Struct.field(UInt64) declare primary_key: UInt64
    @Struct.field('bool') declare executed: boolean
}
 
@Struct.type('get_proposals_response')
export class GetProposalsResponse extends Struct {
    @Struct.field(Float64, {optional: true}) declare query_time?: Float64
    @Struct.field('bool') declare cached: boolean
    @Struct.field(TotalCount) declare total: TotalCount
    @Struct.field(Proposal, {array: true}) declare proposals: Proposal[]
    @Struct.field(Float64) declare query_time_ms: Float64
}
 
@Struct.type('act')
export class ActionAct extends Struct {
    @Struct.field(Name) declare account: Name
    @Struct.field(Name) declare name: Name
    @Struct.field(PermissionLevel, {array: true}) declare authorization: PermissionLevel[]
    @Struct.field('any') declare data: any
}
 
@Struct.type('account_sequence')
export class AccountSequence extends Struct {
    @Struct.field(Name) declare account: Name
    @Struct.field(UInt64) declare sequence: UInt64
}
 
@Struct.type('action_receipt')
export class ActionReceipt extends Struct {
    @Struct.field(Name) declare receiver: Name
    @Struct.field(UInt64) declare global_sequence: UInt64
    @Struct.field(UInt64) declare recv_sequence: UInt64
    @Struct.field(AccountSequence, {array: true}) declare auth_sequence: AccountSequence[]
}
 
@Struct.type('action_ram_delta')
export class ActionRamDelta extends Struct {
    @Struct.field(Name) declare account: Name
    @Struct.field(Int64) declare delta: Int64
}
 
@Struct.type('action')
export class Action extends Struct {
    @Struct.field(BlockTimestamp) declare timestamp: BlockTimestamp
    @Struct.field(UInt32) declare block_num: UInt32
    @Struct.field(Checksum256, {optional: true}) declare block_id: Checksum256
    @Struct.field(Checksum256) declare trx_id: Checksum256
    @Struct.field(ActionAct) declare act: ActionAct
    @Struct.field(ActionReceipt, {array: true, optional: true})
    declare receipts: ActionReceipt[]
    @Struct.field(ActionRamDelta, {array: true, optional: true})
    declare account_ram_deltas: ActionRamDelta[]
    @Struct.field(UInt64) declare global_sequence: UInt64
    @Struct.field(Name) declare producer: Name
    @Struct.field(UInt64) declare action_ordinal: UInt64
    @Struct.field(UInt64) declare creator_action_ordinal: UInt64
    @Struct.field(UInt64, {optional: true}) declare cpu_usage_us: UInt64
    @Struct.field(UInt64, {optional: true}) declare net_usage_words: UInt64
    @Struct.field(UInt64, {optional: true}) declare parent: UInt64
    @Struct.field('string', {array: true, optional: true}) declare signatures: string[]
}
 
@Struct.type('get_actions_response')
export class GetActionsResponse extends Struct {
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field('bool') declare cached: boolean
    @Struct.field(UInt32, {optional: true}) declare lib?: UInt32
    @Struct.field(TotalCount) declare total: TotalCount
    @Struct.field(Action, {array: true}) declare actions: Action[]
}
 
@Struct.type('account_info')
export class AccountInfo extends Struct {
    @Struct.field(Name) declare name: Name
    @Struct.field(Checksum256) declare trx_id: Checksum256
    @Struct.field(TimePoint) declare timestamp: TimePoint
}
 
@Struct.type('get_created_accounts_response')
export class GetCreatedAccountsResponse extends Struct {
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field(AccountInfo, {array: true}) declare accounts: AccountInfo[]
}
 
@Struct.type('get_creator_response')
export class GetCreatorResponse extends Struct {
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field(Name) declare account: Name
    @Struct.field(Name) declare creator: Name // In the case of eosio account this can be string "__self__"
    @Struct.field(BlockTimestamp) declare timestamp: BlockTimestamp
    @Struct.field(UInt32) declare block_num: UInt32
    @Struct.field(Checksum256) declare trx_id: Checksum256 // In the case of eosio account this can be empty
}
 
@Struct.type('delta')
export class Delta extends Struct {
    @Struct.field(BlockTimestamp) declare timestamp: BlockTimestamp
    @Struct.field(UInt8) declare present: UInt8
    @Struct.field(Name) declare code: Name
    @Struct.field(Name) declare scope: Name
    @Struct.field(Name) declare table: Name
    @Struct.field(Name) declare primary_key: Name
    @Struct.field(Name) declare payer: Name
    @Struct.field(UInt64) declare block_num: UInt64
    @Struct.field(Checksum256) declare block_id: Checksum256
    @Struct.field('any') declare data: any
}
 
@Struct.type('get_deltas_response')
export class GetDeltasResponse extends Struct {
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field(TotalCount) declare total: TotalCount
    @Struct.field(Delta, {array: true}) declare deltas: Delta[]
}
 
@Struct.type('get_table_state_response')
export class GetTableStateResponse extends Struct {
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field(Name) declare code: Name
    @Struct.field(Name) declare table: Name
    @Struct.field(UInt64) declare block_num: UInt64
    @Struct.field('string') declare after_key: string
    @Struct.field('string') declare next_key: string
    @Struct.field('any', {array: true}) declare results: any[]
}
 
@Struct.type('get_key_accounts_response')
export class GetKeyAccountsResponse extends Struct {
    @Struct.field(Name, {array: true}) declare account_names: Name[]
}
 
@Struct.type('token_info')
export class TokenInfo extends Struct {
    @Struct.field('string') declare symbol: string
    @Struct.field(Float64) declare amount: Float64
    @Struct.field('string') declare contract: 'string'
    @Struct.field(UInt32, {optional: true}) declare precision?: UInt32
    @Struct.field('string', {optional: true}) declare error?: string
}
@Struct.type('get_tokens_response')
export class GetTokensResponse extends Struct {
    @Struct.field(Name) declare account: Name
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field(TokenInfo, {array: true}) declare tokens: TokenInfo[]
}
 
@Struct.type('get_transaction_response')
export class GetTransactionResponse extends Struct {
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field('bool') declare executed: boolean
    @Struct.field(Checksum256) declare trx_id: Checksum256
    @Struct.field(UInt32) declare lib: UInt32
    @Struct.field('bool') declare cached_lib: boolean
    @Struct.field(Action, {array: true}) declare actions: Action[]
}
@Struct.type('get_account_response_link')
export class GetAccountResponseLink extends Struct {
    @Struct.field(BlockTimestamp) declare timestamp: BlockTimestamp
    @Struct.field(Name) declare permission: Name
    @Struct.field(Name) declare code: Name
    @Struct.field(Name) declare action: Name
}
 
@Struct.type('get_account_response')
export class GetAccountResponse extends Struct {
    @Struct.field(Float64) declare query_time_ms: Float64
    @Struct.field(API.v1.AccountObject) declare account: API.v1.AccountObject
    @Struct.field(GetAccountResponseLink, {array: true}) declare links: GetAccountResponseLink[]
    @Struct.field(TokenInfo, {array: true}) declare tokens: TokenInfo[]
    @Struct.field(UInt64) declare total_actions: UInt64
    @Struct.field(Action, {array: true}) declare actions: Action[]
}
 
// For the `health` field
@Struct.type('health_entry')
export class HealthEntry extends Struct {
    @Struct.field('string') declare service: string
    @Struct.field('string') declare status: string
    @Struct.field('any', {optional: true}) declare service_data?:
        | NodeosRPCServiceData
        | ElasticsearchServiceData
    @Struct.field(UInt64) declare time: UInt64
}
 
@Struct.type('nodeos_rpc_service_data')
export class NodeosRPCServiceData extends Struct {
    @Struct.field(UInt64) declare head_block_num: UInt64
    @Struct.field('string') declare head_block_time: string
    @Struct.field(UInt64) declare time_offset: UInt64
    @Struct.field(UInt64) declare last_irreversible_block: UInt64
    @Struct.field('string') declare chain_id: string
}
 
@Struct.type('elasticsearch_service_data')
export class ElasticsearchServiceData extends Struct {
    @Struct.field('string') declare active_shards: string
    @Struct.field(UInt64) declare head_offset: UInt64
    @Struct.field(UInt64) declare first_indexed_block: UInt64
    @Struct.field(UInt64) declare last_indexed_block: UInt64
    @Struct.field(UInt64) declare total_indexed_blocks: UInt64
    @Struct.field(UInt64) declare missing_blocks: UInt64
    @Struct.field('string') declare missing_pct: string
}
 
// For the `features` field
@Struct.type('streaming_features')
export class StreamingFeatures extends Struct {
    @Struct.field('bool') declare enable: boolean
    @Struct.field('bool') declare traces: boolean
    @Struct.field('bool') declare deltas: boolean
}
 
@Struct.type('tables_features')
export class TablesFeatures extends Struct {
    @Struct.field('bool') declare proposals: boolean
    @Struct.field('bool') declare accounts: boolean
    @Struct.field('bool') declare voters: boolean
}
 
// For the `features` in the main type
@Struct.type('features')
export class Features extends Struct {
    @Struct.field(StreamingFeatures) declare streaming: StreamingFeatures
    @Struct.field(TablesFeatures) declare tables: TablesFeatures
    @Struct.field('bool') declare index_deltas: boolean
    @Struct.field('bool') declare index_transfer_memo: boolean
    @Struct.field('bool') declare index_all_deltas: boolean
    @Struct.field('bool') declare deferred_trx: boolean
    @Struct.field('bool') declare failed_trx: boolean
    @Struct.field('bool') declare resource_limits: boolean
    @Struct.field('bool') declare resource_usage: boolean
}
 
// The main type
@Struct.type('get_health_response')
export class GetHealthResponse extends Struct {
    @Struct.field('string') declare version: string
    @Struct.field('string') declare version_hash: string
    @Struct.field('string') declare host: string
    @Struct.field(HealthEntry, {array: true}) declare health: HealthEntry[]
    @Struct.field(Features) declare features: Features
    @Struct.field(Float64) declare query_time_ms: Float64
}