@lufycz/sushi-data
Advanced tools
Comparing version 2.0.0-canary-21 to 2.0.0-canary-22
@@ -14,3 +14,6 @@ export declare const graphAPIEndpoints: { | ||
bentobox: string; | ||
vesting: string; | ||
vesting: { | ||
direct: string; | ||
protocol: string; | ||
}; | ||
}; | ||
@@ -17,0 +20,0 @@ export declare const graphWSEndpoints: { |
@@ -17,3 +17,6 @@ "use strict"; | ||
bentobox: 'https://api.thegraph.com/subgraphs/name/jiro-ono/bento', | ||
vesting: 'https://api.thegraph.com/subgraphs/name/lufycz/sushiclaimedvesting' | ||
vesting: { | ||
"direct": 'https://api.thegraph.com/subgraphs/name/sushiswap/vesting', | ||
"protocol": "https://api.thegraph.com/subgraphs/name/sushiswap/vesting" | ||
} | ||
}; | ||
@@ -20,0 +23,0 @@ exports.graphWSEndpoints = { |
import { Arg1 } from '../../../types'; | ||
export declare function user({ block, timestamp, address }: (Arg1 & { | ||
export declare function user({ block, timestamp, address, type }: (Arg1 & { | ||
address: string; | ||
type?: "direct" | "protocol"; | ||
})): Promise<{ | ||
@@ -13,3 +14,5 @@ id: string | undefined; | ||
}>; | ||
export declare function users({ block, timestamp }?: Arg1): Promise<{ | ||
export declare function users({ block, timestamp, type }?: (Arg1 & { | ||
type?: "direct" | "protocol"; | ||
})): Promise<{ | ||
id: string | undefined; | ||
@@ -23,4 +26,5 @@ claims: { | ||
}[]>; | ||
export declare function week({ block, timestamp, week }: (Arg1 & { | ||
export declare function week({ block, timestamp, week, type }: (Arg1 & { | ||
week: number; | ||
type?: "direct" | "protocol"; | ||
})): Promise<{ | ||
@@ -32,3 +36,5 @@ id: number; | ||
}>; | ||
export declare function weeks({ block, timestamp }?: Arg1): Promise<{ | ||
export declare function weeks({ block, timestamp, type }?: (Arg1 & { | ||
type?: "direct" | "protocol"; | ||
})): Promise<{ | ||
id: number; | ||
@@ -35,0 +41,0 @@ numberOfClaims: number; |
@@ -20,7 +20,7 @@ "use strict"; | ||
const utils_1 = require("./../../utils"); | ||
function user({ block = undefined, timestamp = undefined, address }) { | ||
function user({ block = undefined, timestamp = undefined, address, type = "direct" }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
block = block ? block : timestamp ? (yield utils_1.timestampToBlock(timestamp)) : undefined; | ||
const blockString = block ? `block: { number: ${block} }` : ""; | ||
const result = yield graphql_request_1.request(constants_1.graphAPIEndpoints.vesting, graphql_request_1.gql `{ | ||
const result = yield graphql_request_1.request(constants_1.graphAPIEndpoints.vesting[type], graphql_request_1.gql `{ | ||
user(id: "${address.toLowerCase()}", ${blockString}) { | ||
@@ -34,6 +34,6 @@ ${user_properties.toString()} | ||
exports.user = user; | ||
function users({ block = undefined, timestamp = undefined } = {}) { | ||
function users({ block = undefined, timestamp = undefined, type = "direct" } = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const results = yield graph_results_pager_1.default({ | ||
api: constants_1.graphAPIEndpoints.vesting, | ||
api: constants_1.graphAPIEndpoints.vesting[type], | ||
query: { | ||
@@ -51,7 +51,7 @@ entity: 'users', | ||
exports.users = users; | ||
function week({ block = undefined, timestamp = undefined, week }) { | ||
function week({ block = undefined, timestamp = undefined, week, type = "direct" }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
block = block ? block : timestamp ? (yield utils_1.timestampToBlock(timestamp)) : undefined; | ||
const blockString = block ? `block: { number: ${block} }` : ""; | ||
const result = yield graphql_request_1.request(constants_1.graphAPIEndpoints.vesting, graphql_request_1.gql `{ | ||
const result = yield graphql_request_1.request(constants_1.graphAPIEndpoints.vesting[type], graphql_request_1.gql `{ | ||
week(id: "${week}", ${blockString}) { | ||
@@ -65,6 +65,6 @@ ${week_properties.toString()} | ||
exports.week = week; | ||
function weeks({ block = undefined, timestamp = undefined } = {}) { | ||
function weeks({ block = undefined, timestamp = undefined, type = "direct" } = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const results = yield graph_results_pager_1.default({ | ||
api: constants_1.graphAPIEndpoints.vesting, | ||
api: constants_1.graphAPIEndpoints.vesting[type], | ||
query: { | ||
@@ -71,0 +71,0 @@ entity: 'weeks', |
{ | ||
"name": "@lufycz/sushi-data", | ||
"license": "MIT", | ||
"version": "2.0.0-canary-21", | ||
"version": "2.0.0-canary-22", | ||
"author": "SushiSwap", | ||
@@ -6,0 +6,0 @@ "main": "dist/index", |
261381
6601