@0xsequence/indexer 1.2.9 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -244,68 +244,38 @@ const buildResponse = res => {
|
|
|
244
244
|
});
|
|
245
245
|
};
|
|
246
246
|
|
|
247
|
-
// TODO: rename to SequenceIndexerNetworks
|
|
248
|
-
let SequenceIndexerServices = /*#__PURE__*/function (SequenceIndexerServices) {
|
|
249
|
-
SequenceIndexerServices["MAINNET"] = "https://mainnet-indexer.sequence.app";
|
|
250
|
-
SequenceIndexerServices["POLYGON"] = "https://polygon-indexer.sequence.app";
|
|
251
|
-
SequenceIndexerServices["POLYGON_MUMBAI"] = "https://mumbai-indexer.sequence.app";
|
|
252
|
-
SequenceIndexerServices["POLYGON_ZKEVM"] = "https://polygon-zkevm-indexer.sequence.app";
|
|
253
|
-
SequenceIndexerServices["ARBITRUM"] = "https://arbitrum-indexer.sequence.app";
|
|
254
|
-
SequenceIndexerServices["ARBITRUM_NOVA"] = "https://arbitrum-nova-indexer.sequence.app";
|
|
255
|
-
SequenceIndexerServices["OPTIMISM"] = "https://optimism-indexer.sequence.app";
|
|
256
|
-
SequenceIndexerServices["AVALANCHE"] = "https://avalanche-indexer.sequence.app";
|
|
257
|
-
SequenceIndexerServices["GNOSIS"] = "https://gnosis-indexer.sequence.app";
|
|
258
|
-
SequenceIndexerServices["BSC"] = "https://bsc-indexer.sequence.app";
|
|
259
|
-
SequenceIndexerServices["BSC_TESTNET"] = "https://bsc-testnet-indexer.sequence.app";
|
|
260
|
-
SequenceIndexerServices["GOERLI"] = "https://goerli-indexer.sequence.app";
|
|
261
|
-
return SequenceIndexerServices;
|
|
262
|
-
}({});
|
|
263
247
|
const fetch = typeof global === 'object' ? global.fetch : window.fetch;
|
|
264
|
-
class
|
|
265
|
-
constructor(hostname,
|
|
248
|
+
class SequenceIndexer extends Indexer {
|
|
249
|
+
constructor(hostname, _projectAccessKey, _jwtAuth) {
|
|
266
250
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
267
251
|
this._fetch = (input, init) => {
|
|
268
|
-
// automatically include jwt auth header to requests
|
|
252
|
+
// automatically include jwt and access key auth header to requests
|
|
269
253
|
// if its been set on the api client
|
|
270
254
|
const headers = {};
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
accessKey
|
|
274
|
-
} = this.authorization || {};
|
|
255
|
+
const jwtAuth = this.jwtAuth;
|
|
256
|
+
const projectAccessKey = this.projectAccessKey;
|
|
275
257
|
if (jwtAuth && jwtAuth.length > 0) {
|
|
276
258
|
headers['Authorization'] = `BEARER ${jwtAuth}`;
|
|
277
259
|
}
|
|
278
|
-
if (
|
|
279
|
-
headers['X-Access-Key'] =
|
|
260
|
+
if (projectAccessKey && projectAccessKey.length > 0) {
|
|
261
|
+
headers['X-Access-Key'] = projectAccessKey;
|
|
280
262
|
}
|
|
281
263
|
|
|
282
264
|
// before the request is made
|
|
283
265
|
init.headers = _extends({}, init.headers, headers);
|
|
284
266
|
return fetch(input, init);
|
|
285
267
|
};
|
|
286
|
-
this.
|
|
268
|
+
this.projectAccessKey = _projectAccessKey;
|
|
269
|
+
this.jwtAuth = _jwtAuth;
|
|
287
270
|
this.fetch = this._fetch;
|
|
288
271
|
}
|
|
289
272
|
}
|
|
290
273
|
|
|
291
|
-
// const SequenceIndexerServices: { [key: string]: string } = {}
|
|
292
|
-
|
|
293
|
-
// {
|
|
294
|
-
// [ ...mainnetNetworks, ...testnetNetworks ].forEach(n => {
|
|
295
|
-
// if (n.indexerUrl) {
|
|
296
|
-
// SequenceIndexerServices[n.name.toUpperCase()] = n.indexerUrl
|
|
297
|
-
// }
|
|
298
|
-
// })
|
|
299
|
-
// }
|
|
300
|
-
|
|
301
|
-
// export { SequenceIndexerServices }
|
|
302
|
-
|
|
303
274
|
exports.ContractType = ContractType;
|
|
304
275
|
exports.EventLogDataType = EventLogDataType;
|
|
305
276
|
exports.EventLogType = EventLogType;
|
|
306
277
|
exports.Indexer = Indexer;
|
|
307
|
-
exports.
|
|
308
|
-
exports.SequenceIndexerServices = SequenceIndexerServices;
|
|
278
|
+
exports.SequenceIndexer = SequenceIndexer;
|
|
309
279
|
exports.SortOrder = SortOrder;
|
|
310
280
|
exports.TransactionStatus = TransactionStatus;
|
|
311
281
|
exports.TransactionType = TransactionType;
|
|
@@ -244,68 +244,38 @@ const buildResponse = res => {
|
|
|
244
244
|
});
|
|
245
245
|
};
|
|
246
246
|
|
|
247
|
-
// TODO: rename to SequenceIndexerNetworks
|
|
248
|
-
let SequenceIndexerServices = /*#__PURE__*/function (SequenceIndexerServices) {
|
|
249
|
-
SequenceIndexerServices["MAINNET"] = "https://mainnet-indexer.sequence.app";
|
|
250
|
-
SequenceIndexerServices["POLYGON"] = "https://polygon-indexer.sequence.app";
|
|
251
|
-
SequenceIndexerServices["POLYGON_MUMBAI"] = "https://mumbai-indexer.sequence.app";
|
|
252
|
-
SequenceIndexerServices["POLYGON_ZKEVM"] = "https://polygon-zkevm-indexer.sequence.app";
|
|
253
|
-
SequenceIndexerServices["ARBITRUM"] = "https://arbitrum-indexer.sequence.app";
|
|
254
|
-
SequenceIndexerServices["ARBITRUM_NOVA"] = "https://arbitrum-nova-indexer.sequence.app";
|
|
255
|
-
SequenceIndexerServices["OPTIMISM"] = "https://optimism-indexer.sequence.app";
|
|
256
|
-
SequenceIndexerServices["AVALANCHE"] = "https://avalanche-indexer.sequence.app";
|
|
257
|
-
SequenceIndexerServices["GNOSIS"] = "https://gnosis-indexer.sequence.app";
|
|
258
|
-
SequenceIndexerServices["BSC"] = "https://bsc-indexer.sequence.app";
|
|
259
|
-
SequenceIndexerServices["BSC_TESTNET"] = "https://bsc-testnet-indexer.sequence.app";
|
|
260
|
-
SequenceIndexerServices["GOERLI"] = "https://goerli-indexer.sequence.app";
|
|
261
|
-
return SequenceIndexerServices;
|
|
262
|
-
}({});
|
|
263
247
|
const fetch = typeof global === 'object' ? global.fetch : window.fetch;
|
|
264
|
-
class
|
|
265
|
-
constructor(hostname,
|
|
248
|
+
class SequenceIndexer extends Indexer {
|
|
249
|
+
constructor(hostname, _projectAccessKey, _jwtAuth) {
|
|
266
250
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
267
251
|
this._fetch = (input, init) => {
|
|
268
|
-
// automatically include jwt auth header to requests
|
|
252
|
+
// automatically include jwt and access key auth header to requests
|
|
269
253
|
// if its been set on the api client
|
|
270
254
|
const headers = {};
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
accessKey
|
|
274
|
-
} = this.authorization || {};
|
|
255
|
+
const jwtAuth = this.jwtAuth;
|
|
256
|
+
const projectAccessKey = this.projectAccessKey;
|
|
275
257
|
if (jwtAuth && jwtAuth.length > 0) {
|
|
276
258
|
headers['Authorization'] = `BEARER ${jwtAuth}`;
|
|
277
259
|
}
|
|
278
|
-
if (
|
|
279
|
-
headers['X-Access-Key'] =
|
|
260
|
+
if (projectAccessKey && projectAccessKey.length > 0) {
|
|
261
|
+
headers['X-Access-Key'] = projectAccessKey;
|
|
280
262
|
}
|
|
281
263
|
|
|
282
264
|
// before the request is made
|
|
283
265
|
init.headers = _extends({}, init.headers, headers);
|
|
284
266
|
return fetch(input, init);
|
|
285
267
|
};
|
|
286
|
-
this.
|
|
268
|
+
this.projectAccessKey = _projectAccessKey;
|
|
269
|
+
this.jwtAuth = _jwtAuth;
|
|
287
270
|
this.fetch = this._fetch;
|
|
288
271
|
}
|
|
289
272
|
}
|
|
290
273
|
|
|
291
|
-
// const SequenceIndexerServices: { [key: string]: string } = {}
|
|
292
|
-
|
|
293
|
-
// {
|
|
294
|
-
// [ ...mainnetNetworks, ...testnetNetworks ].forEach(n => {
|
|
295
|
-
// if (n.indexerUrl) {
|
|
296
|
-
// SequenceIndexerServices[n.name.toUpperCase()] = n.indexerUrl
|
|
297
|
-
// }
|
|
298
|
-
// })
|
|
299
|
-
// }
|
|
300
|
-
|
|
301
|
-
// export { SequenceIndexerServices }
|
|
302
|
-
|
|
303
274
|
exports.ContractType = ContractType;
|
|
304
275
|
exports.EventLogDataType = EventLogDataType;
|
|
305
276
|
exports.EventLogType = EventLogType;
|
|
306
277
|
exports.Indexer = Indexer;
|
|
307
|
-
exports.
|
|
308
|
-
exports.SequenceIndexerServices = SequenceIndexerServices;
|
|
278
|
+
exports.SequenceIndexer = SequenceIndexer;
|
|
309
279
|
exports.SortOrder = SortOrder;
|
|
310
280
|
exports.TransactionStatus = TransactionStatus;
|
|
311
281
|
exports.TransactionType = TransactionType;
|
|
@@ -240,60 +240,31 @@ const buildResponse = res => {
|
|
|
240
240
|
});
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
// TODO: rename to SequenceIndexerNetworks
|
|
244
|
-
let SequenceIndexerServices = /*#__PURE__*/function (SequenceIndexerServices) {
|
|
245
|
-
SequenceIndexerServices["MAINNET"] = "https://mainnet-indexer.sequence.app";
|
|
246
|
-
SequenceIndexerServices["POLYGON"] = "https://polygon-indexer.sequence.app";
|
|
247
|
-
SequenceIndexerServices["POLYGON_MUMBAI"] = "https://mumbai-indexer.sequence.app";
|
|
248
|
-
SequenceIndexerServices["POLYGON_ZKEVM"] = "https://polygon-zkevm-indexer.sequence.app";
|
|
249
|
-
SequenceIndexerServices["ARBITRUM"] = "https://arbitrum-indexer.sequence.app";
|
|
250
|
-
SequenceIndexerServices["ARBITRUM_NOVA"] = "https://arbitrum-nova-indexer.sequence.app";
|
|
251
|
-
SequenceIndexerServices["OPTIMISM"] = "https://optimism-indexer.sequence.app";
|
|
252
|
-
SequenceIndexerServices["AVALANCHE"] = "https://avalanche-indexer.sequence.app";
|
|
253
|
-
SequenceIndexerServices["GNOSIS"] = "https://gnosis-indexer.sequence.app";
|
|
254
|
-
SequenceIndexerServices["BSC"] = "https://bsc-indexer.sequence.app";
|
|
255
|
-
SequenceIndexerServices["BSC_TESTNET"] = "https://bsc-testnet-indexer.sequence.app";
|
|
256
|
-
SequenceIndexerServices["GOERLI"] = "https://goerli-indexer.sequence.app";
|
|
257
|
-
return SequenceIndexerServices;
|
|
258
|
-
}({});
|
|
259
243
|
const fetch = typeof global === 'object' ? global.fetch : window.fetch;
|
|
260
|
-
class
|
|
261
|
-
constructor(hostname,
|
|
244
|
+
class SequenceIndexer extends Indexer {
|
|
245
|
+
constructor(hostname, _projectAccessKey, _jwtAuth) {
|
|
262
246
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
263
247
|
this._fetch = (input, init) => {
|
|
264
|
-
// automatically include jwt auth header to requests
|
|
248
|
+
// automatically include jwt and access key auth header to requests
|
|
265
249
|
// if its been set on the api client
|
|
266
250
|
const headers = {};
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
accessKey
|
|
270
|
-
} = this.authorization || {};
|
|
251
|
+
const jwtAuth = this.jwtAuth;
|
|
252
|
+
const projectAccessKey = this.projectAccessKey;
|
|
271
253
|
if (jwtAuth && jwtAuth.length > 0) {
|
|
272
254
|
headers['Authorization'] = `BEARER ${jwtAuth}`;
|
|
273
255
|
}
|
|
274
|
-
if (
|
|
275
|
-
headers['X-Access-Key'] =
|
|
256
|
+
if (projectAccessKey && projectAccessKey.length > 0) {
|
|
257
|
+
headers['X-Access-Key'] = projectAccessKey;
|
|
276
258
|
}
|
|
277
259
|
|
|
278
260
|
// before the request is made
|
|
279
261
|
init.headers = _extends({}, init.headers, headers);
|
|
280
262
|
return fetch(input, init);
|
|
281
263
|
};
|
|
282
|
-
this.
|
|
264
|
+
this.projectAccessKey = _projectAccessKey;
|
|
265
|
+
this.jwtAuth = _jwtAuth;
|
|
283
266
|
this.fetch = this._fetch;
|
|
284
267
|
}
|
|
285
268
|
}
|
|
286
269
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
// {
|
|
290
|
-
// [ ...mainnetNetworks, ...testnetNetworks ].forEach(n => {
|
|
291
|
-
// if (n.indexerUrl) {
|
|
292
|
-
// SequenceIndexerServices[n.name.toUpperCase()] = n.indexerUrl
|
|
293
|
-
// }
|
|
294
|
-
// })
|
|
295
|
-
// }
|
|
296
|
-
|
|
297
|
-
// export { SequenceIndexerServices }
|
|
298
|
-
|
|
299
|
-
export { ContractType, EventLogDataType, EventLogType, Indexer, SequenceIndexerClient, SequenceIndexerServices, SortOrder, TransactionStatus, TransactionType, TxnTransferType, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
|
|
270
|
+
export { ContractType, EventLogDataType, EventLogType, Indexer, SequenceIndexer, SortOrder, TransactionStatus, TransactionType, TxnTransferType, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
|
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
export * from "./indexer.gen.js";
|
|
2
2
|
import { Indexer as IndexerRpc } from "./indexer.gen.js";
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
POLYGON_ZKEVM = "https://polygon-zkevm-indexer.sequence.app",
|
|
8
|
-
ARBITRUM = "https://arbitrum-indexer.sequence.app",
|
|
9
|
-
ARBITRUM_NOVA = "https://arbitrum-nova-indexer.sequence.app",
|
|
10
|
-
OPTIMISM = "https://optimism-indexer.sequence.app",
|
|
11
|
-
AVALANCHE = "https://avalanche-indexer.sequence.app",
|
|
12
|
-
GNOSIS = "https://gnosis-indexer.sequence.app",
|
|
13
|
-
BSC = "https://bsc-indexer.sequence.app",
|
|
14
|
-
BSC_TESTNET = "https://bsc-testnet-indexer.sequence.app",
|
|
15
|
-
GOERLI = "https://goerli-indexer.sequence.app"
|
|
16
|
-
}
|
|
17
|
-
export declare class SequenceIndexerClient extends IndexerRpc {
|
|
18
|
-
authorization?: {
|
|
19
|
-
jwtAuth?: string | undefined;
|
|
20
|
-
accessKey?: string | undefined;
|
|
21
|
-
} | undefined;
|
|
22
|
-
constructor(hostname: string, authorization?: {
|
|
23
|
-
jwtAuth?: string | undefined;
|
|
24
|
-
accessKey?: string | undefined;
|
|
25
|
-
} | undefined);
|
|
3
|
+
export declare class SequenceIndexer extends IndexerRpc {
|
|
4
|
+
projectAccessKey?: string | undefined;
|
|
5
|
+
jwtAuth?: string | undefined;
|
|
6
|
+
constructor(hostname: string, projectAccessKey?: string | undefined, jwtAuth?: string | undefined);
|
|
26
7
|
_fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
27
8
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,55 +2,32 @@ export * from './indexer.gen'
|
|
|
2
2
|
|
|
3
3
|
import { Indexer as IndexerRpc } from './indexer.gen'
|
|
4
4
|
|
|
5
|
-
// TODO: rename to SequenceIndexerNetworks
|
|
6
|
-
export enum SequenceIndexerServices {
|
|
7
|
-
MAINNET = 'https://mainnet-indexer.sequence.app',
|
|
8
|
-
|
|
9
|
-
POLYGON = 'https://polygon-indexer.sequence.app',
|
|
10
|
-
POLYGON_MUMBAI = 'https://mumbai-indexer.sequence.app',
|
|
11
|
-
|
|
12
|
-
POLYGON_ZKEVM = 'https://polygon-zkevm-indexer.sequence.app',
|
|
13
|
-
|
|
14
|
-
ARBITRUM = 'https://arbitrum-indexer.sequence.app',
|
|
15
|
-
ARBITRUM_NOVA = 'https://arbitrum-nova-indexer.sequence.app',
|
|
16
|
-
|
|
17
|
-
OPTIMISM = 'https://optimism-indexer.sequence.app',
|
|
18
|
-
AVALANCHE = 'https://avalanche-indexer.sequence.app',
|
|
19
|
-
GNOSIS = 'https://gnosis-indexer.sequence.app',
|
|
20
|
-
|
|
21
|
-
BSC = 'https://bsc-indexer.sequence.app',
|
|
22
|
-
BSC_TESTNET = 'https://bsc-testnet-indexer.sequence.app',
|
|
23
|
-
|
|
24
|
-
GOERLI = 'https://goerli-indexer.sequence.app'
|
|
25
|
-
}
|
|
26
|
-
|
|
27
5
|
const fetch = typeof global === 'object' ? global.fetch : window.fetch
|
|
28
6
|
|
|
29
|
-
export class
|
|
7
|
+
export class SequenceIndexer extends IndexerRpc {
|
|
30
8
|
constructor(
|
|
31
9
|
hostname: string,
|
|
32
|
-
public
|
|
33
|
-
|
|
34
|
-
accessKey?: string
|
|
35
|
-
}
|
|
10
|
+
public projectAccessKey?: string,
|
|
11
|
+
public jwtAuth?: string
|
|
36
12
|
) {
|
|
37
13
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch)
|
|
38
14
|
this.fetch = this._fetch
|
|
39
15
|
}
|
|
40
16
|
|
|
41
17
|
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
|
|
42
|
-
// automatically include jwt auth header to requests
|
|
18
|
+
// automatically include jwt and access key auth header to requests
|
|
43
19
|
// if its been set on the api client
|
|
44
20
|
const headers: { [key: string]: any } = {}
|
|
45
21
|
|
|
46
|
-
const
|
|
22
|
+
const jwtAuth = this.jwtAuth
|
|
23
|
+
const projectAccessKey = this.projectAccessKey
|
|
47
24
|
|
|
48
25
|
if (jwtAuth && jwtAuth.length > 0) {
|
|
49
26
|
headers['Authorization'] = `BEARER ${jwtAuth}`
|
|
50
27
|
}
|
|
51
28
|
|
|
52
|
-
if (
|
|
53
|
-
headers['X-Access-Key'] =
|
|
29
|
+
if (projectAccessKey && projectAccessKey.length > 0) {
|
|
30
|
+
headers['X-Access-Key'] = projectAccessKey
|
|
54
31
|
}
|
|
55
32
|
|
|
56
33
|
// before the request is made
|
|
@@ -59,15 +36,3 @@ export class SequenceIndexerClient extends IndexerRpc {
|
|
|
59
36
|
return fetch(input, init)
|
|
60
37
|
}
|
|
61
38
|
}
|
|
62
|
-
|
|
63
|
-
// const SequenceIndexerServices: { [key: string]: string } = {}
|
|
64
|
-
|
|
65
|
-
// {
|
|
66
|
-
// [ ...mainnetNetworks, ...testnetNetworks ].forEach(n => {
|
|
67
|
-
// if (n.indexerUrl) {
|
|
68
|
-
// SequenceIndexerServices[n.name.toUpperCase()] = n.indexerUrl
|
|
69
|
-
// }
|
|
70
|
-
// })
|
|
71
|
-
// }
|
|
72
|
-
|
|
73
|
-
// export { SequenceIndexerServices }
|