client_2finance

package
v0.0.0-...-ce4d80e Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client2FinanceNetwork

type Client2FinanceNetwork interface {
	// Client
	SetPrivateKey(privateKey string)
	GenerateKeyEd25519() (string, string, error)
	HandlerRequest(method string, tx interface{}, replyTo string) (outputBytes []byte, err error)

	// CHAIN
	GetNonce(publicKey string) (uint64, error)
	ListTransactions(from, to, hash string, dataFilter map[string]interface{}, nonce uint64,
		page, limit int,
		ascending bool) ([]transaction.Transaction, error)
	ListLogs(logType string, logIndex uint, transactionHash string, event map[string]interface{}, contractAddress string,
		page, limit int,
		ascending bool) ([]blockchainLog.Log, error)
	SendTransaction(
		from string,
		to string,
		contractVersion string,
		method string,
		data map[string]interface{}) (types.ContractOutput, error)
	GetState(
		contractVersion string,
		method string,
		data map[string]interface{}) (types.ContractOutput, error)
	ListBlocks(blockNumber uint64, blockTimestamp time.Time, hash string, previousHash string,
		merkleRoot string,
		page, limit int,
		ascending bool) ([]block.Block, error)

	// WALLET
	AddWallet(pubKey string) (types.ContractOutput, error)
	GetWallet(pubKey string) (types.ContractOutput, error)
	TransferWallet(to, amount string, decimals int) (types.ContractOutput, error)

	// TOKEN
	AddToken(symbol string,
		name string,
		decimals int,
		totalSupply string,
		description string,
		owner string,
		image string,
		website string,
		tagsSocialMedia map[string]string,
		tagsCategory map[string]string,
		tags map[string]string,
		creator string,
		creatorWebsite string,
		allowUsers map[string]bool,
		blockUsers map[string]bool,
		feeTiersList []map[string]interface{},
		feeAddress string,
		freezeAuthorityRevoked bool,
		mintAuthorityRevoked bool,
		updateAuthorityRevoked bool,
		paused bool,
		expired_at time.Time) (types.ContractOutput, error)
	MintToken(to, mintTo, amount string, decimals int) (types.ContractOutput, error)
	BurnToken(to, amount string, decimals int) (types.ContractOutput, error)
	TransferToken(to, transferTo, amount string, decimals int) (types.ContractOutput, error)
	AllowUsers(tokenAddress string, users map[string]bool) (types.ContractOutput, error)
	DisallowUsers(tokenAddress string, users map[string]bool) (types.ContractOutput, error)
	BlockUsers(tokenAddress string, users map[string]bool) (types.ContractOutput, error)
	UnblockUsers(tokenAddress string, users map[string]bool) (types.ContractOutput, error)
	RevokeFreezeAuthority(tokenAddress string, revoke bool) (types.ContractOutput, error)
	RevokeMintAuthority(tokenAddress string, revoke bool) (types.ContractOutput, error)
	RevokeUpdateAuthority(tokenAddress string, revoke bool) (types.ContractOutput, error)
	UpdateMetadata(tokenAddress, symbol, name string, decimals int, description, image, website string,
		tagsSocialMedia, tagsCategory, tags map[string]string,
		creator, creatorWebsite string, expired_at time.Time) (types.ContractOutput, error)
	PauseToken(tokenAddress string, pause bool) (types.ContractOutput, error)
	UnpauseToken(tokenAddress string, unpause bool) (types.ContractOutput, error)
	UpdateFeeTiers(tokenAddress string, feeTierList []map[string]interface{}) (types.ContractOutput, error)
	UpdateFeeAddress(tokenAddress, feeAddress string) (types.ContractOutput, error)
	GetToken(tokenAddress string, symbol string, name string) (types.ContractOutput, error)
	ListTokens(ownerAddress, symbol, name string, page, limit int, ascending bool) (types.ContractOutput, error)

	GetTokenBalance(tokenAddress, ownerAddress string) (types.ContractOutput, error)
	ListTokenBalances(tokenAddress, ownerAddress string, page, limit int, ascending bool) (types.ContractOutput, error)

	// FAUCET
	AddFaucet(
		owner string,
		tokenAddress string,
		startTime time.Time,
		expireTime time.Time,
		paused bool,
		requestLimit int,
	) (types.ContractOutput, error)
	UpdateFaucet(
		address string,
		startTime time.Time,
		expireTime time.Time,
		requestLimit int,
		requestsByUser map[string]int,
	) (types.ContractOutput, error)
	DepositFunds(address, tokenAddress, amount string) (types.ContractOutput, error)
	WithdrawFunds(address, tokenAddress, amount string) (types.ContractOutput, error)
	PauseFaucet(address string, pause bool) (types.ContractOutput, error)
	UnpauseFaucet(address string, pause bool) (types.ContractOutput, error)

	GetFaucet(faucetAddress string) (types.ContractOutput, error)
	ListFaucets(
		address, ownerAddress, tokenAddress string,
		requestLimit int,
		requestsByUser map[string]int,
		page, limit int,
		ascending bool,
	) (types.ContractOutput, error)
}

Interface exposes the client behavior

func New

func New(broker, clientID string, debug bool) Client2FinanceNetwork

New creates a new client

Jump to

Keyboard shortcuts

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