diff --git a/.github/workflows/pr_validate_anchor_idl.yml b/.github/workflows/pr_validate_anchor_idl.yml index 567b8acb..11359734 100644 --- a/.github/workflows/pr_validate_anchor_idl.yml +++ b/.github/workflows/pr_validate_anchor_idl.yml @@ -21,11 +21,11 @@ jobs: - name: Validate anchor IDL shell: bash run: | - if [ $(cat anchor/target/idl/glam.json | jq -r .address) == "GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP" ]; then + if [ $(cat anchor/target/idl/glam.json | jq -r .address) == "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc" ]; then echo "Anchor IDL program address is correct." else echo "Anchor IDL program address is incorrect." - echo "Program address in the main branch IDL should be GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP (mainnet deploy)." + echo "Program address in the main branch IDL should be GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc (mainnet deploy)." echo "Make sure you run \"anchor build\" or \"pnpm run anchor-build\" before pushing changes to your PR." exit 1 fi diff --git a/anchor/Anchor.toml b/anchor/Anchor.toml index 75509f0f..97cfd6c3 100644 --- a/anchor/Anchor.toml +++ b/anchor/Anchor.toml @@ -6,7 +6,7 @@ seeds = false skip-lint = false [programs.mainnet] -glam = "GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP" +glam = "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc" [programs.devnet] glam = "Gco1pcjxCMYjKJjSNJ7mKV7qezeUTE7arXJgy7PAPNRc" diff --git a/anchor/programs/glam/src/lib.rs b/anchor/programs/glam/src/lib.rs index 4cdc3fde..09a910ac 100644 --- a/anchor/programs/glam/src/lib.rs +++ b/anchor/programs/glam/src/lib.rs @@ -13,7 +13,7 @@ pub use state::model::*; use ::drift::{MarketType, OrderParams, PositionDirection}; #[cfg(feature = "mainnet")] -declare_id!("GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP"); +declare_id!("GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc"); #[cfg(not(feature = "mainnet"))] declare_id!("Gco1pcjxCMYjKJjSNJ7mKV7qezeUTE7arXJgy7PAPNRc"); diff --git a/anchor/src/client/state.ts b/anchor/src/client/state.ts index 9d220f48..1e0d8e7c 100644 --- a/anchor/src/client/state.ts +++ b/anchor/src/client/state.ts @@ -23,8 +23,6 @@ import { ShareClassOpenfundsModel, CreatedModel, Metadata, - StateIdlModel, - StateModelType, } from "../models"; import { WSOL } from "../constants"; @@ -99,7 +97,7 @@ export class StateClient { // FIXME: setting rawOpenfunds to null is a workarond for // Access violation in stack frame 5 at address 0x200005ff8 of size 8 - // shareClass.rawOpenfunds = null; + shareClass.rawOpenfunds = null; return await this.base.program.methods .addShareClass(shareClass) .accounts({ diff --git a/anchor/src/glamExports.ts b/anchor/src/glamExports.ts index df496e62..c02e07a7 100644 --- a/anchor/src/glamExports.ts +++ b/anchor/src/glamExports.ts @@ -13,7 +13,7 @@ export const GLAM_PROGRAM_ID_DEV = new PublicKey( "Gco1pcjxCMYjKJjSNJ7mKV7qezeUTE7arXJgy7PAPNRc", ); export const GLAM_PROGRAM_ID_MAINNET = new PublicKey( - "GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP", + "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc", ); export function getGlamProgramId(cluster: ClusterNetwork) { diff --git a/anchor/src/models.ts b/anchor/src/models.ts index 3e5fe503..0ce76c9f 100644 --- a/anchor/src/models.ts +++ b/anchor/src/models.ts @@ -7,7 +7,7 @@ import { BN } from "@coral-xyz/anchor"; export const GlamIntegrations = GlamIDLJson?.types - ?.find((t) => t.name === "IntegrationName") + ?.find((t) => t.name === "Integration") ?.type?.variants?.map((v) => v.name) ?? []; export const GlamPermissions = @@ -15,8 +15,6 @@ export const GlamPermissions = ?.find((t) => t.name === "Permission") ?.type?.variants?.map((v) => v.name) ?? []; -export const VaultIntegrations = GlamIntegrations.filter((i) => i !== "Mint"); - const GLAM_PROGRAM_ID_DEFAULT = new PublicKey(GlamIDLJson.address); export type StateAccountType = IdlTypes["accountType"]; diff --git a/anchor/target/idl/glam.json b/anchor/target/idl/glam.json index f20b579c..71a2ff6b 100644 --- a/anchor/target/idl/glam.json +++ b/anchor/target/idl/glam.json @@ -1,5 +1,5 @@ { - "address": "GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP", + "address": "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc", "metadata": { "name": "glam", "version": "0.4.0", diff --git a/anchor/target/types/glam.ts b/anchor/target/types/glam.ts index dc66da9d..23596595 100644 --- a/anchor/target/types/glam.ts +++ b/anchor/target/types/glam.ts @@ -5,7 +5,7 @@ * IDL can be found at `target/idl/glam.json`. */ export type Glam = { - "address": "GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP", + "address": "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc", "metadata": { "name": "glam", "version": "0.4.0", diff --git a/cli/src/main.ts b/cli/src/main.ts index 5c373c1a..d1fb4403 100644 --- a/cli/src/main.ts +++ b/cli/src/main.ts @@ -1,11 +1,10 @@ import * as anchor from "@coral-xyz/anchor"; import { StateModel, - Integration, WSOL, getPriorityFeeEstimate, GlamClient, - VaultIntegrations, + GlamIntegrations, GlamPermissions, } from "@glam/anchor"; import { LAMPORTS_PER_SOL, PublicKey } from "@solana/web3.js"; @@ -413,7 +412,7 @@ integration } }); -const allowIntegrations = VaultIntegrations.map( +const allowIntegrations = GlamIntegrations.map( (i) => i.slice(0, 1).toLowerCase() + i.slice(1), ); const integrationValidation = (input) => { diff --git a/playground/src/components/integrations/data.tsx b/playground/src/components/integrations/data.tsx index 1f8e67a3..83d6aaa7 100644 --- a/playground/src/components/integrations/data.tsx +++ b/playground/src/components/integrations/data.tsx @@ -1,4 +1,4 @@ -import { VaultIntegrations } from "@glam/anchor"; +import { GlamIntegrations } from "@glam/anchor"; const metadata = { Drift: { @@ -37,7 +37,7 @@ const metadata = { }, } as { [key: string]: { description: string; labels: string[] } }; -export const allIntegrations = VaultIntegrations.sort().map((integ, index) => ({ +export const allIntegrations = GlamIntegrations.sort().map((integ, index) => ({ id: index, name: integ, enabled: false,