diff --git a/packages/metadata/src/metadata.gen.ts b/packages/metadata/src/metadata.gen.ts index 984b53119..7db441516 100644 --- a/packages/metadata/src/metadata.gen.ts +++ b/packages/metadata/src/metadata.gen.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -// sequence-metadata v0.4.0 eaaa99d70565871556a53333df1c49d28c8be767 +// sequence-metadata v0.4.0 376fc6f21f770a4d0457a039d13b6aca6d174e3f // -- // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript // Do not edit by hand. Update your webrpc schema and re-generate. @@ -11,18 +11,32 @@ export const WebRPCVersion = "v1" export const WebRPCSchemaVersion = "v0.4.0" // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = "eaaa99d70565871556a53333df1c49d28c8be767" +export const WebRPCSchemaHash = "376fc6f21f770a4d0457a039d13b6aca6d174e3f" // // Types // +export enum ContractType { + ERC20 = 'ERC20', + ContractURI = 'ContractURI', + OpenSea = 'OpenSea', + ERC1155 = 'ERC1155', + ERC721 = 'ERC721', + UNKNOWN = 'UNKNOWN' +} + export enum SwapType { UNKNOWN = 'UNKNOWN', BUY = 'BUY', SELL = 'SELL' } +export enum SortOrder { + DESC = 'DESC', + ASC = 'ASC' +} + export interface Version { webrpcVersion: string schemaVersion: string @@ -43,6 +57,13 @@ export interface RuntimeStatus { export interface RuntimeChecks { } +export interface ContractIndex { + chainId: string + address: string + type: ContractType + metadata: {[key: string]: any} +} + export interface ContractInfo { chainId: number address: string @@ -63,6 +84,14 @@ export interface ContractInfoExtensions { blacklist: boolean } +export interface TokenIndex { + chainId: string + contractAddress: string + tokenId: string + metadata: {[key: string]: any} + +} + export interface TokenMetadata { tokenId: string contractAddress: string @@ -86,12 +115,24 @@ export interface GetNiftyswapUnitPricesRequest { amounts: Array } +export interface Page { + pageSize?: number + page?: number +} + +export interface SortBy { + column: string + order: SortOrder +} + export interface Metadata { ping(headers?: object): Promise version(headers?: object): Promise runtimeStatus(headers?: object): Promise getTokenMetadata(args: GetTokenMetadataArgs, headers?: object): Promise getTokenMetadataBatch(args: GetTokenMetadataBatchArgs, headers?: object): Promise + searchTokenMetadata(args: SearchTokenMetadataArgs, headers?: object): Promise + searchTokenIDs(args: SearchTokenIDsArgs, headers?: object): Promise getContractInfo(args: GetContractInfoArgs, headers?: object): Promise getContractInfoBatch(args: GetContractInfoBatchArgs, headers?: object): Promise searchContractInfo(args: SearchContractInfoArgs, headers?: object): Promise @@ -135,6 +176,28 @@ export interface GetTokenMetadataBatchArgs { export interface GetTokenMetadataBatchReturn { contractTokenMetadata: {[key: string]: Array} } +export interface SearchTokenMetadataArgs { + chainID: string + contractAddress: string + filter: string + page?: Page +} + +export interface SearchTokenMetadataReturn { + page: Page + tokenMetadata: Array +} +export interface SearchTokenIDsArgs { + chainID: string + contractAddress: string + filter: string + page?: Page +} + +export interface SearchTokenIDsReturn { + page: Page + tokenIds: Array +} export interface GetContractInfoArgs { chainID: string contractAddress: string @@ -266,6 +329,32 @@ export class Metadata implements Metadata { }) } + searchTokenMetadata = (args: SearchTokenMetadataArgs, headers?: object): Promise => { + return this.fetch( + this.url('SearchTokenMetadata'), + createHTTPRequest(args, headers)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + tokenMetadata: >(_data.tokenMetadata) + } + }) + }) + } + + searchTokenIDs = (args: SearchTokenIDsArgs, headers?: object): Promise => { + return this.fetch( + this.url('SearchTokenIDs'), + createHTTPRequest(args, headers)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + tokenIds: >(_data.tokenIds) + } + }) + }) + } + getContractInfo = (args: GetContractInfoArgs, headers?: object): Promise => { return this.fetch( this.url('GetContractInfo'), @@ -370,4 +459,4 @@ const buildResponse = (res: Response): Promise => { }) } -export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise +export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise \ No newline at end of file