asset

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Discriminator_initialize             uint64 = 0xafaf6d1f0d989bed
	Discriminator_transferLamportsToAta  uint64 = 0x19abfdc53787513b
	Discriminator_syncNativeAta          uint64 = 0xf22a38bcd6c68795
	Discriminator_proxyOrcaSwap          uint64 = 0xddbc843aea104171
	Discriminator_proxyRaydiumSwapBaseIn uint64 = 0x1c49426140d5541a
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Initialize

type Initialize struct {

	//资产账户
	Asset common.Address
	//FeePayer
	User common.Address

	//资产合约超级管理员
	Administrator common.Address
	//多签管理员一
	SingerA common.Address
	//多签管理员二
	SingerB common.Address
	//多签管理员三
	SingerC common.Address
	//工作者(主)
	PrimaryWorker common.Address
	//工作者(次)
	SecondaryWorker common.Address

	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

func NewInitInstruction

func NewInitInstruction(
	Administrator common.Address,
	SingerA common.Address,
	SingerB common.Address,
	SingerC common.Address,
	PrimaryWorker common.Address,
	SecondaryWorker common.Address,
	AssetAccount common.Address,
	UserAccount common.Address,
) *Initialize

func NewInitInstructionBuilder

func NewInitInstructionBuilder() *Initialize

func (Initialize) Build

func (init Initialize) Build() *Instruction

func (Initialize) MarshalWithEncoder

func (init Initialize) MarshalWithEncoder(encoder *encodbin.Encoder) (err error)

func (*Initialize) SetAdministrator

func (init *Initialize) SetAdministrator(asset common.Address) *Initialize

合约超级管理员.

func (*Initialize) SetAssetAccount

func (init *Initialize) SetAssetAccount(asset common.Address) *Initialize

资产账户

func (*Initialize) SetPrimaryWorker

func (init *Initialize) SetPrimaryWorker(asset common.Address) *Initialize

工作者(主)

func (*Initialize) SetSecondaryWorker

func (init *Initialize) SetSecondaryWorker(asset common.Address) *Initialize

工作者(副)

func (*Initialize) SetSingerA

func (init *Initialize) SetSingerA(asset common.Address) *Initialize

多签A

func (*Initialize) SetSingerB

func (init *Initialize) SetSingerB(asset common.Address) *Initialize

多签B

func (*Initialize) SetSingerC

func (init *Initialize) SetSingerC(asset common.Address) *Initialize

多签C

func (*Initialize) SetUserAccount

func (init *Initialize) SetUserAccount(asset common.Address) *Initialize

FeePayer

type Instruction

type Instruction struct {
	encodbin.BaseVariant
	AssertExecutorProgramID common.Address
}

func (*Instruction) Accounts

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

func (*Instruction) Data

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

func (*Instruction) MarshalWithEncoder

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

func (*Instruction) ProgramID

func (inst *Instruction) ProgramID() common.Address

func (*Instruction) SetProgramID

func (inst *Instruction) SetProgramID(tokenProgramID common.Address)

type ProxyRaydiumSwapBaseIn

type ProxyRaydiumSwapBaseIn struct {
	AmmProgram        common.Address
	Amm               common.Address
	AmmAuthority      common.Address
	AmmOpenOrders     common.Address
	AmmTargetOrders   common.Address
	AmmCoinVault      common.Address
	AmmPcVault        common.Address
	MarketProgram     common.Address
	Market            common.Address
	MarketBids        common.Address
	MarketAsks        common.Address
	MarketEventQueue  common.Address
	MarketCoinVault   common.Address
	MarketPcVault     common.Address
	MarketVaultSigner common.Address
	//out by only owner asset ata.
	UserTokenSource common.Address
	//in by only owner asset ata.
	UserTokenDestination common.Address
	Asset                common.Address
	Administrator        common.Address
	Worker               common.Address
	//交易得到的代币Mint地址,填写错误会导致模拟交易失败!
	//only destination token mint.
	Mint             common.Address
	AmountIn         uint64
	MinimumAmountOut uint64
	//当source余额为0时,是否自动关闭ata账户并且返回SOL到Worker.
	CanClose bool

	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

func NewProxyRaydiumSwapBaseIn

func NewProxyRaydiumSwapBaseIn(
	AmmProgram common.Address,
	Amm common.Address,
	AmmAuthority common.Address,
	AmmOpenOrders common.Address,
	AmmTargetOrders common.Address,
	AmmCoinVault common.Address,
	AmmPcVault common.Address,
	MarketProgram common.Address,
	Market common.Address,
	MarketBids common.Address,
	MarketAsks common.Address,
	MarketEventQueue common.Address,
	MarketCoinVault common.Address,
	MarketPcVault common.Address,
	MarketVaultSigner common.Address,
	UserTokenSource common.Address,
	UserTokenDestination common.Address,
	Asset common.Address,
	Administrator common.Address,
	Worker common.Address,
	Mint common.Address,
	AmountIn uint64,
	MinimumAmountOut uint64,
	CanClose bool,
) *ProxyRaydiumSwapBaseIn

func (ProxyRaydiumSwapBaseIn) Build

func (init ProxyRaydiumSwapBaseIn) Build() *Instruction

func (ProxyRaydiumSwapBaseIn) MarshalWithEncoder

func (init ProxyRaydiumSwapBaseIn) MarshalWithEncoder(encoder *encodbin.Encoder) (err error)

type SyncNativeAssetAta

type SyncNativeAssetAta struct {

	//资产账户
	Asset common.Address
	//Ata账户(强制owner是Asset)
	WarpSolAccount common.Address
	//Mint地址
	Mint common.Address
	//资产账户管理员地址
	Administrator common.Address
	//工作者
	Worker common.Address

	AssociatedTokenProgram common.Address
	TokenProgram           common.Address
	SystemProgram          common.Address

	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

func NewSyncNativeAssetAtaInstruction

func NewSyncNativeAssetAtaInstruction(
	Asset common.Address,
	WarpSolAccount common.Address,
	Mint common.Address,
	Administrator common.Address,
	Worker common.Address,
) *SyncNativeAssetAta

func NewSyncNativeAssetAtaInstructionBuilder

func NewSyncNativeAssetAtaInstructionBuilder() *SyncNativeAssetAta

func (SyncNativeAssetAta) Build

func (init SyncNativeAssetAta) Build() *Instruction

func (SyncNativeAssetAta) MarshalWithEncoder

func (init SyncNativeAssetAta) MarshalWithEncoder(encoder *encodbin.Encoder) (err error)

func (*SyncNativeAssetAta) SetAdministrator

func (init *SyncNativeAssetAta) SetAdministrator(val common.Address) *SyncNativeAssetAta

func (*SyncNativeAssetAta) SetAsset

func (init *SyncNativeAssetAta) SetAsset(val common.Address) *SyncNativeAssetAta

func (*SyncNativeAssetAta) SetMint

func (*SyncNativeAssetAta) SetWarpSolAccount

func (init *SyncNativeAssetAta) SetWarpSolAccount(val common.Address) *SyncNativeAssetAta

func (*SyncNativeAssetAta) SetWorker

func (init *SyncNativeAssetAta) SetWorker(val common.Address) *SyncNativeAssetAta

type TransferLamportsToAta

type TransferLamportsToAta struct {

	//资产账户
	Asset common.Address
	//Ata账户(强制owner是Asset)
	WarpSolAccount common.Address
	//Mint地址
	Mint common.Address
	//资产账户管理员地址
	Administrator common.Address
	//工作者
	Worker common.Address
	//转移数量
	Amount                 uint64
	AssociatedTokenProgram common.Address
	TokenProgram           common.Address
	SystemProgram          common.Address

	base.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

func NewTransferLamportsToAtaInstruction

func NewTransferLamportsToAtaInstruction(
	Asset common.Address,
	WarpSolAccount common.Address,
	Mint common.Address,
	Administrator common.Address,
	Worker common.Address,
	Amount uint64,
) *TransferLamportsToAta

func NewTransferLamportsToAtaInstructionBuilder

func NewTransferLamportsToAtaInstructionBuilder() *TransferLamportsToAta

func (TransferLamportsToAta) Build

func (init TransferLamportsToAta) Build() *Instruction

func (TransferLamportsToAta) MarshalWithEncoder

func (init TransferLamportsToAta) MarshalWithEncoder(encoder *encodbin.Encoder) (err error)

func (*TransferLamportsToAta) SetAdministrator

func (init *TransferLamportsToAta) SetAdministrator(val common.Address) *TransferLamportsToAta

func (*TransferLamportsToAta) SetAmount

func (init *TransferLamportsToAta) SetAmount(val uint64) *TransferLamportsToAta

func (*TransferLamportsToAta) SetAsset

func (*TransferLamportsToAta) SetMint

func (*TransferLamportsToAta) SetWarpSolAccount

func (init *TransferLamportsToAta) SetWarpSolAccount(val common.Address) *TransferLamportsToAta

func (*TransferLamportsToAta) SetWorker

Jump to

Keyboard shortcuts

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