From e54024ffb1ac630738239c1cd422467541ca57fe Mon Sep 17 00:00:00 2001 From: keyvan Date: Wed, 18 Sep 2024 19:53:42 -0700 Subject: [PATCH 1/9] feat(staking): add scaling factor --- governance/pyth_staking_sdk/src/constants.ts | 2 ++ governance/pyth_staking_sdk/src/pdas.ts | 7 ++++++ .../src/pyth-staking-client.ts | 25 ++++++++++++++++++- governance/pyth_staking_sdk/src/types.ts | 3 +++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/governance/pyth_staking_sdk/src/constants.ts b/governance/pyth_staking_sdk/src/constants.ts index 2954bd39ec..05fbd89e82 100644 --- a/governance/pyth_staking_sdk/src/constants.ts +++ b/governance/pyth_staking_sdk/src/constants.ts @@ -8,6 +8,8 @@ const ONE_WEEK_IN_SECONDS = 7n * ONE_DAY_IN_SECONDS; export const EPOCH_DURATION = ONE_WEEK_IN_SECONDS; +export const MAX_VOTER_WEIGHT = 10_000_000_000_000_000; // 10 Billion with 6 decimals + export const FRACTION_PRECISION = 1_000_000; export const FRACTION_PRECISION_N = 1_000_000n; diff --git a/governance/pyth_staking_sdk/src/pdas.ts b/governance/pyth_staking_sdk/src/pdas.ts index a3e5f7afcc..a4ed1026e5 100644 --- a/governance/pyth_staking_sdk/src/pdas.ts +++ b/governance/pyth_staking_sdk/src/pdas.ts @@ -50,3 +50,10 @@ export const getDelegationRecordAddress = ( INTEGRITY_POOL_PROGRAM_ADDRESS, )[0]; }; + +export const getTargetAccountAddress = () => { + return PublicKey.findProgramAddressSync( + [Buffer.from("target"), Buffer.from("voting")], + STAKING_PROGRAM_ADDRESS, + )[0]; +}; diff --git a/governance/pyth_staking_sdk/src/pyth-staking-client.ts b/governance/pyth_staking_sdk/src/pyth-staking-client.ts index 69e403726f..684c3ef0f4 100644 --- a/governance/pyth_staking_sdk/src/pyth-staking-client.ts +++ b/governance/pyth_staking_sdk/src/pyth-staking-client.ts @@ -21,13 +21,18 @@ import { TransactionInstruction, } from "@solana/web3.js"; -import { GOVERNANCE_ADDRESS, POSITIONS_ACCOUNT_SIZE } from "./constants"; +import { + GOVERNANCE_ADDRESS, + MAX_VOTER_WEIGHT, + POSITIONS_ACCOUNT_SIZE, +} from "./constants"; import { getConfigAddress, getDelegationRecordAddress, getPoolConfigAddress, getStakeAccountCustodyAddress, getStakeAccountMetadataAddress, + getTargetAccountAddress, } from "./pdas"; import { PositionState, @@ -35,6 +40,7 @@ import { type PoolConfig, type PoolDataAccount, type StakeAccountPositions, + type TargetAccount, } from "./types"; import { convertBigIntToBN, convertBNToBigInt } from "./utils/bn"; import { epochToDate, getCurrentEpoch } from "./utils/clock"; @@ -710,4 +716,21 @@ export class PythStakingClient { undefined, ); } + + public async getTargetAccount(): Promise { + const targetAccount = + await this.stakingProgram.account.targetMetadata.fetch( + getTargetAccountAddress(), + ); + return convertBNToBigInt(targetAccount); + } + + /** + * This returns the current scaling factor between staked tokens and realms voter weight. + * The formula is n_staked_tokens = scaling_factor * n_voter_weight + */ + public async getScalingFactor(): Promise { + const targetAccount = await this.getTargetAccount(); + return Number(targetAccount.locked) / MAX_VOTER_WEIGHT; + } } diff --git a/governance/pyth_staking_sdk/src/types.ts b/governance/pyth_staking_sdk/src/types.ts index c040eb3f51..add2d8e914 100644 --- a/governance/pyth_staking_sdk/src/types.ts +++ b/governance/pyth_staking_sdk/src/types.ts @@ -35,6 +35,9 @@ export type TargetWithParameters = IdlTypes["targetWithParameters"]; export type VestingScheduleAnchor = IdlTypes["vestingSchedule"]; export type VestingSchedule = ConvertBNToBigInt; +export type TargetAccountAnchor = IdlAccounts["targetMetadata"]; +export type TargetAccount = ConvertBNToBigInt; + export type UnlockSchedule = { date: Date; amount: bigint; From a89a66cd4c7abbcc4d7f828452ef4b1a97cdec1c Mon Sep 17 00:00:00 2001 From: keyvan Date: Wed, 18 Sep 2024 20:18:36 -0700 Subject: [PATCH 2/9] add --- .../src/pyth-staking-client.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/governance/pyth_staking_sdk/src/pyth-staking-client.ts b/governance/pyth_staking_sdk/src/pyth-staking-client.ts index 684c3ef0f4..4243724ce3 100644 --- a/governance/pyth_staking_sdk/src/pyth-staking-client.ts +++ b/governance/pyth_staking_sdk/src/pyth-staking-client.ts @@ -733,4 +733,27 @@ export class PythStakingClient { const targetAccount = await this.getTargetAccount(); return Number(targetAccount.locked) / MAX_VOTER_WEIGHT; } + + public async getRecoverAccountInstruction( + stakeAccountPositions: PublicKey, + ): Promise { + return this.stakingProgram.methods + .recoverAccount() + .accounts({ + stakeAccountPositions, + }) + .instruction(); + } + + public async getUpdatePoolAuthorityInstruction( + governanceAuthority: PublicKey, + poolAuthority: PublicKey, + ): Promise { + return this.stakingProgram.methods + .updatePoolAuthority(poolAuthority) + .accounts({ + governanceAuthority, + }) + .instruction(); + } } From a0e38499734e1a3d62f2530a3b57d108df7a32f6 Mon Sep 17 00:00:00 2001 From: keyvan Date: Fri, 20 Sep 2024 11:21:44 -0700 Subject: [PATCH 3/9] fix --- governance/pyth_staking_sdk/src/pyth-staking-client.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/governance/pyth_staking_sdk/src/pyth-staking-client.ts b/governance/pyth_staking_sdk/src/pyth-staking-client.ts index dabf958358..aab48253ed 100644 --- a/governance/pyth_staking_sdk/src/pyth-staking-client.ts +++ b/governance/pyth_staking_sdk/src/pyth-staking-client.ts @@ -713,11 +713,17 @@ export class PythStakingClient { public async getRecoverAccountInstruction( stakeAccountPositions: PublicKey, + governanceAuthority: PublicKey, ): Promise { + const stakeAccountPositionsData = await this.getStakeAccountPositions( + stakeAccountPositions, + ); return this.stakingProgram.methods .recoverAccount() - .accounts({ + .accountsPartial({ stakeAccountPositions, + governanceAuthority, + owner: stakeAccountPositionsData.data.owner, }) .instruction(); } From fbf8a2dbeaf605ef37bc652661eab55831fba334 Mon Sep 17 00:00:00 2001 From: keyvan Date: Fri, 20 Sep 2024 12:10:28 -0700 Subject: [PATCH 4/9] fix --- governance/pyth_staking_sdk/src/pyth-staking-client.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/governance/pyth_staking_sdk/src/pyth-staking-client.ts b/governance/pyth_staking_sdk/src/pyth-staking-client.ts index aab48253ed..4d8caa647c 100644 --- a/governance/pyth_staking_sdk/src/pyth-staking-client.ts +++ b/governance/pyth_staking_sdk/src/pyth-staking-client.ts @@ -715,15 +715,11 @@ export class PythStakingClient { stakeAccountPositions: PublicKey, governanceAuthority: PublicKey, ): Promise { - const stakeAccountPositionsData = await this.getStakeAccountPositions( - stakeAccountPositions, - ); return this.stakingProgram.methods .recoverAccount() .accountsPartial({ stakeAccountPositions, governanceAuthority, - owner: stakeAccountPositionsData.data.owner, }) .instruction(); } From f0f03d1a0c719b72da7dc701e1d490d5de144892 Mon Sep 17 00:00:00 2001 From: keyvan Date: Fri, 20 Sep 2024 12:57:34 -0700 Subject: [PATCH 5/9] add more --- governance/pyth_staking_sdk/src/pdas.ts | 18 +++++ .../src/pyth-staking-client.ts | 67 +++++++++++++++++++ governance/pyth_staking_sdk/src/types.ts | 2 + 3 files changed, 87 insertions(+) diff --git a/governance/pyth_staking_sdk/src/pdas.ts b/governance/pyth_staking_sdk/src/pdas.ts index a4ed1026e5..ff316940a4 100644 --- a/governance/pyth_staking_sdk/src/pdas.ts +++ b/governance/pyth_staking_sdk/src/pdas.ts @@ -57,3 +57,21 @@ export const getTargetAccountAddress = () => { STAKING_PROGRAM_ADDRESS, )[0]; }; + +export const getVoterWeightRecordAddress = ( + stakeAccountPositions: PublicKey, +) => { + return PublicKey.findProgramAddressSync( + [Buffer.from("voter_weight"), stakeAccountPositions.toBuffer()], + STAKING_PROGRAM_ADDRESS, + )[0]; +}; + +export const getMaxVoterWeightRecordAddress = ( + stakeAccountPositions: PublicKey, +) => { + return PublicKey.findProgramAddressSync( + [Buffer.from("max_voter"), stakeAccountPositions.toBuffer()], + STAKING_PROGRAM_ADDRESS, + )[0]; +}; diff --git a/governance/pyth_staking_sdk/src/pyth-staking-client.ts b/governance/pyth_staking_sdk/src/pyth-staking-client.ts index 4d8caa647c..7e123f89b3 100644 --- a/governance/pyth_staking_sdk/src/pyth-staking-client.ts +++ b/governance/pyth_staking_sdk/src/pyth-staking-client.ts @@ -41,6 +41,7 @@ import { type PoolDataAccount, type StakeAccountPositions, type TargetAccount, + type VoterWeightAction, } from "./types"; import { convertBigIntToBN, convertBNToBigInt } from "./utils/bn"; import { epochToDate, getCurrentEpoch } from "./utils/clock"; @@ -735,4 +736,70 @@ export class PythStakingClient { }) .instruction(); } + + public async getUpdateVoterWeightInstruction( + stakeAccountPositions: PublicKey, + action: VoterWeightAction, + remainingAccount?: PublicKey, + ) { + return this.stakingProgram.methods + .updateVoterWeight(action) + .accounts({ + stakeAccountPositions, + }) + .remainingAccounts( + remainingAccount + ? [ + { + pubkey: remainingAccount, + isWritable: false, + isSigner: false, + }, + ] + : [], + ) + .instruction(); + } + + public async getMainStakeAccount() { + const stakeAccountPositions = await this.getAllStakeAccountPositions(); + const stakeAccountBalances = await Promise.all( + stakeAccountPositions.map(async (position) => { + const stakeAccountCustody = await this.getStakeAccountCustody(position); + return { + stakeAccountPosition: position, + balance: stakeAccountCustody.amount, + }; + }), + ); + + let mainAccount = stakeAccountBalances[0]; + + if (mainAccount === undefined) { + return; + } + + for (let i = 1; i < stakeAccountBalances.length; i++) { + const currentAccount = stakeAccountBalances[i]; + if ( + currentAccount !== undefined && + currentAccount.balance > mainAccount.balance + ) { + mainAccount = currentAccount; + } + } + + return mainAccount; + } + + public async getVoterWeight() { + const mainAccount = await this.getMainStakeAccount(); + + if (mainAccount === undefined) { + return 0; + } + + const scalingFactor = await this.getScalingFactor(); + return Number(mainAccount.balance) / scalingFactor; + } } diff --git a/governance/pyth_staking_sdk/src/types.ts b/governance/pyth_staking_sdk/src/types.ts index add2d8e914..fbf0d64e53 100644 --- a/governance/pyth_staking_sdk/src/types.ts +++ b/governance/pyth_staking_sdk/src/types.ts @@ -38,6 +38,8 @@ export type VestingSchedule = ConvertBNToBigInt; export type TargetAccountAnchor = IdlAccounts["targetMetadata"]; export type TargetAccount = ConvertBNToBigInt; +export type VoterWeightAction = IdlTypes["voterWeightAction"]; + export type UnlockSchedule = { date: Date; amount: bigint; From e1f64107643fbfbb55ff401a8a3e04082b0e7c22 Mon Sep 17 00:00:00 2001 From: keyvan Date: Fri, 20 Sep 2024 13:22:55 -0700 Subject: [PATCH 6/9] fix --- .../src/pyth-staking-client.ts | 23 ++++++++++++------- .../pyth_staking_sdk/src/utils/position.ts | 19 +++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/governance/pyth_staking_sdk/src/pyth-staking-client.ts b/governance/pyth_staking_sdk/src/pyth-staking-client.ts index 7e123f89b3..66b1dddf57 100644 --- a/governance/pyth_staking_sdk/src/pyth-staking-client.ts +++ b/governance/pyth_staking_sdk/src/pyth-staking-client.ts @@ -49,6 +49,7 @@ import { extractPublisherData } from "./utils/pool"; import { deserializeStakeAccountPositions, getPositionState, + getVotingTokenAmount, } from "./utils/position"; import { sendTransaction } from "./utils/transaction"; import { getUnlockSchedule } from "./utils/vesting"; @@ -763,27 +764,33 @@ export class PythStakingClient { public async getMainStakeAccount() { const stakeAccountPositions = await this.getAllStakeAccountPositions(); - const stakeAccountBalances = await Promise.all( + const currentEpoch = await getCurrentEpoch(this.connection); + + const stakeAccountVotingTokens = await Promise.all( stakeAccountPositions.map(async (position) => { - const stakeAccountCustody = await this.getStakeAccountCustody(position); + const stakeAccountPositionsData = + await this.getStakeAccountPositions(position); return { stakeAccountPosition: position, - balance: stakeAccountCustody.amount, + votingTokens: getVotingTokenAmount( + stakeAccountPositionsData, + currentEpoch, + ), }; }), ); - let mainAccount = stakeAccountBalances[0]; + let mainAccount = stakeAccountVotingTokens[0]; if (mainAccount === undefined) { return; } - for (let i = 1; i < stakeAccountBalances.length; i++) { - const currentAccount = stakeAccountBalances[i]; + for (let i = 1; i < stakeAccountVotingTokens.length; i++) { + const currentAccount = stakeAccountVotingTokens[i]; if ( currentAccount !== undefined && - currentAccount.balance > mainAccount.balance + currentAccount.votingTokens > mainAccount.votingTokens ) { mainAccount = currentAccount; } @@ -800,6 +807,6 @@ export class PythStakingClient { } const scalingFactor = await this.getScalingFactor(); - return Number(mainAccount.balance) / scalingFactor; + return Number(mainAccount.votingTokens) / scalingFactor; } } diff --git a/governance/pyth_staking_sdk/src/utils/position.ts b/governance/pyth_staking_sdk/src/utils/position.ts index 1e4eb2430d..7abc2830a9 100644 --- a/governance/pyth_staking_sdk/src/utils/position.ts +++ b/governance/pyth_staking_sdk/src/utils/position.ts @@ -92,3 +92,22 @@ export const deserializeStakeAccountPositions = ( }, }; }; + +export const getVotingTokenAmount = ( + stakeAccountPositions: StakeAccountPositions, + epoch: bigint, +) => { + const positions = stakeAccountPositions.data.positions; + const votingPositions = positions + .filter((p) => p.targetWithParameters.voting) + .filter((p) => + [PositionState.LOCKED, PositionState.PREUNLOCKING].includes( + getPositionState(p, epoch), + ), + ); + const totalVotingTokenAmount = votingPositions.reduce( + (sum, p) => sum + p.amount, + 0n, + ); + return totalVotingTokenAmount; +}; From 0c2c5696d1e6e79a161de14c4d525f1092e32d7b Mon Sep 17 00:00:00 2001 From: keyvan Date: Tue, 24 Sep 2024 10:36:35 -0700 Subject: [PATCH 7/9] wip --- governance/pyth_staking_sdk/package.json | 8 +++----- governance/pyth_staking_sdk/tsconfig.json | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/governance/pyth_staking_sdk/package.json b/governance/pyth_staking_sdk/package.json index 67ac1256e3..8e93223141 100644 --- a/governance/pyth_staking_sdk/package.json +++ b/governance/pyth_staking_sdk/package.json @@ -1,11 +1,9 @@ { "name": "@pythnetwork/staking-sdk", - "version": "0.0.0", + "version": "0.0.1", "description": "Pyth staking SDK", - "type": "module", - "exports": { - ".": "./src/index.ts" - }, + "main": "src/index.ts", + "types": "src/index.d.ts", "publishConfig": { "access": "public" }, diff --git a/governance/pyth_staking_sdk/tsconfig.json b/governance/pyth_staking_sdk/tsconfig.json index 1411fbaef3..4ae721b71f 100644 --- a/governance/pyth_staking_sdk/tsconfig.json +++ b/governance/pyth_staking_sdk/tsconfig.json @@ -7,11 +7,12 @@ "baseUrl": "./", "noEmit": false, "target": "ESNext", - "module": "ESNext", + "module": "CommonJS", "moduleResolution": "Node", "declaration": true, "composite": true, "declarationMap": true, - "esModuleInterop": true + "esModuleInterop": true, + "verbatimModuleSyntax": false } } From a01e26561d20fbe8e1663649164ad4e0937dc98b Mon Sep 17 00:00:00 2001 From: keyvan Date: Tue, 24 Sep 2024 16:02:48 -0700 Subject: [PATCH 8/9] fix --- .../{eslint.config.js => eslint.config.mjs} | 0 governance/pyth_staking_sdk/package.json | 2 +- .../{prettier.config.js => prettier.config.mjs} | 0 ...-package-json.js => update-package-json.mjs} | 4 +--- governance/pyth_staking_sdk/src/constants.ts | 2 +- governance/pyth_staking_sdk/src/pdas.ts | 10 ++++------ .../pyth_staking_sdk/src/pyth-staking-client.ts | 17 +++++++++-------- 7 files changed, 16 insertions(+), 19 deletions(-) rename governance/pyth_staking_sdk/{eslint.config.js => eslint.config.mjs} (100%) rename governance/pyth_staking_sdk/{prettier.config.js => prettier.config.mjs} (100%) rename governance/pyth_staking_sdk/scripts/{update-package-json.js => update-package-json.mjs} (92%) diff --git a/governance/pyth_staking_sdk/eslint.config.js b/governance/pyth_staking_sdk/eslint.config.mjs similarity index 100% rename from governance/pyth_staking_sdk/eslint.config.js rename to governance/pyth_staking_sdk/eslint.config.mjs diff --git a/governance/pyth_staking_sdk/package.json b/governance/pyth_staking_sdk/package.json index 8e93223141..edbd5d55d7 100644 --- a/governance/pyth_staking_sdk/package.json +++ b/governance/pyth_staking_sdk/package.json @@ -8,7 +8,7 @@ "access": "public" }, "scripts": { - "build": "tsc && node scripts/update-package-json.js", + "build": "tsc && node scripts/update-package-json.mjs", "test": "pnpm run test:format && pnpm run test:lint && pnpm run test:integration && pnpm run test:types", "fix": "pnpm fix:lint && pnpm fix:format", "fix:format": "prettier --write .", diff --git a/governance/pyth_staking_sdk/prettier.config.js b/governance/pyth_staking_sdk/prettier.config.mjs similarity index 100% rename from governance/pyth_staking_sdk/prettier.config.js rename to governance/pyth_staking_sdk/prettier.config.mjs diff --git a/governance/pyth_staking_sdk/scripts/update-package-json.js b/governance/pyth_staking_sdk/scripts/update-package-json.mjs similarity index 92% rename from governance/pyth_staking_sdk/scripts/update-package-json.js rename to governance/pyth_staking_sdk/scripts/update-package-json.mjs index 92574ce325..931eb14cfc 100644 --- a/governance/pyth_staking_sdk/scripts/update-package-json.js +++ b/governance/pyth_staking_sdk/scripts/update-package-json.mjs @@ -15,8 +15,6 @@ const distPackageJsonPath = path.join(__dirname, "..", "dist", "package.json"); const packageJson = JSON.parse(fs.readFileSync(distPackageJsonPath, "utf8")); -packageJson.exports = { - ".": "./src/index.js", -}; +packageJson.main = "src/index.js"; fs.writeFileSync(distPackageJsonPath, JSON.stringify(packageJson, null, 2)); diff --git a/governance/pyth_staking_sdk/src/constants.ts b/governance/pyth_staking_sdk/src/constants.ts index 6cf7c59de2..0b5249ef95 100644 --- a/governance/pyth_staking_sdk/src/constants.ts +++ b/governance/pyth_staking_sdk/src/constants.ts @@ -9,7 +9,7 @@ export const ONE_YEAR_IN_SECONDS = 365n * ONE_DAY_IN_SECONDS; export const EPOCH_DURATION = ONE_WEEK_IN_SECONDS; -export const MAX_VOTER_WEIGHT = 10_000_000_000_000_000; // 10 Billion with 6 decimals +export const MAX_VOTER_WEIGHT = 10_000_000_000_000_000n; // 10 Billion with 6 decimals export const FRACTION_PRECISION = 1_000_000; export const FRACTION_PRECISION_N = 1_000_000n; diff --git a/governance/pyth_staking_sdk/src/pdas.ts b/governance/pyth_staking_sdk/src/pdas.ts index ff316940a4..29df5af889 100644 --- a/governance/pyth_staking_sdk/src/pdas.ts +++ b/governance/pyth_staking_sdk/src/pdas.ts @@ -64,14 +64,12 @@ export const getVoterWeightRecordAddress = ( return PublicKey.findProgramAddressSync( [Buffer.from("voter_weight"), stakeAccountPositions.toBuffer()], STAKING_PROGRAM_ADDRESS, - )[0]; + ); }; -export const getMaxVoterWeightRecordAddress = ( - stakeAccountPositions: PublicKey, -) => { +export const getMaxVoterWeightRecordAddress = () => { return PublicKey.findProgramAddressSync( - [Buffer.from("max_voter"), stakeAccountPositions.toBuffer()], + [Buffer.from("max_voter")], STAKING_PROGRAM_ADDRESS, - )[0]; + ); }; diff --git a/governance/pyth_staking_sdk/src/pyth-staking-client.ts b/governance/pyth_staking_sdk/src/pyth-staking-client.ts index 56ab083f2d..f32f00923c 100644 --- a/governance/pyth_staking_sdk/src/pyth-staking-client.ts +++ b/governance/pyth_staking_sdk/src/pyth-staking-client.ts @@ -769,7 +769,7 @@ export class PythStakingClient { */ public async getScalingFactor(): Promise { const targetAccount = await this.getTargetAccount(); - return Number(targetAccount.locked) / MAX_VOTER_WEIGHT; + return Number(targetAccount.locked) / Number(MAX_VOTER_WEIGHT); } public async getRecoverAccountInstruction( @@ -821,8 +821,8 @@ export class PythStakingClient { .instruction(); } - public async getMainStakeAccount() { - const stakeAccountPositions = await this.getAllStakeAccountPositions(); + public async getMainStakeAccount(owner?: PublicKey) { + const stakeAccountPositions = await this.getAllStakeAccountPositions(owner); const currentEpoch = await getCurrentEpoch(this.connection); const stakeAccountVotingTokens = await Promise.all( @@ -858,17 +858,18 @@ export class PythStakingClient { return mainAccount; } - public async getVoterWeight() { - const mainAccount = await this.getMainStakeAccount(); + public async getVoterWeight(owner?: PublicKey) { + const mainAccount = await this.getMainStakeAccount(owner); if (mainAccount === undefined) { return 0; } - const scalingFactor = await this.getScalingFactor(); - return Number(mainAccount.votingTokens) / scalingFactor; + const targetAccount = await this.getTargetAccount(); + + return (mainAccount.votingTokens * MAX_VOTER_WEIGHT) / targetAccount.locked; } - + public async getPythTokenMint(): Promise { const globalConfig = await this.getGlobalConfig(); return getMint(this.connection, globalConfig.pythTokenMint); From b6d0e705cb79b031fad981243852a315a7b7560e Mon Sep 17 00:00:00 2001 From: keyvan Date: Tue, 24 Sep 2024 16:08:37 -0700 Subject: [PATCH 9/9] fix --- governance/pyth_staking_sdk/package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/governance/pyth_staking_sdk/package.json b/governance/pyth_staking_sdk/package.json index edbd5d55d7..dcc490a863 100644 --- a/governance/pyth_staking_sdk/package.json +++ b/governance/pyth_staking_sdk/package.json @@ -2,11 +2,14 @@ "name": "@pythnetwork/staking-sdk", "version": "0.0.1", "description": "Pyth staking SDK", - "main": "src/index.ts", - "types": "src/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "publishConfig": { "access": "public" }, + "files": [ + "dist/**/*" + ], "scripts": { "build": "tsc && node scripts/update-package-json.mjs", "test": "pnpm run test:format && pnpm run test:lint && pnpm run test:integration && pnpm run test:types",