cobo_custody

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyPair

func GenerateKeyPair() (string, string)

func Hash256

func Hash256(s string) string

func Hash256x2

func Hash256x2(s string) string

func SortParams

func SortParams(params map[string]string) string

Types

type ApiError

type ApiError struct {
	ErrorId      string
	ErrorCode    int
	ErrorMessage string
}

type ApiSigner

type ApiSigner interface {
	Sign(message string) string
	GetPublicKey() string
}

type Client

type Client struct {
	Signer ApiSigner
	Env    Env
	Debug  bool
}

func (Client) BatchNewDepositAddress

func (c Client) BatchNewDepositAddress(coin string, count int, nativeSegwit bool) (*simplejson.Json, *ApiError)

func (Client) BatchVerifyDepositAddress

func (c Client) BatchVerifyDepositAddress(coin string, addresses string) (*simplejson.Json, *ApiError)

func (Client) CheckLoopAddressDetails

func (c Client) CheckLoopAddressDetails(coin string, address string, memo string) (*simplejson.Json, *ApiError)

func (Client) GetAccountInfo

func (c Client) GetAccountInfo() (*simplejson.Json, *ApiError)

func (Client) GetAddressHistory

func (c Client) GetAddressHistory(coin string) (*simplejson.Json, *ApiError)

func (Client) GetAddressHistoryWithPage

func (c Client) GetAddressHistoryWithPage(params map[string]string) (*simplejson.Json, *ApiError)

@param coin string "ETH" @param page_index int start with 0 page @param page_length int page size <= 50 @param sort_flag int 0:DESCENDING 1:ASCENDING

func (Client) GetCoinInfo

func (c Client) GetCoinInfo(coin string, amount *big.Int) (*simplejson.Json, *ApiError)

func (Client) GetGasStationBalance added in v0.50.0

func (c Client) GetGasStationBalance() (*simplejson.Json, *ApiError)

func (Client) GetPendingTransaction

func (c Client) GetPendingTransaction(id string) (*simplejson.Json, *ApiError)

func (Client) GetPendingTransactions

func (c Client) GetPendingTransactions(params map[string]string) (*simplejson.Json, *ApiError)

func (Client) GetStakingHistory

func (c Client) GetStakingHistory() (*simplejson.Json, *ApiError)

func (Client) GetStakingProductDetails

func (c Client) GetStakingProductDetails(productId string, language string) (*simplejson.Json, *ApiError)

func (Client) GetStakingProductList

func (c Client) GetStakingProductList(coin string, language string) (*simplejson.Json, *ApiError)

func (Client) GetStakings

func (c Client) GetStakings(coin string, language string) (*simplejson.Json, *ApiError)

func (Client) GetSupportedCoins added in v0.47.0

func (c Client) GetSupportedCoins() (*simplejson.Json, *ApiError)

func (Client) GetTransactionDetails

func (c Client) GetTransactionDetails(txId string) (*simplejson.Json, *ApiError)

func (Client) GetTransactionHistory

func (c Client) GetTransactionHistory(params map[string]string) (*simplejson.Json, *ApiError)

func (Client) GetTransactionsById

func (c Client) GetTransactionsById(params map[string]string) (*simplejson.Json, *ApiError)

func (Client) GetTransactionsByRequestIds added in v0.47.0

func (c Client) GetTransactionsByRequestIds(requestIds string) (*simplejson.Json, *ApiError)

func (Client) GetTransactionsByTime

func (c Client) GetTransactionsByTime(params map[string]string) (*simplejson.Json, *ApiError)

func (Client) GetTransactionsByTimeEx added in v0.46.0

func (c Client) GetTransactionsByTimeEx(params map[string]string) (*simplejson.Json, *ApiError)

func (Client) GetTransactionsByTxid

func (c Client) GetTransactionsByTxid(txid string) (*simplejson.Json, *ApiError)

func (Client) GetUnstakings

func (c Client) GetUnstakings(coin string) (*simplejson.Json, *ApiError)

func (Client) NewDepositAddress

func (c Client) NewDepositAddress(coin string, nativeSegwit bool) (*simplejson.Json, *ApiError)

func (Client) QueryWithdrawInfo

func (c Client) QueryWithdrawInfo(requestId string) (*simplejson.Json, *ApiError)

func (Client) Request

func (c Client) Request(method string, path string, params map[string]string) (*simplejson.Json, *ApiError)

func (Client) Stake

func (c Client) Stake(productId string, amount *big.Int) (*simplejson.Json, *ApiError)

func (Client) Unstake

func (c Client) Unstake(productId string, amount *big.Int) (*simplejson.Json, *ApiError)

func (Client) VerifyDepositAddress

func (c Client) VerifyDepositAddress(coin string, address string) (*simplejson.Json, *ApiError)

func (Client) VerifyEcc

func (c Client) VerifyEcc(message string, signature string) bool

func (Client) VerifyLoopAddressList

func (c Client) VerifyLoopAddressList(coin string, addresses string) (*simplejson.Json, *ApiError)

func (Client) VerifyValidAddress

func (c Client) VerifyValidAddress(coin string, addresses string) (*simplejson.Json, *ApiError)

func (Client) Withdraw

func (c Client) Withdraw(coin string, requestId string, address string, amount *big.Int, options map[string]string) (*simplejson.Json, *ApiError)

type Config

type Config struct {
	CoboId      string
	TxId        string
	WithdrawId  string
	DeAddress   map[string]string
	DeAddresses map[string]string
	LpAddress   map[string]string
	LpAddresses map[string]string
	Withdraw    map[string]string
}

func DevConfig added in v0.45.0

func DevConfig() Config

func ProdConfig

func ProdConfig() Config

type Env

type Env struct {
	Host    string
	CoboPub string
}

func Dev added in v0.45.0

func Dev() Env

func Prod

func Prod() Env

type LocalSigner

type LocalSigner struct {
	PrivateKey string
}

func (LocalSigner) GetPublicKey

func (signer LocalSigner) GetPublicKey() string

func (LocalSigner) Sign

func (signer LocalSigner) Sign(message string) string

type MPCClient

type MPCClient struct {
	Signer ApiSigner
	Env    Env
	Debug  bool
}

func (MPCClient) CreateTransaction

func (c MPCClient) CreateTransaction(coin, requestId string, amount *big.Int, fromAddr, toAddr, toAddressDetails string,
	fee *big.Float, gasPrice *big.Int, gasLimit *big.Int, operation int, extraParameters string, maxFee *big.Int,
	maxPriorityFee *big.Int, feeAmount *big.Int, remark string, autoFuel int, memo string) (*simplejson.Json, *ApiError)

func (MPCClient) DropTransaction

func (c MPCClient) DropTransaction(coboId, requestId string, fee *big.Float, gasPrice *big.Int,
	gasLimit *big.Int, feeAmount *big.Int, autoFuel int, extraParameters string) (*simplejson.Json, *ApiError)

func (MPCClient) EstimateFee

func (c MPCClient) EstimateFee(coin string, amount *big.Int, address string, replace_cobo_id string, from_address string,
	to_address_details string, fee *big.Float, gasPrice *big.Int, gasLimit *big.Int, extra_parameters string) (*simplejson.Json, *ApiError)

func (MPCClient) GenerateAddressMemo added in v0.51.0

func (c MPCClient) GenerateAddressMemo(chainCode string, address string, count int) (*simplejson.Json, *ApiError)

func (MPCClient) GenerateAddresses

func (c MPCClient) GenerateAddresses(chainCode string, count int) (*simplejson.Json, *ApiError)

func (MPCClient) GetBalance

func (c MPCClient) GetBalance(address, chainCode, coin string) (*simplejson.Json, *ApiError)

func (MPCClient) GetCoinInfo added in v0.52.0

func (c MPCClient) GetCoinInfo(coin string) (*simplejson.Json, *ApiError)

func (MPCClient) GetMainAddress

func (c MPCClient) GetMainAddress(chainCode string) (*simplejson.Json, *ApiError)

func (MPCClient) GetMaxSendAmount added in v0.48.0

func (c MPCClient) GetMaxSendAmount(coin string, feeRate big.Float, toAddress string, fromAddress string) (*simplejson.Json, *ApiError)

func (MPCClient) GetOrdinalsInscription added in v0.55.0

func (c MPCClient) GetOrdinalsInscription(inscriptionId string) (*simplejson.Json, *ApiError)

func (MPCClient) GetRareSatoshis added in v0.51.0

func (c MPCClient) GetRareSatoshis(coin string, txHash string, voutN int) (*simplejson.Json, *ApiError)

func (MPCClient) GetSupportedChains

func (c MPCClient) GetSupportedChains() (*simplejson.Json, *ApiError)

func (MPCClient) GetSupportedCoins

func (c MPCClient) GetSupportedCoins(chainCode string) (*simplejson.Json, *ApiError)

func (MPCClient) GetSupportedNftCollections

func (c MPCClient) GetSupportedNftCollections(chainCode string) (*simplejson.Json, *ApiError)

func (MPCClient) GetUTXOAssets added in v0.55.0

func (c MPCClient) GetUTXOAssets(coin string, txHash string, voutN int) (*simplejson.Json, *ApiError)

func (MPCClient) GetWalletSupportedCoins

func (c MPCClient) GetWalletSupportedCoins() (*simplejson.Json, *ApiError)

func (MPCClient) IsValidAddress

func (c MPCClient) IsValidAddress(coin string, address string) (*simplejson.Json, *ApiError)

func (MPCClient) ListAddresses

func (c MPCClient) ListAddresses(chainCode, startId, endId string, limit, sortFlag int) (*simplejson.Json, *ApiError)

func (MPCClient) ListBalances

func (c MPCClient) ListBalances(pageIndex, pageLength int, coin string, chainCode string) (*simplejson.Json, *ApiError)

func (MPCClient) ListSpendable

func (c MPCClient) ListSpendable(address, coin string) (*simplejson.Json, *ApiError)

func (MPCClient) ListTransactions

func (c MPCClient) ListTransactions(startTime, endTime, status int, orderBy, order string, transactionType int,
	coins, fromAddress, toAddress string, limit int) (*simplejson.Json, *ApiError)

func (MPCClient) ListTssNode

func (c MPCClient) ListTssNode() (*simplejson.Json, *ApiError)

func (MPCClient) ListTssNodeRequests

func (c MPCClient) ListTssNodeRequests(requestType, status int) (*simplejson.Json, *ApiError)

func (MPCClient) LockSpendable added in v0.51.0

func (c MPCClient) LockSpendable(coin string, txHash string, voutN int) (*simplejson.Json, *ApiError)

func (MPCClient) Request

func (c MPCClient) Request(method string, path string, params map[string]string) (*simplejson.Json, *ApiError)

func (MPCClient) RetryDoubleCheck

func (c MPCClient) RetryDoubleCheck(requestId string) (*simplejson.Json, *ApiError)

func (MPCClient) SignMessage

func (c MPCClient) SignMessage(chainCode, requestId, fromAddr string, signVersion int, extraParameters string) (*simplejson.Json, *ApiError)

func (MPCClient) SignMessagesByCobotIds added in v0.44.0

func (c MPCClient) SignMessagesByCobotIds(CoboIds string) (*simplejson.Json, *ApiError)

func (MPCClient) SignMessagesByRequestIds added in v0.44.0

func (c MPCClient) SignMessagesByRequestIds(requestIds string) (*simplejson.Json, *ApiError)

func (MPCClient) SpeedupTransaction

func (c MPCClient) SpeedupTransaction(coboId, requestId string, fee *big.Float, gasPrice *big.Int,
	gasLimit *big.Int, feeAmount *big.Int, autoFuel int, extraParameters string) (*simplejson.Json, *ApiError)

func (MPCClient) TransactionsByCoboIds

func (c MPCClient) TransactionsByCoboIds(coboIds string, status int) (*simplejson.Json, *ApiError)

func (MPCClient) TransactionsByRequestIds

func (c MPCClient) TransactionsByRequestIds(requestIds string, status int) (*simplejson.Json, *ApiError)

func (MPCClient) TransactionsByTxHash

func (c MPCClient) TransactionsByTxHash(txHash string, transactionType int) (*simplejson.Json, *ApiError)

func (MPCClient) UnlockSpendable added in v0.51.0

func (c MPCClient) UnlockSpendable(coin string, txHash string, voutN int) (*simplejson.Json, *ApiError)

func (MPCClient) UpdateAddressDescription added in v0.45.0

func (c MPCClient) UpdateAddressDescription(coin string, address string, description string) (*simplejson.Json, *ApiError)

func (MPCClient) VerifyEcc

func (c MPCClient) VerifyEcc(message string, signature string) bool

type MPCPrimeBrokerClient added in v0.47.0

type MPCPrimeBrokerClient struct {
	Signer ApiSigner
	Env    Env
	Debug  bool
}

func (MPCPrimeBrokerClient) BindAddresses added in v0.47.0

func (c MPCPrimeBrokerClient) BindAddresses(userId string, addresses string) (*simplejson.Json, *ApiError)

func (MPCPrimeBrokerClient) ChangeBinding added in v0.47.0

func (c MPCPrimeBrokerClient) ChangeBinding(userId string) (*simplejson.Json, *ApiError)

func (MPCPrimeBrokerClient) CreateBinding added in v0.47.0

func (c MPCPrimeBrokerClient) CreateBinding(userId string) (*simplejson.Json, *ApiError)

func (MPCPrimeBrokerClient) QueryBinding added in v0.47.0

func (c MPCPrimeBrokerClient) QueryBinding(binderId string) (*simplejson.Json, *ApiError)

func (MPCPrimeBrokerClient) QueryStatement added in v0.47.0

func (c MPCPrimeBrokerClient) QueryStatement(statementId string) (*simplejson.Json, *ApiError)

func (MPCPrimeBrokerClient) QueryUserAuth added in v0.47.0

func (c MPCPrimeBrokerClient) QueryUserAuth(userId string) (*simplejson.Json, *ApiError)

func (MPCPrimeBrokerClient) Request added in v0.47.0

func (c MPCPrimeBrokerClient) Request(method string, path string, params map[string]string) (*simplejson.Json, *ApiError)

func (MPCPrimeBrokerClient) UnbindBinding added in v0.47.0

func (c MPCPrimeBrokerClient) UnbindBinding(userId string) (*simplejson.Json, *ApiError)

func (MPCPrimeBrokerClient) VerifyEcc added in v0.47.0

func (c MPCPrimeBrokerClient) VerifyEcc(message string, signature string) bool

type Web3Client

type Web3Client struct {
	Signer ApiSigner
	Env    Env
	Debug  bool
}

func (Web3Client) BatchWeb3NewAddress

func (c Web3Client) BatchWeb3NewAddress(chainCode string, count int) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3AddressList

func (c Web3Client) GetWeb3AddressList(chainCode string, pageIndex int, pageLength int, sortFlag int) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3ContractTransaction

func (c Web3Client) GetWeb3ContractTransaction(requestId string) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3SupportedChains

func (c Web3Client) GetWeb3SupportedChains() (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3SupportedCoins

func (c Web3Client) GetWeb3SupportedCoins(chainCode string) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3SupportedContractMethods

func (c Web3Client) GetWeb3SupportedContractMethods(chainCode string, contractAddress string) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3SupportedContracts

func (c Web3Client) GetWeb3SupportedContracts(chainCode string) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3SupportedNftCollections

func (c Web3Client) GetWeb3SupportedNftCollections() (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3WalletAssetList

func (c Web3Client) GetWeb3WalletAssetList(address string, chainCode string) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3WalletNftDetail

func (c Web3Client) GetWeb3WalletNftDetail(nftCode string, tokenId string) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3WalletNftList

func (c Web3Client) GetWeb3WalletNftList(nftCode string, address string) (*simplejson.Json, *ApiError)

func (Web3Client) GetWeb3WithdrawTransaction

func (c Web3Client) GetWeb3WithdrawTransaction(requestId string) (*simplejson.Json, *ApiError)

func (Web3Client) ListWeb3WalletTransactions

func (c Web3Client) ListWeb3WalletTransactions(address string, chainCode string, maxId string, minId string, limit int) (*simplejson.Json, *ApiError)

func (Web3Client) Request

func (c Web3Client) Request(method string, path string, params map[string]string) (*simplejson.Json, *ApiError)

func (Web3Client) VerifyEcc

func (c Web3Client) VerifyEcc(message string, signature string) bool

func (Web3Client) Web3Contract

func (c Web3Client) Web3Contract(chainCode string, requestId string, walletAddr string, contractAddr string, methodId string,
	methodName string, args string, amount *big.Int, gasLimit *big.Int) (*simplejson.Json, *ApiError)

func (Web3Client) Web3Withdraw

func (c Web3Client) Web3Withdraw(coin string, requestId string, fromAddr string, toAddr string, amount *big.Int) (*simplejson.Json, *ApiError)

Jump to

Keyboard shortcuts

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