@0xsequence/indexer
Advanced tools
Comparing version 0.0.0-2021827201516 to 0.0.0-20220418165517
@@ -30,3 +30,3 @@ 'use strict'; | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 af55f42a2e22fda0417a49eaefd8db7c5ad28a6a | ||
// sequence-indexer v0.4.0 d44c148ecd843665eba71e66908382e569d8821a | ||
// -- | ||
@@ -40,3 +40,3 @@ // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript | ||
const WebRPCSchemaHash = "af55f42a2e22fda0417a49eaefd8db7c5ad28a6a"; // | ||
const WebRPCSchemaHash = "d44c148ecd843665eba71e66908382e569d8821a"; // | ||
// Types | ||
@@ -53,2 +53,5 @@ // | ||
ContractType["SEQUENCE_WALLET"] = "SEQUENCE_WALLET"; | ||
ContractType["ERC20_BRIDGE"] = "ERC20_BRIDGE"; | ||
ContractType["ERC721_BRIDGE"] = "ERC721_BRIDGE"; | ||
ContractType["ERC1155_BRIDGE"] = "ERC1155_BRIDGE"; | ||
})(exports.ContractType || (exports.ContractType = {})); | ||
@@ -160,2 +163,13 @@ | ||
return { | ||
contractType: _data.contractType, | ||
tokenIDs: _data.tokenIDs | ||
}; | ||
}); | ||
}); | ||
}; | ||
this.getTokenSuppliesMap = (args, headers) => { | ||
return this.fetch(this.url('GetTokenSuppliesMap'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
supplies: _data.supplies | ||
@@ -231,6 +245,14 @@ }; | ||
exports.SequenceIndexerServices = void 0; | ||
(function (SequenceIndexerServices) { | ||
SequenceIndexerServices["MAINNET"] = "https://mainnet-indexer.sequence.app"; | ||
SequenceIndexerServices["POLYGON"] = "https://polygon-indexer.sequence.app"; | ||
SequenceIndexerServices["RINKEBY"] = "https://rinkeby-indexer.sequence.app"; | ||
SequenceIndexerServices["POLYGON_MUMBAI"] = "https://mumbai-indexer.sequence.app"; | ||
})(exports.SequenceIndexerServices || (exports.SequenceIndexerServices = {})); | ||
class SequenceIndexerClient extends Indexer { | ||
constructor(hostname, chainId, jwtAuth) { | ||
super(hostname, fetch__default['default']); | ||
this.chainId = chainId; | ||
constructor(hostname, jwtAuth) { | ||
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch__default["default"]); | ||
this.jwtAuth = jwtAuth; | ||
@@ -249,3 +271,3 @@ | ||
init.headers = _extends({}, init.headers, headers); | ||
return fetch__default['default'](input, init); | ||
return fetch__default["default"](input, init); | ||
}; | ||
@@ -252,0 +274,0 @@ |
@@ -30,3 +30,3 @@ 'use strict'; | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 af55f42a2e22fda0417a49eaefd8db7c5ad28a6a | ||
// sequence-indexer v0.4.0 d44c148ecd843665eba71e66908382e569d8821a | ||
// -- | ||
@@ -40,3 +40,3 @@ // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript | ||
const WebRPCSchemaHash = "af55f42a2e22fda0417a49eaefd8db7c5ad28a6a"; // | ||
const WebRPCSchemaHash = "d44c148ecd843665eba71e66908382e569d8821a"; // | ||
// Types | ||
@@ -53,2 +53,5 @@ // | ||
ContractType["SEQUENCE_WALLET"] = "SEQUENCE_WALLET"; | ||
ContractType["ERC20_BRIDGE"] = "ERC20_BRIDGE"; | ||
ContractType["ERC721_BRIDGE"] = "ERC721_BRIDGE"; | ||
ContractType["ERC1155_BRIDGE"] = "ERC1155_BRIDGE"; | ||
})(exports.ContractType || (exports.ContractType = {})); | ||
@@ -160,2 +163,13 @@ | ||
return { | ||
contractType: _data.contractType, | ||
tokenIDs: _data.tokenIDs | ||
}; | ||
}); | ||
}); | ||
}; | ||
this.getTokenSuppliesMap = (args, headers) => { | ||
return this.fetch(this.url('GetTokenSuppliesMap'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
supplies: _data.supplies | ||
@@ -231,6 +245,14 @@ }; | ||
exports.SequenceIndexerServices = void 0; | ||
(function (SequenceIndexerServices) { | ||
SequenceIndexerServices["MAINNET"] = "https://mainnet-indexer.sequence.app"; | ||
SequenceIndexerServices["POLYGON"] = "https://polygon-indexer.sequence.app"; | ||
SequenceIndexerServices["RINKEBY"] = "https://rinkeby-indexer.sequence.app"; | ||
SequenceIndexerServices["POLYGON_MUMBAI"] = "https://mumbai-indexer.sequence.app"; | ||
})(exports.SequenceIndexerServices || (exports.SequenceIndexerServices = {})); | ||
class SequenceIndexerClient extends Indexer { | ||
constructor(hostname, chainId, jwtAuth) { | ||
super(hostname, fetch__default['default']); | ||
this.chainId = chainId; | ||
constructor(hostname, jwtAuth) { | ||
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch__default["default"]); | ||
this.jwtAuth = jwtAuth; | ||
@@ -249,3 +271,3 @@ | ||
init.headers = _extends({}, init.headers, headers); | ||
return fetch__default['default'](input, init); | ||
return fetch__default["default"](input, init); | ||
}; | ||
@@ -252,0 +274,0 @@ |
@@ -22,3 +22,3 @@ import fetch from 'cross-fetch'; | ||
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 af55f42a2e22fda0417a49eaefd8db7c5ad28a6a | ||
// sequence-indexer v0.4.0 d44c148ecd843665eba71e66908382e569d8821a | ||
// -- | ||
@@ -32,3 +32,3 @@ // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript | ||
const WebRPCSchemaHash = "af55f42a2e22fda0417a49eaefd8db7c5ad28a6a"; // | ||
const WebRPCSchemaHash = "d44c148ecd843665eba71e66908382e569d8821a"; // | ||
// Types | ||
@@ -45,2 +45,5 @@ // | ||
ContractType["SEQUENCE_WALLET"] = "SEQUENCE_WALLET"; | ||
ContractType["ERC20_BRIDGE"] = "ERC20_BRIDGE"; | ||
ContractType["ERC721_BRIDGE"] = "ERC721_BRIDGE"; | ||
ContractType["ERC1155_BRIDGE"] = "ERC1155_BRIDGE"; | ||
})(ContractType || (ContractType = {})); | ||
@@ -152,2 +155,13 @@ | ||
return { | ||
contractType: _data.contractType, | ||
tokenIDs: _data.tokenIDs | ||
}; | ||
}); | ||
}); | ||
}; | ||
this.getTokenSuppliesMap = (args, headers) => { | ||
return this.fetch(this.url('GetTokenSuppliesMap'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
supplies: _data.supplies | ||
@@ -223,6 +237,14 @@ }; | ||
let SequenceIndexerServices; | ||
(function (SequenceIndexerServices) { | ||
SequenceIndexerServices["MAINNET"] = "https://mainnet-indexer.sequence.app"; | ||
SequenceIndexerServices["POLYGON"] = "https://polygon-indexer.sequence.app"; | ||
SequenceIndexerServices["RINKEBY"] = "https://rinkeby-indexer.sequence.app"; | ||
SequenceIndexerServices["POLYGON_MUMBAI"] = "https://mumbai-indexer.sequence.app"; | ||
})(SequenceIndexerServices || (SequenceIndexerServices = {})); | ||
class SequenceIndexerClient extends Indexer { | ||
constructor(hostname, chainId, jwtAuth) { | ||
super(hostname, fetch); | ||
this.chainId = chainId; | ||
constructor(hostname, jwtAuth) { | ||
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch); | ||
this.jwtAuth = jwtAuth; | ||
@@ -249,2 +271,2 @@ | ||
export { ContractType, EventLogDataType, EventLogType, Indexer, SequenceIndexerClient, SortOrder, TxnTransferType, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion }; | ||
export { ContractType, EventLogDataType, EventLogType, Indexer, SequenceIndexerClient, SequenceIndexerServices, SortOrder, TxnTransferType, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion }; |
export * from './indexer.gen'; | ||
import { Indexer as BaseSequenceIndexer } from './indexer.gen'; | ||
export declare enum SequenceIndexerServices { | ||
MAINNET = "https://mainnet-indexer.sequence.app", | ||
POLYGON = "https://polygon-indexer.sequence.app", | ||
RINKEBY = "https://rinkeby-indexer.sequence.app", | ||
POLYGON_MUMBAI = "https://mumbai-indexer.sequence.app" | ||
} | ||
export declare class SequenceIndexerClient extends BaseSequenceIndexer { | ||
readonly chainId: number; | ||
jwtAuth?: string | undefined; | ||
constructor(hostname: string, chainId: number, jwtAuth?: string | undefined); | ||
constructor(hostname: string, jwtAuth?: string | undefined); | ||
_fetch: (input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>; | ||
} |
export declare const WebRPCVersion = "v1"; | ||
export declare const WebRPCSchemaVersion = "v0.4.0"; | ||
export declare const WebRPCSchemaHash = "af55f42a2e22fda0417a49eaefd8db7c5ad28a6a"; | ||
export declare const WebRPCSchemaHash = "d44c148ecd843665eba71e66908382e569d8821a"; | ||
export declare enum ContractType { | ||
@@ -9,3 +9,6 @@ UNKNOWN = "UNKNOWN", | ||
ERC1155 = "ERC1155", | ||
SEQUENCE_WALLET = "SEQUENCE_WALLET" | ||
SEQUENCE_WALLET = "SEQUENCE_WALLET", | ||
ERC20_BRIDGE = "ERC20_BRIDGE", | ||
ERC721_BRIDGE = "ERC721_BRIDGE", | ||
ERC1155_BRIDGE = "ERC1155_BRIDGE" | ||
} | ||
@@ -58,2 +61,3 @@ export declare enum EventLogType { | ||
export interface IndexState { | ||
chainId: string; | ||
lastBlockNum: number; | ||
@@ -84,2 +88,3 @@ } | ||
blockNumber: number; | ||
updateId: number; | ||
chainId: number; | ||
@@ -101,2 +106,7 @@ } | ||
} | ||
export interface TokenSupply { | ||
tokenID: string; | ||
supply: string; | ||
chainId: number; | ||
} | ||
export interface Transaction { | ||
@@ -121,2 +131,4 @@ txnHash: string; | ||
export interface TransactionHistoryFilter { | ||
accountAddress?: string; | ||
contractAddress?: string; | ||
accountAddresses?: Array<string>; | ||
@@ -132,3 +144,3 @@ contractAddresses?: Array<string>; | ||
page?: number; | ||
totalRecords?: number; | ||
more?: boolean; | ||
column?: string; | ||
@@ -151,2 +163,3 @@ before?: any; | ||
getTokenSupplies(args: GetTokenSuppliesArgs, headers?: object): Promise<GetTokenSuppliesReturn>; | ||
getTokenSuppliesMap(args: GetTokenSuppliesMapArgs, headers?: object): Promise<GetTokenSuppliesMapReturn>; | ||
getBalanceUpdates(args: GetBalanceUpdatesArgs, headers?: object): Promise<GetBalanceUpdatesReturn>; | ||
@@ -189,2 +202,9 @@ getTransactionHistory(args: GetTransactionHistoryArgs, headers?: object): Promise<GetTransactionHistoryReturn>; | ||
export interface GetTokenSuppliesArgs { | ||
contractAddress: string; | ||
} | ||
export interface GetTokenSuppliesReturn { | ||
contractType: ContractType; | ||
tokenIDs: Array<TokenSupply>; | ||
} | ||
export interface GetTokenSuppliesMapArgs { | ||
tokenMap: { | ||
@@ -194,5 +214,5 @@ [key: string]: Array<string>; | ||
} | ||
export interface GetTokenSuppliesReturn { | ||
export interface GetTokenSuppliesMapReturn { | ||
supplies: { | ||
[key: string]: Array<TokenBalance>; | ||
[key: string]: Array<TokenSupply>; | ||
}; | ||
@@ -202,3 +222,3 @@ } | ||
contractAddress: string; | ||
lastBalanceID: number; | ||
lastUpdateID: number; | ||
page?: Page; | ||
@@ -231,2 +251,3 @@ } | ||
getTokenSupplies: (args: GetTokenSuppliesArgs, headers?: object | undefined) => Promise<GetTokenSuppliesReturn>; | ||
getTokenSuppliesMap: (args: GetTokenSuppliesMapArgs, headers?: object | undefined) => Promise<GetTokenSuppliesMapReturn>; | ||
getBalanceUpdates: (args: GetBalanceUpdatesArgs, headers?: object | undefined) => Promise<GetBalanceUpdatesReturn>; | ||
@@ -233,0 +254,0 @@ getTransactionHistory: (args: GetTransactionHistoryArgs, headers?: object | undefined) => Promise<GetTransactionHistoryReturn>; |
{ | ||
"name": "@0xsequence/indexer", | ||
"version": "0.0.0-2021827201516", | ||
"version": "0.0.0-20220418165517", | ||
"description": "indexer sub-package for Sequence", | ||
@@ -16,3 +16,3 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/indexer", | ||
"dependencies": { | ||
"cross-fetch": "^3.1.4" | ||
"cross-fetch": "^3.1.5" | ||
}, | ||
@@ -19,0 +19,0 @@ "peerDependencies": {}, |
@@ -7,5 +7,13 @@ export * from './indexer.gen' | ||
export enum SequenceIndexerServices { | ||
MAINNET = 'https://mainnet-indexer.sequence.app', | ||
POLYGON = 'https://polygon-indexer.sequence.app', | ||
RINKEBY = 'https://rinkeby-indexer.sequence.app', | ||
POLYGON_MUMBAI = 'https://mumbai-indexer.sequence.app' | ||
} | ||
export class SequenceIndexerClient extends BaseSequenceIndexer { | ||
constructor(hostname: string, readonly chainId: number, public jwtAuth?: string) { | ||
super(hostname, fetch) | ||
constructor(hostname: string, public jwtAuth?: string) { | ||
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch) | ||
this.fetch = this._fetch | ||
@@ -12,0 +20,0 @@ } |
/* eslint-disable */ | ||
// sequence-indexer v0.4.0 af55f42a2e22fda0417a49eaefd8db7c5ad28a6a | ||
// sequence-indexer v0.4.0 d44c148ecd843665eba71e66908382e569d8821a | ||
// -- | ||
@@ -14,3 +14,3 @@ // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript | ||
// Schema hash generated from your RIDL schema | ||
export const WebRPCSchemaHash = "af55f42a2e22fda0417a49eaefd8db7c5ad28a6a" | ||
export const WebRPCSchemaHash = "d44c148ecd843665eba71e66908382e569d8821a" | ||
@@ -26,3 +26,6 @@ | ||
ERC1155 = 'ERC1155', | ||
SEQUENCE_WALLET = 'SEQUENCE_WALLET' | ||
SEQUENCE_WALLET = 'SEQUENCE_WALLET', | ||
ERC20_BRIDGE = 'ERC20_BRIDGE', | ||
ERC721_BRIDGE = 'ERC721_BRIDGE', | ||
ERC1155_BRIDGE = 'ERC1155_BRIDGE' | ||
} | ||
@@ -84,2 +87,3 @@ | ||
export interface IndexState { | ||
chainId: string | ||
lastBlockNum: number | ||
@@ -113,2 +117,3 @@ } | ||
blockNumber: number | ||
updateId: number | ||
chainId: number | ||
@@ -132,2 +137,8 @@ } | ||
export interface TokenSupply { | ||
tokenID: string | ||
supply: string | ||
chainId: number | ||
} | ||
export interface Transaction { | ||
@@ -154,2 +165,4 @@ txnHash: string | ||
export interface TransactionHistoryFilter { | ||
accountAddress?: string | ||
contractAddress?: string | ||
accountAddresses?: Array<string> | ||
@@ -166,3 +179,3 @@ contractAddresses?: Array<string> | ||
page?: number | ||
totalRecords?: number | ||
more?: boolean | ||
column?: string | ||
@@ -187,2 +200,3 @@ before?: any | ||
getTokenSupplies(args: GetTokenSuppliesArgs, headers?: object): Promise<GetTokenSuppliesReturn> | ||
getTokenSuppliesMap(args: GetTokenSuppliesMapArgs, headers?: object): Promise<GetTokenSuppliesMapReturn> | ||
getBalanceUpdates(args: GetBalanceUpdatesArgs, headers?: object): Promise<GetBalanceUpdatesReturn> | ||
@@ -232,11 +246,19 @@ getTransactionHistory(args: GetTransactionHistoryArgs, headers?: object): Promise<GetTransactionHistoryReturn> | ||
export interface GetTokenSuppliesArgs { | ||
tokenMap: {[key: string]: Array<string>} | ||
contractAddress: string | ||
} | ||
export interface GetTokenSuppliesReturn { | ||
supplies: {[key: string]: Array<TokenBalance>} | ||
contractType: ContractType | ||
tokenIDs: Array<TokenSupply> | ||
} | ||
export interface GetTokenSuppliesMapArgs { | ||
tokenMap: {[key: string]: Array<string>} | ||
} | ||
export interface GetTokenSuppliesMapReturn { | ||
supplies: {[key: string]: Array<TokenSupply>} | ||
} | ||
export interface GetBalanceUpdatesArgs { | ||
contractAddress: string | ||
lastBalanceID: number | ||
lastUpdateID: number | ||
page?: Page | ||
@@ -360,3 +382,4 @@ } | ||
return { | ||
supplies: <{[key: string]: Array<TokenBalance>}>(_data.supplies) | ||
contractType: <ContractType>(_data.contractType), | ||
tokenIDs: <Array<TokenSupply>>(_data.tokenIDs) | ||
} | ||
@@ -367,2 +390,14 @@ }) | ||
getTokenSuppliesMap = (args: GetTokenSuppliesMapArgs, headers?: object): Promise<GetTokenSuppliesMapReturn> => { | ||
return this.fetch( | ||
this.url('GetTokenSuppliesMap'), | ||
createHTTPRequest(args, headers)).then((res) => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
supplies: <{[key: string]: Array<TokenSupply>}>(_data.supplies) | ||
} | ||
}) | ||
}) | ||
} | ||
getBalanceUpdates = (args: GetBalanceUpdatesArgs, headers?: object): Promise<GetBalanceUpdatesReturn> => { | ||
@@ -369,0 +404,0 @@ return this.fetch( |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
43860
1365
7
11
Updatedcross-fetch@^3.1.5