Documentation ¶
Index ¶
- type UserPayment
- type Wallet
- func (w *Wallet) AddMultisigAddressByAuthorization(accountType enum.AccountType, addressType enum.AddressType) error
- func (w *Wallet) CreateUnsignedTransactionForPayment(adjustmentFee float64) (string, string, error)
- func (w *Wallet) DetectReceivedCoin(adjustmentFee float64) (string, string, error)
- func (w *Wallet) Done()
- func (w *Wallet) ExportAccountKey(accountType enum.AccountType, keyStatus enum.KeyStatus) (string, error)
- func (w *Wallet) ExportAddedPubkeyHistory(accountType enum.AccountType) (string, error)
- func (w *Wallet) GenerateAccountKey(accountType enum.AccountType, coinType enum.CoinType, seed []byte, ...) ([]key.WalletKey, error)
- func (w *Wallet) GenerateSeed() ([]byte, error)
- func (w *Wallet) ImportMultisigAddrForColdWallet1(fileName string, accountType enum.AccountType) error
- func (w *Wallet) ImportPrivateKey(accountType enum.AccountType) error
- func (w *Wallet) ImportPublicKeyForColdWallet2(fileName string, accountType enum.AccountType) error
- func (w *Wallet) ImportPublicKeyForWatchWallet(fileName string, accountType enum.AccountType, isRescan bool) error
- func (w *Wallet) SendFromFile(filePath string) (string, error)
- func (w *Wallet) SendToAccount(from, to enum.AccountType, amount btcutil.Amount) (string, string, error)
- func (w *Wallet) SignatureFromFile(filePath string) (string, bool, string, error)
- func (w *Wallet) UpdateStatus() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserPayment ¶
type UserPayment struct {
// contains filtered or unexported fields
}
UserPayment ユーザーの支払先アドレスと金額
type Wallet ¶
type Wallet struct { //BTC *btc.Bitcoin BTC api.Bitcoiner DB *model.DB GCS map[enum.ActionType]*gcp.Storage Env enum.EnvironmentType Type enum.WalletType Seed string }
Wallet 基底オブジェクト
func InitialSettings ¶
InitialSettings 実行前に必要なすべての設定をこちらで行う TODO:hotwalletとColdwalletで設定が異なるので要調整
func (*Wallet) AddMultisigAddressByAuthorization ¶
func (w *Wallet) AddMultisigAddressByAuthorization(accountType enum.AccountType, addressType enum.AddressType) error
AddMultisigAddressByAuthorization account_key_authorizationテーブルのwallet_addressを認証者として、 added_pubkey_history_paymentテーブル内のwalletアドレスのmultisigアドレスを生成する TODO:第4パラメータに、address_typeを追加する。Bitcoinの場合は、p2sh-segwit とする
func (*Wallet) CreateUnsignedTransactionForPayment ¶
CreateUnsignedTransactionForPayment 支払いのための未署名トランザクションを作成する
func (*Wallet) DetectReceivedCoin ¶
DetectReceivedCoin Wallet内アカウントに入金があれば、そこから、未署名のトランザクションを返す
func (*Wallet) ExportAccountKey ¶
func (w *Wallet) ExportAccountKey(accountType enum.AccountType, keyStatus enum.KeyStatus) (string, error)
ExportAccountKey AccountKeyテーブルをcsvとして出力する TODO:watch only walletにセットするアドレスは、clientの場合は、wallet_address, receipt/paymentの場合、`wallet_multisig_address`
func (*Wallet) ExportAddedPubkeyHistory ¶
func (w *Wallet) ExportAddedPubkeyHistory(accountType enum.AccountType) (string, error)
ExportAddedPubkeyHistory AddedPubkeyHistoryテーブルをcsvとして出力する coldwallet2から使用
func (*Wallet) GenerateAccountKey ¶
func (w *Wallet) GenerateAccountKey(accountType enum.AccountType, coinType enum.CoinType, seed []byte, count uint32) ([]key.WalletKey, error)
GenerateAccountKey AccountType属性のアカウントKeyを生成する TODO:AccountTypeAuthorizationのときは、レコードがある場合は追加できないようにしたほうがいい??
func (*Wallet) GenerateSeed ¶
GenerateSeed seedを生成する
func (*Wallet) ImportMultisigAddrForColdWallet1 ¶
func (w *Wallet) ImportMultisigAddrForColdWallet1(fileName string, accountType enum.AccountType) error
ImportMultisigAddrForColdWallet1 coldwallet2でexportされたmultisigアドレス情報をimportする for Cold Wallet1
func (*Wallet) ImportPrivateKey ¶
func (w *Wallet) ImportPrivateKey(accountType enum.AccountType) error
ImportPrivateKey 指定したAccountTypeに属するテーブルのis_imported_priv_keyがfalseのWIFをImportPrivKeyRescanする https://en.bitcoin.it/wiki/How_to_import_private_keys getaddressesbyaccount "" で内容を確認可能??
func (*Wallet) ImportPublicKeyForColdWallet2 ¶
func (w *Wallet) ImportPublicKeyForColdWallet2(fileName string, accountType enum.AccountType) error
ImportPublicKeyForColdWallet2 csvファイルからpublicアドレスをimportする for Cold Wallet2
func (*Wallet) ImportPublicKeyForWatchWallet ¶
func (w *Wallet) ImportPublicKeyForWatchWallet(fileName string, accountType enum.AccountType, isRescan bool) error
ImportPublicKeyForWatchWallet csvファイルからpublicアドレスをimportする for WatchOnyWallet
func (*Wallet) SendFromFile ¶
SendFromFile 渡されたファイルから署名済transactionを読み取り、送信を行う
func (*Wallet) SendToAccount ¶
func (w *Wallet) SendToAccount(from, to enum.AccountType, amount btcutil.Amount) (string, string, error)
SendToAccount 内部アカウント間での送金 amountが0のとき、全額送金する TODO:実行後、`listtransactions`methodで確認できるかも(未チェック)
func (*Wallet) SignatureFromFile ¶
SignatureFromFile 渡されたファイルからtransactionを読み取り、署名を行う TODO:いずれにせよ、入金と出金で署名もMultisigかどうかで変わってくる
func (*Wallet) UpdateStatus ¶
UpdateStatus tx_paymentテーブル/tx_receiptテーブルのcurrent_tx_typeが3(送信済)のものを監視し、statusをupdateする