token_vault

package
v0.8.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Initialize a token vault, starts inactivate. Add tokens in subsequent instructions, then activate.
	Instruction_InitVault uint8 = iota

	// Add a token to a inactive token vault
	Instruction_AddTokenToInactiveVault

	// Activates the vault, distributing initial shares into the fraction treasury.
	// Tokens can no longer be removed in this state until Combination.
	Instruction_ActivateVault

	// This act checks the external pricing oracle for permission to combine and the price of the circulating market cap to do so.
	// If you can afford it, this amount is charged and placed into the redeem treasury for shareholders to redeem at a later time.
	// The treasury then unlocks into Combine state and you can remove the tokens.
	Instruction_CombineVault

	// If in the combine state, shareholders can hit this endpoint to burn shares in exchange for monies from the treasury.
	// Once fractional supply is zero and all tokens have been removed this action will take vault to Deactivated
	Instruction_RedeemShares

	// If in combine state, authority on vault can hit this to withdrawal some of a token type from a safety deposit box.
	// Once fractional supply is zero and all tokens have been removed this action will take vault to Deactivated
	Instruction_WithdrawTokenFromSafetyDepositBox

	// Self explanatory - mint more fractional shares if the vault is configured to allow such.
	Instruction_MintFractionalShares

	// Withdraws shares from the treasury to a desired account.
	Instruction_WithdrawSharesFromTreasury

	// Returns shares to the vault if you wish to remove them from circulation.
	Instruction_AddSharesToTreasury

	// Helpful method that isn't necessary to use for main users of the app, but allows one to create/update
	// existing external price account fields if they are signers of this account.
	// Useful for testing purposes, and the CLI makes use of it as well so that you can verify logic.
	Instruction_UpdateExternalPriceAccount

	// Sets the authority of the vault to a new authority.
	Instruction_SetAuthority
)
View Source
const MAX_EXTERNAL_ACCOUNT_SIZE = 1 + 8 + 32 + 1
View Source
const MAX_SAFETY_DEPOSIT_SIZE = 1 + 32 + 32 + 32 + 1
View Source
const MAX_VAULT_SIZE = 1 + 32 + 32 + 32 + 32 + 1 + 32 + 1 + 32 + 1 + 1 + 8
View Source
const PREFIX = "vault"

/ prefix used for PDAs to avoid certain collision attacks (https://en.wikipedia.org/wiki/Collision_attack#Chosen-prefix_collision_attack)

View Source
const ProgramName = "TokenVault"

Variables

View Source
var InstructionImplDef = ag_binary.NewVariantDefinition(
	ag_binary.Uint8TypeIDEncoding,
	[]ag_binary.VariantType{
		{
			"InitVault", (*InitVault)(nil),
		},
		{
			"AddTokenToInactiveVault", (*AddTokenToInactiveVault)(nil),
		},
		{
			"ActivateVault", (*ActivateVault)(nil),
		},
		{
			"CombineVault", (*CombineVault)(nil),
		},
		{
			"RedeemShares", (*RedeemShares)(nil),
		},
		{
			"WithdrawTokenFromSafetyDepositBox", (*WithdrawTokenFromSafetyDepositBox)(nil),
		},
		{
			"MintFractionalShares", (*MintFractionalShares)(nil),
		},
		{
			"WithdrawSharesFromTreasury", (*WithdrawSharesFromTreasury)(nil),
		},
		{
			"AddSharesToTreasury", (*AddSharesToTreasury)(nil),
		},
		{
			"UpdateExternalPriceAccount", (*UpdateExternalPriceAccount)(nil),
		},
		{
			"SetAuthority", (*SetAuthority)(nil),
		},
	},
)
View Source
var ProgramID ag_solanago.PublicKey = ag_solanago.MustPublicKeyFromBase58("vau1zxA2LbssAUEF7Gpw91zMM1LvXrvpzJtmZ58rPsn")

Functions

func InstructionIDToName

func InstructionIDToName(id uint8) string

InstructionIDToName returns the name of the instruction given its ID.

func SetProgramID

func SetProgramID(pubkey ag_solanago.PublicKey)

Types

type ActivateVault

type ActivateVault struct {
	Args *NumberOfShareArgs

	// [0] = [WRITE] initializedInactivatedFractionalizedTokenVault
	// ··········· Initialized inactivated fractionalized token vault
	//
	// [1] = [WRITE] fractionMint
	// ··········· Fraction mint
	//
	// [2] = [WRITE] fractionTreasury
	// ··········· Fraction treasury
	//
	// [3] = [] fractionMintAuthority
	// ··········· Fraction mint authority for the program - seed of [PREFIX, program_id]
	//
	// [4] = [SIGNER] vaultAuthority
	// ··········· Authority on the vault
	//
	// [5] = [] tokenProgram
	// ··········· Token program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Activates the vault, distributing initial shares into the fraction treasury. Tokens can no longer be removed in this state until Combination.

func NewActivateVaultInstruction

func NewActivateVaultInstruction(

	args NumberOfShareArgs,

	initializedInactivatedFractionalizedTokenVault ag_solanago.PublicKey,
	fractionMint ag_solanago.PublicKey,
	fractionTreasury ag_solanago.PublicKey,
	fractionMintAuthority ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey) *ActivateVault

NewActivateVaultInstruction declares a new ActivateVault instruction with the provided parameters and accounts.

func NewActivateVaultInstructionBuilder

func NewActivateVaultInstructionBuilder() *ActivateVault

NewActivateVaultInstructionBuilder creates a new `ActivateVault` instruction builder.

func (ActivateVault) Build

func (inst ActivateVault) Build() *Instruction

func (*ActivateVault) EncodeToTree

func (inst *ActivateVault) EncodeToTree(parent ag_treeout.Branches)

func (*ActivateVault) GetFractionMintAccount

func (inst *ActivateVault) GetFractionMintAccount() *ag_solanago.AccountMeta

GetFractionMintAccount gets the "fractionMint" account. Fraction mint

func (*ActivateVault) GetFractionMintAuthorityAccount

func (inst *ActivateVault) GetFractionMintAuthorityAccount() *ag_solanago.AccountMeta

GetFractionMintAuthorityAccount gets the "fractionMintAuthority" account. Fraction mint authority for the program - seed of [PREFIX, program_id]

func (*ActivateVault) GetFractionTreasuryAccount

func (inst *ActivateVault) GetFractionTreasuryAccount() *ag_solanago.AccountMeta

GetFractionTreasuryAccount gets the "fractionTreasury" account. Fraction treasury

func (*ActivateVault) GetInitializedInactivatedFractionalizedTokenVaultAccount

func (inst *ActivateVault) GetInitializedInactivatedFractionalizedTokenVaultAccount() *ag_solanago.AccountMeta

GetInitializedInactivatedFractionalizedTokenVaultAccount gets the "initializedInactivatedFractionalizedTokenVault" account. Initialized inactivated fractionalized token vault

func (*ActivateVault) GetTokenProgramAccount

func (inst *ActivateVault) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (*ActivateVault) GetVaultAuthorityAccount

func (inst *ActivateVault) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Authority on the vault

func (ActivateVault) MarshalWithEncoder

func (obj ActivateVault) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*ActivateVault) SetArgs

func (inst *ActivateVault) SetArgs(args NumberOfShareArgs) *ActivateVault

SetArgs sets the "args" parameter.

func (*ActivateVault) SetFractionMintAccount

func (inst *ActivateVault) SetFractionMintAccount(fractionMint ag_solanago.PublicKey) *ActivateVault

SetFractionMintAccount sets the "fractionMint" account. Fraction mint

func (*ActivateVault) SetFractionMintAuthorityAccount

func (inst *ActivateVault) SetFractionMintAuthorityAccount(fractionMintAuthority ag_solanago.PublicKey) *ActivateVault

SetFractionMintAuthorityAccount sets the "fractionMintAuthority" account. Fraction mint authority for the program - seed of [PREFIX, program_id]

func (*ActivateVault) SetFractionTreasuryAccount

func (inst *ActivateVault) SetFractionTreasuryAccount(fractionTreasury ag_solanago.PublicKey) *ActivateVault

SetFractionTreasuryAccount sets the "fractionTreasury" account. Fraction treasury

func (*ActivateVault) SetInitializedInactivatedFractionalizedTokenVaultAccount

func (inst *ActivateVault) SetInitializedInactivatedFractionalizedTokenVaultAccount(initializedInactivatedFractionalizedTokenVault ag_solanago.PublicKey) *ActivateVault

SetInitializedInactivatedFractionalizedTokenVaultAccount sets the "initializedInactivatedFractionalizedTokenVault" account. Initialized inactivated fractionalized token vault

func (*ActivateVault) SetTokenProgramAccount

func (inst *ActivateVault) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *ActivateVault

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*ActivateVault) SetVaultAuthorityAccount

func (inst *ActivateVault) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *ActivateVault

SetVaultAuthorityAccount sets the "vaultAuthority" account. Authority on the vault

func (*ActivateVault) UnmarshalWithDecoder

func (obj *ActivateVault) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*ActivateVault) Validate

func (inst *ActivateVault) Validate() error

func (ActivateVault) ValidateAndBuild

func (inst ActivateVault) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type AddSharesToTreasury

type AddSharesToTreasury struct {
	Args *NumberOfShareArgs

	// [0] = [WRITE] initializedSourceAccount
	// ··········· Initialized account from which shares will be withdrawn
	//
	// [1] = [WRITE] fractionTreasury
	// ··········· Fraction treasury
	//
	// [2] = [] initializedActiveTokenVault
	// ··········· The initialized active token vault
	//
	// [3] = [SIGNER] transferAuthority
	// ··········· Transfer authority to move tokens from your account to treasury
	//
	// [4] = [SIGNER] vaultAuthority
	// ··········· Authority of vault
	//
	// [5] = [] tokenProgram
	// ··········· Token program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Returns shares to the vault if you wish to remove them from circulation.

func NewAddSharesToTreasuryInstruction

func NewAddSharesToTreasuryInstruction(

	args NumberOfShareArgs,

	initializedSourceAccount ag_solanago.PublicKey,
	fractionTreasury ag_solanago.PublicKey,
	initializedActiveTokenVault ag_solanago.PublicKey,
	transferAuthority ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey) *AddSharesToTreasury

NewAddSharesToTreasuryInstruction declares a new AddSharesToTreasury instruction with the provided parameters and accounts.

func NewAddSharesToTreasuryInstructionBuilder

func NewAddSharesToTreasuryInstructionBuilder() *AddSharesToTreasury

NewAddSharesToTreasuryInstructionBuilder creates a new `AddSharesToTreasury` instruction builder.

func (AddSharesToTreasury) Build

func (inst AddSharesToTreasury) Build() *Instruction

func (*AddSharesToTreasury) EncodeToTree

func (inst *AddSharesToTreasury) EncodeToTree(parent ag_treeout.Branches)

func (*AddSharesToTreasury) GetFractionTreasuryAccount

func (inst *AddSharesToTreasury) GetFractionTreasuryAccount() *ag_solanago.AccountMeta

GetFractionTreasuryAccount gets the "fractionTreasury" account. Fraction treasury

func (*AddSharesToTreasury) GetInitializedActiveTokenVaultAccount

func (inst *AddSharesToTreasury) GetInitializedActiveTokenVaultAccount() *ag_solanago.AccountMeta

GetInitializedActiveTokenVaultAccount gets the "initializedActiveTokenVault" account. The initialized active token vault

func (*AddSharesToTreasury) GetInitializedSourceAccount

func (inst *AddSharesToTreasury) GetInitializedSourceAccount() *ag_solanago.AccountMeta

GetInitializedSourceAccount gets the "initializedSourceAccount" account. Initialized account from which shares will be withdrawn

func (*AddSharesToTreasury) GetTokenProgramAccount

func (inst *AddSharesToTreasury) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (*AddSharesToTreasury) GetTransferAuthorityAccount

func (inst *AddSharesToTreasury) GetTransferAuthorityAccount() *ag_solanago.AccountMeta

GetTransferAuthorityAccount gets the "transferAuthority" account. Transfer authority to move tokens from your account to treasury

func (*AddSharesToTreasury) GetVaultAuthorityAccount

func (inst *AddSharesToTreasury) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Authority of vault

func (AddSharesToTreasury) MarshalWithEncoder

func (obj AddSharesToTreasury) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*AddSharesToTreasury) SetArgs

SetArgs sets the "args" parameter.

func (*AddSharesToTreasury) SetFractionTreasuryAccount

func (inst *AddSharesToTreasury) SetFractionTreasuryAccount(fractionTreasury ag_solanago.PublicKey) *AddSharesToTreasury

SetFractionTreasuryAccount sets the "fractionTreasury" account. Fraction treasury

func (*AddSharesToTreasury) SetInitializedActiveTokenVaultAccount

func (inst *AddSharesToTreasury) SetInitializedActiveTokenVaultAccount(initializedActiveTokenVault ag_solanago.PublicKey) *AddSharesToTreasury

SetInitializedActiveTokenVaultAccount sets the "initializedActiveTokenVault" account. The initialized active token vault

func (*AddSharesToTreasury) SetInitializedSourceAccount

func (inst *AddSharesToTreasury) SetInitializedSourceAccount(initializedSourceAccount ag_solanago.PublicKey) *AddSharesToTreasury

SetInitializedSourceAccount sets the "initializedSourceAccount" account. Initialized account from which shares will be withdrawn

func (*AddSharesToTreasury) SetTokenProgramAccount

func (inst *AddSharesToTreasury) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *AddSharesToTreasury

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*AddSharesToTreasury) SetTransferAuthorityAccount

func (inst *AddSharesToTreasury) SetTransferAuthorityAccount(transferAuthority ag_solanago.PublicKey) *AddSharesToTreasury

SetTransferAuthorityAccount sets the "transferAuthority" account. Transfer authority to move tokens from your account to treasury

func (*AddSharesToTreasury) SetVaultAuthorityAccount

func (inst *AddSharesToTreasury) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *AddSharesToTreasury

SetVaultAuthorityAccount sets the "vaultAuthority" account. Authority of vault

func (*AddSharesToTreasury) UnmarshalWithDecoder

func (obj *AddSharesToTreasury) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*AddSharesToTreasury) Validate

func (inst *AddSharesToTreasury) Validate() error

func (AddSharesToTreasury) ValidateAndBuild

func (inst AddSharesToTreasury) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type AddTokenToInactiveVault

type AddTokenToInactiveVault struct {
	Args *AmountArgs

	// [0] = [WRITE] uninitializedSafetyDepositBoxAccount
	// ··········· Uninitialized safety deposit box account address (will be created and allocated by this endpoint)
	// ··········· Address should be pda with seed of [PREFIX, vault_address, token_mint_address]
	//
	// [1] = [WRITE] initializedToken
	// ··········· Initialized Token account
	//
	// [2] = [WRITE] initializedTokenStore
	// ··········· Initialized Token store account with authority of this program, this will get set on the safety deposit box
	//
	// [3] = [WRITE] initializedInactiveFractionalizedTokenVault
	// ··········· Initialized inactive fractionalized token vault
	//
	// [4] = [SIGNER] vaultAuthority
	// ··········· Authority on the vault
	//
	// [5] = [SIGNER] payer
	// ··········· Payer
	//
	// [6] = [SIGNER] transferAuthority
	// ··········· Transfer Authority to move desired token amount from token account to safety deposit
	//
	// [7] = [] tokenProgram
	// ··········· Token program
	//
	// [8] = [] rentSysvar
	// ··········· Rent sysvar
	//
	// [9] = [] systemAccountSysvar
	// ··········· System account sysvar
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Add a token to a inactive token vault

func NewAddTokenToInactiveVaultInstruction

func NewAddTokenToInactiveVaultInstruction(

	args AmountArgs,

	uninitializedSafetyDepositBoxAccount ag_solanago.PublicKey,
	initializedToken ag_solanago.PublicKey,
	initializedTokenStore ag_solanago.PublicKey,
	initializedInactiveFractionalizedTokenVault ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	payer ag_solanago.PublicKey,
	transferAuthority ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	rentSysvar ag_solanago.PublicKey,
	systemAccountSysvar ag_solanago.PublicKey) *AddTokenToInactiveVault

NewAddTokenToInactiveVaultInstruction declares a new AddTokenToInactiveVault instruction with the provided parameters and accounts.

func NewAddTokenToInactiveVaultInstructionBuilder

func NewAddTokenToInactiveVaultInstructionBuilder() *AddTokenToInactiveVault

NewAddTokenToInactiveVaultInstructionBuilder creates a new `AddTokenToInactiveVault` instruction builder.

func (AddTokenToInactiveVault) Build

func (inst AddTokenToInactiveVault) Build() *Instruction

func (*AddTokenToInactiveVault) EncodeToTree

func (inst *AddTokenToInactiveVault) EncodeToTree(parent ag_treeout.Branches)

func (*AddTokenToInactiveVault) GetInitializedInactiveFractionalizedTokenVaultAccount

func (inst *AddTokenToInactiveVault) GetInitializedInactiveFractionalizedTokenVaultAccount() *ag_solanago.AccountMeta

GetInitializedInactiveFractionalizedTokenVaultAccount gets the "initializedInactiveFractionalizedTokenVault" account. Initialized inactive fractionalized token vault

func (*AddTokenToInactiveVault) GetInitializedTokenAccount

func (inst *AddTokenToInactiveVault) GetInitializedTokenAccount() *ag_solanago.AccountMeta

GetInitializedTokenAccount gets the "initializedToken" account. Initialized Token account

func (*AddTokenToInactiveVault) GetInitializedTokenStoreAccount

func (inst *AddTokenToInactiveVault) GetInitializedTokenStoreAccount() *ag_solanago.AccountMeta

GetInitializedTokenStoreAccount gets the "initializedTokenStore" account. Initialized Token store account with authority of this program, this will get set on the safety deposit box

func (*AddTokenToInactiveVault) GetPayerAccount

func (inst *AddTokenToInactiveVault) GetPayerAccount() *ag_solanago.AccountMeta

GetPayerAccount gets the "payer" account. Payer

func (*AddTokenToInactiveVault) GetRentSysvarAccount

func (inst *AddTokenToInactiveVault) GetRentSysvarAccount() *ag_solanago.AccountMeta

GetRentSysvarAccount gets the "rentSysvar" account. Rent sysvar

func (*AddTokenToInactiveVault) GetSystemAccountSysvarAccount

func (inst *AddTokenToInactiveVault) GetSystemAccountSysvarAccount() *ag_solanago.AccountMeta

GetSystemAccountSysvarAccount gets the "systemAccountSysvar" account. System account sysvar

func (*AddTokenToInactiveVault) GetTokenProgramAccount

func (inst *AddTokenToInactiveVault) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (*AddTokenToInactiveVault) GetTransferAuthorityAccount

func (inst *AddTokenToInactiveVault) GetTransferAuthorityAccount() *ag_solanago.AccountMeta

GetTransferAuthorityAccount gets the "transferAuthority" account. Transfer Authority to move desired token amount from token account to safety deposit

func (*AddTokenToInactiveVault) GetUninitializedSafetyDepositBoxAccount

func (inst *AddTokenToInactiveVault) GetUninitializedSafetyDepositBoxAccount() *ag_solanago.AccountMeta

GetUninitializedSafetyDepositBoxAccount gets the "uninitializedSafetyDepositBoxAccount" account. Uninitialized safety deposit box account address (will be created and allocated by this endpoint) Address should be pda with seed of [PREFIX, vault_address, token_mint_address]

func (*AddTokenToInactiveVault) GetVaultAuthorityAccount

func (inst *AddTokenToInactiveVault) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Authority on the vault

func (AddTokenToInactiveVault) MarshalWithEncoder

func (obj AddTokenToInactiveVault) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*AddTokenToInactiveVault) SetArgs

SetArgs sets the "args" parameter.

func (*AddTokenToInactiveVault) SetInitializedInactiveFractionalizedTokenVaultAccount

func (inst *AddTokenToInactiveVault) SetInitializedInactiveFractionalizedTokenVaultAccount(initializedInactiveFractionalizedTokenVault ag_solanago.PublicKey) *AddTokenToInactiveVault

SetInitializedInactiveFractionalizedTokenVaultAccount sets the "initializedInactiveFractionalizedTokenVault" account. Initialized inactive fractionalized token vault

func (*AddTokenToInactiveVault) SetInitializedTokenAccount

func (inst *AddTokenToInactiveVault) SetInitializedTokenAccount(initializedToken ag_solanago.PublicKey) *AddTokenToInactiveVault

SetInitializedTokenAccount sets the "initializedToken" account. Initialized Token account

func (*AddTokenToInactiveVault) SetInitializedTokenStoreAccount

func (inst *AddTokenToInactiveVault) SetInitializedTokenStoreAccount(initializedTokenStore ag_solanago.PublicKey) *AddTokenToInactiveVault

SetInitializedTokenStoreAccount sets the "initializedTokenStore" account. Initialized Token store account with authority of this program, this will get set on the safety deposit box

func (*AddTokenToInactiveVault) SetPayerAccount

SetPayerAccount sets the "payer" account. Payer

func (*AddTokenToInactiveVault) SetRentSysvarAccount

func (inst *AddTokenToInactiveVault) SetRentSysvarAccount(rentSysvar ag_solanago.PublicKey) *AddTokenToInactiveVault

SetRentSysvarAccount sets the "rentSysvar" account. Rent sysvar

func (*AddTokenToInactiveVault) SetSystemAccountSysvarAccount

func (inst *AddTokenToInactiveVault) SetSystemAccountSysvarAccount(systemAccountSysvar ag_solanago.PublicKey) *AddTokenToInactiveVault

SetSystemAccountSysvarAccount sets the "systemAccountSysvar" account. System account sysvar

func (*AddTokenToInactiveVault) SetTokenProgramAccount

func (inst *AddTokenToInactiveVault) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *AddTokenToInactiveVault

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*AddTokenToInactiveVault) SetTransferAuthorityAccount

func (inst *AddTokenToInactiveVault) SetTransferAuthorityAccount(transferAuthority ag_solanago.PublicKey) *AddTokenToInactiveVault

SetTransferAuthorityAccount sets the "transferAuthority" account. Transfer Authority to move desired token amount from token account to safety deposit

func (*AddTokenToInactiveVault) SetUninitializedSafetyDepositBoxAccount

func (inst *AddTokenToInactiveVault) SetUninitializedSafetyDepositBoxAccount(uninitializedSafetyDepositBoxAccount ag_solanago.PublicKey) *AddTokenToInactiveVault

SetUninitializedSafetyDepositBoxAccount sets the "uninitializedSafetyDepositBoxAccount" account. Uninitialized safety deposit box account address (will be created and allocated by this endpoint) Address should be pda with seed of [PREFIX, vault_address, token_mint_address]

func (*AddTokenToInactiveVault) SetVaultAuthorityAccount

func (inst *AddTokenToInactiveVault) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *AddTokenToInactiveVault

SetVaultAuthorityAccount sets the "vaultAuthority" account. Authority on the vault

func (*AddTokenToInactiveVault) UnmarshalWithDecoder

func (obj *AddTokenToInactiveVault) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*AddTokenToInactiveVault) Validate

func (inst *AddTokenToInactiveVault) Validate() error

func (AddTokenToInactiveVault) ValidateAndBuild

func (inst AddTokenToInactiveVault) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type AmountArgs

type AmountArgs struct {
	Amount uint64
}

func (AmountArgs) MarshalWithEncoder

func (obj AmountArgs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*AmountArgs) UnmarshalWithDecoder

func (obj *AmountArgs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type CombineVault

type CombineVault struct {

	// [0] = [WRITE] initializedActivatedTokenVault
	// ··········· Initialized activated token vault
	//
	// [1] = [WRITE] tokenAccount
	// ··········· Token account containing your portion of the outstanding fraction shares
	//
	// [2] = [WRITE] redeemTreasuryMintTypeTokenAccount
	// ··········· Token account of the redeem_treasury mint type that you will pay with
	//
	// [3] = [WRITE] fractionMint
	// ··········· Fraction mint
	//
	// [4] = [WRITE] fractionTreasury
	// ··········· Fraction treasury account
	//
	// [5] = [WRITE] redeemTreasury
	// ··········· Redeem treasury account
	//
	// [6] = [] newAuthorityOnTheVault
	// ··········· New authority on the vault going forward - can be same authority if you want
	//
	// [7] = [SIGNER] vaultAuthority
	// ··········· Authority on the vault
	//
	// [8] = [SIGNER] transferAuthority
	// ··········· Transfer authority for the token account and outstanding fractional shares account you're transferring from
	//
	// [9] = [] pdaBasedBurnAuthority
	// ··········· PDA-based Burn authority for the fraction treasury account containing the uncirculated shares seed [PREFIX, program_id]
	//
	// [10] = [] externalPricingLookupAddress
	// ··········· External pricing lookup address
	//
	// [11] = [] tokenProgram
	// ··········· Token program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

This act checks the external pricing oracle for permission to combine and the price of the circulating market cap to do so. If you can afford it, this amount is charged and placed into the redeem treasury for shareholders to redeem at a later time. The treasury then unlocks into Combine state and you can remove the tokens.

func NewCombineVaultInstruction

func NewCombineVaultInstruction(

	initializedActivatedTokenVault ag_solanago.PublicKey,
	tokenAccount ag_solanago.PublicKey,
	redeemTreasuryMintTypeTokenAccount ag_solanago.PublicKey,
	fractionMint ag_solanago.PublicKey,
	fractionTreasury ag_solanago.PublicKey,
	redeemTreasury ag_solanago.PublicKey,
	newAuthorityOnTheVault ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	transferAuthority ag_solanago.PublicKey,
	pdaBasedBurnAuthority ag_solanago.PublicKey,
	externalPricingLookupAddress ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey) *CombineVault

NewCombineVaultInstruction declares a new CombineVault instruction with the provided parameters and accounts.

func NewCombineVaultInstructionBuilder

func NewCombineVaultInstructionBuilder() *CombineVault

NewCombineVaultInstructionBuilder creates a new `CombineVault` instruction builder.

func (CombineVault) Build

func (inst CombineVault) Build() *Instruction

func (*CombineVault) EncodeToTree

func (inst *CombineVault) EncodeToTree(parent ag_treeout.Branches)

func (*CombineVault) GetExternalPricingLookupAddressAccount

func (inst *CombineVault) GetExternalPricingLookupAddressAccount() *ag_solanago.AccountMeta

GetExternalPricingLookupAddressAccount gets the "externalPricingLookupAddress" account. External pricing lookup address

func (*CombineVault) GetFractionMintAccount

func (inst *CombineVault) GetFractionMintAccount() *ag_solanago.AccountMeta

GetFractionMintAccount gets the "fractionMint" account. Fraction mint

func (*CombineVault) GetFractionTreasuryAccount

func (inst *CombineVault) GetFractionTreasuryAccount() *ag_solanago.AccountMeta

GetFractionTreasuryAccount gets the "fractionTreasury" account. Fraction treasury account

func (*CombineVault) GetInitializedActivatedTokenVaultAccount

func (inst *CombineVault) GetInitializedActivatedTokenVaultAccount() *ag_solanago.AccountMeta

GetInitializedActivatedTokenVaultAccount gets the "initializedActivatedTokenVault" account. Initialized activated token vault

func (*CombineVault) GetNewAuthorityOnTheVaultAccount

func (inst *CombineVault) GetNewAuthorityOnTheVaultAccount() *ag_solanago.AccountMeta

GetNewAuthorityOnTheVaultAccount gets the "newAuthorityOnTheVault" account. New authority on the vault going forward - can be same authority if you want

func (*CombineVault) GetPdaBasedBurnAuthorityAccount

func (inst *CombineVault) GetPdaBasedBurnAuthorityAccount() *ag_solanago.AccountMeta

GetPdaBasedBurnAuthorityAccount gets the "pdaBasedBurnAuthority" account. PDA-based Burn authority for the fraction treasury account containing the uncirculated shares seed [PREFIX, program_id]

func (*CombineVault) GetRedeemTreasuryAccount

func (inst *CombineVault) GetRedeemTreasuryAccount() *ag_solanago.AccountMeta

GetRedeemTreasuryAccount gets the "redeemTreasury" account. Redeem treasury account

func (*CombineVault) GetRedeemTreasuryMintTypeTokenAccount

func (inst *CombineVault) GetRedeemTreasuryMintTypeTokenAccount() *ag_solanago.AccountMeta

GetRedeemTreasuryMintTypeTokenAccount gets the "redeemTreasuryMintTypeTokenAccount" account. Token account of the redeem_treasury mint type that you will pay with

func (*CombineVault) GetTokenAccount

func (inst *CombineVault) GetTokenAccount() *ag_solanago.AccountMeta

GetTokenAccount gets the "tokenAccount" account. Token account containing your portion of the outstanding fraction shares

func (*CombineVault) GetTokenProgramAccount

func (inst *CombineVault) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (*CombineVault) GetTransferAuthorityAccount

func (inst *CombineVault) GetTransferAuthorityAccount() *ag_solanago.AccountMeta

GetTransferAuthorityAccount gets the "transferAuthority" account. Transfer authority for the token account and outstanding fractional shares account you're transferring from

func (*CombineVault) GetVaultAuthorityAccount

func (inst *CombineVault) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Authority on the vault

func (CombineVault) MarshalWithEncoder

func (obj CombineVault) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*CombineVault) SetExternalPricingLookupAddressAccount

func (inst *CombineVault) SetExternalPricingLookupAddressAccount(externalPricingLookupAddress ag_solanago.PublicKey) *CombineVault

SetExternalPricingLookupAddressAccount sets the "externalPricingLookupAddress" account. External pricing lookup address

func (*CombineVault) SetFractionMintAccount

func (inst *CombineVault) SetFractionMintAccount(fractionMint ag_solanago.PublicKey) *CombineVault

SetFractionMintAccount sets the "fractionMint" account. Fraction mint

func (*CombineVault) SetFractionTreasuryAccount

func (inst *CombineVault) SetFractionTreasuryAccount(fractionTreasury ag_solanago.PublicKey) *CombineVault

SetFractionTreasuryAccount sets the "fractionTreasury" account. Fraction treasury account

func (*CombineVault) SetInitializedActivatedTokenVaultAccount

func (inst *CombineVault) SetInitializedActivatedTokenVaultAccount(initializedActivatedTokenVault ag_solanago.PublicKey) *CombineVault

SetInitializedActivatedTokenVaultAccount sets the "initializedActivatedTokenVault" account. Initialized activated token vault

func (*CombineVault) SetNewAuthorityOnTheVaultAccount

func (inst *CombineVault) SetNewAuthorityOnTheVaultAccount(newAuthorityOnTheVault ag_solanago.PublicKey) *CombineVault

SetNewAuthorityOnTheVaultAccount sets the "newAuthorityOnTheVault" account. New authority on the vault going forward - can be same authority if you want

func (*CombineVault) SetPdaBasedBurnAuthorityAccount

func (inst *CombineVault) SetPdaBasedBurnAuthorityAccount(pdaBasedBurnAuthority ag_solanago.PublicKey) *CombineVault

SetPdaBasedBurnAuthorityAccount sets the "pdaBasedBurnAuthority" account. PDA-based Burn authority for the fraction treasury account containing the uncirculated shares seed [PREFIX, program_id]

func (*CombineVault) SetRedeemTreasuryAccount

func (inst *CombineVault) SetRedeemTreasuryAccount(redeemTreasury ag_solanago.PublicKey) *CombineVault

SetRedeemTreasuryAccount sets the "redeemTreasury" account. Redeem treasury account

func (*CombineVault) SetRedeemTreasuryMintTypeTokenAccount

func (inst *CombineVault) SetRedeemTreasuryMintTypeTokenAccount(redeemTreasuryMintTypeTokenAccount ag_solanago.PublicKey) *CombineVault

SetRedeemTreasuryMintTypeTokenAccount sets the "redeemTreasuryMintTypeTokenAccount" account. Token account of the redeem_treasury mint type that you will pay with

func (*CombineVault) SetTokenAccount

func (inst *CombineVault) SetTokenAccount(tokenAccount ag_solanago.PublicKey) *CombineVault

SetTokenAccount sets the "tokenAccount" account. Token account containing your portion of the outstanding fraction shares

func (*CombineVault) SetTokenProgramAccount

func (inst *CombineVault) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *CombineVault

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*CombineVault) SetTransferAuthorityAccount

func (inst *CombineVault) SetTransferAuthorityAccount(transferAuthority ag_solanago.PublicKey) *CombineVault

SetTransferAuthorityAccount sets the "transferAuthority" account. Transfer authority for the token account and outstanding fractional shares account you're transferring from

func (*CombineVault) SetVaultAuthorityAccount

func (inst *CombineVault) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *CombineVault

SetVaultAuthorityAccount sets the "vaultAuthority" account. Authority on the vault

func (*CombineVault) UnmarshalWithDecoder

func (obj *CombineVault) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*CombineVault) Validate

func (inst *CombineVault) Validate() error

func (CombineVault) ValidateAndBuild

func (inst CombineVault) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type ExternalPriceAccount

type ExternalPriceAccount struct {
	Key           Key
	PricePerShare uint64

	// Mint of the currency we are pricing the shares against, should be same as redeem_treasury.
	// Most likely will be USDC mint most of the time.
	PriceMint ag_solanago.PublicKey

	// Whether or not combination has been allowed for this vault.
	AllowedToCombine bool
}

func (ExternalPriceAccount) MarshalWithEncoder

func (obj ExternalPriceAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*ExternalPriceAccount) UnmarshalWithDecoder

func (obj *ExternalPriceAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type InitVault

type InitVault struct {
	Args *InitVaultArgs

	// [0] = [WRITE] initializedFractionalShareMint
	// ··········· Initialized fractional share mint with 0 tokens in supply, authority on mint must be pda of program with seed [prefix, programid]
	//
	// [1] = [WRITE] initializedRedeemTreasuryTokenAccount
	// ··········· Initialized redeem treasury token account with 0 tokens in supply, owner of account must be pda of program like above
	//
	// [2] = [WRITE] initializedFractionTreasuryTokenAccount
	// ··········· Initialized fraction treasury token account with 0 tokens in supply, owner of account must be pda of program like above
	//
	// [3] = [WRITE] uninitializedVault
	// ··········· Uninitialized vault account
	//
	// [4] = [] vaultAuthority
	// ··········· Authority on the vault
	//
	// [5] = [] pricingLookupAddress
	// ··········· Pricing Lookup Address
	//
	// [6] = [] tokenProgram
	// ··········· Token program
	//
	// [7] = [] rentSysvar
	// ··········· Rent sysvar
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Initialize a token vault, starts inactivate. Add tokens in subsequent instructions, then activate.

func NewInitVaultInstruction

func NewInitVaultInstruction(

	args InitVaultArgs,

	initializedFractionalShareMint ag_solanago.PublicKey,
	initializedRedeemTreasuryTokenAccount ag_solanago.PublicKey,
	initializedFractionTreasuryTokenAccount ag_solanago.PublicKey,
	uninitializedVault ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	pricingLookupAddress ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	rentSysvar ag_solanago.PublicKey) *InitVault

NewInitVaultInstruction declares a new InitVault instruction with the provided parameters and accounts.

func NewInitVaultInstructionBuilder

func NewInitVaultInstructionBuilder() *InitVault

NewInitVaultInstructionBuilder creates a new `InitVault` instruction builder.

func (InitVault) Build

func (inst InitVault) Build() *Instruction

func (*InitVault) EncodeToTree

func (inst *InitVault) EncodeToTree(parent ag_treeout.Branches)

func (*InitVault) GetInitializedFractionTreasuryTokenAccount

func (inst *InitVault) GetInitializedFractionTreasuryTokenAccount() *ag_solanago.AccountMeta

GetInitializedFractionTreasuryTokenAccount gets the "initializedFractionTreasuryTokenAccount" account. Initialized fraction treasury token account with 0 tokens in supply, owner of account must be pda of program like above

func (*InitVault) GetInitializedFractionalShareMintAccount

func (inst *InitVault) GetInitializedFractionalShareMintAccount() *ag_solanago.AccountMeta

GetInitializedFractionalShareMintAccount gets the "initializedFractionalShareMint" account. Initialized fractional share mint with 0 tokens in supply, authority on mint must be pda of program with seed [prefix, programid]

func (*InitVault) GetInitializedRedeemTreasuryTokenAccount

func (inst *InitVault) GetInitializedRedeemTreasuryTokenAccount() *ag_solanago.AccountMeta

GetInitializedRedeemTreasuryTokenAccount gets the "initializedRedeemTreasuryTokenAccount" account. Initialized redeem treasury token account with 0 tokens in supply, owner of account must be pda of program like above

func (*InitVault) GetPricingLookupAddressAccount

func (inst *InitVault) GetPricingLookupAddressAccount() *ag_solanago.AccountMeta

GetPricingLookupAddressAccount gets the "pricingLookupAddress" account. Pricing Lookup Address

func (*InitVault) GetRentSysvarAccount

func (inst *InitVault) GetRentSysvarAccount() *ag_solanago.AccountMeta

GetRentSysvarAccount gets the "rentSysvar" account. Rent sysvar

func (*InitVault) GetTokenProgramAccount

func (inst *InitVault) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (*InitVault) GetUninitializedVaultAccount

func (inst *InitVault) GetUninitializedVaultAccount() *ag_solanago.AccountMeta

GetUninitializedVaultAccount gets the "uninitializedVault" account. Uninitialized vault account

func (*InitVault) GetVaultAuthorityAccount

func (inst *InitVault) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Authority on the vault

func (InitVault) MarshalWithEncoder

func (obj InitVault) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*InitVault) SetArgs

func (inst *InitVault) SetArgs(args InitVaultArgs) *InitVault

SetArgs sets the "args" parameter.

func (*InitVault) SetInitializedFractionTreasuryTokenAccount

func (inst *InitVault) SetInitializedFractionTreasuryTokenAccount(initializedFractionTreasuryTokenAccount ag_solanago.PublicKey) *InitVault

SetInitializedFractionTreasuryTokenAccount sets the "initializedFractionTreasuryTokenAccount" account. Initialized fraction treasury token account with 0 tokens in supply, owner of account must be pda of program like above

func (*InitVault) SetInitializedFractionalShareMintAccount

func (inst *InitVault) SetInitializedFractionalShareMintAccount(initializedFractionalShareMint ag_solanago.PublicKey) *InitVault

SetInitializedFractionalShareMintAccount sets the "initializedFractionalShareMint" account. Initialized fractional share mint with 0 tokens in supply, authority on mint must be pda of program with seed [prefix, programid]

func (*InitVault) SetInitializedRedeemTreasuryTokenAccount

func (inst *InitVault) SetInitializedRedeemTreasuryTokenAccount(initializedRedeemTreasuryTokenAccount ag_solanago.PublicKey) *InitVault

SetInitializedRedeemTreasuryTokenAccount sets the "initializedRedeemTreasuryTokenAccount" account. Initialized redeem treasury token account with 0 tokens in supply, owner of account must be pda of program like above

func (*InitVault) SetPricingLookupAddressAccount

func (inst *InitVault) SetPricingLookupAddressAccount(pricingLookupAddress ag_solanago.PublicKey) *InitVault

SetPricingLookupAddressAccount sets the "pricingLookupAddress" account. Pricing Lookup Address

func (*InitVault) SetRentSysvarAccount

func (inst *InitVault) SetRentSysvarAccount(rentSysvar ag_solanago.PublicKey) *InitVault

SetRentSysvarAccount sets the "rentSysvar" account. Rent sysvar

func (*InitVault) SetTokenProgramAccount

func (inst *InitVault) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *InitVault

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*InitVault) SetUninitializedVaultAccount

func (inst *InitVault) SetUninitializedVaultAccount(uninitializedVault ag_solanago.PublicKey) *InitVault

SetUninitializedVaultAccount sets the "uninitializedVault" account. Uninitialized vault account

func (*InitVault) SetVaultAuthorityAccount

func (inst *InitVault) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *InitVault

SetVaultAuthorityAccount sets the "vaultAuthority" account. Authority on the vault

func (*InitVault) UnmarshalWithDecoder

func (obj *InitVault) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*InitVault) Validate

func (inst *InitVault) Validate() error

func (InitVault) ValidateAndBuild

func (inst InitVault) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type InitVaultArgs

type InitVaultArgs struct {
	AllowFurtherShareCreation bool
}

func (InitVaultArgs) MarshalWithEncoder

func (obj InitVaultArgs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*InitVaultArgs) UnmarshalWithDecoder

func (obj *InitVaultArgs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type Instruction

type Instruction struct {
	ag_binary.BaseVariant
}

func DecodeInstruction

func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error)

func (*Instruction) Accounts

func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta)

func (*Instruction) Data

func (inst *Instruction) Data() ([]byte, error)

func (*Instruction) EncodeToTree

func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches)

func (*Instruction) MarshalWithEncoder

func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*Instruction) ProgramID

func (inst *Instruction) ProgramID() ag_solanago.PublicKey

func (*Instruction) TextEncode

func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error

func (*Instruction) UnmarshalWithDecoder

func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

type Key

type Key ag_binary.BorshEnum
const (
	KeyUninitialized Key = iota
	KeySafetyDepositBoxV1
	KeyExternalAccountKeyV1
	KeyVaultV1
)

func (Key) String

func (value Key) String() string

type MintEditionProxyArgs

type MintEditionProxyArgs struct {
	Edition uint64
}

func (MintEditionProxyArgs) MarshalWithEncoder

func (obj MintEditionProxyArgs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*MintEditionProxyArgs) UnmarshalWithDecoder

func (obj *MintEditionProxyArgs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type MintFractionalShares

type MintFractionalShares struct {
	Args *NumberOfShareArgs

	// [0] = [WRITE] fractionTreasury
	// ··········· Fraction treasury
	//
	// [1] = [WRITE] fractionMint
	// ··········· Fraction mint
	//
	// [2] = [] initializedActiveTokenVault
	// ··········· The initialized active token vault
	//
	// [3] = [] pdaBasedMintAuthority
	// ··········· PDA-based Mint authority to mint tokens to treasury[PREFIX, program_id]
	//
	// [4] = [SIGNER] vaultAuthority
	// ··········· Authority of vault
	//
	// [5] = [] tokenProgram
	// ··········· Token program
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Self explanatory - mint more fractional shares if the vault is configured to allow such.

func NewMintFractionalSharesInstruction

func NewMintFractionalSharesInstruction(

	args NumberOfShareArgs,

	fractionTreasury ag_solanago.PublicKey,
	fractionMint ag_solanago.PublicKey,
	initializedActiveTokenVault ag_solanago.PublicKey,
	pdaBasedMintAuthority ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey) *MintFractionalShares

NewMintFractionalSharesInstruction declares a new MintFractionalShares instruction with the provided parameters and accounts.

func NewMintFractionalSharesInstructionBuilder

func NewMintFractionalSharesInstructionBuilder() *MintFractionalShares

NewMintFractionalSharesInstructionBuilder creates a new `MintFractionalShares` instruction builder.

func (MintFractionalShares) Build

func (inst MintFractionalShares) Build() *Instruction

func (*MintFractionalShares) EncodeToTree

func (inst *MintFractionalShares) EncodeToTree(parent ag_treeout.Branches)

func (*MintFractionalShares) GetFractionMintAccount

func (inst *MintFractionalShares) GetFractionMintAccount() *ag_solanago.AccountMeta

GetFractionMintAccount gets the "fractionMint" account. Fraction mint

func (*MintFractionalShares) GetFractionTreasuryAccount

func (inst *MintFractionalShares) GetFractionTreasuryAccount() *ag_solanago.AccountMeta

GetFractionTreasuryAccount gets the "fractionTreasury" account. Fraction treasury

func (*MintFractionalShares) GetInitializedActiveTokenVaultAccount

func (inst *MintFractionalShares) GetInitializedActiveTokenVaultAccount() *ag_solanago.AccountMeta

GetInitializedActiveTokenVaultAccount gets the "initializedActiveTokenVault" account. The initialized active token vault

func (*MintFractionalShares) GetPdaBasedMintAuthorityAccount

func (inst *MintFractionalShares) GetPdaBasedMintAuthorityAccount() *ag_solanago.AccountMeta

GetPdaBasedMintAuthorityAccount gets the "pdaBasedMintAuthority" account. PDA-based Mint authority to mint tokens to treasury[PREFIX, program_id]

func (*MintFractionalShares) GetTokenProgramAccount

func (inst *MintFractionalShares) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (*MintFractionalShares) GetVaultAuthorityAccount

func (inst *MintFractionalShares) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Authority of vault

func (MintFractionalShares) MarshalWithEncoder

func (obj MintFractionalShares) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*MintFractionalShares) SetArgs

SetArgs sets the "args" parameter.

func (*MintFractionalShares) SetFractionMintAccount

func (inst *MintFractionalShares) SetFractionMintAccount(fractionMint ag_solanago.PublicKey) *MintFractionalShares

SetFractionMintAccount sets the "fractionMint" account. Fraction mint

func (*MintFractionalShares) SetFractionTreasuryAccount

func (inst *MintFractionalShares) SetFractionTreasuryAccount(fractionTreasury ag_solanago.PublicKey) *MintFractionalShares

SetFractionTreasuryAccount sets the "fractionTreasury" account. Fraction treasury

func (*MintFractionalShares) SetInitializedActiveTokenVaultAccount

func (inst *MintFractionalShares) SetInitializedActiveTokenVaultAccount(initializedActiveTokenVault ag_solanago.PublicKey) *MintFractionalShares

SetInitializedActiveTokenVaultAccount sets the "initializedActiveTokenVault" account. The initialized active token vault

func (*MintFractionalShares) SetPdaBasedMintAuthorityAccount

func (inst *MintFractionalShares) SetPdaBasedMintAuthorityAccount(pdaBasedMintAuthority ag_solanago.PublicKey) *MintFractionalShares

SetPdaBasedMintAuthorityAccount sets the "pdaBasedMintAuthority" account. PDA-based Mint authority to mint tokens to treasury[PREFIX, program_id]

func (*MintFractionalShares) SetTokenProgramAccount

func (inst *MintFractionalShares) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *MintFractionalShares

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*MintFractionalShares) SetVaultAuthorityAccount

func (inst *MintFractionalShares) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *MintFractionalShares

SetVaultAuthorityAccount sets the "vaultAuthority" account. Authority of vault

func (*MintFractionalShares) UnmarshalWithDecoder

func (obj *MintFractionalShares) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*MintFractionalShares) Validate

func (inst *MintFractionalShares) Validate() error

func (MintFractionalShares) ValidateAndBuild

func (inst MintFractionalShares) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type NumberOfShareArgs

type NumberOfShareArgs struct {
	NumberOfShares uint64
}

func (NumberOfShareArgs) MarshalWithEncoder

func (obj NumberOfShareArgs) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*NumberOfShareArgs) UnmarshalWithDecoder

func (obj *NumberOfShareArgs) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type RedeemShares

type RedeemShares struct {

	// [0] = [WRITE] initializedToken
	// ··········· Initialized Token account containing your fractional shares
	//
	// [1] = [WRITE] initializedDestinationToken
	// ··········· Initialized Destination token account where you wish your proceeds to arrive
	//
	// [2] = [WRITE] fractionMint
	// ··········· Fraction mint
	//
	// [3] = [WRITE] redeemTreasury
	// ··········· Redeem treasury account
	//
	// [4] = [] pdaBasedTransferAuthority
	// ··········· PDA-based Transfer authority for the transfer of proceeds from redeem treasury to destination seed [PREFIX, program_id]
	//
	// [5] = [SIGNER] burnAuthority
	// ··········· Burn authority for the burning of your shares
	//
	// [6] = [] combinedTokenVault
	// ··········· Combined token vault
	//
	// [7] = [] tokenProgram
	// ··········· Token program
	//
	// [8] = [] rentSysvar
	// ··········· Rent sysvar
	ag_solanago.AccountMetaSlice `bin:"-"`
}

If in the combine state, shareholders can hit this endpoint to burn shares in exchange for monies from the treasury. Once fractional supply is zero and all tokens have been removed this action will take vault to Deactivated

func NewRedeemSharesInstruction

func NewRedeemSharesInstruction(

	initializedToken ag_solanago.PublicKey,
	initializedDestinationToken ag_solanago.PublicKey,
	fractionMint ag_solanago.PublicKey,
	redeemTreasury ag_solanago.PublicKey,
	pdaBasedTransferAuthority ag_solanago.PublicKey,
	burnAuthority ag_solanago.PublicKey,
	combinedTokenVault ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	rentSysvar ag_solanago.PublicKey) *RedeemShares

NewRedeemSharesInstruction declares a new RedeemShares instruction with the provided parameters and accounts.

func NewRedeemSharesInstructionBuilder

func NewRedeemSharesInstructionBuilder() *RedeemShares

NewRedeemSharesInstructionBuilder creates a new `RedeemShares` instruction builder.

func (RedeemShares) Build

func (inst RedeemShares) Build() *Instruction

func (*RedeemShares) EncodeToTree

func (inst *RedeemShares) EncodeToTree(parent ag_treeout.Branches)

func (*RedeemShares) GetBurnAuthorityAccount

func (inst *RedeemShares) GetBurnAuthorityAccount() *ag_solanago.AccountMeta

GetBurnAuthorityAccount gets the "burnAuthority" account. Burn authority for the burning of your shares

func (*RedeemShares) GetCombinedTokenVaultAccount

func (inst *RedeemShares) GetCombinedTokenVaultAccount() *ag_solanago.AccountMeta

GetCombinedTokenVaultAccount gets the "combinedTokenVault" account. Combined token vault

func (*RedeemShares) GetFractionMintAccount

func (inst *RedeemShares) GetFractionMintAccount() *ag_solanago.AccountMeta

GetFractionMintAccount gets the "fractionMint" account. Fraction mint

func (*RedeemShares) GetInitializedDestinationTokenAccount

func (inst *RedeemShares) GetInitializedDestinationTokenAccount() *ag_solanago.AccountMeta

GetInitializedDestinationTokenAccount gets the "initializedDestinationToken" account. Initialized Destination token account where you wish your proceeds to arrive

func (*RedeemShares) GetInitializedTokenAccount

func (inst *RedeemShares) GetInitializedTokenAccount() *ag_solanago.AccountMeta

GetInitializedTokenAccount gets the "initializedToken" account. Initialized Token account containing your fractional shares

func (*RedeemShares) GetPdaBasedTransferAuthorityAccount

func (inst *RedeemShares) GetPdaBasedTransferAuthorityAccount() *ag_solanago.AccountMeta

GetPdaBasedTransferAuthorityAccount gets the "pdaBasedTransferAuthority" account. PDA-based Transfer authority for the transfer of proceeds from redeem treasury to destination seed [PREFIX, program_id]

func (*RedeemShares) GetRedeemTreasuryAccount

func (inst *RedeemShares) GetRedeemTreasuryAccount() *ag_solanago.AccountMeta

GetRedeemTreasuryAccount gets the "redeemTreasury" account. Redeem treasury account

func (*RedeemShares) GetRentSysvarAccount

func (inst *RedeemShares) GetRentSysvarAccount() *ag_solanago.AccountMeta

GetRentSysvarAccount gets the "rentSysvar" account. Rent sysvar

func (*RedeemShares) GetTokenProgramAccount

func (inst *RedeemShares) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (RedeemShares) MarshalWithEncoder

func (obj RedeemShares) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*RedeemShares) SetBurnAuthorityAccount

func (inst *RedeemShares) SetBurnAuthorityAccount(burnAuthority ag_solanago.PublicKey) *RedeemShares

SetBurnAuthorityAccount sets the "burnAuthority" account. Burn authority for the burning of your shares

func (*RedeemShares) SetCombinedTokenVaultAccount

func (inst *RedeemShares) SetCombinedTokenVaultAccount(combinedTokenVault ag_solanago.PublicKey) *RedeemShares

SetCombinedTokenVaultAccount sets the "combinedTokenVault" account. Combined token vault

func (*RedeemShares) SetFractionMintAccount

func (inst *RedeemShares) SetFractionMintAccount(fractionMint ag_solanago.PublicKey) *RedeemShares

SetFractionMintAccount sets the "fractionMint" account. Fraction mint

func (*RedeemShares) SetInitializedDestinationTokenAccount

func (inst *RedeemShares) SetInitializedDestinationTokenAccount(initializedDestinationToken ag_solanago.PublicKey) *RedeemShares

SetInitializedDestinationTokenAccount sets the "initializedDestinationToken" account. Initialized Destination token account where you wish your proceeds to arrive

func (*RedeemShares) SetInitializedTokenAccount

func (inst *RedeemShares) SetInitializedTokenAccount(initializedToken ag_solanago.PublicKey) *RedeemShares

SetInitializedTokenAccount sets the "initializedToken" account. Initialized Token account containing your fractional shares

func (*RedeemShares) SetPdaBasedTransferAuthorityAccount

func (inst *RedeemShares) SetPdaBasedTransferAuthorityAccount(pdaBasedTransferAuthority ag_solanago.PublicKey) *RedeemShares

SetPdaBasedTransferAuthorityAccount sets the "pdaBasedTransferAuthority" account. PDA-based Transfer authority for the transfer of proceeds from redeem treasury to destination seed [PREFIX, program_id]

func (*RedeemShares) SetRedeemTreasuryAccount

func (inst *RedeemShares) SetRedeemTreasuryAccount(redeemTreasury ag_solanago.PublicKey) *RedeemShares

SetRedeemTreasuryAccount sets the "redeemTreasury" account. Redeem treasury account

func (*RedeemShares) SetRentSysvarAccount

func (inst *RedeemShares) SetRentSysvarAccount(rentSysvar ag_solanago.PublicKey) *RedeemShares

SetRentSysvarAccount sets the "rentSysvar" account. Rent sysvar

func (*RedeemShares) SetTokenProgramAccount

func (inst *RedeemShares) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *RedeemShares

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*RedeemShares) UnmarshalWithDecoder

func (obj *RedeemShares) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*RedeemShares) Validate

func (inst *RedeemShares) Validate() error

func (RedeemShares) ValidateAndBuild

func (inst RedeemShares) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type SafetyDepositBox

type SafetyDepositBox struct {
	// Each token type in a vault has it's own box that contains it's mint and a look-back
	Key Key

	// Key pointing to the parent vault
	Vault ag_solanago.PublicKey

	// This particular token's mint
	TokenMint ag_solanago.PublicKey

	// Account that stores the tokens under management
	Store ag_solanago.PublicKey

	// the order in the array of registries
	Order uint8
}

func (SafetyDepositBox) MarshalWithEncoder

func (obj SafetyDepositBox) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*SafetyDepositBox) UnmarshalWithDecoder

func (obj *SafetyDepositBox) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type SetAuthority

type SetAuthority struct {

	// [0] = [WRITE] vault
	// ··········· Vault
	//
	// [1] = [SIGNER] vaultAuthority
	// ··········· Vault authority
	//
	// [2] = [] newAuthority
	// ··········· New authority
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Sets the authority of the vault to a new authority.

func NewSetAuthorityInstruction

func NewSetAuthorityInstruction(

	vault ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	newAuthority ag_solanago.PublicKey) *SetAuthority

NewSetAuthorityInstruction declares a new SetAuthority instruction with the provided parameters and accounts.

func NewSetAuthorityInstructionBuilder

func NewSetAuthorityInstructionBuilder() *SetAuthority

NewSetAuthorityInstructionBuilder creates a new `SetAuthority` instruction builder.

func (SetAuthority) Build

func (inst SetAuthority) Build() *Instruction

func (*SetAuthority) EncodeToTree

func (inst *SetAuthority) EncodeToTree(parent ag_treeout.Branches)

func (*SetAuthority) GetNewAuthorityAccount

func (inst *SetAuthority) GetNewAuthorityAccount() *ag_solanago.AccountMeta

GetNewAuthorityAccount gets the "newAuthority" account. New authority

func (*SetAuthority) GetVaultAccount

func (inst *SetAuthority) GetVaultAccount() *ag_solanago.AccountMeta

GetVaultAccount gets the "vault" account. Vault

func (*SetAuthority) GetVaultAuthorityAccount

func (inst *SetAuthority) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Vault authority

func (SetAuthority) MarshalWithEncoder

func (obj SetAuthority) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*SetAuthority) SetNewAuthorityAccount

func (inst *SetAuthority) SetNewAuthorityAccount(newAuthority ag_solanago.PublicKey) *SetAuthority

SetNewAuthorityAccount sets the "newAuthority" account. New authority

func (*SetAuthority) SetVaultAccount

func (inst *SetAuthority) SetVaultAccount(vault ag_solanago.PublicKey) *SetAuthority

SetVaultAccount sets the "vault" account. Vault

func (*SetAuthority) SetVaultAuthorityAccount

func (inst *SetAuthority) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *SetAuthority

SetVaultAuthorityAccount sets the "vaultAuthority" account. Vault authority

func (*SetAuthority) UnmarshalWithDecoder

func (obj *SetAuthority) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*SetAuthority) Validate

func (inst *SetAuthority) Validate() error

func (SetAuthority) ValidateAndBuild

func (inst SetAuthority) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type UpdateExternalPriceAccount

type UpdateExternalPriceAccount struct {
	Args *ExternalPriceAccount

	// [0] = [WRITE] externalPrice
	// ··········· External price account
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Helpful method that isn't necessary to use for main users of the app, but allows one to create/update existing external price account fields if they are signers of this account. Useful for testing purposes, and the CLI makes use of it as well so that you can verify logic.

func NewUpdateExternalPriceAccountInstruction

func NewUpdateExternalPriceAccountInstruction(

	args ExternalPriceAccount,

	externalPrice ag_solanago.PublicKey) *UpdateExternalPriceAccount

NewUpdateExternalPriceAccountInstruction declares a new UpdateExternalPriceAccount instruction with the provided parameters and accounts.

func NewUpdateExternalPriceAccountInstructionBuilder

func NewUpdateExternalPriceAccountInstructionBuilder() *UpdateExternalPriceAccount

NewUpdateExternalPriceAccountInstructionBuilder creates a new `UpdateExternalPriceAccount` instruction builder.

func (UpdateExternalPriceAccount) Build

func (*UpdateExternalPriceAccount) EncodeToTree

func (inst *UpdateExternalPriceAccount) EncodeToTree(parent ag_treeout.Branches)

func (*UpdateExternalPriceAccount) GetExternalPriceAccount

func (inst *UpdateExternalPriceAccount) GetExternalPriceAccount() *ag_solanago.AccountMeta

GetExternalPriceAccount gets the "externalPrice" account. External price account

func (UpdateExternalPriceAccount) MarshalWithEncoder

func (obj UpdateExternalPriceAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*UpdateExternalPriceAccount) SetArgs

SetArgs sets the "args" parameter.

func (*UpdateExternalPriceAccount) SetExternalPriceAccount

func (inst *UpdateExternalPriceAccount) SetExternalPriceAccount(externalPrice ag_solanago.PublicKey) *UpdateExternalPriceAccount

SetExternalPriceAccount sets the "externalPrice" account. External price account

func (*UpdateExternalPriceAccount) UnmarshalWithDecoder

func (obj *UpdateExternalPriceAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*UpdateExternalPriceAccount) Validate

func (inst *UpdateExternalPriceAccount) Validate() error

func (UpdateExternalPriceAccount) ValidateAndBuild

func (inst UpdateExternalPriceAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Vault

type Vault struct {
	Key Key

	// Store token program used
	TokenProgram ag_solanago.PublicKey

	// Mint that produces the fractional shares
	FractionMint ag_solanago.PublicKey

	// Authority who can make changes to the vault
	Authority ag_solanago.PublicKey

	// treasury where fractional shares are held for redemption by authority
	FractionTreasury ag_solanago.PublicKey

	// treasury where monies are held for fractional share holders to redeem(burn) shares once buyout is made
	RedeemTreasury ag_solanago.PublicKey

	// Can authority mint more shares from fraction_mint after activation
	AllowFurtherShareCreation bool

	// Must point at an ExternalPriceAccount, which gives permission and price for buyout.
	PricingLookupAddress ag_solanago.PublicKey

	// In inactive state, we use this to set the order key on Safety Deposit Boxes being added and
	// then we increment it and save so the next safety deposit box gets the next number.
	// In the Combined state during token redemption by authority, we use it as a decrementing counter each time
	// The authority of the vault withdrawals a Safety Deposit contents to count down how many
	// are left to be opened and closed down. Once this hits zero, and the fraction mint has zero shares,
	// then we can deactivate the vault.
	TokenTypeCount uint8
	State          VaultState

	// Once combination happens, we copy price per share to vault so that if something nefarious happens
	// to external price account, like price change, we still have the math 'saved' for use in our calcs
	LockedPricePerShare uint64
}

func (Vault) MarshalWithEncoder

func (obj Vault) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Vault) UnmarshalWithDecoder

func (obj *Vault) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

type VaultState

type VaultState ag_binary.BorshEnum
const (
	VaultStateInactive VaultState = iota
	VaultStateActive
	VaultStateCombined
	VaultStateDeactivated
)

func (VaultState) String

func (value VaultState) String() string

type WithdrawSharesFromTreasury

type WithdrawSharesFromTreasury struct {
	Args *NumberOfShareArgs

	// [0] = [WRITE] initializedDestination
	// ··········· Initialized Destination account for the shares being withdrawn
	//
	// [1] = [WRITE] fractionTreasury
	// ··········· Fraction treasury
	//
	// [2] = [] initializedActiveTokenVault
	// ··········· The initialized active token vault
	//
	// [3] = [] pdaBasedTransferAuthority
	// ··········· PDA-based Transfer authority to move tokens from treasury to your destination[PREFIX, program_id]
	//
	// [4] = [SIGNER] vaultAuthority
	// ··········· Authority of vault
	//
	// [5] = [] tokenProgram
	// ··········· Token program
	//
	// [6] = [] rentSysvar
	// ··········· Rent sysvar
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Withdraws shares from the treasury to a desired account.

func NewWithdrawSharesFromTreasuryInstruction

func NewWithdrawSharesFromTreasuryInstruction(

	args NumberOfShareArgs,

	initializedDestination ag_solanago.PublicKey,
	fractionTreasury ag_solanago.PublicKey,
	initializedActiveTokenVault ag_solanago.PublicKey,
	pdaBasedTransferAuthority ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	rentSysvar ag_solanago.PublicKey) *WithdrawSharesFromTreasury

NewWithdrawSharesFromTreasuryInstruction declares a new WithdrawSharesFromTreasury instruction with the provided parameters and accounts.

func NewWithdrawSharesFromTreasuryInstructionBuilder

func NewWithdrawSharesFromTreasuryInstructionBuilder() *WithdrawSharesFromTreasury

NewWithdrawSharesFromTreasuryInstructionBuilder creates a new `WithdrawSharesFromTreasury` instruction builder.

func (WithdrawSharesFromTreasury) Build

func (*WithdrawSharesFromTreasury) EncodeToTree

func (inst *WithdrawSharesFromTreasury) EncodeToTree(parent ag_treeout.Branches)

func (*WithdrawSharesFromTreasury) GetFractionTreasuryAccount

func (inst *WithdrawSharesFromTreasury) GetFractionTreasuryAccount() *ag_solanago.AccountMeta

GetFractionTreasuryAccount gets the "fractionTreasury" account. Fraction treasury

func (*WithdrawSharesFromTreasury) GetInitializedActiveTokenVaultAccount

func (inst *WithdrawSharesFromTreasury) GetInitializedActiveTokenVaultAccount() *ag_solanago.AccountMeta

GetInitializedActiveTokenVaultAccount gets the "initializedActiveTokenVault" account. The initialized active token vault

func (*WithdrawSharesFromTreasury) GetInitializedDestinationAccount

func (inst *WithdrawSharesFromTreasury) GetInitializedDestinationAccount() *ag_solanago.AccountMeta

GetInitializedDestinationAccount gets the "initializedDestination" account. Initialized Destination account for the shares being withdrawn

func (*WithdrawSharesFromTreasury) GetPdaBasedTransferAuthorityAccount

func (inst *WithdrawSharesFromTreasury) GetPdaBasedTransferAuthorityAccount() *ag_solanago.AccountMeta

GetPdaBasedTransferAuthorityAccount gets the "pdaBasedTransferAuthority" account. PDA-based Transfer authority to move tokens from treasury to your destination[PREFIX, program_id]

func (*WithdrawSharesFromTreasury) GetRentSysvarAccount

func (inst *WithdrawSharesFromTreasury) GetRentSysvarAccount() *ag_solanago.AccountMeta

GetRentSysvarAccount gets the "rentSysvar" account. Rent sysvar

func (*WithdrawSharesFromTreasury) GetTokenProgramAccount

func (inst *WithdrawSharesFromTreasury) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (*WithdrawSharesFromTreasury) GetVaultAuthorityAccount

func (inst *WithdrawSharesFromTreasury) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Authority of vault

func (WithdrawSharesFromTreasury) MarshalWithEncoder

func (obj WithdrawSharesFromTreasury) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*WithdrawSharesFromTreasury) SetArgs

SetArgs sets the "args" parameter.

func (*WithdrawSharesFromTreasury) SetFractionTreasuryAccount

func (inst *WithdrawSharesFromTreasury) SetFractionTreasuryAccount(fractionTreasury ag_solanago.PublicKey) *WithdrawSharesFromTreasury

SetFractionTreasuryAccount sets the "fractionTreasury" account. Fraction treasury

func (*WithdrawSharesFromTreasury) SetInitializedActiveTokenVaultAccount

func (inst *WithdrawSharesFromTreasury) SetInitializedActiveTokenVaultAccount(initializedActiveTokenVault ag_solanago.PublicKey) *WithdrawSharesFromTreasury

SetInitializedActiveTokenVaultAccount sets the "initializedActiveTokenVault" account. The initialized active token vault

func (*WithdrawSharesFromTreasury) SetInitializedDestinationAccount

func (inst *WithdrawSharesFromTreasury) SetInitializedDestinationAccount(initializedDestination ag_solanago.PublicKey) *WithdrawSharesFromTreasury

SetInitializedDestinationAccount sets the "initializedDestination" account. Initialized Destination account for the shares being withdrawn

func (*WithdrawSharesFromTreasury) SetPdaBasedTransferAuthorityAccount

func (inst *WithdrawSharesFromTreasury) SetPdaBasedTransferAuthorityAccount(pdaBasedTransferAuthority ag_solanago.PublicKey) *WithdrawSharesFromTreasury

SetPdaBasedTransferAuthorityAccount sets the "pdaBasedTransferAuthority" account. PDA-based Transfer authority to move tokens from treasury to your destination[PREFIX, program_id]

func (*WithdrawSharesFromTreasury) SetRentSysvarAccount

func (inst *WithdrawSharesFromTreasury) SetRentSysvarAccount(rentSysvar ag_solanago.PublicKey) *WithdrawSharesFromTreasury

SetRentSysvarAccount sets the "rentSysvar" account. Rent sysvar

func (*WithdrawSharesFromTreasury) SetTokenProgramAccount

func (inst *WithdrawSharesFromTreasury) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *WithdrawSharesFromTreasury

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*WithdrawSharesFromTreasury) SetVaultAuthorityAccount

func (inst *WithdrawSharesFromTreasury) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *WithdrawSharesFromTreasury

SetVaultAuthorityAccount sets the "vaultAuthority" account. Authority of vault

func (*WithdrawSharesFromTreasury) UnmarshalWithDecoder

func (obj *WithdrawSharesFromTreasury) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*WithdrawSharesFromTreasury) Validate

func (inst *WithdrawSharesFromTreasury) Validate() error

func (WithdrawSharesFromTreasury) ValidateAndBuild

func (inst WithdrawSharesFromTreasury) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type WithdrawTokenFromSafetyDepositBox

type WithdrawTokenFromSafetyDepositBox struct {
	Args *AmountArgs

	// [0] = [WRITE] initializedDestination
	// ··········· Initialized Destination account for the tokens being withdrawn
	//
	// [1] = [WRITE] safetyDepositBox
	// ··········· The safety deposit box account key for the tokens
	//
	// [2] = [WRITE] storeKey
	// ··········· The store key on the safety deposit box account
	//
	// [3] = [WRITE] initializedCombinedTokenVault
	// ··········· The initialized combined token vault
	//
	// [4] = [] fractionMint
	// ··········· Fraction mint
	//
	// [5] = [SIGNER] vaultAuthority
	// ··········· Authority of vault
	//
	// [6] = [] pdaBasedTransferAuthority
	// ··········· PDA-based Transfer authority to move the tokens from the store to the destination seed [PREFIX, program_id]
	//
	// [7] = [] tokenProgram
	// ··········· Token program
	//
	// [8] = [] rentSysvar
	// ··········· Rent sysvar
	ag_solanago.AccountMetaSlice `bin:"-"`
}

If in combine state, authority on vault can hit this to withdrawal some of a token type from a safety deposit box. Once fractional supply is zero and all tokens have been removed this action will take vault to Deactivated

func NewWithdrawTokenFromSafetyDepositBoxInstruction

func NewWithdrawTokenFromSafetyDepositBoxInstruction(

	args AmountArgs,

	initializedDestination ag_solanago.PublicKey,
	safetyDepositBox ag_solanago.PublicKey,
	storeKey ag_solanago.PublicKey,
	initializedCombinedTokenVault ag_solanago.PublicKey,
	fractionMint ag_solanago.PublicKey,
	vaultAuthority ag_solanago.PublicKey,
	pdaBasedTransferAuthority ag_solanago.PublicKey,
	tokenProgram ag_solanago.PublicKey,
	rentSysvar ag_solanago.PublicKey) *WithdrawTokenFromSafetyDepositBox

NewWithdrawTokenFromSafetyDepositBoxInstruction declares a new WithdrawTokenFromSafetyDepositBox instruction with the provided parameters and accounts.

func NewWithdrawTokenFromSafetyDepositBoxInstructionBuilder

func NewWithdrawTokenFromSafetyDepositBoxInstructionBuilder() *WithdrawTokenFromSafetyDepositBox

NewWithdrawTokenFromSafetyDepositBoxInstructionBuilder creates a new `WithdrawTokenFromSafetyDepositBox` instruction builder.

func (WithdrawTokenFromSafetyDepositBox) Build

func (*WithdrawTokenFromSafetyDepositBox) EncodeToTree

func (inst *WithdrawTokenFromSafetyDepositBox) EncodeToTree(parent ag_treeout.Branches)

func (*WithdrawTokenFromSafetyDepositBox) GetFractionMintAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetFractionMintAccount() *ag_solanago.AccountMeta

GetFractionMintAccount gets the "fractionMint" account. Fraction mint

func (*WithdrawTokenFromSafetyDepositBox) GetInitializedCombinedTokenVaultAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetInitializedCombinedTokenVaultAccount() *ag_solanago.AccountMeta

GetInitializedCombinedTokenVaultAccount gets the "initializedCombinedTokenVault" account. The initialized combined token vault

func (*WithdrawTokenFromSafetyDepositBox) GetInitializedDestinationAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetInitializedDestinationAccount() *ag_solanago.AccountMeta

GetInitializedDestinationAccount gets the "initializedDestination" account. Initialized Destination account for the tokens being withdrawn

func (*WithdrawTokenFromSafetyDepositBox) GetPdaBasedTransferAuthorityAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetPdaBasedTransferAuthorityAccount() *ag_solanago.AccountMeta

GetPdaBasedTransferAuthorityAccount gets the "pdaBasedTransferAuthority" account. PDA-based Transfer authority to move the tokens from the store to the destination seed [PREFIX, program_id]

func (*WithdrawTokenFromSafetyDepositBox) GetRentSysvarAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetRentSysvarAccount() *ag_solanago.AccountMeta

GetRentSysvarAccount gets the "rentSysvar" account. Rent sysvar

func (*WithdrawTokenFromSafetyDepositBox) GetSafetyDepositBoxAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetSafetyDepositBoxAccount() *ag_solanago.AccountMeta

GetSafetyDepositBoxAccount gets the "safetyDepositBox" account. The safety deposit box account key for the tokens

func (*WithdrawTokenFromSafetyDepositBox) GetStoreKeyAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetStoreKeyAccount() *ag_solanago.AccountMeta

GetStoreKeyAccount gets the "storeKey" account. The store key on the safety deposit box account

func (*WithdrawTokenFromSafetyDepositBox) GetTokenProgramAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetTokenProgramAccount() *ag_solanago.AccountMeta

GetTokenProgramAccount gets the "tokenProgram" account. Token program

func (*WithdrawTokenFromSafetyDepositBox) GetVaultAuthorityAccount

func (inst *WithdrawTokenFromSafetyDepositBox) GetVaultAuthorityAccount() *ag_solanago.AccountMeta

GetVaultAuthorityAccount gets the "vaultAuthority" account. Authority of vault

func (WithdrawTokenFromSafetyDepositBox) MarshalWithEncoder

func (obj WithdrawTokenFromSafetyDepositBox) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*WithdrawTokenFromSafetyDepositBox) SetArgs

SetArgs sets the "args" parameter.

func (*WithdrawTokenFromSafetyDepositBox) SetFractionMintAccount

SetFractionMintAccount sets the "fractionMint" account. Fraction mint

func (*WithdrawTokenFromSafetyDepositBox) SetInitializedCombinedTokenVaultAccount

func (inst *WithdrawTokenFromSafetyDepositBox) SetInitializedCombinedTokenVaultAccount(initializedCombinedTokenVault ag_solanago.PublicKey) *WithdrawTokenFromSafetyDepositBox

SetInitializedCombinedTokenVaultAccount sets the "initializedCombinedTokenVault" account. The initialized combined token vault

func (*WithdrawTokenFromSafetyDepositBox) SetInitializedDestinationAccount

func (inst *WithdrawTokenFromSafetyDepositBox) SetInitializedDestinationAccount(initializedDestination ag_solanago.PublicKey) *WithdrawTokenFromSafetyDepositBox

SetInitializedDestinationAccount sets the "initializedDestination" account. Initialized Destination account for the tokens being withdrawn

func (*WithdrawTokenFromSafetyDepositBox) SetPdaBasedTransferAuthorityAccount

func (inst *WithdrawTokenFromSafetyDepositBox) SetPdaBasedTransferAuthorityAccount(pdaBasedTransferAuthority ag_solanago.PublicKey) *WithdrawTokenFromSafetyDepositBox

SetPdaBasedTransferAuthorityAccount sets the "pdaBasedTransferAuthority" account. PDA-based Transfer authority to move the tokens from the store to the destination seed [PREFIX, program_id]

func (*WithdrawTokenFromSafetyDepositBox) SetRentSysvarAccount

SetRentSysvarAccount sets the "rentSysvar" account. Rent sysvar

func (*WithdrawTokenFromSafetyDepositBox) SetSafetyDepositBoxAccount

func (inst *WithdrawTokenFromSafetyDepositBox) SetSafetyDepositBoxAccount(safetyDepositBox ag_solanago.PublicKey) *WithdrawTokenFromSafetyDepositBox

SetSafetyDepositBoxAccount sets the "safetyDepositBox" account. The safety deposit box account key for the tokens

func (*WithdrawTokenFromSafetyDepositBox) SetStoreKeyAccount

SetStoreKeyAccount sets the "storeKey" account. The store key on the safety deposit box account

func (*WithdrawTokenFromSafetyDepositBox) SetTokenProgramAccount

SetTokenProgramAccount sets the "tokenProgram" account. Token program

func (*WithdrawTokenFromSafetyDepositBox) SetVaultAuthorityAccount

func (inst *WithdrawTokenFromSafetyDepositBox) SetVaultAuthorityAccount(vaultAuthority ag_solanago.PublicKey) *WithdrawTokenFromSafetyDepositBox

SetVaultAuthorityAccount sets the "vaultAuthority" account. Authority of vault

func (*WithdrawTokenFromSafetyDepositBox) UnmarshalWithDecoder

func (obj *WithdrawTokenFromSafetyDepositBox) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*WithdrawTokenFromSafetyDepositBox) Validate

func (inst *WithdrawTokenFromSafetyDepositBox) Validate() error

func (WithdrawTokenFromSafetyDepositBox) ValidateAndBuild

func (inst WithdrawTokenFromSafetyDepositBox) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL