All files / src/endpoints types.ts

100% Statements 601/601
95% Branches 19/20
100% Functions 7/7
100% Lines 491/491

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 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 7763850x                   1x   1x   2x 1x 1x 1x 1x 1x 1x     2x 1x 1x 1x 1x     2x 1x 1x 1x 1x 1x     2x 1x 1x 1x 1x 1x     2x 1x 1x 1x 1x 1x     2x 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 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 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    
import {
    Float64,
    Int32,
    Int64,
    Name,
    PublicKey,
    Struct,
    UInt32,
    UInt64,
    UInt8,
} from '@wharfkit/antelope'
 
import * as AtomicAssetsContract from '../contracts/atomicassets'
 
export enum OfferState {
    PENDING = 0,
    INVALID = 1,
    UNKNOWN = 2,
    ACCEPTED = 3,
    DECLINED = 4,
    CANCELLED = 5,
}
 
export enum LinkState {
    WAITING = 0,
    CREATED = 1,
    CANCELED = 2,
    CLAIMED = 3,
}
 
export enum AuctionState {
    WAITING = 0,
    LISTED = 1,
    CANCELED = 2,
    SOLD = 3,
    INVALID = 4,
}
 
export enum SaleState {
    WAITING = 0,
    LISTED = 1,
    CANCELED = 2,
    SOLD = 3,
    INVALID = 4,
}
 
export enum BuyofferState {
    PENDING = 0,
    DECLINED = 1,
    CANCELED = 2,
    ACCEPTED = 3,
    INVALID = 4,
}
 
export enum TemplateBuyofferState {
    LISTED = 0,
    CANCELED = 1,
    SOLD = 2,
    INVALID = 3,
}
 
@Struct.type('token')
export class Token extends Struct {
    @Struct.field(Name) declare token_contract: Name
    @Struct.field('string') declare token_symbol: string
    @Struct.field(UInt8) declare token_precision: UInt8
}
 
@Struct.type('token_amount')
export class TokenAmount extends Token {
    @Struct.field(UInt64) declare amount: UInt64
}
 
@Struct.type('trading_pair')
export class TradingPair extends Struct {
    @Struct.field('string') declare listing_symbol: string
    @Struct.field('string') declare settlement_symbol: string
    @Struct.field('string') declare delphi_pair_name: string
    @Struct.field('bool') declare invert_delphi_pair: boolean
}
 
@Struct.type('atomicassets_config')
export class AtomicAssetsConfig extends Struct {
    @Struct.field(Name) declare contract: Name
    @Struct.field('string') declare version: string
    @Struct.field(AtomicAssetsContract.Types.FORMAT, {array: true})
    declare collection_format: AtomicAssetsContract.Types.FORMAT[]
    @Struct.field(Token, {array: true}) declare supported_tokens: Token[]
}
 
@Struct.type('atomicmarket_config')
export class AtomicMarketConfig extends Struct {
    @Struct.field(Name) declare atomicassets_contract: Name
    @Struct.field(Name) declare atomicmarket_contract: Name
    @Struct.field(Name) declare delphioracle_contract: Name
    @Struct.field('string') declare version: string
    @Struct.field(Float64) declare maker_market_fee: Float64
    @Struct.field(Float64) declare taker_market_fee: Float64
    @Struct.field(UInt64) declare minimum_auction_duration: UInt64
    @Struct.field(UInt64) declare maximum_auction_duration: UInt64
    @Struct.field(Float64) declare minimum_bid_increase: Float64
    @Struct.field(UInt64) declare auction_reset_duration: UInt64
    @Struct.field(Token, {array: true}) declare supported_tokens: Token[]
    @Struct.field(TradingPair, {array: true}) declare supported_pairs: TradingPair[]
}
 
@Struct.type('atomictools_config')
export class AtomicToolsConfig extends Struct {
    @Struct.field(Name) declare atomicassets_contract: Name
    @Struct.field(Name) declare atomictools_contract: Name
    @Struct.field('string') declare version: string
}
 
@Struct.type('collection_object')
export class CollectionObject extends Struct {
    @Struct.field(Name, {optional: true}) declare contract: Name
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(Name) declare author: Name
    @Struct.field('bool') declare allow_notify: boolean
    @Struct.field(Name, {array: true}) declare authorized_accounts: Name[]
    @Struct.field(Name, {array: true}) declare notify_accounts: Name[]
    @Struct.field(Float64) declare market_fee: Float64
    @Struct.field('string', {optional: true}) declare name: string
    @Struct.field('string', {optional: true}) declare img: string
    @Struct.field('any', {optional: true}) declare data: Record<string, any>
    @Struct.field('string', {optional: true}) declare images: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
    /** Pending author succession, set by `createauswap`. AtomicAssets v2 only. */
    @Struct.field(Name, {optional: true}) declare new_author_name: Name
    /** Date the pending author succession may be accepted. AtomicAssets v2 only. */
    @Struct.field('string', {optional: true}) declare new_author_date: string
}
 
/**
 * A schema format field as returned by the API.
 *
 * This is intentionally not the contract's `FORMAT` struct: `createschema` takes
 * only `{name, type}`, while the API additionally reports a `mediatype` and an
 * `info` descriptor per field. Widening the contract struct would let those
 * fields leak into serialized action data.
 */
@Struct.type('schema_format_field')
export class SchemaFormatField extends Struct {
    @Struct.field('string') declare name: string
    @Struct.field('string') declare type: string
    /**
     * Media type for the field. The API merges the descriptors authored through
     * `setschematyp` with a name and type heuristic, so a value here can be
     * derived rather than stored. `SchemaObject.types` reports the authored
     * ones. AtomicAssets v2 only.
     */
    @Struct.field('string', {optional: true}) declare mediatype: string
    /**
     * Free-form descriptor for the field, merged with the same heuristic as
     * `mediatype`. `SchemaObject.types` reports the authored ones.
     * AtomicAssets v2 only.
     */
    @Struct.field('string', {optional: true}) declare info: string
}
 
/**
 * A media-type descriptor authored through `setschematyp`, exactly as stored on
 * chain. It carries no serialization `type`, which is what separates it from
 * `SchemaFormatField`.
 */
@Struct.type('schema_format_type')
export class SchemaFormatType extends Struct {
    @Struct.field('string') declare name: string
    @Struct.field('string', {optional: true}) declare mediatype: string
    @Struct.field('string', {optional: true}) declare info: string
}
 
@Struct.type('schema_object')
export class SchemaObject extends Struct {
    @Struct.field(Name) declare schema_name: Name
    @Struct.field(UInt64, {optional: true}) declare assets: UInt64
    @Struct.field(SchemaFormatField, {array: true})
    declare format: SchemaFormatField[]
    /**
     * The descriptors authored through `setschematyp`, unmerged. Returned by
     * `/schemas` and `/schemas/{collection_name}/{schema_name}` alone, so a
     * schema nested in an asset, template, or account response omits it. An
     * empty array means the schema has none, and an absent one means the
     * response does not report them. AtomicAssets v2 only.
     */
    @Struct.field(SchemaFormatType, {array: true, optional: true})
    declare types: SchemaFormatType[]
    @Struct.field(Name, {optional: true}) declare contract: Name
    @Struct.field(Name, {optional: true}) declare collection_name: Name
    @Struct.field(CollectionObject, {optional: true}) declare collection: CollectionObject
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
@Struct.type('template_object')
export class TemplateObject extends Struct {
    @Struct.field(Int32) declare template_id: Int32
    @Struct.field('bool') declare is_transferable: boolean
    @Struct.field('bool') declare is_burnable: boolean
    @Struct.field(UInt32) declare issued_supply: UInt32
    @Struct.field(UInt32) declare max_supply: UInt32
    @Struct.field('any') declare immutable_data: Record<string, any>
    @Struct.field(Name, {optional: true}) declare contract: Name
    @Struct.field(CollectionObject, {optional: true}) declare collection: CollectionObject
    @Struct.field(SchemaObject, {optional: true}) declare schema: SchemaObject
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
    @Struct.field('string', {optional: true}) declare name: string
    /** Mutable template data, set by `settempldata`. AtomicAssets v2 only. */
    @Struct.field('any', {optional: true}) declare mutable_data: Record<string, any>
    /** Immutable and mutable data merged. AtomicAssets v2 only. */
    @Struct.field('any', {optional: true}) declare data: Record<string, any>
    /** Set once the template is removed by `deltemplate`. AtomicAssets v2 only. */
    @Struct.field(UInt64, {optional: true}) declare deleted_at_block: UInt64
    /** Set once the template is removed by `deltemplate`. AtomicAssets v2 only. */
    @Struct.field('string', {optional: true}) declare deleted_at_time: string
}
 
@Struct.type('assetpricev1')
export class AssetPriceV1 extends Struct {
    @Struct.field('string') declare token_symbol: string
    @Struct.field(UInt8) declare token_precision: UInt8
    @Struct.field(Name) declare token_contract: Name
    @Struct.field(UInt64) declare median: UInt64
    @Struct.field(UInt64) declare average: UInt64
    @Struct.field(UInt64) declare suggested_median: UInt64
    @Struct.field(UInt64) declare suggested_average: UInt64
    @Struct.field(UInt64) declare max: UInt64
    @Struct.field(UInt64) declare min: UInt64
}
 
@Struct.type('assetpricev2')
export class AssetPriceV2 extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(Token) declare token: Token
    @Struct.field(UInt64) declare median: UInt64
    @Struct.field(UInt64) declare average: UInt64
    @Struct.field(UInt64) declare suggested_median: UInt64
    @Struct.field(UInt64) declare suggested_average: UInt64
    @Struct.field(UInt64) declare max: UInt64
    @Struct.field(UInt64) declare min: UInt64
    @Struct.field(UInt64) declare sales: UInt64
}
 
@Struct.type('asset_object')
export class AssetObject extends Struct {
    @Struct.field(UInt64) declare asset_id: UInt64
    @Struct.field(CollectionObject) declare collection: CollectionObject
    @Struct.field(SchemaObject) declare schema: SchemaObject
    @Struct.field(TemplateObject, {optional: true}) declare template: TemplateObject
    @Struct.field(TokenAmount, {array: true}) declare backed_tokens: TokenAmount[]
    @Struct.field('any') declare immutable_data: Record<string, any>
    @Struct.field('any') declare mutable_data: Record<string, any>
    @Struct.field('any') declare data: Record<string, any>
    @Struct.field(Name, {optional: true}) declare owner: Name
    @Struct.field('bool') declare is_transferable: boolean
    @Struct.field('bool') declare is_burnable: boolean
    @Struct.field('string', {optional: true}) declare name: string
    @Struct.field(Name, {optional: true}) declare contract: Name
    @Struct.field(Name, {optional: true}) declare burned_by_account: Name
    @Struct.field(UInt64, {optional: true}) declare burned_at_block: UInt64
    @Struct.field('string', {optional: true}) declare burned_at_time: string
    @Struct.field(UInt32, {optional: true}) declare template_mint: UInt32
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    @Struct.field(UInt64) declare transferred_at_block: UInt64
    @Struct.field('string') declare transferred_at_time: string
    @Struct.field(UInt64) declare minted_at_block: UInt64
    @Struct.field('string') declare minted_at_time: string
}
 
@Struct.type('offer_object')
export class OfferObject extends Struct {
    @Struct.field(Name) declare contract: Name
    @Struct.field(UInt64) declare offer_id: UInt64
    @Struct.field(Name) declare sender_name: Name
    @Struct.field(Name) declare recipient_name: Name
    @Struct.field('string') declare memo: string
    @Struct.field(UInt8) declare state: UInt8
    @Struct.field('bool') declare is_sender_contract: boolean
    @Struct.field('bool') declare is_recipient_contract: boolean
    @Struct.field(AssetObject, {array: true}) declare sender_assets: AssetObject[]
    @Struct.field(AssetObject, {array: true}) declare recipient_assets: AssetObject[]
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
@Struct.type('transfer_object')
export class TransferObject extends Struct {
    @Struct.field(Name) declare contract: Name
    @Struct.field(UInt64) declare transfer_id: UInt64
    @Struct.field(Name) declare sender_name: Name
    @Struct.field(Name) declare recipient_name: Name
    @Struct.field('string') declare memo: string
    @Struct.field('string') declare txid: string
    @Struct.field(AssetObject, {array: true}) declare assets: AssetObject[]
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
@Struct.type('link_object')
export class LinkObject extends Struct {
    @Struct.field(Name) declare tools_contract: Name
    @Struct.field(Name) declare assets_contract: Name
    @Struct.field(UInt64) declare link_id: UInt64
    @Struct.field(Name) declare creator: Name
    @Struct.field(Name) declare claimer: Name
    @Struct.field(UInt8) declare state: UInt8
    @Struct.field(PublicKey) declare public_key: PublicKey
    @Struct.field('string') declare memo: string
    @Struct.field(AssetObject, {array: true}) declare assets: AssetObject[]
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
}
 
@Struct.type('sale_brief')
export class SaleBrief extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(UInt64) declare sale_id: UInt64
}
 
@Struct.type('aucttion_brief')
export class AuctionBrief extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(UInt64) declare auction_id: UInt64
}
 
@Struct.type('template_buyoffer')
export class TemplateBuyofferBrief extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(UInt64) declare buyoffer_id: UInt64
    @Struct.field('string') declare token_symbol: string
}
 
@Struct.type('market_asset_object')
export class MarketAssetObject extends AssetObject {
    @Struct.field(SaleBrief, {array: true}) declare sales: SaleBrief[]
    @Struct.field(AuctionBrief, {array: true}) declare auctions: AuctionBrief[]
    @Struct.field(AssetPriceV2, {array: true, optional: true}) declare prices: AssetPriceV2[]
    @Struct.field(TemplateBuyofferBrief, {array: true, optional: true})
    declare template_buyoffers: TemplateBuyofferBrief[]
}
 
@Struct.type('sale_object')
export class SaleObject extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(Name) declare assets_contract: Name
    @Struct.field(UInt64) declare sale_id: UInt64
    @Struct.field(Name) declare seller: Name
    @Struct.field(Name, {optional: true}) declare buyer: Name
    @Struct.field(UInt64) declare offer_id: UInt64
    @Struct.field(TokenAmount) declare price: TokenAmount
    @Struct.field(UInt64) declare listing_price: UInt64
    @Struct.field('string') declare listing_symbol: string
    @Struct.field(MarketAssetObject, {array: true}) declare assets: MarketAssetObject[]
    // Null whenever the listing was created without a referring marketplace.
    @Struct.field('string', {optional: true}) declare maker_marketplace: Name
    @Struct.field('string', {optional: true}) declare taker_marketplace: Name
    @Struct.field(UInt8) declare state: UInt8
    @Struct.field('bool') declare is_seller_contract: boolean
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(CollectionObject) declare collection: CollectionObject
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
    /**
     * The collection's `market_fee` as of the last indexed block. The nested
     * `collection.market_fee` is the listing-time snapshot, and the two differ
     * while the listing is open. AtomicMarket v2 only, undefined on a v1 indexer.
     */
    @Struct.field(Float64, {optional: true}) declare current_collection_fee: Float64
}
 
@Struct.type('bid')
export class Bid extends Struct {
    @Struct.field(Int64) declare number: Int64
    @Struct.field(Name) declare account: Name
    @Struct.field(UInt64) declare amount: UInt64
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
    @Struct.field('string') declare txid: string
}
 
@Struct.type('auction_object')
export class AuctionObject extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(Name) declare assets_contract: Name
    @Struct.field(UInt64) declare auction_id: UInt64
    @Struct.field(Name) declare seller: Name
    @Struct.field(MarketAssetObject, {array: true}) declare assets: MarketAssetObject[]
    @Struct.field('string') declare end_time: string
    @Struct.field(TokenAmount) declare price: TokenAmount
    @Struct.field(Bid, {array: true}) declare bids: Bid[]
    @Struct.field(UInt8) declare state: UInt8
    @Struct.field(Name, {optional: true}) declare buyer: Name
    @Struct.field('bool') declare claimed_by_seller: boolean
    @Struct.field('bool') declare claimed_by_buyer: boolean
    // Null whenever the listing was created without a referring marketplace.
    @Struct.field('string', {optional: true}) declare maker_marketplace: Name
    @Struct.field('string', {optional: true}) declare taker_marketplace: Name
    @Struct.field(CollectionObject) declare collection: CollectionObject
    @Struct.field('bool') declare is_seller_contract: boolean
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    /**
     * The collection's live market_fee; see SaleObject.current_collection_fee.
     * AtomicMarket v2 only.
     */
    @Struct.field(Float64, {optional: true}) declare current_collection_fee: Float64
}
 
@Struct.type('buyoffer_object')
export class BuyofferObject extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(Name) declare assets_contract: Name
    @Struct.field(UInt64) declare buyoffer_id: UInt64
    @Struct.field(Name) declare seller: Name
    @Struct.field(Name) declare buyer: Name
    @Struct.field(TokenAmount) declare price: TokenAmount
    @Struct.field(AssetObject, {array: true}) declare assets: AssetObject[]
    // Null whenever the listing was created without a referring marketplace.
    @Struct.field('string', {optional: true}) declare maker_marketplace: Name
    @Struct.field('string', {optional: true}) declare taker_marketplace: Name
    @Struct.field(CollectionObject) declare collection: CollectionObject
    @Struct.field('string') declare memo: string
    @Struct.field('string', {optional: true}) declare decline_memo: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    @Struct.field(UInt8) declare state: UInt8
    /**
     * The collection's live market_fee; see SaleObject.current_collection_fee.
     * AtomicMarket v2 only.
     */
    @Struct.field(Float64, {optional: true}) declare current_collection_fee: Float64
}
 
@Struct.type('template_buyoffer_object')
export class TemplateBuyofferObject extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(Name) declare assets_contract: Name
    @Struct.field(UInt64) declare buyoffer_id: UInt64
    @Struct.field(Name, {optional: true}) declare seller: Name
    @Struct.field(Name) declare buyer: Name
    @Struct.field(TokenAmount) declare price: TokenAmount
    @Struct.field(AssetObject, {array: true}) declare assets: AssetObject[]
    // Null whenever the listing was created without a referring marketplace.
    @Struct.field('string', {optional: true}) declare maker_marketplace: Name
    @Struct.field('string', {optional: true}) declare taker_marketplace: Name
    @Struct.field(CollectionObject) declare collection: CollectionObject
    @Struct.field(TemplateObject) declare template: TemplateObject
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    @Struct.field(UInt8) declare state: UInt8
    /**
     * The collection's live market_fee; see SaleObject.current_collection_fee.
     * AtomicMarket v2 only.
     */
    @Struct.field(Float64, {optional: true}) declare current_collection_fee: Float64
}
 
@Struct.type('marketplace')
export class Marketplace extends Struct {
    @Struct.field('string') declare marketplace_name: Name
    @Struct.field(Name) declare creator: Name
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
/**
 * A royalty recipient and its weight as returned by the API.
 *
 * This is intentionally not the AtomicMarket contract's `ROYALTYPAIR` struct.
 * That one serializes action data for `setroyalconf` and the rule actions, this
 * one only decodes an API row, and keeping them apart is what stops a decoded
 * row from reaching the wire.
 */
@Struct.type('royalty_pair')
export class RoyaltyPair extends Struct {
    @Struct.field(Name) declare recipient: Name
    @Struct.field(UInt32) declare weight: UInt32
}
 
/**
 * The `royaltyconf` row for a collection, mirrored field for field.
 *
 * The API answers HTTP 416 for a collection that has no row, and every
 * collection on an AtomicMarket v1 chain answers that way. AtomicMarket v2 only.
 */
@Struct.type('royalty_config')
export class RoyaltyConfig extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(RoyaltyPair, {array: true}) declare founders: RoyaltyPair[]
    /** How attribute rules combine: 0 merged, 1 granular. */
    @Struct.field(UInt8) declare attribute_mode: UInt8
    @Struct.field(UInt32) declare split_founders: UInt32
    @Struct.field(UInt32) declare split_templates: UInt32
    @Struct.field(UInt32) declare split_attributes: UInt32
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
/** A `royaltytemp` row: the per-template recipient override. AtomicMarket v2 only. */
@Struct.type('royalty_template_rule')
export class RoyaltyTemplateRule extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(Int32) declare template_id: Int32
    @Struct.field(RoyaltyPair, {array: true}) declare recipients: RoyaltyPair[]
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
/** A `royaltyattr` row: the attribute-matched recipient override. AtomicMarket v2 only. */
@Struct.type('royalty_attribute_rule')
export class RoyaltyAttributeRule extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(UInt64) declare rule_id: UInt64
    /** Which data source the matched attribute is read from, as the contract stores it. */
    @Struct.field(UInt8) declare source: UInt8
    @Struct.field('string') declare field: string
    /**
     * The raw `["type", value]` variant tuple the rule matches on. It is kept
     * untyped so an integer payload stays the string the API sent and nothing
     * is reparsed. The content is chain-authored by the collection and relayed
     * by the indexer, so a caller shape-checks it before use.
     */
    @Struct.field('any') declare value: [string, unknown]
    @Struct.field(UInt32) declare weight: UInt32
    @Struct.field(RoyaltyPair, {array: true}) declare recipients: RoyaltyPair[]
    /** Hex-encoded sha256 of the matched attribute, as the contract stores it. */
    @Struct.field('string') declare lookup_hash: string
    @Struct.field(UInt64) declare updated_at_block: UInt64
    @Struct.field('string') declare updated_at_time: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
/**
 * One settled royalty payout, keyed by the log trace global sequence and the
 * entry's position in the payouts vector. AtomicMarket v2 only.
 */
@Struct.type('royalty_payout')
export class RoyaltyPayout extends Struct {
    @Struct.field(Name) declare market_contract: Name
    @Struct.field(UInt64) declare log_global_sequence: UInt64
    @Struct.field(UInt32) declare payout_index: UInt32
    /** One of unresolved, sale, auction, buyoffer, template_buyoffer. */
    @Struct.field('string', {optional: true}) declare listing_type: string
    @Struct.field(UInt64, {optional: true}) declare listing_id: UInt64
    /** One of founders, template, attribute, dust. */
    @Struct.field('string', {optional: true}) declare category: string
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(UInt64, {optional: true}) declare asset_id: UInt64
    @Struct.field(Int32, {optional: true}) declare template_id: Int32
    @Struct.field(UInt64, {optional: true}) declare rule_id: UInt64
    @Struct.field(Name) declare recipient: Name
    @Struct.field(UInt64) declare amount: UInt64
    @Struct.field('string') declare token_symbol: string
    @Struct.field(UInt8) declare token_precision: UInt8
    @Struct.field(Name) declare token_contract: Name
    /** Hex-encoded id of the transaction the payout was logged in. */
    @Struct.field('string') declare txid: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
/** An account's settled royalties for one token symbol. AtomicMarket v2 only. */
@Struct.type('royalty_account_total')
export class RoyaltyAccountTotal extends TokenAmount {
    @Struct.field(UInt64) declare payout_count: UInt64
}
 
@Struct.type('saleprice')
export class SalePrice extends Struct {
    @Struct.field(UInt64, {optional: true}) declare sale_id: UInt64
    @Struct.field(UInt64, {optional: true}) declare auction_id: UInt64
    @Struct.field(UInt64, {optional: true}) declare buyoffer_id: UInt64
    @Struct.field(UInt64) declare price: UInt64
    @Struct.field(UInt32) declare template_mint: UInt32
    @Struct.field('string') declare token_symbol: string
    @Struct.field(UInt8) declare token_precision: UInt8
    @Struct.field(Name) declare token_contract: Name
    @Struct.field('string') declare block_time: string
}
 
@Struct.type('salepriceday')
export class SalePriceDay extends Struct {
    @Struct.field(UInt64) declare median: UInt64
    @Struct.field(UInt64) declare average: UInt64
    @Struct.field(UInt64) declare volume: UInt64
    @Struct.field(UInt64) declare sales: UInt64
    @Struct.field(UInt32, {optional: true}) declare template_mint: UInt32
    @Struct.field('string') declare token_symbol: string
    @Struct.field(UInt8) declare token_precision: UInt8
    @Struct.field(Name) declare token_contract: Name
    @Struct.field('string') declare time: string
}
 
@Struct.type('templateprice')
export class TemplatePrice extends Struct {
    @Struct.field('string') declare token_symbol: string
    @Struct.field(UInt8) declare token_precision: UInt8
    @Struct.field(Name) declare token_contract: Name
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(Int32) declare template_id: Int32
    @Struct.field(UInt64) declare median: UInt64
    @Struct.field(UInt64) declare average: UInt64
    @Struct.field(UInt64) declare suggested_median: UInt64
    @Struct.field(UInt64) declare suggested_average: UInt64
    @Struct.field(UInt64) declare max: UInt64
    @Struct.field(UInt64) declare min: UInt64
    @Struct.field(UInt64) declare sales: UInt64
}
 
@Struct.type('collectionprice')
export class CollectionPrice extends Struct {
    @Struct.field('string') declare token_symbol: string
    @Struct.field(UInt8) declare token_precision: UInt8
    @Struct.field(Name) declare token_contract: Name
    @Struct.field(UInt64) declare median: UInt64
    @Struct.field(UInt64) declare average: UInt64
    @Struct.field(UInt64) declare suggested_median: UInt64
    @Struct.field(UInt64) declare suggested_average: UInt64
    @Struct.field(UInt64) declare max: UInt64
    @Struct.field(UInt64) declare min: UInt64
}
 
@Struct.type('collection_wrapper')
export class CollectionWrapper extends Struct {
    @Struct.field(CollectionObject) declare collection: CollectionObject
    @Struct.field(UInt64, {optional: true}) declare assets: UInt64
    @Struct.field(CollectionPrice, {array: true, optional: true}) declare prices: CollectionPrice[]
}
 
@Struct.type('schema_wrapper')
export class SchemaWrapper extends Struct {
    @Struct.field(SchemaObject) declare schema: SchemaObject
    @Struct.field(UInt64) declare assets: UInt64
}
 
@Struct.type('template_wrapper')
export class TemplateWrapper extends Struct {
    @Struct.field(TemplateObject) declare template: TemplateObject
    @Struct.field(Int32) declare template_id: Int32
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(UInt64) declare assets: UInt64
}
 
@Struct.type('inventoryprice')
export class InventoryPrice extends Struct {
    @Struct.field(CollectionWrapper, {array: true}) declare collections: CollectionWrapper[]
}
 
@Struct.type('action_log')
export class ActionLog extends Struct {
    @Struct.field(UInt64) declare log_id: UInt64
    @Struct.field(Name) declare name: Name
    @Struct.field('any') declare data: Record<string, any>
    @Struct.field('string') declare txid: string
    @Struct.field(UInt64) declare created_at_block: UInt64
    @Struct.field('string') declare created_at_time: string
}
 
@Struct.type('account_info')
export class AccountInfo extends Struct {
    @Struct.field(CollectionWrapper, {array: true}) declare collections: CollectionWrapper[]
    @Struct.field(SchemaWrapper, {array: true}) declare schemas: SchemaWrapper[]
    @Struct.field(TemplateWrapper, {array: true}) declare templates: TemplateWrapper[]
    @Struct.field(UInt64) declare assets: UInt64
}
 
@Struct.type('burned_by_template')
export class BurnedByTemplate extends Struct {
    @Struct.field(UInt64) declare burned: UInt64
    @Struct.field(Int32) declare template_id: Int32
}
 
@Struct.type('burned_by_schema')
export class BurnedBySchema extends Struct {
    @Struct.field(UInt64) declare burned: UInt64
    @Struct.field(Name) declare schema_name: Name
}
 
@Struct.type('collection_stats')
export class CollectionStats extends Struct {
    @Struct.field(UInt64, {optional: true}) declare assets: UInt64
    @Struct.field(UInt64, {optional: true}) declare burned: UInt64
    @Struct.field(UInt64) declare templates: UInt64
    @Struct.field(UInt64) declare schemas: UInt64
    @Struct.field(BurnedByTemplate, {array: true})
    declare burned_by_template: BurnedByTemplate[]
    @Struct.field(BurnedBySchema, {array: true})
    declare burned_by_schema: BurnedBySchema[]
}
 
@Struct.type('asset_stats')
export class AssetStats extends Struct {
    @Struct.field(UInt32) declare template_mint: UInt32
}
 
@Struct.type('template_stats')
export class TemplateStats extends Struct {
    @Struct.field(UInt64) declare assets: UInt64
    @Struct.field(UInt64) declare burned: UInt64
}
 
@Struct.type('schema_stats')
export class SchemaStats extends Struct {
    @Struct.field(UInt64, {optional: true}) declare assets: UInt64
    @Struct.field(UInt64, {optional: true}) declare burned: UInt64
    @Struct.field(UInt64) declare templates: UInt64
}
 
@Struct.type('collection_burn')
export class CollectionBurn extends Struct {
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(UInt64) declare assets: UInt64
}
 
@Struct.type('template_burn')
export class TemplateBurn extends Struct {
    @Struct.field(Name) declare collection_name: Name
    @Struct.field(Int32) declare template_id: Int32
    @Struct.field(UInt64) declare assets: UInt64
}
 
@Struct.type('account_burns')
export class AccountBurns extends Struct {
    @Struct.field(CollectionWrapper, {array: true}) declare collections: CollectionWrapper[]
    @Struct.field(TemplateBurn, {array: true}) declare templates: TemplateBurn[]
    @Struct.field(UInt64) declare assets: UInt64
}
 
@Struct.type('asset_sales')
export class AssetSale extends Struct {
    @Struct.field(UInt64, {optional: true}) declare sale_id: UInt64
    @Struct.field(UInt64, {optional: true}) declare auction_id: UInt64
    @Struct.field(UInt64, {optional: true}) declare buyoffer_id: UInt64
    @Struct.field(UInt64) declare price: UInt64
    @Struct.field('string') declare token_symbol: string
    @Struct.field(UInt8) declare token_precision: UInt8
    @Struct.field(Name) declare token_contract: Name
    @Struct.field(Name) declare seller: Name
    @Struct.field(Name) declare buyer: Name
    @Struct.field('string') declare block_time: string
}
 
@Struct.type('resp')
export class ResponseStruct extends Struct {
    @Struct.field('bool') declare success: boolean
    @Struct.field(Float64) declare query_time: Float64
}
 
@Struct.type('get_count_resp')
export class CountResponseStruct extends ResponseStruct {
    @Struct.field(UInt64) declare data: UInt64
}