All files / src/kits atomictools.ts

100% Statements 9/9
75% Branches 6/8
100% Functions 4/4
100% Lines 9/9

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 2622x     1x     1x   1x       1x       10x   10x       1x   1x  
import type {Action, UInt64Type} from '@wharfkit/antelope'
import type {ChainDefinition} from '@wharfkit/common'
 
import {Link} from '../objects'
import type * as AtomicToolsContract from '../contracts/atomictoolsx'
import type {KitOptions} from '../utility'
import {KitUtility} from '../utility'
 
export class AtomicToolsKit {
    readonly utility: KitUtility
 
    constructor(url: string, chain: ChainDefinition, options?: KitOptions) {
        this.utility = new KitUtility(url, chain, options)
    }
 
    async loadLink(linkId: UInt64Type): Promise<Link> {
        const data = await this.utility.atomicClient.atomictools.v1.get_link(linkId)
 
        return Link.from(data.data, this.utility)
    }
 
    announceLink(value: AtomicToolsContract.ActionParams.announcelink): Action {
        return this.utility.toolsContract.action('announcelink', value)
    }
}