Versions in this module Expand all Collapse all v1 v1.5.0 Jan 11, 2021 Changes in this version + const BttWallet + const InAppWallet + const StatusFailed + const StatusPending + const StatusSuccess + var DepositMaxAmount int64 = 1000000000000 + var DepositMinAmount int64 = 1 + var ErrChannelCommitParam = errors.New("channelCommit is nil") + var ErrChannelStateParam = errors.New("channelState is nil") + var ErrInsufficientExchangeBalanceOnLedger = errors.New("exchange balance on Private Ledger is not sufficient") + var ErrInsufficientExchangeBalanceOnTron = errors.New("exchange balance on Tron network is not sufficient") + var ErrInsufficientUserBalanceOnLedger = errors.New("rpc error: code = ResourceExhausted desc = NSF") + var ErrInsufficientUserBalanceOnTron = errors.New(fmt.Sprint("User balance on tron network is not sufficient.")) + var ErrTransactionParam = errors.New("transaction is nil") + var ErrTypeParam = errors.New("wrong type") + var TokenId = "1002000" + var TokenIdDev = "1000252" + var WithdrawMaxAmount int64 = 1000000000000 + var WithdrawMinAmount int64 = 1 + func Balance(ctx context.Context, configuration *config.Config) (int64, error) + func BalanceHelper(ctx context.Context, configuration *config.Config, offsign bool, ...) (int64, error) + func ConfirmDeposit(ctx context.Context, logId int64) (*exPb.ConfirmDepositResponse, error) + func ConfirmDepositProcess(ctx context.Context, n *core.IpfsNode, ...) error + func DecryptWithAES(key, message string) (string, error) + func Deposit(ctx context.Context, n *core.IpfsNode, ledgerAddr []byte, amount int64, ...) (*exPb.PrepareDepositResponse, error) + func DepositRequest(ctx context.Context, prepareResponse *exPb.PrepareDepositResponse, ...) (*exPb.DepositResponse, error) + func DiscoverySpeedKey(password string) (string, error) + func EncryptWithAES(key, message string) (string, error) + func GetBalance(ctx context.Context, configuration *config.Config) (int64, int64, error) + func GetBalanceByWalletAddress(ctx context.Context, solidityUrl string, walletAddress string) (tokenMap map[string]int64, err error) + func GetStatus(ctx context.Context, url string, txId string) (string, error) + func GetTokenBalance(ctx context.Context, addr []byte, tokenId string) (int64, error) + func GetTransactions(d ds.Datastore, peerId string) ([]*walletpb.TransactionV1, error) + func Init(ctx context.Context, configuration *config.Config) error + func PKCS5Padding(ciphertext []byte, blockSize int) ([]byte, error) + func PKCS5Unpadding(encrypt []byte) ([]byte, error) + func PersistTx(d ds.Datastore, peerId string, txId string, amount int64, from string, ...) error + func PersistTxWithTime(d ds.Datastore, peerId string, txId string, amount int64, from string, ...) error + func PrepareDeposit(ctx context.Context, ledgerAddr []byte, amount int64) (*exPb.PrepareDepositResponse, error) + func PrepareTx(ctx context.Context, cfg *config.Config, from string, to string, amount int64, ...) (*tronPb.TransactionExtention, error) + func PrepareWithdraw(ctx context.Context, ledgerAddr, externalAddr []byte, amount, outTxId int64) (*exPb.PrepareWithdrawResponse, error) + func SendRawTransaction(ctx context.Context, url string, raw []byte, sig []byte) error + func SetKeys(n *core.IpfsNode, privKey string, mnemonic string) (err error) + func Sign(in interface{}, key *ecdsa.PrivateKey) ([]byte, error) + func SignChannel(raw []byte, key *ecdsa.PrivateKey) ([]byte, error) + func SignTron(rawData []byte, key *ecdsa.PrivateKey) ([]byte, error) + func UpdatePendingTransactions(ctx context.Context, d ds.Datastore, cfg *config.Config, peerId string) (int, int, error) + func UpdateStatus(d ds.Datastore, peerId string, txId string, status string) error + func WalletDeposit(ctx context.Context, configuration *config.Config, n *core.IpfsNode, ...) error + func WalletWithdraw(ctx context.Context, configuration *config.Config, n *core.IpfsNode, ...) error + func Withdraw(ctx context.Context, n *core.IpfsNode, ledgerAddr, externalAddr []byte, ...) (int64, int64, error) + func WithdrawRequest(ctx context.Context, channelId *ledgerPb.ChannelID, ledgerAddr []byte, ...) (*exPb.WithdrawResponse, error) + type EcdsaSignature struct + R *big.Int + S *big.Int + type TronRet struct + Code string + Message string + Result bool + TxId string + func TransferBTT(ctx context.Context, n *core.IpfsNode, cfg *config.Config, privKey ic.PrivKey, ...) (*TronRet, error) + func TransferBTTWithMemo(ctx context.Context, n *core.IpfsNode, cfg *config.Config, privKey ic.PrivKey, ...) (*TronRet, error) + type TxData struct + func SyncTxFromTronGrid(ctx context.Context, cfg *config.Config, ds datastore.Datastore) ([]*TxData, error) + type TxSlice []*walletpb.TransactionV1 + func (p TxSlice) Len() int + func (p TxSlice) Less(i, j int) bool + func (p TxSlice) Swap(i, j int) + type Wallet struct