///
import type BigNumber from "bignumber.js";
import type { DataItem, Signer, createData, deepHash, getCryptoDriver, stringToBuffer, DataItemCreateOptions, bundleAndSignData } from "arbundles";
import type Irys from "./irys";
export type CreateTxData = {
amount: BigNumber.Value;
to: string;
fee?: string;
};
export type Arbundles = {
createData: typeof createData;
DataItem: typeof DataItem;
deepHash: typeof deepHash;
stringToBuffer: typeof stringToBuffer;
getCryptoDriver: typeof getCryptoDriver;
bundleAndSignData: typeof bundleAndSignData;
};
export type IrysTransaction = {
sign: () => Promise;
size: number;
uploadWithReceipt: (opts?: UploadOptions) => Promise;
upload(opts: UploadOptions & {
getReceiptSignature: true;
}): Promise;
upload(opts?: UploadOptions): Promise;
isValid(): Promise;
} & DataItem;
export type IrysTransactonCtor = new (data: string | Uint8Array, Irys: Pick, opts?: IrysTransactionCreateOptions) => IrysTransaction;
export type Tx = {
from: string;
to: string;
amount: BigNumber;
blockHeight?: BigNumber;
pending: boolean;
confirmed: boolean;
};
export type TokenConfig = {
irys: Irys;
name: string;
ticker: string;
minConfirm?: number;
wallet?: Wallet;
providerUrl: string;
isSlow?: boolean;
opts?: Opts;
};
export type Network = "mainnet" | "devnet" | string;
export type IrysConfig = {
timeout?: number;
providerUrl?: string;
contractAddress?: string;
tokenOpts?: object;
headers?: Record;
debug?: boolean;
};
export type Token = {
isSlow: boolean;
needsFee: boolean;
base: [string, number];
name: string;
get address(): string | undefined;
ticker: string;
irys: Irys;
getTx(txId: string): Promise;
ownerToAddress(owner: any): string;
price(): Promise;
sign(data: Uint8Array): Promise;
getSigner(): Signer;
verify(pub: any, data: Uint8Array, signature: Uint8Array): Promise;
getCurrentHeight(): Promise;
getFee(amount: BigNumber.Value, to?: string, multiplier?: BigNumber.Value): Promise;
sendTx(data: any): Promise;
createTx(amount: BigNumber.Value, to: string, fee?: string | object): Promise<{
txId: string | undefined;
tx: any;
}>;
getPublicKey(): Promise | (string | Buffer);
ready?(): Promise;
};
export type Manifest = {
manifest: string;
version: string;
paths: Record>>;
index?: Record<"path", string>;
};
export type UploadResponse = {
id: string;
public: string;
signature: string;
deadlineHeight: number;
validatorSignatures: {
address: string;
signature: string;
}[];
timestamp: number;
version: "1.0.0";
verify: () => Promise;
};
export type UploadReceipt = UploadResponse;
export type UploadReceiptData = Omit;
export type FundResponse = {
reward: string;
target: string;
quantity: string;
id: string;
};
export type WithdrawalResponse = {
tx_id: string;
requested: number;
fee: number;
final: number;
};
export type CreateAndUploadOptions = DataItemCreateOptions & {
upload?: UploadOptions;
};
export type UploadOptions = {
paidBy?: string;
};
export declare enum UploadHeaders {
PAID_BY = "x-irys-paid-by"
}
export type IrysTransactionCreateOptions = DataItemCreateOptions & {
dataIsRawTransaction?: boolean;
};
export type HashingAlgo = "sha256" | "sha384";
export type ProvenanceProof = {
dataProtocol: "Provenance-Confirmation" | string;
hashingAlgo?: HashingAlgo | string;
dataHash: string;
uploadedFor?: string;
prompt?: string;
promptHash?: string;
model?: string;
};
export type TxGqlNode = {
id: string;
receipt: {
deadlineHeight: number;
signature: string;
timestamp: number;
version: string;
};
tags: {
name: string;
value: string;
}[];
address: string;
currency: string;
signature: string;
timetamp: number;
};
export type TxGqlResponse = {
data: {
transactions: {
edges: {
node: TxGqlNode;
}[];
pageInfo?: {
endCursor: string | null;
hasNextPage: boolean;
};
};
};
};
export type UnixEpochMs = number;
export type StringifiedNumber<_NumberType extends number> = string;