Vault
To create a vault, we use thestate sub-client’s create method:
create-vault.ts
glam-cli using the following template:
vault.json
Tokenized Vault
We need to use themint sub-client’s initialize method to create a tokenized vault. The vault state will be automatically created by the underlying initialize_mint instruction through CPI.
create-tokenized-vault.ts
glam-cli using the following template:
tokenized-vault.json
State Model
GLAM SDK abstracts onchain vault state using theStateModel. At vault creation time, the StateModel defines the initial configurations of the vault.
state-model.ts
StateModel object:
fetch-vault-state.ts
glamClient binds to. You can also fetch the state of a specific vault by passing its public key:
fetch-specific-vault-state.ts
Mint Model
GLAM SDK represents the onchain mint data using theMintModel. At tokenized vault creation time, the MintModel defines the initial configurations of the tokenized vault.
mint-model.ts
MintModel of a tokenized vault can be accessed via stateModel.mintModel.