Versions in this module Expand all Collapse all v0 v0.2.0 Dec 1, 2025 v0.1.0 Nov 28, 2025 Changes in this version + var CodeVmAccount = NewAccountFromPublicKeyString(config.VmAccountPublicKey) + var CodeVmOmnibusAccount = NewAccountFromPublicKeyString(config.VmOmnibusPublicKey) + var CoreMintAccount = NewAccountFromPublicKeyBytes(config.CoreMintPublicKeyBytes) + var CoreMintDecimals = config.CoreMintDecimals + var CoreMintName = config.CoreMintName + var CoreMintQuarksPerUnit = uint64(config.CoreMintQuarksPerUnit) + var CoreMintSymbol = config.CoreMintSymbol + var ErrOwnerNotFound = errors.New("owner account not found") + var ErrSubsidizerRequiresFunding = errors.New("subsidizer requires funding") + var ErrUnsupportedMint = errors.New("unsupported mint") + func EnforceMinimumSubsidizerBalance(ctx context.Context, data code_data.Provider) error + func EnsureVirtualTimelockAccountIsInitialized(ctx context.Context, data code_data.Provider, ...) error + func EstimateUsedSubsidizerBalance(ctx context.Context, data code_data.Provider) (uint64, error) + func FromCoreMintQuarks(quarks uint64) uint64 + func GetCurrentSubsidizerBalance(ctx context.Context, data code_data.Provider) (uint64, error) + func GetLatestCodeTimelockAccountRecordsForOwner(ctx context.Context, data code_data.Provider, owner *Account) (map[string]map[commonpb.AccountType][]*AccountRecords, error) + func GetLatestTokenAccountRecordsForOwner(ctx context.Context, data code_data.Provider, owner *Account) (map[string]map[commonpb.AccountType][]*AccountRecords, error) + func GetMintQuarksPerUnit(mint *Account) uint64 + func InjectTestSubsidizer(ctx context.Context, data code_data.Provider, testAccount *Account) error + func IsCoreMint(mint *Account) bool + func IsCoreMintUsdStableCoin() bool + func IsManagedByCode(ctx context.Context, timelockRecord *timelock.Record) bool + func IsSupportedMint(ctx context.Context, data code_data.Provider, mintAccount *Account) (bool, error) + func LoadProductionSubsidizer(ctx context.Context, data code_data.Provider) error + func ToCoreMintQuarks(units uint64) uint64 + func ValidateExternalTokenAccount(ctx context.Context, data code_data.Provider, ...) (bool, string, error) + type Account struct + func GetBackwardsCompatMint(protoMint *commonpb.SolanaAccountId) (*Account, error) + func GetSubsidizer() *Account + func GetVirtualTimelockAccountLocationInMemory(ctx context.Context, vmIndexerClient indexerpb.IndexerClient, ...) (*Account, uint16, error) + func NewAccountFromPrivateKey(privateKey *Key) (*Account, error) + func NewAccountFromPrivateKeyBytes(publicKey []byte) (*Account, error) + func NewAccountFromPrivateKeyString(privateKey string) (*Account, error) + func NewAccountFromProto(proto *commonpb.SolanaAccountId) (*Account, error) + func NewAccountFromPublicKey(publicKey *Key) (*Account, error) + func NewAccountFromPublicKeyBytes(publicKey []byte) (*Account, error) + func NewAccountFromPublicKeyString(publicKey string) (*Account, error) + func NewRandomAccount() (*Account, error) + func (a *Account) GetTimelockAccounts(vmConfig *VmConfig) (*TimelockAccounts, error) + func (a *Account) GetVmDepositAccounts(vmConfig *VmConfig) (*VmDepositAccounts, error) + func (a *Account) GetVmSwapAccounts(vmConfig *VmConfig) (*VmSwapAccounts, error) + func (a *Account) IsManagedByCode(ctx context.Context, data code_data.Provider) (bool, error) + func (a *Account) IsOnCurve() bool + func (a *Account) PrivateKey() *Key + func (a *Account) PublicKey() *Key + func (a *Account) Sign(message []byte) ([]byte, error) + func (a *Account) String() string + func (a *Account) ToAssociatedTokenAccount(mint *Account) (*Account, error) + func (a *Account) ToProto() *commonpb.SolanaAccountId + func (a *Account) ToTimelockVault(vmConfig *VmConfig) (*Account, error) + func (a *Account) ToVmDepositAta(vmConfig *VmConfig) (*Account, error) + func (a *Account) ToVmSwapAta(vmConfig *VmConfig) (*Account, error) + func (a *Account) Validate() error + type AccountRecords struct + General *account.Record + Timelock *timelock.Record + func (r *AccountRecords) IsManagedByCode(ctx context.Context) bool + func (r *AccountRecords) IsTimelock() bool + type Key struct + func NewKeyFromBytes(value []byte) (*Key, error) + func NewKeyFromString(value string) (*Key, error) + func NewRandomKey() (*Key, error) + func (k *Key) IsPublic() bool + func (k *Key) ToBase58() string + func (k *Key) ToBytes() []byte + func (k *Key) Validate() error + type LaunchpadCurrencyAccounts struct + CurrencyConfig *Account + CurrencyConfigBump uint8 + FeesBase *Account + FeesMint *Account + LiquidityPool *Account + LiquidityPoolBump uint8 + Mint *Account + VaultBase *Account + VaultBaseBump uint8 + VaultMint *Account + VaultMintBump uint8 + func GetLaunchpadCurrencyAccounts(metadataRecord *currency.MetadataRecord) (*LaunchpadCurrencyAccounts, error) + type OwnerManagementState uint8 + const OwnerManagementStateCodeAccount + const OwnerManagementStateNotFound + const OwnerManagementStateUnknown + const OwnerManagementStateUnlocked + func GetOwnerManagementState(ctx context.Context, data code_data.Provider, owner *Account) (OwnerManagementState, error) + func (t OwnerManagementState) String() string + type OwnerMetadata struct + Account *Account + State OwnerManagementState + Type OwnerType + func GetOwnerMetadata(ctx context.Context, data code_data.Provider, owner *Account) (*OwnerMetadata, error) + type OwnerType uint8 + const OwnerTypeRemoteSendGiftCard + const OwnerTypeUnknown + const OwnerTypeUser12Words + func (t OwnerType) String() string + type TimelockAccounts struct + Mint *Account + State *Account + StateBump uint8 + Unlock *Account + UnlockBump uint8 + Vault *Account + VaultBump uint8 + VaultOwner *Account + Vm *Account + VmDepositAccounts *VmDepositAccounts + VmSwapAccounts *VmSwapAccounts + func (a *TimelockAccounts) GetDBRecord(ctx context.Context, data code_data.Provider) (*timelock.Record, error) + func (a *TimelockAccounts) GetInitializeInstruction(vmAuthority, memory *Account, accountIndex uint16) (solana.Instruction, error) + func (a *TimelockAccounts) ToDBRecord() *timelock.Record + type VmConfig struct + Authority *Account + Mint *Account + Omnibus *Account + Vm *Account + func GetVmConfigForMint(ctx context.Context, data code_data.Provider, mint *Account) (*VmConfig, error) + type VmDepositAccounts struct + Ata *Account + Mint *Account + Pda *Account + PdaBump uint8 + VaultOwner *Account + Vm *Account + type VmSwapAccounts struct + Ata *Account + Mint *Account + Pda *Account + PdaBump uint8 + VaultOwner *Account + Vm *Account