deposit

package
v1.12.4-0...-e320c17 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const PanicIsLogicalError = false
View Source
const (
	PublicAllocation2DepositName = "genesis_deposit2"
)

Variables

This section is empty.

Functions

func INSCONSTRUCTOR_New

func INSCONSTRUCTOR_New(ref insolar.Reference, data []byte) (state []byte, result []byte, err error)

func INSCONSTRUCTOR_NewFund

func INSCONSTRUCTOR_NewFund(ref insolar.Reference, data []byte) (state []byte, result []byte, err error)

func INSMETHOD_Accept

func INSMETHOD_Accept(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_Confirm

func INSMETHOD_Confirm(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_GetAmount

func INSMETHOD_GetAmount(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_GetBalance

func INSMETHOD_GetBalance(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_GetCode

func INSMETHOD_GetCode(object []byte, data []byte) ([]byte, []byte, error)

func INSMETHOD_GetPrototype

func INSMETHOD_GetPrototype(object []byte, data []byte) ([]byte, []byte, error)

func INSMETHOD_GetPulseUnHold

func INSMETHOD_GetPulseUnHold(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_GetTxHash

func INSMETHOD_GetTxHash(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_Itself

func INSMETHOD_Itself(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_Transfer

func INSMETHOD_Transfer(object []byte, data []byte) (newState []byte, result []byte, err error)

func INSMETHOD_TransferToDeposit

func INSMETHOD_TransferToDeposit(object []byte, data []byte) (newState []byte, result []byte, err error)

func INS_META_INFO

func INS_META_INFO() []map[string]string

func Initialize

func Initialize() insolar.ContractWrapper

Types

type DaemonConfirm

type DaemonConfirm struct {
	Reference string `json:"reference"`
	Amount    string `json:"amount"`
}

type Deposit

type Deposit struct {
	foundation.BaseContract
	Balance                 string                    `json:"balance"`
	PulseDepositUnHold      insolar.PulseNumber       `json:"holdReleaseDate"`
	MigrationDaemonConfirms foundation.StableMap      `json:"confirmerReferences"`
	Amount                  string                    `json:"amount"`
	TxHash                  string                    `json:"ethTxHash"`
	VestingType             appfoundation.VestingType `json:"vestingType"`
	Lockup                  int64                     `json:"lockupInPulses"`
	Vesting                 int64                     `json:"vestingInPulses"`
	VestingStep             int64                     `json:"vestingStepInPulses"`
	IsConfirmed             bool                      `json:"isConfirmed"`
}

Deposit is like an account. But it holds migrated money.

func New

func New(txHash string, lockup int64, vesting int64, vestingStep int64) (*Deposit, error)

New creates new deposit.

func NewFund

func NewFund(lockupEndDate int64) (*Deposit, error)

NewFund creates new public allocation 2 deposit

func (*Deposit) Accept

func (d *Deposit) Accept(arg appfoundation.SagaAcceptInfo) error

Accept accepts transfer to balance. ins:saga(INS_FLAG_NO_ROLLBACK_METHOD)

func (*Deposit) Confirm

func (d *Deposit) Confirm(
	txHash string, amountStr string, fromMember insolar.Reference, request insolar.Reference, toMember insolar.Reference,
) error

Confirm adds confirm for deposit by migration daemon.

func (*Deposit) GetAmount

func (d *Deposit) GetAmount() (string, error)

GetAmount gets amount. ins:immutable

func (*Deposit) GetBalance

func (d *Deposit) GetBalance() (string, error)

GetBalance gets balance. ins:immutable

func (*Deposit) GetPulseUnHold

func (d *Deposit) GetPulseUnHold() (insolar.PulseNumber, error)

Return pulse of unhold deposit. ins:immutable

func (*Deposit) GetTxHash

func (d *Deposit) GetTxHash() (string, error)

GetTxHash gets transaction hash. ins:immutable

func (*Deposit) Itself

func (d *Deposit) Itself() (interface{}, error)

Itself gets deposit information. ins:immutable

func (*Deposit) Transfer

func (d *Deposit) Transfer(
	amountStr string, memberRef insolar.Reference, request insolar.Reference,
) (interface{}, error)

Transfer transfers money from deposit to wallet. It can be called only after deposit hold period.

func (*Deposit) TransferToDeposit

func (d *Deposit) TransferToDeposit(
	amountStr string,
	toDeposit insolar.Reference,
	fromMember insolar.Reference,
	request insolar.Reference,
	toMember insolar.Reference,
	txType string,
) error

TransferToDeposit transfers funds to deposit.

type DepositOut

type DepositOut struct {
	Balance                 string                    `json:"balance"`
	HoldStartDate           int64                     `json:"holdStartDate"`
	PulseDepositUnHold      int64                     `json:"holdReleaseDate"`
	MigrationDaemonConfirms []DaemonConfirm           `json:"confirmerReferences"`
	Amount                  string                    `json:"amount"`
	TxHash                  string                    `json:"ethTxHash"`
	VestingType             appfoundation.VestingType `json:"vestingType"`
	Lockup                  int64                     `json:"lockup"`
	Vesting                 int64                     `json:"vesting"`
	VestingStep             int64                     `json:"vestingStep"`
}

Form of Deposit that is applied in API

Jump to

Keyboard shortcuts

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