Documentation ¶
Index ¶
- func CheckForDuplicates(transactions []AntifraudTransaction) error
- func CheckPreparedTransactions(ctx context.Context, settlementWallet *uphold.Wallet, ...) error
- func ConfirmPreparedTransaction(ctx context.Context, settlementWallet *uphold.Wallet, ...) error
- func ConfirmPreparedTransactions(ctx context.Context, settlementWallet *uphold.Wallet, ...) error
- func ParseBPTSignedSettlement(jsonIn []byte) ([]string, error)
- func PrepareTransactions(wallet *uphold.Wallet, settlements []custodian.Transaction, purpose string, ...) error
- func ReadFiles(filesPaths []string) (*[]custodian.Transaction, error)
- func SubmitPreparedTransaction(ctx context.Context, settlementWallet *uphold.Wallet, ...) error
- func SubmitPreparedTransactions(ctx context.Context, settlementWallet *uphold.Wallet, ...) error
- type AggregateTransaction
- type AntifraudTransaction
- type BPTSignedSettlement
- type Config
- type ProviderInfo
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForDuplicates ¶
func CheckForDuplicates(transactions []AntifraudTransaction) error
CheckForDuplicates in a list of transactions
func CheckPreparedTransactions ¶
func CheckPreparedTransactions(ctx context.Context, settlementWallet *uphold.Wallet, settlements []custodian.Transaction) error
CheckPreparedTransactions performs sanity checks on an array of signed settlements
func ConfirmPreparedTransaction ¶
func ConfirmPreparedTransaction( ctx context.Context, settlementWallet *uphold.Wallet, settlement *custodian.Transaction, isResubmit bool, ) error
ConfirmPreparedTransaction confirms a single settlement transaction with uphold
It is designed to be idempotent across multiple runs, in case of network outage transactions that were unable to be confirmed during an initial run can be submitted in subsequent runs.
func ConfirmPreparedTransactions ¶
func ConfirmPreparedTransactions(ctx context.Context, settlementWallet *uphold.Wallet, settlements []custodian.Transaction) error
ConfirmPreparedTransactions confirms settlement transactions that have already been submitted to uphold
It is designed to be idempotent across multiple runs, in case of network outage transactions that were unable to be confirmed during an initial run can be confirmed in subsequent runs.
func ParseBPTSignedSettlement ¶
ParseBPTSignedSettlement parses the signed output from brave-payment-tools
It returns an array of base64 encoded "extracted" httpsignatures
func PrepareTransactions ¶
func PrepareTransactions(wallet *uphold.Wallet, settlements []custodian.Transaction, purpose string, beneficiary *uphold.Beneficiary) error
PrepareTransactions by embedding signed transactions into the settlement documents
func ReadFiles ¶
func ReadFiles(filesPaths []string) (*[]custodian.Transaction, error)
ReadFiles reads a series of files
func SubmitPreparedTransaction ¶
func SubmitPreparedTransaction(ctx context.Context, settlementWallet *uphold.Wallet, settlement *custodian.Transaction) error
SubmitPreparedTransaction submits a single settlement transaction to uphold
It is designed to be idempotent across multiple runs, in case of network outage transactions that were unable to be submitted during an initial run can be submitted in subsequent runs.
func SubmitPreparedTransactions ¶
func SubmitPreparedTransactions(ctx context.Context, settlementWallet *uphold.Wallet, settlements []custodian.Transaction) error
SubmitPreparedTransactions by submitting them to uphold after performing sanity checks
It is designed to be idempotent across multiple runs, in case of network outage transactions that were unable to be submitted during an initial run can be submitted in subsequent runs.
Types ¶
type AggregateTransaction ¶
type AggregateTransaction struct { custodian.Transaction Inputs []custodian.Transaction `json:"inputs"` SourceFrom string `json:"source"` }
AggregateTransaction is a single transaction aggregating multiple input transactions
type AntifraudTransaction ¶
type AntifraudTransaction struct { custodian.Transaction BAT decimal.Decimal `json:"bat,omitempty"` PayoutReportID string `json:"payout_report_id,omitempty"` WalletProviderInfo string `json:"wallet_provider_id,omitempty"` }
AntifraudTransaction is a "v2" transaction, creators only atm
func (AntifraudTransaction) ProviderInfo ¶
func (at AntifraudTransaction) ProviderInfo() ProviderInfo
ProviderInfo splits apart provider info from wallet provider id
func (AntifraudTransaction) ToTransaction ¶
func (at AntifraudTransaction) ToTransaction() (custodian.Transaction, error)
ToTransaction turns the antifraud transaction into a transaction understandable by settlement tools
type BPTSignedSettlement ¶
type BPTSignedSettlement struct { SignedTxs []struct { uphold.HTTPSignedRequest `json:"signedTx"` } `json:"signedTxs"` }
BPTSignedSettlement is a struct describing the signed output format of brave-payment-tools
type Config ¶
Config a space for complex inputs
func ReadYamlConfig ¶
ReadYamlConfig reads a yaml config
func (*Config) GetWalletKey ¶
GetWalletKey accesses the wallet config
type ProviderInfo ¶
ProviderInfo holds information parsed from the wallet_provider_id