This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
URANI
committed
Mar 28, 2024
1 parent
af9c320
commit d72779f
Showing
28 changed files
with
413 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...i/anchor/programs/dapp-example/Cargo.toml → ...pp_cli/anchor/programs/counter/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
demos/frontend/07_create_dapp_cli/anchor/src/counter-exports.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Here we export some useful types and functions for interacting with the Anchor program. | ||
import { Cluster, PublicKey } from '@solana/web3.js'; | ||
import type { Counter } from '../target/types/counter'; | ||
import { IDL as CounterIDL } from '../target/types/counter'; | ||
|
||
// Re-export the generated IDL and type | ||
export { Counter, CounterIDL }; | ||
|
||
// After updating your program ID (e.g. after running `anchor keys sync`) update the value below. | ||
export const COUNTER_PROGRAM_ID = new PublicKey( | ||
'FaC3oSqrzou2eaJft4UpCxZYtCe6hGa4WWSLTzg1yRMD' | ||
); | ||
|
||
// This is a helper function to get the program ID for the Counter program depending on the cluster. | ||
export function getCounterProgramId(cluster: Cluster) { | ||
switch (cluster) { | ||
case 'devnet': | ||
case 'testnet': | ||
// This is the program ID for the Counter program on devnet and testnet. | ||
return new PublicKey('CounNZdmsQmWh7uVngV9FXW2dZ6zAgbJyYsvBpqbykg'); | ||
case 'mainnet-beta': | ||
default: | ||
return COUNTER_PROGRAM_ID; | ||
} | ||
} |
23 changes: 0 additions & 23 deletions
23
demos/frontend/07_create_dapp_cli/anchor/src/dapp-example-exports.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This file was generated by preset-anchor. Programs are exported from this file. | ||
|
||
export * from './dapp-example-exports'; | ||
export * from './counter-exports'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.