custody

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListPayments added in v1.0.2

func ListPayments(o *ListPaymentsOption) ([]*payments.Payment[string], error)

ListPayments return all Custody Payments, based on provided filters (which can be nil) JWT is required for this request

func NewDepositWithPayment

func NewDepositWithPayment(da *DepositWithPaymentArgs) (*payments.Payment[string], error)

NewDepositWithPayment will create a payment to deposit on a specific user account (refill account) The response doesn't provide the payment link, but can be built using https://nowpayments.io/payment/?iid=[INVOICE_ID]&paymentId=[PAYMENT_id] JWT is required for this request

Types

type BalanceAmounts

type BalanceAmounts struct {
	Amount        float64 `json:"amount"`
	PendingAmount float64 `json:"pendingAmount"`
}

BalanceAmounts single balance for Custody user account

type Balances

type Balances struct {
	Usddtrc20 BalanceAmounts `json:"usddtrc20"`
	Usdtbsc   BalanceAmounts `json:"usdtbsc"`
}

Balances hold multiple balances for Custody user account

type DepositArgs

type DepositArgs struct {
	Currency     string  `json:"currency"`
	Amount       float64 `json:"amount"`
	SubPartnerID string  `json:"sub_partner_id"`
}

type DepositWithPaymentArgs

type DepositWithPaymentArgs struct {
	DepositArgs
	IsFixedRate     bool   `json:"is_fixed_rate"`
	IsFeePaidByUser bool   `json:"is_fee_paid_by_user"`
	IpnCallbackURL  string `json:"ipn_callback_url,omitempty"`
}

type ListCommonOptionsArgs

type ListCommonOptionsArgs struct {
	Id     int64
	Limit  int64
	Offset int64
	Order  string
}

type ListPaymentsOption

type ListPaymentsOption struct {
	Limit        int64
	Page         int64
	Id           int64
	PayCurrency  string
	Status       string
	SubPartnerID string
	DateFrom     string
	DateTo       string
	OrderBy      string
	SortBy       string
}

BalanceAmounts single balance for Custody user account

type ListTransfersOptionArgs

type ListTransfersOptionArgs struct {
	ListCommonOptionsArgs
	Status string
}

ListTransfersOption are options applying to the list of transfers

type Transfer

type Transfer struct {
	Id        string    `json:"id,omitempty"`
	FromSubID string    `json:"from_sub_id,omitempty"`
	ToSubID   string    `json:"to_sub_id,omitempty"`
	Status    string    `json:"status,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	Amount    string    `json:"amount,omitempty"`
	Currency  string    `json:"currency,omitempty"`
}

func GetTransfer

func GetTransfer(transferID string) (*Transfer, error)

GetTransfer will return single transfer information based on the supplied transfer ID JWT is required for this request

func ListTransfers

func ListTransfers(o *ListTransfersOptionArgs) ([]*Transfer, error)

Transfer with return a list of all transfers based on supplied options (which can be nil) JWT is required for this request

func NewDepositFroMasterAccount

func NewDepositFroMasterAccount(da *DepositArgs) (*Transfer, error)

NewDepositFroMasterAccount will create a deposit on a specific user account from a master account (no payment link, will use balance from master) JWT is required for this request

func NewTransfer

func NewTransfer(ta *TransferArgs) (*Transfer, error)

NewTransfer will initiate a transfer between two user account JWT is required for this request

func NewWriteOffToMaster

func NewWriteOffToMaster(wo *DepositArgs) (*Transfer, error)

NewWriteOffToMaster will initiate a funds transfer from user balance to master account JWT is required for this request

type TransferArgs

type TransferArgs struct {
	FromID   string  `json:"from_id"`
	ToID     string  `json:"to_id"`
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

type User

type User struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

User hold response for a Custody user account

func ListUsers

func ListUsers(o *ListCommonOptionsArgs) ([]*User, error)

func NewUser

func NewUser(cu *UserAccountArgs) (*User, error)

NewUser will initiate new user account from a unique ID JWT is required for this request

type UserAccountArgs

type UserAccountArgs struct {
	Name string `json:"name"`
}

type UserBalances

type UserBalances struct {
	SubPartnerID string   `json:"subPartnerId"`
	Balances     Balances `json:"balances"`
}

UserBalances hold response for a specific Custody user account balance

func GetBalance

func GetBalance(userAccountID string) (*UserBalances, error)

GetBalance get the balances for a specific Custody user account, based on it's unique account ID This endpoint will work only if IP is whitelisted (or white IP restrictions are disabled)

Jump to

Keyboard shortcuts

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