dev

package
v0.0.0-...-2181388 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: AGPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Track          string         `json: "track"`
	Address        string         `json: "address"`
	Nonce          int            `json: "nonce"`
	DefaultVoucher string         `json: "defaultVoucher"`
	Balances       map[string]int `json: "balances"`
	Alias          string
	Txs            []string `json: "txs"`
}

func (*Account) ToRegistrationEvent

func (a *Account) ToRegistrationEvent() event.EventCustodialRegistration

type DevAccountService

type DevAccountService struct {
	// contains filtered or unexported fields
}

func (*DevAccountService) AddVoucher

func (das *DevAccountService) AddVoucher(ctx context.Context, symbol string) error

TODO: add persistence for vouchers TODO: set max balance for 0x00 address

func (*DevAccountService) CheckAliasAddress

func (das *DevAccountService) CheckAliasAddress(ctx context.Context, alias string) (*models.AliasAddress, error)

func (*DevAccountService) CheckBalance

func (das *DevAccountService) CheckBalance(ctx context.Context, publicKey string) (*models.BalanceResult, error)

func (*DevAccountService) CreateAccount

func (das *DevAccountService) CreateAccount(ctx context.Context) (*models.AccountResult, error)

func (*DevAccountService) FetchTransactions

func (das *DevAccountService) FetchTransactions(ctx context.Context, publicKey string) ([]dataserviceapi.Last10TxResponse, error)

func (*DevAccountService) FetchVouchers

func (das *DevAccountService) FetchVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error)

func (*DevAccountService) GetAliases

func (das *DevAccountService) GetAliases(ctx context.Context) map[string]string

func (*DevAccountService) RequestAlias

func (das *DevAccountService) RequestAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error)

func (*DevAccountService) TokenTransfer

func (das *DevAccountService) TokenTransfer(ctx context.Context, amount, from, to, tokenAddress string) (*models.TokenTransferResponse, error)

TODO: set default voucher on first received TODO: update balance

func (*DevAccountService) TrackAccountStatus

func (das *DevAccountService) TrackAccountStatus(ctx context.Context, publicKey string) (*models.TrackStatusResult, error)

func (*DevAccountService) VoucherData

func (das *DevAccountService) VoucherData(ctx context.Context, address string) (*models.VoucherDataResult, error)

func (*DevAccountService) WithAutoVoucher

func (das *DevAccountService) WithAutoVoucher(ctx context.Context, symbol string, value int) *DevAccountService

func (*DevAccountService) WithEmitter

func (das *DevAccountService) WithEmitter(fn event.EmitterFunc) *DevAccountService

func (*DevAccountService) WithPrefix

func (das *DevAccountService) WithPrefix(pfx []byte) *DevAccountService

type Tx

type Tx struct {
	Track   string    `json: "track"`
	Hsh     string    `json:"hash"`
	To      string    `json:"to"`
	From    string    `json: "from"`
	Voucher string    `json: "voucher"`
	Value   int       `json: "value"`
	When    time.Time `json: "when"`
}

func (*Tx) ToMintEvent

func (t *Tx) ToMintEvent() event.EventTokenMint

func (*Tx) ToTransferEvent

func (t *Tx) ToTransferEvent() event.EventTokenTransfer

type Voucher

type Voucher struct {
	Name      string `json: "name"`
	Address   string `json: "address"`
	Symbol    string `json: "symbol"`
	Decimals  int    `json: "decimals"`
	Sink      string `json: "sink"`
	Commodity string `json: "commodity"`
	Location  string `json: "location"`
}

Jump to

Keyboard shortcuts

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