@smartinvoicexyz/graphql
Version:
Unified source for helpers and schema used across the GraphQL services within the Smart Invoice protocol.
92 lines (91 loc) • 2.11 kB
TypeScript
import { Address, Hex } from 'viem';
import { ADR } from './zeus';
export type TokenMetadata = {
address: Hex;
name: string;
symbol: string;
decimals: number;
totalSupply: bigint;
};
export type TokenBalance = {
decimals: number;
symbol: string;
value: bigint;
};
export type InstantDetails = {
totalDue?: bigint;
amountFulfilled?: bigint;
fulfilled?: boolean;
deadline?: bigint;
lateFee?: bigint;
lateFeeTimeInterval?: bigint;
};
export type Release = {
id: string;
txHash: string;
milestone: bigint;
amount: bigint;
timestamp: bigint;
};
export type Deposit = {
id: string;
txHash: string;
sender: string;
amount: bigint;
timestamp: bigint;
};
export type Dispute = {
sender: string;
details: string;
id: string;
txHash: string;
timestamp: bigint;
ipfsHash: string;
disputeToken?: string | undefined;
disputeFee?: bigint | undefined;
disputeId?: bigint | undefined;
};
export type Resolution = {
id: string;
txHash: string;
ipfsHash: string;
resolverType: ADR;
resolver: string;
clientAward: bigint;
providerAward: bigint;
resolutionDetails?: string | undefined;
resolutionFee?: bigint | undefined;
timestamp: bigint;
};
export type Invoice = {
amounts: bigint[];
version?: bigint | undefined;
address: Hex;
invoiceType?: string | undefined;
resolver: string;
resolutionRate: bigint;
ipfsHash: string;
token: string;
id: string;
createdAt: bigint;
network: string;
client: Hex;
clientReceiver: Hex;
provider: Hex;
providerReceiver: Hex;
resolverType: ADR;
isLocked: boolean;
currentMilestone: bigint;
total: bigint;
released: bigint;
terminationTime: bigint;
deposits: Deposit[];
releases: Release[];
disputes: Dispute[];
resolutions: Resolution[];
verified: {
id: string;
client: string;
}[];
};
export declare const fetchInvoice: (chainId: number | undefined, queryAddress: Address) => Promise<Invoice | null>;