Crates.io | sol-did-cpi |
lib.rs | sol-did-cpi |
version | 0.0.1 |
source | src |
created_at | 2022-10-12 13:50:25.227924 |
updated_at | 2022-10-12 13:50:25.227924 |
description | CPI helpers for the Sol-DID program |
homepage | |
repository | |
max_upload_size | |
id | 686325 |
size | 18,047 |
_# sol-did-cpi
CPI helpers for the Sol-DID program, that manages the did:sol DID method on Solana.
This crate was automatically generated by anchor-gen, a crate for generating Anchor CPI helpers from JSON IDLs.
use sol_did_cpi::State;
use sol_did_cpi::cpi::{ initialize };
use sol_did_cpi::cpi::accounts::{ Initialize };
use sol_did_cpi::program::sol_did;
pub fn initialize(ctx: Context<Initialize>, size: u64) -> Result<()> {
let cpi_program = ctx.accounts.sol_did_program.to_account_info();
let cpi_accounts = Initialize {
did_data: ctx.accounts.did_data.to_account_info(),
authority: ctx.accounts.authority.to_account_info(),
payer: ctx.accounts.payer.to_account_info(),
system_program: ctx.accounts.system_program.to_account_info(),
};
let cpi_ctx = CpiContext::new(cpi_program, cpi_accounts);
initialize(cpi_ctx, size)
}
To publish a new version:
cargo build
# allow-dirty, to include the idl passed in via the build script
cargo publish --allow-dirty