dinariapisdkgo

package module
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

README

Dinari Go API Library

Go Reference

The Dinari Go library provides convenient access to the Dinari REST API from applications written in Go.

It is generated with Stainless.

MCP Server

Use the Dinari MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

Add to Cursor Install in VS Code

Note: You may need to set environment variables in your MCP client.

Installation

import (
	"github.com/dinaricrypto/dinari-api-sdk-go" // imported as dinariapisdkgo
)

Or to pin the version:

go get -u 'github.com/dinaricrypto/[email protected]'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/dinaricrypto/dinari-api-sdk-go"
	"github.com/dinaricrypto/dinari-api-sdk-go/option"
)

func main() {
	client := dinariapisdkgo.NewClient(
		option.WithAPIKeyID("My API Key ID"),         // defaults to os.LookupEnv("DINARI_API_KEY_ID")
		option.WithAPISecretKey("My API Secret Key"), // defaults to os.LookupEnv("DINARI_API_SECRET_KEY")
		option.WithEnvironmentSandbox(),              // defaults to option.WithEnvironmentProduction()
	)
	stocks, err := client.V2.MarketData.Stocks.List(context.TODO(), dinariapisdkgo.V2MarketDataStockListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", stocks)
}

Request fields

The dinariapisdkgo library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `json:"...,required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, dinariapisdkgo.String(string), dinariapisdkgo.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := dinariapisdkgo.ExampleParams{
	ID:   "id_xxx",                     // required property
	Name: dinariapisdkgo.String("..."), // optional property

	Point: dinariapisdkgo.Point{
		X: 0,                     // required field will serialize as 0
		Y: dinariapisdkgo.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: dinariapisdkgo.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[dinariapisdkgo.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := dinariapisdkgo.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.V2.MarketData.Stocks.List(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *dinariapisdkgo.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.V2.MarketData.Stocks.List(context.TODO(), dinariapisdkgo.V2MarketDataStockListParams{})
if err != nil {
	var apierr *dinariapisdkgo.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/api/v2/market_data/stocks/": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.V2.MarketData.Stocks.List(
	ctx,
	dinariapisdkgo.V2MarketDataStockListParams{},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper dinariapisdkgo.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

// A file from the file system
file, err := os.Open("/path/to/file")
dinariapisdkgo.V2EntityKYCDocumentUploadParams{
	EntityID:     "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
	DocumentType: dinariapisdkgo.KYCDocumentTypeGovernmentID,
	File:         file,
}

// A file from a string
dinariapisdkgo.V2EntityKYCDocumentUploadParams{
	EntityID:     "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
	DocumentType: dinariapisdkgo.KYCDocumentTypeGovernmentID,
	File:         strings.NewReader("my file contents"),
}

// With a custom filename and contentType
dinariapisdkgo.V2EntityKYCDocumentUploadParams{
	EntityID:     "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
	DocumentType: dinariapisdkgo.KYCDocumentTypeGovernmentID,
	File:         dinariapisdkgo.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
}
Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := dinariapisdkgo.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.V2.MarketData.Stocks.List(
	context.TODO(),
	dinariapisdkgo.V2MarketDataStockListParams{},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
stocks, err := client.V2.MarketData.Stocks.List(
	context.TODO(),
	dinariapisdkgo.V2MarketDataStockListParams{},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", stocks)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: dinariapisdkgo.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := dinariapisdkgo.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

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 File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type Account

type Account struct {
	// Unique ID for the `Account`.
	ID string `json:"id" api:"required" format:"uuid"`
	// Datetime when the `Account` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt" api:"required" format:"date-time"`
	// ID for the `Entity` that owns the `Account`.
	EntityID string `json:"entity_id" api:"required" format:"uuid"`
	// Indicates whether the `Account` is active.
	IsActive bool `json:"is_active" api:"required"`
	// Jurisdiction of the `Account`.
	//
	// Any of "BASELINE", "US".
	Jurisdiction Jurisdiction `json:"jurisdiction" api:"required"`
	// ID of the brokerage account associated with the `Account`.
	BrokerageAccountID string `json:"brokerage_account_id" api:"nullable"`
	// 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
		Jurisdiction       respjson.Field
		BrokerageAccountID respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about an `Account` owned by an `Entity`.

func (Account) RawJSON

func (r Account) RawJSON() string

Returns the unmodified JSON received from the API

func (*Account) UnmarshalJSON

func (r *Account) UnmarshalJSON(data []byte) error

type BaselineKYCCheckData added in v0.7.0

type BaselineKYCCheckData struct {
	// Country of residence. ISO 3166-1 alpha 2 country code.
	AddressCountryCode string `json:"address_country_code" api:"required"`
	// Country of citizenship or home country of the organization. ISO 3166-1 alpha 2
	// country code.
	CountryCode string `json:"country_code" api:"required"`
	// Last name of the person.
	LastName string `json:"last_name" api:"required"`
	// City of address. Not all international addresses use this attribute.
	AddressCity string `json:"address_city" api:"nullable"`
	// Postal code of residence address. Not all international addresses use this
	// attribute.
	AddressPostalCode string `json:"address_postal_code" api:"nullable"`
	// Street address of address.
	AddressStreet1 string `json:"address_street_1" api:"nullable"`
	// Extension of address, usually apartment or suite number.
	AddressStreet2 string `json:"address_street_2" api:"nullable"`
	// 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" api:"nullable"`
	// Birth date of the individual. In ISO 8601 format, YYYY-MM-DD.
	BirthDate time.Time `json:"birth_date" api:"nullable" format:"date"`
	// Email address.
	Email string `json:"email" api:"nullable"`
	// First name of the person.
	FirstName string `json:"first_name" api:"nullable"`
	// Middle name of the user
	MiddleName string `json:"middle_name" api:"nullable"`
	// ID number of the official tax document of the country the entity belongs to.
	TaxIDNumber string `json:"tax_id_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AddressCountryCode respjson.Field
		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` in the BASELINE jurisdiction.

func (BaselineKYCCheckData) RawJSON added in v0.7.0

func (r BaselineKYCCheckData) RawJSON() string

Returns the unmodified JSON received from the API

func (BaselineKYCCheckData) ToParam added in v0.7.0

ToParam converts this BaselineKYCCheckData to a BaselineKYCCheckDataParam.

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 BaselineKYCCheckDataParam.Overrides()

func (*BaselineKYCCheckData) UnmarshalJSON added in v0.7.0

func (r *BaselineKYCCheckData) UnmarshalJSON(data []byte) error

type BaselineKYCCheckDataParam added in v0.7.0

type BaselineKYCCheckDataParam struct {
	// Country of residence. ISO 3166-1 alpha 2 country code.
	AddressCountryCode string `json:"address_country_code" api:"required"`
	// Country of citizenship or home country of the organization. ISO 3166-1 alpha 2
	// country code.
	CountryCode string `json:"country_code" api:"required"`
	// Last name of the person.
	LastName string `json:"last_name" api:"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` in the BASELINE jurisdiction.

The properties AddressCountryCode, CountryCode, LastName are required.

func (BaselineKYCCheckDataParam) MarshalJSON added in v0.7.0

func (r BaselineKYCCheckDataParam) MarshalJSON() (data []byte, err error)

func (*BaselineKYCCheckDataParam) UnmarshalJSON added in v0.7.0

func (r *BaselineKYCCheckDataParam) UnmarshalJSON(data []byte) error

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"
	BrokerageOrderStatusPartiallyFilled  BrokerageOrderStatus = "PARTIALLY_FILLED"
	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_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_202110    Chain = "eip155:202110"
	ChainEip155_179205    Chain = "eip155:179205"
	ChainEip155_179202    Chain = "eip155:179202"
	ChainEip155_98865     Chain = "eip155:98865"
	ChainEip155_7887      Chain = "eip155:7887"
)

type Client

type Client struct {
	Options []option.RequestOption
	// **`Orders` represent the buying and selling of assets under an `Account`.**
	//
	// For `Accounts` using self-custodied `Wallets`, `Orders` are created and
	// fulfilled by making calls to Dinari's smart contracts, or using the _Proxied
	// Orders_ methods.
	//
	// For `Accounts` using managed `Wallets`, `Orders` are created and fulfilled by
	// using the `Managed Orders` methods, which then create the corresponding
	// transactions on the blockchain.
	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.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type CreateLimitBuyOrderInputParam added in v0.4.0

type CreateLimitBuyOrderInputParam struct {
	// Amount of dShare asset involved. Required for limit `Order Requests` and market
	// sell `Order Requests`. Must be a positive number with a precision of up to 4
	// decimal places.
	AssetQuantity float64 `json:"asset_quantity" api:"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" api:"required"`
	// ID of `Alloy`.
	AlloyID param.Opt[string] `json:"alloy_id,omitzero" format:"uuid"`
	// Customer-supplied ID to map this order to an order in their own systems. Must be
	// unique within the entity.
	ClientOrderID param.Opt[string] `json:"client_order_id,omitzero"`
	// ID of `Account` to receive the `Order`.
	RecipientAccountID param.Opt[string] `json:"recipient_account_id,omitzero" format:"uuid"`
	// ID of `Stock`.
	StockID param.Opt[string] `json:"stock_id,omitzero" format:"uuid"`
	// contains filtered or unexported fields
}

Input parameters for creating a limit buy `OrderRequest`.

The properties AssetQuantity, LimitPrice are required.

func (CreateLimitBuyOrderInputParam) MarshalJSON added in v0.4.0

func (r CreateLimitBuyOrderInputParam) MarshalJSON() (data []byte, err error)

func (*CreateLimitBuyOrderInputParam) UnmarshalJSON added in v0.4.0

func (r *CreateLimitBuyOrderInputParam) UnmarshalJSON(data []byte) error

type CreateLimitSellOrderInputParam added in v0.4.0

type CreateLimitSellOrderInputParam struct {
	// Amount of dShare asset involved. Required for limit `Order Requests` and market
	// sell `Order Requests`. Must be a positive number with a precision of up to 4
	// decimal places.
	AssetQuantity float64 `json:"asset_quantity" api:"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" api:"required"`
	// ID of `Alloy`.
	AlloyID param.Opt[string] `json:"alloy_id,omitzero" format:"uuid"`
	// Customer-supplied ID to map this order to an order in their own systems. Must be
	// unique within the entity.
	ClientOrderID param.Opt[string] `json:"client_order_id,omitzero"`
	// Address of the payment token to be used for the sell order. If not provided, the
	// default payment token (USD+) will be used. Should only be specified if
	// `recipient_account_id` for a non-managed wallet account is also provided.
	PaymentTokenAddress param.Opt[string] `json:"payment_token_address,omitzero" format:"eth_address"`
	// ID of `Account` to receive the `Order`.
	RecipientAccountID param.Opt[string] `json:"recipient_account_id,omitzero" format:"uuid"`
	// ID of `Stock`.
	StockID param.Opt[string] `json:"stock_id,omitzero" format:"uuid"`
	// contains filtered or unexported fields
}

Input parameters for creating a limit sell `OrderRequest`.

The properties AssetQuantity, LimitPrice are required.

func (CreateLimitSellOrderInputParam) MarshalJSON added in v0.4.0

func (r CreateLimitSellOrderInputParam) MarshalJSON() (data []byte, err error)

func (*CreateLimitSellOrderInputParam) UnmarshalJSON added in v0.4.0

func (r *CreateLimitSellOrderInputParam) UnmarshalJSON(data []byte) error

type CreateMarketBuyOrderInputParam added in v0.4.0

type CreateMarketBuyOrderInputParam struct {
	// Amount of currency (USD for US equities and ETFs) to pay for the order. Must be
	// a positive number with a precision of up to 2 decimal places.
	PaymentAmount float64 `json:"payment_amount" api:"required"`
	// ID of `Alloy`.
	AlloyID param.Opt[string] `json:"alloy_id,omitzero" format:"uuid"`
	// Customer-supplied ID to map this order to an order in their own systems. Must be
	// unique within the entity.
	ClientOrderID param.Opt[string] `json:"client_order_id,omitzero"`
	// ID of `Account` to receive the `Order`.
	RecipientAccountID param.Opt[string] `json:"recipient_account_id,omitzero" format:"uuid"`
	// ID of `Stock`.
	StockID param.Opt[string] `json:"stock_id,omitzero" format:"uuid"`
	// contains filtered or unexported fields
}

Input parameters for creating a market buy `OrderRequest`.

The property PaymentAmount is required.

func (CreateMarketBuyOrderInputParam) MarshalJSON added in v0.4.0

func (r CreateMarketBuyOrderInputParam) MarshalJSON() (data []byte, err error)

func (*CreateMarketBuyOrderInputParam) UnmarshalJSON added in v0.4.0

func (r *CreateMarketBuyOrderInputParam) UnmarshalJSON(data []byte) error

type CreateMarketSellOrderInputParam added in v0.4.0

type CreateMarketSellOrderInputParam struct {
	// Quantity of shares to trade. Must be a positive number with a precision of up to
	// 6 decimal places.
	AssetQuantity float64 `json:"asset_quantity" api:"required"`
	// ID of `Alloy`.
	AlloyID param.Opt[string] `json:"alloy_id,omitzero" format:"uuid"`
	// Customer-supplied ID to map this order to an order in their own systems. Must be
	// unique within the entity.
	ClientOrderID param.Opt[string] `json:"client_order_id,omitzero"`
	// Address of the payment token to be used for the sell order. If not provided, the
	// default payment token (USD+) will be used. Should only be specified if
	// `recipient_account_id` for a non-managed wallet account is also provided.
	PaymentTokenAddress param.Opt[string] `json:"payment_token_address,omitzero" format:"eth_address"`
	// ID of `Account` to receive the `Order`.
	RecipientAccountID param.Opt[string] `json:"recipient_account_id,omitzero" format:"uuid"`
	// ID of `Stock`.
	StockID param.Opt[string] `json:"stock_id,omitzero" format:"uuid"`
	// contains filtered or unexported fields
}

Input parameters for creating a market sell `OrderRequest`.

The property AssetQuantity is required.

func (CreateMarketSellOrderInputParam) MarshalJSON added in v0.4.0

func (r CreateMarketSellOrderInputParam) MarshalJSON() (data []byte, err error)

func (*CreateMarketSellOrderInputParam) UnmarshalJSON added in v0.4.0

func (r *CreateMarketSellOrderInputParam) UnmarshalJSON(data []byte) error

type Eip155OrderRequestPermitTransactionParam added in v0.7.0

type Eip155OrderRequestPermitTransactionParam struct {
	// ID of the prepared proxied order to be submitted as a proxied order.
	OrderRequestID string `json:"order_request_id" api:"required" format:"uuid"`
	// Signature of the permit typed data, allowing Dinari to spend the payment token
	// or dShare asset token on behalf of the owner.
	PermitSignature string `json:"permit_signature" api:"required" format:"hex_string"`
	// contains filtered or unexported fields
}

Input parameters for creating a proxied `EIP155OrderRequestPermitTransaction`.

The properties OrderRequestID, PermitSignature are required.

func (Eip155OrderRequestPermitTransactionParam) MarshalJSON added in v0.7.0

func (r Eip155OrderRequestPermitTransactionParam) MarshalJSON() (data []byte, err error)

func (*Eip155OrderRequestPermitTransactionParam) UnmarshalJSON added in v0.7.0

func (r *Eip155OrderRequestPermitTransactionParam) UnmarshalJSON(data []byte) error

type Entity

type Entity struct {
	// Unique ID of the `Entity`.
	ID string `json:"id" api:"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" api:"required"`
	// Indicates if `Entity` completed KYC.
	IsKYCComplete bool `json:"is_kyc_complete" api:"required"`
	// Name of `Entity`.
	Name string `json:"name" api:"nullable"`
	// Nationality or home country of the `Entity`.
	Nationality string `json:"nationality" api:"nullable"`
	// Case sensitive unique reference ID that you can set for the `Entity`. We
	// recommend setting this to the unique ID of the `Entity` in your system.
	ReferenceID string `json:"reference_id" api:"nullable"`
	// 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
		ReferenceID   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) RawJSON

func (r Entity) RawJSON() string

Returns the unmodified JSON received from the API

func (*Entity) UnmarshalJSON

func (r *Entity) UnmarshalJSON(data []byte) error

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 Error

type Error = apierror.Error

type Fulfillment

type Fulfillment struct {
	// ID of the `OrderFulfillment`.
	ID string `json:"id" api:"required" format:"uuid"`
	// Amount of dShare asset token filled for `BUY` orders.
	AssetTokenFilled float64 `json:"asset_token_filled" api:"required"`
	// Amount of dShare asset token spent for `SELL` orders.
	AssetTokenSpent float64 `json:"asset_token_spent" api:"required"`
	// Blockchain that the transaction was run on.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `json:"chain_id" api:"required"`
	// ID of the `Order` this `OrderFulfillment` is for.
	OrderID string `json:"order_id" api:"required" format:"uuid"`
	// Amount of payment token filled for `SELL` orders.
	PaymentTokenFilled float64 `json:"payment_token_filled" api:"required"`
	// Amount of payment token spent for `BUY` orders.
	PaymentTokenSpent float64 `json:"payment_token_spent" api:"required"`
	// Time when transaction occurred.
	TransactionDt time.Time `json:"transaction_dt" api:"required" format:"date-time"`
	// Transaction hash for this fulfillment.
	TransactionHash string `json:"transaction_hash" api:"required" format:"hex_string"`
	// The `Alloy` ID associated with the `Order`
	AlloyID string `json:"alloy_id" api:"nullable" format:"uuid"`
	// Fee amount, in payment tokens.
	PaymentTokenFee float64 `json:"payment_token_fee" api:"nullable"`
	// The `Stock` ID associated with the `Order`
	StockID string `json:"stock_id" api:"nullable" format:"uuid"`
	// 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
		AlloyID            respjson.Field
		PaymentTokenFee    respjson.Field
		StockID            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 Jurisdiction added in v0.7.0

type Jurisdiction string
const (
	JurisdictionBaseline Jurisdiction = "BASELINE"
	JurisdictionUs       Jurisdiction = "US"
)

type KYCDocument

type KYCDocument struct {
	// ID of the document.
	ID string `json:"id" api:"required" format:"uuid"`
	// Type of document.
	//
	// Any of "GOVERNMENT_ID", "SELFIE", "RESIDENCY", "UNKNOWN".
	DocumentType KYCDocumentType `json:"document_type" api:"required"`
	// Filename of document.
	Filename string `json:"filename" api:"required"`
	// Temporary URL to access the document. Expires in 1 hour.
	URL string `json:"url" api:"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 KYCInfoBaseline added in v0.7.0

type KYCInfoBaseline struct {
	// ID of the KYC check.
	ID string `json:"id" api:"required" format:"uuid"`
	// KYC check status.
	//
	// Any of "PASS", "FAIL", "PENDING", "INCOMPLETE", "NEEDS_REVIEW".
	Status KYCStatus `json:"status" api:"required"`
	// Datetime when the KYC was last checked. ISO 8601 timestamp.
	CheckedDt time.Time `json:"checked_dt" api:"nullable" format:"date-time"`
	// KYC data for an `Entity` in the BASELINE jurisdiction.
	Data BaselineKYCCheckData `json:"data" api:"nullable"`
	// Jurisdiction of the KYC check.
	//
	// Any of "BASELINE".
	Jurisdiction string `json:"jurisdiction"`
	// 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
		Jurisdiction respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

KYC information for an `Entity` in the baseline jurisdiction.

func (KYCInfoBaseline) RawJSON added in v0.7.0

func (r KYCInfoBaseline) RawJSON() string

Returns the unmodified JSON received from the API

func (*KYCInfoBaseline) UnmarshalJSON added in v0.7.0

func (r *KYCInfoBaseline) UnmarshalJSON(data []byte) error

type KYCInfoUnion added in v0.7.0

type KYCInfoUnion struct {
	ID string `json:"id"`
	// This field is from variant [KYCInfoBaseline].
	Status    KYCStatus `json:"status"`
	CheckedDt time.Time `json:"checked_dt"`
	// This field is a union of [BaselineKYCCheckData], [UsKYCCheckData]
	Data KYCInfoUnionData `json:"data"`
	// Any of "BASELINE", "US".
	Jurisdiction string `json:"jurisdiction"`
	JSON         struct {
		ID           respjson.Field
		Status       respjson.Field
		CheckedDt    respjson.Field
		Data         respjson.Field
		Jurisdiction respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

KYCInfoUnion contains all possible properties and values from KYCInfoBaseline, KYCInfoUs.

Use the KYCInfoUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (KYCInfoUnion) AsAny added in v0.7.0

func (u KYCInfoUnion) AsAny() anyKYCInfo

Use the following switch statement to find the correct variant

switch variant := KYCInfoUnion.AsAny().(type) {
case dinariapisdkgo.KYCInfoBaseline:
case dinariapisdkgo.KYCInfoUs:
default:
  fmt.Errorf("no variant present")
}

func (KYCInfoUnion) AsBaseline added in v0.7.0

func (u KYCInfoUnion) AsBaseline() (v KYCInfoBaseline)

func (KYCInfoUnion) AsUs added in v0.7.0

func (u KYCInfoUnion) AsUs() (v KYCInfoUs)

func (KYCInfoUnion) RawJSON added in v0.7.0

func (u KYCInfoUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*KYCInfoUnion) UnmarshalJSON added in v0.7.0

func (r *KYCInfoUnion) UnmarshalJSON(data []byte) error

type KYCInfoUnionData added in v0.7.0

type KYCInfoUnionData struct {
	// This field is from variant [BaselineKYCCheckData].
	AddressCountryCode string `json:"address_country_code"`
	// This field is from variant [BaselineKYCCheckData].
	CountryCode string `json:"country_code"`
	// This field is from variant [BaselineKYCCheckData].
	LastName string `json:"last_name"`
	// This field is from variant [BaselineKYCCheckData].
	AddressCity string `json:"address_city"`
	// This field is from variant [BaselineKYCCheckData].
	AddressPostalCode string `json:"address_postal_code"`
	// This field is from variant [BaselineKYCCheckData].
	AddressStreet1 string `json:"address_street_1"`
	// This field is from variant [BaselineKYCCheckData].
	AddressStreet2 string `json:"address_street_2"`
	// This field is from variant [BaselineKYCCheckData].
	AddressSubdivision string `json:"address_subdivision"`
	// This field is from variant [BaselineKYCCheckData].
	BirthDate time.Time `json:"birth_date"`
	// This field is from variant [BaselineKYCCheckData].
	Email string `json:"email"`
	// This field is from variant [BaselineKYCCheckData].
	FirstName string `json:"first_name"`
	// This field is from variant [BaselineKYCCheckData].
	MiddleName string `json:"middle_name"`
	// This field is from variant [BaselineKYCCheckData].
	TaxIDNumber string `json:"tax_id_number"`
	// This field is from variant [UsKYCCheckData].
	AlpacaCustomerAgreement UsKYCCheckDataAlpacaCustomerAgreement `json:"alpaca_customer_agreement"`
	// This field is from variant [UsKYCCheckData].
	AmlCheck UsKYCCheckDataAmlCheck `json:"aml_check"`
	// This field is from variant [UsKYCCheckData].
	DataCitation UsKYCCheckDataDataCitation `json:"data_citation"`
	// This field is from variant [UsKYCCheckData].
	Employment UsKYCCheckDataEmployment `json:"employment"`
	// This field is from variant [UsKYCCheckData].
	FinancialProfile UsKYCCheckDataFinancialProfile `json:"financial_profile"`
	// This field is from variant [UsKYCCheckData].
	Identity UsKYCCheckDataIdentity `json:"identity"`
	// This field is from variant [UsKYCCheckData].
	KYCMetadata UsKYCCheckDataKYCMetadata `json:"kyc_metadata"`
	// This field is from variant [UsKYCCheckData].
	NonProfessionalTraderAttestation UsKYCCheckDataNonProfessionalTraderAttestation `json:"non_professional_trader_attestation"`
	// This field is from variant [UsKYCCheckData].
	RiskDisclosure UsKYCCheckDataRiskDisclosure `json:"risk_disclosure"`
	// This field is from variant [UsKYCCheckData].
	TrustedContact UsKYCCheckDataTrustedContact `json:"trusted_contact"`
	// This field is from variant [UsKYCCheckData].
	UsImmigrationInfo UsKYCCheckDataUsImmigrationInfo `json:"us_immigration_info"`
	JSON              struct {
		AddressCountryCode               respjson.Field
		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
		AlpacaCustomerAgreement          respjson.Field
		AmlCheck                         respjson.Field
		DataCitation                     respjson.Field
		Employment                       respjson.Field
		FinancialProfile                 respjson.Field
		Identity                         respjson.Field
		KYCMetadata                      respjson.Field
		NonProfessionalTraderAttestation respjson.Field
		RiskDisclosure                   respjson.Field
		TrustedContact                   respjson.Field
		UsImmigrationInfo                respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

KYCInfoUnionData is an implicit subunion of KYCInfoUnion. KYCInfoUnionData provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the KYCInfoUnion.

func (*KYCInfoUnionData) UnmarshalJSON added in v0.7.0

func (r *KYCInfoUnionData) UnmarshalJSON(data []byte) error

type KYCInfoUs added in v0.7.0

type KYCInfoUs struct {
	// ID of the KYC check.
	ID string `json:"id" api:"required" format:"uuid"`
	// KYC check status.
	//
	// Any of "PASS", "FAIL", "PENDING", "INCOMPLETE", "NEEDS_REVIEW".
	Status KYCStatus `json:"status" api:"required"`
	// Datetime when the KYC was last checked. ISO 8601 timestamp.
	CheckedDt time.Time `json:"checked_dt" api:"nullable" format:"date-time"`
	// KYC data for an `Entity` in the US jurisdiction.
	Data UsKYCCheckData `json:"data" api:"nullable"`
	// Jurisdiction of the KYC check.
	//
	// Any of "US".
	Jurisdiction string `json:"jurisdiction"`
	// 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
		Jurisdiction respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

KYC information for an `Entity` in the US jurisdiction.

func (KYCInfoUs) RawJSON added in v0.7.0

func (r KYCInfoUs) RawJSON() string

Returns the unmodified JSON received from the API

func (*KYCInfoUs) UnmarshalJSON added in v0.7.0

func (r *KYCInfoUs) UnmarshalJSON(data []byte) error

type KYCStatus added in v0.7.0

type KYCStatus string
const (
	KYCStatusPass        KYCStatus = "PASS"
	KYCStatusFail        KYCStatus = "FAIL"
	KYCStatusPending     KYCStatus = "PENDING"
	KYCStatusIncomplete  KYCStatus = "INCOMPLETE"
	KYCStatusNeedsReview KYCStatus = "NEEDS_REVIEW"
)

type Order

type Order struct {
	// ID of the `Order`.
	ID string `json:"id" api:"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:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `json:"chain_id" api:"required"`
	// Datetime at which the `Order` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt" api:"required" format:"date-time"`
	// Smart contract address that `Order` was created from.
	OrderContractAddress string `json:"order_contract_address" api:"required" format:"eth_address"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side" api:"required"`
	// Time in force. Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif" api:"required"`
	// Transaction hash for the `Order` creation.
	OrderTransactionHash string `json:"order_transaction_hash" api:"required" format:"hex_string"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type" api:"required"`
	// The payment token (stablecoin) address.
	PaymentToken string `json:"payment_token" api:"required" format:"eth_address"`
	// Status of the `Order`.
	//
	// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
	// "ESCROWED", "SUBMITTED", "CANCELLED", "PARTIALLY_FILLED", "FILLED", "REJECTED",
	// "REQUIRING_CONTACT", "ERROR".
	Status BrokerageOrderStatus `json:"status" api:"required"`
	// The `Alloy` ID associated with the `Order`
	AlloyID string `json:"alloy_id" api:"nullable" format:"uuid"`
	// The dShare asset token address.
	AssetToken string `json:"asset_token" api:"nullable" format:"eth_address"`
	// Total amount of assets involved.
	AssetTokenQuantity float64 `json:"asset_token_quantity" api:"nullable"`
	// Transaction hash for cancellation of `Order`, if the `Order` was cancelled.
	CancelTransactionHash string `json:"cancel_transaction_hash" api:"nullable" format:"hex_string"`
	// Customer-supplied unique identifier to map this `Order` to an order in the
	// customer's systems.
	ClientOrderID string `json:"client_order_id" api:"nullable"`
	// Fee amount associated with `Order`.
	Fee float64 `json:"fee" api:"nullable"`
	// 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" api:"nullable"`
	// Order Request ID for the `Order`
	OrderRequestID string `json:"order_request_id" api:"nullable" format:"uuid"`
	// Total amount of payment involved.
	PaymentTokenQuantity float64 `json:"payment_token_quantity" api:"nullable"`
	// The `Stock` ID associated with the `Order`
	StockID string `json:"stock_id" api:"nullable" format:"uuid"`
	// 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
		PaymentToken          respjson.Field
		Status                respjson.Field
		AlloyID               respjson.Field
		AssetToken            respjson.Field
		AssetTokenQuantity    respjson.Field
		CancelTransactionHash respjson.Field
		ClientOrderID         respjson.Field
		Fee                   respjson.Field
		LimitPrice            respjson.Field
		OrderRequestID        respjson.Field
		PaymentTokenQuantity  respjson.Field
		StockID               respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Order) RawJSON

func (r Order) RawJSON() string

Returns the unmodified JSON received from the API

func (*Order) UnmarshalJSON

func (r *Order) UnmarshalJSON(data []byte) error

type OrderRequest

type OrderRequest struct {
	// ID of `OrderRequest`. This is the primary identifier for the `/order_requests`
	// routes.
	ID string `json:"id" api:"required" format:"uuid"`
	// ID of `Account` placing the `OrderRequest`.
	AccountID string `json:"account_id" api:"required" format:"uuid"`
	// Datetime at which the `OrderRequest` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt" api:"required" format:"date-time"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side" api:"required"`
	// Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif" api:"required"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type" api:"required"`
	// Status of `OrderRequest`. Possible values:
	//
	// - `QUOTED`: Order request created with fee quote provided, ready for processing
	// - `PENDING`: Order request is being prepared for submission
	// - `PENDING_BRIDGE`: Order is waiting for bridge transaction to complete
	// - `SUBMITTED`: Order has been successfully submitted to the order book
	// - `ERROR`: An error occurred during order processing
	// - `CANCELLED`: Order request was cancelled
	// - `EXPIRED`: Order request expired due to deadline passing
	// - `REJECTED`: Order request was rejected
	//
	// Any of "QUOTED", "PENDING", "PENDING_BRIDGE", "SUBMITTED", "ERROR", "CANCELLED",
	// "EXPIRED", "REJECTED".
	Status OrderRequestStatus `json:"status" api:"required"`
	// Reason for the order cancellation if the order status is CANCELLED
	CancelMessage string `json:"cancel_message" api:"nullable"`
	// Customer-supplied ID to map this `OrderRequest` to an order in their own
	// systems.
	ClientOrderID string `json:"client_order_id" api:"nullable"`
	// ID of `Order` created from the `OrderRequest`. This is the primary identifier
	// for the `/orders` routes.
	OrderID string `json:"order_id" api:"nullable" format:"uuid"`
	// ID of recipient `Account`.
	RecipientAccountID string `json:"recipient_account_id" api:"nullable" format:"uuid"`
	// Reason for the order rejection if the order status is REJECTED
	RejectMessage string `json:"reject_message" api:"nullable"`
	// 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
		CancelMessage      respjson.Field
		ClientOrderID      respjson.Field
		OrderID            respjson.Field
		RecipientAccountID respjson.Field
		RejectMessage      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
const (
	OrderRequestStatusQuoted        OrderRequestStatus = "QUOTED"
	OrderRequestStatusPending       OrderRequestStatus = "PENDING"
	OrderRequestStatusPendingBridge OrderRequestStatus = "PENDING_BRIDGE"
	OrderRequestStatusSubmitted     OrderRequestStatus = "SUBMITTED"
	OrderRequestStatusError         OrderRequestStatus = "ERROR"
	OrderRequestStatusCancelled     OrderRequestStatus = "CANCELLED"
	OrderRequestStatusExpired       OrderRequestStatus = "EXPIRED"
	OrderRequestStatusRejected      OrderRequestStatus = "REJECTED"
)

type OrderSide

type OrderSide string
const (
	OrderSideBuy  OrderSide = "BUY"
	OrderSideSell OrderSide = "SELL"
)

type OrderTif

type OrderTif string
const (
	OrderTifDay OrderTif = "DAY"
	OrderTifGtc OrderTif = "GTC"
	OrderTifIoc OrderTif = "IOC"
	OrderTifFok OrderTif = "FOK"
)

type OrderType

type OrderType string
const (
	OrderTypeMarket OrderType = "MARKET"
	OrderTypeLimit  OrderType = "LIMIT"
)

type StockSplit

type StockSplit struct {
	// ID of the `StockSplit`
	ID string `json:"id" api:"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" api:"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" api:"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" api:"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" api:"required"`
	// The number of shares after the split. In a 10-for-1 split, this would be 10.
	SplitTo float64 `json:"split_to" api:"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" api:"required"`
	// ID of the `Stock` whose shares are being split.
	StockID string `json:"stock_id" api:"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 TokenTransfer added in v0.5.0

type TokenTransfer struct {
	// ID of the token transfer.
	ID string `json:"id" api:"required" format:"uuid"`
	// CAIP-2 chain ID of the blockchain that the transfer is made on.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID TokenTransferChainID `json:"chain_id" api:"required"`
	// Datetime at which the transfer was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt" api:"required" format:"date-time"`
	// Quantity of the token being transferred.
	Quantity float64 `json:"quantity" api:"required"`
	// ID of the account to which the tokens are transferred.
	RecipientAccountID string `json:"recipient_account_id" api:"required" format:"uuid"`
	// ID of the account from which the tokens are transferred.
	SenderAccountID string `json:"sender_account_id" api:"required" format:"uuid"`
	// Status of the token transfer.
	//
	// Any of "PENDING", "IN_PROGRESS", "COMPLETE", "FAILED".
	Status TokenTransferStatus `json:"status" api:"required"`
	// Address of the token being transferred.
	TokenAddress string `json:"token_address" api:"required" format:"eth_address"`
	// Datetime at which the transfer was last updated. ISO 8601 timestamp.
	UpdatedDt time.Time `json:"updated_dt" api:"required" format:"date-time"`
	// Transaction hash of the transfer on the blockchain, if applicable. This is only
	// present if the transfer has been executed on-chain.
	TransactionHash string `json:"transaction_hash" api:"nullable" format:"hex_string"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		ChainID            respjson.Field
		CreatedDt          respjson.Field
		Quantity           respjson.Field
		RecipientAccountID respjson.Field
		SenderAccountID    respjson.Field
		Status             respjson.Field
		TokenAddress       respjson.Field
		UpdatedDt          respjson.Field
		TransactionHash    respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about a token transfer between accounts.

func (TokenTransfer) RawJSON added in v0.5.0

func (r TokenTransfer) RawJSON() string

Returns the unmodified JSON received from the API

func (*TokenTransfer) UnmarshalJSON added in v0.5.0

func (r *TokenTransfer) UnmarshalJSON(data []byte) error

type TokenTransferChainID added in v0.13.0

type TokenTransferChainID string

CAIP-2 chain ID of the blockchain that the transfer is made on.

const (
	TokenTransferChainIDEip155_1         TokenTransferChainID = "eip155:1"
	TokenTransferChainIDEip155_42161     TokenTransferChainID = "eip155:42161"
	TokenTransferChainIDEip155_8453      TokenTransferChainID = "eip155:8453"
	TokenTransferChainIDEip155_81457     TokenTransferChainID = "eip155:81457"
	TokenTransferChainIDEip155_98866     TokenTransferChainID = "eip155:98866"
	TokenTransferChainIDEip155_11155111  TokenTransferChainID = "eip155:11155111"
	TokenTransferChainIDEip155_421614    TokenTransferChainID = "eip155:421614"
	TokenTransferChainIDEip155_84532     TokenTransferChainID = "eip155:84532"
	TokenTransferChainIDEip155_168587773 TokenTransferChainID = "eip155:168587773"
	TokenTransferChainIDEip155_98867     TokenTransferChainID = "eip155:98867"
	TokenTransferChainIDEip155_202110    TokenTransferChainID = "eip155:202110"
	TokenTransferChainIDEip155_179205    TokenTransferChainID = "eip155:179205"
	TokenTransferChainIDEip155_179202    TokenTransferChainID = "eip155:179202"
	TokenTransferChainIDEip155_98865     TokenTransferChainID = "eip155:98865"
	TokenTransferChainIDEip155_7887      TokenTransferChainID = "eip155:7887"
)

type TokenTransferStatus added in v0.5.0

type TokenTransferStatus string

Status of the token transfer.

const (
	TokenTransferStatusPending    TokenTransferStatus = "PENDING"
	TokenTransferStatusInProgress TokenTransferStatus = "IN_PROGRESS"
	TokenTransferStatusComplete   TokenTransferStatus = "COMPLETE"
	TokenTransferStatusFailed     TokenTransferStatus = "FAILED"
)

type UsKYCCheckData added in v0.7.0

type UsKYCCheckData struct {
	// Information to affirm that the individual has read, agreed to, and signed
	// Alpaca's customer agreement, found here:
	// https://files.alpaca.markets/disclosures/library/AcctAppMarginAndCustAgmt.pdf
	AlpacaCustomerAgreement UsKYCCheckDataAlpacaCustomerAgreement `json:"alpaca_customer_agreement" api:"required"`
	// AML check information for this individual. If any of the checks have a match,
	// provide details about the matches or hits found. The individual will be marked
	// as high risk and be subject to manual review.
	AmlCheck UsKYCCheckDataAmlCheck `json:"aml_check" api:"required"`
	// Data source citations for a KYC check.
	DataCitation UsKYCCheckDataDataCitation `json:"data_citation" api:"required"`
	// Employment information for the individual
	Employment UsKYCCheckDataEmployment `json:"employment" api:"required"`
	// Financial profile information for the individual <br/><br/> Examples of liquid
	// net worth ranges: <br/> - $0 - $20,000 <br/> - $20,000 - $50,000 <br/> -
	// $50,000 - $100,000 <br/> - $100,000 - $500,000 <br/> - $500,000 - $1,000,000
	FinancialProfile UsKYCCheckDataFinancialProfile `json:"financial_profile" api:"required"`
	// Identity information for the individual
	Identity UsKYCCheckDataIdentity `json:"identity" api:"required"`
	// Metadata about the KYC check.
	KYCMetadata UsKYCCheckDataKYCMetadata `json:"kyc_metadata" api:"required"`
	// The non-professional trader property is a self-attestation for US customers that
	// can affect the metered realtime data fees. This field must be updated when if
	// there is a change in the user's attestation. This field may also be modified by
	// Dinari compliance team. For more information, please see the US Customers
	// Integration Guide.
	NonProfessionalTraderAttestation UsKYCCheckDataNonProfessionalTraderAttestation `json:"non_professional_trader_attestation" api:"required"`
	// Risk information about the individual <br/><br/> Fields denote if the account
	// owner falls under each category defined by FINRA rules. If any of the answers is
	// true (yes), additional verifications may be required before US account approval.
	RiskDisclosure UsKYCCheckDataRiskDisclosure `json:"risk_disclosure" api:"required"`
	// Information for a trusted contact person for the individual. More information:
	// <br/> -
	// <a href="https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins-trusted-contact" target="_blank" rel="noopener noreferrer">Investor.gov -
	// Trusted Contact</a> <br/> -
	// <a href="https://www.finra.org/investors/insights/trusted-contact" target="_blank" rel="noopener noreferrer">FINRA -
	// Trusted Contact</a>
	TrustedContact UsKYCCheckDataTrustedContact `json:"trusted_contact" api:"required"`
	// US immigration information for this individual. Required if the individual is
	// not a US citizen.
	UsImmigrationInfo UsKYCCheckDataUsImmigrationInfo `json:"us_immigration_info" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AlpacaCustomerAgreement          respjson.Field
		AmlCheck                         respjson.Field
		DataCitation                     respjson.Field
		Employment                       respjson.Field
		FinancialProfile                 respjson.Field
		Identity                         respjson.Field
		KYCMetadata                      respjson.Field
		NonProfessionalTraderAttestation respjson.Field
		RiskDisclosure                   respjson.Field
		TrustedContact                   respjson.Field
		UsImmigrationInfo                respjson.Field
		ExtraFields                      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

KYC data for an `Entity` in the US jurisdiction.

func (UsKYCCheckData) RawJSON added in v0.7.0

func (r UsKYCCheckData) RawJSON() string

Returns the unmodified JSON received from the API

func (UsKYCCheckData) ToParam added in v0.7.0

func (r UsKYCCheckData) ToParam() UsKYCCheckDataParam

ToParam converts this UsKYCCheckData to a UsKYCCheckDataParam.

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 UsKYCCheckDataParam.Overrides()

func (*UsKYCCheckData) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckData) UnmarshalJSON(data []byte) error

type UsKYCCheckDataAlpacaCustomerAgreement added in v0.7.0

type UsKYCCheckDataAlpacaCustomerAgreement struct {
	// The IP address from where the individual signed the agreement.
	IPAddress string `json:"ip_address" api:"required" format:"ip"`
	// The timestamp the agreement was signed.
	SignedAt time.Time `json:"signed_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IPAddress   respjson.Field
		SignedAt    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information to affirm that the individual has read, agreed to, and signed Alpaca's customer agreement, found here: https://files.alpaca.markets/disclosures/library/AcctAppMarginAndCustAgmt.pdf

func (UsKYCCheckDataAlpacaCustomerAgreement) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataAlpacaCustomerAgreement) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataAlpacaCustomerAgreement) UnmarshalJSON(data []byte) error

type UsKYCCheckDataAlpacaCustomerAgreementParam added in v0.7.0

type UsKYCCheckDataAlpacaCustomerAgreementParam struct {
	// The IP address from where the individual signed the agreement.
	IPAddress string `json:"ip_address" api:"required" format:"ip"`
	// The timestamp the agreement was signed.
	SignedAt time.Time `json:"signed_at" api:"required" format:"date-time"`
	// contains filtered or unexported fields
}

Information to affirm that the individual has read, agreed to, and signed Alpaca's customer agreement, found here: https://files.alpaca.markets/disclosures/library/AcctAppMarginAndCustAgmt.pdf

The properties IPAddress, SignedAt are required.

func (UsKYCCheckDataAlpacaCustomerAgreementParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataAlpacaCustomerAgreementParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataAlpacaCustomerAgreementParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataAlpacaCustomerAgreementParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataAmlCheck added in v0.7.0

type UsKYCCheckDataAmlCheck struct {
	// Datetime that this AML check was created.
	CheckCreatedAt time.Time `json:"check_created_at" api:"required" format:"date-time"`
	// Whether there was a match in the adverse media check.
	IsAdverseMediaMatch bool `json:"is_adverse_media_match" api:"required"`
	// Whether there was a match in the monitored lists check.
	IsMonitoredListsMatch bool `json:"is_monitored_lists_match" api:"required"`
	// Whether there was a match in the politically exposed person (PEP) check.
	IsPoliticallyExposedPersonMatch bool `json:"is_politically_exposed_person_match" api:"required"`
	// Whether there was a match in the sanctions check.
	IsSanctionsMatch bool `json:"is_sanctions_match" api:"required"`
	// If any of the checks have a match, provide details about the matches or hits
	// found.
	Records []string `json:"records" api:"required"`
	// Your unique identifier for the AML check.
	RefID string `json:"ref_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CheckCreatedAt                  respjson.Field
		IsAdverseMediaMatch             respjson.Field
		IsMonitoredListsMatch           respjson.Field
		IsPoliticallyExposedPersonMatch respjson.Field
		IsSanctionsMatch                respjson.Field
		Records                         respjson.Field
		RefID                           respjson.Field
		ExtraFields                     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AML check information for this individual. If any of the checks have a match, provide details about the matches or hits found. The individual will be marked as high risk and be subject to manual review.

func (UsKYCCheckDataAmlCheck) RawJSON added in v0.7.0

func (r UsKYCCheckDataAmlCheck) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataAmlCheck) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataAmlCheck) UnmarshalJSON(data []byte) error

type UsKYCCheckDataAmlCheckParam added in v0.7.0

type UsKYCCheckDataAmlCheckParam struct {
	// Datetime that this AML check was created.
	CheckCreatedAt time.Time `json:"check_created_at" api:"required" format:"date-time"`
	// Whether there was a match in the adverse media check.
	IsAdverseMediaMatch bool `json:"is_adverse_media_match" api:"required"`
	// Whether there was a match in the monitored lists check.
	IsMonitoredListsMatch bool `json:"is_monitored_lists_match" api:"required"`
	// Whether there was a match in the politically exposed person (PEP) check.
	IsPoliticallyExposedPersonMatch bool `json:"is_politically_exposed_person_match" api:"required"`
	// Whether there was a match in the sanctions check.
	IsSanctionsMatch bool `json:"is_sanctions_match" api:"required"`
	// If any of the checks have a match, provide details about the matches or hits
	// found.
	Records []string `json:"records,omitzero" api:"required"`
	// Your unique identifier for the AML check.
	RefID string `json:"ref_id" api:"required"`
	// contains filtered or unexported fields
}

AML check information for this individual. If any of the checks have a match, provide details about the matches or hits found. The individual will be marked as high risk and be subject to manual review.

The properties CheckCreatedAt, IsAdverseMediaMatch, IsMonitoredListsMatch, IsPoliticallyExposedPersonMatch, IsSanctionsMatch, Records, RefID are required.

func (UsKYCCheckDataAmlCheckParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataAmlCheckParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataAmlCheckParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataAmlCheckParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataDataCitation added in v0.7.0

type UsKYCCheckDataDataCitation struct {
	// List of sources for address verification
	AddressSources []string `json:"address_sources" api:"required"`
	// List of sources for date of birth verification
	DateOfBirthSources []string `json:"date_of_birth_sources" api:"required"`
	// List of sources for tax ID verification
	TaxIDSources []string `json:"tax_id_sources" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AddressSources     respjson.Field
		DateOfBirthSources respjson.Field
		TaxIDSources       respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Data source citations for a KYC check.

func (UsKYCCheckDataDataCitation) RawJSON added in v0.7.0

func (r UsKYCCheckDataDataCitation) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataDataCitation) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataDataCitation) UnmarshalJSON(data []byte) error

type UsKYCCheckDataDataCitationParam added in v0.7.0

type UsKYCCheckDataDataCitationParam struct {
	// List of sources for address verification
	AddressSources []string `json:"address_sources,omitzero" api:"required"`
	// List of sources for date of birth verification
	DateOfBirthSources []string `json:"date_of_birth_sources,omitzero" api:"required"`
	// List of sources for tax ID verification
	TaxIDSources []string `json:"tax_id_sources,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Data source citations for a KYC check.

The properties AddressSources, DateOfBirthSources, TaxIDSources are required.

func (UsKYCCheckDataDataCitationParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataDataCitationParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataDataCitationParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataDataCitationParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataEmployment added in v0.7.0

type UsKYCCheckDataEmployment struct {
	// One of the following: employed, unemployed, retired, or student.
	//
	// Any of "UNEMPLOYED", "EMPLOYED", "STUDENT", "RETIRED".
	EmploymentStatus string `json:"employment_status" api:"required"`
	// The employer's address if the user is employed.
	EmployerAddress string `json:"employer_address" api:"nullable"`
	// The name of the employer if the user is employed.
	EmployerName string `json:"employer_name" api:"nullable"`
	// The user's position if they are employed.
	EmploymentPosition string `json:"employment_position" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EmploymentStatus   respjson.Field
		EmployerAddress    respjson.Field
		EmployerName       respjson.Field
		EmploymentPosition respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employment information for the individual

func (UsKYCCheckDataEmployment) RawJSON added in v0.7.0

func (r UsKYCCheckDataEmployment) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataEmployment) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataEmployment) UnmarshalJSON(data []byte) error

type UsKYCCheckDataEmploymentParam added in v0.7.0

type UsKYCCheckDataEmploymentParam struct {
	// One of the following: employed, unemployed, retired, or student.
	//
	// Any of "UNEMPLOYED", "EMPLOYED", "STUDENT", "RETIRED".
	EmploymentStatus string `json:"employment_status,omitzero" api:"required"`
	// The employer's address if the user is employed.
	EmployerAddress param.Opt[string] `json:"employer_address,omitzero"`
	// The name of the employer if the user is employed.
	EmployerName param.Opt[string] `json:"employer_name,omitzero"`
	// The user's position if they are employed.
	EmploymentPosition param.Opt[string] `json:"employment_position,omitzero"`
	// contains filtered or unexported fields
}

Employment information for the individual

The property EmploymentStatus is required.

func (UsKYCCheckDataEmploymentParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataEmploymentParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataEmploymentParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataEmploymentParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataFinancialProfile added in v0.7.0

type UsKYCCheckDataFinancialProfile struct {
	// One or more of the following: employment_income, investments, inheritance,
	// business_income, savings, family.
	//
	// Any of "EMPLOYMENT_INCOME", "INVESTMENTS", "INHERITANCE", "BUSINESS_INCOME",
	// "SAVINGS", "FAMILY".
	FundingSources []string `json:"funding_sources" api:"required"`
	// The upper bound of the user's liquid net worth (USD).
	LiquidNetWorthMax int64 `json:"liquid_net_worth_max" api:"required"`
	// The lower bound of the user's liquid net worth (USD). Can be 0 if max is
	// <=$20,000, but otherwise must be within an order of magnitude of the max value.
	LiquidNetWorthMin int64 `json:"liquid_net_worth_min" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FundingSources    respjson.Field
		LiquidNetWorthMax respjson.Field
		LiquidNetWorthMin respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Financial profile information for the individual <br/><br/> Examples of liquid net worth ranges: <br/> - $0 - $20,000 <br/> - $20,000 - $50,000 <br/> - $50,000 - $100,000 <br/> - $100,000 - $500,000 <br/> - $500,000 - $1,000,000

func (UsKYCCheckDataFinancialProfile) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataFinancialProfile) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataFinancialProfile) UnmarshalJSON(data []byte) error

type UsKYCCheckDataFinancialProfileParam added in v0.7.0

type UsKYCCheckDataFinancialProfileParam struct {
	// One or more of the following: employment_income, investments, inheritance,
	// business_income, savings, family.
	//
	// Any of "EMPLOYMENT_INCOME", "INVESTMENTS", "INHERITANCE", "BUSINESS_INCOME",
	// "SAVINGS", "FAMILY".
	FundingSources []string `json:"funding_sources,omitzero" api:"required"`
	// The upper bound of the user's liquid net worth (USD).
	LiquidNetWorthMax int64 `json:"liquid_net_worth_max" api:"required"`
	// The lower bound of the user's liquid net worth (USD). Can be 0 if max is
	// <=$20,000, but otherwise must be within an order of magnitude of the max value.
	LiquidNetWorthMin int64 `json:"liquid_net_worth_min" api:"required"`
	// contains filtered or unexported fields
}

Financial profile information for the individual <br/><br/> Examples of liquid net worth ranges: <br/> - $0 - $20,000 <br/> - $20,000 - $50,000 <br/> - $50,000 - $100,000 <br/> - $100,000 - $500,000 <br/> - $500,000 - $1,000,000

The properties FundingSources, LiquidNetWorthMax, LiquidNetWorthMin are required.

func (UsKYCCheckDataFinancialProfileParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataFinancialProfileParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataFinancialProfileParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataFinancialProfileParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataIdentity added in v0.7.0

type UsKYCCheckDataIdentity struct {
	// City of the applicant.
	City string `json:"city" api:"required"`
	// Nationality of the applicant.
	CountryOfCitizenship string `json:"country_of_citizenship" api:"required"`
	// Country of residency of the applicant. Must be 'US'.
	//
	// Any of "US".
	CountryOfTaxResidence string `json:"country_of_tax_residence" api:"required"`
	// Date of birth of the applicant.
	DateOfBirth time.Time `json:"date_of_birth" api:"required" format:"date"`
	// Email address of the applicant.
	EmailAddress string `json:"email_address" api:"required"`
	// The last name (surname) of the user.
	FamilyName string `json:"family_name" api:"required"`
	// The first/given name of the user.
	GivenName string `json:"given_name" api:"required"`
	// Phone number should include the country code, format: “+15555555555”
	PhoneNumber string `json:"phone_number" api:"required"`
	// Postal code of the applicant.
	PostalCode string `json:"postal_code" api:"required"`
	// Street address of the applicant.
	StreetAddress string `json:"street_address" api:"required"`
	// Social Security Number (SSN) or Tax Identification Number (TIN) of the
	// applicant.
	TaxID string `json:"tax_id" api:"required"`
	// The middle name of the user.
	MiddleName string `json:"middle_name" api:"nullable"`
	// State of the applicant. Required if the applicant resides in the US as a
	// 2-letter abbreviation.
	State string `json:"state" api:"nullable"`
	// The specific apartment number if applicable
	Unit string `json:"unit" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City                  respjson.Field
		CountryOfCitizenship  respjson.Field
		CountryOfTaxResidence respjson.Field
		DateOfBirth           respjson.Field
		EmailAddress          respjson.Field
		FamilyName            respjson.Field
		GivenName             respjson.Field
		PhoneNumber           respjson.Field
		PostalCode            respjson.Field
		StreetAddress         respjson.Field
		TaxID                 respjson.Field
		MiddleName            respjson.Field
		State                 respjson.Field
		Unit                  respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Identity information for the individual

func (UsKYCCheckDataIdentity) RawJSON added in v0.7.0

func (r UsKYCCheckDataIdentity) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataIdentity) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataIdentity) UnmarshalJSON(data []byte) error

type UsKYCCheckDataIdentityParam added in v0.7.0

type UsKYCCheckDataIdentityParam struct {
	// City of the applicant.
	City string `json:"city" api:"required"`
	// Nationality of the applicant.
	CountryOfCitizenship string `json:"country_of_citizenship" api:"required"`
	// Country of residency of the applicant. Must be 'US'.
	//
	// Any of "US".
	CountryOfTaxResidence string `json:"country_of_tax_residence,omitzero" api:"required"`
	// Date of birth of the applicant.
	DateOfBirth time.Time `json:"date_of_birth" api:"required" format:"date"`
	// Email address of the applicant.
	EmailAddress string `json:"email_address" api:"required"`
	// The last name (surname) of the user.
	FamilyName string `json:"family_name" api:"required"`
	// The first/given name of the user.
	GivenName string `json:"given_name" api:"required"`
	// Phone number should include the country code, format: “+15555555555”
	PhoneNumber string `json:"phone_number" api:"required"`
	// Postal code of the applicant.
	PostalCode string `json:"postal_code" api:"required"`
	// Street address of the applicant.
	StreetAddress string `json:"street_address" api:"required"`
	// Social Security Number (SSN) or Tax Identification Number (TIN) of the
	// applicant.
	TaxID string `json:"tax_id" api:"required"`
	// The middle name of the user.
	MiddleName param.Opt[string] `json:"middle_name,omitzero"`
	// State of the applicant. Required if the applicant resides in the US as a
	// 2-letter abbreviation.
	State param.Opt[string] `json:"state,omitzero"`
	// The specific apartment number if applicable
	Unit param.Opt[string] `json:"unit,omitzero"`
	// contains filtered or unexported fields
}

Identity information for the individual

The properties City, CountryOfCitizenship, CountryOfTaxResidence, DateOfBirth, EmailAddress, FamilyName, GivenName, PhoneNumber, PostalCode, StreetAddress, TaxID are required.

func (UsKYCCheckDataIdentityParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataIdentityParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataIdentityParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataIdentityParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataKYCMetadata added in v0.7.0

type UsKYCCheckDataKYCMetadata struct {
	// Completion datetime of KYC check.
	CheckCompletedAt time.Time `json:"check_completed_at" api:"required" format:"date-time"`
	// Start datetime of KYC check.
	CheckInitiatedAt time.Time `json:"check_initiated_at" api:"required" format:"date-time"`
	// IP address of applicant at time of KYC check.
	IPAddress string `json:"ip_address" api:"required" format:"ip"`
	// Your unique identifier for the KYC check.
	RefID string `json:"ref_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CheckCompletedAt respjson.Field
		CheckInitiatedAt respjson.Field
		IPAddress        respjson.Field
		RefID            respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the KYC check.

func (UsKYCCheckDataKYCMetadata) RawJSON added in v0.7.0

func (r UsKYCCheckDataKYCMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataKYCMetadata) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataKYCMetadata) UnmarshalJSON(data []byte) error

type UsKYCCheckDataKYCMetadataParam added in v0.7.0

type UsKYCCheckDataKYCMetadataParam struct {
	// Completion datetime of KYC check.
	CheckCompletedAt time.Time `json:"check_completed_at" api:"required" format:"date-time"`
	// Start datetime of KYC check.
	CheckInitiatedAt time.Time `json:"check_initiated_at" api:"required" format:"date-time"`
	// IP address of applicant at time of KYC check.
	IPAddress string `json:"ip_address" api:"required" format:"ip"`
	// Your unique identifier for the KYC check.
	RefID string `json:"ref_id" api:"required"`
	// contains filtered or unexported fields
}

Metadata about the KYC check.

The properties CheckCompletedAt, CheckInitiatedAt, IPAddress, RefID are required.

func (UsKYCCheckDataKYCMetadataParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataKYCMetadataParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataKYCMetadataParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataKYCMetadataParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataNonProfessionalTraderAttestation added in v0.8.0

type UsKYCCheckDataNonProfessionalTraderAttestation struct {
	// Datetime when the attestation was made.
	AttestationDt time.Time `json:"attestation_dt" api:"required" format:"date-time"`
	// Whether the individual attests to being a non-professional trader.
	IsNonProfessionalTrader bool `json:"is_non_professional_trader" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AttestationDt           respjson.Field
		IsNonProfessionalTrader respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The non-professional trader property is a self-attestation for US customers that can affect the metered realtime data fees. This field must be updated when if there is a change in the user's attestation. This field may also be modified by Dinari compliance team. For more information, please see the US Customers Integration Guide.

func (UsKYCCheckDataNonProfessionalTraderAttestation) RawJSON added in v0.8.0

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataNonProfessionalTraderAttestation) UnmarshalJSON added in v0.8.0

type UsKYCCheckDataNonProfessionalTraderAttestationParam added in v0.8.0

type UsKYCCheckDataNonProfessionalTraderAttestationParam struct {
	// Datetime when the attestation was made.
	AttestationDt time.Time `json:"attestation_dt" api:"required" format:"date-time"`
	// Whether the individual attests to being a non-professional trader.
	IsNonProfessionalTrader bool `json:"is_non_professional_trader" api:"required"`
	// contains filtered or unexported fields
}

The non-professional trader property is a self-attestation for US customers that can affect the metered realtime data fees. This field must be updated when if there is a change in the user's attestation. This field may also be modified by Dinari compliance team. For more information, please see the US Customers Integration Guide.

The properties AttestationDt, IsNonProfessionalTrader are required.

func (UsKYCCheckDataNonProfessionalTraderAttestationParam) MarshalJSON added in v0.8.0

func (r UsKYCCheckDataNonProfessionalTraderAttestationParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataNonProfessionalTraderAttestationParam) UnmarshalJSON added in v0.8.0

type UsKYCCheckDataParam added in v0.7.0

type UsKYCCheckDataParam struct {
	// Information to affirm that the individual has read, agreed to, and signed
	// Alpaca's customer agreement, found here:
	// https://files.alpaca.markets/disclosures/library/AcctAppMarginAndCustAgmt.pdf
	AlpacaCustomerAgreement UsKYCCheckDataAlpacaCustomerAgreementParam `json:"alpaca_customer_agreement,omitzero" api:"required"`
	// AML check information for this individual. If any of the checks have a match,
	// provide details about the matches or hits found. The individual will be marked
	// as high risk and be subject to manual review.
	AmlCheck UsKYCCheckDataAmlCheckParam `json:"aml_check,omitzero" api:"required"`
	// Data source citations for a KYC check.
	DataCitation UsKYCCheckDataDataCitationParam `json:"data_citation,omitzero" api:"required"`
	// Employment information for the individual
	Employment UsKYCCheckDataEmploymentParam `json:"employment,omitzero" api:"required"`
	// Financial profile information for the individual <br/><br/> Examples of liquid
	// net worth ranges: <br/> - $0 - $20,000 <br/> - $20,000 - $50,000 <br/> -
	// $50,000 - $100,000 <br/> - $100,000 - $500,000 <br/> - $500,000 - $1,000,000
	FinancialProfile UsKYCCheckDataFinancialProfileParam `json:"financial_profile,omitzero" api:"required"`
	// Identity information for the individual
	Identity UsKYCCheckDataIdentityParam `json:"identity,omitzero" api:"required"`
	// Metadata about the KYC check.
	KYCMetadata UsKYCCheckDataKYCMetadataParam `json:"kyc_metadata,omitzero" api:"required"`
	// The non-professional trader property is a self-attestation for US customers that
	// can affect the metered realtime data fees. This field must be updated when if
	// there is a change in the user's attestation. This field may also be modified by
	// Dinari compliance team. For more information, please see the US Customers
	// Integration Guide.
	NonProfessionalTraderAttestation UsKYCCheckDataNonProfessionalTraderAttestationParam `json:"non_professional_trader_attestation,omitzero" api:"required"`
	// Risk information about the individual <br/><br/> Fields denote if the account
	// owner falls under each category defined by FINRA rules. If any of the answers is
	// true (yes), additional verifications may be required before US account approval.
	RiskDisclosure UsKYCCheckDataRiskDisclosureParam `json:"risk_disclosure,omitzero" api:"required"`
	// Information for a trusted contact person for the individual. More information:
	// <br/> -
	// <a href="https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins-trusted-contact" target="_blank" rel="noopener noreferrer">Investor.gov -
	// Trusted Contact</a> <br/> -
	// <a href="https://www.finra.org/investors/insights/trusted-contact" target="_blank" rel="noopener noreferrer">FINRA -
	// Trusted Contact</a>
	TrustedContact UsKYCCheckDataTrustedContactParam `json:"trusted_contact,omitzero" api:"required"`
	// US immigration information for this individual. Required if the individual is
	// not a US citizen.
	UsImmigrationInfo UsKYCCheckDataUsImmigrationInfoParam `json:"us_immigration_info,omitzero"`
	// contains filtered or unexported fields
}

KYC data for an `Entity` in the US jurisdiction.

The properties AlpacaCustomerAgreement, AmlCheck, DataCitation, Employment, FinancialProfile, Identity, KYCMetadata, NonProfessionalTraderAttestation, RiskDisclosure, TrustedContact are required.

func (UsKYCCheckDataParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataRiskDisclosure added in v0.7.0

type UsKYCCheckDataRiskDisclosure struct {
	// If the individual's immediate family member (sibling, husband/wife, child,
	// parent) is either politically exposed or holds a control position.
	ImmediateFamilyExposed bool `json:"immediate_family_exposed" api:"required"`
	// Whether the individual is affiliated with any exchanges or FINRA.
	IsAffiliatedExchangeOrFinra bool `json:"is_affiliated_exchange_or_finra" api:"required"`
	// Whether the individual holds a controlling position in a publicly traded
	// company, is a member of the board of directors, or has policy making abilities
	// in a publicly traded company.
	IsControlPerson bool `json:"is_control_person" api:"required"`
	// Whether the individual is politically exposed.
	IsPoliticallyExposed bool `json:"is_politically_exposed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ImmediateFamilyExposed      respjson.Field
		IsAffiliatedExchangeOrFinra respjson.Field
		IsControlPerson             respjson.Field
		IsPoliticallyExposed        respjson.Field
		ExtraFields                 map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Risk information about the individual <br/><br/> Fields denote if the account owner falls under each category defined by FINRA rules. If any of the answers is true (yes), additional verifications may be required before US account approval.

func (UsKYCCheckDataRiskDisclosure) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataRiskDisclosure) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataRiskDisclosure) UnmarshalJSON(data []byte) error

type UsKYCCheckDataRiskDisclosureParam added in v0.7.0

type UsKYCCheckDataRiskDisclosureParam struct {
	// If the individual's immediate family member (sibling, husband/wife, child,
	// parent) is either politically exposed or holds a control position.
	ImmediateFamilyExposed bool `json:"immediate_family_exposed" api:"required"`
	// Whether the individual is affiliated with any exchanges or FINRA.
	IsAffiliatedExchangeOrFinra bool `json:"is_affiliated_exchange_or_finra" api:"required"`
	// Whether the individual holds a controlling position in a publicly traded
	// company, is a member of the board of directors, or has policy making abilities
	// in a publicly traded company.
	IsControlPerson bool `json:"is_control_person" api:"required"`
	// Whether the individual is politically exposed.
	IsPoliticallyExposed bool `json:"is_politically_exposed" api:"required"`
	// contains filtered or unexported fields
}

Risk information about the individual <br/><br/> Fields denote if the account owner falls under each category defined by FINRA rules. If any of the answers is true (yes), additional verifications may be required before US account approval.

The properties ImmediateFamilyExposed, IsAffiliatedExchangeOrFinra, IsControlPerson, IsPoliticallyExposed are required.

func (UsKYCCheckDataRiskDisclosureParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataRiskDisclosureParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataRiskDisclosureParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataRiskDisclosureParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataTrustedContact added in v0.7.0

type UsKYCCheckDataTrustedContact struct {
	// The family name of the trusted contact
	FamilyName string `json:"family_name" api:"required"`
	// The given name of the trusted contact
	GivenName string `json:"given_name" api:"required"`
	// The email address of the trusted contact. At least one of email_address or
	// phone_number is required.
	EmailAddress string `json:"email_address" api:"nullable"`
	// The phone number of the trusted contact. At least one of email_address or
	// phone_number is required.
	PhoneNumber string `json:"phone_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FamilyName   respjson.Field
		GivenName    respjson.Field
		EmailAddress respjson.Field
		PhoneNumber  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information for a trusted contact person for the individual. More information: <br/> - <a href="https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins-trusted-contact" target="_blank" rel="noopener noreferrer">Investor.gov - Trusted Contact</a> <br/> - <a href="https://www.finra.org/investors/insights/trusted-contact" target="_blank" rel="noopener noreferrer">FINRA - Trusted Contact</a>

func (UsKYCCheckDataTrustedContact) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataTrustedContact) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataTrustedContact) UnmarshalJSON(data []byte) error

type UsKYCCheckDataTrustedContactParam added in v0.7.0

type UsKYCCheckDataTrustedContactParam struct {
	// The family name of the trusted contact
	FamilyName string `json:"family_name" api:"required"`
	// The given name of the trusted contact
	GivenName string `json:"given_name" api:"required"`
	// The email address of the trusted contact. At least one of email_address or
	// phone_number is required.
	EmailAddress param.Opt[string] `json:"email_address,omitzero"`
	// The phone number of the trusted contact. At least one of email_address or
	// phone_number is required.
	PhoneNumber param.Opt[string] `json:"phone_number,omitzero"`
	// contains filtered or unexported fields
}

Information for a trusted contact person for the individual. More information: <br/> - <a href="https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins-trusted-contact" target="_blank" rel="noopener noreferrer">Investor.gov - Trusted Contact</a> <br/> - <a href="https://www.finra.org/investors/insights/trusted-contact" target="_blank" rel="noopener noreferrer">FINRA - Trusted Contact</a>

The properties FamilyName, GivenName are required.

func (UsKYCCheckDataTrustedContactParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataTrustedContactParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataTrustedContactParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataTrustedContactParam) UnmarshalJSON(data []byte) error

type UsKYCCheckDataUsImmigrationInfo added in v0.7.0

type UsKYCCheckDataUsImmigrationInfo struct {
	// Country where the individual was born.
	CountryOfBirth string `json:"country_of_birth" api:"required"`
	// Whether the individual is a US permanent resident (green card holder).
	IsPermanentResident bool `json:"is_permanent_resident" api:"required"`
	// Date the individual is scheduled to leave the US. Required for B1 and B2 visas.
	DepartureFromUsDate time.Time `json:"departure_from_us_date" api:"nullable" format:"date"`
	// Expiration date of the visa. Required if visa_type is provided.
	VisaExpirationDate time.Time `json:"visa_expiration_date" api:"nullable" format:"date"`
	// Type of visa the individual holds. Required if not a permanent resident.
	//
	// Any of "B1", "B2", "DACA", "E1", "E2", "E3", "F1", "G4", "H1B", "J1", "L1",
	// "Other", "O1", "TN1".
	VisaType string `json:"visa_type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CountryOfBirth      respjson.Field
		IsPermanentResident respjson.Field
		DepartureFromUsDate respjson.Field
		VisaExpirationDate  respjson.Field
		VisaType            respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

US immigration information for this individual. Required if the individual is not a US citizen.

func (UsKYCCheckDataUsImmigrationInfo) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*UsKYCCheckDataUsImmigrationInfo) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataUsImmigrationInfo) UnmarshalJSON(data []byte) error

type UsKYCCheckDataUsImmigrationInfoParam added in v0.7.0

type UsKYCCheckDataUsImmigrationInfoParam struct {
	// Country where the individual was born.
	CountryOfBirth string `json:"country_of_birth" api:"required"`
	// Whether the individual is a US permanent resident (green card holder).
	IsPermanentResident bool `json:"is_permanent_resident" api:"required"`
	// Date the individual is scheduled to leave the US. Required for B1 and B2 visas.
	DepartureFromUsDate param.Opt[time.Time] `json:"departure_from_us_date,omitzero" format:"date"`
	// Expiration date of the visa. Required if visa_type is provided.
	VisaExpirationDate param.Opt[time.Time] `json:"visa_expiration_date,omitzero" format:"date"`
	// Type of visa the individual holds. Required if not a permanent resident.
	//
	// Any of "B1", "B2", "DACA", "E1", "E2", "E3", "F1", "G4", "H1B", "J1", "L1",
	// "Other", "O1", "TN1".
	VisaType string `json:"visa_type,omitzero"`
	// contains filtered or unexported fields
}

US immigration information for this individual. Required if the individual is not a US citizen.

The properties CountryOfBirth, IsPermanentResident are required.

func (UsKYCCheckDataUsImmigrationInfoParam) MarshalJSON added in v0.7.0

func (r UsKYCCheckDataUsImmigrationInfoParam) MarshalJSON() (data []byte, err error)

func (*UsKYCCheckDataUsImmigrationInfoParam) UnmarshalJSON added in v0.7.0

func (r *UsKYCCheckDataUsImmigrationInfoParam) UnmarshalJSON(data []byte) error

type V2AccountActivityGetBrokerageParams added in v0.7.0

type V2AccountActivityGetBrokerageParams struct {
	// The maximum number of entries to return in the response. Defaults to 100.
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Pagination token. Set to the `id` field of the last Activity returned in the
	// previous page to get the next page of results.
	PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountActivityGetBrokerageParams) URLQuery added in v0.7.0

func (r V2AccountActivityGetBrokerageParams) URLQuery() (v url.Values, err error)

URLQuery serializes V2AccountActivityGetBrokerageParams's query parameters as `url.Values`.

type V2AccountActivityService added in v0.7.0

type V2AccountActivityService struct {
	Options []option.RequestOption
}

**`Accounts` represent the financial accounts of an `Entity`.**

`Orders`, dividends, and other transactions are associated with an `Account`.

V2AccountActivityService 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 NewV2AccountActivityService method instead.

func NewV2AccountActivityService added in v0.7.0

func NewV2AccountActivityService(opts ...option.RequestOption) (r V2AccountActivityService)

NewV2AccountActivityService 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 (*V2AccountActivityService) GetBrokerage added in v0.7.0

func (r *V2AccountActivityService) GetBrokerage(ctx context.Context, accountID string, query V2AccountActivityGetBrokerageParams, opts ...option.RequestOption) (err error)

Get a list of brokerage activities tied to the specified `Account`.

**⚠️ ALPHA: This endpoint is in early development and subject to breaking changes.**

type V2AccountGetCashBalancesResponse

type V2AccountGetCashBalancesResponse struct {
	// Total amount of the payment token in the `Account`.
	Amount float64 `json:"amount" api:"required"`
	// CAIP-2 chain ID of the payment token.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `json:"chain_id" api:"required"`
	// Symbol of the payment token.
	Symbol string `json:"symbol" api:"required"`
	// Address of the payment token.
	TokenAddress string `json:"token_address" api:"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

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" api:"required" format:"date" json:"-"`
	// Start date, inclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
	StartDate time.Time `query:"start_date" api:"required" format:"date" json:"-"`
	// Optional ID of the `Stock` to filter by
	StockID  param.Opt[string] `query:"stock_id,omitzero" 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 (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" api:"required"`
	// Currency in which the dividend was paid. (e.g. USD)
	Currency string `json:"currency" api:"required"`
	// Date the dividend was distributed to the account. ISO 8601 format, YYYY-MM-DD.
	PaymentDate time.Time `json:"payment_date" api:"required" format:"date"`
	// ID of the `Stock` for which the dividend was paid.
	StockID string `json:"stock_id" api:"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

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" api:"required" format:"date" json:"-"`
	// Start date, inclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
	StartDate time.Time        `query:"start_date" api:"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" api:"required"`
	// Currency in which the interest was paid (e.g. USD).
	Currency string `json:"currency" api:"required"`
	// Date of interest payment in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
	PaymentDate time.Time `json:"payment_date" api:"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

Returns the unmodified JSON received from the API

func (*V2AccountGetInterestPaymentsResponse) UnmarshalJSON

func (r *V2AccountGetInterestPaymentsResponse) UnmarshalJSON(data []byte) error

type V2AccountGetPortfolioParams added in v0.6.0

type V2AccountGetPortfolioParams struct {
	// The page number.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// The number of stocks to return per page, maximum number is 200.
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountGetPortfolioParams) URLQuery added in v0.6.0

func (r V2AccountGetPortfolioParams) URLQuery() (v url.Values, err error)

URLQuery serializes V2AccountGetPortfolioParams's query parameters as `url.Values`.

type V2AccountGetPortfolioResponse

type V2AccountGetPortfolioResponse struct {
	// Balance details for all owned `Stocks`.
	Assets []V2AccountGetPortfolioResponseAsset `json:"assets" api:"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

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" api:"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:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `json:"chain_id" api:"required"`
	// ID of the underlying `Stock` represented by the dShare asset token.
	StockID string `json:"stock_id" api:"required" format:"uuid"`
	// Token symbol of the dShare asset token.
	Symbol string `json:"symbol" api:"required"`
	// Address of the dShare asset token.
	TokenAddress string `json:"token_address" api:"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

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:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	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 V2AccountOrderBatchCancelParams added in v0.6.0

type V2AccountOrderBatchCancelParams struct {
	// List of `Order` IDs to cancel
	OrderIDs []string `json:"order_ids,omitzero" api:"required" format:"uuid"`
	// contains filtered or unexported fields
}

func (V2AccountOrderBatchCancelParams) MarshalJSON added in v0.6.0

func (r V2AccountOrderBatchCancelParams) MarshalJSON() (data []byte, err error)

func (*V2AccountOrderBatchCancelParams) UnmarshalJSON added in v0.6.0

func (r *V2AccountOrderBatchCancelParams) UnmarshalJSON(data []byte) error

type V2AccountOrderBatchCancelResponse added in v0.6.0

type V2AccountOrderBatchCancelResponse struct {
	// Orders that were queued to cancel.
	CancelQueuedOrders []Order `json:"cancel_queued_orders" api:"required"`
	// Orders that could not be queued to cancel.
	FailedToCancelOrders []Order `json:"failed_to_cancel_orders" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CancelQueuedOrders   respjson.Field
		FailedToCancelOrders respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (V2AccountOrderBatchCancelResponse) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*V2AccountOrderBatchCancelResponse) UnmarshalJSON added in v0.6.0

func (r *V2AccountOrderBatchCancelResponse) UnmarshalJSON(data []byte) error

type V2AccountOrderCancelParams

type V2AccountOrderCancelParams struct {
	AccountID string `path:"account_id" api:"required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type V2AccountOrderFulfillmentGetParams

type V2AccountOrderFulfillmentGetParams struct {
	AccountID string `path:"account_id" api:"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
}

**`Orders` represent the buying and selling of assets under an `Account`.**

For `Accounts` using self-custodied `Wallets`, `Orders` are created and fulfilled by making calls to Dinari's smart contracts, or using the _Proxied Orders_ methods.

For `Accounts` using managed `Wallets`, `Orders` are created and fulfilled by using the `Managed Orders` methods, which then create the corresponding transactions on the blockchain.

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

Get a specific `OrderFulfillment` by its ID.

func (*V2AccountOrderFulfillmentService) Query

Query `OrderFulfillments` under the `Account`.

type V2AccountOrderGetFulfillmentsParams

type V2AccountOrderGetFulfillmentsParams struct {
	AccountID string           `path:"account_id" api:"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" api:"required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type V2AccountOrderListParams

type V2AccountOrderListParams struct {
	// Customer-supplied identifier to search for `Order`s.
	ClientOrderID param.Opt[string] `query:"client_order_id,omitzero" json:"-"`
	// Transaction hash of the `Order`.
	OrderTransactionHash param.Opt[string] `query:"order_transaction_hash,omitzero" json:"-"`
	Page                 param.Opt[int64]  `query:"page,omitzero" json:"-"`
	PageSize             param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	// CAIP-2 formatted chain ID of the blockchain the `Order` was made on.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `query:"chain_id,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 V2AccountOrderRequestEip155NewPermitParams added in v0.6.0

type V2AccountOrderRequestEip155NewPermitParams 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:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `json:"chain_id,omitzero" api:"required"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,omitzero" api:"required"`
	// Time in force. Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif,omitzero" api:"required"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,omitzero" api:"required"`
	// Address of payment token.
	PaymentToken string `json:"payment_token" api:"required" format:"eth_address"`
	// The ID of the `Alloy` for which the `Order` is being placed.
	AlloyID param.Opt[string] `json:"alloy_id,omitzero" format:"uuid"`
	// Amount of dShare asset tokens involved. Required for limit `Order Requests` and
	// market sell `Order Requests`. Must be a positive number with a precision of up
	// to 4 decimal places for limit `Order Requests` or up to 6 decimal places for
	// market sell `Order Requests`.
	AssetTokenQuantity param.Opt[float64] `json:"asset_token_quantity,omitzero"`
	// Customer-supplied unique identifier to map this `Order` to an order in the
	// customer's systems.
	ClientOrderID param.Opt[string] `json:"client_order_id,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"`
	// Amount of payment tokens involved. Required for market buy `Orders`.
	PaymentTokenQuantity param.Opt[float64] `json:"payment_token_quantity,omitzero"`
	// The ID of the `Stock` for which the `Order` is being placed.
	StockID param.Opt[string] `json:"stock_id,omitzero" format:"uuid"`
	// The ID of the `Token` for which the `Order` is being placed.
	TokenID param.Opt[string] `json:"token_id,omitzero" format:"uuid"`
	// contains filtered or unexported fields
}

func (V2AccountOrderRequestEip155NewPermitParams) MarshalJSON added in v0.6.0

func (r V2AccountOrderRequestEip155NewPermitParams) MarshalJSON() (data []byte, err error)

func (*V2AccountOrderRequestEip155NewPermitParams) UnmarshalJSON added in v0.6.0

func (r *V2AccountOrderRequestEip155NewPermitParams) UnmarshalJSON(data []byte) error

type V2AccountOrderRequestEip155NewPermitResponse added in v0.6.0

type V2AccountOrderRequestEip155NewPermitResponse struct {
	// ID representing the EIP155 `OrderRequest`
	OrderRequestID string `json:"order_request_id" api:"required" format:"uuid"`
	// Token permit that is to be signed by smart contract submitter for authorizing
	// token transfer for the `OrderRequest`
	Permit map[string]any `json:"permit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		OrderRequestID respjson.Field
		Permit         respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token permit to be signed by the smart contract submitter.

func (V2AccountOrderRequestEip155NewPermitResponse) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*V2AccountOrderRequestEip155NewPermitResponse) UnmarshalJSON added in v0.6.0

func (r *V2AccountOrderRequestEip155NewPermitResponse) UnmarshalJSON(data []byte) error

type V2AccountOrderRequestEip155NewPermitTransactionParams added in v0.6.0

type V2AccountOrderRequestEip155NewPermitTransactionParams struct {
	// Input parameters for creating a proxied `EIP155OrderRequestPermitTransaction`.
	Eip155OrderRequestPermitTransaction Eip155OrderRequestPermitTransactionParam
	// contains filtered or unexported fields
}

func (V2AccountOrderRequestEip155NewPermitTransactionParams) MarshalJSON added in v0.6.0

func (*V2AccountOrderRequestEip155NewPermitTransactionParams) UnmarshalJSON added in v0.6.0

type V2AccountOrderRequestEip155NewPermitTransactionResponse added in v0.6.0

type V2AccountOrderRequestEip155NewPermitTransactionResponse struct {
	// [JSON ABI](https://docs.soliditylang.org/en/v0.8.30/abi-spec.html#json) of the
	// smart contract function encoded in the transaction. Provided for informational
	// purposes.
	Abi any `json:"abi" api:"required"`
	// Arguments to the smart contract function encoded in the transaction. Provided
	// for informational purposes.
	Args any `json:"args" api:"required"`
	// Smart contract address that the transaction should call.
	ContractAddress string `json:"contract_address" api:"required" format:"eth_address"`
	// Hex-encoded function call.
	Data string `json:"data" api:"required" format:"hex_string"`
	// Transaction value estimate in Wei.
	Value string `json:"value" api:"required" format:"bigint"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Abi             respjson.Field
		Args            respjson.Field
		ContractAddress respjson.Field
		Data            respjson.Field
		Value           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (V2AccountOrderRequestEip155NewPermitTransactionResponse) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*V2AccountOrderRequestEip155NewPermitTransactionResponse) UnmarshalJSON added in v0.6.0

type V2AccountOrderRequestEip155Service added in v0.6.0

type V2AccountOrderRequestEip155Service struct {
	Options []option.RequestOption
}

**`Order Requests` represent requests for Dinari to create `Orders` on behalf of an `Account`.**

`Order Requests` are created when placing **proxied orders** or **managed orders**. See their respective descriptions for more details.

V2AccountOrderRequestEip155Service 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 NewV2AccountOrderRequestEip155Service method instead.

func NewV2AccountOrderRequestEip155Service added in v0.6.0

func NewV2AccountOrderRequestEip155Service(opts ...option.RequestOption) (r V2AccountOrderRequestEip155Service)

NewV2AccountOrderRequestEip155Service 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 (*V2AccountOrderRequestEip155Service) NewPermit added in v0.6.0

Generates a permit that can be signed and used to create an `OrderRequest` using Dinari's EVM smart contracts.

This is a convenience method to prepare the transactions needed to create an `OrderRequest` using Dinari's EVM smart contracts. Once signed, the transactions can be sent to the EVM network to create the order. Note that the fee quote is already included in the transactions, so no additional fee quote lookup is needed.

func (*V2AccountOrderRequestEip155Service) NewPermitTransaction added in v0.6.0

Prepare a transaction to be placed on EVM. The returned structure contains the necessary data to create an `EIP155Transaction` object.

func (*V2AccountOrderRequestEip155Service) Submit added in v0.6.0

Submits a transaction for an EIP155 Order Request given the EIP155OrderRequest ID and Permit Signature.

An `EIP155OrderRequest` representing the proxied order is returned.

type V2AccountOrderRequestEip155SubmitParams added in v0.6.0

type V2AccountOrderRequestEip155SubmitParams struct {
	// Input parameters for creating a proxied `EIP155OrderRequestPermitTransaction`.
	Eip155OrderRequestPermitTransaction Eip155OrderRequestPermitTransactionParam
	// contains filtered or unexported fields
}

func (V2AccountOrderRequestEip155SubmitParams) MarshalJSON added in v0.6.0

func (r V2AccountOrderRequestEip155SubmitParams) MarshalJSON() (data []byte, err error)

func (*V2AccountOrderRequestEip155SubmitParams) UnmarshalJSON added in v0.6.0

func (r *V2AccountOrderRequestEip155SubmitParams) UnmarshalJSON(data []byte) error

type V2AccountOrderRequestEip155SubmitResponse added in v0.6.0

type V2AccountOrderRequestEip155SubmitResponse struct {
	// ID of `EIP155OrderRequest`. This is the primary identifier for the
	// `/order_requests` routes.
	ID string `json:"id" api:"required" format:"uuid"`
	// ID of `Account` placing the `EIP155OrderRequest`.
	AccountID string `json:"account_id" api:"required" format:"uuid"`
	// Datetime at which the `EIP155OrderRequest` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt" api:"required" format:"date-time"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side" api:"required"`
	// Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif" api:"required"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type" api:"required"`
	// Status of `EIP155OrderRequest`. Possible values:
	//
	// - `QUOTED`: Order request created with fee quote provided, ready for processing
	// - `PENDING`: Order request is being prepared for submission
	// - `PENDING_BRIDGE`: Order is waiting for bridge transaction to complete
	// - `SUBMITTED`: Order has been successfully submitted to the order book
	// - `ERROR`: An error occurred during order processing
	// - `CANCELLED`: Order request was cancelled
	// - `EXPIRED`: Order request expired due to deadline passing
	// - `REJECTED`: Order request was rejected
	//
	// Any of "QUOTED", "PENDING", "PENDING_BRIDGE", "SUBMITTED", "ERROR", "CANCELLED",
	// "EXPIRED", "REJECTED".
	Status OrderRequestStatus `json:"status" api:"required"`
	// Reason for the order cancellation if the order status is CANCELLED
	CancelMessage string `json:"cancel_message" api:"nullable"`
	// ID of `Order` created from the `EIP155OrderRequest`. This is the primary
	// identifier for the `/orders` routes.
	OrderID string `json:"order_id" api:"nullable" format:"uuid"`
	// ID of recipient `Account`.
	RecipientAccountID string `json:"recipient_account_id" api:"nullable" format:"uuid"`
	// Reason for the order rejection if the order status is REJECTED
	RejectMessage string `json:"reject_message" api:"nullable"`
	// 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
		CancelMessage      respjson.Field
		OrderID            respjson.Field
		RecipientAccountID respjson.Field
		RejectMessage      respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A request to create an `Order`.

An `EIP155OrderRequest` is created when a user places an order through the Dinari API. The `EIP155OrderRequest` is then fulfilled by creating an `Order` on-chain.

The `EIP155OrderRequest` 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 (V2AccountOrderRequestEip155SubmitResponse) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*V2AccountOrderRequestEip155SubmitResponse) UnmarshalJSON added in v0.6.0

func (r *V2AccountOrderRequestEip155SubmitResponse) UnmarshalJSON(data []byte) error

type V2AccountOrderRequestGetFeeQuoteParams

type V2AccountOrderRequestGetFeeQuoteParams struct {
	// Indicates whether `Order Request` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,omitzero" api:"required"`
	// Type of `Order Request`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,omitzero" api:"required"`
	// The `Alloy` ID associated with the Order Request
	AlloyID param.Opt[string] `json:"alloy_id,omitzero" format:"uuid"`
	// Amount of dShare asset tokens involved. Required for limit `Order Requests` and
	// market sell `Order Requests`. Must be a positive number with a precision of up
	// to 4 decimal places for limit `Order Requests` or up to 6 decimal places for
	// 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"`
	// Address of the payment token to be used for an order. If not provided, the
	// default payment token (USD+) will be used.
	PaymentTokenAddress param.Opt[string] `json:"payment_token_address,omitzero" format:"eth_address"`
	// Amount of payment tokens involved. Required for market buy `Order Requests`.
	PaymentTokenQuantity param.Opt[float64] `json:"payment_token_quantity,omitzero"`
	// The `Stock` ID associated with the Order Request
	StockID param.Opt[string] `json:"stock_id,omitzero" format:"uuid"`
	// CAIP-2 chain ID of the blockchain where the `Order Request` will be placed. If
	// not provided, the default chain ID (eip155:42161) will be used.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `json:"chain_id,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" api:"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

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" api:"required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type V2AccountOrderRequestListParams

type V2AccountOrderRequestListParams struct {
	// Customer-supplied ID to map this `OrderRequest` to an order in their own
	// systems.
	ClientOrderID param.Opt[string] `query:"client_order_id,omitzero" json:"-"`
	// Order ID for the `OrderRequest`
	OrderID param.Opt[string] `query:"order_id,omitzero" format:"uuid" json:"-"`
	// Order Request ID for the `OrderRequest`
	OrderRequestID param.Opt[string] `query:"order_request_id,omitzero" 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 (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 buy `OrderRequest`.
	CreateLimitBuyOrderInput CreateLimitBuyOrderInputParam
	// 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 sell `OrderRequest`.
	CreateLimitSellOrderInput CreateLimitSellOrderInputParam
	// 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 {
	// Input parameters for creating a market buy `OrderRequest`.
	CreateMarketBuyOrderInput CreateMarketBuyOrderInputParam
	// 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 {
	// Input parameters for creating a market sell `OrderRequest`.
	CreateMarketSellOrderInput CreateMarketSellOrderInputParam
	// 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
	// **`Order Requests` represent requests for Dinari to create `Orders` on behalf of
	// an `Account`.**
	//
	// `Order Requests` are created when placing **proxied orders** or **managed
	// orders**. See their respective descriptions for more details.
	Eip155 V2AccountOrderRequestEip155Service
}

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

Get a specific `OrderRequest` by its ID.

func (*V2AccountOrderRequestService) GetFeeQuote

Get fee quote data for an `Order Request`. This is provided primarily for informational purposes.

For market buy orders, the notional amount of the order includes the fees. For market and limit sell orders, fees are deducted from the proceeds of the sale. For limit buy orders, the fees are added to the total cost of the order.

func (*V2AccountOrderRequestService) List

Lists `OrderRequests`. Optionally `OrderRequests` can be filtered by certain parameters.

func (*V2AccountOrderRequestService) NewLimitBuy

Create a managed `OrderRequest` to place a limit buy `Order`.

Fees for the `Order` are included in the transaction. Refer to our [Fee Quote API](https://docs.dinari.com/reference/createproxiedorderfeequote#/) for fee estimation.

If an `OrderRequest` with the same `client_order_id` already exists for the given account, the creation call will fail.

func (*V2AccountOrderRequestService) NewLimitSell

Create a managed `OrderRequest` to place a limit sell `Order`.

Fees for the `Order` are included in the transaction. Refer to our [Fee Quote API](https://docs.dinari.com/reference/createproxiedorderfeequote#/) for fee estimation.

If an `OrderRequest` with the same `client_order_id` already exists for the given account, the creation call will fail.

func (*V2AccountOrderRequestService) NewMarketBuy

Create a managed `OrderRequest` to place a market buy `Order`.

Fees for the `Order` are included in the transaction. Refer to our [Fee Quote API](https://docs.dinari.com/reference/createproxiedorderfeequote#/) for fee estimation.

If an `OrderRequest` with the same `client_order_id` already exists for the given account, the creation call will fail.

func (*V2AccountOrderRequestService) NewMarketSell

Create a managed `OrderRequest` to place a market sell `Order`.

Fees for the `Order` are included in the transaction. Refer to our [Fee Quote API](https://docs.dinari.com/reference/createproxiedorderfeequote#/) for fee estimation.

If an `OrderRequest` with the same `client_order_id` already exists for the given account, the creation call will fail.

type V2AccountOrderService

type V2AccountOrderService struct {
	Options []option.RequestOption
}

**`Orders` represent the buying and selling of assets under an `Account`.**

For `Accounts` using self-custodied `Wallets`, `Orders` are created and fulfilled by making calls to Dinari's smart contracts, or using the _Proxied Orders_ methods.

For `Accounts` using managed `Wallets`, `Orders` are created and fulfilled by using the `Managed Orders` methods, which then create the corresponding transactions on the blockchain.

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) BatchCancel added in v0.6.0

Cancel multiple `Orders` by their IDs in a single request. Note that this requires the `Order` IDs, not the `OrderRequest` IDs. 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 `Orders` may still be executed if the cancellation request is not received in time.

The response will indicate which orders were successfully queued to cancel and which failed to queue. Check the status using the "Get Order by ID" endpoint to confirm whether individual `Orders` have been cancelled.

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) 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`. Optionally `Orders` can be filtered by chain ID, transaction hash, or client order ID.

type V2AccountService

type V2AccountService struct {
	Options []option.RequestOption
	// **`Wallets` represent the blockchain wallet that holds the assets of an
	// `Account`.**
	//
	// An `Account` may be connected to a single `Wallet`.
	//
	// Individual `Entities` can connect their self-custodied `Wallets` by proving
	// ownership of the `Wallet` address. For Dinari Partners, a Dinari-managed
	// `Wallet` can be created for the Partner `Entity` in the
	// [Dinari Partners Portal](https://Partners.dinari.com/). This may be used in
	// omnibus accounting for self-managing customers' assets.
	Wallet V2AccountWalletService
	// **`Orders` represent the buying and selling of assets under an `Account`.**
	//
	// For `Accounts` using self-custodied `Wallets`, `Orders` are created and
	// fulfilled by making calls to Dinari's smart contracts, or using the _Proxied
	// Orders_ methods.
	//
	// For `Accounts` using managed `Wallets`, `Orders` are created and fulfilled by
	// using the `Managed Orders` methods, which then create the corresponding
	// transactions on the blockchain.
	Orders V2AccountOrderService
	// **`Orders` represent the buying and selling of assets under an `Account`.**
	//
	// For `Accounts` using self-custodied `Wallets`, `Orders` are created and
	// fulfilled by making calls to Dinari's smart contracts, or using the _Proxied
	// Orders_ methods.
	//
	// For `Accounts` using managed `Wallets`, `Orders` are created and fulfilled by
	// using the `Managed Orders` methods, which then create the corresponding
	// transactions on the blockchain.
	OrderFulfillments V2AccountOrderFulfillmentService
	OrderRequests     V2AccountOrderRequestService
	// **`Withdrawals` represent the transfer of stablecoins from an `Account`
	// connected to a managed `Wallet` to another `Account` that is owned by the
	// `Entity`.**
	//
	// Since the `Account` is backed by a managed `Wallet`, the `Withdrawal` must be
	// processed by Dinari and the corresponding transaction is submitted on chain.
	//
	// Upon requesting a withdrawal, a `WithdrawalRequest` is created, which is then
	// submitted on chain by Dinari. Once the transfer is submitted on chain, the
	// corresponding `Withdrawal` is created.
	//
	// Currently, withdrawals are made in USDC on the Arbitrum network (Chain ID
	// `eip155:42161`).
	WithdrawalRequests V2AccountWithdrawalRequestService
	// **`Withdrawals` represent the transfer of stablecoins from an `Account`
	// connected to a managed `Wallet` to another `Account` that is owned by the
	// `Entity`.**
	//
	// Since the `Account` is backed by a managed `Wallet`, the `Withdrawal` must be
	// processed by Dinari and the corresponding transaction is submitted on chain.
	//
	// Upon requesting a withdrawal, a `WithdrawalRequest` is created, which is then
	// submitted on chain by Dinari. Once the transfer is submitted on chain, the
	// corresponding `Withdrawal` is created.
	//
	// Currently, withdrawals are made in USDC on the Arbitrum network (Chain ID
	// `eip155:42161`).
	Withdrawals V2AccountWithdrawalService
	// **`Accounts` represent the financial accounts of an `Entity`.**
	//
	// `Orders`, dividends, and other transactions are associated with an `Account`.
	TokenTransfers V2AccountTokenTransferService
	// **`Accounts` represent the financial accounts of an `Entity`.**
	//
	// `Orders`, dividends, and other transactions are associated with an `Account`.
	Activities V2AccountActivityService
}

**`Accounts` represent the financial accounts of an `Entity`.**

`Orders`, dividends, and other transactions are associated with an `Account`.

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

Get dividend payments made to the `Account` from dividend-bearing stock holdings.

func (*V2AccountService) GetInterestPayments

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

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 V2AccountTokenTransferGetParams added in v0.5.0

type V2AccountTokenTransferGetParams struct {
	AccountID string `path:"account_id" api:"required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type V2AccountTokenTransferListParams added in v0.5.0

type V2AccountTokenTransferListParams struct {
	Page     param.Opt[int64] `query:"page,omitzero" json:"-"`
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountTokenTransferListParams) URLQuery added in v0.5.0

func (r V2AccountTokenTransferListParams) URLQuery() (v url.Values, err error)

URLQuery serializes V2AccountTokenTransferListParams's query parameters as `url.Values`.

type V2AccountTokenTransferNewParams added in v0.5.0

type V2AccountTokenTransferNewParams struct {
	// Quantity of the token to transfer.
	Quantity float64 `json:"quantity" api:"required"`
	// ID of the recipient account to which the tokens will be transferred.
	RecipientAccountID string `json:"recipient_account_id" api:"required" format:"uuid"`
	// Address of the token to transfer.
	TokenAddress string `json:"token_address" api:"required" format:"eth_address"`
	// contains filtered or unexported fields
}

func (V2AccountTokenTransferNewParams) MarshalJSON added in v0.5.0

func (r V2AccountTokenTransferNewParams) MarshalJSON() (data []byte, err error)

func (*V2AccountTokenTransferNewParams) UnmarshalJSON added in v0.5.0

func (r *V2AccountTokenTransferNewParams) UnmarshalJSON(data []byte) error

type V2AccountTokenTransferService added in v0.5.0

type V2AccountTokenTransferService struct {
	Options []option.RequestOption
}

**`Accounts` represent the financial accounts of an `Entity`.**

`Orders`, dividends, and other transactions are associated with an `Account`.

V2AccountTokenTransferService 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 NewV2AccountTokenTransferService method instead.

func NewV2AccountTokenTransferService added in v0.5.0

func NewV2AccountTokenTransferService(opts ...option.RequestOption) (r V2AccountTokenTransferService)

NewV2AccountTokenTransferService 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 (*V2AccountTokenTransferService) Get added in v0.5.0

Get a specific `TokenTransfer` made from this `Account` by its ID.

A `TokenTransfer` represents a transfer of tokens through the Dinari platform from one `Account` to another. As such, only `Account`s that are connected to Dinari-managed `Wallet`s can initiate `TokenTransfer`s.

func (*V2AccountTokenTransferService) List added in v0.5.0

Get `TokenTransfer`s made from this `Account`.

A `TokenTransfer` represents a transfer of tokens through the Dinari platform from one `Account` to another. As such, only `Account`s that are connected to Dinari-managed `Wallet`s can initiate `TokenTransfer`s.

func (*V2AccountTokenTransferService) New added in v0.5.0

Creates a `TokenTransfer` from this `Account`.

A `TokenTransfer` represents a transfer of tokens through the Dinari platform from one `Account` to another. As such, only `Account`s that are connected to Dinari-managed `Wallet`s can initiate `TokenTransfer`s.

type V2AccountWalletConnectInternalParams added in v0.2.0

type V2AccountWalletConnectInternalParams struct {
	// CAIP-2 formatted chain ID of the blockchain the `Wallet` to link is on. eip155:0
	// is used for EOA wallets
	//
	// Any of "eip155:0", "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID WalletChainID `json:"chain_id,omitzero" api:"required"`
	// Address of the `Wallet`.
	WalletAddress string `json:"wallet_address" api:"required" format:"eth_address"`
	// Is the linked Wallet shared or not
	IsShared param.Opt[bool] `json:"is_shared,omitzero"`
	// contains filtered or unexported fields
}

func (V2AccountWalletConnectInternalParams) MarshalJSON added in v0.2.0

func (r V2AccountWalletConnectInternalParams) MarshalJSON() (data []byte, err error)

func (*V2AccountWalletConnectInternalParams) UnmarshalJSON added in v0.2.0

func (r *V2AccountWalletConnectInternalParams) UnmarshalJSON(data []byte) error

type V2AccountWalletExternalConnectParams

type V2AccountWalletExternalConnectParams struct {
	// CAIP-2 formatted chain ID of the blockchain the `Wallet` to link is on. eip155:0
	// is used for EOA wallets
	//
	// Any of "eip155:0", "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID WalletChainID `json:"chain_id,omitzero" api:"required"`
	// Nonce contained within the connection message.
	Nonce string `json:"nonce" api:"required" format:"uuid"`
	// Signature payload from signing the connection message with the `Wallet`.
	Signature string `json:"signature" api:"required" format:"hex_string"`
	// Address of the `Wallet`.
	WalletAddress string `json:"wallet_address" api:"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 {
	// CAIP-2 formatted chain ID of the blockchain the `Wallet` is on. eip155:0 is used
	// for EOA wallets
	//
	// Any of "eip155:0", "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID WalletChainID `query:"chain_id,omitzero" api:"required" json:"-"`
	// Address of the `Wallet` to connect.
	WalletAddress string `query:"wallet_address" api:"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" api:"required"`
	// Single-use identifier
	Nonce string `json:"nonce" api:"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

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
}

**`Wallets` represent the blockchain wallet that holds the assets of an `Account`.**

An `Account` may be connected to a single `Wallet`.

Individual `Entities` can connect their self-custodied `Wallets` by proving ownership of the `Wallet` address. For Dinari Partners, a Dinari-managed `Wallet` can be created for the Partner `Entity` in the [Dinari Partners Portal](https://Partners.dinari.com/). This may be used in omnibus accounting for self-managing customers' assets.

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

Connect a `Wallet` to the `Account` after verifying the signature.

func (*V2AccountWalletExternalService) GetNonce

Get a nonce and message to be signed in order to verify `Wallet` ownership.

type V2AccountWalletService

type V2AccountWalletService struct {
	Options []option.RequestOption
	// **`Wallets` represent the blockchain wallet that holds the assets of an
	// `Account`.**
	//
	// An `Account` may be connected to a single `Wallet`.
	//
	// Individual `Entities` can connect their self-custodied `Wallets` by proving
	// ownership of the `Wallet` address. For Dinari Partners, a Dinari-managed
	// `Wallet` can be created for the Partner `Entity` in the
	// [Dinari Partners Portal](https://Partners.dinari.com/). This may be used in
	// omnibus accounting for self-managing customers' assets.
	External V2AccountWalletExternalService
}

**`Wallets` represent the blockchain wallet that holds the assets of an `Account`.**

An `Account` may be connected to a single `Wallet`.

Individual `Entities` can connect their self-custodied `Wallets` by proving ownership of the `Wallet` address. For Dinari Partners, a Dinari-managed `Wallet` can be created for the Partner `Entity` in the [Dinari Partners Portal](https://Partners.dinari.com/). This may be used in omnibus accounting for self-managing customers' assets.

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) ConnectInternal added in v0.2.0

func (r *V2AccountWalletService) ConnectInternal(ctx context.Context, accountID string, body V2AccountWalletConnectInternalParams, opts ...option.RequestOption) (res *Wallet, err error)

Connect an internal `Wallet` to the `Account`.

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" api:"required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type V2AccountWithdrawalListParams

type V2AccountWithdrawalListParams struct {
	// ID of the `WithdrawalRequest` to find `Withdrawals` for.
	WithdrawalRequestID param.Opt[string] `query:"withdrawal_request_id,omitzero" 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 (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" api:"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" api:"required"`
	// ID of the `Account` that will receive payment tokens from the `Withdrawal`.
	RecipientAccountID string `json:"recipient_account_id" api:"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
}

**`Withdrawals` represent the transfer of stablecoins from an `Account` connected to a managed `Wallet` to another `Account` that is owned by the `Entity`.**

Since the `Account` is backed by a managed `Wallet`, the `Withdrawal` must be processed by Dinari and the corresponding transaction is submitted on chain.

Upon requesting a withdrawal, a `WithdrawalRequest` is created, which is then submitted on chain by Dinari. Once the transfer is submitted on chain, the corresponding `Withdrawal` is created.

Currently, withdrawals are made in USDC on the Arbitrum network (Chain ID `eip155:42161`).

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

Get a specific `WithdrawalRequest` by its ID.

func (*V2AccountWithdrawalRequestService) List

List `WithdrawalRequests` under the `Account`, sorted by most recent.

func (*V2AccountWithdrawalRequestService) New

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
}

**`Withdrawals` represent the transfer of stablecoins from an `Account` connected to a managed `Wallet` to another `Account` that is owned by the `Entity`.**

Since the `Account` is backed by a managed `Wallet`, the `Withdrawal` must be processed by Dinari and the corresponding transaction is submitted on chain.

Upon requesting a withdrawal, a `WithdrawalRequest` is created, which is then submitted on chain by Dinari. Once the transfer is submitted on chain, the corresponding `Withdrawal` is created.

Currently, withdrawals are made in USDC on the Arbitrum network (Chain ID `eip155:42161`).

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

Get a specific `Withdrawal` by its ID.

func (*V2AccountWithdrawalService) List

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 V2EntityAccountNewParams added in v0.7.0

type V2EntityAccountNewParams struct {
	// Jurisdiction of the `Account`.
	//
	// Any of "BASELINE", "US".
	Jurisdiction Jurisdiction `json:"jurisdiction,omitzero"`
	// contains filtered or unexported fields
}

func (V2EntityAccountNewParams) MarshalJSON added in v0.7.0

func (r V2EntityAccountNewParams) MarshalJSON() (data []byte, err error)

func (*V2EntityAccountNewParams) UnmarshalJSON added in v0.7.0

func (r *V2EntityAccountNewParams) UnmarshalJSON(data []byte) error

type V2EntityAccountService

type V2EntityAccountService struct {
	Options []option.RequestOption
}

**`Accounts` represent the financial accounts of an `Entity`.**

`Orders`, dividends, and other transactions are associated with an `Account`.

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, body V2EntityAccountNewParams, 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" api:"required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type V2EntityKYCDocumentService

type V2EntityKYCDocumentService struct {
	Options []option.RequestOption
}

**KYC (Know Your Customer) is a process of verifying the identity of customer `Entities`.**

KYC is required for all customer `Entities` that transact on Dinari's platform.

Dinari provides a managed KYC process for its Partners, which provides a convenient KYC flow URL to present to the end customer.

For Dinari Partners that supply their own KYC data, the API provides a way to record a customer's KYC information using the Partner's KYC data. This requires an existing KYC agreement between Dinari and the Partner.

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

Get uploaded documents for a KYC check

func (*V2EntityKYCDocumentService) Upload

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" api:"required" format:"uuid" json:"-"`
	// Type of `KYCDocument` to be uploaded.
	//
	// Any of "GOVERNMENT_ID", "SELFIE", "RESIDENCY", "UNKNOWN".
	DocumentType KYCDocumentType `query:"document_type,omitzero" api:"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" api:"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" api:"required"`
	// Datetime at which the KYC request will expired. ISO 8601 timestamp.
	ExpirationDt time.Time `json:"expiration_dt" api:"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

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
	// **KYC (Know Your Customer) is a process of verifying the identity of customer
	// `Entities`.**
	//
	// KYC is required for all customer `Entities` that transact on Dinari's platform.
	//
	// Dinari provides a managed KYC process for its Partners, which provides a
	// convenient KYC flow URL to present to the end customer.
	//
	// For Dinari Partners that supply their own KYC data, the API provides a way to
	// record a customer's KYC information using the Partner's KYC data. This requires
	// an existing KYC agreement between Dinari and the Partner.
	Document V2EntityKYCDocumentService
}

**KYC (Know Your Customer) is a process of verifying the identity of customer `Entities`.**

KYC is required for all customer `Entities` that transact on Dinari's platform.

Dinari provides a managed KYC process for its Partners, which provides a convenient KYC flow URL to present to the end customer.

For Dinari Partners that supply their own KYC data, the API provides a way to record a customer's KYC information using the Partner's KYC data. This requires an existing KYC agreement between Dinari and the Partner.

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 *KYCInfoUnion, 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 *KYCInfoUnion, 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 {

	// This field is a request body variant, only one variant field can be set. Input
	// parameters for providing KYC information for an `Entity` in the baseline
	// jurisdiction.
	OfBaseline *V2EntityKYCSubmitParamsBodyBaseline `json:",inline"`
	// This field is a request body variant, only one variant field can be set. Input
	// parameters for providing KYC information for an `Entity` in the US jurisdiction.
	OfUs *V2EntityKYCSubmitParamsBodyUs `json:",inline"`
	// contains filtered or unexported fields
}

func (V2EntityKYCSubmitParams) MarshalJSON

func (u V2EntityKYCSubmitParams) MarshalJSON() ([]byte, error)

func (*V2EntityKYCSubmitParams) UnmarshalJSON

func (r *V2EntityKYCSubmitParams) UnmarshalJSON(data []byte) error

type V2EntityKYCSubmitParamsBodyBaseline added in v0.7.0

type V2EntityKYCSubmitParamsBodyBaseline struct {
	// KYC data for an `Entity` in the BASELINE jurisdiction.
	Data BaselineKYCCheckDataParam `json:"data,omitzero" api:"required"`
	// Name of the KYC provider that provided the KYC information.
	ProviderName string `json:"provider_name" api:"required"`
	// Jurisdiction of the KYC check.
	//
	// Any of "BASELINE".
	Jurisdiction string `json:"jurisdiction,omitzero"`
	// contains filtered or unexported fields
}

Input parameters for providing KYC information for an `Entity` in the baseline jurisdiction.

The properties Data, ProviderName are required.

func (V2EntityKYCSubmitParamsBodyBaseline) MarshalJSON added in v0.7.0

func (r V2EntityKYCSubmitParamsBodyBaseline) MarshalJSON() (data []byte, err error)

func (*V2EntityKYCSubmitParamsBodyBaseline) UnmarshalJSON added in v0.7.0

func (r *V2EntityKYCSubmitParamsBodyBaseline) UnmarshalJSON(data []byte) error

type V2EntityKYCSubmitParamsBodyUs added in v0.7.0

type V2EntityKYCSubmitParamsBodyUs struct {
	// KYC data for an `Entity` in the US jurisdiction.
	Data UsKYCCheckDataParam `json:"data,omitzero" api:"required"`
	// Name of the KYC provider that provided the KYC information.
	ProviderName string `json:"provider_name" api:"required"`
	// Jurisdiction of the KYC check.
	//
	// Any of "US".
	Jurisdiction string `json:"jurisdiction,omitzero"`
	// contains filtered or unexported fields
}

Input parameters for providing KYC information for an `Entity` in the US jurisdiction.

The properties Data, ProviderName are required.

func (V2EntityKYCSubmitParamsBodyUs) MarshalJSON added in v0.7.0

func (r V2EntityKYCSubmitParamsBodyUs) MarshalJSON() (data []byte, err error)

func (*V2EntityKYCSubmitParamsBodyUs) UnmarshalJSON added in v0.7.0

func (r *V2EntityKYCSubmitParamsBodyUs) UnmarshalJSON(data []byte) error

type V2EntityListParams added in v0.2.0

type V2EntityListParams struct {
	// Case sensitive unique reference ID for the `Entity`.
	ReferenceID param.Opt[string] `query:"reference_id,omitzero" json:"-"`
	Page        param.Opt[int64]  `query:"page,omitzero" json:"-"`
	PageSize    param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2EntityListParams) URLQuery added in v0.2.0

func (r V2EntityListParams) URLQuery() (v url.Values, err error)

URLQuery serializes V2EntityListParams's query parameters as `url.Values`.

type V2EntityNewParams

type V2EntityNewParams struct {
	// Name of the `Entity`.
	Name string `json:"name" api:"required"`
	// Case sensitive unique reference ID for the `Entity`. We recommend setting this
	// to the unique ID of the `Entity` in your system.
	ReferenceID param.Opt[string] `json:"reference_id,omitzero"`
	// 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` represent the financial accounts of an `Entity`.**
	//
	// `Orders`, dividends, and other transactions are associated with an `Account`.
	Accounts V2EntityAccountService
	// **KYC (Know Your Customer) is a process of verifying the identity of customer
	// `Entities`.**
	//
	// KYC is required for all customer `Entities` that transact on Dinari's platform.
	//
	// Dinari provides a managed KYC process for its Partners, which provides a
	// convenient KYC flow URL to present to the end customer.
	//
	// For Dinari Partners that supply their own KYC data, the API provides a way to
	// record a customer's KYC information using the Partner's KYC data. This requires
	// an existing KYC agreement between Dinari and the Partner.
	KYC V2EntityKYCService
}

**`Entities` represent a business or organization that uses the API, and their customers.**

Dinari Partners are represented as an organization `Entity` in the API, with their own accounts. Individual customers of Partner `Entities` are also represented as `Entities` in the API, which are managed by the Partner `Entity`.

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, query V2EntityListParams, opts ...option.RequestOption) (res *[]Entity, err error)

Get a list of 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.

func (*V2EntityService) Update added in v0.2.0

func (r *V2EntityService) Update(ctx context.Context, entityID string, body V2EntityUpdateParams, opts ...option.RequestOption) (res *Entity, err error)

Update a specific customer `Entity` of your organization.

type V2EntityUpdateParams added in v0.2.0

type V2EntityUpdateParams struct {
	// Case sensitive unique reference ID for the `Entity`. We recommend setting this
	// to the unique ID of the `Entity` in your system.
	ReferenceID param.Opt[string] `json:"reference_id,omitzero"`
	// contains filtered or unexported fields
}

func (V2EntityUpdateParams) MarshalJSON added in v0.2.0

func (r V2EntityUpdateParams) MarshalJSON() (data []byte, err error)

func (*V2EntityUpdateParams) UnmarshalJSON added in v0.2.0

func (r *V2EntityUpdateParams) UnmarshalJSON(data []byte) error

type V2ListOrdersParams added in v0.3.0

type V2ListOrdersParams struct {
	// Fulfillment transaction hash of the `Order`.
	OrderFulfillmentTransactionHash param.Opt[string] `query:"order_fulfillment_transaction_hash,omitzero" json:"-"`
	// Order Request ID for the `Order`
	OrderRequestID param.Opt[string] `query:"order_request_id,omitzero" format:"uuid" json:"-"`
	// Transaction hash of the `Order`.
	OrderTransactionHash param.Opt[string] `query:"order_transaction_hash,omitzero" json:"-"`
	Page                 param.Opt[int64]  `query:"page,omitzero" json:"-"`
	PageSize             param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	// CAIP-2 formatted chain ID of the blockchain the `Order` was made on.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `query:"chain_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2ListOrdersParams) URLQuery added in v0.3.0

func (r V2ListOrdersParams) URLQuery() (v url.Values, err error)

URLQuery serializes V2ListOrdersParams's query parameters as `url.Values`.

type V2ListOrdersResponse added in v0.3.0

type V2ListOrdersResponse struct {
	// ID of the `Order`.
	ID string `json:"id" api:"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:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `json:"chain_id" api:"required"`
	// Datetime at which the `Order` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt" api:"required" format:"date-time"`
	// Smart contract address that `Order` was created from.
	OrderContractAddress string `json:"order_contract_address" api:"required" format:"eth_address"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side" api:"required"`
	// Time in force. Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif" api:"required"`
	// Transaction hash for the `Order` creation.
	OrderTransactionHash string `json:"order_transaction_hash" api:"required" format:"hex_string"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type" api:"required"`
	// The payment token (stablecoin) address.
	PaymentToken string `json:"payment_token" api:"required" format:"eth_address"`
	// Status of the `Order`.
	//
	// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
	// "ESCROWED", "SUBMITTED", "CANCELLED", "PARTIALLY_FILLED", "FILLED", "REJECTED",
	// "REQUIRING_CONTACT", "ERROR".
	Status BrokerageOrderStatus `json:"status" api:"required"`
	// Account ID the order was made for.
	AccountID string `json:"account_id" api:"nullable" format:"uuid"`
	// The `Alloy` ID associated with the `Order`
	AlloyID string `json:"alloy_id" api:"nullable" format:"uuid"`
	// The dShare asset token address.
	AssetToken string `json:"asset_token" api:"nullable" format:"eth_address"`
	// Total amount of assets involved.
	AssetTokenQuantity float64 `json:"asset_token_quantity" api:"nullable"`
	// Transaction hash for cancellation of `Order`, if the `Order` was cancelled.
	CancelTransactionHash string `json:"cancel_transaction_hash" api:"nullable" format:"hex_string"`
	// Customer-supplied unique identifier to map this `Order` to an order in the
	// customer's systems.
	ClientOrderID string `json:"client_order_id" api:"nullable"`
	// Entity ID of the Order
	EntityID string `json:"entity_id" api:"nullable" format:"uuid"`
	// Fee amount associated with `Order`.
	Fee float64 `json:"fee" api:"nullable"`
	// 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" api:"nullable"`
	// Order Request ID for the `Order`
	OrderRequestID string `json:"order_request_id" api:"nullable" format:"uuid"`
	// Total amount of payment involved.
	PaymentTokenQuantity float64 `json:"payment_token_quantity" api:"nullable"`
	// The `Stock` ID associated with the `Order`
	StockID string `json:"stock_id" api:"nullable" format:"uuid"`
	// 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
		PaymentToken          respjson.Field
		Status                respjson.Field
		AccountID             respjson.Field
		AlloyID               respjson.Field
		AssetToken            respjson.Field
		AssetTokenQuantity    respjson.Field
		CancelTransactionHash respjson.Field
		ClientOrderID         respjson.Field
		EntityID              respjson.Field
		Fee                   respjson.Field
		LimitPrice            respjson.Field
		OrderRequestID        respjson.Field
		PaymentTokenQuantity  respjson.Field
		StockID               respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (V2ListOrdersResponse) RawJSON added in v0.3.0

func (r V2ListOrdersResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*V2ListOrdersResponse) UnmarshalJSON added in v0.3.0

func (r *V2ListOrdersResponse) UnmarshalJSON(data []byte) error

type V2MarketDataAlloyGetCurrentPriceResponse added in v0.13.0

type V2MarketDataAlloyGetCurrentPriceResponse struct {
	// ID of the `Alloy` asset.
	ID string `json:"id" api:"required" format:"uuid"`
	// Current trade price.
	Price float64 `json:"price" api:"required"`
	// When the price was generated.
	Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
	// Schema version
	//
	// Any of "AlloyPrice:v1".
	Sv V2MarketDataAlloyGetCurrentPriceResponse_Sv `json:"_sv"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Price       respjson.Field
		Timestamp   respjson.Field
		Sv          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (V2MarketDataAlloyGetCurrentPriceResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*V2MarketDataAlloyGetCurrentPriceResponse) UnmarshalJSON added in v0.13.0

func (r *V2MarketDataAlloyGetCurrentPriceResponse) UnmarshalJSON(data []byte) error

type V2MarketDataAlloyGetCurrentPriceResponse_Sv added in v0.13.0

type V2MarketDataAlloyGetCurrentPriceResponse_Sv string

Schema version

const (
	V2MarketDataAlloyGetCurrentPriceResponse_SvAlloyPriceV1 V2MarketDataAlloyGetCurrentPriceResponse_Sv = "AlloyPrice:v1"
)

type V2MarketDataAlloyGetHistoricalPricesParams added in v0.13.0

type V2MarketDataAlloyGetHistoricalPricesParams struct {
	// The timespan of the historical prices to query.
	//
	// Any of "DAY", "WEEK".
	Timespan V2MarketDataAlloyGetHistoricalPricesParamsTimespan `query:"timespan,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (V2MarketDataAlloyGetHistoricalPricesParams) URLQuery added in v0.13.0

URLQuery serializes V2MarketDataAlloyGetHistoricalPricesParams's query parameters as `url.Values`.

type V2MarketDataAlloyGetHistoricalPricesParamsTimespan added in v0.13.0

type V2MarketDataAlloyGetHistoricalPricesParamsTimespan string

The timespan of the historical prices to query.

const (
	V2MarketDataAlloyGetHistoricalPricesParamsTimespanDay  V2MarketDataAlloyGetHistoricalPricesParamsTimespan = "DAY"
	V2MarketDataAlloyGetHistoricalPricesParamsTimespanWeek V2MarketDataAlloyGetHistoricalPricesParamsTimespan = "WEEK"
)

type V2MarketDataAlloyGetHistoricalPricesResponse added in v0.13.0

type V2MarketDataAlloyGetHistoricalPricesResponse struct {
	// Close price from the given time period.
	Close float64 `json:"close" api:"required"`
	// High price from the given time period.
	High float64 `json:"high" api:"required"`
	// Low price from the given time period.
	Low float64 `json:"low" api:"required"`
	// Open price from the given time period.
	Open float64 `json:"open" api:"required"`
	// UNIX timestamp in seconds for the start of the aggregate window.
	Timestamp int64 `json:"timestamp" api:"required"`
	// Schema version
	//
	// Any of "AlloyHistoricalPriceDataPointV1:v1".
	Sv V2MarketDataAlloyGetHistoricalPricesResponse_Sv `json:"_sv"`
	// 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
		Sv          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Datapoint of historical price data for an `Alloy`.

func (V2MarketDataAlloyGetHistoricalPricesResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*V2MarketDataAlloyGetHistoricalPricesResponse) UnmarshalJSON added in v0.13.0

func (r *V2MarketDataAlloyGetHistoricalPricesResponse) UnmarshalJSON(data []byte) error

type V2MarketDataAlloyGetHistoricalPricesResponse_Sv added in v0.13.0

type V2MarketDataAlloyGetHistoricalPricesResponse_Sv string

Schema version

const (
	V2MarketDataAlloyGetHistoricalPricesResponse_SvAlloyHistoricalPriceDataPointV1V1 V2MarketDataAlloyGetHistoricalPricesResponse_Sv = "AlloyHistoricalPriceDataPointV1:v1"
)

type V2MarketDataAlloyListParams added in v0.13.0

type V2MarketDataAlloyListParams struct {
	// Cursor for next page
	Next param.Opt[string] `query:"next,omitzero" json:"-"`
	// Cursor for previous page
	Previous param.Opt[string] `query:"previous,omitzero" json:"-"`
	// Number of results to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Sort order
	//
	// Any of "asc", "desc".
	Order V2MarketDataAlloyListParamsOrder `query:"order,omitzero" json:"-"`
	// If set, this endpoint will return Alloys that match the symbols specified
	Symbols []string `query:"symbols,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2MarketDataAlloyListParams) URLQuery added in v0.13.0

func (r V2MarketDataAlloyListParams) URLQuery() (v url.Values, err error)

URLQuery serializes V2MarketDataAlloyListParams's query parameters as `url.Values`.

type V2MarketDataAlloyListParamsOrder added in v0.13.0

type V2MarketDataAlloyListParamsOrder string

Sort order

const (
	V2MarketDataAlloyListParamsOrderAsc  V2MarketDataAlloyListParamsOrder = "asc"
	V2MarketDataAlloyListParamsOrderDesc V2MarketDataAlloyListParamsOrder = "desc"
)

type V2MarketDataAlloyListResponse added in v0.13.0

type V2MarketDataAlloyListResponse struct {
	// List of Alloys
	Data []V2MarketDataAlloyListResponseData `json:"data" api:"required"`
	// Pagination metadata
	PaginationMetadata V2MarketDataAlloyListResponsePaginationMetadata `json:"pagination_metadata" api:"required"`
	// Schema version
	//
	// Any of "PaginatedAlloyResponse:v1".
	Sv V2MarketDataAlloyListResponse_Sv `json:"_sv"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data               respjson.Field
		PaginationMetadata respjson.Field
		Sv                 respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Paginated response containing a list of Alloys.

func (V2MarketDataAlloyListResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*V2MarketDataAlloyListResponse) UnmarshalJSON added in v0.13.0

func (r *V2MarketDataAlloyListResponse) UnmarshalJSON(data []byte) error

type V2MarketDataAlloyListResponseData added in v0.13.0

type V2MarketDataAlloyListResponseData struct {
	// Unique identifier of the Alloy asset
	ID string `json:"id" api:"required" format:"uuid"`
	// Indicates if tradable on Dinari platform
	IsTradable bool `json:"is_tradable" api:"required"`
	// Name of the Alloy
	Name string `json:"name" api:"required"`
	// Symbol of the Alloy
	Symbol string `json:"symbol" api:"required"`
	// Schema version
	//
	// Any of "Alloy:v1".
	Sv string `json:"_sv"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		IsTradable  respjson.Field
		Name        respjson.Field
		Symbol      respjson.Field
		Sv          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Alloy details.

func (V2MarketDataAlloyListResponseData) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*V2MarketDataAlloyListResponseData) UnmarshalJSON added in v0.13.0

func (r *V2MarketDataAlloyListResponseData) UnmarshalJSON(data []byte) error

type V2MarketDataAlloyListResponsePaginationMetadata added in v0.13.0

type V2MarketDataAlloyListResponsePaginationMetadata struct {
	// Cursor for next page
	Next string `json:"next"`
	// Cursor for previous page
	Previous string `json:"previous"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Next        respjson.Field
		Previous    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata

func (V2MarketDataAlloyListResponsePaginationMetadata) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*V2MarketDataAlloyListResponsePaginationMetadata) UnmarshalJSON added in v0.13.0

type V2MarketDataAlloyListResponse_Sv added in v0.13.0

type V2MarketDataAlloyListResponse_Sv string

Schema version

const (
	V2MarketDataAlloyListResponse_SvPaginatedAlloyResponseV1 V2MarketDataAlloyListResponse_Sv = "PaginatedAlloyResponse:v1"
)

type V2MarketDataAlloyService added in v0.13.0

type V2MarketDataAlloyService struct {
	Options []option.RequestOption
}

**Dinari provides basic market data for `Stocks` and `Alloys` that are available to transact on.**

This data is provided on a best-effort basis and we recommend using a dedicated provider for more intensive market data needs.

V2MarketDataAlloyService 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 NewV2MarketDataAlloyService method instead.

func NewV2MarketDataAlloyService added in v0.13.0

func NewV2MarketDataAlloyService(opts ...option.RequestOption) (r V2MarketDataAlloyService)

NewV2MarketDataAlloyService 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 (*V2MarketDataAlloyService) GetCurrentPrice added in v0.13.0

Get the current price for a specified `Alloy`.

func (*V2MarketDataAlloyService) GetHistoricalPrices added in v0.13.0

Get historical price data for a specified `Alloy`. Each index in the array represents a single tick in a price chart.

func (*V2MarketDataAlloyService) List added in v0.13.0

Returns available `Alloys` with cursor-based pagination.

type V2MarketDataGetMarketHoursResponse

type V2MarketDataGetMarketHoursResponse struct {
	// Whether or not the market is open
	IsMarketOpen bool `json:"is_market_open" api:"required"`
	// Datetime at which the next session closes. ISO 8601 timestamp.
	NextSessionCloseDt time.Time `json:"next_session_close_dt" api:"required" format:"date-time"`
	// Datetime at which the next session opens. ISO 8601 timestamp.
	NextSessionOpenDt time.Time `json:"next_session_open_dt" api:"required" format:"date-time"`
	// Time at which the current session after-hours end.
	CurrentSessionAfterHoursCloseTimeDt time.Time `json:"current_session_after_hours_close_time_dt" api:"nullable" 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" api:"nullable" 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" api:"nullable" format:"date-time"`
	// Time at which the current session overnight starts.
	CurrentSessionOvernightOpenTimeDt time.Time `json:"current_session_overnight_open_time_dt" api:"nullable" format:"date-time"`
	// Time at which the current session pre-market hours start.
	CurrentSessionPreMarketOpenTimeDt time.Time `json:"current_session_pre_market_open_time_dt" api:"nullable" format:"date-time"`
	// Time at which the next session after-hours end.
	NextSessionAfterHoursCloseTimeDt time.Time `json:"next_session_after_hours_close_time_dt" format:"date-time"`
	// Time at which the next session overnight starts.
	NextSessionOvernightOpenTimeDt time.Time `json:"next_session_overnight_open_time_dt" format:"date-time"`
	// Time at which the next session pre-market hours start.
	NextSessionPreMarketOpenTimeDt time.Time `json:"next_session_pre_market_open_time_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
		CurrentSessionAfterHoursCloseTimeDt respjson.Field
		CurrentSessionCloseDt               respjson.Field
		CurrentSessionOpenDt                respjson.Field
		CurrentSessionOvernightOpenTimeDt   respjson.Field
		CurrentSessionPreMarketOpenTimeDt   respjson.Field
		NextSessionAfterHoursCloseTimeDt    respjson.Field
		NextSessionOvernightOpenTimeDt      respjson.Field
		NextSessionPreMarketOpenTimeDt      respjson.Field
		ExtraFields                         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (V2MarketDataGetMarketHoursResponse) RawJSON

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
	// **Dinari provides basic market data for `Stocks` and `Alloys` that are available
	// to transact on.**
	//
	// This data is provided on a best-effort basis and we recommend using a dedicated
	// provider for more intensive market data needs.
	Alloys V2MarketDataAlloyService
}

**Dinari provides basic market data for `Stocks` and `Alloys` that are available to transact on.**

This data is provided on a best-effort basis and we recommend using a dedicated provider for more intensive market data needs.

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

Get the market hours for the current trading session and next open trading session.

type V2MarketDataStockGetCurrentPriceResponse added in v0.3.0

type V2MarketDataStockGetCurrentPriceResponse struct {
	// The ask price.
	Price float64 `json:"price" api:"required"`
	// ID of the `Stock`
	StockID string `json:"stock_id" api:"required" format:"uuid"`
	// When the Stock Quote was generated.
	Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
	// The change in price from the previous close.
	Change float64 `json:"change" api:"nullable"`
	// The percentage change in price from the previous close.
	ChangePercent float64 `json:"change_percent" api:"nullable"`
	// The close price from the given time period.
	Close float64 `json:"close" api:"nullable"`
	// The highest price from the given time period
	High float64 `json:"high" api:"nullable"`
	// The lowest price from the given time period.
	Low float64 `json:"low" api:"nullable"`
	// The most recent close price of the ticker multiplied by weighted outstanding
	// shares.
	MarketCap int64 `json:"market_cap" api:"nullable"`
	// The open price from the given time period.
	Open float64 `json:"open" api:"nullable"`
	// The close price for the `Stock` from the previous trading session.
	PreviousClose float64 `json:"previous_close" api:"nullable"`
	// The trading volume from the given time period.
	Volume float64 `json:"volume" api:"nullable"`
	// The number of shares outstanding in the given time period.
	WeightedSharesOutstanding int64 `json:"weighted_shares_outstanding" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Price                     respjson.Field
		StockID                   respjson.Field
		Timestamp                 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 (V2MarketDataStockGetCurrentPriceResponse) RawJSON added in v0.3.0

Returns the unmodified JSON received from the API

func (*V2MarketDataStockGetCurrentPriceResponse) UnmarshalJSON added in v0.3.0

func (r *V2MarketDataStockGetCurrentPriceResponse) UnmarshalJSON(data []byte) error

type V2MarketDataStockGetCurrentQuoteResponse added in v0.3.0

type V2MarketDataStockGetCurrentQuoteResponse struct {
	// The ask price.
	AskPrice float64 `json:"ask_price" api:"required"`
	// The ask size.
	AskSize float64 `json:"ask_size" api:"required"`
	// The bid price.
	BidPrice float64 `json:"bid_price" api:"required"`
	// The bid size.
	BidSize float64 `json:"bid_size" api:"required"`
	// ID of the `Stock`
	StockID string `json:"stock_id" api:"required" format:"uuid"`
	// When the Stock Quote was generated.
	Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AskPrice    respjson.Field
		AskSize     respjson.Field
		BidPrice    respjson.Field
		BidSize     respjson.Field
		StockID     respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (V2MarketDataStockGetCurrentQuoteResponse) RawJSON added in v0.3.0

Returns the unmodified JSON received from the API

func (*V2MarketDataStockGetCurrentQuoteResponse) UnmarshalJSON added in v0.3.0

func (r *V2MarketDataStockGetCurrentQuoteResponse) UnmarshalJSON(data []byte) error

type V2MarketDataStockGetDividendsResponse

type V2MarketDataStockGetDividendsResponse struct {
	// Cash amount of the dividend per share owned.
	CashAmount float64 `json:"cash_amount" api:"nullable"`
	// Currency in which the dividend is paid.
	Currency string `json:"currency" api:"nullable"`
	// 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`.
	DividendType string `json:"dividend_type" api:"nullable"`
	// 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" api:"nullable" format:"date"`
	// Date on which the dividend is paid out. In ISO 8601 format, YYYY-MM-DD.
	PayDate time.Time `json:"pay_date" api:"nullable" 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" api:"nullable" format:"date"`
	// Ticker symbol of the `Stock`.
	Ticker string `json:"ticker" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CashAmount     respjson.Field
		Currency       respjson.Field
		DividendType   respjson.Field
		ExDividendDate 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

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" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (V2MarketDataStockGetHistoricalPricesParams) URLQuery

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" api:"required"`
	// Highest price from the given time period.
	High float64 `json:"high" api:"required"`
	// Lowest price from the given time period.
	Low float64 `json:"low" api:"required"`
	// Open price from the given time period.
	Open float64 `json:"open" api:"required"`
	// The UNIX timestamp in seconds for the start of the aggregate window.
	Timestamp int64 `json:"timestamp" api:"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

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" api:"required"`
	// Description of the news article
	Description string `json:"description" api:"required"`
	// URL of the image for the news article
	ImageURL string `json:"image_url" api:"required"`
	// Datetime when the article was published. ISO 8601 timestamp.
	PublishedDt time.Time `json:"published_dt" api:"required" format:"date-time"`
	// The publisher of the news article
	Publisher string `json:"publisher" api:"required"`
	// Mobile-friendly Accelerated Mobile Page (AMP) URL of the news article, if
	// available
	AmpURL string `json:"amp_url" api:"nullable"`
	// 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

Returns the unmodified JSON received from the API

func (*V2MarketDataStockGetNewsResponse) UnmarshalJSON

func (r *V2MarketDataStockGetNewsResponse) 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" api:"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" api:"required"`
	// Whether the `Stock` is available for trading.
	IsTradable bool `json:"is_tradable" api:"required"`
	// Company name
	Name string `json:"name" api:"required"`
	// Ticker symbol
	Symbol string `json:"symbol" api:"required"`
	// List of CAIP-10 formatted token addresses.
	Tokens []string `json:"tokens" api:"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" api:"nullable"`
	// Composite FIGI ID. Refer to [this link](https://www.openfigi.com/about/figi) for
	// more information.
	CompositeFigi string `json:"composite_figi" api:"nullable"`
	// CUSIP ID. Refer to [this link](https://www.cusip.com/identifiers.html) for more
	// information. A license agreement with CUSIP Global Services is required to
	// receive this value.
	Cusip string `json:"cusip" api:"nullable"`
	// Description of the company and their services.
	Description string `json:"description" api:"nullable"`
	// Name of `Stock` for application display. If defined, this supercedes the `name`
	// field for displaying the name.
	DisplayName string `json:"display_name" api:"nullable"`
	// URL of the company's logo. Supported formats are SVG and PNG.
	LogoURL string `json:"logo_url" api:"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
		Tokens         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

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
	// **Corporate actions are events that affect the ownership of a `Stock`.**
	//
	// Corporate actions include dividends and stock splits.
	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) GetCurrentPrice added in v0.3.0

Get current price for a specified `Stock`.

func (*V2MarketDataStockService) GetCurrentQuote added in v0.3.0

Get quote for a specified `Stock`.

func (*V2MarketDataStockService) GetDividends

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

Get historical price data for a specified `Stock`. Each index in the array represents a single tick in a price chart.

func (*V2MarketDataStockService) GetNews

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) List

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

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
}

**Corporate actions are events that affect the ownership of a `Stock`.**

Corporate actions include dividends and stock splits.

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

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

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
	// **Dinari provides basic market data for `Stocks` and `Alloys` that are available
	// to transact on.**
	//
	// This data is provided on a best-effort basis and we recommend using a dedicated
	// provider for more intensive market data needs.
	MarketData V2MarketDataService
	// **`Entities` represent a business or organization that uses the API, and their
	// customers.**
	//
	// Dinari Partners are represented as an organization `Entity` in the API, with
	// their own accounts. Individual customers of Partner `Entities` are also
	// represented as `Entities` in the API, which are managed by the Partner `Entity`.
	Entities V2EntityService
	// **`Accounts` represent the financial accounts of an `Entity`.**
	//
	// `Orders`, dividends, and other transactions are associated with an `Account`.
	Accounts V2AccountService
}

**`Orders` represent the buying and selling of assets under an `Account`.**

For `Accounts` using self-custodied `Wallets`, `Orders` are created and fulfilled by making calls to Dinari's smart contracts, or using the _Proxied Orders_ methods.

For `Accounts` using managed `Wallets`, `Orders` are created and fulfilled by using the `Managed Orders` methods, which then create the corresponding transactions on the blockchain.

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.

func (*V2Service) ListOrders added in v0.3.0

func (r *V2Service) ListOrders(ctx context.Context, query V2ListOrdersParams, opts ...option.RequestOption) (res *[]V2ListOrdersResponse, err error)

Get a list of all `Orders` under the `Entity`. Optionally `Orders` can be transaction hash or fulfillment transaction hash.

type Wallet

type Wallet struct {
	// Address of the `Wallet`.
	Address string `json:"address" api:"required"`
	// CAIP-2 formatted chain ID of the blockchain the `Wallet` is on. eip155:0 is used
	// for EOA wallets
	//
	// Any of "eip155:0", "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID WalletChainID `json:"chain_id" api:"required"`
	// Indicates whether the `Wallet` is flagged for AML violation.
	IsAmlFlagged bool `json:"is_aml_flagged" api:"required"`
	// Indicates whether the `Wallet` is a Dinari-managed wallet.
	IsManagedWallet bool `json:"is_managed_wallet" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address         respjson.Field
		ChainID         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) RawJSON

func (r Wallet) RawJSON() string

Returns the unmodified JSON received from the API

func (*Wallet) UnmarshalJSON

func (r *Wallet) UnmarshalJSON(data []byte) error

type WalletChainID added in v0.2.0

type WalletChainID string
const (
	WalletChainIDEip155_0         WalletChainID = "eip155:0"
	WalletChainIDEip155_1         WalletChainID = "eip155:1"
	WalletChainIDEip155_42161     WalletChainID = "eip155:42161"
	WalletChainIDEip155_8453      WalletChainID = "eip155:8453"
	WalletChainIDEip155_81457     WalletChainID = "eip155:81457"
	WalletChainIDEip155_98866     WalletChainID = "eip155:98866"
	WalletChainIDEip155_11155111  WalletChainID = "eip155:11155111"
	WalletChainIDEip155_421614    WalletChainID = "eip155:421614"
	WalletChainIDEip155_84532     WalletChainID = "eip155:84532"
	WalletChainIDEip155_168587773 WalletChainID = "eip155:168587773"
	WalletChainIDEip155_98867     WalletChainID = "eip155:98867"
	WalletChainIDEip155_202110    WalletChainID = "eip155:202110"
	WalletChainIDEip155_179205    WalletChainID = "eip155:179205"
	WalletChainIDEip155_179202    WalletChainID = "eip155:179202"
	WalletChainIDEip155_98865     WalletChainID = "eip155:98865"
	WalletChainIDEip155_7887      WalletChainID = "eip155:7887"
)

type Withdrawal

type Withdrawal struct {
	// ID of the `Withdrawal`.
	ID string `json:"id" api:"required" format:"uuid"`
	// ID of the `Account` from which the `Withdrawal` is made.
	AccountID string `json:"account_id" api:"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:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:202110", "eip155:179205",
	// "eip155:179202", "eip155:98865", "eip155:7887".
	ChainID Chain `json:"chain_id" api:"required"`
	// Address of USDC payment token that the `Withdrawal` will be received in.
	PaymentTokenAddress string `json:"payment_token_address" api:"required" format:"eth_address"`
	// Amount of USDC payment tokens to be withdrawn.
	PaymentTokenAmount float64 `json:"payment_token_amount" api:"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" api:"required" format:"uuid"`
	// Status of the `Withdrawal`.
	//
	// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
	// "ESCROWED", "SUBMITTED", "CANCELLED", "PARTIALLY_FILLED", "FILLED", "REJECTED",
	// "REQUIRING_CONTACT", "ERROR".
	Status BrokerageOrderStatus `json:"status" api:"required"`
	// Datetime at which the `Withdrawal` was transacted. ISO 8601 timestamp.
	TransactionDt time.Time `json:"transaction_dt" api:"required" format:"date-time"`
	// Hash of the transaction for the `Withdrawal`.
	TransactionHash string `json:"transaction_hash" api:"required" format:"hex_string"`
	// ID of the `WithdrawalRequest` associated with this `Withdrawal`.
	WithdrawalRequestID string `json:"withdrawal_request_id" api:"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" api:"required" format:"uuid"`
	// ID of the `Account` of the `WithdrawalRequest`.
	AccountID string `json:"account_id" api:"required" format:"uuid"`
	// Datetime at which the `WithdrawalRequest` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt" api:"required" format:"date-time"`
	// Amount of USD+ payment tokens submitted for withdrawal.
	PaymentTokenAmount float64 `json:"payment_token_amount" api:"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" api:"required" format:"uuid"`
	// Status of the `WithdrawalRequest`
	//
	// Any of "PENDING", "SUBMITTED", "ERROR", "CANCELLED".
	Status WithdrawalRequestStatus `json:"status" api:"required"`
	// Datetime at which the `WithdrawalRequest` was updated. ISO 8601 timestamp.
	UpdatedDt time.Time `json:"updated_dt" api:"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"
)

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.22, 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.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

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