bitflyersettlement

package
v0.0.0-...-57962c9 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CategorizeResponse

func CategorizeResponse(
	batchByTransferID map[string]settlement.AggregateTransaction,
	payout *bitflyer.WithdrawToDepositIDResponse,
) ([]custodian.Transaction, string)

CategorizeResponse categorizes a response from bitflyer as pending, complete, failed, or unknown

func CategorizeResponses

func CategorizeResponses(
	batch []settlement.AggregateTransaction,
	response *[]bitflyer.WithdrawToDepositIDResponse,
) map[string][]custodian.Transaction

CategorizeResponses categorizes the series of responses

func CheckPayoutTransactionsStatus

func CheckPayoutTransactionsStatus(
	ctx context.Context,
	batch []settlement.AggregateTransaction,
	submittedTransactions map[string][]custodian.Transaction,
	bulkPayoutRequestRequirements bitflyer.WithdrawToDepositIDBulkPayload,
	bitflyerClient bitflyer.Client,
	total int,
	blockProgress int,
) (map[string][]custodian.Transaction, error)

CheckPayoutTransactionsStatus checks the status of given transactions

func GroupSettlements

func GroupSettlements(
	settlements *[]custodian.Transaction,
) map[string][]custodian.Transaction

GroupSettlements groups settlements under a single wallet provider id so that we can impose limits based on price no signing here, just grouping settlements under a single deposit id

func IterateRequest

func IterateRequest(
	ctx context.Context,
	action string,
	bitflyerClient bitflyer.Client,
	prepared PreparedTransactions,
	dryRun *bitflyer.DryRunOption,
) (map[string][]custodian.Transaction, error)

IterateRequest iterates requests

func SubmitBulkPayoutTransactions

func SubmitBulkPayoutTransactions(
	ctx context.Context,
	batch []settlement.AggregateTransaction,
	submittedTransactions map[string][]custodian.Transaction,
	bulkPayoutRequestRequirements bitflyer.WithdrawToDepositIDBulkPayload,
	bitflyerClient bitflyer.Client,
	total int,
	blockProgress int,
) (map[string][]custodian.Transaction, error)

SubmitBulkPayoutTransactions submits bulk payout transactions

Types

type PreparedTransactions

type PreparedTransactions struct {
	// goes to bitflyer
	AggregateTransactionBatches [][]settlement.AggregateTransaction `json:"aggregateTransactionBatches"`
	// a list of settlements that are not being sent
	NotSubmittedTransactions []custodian.Transaction `json:"notSubmittedTransactions"`
}

PreparedTransactions are the transactions which have been prepared into batches after applying limits, etc

func PrepareRequests

func PrepareRequests(
	ctx context.Context,
	bitflyerClient bitflyer.Client,
	txs []custodian.Transaction,
	excludeLimited bool,
	sourceFrom string,
) (*PreparedTransactions, error)

PrepareRequests prepares requests

Jump to

Keyboard shortcuts

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