@0xsequence/indexer
Advanced tools
Comparing version 0.0.0-20240718140827 to 0.0.0-20240807210827
@@ -21,3 +21,3 @@ 'use strict'; | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 d33d29bc84a4439a42a4e1533035bc80c4ea226e | ||
// sequence-indexer v0.4.0 9accea267e7db3d66f40d5e0f27db92eb5a29e2f | ||
// -- | ||
@@ -35,3 +35,3 @@ // Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT. | ||
// Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = 'd33d29bc84a4439a42a4e1533035bc80c4ea226e'; | ||
const WebRPCSchemaHash = '9accea267e7db3d66f40d5e0f27db92eb5a29e2f'; | ||
@@ -62,3 +62,3 @@ // | ||
let EventLogDataType = /*#__PURE__*/function (EventLogDataType) { | ||
EventLogDataType["UNKNOWN"] = "UNKNOWN"; | ||
EventLogDataType["EVENT"] = "EVENT"; | ||
EventLogDataType["TOKEN_TRANSFER"] = "TOKEN_TRANSFER"; | ||
@@ -370,2 +370,41 @@ EventLogDataType["NATIVE_TOKEN_TRANSFER"] = "NATIVE_TOKEN_TRANSFER"; | ||
}; | ||
this.toggleWebhookListener = (args, headers, signal) => { | ||
return this.fetch(this.url('ToggleWebhookListener'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
webhookListener: _data.webhookListener | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.pauseAllWebhookListeners = (args, headers, signal) => { | ||
return this.fetch(this.url('PauseAllWebhookListeners'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.resumeAllWebhookListeners = (args, headers, signal) => { | ||
return this.fetch(this.url('ResumeAllWebhookListeners'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.subscribeReceipts = (args, options) => { | ||
@@ -387,2 +426,10 @@ const _fetch = () => this.fetch(this.url('SubscribeReceipts'), createHTTPRequest(args, options.headers, options.signal)).then(async function (res) { | ||
}; | ||
this.subscribeBalanceUpdates = (args, options) => { | ||
const _fetch = () => this.fetch(this.url('SubscribeBalanceUpdates'), createHTTPRequest(args, options.headers, options.signal)).then(async function (res) { | ||
await sseResponse(res, options, _fetch); | ||
}, error => { | ||
options.onError(error, _fetch); | ||
}); | ||
return _fetch(); | ||
}; | ||
this.hostname = hostname; | ||
@@ -700,2 +747,8 @@ this.fetch = (input, init) => fetch(input, init); | ||
} | ||
class ResourceExhaustedError extends WebrpcError { | ||
constructor(name = 'ResourceExhausted', code = 2004, message = 'Resource exhausted', status = 0, cause) { | ||
super(name, code, message, status, cause); | ||
Object.setPrototypeOf(this, ResourceExhaustedError.prototype); | ||
} | ||
} | ||
class NotFoundError extends WebrpcError { | ||
@@ -741,2 +794,3 @@ constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) { | ||
errors["QueryFailed"] = "QueryFailed"; | ||
errors["ResourceExhausted"] = "ResourceExhausted"; | ||
errors["NotFound"] = "NotFound"; | ||
@@ -769,2 +823,3 @@ errors["ProjectNotFound"] = "ProjectNotFound"; | ||
[2003]: QueryFailedError, | ||
[2004]: ResourceExhaustedError, | ||
[3000]: NotFoundError, | ||
@@ -775,3 +830,3 @@ [3002]: ProjectNotFoundError, | ||
const fetch = typeof global === 'object' ? global.fetch : window.fetch; | ||
const fetch = globalThis.fetch; | ||
class SequenceIndexer extends Indexer { | ||
@@ -817,2 +872,3 @@ constructor(hostname, projectAccessKey, jwtAuth) { | ||
exports.RequestConflictError = RequestConflictError; | ||
exports.ResourceExhaustedError = ResourceExhaustedError; | ||
exports.SequenceIndexer = SequenceIndexer; | ||
@@ -819,0 +875,0 @@ exports.SessionExpiredError = SessionExpiredError; |
@@ -21,3 +21,3 @@ 'use strict'; | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 d33d29bc84a4439a42a4e1533035bc80c4ea226e | ||
// sequence-indexer v0.4.0 9accea267e7db3d66f40d5e0f27db92eb5a29e2f | ||
// -- | ||
@@ -35,3 +35,3 @@ // Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT. | ||
// Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = 'd33d29bc84a4439a42a4e1533035bc80c4ea226e'; | ||
const WebRPCSchemaHash = '9accea267e7db3d66f40d5e0f27db92eb5a29e2f'; | ||
@@ -62,3 +62,3 @@ // | ||
let EventLogDataType = /*#__PURE__*/function (EventLogDataType) { | ||
EventLogDataType["UNKNOWN"] = "UNKNOWN"; | ||
EventLogDataType["EVENT"] = "EVENT"; | ||
EventLogDataType["TOKEN_TRANSFER"] = "TOKEN_TRANSFER"; | ||
@@ -370,2 +370,41 @@ EventLogDataType["NATIVE_TOKEN_TRANSFER"] = "NATIVE_TOKEN_TRANSFER"; | ||
}; | ||
this.toggleWebhookListener = (args, headers, signal) => { | ||
return this.fetch(this.url('ToggleWebhookListener'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
webhookListener: _data.webhookListener | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.pauseAllWebhookListeners = (args, headers, signal) => { | ||
return this.fetch(this.url('PauseAllWebhookListeners'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.resumeAllWebhookListeners = (args, headers, signal) => { | ||
return this.fetch(this.url('ResumeAllWebhookListeners'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.subscribeReceipts = (args, options) => { | ||
@@ -387,2 +426,10 @@ const _fetch = () => this.fetch(this.url('SubscribeReceipts'), createHTTPRequest(args, options.headers, options.signal)).then(async function (res) { | ||
}; | ||
this.subscribeBalanceUpdates = (args, options) => { | ||
const _fetch = () => this.fetch(this.url('SubscribeBalanceUpdates'), createHTTPRequest(args, options.headers, options.signal)).then(async function (res) { | ||
await sseResponse(res, options, _fetch); | ||
}, error => { | ||
options.onError(error, _fetch); | ||
}); | ||
return _fetch(); | ||
}; | ||
this.hostname = hostname; | ||
@@ -700,2 +747,8 @@ this.fetch = (input, init) => fetch(input, init); | ||
} | ||
class ResourceExhaustedError extends WebrpcError { | ||
constructor(name = 'ResourceExhausted', code = 2004, message = 'Resource exhausted', status = 0, cause) { | ||
super(name, code, message, status, cause); | ||
Object.setPrototypeOf(this, ResourceExhaustedError.prototype); | ||
} | ||
} | ||
class NotFoundError extends WebrpcError { | ||
@@ -741,2 +794,3 @@ constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) { | ||
errors["QueryFailed"] = "QueryFailed"; | ||
errors["ResourceExhausted"] = "ResourceExhausted"; | ||
errors["NotFound"] = "NotFound"; | ||
@@ -769,2 +823,3 @@ errors["ProjectNotFound"] = "ProjectNotFound"; | ||
[2003]: QueryFailedError, | ||
[2004]: ResourceExhaustedError, | ||
[3000]: NotFoundError, | ||
@@ -775,3 +830,3 @@ [3002]: ProjectNotFoundError, | ||
const fetch = typeof global === 'object' ? global.fetch : window.fetch; | ||
const fetch = globalThis.fetch; | ||
class SequenceIndexer extends Indexer { | ||
@@ -817,2 +872,3 @@ constructor(hostname, projectAccessKey, jwtAuth) { | ||
exports.RequestConflictError = RequestConflictError; | ||
exports.ResourceExhaustedError = ResourceExhaustedError; | ||
exports.SequenceIndexer = SequenceIndexer; | ||
@@ -819,0 +875,0 @@ exports.SessionExpiredError = SessionExpiredError; |
@@ -17,3 +17,3 @@ function _extends() { | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 d33d29bc84a4439a42a4e1533035bc80c4ea226e | ||
// sequence-indexer v0.4.0 9accea267e7db3d66f40d5e0f27db92eb5a29e2f | ||
// -- | ||
@@ -31,3 +31,3 @@ // Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT. | ||
// Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = 'd33d29bc84a4439a42a4e1533035bc80c4ea226e'; | ||
const WebRPCSchemaHash = '9accea267e7db3d66f40d5e0f27db92eb5a29e2f'; | ||
@@ -58,3 +58,3 @@ // | ||
let EventLogDataType = /*#__PURE__*/function (EventLogDataType) { | ||
EventLogDataType["UNKNOWN"] = "UNKNOWN"; | ||
EventLogDataType["EVENT"] = "EVENT"; | ||
EventLogDataType["TOKEN_TRANSFER"] = "TOKEN_TRANSFER"; | ||
@@ -366,2 +366,41 @@ EventLogDataType["NATIVE_TOKEN_TRANSFER"] = "NATIVE_TOKEN_TRANSFER"; | ||
}; | ||
this.toggleWebhookListener = (args, headers, signal) => { | ||
return this.fetch(this.url('ToggleWebhookListener'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
webhookListener: _data.webhookListener | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.pauseAllWebhookListeners = (args, headers, signal) => { | ||
return this.fetch(this.url('PauseAllWebhookListeners'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.resumeAllWebhookListeners = (args, headers, signal) => { | ||
return this.fetch(this.url('ResumeAllWebhookListeners'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.subscribeReceipts = (args, options) => { | ||
@@ -383,2 +422,10 @@ const _fetch = () => this.fetch(this.url('SubscribeReceipts'), createHTTPRequest(args, options.headers, options.signal)).then(async function (res) { | ||
}; | ||
this.subscribeBalanceUpdates = (args, options) => { | ||
const _fetch = () => this.fetch(this.url('SubscribeBalanceUpdates'), createHTTPRequest(args, options.headers, options.signal)).then(async function (res) { | ||
await sseResponse(res, options, _fetch); | ||
}, error => { | ||
options.onError(error, _fetch); | ||
}); | ||
return _fetch(); | ||
}; | ||
this.hostname = hostname; | ||
@@ -696,2 +743,8 @@ this.fetch = (input, init) => fetch(input, init); | ||
} | ||
class ResourceExhaustedError extends WebrpcError { | ||
constructor(name = 'ResourceExhausted', code = 2004, message = 'Resource exhausted', status = 0, cause) { | ||
super(name, code, message, status, cause); | ||
Object.setPrototypeOf(this, ResourceExhaustedError.prototype); | ||
} | ||
} | ||
class NotFoundError extends WebrpcError { | ||
@@ -737,2 +790,3 @@ constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) { | ||
errors["QueryFailed"] = "QueryFailed"; | ||
errors["ResourceExhausted"] = "ResourceExhausted"; | ||
errors["NotFound"] = "NotFound"; | ||
@@ -765,2 +819,3 @@ errors["ProjectNotFound"] = "ProjectNotFound"; | ||
[2003]: QueryFailedError, | ||
[2004]: ResourceExhaustedError, | ||
[3000]: NotFoundError, | ||
@@ -771,3 +826,3 @@ [3002]: ProjectNotFoundError, | ||
const fetch = typeof global === 'object' ? global.fetch : window.fetch; | ||
const fetch = globalThis.fetch; | ||
class SequenceIndexer extends Indexer { | ||
@@ -799,2 +854,2 @@ constructor(hostname, projectAccessKey, jwtAuth) { | ||
export { AbortedError, ContractType, EventLogDataType, EventLogType, Indexer, InvalidArgumentError, MetadataCallFailedError, MethodNotFoundError, NotFoundError, OrderStatus, PermissionDeniedError, ProjectNotFoundError, QueryFailedError, RequestConflictError, SequenceIndexer, SessionExpiredError, SortOrder, TimeoutError, TransactionStatus, TransactionType, TxnTransferType, UnauthorizedError, UnavailableError, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion, WebrpcBadMethodError, WebrpcBadRequestError, WebrpcBadResponseError, WebrpcBadRouteError, WebrpcClientDisconnectedError, WebrpcEndpointError, WebrpcError, WebrpcInternalErrorError, WebrpcRequestFailedError, WebrpcServerPanicError, WebrpcStreamFinishedError, WebrpcStreamLostError, errors }; | ||
export { AbortedError, ContractType, EventLogDataType, EventLogType, Indexer, InvalidArgumentError, MetadataCallFailedError, MethodNotFoundError, NotFoundError, OrderStatus, PermissionDeniedError, ProjectNotFoundError, QueryFailedError, RequestConflictError, ResourceExhaustedError, SequenceIndexer, SessionExpiredError, SortOrder, TimeoutError, TransactionStatus, TransactionType, TxnTransferType, UnauthorizedError, UnavailableError, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion, WebrpcBadMethodError, WebrpcBadRequestError, WebrpcBadResponseError, WebrpcBadRouteError, WebrpcClientDisconnectedError, WebrpcEndpointError, WebrpcError, WebrpcInternalErrorError, WebrpcRequestFailedError, WebrpcServerPanicError, WebrpcStreamFinishedError, WebrpcStreamLostError, errors }; |
export declare const WebRPCVersion = "v1"; | ||
export declare const WebRPCSchemaVersion = "v0.4.0"; | ||
export declare const WebRPCSchemaHash = "d33d29bc84a4439a42a4e1533035bc80c4ea226e"; | ||
export declare const WebRPCSchemaHash = "9accea267e7db3d66f40d5e0f27db92eb5a29e2f"; | ||
export interface ContractInfo { | ||
@@ -26,2 +26,3 @@ chainId: number; | ||
verifiedBy: string; | ||
featured: boolean; | ||
} | ||
@@ -52,3 +53,3 @@ export interface TokenMetadata { | ||
collectionId: number; | ||
tokenId: string; | ||
tokenId?: string; | ||
url?: string; | ||
@@ -81,3 +82,3 @@ metadataField: string; | ||
export declare enum EventLogDataType { | ||
UNKNOWN = "UNKNOWN", | ||
EVENT = "EVENT", | ||
TOKEN_TRANSFER = "TOKEN_TRANSFER", | ||
@@ -139,2 +140,3 @@ NATIVE_TOKEN_TRANSFER = "NATIVE_TOKEN_TRANSFER", | ||
running: boolean; | ||
runnables: any; | ||
cgoEnabled: boolean; | ||
@@ -189,3 +191,3 @@ quotaControlEnabled: boolean; | ||
} | ||
export interface TxnData { | ||
export interface TxnInfo { | ||
from: string; | ||
@@ -197,2 +199,3 @@ to: string; | ||
id: number; | ||
uid: string; | ||
type: EventLogType; | ||
@@ -206,8 +209,18 @@ blockNumber: number; | ||
txnIndex: number; | ||
txnData: TxnData; | ||
txnLogIndex: number; | ||
logDataType: EventLogDataType; | ||
ts: string; | ||
logData: string; | ||
txnInfo?: TxnInfo; | ||
rawLog?: { | ||
[key: string]: any; | ||
}; | ||
event?: EventDecoded; | ||
} | ||
export interface EventDecoded { | ||
topicHash: string; | ||
eventSig: string; | ||
types: Array<string>; | ||
names: Array<string>; | ||
values: Array<string>; | ||
} | ||
export interface TokenBalance { | ||
@@ -217,3 +230,3 @@ contractType: ContractType; | ||
accountAddress: string; | ||
tokenID: string; | ||
tokenID?: string; | ||
balance: string; | ||
@@ -310,3 +323,2 @@ blockHash: string; | ||
event?: string; | ||
topicHash?: string; | ||
} | ||
@@ -352,11 +364,16 @@ export interface TransactionReceipt { | ||
filters: EventFilter; | ||
name: string; | ||
updatedAt: string; | ||
active: boolean; | ||
} | ||
export interface EventFilter { | ||
events?: Array<string>; | ||
topicHashes?: Array<string>; | ||
contractAddresses?: Array<string>; | ||
accounts?: Array<string>; | ||
tokenIDs?: Array<string>; | ||
accounts?: Array<string>; | ||
} | ||
export interface TokenBalanceFilter { | ||
contractAddress: string; | ||
sinceBlockNumber: number; | ||
} | ||
export interface MetadataOptions { | ||
@@ -388,4 +405,8 @@ verifiedOnly?: boolean; | ||
removeWebhookListener(args: RemoveWebhookListenerArgs, headers?: object, signal?: AbortSignal): Promise<RemoveWebhookListenerReturn>; | ||
toggleWebhookListener(args: ToggleWebhookListenerArgs, headers?: object, signal?: AbortSignal): Promise<ToggleWebhookListenerReturn>; | ||
pauseAllWebhookListeners(args: PauseAllWebhookListenersArgs, headers?: object, signal?: AbortSignal): Promise<PauseAllWebhookListenersReturn>; | ||
resumeAllWebhookListeners(args: ResumeAllWebhookListenersArgs, headers?: object, signal?: AbortSignal): Promise<ResumeAllWebhookListenersReturn>; | ||
subscribeReceipts(args: SubscribeReceiptsArgs, options: WebrpcStreamOptions<SubscribeReceiptsReturn>): Promise<void>; | ||
subscribeEvents(args: SubscribeEventsArgs, options: WebrpcStreamOptions<SubscribeEventsReturn>): Promise<void>; | ||
subscribeBalanceUpdates(args: SubscribeBalanceUpdatesArgs, options: WebrpcStreamOptions<SubscribeBalanceUpdatesReturn>): Promise<void>; | ||
} | ||
@@ -556,2 +577,21 @@ export interface PingArgs { | ||
} | ||
export interface ToggleWebhookListenerArgs { | ||
id: number; | ||
projectId?: number; | ||
} | ||
export interface ToggleWebhookListenerReturn { | ||
webhookListener: WebhookListener; | ||
} | ||
export interface PauseAllWebhookListenersArgs { | ||
projectId?: number; | ||
} | ||
export interface PauseAllWebhookListenersReturn { | ||
status: boolean; | ||
} | ||
export interface ResumeAllWebhookListenersArgs { | ||
projectId?: number; | ||
} | ||
export interface ResumeAllWebhookListenersReturn { | ||
status: boolean; | ||
} | ||
export interface SubscribeReceiptsArgs { | ||
@@ -569,2 +609,8 @@ filter: TransactionFilter; | ||
} | ||
export interface SubscribeBalanceUpdatesArgs { | ||
contractAddress: string; | ||
} | ||
export interface SubscribeBalanceUpdatesReturn { | ||
balance: TokenBalance; | ||
} | ||
export declare class Indexer implements Indexer { | ||
@@ -596,4 +642,8 @@ protected hostname: string; | ||
removeWebhookListener: (args: RemoveWebhookListenerArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<RemoveWebhookListenerReturn>; | ||
toggleWebhookListener: (args: ToggleWebhookListenerArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<ToggleWebhookListenerReturn>; | ||
pauseAllWebhookListeners: (args: PauseAllWebhookListenersArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<PauseAllWebhookListenersReturn>; | ||
resumeAllWebhookListeners: (args: ResumeAllWebhookListenersArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<ResumeAllWebhookListenersReturn>; | ||
subscribeReceipts: (args: SubscribeReceiptsArgs, options: WebrpcStreamOptions<SubscribeReceiptsReturn>) => Promise<void>; | ||
subscribeEvents: (args: SubscribeEventsArgs, options: WebrpcStreamOptions<SubscribeEventsReturn>) => Promise<void>; | ||
subscribeBalanceUpdates: (args: SubscribeBalanceUpdatesArgs, options: WebrpcStreamOptions<SubscribeBalanceUpdatesReturn>) => Promise<void>; | ||
} | ||
@@ -674,2 +724,5 @@ export declare class WebrpcError extends Error { | ||
} | ||
export declare class ResourceExhaustedError extends WebrpcError { | ||
constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); | ||
} | ||
export declare class NotFoundError extends WebrpcError { | ||
@@ -706,2 +759,3 @@ constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); | ||
QueryFailed = "QueryFailed", | ||
ResourceExhausted = "ResourceExhausted", | ||
NotFound = "NotFound", | ||
@@ -708,0 +762,0 @@ ProjectNotFound = "ProjectNotFound", |
{ | ||
"name": "@0xsequence/indexer", | ||
"version": "0.0.0-20240718140827", | ||
"version": "0.0.0-20240807210827", | ||
"description": "indexer sub-package for Sequence", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/indexer", |
@@ -5,3 +5,3 @@ export * from './indexer.gen' | ||
const fetch = typeof global === 'object' ? global.fetch : window.fetch | ||
const fetch = globalThis.fetch | ||
@@ -8,0 +8,0 @@ export class SequenceIndexer extends IndexerRpc { |
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 d33d29bc84a4439a42a4e1533035bc80c4ea226e | ||
// sequence-indexer v0.4.0 9accea267e7db3d66f40d5e0f27db92eb5a29e2f | ||
// -- | ||
@@ -15,3 +15,3 @@ // Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT. | ||
// Schema hash generated from your RIDL schema | ||
export const WebRPCSchemaHash = 'd33d29bc84a4439a42a4e1533035bc80c4ea226e' | ||
export const WebRPCSchemaHash = '9accea267e7db3d66f40d5e0f27db92eb5a29e2f' | ||
@@ -45,2 +45,3 @@ // | ||
verifiedBy: string | ||
featured: boolean | ||
} | ||
@@ -69,3 +70,3 @@ | ||
collectionId: number | ||
tokenId: string | ||
tokenId?: string | ||
url?: string | ||
@@ -101,3 +102,3 @@ metadataField: string | ||
export enum EventLogDataType { | ||
UNKNOWN = 'UNKNOWN', | ||
EVENT = 'EVENT', | ||
TOKEN_TRANSFER = 'TOKEN_TRANSFER', | ||
@@ -168,2 +169,3 @@ NATIVE_TOKEN_TRANSFER = 'NATIVE_TOKEN_TRANSFER', | ||
running: boolean | ||
runnables: any | ||
cgoEnabled: boolean | ||
@@ -224,3 +226,3 @@ quotaControlEnabled: boolean | ||
export interface TxnData { | ||
export interface TxnInfo { | ||
from: string | ||
@@ -233,2 +235,3 @@ to: string | ||
id: number | ||
uid: string | ||
type: EventLogType | ||
@@ -242,9 +245,18 @@ blockNumber: number | ||
txnIndex: number | ||
txnData: TxnData | ||
txnLogIndex: number | ||
logDataType: EventLogDataType | ||
ts: string | ||
logData: string | ||
txnInfo?: TxnInfo | ||
rawLog?: { [key: string]: any } | ||
event?: EventDecoded | ||
} | ||
export interface EventDecoded { | ||
topicHash: string | ||
eventSig: string | ||
types: Array<string> | ||
names: Array<string> | ||
values: Array<string> | ||
} | ||
export interface TokenBalance { | ||
@@ -254,3 +266,3 @@ contractType: ContractType | ||
accountAddress: string | ||
tokenID: string | ||
tokenID?: string | ||
balance: string | ||
@@ -353,3 +365,2 @@ blockHash: string | ||
event?: string | ||
topicHash?: string | ||
} | ||
@@ -400,3 +411,5 @@ | ||
filters: EventFilter | ||
name: string | ||
updatedAt: string | ||
active: boolean | ||
} | ||
@@ -406,8 +419,12 @@ | ||
events?: Array<string> | ||
topicHashes?: Array<string> | ||
contractAddresses?: Array<string> | ||
accounts?: Array<string> | ||
tokenIDs?: Array<string> | ||
accounts?: Array<string> | ||
} | ||
export interface TokenBalanceFilter { | ||
contractAddress: string | ||
sinceBlockNumber: number | ||
} | ||
export interface MetadataOptions { | ||
@@ -464,4 +481,23 @@ verifiedOnly?: boolean | ||
): Promise<RemoveWebhookListenerReturn> | ||
toggleWebhookListener( | ||
args: ToggleWebhookListenerArgs, | ||
headers?: object, | ||
signal?: AbortSignal | ||
): Promise<ToggleWebhookListenerReturn> | ||
pauseAllWebhookListeners( | ||
args: PauseAllWebhookListenersArgs, | ||
headers?: object, | ||
signal?: AbortSignal | ||
): Promise<PauseAllWebhookListenersReturn> | ||
resumeAllWebhookListeners( | ||
args: ResumeAllWebhookListenersArgs, | ||
headers?: object, | ||
signal?: AbortSignal | ||
): Promise<ResumeAllWebhookListenersReturn> | ||
subscribeReceipts(args: SubscribeReceiptsArgs, options: WebrpcStreamOptions<SubscribeReceiptsReturn>): Promise<void> | ||
subscribeEvents(args: SubscribeEventsArgs, options: WebrpcStreamOptions<SubscribeEventsReturn>): Promise<void> | ||
subscribeBalanceUpdates( | ||
args: SubscribeBalanceUpdatesArgs, | ||
options: WebrpcStreamOptions<SubscribeBalanceUpdatesReturn> | ||
): Promise<void> | ||
} | ||
@@ -644,2 +680,24 @@ | ||
} | ||
export interface ToggleWebhookListenerArgs { | ||
id: number | ||
projectId?: number | ||
} | ||
export interface ToggleWebhookListenerReturn { | ||
webhookListener: WebhookListener | ||
} | ||
export interface PauseAllWebhookListenersArgs { | ||
projectId?: number | ||
} | ||
export interface PauseAllWebhookListenersReturn { | ||
status: boolean | ||
} | ||
export interface ResumeAllWebhookListenersArgs { | ||
projectId?: number | ||
} | ||
export interface ResumeAllWebhookListenersReturn { | ||
status: boolean | ||
} | ||
export interface SubscribeReceiptsArgs { | ||
@@ -659,3 +717,10 @@ filter: TransactionFilter | ||
} | ||
export interface SubscribeBalanceUpdatesArgs { | ||
contractAddress: string | ||
} | ||
export interface SubscribeBalanceUpdatesReturn { | ||
balance: TokenBalance | ||
} | ||
// | ||
@@ -1023,2 +1088,59 @@ // Client | ||
toggleWebhookListener = ( | ||
args: ToggleWebhookListenerArgs, | ||
headers?: object, | ||
signal?: AbortSignal | ||
): Promise<ToggleWebhookListenerReturn> => { | ||
return this.fetch(this.url('ToggleWebhookListener'), createHTTPRequest(args, headers, signal)).then( | ||
res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
webhookListener: <WebhookListener>_data.webhookListener | ||
} | ||
}) | ||
}, | ||
error => { | ||
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) | ||
} | ||
) | ||
} | ||
pauseAllWebhookListeners = ( | ||
args: PauseAllWebhookListenersArgs, | ||
headers?: object, | ||
signal?: AbortSignal | ||
): Promise<PauseAllWebhookListenersReturn> => { | ||
return this.fetch(this.url('PauseAllWebhookListeners'), createHTTPRequest(args, headers, signal)).then( | ||
res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: <boolean>_data.status | ||
} | ||
}) | ||
}, | ||
error => { | ||
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) | ||
} | ||
) | ||
} | ||
resumeAllWebhookListeners = ( | ||
args: ResumeAllWebhookListenersArgs, | ||
headers?: object, | ||
signal?: AbortSignal | ||
): Promise<ResumeAllWebhookListenersReturn> => { | ||
return this.fetch(this.url('ResumeAllWebhookListeners'), createHTTPRequest(args, headers, signal)).then( | ||
res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: <boolean>_data.status | ||
} | ||
}) | ||
}, | ||
error => { | ||
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) | ||
} | ||
) | ||
} | ||
subscribeReceipts = (args: SubscribeReceiptsArgs, options: WebrpcStreamOptions<SubscribeReceiptsReturn>): Promise<void> => { | ||
@@ -1048,2 +1170,17 @@ const _fetch = () => | ||
} | ||
subscribeBalanceUpdates = ( | ||
args: SubscribeBalanceUpdatesArgs, | ||
options: WebrpcStreamOptions<SubscribeBalanceUpdatesReturn> | ||
): Promise<void> => { | ||
const _fetch = () => | ||
this.fetch(this.url('SubscribeBalanceUpdates'), createHTTPRequest(args, options.headers, options.signal)).then( | ||
async res => { | ||
await sseResponse(res, options, _fetch) | ||
}, | ||
error => { | ||
options.onError(error, _fetch) | ||
} | ||
) | ||
return _fetch() | ||
} | ||
} | ||
@@ -1514,2 +1651,15 @@ | ||
export class ResourceExhaustedError extends WebrpcError { | ||
constructor( | ||
name: string = 'ResourceExhausted', | ||
code: number = 2004, | ||
message: string = 'Resource exhausted', | ||
status: number = 0, | ||
cause?: string | ||
) { | ||
super(name, code, message, status, cause) | ||
Object.setPrototypeOf(this, ResourceExhaustedError.prototype) | ||
} | ||
} | ||
export class NotFoundError extends WebrpcError { | ||
@@ -1576,2 +1726,3 @@ constructor( | ||
QueryFailed = 'QueryFailed', | ||
ResourceExhausted = 'ResourceExhausted', | ||
NotFound = 'NotFound', | ||
@@ -1604,2 +1755,3 @@ ProjectNotFound = 'ProjectNotFound', | ||
[2003]: QueryFailedError, | ||
[2004]: ResourceExhaustedError, | ||
[3000]: NotFoundError, | ||
@@ -1606,0 +1758,0 @@ [3002]: ProjectNotFoundError, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
180602
4980