@0xsequence/collectible-lists
Version:
📚 The Collectible Lists specification
31 lines (30 loc) • 1.1 kB
TypeScript
import { CollectibleInfo } from './types';
export declare type CollectibleInfoChangeKey = Exclude<keyof CollectibleInfo, 'address' | 'chainId'>;
export declare type CollectibleInfoChanges = Array<CollectibleInfoChangeKey>;
/**
* Differences between a base list and an updated list.
*/
export interface CollectibleListDiff {
/**
* Tokens from updated with chainId/address not present in base list
*/
readonly added: CollectibleInfo[];
/**
* Tokens from base with chainId/address not present in the updated list
*/
readonly removed: CollectibleInfo[];
/**
* The token info that changed
*/
readonly changed: {
[chainId: number]: {
[address: string]: CollectibleInfoChanges;
};
};
}
/**
* Computes the diff of a collectible list where the first argument is the base and the second argument is the updated list.
* @param base base list
* @param update updated list
*/
export declare function diffCollectibleLists(base: CollectibleInfo[], update: CollectibleInfo[]): CollectibleListDiff;