All files / src/kits atomicmarket.ts

57.69% Statements 15/26
75% Branches 6/8
42.1% Functions 8/19
57.69% Lines 15/26

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 9026x     1x     1x   1x       3x       18x   18x       1x       15x   15x       1x       13x   13x       1x                                                                                           1x  
import type {Action, UInt64Type} from '@wharfkit/antelope'
import type {ChainDefinition} from '@wharfkit/common'
 
import {Auction, Buyoffer, Sale} from '../objects'
import type * as AtomicMarketContract from '../contracts/atomicmarket'
import type {KitOptions} from '../utility'
import {KitUtility} from '../utility'
 
export class AtomicMarketKit {
    readonly utility: KitUtility
 
    constructor(url: string, chain: ChainDefinition, options?: KitOptions) {
        this.utility = new KitUtility(url, chain, options)
    }
 
    async loadAuction(auctionId: UInt64Type): Promise<Auction> {
        const data = await this.utility.atomicClient.atomicmarket.v1.get_auction(auctionId)
 
        return Auction.from(data.data, this.utility)
    }
 
    announceAuction(value: AtomicMarketContract.ActionParams.announceauct): Action {
        return this.utility.marketContract.action('announceauct', value)
    }
 
    async loadSale(saleId: UInt64Type): Promise<Sale> {
        const data = await this.utility.atomicClient.atomicmarket.v1.get_sale(saleId)
 
        return Sale.from(data.data, this.utility)
    }
 
    announceSale(value: AtomicMarketContract.ActionParams.announcesale): Action {
        return this.utility.marketContract.action('announcesale', value)
    }
 
    async loadBuyoffer(buyofferId: UInt64Type): Promise<Buyoffer> {
        const data = await this.utility.atomicClient.atomicmarket.v1.get_buyoffer(buyofferId)
 
        return Buyoffer.from(data.data, this.utility)
    }
 
    createBuyo(value: AtomicMarketContract.ActionParams.createbuyo): Action {
        return this.utility.marketContract.action('createbuyo', value)
    }
 
    addBonusfeeCounter(value: AtomicMarketContract.ActionParams.addbonusfee): Action {
        return this.utility.marketContract.action('addafeectr', value)
    }
 
    addBonusfee(value: AtomicMarketContract.ActionParams.addbonusfee): Action {
        return this.utility.marketContract.action('addbonusfee', value)
    }
 
    delBonusfee(value: AtomicMarketContract.ActionParams.delbonusfee): Action {
        return this.utility.marketContract.action('delbonusfee', value)
    }
 
    stopBonusfee(value: AtomicMarketContract.ActionParams.stopbonusfee): Action {
        return this.utility.marketContract.action('stopbonusfee', value)
    }
 
    addConfToken(value: AtomicMarketContract.ActionParams.addconftoken): Action {
        return this.utility.marketContract.action('addconftoken', value)
    }
 
    addDelphi(value: AtomicMarketContract.ActionParams.adddelphi): Action {
        return this.utility.marketContract.action('adddelphi', value)
    }
 
    registerMarketplace(value: AtomicMarketContract.ActionParams.regmarket): Action {
        return this.utility.marketContract.action('regmarket', value)
    }
 
    setMarketfee(value: AtomicMarketContract.ActionParams.setmarketfee): Action {
        return this.utility.marketContract.action('setmarketfee', value)
    }
 
    setMinbidinc(value: AtomicMarketContract.ActionParams.setminbidinc): Action {
        return this.utility.marketContract.action('setminbidinc', value)
    }
 
    setVersion(value: AtomicMarketContract.ActionParams.setversion): Action {
        return this.utility.marketContract.action('setversion', value)
    }
 
    withdraw(value: AtomicMarketContract.ActionParams.withdraw): Action {
        return this.utility.marketContract.action('withdraw', value)
    }
}