@quarryprotocol/gauge
Advanced tools
Comparing version
@@ -1023,2 +1023,43 @@ export declare type Gauge = { | ||
{ | ||
name: "syncDisabledGauge"; | ||
accounts: [ | ||
{ | ||
name: "gaugemeister"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "gauge"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "quarry"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "operator"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "rewarder"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "quarryMineProgram"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "quarryOperatorProgram"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "setGaugemeisterParams"; | ||
@@ -1025,0 +1066,0 @@ accounts: [ |
@@ -1026,2 +1026,43 @@ "use strict"; | ||
{ | ||
name: "syncDisabledGauge", | ||
accounts: [ | ||
{ | ||
name: "gaugemeister", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "gauge", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "quarry", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "operator", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "rewarder", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "quarryMineProgram", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "quarryOperatorProgram", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "setGaugemeisterParams", | ||
@@ -1028,0 +1069,0 @@ accounts: [ |
@@ -627,2 +627,17 @@ "use strict"; | ||
} | ||
if (gaugeData.isDisabled) { | ||
return this.provider.newTX([ | ||
this.program.instruction.syncDisabledGauge({ | ||
accounts: { | ||
gaugemeister: gaugeData.gaugemeister, | ||
gauge, | ||
quarry: gaugeData.quarry, | ||
operator: gmData.operator, | ||
rewarder: gmData.rewarder, | ||
quarryMineProgram: quarry_sdk_1.QUARRY_ADDRESSES.Mine, | ||
quarryOperatorProgram: quarry_sdk_1.QUARRY_ADDRESSES.Operator, | ||
}, | ||
}), | ||
]); | ||
} | ||
const [epochGauge] = await (0, pda_1.findEpochGaugeAddress)(gauge, gmData.currentRewardsEpoch); | ||
@@ -629,0 +644,0 @@ return this.provider.newTX([ |
@@ -30,2 +30,30 @@ import { PublicKey } from "@solana/web3.js"; | ||
export declare const findEpochGaugeVoteAddress: (gaugeVote: PublicKey, votingEpoch: number) => Promise<[PublicKey, number]>; | ||
/** | ||
* Finds the address of a GaugeVoter. | ||
*/ | ||
export declare const getGaugeVoterAddress: (gaugemeister: PublicKey, escrow: PublicKey) => PublicKey; | ||
/** | ||
* Finds the address of a Gaugemeister. | ||
*/ | ||
export declare const getGaugemeisterAddress: (base: PublicKey) => PublicKey; | ||
/** | ||
* Finds the address of a Gauge. | ||
*/ | ||
export declare const getGaugeAddress: (gaugemeister: PublicKey, quarry: PublicKey) => PublicKey; | ||
/** | ||
* Finds the address of a GaugeVote. | ||
*/ | ||
export declare const getGaugeVoteAddress: (gaugeVoter: PublicKey, gauge: PublicKey) => PublicKey; | ||
/** | ||
* Finds the address of an epoch gauge. | ||
*/ | ||
export declare const getEpochGaugeAddress: (gauge: PublicKey, votingEpoch: number) => PublicKey; | ||
/** | ||
* Finds the address of an epoch gauge voter. | ||
*/ | ||
export declare const getEpochGaugeVoterAddress: (gaugeVoter: PublicKey, votingEpoch: number) => PublicKey; | ||
/** | ||
* Finds the address of an epoch gauge vote. | ||
*/ | ||
export declare const getEpochGaugeVoteAddress: (gaugeVote: PublicKey, votingEpoch: number) => PublicKey; | ||
//# sourceMappingURL=pda.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findEpochGaugeVoteAddress = exports.findEpochGaugeVoterAddress = exports.findEpochGaugeAddress = exports.findGaugeVoteAddress = exports.findGaugeAddress = exports.findGaugemeisterAddress = exports.findGaugeVoterAddress = void 0; | ||
exports.getEpochGaugeVoteAddress = exports.getEpochGaugeVoterAddress = exports.getEpochGaugeAddress = exports.getGaugeVoteAddress = exports.getGaugeAddress = exports.getGaugemeisterAddress = exports.getGaugeVoterAddress = exports.findEpochGaugeVoteAddress = exports.findEpochGaugeVoterAddress = exports.findEpochGaugeAddress = exports.findGaugeVoteAddress = exports.findGaugeAddress = exports.findGaugemeisterAddress = exports.findGaugeVoterAddress = void 0; | ||
const anchor_1 = require("@project-serum/anchor"); | ||
const solana_contrib_1 = require("@saberhq/solana-contrib"); | ||
const web3_js_1 = require("@solana/web3.js"); | ||
@@ -85,2 +86,75 @@ const constants_1 = require("../../constants"); | ||
exports.findEpochGaugeVoteAddress = findEpochGaugeVoteAddress; | ||
/** | ||
* Finds the address of a GaugeVoter. | ||
*/ | ||
const getGaugeVoterAddress = (gaugemeister, escrow) => { | ||
return (0, solana_contrib_1.getProgramAddress)([ | ||
anchor_1.utils.bytes.utf8.encode("GaugeVoter"), | ||
gaugemeister.toBuffer(), | ||
escrow.toBuffer(), | ||
], constants_1.GAUGE_ADDRESSES.Gauge); | ||
}; | ||
exports.getGaugeVoterAddress = getGaugeVoterAddress; | ||
/** | ||
* Finds the address of a Gaugemeister. | ||
*/ | ||
const getGaugemeisterAddress = (base) => { | ||
return (0, solana_contrib_1.getProgramAddress)([anchor_1.utils.bytes.utf8.encode("Gaugemeister"), base.toBuffer()], constants_1.GAUGE_ADDRESSES.Gauge); | ||
}; | ||
exports.getGaugemeisterAddress = getGaugemeisterAddress; | ||
/** | ||
* Finds the address of a Gauge. | ||
*/ | ||
const getGaugeAddress = (gaugemeister, quarry) => { | ||
return (0, solana_contrib_1.getProgramAddress)([ | ||
anchor_1.utils.bytes.utf8.encode("Gauge"), | ||
gaugemeister.toBuffer(), | ||
quarry.toBuffer(), | ||
], constants_1.GAUGE_ADDRESSES.Gauge); | ||
}; | ||
exports.getGaugeAddress = getGaugeAddress; | ||
/** | ||
* Finds the address of a GaugeVote. | ||
*/ | ||
const getGaugeVoteAddress = (gaugeVoter, gauge) => { | ||
return (0, solana_contrib_1.getProgramAddress)([ | ||
anchor_1.utils.bytes.utf8.encode("GaugeVote"), | ||
gaugeVoter.toBuffer(), | ||
gauge.toBuffer(), | ||
], constants_1.GAUGE_ADDRESSES.Gauge); | ||
}; | ||
exports.getGaugeVoteAddress = getGaugeVoteAddress; | ||
/** | ||
* Finds the address of an epoch gauge. | ||
*/ | ||
const getEpochGaugeAddress = (gauge, votingEpoch) => { | ||
return (0, solana_contrib_1.getProgramAddress)([ | ||
anchor_1.utils.bytes.utf8.encode("EpochGauge"), | ||
gauge.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], constants_1.GAUGE_ADDRESSES.Gauge); | ||
}; | ||
exports.getEpochGaugeAddress = getEpochGaugeAddress; | ||
/** | ||
* Finds the address of an epoch gauge voter. | ||
*/ | ||
const getEpochGaugeVoterAddress = (gaugeVoter, votingEpoch) => { | ||
return (0, solana_contrib_1.getProgramAddress)([ | ||
anchor_1.utils.bytes.utf8.encode("EpochGaugeVoter"), | ||
gaugeVoter.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], constants_1.GAUGE_ADDRESSES.Gauge); | ||
}; | ||
exports.getEpochGaugeVoterAddress = getEpochGaugeVoterAddress; | ||
/** | ||
* Finds the address of an epoch gauge vote. | ||
*/ | ||
const getEpochGaugeVoteAddress = (gaugeVote, votingEpoch) => { | ||
return (0, solana_contrib_1.getProgramAddress)([ | ||
anchor_1.utils.bytes.utf8.encode("EpochGaugeVote"), | ||
gaugeVote.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], constants_1.GAUGE_ADDRESSES.Gauge); | ||
}; | ||
exports.getEpochGaugeVoteAddress = getEpochGaugeVoteAddress; | ||
//# sourceMappingURL=pda.js.map |
@@ -1023,2 +1023,43 @@ export declare type Gauge = { | ||
{ | ||
name: "syncDisabledGauge"; | ||
accounts: [ | ||
{ | ||
name: "gaugemeister"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "gauge"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "quarry"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "operator"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "rewarder"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "quarryMineProgram"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "quarryOperatorProgram"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "setGaugemeisterParams"; | ||
@@ -1025,0 +1066,0 @@ accounts: [ |
@@ -1023,2 +1023,43 @@ export const IDL = { | ||
{ | ||
name: "syncDisabledGauge", | ||
accounts: [ | ||
{ | ||
name: "gaugemeister", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "gauge", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "quarry", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "operator", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "rewarder", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "quarryMineProgram", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "quarryOperatorProgram", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "setGaugemeisterParams", | ||
@@ -1025,0 +1066,0 @@ accounts: [ |
@@ -624,2 +624,17 @@ import { QUARRY_ADDRESSES } from "@quarryprotocol/quarry-sdk"; | ||
} | ||
if (gaugeData.isDisabled) { | ||
return this.provider.newTX([ | ||
this.program.instruction.syncDisabledGauge({ | ||
accounts: { | ||
gaugemeister: gaugeData.gaugemeister, | ||
gauge, | ||
quarry: gaugeData.quarry, | ||
operator: gmData.operator, | ||
rewarder: gmData.rewarder, | ||
quarryMineProgram: QUARRY_ADDRESSES.Mine, | ||
quarryOperatorProgram: QUARRY_ADDRESSES.Operator, | ||
}, | ||
}), | ||
]); | ||
} | ||
const [epochGauge] = await findEpochGaugeAddress(gauge, gmData.currentRewardsEpoch); | ||
@@ -626,0 +641,0 @@ return this.provider.newTX([ |
@@ -30,2 +30,30 @@ import { PublicKey } from "@solana/web3.js"; | ||
export declare const findEpochGaugeVoteAddress: (gaugeVote: PublicKey, votingEpoch: number) => Promise<[PublicKey, number]>; | ||
/** | ||
* Finds the address of a GaugeVoter. | ||
*/ | ||
export declare const getGaugeVoterAddress: (gaugemeister: PublicKey, escrow: PublicKey) => PublicKey; | ||
/** | ||
* Finds the address of a Gaugemeister. | ||
*/ | ||
export declare const getGaugemeisterAddress: (base: PublicKey) => PublicKey; | ||
/** | ||
* Finds the address of a Gauge. | ||
*/ | ||
export declare const getGaugeAddress: (gaugemeister: PublicKey, quarry: PublicKey) => PublicKey; | ||
/** | ||
* Finds the address of a GaugeVote. | ||
*/ | ||
export declare const getGaugeVoteAddress: (gaugeVoter: PublicKey, gauge: PublicKey) => PublicKey; | ||
/** | ||
* Finds the address of an epoch gauge. | ||
*/ | ||
export declare const getEpochGaugeAddress: (gauge: PublicKey, votingEpoch: number) => PublicKey; | ||
/** | ||
* Finds the address of an epoch gauge voter. | ||
*/ | ||
export declare const getEpochGaugeVoterAddress: (gaugeVoter: PublicKey, votingEpoch: number) => PublicKey; | ||
/** | ||
* Finds the address of an epoch gauge vote. | ||
*/ | ||
export declare const getEpochGaugeVoteAddress: (gaugeVote: PublicKey, votingEpoch: number) => PublicKey; | ||
//# sourceMappingURL=pda.d.ts.map |
import { utils } from "@project-serum/anchor"; | ||
import { getProgramAddress } from "@saberhq/solana-contrib"; | ||
import { PublicKey } from "@solana/web3.js"; | ||
@@ -75,2 +76,68 @@ import { GAUGE_ADDRESSES } from "../../constants"; | ||
}; | ||
/** | ||
* Finds the address of a GaugeVoter. | ||
*/ | ||
export const getGaugeVoterAddress = (gaugemeister, escrow) => { | ||
return getProgramAddress([ | ||
utils.bytes.utf8.encode("GaugeVoter"), | ||
gaugemeister.toBuffer(), | ||
escrow.toBuffer(), | ||
], GAUGE_ADDRESSES.Gauge); | ||
}; | ||
/** | ||
* Finds the address of a Gaugemeister. | ||
*/ | ||
export const getGaugemeisterAddress = (base) => { | ||
return getProgramAddress([utils.bytes.utf8.encode("Gaugemeister"), base.toBuffer()], GAUGE_ADDRESSES.Gauge); | ||
}; | ||
/** | ||
* Finds the address of a Gauge. | ||
*/ | ||
export const getGaugeAddress = (gaugemeister, quarry) => { | ||
return getProgramAddress([ | ||
utils.bytes.utf8.encode("Gauge"), | ||
gaugemeister.toBuffer(), | ||
quarry.toBuffer(), | ||
], GAUGE_ADDRESSES.Gauge); | ||
}; | ||
/** | ||
* Finds the address of a GaugeVote. | ||
*/ | ||
export const getGaugeVoteAddress = (gaugeVoter, gauge) => { | ||
return getProgramAddress([ | ||
utils.bytes.utf8.encode("GaugeVote"), | ||
gaugeVoter.toBuffer(), | ||
gauge.toBuffer(), | ||
], GAUGE_ADDRESSES.Gauge); | ||
}; | ||
/** | ||
* Finds the address of an epoch gauge. | ||
*/ | ||
export const getEpochGaugeAddress = (gauge, votingEpoch) => { | ||
return getProgramAddress([ | ||
utils.bytes.utf8.encode("EpochGauge"), | ||
gauge.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], GAUGE_ADDRESSES.Gauge); | ||
}; | ||
/** | ||
* Finds the address of an epoch gauge voter. | ||
*/ | ||
export const getEpochGaugeVoterAddress = (gaugeVoter, votingEpoch) => { | ||
return getProgramAddress([ | ||
utils.bytes.utf8.encode("EpochGaugeVoter"), | ||
gaugeVoter.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], GAUGE_ADDRESSES.Gauge); | ||
}; | ||
/** | ||
* Finds the address of an epoch gauge vote. | ||
*/ | ||
export const getEpochGaugeVoteAddress = (gaugeVote, votingEpoch) => { | ||
return getProgramAddress([ | ||
utils.bytes.utf8.encode("EpochGaugeVote"), | ||
gaugeVote.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], GAUGE_ADDRESSES.Gauge); | ||
}; | ||
//# sourceMappingURL=pda.js.map |
{ | ||
"name": "@quarryprotocol/gauge", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "The TypeScript SDK for Quarry Gauge.", | ||
@@ -39,9 +39,9 @@ "keywords": [ | ||
"@rushstack/eslint-patch": "^1.1.3", | ||
"@saberhq/anchor-contrib": "^1.12.67", | ||
"@saberhq/chai-solana": "^1.12.67", | ||
"@saberhq/eslint-config": "^1.12.67", | ||
"@saberhq/solana-contrib": "^1.12.67", | ||
"@saberhq/token-utils": "^1.12.67", | ||
"@saberhq/tsconfig": "^1.12.67", | ||
"@solana/web3.js": "^1.41.1", | ||
"@saberhq/anchor-contrib": "^1.13.15", | ||
"@saberhq/chai-solana": "^1.13.15", | ||
"@saberhq/eslint-config": "^1.13.15", | ||
"@saberhq/solana-contrib": "^1.13.15", | ||
"@saberhq/token-utils": "^1.13.15", | ||
"@saberhq/tsconfig": "^1.13.15", | ||
"@solana/web3.js": "^1.43.1", | ||
"@tribecahq/tribeca-sdk": "^0.5.6", | ||
@@ -52,11 +52,11 @@ "@types/bn.js": "^5.1.0", | ||
"@types/mocha": "^9.1.1", | ||
"@types/node": "^17.0.29", | ||
"@types/prettier": "^2.6.0", | ||
"@yarnpkg/doctor": "^4.0.0-rc.3", | ||
"@types/node": "^17.0.35", | ||
"@types/prettier": "^2.6.1", | ||
"@yarnpkg/doctor": "^4.0.0-rc.6", | ||
"bn.js": "^5.2.0", | ||
"chai": "=4.3.4", | ||
"eslint": "^8.14.0", | ||
"eslint": "^8.16.0", | ||
"eslint-import-resolver-node": "^0.3.6", | ||
"eslint-plugin-import": "^2.26.0", | ||
"husky": "^7.0.4", | ||
"husky": "^8.0.1", | ||
"jsbi": "^4.3.0", | ||
@@ -67,5 +67,5 @@ "lint-staged": "^12.4.1", | ||
"prettier": "^2.6.2", | ||
"ts-node": "^10.7.0", | ||
"ts-node": "^10.8.0", | ||
"typedoc": "^0.22.15", | ||
"typescript": "^4.6.3" | ||
"typescript": "^4.6.4" | ||
}, | ||
@@ -75,6 +75,6 @@ "peerDependencies": { | ||
"@quarryprotocol/quarry-sdk": "^5", | ||
"@saberhq/anchor-contrib": "^1.12", | ||
"@saberhq/solana-contrib": "^1.12", | ||
"@saberhq/token-utils": "^1.12", | ||
"@solana/web3.js": "^1.39", | ||
"@saberhq/anchor-contrib": "^1.13", | ||
"@saberhq/solana-contrib": "^1.13", | ||
"@saberhq/token-utils": "^1.13", | ||
"@solana/web3.js": "^1.42", | ||
"@tribecahq/tribeca-sdk": "^0.5.6", | ||
@@ -84,3 +84,3 @@ "bn.js": "^5.2.0" | ||
"resolutions": { | ||
"@solana/web3.js": "^1.37", | ||
"@solana/web3.js": "^1.43", | ||
"bn.js": "^5.2.0", | ||
@@ -105,3 +105,3 @@ "@types/bn.js": "^5.1.0" | ||
}, | ||
"packageManager": "yarn@3.2.0" | ||
"packageManager": "yarn@3.2.1" | ||
} |
@@ -996,2 +996,18 @@ import { QUARRY_ADDRESSES } from "@quarryprotocol/quarry-sdk"; | ||
} | ||
if (gaugeData.isDisabled) { | ||
return this.provider.newTX([ | ||
this.program.instruction.syncDisabledGauge({ | ||
accounts: { | ||
gaugemeister: gaugeData.gaugemeister, | ||
gauge, | ||
quarry: gaugeData.quarry, | ||
operator: gmData.operator, | ||
rewarder: gmData.rewarder, | ||
quarryMineProgram: QUARRY_ADDRESSES.Mine, | ||
quarryOperatorProgram: QUARRY_ADDRESSES.Operator, | ||
}, | ||
}), | ||
]); | ||
} | ||
const [epochGauge] = await findEpochGaugeAddress( | ||
@@ -998,0 +1014,0 @@ gauge, |
import { utils } from "@project-serum/anchor"; | ||
import { getProgramAddress } from "@saberhq/solana-contrib"; | ||
import { PublicKey } from "@solana/web3.js"; | ||
@@ -125,1 +126,113 @@ | ||
}; | ||
/** | ||
* Finds the address of a GaugeVoter. | ||
*/ | ||
export const getGaugeVoterAddress = ( | ||
gaugemeister: PublicKey, | ||
escrow: PublicKey | ||
): PublicKey => { | ||
return getProgramAddress( | ||
[ | ||
utils.bytes.utf8.encode("GaugeVoter"), | ||
gaugemeister.toBuffer(), | ||
escrow.toBuffer(), | ||
], | ||
GAUGE_ADDRESSES.Gauge | ||
); | ||
}; | ||
/** | ||
* Finds the address of a Gaugemeister. | ||
*/ | ||
export const getGaugemeisterAddress = (base: PublicKey): PublicKey => { | ||
return getProgramAddress( | ||
[utils.bytes.utf8.encode("Gaugemeister"), base.toBuffer()], | ||
GAUGE_ADDRESSES.Gauge | ||
); | ||
}; | ||
/** | ||
* Finds the address of a Gauge. | ||
*/ | ||
export const getGaugeAddress = ( | ||
gaugemeister: PublicKey, | ||
quarry: PublicKey | ||
): PublicKey => { | ||
return getProgramAddress( | ||
[ | ||
utils.bytes.utf8.encode("Gauge"), | ||
gaugemeister.toBuffer(), | ||
quarry.toBuffer(), | ||
], | ||
GAUGE_ADDRESSES.Gauge | ||
); | ||
}; | ||
/** | ||
* Finds the address of a GaugeVote. | ||
*/ | ||
export const getGaugeVoteAddress = ( | ||
gaugeVoter: PublicKey, | ||
gauge: PublicKey | ||
): PublicKey => { | ||
return getProgramAddress( | ||
[ | ||
utils.bytes.utf8.encode("GaugeVote"), | ||
gaugeVoter.toBuffer(), | ||
gauge.toBuffer(), | ||
], | ||
GAUGE_ADDRESSES.Gauge | ||
); | ||
}; | ||
/** | ||
* Finds the address of an epoch gauge. | ||
*/ | ||
export const getEpochGaugeAddress = ( | ||
gauge: PublicKey, | ||
votingEpoch: number | ||
): PublicKey => { | ||
return getProgramAddress( | ||
[ | ||
utils.bytes.utf8.encode("EpochGauge"), | ||
gauge.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], | ||
GAUGE_ADDRESSES.Gauge | ||
); | ||
}; | ||
/** | ||
* Finds the address of an epoch gauge voter. | ||
*/ | ||
export const getEpochGaugeVoterAddress = ( | ||
gaugeVoter: PublicKey, | ||
votingEpoch: number | ||
): PublicKey => { | ||
return getProgramAddress( | ||
[ | ||
utils.bytes.utf8.encode("EpochGaugeVoter"), | ||
gaugeVoter.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], | ||
GAUGE_ADDRESSES.Gauge | ||
); | ||
}; | ||
/** | ||
* Finds the address of an epoch gauge vote. | ||
*/ | ||
export const getEpochGaugeVoteAddress = ( | ||
gaugeVote: PublicKey, | ||
votingEpoch: number | ||
): PublicKey => { | ||
return getProgramAddress( | ||
[ | ||
utils.bytes.utf8.encode("EpochGaugeVote"), | ||
gaugeVote.toBuffer(), | ||
encodeU32(votingEpoch), | ||
], | ||
GAUGE_ADDRESSES.Gauge | ||
); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
912816
3.94%15175
4.08%0
-100%