diff --git a/components/instructions/programs/foresight.tsx b/components/instructions/programs/foresight.tsx index 839d999965..c8846f031f 100644 --- a/components/instructions/programs/foresight.tsx +++ b/components/instructions/programs/foresight.tsx @@ -82,7 +82,7 @@ async function fetchMarketListId( } export const FORESIGHT_INSTRUCTIONS = { - [consts.DEVNET_PID]: { + [consts.PROGRAM_ID]: { 65: { name: 'Foresight: Init Category', accounts: findAccounts('initCategory'), @@ -215,7 +215,7 @@ export const FORESIGHT_INSTRUCTIONS = { const marketListId = Buffer.from(marketAccount.marketListId) const [metadataPubkey] = utils.publicKey.findProgramAddressSync( [Buffer.from('market_metadata'), marketId, marketListId], - new PublicKey(consts.DEVNET_PID) + consts.PROGRAM_ID_PUBKEY ) const metadataAccount = await generatedAccounts.MarketMetadata.fetch( connection, diff --git a/components/instructions/programs/names.ts b/components/instructions/programs/names.ts index 98d7938169..f27acf93a4 100644 --- a/components/instructions/programs/names.ts +++ b/components/instructions/programs/names.ts @@ -31,7 +31,7 @@ export const PROGRAM_NAMES = { SysvarC1ock11111111111111111111111111111111: 'Sysvar: Clock', '4Q6WW2ouZ6V3iaNm56MTd5n2tnTm4C5fiH8miFHnAFHo': 'Mango Voter Stake Registry Program', - [foresightConsts.DEVNET_PID]: 'Foresight Devnet', + [foresightConsts.PROGRAM_ID]: 'Foresight Dex', ...GOVERNANCE_PROGRAM_NAMES, } diff --git a/package.json b/package.json index a517eb66ce..7ba553f340 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@dialectlabs/react-ui": "0.8.2", "@emotion/react": "^11.9.0", "@emotion/styled": "^11.8.1", - "@foresight-tmp/foresight-sdk": "^0.1.41", + "@foresight-tmp/foresight-sdk": "^0.1.44", "@friktion-labs/friktion-sdk": "^1.1.25", "@headlessui/react": "^1.5.0", "@heroicons/react": "^1.0.1", diff --git a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeAddMarketListToCategoryParams.tsx b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeAddMarketListToCategoryParams.tsx index 033e8af1f3..488c3fbe6e 100644 --- a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeAddMarketListToCategoryParams.tsx +++ b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeAddMarketListToCategoryParams.tsx @@ -3,16 +3,12 @@ import React from 'react' import { ForesightMakeAddMarketListToCategoryParams } from '@utils/uiTypes/proposalCreationTypes' import { Governance } from '@solana/spl-governance' import { ProgramAccount } from '@solana/spl-governance' -import { - governance as foresightGov, - consts, -} from '@foresight-tmp/foresight-sdk' +import { governance as foresightGov } from '@foresight-tmp/foresight-sdk' import { commonAssets, ForesightCategoryIdInput, ForesightMarketListIdInput, } from '@utils/Foresight' -import { PublicKey } from '@solana/web3.js' function MakeAddMarketListToCategoryParams({ index, @@ -35,7 +31,6 @@ function MakeAddMarketListToCategoryParams({ const { ix } = await foresightGov.genAddMarketListToCategoryIx( Buffer.from(form.categoryId.padEnd(20)), Buffer.from(form.marketListId.padEnd(20)), - new PublicKey(consts.DEVNET_PID), wallet!.publicKey! ) return ix diff --git a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitCategoryParams.tsx b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitCategoryParams.tsx index eb8cd728b6..04003cf3da 100644 --- a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitCategoryParams.tsx +++ b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitCategoryParams.tsx @@ -3,12 +3,8 @@ import React from 'react' import { ForesightHasCategoryId } from '@utils/uiTypes/proposalCreationTypes' import { Governance } from '@solana/spl-governance' import { ProgramAccount } from '@solana/spl-governance' -import { - governance as foresightGov, - consts as foresightConsts, -} from '@foresight-tmp/foresight-sdk' +import { governance as foresightGov } from '@foresight-tmp/foresight-sdk' import { commonAssets, ForesightCategoryIdInput } from '@utils/Foresight' -import { PublicKey } from '@solana/web3.js' const MakeInitCategoryParams = ({ index, @@ -30,7 +26,6 @@ const MakeInitCategoryParams = ({ async function ixCreator(form: ForesightHasCategoryId) { const { ix } = await foresightGov.genInitCategoryIx( Buffer.from(form.categoryId.padEnd(20)), - new PublicKey(foresightConsts.DEVNET_PID), wallet!.publicKey! ) return ix diff --git a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitMarketListParams.tsx b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitMarketListParams.tsx index b49605960b..158a268b51 100644 --- a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitMarketListParams.tsx +++ b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitMarketListParams.tsx @@ -3,12 +3,8 @@ import React from 'react' import { ForesightHasMarketListId } from '@utils/uiTypes/proposalCreationTypes' import { Governance } from '@solana/spl-governance' import { ProgramAccount } from '@solana/spl-governance' -import { - governance as foresightGov, - consts, -} from '@foresight-tmp/foresight-sdk' +import { governance as foresightGov } from '@foresight-tmp/foresight-sdk' import { commonAssets, ForesightMarketListIdInput } from '@utils/Foresight' -import { PublicKey } from '@solana/web3.js' const MakeInitMarketListParams = ({ index, @@ -30,7 +26,6 @@ const MakeInitMarketListParams = ({ async function ixCreator(form: ForesightHasMarketListId) { const { ix } = await foresightGov.genInitMarketListIx( Buffer.from(form.marketListId.padEnd(20)), - new PublicKey(consts.DEVNET_PID), wallet!.publicKey!, form.governedAccount.extensions.transferAddress! ) diff --git a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitMarketParams.tsx b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitMarketParams.tsx index 63ca7184b9..c7a5386b3e 100644 --- a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitMarketParams.tsx +++ b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeInitMarketParams.tsx @@ -3,17 +3,12 @@ import React from 'react' import { ForesightHasMarketId } from '@utils/uiTypes/proposalCreationTypes' import { Governance } from '@solana/spl-governance' import { ProgramAccount } from '@solana/spl-governance' -import { - governance as foresightGov, - utils, - consts, -} from '@foresight-tmp/foresight-sdk' +import { governance as foresightGov, utils } from '@foresight-tmp/foresight-sdk' import { commonAssets, ForesightMarketIdInput, ForesightMarketListIdInput, } from '@utils/Foresight' -import { PublicKey } from '@solana/web3.js' const MakeInitMarketParams = ({ index, @@ -36,7 +31,6 @@ const MakeInitMarketParams = ({ const { ix } = await foresightGov.genInitMarketIx( Buffer.from(form.marketListId.padEnd(20)), utils.intToArray(form.marketId, 1), - new PublicKey(consts.DEVNET_PID), wallet!.publicKey! ) return ix diff --git a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeResolveMarketParams.tsx b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeResolveMarketParams.tsx index 4299cfe542..928e5850b1 100644 --- a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeResolveMarketParams.tsx +++ b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeResolveMarketParams.tsx @@ -3,18 +3,13 @@ import React from 'react' import { ForesightMakeResolveMarketParams } from '@utils/uiTypes/proposalCreationTypes' import { Governance } from '@solana/spl-governance' import { ProgramAccount } from '@solana/spl-governance' -import { - governance as foresightGov, - utils, - consts, -} from '@foresight-tmp/foresight-sdk' +import { governance as foresightGov, utils } from '@foresight-tmp/foresight-sdk' import { commonAssets, ForesightMarketIdInput, ForesightMarketListIdInput, ForesightWinnerInput, } from '@utils/Foresight' -import { PublicKey } from '@solana/web3.js' const MakeResolveMarketParams = ({ index, @@ -37,7 +32,6 @@ const MakeResolveMarketParams = ({ form.winner, utils.intToArray(form.marketId, 1), Buffer.from(form.marketListId.padEnd(20)), - new PublicKey(consts.DEVNET_PID), form.governedAccount.extensions.transferAddress! ) return ix diff --git a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeSetMarketMetadataParams.tsx b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeSetMarketMetadataParams.tsx index 8889ecb0c0..4c5bfb82d4 100644 --- a/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeSetMarketMetadataParams.tsx +++ b/pages/dao/[symbol]/proposal/components/instructions/Foresight/MakeSetMarketMetadataParams.tsx @@ -7,7 +7,6 @@ import { governance as foresightGov, consts as foresightConsts, utils, - consts, } from '@foresight-tmp/foresight-sdk' import { commonAssets, @@ -16,7 +15,6 @@ import { ForesightMarketListIdInput, ForesightMarketMetadataFieldSelect, } from '@utils/Foresight' -import { PublicKey } from '@solana/web3.js' export default function MakeSetMarketMetadataParams({ index, @@ -49,7 +47,6 @@ export default function MakeSetMarketMetadataParams({ Buffer.from(form.marketListId.padEnd(20)), form.content, new field(), - new PublicKey(consts.DEVNET_PID), wallet!.publicKey! ) return ix diff --git a/yarn.lock b/yarn.lock index ce620ade01..f1f6fe1885 100644 --- a/yarn.lock +++ b/yarn.lock @@ -868,10 +868,10 @@ lodash.isundefined "^3.0.1" lodash.uniq "^4.5.0" -"@foresight-tmp/foresight-sdk@^0.1.41": - version "0.1.41" - resolved "https://registry.yarnpkg.com/@foresight-tmp/foresight-sdk/-/foresight-sdk-0.1.41.tgz#ff652a13a683923bdce435f0b6df776ecb844758" - integrity sha512-P9wvA37sBIErQo8XjXUK5KZqElS9gkS4Emw2fQvaRfjbcOaTvIpM1hTeFUi3oDj3Rh+GJ07cnF2RSXfxURcAug== +"@foresight-tmp/foresight-sdk@^0.1.44": + version "0.1.44" + resolved "https://registry.yarnpkg.com/@foresight-tmp/foresight-sdk/-/foresight-sdk-0.1.44.tgz#b7fee32272a9f16fd12e93da1bcbba532bb90183" + integrity sha512-MMBGcfKIwcRrllih2IaOEdnSZuE0fYrNQcSJBAuwxG6ORknKShYHPqp2cRq5NEnNZS90I0AMzhpdDXv+N/302g== dependencies: "@project-serum/anchor" "^0.23.0" "@project-serum/serum" "0.13.64"