mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
make field getVotingInfo public
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.19.89-rc15",
|
||||
"version": "0.19.89-rc16",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.19.89-rc15",
|
||||
"version": "0.19.89-rc16",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.19.89-rc15",
|
||||
"version": "0.19.89-rc16",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -117,6 +117,17 @@ class IntegratorService {
|
||||
return BigNumber(amount).dividedBy(this.getK(timestamp));
|
||||
}
|
||||
|
||||
getVotingInfo = (userAddress: number) => {
|
||||
return fetchWithValidation(this.apiUrl, votingInfoResponseSchema, {
|
||||
method: 'POST',
|
||||
body: this.makeRPCPayload({
|
||||
model: 'OrionVoting',
|
||||
method: 'info',
|
||||
params: [userAddress],
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
private readonly getEnvironment = () => {
|
||||
return fetchWithValidation(this.apiUrl, environmentResponseSchema, {
|
||||
method: 'POST',
|
||||
@@ -194,17 +205,6 @@ class IntegratorService {
|
||||
// sqrt
|
||||
return BigNumber(amountToken).multipliedBy(BigNumber(deltaDays).sqrt()).dividedBy(BigNumber(WEEK_DAYS).sqrt());
|
||||
}
|
||||
|
||||
private readonly getVotingInfo = (userAddress: number) => {
|
||||
return fetchWithValidation(this.apiUrl, votingInfoResponseSchema, {
|
||||
method: 'POST',
|
||||
body: this.makeRPCPayload({
|
||||
model: 'OrionVoting',
|
||||
method: 'info',
|
||||
params: [userAddress],
|
||||
}),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export * as schemas from './schemas/index.js';
|
||||
|
||||
Reference in New Issue
Block a user