| Crates.io | gmsol-timelock |
| lib.rs | gmsol-timelock |
| version | 0.5.0 |
| created_at | 2025-05-12 12:41:24.100759+00 |
| updated_at | 2025-05-16 05:18:21.677051+00 |
| description | GMX-Solana is an extension of GMX on the Solana blockchain. |
| homepage | |
| repository | https://github.com/gmsol-labs/gmx-solana |
| max_upload_size | |
| id | 1670540 |
| size | 197,426 |
| Program | Last Audit Date | Version |
|---|---|---|
| gmsol-store | 2025-03-07 | 2a66761 |
| gmsol-treasury | 2025-03-07 | 2a66761 |
| gmsol-timelock | 2025-03-07 | 2a66761 |
Add the following to your Cargo.toml:
[dependencies]
gmsol-sdk = { version = "0.5.0", features = ["client"] }
Create a Client and start using the core APIs:
use gmsol_sdk::{
Client,
ops::ExchangeOps,
solana_utils::{
cluster::Cluster,
solana_sdk::{pubkey::Pubkey, signature::read_keypair_file},
},
};
let keypair =
read_keypair_file(std::env::var("KEYPAIR")?)?;
let market_token: Pubkey = std::env::var("MARKET_TOKEN")?.parse()?;
let client = Client::new(Cluster::Mainnet, &keypair)?;
let store = client.find_store_address("");
let (txn, order) = client
.market_increase(
&store,
&market_token,
true,
5_000_000,
true,
500_000_000_000_000_000_000,
)
.build_with_address()
.await?;
let signature = txn.send().await?;
declare_program!Create a new Rust project and include anchor_lang and bytemuck as dependencies:
[dependencies]
anchor-lang = "0.30.1"
bytemuck = { version = "1.19.0", features = ["min_const_generics"] }
{PROJECT_ROOT}/idls/You can retrieve the IDLs using the anchor CLI or download them directly from the explorer (gmsol-store Program and gmsol-treasury Program).
Once downloaded, move them to the {PROJECT_ROOT}/idls/ directory.
Your project structure should now look like this:
{PROJECT_ROOT}/
├── .gitignore
├── Cargo.lock
├── Cargo.toml
├── idls
│ ├── gmsol_store.json
│ └── gmsol_treasury.json
└── src
└── lib.rs
lib.rsUse declare_program! to register the gmsol-store and gmsol-treasury programs:
use anchor_lang::declare_program;
declare_program!(gmsol_store);
declare_program!(gmsol_treasury);
Run the following command to generate and view the documentation:
cargo doc --open
If the build is successful, it will automatically open the documentation in your default web browser.
For a working implementation, check out the gmx-solana-programs.
To run all tests:
just
To install the gmsol CLI:
cargo install-gmsol
Use the following command to verify the CLI is installed properly:
gmsol --version
test-validator on MacOSError Message:
Error: failed to start validator: Failed to create ledger at test-ledger: io error: Error checking to unpack genesis archive: Archive error: extra entry found: "._genesis.bin" Regular
Posssible Solution:
Check this comment.