@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
38 lines (31 loc) • 1.21 kB
text/typescript
import {Account, Action, BurnFioAddressResponse, EndPoint} from '../../entities'
import {validationRules} from '../../utils/validation'
import {RequestConfig} from '../Transactions'
import { SignedTransaction } from './SignedTransaction'
export type BurnFioAddressRequestProps = {
fioAddress: string;
maxFee: number;
technologyProviderId: string;
}
export type BurnFioAddressRequestData = {
fio_address: string;
actor: string;
tpid: string;
max_fee: number;
}
export class BurnFioAddress extends SignedTransaction<BurnFioAddressRequestData, BurnFioAddressResponse> {
public ENDPOINT = `chain/${EndPoint.burnFioAddress}` as const
public ACTION = Action.burnAddress
public ACCOUNT = Account.address
constructor(config: RequestConfig, public props: BurnFioAddressRequestProps) {
super(config)
this.validationData = {fioAddress: props.fioAddress, tpid: props.technologyProviderId}
this.validationRules = validationRules.registerFioAddress
}
public getData = () => ({
actor: this.getActor(),
fio_address: this.props.fioAddress,
max_fee: this.props.maxFee,
tpid: this.props.technologyProviderId,
})
}