fluidity

package
v0.0.0-...-07d62d3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 0
	// VariantWrap to wrap spl tokens into fluid tokens
	VariantWrap = iota

	// VariantUnwrap to unwrap fluid tokens to spl tokens
	VariantUnwrap

	// VariantPayout to pay winnings to users
	VariantPayout

	// VariantInitSolendObligation to initialize solend accounts
	VariantInitSolendObligation

	// VariantLogTvl to write the current TVL to an account
	VariantLogTvl

	// 5
	// VariantInitData to initialize contract account
	VariantInitData

	// VariantDrain to drain the prize pool
	VariantDrain

	// VariantUpdateMintLimits to update the mint caps
	VariantUpdateMintLimits

	// VariantUpdatePayoutLimits to update the amount that can be freely
	// minted
	VariantUpdatePayoutLimits

	// VariantUpdatePayoutAuthority to update the worker key
	VariantUpdatePayoutAuthority

	// 10
	// VariantUpdateOperator to update the admin account
	VariantUpdateOperator

	// VariantConfirmUpdatePayoutAuthority to finalise a worker update
	VariantConfirmUpdatePayoutAuthority

	// VariantEmergency to lock down the contract
	VariantEmergency
)

Variables

View Source
var UnknownInstructionError = solana.UnknownInstructionError

Functions

func GetBaseToken

func GetBaseToken(token string, fluidTokens map[string]string) (string, error)

GetBaseToken takes a fluid token and returns its counterpart

func IsFluidToken

func IsFluidToken(token string, fluidTokens map[string]string) bool

IsFluidToken takes a token and checks if is one of the fluid tokens

Types

type FluidityInstruction

type FluidityInstruction struct {
	Wrap   *FluidityWrap
	Unwrap *FluidityUnwrap
	Payout *FluidityPayout
}

FluidityInstruction is a container storing a single variant of the decoded fluidity instruction enum

func DecodeFluidityInstruction

func DecodeFluidityInstruction(data string) (FluidityInstruction, error)

DecodeFluidityInstruction tries to decode base58 encoded solana transaction data into a fluidity instruction

type FluidityPayout

type FluidityPayout struct {
	Value uint64
}

FluidityPayout represents Payout(u64), giving a reward payout to two users

type FluidityUnwrap

type FluidityUnwrap struct {
	Value uint64
}

FluidityUnwrap represents Unwrap(u64), converting from fluid -> normal tokens

type FluidityWrap

type FluidityWrap struct {
	Value uint64
}

FluidityWrap represents Wrap(u64), converting from normal -> fluid tokens

Jump to

Keyboard shortcuts

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