Skip to content

Commit

Permalink
Add foresight mainnet (solana-labs#747)
Browse files Browse the repository at this point in the history
* add fore mainnet token mint

* update foresight-sdk dep

* add foresight mainnet treasury

* update yarn.lock

* add mainnet details for foresight dao

* take out bad comma

* update foresight token accounts filter
  • Loading branch information
kevinheavey authored Jun 14, 2022
1 parent 3e8197e commit 0b7f00a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
4 changes: 3 additions & 1 deletion components/instructions/tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ export const ACCOUNT_NAMES = {
'Mango v3 BTC-PERP Incentive Vault',
'7Gm5zF6FNJpyhqdwKcEdMQw3r5YzitYUGVDKYMPT1cMy': 'Mango V3 Admin Key',
MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac: 'MNGO Token Mint',
H7uqouPsJkeEiLpCEoC1qYVVquDrZan6ZfdPK2gS44zm: 'FORE Token Mint',
H7uqouPsJkeEiLpCEoC1qYVVquDrZan6ZfdPK2gS44zm: 'FORE Devnet Token Mint',
'4ahVJVavHM8DZCtjX6YuKSTFx6KJwRPmVCJtjdQYdUU7': 'FORE Mainnet Token Mint',
[foresightGov.DEVNET_TREASURY.toBase58()]: 'Foresight Devnet Governance',
[foresightGov.MAINNET_TREASURY.toBase58()]: 'Foresight Mainnet Governance',
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: 'USDC Token Mint',

MyHd6a7HWKTMeJMHBkrbMq4hZwZxwn9x7dxXcopQ4Wd: 'OMH Token',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@friktion-labs/friktion-sdk": "^1.1.118",
"@foresight-tmp/foresight-sdk": "^0.1.44",
"@foresight-tmp/foresight-sdk": "^0.1.45",
"@headlessui/react": "^1.5.0",
"@heroicons/react": "^1.0.1",
"@marinade.finance/marinade-ts-sdk": "^2.0.9",
Expand Down
9 changes: 9 additions & 0 deletions public/realms/mainnet-beta.json
Original file line number Diff line number Diff line change
Expand Up @@ -788,5 +788,14 @@
"website": "https://samoyedcoin.com",
"twitter": "@Samo_DAO",
"ogImage": "/realms/SamoDAO/SamoDAO.png"
},
{
"symbol": "FORE",
"displayName": "Foresight DAO",
"programId": "GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw",
"realmId": "CZatgrcvaDN9ib1sQeSCJWUnBXc899ydTB9vfAHHBVfP",
"ogImage": "https://www.foresight.exchange/logo.png",
"website": "https://www.foresight.exchange/",
"twitter": "@foresightmkt"
}
]
10 changes: 7 additions & 3 deletions utils/Foresight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ type SetFormErrors = Dispatch<React.SetStateAction<EmptyObject>>

export function getFilteredTokenAccounts(): AssetAccount[] {
const { governedTokenAccountsWithoutNfts } = useGovernanceAssets()
return governedTokenAccountsWithoutNfts.filter((x) =>
x.extensions.transferAddress?.equals(foresightGov.DEVNET_TREASURY)
)
return governedTokenAccountsWithoutNfts.filter((x) => {
const transferAddress = x.extensions.transferAddress
return (
transferAddress?.equals(foresightGov.DEVNET_TREASURY) ||
transferAddress?.equals(foresightGov.MAINNET_TREASURY)
)
})
}

type HandleSetForm = ({
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,10 @@
lodash.isundefined "^3.0.1"
lodash.uniq "^4.5.0"

"@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==
"@foresight-tmp/foresight-sdk@^0.1.45":
version "0.1.46"
resolved "https://registry.yarnpkg.com/@foresight-tmp/foresight-sdk/-/foresight-sdk-0.1.46.tgz#f928dde22f424cfd438f8c9116d5ce84f5b56864"
integrity sha512-fqYnT+OrRDe84OWoDGow4KB5KYX/sRP+jg0Ylz0ExdNqoewK8gLmmAg6AvPc+B9ItAhcDhEBf0H/cGG6HpIQdw==
dependencies:
"@project-serum/anchor" "^0.23.0"
"@project-serum/serum" "0.13.64"
Expand Down

0 comments on commit 0b7f00a

Please sign in to comment.