Skip to content

Commit

Permalink
Merge pull request #382 from Once-Upon/v3-types
Browse files Browse the repository at this point in the history
Add v3 Transaction Types
  • Loading branch information
cdt-eth authored May 28, 2024
2 parents 52fb744 + 0dc0678 commit 3efb07f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/types/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,52 @@ export type RawNeighbor = {
export type TxContext = {
type: string;
};

/**
* @note These `/v3/transactions` endpoint types are currently in alpha and may change.
*/
export type TransactionQueryResponse = {
transactions: TransactionEnriched[];
cursor: string | null;
partiesEnriched?: { [key: string]: PartyEnriched };
assetsEnriched?: { [key: string]: AssetEnriched };
};
export type TransactionEnriched = {
parties: string[];
context: TransactionContextType;
netAssetTransfers: NetAssetTransfers;
assetTransfers: AssetTransfer[];
pseudotransactions?: PseudoTransaction[];
} & Transaction;

type HandleAvatar = {
handle: string | null;
avatar: string | null;
};

type FarcasterDetails = HandleAvatar & {
fid: string | null;
};

export type PartyEnriched = {
chainId: number;
label: {
public: string;
};
isContract: boolean;
tokenStandard: string;
imgUrl: string;
decimals: number;
symbol: string;
ensNew: HandleAvatar;
bns: HandleAvatar;
farcaster: FarcasterDetails;
};

export type AssetEnriched = {
contract: string;
tokenId: string;
type: string;
value: string;
imageUrl: string | null;
};

0 comments on commit 3efb07f

Please sign in to comment.