wallets

package
v0.0.0-...-9e4017b Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWalletRepo

func NewWalletRepo(client *mongo.Client) *repo

Types

type BalanceRequest

type BalanceRequest struct {
	WalletAddress string `json:"walletAddress"`
	Token         string `json:"token"`
}

type BalanceResponse

type BalanceResponse struct {
	WalletAddress string       `json:"walletAddress"`
	TokenBalance  TokenBalance `json:"tokenBalance"`
}

func GetERC20Balance

func GetERC20Balance(ctx context.Context, client *w3.Client, req BalanceRequest) (BalanceResponse, error)

type TokenBalance

type TokenBalance struct {
	Token    string  `json:"token"`
	Symbol   string  `json:"symbol"`
	Decimals uint8   `json:"decimals"`
	Balance  big.Int `json:"balance"`
}

type WalletKey

type WalletKey struct {
	ID               primitive.ObjectID `bson:"_id"`
	PublicKeyECB     string             `bson:"publicKeyECB"`
	PrivateKeyECB    string             `bson:"privateKeyECB"`
	IsEnabled        bool               `bson:"isEnabled"`
	ChainID          float64            `bson:"chainId"`
	CanDoWithdrawals bool               `bson:"canDoWithdrawals"`
	CanTakeDeposits  bool               `bson:"canTakeDeposits"`
	V                float64            `bson:"__v"`
	CreatedAt        time.Time          `bson:"created_at"`
	UpdatedAt        time.Time          `bson:"updated_at"`
}

Jump to

Keyboard shortcuts

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