@0xsequence/indexer
Advanced tools
Comparing version 0.0.0-20240709173026 to 0.0.0-20240711134535
@@ -21,3 +21,3 @@ 'use strict'; | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 604761d36d9ef082fa97d028f8315ccdedf19838 | ||
// sequence-indexer v0.4.0 d33d29bc84a4439a42a4e1533035bc80c4ea226e | ||
// -- | ||
@@ -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 = '604761d36d9ef082fa97d028f8315ccdedf19838'; | ||
const WebRPCSchemaHash = 'd33d29bc84a4439a42a4e1533035bc80c4ea226e'; | ||
@@ -369,41 +369,2 @@ // | ||
}; | ||
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) => { | ||
@@ -425,10 +386,2 @@ 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; | ||
@@ -746,8 +699,2 @@ 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 { | ||
@@ -793,3 +740,2 @@ constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) { | ||
errors["QueryFailed"] = "QueryFailed"; | ||
errors["ResourceExhausted"] = "ResourceExhausted"; | ||
errors["NotFound"] = "NotFound"; | ||
@@ -822,3 +768,2 @@ errors["ProjectNotFound"] = "ProjectNotFound"; | ||
[2003]: QueryFailedError, | ||
[2004]: ResourceExhaustedError, | ||
[3000]: NotFoundError, | ||
@@ -870,3 +815,2 @@ [3002]: ProjectNotFoundError, | ||
exports.RequestConflictError = RequestConflictError; | ||
exports.ResourceExhaustedError = ResourceExhaustedError; | ||
exports.SequenceIndexer = SequenceIndexer; | ||
@@ -873,0 +817,0 @@ exports.SessionExpiredError = SessionExpiredError; |
@@ -21,3 +21,3 @@ 'use strict'; | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 604761d36d9ef082fa97d028f8315ccdedf19838 | ||
// sequence-indexer v0.4.0 d33d29bc84a4439a42a4e1533035bc80c4ea226e | ||
// -- | ||
@@ -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 = '604761d36d9ef082fa97d028f8315ccdedf19838'; | ||
const WebRPCSchemaHash = 'd33d29bc84a4439a42a4e1533035bc80c4ea226e'; | ||
@@ -369,41 +369,2 @@ // | ||
}; | ||
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) => { | ||
@@ -425,10 +386,2 @@ 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; | ||
@@ -746,8 +699,2 @@ 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 { | ||
@@ -793,3 +740,2 @@ constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) { | ||
errors["QueryFailed"] = "QueryFailed"; | ||
errors["ResourceExhausted"] = "ResourceExhausted"; | ||
errors["NotFound"] = "NotFound"; | ||
@@ -822,3 +768,2 @@ errors["ProjectNotFound"] = "ProjectNotFound"; | ||
[2003]: QueryFailedError, | ||
[2004]: ResourceExhaustedError, | ||
[3000]: NotFoundError, | ||
@@ -870,3 +815,2 @@ [3002]: ProjectNotFoundError, | ||
exports.RequestConflictError = RequestConflictError; | ||
exports.ResourceExhaustedError = ResourceExhaustedError; | ||
exports.SequenceIndexer = SequenceIndexer; | ||
@@ -873,0 +817,0 @@ exports.SessionExpiredError = SessionExpiredError; |
@@ -17,3 +17,3 @@ function _extends() { | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 604761d36d9ef082fa97d028f8315ccdedf19838 | ||
// sequence-indexer v0.4.0 d33d29bc84a4439a42a4e1533035bc80c4ea226e | ||
// -- | ||
@@ -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 = '604761d36d9ef082fa97d028f8315ccdedf19838'; | ||
const WebRPCSchemaHash = 'd33d29bc84a4439a42a4e1533035bc80c4ea226e'; | ||
@@ -365,41 +365,2 @@ // | ||
}; | ||
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) => { | ||
@@ -421,10 +382,2 @@ 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; | ||
@@ -742,8 +695,2 @@ 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 { | ||
@@ -789,3 +736,2 @@ constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) { | ||
errors["QueryFailed"] = "QueryFailed"; | ||
errors["ResourceExhausted"] = "ResourceExhausted"; | ||
errors["NotFound"] = "NotFound"; | ||
@@ -818,3 +764,2 @@ errors["ProjectNotFound"] = "ProjectNotFound"; | ||
[2003]: QueryFailedError, | ||
[2004]: ResourceExhaustedError, | ||
[3000]: NotFoundError, | ||
@@ -852,2 +797,2 @@ [3002]: ProjectNotFoundError, | ||
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 { 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 declare const WebRPCVersion = "v1"; | ||
export declare const WebRPCSchemaVersion = "v0.4.0"; | ||
export declare const WebRPCSchemaHash = "604761d36d9ef082fa97d028f8315ccdedf19838"; | ||
export declare const WebRPCSchemaHash = "d33d29bc84a4439a42a4e1533035bc80c4ea226e"; | ||
export interface ContractInfo { | ||
@@ -26,3 +26,2 @@ chainId: number; | ||
verifiedBy: string; | ||
featured: boolean; | ||
} | ||
@@ -53,3 +52,3 @@ export interface TokenMetadata { | ||
collectionId: number; | ||
tokenId?: string; | ||
tokenId: string; | ||
url?: string; | ||
@@ -139,3 +138,2 @@ metadataField: string; | ||
running: boolean; | ||
runnables: any; | ||
cgoEnabled: boolean; | ||
@@ -215,3 +213,3 @@ quotaControlEnabled: boolean; | ||
accountAddress: string; | ||
tokenID?: string; | ||
tokenID: string; | ||
balance: string; | ||
@@ -349,5 +347,3 @@ blockHash: string; | ||
filters: EventFilter; | ||
name: string; | ||
updatedAt: string; | ||
active: boolean; | ||
} | ||
@@ -361,6 +357,2 @@ export interface EventFilter { | ||
} | ||
export interface TokenBalanceFilter { | ||
contractAddress: string; | ||
sinceBlockNumber: number; | ||
} | ||
export interface MetadataOptions { | ||
@@ -392,8 +384,4 @@ 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>; | ||
} | ||
@@ -564,21 +552,2 @@ 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 { | ||
@@ -596,8 +565,2 @@ filter: TransactionFilter; | ||
} | ||
export interface SubscribeBalanceUpdatesArgs { | ||
contractAddress: string; | ||
} | ||
export interface SubscribeBalanceUpdatesReturn { | ||
balance: TokenBalance; | ||
} | ||
export declare class Indexer implements Indexer { | ||
@@ -629,8 +592,4 @@ 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>; | ||
} | ||
@@ -711,5 +670,2 @@ 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 { | ||
@@ -746,3 +702,2 @@ constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); | ||
QueryFailed = "QueryFailed", | ||
ResourceExhausted = "ResourceExhausted", | ||
NotFound = "NotFound", | ||
@@ -749,0 +704,0 @@ ProjectNotFound = "ProjectNotFound", |
{ | ||
"name": "@0xsequence/indexer", | ||
"version": "0.0.0-20240709173026", | ||
"version": "0.0.0-20240711134535", | ||
"description": "indexer sub-package for Sequence", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/indexer", |
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 604761d36d9ef082fa97d028f8315ccdedf19838 | ||
// sequence-indexer v0.4.0 d33d29bc84a4439a42a4e1533035bc80c4ea226e | ||
// -- | ||
@@ -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 = '604761d36d9ef082fa97d028f8315ccdedf19838' | ||
export const WebRPCSchemaHash = 'd33d29bc84a4439a42a4e1533035bc80c4ea226e' | ||
@@ -45,3 +45,2 @@ // | ||
verifiedBy: string | ||
featured: boolean | ||
} | ||
@@ -70,3 +69,3 @@ | ||
collectionId: number | ||
tokenId?: string | ||
tokenId: string | ||
url?: string | ||
@@ -168,3 +167,2 @@ metadataField: string | ||
running: boolean | ||
runnables: any | ||
cgoEnabled: boolean | ||
@@ -252,3 +250,3 @@ quotaControlEnabled: boolean | ||
accountAddress: string | ||
tokenID?: string | ||
tokenID: string | ||
balance: string | ||
@@ -397,5 +395,3 @@ blockHash: string | ||
filters: EventFilter | ||
name: string | ||
updatedAt: string | ||
active: boolean | ||
} | ||
@@ -411,7 +407,2 @@ | ||
export interface TokenBalanceFilter { | ||
contractAddress: string | ||
sinceBlockNumber: number | ||
} | ||
export interface MetadataOptions { | ||
@@ -468,23 +459,4 @@ 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> | ||
} | ||
@@ -667,24 +639,2 @@ | ||
} | ||
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 { | ||
@@ -704,10 +654,3 @@ filter: TransactionFilter | ||
} | ||
export interface SubscribeBalanceUpdatesArgs { | ||
contractAddress: string | ||
} | ||
export interface SubscribeBalanceUpdatesReturn { | ||
balance: TokenBalance | ||
} | ||
// | ||
@@ -1075,59 +1018,2 @@ // 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> => { | ||
@@ -1157,17 +1043,2 @@ 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() | ||
} | ||
} | ||
@@ -1638,15 +1509,2 @@ | ||
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 { | ||
@@ -1713,3 +1571,2 @@ constructor( | ||
QueryFailed = 'QueryFailed', | ||
ResourceExhausted = 'ResourceExhausted', | ||
NotFound = 'NotFound', | ||
@@ -1742,3 +1599,2 @@ ProjectNotFound = 'ProjectNotFound', | ||
[2003]: QueryFailedError, | ||
[2004]: ResourceExhaustedError, | ||
[3000]: NotFoundError, | ||
@@ -1745,0 +1601,0 @@ [3002]: ProjectNotFoundError, |
167732
4617