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

Added ZK Compression program names #389

Merged
Merged
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
30 changes: 24 additions & 6 deletions app/utils/programs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ export enum PROGRAM_NAMES {
OPENBOOK_DEX = 'OpenBook Dex',
FINTERNET_USER_MANAGER = 'Finternet - User manager',
FINTERNET_TOKEN_MANAGER = 'Finternet - Token manager',

// ZK Compression
ZK_LIGHT_SYSTEM_PROGRAM = 'Light System Program',
ZK_COMPRESSED_TOKEN_PROGRAM = 'ZK Compressed Token Program',
ZK_ACCOUNT_COMPRESSION_PROGRAM = 'ZK Account Compression Program',
}

const ALL_CLUSTERS = [Cluster.Custom, Cluster.Devnet, Cluster.Testnet, Cluster.MainnetBeta];
Expand Down Expand Up @@ -204,7 +209,7 @@ export const PROGRAM_INFO_BY_ID: { [address: string]: ProgramInfo } = {
name: PROGRAM_NAMES.CLOCKWORK_2,
},
CmFuqQTLs2nQof5uaktJn1a6k2VdbGmZPfrJufB2Vm3F: {
deployments: [Cluster.Devnet,Cluster.MainnetBeta],
deployments: [Cluster.Devnet, Cluster.MainnetBeta],
name: PROGRAM_NAMES.FINTERNET_USER_MANAGER,
},
ComputeBudget111111111111111111111111111111: {
Expand Down Expand Up @@ -351,6 +356,10 @@ export const PROGRAM_INFO_BY_ID: { [address: string]: ProgramInfo } = {
deployments: LIVE_CLUSTERS,
name: PROGRAM_NAMES.SWAP,
},
SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7: {
deployments: [Cluster.MainnetBeta, Cluster.Devnet],
name: PROGRAM_NAMES.ZK_LIGHT_SYSTEM_PROGRAM,
},
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA: {
deployments: ALL_CLUSTERS,
name: PROGRAM_NAMES.TOKEN,
Expand Down Expand Up @@ -379,6 +388,10 @@ export const PROGRAM_INFO_BY_ID: { [address: string]: ProgramInfo } = {
deployments: LIVE_CLUSTERS,
name: PROGRAM_NAMES.NFT_AUCTION,
},
cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m: {
deployments: [Cluster.MainnetBeta, Cluster.Devnet],
name: PROGRAM_NAMES.ZK_COMPRESSED_TOKEN_PROGRAM,
},
cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ: {
deployments: [Cluster.Devnet, Cluster.MainnetBeta],
name: PROGRAM_NAMES.CHAINLINK_ORACLE,
Expand All @@ -395,6 +408,10 @@ export const PROGRAM_INFO_BY_ID: { [address: string]: ProgramInfo } = {
deployments: LIVE_CLUSTERS,
name: PROGRAM_NAMES.NFT_CANDY_MACHINE,
},
compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq: {
deployments: [Cluster.MainnetBeta, Cluster.Devnet],
name: PROGRAM_NAMES.ZK_ACCOUNT_COMPRESSION_PROGRAM,
},
gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s: {
deployments: [Cluster.Devnet],
name: PROGRAM_NAMES.PYTH_DEVNET,
Expand All @@ -413,7 +430,7 @@ export const PROGRAM_INFO_BY_ID: { [address: string]: ProgramInfo } = {
},
oreV2ZymfyeXgNgBdqMkumTqqAprVqgBWQfoYkrtKWQ: {
deployments: [Cluster.MainnetBeta],
name: PROGRAM_NAMES.ORE
name: PROGRAM_NAMES.ORE,
},
p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98: {
deployments: LIVE_CLUSTERS,
Expand Down Expand Up @@ -456,19 +473,20 @@ export const SYSVAR_IDS: { [key: string]: string } = {
};

export const TOKEN_IDS: { [key: string]: string } = {
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA: 'Token Program',
TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb: 'Token-2022 Program',
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA: 'Token Program',
TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb: 'Token-2022 Program',
} as const;

export type TokenProgram = 'spl-token' | 'spl-token-2022';
export function assertIsTokenProgram(program: string): asserts program is TokenProgram {
if (program !== 'spl-token' && program !== 'spl-token-2022') throw new Error("Expected token program name of `spl-token` or `spl-token-2022`");
if (program !== 'spl-token' && program !== 'spl-token-2022')
throw new Error('Expected token program name of `spl-token` or `spl-token-2022`');
}
export function isTokenProgram(program: string): program is TokenProgram {
try {
assertIsTokenProgram(program);
return true;
} catch(e) {
} catch (e) {
return false;
}
}
Loading