custodian

package
v0.0.0-...-57c94a7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MPL-2.0 Imports: 16 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoAllowBlockMap

type GeoAllowBlockMap struct {
	Allow []string `json:"allow" valid:"-"`
	Block []string `json:"block" valid:"-"`
}

GeoAllowBlockMap - this is the allow / block list of geos for a custodian

func (GeoAllowBlockMap) Verdict

func (gabm GeoAllowBlockMap) Verdict(countries ...string) bool

Verdict - test is countries exist in allow list, or do not exist in block list

type PayoutStatus

type PayoutStatus struct {
	Unverified string `json:"unverified" valid:"in(off|processing|complete)"`
	Uphold     string `json:"uphold" valid:"in(off|processing|complete)"`
	Gemini     string `json:"gemini" valid:"in(off|processing|complete)"`
	Bitflyer   string `json:"bitflyer" valid:"in(off|processing|complete)"`
	Zebpay     string `json:"zebpay" valid:"in(off|processing|complete)"`
	Solana     string `json:"solana" valid:"in(off|processing|complete)"`
	Date       string `json:"payoutDate" valid:"-"`
}

PayoutStatus - current state of the payout status

func ExtractPayoutStatus

func ExtractPayoutStatus(ctx context.Context, client appaws.S3GetObjectAPI, bucket string) (*PayoutStatus, error)

ExtractPayoutStatus - extract the custodian payout status from the client

func (*PayoutStatus) Decode

func (ps *PayoutStatus) Decode(ctx context.Context, input []byte) error

Decode - implement decodable

func (*PayoutStatus) HandleErrors

func (ps *PayoutStatus) HandleErrors(err error) *handlers.AppError

HandleErrors - handle any errors in input

func (*PayoutStatus) Validate

func (ps *PayoutStatus) Validate(ctx context.Context) error

Validate - implement validatable

type Regions

type Regions struct {
	Uphold   GeoAllowBlockMap `json:"uphold" valid:"-"`
	Gemini   GeoAllowBlockMap `json:"gemini" valid:"-"`
	Bitflyer GeoAllowBlockMap `json:"bitflyer" valid:"-"`
	Zebpay   GeoAllowBlockMap `json:"zebpay" valid:"-"`
	Solana   GeoAllowBlockMap `json:"solana" valid:"-"`
}

Regions - Supported Regions

func ExtractCustodianRegions

func ExtractCustodianRegions(ctx context.Context, client appaws.S3GetObjectAPI, bucket string) (*Regions, error)

ExtractCustodianRegions - extract the custodian regions from the client

func (*Regions) Decode

func (cr *Regions) Decode(_ context.Context, input []byte) error

Decode - implement decodable

func (*Regions) HandleErrors

func (cr *Regions) HandleErrors(err error) *handlers.AppError

HandleErrors - handle any errors in input

func (*Regions) Validate

func (cr *Regions) Validate(_ context.Context) error

Validate - implement validatable

type Transaction

type Transaction struct {
	AltCurrency      *altcurrency.AltCurrency `json:"altcurrency"`
	Authority        string                   `json:"authority"`
	Amount           decimal.Decimal          `json:"amount"`
	ExchangeFee      decimal.Decimal          `json:"commission"`
	FailureReason    string                   `json:"failureReason,omitempty"`
	Currency         string                   `json:"currency"`
	Destination      string                   `json:"address"`
	Publisher        string                   `json:"owner"`
	BATPlatformFee   decimal.Decimal          `json:"fees"`
	Probi            decimal.Decimal          `json:"probi"`
	ProviderID       string                   `json:"hash"`
	WalletProvider   string                   `json:"walletProvider"`
	WalletProviderID string                   `json:"walletProviderId"`
	Channel          string                   `json:"publisher"`
	SignedTx         string                   `json:"signedTx"`
	Status           string                   `json:"status"`
	SettlementID     string                   `json:"transactionId" valid:"uuidv4"`
	TransferFee      decimal.Decimal          `json:"fee"`
	Type             string                   `json:"type"`
	ValidUntil       time.Time                `json:"validUntil,omitempty"`
	DocumentID       string                   `json:"documentId,omitempty"`
	Note             string                   `json:"note"`
}

Transaction describes a payout transaction from the settlement wallet to a publisher

func (Transaction) BitflyerTransferID

func (tx Transaction) BitflyerTransferID() string

BitflyerTransferID generate the bitflier transfer id

func (Transaction) IsComplete

func (tx Transaction) IsComplete() bool

IsComplete returns true if the transaction status is completed

func (Transaction) IsFailed

func (tx Transaction) IsFailed() bool

IsFailed returns true if the transaction status is failed

func (Transaction) IsProcessing

func (tx Transaction) IsProcessing() bool

IsProcessing returns true if the transaction status is processing

func (Transaction) Log

func (tx Transaction) Log()

Log logs a message

func (Transaction) TransferID

func (tx Transaction) TransferID() string

TransferID generate the transfer id

Jump to

Keyboard shortcuts

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