Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/prepare split #211

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/client/src/blaze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ import {
type Transaction,
} from "@solana/web3.js";
import type BN from "bn.js";
import {
findBSolTokenAccountAuthority,
findGSolMintAuthority,
type SunriseStakeConfig,
} from "./util";
import { findBSolTokenAccountAuthority, findGSolMintAuthority } from "./util";
import { STAKE_POOL_PROGRAM_ID } from "./constants";
import { type AnchorProvider, type Program, utils } from "@coral-xyz/anchor";
import { type SunriseStakeConfig } from "./types/Config";
import { type SunriseStake } from "./types/sunrise_stake";
import { TOKEN_PROGRAM_ID } from "@solana/spl-token";
import { type BlazeState } from "./types/Solblaze";
Expand Down
55 changes: 55 additions & 0 deletions packages/client/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@ export const IMPACT_NFT_PROGRAM_ID = new PublicKey(
"SUNFT6ErsQvMcDzMcGyndq2P31wYCFs6G6WEcoyGkGc"
);

export const MARINADE_PROGRAM_ID = new PublicKey(
"MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD"
);

interface BlazeConfig {
pool: PublicKey;
bsolMint: PublicKey;
}

interface MarinadeConfig {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this in order to be able to remove the marinade sdk from our build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could be a long-term idea. Right now it only reduces our dependency on it. i.e now we're able to derive the bsolTokenAccountAuthority without needing to have called initMarinade() first.

stateAddress: PublicKey;
msolMintAddress: PublicKey;
lpMintAddress: PublicKey;
}

export interface EnvironmentConfig {
state: PublicKey;
holdingAccount: PublicKey;
Expand All @@ -30,6 +40,7 @@ export interface EnvironmentConfig {
impactNFT: {
state: PublicKey | undefined; // if undefined, impact nft is disabled
};
marinade: MarinadeConfig;
}
export const Environment: Record<
WalletAdapterNetwork | "localnet",
Expand All @@ -51,6 +62,17 @@ export const Environment: Record<
impactNFT: {
state: new PublicKey("6RzCneyeEqnjiWxrzqfBwHDEpTrbcSkBFFUrtMZnNjpc"),
},
marinade: {
stateAddress: new PublicKey(
"8szGkuLTAux9XMgZ2vtY39jVSowEcpBfFfD8hXSEqdGC"
),
msolMintAddress: new PublicKey(
"mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"
),
lpMintAddress: new PublicKey(
"LPmSozJJ8Jh69ut2WP3XmVohTjL4ipR18yiCzxrUmVj"
),
},
},
// TODO placeholders
testnet: {
Expand All @@ -67,6 +89,17 @@ export const Environment: Record<
impactNFT: {
state: PublicKey.default, // TODO
},
marinade: {
stateAddress: new PublicKey(
"8szGkuLTAux9XMgZ2vtY39jVSowEcpBfFfD8hXSEqdGC"
),
msolMintAddress: new PublicKey(
"mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"
),
lpMintAddress: new PublicKey(
"LPmSozJJ8Jh69ut2WP3XmVohTjL4ipR18yiCzxrUmVj"
),
},
},
devnet: {
state: new PublicKey("Jpp29FzyV7rXdVRWFaiE9tBcVCaEMvj16gk87rC3S4z"),
Expand All @@ -84,6 +117,17 @@ export const Environment: Record<
impactNFT: {
state: new PublicKey("6iyfwPbbLeYAoUcQkECCPwftFuw3j5VEcXF7xcQeAdX6"),
},
marinade: {
stateAddress: new PublicKey(
"8szGkuLTAux9XMgZ2vtY39jVSowEcpBfFfD8hXSEqdGC"
),
msolMintAddress: new PublicKey(
"mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"
),
lpMintAddress: new PublicKey(
"LPmSozJJ8Jh69ut2WP3XmVohTjL4ipR18yiCzxrUmVj"
),
},
},
localnet: {
state: new PublicKey("28SkW4iD7UJc9zkxcq6yNb1MFX2hxqdJjxjZs67Jwr2b"),
Expand All @@ -101,6 +145,17 @@ export const Environment: Record<
impactNFT: {
state: PublicKey.default, // TODO
},
marinade: {
stateAddress: new PublicKey(
"8szGkuLTAux9XMgZ2vtY39jVSowEcpBfFfD8hXSEqdGC"
),
msolMintAddress: new PublicKey(
"mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"
),
lpMintAddress: new PublicKey(
"LPmSozJJ8Jh69ut2WP3XmVohTjL4ipR18yiCzxrUmVj"
),
},
},
};

Expand Down
Loading