UNPKG

@helium/http

Version:

HTTP library for interacting with the Helium blockchain API

310 lines 9.29 kB
import { Balance, DataCredits, NetworkTokens, TestNetworkTokens, SecurityTokens, IotTokens, MobileTokens } from '@helium/currency'; import Challenge from './Challenge'; import DataModel from './DataModel'; export interface TxnJsonObject { type: string; amount?: number; payments?: any[]; rewards?: any[]; fee?: number; amount_to_seller?: number; token_type?: string; } export declare class AddGatewayV1 extends DataModel { type: string; time: number; stakingFee: Balance<DataCredits>; payerSignature: string; payer: string; ownerSignature: string; owner: string; height: number; hash: string; gatewaySignature: string; gateway: string; fee: Balance<DataCredits>; constructor(data: AddGatewayV1); get data(): AddGatewayV1; } export declare class TokenBurnV1 extends DataModel { type: string; time: number; payer: string; payee: string; nonce: number; memo: string; height: number; hash: string; fee: Balance<DataCredits>; amount: Balance<NetworkTokens | TestNetworkTokens>; constructor(data: TokenBurnV1); get data(): TokenBurnV1; } export declare class AssertLocationV1 extends DataModel { type: string; time: number; stakingFee: Balance<DataCredits>; payerSignature: string; payer: string; ownerSignature: string; owner: string; nonce: number; location: string; lng: number; lat: number; height: number; hash: string; gatewaySignature: string; gateway: string; fee: Balance<DataCredits>; constructor(data: AssertLocationV1); get data(): AssertLocationV1; } export declare class AssertLocationV2 extends DataModel { type: string; time: number; stakingFee: Balance<DataCredits>; payerSignature: string; payer: string; ownerSignature: string; owner: string; nonce: number; location: string; lng: number; lat: number; height: number; hash: string; gateway: string; gain: number; fee: Balance<DataCredits>; elevation: number; constructor(data: AssertLocationV2); get data(): AssertLocationV2; } export declare class PaymentV1 extends DataModel { type: string; time: number; signature: string; payer: string; payee: string; nonce: number; height: number; hash: string; fee: Balance<DataCredits>; amount: Balance<NetworkTokens>; constructor(data: PaymentV1); get data(): PaymentV1; } export declare class PaymentV2 extends DataModel { type: string; time: number; signature: string; payer: string; payments: Payment[]; nonce: number; height: number; hash: string; fee: Balance<DataCredits>; totalAmountHnt: Balance<NetworkTokens>; totalAmountMobile: Balance<MobileTokens>; totalAmountIot: Balance<IotTokens>; constructor(data: PaymentV2); get data(): PaymentV2; } export declare class StakeValidatorV1 extends DataModel { type: string; time: number; stake: Balance<NetworkTokens>; ownerSignature: string; owner: string; fee: Balance<DataCredits>; address: string; constructor(data: StakeValidatorV1); get data(): StakeValidatorV1; } export declare class UnstakeValidatorV1 extends DataModel { type: string; time: number; stakeReleaseHeight: number; stakeAmount: Balance<NetworkTokens>; ownerSignature: string; owner: string; hash: string; fee: Balance<DataCredits>; address: string; constructor(data: UnstakeValidatorV1); get data(): UnstakeValidatorV1; } export declare class TransferValidatorStakeV1 extends DataModel { type: string; time: number; oldAddress: string; newAddress: string; oldOwner: string; newOwner: string; oldOwnerSignature: string; newOwnerSignature: string; fee: Balance<DataCredits>; stakeAmount: Balance<NetworkTokens>; paymentAmount: Balance<NetworkTokens>; constructor(data: TransferValidatorStakeV1); get data(): TransferValidatorStakeV1; } interface StateChannelSummary { owner: string; numPackets: number; numDcs: number; location: string; client: string; } interface StateChannel { summaries: StateChannelSummary[]; state: string; rootHash: string; owner: string; nonce: number; id: string; expireAtBlock: number; } export declare class StateChannelCloseV1 extends DataModel { type: string; time: number; height: number; hash: string; stateChannel: StateChannel; conflictsWith?: StateChannel; closer: string; constructor(data: StateChannelCloseV1); get data(): StateChannelCloseV1; } export declare class SecurityExchangeV1 extends DataModel { type: string; time: number; payer: string; payee: string; nonce: number; height: number; hash: string; fee: Balance<DataCredits>; amount: Balance<SecurityTokens>; constructor(data: SecurityExchangeV1); get data(): SecurityExchangeV1; } export declare class UnknownTransaction extends DataModel { type: string; time: number; constructor(data: UnknownTransaction); get data(): UnknownTransaction; } export interface Payment { payee: string; amount: Balance<NetworkTokens | MobileTokens | IotTokens>; memo?: string; max?: boolean; tokenType: string; } export declare class RewardsV1 extends DataModel { type: string; time: number; startEpoch: number; rewards: Reward[]; height: number; hash: string; endEpoch: number; totalAmount: Balance<NetworkTokens>; constructor(data: RewardsV1); get data(): RewardsV1; } export declare class RewardsV2 extends RewardsV1 { } export interface Reward { type: string; gateway: string; amount: Balance<NetworkTokens>; account: string; } export interface PocReceiptsV1 extends Challenge { } export interface PocReceiptsV2 extends Challenge { } export type AnyTransaction = PaymentV1 | PaymentV2 | RewardsV1 | RewardsV2 | SubnetworkRewardsV1 | TokenRedeemV1 | AddGatewayV1 | AssertLocationV1 | PocReceiptsV1 | PocReceiptsV2 | TransferHotspotV1 | TransferHotspotV2 | TokenBurnV1 | StakeValidatorV1 | UnstakeValidatorV1 | TransferValidatorStakeV1 | SecurityExchangeV1 | UnknownTransaction; export declare class TransferHotspotV1 extends DataModel { type: string; time: number; seller: string; height: number; hash: string; gateway: string; buyerNonce: number; buyer: string; fee: Balance<DataCredits>; amountToSeller: Balance<NetworkTokens>; constructor(data: TransferHotspotV1); get data(): TransferHotspotV1; } export declare class TransferHotspotV2 extends DataModel { type: string; time: number; owner: string; height: number; hash: string; gateway: string; nonce: number; newOwner: string; fee: Balance<DataCredits>; ownerSignature: string; constructor(data: TransferHotspotV2); get data(): TransferHotspotV2; } export interface SubnetworkReward { account: string; amount: Balance<MobileTokens | IotTokens>; } export declare class SubnetworkRewardsV1 extends DataModel { type: string; time: number; tokenType: string; startEpoch: number; endEpoch: number; rewardServerSignature: string; rewards: Array<SubnetworkReward>; constructor(data: SubnetworkRewardsV1); get data(): SubnetworkRewardsV1; } export declare class TokenRedeemV1 extends DataModel { type: string; time: number; account: string; amount: Balance<MobileTokens | IotTokens>; fee: number; nonce: number; tokenType: string; signature: string; constructor(data: TokenRedeemV1); get data(): TokenRedeemV1; } export default class Transaction { static fromJsonObject(json: TxnJsonObject): AnyTransaction; static toPaymentV1(json: TxnJsonObject): PaymentV1; static toPaymentV2(json: TxnJsonObject): PaymentV2; static toAddGatewayV1(json: TxnJsonObject): AddGatewayV1; static toAssertLocationV1(json: TxnJsonObject): AssertLocationV1; static toAssertLocationV2(json: TxnJsonObject): AssertLocationV2; static toTokenBurnV1(json: TxnJsonObject): TokenBurnV1; static toUnstakeValidatorV1(json: TxnJsonObject): UnstakeValidatorV1; static toStakeValidatorV1(json: TxnJsonObject): StakeValidatorV1; static toTransferValidatorStakeV1(json: TxnJsonObject): TransferValidatorStakeV1; static toUnknownTransaction(json: TxnJsonObject): UnknownTransaction; static toPocReceiptsV1(json: TxnJsonObject): PocReceiptsV1; static toPocReceiptsV2(json: TxnJsonObject): PocReceiptsV2; static toTransferHotspotV1(json: TxnJsonObject): TransferHotspotV1; static toTransferHotspotV2(json: TxnJsonObject): TransferHotspotV2; static toStateChannelCloseV1(json: TxnJsonObject): StateChannelCloseV1; static toSecurityExchangeV1(json: TxnJsonObject): SecurityExchangeV1; static toRewardsV1(json: TxnJsonObject): RewardsV1; static toRewardsV2(json: TxnJsonObject): RewardsV2; static toSubnetworkRewardsV1(json: TxnJsonObject): SubnetworkRewardsV1; static toTokenRedeemV1(json: TxnJsonObject): TokenRedeemV1; } export {}; //# sourceMappingURL=Transaction.d.ts.map