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 Account
- type BrokerageOrderStatus
- type Chain
- 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 CreateLimitOrderInputParam
- type Entity
- type EntityEntityType
- type Error
- type Fulfillment
- type KYCData
- type KYCDataParam
- type KYCDocument
- type KYCDocumentType
- type KYCInfo
- type KYCInfoStatus
- type Order
- type OrderRequest
- type OrderRequestStatus
- type OrderSide
- type OrderTif
- type OrderType
- type StockSplit
- type StockSplitStatus
- type V2AccountGetCashBalancesResponse
- type V2AccountGetDividendPaymentsParams
- type V2AccountGetDividendPaymentsResponse
- type V2AccountGetInterestPaymentsParams
- type V2AccountGetInterestPaymentsResponse
- type V2AccountGetPortfolioResponse
- type V2AccountGetPortfolioResponseAsset
- type V2AccountMintSandboxTokensParams
- type V2AccountOrderCancelParams
- type V2AccountOrderFulfillmentGetParams
- type V2AccountOrderFulfillmentQueryParams
- type V2AccountOrderFulfillmentService
- type V2AccountOrderGetFeeQuoteParams
- type V2AccountOrderGetFeeQuoteResponse
- type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObject
- type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFee
- type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFeeQuote
- type V2AccountOrderGetFulfillmentsParams
- type V2AccountOrderGetParams
- type V2AccountOrderListParams
- type V2AccountOrderRequestGetFeeQuoteParams
- type V2AccountOrderRequestGetFeeQuoteResponse
- type V2AccountOrderRequestGetParams
- type V2AccountOrderRequestListParams
- type V2AccountOrderRequestNewLimitBuyParams
- type V2AccountOrderRequestNewLimitSellParams
- type V2AccountOrderRequestNewMarketBuyParams
- type V2AccountOrderRequestNewMarketSellParams
- type V2AccountOrderRequestService
- func (r *V2AccountOrderRequestService) Get(ctx context.Context, orderRequestID string, ...) (res *OrderRequest, err error)
- func (r *V2AccountOrderRequestService) GetFeeQuote(ctx context.Context, accountID string, ...) (res *V2AccountOrderRequestGetFeeQuoteResponse, err error)
- func (r *V2AccountOrderRequestService) List(ctx context.Context, accountID string, query V2AccountOrderRequestListParams, ...) (res *[]OrderRequest, err error)
- func (r *V2AccountOrderRequestService) NewLimitBuy(ctx context.Context, accountID string, ...) (res *OrderRequest, err error)
- func (r *V2AccountOrderRequestService) NewLimitSell(ctx context.Context, accountID string, ...) (res *OrderRequest, err error)
- func (r *V2AccountOrderRequestService) NewMarketBuy(ctx context.Context, accountID string, ...) (res *OrderRequest, err error)
- func (r *V2AccountOrderRequestService) NewMarketSell(ctx context.Context, accountID string, ...) (res *OrderRequest, err error)
- type V2AccountOrderService
- func (r *V2AccountOrderService) Cancel(ctx context.Context, orderID string, body V2AccountOrderCancelParams, ...) (res *Order, err error)
- func (r *V2AccountOrderService) Get(ctx context.Context, orderID string, query V2AccountOrderGetParams, ...) (res *Order, err error)
- func (r *V2AccountOrderService) GetFeeQuote(ctx context.Context, accountID string, body V2AccountOrderGetFeeQuoteParams, ...) (res *V2AccountOrderGetFeeQuoteResponse, err error)
- func (r *V2AccountOrderService) GetFulfillments(ctx context.Context, orderID string, ...) (res *[]Fulfillment, err error)
- func (r *V2AccountOrderService) List(ctx context.Context, accountID string, query V2AccountOrderListParams, ...) (res *[]Order, err error)
- type V2AccountService
- func (r *V2AccountService) Deactivate(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
- func (r *V2AccountService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
- func (r *V2AccountService) GetCashBalances(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]V2AccountGetCashBalancesResponse, err error)
- func (r *V2AccountService) GetDividendPayments(ctx context.Context, accountID string, ...) (res *[]V2AccountGetDividendPaymentsResponse, err error)
- func (r *V2AccountService) GetInterestPayments(ctx context.Context, accountID string, ...) (res *[]V2AccountGetInterestPaymentsResponse, err error)
- func (r *V2AccountService) GetPortfolio(ctx context.Context, accountID string, opts ...option.RequestOption) (res *V2AccountGetPortfolioResponse, err error)
- func (r *V2AccountService) MintSandboxTokens(ctx context.Context, accountID string, body V2AccountMintSandboxTokensParams, ...) (err error)
- type V2AccountWalletExternalConnectParams
- type V2AccountWalletExternalGetNonceParams
- type V2AccountWalletExternalGetNonceResponse
- type V2AccountWalletExternalService
- type V2AccountWalletService
- type V2AccountWithdrawalGetParams
- type V2AccountWithdrawalListParams
- type V2AccountWithdrawalRequestGetParams
- type V2AccountWithdrawalRequestListParams
- type V2AccountWithdrawalRequestNewParams
- type V2AccountWithdrawalRequestService
- func (r *V2AccountWithdrawalRequestService) Get(ctx context.Context, withdrawalRequestID string, ...) (res *WithdrawalRequest, err error)
- func (r *V2AccountWithdrawalRequestService) List(ctx context.Context, accountID string, ...) (res *[]WithdrawalRequest, err error)
- func (r *V2AccountWithdrawalRequestService) New(ctx context.Context, accountID string, ...) (res *WithdrawalRequest, err error)
- type V2AccountWithdrawalService
- func (r *V2AccountWithdrawalService) Get(ctx context.Context, withdrawalID string, query V2AccountWithdrawalGetParams, ...) (res *Withdrawal, err error)
- func (r *V2AccountWithdrawalService) List(ctx context.Context, accountID string, query V2AccountWithdrawalListParams, ...) (res *[]Withdrawal, err error)
- type V2EntityAccountListParams
- type V2EntityAccountService
- type V2EntityKYCDocumentGetParams
- type V2EntityKYCDocumentService
- func (r *V2EntityKYCDocumentService) Get(ctx context.Context, kycID string, query V2EntityKYCDocumentGetParams, ...) (res *[]KYCDocument, err error)
- func (r *V2EntityKYCDocumentService) Upload(ctx context.Context, kycID string, params V2EntityKYCDocumentUploadParams, ...) (res *KYCDocument, err error)
- type V2EntityKYCDocumentUploadParams
- type V2EntityKYCNewManagedCheckResponse
- type V2EntityKYCService
- func (r *V2EntityKYCService) Get(ctx context.Context, entityID string, opts ...option.RequestOption) (res *KYCInfo, err error)
- func (r *V2EntityKYCService) NewManagedCheck(ctx context.Context, entityID string, opts ...option.RequestOption) (res *V2EntityKYCNewManagedCheckResponse, err error)
- func (r *V2EntityKYCService) Submit(ctx context.Context, entityID string, body V2EntityKYCSubmitParams, ...) (res *KYCInfo, err error)
- type V2EntityKYCSubmitParams
- type V2EntityNewParams
- type V2EntityService
- func (r *V2EntityService) GetByID(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Entity, err error)
- func (r *V2EntityService) GetCurrent(ctx context.Context, opts ...option.RequestOption) (res *Entity, err error)
- func (r *V2EntityService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Entity, err error)
- func (r *V2EntityService) New(ctx context.Context, body V2EntityNewParams, opts ...option.RequestOption) (res *Entity, err error)
- type V2MarketDataGetMarketHoursResponse
- type V2MarketDataService
- type V2MarketDataStockGetDividendsResponse
- type V2MarketDataStockGetHistoricalPricesParams
- type V2MarketDataStockGetHistoricalPricesParamsTimespan
- type V2MarketDataStockGetHistoricalPricesResponse
- type V2MarketDataStockGetNewsParams
- type V2MarketDataStockGetNewsResponse
- type V2MarketDataStockGetQuoteResponse
- type V2MarketDataStockListParams
- type V2MarketDataStockListResponse
- type V2MarketDataStockService
- func (r *V2MarketDataStockService) GetDividends(ctx context.Context, stockID string, opts ...option.RequestOption) (res *[]V2MarketDataStockGetDividendsResponse, err error)
- func (r *V2MarketDataStockService) GetHistoricalPrices(ctx context.Context, stockID string, ...) (res *[]V2MarketDataStockGetHistoricalPricesResponse, err error)
- func (r *V2MarketDataStockService) GetNews(ctx context.Context, stockID string, query V2MarketDataStockGetNewsParams, ...) (res *[]V2MarketDataStockGetNewsResponse, err error)
- func (r *V2MarketDataStockService) GetQuote(ctx context.Context, stockID string, opts ...option.RequestOption) (res *V2MarketDataStockGetQuoteResponse, err error)
- func (r *V2MarketDataStockService) List(ctx context.Context, query V2MarketDataStockListParams, ...) (res *[]V2MarketDataStockListResponse, err error)
- type V2MarketDataStockSplitListForStockParams
- type V2MarketDataStockSplitListParams
- type V2MarketDataStockSplitService
- type V2Service
- type Wallet
- type Withdrawal
- type WithdrawalRequest
- type WithdrawalRequestStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (DINARI_API_SECRET_KEY, DINARI_API_KEY_ID, DINARI_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Account ¶
type Account struct {
// Unique ID for the `Account`.
ID string `json:"id,required" format:"uuid"`
// Datetime when the `Account` was created. ISO 8601 timestamp.
CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
// ID 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"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedDt respjson.Field
EntityID respjson.Field
IsActive respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about an `Account` owned by an `Entity`.
func (*Account) UnmarshalJSON ¶
type BrokerageOrderStatus ¶
type BrokerageOrderStatus string
const ( BrokerageOrderStatusPendingSubmit BrokerageOrderStatus = "PENDING_SUBMIT" BrokerageOrderStatusPendingCancel BrokerageOrderStatus = "PENDING_CANCEL" BrokerageOrderStatusPendingEscrow BrokerageOrderStatus = "PENDING_ESCROW" BrokerageOrderStatusPendingFill BrokerageOrderStatus = "PENDING_FILL" BrokerageOrderStatusEscrowed BrokerageOrderStatus = "ESCROWED" BrokerageOrderStatusSubmitted BrokerageOrderStatus = "SUBMITTED" BrokerageOrderStatusCancelled BrokerageOrderStatus = "CANCELLED" BrokerageOrderStatusFilled BrokerageOrderStatus = "FILLED" BrokerageOrderStatusRejected BrokerageOrderStatus = "REJECTED" BrokerageOrderStatusRequiringContact BrokerageOrderStatus = "REQUIRING_CONTACT" BrokerageOrderStatusError BrokerageOrderStatus = "ERROR" )
type Chain ¶
type Chain string
const ( ChainEip155_1 Chain = "eip155:1" ChainEip155_42161 Chain = "eip155:42161" ChainEip155_8453 Chain = "eip155:8453" ChainEip155_81457 Chain = "eip155:81457" ChainEip155_7887 Chain = "eip155:7887" ChainEip155_98866 Chain = "eip155:98866" ChainEip155_11155111 Chain = "eip155:11155111" ChainEip155_421614 Chain = "eip155:421614" ChainEip155_84532 Chain = "eip155:84532" ChainEip155_168587773 Chain = "eip155:168587773" ChainEip155_98867 Chain = "eip155:98867" ChainEip155_31337 Chain = "eip155:31337" ChainEip155_1337 Chain = "eip155:1337" )
type Client ¶
type Client struct {
Options []option.RequestOption
V2 V2Service
}
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_SECRET_KEY, DINARI_API_KEY_ID, 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 CreateLimitOrderInputParam ¶
type CreateLimitOrderInputParam struct {
// Quantity of shares 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`.
StockID string `json:"stock_id,required" format:"uuid"`
// contains filtered or unexported fields
}
Input parameters for creating a limit `OrderRequest`.
The properties AssetQuantity, LimitPrice, StockID are required.
func (CreateLimitOrderInputParam) MarshalJSON ¶
func (r CreateLimitOrderInputParam) MarshalJSON() (data []byte, err error)
func (*CreateLimitOrderInputParam) UnmarshalJSON ¶
func (r *CreateLimitOrderInputParam) UnmarshalJSON(data []byte) error
type Entity ¶
type Entity struct {
// Unique ID of the `Entity`.
ID string `json:"id,required" format:"uuid"`
// Type of `Entity`. `ORGANIZATION` for Dinari Partners and `INDIVIDUAL` for their
// individual customers.
//
// 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 or home country of the `Entity`.
Nationality string `json:"nationality"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
EntityType respjson.Field
IsKYCComplete respjson.Field
Name respjson.Field
Nationality respjson.Field
ExtraFields map[string]respjson.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`. `ORGANIZATION` for Dinari Partners and `INDIVIDUAL` for their individual customers.
const ( EntityEntityTypeIndividual EntityEntityType = "INDIVIDUAL" EntityEntityTypeOrganization EntityEntityType = "ORGANIZATION" )
type Fulfillment ¶
type Fulfillment struct {
// ID of the `OrderFulfillment`.
ID string `json:"id,required" format:"uuid"`
// Amount of dShare asset token filled for `BUY` orders.
AssetTokenFilled float64 `json:"asset_token_filled,required"`
// Amount of dShare asset token spent for `SELL` orders.
AssetTokenSpent float64 `json:"asset_token_spent,required"`
// Blockchain that the transaction was run on.
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,required"`
// ID of the `Order` this `OrderFulfillment` is for.
OrderID string `json:"order_id,required" format:"uuid"`
// Amount of payment token filled for `SELL` orders.
PaymentTokenFilled float64 `json:"payment_token_filled,required"`
// Amount of payment token spent for `BUY` orders.
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, in payment tokens.
PaymentTokenFee float64 `json:"payment_token_fee"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetTokenFilled respjson.Field
AssetTokenSpent respjson.Field
ChainID respjson.Field
OrderID respjson.Field
PaymentTokenFilled respjson.Field
PaymentTokenSpent respjson.Field
TransactionDt respjson.Field
TransactionHash respjson.Field
PaymentTokenFee respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about a fulfillment of an `Order`. An order may be fulfilled in multiple transactions.
func (Fulfillment) RawJSON ¶
func (r Fulfillment) RawJSON() string
Returns the unmodified JSON received from the API
func (*Fulfillment) UnmarshalJSON ¶
func (r *Fulfillment) UnmarshalJSON(data []byte) error
type KYCData ¶
type KYCData struct {
// Country of citizenship or home country of the organization. ISO 3166-1 alpha 2
// country code.
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"`
// Postal code of residence address. Not all international addresses use this
// attribute.
AddressPostalCode string `json:"address_postal_code"`
// Street address 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 of the state. Not all international addresses use this attribute.
AddressSubdivision string `json:"address_subdivision"`
// Birth date of the individual. In ISO 8601 format, YYYY-MM-DD.
BirthDate time.Time `json:"birth_date" format:"date"`
// Email address.
Email string `json:"email"`
// First name of the person.
FirstName string `json:"first_name"`
// Middle name of the user
MiddleName string `json:"middle_name"`
// ID number of the official tax document of the country the entity belongs to.
TaxIDNumber string `json:"tax_id_number"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CountryCode respjson.Field
LastName respjson.Field
AddressCity respjson.Field
AddressPostalCode respjson.Field
AddressStreet1 respjson.Field
AddressStreet2 respjson.Field
AddressSubdivision respjson.Field
BirthDate respjson.Field
Email respjson.Field
FirstName respjson.Field
MiddleName respjson.Field
TaxIDNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
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.Overrides()
func (*KYCData) UnmarshalJSON ¶
type KYCDataParam ¶
type KYCDataParam struct {
// Country of citizenship or home country of the organization. ISO 3166-1 alpha 2
// country code.
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 param.Opt[string] `json:"address_city,omitzero"`
// Postal code of residence address. Not all international addresses use this
// attribute.
AddressPostalCode param.Opt[string] `json:"address_postal_code,omitzero"`
// Street address 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 of the state. Not all international addresses use this attribute.
AddressSubdivision param.Opt[string] `json:"address_subdivision,omitzero"`
// Birth date of the individual. In ISO 8601 format, YYYY-MM-DD.
BirthDate param.Opt[time.Time] `json:"birth_date,omitzero" format:"date"`
// Email address.
Email param.Opt[string] `json:"email,omitzero"`
// First name of the person.
FirstName param.Opt[string] `json:"first_name,omitzero"`
// Middle name of the user
MiddleName param.Opt[string] `json:"middle_name,omitzero"`
// 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
}
KYC data for an `Entity`.
The properties CountryCode, LastName are required.
func (KYCDataParam) MarshalJSON ¶
func (r KYCDataParam) MarshalJSON() (data []byte, err error)
func (*KYCDataParam) UnmarshalJSON ¶
func (r *KYCDataParam) UnmarshalJSON(data []byte) error
type KYCDocument ¶
type KYCDocument struct {
// ID of the document.
ID string `json:"id,required" format:"uuid"`
// Type of document.
//
// Any of "GOVERNMENT_ID", "SELFIE", "RESIDENCY", "UNKNOWN".
DocumentType KYCDocumentType `json:"document_type,required"`
// Filename of document.
Filename string `json:"filename,required"`
// Temporary URL to access the document. Expires in 1 hour.
URL string `json:"url,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
DocumentType respjson.Field
Filename respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A document associated with KYC for an `Entity`.
func (KYCDocument) RawJSON ¶
func (r KYCDocument) RawJSON() string
Returns the unmodified JSON received from the API
func (*KYCDocument) UnmarshalJSON ¶
func (r *KYCDocument) UnmarshalJSON(data []byte) 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 {
// ID of the KYC check.
ID string `json:"id,required" format:"uuid"`
// KYC check status.
//
// Any of "PASS", "FAIL", "PENDING", "INCOMPLETE".
Status KYCInfoStatus `json:"status,required"`
// Datetime when the KYC was last checked. ISO 8601 timestamp.
CheckedDt time.Time `json:"checked_dt" format:"date-time"`
// KYC data for an `Entity`.
Data KYCData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
CheckedDt respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
KYC information for an `Entity`.
func (*KYCInfo) UnmarshalJSON ¶
type KYCInfoStatus ¶
type KYCInfoStatus string
KYC check status.
const ( KYCInfoStatusPass KYCInfoStatus = "PASS" KYCInfoStatusFail KYCInfoStatus = "FAIL" KYCInfoStatusPending KYCInfoStatus = "PENDING" KYCInfoStatusIncomplete KYCInfoStatus = "INCOMPLETE" )
type Order ¶
type Order struct {
// ID of the `Order`.
ID string `json:"id,required" format:"uuid"`
// CAIP-2 formatted chain ID of the blockchain that the `Order` transaction was run
// on.
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,required"`
// Datetime at which the `Order` was created. ISO 8601 timestamp.
CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
// Smart contract address that `Order` was created from.
OrderContractAddress string `json:"order_contract_address,required" format:"eth_address"`
// Indicates whether `Order` is a buy or sell.
//
// Any of "BUY", "SELL".
OrderSide OrderSide `json:"order_side,required"`
// Time in force. Indicates how long `Order` is valid for.
//
// Any of "DAY", "GTC", "IOC", "FOK".
OrderTif OrderTif `json:"order_tif,required"`
// Transaction hash for the `Order` creation.
OrderTransactionHash string `json:"order_transaction_hash,required" format:"hex_string"`
// Type of `Order`.
//
// Any of "MARKET", "LIMIT".
OrderType OrderType `json:"order_type,required"`
// Status of the `Order`.
//
// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
// "ESCROWED", "SUBMITTED", "CANCELLED", "FILLED", "REJECTED", "REQUIRING_CONTACT",
// "ERROR".
Status BrokerageOrderStatus `json:"status,required"`
// The `Stock` ID associated with the `Order`
StockID string `json:"stock_id,required" format:"uuid"`
// The dShare asset token address.
AssetToken string `json:"asset_token" format:"eth_address"`
// Total amount of assets involved.
AssetTokenQuantity float64 `json:"asset_token_quantity"`
// Transaction hash for cancellation of `Order`, if the `Order` was cancelled.
CancelTransactionHash string `json:"cancel_transaction_hash" format:"hex_string"`
// Fee amount associated with `Order`.
Fee float64 `json:"fee"`
// For limit `Orders`, the price per asset, specified in the `Stock`'s native
// currency (USD for US equities and ETFs).
LimitPrice float64 `json:"limit_price"`
// The payment token (stablecoin) address.
PaymentToken string `json:"payment_token" format:"eth_address"`
// Total amount of payment involved.
PaymentTokenQuantity float64 `json:"payment_token_quantity"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ChainID respjson.Field
CreatedDt respjson.Field
OrderContractAddress respjson.Field
OrderSide respjson.Field
OrderTif respjson.Field
OrderTransactionHash respjson.Field
OrderType respjson.Field
Status respjson.Field
StockID respjson.Field
AssetToken respjson.Field
AssetTokenQuantity respjson.Field
CancelTransactionHash respjson.Field
Fee respjson.Field
LimitPrice respjson.Field
PaymentToken respjson.Field
PaymentTokenQuantity respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Order) UnmarshalJSON ¶
type OrderRequest ¶
type OrderRequest struct {
// ID of `OrderRequest`. This is the primary identifier for the `/order_requests`
// routes.
ID string `json:"id,required" format:"uuid"`
// ID of `Account` placing the `OrderRequest`.
AccountID string `json:"account_id,required" format:"uuid"`
// Datetime at which the `OrderRequest` was created. ISO 8601 timestamp.
CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
// Indicates whether `Order` is a buy or sell.
//
// Any of "BUY", "SELL".
OrderSide OrderSide `json:"order_side,required"`
// Indicates how long `Order` is valid for.
//
// Any of "DAY", "GTC", "IOC", "FOK".
OrderTif OrderTif `json:"order_tif,required"`
// Type of `Order`.
//
// Any of "MARKET", "LIMIT".
OrderType OrderType `json:"order_type,required"`
// Status of `OrderRequest`.
//
// Any of "PENDING", "SUBMITTED", "ERROR", "CANCELLED".
Status OrderRequestStatus `json:"status,required"`
// ID of `Order` created from the `OrderRequest`. This is the primary identifier
// for the `/orders` routes.
OrderID string `json:"order_id" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountID respjson.Field
CreatedDt respjson.Field
OrderSide respjson.Field
OrderTif respjson.Field
OrderType respjson.Field
Status respjson.Field
OrderID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A request to create an `Order`.
An `OrderRequest` is created when a user places an order through the Dinari API. The `OrderRequest` is then fulfilled by creating an `Order` on-chain.
The `OrderRequest` is a record of the user's intent to place an order, while the `Order` is the actual transaction that occurs on the blockchain.
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 `OrderRequest`.
const ( OrderRequestStatusPending OrderRequestStatus = "PENDING" OrderRequestStatusSubmitted OrderRequestStatus = "SUBMITTED" OrderRequestStatusError OrderRequestStatus = "ERROR" OrderRequestStatusCancelled OrderRequestStatus = "CANCELLED" )
type StockSplit ¶
type StockSplit struct {
// ID of the `StockSplit`
ID string `json:"id,required" format:"uuid"`
// Ex-date of the split in Eastern Time Zone. First day the stock trades at
// post-split prices. Typically is last date in the process, and the main important
// date for investors. In ISO 8601 format, YYYY-MM-DD.
ExDate time.Time `json:"ex_date,required" format:"date"`
// Payable date of the split in Eastern Time Zone. This is the date when company
// will send out the new shares. Mainly for record keeping by brokerages, who
// forward the shares to eventual owners. Typically is the second date in the
// process. In ISO 8601 format, YYYY-MM-DD.
PayableDate time.Time `json:"payable_date,required" format:"date"`
// Record date of the split in Eastern Time Zone, 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 the first date in the process. In ISO
// 8601 format, YYYY-MM-DD.
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 `StockSplit`. `Stocks` for which this
// status is `IN_PROGRESS` will not be available for trading.
//
// Any of "PENDING", "IN_PROGRESS", "COMPLETE".
Status StockSplitStatus `json:"status,required"`
// ID of the `Stock` whose shares are being split.
StockID string `json:"stock_id,required" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExDate respjson.Field
PayableDate respjson.Field
RecordDate respjson.Field
SplitFrom respjson.Field
SplitTo respjson.Field
Status respjson.Field
StockID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about 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 `StockSplit`. `Stocks` for which this status is `IN_PROGRESS` will not be available for trading.
const ( StockSplitStatusPending StockSplitStatus = "PENDING" StockSplitStatusInProgress StockSplitStatus = "IN_PROGRESS" StockSplitStatusComplete StockSplitStatus = "COMPLETE" )
type V2AccountGetCashBalancesResponse ¶
type V2AccountGetCashBalancesResponse struct {
// Total amount of the payment token in the `Account`.
Amount float64 `json:"amount,required"`
// CAIP-2 chain ID of the payment token.
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,required"`
// Symbol of the payment token.
Symbol string `json:"symbol,required"`
// Address of the payment token.
TokenAddress string `json:"token_address,required" format:"eth_address"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Amount respjson.Field
ChainID respjson.Field
Symbol respjson.Field
TokenAddress respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Balance of a payment token in an `Account`.
func (V2AccountGetCashBalancesResponse) RawJSON ¶
func (r V2AccountGetCashBalancesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountGetCashBalancesResponse) UnmarshalJSON ¶
func (r *V2AccountGetCashBalancesResponse) UnmarshalJSON(data []byte) error
type V2AccountGetDividendPaymentsParams ¶
type V2AccountGetDividendPaymentsParams struct {
// End date, exclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
EndDate time.Time `query:"end_date,required" format:"date" json:"-"`
// Start date, inclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
StartDate time.Time `query:"start_date,required" format:"date" json:"-"`
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// Optional ID of the `Stock` to filter by
StockID param.Opt[string] `query:"stock_id,omitzero" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountGetDividendPaymentsParams) URLQuery ¶
func (r V2AccountGetDividendPaymentsParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountGetDividendPaymentsParams's query parameters as `url.Values`.
type V2AccountGetDividendPaymentsResponse ¶
type V2AccountGetDividendPaymentsResponse 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. ISO 8601 format, YYYY-MM-DD.
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:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Amount respjson.Field
Currency respjson.Field
PaymentDate respjson.Field
StockID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Represents a dividend payment event for an `Account`.
func (V2AccountGetDividendPaymentsResponse) RawJSON ¶
func (r V2AccountGetDividendPaymentsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountGetDividendPaymentsResponse) UnmarshalJSON ¶
func (r *V2AccountGetDividendPaymentsResponse) UnmarshalJSON(data []byte) error
type V2AccountGetInterestPaymentsParams ¶
type V2AccountGetInterestPaymentsParams struct {
// End date, exclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
EndDate time.Time `query:"end_date,required" format:"date" json:"-"`
// Start date, inclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
StartDate time.Time `query:"start_date,required" format:"date" json:"-"`
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountGetInterestPaymentsParams) URLQuery ¶
func (r V2AccountGetInterestPaymentsParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountGetInterestPaymentsParams's query parameters as `url.Values`.
type V2AccountGetInterestPaymentsResponse ¶
type V2AccountGetInterestPaymentsResponse struct {
// Amount of interest paid.
Amount float64 `json:"amount,required"`
// Currency in which the interest was paid (e.g. USD).
Currency string `json:"currency,required"`
// Date of interest payment in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
PaymentDate time.Time `json:"payment_date,required" format:"date"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Amount respjson.Field
Currency respjson.Field
PaymentDate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An object representing an interest payment from stablecoin holdings.
func (V2AccountGetInterestPaymentsResponse) RawJSON ¶
func (r V2AccountGetInterestPaymentsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountGetInterestPaymentsResponse) UnmarshalJSON ¶
func (r *V2AccountGetInterestPaymentsResponse) UnmarshalJSON(data []byte) error
type V2AccountGetPortfolioResponse ¶
type V2AccountGetPortfolioResponse struct {
// Balance details for all owned `Stocks`.
Assets []V2AccountGetPortfolioResponseAsset `json:"assets,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Assets respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Balance information of `Stock` assets in your `Account`.
func (V2AccountGetPortfolioResponse) RawJSON ¶
func (r V2AccountGetPortfolioResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountGetPortfolioResponse) UnmarshalJSON ¶
func (r *V2AccountGetPortfolioResponse) UnmarshalJSON(data []byte) error
type V2AccountGetPortfolioResponseAsset ¶
type V2AccountGetPortfolioResponseAsset struct {
// Total amount of the dShare asset token in the `Account`.
Amount float64 `json:"amount,required"`
// CAIP-2 chain ID of the blockchain where the dShare asset token exists.
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,required"`
// ID of the underlying `Stock` represented by the dShare asset token.
StockID string `json:"stock_id,required" format:"uuid"`
// Token symbol of the dShare asset token.
Symbol string `json:"symbol,required"`
// Address of the dShare asset token.
TokenAddress string `json:"token_address,required" format:"eth_address"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Amount respjson.Field
ChainID respjson.Field
StockID respjson.Field
Symbol respjson.Field
TokenAddress respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Balance of a dShare in an `Account`.
func (V2AccountGetPortfolioResponseAsset) RawJSON ¶
func (r V2AccountGetPortfolioResponseAsset) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountGetPortfolioResponseAsset) UnmarshalJSON ¶
func (r *V2AccountGetPortfolioResponseAsset) UnmarshalJSON(data []byte) error
type V2AccountMintSandboxTokensParams ¶
type V2AccountMintSandboxTokensParams struct {
// CAIP-2 chain ID of blockchain in which to mint the sandbox payment tokens. If
// none specified, defaults to eip155:421614. If the `Account` is linked to a
// Dinari-managed `Wallet`, only eip155:42161 is allowed.
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,omitzero"`
// contains filtered or unexported fields
}
func (V2AccountMintSandboxTokensParams) MarshalJSON ¶
func (r V2AccountMintSandboxTokensParams) MarshalJSON() (data []byte, err error)
func (*V2AccountMintSandboxTokensParams) UnmarshalJSON ¶
func (r *V2AccountMintSandboxTokensParams) UnmarshalJSON(data []byte) error
type V2AccountOrderCancelParams ¶
type V2AccountOrderCancelParams struct {
AccountID string `path:"account_id,required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type V2AccountOrderFulfillmentGetParams ¶
type V2AccountOrderFulfillmentGetParams struct {
AccountID string `path:"account_id,required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type V2AccountOrderFulfillmentQueryParams ¶
type V2AccountOrderFulfillmentQueryParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// List of `Order` IDs to query `OrderFulfillments` for.
OrderIDs []string `query:"order_ids,omitzero" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountOrderFulfillmentQueryParams) URLQuery ¶
func (r V2AccountOrderFulfillmentQueryParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountOrderFulfillmentQueryParams's query parameters as `url.Values`.
type V2AccountOrderFulfillmentService ¶
type V2AccountOrderFulfillmentService struct {
Options []option.RequestOption
}
V2AccountOrderFulfillmentService 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 NewV2AccountOrderFulfillmentService method instead.
func NewV2AccountOrderFulfillmentService ¶
func NewV2AccountOrderFulfillmentService(opts ...option.RequestOption) (r V2AccountOrderFulfillmentService)
NewV2AccountOrderFulfillmentService 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 (*V2AccountOrderFulfillmentService) Get ¶
func (r *V2AccountOrderFulfillmentService) Get(ctx context.Context, orderFulfillmentID string, query V2AccountOrderFulfillmentGetParams, opts ...option.RequestOption) (res *Fulfillment, err error)
Get a specific `OrderFulfillment` by its ID.
func (*V2AccountOrderFulfillmentService) Query ¶
func (r *V2AccountOrderFulfillmentService) Query(ctx context.Context, accountID string, query V2AccountOrderFulfillmentQueryParams, opts ...option.RequestOption) (res *[]Fulfillment, err error)
Query `OrderFulfillments` under the `Account`.
type V2AccountOrderGetFeeQuoteParams ¶
type V2AccountOrderGetFeeQuoteParams struct {
// CAIP-2 chain ID of the blockchain where the `Order` will be placed.
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,omitzero,required"`
// Address of the smart contract that will create the `Order`.
ContractAddress string `json:"contract_address,required" format:"eth_address"`
// Indicates whether `Order` is a buy or sell.
//
// Any of "BUY", "SELL".
OrderSide OrderSide `json:"order_side,omitzero,required"`
// Time in force. Indicates how long `Order` is valid for.
//
// Any of "DAY", "GTC", "IOC", "FOK".
OrderTif OrderTif `json:"order_tif,omitzero,required"`
// Type of `Order`.
//
// Any of "MARKET", "LIMIT".
OrderType OrderType `json:"order_type,omitzero,required"`
// The Stock ID associated with the Order
StockID string `json:"stock_id,required" format:"uuid"`
// Amount of dShare asset tokens involved. Required for limit `Orders` and market
// sell `Orders`.
AssetTokenQuantity param.Opt[float64] `json:"asset_token_quantity,omitzero"`
// Price per asset in the asset's native currency. USD for US equities and ETFs.
// Required for limit `Orders`.
LimitPrice param.Opt[float64] `json:"limit_price,omitzero"`
// Address of payment token.
PaymentToken param.Opt[string] `json:"payment_token,omitzero" format:"eth_address"`
// Amount of payment tokens involved. Required for market buy `Orders`.
PaymentTokenQuantity param.Opt[float64] `json:"payment_token_quantity,omitzero"`
// contains filtered or unexported fields
}
func (V2AccountOrderGetFeeQuoteParams) MarshalJSON ¶
func (r V2AccountOrderGetFeeQuoteParams) MarshalJSON() (data []byte, err error)
func (*V2AccountOrderGetFeeQuoteParams) UnmarshalJSON ¶
func (r *V2AccountOrderGetFeeQuoteParams) UnmarshalJSON(data []byte) error
type V2AccountOrderGetFeeQuoteResponse ¶
type V2AccountOrderGetFeeQuoteResponse struct {
// CAIP-2 chain ID of the blockchain where the `Order` will be placed
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,required"`
// The total quantity of the fees paid via payment token.
Fee float64 `json:"fee,required"`
// Opaque fee quote object to pass into the contract when creating an `Order`
// directly through Dinari's smart contracts.
OrderFeeContractObject V2AccountOrderGetFeeQuoteResponseOrderFeeContractObject `json:"order_fee_contract_object,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChainID respjson.Field
Fee respjson.Field
OrderFeeContractObject respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (V2AccountOrderGetFeeQuoteResponse) RawJSON ¶
func (r V2AccountOrderGetFeeQuoteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountOrderGetFeeQuoteResponse) UnmarshalJSON ¶
func (r *V2AccountOrderGetFeeQuoteResponse) UnmarshalJSON(data []byte) error
type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObject ¶
type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObject struct {
// EVM chain ID where the order is placed
ChainID int64 `json:"chain_id,required"`
// `FeeQuote` structure to pass into contracts.
FeeQuote V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFeeQuote `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 []V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFee `json:"fees,required"`
// Address of payment token used for fees
PaymentToken string `json:"payment_token,required" format:"eth_address"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChainID respjson.Field
FeeQuote respjson.Field
FeeQuoteSignature respjson.Field
Fees respjson.Field
PaymentToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Opaque fee quote object to pass into the contract when creating an `Order` directly through Dinari's smart contracts.
func (V2AccountOrderGetFeeQuoteResponseOrderFeeContractObject) RawJSON ¶
func (r V2AccountOrderGetFeeQuoteResponseOrderFeeContractObject) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountOrderGetFeeQuoteResponseOrderFeeContractObject) UnmarshalJSON ¶
func (r *V2AccountOrderGetFeeQuoteResponseOrderFeeContractObject) UnmarshalJSON(data []byte) error
type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFee ¶
type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFee struct {
// The quantity of the fee paid via payment token in
// [ETH](https://ethereum.org/en/developers/docs/intro-to-ether/#what-is-ether).
FeeInEth float64 `json:"fee_in_eth,required"`
// The quantity of the fee paid via payment token in
// [wei](https://ethereum.org/en/developers/docs/intro-to-ether/#denominations).
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"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FeeInEth respjson.Field
FeeInWei respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFee) RawJSON ¶
func (r V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFee) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFee) UnmarshalJSON ¶
func (r *V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFee) UnmarshalJSON(data []byte) error
type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFeeQuote ¶
type V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFeeQuote 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"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Deadline respjson.Field
Fee respjson.Field
OrderID respjson.Field
Requester respjson.Field
Timestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
`FeeQuote` structure to pass into contracts.
func (V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFeeQuote) RawJSON ¶
func (r V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFeeQuote) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFeeQuote) UnmarshalJSON ¶
func (r *V2AccountOrderGetFeeQuoteResponseOrderFeeContractObjectFeeQuote) UnmarshalJSON(data []byte) error
type V2AccountOrderGetFulfillmentsParams ¶
type V2AccountOrderGetFulfillmentsParams struct {
AccountID string `path:"account_id,required" format:"uuid" json:"-"`
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountOrderGetFulfillmentsParams) URLQuery ¶
func (r V2AccountOrderGetFulfillmentsParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountOrderGetFulfillmentsParams's query parameters as `url.Values`.
type V2AccountOrderGetParams ¶
type V2AccountOrderGetParams struct {
AccountID string `path:"account_id,required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type V2AccountOrderListParams ¶
type V2AccountOrderListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountOrderListParams) URLQuery ¶
func (r V2AccountOrderListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountOrderListParams's query parameters as `url.Values`.
type V2AccountOrderRequestGetFeeQuoteParams ¶
type V2AccountOrderRequestGetFeeQuoteParams struct {
// Indicates whether `Order Request` is a buy or sell.
//
// Any of "BUY", "SELL".
OrderSide OrderSide `json:"order_side,omitzero,required"`
// Type of `Order Request`.
//
// Any of "MARKET", "LIMIT".
OrderType OrderType `json:"order_type,omitzero,required"`
// The Stock ID associated with the Order Request
StockID string `json:"stock_id,required" format:"uuid"`
// Amount of dShare asset tokens involved. Required for limit `Orders` and market
// sell `Order Requests`.
AssetTokenQuantity param.Opt[float64] `json:"asset_token_quantity,omitzero"`
// Price per asset in the asset's native currency. USD for US equities and ETFs.
// Required for limit `Order Requests`.
LimitPrice param.Opt[float64] `json:"limit_price,omitzero"`
// Amount of payment tokens involved. Required for market buy `Order Requests`.
PaymentTokenQuantity param.Opt[float64] `json:"payment_token_quantity,omitzero"`
// contains filtered or unexported fields
}
func (V2AccountOrderRequestGetFeeQuoteParams) MarshalJSON ¶
func (r V2AccountOrderRequestGetFeeQuoteParams) MarshalJSON() (data []byte, err error)
func (*V2AccountOrderRequestGetFeeQuoteParams) UnmarshalJSON ¶
func (r *V2AccountOrderRequestGetFeeQuoteParams) UnmarshalJSON(data []byte) error
type V2AccountOrderRequestGetFeeQuoteResponse ¶
type V2AccountOrderRequestGetFeeQuoteResponse struct {
// Cash amount in USD paid for fees for the Order Request.
Fee float64 `json:"fee,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Fee respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A preview of the fee that would be collected when placing an Order Request.
func (V2AccountOrderRequestGetFeeQuoteResponse) RawJSON ¶
func (r V2AccountOrderRequestGetFeeQuoteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountOrderRequestGetFeeQuoteResponse) UnmarshalJSON ¶
func (r *V2AccountOrderRequestGetFeeQuoteResponse) UnmarshalJSON(data []byte) error
type V2AccountOrderRequestGetParams ¶
type V2AccountOrderRequestGetParams struct {
AccountID string `path:"account_id,required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type V2AccountOrderRequestListParams ¶
type V2AccountOrderRequestListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountOrderRequestListParams) URLQuery ¶
func (r V2AccountOrderRequestListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountOrderRequestListParams's query parameters as `url.Values`.
type V2AccountOrderRequestNewLimitBuyParams ¶
type V2AccountOrderRequestNewLimitBuyParams struct {
// Input parameters for creating a limit `OrderRequest`.
CreateLimitOrderInput CreateLimitOrderInputParam
// contains filtered or unexported fields
}
func (V2AccountOrderRequestNewLimitBuyParams) MarshalJSON ¶
func (r V2AccountOrderRequestNewLimitBuyParams) MarshalJSON() (data []byte, err error)
func (*V2AccountOrderRequestNewLimitBuyParams) UnmarshalJSON ¶
func (r *V2AccountOrderRequestNewLimitBuyParams) UnmarshalJSON(data []byte) error
type V2AccountOrderRequestNewLimitSellParams ¶
type V2AccountOrderRequestNewLimitSellParams struct {
// Input parameters for creating a limit `OrderRequest`.
CreateLimitOrderInput CreateLimitOrderInputParam
// contains filtered or unexported fields
}
func (V2AccountOrderRequestNewLimitSellParams) MarshalJSON ¶
func (r V2AccountOrderRequestNewLimitSellParams) MarshalJSON() (data []byte, err error)
func (*V2AccountOrderRequestNewLimitSellParams) UnmarshalJSON ¶
func (r *V2AccountOrderRequestNewLimitSellParams) UnmarshalJSON(data []byte) error
type V2AccountOrderRequestNewMarketBuyParams ¶
type V2AccountOrderRequestNewMarketBuyParams struct {
// Amount of currency (USD for US equities and ETFS) 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`.
StockID string `json:"stock_id,required" format:"uuid"`
// contains filtered or unexported fields
}
func (V2AccountOrderRequestNewMarketBuyParams) MarshalJSON ¶
func (r V2AccountOrderRequestNewMarketBuyParams) MarshalJSON() (data []byte, err error)
func (*V2AccountOrderRequestNewMarketBuyParams) UnmarshalJSON ¶
func (r *V2AccountOrderRequestNewMarketBuyParams) UnmarshalJSON(data []byte) error
type V2AccountOrderRequestNewMarketSellParams ¶
type V2AccountOrderRequestNewMarketSellParams struct {
// Quantity of shares 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`.
StockID string `json:"stock_id,required" format:"uuid"`
// contains filtered or unexported fields
}
func (V2AccountOrderRequestNewMarketSellParams) MarshalJSON ¶
func (r V2AccountOrderRequestNewMarketSellParams) MarshalJSON() (data []byte, err error)
func (*V2AccountOrderRequestNewMarketSellParams) UnmarshalJSON ¶
func (r *V2AccountOrderRequestNewMarketSellParams) UnmarshalJSON(data []byte) error
type V2AccountOrderRequestService ¶
type V2AccountOrderRequestService struct {
Options []option.RequestOption
}
V2AccountOrderRequestService 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 NewV2AccountOrderRequestService method instead.
func NewV2AccountOrderRequestService ¶
func NewV2AccountOrderRequestService(opts ...option.RequestOption) (r V2AccountOrderRequestService)
NewV2AccountOrderRequestService 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 (*V2AccountOrderRequestService) Get ¶
func (r *V2AccountOrderRequestService) Get(ctx context.Context, orderRequestID string, query V2AccountOrderRequestGetParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Get a specific managed `OrderRequest` by its ID.
func (*V2AccountOrderRequestService) GetFeeQuote ¶
func (r *V2AccountOrderRequestService) GetFeeQuote(ctx context.Context, accountID string, body V2AccountOrderRequestGetFeeQuoteParams, opts ...option.RequestOption) (res *V2AccountOrderRequestGetFeeQuoteResponse, err error)
Get fee quote data for an `Order Request`.
func (*V2AccountOrderRequestService) List ¶
func (r *V2AccountOrderRequestService) List(ctx context.Context, accountID string, query V2AccountOrderRequestListParams, opts ...option.RequestOption) (res *[]OrderRequest, err error)
Lists managed `OrderRequests`.
func (*V2AccountOrderRequestService) NewLimitBuy ¶
func (r *V2AccountOrderRequestService) NewLimitBuy(ctx context.Context, accountID string, body V2AccountOrderRequestNewLimitBuyParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Create a managed limit buy `OrderRequest`.
func (*V2AccountOrderRequestService) NewLimitSell ¶
func (r *V2AccountOrderRequestService) NewLimitSell(ctx context.Context, accountID string, body V2AccountOrderRequestNewLimitSellParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Create a managed limit sell `OrderRequest`.
func (*V2AccountOrderRequestService) NewMarketBuy ¶
func (r *V2AccountOrderRequestService) NewMarketBuy(ctx context.Context, accountID string, body V2AccountOrderRequestNewMarketBuyParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Create a managed market buy `OrderRequest`.
func (*V2AccountOrderRequestService) NewMarketSell ¶
func (r *V2AccountOrderRequestService) NewMarketSell(ctx context.Context, accountID string, body V2AccountOrderRequestNewMarketSellParams, opts ...option.RequestOption) (res *OrderRequest, err error)
Create a managed market sell `OrderRequest`.
type V2AccountOrderService ¶
type V2AccountOrderService struct {
Options []option.RequestOption
}
V2AccountOrderService 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 NewV2AccountOrderService method instead.
func NewV2AccountOrderService ¶
func NewV2AccountOrderService(opts ...option.RequestOption) (r V2AccountOrderService)
NewV2AccountOrderService 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 (*V2AccountOrderService) Cancel ¶
func (r *V2AccountOrderService) Cancel(ctx context.Context, orderID string, body V2AccountOrderCancelParams, opts ...option.RequestOption) (res *Order, err error)
Cancel an `Order` by its ID. Note that this requires the `Order` ID, not the `OrderRequest` ID. Once you submit a cancellation request, it cannot be undone. Be advised that orders with a status of PENDING_FILL, PENDING_ESCROW, FILLED, REJECTED, or CANCELLED cannot be cancelled.
`Order` cancellation is not guaranteed nor is it immediate. The `Order` may still be executed if the cancellation request is not received in time.
Check the status using the "Get Order by ID" endpoint to confirm whether the `Order` has been cancelled.
func (*V2AccountOrderService) Get ¶
func (r *V2AccountOrderService) Get(ctx context.Context, orderID string, query V2AccountOrderGetParams, opts ...option.RequestOption) (res *Order, err error)
Get a specific `Order` by its ID.
func (*V2AccountOrderService) GetFeeQuote ¶
func (r *V2AccountOrderService) GetFeeQuote(ctx context.Context, accountID string, body V2AccountOrderGetFeeQuoteParams, opts ...option.RequestOption) (res *V2AccountOrderGetFeeQuoteResponse, err error)
Get fee quote data for an `Order`.
The `order_fee_contract_object` property contains the fee quote structure to be used verbatim when placing an `Order` directly through our Contracts.
func (*V2AccountOrderService) GetFulfillments ¶
func (r *V2AccountOrderService) GetFulfillments(ctx context.Context, orderID string, params V2AccountOrderGetFulfillmentsParams, opts ...option.RequestOption) (res *[]Fulfillment, err error)
Get `OrderFulfillments` for a specific `Order`.
func (*V2AccountOrderService) List ¶
func (r *V2AccountOrderService) List(ctx context.Context, accountID string, query V2AccountOrderListParams, opts ...option.RequestOption) (res *[]Order, err error)
Get a list of all `Orders` under the `Account`.
type V2AccountService ¶
type V2AccountService struct {
Options []option.RequestOption
Wallet V2AccountWalletService
Orders V2AccountOrderService
OrderFulfillments V2AccountOrderFulfillmentService
OrderRequests V2AccountOrderRequestService
WithdrawalRequests V2AccountWithdrawalRequestService
Withdrawals V2AccountWithdrawalService
}
V2AccountService 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 NewV2AccountService method instead.
func NewV2AccountService ¶
func NewV2AccountService(opts ...option.RequestOption) (r V2AccountService)
NewV2AccountService 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 (*V2AccountService) Deactivate ¶
func (r *V2AccountService) Deactivate(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
Set the `Account` to be inactive. Inactive accounts cannot be used for trading.
func (*V2AccountService) Get ¶
func (r *V2AccountService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)
Get a specific `Account` by its ID.
func (*V2AccountService) GetCashBalances ¶
func (r *V2AccountService) GetCashBalances(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]V2AccountGetCashBalancesResponse, err error)
Get the cash balances of the `Account`, including stablecoins and other cash equivalents.
func (*V2AccountService) GetDividendPayments ¶
func (r *V2AccountService) GetDividendPayments(ctx context.Context, accountID string, query V2AccountGetDividendPaymentsParams, opts ...option.RequestOption) (res *[]V2AccountGetDividendPaymentsResponse, err error)
Get dividend payments made to the `Account` from dividend-bearing stock holdings.
func (*V2AccountService) GetInterestPayments ¶
func (r *V2AccountService) GetInterestPayments(ctx context.Context, accountID string, query V2AccountGetInterestPaymentsParams, opts ...option.RequestOption) (res *[]V2AccountGetInterestPaymentsResponse, err error)
Get interest payments made to the `Account` from yield-bearing cash holdings.
Currently, the only yield-bearing stablecoin accepted by Dinari is [USD+](https://usd.dinari.com/).
func (*V2AccountService) GetPortfolio ¶
func (r *V2AccountService) GetPortfolio(ctx context.Context, accountID string, opts ...option.RequestOption) (res *V2AccountGetPortfolioResponse, err error)
Get the portfolio of the `Account`, excluding cash equivalents such as stablecoins.
func (*V2AccountService) MintSandboxTokens ¶
func (r *V2AccountService) MintSandboxTokens(ctx context.Context, accountID string, body V2AccountMintSandboxTokensParams, opts ...option.RequestOption) (err error)
Mints 1,000 mockUSD sandbox payment tokens to the `Wallet` connected to the `Account`.
This feature is only supported in sandbox mode.
type V2AccountWalletExternalConnectParams ¶
type V2AccountWalletExternalConnectParams struct {
// CAIP-2 formatted chain ID of the blockchain the `Wallet` to link is on.
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,omitzero,required"`
// Nonce contained within the connection message.
Nonce string `json:"nonce,required" format:"uuid"`
// Signature payload from signing the 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 (V2AccountWalletExternalConnectParams) MarshalJSON ¶
func (r V2AccountWalletExternalConnectParams) MarshalJSON() (data []byte, err error)
func (*V2AccountWalletExternalConnectParams) UnmarshalJSON ¶
func (r *V2AccountWalletExternalConnectParams) UnmarshalJSON(data []byte) error
type V2AccountWalletExternalGetNonceParams ¶
type V2AccountWalletExternalGetNonceParams struct {
// Address of the `Wallet` to connect.
WalletAddress string `query:"wallet_address,required" format:"eth_address" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountWalletExternalGetNonceParams) URLQuery ¶
func (r V2AccountWalletExternalGetNonceParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountWalletExternalGetNonceParams's query parameters as `url.Values`.
type V2AccountWalletExternalGetNonceResponse ¶
type V2AccountWalletExternalGetNonceResponse struct {
// Message to be signed by the `Wallet`
Message string `json:"message,required"`
// Single-use identifier
Nonce string `json:"nonce,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Nonce respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Connection message to sign to prove ownership of the `Wallet`.
func (V2AccountWalletExternalGetNonceResponse) RawJSON ¶
func (r V2AccountWalletExternalGetNonceResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2AccountWalletExternalGetNonceResponse) UnmarshalJSON ¶
func (r *V2AccountWalletExternalGetNonceResponse) UnmarshalJSON(data []byte) error
type V2AccountWalletExternalService ¶
type V2AccountWalletExternalService struct {
Options []option.RequestOption
}
V2AccountWalletExternalService 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 NewV2AccountWalletExternalService method instead.
func NewV2AccountWalletExternalService ¶
func NewV2AccountWalletExternalService(opts ...option.RequestOption) (r V2AccountWalletExternalService)
NewV2AccountWalletExternalService 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 (*V2AccountWalletExternalService) Connect ¶
func (r *V2AccountWalletExternalService) Connect(ctx context.Context, accountID string, body V2AccountWalletExternalConnectParams, opts ...option.RequestOption) (res *Wallet, err error)
Connect a `Wallet` to the `Account` after verifying the signature.
func (*V2AccountWalletExternalService) GetNonce ¶
func (r *V2AccountWalletExternalService) GetNonce(ctx context.Context, accountID string, query V2AccountWalletExternalGetNonceParams, opts ...option.RequestOption) (res *V2AccountWalletExternalGetNonceResponse, err error)
Get a nonce and message to be signed in order to verify `Wallet` ownership.
type V2AccountWalletService ¶
type V2AccountWalletService struct {
Options []option.RequestOption
External V2AccountWalletExternalService
}
V2AccountWalletService 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 NewV2AccountWalletService method instead.
func NewV2AccountWalletService ¶
func NewV2AccountWalletService(opts ...option.RequestOption) (r V2AccountWalletService)
NewV2AccountWalletService 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 (*V2AccountWalletService) Get ¶
func (r *V2AccountWalletService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Wallet, err error)
Get the wallet connected to the `Account`.
type V2AccountWithdrawalGetParams ¶
type V2AccountWithdrawalGetParams struct {
AccountID string `path:"account_id,required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type V2AccountWithdrawalListParams ¶
type V2AccountWithdrawalListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// ID of the `WithdrawalRequest` to find `Withdrawals` for.
WithdrawalRequestID param.Opt[string] `query:"withdrawal_request_id,omitzero" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountWithdrawalListParams) URLQuery ¶
func (r V2AccountWithdrawalListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountWithdrawalListParams's query parameters as `url.Values`.
type V2AccountWithdrawalRequestGetParams ¶
type V2AccountWithdrawalRequestGetParams struct {
AccountID string `path:"account_id,required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type V2AccountWithdrawalRequestListParams ¶
type V2AccountWithdrawalRequestListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2AccountWithdrawalRequestListParams) URLQuery ¶
func (r V2AccountWithdrawalRequestListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2AccountWithdrawalRequestListParams's query parameters as `url.Values`.
type V2AccountWithdrawalRequestNewParams ¶
type V2AccountWithdrawalRequestNewParams struct {
// Amount of USD+ payment tokens to be withdrawn. Must be greater than 0 and have
// at most 6 decimal places.
PaymentTokenQuantity float64 `json:"payment_token_quantity,required"`
// ID of the `Account` that will receive payment tokens from the `Withdrawal`.
RecipientAccountID string `json:"recipient_account_id,required" format:"uuid"`
// contains filtered or unexported fields
}
func (V2AccountWithdrawalRequestNewParams) MarshalJSON ¶
func (r V2AccountWithdrawalRequestNewParams) MarshalJSON() (data []byte, err error)
func (*V2AccountWithdrawalRequestNewParams) UnmarshalJSON ¶
func (r *V2AccountWithdrawalRequestNewParams) UnmarshalJSON(data []byte) error
type V2AccountWithdrawalRequestService ¶
type V2AccountWithdrawalRequestService struct {
Options []option.RequestOption
}
V2AccountWithdrawalRequestService 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 NewV2AccountWithdrawalRequestService method instead.
func NewV2AccountWithdrawalRequestService ¶
func NewV2AccountWithdrawalRequestService(opts ...option.RequestOption) (r V2AccountWithdrawalRequestService)
NewV2AccountWithdrawalRequestService 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 (*V2AccountWithdrawalRequestService) Get ¶
func (r *V2AccountWithdrawalRequestService) Get(ctx context.Context, withdrawalRequestID string, query V2AccountWithdrawalRequestGetParams, opts ...option.RequestOption) (res *WithdrawalRequest, err error)
Get a specific `WithdrawalRequest` by its ID.
func (*V2AccountWithdrawalRequestService) List ¶
func (r *V2AccountWithdrawalRequestService) List(ctx context.Context, accountID string, query V2AccountWithdrawalRequestListParams, opts ...option.RequestOption) (res *[]WithdrawalRequest, err error)
List `WithdrawalRequests` under the `Account`, sorted by most recent.
func (*V2AccountWithdrawalRequestService) New ¶
func (r *V2AccountWithdrawalRequestService) New(ctx context.Context, accountID string, body V2AccountWithdrawalRequestNewParams, opts ...option.RequestOption) (res *WithdrawalRequest, err error)
Request to withdraw USD+ payment tokens from a managed `Account` and send the equivalent amount of USDC to the specified recipient `Account`.
The recipient `Account` must belong to the same `Entity` as the managed `Account`.
type V2AccountWithdrawalService ¶
type V2AccountWithdrawalService struct {
Options []option.RequestOption
}
V2AccountWithdrawalService 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 NewV2AccountWithdrawalService method instead.
func NewV2AccountWithdrawalService ¶
func NewV2AccountWithdrawalService(opts ...option.RequestOption) (r V2AccountWithdrawalService)
NewV2AccountWithdrawalService 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 (*V2AccountWithdrawalService) Get ¶
func (r *V2AccountWithdrawalService) Get(ctx context.Context, withdrawalID string, query V2AccountWithdrawalGetParams, opts ...option.RequestOption) (res *Withdrawal, err error)
Get a specific `Withdrawal` by its ID.
func (*V2AccountWithdrawalService) List ¶
func (r *V2AccountWithdrawalService) List(ctx context.Context, accountID string, query V2AccountWithdrawalListParams, opts ...option.RequestOption) (res *[]Withdrawal, err error)
Get a list of all `Withdrawals` under the `Account`, sorted by most recent.
type V2EntityAccountListParams ¶
type V2EntityAccountListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2EntityAccountListParams) URLQuery ¶
func (r V2EntityAccountListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2EntityAccountListParams's query parameters as `url.Values`.
type V2EntityAccountService ¶
type V2EntityAccountService struct {
Options []option.RequestOption
}
V2EntityAccountService 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 NewV2EntityAccountService method instead.
func NewV2EntityAccountService ¶
func NewV2EntityAccountService(opts ...option.RequestOption) (r V2EntityAccountService)
NewV2EntityAccountService 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 (*V2EntityAccountService) List ¶
func (r *V2EntityAccountService) List(ctx context.Context, entityID string, query V2EntityAccountListParams, opts ...option.RequestOption) (res *[]Account, err error)
Get a list of all `Accounts` that belong to a specific `Entity`. This `Entity` represents your organization itself, or an individual customer of your organization.
func (*V2EntityAccountService) New ¶
func (r *V2EntityAccountService) New(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Account, err error)
Create a new `Account` for a specific `Entity`. This `Entity` represents your organization itself, or an individual customer of your organization.
type V2EntityKYCDocumentGetParams ¶
type V2EntityKYCDocumentGetParams struct {
EntityID string `path:"entity_id,required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type V2EntityKYCDocumentService ¶
type V2EntityKYCDocumentService struct {
Options []option.RequestOption
}
V2EntityKYCDocumentService 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 NewV2EntityKYCDocumentService method instead.
func NewV2EntityKYCDocumentService ¶
func NewV2EntityKYCDocumentService(opts ...option.RequestOption) (r V2EntityKYCDocumentService)
NewV2EntityKYCDocumentService 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 (*V2EntityKYCDocumentService) Get ¶
func (r *V2EntityKYCDocumentService) Get(ctx context.Context, kycID string, query V2EntityKYCDocumentGetParams, opts ...option.RequestOption) (res *[]KYCDocument, err error)
Get uploaded documents for a KYC check
func (*V2EntityKYCDocumentService) Upload ¶
func (r *V2EntityKYCDocumentService) Upload(ctx context.Context, kycID string, params V2EntityKYCDocumentUploadParams, opts ...option.RequestOption) (res *KYCDocument, err error)
Upload KYC-related documentation for partners that are provisioned to provide their own KYC data.
type V2EntityKYCDocumentUploadParams ¶
type V2EntityKYCDocumentUploadParams struct {
EntityID string `path:"entity_id,required" format:"uuid" json:"-"`
// Type of `KYCDocument` to be uploaded.
//
// Any of "GOVERNMENT_ID", "SELFIE", "RESIDENCY", "UNKNOWN".
DocumentType KYCDocumentType `query:"document_type,omitzero,required" json:"-"`
// File to be uploaded. Must be a valid image or PDF file (jpg, jpeg, png, pdf)
// less than 10MB in size.
File io.Reader `json:"file,omitzero,required" format:"binary"`
// contains filtered or unexported fields
}
func (V2EntityKYCDocumentUploadParams) MarshalMultipart ¶
func (r V2EntityKYCDocumentUploadParams) MarshalMultipart() (data []byte, contentType string, err error)
func (V2EntityKYCDocumentUploadParams) URLQuery ¶
func (r V2EntityKYCDocumentUploadParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2EntityKYCDocumentUploadParams's query parameters as `url.Values`.
type V2EntityKYCNewManagedCheckResponse ¶
type V2EntityKYCNewManagedCheckResponse struct {
// URL of a managed KYC flow interface for the `Entity`.
EmbedURL string `json:"embed_url,required"`
// Datetime at which the KYC request will expired. ISO 8601 timestamp.
ExpirationDt time.Time `json:"expiration_dt,required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EmbedURL respjson.Field
ExpirationDt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
URL for a managed KYC flow for an `Entity`.
func (V2EntityKYCNewManagedCheckResponse) RawJSON ¶
func (r V2EntityKYCNewManagedCheckResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2EntityKYCNewManagedCheckResponse) UnmarshalJSON ¶
func (r *V2EntityKYCNewManagedCheckResponse) UnmarshalJSON(data []byte) error
type V2EntityKYCService ¶
type V2EntityKYCService struct {
Options []option.RequestOption
Document V2EntityKYCDocumentService
}
V2EntityKYCService 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 NewV2EntityKYCService method instead.
func NewV2EntityKYCService ¶
func NewV2EntityKYCService(opts ...option.RequestOption) (r V2EntityKYCService)
NewV2EntityKYCService 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 (*V2EntityKYCService) Get ¶
func (r *V2EntityKYCService) Get(ctx context.Context, entityID string, opts ...option.RequestOption) (res *KYCInfo, err error)
Get most recent KYC data of the `Entity`.
If there are any completed KYC checks, data from the most recent one will be returned. If there are no completed KYC checks, the most recent KYC check information, regardless of status, will be returned.
func (*V2EntityKYCService) NewManagedCheck ¶
func (r *V2EntityKYCService) NewManagedCheck(ctx context.Context, entityID string, opts ...option.RequestOption) (res *V2EntityKYCNewManagedCheckResponse, err error)
Create a Dinari-managed KYC Check and get a URL for your end customer to interact with.
The URL points to a web-based KYC interface that can be presented to the end customer for KYC verification. Once the customer completes this KYC flow, the KYC check will be created and available in the KYC API.
func (*V2EntityKYCService) Submit ¶
func (r *V2EntityKYCService) Submit(ctx context.Context, entityID string, body V2EntityKYCSubmitParams, opts ...option.RequestOption) (res *KYCInfo, err error)
Submit KYC data directly, for partners that are provisioned to provide their own KYC data.
This feature is available for everyone in sandbox mode, and for specifically provisioned partners in production.
type V2EntityKYCSubmitParams ¶
type V2EntityKYCSubmitParams struct {
// 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 (V2EntityKYCSubmitParams) MarshalJSON ¶
func (r V2EntityKYCSubmitParams) MarshalJSON() (data []byte, err error)
func (*V2EntityKYCSubmitParams) UnmarshalJSON ¶
func (r *V2EntityKYCSubmitParams) UnmarshalJSON(data []byte) error
type V2EntityNewParams ¶
type V2EntityNewParams struct {
// Name of the `Entity`.
Name string `json:"name,required"`
// contains filtered or unexported fields
}
func (V2EntityNewParams) MarshalJSON ¶
func (r V2EntityNewParams) MarshalJSON() (data []byte, err error)
func (*V2EntityNewParams) UnmarshalJSON ¶
func (r *V2EntityNewParams) UnmarshalJSON(data []byte) error
type V2EntityService ¶
type V2EntityService struct {
Options []option.RequestOption
Accounts V2EntityAccountService
KYC V2EntityKYCService
}
V2EntityService 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 NewV2EntityService method instead.
func NewV2EntityService ¶
func NewV2EntityService(opts ...option.RequestOption) (r V2EntityService)
NewV2EntityService 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 (*V2EntityService) GetByID ¶
func (r *V2EntityService) GetByID(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Entity, err error)
Get a specific customer `Entity` of your organization by their ID.
func (*V2EntityService) GetCurrent ¶
func (r *V2EntityService) GetCurrent(ctx context.Context, opts ...option.RequestOption) (res *Entity, err error)
Get the current authenticated `Entity`, which represents your organization.
func (*V2EntityService) List ¶
func (r *V2EntityService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Entity, err error)
Get a list of all direct `Entities` your organization manages. These `Entities` represent individual customers of your organization.
func (*V2EntityService) New ¶
func (r *V2EntityService) New(ctx context.Context, body V2EntityNewParams, opts ...option.RequestOption) (res *Entity, err error)
Create a new `Entity` to be managed by your organization. This `Entity` represents an individual customer of your organization.
type V2MarketDataGetMarketHoursResponse ¶
type V2MarketDataGetMarketHoursResponse struct {
// Whether or not the market is open
IsMarketOpen bool `json:"is_market_open,required"`
// Datetime at which the next session closes. ISO 8601 timestamp.
NextSessionCloseDt time.Time `json:"next_session_close_dt,required" format:"date-time"`
// Datetime at which the next session opens. ISO 8601 timestamp.
NextSessionOpenDt time.Time `json:"next_session_open_dt,required" format:"date-time"`
// Datetime at which the current session closes. `null` if the market is currently
// closed. ISO 8601 timestamp.
CurrentSessionCloseDt time.Time `json:"current_session_close_dt" format:"date-time"`
// Datetime at which the current session opened. `null` if the market is currently
// closed. ISO 8601 timestamp.
CurrentSessionOpenDt time.Time `json:"current_session_open_dt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
IsMarketOpen respjson.Field
NextSessionCloseDt respjson.Field
NextSessionOpenDt respjson.Field
CurrentSessionCloseDt respjson.Field
CurrentSessionOpenDt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (V2MarketDataGetMarketHoursResponse) RawJSON ¶
func (r V2MarketDataGetMarketHoursResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2MarketDataGetMarketHoursResponse) UnmarshalJSON ¶
func (r *V2MarketDataGetMarketHoursResponse) UnmarshalJSON(data []byte) error
type V2MarketDataService ¶
type V2MarketDataService struct {
Options []option.RequestOption
Stocks V2MarketDataStockService
}
V2MarketDataService 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 NewV2MarketDataService method instead.
func NewV2MarketDataService ¶
func NewV2MarketDataService(opts ...option.RequestOption) (r V2MarketDataService)
NewV2MarketDataService 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 (*V2MarketDataService) GetMarketHours ¶
func (r *V2MarketDataService) GetMarketHours(ctx context.Context, opts ...option.RequestOption) (res *V2MarketDataGetMarketHoursResponse, err error)
Get the market hours for the current trading session and next open trading session.
type V2MarketDataStockGetDividendsResponse ¶
type V2MarketDataStockGetDividendsResponse 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. In ISO 8601 format, YYYY-MM-DD.
DeclarationDate time.Time `json:"declaration_date" format:"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. In ISO 8601 format, YYYY-MM-DD.
ExDividendDate time.Time `json:"ex_dividend_date" format:"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 on which the dividend is paid out. In ISO 8601 format, YYYY-MM-DD.
PayDate time.Time `json:"pay_date" format:"date"`
// Date that the shares must be held to receive the dividend; set by the company.
// In ISO 8601 format, YYYY-MM-DD.
RecordDate time.Time `json:"record_date" format:"date"`
// Ticker symbol of the `Stock`.
Ticker string `json:"ticker"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CashAmount respjson.Field
Currency respjson.Field
DeclarationDate respjson.Field
DividendType respjson.Field
ExDividendDate respjson.Field
Frequency respjson.Field
PayDate respjson.Field
RecordDate respjson.Field
Ticker respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about a dividend announcement for a `Stock`.
func (V2MarketDataStockGetDividendsResponse) RawJSON ¶
func (r V2MarketDataStockGetDividendsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2MarketDataStockGetDividendsResponse) UnmarshalJSON ¶
func (r *V2MarketDataStockGetDividendsResponse) UnmarshalJSON(data []byte) error
type V2MarketDataStockGetHistoricalPricesParams ¶
type V2MarketDataStockGetHistoricalPricesParams struct {
// The timespan of the historical prices to query.
//
// Any of "DAY", "WEEK", "MONTH", "YEAR".
Timespan V2MarketDataStockGetHistoricalPricesParamsTimespan `query:"timespan,omitzero,required" json:"-"`
// contains filtered or unexported fields
}
func (V2MarketDataStockGetHistoricalPricesParams) URLQuery ¶
func (r V2MarketDataStockGetHistoricalPricesParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2MarketDataStockGetHistoricalPricesParams's query parameters as `url.Values`.
type V2MarketDataStockGetHistoricalPricesParamsTimespan ¶
type V2MarketDataStockGetHistoricalPricesParamsTimespan string
The timespan of the historical prices to query.
const ( V2MarketDataStockGetHistoricalPricesParamsTimespanDay V2MarketDataStockGetHistoricalPricesParamsTimespan = "DAY" V2MarketDataStockGetHistoricalPricesParamsTimespanWeek V2MarketDataStockGetHistoricalPricesParamsTimespan = "WEEK" V2MarketDataStockGetHistoricalPricesParamsTimespanMonth V2MarketDataStockGetHistoricalPricesParamsTimespan = "MONTH" V2MarketDataStockGetHistoricalPricesParamsTimespanYear V2MarketDataStockGetHistoricalPricesParamsTimespan = "YEAR" )
type V2MarketDataStockGetHistoricalPricesResponse ¶
type V2MarketDataStockGetHistoricalPricesResponse struct {
// Close price from the given time period.
Close float64 `json:"close,required"`
// Highest price from the given time period.
High float64 `json:"high,required"`
// Lowest price from the given time period.
Low float64 `json:"low,required"`
// Open price from 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"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Close respjson.Field
High respjson.Field
Low respjson.Field
Open respjson.Field
Timestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Datapoint of historical price data for a `Stock`.
func (V2MarketDataStockGetHistoricalPricesResponse) RawJSON ¶
func (r V2MarketDataStockGetHistoricalPricesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2MarketDataStockGetHistoricalPricesResponse) UnmarshalJSON ¶
func (r *V2MarketDataStockGetHistoricalPricesResponse) UnmarshalJSON(data []byte) error
type V2MarketDataStockGetNewsParams ¶
type V2MarketDataStockGetNewsParams struct {
// The number of articles to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2MarketDataStockGetNewsParams) URLQuery ¶
func (r V2MarketDataStockGetNewsParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2MarketDataStockGetNewsParams's query parameters as `url.Values`.
type V2MarketDataStockGetNewsResponse ¶
type V2MarketDataStockGetNewsResponse 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"`
// Datetime when the article was published. ISO 8601 timestamp.
PublishedDt time.Time `json:"published_dt,required" format:"date-time"`
// The publisher of the news article
Publisher string `json:"publisher,required"`
// Mobile-friendly Accelerated Mobile Page (AMP) URL of the news article, if
// available
AmpURL string `json:"amp_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ArticleURL respjson.Field
Description respjson.Field
ImageURL respjson.Field
PublishedDt respjson.Field
Publisher respjson.Field
AmpURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A news article relating to a `Stock` which includes a summary of the article and a link to the original source.
func (V2MarketDataStockGetNewsResponse) RawJSON ¶
func (r V2MarketDataStockGetNewsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2MarketDataStockGetNewsResponse) UnmarshalJSON ¶
func (r *V2MarketDataStockGetNewsResponse) UnmarshalJSON(data []byte) error
type V2MarketDataStockGetQuoteResponse ¶
type V2MarketDataStockGetQuoteResponse struct {
// The ask price.
Price float64 `json:"price,required"`
// ID of the `Stock`
StockID string `json:"stock_id,required" format:"uuid"`
// 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 from the given time period.
Close float64 `json:"close"`
// The highest price from the given time period
High float64 `json:"high"`
// The lowest price from 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 from the given time period.
Open float64 `json:"open"`
// The close price for the `Stock` from the previous trading session.
PreviousClose float64 `json:"previous_close"`
// The trading volume from the given time period.
Volume float64 `json:"volume"`
WeightedSharesOutstanding int64 `json:"weighted_shares_outstanding"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Price respjson.Field
StockID respjson.Field
Change respjson.Field
ChangePercent respjson.Field
Close respjson.Field
High respjson.Field
Low respjson.Field
MarketCap respjson.Field
Open respjson.Field
PreviousClose respjson.Field
Volume respjson.Field
WeightedSharesOutstanding respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (V2MarketDataStockGetQuoteResponse) RawJSON ¶
func (r V2MarketDataStockGetQuoteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2MarketDataStockGetQuoteResponse) UnmarshalJSON ¶
func (r *V2MarketDataStockGetQuoteResponse) UnmarshalJSON(data []byte) error
type V2MarketDataStockListParams ¶
type V2MarketDataStockListParams 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 (V2MarketDataStockListParams) URLQuery ¶
func (r V2MarketDataStockListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2MarketDataStockListParams's query parameters as `url.Values`.
type V2MarketDataStockListResponse ¶
type V2MarketDataStockListResponse struct {
// ID of the `Stock`
ID string `json:"id,required" format:"uuid"`
// 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"`
// Whether the `Stock` is available for trading.
IsTradable bool `json:"is_tradable,required"`
// Company name
Name string `json:"name,required"`
// Ticker symbol
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)
// for more information.
Cik string `json:"cik,nullable"`
// Composite FIGI ID. Refer to [this link](https://www.openfigi.com/about/figi) for
// more information.
CompositeFigi string `json:"composite_figi,nullable"`
// CUSIP ID. Refer to [this link](https://www.cusip.com/identifiers.html) for more
// information.
Cusip string `json:"cusip,nullable"`
// Description of the company and their services.
Description string `json:"description,nullable"`
// Name of `Stock` for application display. If defined, this supercedes the `name`
// field for displaying the name.
DisplayName string `json:"display_name,nullable"`
// URL of the company's logo. Supported formats are SVG and PNG.
LogoURL string `json:"logo_url,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
IsFractionable respjson.Field
IsTradable respjson.Field
Name respjson.Field
Symbol respjson.Field
Cik respjson.Field
CompositeFigi respjson.Field
Cusip respjson.Field
Description respjson.Field
DisplayName respjson.Field
LogoURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about stock available for trading.
func (V2MarketDataStockListResponse) RawJSON ¶
func (r V2MarketDataStockListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2MarketDataStockListResponse) UnmarshalJSON ¶
func (r *V2MarketDataStockListResponse) UnmarshalJSON(data []byte) error
type V2MarketDataStockService ¶
type V2MarketDataStockService struct {
Options []option.RequestOption
Splits V2MarketDataStockSplitService
}
V2MarketDataStockService 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 NewV2MarketDataStockService method instead.
func NewV2MarketDataStockService ¶
func NewV2MarketDataStockService(opts ...option.RequestOption) (r V2MarketDataStockService)
NewV2MarketDataStockService 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 (*V2MarketDataStockService) GetDividends ¶
func (r *V2MarketDataStockService) GetDividends(ctx context.Context, stockID string, opts ...option.RequestOption) (res *[]V2MarketDataStockGetDividendsResponse, err error)
Get a list of announced stock dividend details for a specified `Stock`.
Note that this data applies only to actual stocks. Yield received for holding tokenized shares may differ from this.
func (*V2MarketDataStockService) GetHistoricalPrices ¶
func (r *V2MarketDataStockService) GetHistoricalPrices(ctx context.Context, stockID string, query V2MarketDataStockGetHistoricalPricesParams, opts ...option.RequestOption) (res *[]V2MarketDataStockGetHistoricalPricesResponse, err error)
Get historical price data for a specified `Stock`. Each index in the array represents a single tick in a price chart.
func (*V2MarketDataStockService) GetNews ¶
func (r *V2MarketDataStockService) GetNews(ctx context.Context, stockID string, query V2MarketDataStockGetNewsParams, opts ...option.RequestOption) (res *[]V2MarketDataStockGetNewsResponse, 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 (*V2MarketDataStockService) GetQuote ¶
func (r *V2MarketDataStockService) GetQuote(ctx context.Context, stockID string, opts ...option.RequestOption) (res *V2MarketDataStockGetQuoteResponse, err error)
Get quote for a specified `Stock`.
func (*V2MarketDataStockService) List ¶
func (r *V2MarketDataStockService) List(ctx context.Context, query V2MarketDataStockListParams, opts ...option.RequestOption) (res *[]V2MarketDataStockListResponse, err error)
Get a list of `Stocks`.
type V2MarketDataStockSplitListForStockParams ¶
type V2MarketDataStockSplitListForStockParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2MarketDataStockSplitListForStockParams) URLQuery ¶
func (r V2MarketDataStockSplitListForStockParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2MarketDataStockSplitListForStockParams's query parameters as `url.Values`.
type V2MarketDataStockSplitListParams ¶
type V2MarketDataStockSplitListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (V2MarketDataStockSplitListParams) URLQuery ¶
func (r V2MarketDataStockSplitListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V2MarketDataStockSplitListParams's query parameters as `url.Values`.
type V2MarketDataStockSplitService ¶
type V2MarketDataStockSplitService struct {
Options []option.RequestOption
}
V2MarketDataStockSplitService 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 NewV2MarketDataStockSplitService method instead.
func NewV2MarketDataStockSplitService ¶
func NewV2MarketDataStockSplitService(opts ...option.RequestOption) (r V2MarketDataStockSplitService)
NewV2MarketDataStockSplitService 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 (*V2MarketDataStockSplitService) List ¶
func (r *V2MarketDataStockSplitService) List(ctx context.Context, query V2MarketDataStockSplitListParams, opts ...option.RequestOption) (res *[]StockSplit, err error)
Get a list of stock splits for `Stocks` available for trade via Dinari. 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 (*V2MarketDataStockSplitService) ListForStock ¶
func (r *V2MarketDataStockSplitService) ListForStock(ctx context.Context, stockID string, query V2MarketDataStockSplitListForStockParams, opts ...option.RequestOption) (res *[]StockSplit, err error)
Get a list of stock splits for a specific `Stock`. 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 V2Service ¶
type V2Service struct {
Options []option.RequestOption
MarketData V2MarketDataService
Entities V2EntityService
Accounts V2AccountService
}
V2Service 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 NewV2Service method instead.
func NewV2Service ¶
func NewV2Service(opts ...option.RequestOption) (r V2Service)
NewV2Service 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 Wallet ¶
type Wallet struct {
// Address of the `Wallet`.
Address string `json:"address,required"`
// Indicates whether the `Wallet` is flagged for AML violation.
IsAmlFlagged bool `json:"is_aml_flagged,required"`
// Indicates whether the `Wallet` is a Dinari-managed wallet.
IsManagedWallet bool `json:"is_managed_wallet,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address respjson.Field
IsAmlFlagged respjson.Field
IsManagedWallet respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about a blockchain `Wallet`.
func (*Wallet) UnmarshalJSON ¶
type Withdrawal ¶
type Withdrawal struct {
// ID of the `Withdrawal`.
ID string `json:"id,required" format:"uuid"`
// ID of the `Account` from which the `Withdrawal` is made.
AccountID string `json:"account_id,required" format:"uuid"`
// CAIP-2 chain ID of the blockchain where the `Withdrawal` is made.
//
// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
ChainID Chain `json:"chain_id,required"`
// Address of USDC payment token that the `Withdrawal` will be received in.
PaymentTokenAddress string `json:"payment_token_address,required" format:"eth_address"`
// Amount of USDC payment tokens to be withdrawn.
PaymentTokenAmount float64 `json:"payment_token_amount,required"`
// ID of the `Account` that will receive payment tokens from the `Withdrawal`. This
// `Account` must be connected to a non-managed `Wallet` and belong to the same
// `Entity`.
RecipientAccountID string `json:"recipient_account_id,required" format:"uuid"`
// Status of the `Withdrawal`.
//
// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
// "ESCROWED", "SUBMITTED", "CANCELLED", "FILLED", "REJECTED", "REQUIRING_CONTACT",
// "ERROR".
Status BrokerageOrderStatus `json:"status,required"`
// Datetime at which the `Withdrawal` was transacted. ISO 8601 timestamp.
TransactionDt time.Time `json:"transaction_dt,required" format:"date-time"`
// Hash of the transaction for the `Withdrawal`.
TransactionHash string `json:"transaction_hash,required" format:"hex_string"`
// ID of the `WithdrawalRequest` associated with this `Withdrawal`.
WithdrawalRequestID string `json:"withdrawal_request_id,required" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountID respjson.Field
ChainID respjson.Field
PaymentTokenAddress respjson.Field
PaymentTokenAmount respjson.Field
RecipientAccountID respjson.Field
Status respjson.Field
TransactionDt respjson.Field
TransactionHash respjson.Field
WithdrawalRequestID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information for a withdrawal of payment tokens from an `Account` backed by a Dinari-managed `Wallet`.
func (Withdrawal) RawJSON ¶
func (r Withdrawal) RawJSON() string
Returns the unmodified JSON received from the API
func (*Withdrawal) UnmarshalJSON ¶
func (r *Withdrawal) UnmarshalJSON(data []byte) error
type WithdrawalRequest ¶
type WithdrawalRequest struct {
// ID of the `WithdrawalRequest`.
ID string `json:"id,required" format:"uuid"`
// ID of the `Account` of the `WithdrawalRequest`.
AccountID string `json:"account_id,required" format:"uuid"`
// Datetime at which the `WithdrawalRequest` was created. ISO 8601 timestamp.
CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
// Amount of USD+ payment tokens submitted for withdrawal.
PaymentTokenAmount float64 `json:"payment_token_amount,required"`
// ID of the `Account` that will receive USDC payment tokens from the `Withdrawal`.
// This `Account` must be connected to a non-managed `Wallet` and belong to the
// same `Entity`.
RecipientAccountID string `json:"recipient_account_id,required" format:"uuid"`
// Status of the `WithdrawalRequest`
//
// Any of "PENDING", "SUBMITTED", "ERROR", "CANCELLED".
Status WithdrawalRequestStatus `json:"status,required"`
// Datetime at which the `WithdrawalRequest` was updated. ISO 8601 timestamp.
UpdatedDt time.Time `json:"updated_dt,required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountID respjson.Field
CreatedDt respjson.Field
PaymentTokenAmount respjson.Field
RecipientAccountID respjson.Field
Status respjson.Field
UpdatedDt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information for a withdrawal request of payment tokens from an `Account` backed by a Dinari-managed `Wallet`.
func (WithdrawalRequest) RawJSON ¶
func (r WithdrawalRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*WithdrawalRequest) UnmarshalJSON ¶
func (r *WithdrawalRequest) UnmarshalJSON(data []byte) error
type WithdrawalRequestStatus ¶
type WithdrawalRequestStatus string
Status of the `WithdrawalRequest`
const ( WithdrawalRequestStatusPending WithdrawalRequestStatus = "PENDING" WithdrawalRequestStatusSubmitted WithdrawalRequestStatus = "SUBMITTED" WithdrawalRequestStatusError WithdrawalRequestStatus = "ERROR" WithdrawalRequestStatusCancelled WithdrawalRequestStatus = "CANCELLED" )
Source Files
¶
- aliases.go
- client.go
- field.go
- v2.go
- v2account.go
- v2accountorder.go
- v2accountorderfulfillment.go
- v2accountorderrequest.go
- v2accountwallet.go
- v2accountwalletexternal.go
- v2accountwithdrawal.go
- v2accountwithdrawalrequest.go
- v2entity.go
- v2entityaccount.go
- v2entitykyc.go
- v2entitykycdocument.go
- v2marketdata.go
- v2marketdatastock.go
- v2marketdatastocksplit.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
|
|