Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@0xsequence/indexer

Package Overview
Dependencies
Maintainers
6
Versions
428
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsequence/indexer - npm Package Compare versions

Comparing version 2.0.14 to 2.0.15

210

dist/0xsequence-indexer.cjs.dev.js

@@ -21,5 +21,5 @@ 'use strict';

/* eslint-disable */
// sequence-indexer v0.4.0 9accea267e7db3d66f40d5e0f27db92eb5a29e2f
// sequence-indexer v0.4.0 cae735346d8e5c3dce48dce9f85116989b6beffd
// --
// Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
//

@@ -35,3 +35,3 @@ // webrpc-gen -schema=indexer.ridl -target=typescript -client -out=./clients/indexer.gen.ts

// Schema hash generated from your RIDL schema
const WebRPCSchemaHash = '9accea267e7db3d66f40d5e0f27db92eb5a29e2f';
const WebRPCSchemaHash = 'cae735346d8e5c3dce48dce9f85116989b6beffd';

@@ -96,2 +96,8 @@ //

}({});
let ContractVerificationStatus = /*#__PURE__*/function (ContractVerificationStatus) {
ContractVerificationStatus["VERIFIED"] = "VERIFIED";
ContractVerificationStatus["UNVERIFIED"] = "UNVERIFIED";
ContractVerificationStatus["ALL"] = "ALL";
return ContractVerificationStatus;
}({});
//

@@ -170,2 +176,57 @@ // Client

};
this.getNativeTokenBalance = (args, headers, signal) => {
return this.fetch(this.url('GetNativeTokenBalance'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
balance: _data.balance
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesSummary = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesSummary'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesDetails = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesDetails'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesByContract = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesByContract'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalances = (args, headers, signal) => {

@@ -434,3 +495,3 @@ return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers, signal)).then(res => {

};
this.hostname = hostname;
this.hostname = hostname.replace(/\/*$/, '');
this.fetch = (input, init) => fetch(input, init);

@@ -471,85 +532,75 @@ }

const timeout = (10 + 1) * 1000;
let intervalId;
try {
intervalId = setInterval(() => {
if (Date.now() - lastReadTime > timeout) {
throw WebrpcStreamLostError.new({
cause: 'Stream timed out'
let timeoutError = false;
const intervalId = setInterval(() => {
if (Date.now() - lastReadTime > timeout) {
timeoutError = true;
clearInterval(intervalId);
reader.releaseLock();
}
}, timeout);
while (true) {
let value;
let done;
try {
;
({
value,
done
} = await reader.read());
if (timeoutError) throw new Error('Timeout, no data or heartbeat received');
lastReadTime = Date.now();
buffer += decoder.decode(value, {
stream: true
});
} catch (error) {
let message = '';
if (error instanceof Error) {
message = error.message;
}
if (error instanceof DOMException && error.name === 'AbortError') {
onError(WebrpcRequestFailedError.new({
message: 'AbortError',
cause: `AbortError: ${message}`
}), () => {
throw new Error('Abort signal cannot be used to reconnect');
});
} else {
onError(WebrpcStreamLostError.new({
cause: `reader.read(): ${message}`
}), retryFetch);
}
}, timeout);
while (true) {
let value;
let done;
return;
}
let lines = buffer.split('\n');
for (let i = 0; i < lines.length - 1; i++) {
if (lines[i].length == 0) {
continue;
}
let data;
try {
;
({
value,
done
} = await reader.read());
lastReadTime = Date.now();
buffer += decoder.decode(value, {
stream: true
});
data = JSON.parse(lines[i]);
if (data.hasOwnProperty('webrpcError')) {
const error = data.webrpcError;
const code = typeof error.code === 'number' ? error.code : 0;
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
return;
}
} catch (error) {
let message = '';
if (error instanceof Error) {
message = error.message;
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
throw error;
}
if (error instanceof DOMException && error.name === 'AbortError') {
onError(WebrpcRequestFailedError.new({
message: 'AbortError',
cause: `AbortError: ${message}`
}), () => {
throw new Error('Abort signal cannot be used to reconnect');
});
} else {
onError(WebrpcStreamLostError.new({
cause: `reader.read(): ${message}`
}), retryFetch);
}
return;
onError(WebrpcBadResponseError.new({
status: res.status,
// @ts-ignore
cause: `JSON.parse(): ${error.message}`
}), retryFetch);
}
let lines = buffer.split('\n');
for (let i = 0; i < lines.length - 1; i++) {
if (lines[i].length == 0) {
continue;
}
let data;
try {
data = JSON.parse(lines[i]);
if (data.hasOwnProperty('webrpcError')) {
const error = data.webrpcError;
const code = typeof error.code === 'number' ? error.code : 0;
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
return;
}
} catch (error) {
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
throw error;
}
onError(WebrpcBadResponseError.new({
status: res.status,
// @ts-ignore
cause: `JSON.parse(): ${error.message}`
}), retryFetch);
}
onMessage(data);
}
if (!done) {
buffer = lines[lines.length - 1];
continue;
}
onClose && onClose();
return;
onMessage(data);
}
} catch (error) {
// @ts-ignore
if (error instanceof WebrpcStreamLostError) {
onError(error, retryFetch);
} else {
throw error;
if (!done) {
buffer = lines[lines.length - 1];
continue;
}
} finally {
clearInterval(intervalId);
onClose && onClose();
return;
}

@@ -857,2 +908,3 @@ };

exports.ContractType = ContractType;
exports.ContractVerificationStatus = ContractVerificationStatus;
exports.EventLogDataType = EventLogDataType;

@@ -859,0 +911,0 @@ exports.EventLogType = EventLogType;

@@ -21,5 +21,5 @@ 'use strict';

/* eslint-disable */
// sequence-indexer v0.4.0 9accea267e7db3d66f40d5e0f27db92eb5a29e2f
// sequence-indexer v0.4.0 cae735346d8e5c3dce48dce9f85116989b6beffd
// --
// Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
//

@@ -35,3 +35,3 @@ // webrpc-gen -schema=indexer.ridl -target=typescript -client -out=./clients/indexer.gen.ts

// Schema hash generated from your RIDL schema
const WebRPCSchemaHash = '9accea267e7db3d66f40d5e0f27db92eb5a29e2f';
const WebRPCSchemaHash = 'cae735346d8e5c3dce48dce9f85116989b6beffd';

@@ -96,2 +96,8 @@ //

}({});
let ContractVerificationStatus = /*#__PURE__*/function (ContractVerificationStatus) {
ContractVerificationStatus["VERIFIED"] = "VERIFIED";
ContractVerificationStatus["UNVERIFIED"] = "UNVERIFIED";
ContractVerificationStatus["ALL"] = "ALL";
return ContractVerificationStatus;
}({});
//

@@ -170,2 +176,57 @@ // Client

};
this.getNativeTokenBalance = (args, headers, signal) => {
return this.fetch(this.url('GetNativeTokenBalance'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
balance: _data.balance
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesSummary = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesSummary'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesDetails = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesDetails'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesByContract = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesByContract'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalances = (args, headers, signal) => {

@@ -434,3 +495,3 @@ return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers, signal)).then(res => {

};
this.hostname = hostname;
this.hostname = hostname.replace(/\/*$/, '');
this.fetch = (input, init) => fetch(input, init);

@@ -471,85 +532,75 @@ }

const timeout = (10 + 1) * 1000;
let intervalId;
try {
intervalId = setInterval(() => {
if (Date.now() - lastReadTime > timeout) {
throw WebrpcStreamLostError.new({
cause: 'Stream timed out'
let timeoutError = false;
const intervalId = setInterval(() => {
if (Date.now() - lastReadTime > timeout) {
timeoutError = true;
clearInterval(intervalId);
reader.releaseLock();
}
}, timeout);
while (true) {
let value;
let done;
try {
;
({
value,
done
} = await reader.read());
if (timeoutError) throw new Error('Timeout, no data or heartbeat received');
lastReadTime = Date.now();
buffer += decoder.decode(value, {
stream: true
});
} catch (error) {
let message = '';
if (error instanceof Error) {
message = error.message;
}
if (error instanceof DOMException && error.name === 'AbortError') {
onError(WebrpcRequestFailedError.new({
message: 'AbortError',
cause: `AbortError: ${message}`
}), () => {
throw new Error('Abort signal cannot be used to reconnect');
});
} else {
onError(WebrpcStreamLostError.new({
cause: `reader.read(): ${message}`
}), retryFetch);
}
}, timeout);
while (true) {
let value;
let done;
return;
}
let lines = buffer.split('\n');
for (let i = 0; i < lines.length - 1; i++) {
if (lines[i].length == 0) {
continue;
}
let data;
try {
;
({
value,
done
} = await reader.read());
lastReadTime = Date.now();
buffer += decoder.decode(value, {
stream: true
});
data = JSON.parse(lines[i]);
if (data.hasOwnProperty('webrpcError')) {
const error = data.webrpcError;
const code = typeof error.code === 'number' ? error.code : 0;
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
return;
}
} catch (error) {
let message = '';
if (error instanceof Error) {
message = error.message;
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
throw error;
}
if (error instanceof DOMException && error.name === 'AbortError') {
onError(WebrpcRequestFailedError.new({
message: 'AbortError',
cause: `AbortError: ${message}`
}), () => {
throw new Error('Abort signal cannot be used to reconnect');
});
} else {
onError(WebrpcStreamLostError.new({
cause: `reader.read(): ${message}`
}), retryFetch);
}
return;
onError(WebrpcBadResponseError.new({
status: res.status,
// @ts-ignore
cause: `JSON.parse(): ${error.message}`
}), retryFetch);
}
let lines = buffer.split('\n');
for (let i = 0; i < lines.length - 1; i++) {
if (lines[i].length == 0) {
continue;
}
let data;
try {
data = JSON.parse(lines[i]);
if (data.hasOwnProperty('webrpcError')) {
const error = data.webrpcError;
const code = typeof error.code === 'number' ? error.code : 0;
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
return;
}
} catch (error) {
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
throw error;
}
onError(WebrpcBadResponseError.new({
status: res.status,
// @ts-ignore
cause: `JSON.parse(): ${error.message}`
}), retryFetch);
}
onMessage(data);
}
if (!done) {
buffer = lines[lines.length - 1];
continue;
}
onClose && onClose();
return;
onMessage(data);
}
} catch (error) {
// @ts-ignore
if (error instanceof WebrpcStreamLostError) {
onError(error, retryFetch);
} else {
throw error;
if (!done) {
buffer = lines[lines.length - 1];
continue;
}
} finally {
clearInterval(intervalId);
onClose && onClose();
return;
}

@@ -857,2 +908,3 @@ };

exports.ContractType = ContractType;
exports.ContractVerificationStatus = ContractVerificationStatus;
exports.EventLogDataType = EventLogDataType;

@@ -859,0 +911,0 @@ exports.EventLogType = EventLogType;

@@ -17,5 +17,5 @@ function _extends() {

/* eslint-disable */
// sequence-indexer v0.4.0 9accea267e7db3d66f40d5e0f27db92eb5a29e2f
// sequence-indexer v0.4.0 cae735346d8e5c3dce48dce9f85116989b6beffd
// --
// Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
//

@@ -31,3 +31,3 @@ // webrpc-gen -schema=indexer.ridl -target=typescript -client -out=./clients/indexer.gen.ts

// Schema hash generated from your RIDL schema
const WebRPCSchemaHash = '9accea267e7db3d66f40d5e0f27db92eb5a29e2f';
const WebRPCSchemaHash = 'cae735346d8e5c3dce48dce9f85116989b6beffd';

@@ -92,2 +92,8 @@ //

}({});
let ContractVerificationStatus = /*#__PURE__*/function (ContractVerificationStatus) {
ContractVerificationStatus["VERIFIED"] = "VERIFIED";
ContractVerificationStatus["UNVERIFIED"] = "UNVERIFIED";
ContractVerificationStatus["ALL"] = "ALL";
return ContractVerificationStatus;
}({});
//

@@ -166,2 +172,57 @@ // Client

};
this.getNativeTokenBalance = (args, headers, signal) => {
return this.fetch(this.url('GetNativeTokenBalance'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
balance: _data.balance
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesSummary = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesSummary'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesDetails = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesDetails'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalancesByContract = (args, headers, signal) => {
return this.fetch(this.url('GetTokenBalancesByContract'), createHTTPRequest(args, headers, signal)).then(res => {
return buildResponse(res).then(_data => {
return {
page: _data.page,
balances: _data.balances
};
});
}, error => {
throw WebrpcRequestFailedError.new({
cause: `fetch(): ${error.message || ''}`
});
});
};
this.getTokenBalances = (args, headers, signal) => {

@@ -430,3 +491,3 @@ return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers, signal)).then(res => {

};
this.hostname = hostname;
this.hostname = hostname.replace(/\/*$/, '');
this.fetch = (input, init) => fetch(input, init);

@@ -467,85 +528,75 @@ }

const timeout = (10 + 1) * 1000;
let intervalId;
try {
intervalId = setInterval(() => {
if (Date.now() - lastReadTime > timeout) {
throw WebrpcStreamLostError.new({
cause: 'Stream timed out'
let timeoutError = false;
const intervalId = setInterval(() => {
if (Date.now() - lastReadTime > timeout) {
timeoutError = true;
clearInterval(intervalId);
reader.releaseLock();
}
}, timeout);
while (true) {
let value;
let done;
try {
;
({
value,
done
} = await reader.read());
if (timeoutError) throw new Error('Timeout, no data or heartbeat received');
lastReadTime = Date.now();
buffer += decoder.decode(value, {
stream: true
});
} catch (error) {
let message = '';
if (error instanceof Error) {
message = error.message;
}
if (error instanceof DOMException && error.name === 'AbortError') {
onError(WebrpcRequestFailedError.new({
message: 'AbortError',
cause: `AbortError: ${message}`
}), () => {
throw new Error('Abort signal cannot be used to reconnect');
});
} else {
onError(WebrpcStreamLostError.new({
cause: `reader.read(): ${message}`
}), retryFetch);
}
}, timeout);
while (true) {
let value;
let done;
return;
}
let lines = buffer.split('\n');
for (let i = 0; i < lines.length - 1; i++) {
if (lines[i].length == 0) {
continue;
}
let data;
try {
;
({
value,
done
} = await reader.read());
lastReadTime = Date.now();
buffer += decoder.decode(value, {
stream: true
});
data = JSON.parse(lines[i]);
if (data.hasOwnProperty('webrpcError')) {
const error = data.webrpcError;
const code = typeof error.code === 'number' ? error.code : 0;
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
return;
}
} catch (error) {
let message = '';
if (error instanceof Error) {
message = error.message;
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
throw error;
}
if (error instanceof DOMException && error.name === 'AbortError') {
onError(WebrpcRequestFailedError.new({
message: 'AbortError',
cause: `AbortError: ${message}`
}), () => {
throw new Error('Abort signal cannot be used to reconnect');
});
} else {
onError(WebrpcStreamLostError.new({
cause: `reader.read(): ${message}`
}), retryFetch);
}
return;
onError(WebrpcBadResponseError.new({
status: res.status,
// @ts-ignore
cause: `JSON.parse(): ${error.message}`
}), retryFetch);
}
let lines = buffer.split('\n');
for (let i = 0; i < lines.length - 1; i++) {
if (lines[i].length == 0) {
continue;
}
let data;
try {
data = JSON.parse(lines[i]);
if (data.hasOwnProperty('webrpcError')) {
const error = data.webrpcError;
const code = typeof error.code === 'number' ? error.code : 0;
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch);
return;
}
} catch (error) {
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
throw error;
}
onError(WebrpcBadResponseError.new({
status: res.status,
// @ts-ignore
cause: `JSON.parse(): ${error.message}`
}), retryFetch);
}
onMessage(data);
}
if (!done) {
buffer = lines[lines.length - 1];
continue;
}
onClose && onClose();
return;
onMessage(data);
}
} catch (error) {
// @ts-ignore
if (error instanceof WebrpcStreamLostError) {
onError(error, retryFetch);
} else {
throw error;
if (!done) {
buffer = lines[lines.length - 1];
continue;
}
} finally {
clearInterval(intervalId);
onClose && onClose();
return;
}

@@ -851,2 +902,2 @@ };

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, ContractVerificationStatus, 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 = "9accea267e7db3d66f40d5e0f27db92eb5a29e2f";
export declare const WebRPCSchemaHash = "cae735346d8e5c3dce48dce9f85116989b6beffd";
export interface ContractInfo {

@@ -108,2 +108,7 @@ chainId: number;

}
export declare enum ContractVerificationStatus {
VERIFIED = "VERIFIED",
UNVERIFIED = "UNVERIFIED",
ALL = "ALL"
}
export interface Version {

@@ -179,2 +184,6 @@ webrpcVersion: string;

}
export interface NativeTokenBalance {
accountAddress: string;
balance: string;
}
export interface IndexState {

@@ -230,2 +239,4 @@ chainId: string;

chainId: number;
uniqueCollectibles: string;
isSummary: boolean;
contractInfo?: ContractInfo;

@@ -246,9 +257,15 @@ tokenMetadata?: TokenMetadata;

createdBy: string;
blockNumber: number;
orderbookContractAddress: string;
createdAt: number;
orderbookContractAddress: string;
}
export interface OrderbookOrderFilter {
isListing?: boolean;
userAddresses?: Array<string>;
tokenIds: Array<string>;
excludeUserAddresses?: Array<string>;
afterBlockNumber: number;
afterCreatedAt: number;
beforeExpiry: number;
userAddress?: string;
tokenIds: Array<string>;
excludeUserAddress?: string;

@@ -378,2 +395,13 @@ }

}
export interface TokenBalancesFilter {
accountAddresses: Array<string>;
contractStatus: ContractVerificationStatus;
contractWhitelist: Array<string>;
contractBlacklist: Array<string>;
}
export interface TokenBalancesByContractFilter {
contractAddresses: Array<string>;
accountAddresses: Array<string>;
contractStatus: ContractVerificationStatus;
}
export interface Indexer {

@@ -385,2 +413,6 @@ ping(headers?: object, signal?: AbortSignal): Promise<PingReturn>;

getEtherBalance(args: GetEtherBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetEtherBalanceReturn>;
getNativeTokenBalance(args: GetNativeTokenBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetNativeTokenBalanceReturn>;
getTokenBalancesSummary(args: GetTokenBalancesSummaryArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenBalancesSummaryReturn>;
getTokenBalancesDetails(args: GetTokenBalancesDetailsArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenBalancesDetailsReturn>;
getTokenBalancesByContract(args: GetTokenBalancesByContractArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenBalancesByContractReturn>;
getTokenBalances(args: GetTokenBalancesArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenBalancesReturn>;

@@ -434,2 +466,35 @@ getTokenSupplies(args: GetTokenSuppliesArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenSuppliesReturn>;

}
export interface GetNativeTokenBalanceArgs {
accountAddress?: string;
}
export interface GetNativeTokenBalanceReturn {
balance: NativeTokenBalance;
}
export interface GetTokenBalancesSummaryArgs {
filter: TokenBalancesFilter;
omitMetadata?: boolean;
page?: Page;
}
export interface GetTokenBalancesSummaryReturn {
page: Page;
balances: Array<TokenBalance>;
}
export interface GetTokenBalancesDetailsArgs {
filter: TokenBalancesFilter;
omitMetadata?: boolean;
page?: Page;
}
export interface GetTokenBalancesDetailsReturn {
page: Page;
balances: Array<TokenBalance>;
}
export interface GetTokenBalancesByContractArgs {
filter: TokenBalancesByContractFilter;
omitMetadata?: boolean;
page?: Page;
}
export interface GetTokenBalancesByContractReturn {
page: Page;
balances: Array<TokenBalance>;
}
export interface GetTokenBalancesArgs {

@@ -510,5 +575,8 @@ accountAddress?: string;

currencyAddresses: Array<string>;
filter: OrderbookOrderFilter;
orderStatuses: Array<OrderStatus>;
filters: Array<OrderbookOrderFilter>;
orderStatuses: Array<OrderStatus>;
beforeExpiryTimestamp: number;
blockNumberAfter: number;
createdAtAfter: number;
}

@@ -622,2 +690,6 @@ export interface GetOrderbookOrdersReturn {

getEtherBalance: (args: GetEtherBalanceArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<GetEtherBalanceReturn>;
getNativeTokenBalance: (args: GetNativeTokenBalanceArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<GetNativeTokenBalanceReturn>;
getTokenBalancesSummary: (args: GetTokenBalancesSummaryArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<GetTokenBalancesSummaryReturn>;
getTokenBalancesDetails: (args: GetTokenBalancesDetailsArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<GetTokenBalancesDetailsReturn>;
getTokenBalancesByContract: (args: GetTokenBalancesByContractArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<GetTokenBalancesByContractReturn>;
getTokenBalances: (args: GetTokenBalancesArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<GetTokenBalancesReturn>;

@@ -624,0 +696,0 @@ getTokenSupplies: (args: GetTokenSuppliesArgs, headers?: object | undefined, signal?: AbortSignal | undefined) => Promise<GetTokenSuppliesReturn>;

{
"name": "@0xsequence/indexer",
"version": "2.0.14",
"version": "2.0.15",
"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 9accea267e7db3d66f40d5e0f27db92eb5a29e2f
// sequence-indexer v0.4.0 cae735346d8e5c3dce48dce9f85116989b6beffd
// --
// Code generated by webrpc-gen@v0.18.6 with typescript generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
//

@@ -15,3 +15,3 @@ // webrpc-gen -schema=indexer.ridl -target=typescript -client -out=./clients/indexer.gen.ts

// Schema hash generated from your RIDL schema
export const WebRPCSchemaHash = '9accea267e7db3d66f40d5e0f27db92eb5a29e2f'
export const WebRPCSchemaHash = 'cae735346d8e5c3dce48dce9f85116989b6beffd'

@@ -134,2 +134,8 @@ //

export enum ContractVerificationStatus {
VERIFIED = 'VERIFIED',
UNVERIFIED = 'UNVERIFIED',
ALL = 'ALL'
}
export interface Version {

@@ -212,2 +218,7 @@ webrpcVersion: string

export interface NativeTokenBalance {
accountAddress: string
balance: string
}
export interface IndexState {

@@ -266,2 +277,4 @@ chainId: string

chainId: number
uniqueCollectibles: string
isSummary: boolean
contractInfo?: ContractInfo

@@ -283,4 +296,5 @@ tokenMetadata?: TokenMetadata

createdBy: string
blockNumber: number
orderbookContractAddress: string
createdAt: number
orderbookContractAddress: string
}

@@ -290,4 +304,9 @@

isListing?: boolean
userAddresses?: Array<string>
tokenIds: Array<string>
excludeUserAddresses?: Array<string>
afterBlockNumber: number
afterCreatedAt: number
beforeExpiry: number
userAddress?: string
tokenIds: Array<string>
excludeUserAddress?: string

@@ -430,2 +449,15 @@ }

export interface TokenBalancesFilter {
accountAddresses: Array<string>
contractStatus: ContractVerificationStatus
contractWhitelist: Array<string>
contractBlacklist: Array<string>
}
export interface TokenBalancesByContractFilter {
contractAddresses: Array<string>
accountAddresses: Array<string>
contractStatus: ContractVerificationStatus
}
export interface Indexer {

@@ -437,2 +469,22 @@ ping(headers?: object, signal?: AbortSignal): Promise<PingReturn>

getEtherBalance(args: GetEtherBalanceArgs, headers?: object, signal?: AbortSignal): Promise<GetEtherBalanceReturn>
getNativeTokenBalance(
args: GetNativeTokenBalanceArgs,
headers?: object,
signal?: AbortSignal
): Promise<GetNativeTokenBalanceReturn>
getTokenBalancesSummary(
args: GetTokenBalancesSummaryArgs,
headers?: object,
signal?: AbortSignal
): Promise<GetTokenBalancesSummaryReturn>
getTokenBalancesDetails(
args: GetTokenBalancesDetailsArgs,
headers?: object,
signal?: AbortSignal
): Promise<GetTokenBalancesDetailsReturn>
getTokenBalancesByContract(
args: GetTokenBalancesByContractArgs,
headers?: object,
signal?: AbortSignal
): Promise<GetTokenBalancesByContractReturn>
getTokenBalances(args: GetTokenBalancesArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenBalancesReturn>

@@ -527,2 +579,39 @@ getTokenSupplies(args: GetTokenSuppliesArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenSuppliesReturn>

}
export interface GetNativeTokenBalanceArgs {
accountAddress?: string
}
export interface GetNativeTokenBalanceReturn {
balance: NativeTokenBalance
}
export interface GetTokenBalancesSummaryArgs {
filter: TokenBalancesFilter
omitMetadata?: boolean
page?: Page
}
export interface GetTokenBalancesSummaryReturn {
page: Page
balances: Array<TokenBalance>
}
export interface GetTokenBalancesDetailsArgs {
filter: TokenBalancesFilter
omitMetadata?: boolean
page?: Page
}
export interface GetTokenBalancesDetailsReturn {
page: Page
balances: Array<TokenBalance>
}
export interface GetTokenBalancesByContractArgs {
filter: TokenBalancesByContractFilter
omitMetadata?: boolean
page?: Page
}
export interface GetTokenBalancesByContractReturn {
page: Page
balances: Array<TokenBalance>
}
export interface GetTokenBalancesArgs {

@@ -605,5 +694,8 @@ accountAddress?: string

currencyAddresses: Array<string>
filter: OrderbookOrderFilter
orderStatuses: Array<OrderStatus>
filters: Array<OrderbookOrderFilter>
orderStatuses: Array<OrderStatus>
beforeExpiryTimestamp: number
blockNumberAfter: number
createdAtAfter: number
}

@@ -730,3 +822,3 @@

constructor(hostname: string, fetch: Fetch) {
this.hostname = hostname
this.hostname = hostname.replace(/\/*$/, '')
this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init)

@@ -814,2 +906,81 @@ }

getNativeTokenBalance = (
args: GetNativeTokenBalanceArgs,
headers?: object,
signal?: AbortSignal
): Promise<GetNativeTokenBalanceReturn> => {
return this.fetch(this.url('GetNativeTokenBalance'), createHTTPRequest(args, headers, signal)).then(
res => {
return buildResponse(res).then(_data => {
return {
balance: <NativeTokenBalance>_data.balance
}
})
},
error => {
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
}
)
}
getTokenBalancesSummary = (
args: GetTokenBalancesSummaryArgs,
headers?: object,
signal?: AbortSignal
): Promise<GetTokenBalancesSummaryReturn> => {
return this.fetch(this.url('GetTokenBalancesSummary'), createHTTPRequest(args, headers, signal)).then(
res => {
return buildResponse(res).then(_data => {
return {
page: <Page>_data.page,
balances: <Array<TokenBalance>>_data.balances
}
})
},
error => {
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
}
)
}
getTokenBalancesDetails = (
args: GetTokenBalancesDetailsArgs,
headers?: object,
signal?: AbortSignal
): Promise<GetTokenBalancesDetailsReturn> => {
return this.fetch(this.url('GetTokenBalancesDetails'), createHTTPRequest(args, headers, signal)).then(
res => {
return buildResponse(res).then(_data => {
return {
page: <Page>_data.page,
balances: <Array<TokenBalance>>_data.balances
}
})
},
error => {
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
}
)
}
getTokenBalancesByContract = (
args: GetTokenBalancesByContractArgs,
headers?: object,
signal?: AbortSignal
): Promise<GetTokenBalancesByContractReturn> => {
return this.fetch(this.url('GetTokenBalancesByContract'), createHTTPRequest(args, headers, signal)).then(
res => {
return buildResponse(res).then(_data => {
return {
page: <Page>_data.page,
balances: <Array<TokenBalance>>_data.balances
}
})
},
error => {
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
}
)
}
getTokenBalances = (args: GetTokenBalancesArgs, headers?: object, signal?: AbortSignal): Promise<GetTokenBalancesReturn> => {

@@ -1214,92 +1385,83 @@ return this.fetch(this.url('GetTokenBalances'), createHTTPRequest(args, headers, signal)).then(

const timeout = (10 + 1) * 1000
let intervalId: any
let timeoutError = false
const intervalId = setInterval(() => {
if (Date.now() - lastReadTime > timeout) {
timeoutError = true
clearInterval(intervalId)
reader.releaseLock()
}
}, timeout)
try {
intervalId = setInterval(() => {
if (Date.now() - lastReadTime > timeout) {
throw WebrpcStreamLostError.new({ cause: 'Stream timed out' })
while (true) {
let value
let done
try {
;({ value, done } = await reader.read())
if (timeoutError) throw new Error('Timeout, no data or heartbeat received')
lastReadTime = Date.now()
buffer += decoder.decode(value, { stream: true })
} catch (error) {
let message = ''
if (error instanceof Error) {
message = error.message
}
}, timeout)
while (true) {
let value
let done
try {
;({ value, done } = await reader.read())
lastReadTime = Date.now()
buffer += decoder.decode(value, { stream: true })
} catch (error) {
let message = ''
if (error instanceof Error) {
message = error.message
}
if (error instanceof DOMException && error.name === 'AbortError') {
onError(
WebrpcRequestFailedError.new({
message: 'AbortError',
cause: `AbortError: ${message}`
}),
() => {
throw new Error('Abort signal cannot be used to reconnect')
}
)
} else {
onError(
WebrpcStreamLostError.new({
cause: `reader.read(): ${message}`
}),
retryFetch
)
}
return
}
if (error instanceof DOMException && error.name === 'AbortError') {
onError(
WebrpcRequestFailedError.new({
message: 'AbortError',
cause: `AbortError: ${message}`
}),
() => {
throw new Error('Abort signal cannot be used to reconnect')
}
)
} else {
onError(
WebrpcStreamLostError.new({
cause: `reader.read(): ${message}`
}),
retryFetch
)
}
return
let lines = buffer.split('\n')
for (let i = 0; i < lines.length - 1; i++) {
if (lines[i].length == 0) {
continue
}
let lines = buffer.split('\n')
for (let i = 0; i < lines.length - 1; i++) {
if (lines[i].length == 0) {
continue
let data: any
try {
data = JSON.parse(lines[i])
if (data.hasOwnProperty('webrpcError')) {
const error = data.webrpcError
const code: number = typeof error.code === 'number' ? error.code : 0
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch)
return
}
let data: any
try {
data = JSON.parse(lines[i])
if (data.hasOwnProperty('webrpcError')) {
const error = data.webrpcError
const code: number = typeof error.code === 'number' ? error.code : 0
onError((webrpcErrorByCode[code] || WebrpcError).new(error), retryFetch)
return
}
} catch (error) {
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
throw error
}
onError(
WebrpcBadResponseError.new({
status: res.status,
// @ts-ignore
cause: `JSON.parse(): ${error.message}`
}),
retryFetch
)
} catch (error) {
if (error instanceof Error && error.message === 'Abort signal cannot be used to reconnect') {
throw error
}
onMessage(data)
onError(
WebrpcBadResponseError.new({
status: res.status,
// @ts-ignore
cause: `JSON.parse(): ${error.message}`
}),
retryFetch
)
}
onMessage(data)
}
if (!done) {
buffer = lines[lines.length - 1]
continue
}
if (!done) {
buffer = lines[lines.length - 1]
continue
}
onClose && onClose()
return
}
} catch (error) {
// @ts-ignore
if (error instanceof WebrpcStreamLostError) {
onError(error, retryFetch)
} else {
throw error
}
} finally {
clearInterval(intervalId)
onClose && onClose()
return
}

@@ -1306,0 +1468,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc