Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type APIService
- type APIV2AccountOrderFulfillmentService
- func (r *APIV2AccountOrderFulfillmentService) Get(ctx context.Context, accountID string, fulfillmentID string, ...) (res *OrderFulfillment, err error)
- func (r *APIV2AccountOrderFulfillmentService) Query(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]OrderFulfillment, err error)
- type APIV2AccountOrderGetEstimatedFeeParams
- type APIV2AccountOrderRequestNewLimitBuyParams
- type APIV2AccountOrderRequestNewLimitSellParams
- type APIV2AccountOrderRequestNewMarketBuyParams
- type APIV2AccountOrderRequestNewMarketSellParams
- type APIV2AccountOrderRequestService
- func (r *APIV2AccountOrderRequestService) Get(ctx context.Context, accountID string, requestID string, ...) (res *OrderRequest, err error)
- func (r *APIV2AccountOrderRequestService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]OrderRequest, err error)
- func (r *APIV2AccountOrderRequestService) NewLimitBuy(ctx context.Context, accountID string, ...) (res *OrderRequest, err error)
- func (r *APIV2AccountOrderRequestService) NewLimitSell(ctx context.Context, accountID string, ...) (res *OrderRequest, err error)
- func (r *APIV2AccountOrderRequestService) NewMarketBuy(ctx context.Context, accountID string, ...) (res *OrderRequest, err error)
- func (r *APIV2AccountOrderRequestService) NewMarketSell(ctx context.Context, accountID string, ...) (res *OrderRequest, err error)
- type APIV2AccountOrderService
- func (r *APIV2AccountOrderService) Cancel(ctx context.Context, accountID string, orderID string, ...) (res *Order, err error)
- func (r *APIV2AccountOrderService) Get(ctx context.Context, accountID string, orderID string, ...) (res *Order, err error)
- func (r *APIV2AccountOrderService) GetEstimatedFee(ctx context.Context, accountID string, ...) (res *Apiv2AccountOrderGetEstimatedFeeResponse, err error)
- func (r *APIV2AccountOrderService) GetFulfillments(ctx context.Context, accountID string, orderID string, ...) (res *[]OrderFulfillment, err error)
- func (r *APIV2AccountOrderService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]Order, err error)
- type APIV2AccountService
- func (r *APIV2AccountService) Deactivate(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
- func (r *APIV2AccountService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
- func (r *APIV2AccountService) GetCash(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Apiv2AccountGetCashResponse, err error)
- func (r *APIV2AccountService) GetDividendPayments(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]Apiv2AccountGetDividendPaymentsResponse, err error)
- func (r *APIV2AccountService) GetInterestPayments(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]Apiv2AccountGetInterestPaymentsResponse, err error)
- func (r *APIV2AccountService) GetPortfolio(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Apiv2AccountGetPortfolioResponse, err error)
- type APIV2AccountWalletExternalConnectParams
- type APIV2AccountWalletExternalGetNonceParams
- type APIV2AccountWalletExternalService
- type APIV2AccountWalletService
- type APIV2EntityAccountListParams
- type APIV2EntityAccountService
- type APIV2EntityKYCService
- func (r *APIV2EntityKYCService) Get(ctx context.Context, entityID string, opts ...option.RequestOption) (res *KYCInfo, err error)
- func (r *APIV2EntityKYCService) GetURL(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Apiv2EntityKYCGetURLResponse, err error)
- func (r *APIV2EntityKYCService) Submit(ctx context.Context, entityID string, body APIV2EntityKYCSubmitParams, ...) (res *KYCInfo, err error)
- func (r *APIV2EntityKYCService) UploadDocument(ctx context.Context, entityID string, kycID string, ...) (res *Apiv2EntityKYCUploadDocumentResponse, err error)
- type APIV2EntityKYCSubmitParams
- type APIV2EntityKYCUploadDocumentParams
- type APIV2EntityNewParams
- type APIV2EntityService
- func (r *APIV2EntityService) Get(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Entity, err error)
- func (r *APIV2EntityService) GetCurrent(ctx context.Context, opts ...option.RequestOption) (res *Entity, err error)
- func (r *APIV2EntityService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Entity, err error)
- func (r *APIV2EntityService) New(ctx context.Context, body APIV2EntityNewParams, opts ...option.RequestOption) (res *Entity, err error)
- type APIV2MarketDataService
- type APIV2MarketDataStockGetHistoricalPricesParams
- type APIV2MarketDataStockGetHistoricalPricesParamsTimespan
- type APIV2MarketDataStockGetNewsParams
- type APIV2MarketDataStockListParams
- type APIV2MarketDataStockService
- func (r *APIV2MarketDataStockService) GetDividends(ctx context.Context, stockID string, opts ...option.RequestOption) (res *[]Apiv2MarketDataStockGetDividendsResponse, err error)
- func (r *APIV2MarketDataStockService) GetHistoricalPrices(ctx context.Context, stockID string, ...) (res *[]Apiv2MarketDataStockGetHistoricalPricesResponse, err error)
- func (r *APIV2MarketDataStockService) GetNews(ctx context.Context, stockID string, query APIV2MarketDataStockGetNewsParams, ...) (res *[]Apiv2MarketDataStockGetNewsResponse, err error)
- func (r *APIV2MarketDataStockService) GetQuote(ctx context.Context, stockID string, opts ...option.RequestOption) (res *Apiv2MarketDataStockGetQuoteResponse, err error)
- func (r *APIV2MarketDataStockService) List(ctx context.Context, query APIV2MarketDataStockListParams, ...) (res *[]Apiv2MarketDataStockListResponse, err error)
- type APIV2MarketDataStockSplitGetParams
- type APIV2MarketDataStockSplitListParams
- type APIV2MarketDataStockSplitService
- func (r *APIV2MarketDataStockSplitService) Get(ctx context.Context, stockID string, query APIV2MarketDataStockSplitGetParams, ...) (res *[]StockSplit, err error)
- func (r *APIV2MarketDataStockSplitService) List(ctx context.Context, query APIV2MarketDataStockSplitListParams, ...) (res *[]StockSplit, err error)
- type APIV2Service
- type Account
- type Apiv2AccountGetCashResponse
- type Apiv2AccountGetDividendPaymentsResponse
- type Apiv2AccountGetInterestPaymentsResponse
- type Apiv2AccountGetPortfolioResponse
- type Apiv2AccountGetPortfolioResponseAsset
- type Apiv2AccountOrderGetEstimatedFeeResponse
- type Apiv2AccountOrderGetEstimatedFeeResponseFee
- type Apiv2AccountOrderGetEstimatedFeeResponseFeeQuote
- type Apiv2AccountWalletExternalGetNonceResponse
- type Apiv2EntityKYCGetURLResponse
- type Apiv2EntityKYCUploadDocumentResponse
- type Apiv2GetHealthResponse
- type Apiv2MarketDataGetMarketHoursResponse
- type Apiv2MarketDataStockGetDividendsResponse
- type Apiv2MarketDataStockGetHistoricalPricesResponse
- type Apiv2MarketDataStockGetNewsResponse
- type Apiv2MarketDataStockGetQuoteResponse
- type Apiv2MarketDataStockListResponse
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type Entity
- type EntityEntityType
- type Error
- type KYCData
- type KYCDataParam
- type KYCDocumentType
- type KYCInfo
- type KYCInfoStatus
- type LimitOrderRequestInputParam
- type Order
- type OrderBrokerageOrderStatus
- type OrderFulfillment
- type OrderOrderSide
- type OrderOrderTif
- type OrderOrderType
- type OrderRequest
- type OrderRequestStatus
- type StockSplit
- type StockSplitStatus
- type Wallet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (DINARI_API_KEY, DINARI_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type APIService ¶
type APIService struct {
Options []option.RequestOption
V2 APIV2Service
}
APIService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIService method instead.
func NewAPIService ¶
func NewAPIService(opts ...option.RequestOption) (r APIService)
NewAPIService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type APIV2AccountOrderFulfillmentService ¶
type APIV2AccountOrderFulfillmentService struct {
Options []option.RequestOption
}
APIV2AccountOrderFulfillmentService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2AccountOrderFulfillmentService method instead.
func NewAPIV2AccountOrderFulfillmentService ¶
func NewAPIV2AccountOrderFulfillmentService(opts ...option.RequestOption) (r APIV2AccountOrderFulfillmentService)
NewAPIV2AccountOrderFulfillmentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2AccountOrderFulfillmentService) Get ¶
func (r *APIV2AccountOrderFulfillmentService) Get(ctx context.Context, accountID string, fulfillmentID string, opts ...option.RequestOption) (res *OrderFulfillment, err error)
Retrieves details of a specific order fulfillment by its ID.
func (*APIV2AccountOrderFulfillmentService) Query ¶
func (r *APIV2AccountOrderFulfillmentService) Query(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]OrderFulfillment, err error)
Queries all order fulfillments under the account.
type APIV2AccountOrderGetEstimatedFeeParams ¶
type APIV2AccountOrderGetEstimatedFeeParams struct {
// Chain where the order is placed
ChainID int64 `json:"chain_id,required"`
// Order contract address
ContractAddress string `json:"contract_address,required" format:"eth_address"`
// Order data from which to calculate the fees. To be specified in the future
OrderData map[string]string `json:"order_data,omitzero,required"`
// contains filtered or unexported fields
}
func (APIV2AccountOrderGetEstimatedFeeParams) IsPresent ¶
func (f APIV2AccountOrderGetEstimatedFeeParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2AccountOrderGetEstimatedFeeParams) MarshalJSON ¶
func (r APIV2AccountOrderGetEstimatedFeeParams) MarshalJSON() (data []byte, err error)
type APIV2AccountOrderRequestNewLimitBuyParams ¶
type APIV2AccountOrderRequestNewLimitBuyParams struct {
// Input parameters for placing a limit order.
LimitOrderRequestInput LimitOrderRequestInputParam
// contains filtered or unexported fields
}
func (APIV2AccountOrderRequestNewLimitBuyParams) IsPresent ¶
func (f APIV2AccountOrderRequestNewLimitBuyParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2AccountOrderRequestNewLimitBuyParams) MarshalJSON ¶
func (r APIV2AccountOrderRequestNewLimitBuyParams) MarshalJSON() (data []byte, err error)
type APIV2AccountOrderRequestNewLimitSellParams ¶
type APIV2AccountOrderRequestNewLimitSellParams struct {
// Input parameters for placing a limit order.
LimitOrderRequestInput LimitOrderRequestInputParam
// contains filtered or unexported fields
}
func (APIV2AccountOrderRequestNewLimitSellParams) IsPresent ¶
func (f APIV2AccountOrderRequestNewLimitSellParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2AccountOrderRequestNewLimitSellParams) MarshalJSON ¶
func (r APIV2AccountOrderRequestNewLimitSellParams) MarshalJSON() (data []byte, err error)
type APIV2AccountOrderRequestNewMarketBuyParams ¶
type APIV2AccountOrderRequestNewMarketBuyParams struct {
// Amount of USD to pay or receive for the order. Must be a positive number with a
// precision of up to 2 decimal places.
PaymentAmount float64 `json:"payment_amount,required"`
// ID of stock, as returned by the `/stocks` endpoint, e.g. 1
StockID string `json:"stock_id,required" format:"bigint"`
// Whether to include fees in the `payment_amount` input field.
IncludeFees param.Opt[bool] `json:"include_fees,omitzero"`
// contains filtered or unexported fields
}
func (APIV2AccountOrderRequestNewMarketBuyParams) IsPresent ¶
func (f APIV2AccountOrderRequestNewMarketBuyParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2AccountOrderRequestNewMarketBuyParams) MarshalJSON ¶
func (r APIV2AccountOrderRequestNewMarketBuyParams) MarshalJSON() (data []byte, err error)
type APIV2AccountOrderRequestNewMarketSellParams ¶
type APIV2AccountOrderRequestNewMarketSellParams struct {
// Quantity of stock to trade. Must be a positive number with a precision of up to
// 9 decimal places.
AssetQuantity float64 `json:"asset_quantity,required"`
// ID of stock, as returned by the `/stocks` endpoint, e.g. 1
StockID string `json:"stock_id,required" format:"bigint"`
// contains filtered or unexported fields
}
func (APIV2AccountOrderRequestNewMarketSellParams) IsPresent ¶
func (f APIV2AccountOrderRequestNewMarketSellParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2AccountOrderRequestNewMarketSellParams) MarshalJSON ¶
func (r APIV2AccountOrderRequestNewMarketSellParams) MarshalJSON() (data []byte, err error)
type APIV2AccountOrderRequestService ¶
type APIV2AccountOrderRequestService struct {
Options []option.RequestOption
}
APIV2AccountOrderRequestService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2AccountOrderRequestService method instead.
func NewAPIV2AccountOrderRequestService ¶
func NewAPIV2AccountOrderRequestService(opts ...option.RequestOption) (r APIV2AccountOrderRequestService)
NewAPIV2AccountOrderRequestService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2AccountOrderRequestService) Get ¶
func (r *APIV2AccountOrderRequestService) Get(ctx context.Context, accountID string, requestID string, opts ...option.RequestOption) (res *OrderRequest, err error)
Retrieves details of a specific managed order request by its ID.
func (*APIV2AccountOrderRequestService) List ¶
func (r *APIV2AccountOrderRequestService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]OrderRequest, err error)
Lists managed order requests.
func (*APIV2AccountOrderRequestService) NewLimitBuy ¶
func (r *APIV2AccountOrderRequestService) NewLimitBuy(ctx context.Context, accountID string, body APIV2AccountOrderRequestNewLimitBuyParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Creates a managed limit buy request.
func (*APIV2AccountOrderRequestService) NewLimitSell ¶
func (r *APIV2AccountOrderRequestService) NewLimitSell(ctx context.Context, accountID string, body APIV2AccountOrderRequestNewLimitSellParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Creates a managed limit sell request.
func (*APIV2AccountOrderRequestService) NewMarketBuy ¶
func (r *APIV2AccountOrderRequestService) NewMarketBuy(ctx context.Context, accountID string, body APIV2AccountOrderRequestNewMarketBuyParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Creates a managed market buy request.
func (*APIV2AccountOrderRequestService) NewMarketSell ¶
func (r *APIV2AccountOrderRequestService) NewMarketSell(ctx context.Context, accountID string, body APIV2AccountOrderRequestNewMarketSellParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Creates a managed market sell request.
type APIV2AccountOrderService ¶
type APIV2AccountOrderService struct {
Options []option.RequestOption
}
APIV2AccountOrderService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2AccountOrderService method instead.
func NewAPIV2AccountOrderService ¶
func NewAPIV2AccountOrderService(opts ...option.RequestOption) (r APIV2AccountOrderService)
NewAPIV2AccountOrderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2AccountOrderService) Cancel ¶
func (r *APIV2AccountOrderService) Cancel(ctx context.Context, accountID string, orderID string, opts ...option.RequestOption) (res *Order, err error)
Cancels an order by its ID. Note that this requires the order ID, not the order request ID.
func (*APIV2AccountOrderService) Get ¶
func (r *APIV2AccountOrderService) Get(ctx context.Context, accountID string, orderID string, opts ...option.RequestOption) (res *Order, err error)
Retrieves details of a specific order by its ID.
func (*APIV2AccountOrderService) GetEstimatedFee ¶
func (r *APIV2AccountOrderService) GetEstimatedFee(ctx context.Context, accountID string, body APIV2AccountOrderGetEstimatedFeeParams, opts ...option.RequestOption) (res *Apiv2AccountOrderGetEstimatedFeeResponse, err error)
Gets estimated fee data for an order to be placed directly through our contracts.
func (*APIV2AccountOrderService) GetFulfillments ¶
func (r *APIV2AccountOrderService) GetFulfillments(ctx context.Context, accountID string, orderID string, opts ...option.RequestOption) (res *[]OrderFulfillment, err error)
Retrieves order fulfillments for a specific order.
func (*APIV2AccountOrderService) List ¶
func (r *APIV2AccountOrderService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]Order, err error)
Lists all orders under the account.
type APIV2AccountService ¶
type APIV2AccountService struct {
Options []option.RequestOption
Wallet APIV2AccountWalletService
Orders APIV2AccountOrderService
OrderFulfillments APIV2AccountOrderFulfillmentService
OrderRequests APIV2AccountOrderRequestService
}
APIV2AccountService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2AccountService method instead.
func NewAPIV2AccountService ¶
func NewAPIV2AccountService(opts ...option.RequestOption) (r APIV2AccountService)
NewAPIV2AccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2AccountService) Deactivate ¶
func (r *APIV2AccountService) Deactivate(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
Sets the account to be inactive.
func (*APIV2AccountService) Get ¶
func (r *APIV2AccountService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
Retrieves a specific account by its ID.
func (*APIV2AccountService) GetCash ¶
func (r *APIV2AccountService) GetCash(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Apiv2AccountGetCashResponse, err error)
Retrieves the cash amount in the account.
func (*APIV2AccountService) GetDividendPayments ¶
func (r *APIV2AccountService) GetDividendPayments(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]Apiv2AccountGetDividendPaymentsResponse, err error)
Retrieves dividend payments made to the account.
func (*APIV2AccountService) GetInterestPayments ¶
func (r *APIV2AccountService) GetInterestPayments(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]Apiv2AccountGetInterestPaymentsResponse, err error)
Retrieves interest payments made to the account.
func (*APIV2AccountService) GetPortfolio ¶
func (r *APIV2AccountService) GetPortfolio(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Apiv2AccountGetPortfolioResponse, err error)
Retrieves the portfolio of the account, sans cash equivalents.
type APIV2AccountWalletExternalConnectParams ¶
type APIV2AccountWalletExternalConnectParams struct {
// Blockchain the wallet to link is on
ChainID int64 `json:"chain_id,required"`
// Nonce used to sign the wallet connection message
Nonce string `json:"nonce,required" format:"uuid"`
// Signature payload from signing the wallet connection message with the wallet
Signature string `json:"signature,required" format:"hex_string"`
// Address of the wallet
WalletAddress string `json:"wallet_address,required" format:"eth_address"`
// contains filtered or unexported fields
}
func (APIV2AccountWalletExternalConnectParams) IsPresent ¶
func (f APIV2AccountWalletExternalConnectParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2AccountWalletExternalConnectParams) MarshalJSON ¶
func (r APIV2AccountWalletExternalConnectParams) MarshalJSON() (data []byte, err error)
type APIV2AccountWalletExternalGetNonceParams ¶
type APIV2AccountWalletExternalGetNonceParams struct {
// Address of the wallet to connect
WalletAddress string `query:"wallet_address,required" format:"eth_address" json:"-"`
// contains filtered or unexported fields
}
func (APIV2AccountWalletExternalGetNonceParams) IsPresent ¶
func (f APIV2AccountWalletExternalGetNonceParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2AccountWalletExternalGetNonceParams) URLQuery ¶
func (r APIV2AccountWalletExternalGetNonceParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIV2AccountWalletExternalGetNonceParams's query parameters as `url.Values`.
type APIV2AccountWalletExternalService ¶
type APIV2AccountWalletExternalService struct {
Options []option.RequestOption
}
APIV2AccountWalletExternalService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2AccountWalletExternalService method instead.
func NewAPIV2AccountWalletExternalService ¶
func NewAPIV2AccountWalletExternalService(opts ...option.RequestOption) (r APIV2AccountWalletExternalService)
NewAPIV2AccountWalletExternalService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2AccountWalletExternalService) Connect ¶
func (r *APIV2AccountWalletExternalService) Connect(ctx context.Context, accountID string, body APIV2AccountWalletExternalConnectParams, opts ...option.RequestOption) (res *Wallet, err error)
Connects a wallet to the account using the nonce and signature
func (*APIV2AccountWalletExternalService) GetNonce ¶
func (r *APIV2AccountWalletExternalService) GetNonce(ctx context.Context, accountID string, query APIV2AccountWalletExternalGetNonceParams, opts ...option.RequestOption) (res *Apiv2AccountWalletExternalGetNonceResponse, err error)
Gets a nonce and message to be signed in order to verify wallet ownership.
type APIV2AccountWalletService ¶
type APIV2AccountWalletService struct {
Options []option.RequestOption
External APIV2AccountWalletExternalService
}
APIV2AccountWalletService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2AccountWalletService method instead.
func NewAPIV2AccountWalletService ¶
func NewAPIV2AccountWalletService(opts ...option.RequestOption) (r APIV2AccountWalletService)
NewAPIV2AccountWalletService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2AccountWalletService) Get ¶
func (r *APIV2AccountWalletService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Wallet, err error)
Retrieves details of the wallet connected to the account.
type APIV2EntityAccountListParams ¶
type APIV2EntityAccountListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (APIV2EntityAccountListParams) IsPresent ¶
func (f APIV2EntityAccountListParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2EntityAccountListParams) URLQuery ¶
func (r APIV2EntityAccountListParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIV2EntityAccountListParams's query parameters as `url.Values`.
type APIV2EntityAccountService ¶
type APIV2EntityAccountService struct {
Options []option.RequestOption
}
APIV2EntityAccountService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2EntityAccountService method instead.
func NewAPIV2EntityAccountService ¶
func NewAPIV2EntityAccountService(opts ...option.RequestOption) (r APIV2EntityAccountService)
NewAPIV2EntityAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2EntityAccountService) List ¶
func (r *APIV2EntityAccountService) List(ctx context.Context, entityID string, query APIV2EntityAccountListParams, opts ...option.RequestOption) (res *[]Account, err error)
Retrieves a list of Accounts that belong to a specific Entity.
func (*APIV2EntityAccountService) New ¶
func (r *APIV2EntityAccountService) New(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Account, err error)
Creates a new Account for the given Entity.
type APIV2EntityKYCService ¶
type APIV2EntityKYCService struct {
Options []option.RequestOption
}
APIV2EntityKYCService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2EntityKYCService method instead.
func NewAPIV2EntityKYCService ¶
func NewAPIV2EntityKYCService(opts ...option.RequestOption) (r APIV2EntityKYCService)
NewAPIV2EntityKYCService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2EntityKYCService) Get ¶
func (r *APIV2EntityKYCService) Get(ctx context.Context, entityID string, opts ...option.RequestOption) (res *KYCInfo, err error)
Retrieves KYC data of the entity.
func (*APIV2EntityKYCService) GetURL ¶
func (r *APIV2EntityKYCService) GetURL(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Apiv2EntityKYCGetURLResponse, err error)
Gets an iframe URL for managed (self-service) KYC.
func (*APIV2EntityKYCService) Submit ¶
func (r *APIV2EntityKYCService) Submit(ctx context.Context, entityID string, body APIV2EntityKYCSubmitParams, opts ...option.RequestOption) (res *KYCInfo, err error)
Submits KYC data manually (for Partner KYC-enabled entities).
func (*APIV2EntityKYCService) UploadDocument ¶
func (r *APIV2EntityKYCService) UploadDocument(ctx context.Context, entityID string, kycID string, body APIV2EntityKYCUploadDocumentParams, opts ...option.RequestOption) (res *Apiv2EntityKYCUploadDocumentResponse, err error)
Uploads KYC-related documentation (for Partner KYC-enabled entities).
type APIV2EntityKYCSubmitParams ¶
type APIV2EntityKYCSubmitParams struct {
// Object consisting of KYC data for an entity
Data KYCDataParam `json:"data,omitzero,required"`
// Name of the KYC provider that provided the KYC information
ProviderName string `json:"provider_name,required"`
// contains filtered or unexported fields
}
func (APIV2EntityKYCSubmitParams) IsPresent ¶
func (f APIV2EntityKYCSubmitParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2EntityKYCSubmitParams) MarshalJSON ¶
func (r APIV2EntityKYCSubmitParams) MarshalJSON() (data []byte, err error)
type APIV2EntityKYCUploadDocumentParams ¶
type APIV2EntityKYCUploadDocumentParams struct {
// Type of the document to be uploaded
//
// Any of "GOVERNMENT_ID", "SELFIE", "RESIDENCY", "UNKNOWN".
DocumentType KYCDocumentType `json:"document_type,omitzero,required"`
// contains filtered or unexported fields
}
func (APIV2EntityKYCUploadDocumentParams) IsPresent ¶
func (f APIV2EntityKYCUploadDocumentParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2EntityKYCUploadDocumentParams) MarshalJSON ¶
func (r APIV2EntityKYCUploadDocumentParams) MarshalJSON() (data []byte, err error)
type APIV2EntityNewParams ¶
type APIV2EntityNewParams struct {
// Name of the entity
Name string `json:"name,required"`
// contains filtered or unexported fields
}
func (APIV2EntityNewParams) IsPresent ¶
func (f APIV2EntityNewParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2EntityNewParams) MarshalJSON ¶
func (r APIV2EntityNewParams) MarshalJSON() (data []byte, err error)
type APIV2EntityService ¶
type APIV2EntityService struct {
Options []option.RequestOption
Accounts APIV2EntityAccountService
KYC APIV2EntityKYCService
}
APIV2EntityService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2EntityService method instead.
func NewAPIV2EntityService ¶
func NewAPIV2EntityService(opts ...option.RequestOption) (r APIV2EntityService)
NewAPIV2EntityService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2EntityService) Get ¶
func (r *APIV2EntityService) Get(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Entity, err error)
Retrieves a specific customer Entity of your organization by their ID.
func (*APIV2EntityService) GetCurrent ¶
func (r *APIV2EntityService) GetCurrent(ctx context.Context, opts ...option.RequestOption) (res *Entity, err error)
Returns the current authenticated Entity.
func (*APIV2EntityService) List ¶
func (r *APIV2EntityService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Entity, err error)
Returns a list of all direct Entities your organization manages. An Entity represents an individual customer of your organization.
func (*APIV2EntityService) New ¶
func (r *APIV2EntityService) New(ctx context.Context, body APIV2EntityNewParams, opts ...option.RequestOption) (res *Entity, err error)
Creates a new Entity to be managed by your organization. The Entity represents an individual customer of your organization.
type APIV2MarketDataService ¶
type APIV2MarketDataService struct {
Options []option.RequestOption
Stocks APIV2MarketDataStockService
}
APIV2MarketDataService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2MarketDataService method instead.
func NewAPIV2MarketDataService ¶
func NewAPIV2MarketDataService(opts ...option.RequestOption) (r APIV2MarketDataService)
NewAPIV2MarketDataService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2MarketDataService) GetMarketHours ¶
func (r *APIV2MarketDataService) GetMarketHours(ctx context.Context, opts ...option.RequestOption) (res *Apiv2MarketDataGetMarketHoursResponse, err error)
Returns an object containing the market hours for the current day and next open trading day.
type APIV2MarketDataStockGetHistoricalPricesParams ¶
type APIV2MarketDataStockGetHistoricalPricesParams struct {
// The timespan of the historical prices to query.
//
// Any of "DAY", "WEEK", "MONTH", "YEAR".
Timespan APIV2MarketDataStockGetHistoricalPricesParamsTimespan `query:"timespan,omitzero,required" json:"-"`
// contains filtered or unexported fields
}
func (APIV2MarketDataStockGetHistoricalPricesParams) IsPresent ¶
func (f APIV2MarketDataStockGetHistoricalPricesParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2MarketDataStockGetHistoricalPricesParams) URLQuery ¶
func (r APIV2MarketDataStockGetHistoricalPricesParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIV2MarketDataStockGetHistoricalPricesParams's query parameters as `url.Values`.
type APIV2MarketDataStockGetHistoricalPricesParamsTimespan ¶
type APIV2MarketDataStockGetHistoricalPricesParamsTimespan string
The timespan of the historical prices to query.
const ( APIV2MarketDataStockGetHistoricalPricesParamsTimespanDay APIV2MarketDataStockGetHistoricalPricesParamsTimespan = "DAY" APIV2MarketDataStockGetHistoricalPricesParamsTimespanWeek APIV2MarketDataStockGetHistoricalPricesParamsTimespan = "WEEK" APIV2MarketDataStockGetHistoricalPricesParamsTimespanMonth APIV2MarketDataStockGetHistoricalPricesParamsTimespan = "MONTH" APIV2MarketDataStockGetHistoricalPricesParamsTimespanYear APIV2MarketDataStockGetHistoricalPricesParamsTimespan = "YEAR" )
type APIV2MarketDataStockGetNewsParams ¶
type APIV2MarketDataStockGetNewsParams struct {
// The number of news articles to return, default is 10 max is 25
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (APIV2MarketDataStockGetNewsParams) IsPresent ¶
func (f APIV2MarketDataStockGetNewsParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2MarketDataStockGetNewsParams) URLQuery ¶
func (r APIV2MarketDataStockGetNewsParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIV2MarketDataStockGetNewsParams's query parameters as `url.Values`.
type APIV2MarketDataStockListParams ¶
type APIV2MarketDataStockListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// List of stock symbols to query. If not provided, all stocks are returned.
Symbols []string `query:"symbols,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (APIV2MarketDataStockListParams) IsPresent ¶
func (f APIV2MarketDataStockListParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2MarketDataStockListParams) URLQuery ¶
func (r APIV2MarketDataStockListParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIV2MarketDataStockListParams's query parameters as `url.Values`.
type APIV2MarketDataStockService ¶
type APIV2MarketDataStockService struct {
Options []option.RequestOption
Splits APIV2MarketDataStockSplitService
}
APIV2MarketDataStockService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2MarketDataStockService method instead.
func NewAPIV2MarketDataStockService ¶
func NewAPIV2MarketDataStockService(opts ...option.RequestOption) (r APIV2MarketDataStockService)
NewAPIV2MarketDataStockService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2MarketDataStockService) GetDividends ¶
func (r *APIV2MarketDataStockService) GetDividends(ctx context.Context, stockID string, opts ...option.RequestOption) (res *[]Apiv2MarketDataStockGetDividendsResponse, err error)
Returns a list of announced stock dividend details for a specified stock. Note that this data applies only to actual stocks. Yield received for holding dShares may differ from this.
func (*APIV2MarketDataStockService) GetHistoricalPrices ¶
func (r *APIV2MarketDataStockService) GetHistoricalPrices(ctx context.Context, stockID string, query APIV2MarketDataStockGetHistoricalPricesParams, opts ...option.RequestOption) (res *[]Apiv2MarketDataStockGetHistoricalPricesResponse, err error)
Returns a list of historical prices for a specified stock. Each index in the array represents a single tick in a price chart.
func (*APIV2MarketDataStockService) GetNews ¶
func (r *APIV2MarketDataStockService) GetNews(ctx context.Context, stockID string, query APIV2MarketDataStockGetNewsParams, opts ...option.RequestOption) (res *[]Apiv2MarketDataStockGetNewsResponse, err error)
Get the most recent news articles relating to a stock, including a summary of the article and a link to the original source
func (*APIV2MarketDataStockService) GetQuote ¶
func (r *APIV2MarketDataStockService) GetQuote(ctx context.Context, stockID string, opts ...option.RequestOption) (res *Apiv2MarketDataStockGetQuoteResponse, err error)
Returns a stock quote for a specified stock.
func (*APIV2MarketDataStockService) List ¶
func (r *APIV2MarketDataStockService) List(ctx context.Context, query APIV2MarketDataStockListParams, opts ...option.RequestOption) (res *[]Apiv2MarketDataStockListResponse, err error)
Returns a list of stocks available for trading.
type APIV2MarketDataStockSplitGetParams ¶
type APIV2MarketDataStockSplitGetParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (APIV2MarketDataStockSplitGetParams) IsPresent ¶
func (f APIV2MarketDataStockSplitGetParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2MarketDataStockSplitGetParams) URLQuery ¶
func (r APIV2MarketDataStockSplitGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIV2MarketDataStockSplitGetParams's query parameters as `url.Values`.
type APIV2MarketDataStockSplitListParams ¶
type APIV2MarketDataStockSplitListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (APIV2MarketDataStockSplitListParams) IsPresent ¶
func (f APIV2MarketDataStockSplitListParams) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (APIV2MarketDataStockSplitListParams) URLQuery ¶
func (r APIV2MarketDataStockSplitListParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIV2MarketDataStockSplitListParams's query parameters as `url.Values`.
type APIV2MarketDataStockSplitService ¶
type APIV2MarketDataStockSplitService struct {
Options []option.RequestOption
}
APIV2MarketDataStockSplitService contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2MarketDataStockSplitService method instead.
func NewAPIV2MarketDataStockSplitService ¶
func NewAPIV2MarketDataStockSplitService(opts ...option.RequestOption) (r APIV2MarketDataStockSplitService)
NewAPIV2MarketDataStockSplitService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2MarketDataStockSplitService) Get ¶
func (r *APIV2MarketDataStockSplitService) Get(ctx context.Context, stockID string, query APIV2MarketDataStockSplitGetParams, opts ...option.RequestOption) (res *[]StockSplit, err error)
Returns a list of stock splits for a given stock id. The splits are ordered by the date they were created, with the most recent split first.
In an example 10-for-1 stock split, trading will be halted for the stock at the end of the `payable_date`, as the split transitions from `PENDING` to `IN_PROGRESS`. This usually occurs over a weekend to minimize trading disruptions. Each share of stock owned by a shareholder will then be converted into 10 shares, and the split becomes `COMPLETE` as trading resumes on the `ex_date` with new split-adjusted prices.
func (*APIV2MarketDataStockSplitService) List ¶
func (r *APIV2MarketDataStockSplitService) List(ctx context.Context, query APIV2MarketDataStockSplitListParams, opts ...option.RequestOption) (res *[]StockSplit, err error)
Returns a list of stock splits. The splits are ordered by the date they were created, with the most recent split first.
In an example 10-for-1 stock split, trading will be halted for the stock at the end of the `payable_date`, as the split transitions from `PENDING` to `IN_PROGRESS`. This usually occurs over a weekend to minimize trading disruptions. Each share of stock owned by a shareholder will then be converted into 10 shares, and the split becomes `COMPLETE` as trading resumes on the `ex_date` with new split-adjusted prices.
type APIV2Service ¶
type APIV2Service struct {
Options []option.RequestOption
MarketData APIV2MarketDataService
Entities APIV2EntityService
Accounts APIV2AccountService
}
APIV2Service contains methods and other services that help with interacting with the dinari API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIV2Service method instead.
func NewAPIV2Service ¶
func NewAPIV2Service(opts ...option.RequestOption) (r APIV2Service)
NewAPIV2Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIV2Service) GetHealth ¶
func (r *APIV2Service) GetHealth(ctx context.Context, opts ...option.RequestOption) (res *Apiv2GetHealthResponse, err error)
Get Health Status
type Account ¶
type Account struct {
// Unique identifier for the account
ID string `json:"id,required" format:"uuid"`
// Timestamp when the account was created
CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
// Identifier for the Entity that owns the account
EntityID string `json:"entity_id,required" format:"uuid"`
// Indicates whether the account is active
IsActive bool `json:"is_active,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ID resp.Field
CreatedDt resp.Field
EntityID resp.Field
IsActive resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about an account owned by an entity
func (*Account) UnmarshalJSON ¶
type Apiv2AccountGetCashResponse ¶
type Apiv2AccountGetCashResponse struct {
// Total amount of cash and cash equivalents
Amount float64 `json:"amount,required"`
// Currency (e.g. USD)
Currency string `json:"currency,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Amount resp.Field
Currency resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Balance of cash and cash equivalents currently in the account.
func (Apiv2AccountGetCashResponse) RawJSON ¶
func (r Apiv2AccountGetCashResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountGetCashResponse) UnmarshalJSON ¶
func (r *Apiv2AccountGetCashResponse) UnmarshalJSON(data []byte) error
type Apiv2AccountGetDividendPaymentsResponse ¶
type Apiv2AccountGetDividendPaymentsResponse struct {
// Amount of the dividend paid.
Amount float64 `json:"amount,required"`
// Currency in which the dividend was paid. (e.g. USD)
Currency string `json:"currency,required"`
// Date the dividend was distributed to the account.
PaymentDate time.Time `json:"payment_date,required" format:"date"`
// ID of the stock for which the dividend was paid.
StockID string `json:"stock_id,required" format:"bigint"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Amount resp.Field
Currency resp.Field
PaymentDate resp.Field
StockID resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
AccountDividendPayment represents a stock dividend payment event for an account.
func (Apiv2AccountGetDividendPaymentsResponse) RawJSON ¶
func (r Apiv2AccountGetDividendPaymentsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountGetDividendPaymentsResponse) UnmarshalJSON ¶
func (r *Apiv2AccountGetDividendPaymentsResponse) UnmarshalJSON(data []byte) error
type Apiv2AccountGetInterestPaymentsResponse ¶
type Apiv2AccountGetInterestPaymentsResponse struct {
// Amount of interest paid
Amount float64 `json:"amount,required"`
// Type of currency (e.g. USD)
Currency string `json:"currency,required"`
// Date of interest payment. In US Eastern time zone
PaymentDate time.Time `json:"payment_date,required" format:"date"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Amount resp.Field
Currency resp.Field
PaymentDate resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
An object representing interest payment details.
func (Apiv2AccountGetInterestPaymentsResponse) RawJSON ¶
func (r Apiv2AccountGetInterestPaymentsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountGetInterestPaymentsResponse) UnmarshalJSON ¶
func (r *Apiv2AccountGetInterestPaymentsResponse) UnmarshalJSON(data []byte) error
type Apiv2AccountGetPortfolioResponse ¶
type Apiv2AccountGetPortfolioResponse struct {
// Stock Balance details for all owned stocks
Assets []Apiv2AccountGetPortfolioResponseAsset `json:"assets,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Assets resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
This is an object representing the balance of cash and stock assets in your account.
func (Apiv2AccountGetPortfolioResponse) RawJSON ¶
func (r Apiv2AccountGetPortfolioResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountGetPortfolioResponse) UnmarshalJSON ¶
func (r *Apiv2AccountGetPortfolioResponse) UnmarshalJSON(data []byte) error
type Apiv2AccountGetPortfolioResponseAsset ¶
type Apiv2AccountGetPortfolioResponseAsset struct {
// Total amount of the stock
Amount float64 `json:"amount,required"`
// Total market value of the stock
MarketValue float64 `json:"market_value,required"`
// ID of Stock
StockID string `json:"stock_id,required" format:"bigint"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Amount resp.Field
MarketValue resp.Field
StockID resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Balance of a stock in the account
func (Apiv2AccountGetPortfolioResponseAsset) RawJSON ¶
func (r Apiv2AccountGetPortfolioResponseAsset) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountGetPortfolioResponseAsset) UnmarshalJSON ¶
func (r *Apiv2AccountGetPortfolioResponseAsset) UnmarshalJSON(data []byte) error
type Apiv2AccountOrderGetEstimatedFeeResponse ¶
type Apiv2AccountOrderGetEstimatedFeeResponse struct {
// Chain where the order is placed
ChainID int64 `json:"chain_id,required"`
// FeeQuote structure to pass into contracts
FeeQuote Apiv2AccountOrderGetEstimatedFeeResponseFeeQuote `json:"fee_quote,required"`
// Signed FeeQuote structure to pass into contracts
FeeQuoteSignature string `json:"fee_quote_signature,required" format:"hex_string"`
// Breakdown of fees
Fees []Apiv2AccountOrderGetEstimatedFeeResponseFee `json:"fees,required"`
// Address of payment token used for fees
PaymentToken string `json:"payment_token,required" format:"eth_address"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ChainID resp.Field
FeeQuote resp.Field
FeeQuoteSignature resp.Field
Fees resp.Field
PaymentToken resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Apiv2AccountOrderGetEstimatedFeeResponse) RawJSON ¶
func (r Apiv2AccountOrderGetEstimatedFeeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountOrderGetEstimatedFeeResponse) UnmarshalJSON ¶
func (r *Apiv2AccountOrderGetEstimatedFeeResponse) UnmarshalJSON(data []byte) error
type Apiv2AccountOrderGetEstimatedFeeResponseFee ¶
type Apiv2AccountOrderGetEstimatedFeeResponseFee struct {
// The quantity of the fee paid via payment token in ETH
// <a href='https://ethereum.org/en/developers/docs/intro-to-ether/#what-is-ether' target='_blank'>(what
// is ETH?)</a>
FeeInEth float64 `json:"fee_in_eth,required"`
// The quantity of the fee paid via payment token in wei
// <a href='https://ethereum.org/en/developers/docs/intro-to-ether/#denominations' target='_blank'>(what
// is wei?)</a>
FeeInWei string `json:"fee_in_wei,required" format:"bigint"`
// Type of fee
//
// Any of "SPONSORED_NETWORK", "NETWORK", "TRADING", "ORDER", "PARTNER_ORDER",
// "PARTNER_TRADING".
Type string `json:"type,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
FeeInEth resp.Field
FeeInWei resp.Field
Type resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Apiv2AccountOrderGetEstimatedFeeResponseFee) RawJSON ¶
func (r Apiv2AccountOrderGetEstimatedFeeResponseFee) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountOrderGetEstimatedFeeResponseFee) UnmarshalJSON ¶
func (r *Apiv2AccountOrderGetEstimatedFeeResponseFee) UnmarshalJSON(data []byte) error
type Apiv2AccountOrderGetEstimatedFeeResponseFeeQuote ¶
type Apiv2AccountOrderGetEstimatedFeeResponseFeeQuote struct {
Deadline int64 `json:"deadline,required"`
Fee string `json:"fee,required" format:"bigint"`
OrderID string `json:"orderId,required" format:"bigint"`
Requester string `json:"requester,required" format:"eth_address"`
Timestamp int64 `json:"timestamp,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Deadline resp.Field
Fee resp.Field
OrderID resp.Field
Requester resp.Field
Timestamp resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
FeeQuote structure to pass into contracts
func (Apiv2AccountOrderGetEstimatedFeeResponseFeeQuote) RawJSON ¶
func (r Apiv2AccountOrderGetEstimatedFeeResponseFeeQuote) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountOrderGetEstimatedFeeResponseFeeQuote) UnmarshalJSON ¶
func (r *Apiv2AccountOrderGetEstimatedFeeResponseFeeQuote) UnmarshalJSON(data []byte) error
type Apiv2AccountWalletExternalGetNonceResponse ¶
type Apiv2AccountWalletExternalGetNonceResponse struct {
// Message to be signed by the wallet
Message string `json:"message,required"`
// Single-use identifier
Nonce string `json:"nonce,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Message resp.Field
Nonce resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Wallet connection message for Dinari-managed wallets
func (Apiv2AccountWalletExternalGetNonceResponse) RawJSON ¶
func (r Apiv2AccountWalletExternalGetNonceResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2AccountWalletExternalGetNonceResponse) UnmarshalJSON ¶
func (r *Apiv2AccountWalletExternalGetNonceResponse) UnmarshalJSON(data []byte) error
type Apiv2EntityKYCGetURLResponse ¶
type Apiv2EntityKYCGetURLResponse struct {
// URL of a managed KYC flow interface for the entity. This URL is unique per KYC
// attempt.
EmbedURL string `json:"embed_url,required"`
// Timestamp at which the KYC request will be expired
ExpirationDt time.Time `json:"expiration_dt,required" format:"date-time"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
EmbedURL resp.Field
ExpirationDt resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
URL for a managed KYC flow for the entity that can be shown in an iframe
func (Apiv2EntityKYCGetURLResponse) RawJSON ¶
func (r Apiv2EntityKYCGetURLResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2EntityKYCGetURLResponse) UnmarshalJSON ¶
func (r *Apiv2EntityKYCGetURLResponse) UnmarshalJSON(data []byte) error
type Apiv2EntityKYCUploadDocumentResponse ¶
type Apiv2EntityKYCUploadDocumentResponse struct {
// ID of the document
ID string `json:"id,required" format:"uuid"`
// Type of the document
//
// Any of "GOVERNMENT_ID", "SELFIE", "RESIDENCY", "UNKNOWN".
DocumentType KYCDocumentType `json:"document_type,required"`
// Filename of the document
Filename string `json:"filename,required"`
// URL to access the document. Expires in 1 hour
URL string `json:"url,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ID resp.Field
DocumentType resp.Field
Filename resp.Field
URL resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Document associated with KYC for an entity
func (Apiv2EntityKYCUploadDocumentResponse) RawJSON ¶
func (r Apiv2EntityKYCUploadDocumentResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2EntityKYCUploadDocumentResponse) UnmarshalJSON ¶
func (r *Apiv2EntityKYCUploadDocumentResponse) UnmarshalJSON(data []byte) error
type Apiv2GetHealthResponse ¶
type Apiv2GetHealthResponse struct {
// Status of server
Status string `json:"status,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Status resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Apiv2GetHealthResponse) RawJSON ¶
func (r Apiv2GetHealthResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2GetHealthResponse) UnmarshalJSON ¶
func (r *Apiv2GetHealthResponse) UnmarshalJSON(data []byte) error
type Apiv2MarketDataGetMarketHoursResponse ¶
type Apiv2MarketDataGetMarketHoursResponse struct {
// Whether or not the market is open
IsMarketOpen bool `json:"is_market_open,required"`
// Timestamp in ISO 8601 format at which the next session closes
NextSessionCloseDt time.Time `json:"next_session_close_dt,required" format:"date-time"`
// Timestamp in ISO 8601 format at which the next session opens
NextSessionOpenDt time.Time `json:"next_session_open_dt,required" format:"date-time"`
// Timestamp in ISO 8601 format at which the current session closes or null if the
// market is currently closed
CurrentSessionCloseDt time.Time `json:"current_session_close_dt" format:"date-time"`
// Timestamp in ISO 8601 format at which the current session opened or null if the
// market is currently closed
CurrentSessionOpenDt time.Time `json:"current_session_open_dt" format:"date-time"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
IsMarketOpen resp.Field
NextSessionCloseDt resp.Field
NextSessionOpenDt resp.Field
CurrentSessionCloseDt resp.Field
CurrentSessionOpenDt resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Apiv2MarketDataGetMarketHoursResponse) RawJSON ¶
func (r Apiv2MarketDataGetMarketHoursResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2MarketDataGetMarketHoursResponse) UnmarshalJSON ¶
func (r *Apiv2MarketDataGetMarketHoursResponse) UnmarshalJSON(data []byte) error
type Apiv2MarketDataStockGetDividendsResponse ¶
type Apiv2MarketDataStockGetDividendsResponse struct {
// Cash amount of the dividend per share owned.
CashAmount float64 `json:"cash_amount"`
// Currency in which the dividend is paid.
Currency string `json:"currency"`
// Date on which the dividend was announced.
DeclarationDate string `json:"declaration_date"`
// Type of dividend. Dividends that have been paid and/or are expected to be paid
// on consistent schedules are denoted as CD. Special Cash dividends that have been
// paid that are infrequent or unusual, and/or can not be expected to occur in the
// future are denoted as SC. Long-Term and Short-Term capital gain distributions
// are denoted as LT and ST, respectively.
DividendType string `json:"dividend_type"`
// Date on or after which a stock is traded without the right to receive the next
// dividend payment. (If you purchase a stock on or after the ex-dividend date, you
// will not receive the upcoming dividend.)
ExDividendDate string `json:"ex_dividend_date"`
// Frequency of the dividend. The following values are possible:
//
// 1 - Annual
//
// 2 - Semi-Annual
//
// 4 - Quarterly
//
// 12 - Monthly
//
// 52 - Weekly
//
// 365 - Daily
Frequency int64 `json:"frequency"`
// Date that the dividend is paid out.
PayDate string `json:"pay_date"`
// Date that the stock must be held to receive the dividend; set by the company.
RecordDate string `json:"record_date"`
// Ticker symbol of the stock.
Ticker string `json:"ticker"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
CashAmount resp.Field
Currency resp.Field
DeclarationDate resp.Field
DividendType resp.Field
ExDividendDate resp.Field
Frequency resp.Field
PayDate resp.Field
RecordDate resp.Field
Ticker resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Details of a dividend announcement for a stock.
func (Apiv2MarketDataStockGetDividendsResponse) RawJSON ¶
func (r Apiv2MarketDataStockGetDividendsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2MarketDataStockGetDividendsResponse) UnmarshalJSON ¶
func (r *Apiv2MarketDataStockGetDividendsResponse) UnmarshalJSON(data []byte) error
type Apiv2MarketDataStockGetHistoricalPricesResponse ¶
type Apiv2MarketDataStockGetHistoricalPricesResponse struct {
// Close price of the stock in the given time period.
Close float64 `json:"close,required"`
// Highest price of the stock in the given time period.
High float64 `json:"high,required"`
// Lowest price of the stock in the given time period.
Low float64 `json:"low,required"`
// Open price of the stock in the given time period.
Open float64 `json:"open,required"`
// The Unix timestamp in seconds for the start of the aggregate window.
Timestamp int64 `json:"timestamp,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Close resp.Field
High resp.Field
Low resp.Field
Open resp.Field
Timestamp resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Datapoint of historical price data for a stock.
func (Apiv2MarketDataStockGetHistoricalPricesResponse) RawJSON ¶
func (r Apiv2MarketDataStockGetHistoricalPricesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2MarketDataStockGetHistoricalPricesResponse) UnmarshalJSON ¶
func (r *Apiv2MarketDataStockGetHistoricalPricesResponse) UnmarshalJSON(data []byte) error
type Apiv2MarketDataStockGetNewsResponse ¶
type Apiv2MarketDataStockGetNewsResponse struct {
// URL of the news article
ArticleURL string `json:"article_url,required"`
// Description of the news article
Description string `json:"description,required"`
// URL of the image for the news article
ImageURL string `json:"image_url,required"`
// Timestamp when the article was published
PublishedDt time.Time `json:"published_dt,required" format:"date-time"`
// The publisher of the news article
Publisher string `json:"publisher,required"`
// The mobile friendly Accelerated Mobile Page (AMP) URL of the news article if
// available
AmpURL string `json:"amp_url"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ArticleURL resp.Field
Description resp.Field
ImageURL resp.Field
PublishedDt resp.Field
Publisher resp.Field
AmpURL resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
This represents a news article relating to a stock ticker symbol which includes a summary of the article and a link to the original source.
func (Apiv2MarketDataStockGetNewsResponse) RawJSON ¶
func (r Apiv2MarketDataStockGetNewsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2MarketDataStockGetNewsResponse) UnmarshalJSON ¶
func (r *Apiv2MarketDataStockGetNewsResponse) UnmarshalJSON(data []byte) error
type Apiv2MarketDataStockGetQuoteResponse ¶
type Apiv2MarketDataStockGetQuoteResponse struct {
// The ask price.
Price float64 `json:"price,required"`
StockID string `json:"stock_id,required" format:"bigint"`
// The change in price from the previous close.
Change float64 `json:"change"`
// The percentage change in price from the previous close.
ChangePercent float64 `json:"change_percent"`
// The close price for the stock in the given time period.
Close float64 `json:"close"`
// The highest price for the stock in the given time period
High float64 `json:"high"`
// The lowest price for the stock in the given time period.
Low float64 `json:"low"`
// The most recent close price of the ticker multiplied by weighted outstanding
// shares
MarketCap int64 `json:"market_cap"`
// The open price for the stock in the given time period.
Open float64 `json:"open"`
// The close price for the stock for the previous trading day.
PreviousClose float64 `json:"previous_close"`
// The trading volume of the stock in the given time period.
Volume float64 `json:"volume"`
WeightedSharesOutstanding int64 `json:"weighted_shares_outstanding"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Price resp.Field
StockID resp.Field
Change resp.Field
ChangePercent resp.Field
Close resp.Field
High resp.Field
Low resp.Field
MarketCap resp.Field
Open resp.Field
PreviousClose resp.Field
Volume resp.Field
WeightedSharesOutstanding resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Apiv2MarketDataStockGetQuoteResponse) RawJSON ¶
func (r Apiv2MarketDataStockGetQuoteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2MarketDataStockGetQuoteResponse) UnmarshalJSON ¶
func (r *Apiv2MarketDataStockGetQuoteResponse) UnmarshalJSON(data []byte) error
type Apiv2MarketDataStockListResponse ¶
type Apiv2MarketDataStockListResponse struct {
// Unique identifier for the stock
ID string `json:"id,required" format:"bigint"`
// Whether the stock allows for fractional trading. If it is not fractionable,
// Dinari only supports limit orders for the stock.
IsFractionable bool `json:"is_fractionable,required"`
// Stock Name
Name string `json:"name,required"`
// Ticker symbol of the stock
Symbol string `json:"symbol,required"`
// SEC Central Index Key. Refer to
// [this link](https://www.sec.gov/submit-filings/filer-support-resources/how-do-i-guides/understand-utilize-edgar-ciks-passphrases-access-codes)
Cik string `json:"cik,nullable"`
// Composite FIGI ID. Refer to [this link](https://www.openfigi.com/about/figi)
CompositeFigi string `json:"composite_figi,nullable"`
// CUSIP ID. Refer to [this link](https://www.cusip.com/identifiers.html)
Cusip string `json:"cusip,nullable"`
// Description of the company and what they do/offer.
Description string `json:"description,nullable"`
// Name of Stock for application display
DisplayName string `json:"display_name,nullable"`
// The URL of the logo of the stock. The preferred format is svg.
LogoURL string `json:"logo_url,nullable"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ID resp.Field
IsFractionable resp.Field
Name resp.Field
Symbol resp.Field
Cik resp.Field
CompositeFigi resp.Field
Cusip resp.Field
Description resp.Field
DisplayName resp.Field
LogoURL resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about stock available for trading.
func (Apiv2MarketDataStockListResponse) RawJSON ¶
func (r Apiv2MarketDataStockListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*Apiv2MarketDataStockListResponse) UnmarshalJSON ¶
func (r *Apiv2MarketDataStockListResponse) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
API APIService
}
Client creates a struct with services and top level methods that help with interacting with the dinari API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (DINARI_API_KEY, DINARI_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type Entity ¶
type Entity struct {
// Unique identifier for the entity
ID string `json:"id,required" format:"uuid"`
// Type of entity
//
// Any of "INDIVIDUAL", "ORGANIZATION".
EntityType EntityEntityType `json:"entity_type,required"`
// Indicates if Entity completed KYC
IsKYCComplete bool `json:"is_kyc_complete,required"`
// Name of Entity
Name string `json:"name"`
// Nationality of the entity
Nationality string `json:"nationality"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ID resp.Field
EntityType resp.Field
IsKYCComplete resp.Field
Name resp.Field
Nationality resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about an entity, which can be either an individual or an organization.
func (*Entity) UnmarshalJSON ¶
type EntityEntityType ¶
type EntityEntityType string
Type of entity
const ( EntityEntityTypeIndividual EntityEntityType = "INDIVIDUAL" EntityEntityTypeOrganization EntityEntityType = "ORGANIZATION" )
type KYCData ¶
type KYCData struct {
// ISO 3166-1 alpha 2 country code of citizenship or the country the organization
// is based out of.
CountryCode string `json:"country_code,required"`
// Last name of the person
LastName string `json:"last_name,required"`
// City of address. Not all international addresses use this attribute.
AddressCity string `json:"address_city"`
// ZIP or postal code of residence address. Not all international addresses use
// this attribute.
AddressPostalCode string `json:"address_postal_code"`
// Street name of address.
AddressStreet1 string `json:"address_street_1"`
// Extension of address, usually apartment or suite number.
AddressStreet2 string `json:"address_street_2"`
// State or subdivision of address. In the US, this should be the unabbreviated
// name. Not all international addresses use this attribute.
AddressSubdivision string `json:"address_subdivision"`
// Birth date of the individual
BirthDate time.Time `json:"birth_date" format:"date"`
// Email address
Email string `json:"email,nullable"`
// First name of the person, or name of the organization
FirstName string `json:"first_name,nullable"`
// Middle name of the user
MiddleName string `json:"middle_name,nullable"`
// ID number of the official tax document of the country the entity belongs to
TaxIDNumber string `json:"tax_id_number"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
CountryCode resp.Field
LastName resp.Field
AddressCity resp.Field
AddressPostalCode resp.Field
AddressStreet1 resp.Field
AddressStreet2 resp.Field
AddressSubdivision resp.Field
BirthDate resp.Field
Email resp.Field
FirstName resp.Field
MiddleName resp.Field
TaxIDNumber resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object consisting of KYC data for an entity
func (KYCData) ToParam ¶
func (r KYCData) ToParam() KYCDataParam
ToParam converts this KYCData to a KYCDataParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with KYCDataParam.IsOverridden()
func (*KYCData) UnmarshalJSON ¶
type KYCDataParam ¶
type KYCDataParam struct {
// ISO 3166-1 alpha 2 country code of citizenship or the country the organization
// is based out of.
CountryCode string `json:"country_code,required"`
// Last name of the person
LastName string `json:"last_name,required"`
// Email address
Email param.Opt[string] `json:"email,omitzero"`
// First name of the person, or name of the organization
FirstName param.Opt[string] `json:"first_name,omitzero"`
// Middle name of the user
MiddleName param.Opt[string] `json:"middle_name,omitzero"`
// City of address. Not all international addresses use this attribute.
AddressCity param.Opt[string] `json:"address_city,omitzero"`
// ZIP or postal code of residence address. Not all international addresses use
// this attribute.
AddressPostalCode param.Opt[string] `json:"address_postal_code,omitzero"`
// Street name of address.
AddressStreet1 param.Opt[string] `json:"address_street_1,omitzero"`
// Extension of address, usually apartment or suite number.
AddressStreet2 param.Opt[string] `json:"address_street_2,omitzero"`
// State or subdivision of address. In the US, this should be the unabbreviated
// name. Not all international addresses use this attribute.
AddressSubdivision param.Opt[string] `json:"address_subdivision,omitzero"`
// Birth date of the individual
BirthDate param.Opt[time.Time] `json:"birth_date,omitzero" format:"date"`
// ID number of the official tax document of the country the entity belongs to
TaxIDNumber param.Opt[string] `json:"tax_id_number,omitzero"`
// contains filtered or unexported fields
}
Object consisting of KYC data for an entity
The properties CountryCode, LastName are required.
func (KYCDataParam) IsPresent ¶
func (f KYCDataParam) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (KYCDataParam) MarshalJSON ¶
func (r KYCDataParam) MarshalJSON() (data []byte, err error)
type KYCDocumentType ¶
type KYCDocumentType string
const ( KYCDocumentTypeGovernmentID KYCDocumentType = "GOVERNMENT_ID" KYCDocumentTypeSelfie KYCDocumentType = "SELFIE" KYCDocumentTypeResidency KYCDocumentType = "RESIDENCY" KYCDocumentTypeUnknown KYCDocumentType = "UNKNOWN" )
type KYCInfo ¶
type KYCInfo struct {
// Unique identifier for the KYC check
ID string `json:"id,required" format:"bigint"`
// KYC status
//
// Any of "PASS", "FAIL", "PENDING", "INCOMPLETE".
Status KYCInfoStatus `json:"status,required"`
// Timestamp when the KYC was last checked
CheckedDt time.Time `json:"checked_dt" format:"date-time"`
// Object consisting of KYC data for an entity
Data KYCData `json:"data"`
// Name of the KYC provider that provided the KYC check
ProviderName string `json:"provider_name"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ID resp.Field
Status resp.Field
CheckedDt resp.Field
Data resp.Field
ProviderName resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
KYC information for an entity
func (*KYCInfo) UnmarshalJSON ¶
type KYCInfoStatus ¶
type KYCInfoStatus string
KYC status
const ( KYCInfoStatusPass KYCInfoStatus = "PASS" KYCInfoStatusFail KYCInfoStatus = "FAIL" KYCInfoStatusPending KYCInfoStatus = "PENDING" KYCInfoStatusIncomplete KYCInfoStatus = "INCOMPLETE" )
type LimitOrderRequestInputParam ¶
type LimitOrderRequestInputParam struct {
// Quantity of stock to trade. Must be a positive integer.
AssetQuantity int64 `json:"asset_quantity,required"`
// Price at which to execute the order. Must be a positive number with a precision
// of up to 2 decimal places.
LimitPrice float64 `json:"limit_price,required"`
// ID of stock, as returned by the `/stocks` endpoint, e.g. 1
StockID string `json:"stock_id,required" format:"bigint"`
// contains filtered or unexported fields
}
Input parameters for placing a limit order.
The properties AssetQuantity, LimitPrice, StockID are required.
func (LimitOrderRequestInputParam) IsPresent ¶
func (f LimitOrderRequestInputParam) IsPresent() bool
IsPresent returns true if the field's value is not omitted and not the JSON "null". To check if this field is omitted, use param.IsOmitted.
func (LimitOrderRequestInputParam) MarshalJSON ¶
func (r LimitOrderRequestInputParam) MarshalJSON() (data []byte, err error)
type Order ¶
type Order struct {
// Identifier of the order
ID string `json:"id,required" format:"uuid"`
// Total amount of assets involved
AssetTokenQuantity float64 `json:"asset_token_quantity,required"`
// Status of the order
//
// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
// "ESCROWED", "SUBMITTED", "CANCELLED", "FILLED", "REJECTED", "REQUIRING_CONTACT",
// "ERROR".
BrokerageOrderStatus OrderBrokerageOrderStatus `json:"brokerage_order_status,required"`
// Blockchain that transaction was run on
ChainID int64 `json:"chain_id,required"`
// Smart Contract address that order came from
OrderContractAddress string `json:"order_contract_address,required" format:"eth_address"`
// Indicates if order is a buy or sell
//
// Any of "BUY", "SELL".
OrderSide OrderOrderSide `json:"order_side,required"`
// Indicates how long order is valid
//
// Any of "DAY", "GTC", "IOC", "FOK".
OrderTif OrderOrderTif `json:"order_tif,required"`
// Transaction hash for the order
OrderTransactionHash string `json:"order_transaction_hash,required" format:"hex_string"`
// Indicates what type of order
//
// Any of "MARKET", "LIMIT".
OrderType OrderOrderType `json:"order_type,required"`
// Total amount of payment involved
PaymentTokenQuantity float64 `json:"payment_token_quantity,required"`
// Unique identifier of this Order generated by the order contract.
SmartContractOrderID string `json:"smart_contract_order_id,required"`
// Transaction hash for cancellation of order
CancelTransactionHash string `json:"cancel_transaction_hash" format:"hex_string"`
// List of fees associated with order
Fees []map[string]any `json:"fees"`
// Total amount of network fee taken in USD
NetworkFeeInUsd float64 `json:"network_fee_in_usd"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ID resp.Field
AssetTokenQuantity resp.Field
BrokerageOrderStatus resp.Field
ChainID resp.Field
OrderContractAddress resp.Field
OrderSide resp.Field
OrderTif resp.Field
OrderTransactionHash resp.Field
OrderType resp.Field
PaymentTokenQuantity resp.Field
SmartContractOrderID resp.Field
CancelTransactionHash resp.Field
Fees resp.Field
NetworkFeeInUsd resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Order) UnmarshalJSON ¶
type OrderBrokerageOrderStatus ¶
type OrderBrokerageOrderStatus string
Status of the order
const ( OrderBrokerageOrderStatusPendingSubmit OrderBrokerageOrderStatus = "PENDING_SUBMIT" OrderBrokerageOrderStatusPendingCancel OrderBrokerageOrderStatus = "PENDING_CANCEL" OrderBrokerageOrderStatusPendingEscrow OrderBrokerageOrderStatus = "PENDING_ESCROW" OrderBrokerageOrderStatusPendingFill OrderBrokerageOrderStatus = "PENDING_FILL" OrderBrokerageOrderStatusEscrowed OrderBrokerageOrderStatus = "ESCROWED" OrderBrokerageOrderStatusSubmitted OrderBrokerageOrderStatus = "SUBMITTED" OrderBrokerageOrderStatusCancelled OrderBrokerageOrderStatus = "CANCELLED" OrderBrokerageOrderStatusFilled OrderBrokerageOrderStatus = "FILLED" OrderBrokerageOrderStatusRejected OrderBrokerageOrderStatus = "REJECTED" OrderBrokerageOrderStatusRequiringContact OrderBrokerageOrderStatus = "REQUIRING_CONTACT" OrderBrokerageOrderStatusError OrderBrokerageOrderStatus = "ERROR" )
type OrderFulfillment ¶
type OrderFulfillment struct {
// Identifier of the order fulfillment
ID string `json:"id,required" format:"uuid"`
// Amount of asset token filled
AssetTokenFilled float64 `json:"asset_token_filled,required"`
// Amount of asset token spent
AssetTokenSpent float64 `json:"asset_token_spent,required"`
// Identifier of the order this fulfillment is for
OrderID string `json:"order_id,required" format:"uuid"`
// Amount of payment token filled
PaymentTokenFilled float64 `json:"payment_token_filled,required"`
// Amount of payment token spent
PaymentTokenSpent float64 `json:"payment_token_spent,required"`
// Time when transaction occurred
TransactionDt time.Time `json:"transaction_dt,required" format:"date-time"`
// Transaction hash for this fulfillment
TransactionHash string `json:"transaction_hash,required" format:"hex_string"`
// Fee amount of payment token spent
PaymentTokenFee float64 `json:"payment_token_fee"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ID resp.Field
AssetTokenFilled resp.Field
AssetTokenSpent resp.Field
OrderID resp.Field
PaymentTokenFilled resp.Field
PaymentTokenSpent resp.Field
TransactionDt resp.Field
TransactionHash resp.Field
PaymentTokenFee resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about a fulfillment of an order. An order may be fulfilled in multiple transactions.
func (OrderFulfillment) RawJSON ¶
func (r OrderFulfillment) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrderFulfillment) UnmarshalJSON ¶
func (r *OrderFulfillment) UnmarshalJSON(data []byte) error
type OrderOrderSide ¶
type OrderOrderSide string
Indicates if order is a buy or sell
const ( OrderOrderSideBuy OrderOrderSide = "BUY" OrderOrderSideSell OrderOrderSide = "SELL" )
type OrderOrderTif ¶
type OrderOrderTif string
Indicates how long order is valid
const ( OrderOrderTifDay OrderOrderTif = "DAY" OrderOrderTifGtc OrderOrderTif = "GTC" OrderOrderTifIoc OrderOrderTif = "IOC" OrderOrderTifFok OrderOrderTif = "FOK" )
type OrderOrderType ¶
type OrderOrderType string
Indicates what type of order
const ( OrderOrderTypeMarket OrderOrderType = "MARKET" OrderOrderTypeLimit OrderOrderType = "LIMIT" )
type OrderRequest ¶
type OrderRequest struct {
// ID of account placing the order
AccountID string `json:"account_id,required" format:"uuid"`
// Confirmation code of order request. This is the primary identifier for the
// `/order_requests` endpoint
ConfirmationCode string `json:"confirmation_code,required" format:"uuid"`
// Timestamp at which the order request was created.
CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
// Status of order request
//
// Any of "PENDING", "SUBMITTED", "ERROR", "CANCELLED".
Status OrderRequestStatus `json:"status,required"`
// ID of order created from the order request. This is the primary identifier for
// the `/orders` endpoint
OrderID string `json:"order_id" format:"uuid"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
AccountID resp.Field
ConfirmationCode resp.Field
CreatedDt resp.Field
Status resp.Field
OrderID resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Request to create an order
func (OrderRequest) RawJSON ¶
func (r OrderRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrderRequest) UnmarshalJSON ¶
func (r *OrderRequest) UnmarshalJSON(data []byte) error
type OrderRequestStatus ¶
type OrderRequestStatus string
Status of order request
const ( OrderRequestStatusPending OrderRequestStatus = "PENDING" OrderRequestStatusSubmitted OrderRequestStatus = "SUBMITTED" OrderRequestStatusError OrderRequestStatus = "ERROR" OrderRequestStatusCancelled OrderRequestStatus = "CANCELLED" )
type StockSplit ¶
type StockSplit struct {
// Unique identifier for the stock split
ID string `json:"id,required" format:"bigint"`
// Ex-date of the split (Eastern Time Zone). First day the stock trades at
// post-split prices. Typically is last in the process, and the main important date
// for investors.
ExDate time.Time `json:"ex_date,required" format:"date"`
// Payable date (Eastern Time Zone) of the split. Date when company will send out
// the new shares. Mainly for record keeping by brokerages, who forward the shares
// to eventual owners. Typically is second in the process.
PayableDate time.Time `json:"payable_date,required" format:"date"`
// Record date (Eastern Time Zone) of the split, for company to determine where to
// send their new shares. Mainly for record keeping by brokerages, who forward the
// shares to eventual owners. Typically is first in the process.
RecordDate time.Time `json:"record_date,required" format:"date"`
// The number of shares before the split. In a 10-for-1 split, this would be 1.
SplitFrom float64 `json:"split_from,required"`
// The number of shares after the split. In a 10-for-1 split, this would be 10.
SplitTo float64 `json:"split_to,required"`
// The status of Dinari's processing of the split. Stocks for which a split is
// `IN_PROGRESS` will not be available for trading.
//
// Any of "PENDING", "IN_PROGRESS", "COMPLETE".
Status StockSplitStatus `json:"status,required"`
// Reference to the id of the stock for this split
StockID string `json:"stock_id,required" format:"bigint"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
ID resp.Field
ExDate resp.Field
PayableDate resp.Field
RecordDate resp.Field
SplitFrom resp.Field
SplitTo resp.Field
Status resp.Field
StockID resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
StockSplit contains data for a stock split, including the stock id, the number of shares before and after the split, the record date, payable date, ex-date, and the status of the split.
func (StockSplit) RawJSON ¶
func (r StockSplit) RawJSON() string
Returns the unmodified JSON received from the API
func (*StockSplit) UnmarshalJSON ¶
func (r *StockSplit) UnmarshalJSON(data []byte) error
type StockSplitStatus ¶
type StockSplitStatus string
The status of Dinari's processing of the split. Stocks for which a split is `IN_PROGRESS` will not be available for trading.
const ( StockSplitStatusPending StockSplitStatus = "PENDING" StockSplitStatusInProgress StockSplitStatus = "IN_PROGRESS" StockSplitStatusComplete StockSplitStatus = "COMPLETE" )
type Wallet ¶
type Wallet struct {
// Address of the wallet
Address string `json:"address,required"`
// Indicates whether the wallet is flagged for AML violations
IsAmlFlagged bool `json:"is_aml_flagged,required"`
// Indicates whether the wallet is a Dinari-managed wallet
IsManagedWallet bool `json:"is_managed_wallet,required"`
// Metadata for the response, check the presence of optional fields with the
// [resp.Field.IsPresent] method.
JSON struct {
Address resp.Field
IsAmlFlagged resp.Field
IsManagedWallet resp.Field
ExtraFields map[string]resp.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about a digital wallet
func (*Wallet) UnmarshalJSON ¶
Source Files
¶
- aliases.go
- api.go
- apiv2.go
- apiv2account.go
- apiv2accountorder.go
- apiv2accountorderfulfillment.go
- apiv2accountorderrequest.go
- apiv2accountwallet.go
- apiv2accountwalletexternal.go
- apiv2entity.go
- apiv2entityaccount.go
- apiv2entitykyc.go
- apiv2marketdata.go
- apiv2marketdatastock.go
- apiv2marketdatastocksplit.go
- client.go
- field.go
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|