sdk

package
v0.0.0-...-cd62ce9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT, GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSASignerType = "RSASigner"
	EccSignerType = "EccSigner"
)

Variables

View Source
var (
	ErrTokenNotExist   = errors.New("err_not_exist_token")
	ErrBurnFeeNotExist = errors.New("err_not_exist_burn_fee")
	ErrNotBundleTx     = errors.New("err_not_bundle_tx")

	ErrNotJsonData = errors.New("err_not_json_data")
)

Functions

func GenBundle

func GenBundle(items []paySchema.BundleItem,
	expiration int64) paySchema.Bundle

GenBundle expiration: bundle tx expiration time(s)

Types

type Client

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

func NewClient

func NewClient(payURL string) *Client

func (*Client) AccInfo

func (c *Client) AccInfo(accid string) (resp schema.RespAcc, err error)

func (*Client) AddBlackListWithoutSig

func (c *Client) AddBlackListWithoutSig(tokenTag, from string,
	blackList []string) (everTx paySchema.Transaction, err error)

func (*Client) AddWhiteListWithoutSig

func (c *Client) AddWhiteListWithoutSig(tokenTag, from string,
	whiteList []string) (everTx paySchema.Transaction, err error)

func (*Client) AssembleTxWithoutSig

func (c *Client) AssembleTxWithoutSig(tokenTag, from, to, amount, fee, action, data string) (everTx paySchema.Transaction,
	err error)

func (*Client) Balance

func (c *Client) Balance(tokenTag, accid string) (balance schema.AccBalance,
	err error)

func (*Client) Balances

func (c *Client) Balances(accid string) (balances schema.AccBalances,
	err error)

func (*Client) BlackList

func (c *Client) BlackList(tokenTag string) ([]string, error)

func (*Client) BundleByHash

func (c *Client) BundleByHash(everHash string) (
	tx cacheSchema.TxResponse,
	bundle paySchema.BundleWithSigs,
	internalStatus cacheSchema.InternalStatus,
	err error)

func (*Client) Burn102WithoutSig

func (c *Client) Burn102WithoutSig(tokenTag, from, amount string) (everTx paySchema.Transaction,
	err error)

func (*Client) Fee

func (c *Client) Fee(tokenTag string) (fee schema.Fee, err error)

func (*Client) Fees

func (c *Client) Fees() (fees schema.Fees, err error)

func (*Client) GetInfo

func (c *Client) GetInfo() (info schema.Info, err error)

func (*Client) GetTokens

func (c *Client) GetTokens() (tokens map[string]*token.Token, err error)

func (*Client) LimitIp

func (c *Client) LimitIp() (isLimit bool, err error)

func (*Client) Mint102WithoutSig

func (c *Client) Mint102WithoutSig(tokenTag, from, to, amount string) (everTx paySchema.Transaction,
	err error)

func (*Client) MintTx

func (c *Client) MintTx(chainHash string) (tx schema.Tx, err error)

MintTx get minted everTx by onChain mint txHash

func (*Client) PendingTxs

func (c *Client) PendingTxs(everHash string) (txs schema.PendingTxs,
	err error)

PendingTxs get pending Txs everHash: means get from the everTx

func (*Client) SetHeader

func (c *Client) SetHeader(key, val string)

func (*Client) SubmitTx

func (c *Client) SubmitTx(tx paySchema.Transaction) (err error)

func (*Client) SubscribeTxs

func (c *Client) SubscribeTxs(fq schema.FilterQuery) *SubscribeTx

SubscribeTxs fq.StartCursor: option fq.Address: option fq.TokenSymbol: option fq.Action: option fq.WithoutAction: option

func (*Client) TransferWithoutSig

func (c *Client) TransferWithoutSig(tokenTag, from, to, amount string) (everTx paySchema.Transaction,
	err error)

func (*Client) TxByHash

func (c *Client) TxByHash(everHash string) (tx schema.Tx, err error)

func (*Client) Txs

func (c *Client) Txs(startCursor int64, orderBy string, limit int,
	opts schema.TxOpts) (txs schema.Txs, err error)

func (*Client) WhiteList

func (c *Client) WhiteList(tokenTag string) ([]string, error)

type SDK

type SDK struct {
	AccId string
	Cli   *Client
	// contains filtered or unexported fields
}

func New

func New(signer interface{}, payUrl string) (*SDK, error)

func (*SDK) AddBlackListTx

func (s *SDK) AddBlackListTx(tokenTag string,
	blackList []string) (*paySchema.Transaction, error)

func (*SDK) AddWhiteListTx

func (s *SDK) AddWhiteListTx(tokenTag string,
	whiteList []string) (*paySchema.Transaction, error)

func (*SDK) Bundle

func (s *SDK) Bundle(tokenTag string, to string, amount *big.Int,
	bundleWithSigs paySchema.BundleWithSigs) (*paySchema.Transaction, error)

func (*SDK) Burn

func (s *SDK) Burn(tokenTag string, amount *big.Int,
	chainType, to string) (*paySchema.Transaction, error)

func (*SDK) BurnToEverpay

func (s *SDK) BurnToEverpay(tokenTag string,
	amount *big.Int) (*paySchema.Transaction, error)

func (*SDK) Deposit

func (s *SDK) Deposit(tokenTag string, amount *big.Int,
	chainType, to, txData string) (*paySchema.Transaction, error)

func (*SDK) GetTokens

func (s *SDK) GetTokens() map[string]serverSchema.TokenInfo

func (*SDK) Mint

func (s *SDK) Mint(tokenTag string, amount *big.Int,
	chainType, to, txData string) (*paySchema.Transaction, error)

func (*SDK) PauseBlackListTx

func (s *SDK) PauseBlackListTx(tokenTag string,
	pause bool) (*paySchema.Transaction, error)

func (*SDK) PauseTokenTx

func (s *SDK) PauseTokenTx(tokenTag string, pause bool) (*paySchema.Transaction,
	error)

func (*SDK) PauseWhiteListTx

func (s *SDK) PauseWhiteListTx(tokenTag string,
	pause bool) (*paySchema.Transaction, error)

func (*SDK) RemoveBlackListTx

func (s *SDK) RemoveBlackListTx(tokenTag string,
	blackList []string) (*paySchema.Transaction, error)

func (*SDK) RemoveWhiteListTx

func (s *SDK) RemoveWhiteListTx(tokenTag string,
	whiteList []string) (*paySchema.Transaction, error)

func (*SDK) Sign

func (s *SDK) Sign(msg string) (string, error)

func (*SDK) SignBundleData

func (s *SDK) SignBundleData(bundleTx paySchema.Bundle) (paySchema.BundleWithSigs,
	error)

func (*SDK) SymbolToTagArr

func (s *SDK) SymbolToTagArr(symbol string) []string

func (*SDK) Transfer

func (s *SDK) Transfer(tokenTag string, amount *big.Int,
	to, data string) (*paySchema.Transaction, error)

func (*SDK) TransferTokenOwnerTx

func (s *SDK) TransferTokenOwnerTx(tokenTag string,
	newOwner string) (*paySchema.Transaction, error)

func (*SDK) Withdraw

func (s *SDK) Withdraw(tokenTag string, amount *big.Int,
	chainType, to string) (*paySchema.Transaction, error)

type SubscribeTx

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

func (*SubscribeTx) Subscribe

func (s *SubscribeTx) Subscribe() <-chan cacheSchema.TxResponse

func (*SubscribeTx) Unsubscribe

func (s *SubscribeTx) Unsubscribe()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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