UNPKG

@fioprotocol/fiosdk

Version:

The Foundation for Interwallet Operability (FIO) is a consortium of leading blockchain wallets, exchanges and payments providers that seeks to accelerate blockchain adoption by reducing the risk, complexity, and inconvenience of sending and receiving cryp

44 lines (37 loc) 1.39 kB
import {Account, Action, AddBundledTransactionsResponse, EndPoint} from '../../entities' import {validationRules} from '../../utils/validation' import {RequestConfig} from '../Transactions' import { SignedTransaction } from './SignedTransaction' export type AddBundledTransactionsRequestProps = { fioAddress: string; bundleSets: number; maxFee: number; technologyProviderId: string } export type AddBundledTransactionsRequestData = { actor: any; bundle_sets: number; fio_address: string; max_fee: number; tpid: string; } export class AddBundledTransactions extends SignedTransaction< AddBundledTransactionsRequestData, AddBundledTransactionsResponse > { public ENDPOINT = `chain/${EndPoint.addBundledTransactions}` as const public ACTION = Action.addBundledTransactions public ACCOUNT = Account.address constructor(config: RequestConfig, public props: AddBundledTransactionsRequestProps) { super(config) this.validationData = {fioAddress: props.fioAddress, tpid: props.technologyProviderId} this.validationRules = validationRules.registerFioAddress } public getData = () => ({ actor: this.getActor(), bundle_sets: this.props.bundleSets, fio_address: this.props.fioAddress, max_fee: this.props.maxFee, tpid: this.props.technologyProviderId, }) }