sdk

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: GPL-3.0 Imports: 23 Imported by: 1

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 added in v0.1.1

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

func (*Client) AddBlackListWithoutSig added in v0.0.9

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

func (*Client) AddWhiteListWithoutSig added in v0.0.6

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

func (*Client) AssembleTxWithoutSig added in v0.0.6

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 added in v0.1.0

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 added in v0.0.6

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 added in v0.0.3

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 added in v0.0.6

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 added in v0.0.6

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 added in v0.1.0

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 added in v0.0.4

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

func (*SDK) AddWhiteListTx added in v0.0.4

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 added in v0.0.4

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

func (*SDK) BurnToEverpay added in v0.0.5

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

func (*SDK) Deposit added in v0.0.4

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 added in v0.0.4

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

func (*SDK) PauseBlackListTx added in v0.0.4

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

func (*SDK) PauseTokenTx added in v0.0.4

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

func (*SDK) PauseWhiteListTx added in v0.0.4

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

func (*SDK) RemoveBlackListTx added in v0.0.4

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

func (*SDK) RemoveWhiteListTx added in v0.0.4

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 added in v0.0.7

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 added in v0.0.4

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