dinariapisdkgo

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: Apache-2.0 Imports: 19 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.

Installation

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

Or to pin the version:

go get -u 'github.com/dinaricrypto/dinari-api-sdk-go@v0.4.0'

Requirements

This library requires Go 1.18+.

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 it's 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,required" format:"uuid"`
	// Datetime when the `Account` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
	// ID for the `Entity` that owns the `Account`.
	EntityID string `json:"entity_id,required" format:"uuid"`
	// Indicates whether the `Account` is active.
	IsActive bool `json:"is_active,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedDt   respjson.Field
		EntityID    respjson.Field
		IsActive    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

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

func (Account) 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 BrokerageOrderStatus

type BrokerageOrderStatus string
const (
	BrokerageOrderStatusPendingSubmit    BrokerageOrderStatus = "PENDING_SUBMIT"
	BrokerageOrderStatusPendingCancel    BrokerageOrderStatus = "PENDING_CANCEL"
	BrokerageOrderStatusPendingEscrow    BrokerageOrderStatus = "PENDING_ESCROW"
	BrokerageOrderStatusPendingFill      BrokerageOrderStatus = "PENDING_FILL"
	BrokerageOrderStatusEscrowed         BrokerageOrderStatus = "ESCROWED"
	BrokerageOrderStatusSubmitted        BrokerageOrderStatus = "SUBMITTED"
	BrokerageOrderStatusCancelled        BrokerageOrderStatus = "CANCELLED"
	BrokerageOrderStatusFilled           BrokerageOrderStatus = "FILLED"
	BrokerageOrderStatusRejected         BrokerageOrderStatus = "REJECTED"
	BrokerageOrderStatusRequiringContact BrokerageOrderStatus = "REQUIRING_CONTACT"
	BrokerageOrderStatusError            BrokerageOrderStatus = "ERROR"
)

type Chain

type Chain string
const (
	ChainEip155_1         Chain = "eip155:1"
	ChainEip155_42161     Chain = "eip155:42161"
	ChainEip155_8453      Chain = "eip155:8453"
	ChainEip155_81457     Chain = "eip155:81457"
	ChainEip155_7887      Chain = "eip155:7887"
	ChainEip155_98866     Chain = "eip155:98866"
	ChainEip155_11155111  Chain = "eip155:11155111"
	ChainEip155_421614    Chain = "eip155:421614"
	ChainEip155_84532     Chain = "eip155:84532"
	ChainEip155_168587773 Chain = "eip155:168587773"
	ChainEip155_98867     Chain = "eip155:98867"
	ChainEip155_31337     Chain = "eip155:31337"
	ChainEip155_1337      Chain = "eip155:1337"
)

type Client

type Client struct {
	Options []option.RequestOption
	V2      V2Service
}

Client creates a struct with services and top level methods that help with interacting with the dinari API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (DINARI_API_SECRET_KEY, DINARI_API_KEY_ID, DINARI_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

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

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

func (*Client) Execute

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

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

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

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

func (*Client) Patch

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

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

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 `Orders` and market sell
	// `Orders`.
	AssetQuantity float64 `json:"asset_quantity,required"`
	// Price at which to execute the order. Must be a positive number with a precision
	// of up to 2 decimal places.
	LimitPrice float64 `json:"limit_price,required"`
	// ID of `Stock`.
	StockID string `json:"stock_id,required" format:"uuid"`
	// ID of `Account` to receive the `Order`.
	RecipientAccountID param.Opt[string] `json:"recipient_account_id,omitzero" format:"uuid"`
	// contains filtered or unexported fields
}

Input parameters for creating a limit buy `OrderRequest`.

The properties AssetQuantity, LimitPrice, StockID 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 `Orders` and market sell
	// `Orders`.
	AssetQuantity float64 `json:"asset_quantity,required"`
	// Price at which to execute the order. Must be a positive number with a precision
	// of up to 2 decimal places.
	LimitPrice float64 `json:"limit_price,required"`
	// ID of `Stock`.
	StockID string `json:"stock_id,required" format:"uuid"`
	// 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"`
	// contains filtered or unexported fields
}

Input parameters for creating a limit sell `OrderRequest`.

The properties AssetQuantity, LimitPrice, StockID 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,required"`
	// ID of `Stock`.
	StockID string `json:"stock_id,required" format:"uuid"`
	// ID of `Account` to receive the `Order`.
	RecipientAccountID param.Opt[string] `json:"recipient_account_id,omitzero" format:"uuid"`
	// contains filtered or unexported fields
}

Input parameters for creating a market buy `OrderRequest`.

The properties PaymentAmount, StockID are 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
	// 9 decimal places.
	AssetQuantity float64 `json:"asset_quantity,required"`
	// ID of `Stock`.
	StockID string `json:"stock_id,required" format:"uuid"`
	// 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"`
	// contains filtered or unexported fields
}

Input parameters for creating a market sell `OrderRequest`.

The properties AssetQuantity, StockID are 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 Entity

type Entity struct {
	// Unique ID of the `Entity`.
	ID string `json:"id,required" format:"uuid"`
	// Type of `Entity`. `ORGANIZATION` for Dinari Partners and `INDIVIDUAL` for their
	// individual customers.
	//
	// Any of "INDIVIDUAL", "ORGANIZATION".
	EntityType EntityEntityType `json:"entity_type,required"`
	// Indicates if `Entity` completed KYC.
	IsKYCComplete bool `json:"is_kyc_complete,required"`
	// Name of `Entity`.
	Name string `json:"name"`
	// Nationality or home country of the `Entity`.
	Nationality string `json:"nationality"`
	// 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"`
	// 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 EvmTypedData added in v0.2.0

type EvmTypedData struct {
	// Domain separator for the typed data.
	Domain any `json:"domain,required"`
	// Message to be signed. Contains the actual data that will be signed with the
	// wallet.
	Message any `json:"message,required"`
	// Primary type of the typed data.
	PrimaryType string `json:"primaryType,required"`
	// Types used in the typed data.
	Types any `json:"types,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Domain      respjson.Field
		Message     respjson.Field
		PrimaryType respjson.Field
		Types       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

[EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data to be signed with a wallet.

func (EvmTypedData) RawJSON added in v0.2.0

func (r EvmTypedData) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvmTypedData) UnmarshalJSON added in v0.2.0

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

type Fulfillment

type Fulfillment struct {
	// ID of the `OrderFulfillment`.
	ID string `json:"id,required" format:"uuid"`
	// Amount of dShare asset token filled for `BUY` orders.
	AssetTokenFilled float64 `json:"asset_token_filled,required"`
	// Amount of dShare asset token spent for `SELL` orders.
	AssetTokenSpent float64 `json:"asset_token_spent,required"`
	// Blockchain that the transaction was run on.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,required"`
	// ID of the `Order` this `OrderFulfillment` is for.
	OrderID string `json:"order_id,required" format:"uuid"`
	// Amount of payment token filled for `SELL` orders.
	PaymentTokenFilled float64 `json:"payment_token_filled,required"`
	// Amount of payment token spent for `BUY` orders.
	PaymentTokenSpent float64 `json:"payment_token_spent,required"`
	// Time when transaction occurred.
	TransactionDt time.Time `json:"transaction_dt,required" format:"date-time"`
	// Transaction hash for this fulfillment.
	TransactionHash string `json:"transaction_hash,required" format:"hex_string"`
	// Fee amount, in payment tokens.
	PaymentTokenFee float64 `json:"payment_token_fee"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		AssetTokenFilled   respjson.Field
		AssetTokenSpent    respjson.Field
		ChainID            respjson.Field
		OrderID            respjson.Field
		PaymentTokenFilled respjson.Field
		PaymentTokenSpent  respjson.Field
		TransactionDt      respjson.Field
		TransactionHash    respjson.Field
		PaymentTokenFee    respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about a fulfillment of an `Order`. An order may be fulfilled in multiple transactions.

func (Fulfillment) RawJSON

func (r Fulfillment) RawJSON() string

Returns the unmodified JSON received from the API

func (*Fulfillment) UnmarshalJSON

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

type KYCData

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

func (KYCData) RawJSON

func (r KYCData) RawJSON() string

Returns the unmodified JSON received from the API

func (KYCData) ToParam

func (r KYCData) ToParam() KYCDataParam

ToParam converts this KYCData to a KYCDataParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with KYCDataParam.Overrides()

func (*KYCData) UnmarshalJSON

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

type KYCDataParam

type KYCDataParam struct {
	// Country of residence. ISO 3166-1 alpha 2 country code.
	AddressCountryCode string `json:"address_country_code,required"`
	// Country of citizenship or home country of the organization. ISO 3166-1 alpha 2
	// country code.
	CountryCode string `json:"country_code,required"`
	// Last name of the person.
	LastName string `json:"last_name,required"`
	// City of address. Not all international addresses use this attribute.
	AddressCity param.Opt[string] `json:"address_city,omitzero"`
	// Postal code of residence address. Not all international addresses use this
	// attribute.
	AddressPostalCode param.Opt[string] `json:"address_postal_code,omitzero"`
	// Street address of address.
	AddressStreet1 param.Opt[string] `json:"address_street_1,omitzero"`
	// Extension of address, usually apartment or suite number.
	AddressStreet2 param.Opt[string] `json:"address_street_2,omitzero"`
	// State or subdivision of address. In the US, this should be the unabbreviated
	// name of the state. Not all international addresses use this attribute.
	AddressSubdivision param.Opt[string] `json:"address_subdivision,omitzero"`
	// Birth date of the individual. In ISO 8601 format, YYYY-MM-DD.
	BirthDate param.Opt[time.Time] `json:"birth_date,omitzero" format:"date"`
	// Email address.
	Email param.Opt[string] `json:"email,omitzero"`
	// First name of the person.
	FirstName param.Opt[string] `json:"first_name,omitzero"`
	// Middle name of the user
	MiddleName param.Opt[string] `json:"middle_name,omitzero"`
	// ID number of the official tax document of the country the entity belongs to.
	TaxIDNumber param.Opt[string] `json:"tax_id_number,omitzero"`
	// contains filtered or unexported fields
}

KYC data for an `Entity`.

The properties AddressCountryCode, CountryCode, LastName are required.

func (KYCDataParam) MarshalJSON

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

func (*KYCDataParam) UnmarshalJSON

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

type KYCDocument

type KYCDocument struct {
	// ID of the document.
	ID string `json:"id,required" format:"uuid"`
	// Type of document.
	//
	// Any of "GOVERNMENT_ID", "SELFIE", "RESIDENCY", "UNKNOWN".
	DocumentType KYCDocumentType `json:"document_type,required"`
	// Filename of document.
	Filename string `json:"filename,required"`
	// Temporary URL to access the document. Expires in 1 hour.
	URL string `json:"url,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		DocumentType respjson.Field
		Filename     respjson.Field
		URL          respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A document associated with KYC for an `Entity`.

func (KYCDocument) RawJSON

func (r KYCDocument) RawJSON() string

Returns the unmodified JSON received from the API

func (*KYCDocument) UnmarshalJSON

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

type KYCDocumentType

type KYCDocumentType string
const (
	KYCDocumentTypeGovernmentID KYCDocumentType = "GOVERNMENT_ID"
	KYCDocumentTypeSelfie       KYCDocumentType = "SELFIE"
	KYCDocumentTypeResidency    KYCDocumentType = "RESIDENCY"
	KYCDocumentTypeUnknown      KYCDocumentType = "UNKNOWN"
)

type KYCInfo

type KYCInfo struct {
	// ID of the KYC check.
	ID string `json:"id,required" format:"uuid"`
	// KYC check status.
	//
	// Any of "PASS", "FAIL", "PENDING", "INCOMPLETE".
	Status KYCInfoStatus `json:"status,required"`
	// Datetime when the KYC was last checked. ISO 8601 timestamp.
	CheckedDt time.Time `json:"checked_dt" format:"date-time"`
	// KYC data for an `Entity`.
	Data KYCData `json:"data"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Status      respjson.Field
		CheckedDt   respjson.Field
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

KYC information for an `Entity`.

func (KYCInfo) RawJSON

func (r KYCInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*KYCInfo) UnmarshalJSON

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

type KYCInfoStatus

type KYCInfoStatus string

KYC check status.

const (
	KYCInfoStatusPass       KYCInfoStatus = "PASS"
	KYCInfoStatusFail       KYCInfoStatus = "FAIL"
	KYCInfoStatusPending    KYCInfoStatus = "PENDING"
	KYCInfoStatusIncomplete KYCInfoStatus = "INCOMPLETE"
)

type Order

type Order struct {
	// ID of the `Order`.
	ID string `json:"id,required" format:"uuid"`
	// CAIP-2 formatted chain ID of the blockchain that the `Order` transaction was run
	// on.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,required"`
	// Datetime at which the `Order` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
	// Smart contract address that `Order` was created from.
	OrderContractAddress string `json:"order_contract_address,required" format:"eth_address"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,required"`
	// Time in force. Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif,required"`
	// Transaction hash for the `Order` creation.
	OrderTransactionHash string `json:"order_transaction_hash,required" format:"hex_string"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,required"`
	// The payment token (stablecoin) address.
	PaymentToken string `json:"payment_token,required" format:"eth_address"`
	// Status of the `Order`.
	//
	// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
	// "ESCROWED", "SUBMITTED", "CANCELLED", "FILLED", "REJECTED", "REQUIRING_CONTACT",
	// "ERROR".
	Status BrokerageOrderStatus `json:"status,required"`
	// The `Stock` ID associated with the `Order`
	StockID string `json:"stock_id,required" format:"uuid"`
	// The dShare asset token address.
	AssetToken string `json:"asset_token" format:"eth_address"`
	// Total amount of assets involved.
	AssetTokenQuantity float64 `json:"asset_token_quantity"`
	// Transaction hash for cancellation of `Order`, if the `Order` was cancelled.
	CancelTransactionHash string `json:"cancel_transaction_hash" format:"hex_string"`
	// Fee amount associated with `Order`.
	Fee float64 `json:"fee"`
	// For limit `Orders`, the price per asset, specified in the `Stock`'s native
	// currency (USD for US equities and ETFs).
	LimitPrice float64 `json:"limit_price"`
	// Order Request ID for the `Order`
	OrderRequestID string `json:"order_request_id" format:"uuid"`
	// Total amount of payment involved.
	PaymentTokenQuantity float64 `json:"payment_token_quantity"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		ChainID               respjson.Field
		CreatedDt             respjson.Field
		OrderContractAddress  respjson.Field
		OrderSide             respjson.Field
		OrderTif              respjson.Field
		OrderTransactionHash  respjson.Field
		OrderType             respjson.Field
		PaymentToken          respjson.Field
		Status                respjson.Field
		StockID               respjson.Field
		AssetToken            respjson.Field
		AssetTokenQuantity    respjson.Field
		CancelTransactionHash respjson.Field
		Fee                   respjson.Field
		LimitPrice            respjson.Field
		OrderRequestID        respjson.Field
		PaymentTokenQuantity  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 OrderFeeAmount added in v0.2.0

type OrderFeeAmount struct {
	// The quantity of the fee paid via payment token in
	// [ETH](https://ethereum.org/en/developers/docs/intro-to-ether/#what-is-ether).
	FeeInEth float64 `json:"fee_in_eth,required"`
	// The quantity of the fee paid via payment token in
	// [wei](https://ethereum.org/en/developers/docs/intro-to-ether/#denominations).
	FeeInWei string `json:"fee_in_wei,required" format:"bigint"`
	// Type of fee.
	//
	// Any of "SPONSORED_NETWORK", "NETWORK", "TRADING", "ORDER", "PARTNER_ORDER",
	// "PARTNER_TRADING".
	Type OrderFeeAmountType `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FeeInEth    respjson.Field
		FeeInWei    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderFeeAmount) RawJSON added in v0.2.0

func (r OrderFeeAmount) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderFeeAmount) UnmarshalJSON added in v0.2.0

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

type OrderFeeAmountType added in v0.2.0

type OrderFeeAmountType string

Type of fee.

const (
	OrderFeeAmountTypeSponsoredNetwork OrderFeeAmountType = "SPONSORED_NETWORK"
	OrderFeeAmountTypeNetwork          OrderFeeAmountType = "NETWORK"
	OrderFeeAmountTypeTrading          OrderFeeAmountType = "TRADING"
	OrderFeeAmountTypeOrder            OrderFeeAmountType = "ORDER"
	OrderFeeAmountTypePartnerOrder     OrderFeeAmountType = "PARTNER_ORDER"
	OrderFeeAmountTypePartnerTrading   OrderFeeAmountType = "PARTNER_TRADING"
)

type OrderRequest

type OrderRequest struct {
	// ID of `OrderRequest`. This is the primary identifier for the `/order_requests`
	// routes.
	ID string `json:"id,required" format:"uuid"`
	// ID of `Account` placing the `OrderRequest`.
	AccountID string `json:"account_id,required" format:"uuid"`
	// Datetime at which the `OrderRequest` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,required"`
	// Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif,required"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,required"`
	// Status of `OrderRequest`.
	//
	// Any of "PENDING", "SUBMITTED", "ERROR", "CANCELLED".
	Status OrderRequestStatus `json:"status,required"`
	// ID of `Order` created from the `OrderRequest`. This is the primary identifier
	// for the `/orders` routes.
	OrderID string `json:"order_id" format:"uuid"`
	// ID of recipient `Account`.
	RecipientAccountID string `json:"recipient_account_id" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		AccountID          respjson.Field
		CreatedDt          respjson.Field
		OrderSide          respjson.Field
		OrderTif           respjson.Field
		OrderType          respjson.Field
		Status             respjson.Field
		OrderID            respjson.Field
		RecipientAccountID respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A request to create an `Order`.

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

The `OrderRequest` is a record of the user's intent to place an order, while the `Order` is the actual transaction that occurs on the blockchain.

func (OrderRequest) RawJSON

func (r OrderRequest) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderRequest) UnmarshalJSON

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

type OrderRequestStatus

type OrderRequestStatus string

Status of `OrderRequest`.

const (
	OrderRequestStatusPending   OrderRequestStatus = "PENDING"
	OrderRequestStatusSubmitted OrderRequestStatus = "SUBMITTED"
	OrderRequestStatusError     OrderRequestStatus = "ERROR"
	OrderRequestStatusCancelled OrderRequestStatus = "CANCELLED"
)

type 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,required" format:"uuid"`
	// Ex-date of the split in Eastern Time Zone. First day the stock trades at
	// post-split prices. Typically is last date in the process, and the main important
	// date for investors. In ISO 8601 format, YYYY-MM-DD.
	ExDate time.Time `json:"ex_date,required" format:"date"`
	// Payable date of the split in Eastern Time Zone. This is the date when company
	// will send out the new shares. Mainly for record keeping by brokerages, who
	// forward the shares to eventual owners. Typically is the second date in the
	// process. In ISO 8601 format, YYYY-MM-DD.
	PayableDate time.Time `json:"payable_date,required" format:"date"`
	// Record date of the split in Eastern Time Zone, for company to determine where to
	// send their new shares. Mainly for record keeping by brokerages, who forward the
	// shares to eventual owners. Typically is the first date in the process. In ISO
	// 8601 format, YYYY-MM-DD.
	RecordDate time.Time `json:"record_date,required" format:"date"`
	// The number of shares before the split. In a 10-for-1 split, this would be 1.
	SplitFrom float64 `json:"split_from,required"`
	// The number of shares after the split. In a 10-for-1 split, this would be 10.
	SplitTo float64 `json:"split_to,required"`
	// The status of Dinari's processing of the `StockSplit`. `Stocks` for which this
	// status is `IN_PROGRESS` will not be available for trading.
	//
	// Any of "PENDING", "IN_PROGRESS", "COMPLETE".
	Status StockSplitStatus `json:"status,required"`
	// ID of the `Stock` whose shares are being split.
	StockID string `json:"stock_id,required" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExDate      respjson.Field
		PayableDate respjson.Field
		RecordDate  respjson.Field
		SplitFrom   respjson.Field
		SplitTo     respjson.Field
		Status      respjson.Field
		StockID     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about a stock split, including the `Stock` ID, the number of shares before and after the split, the record date, payable date, ex-date, and the status of the split.

func (StockSplit) RawJSON

func (r StockSplit) RawJSON() string

Returns the unmodified JSON received from the API

func (*StockSplit) UnmarshalJSON

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

type StockSplitStatus

type StockSplitStatus string

The status of Dinari's processing of the `StockSplit`. `Stocks` for which this status is `IN_PROGRESS` will not be available for trading.

const (
	StockSplitStatusPending    StockSplitStatus = "PENDING"
	StockSplitStatusInProgress StockSplitStatus = "IN_PROGRESS"
	StockSplitStatusComplete   StockSplitStatus = "COMPLETE"
)

type V2AccountGetCashBalancesResponse

type V2AccountGetCashBalancesResponse struct {
	// Total amount of the payment token in the `Account`.
	Amount float64 `json:"amount,required"`
	// CAIP-2 chain ID of the payment token.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,required"`
	// Symbol of the payment token.
	Symbol string `json:"symbol,required"`
	// Address of the payment token.
	TokenAddress string `json:"token_address,required" format:"eth_address"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount       respjson.Field
		ChainID      respjson.Field
		Symbol       respjson.Field
		TokenAddress respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Balance of a payment token in an `Account`.

func (V2AccountGetCashBalancesResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountGetCashBalancesResponse) UnmarshalJSON

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

type V2AccountGetDividendPaymentsParams

type V2AccountGetDividendPaymentsParams struct {
	// End date, exclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
	EndDate time.Time `query:"end_date,required" format:"date" json:"-"`
	// Start date, inclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
	StartDate time.Time        `query:"start_date,required" format:"date" json:"-"`
	Page      param.Opt[int64] `query:"page,omitzero" json:"-"`
	PageSize  param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Optional ID of the `Stock` to filter by
	StockID param.Opt[string] `query:"stock_id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountGetDividendPaymentsParams) URLQuery

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

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

type V2AccountGetDividendPaymentsResponse

type V2AccountGetDividendPaymentsResponse struct {
	// Amount of the dividend paid.
	Amount float64 `json:"amount,required"`
	// Currency in which the dividend was paid. (e.g. USD)
	Currency string `json:"currency,required"`
	// Date the dividend was distributed to the account. ISO 8601 format, YYYY-MM-DD.
	PaymentDate time.Time `json:"payment_date,required" format:"date"`
	// ID of the `Stock` for which the dividend was paid.
	StockID string `json:"stock_id,required" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		Currency    respjson.Field
		PaymentDate respjson.Field
		StockID     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a dividend payment event for an `Account`.

func (V2AccountGetDividendPaymentsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountGetDividendPaymentsResponse) UnmarshalJSON

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

type V2AccountGetInterestPaymentsParams

type V2AccountGetInterestPaymentsParams struct {
	// End date, exclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
	EndDate time.Time `query:"end_date,required" format:"date" json:"-"`
	// Start date, inclusive, in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
	StartDate time.Time        `query:"start_date,required" format:"date" json:"-"`
	Page      param.Opt[int64] `query:"page,omitzero" json:"-"`
	PageSize  param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountGetInterestPaymentsParams) URLQuery

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

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

type V2AccountGetInterestPaymentsResponse

type V2AccountGetInterestPaymentsResponse struct {
	// Amount of interest paid.
	Amount float64 `json:"amount,required"`
	// Currency in which the interest was paid (e.g. USD).
	Currency string `json:"currency,required"`
	// Date of interest payment in US Eastern time zone. ISO 8601 format, YYYY-MM-DD.
	PaymentDate time.Time `json:"payment_date,required" format:"date"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		Currency    respjson.Field
		PaymentDate respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An object representing an interest payment from stablecoin holdings.

func (V2AccountGetInterestPaymentsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountGetInterestPaymentsResponse) UnmarshalJSON

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

type V2AccountGetPortfolioResponse

type V2AccountGetPortfolioResponse struct {
	// Balance details for all owned `Stocks`.
	Assets []V2AccountGetPortfolioResponseAsset `json:"assets,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Assets      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Balance information of `Stock` assets in your `Account`.

func (V2AccountGetPortfolioResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountGetPortfolioResponse) UnmarshalJSON

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

type V2AccountGetPortfolioResponseAsset

type V2AccountGetPortfolioResponseAsset struct {
	// Total amount of the dShare asset token in the `Account`.
	Amount float64 `json:"amount,required"`
	// CAIP-2 chain ID of the blockchain where the dShare asset token exists.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,required"`
	// ID of the underlying `Stock` represented by the dShare asset token.
	StockID string `json:"stock_id,required" format:"uuid"`
	// Token symbol of the dShare asset token.
	Symbol string `json:"symbol,required"`
	// Address of the dShare asset token.
	TokenAddress string `json:"token_address,required" format:"eth_address"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount       respjson.Field
		ChainID      respjson.Field
		StockID      respjson.Field
		Symbol       respjson.Field
		TokenAddress respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Balance of a dShare in an `Account`.

func (V2AccountGetPortfolioResponseAsset) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountGetPortfolioResponseAsset) UnmarshalJSON

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

type V2AccountMintSandboxTokensParams

type V2AccountMintSandboxTokensParams struct {
	// CAIP-2 chain ID of blockchain in which to mint the sandbox payment tokens. If
	// none specified, defaults to eip155:421614. If the `Account` is linked to a
	// Dinari-managed `Wallet`, only eip155:42161 is allowed.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,omitzero"`
	// contains filtered or unexported fields
}

func (V2AccountMintSandboxTokensParams) MarshalJSON

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

func (*V2AccountMintSandboxTokensParams) UnmarshalJSON

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

type V2AccountOrderCancelParams

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

type V2AccountOrderFulfillmentGetParams

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

type V2AccountOrderFulfillmentQueryParams

type V2AccountOrderFulfillmentQueryParams struct {
	Page     param.Opt[int64] `query:"page,omitzero" json:"-"`
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// List of `Order` IDs to query `OrderFulfillments` for.
	OrderIDs []string `query:"order_ids,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountOrderFulfillmentQueryParams) URLQuery

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

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

type V2AccountOrderFulfillmentService

type V2AccountOrderFulfillmentService struct {
	Options []option.RequestOption
}

V2AccountOrderFulfillmentService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2AccountOrderFulfillmentService method instead.

func NewV2AccountOrderFulfillmentService

func NewV2AccountOrderFulfillmentService(opts ...option.RequestOption) (r V2AccountOrderFulfillmentService)

NewV2AccountOrderFulfillmentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2AccountOrderFulfillmentService) Get

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,required" format:"uuid" json:"-"`
	Page      param.Opt[int64] `query:"page,omitzero" json:"-"`
	PageSize  param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountOrderGetFulfillmentsParams) URLQuery

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

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

type V2AccountOrderGetParams

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

type V2AccountOrderListParams

type V2AccountOrderListParams struct {
	// 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:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	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 V2AccountOrderRequestGetFeeQuoteParams

type V2AccountOrderRequestGetFeeQuoteParams struct {
	// Indicates whether `Order Request` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,omitzero,required"`
	// Type of `Order Request`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,omitzero,required"`
	// The Stock ID associated with the Order Request
	StockID string `json:"stock_id,required" format:"uuid"`
	// Amount of dShare asset tokens involved. Required for limit `Orders` and market
	// sell `Order Requests`.
	AssetTokenQuantity param.Opt[float64] `json:"asset_token_quantity,omitzero"`
	// Price per asset in the asset's native currency. USD for US equities and ETFs.
	// Required for limit `Order Requests`.
	LimitPrice param.Opt[float64] `json:"limit_price,omitzero"`
	// 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"`
	// 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:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,omitzero"`
	// contains filtered or unexported fields
}

func (V2AccountOrderRequestGetFeeQuoteParams) MarshalJSON

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

func (*V2AccountOrderRequestGetFeeQuoteParams) UnmarshalJSON

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

type V2AccountOrderRequestGetFeeQuoteResponse

type V2AccountOrderRequestGetFeeQuoteResponse struct {
	// Cash amount in USD paid for fees for the Order Request.
	Fee float64 `json:"fee,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Fee         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A preview of the fee that would be collected when placing an Order Request.

func (V2AccountOrderRequestGetFeeQuoteResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountOrderRequestGetFeeQuoteResponse) UnmarshalJSON

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

type V2AccountOrderRequestGetParams

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

type V2AccountOrderRequestListParams

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

func (V2AccountOrderRequestListParams) URLQuery

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

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

type V2AccountOrderRequestNewLimitBuyParams

type V2AccountOrderRequestNewLimitBuyParams struct {
	// Input parameters for creating a limit 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
	Stocks  V2AccountOrderRequestStockService
}

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.

func (*V2AccountOrderRequestService) List

Lists `OrderRequests`.

func (*V2AccountOrderRequestService) NewLimitBuy

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

func (*V2AccountOrderRequestService) NewLimitSell

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

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.

func (*V2AccountOrderRequestService) NewMarketSell

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

type V2AccountOrderRequestStockEip155NewProxiedOrderParams

type V2AccountOrderRequestStockEip155NewProxiedOrderParams struct {
	// Signature of the order typed data, allowing Dinari to place the proxied order on
	// behalf of the `Wallet`.
	OrderSignature string `json:"order_signature,required" format:"hex_string"`
	// 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,required" format:"hex_string"`
	// ID of the prepared proxied order to be submitted as a proxied order.
	PreparedProxiedOrderID string `json:"prepared_proxied_order_id,required" format:"uuid"`
	// contains filtered or unexported fields
}

func (V2AccountOrderRequestStockEip155NewProxiedOrderParams) MarshalJSON

func (*V2AccountOrderRequestStockEip155NewProxiedOrderParams) UnmarshalJSON

type V2AccountOrderRequestStockEip155PrepareProxiedOrderParams

type V2AccountOrderRequestStockEip155PrepareProxiedOrderParams struct {
	// CAIP-2 chain ID of the blockchain where the `Order` will be placed.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,omitzero,required"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,omitzero,required"`
	// Time in force. Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif,omitzero,required"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,omitzero,required"`
	// Address of payment token.
	PaymentToken string `json:"payment_token,required" format:"eth_address"`
	// The ID of the `Stock` for which the `Order` is being placed.
	StockID string `json:"stock_id,required" format:"uuid"`
	// Amount of dShare asset tokens involved. Required for limit `Orders` and market
	// sell `Orders`.
	AssetTokenQuantity param.Opt[float64] `json:"asset_token_quantity,omitzero"`
	// Price per asset in the asset's native currency. USD for US equities and ETFs.
	// Required for limit `Orders`.
	LimitPrice param.Opt[float64] `json:"limit_price,omitzero"`
	// Amount of payment tokens involved. Required for market buy `Orders`.
	PaymentTokenQuantity param.Opt[float64] `json:"payment_token_quantity,omitzero"`
	// contains filtered or unexported fields
}

func (V2AccountOrderRequestStockEip155PrepareProxiedOrderParams) MarshalJSON

func (*V2AccountOrderRequestStockEip155PrepareProxiedOrderParams) UnmarshalJSON

type V2AccountOrderRequestStockEip155PrepareProxiedOrderResponse

type V2AccountOrderRequestStockEip155PrepareProxiedOrderResponse struct {
	// ID of the EvmPreparedProxiedOrder.
	ID string `json:"id,required" format:"uuid"`
	// Deadline for the prepared order to be placed.
	Deadline time.Time `json:"deadline,required" format:"date-time"`
	// Fees involved in the order. Provided here as a reference.
	Fees []OrderFeeAmount `json:"fees,required"`
	// [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data to be signed with a
	// wallet.
	OrderTypedData EvmTypedData `json:"order_typed_data,required"`
	// [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data to be signed with a
	// wallet.
	PermitTypedData EvmTypedData `json:"permit_typed_data,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Deadline        respjson.Field
		Fees            respjson.Field
		OrderTypedData  respjson.Field
		PermitTypedData respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Prepared data for creating an `OrderRequest` through the EVM proxied order API route.

func (V2AccountOrderRequestStockEip155PrepareProxiedOrderResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountOrderRequestStockEip155PrepareProxiedOrderResponse) UnmarshalJSON

type V2AccountOrderRequestStockEip155Service

type V2AccountOrderRequestStockEip155Service struct {
	Options []option.RequestOption
}

V2AccountOrderRequestStockEip155Service 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 NewV2AccountOrderRequestStockEip155Service method instead.

func NewV2AccountOrderRequestStockEip155Service

func NewV2AccountOrderRequestStockEip155Service(opts ...option.RequestOption) (r V2AccountOrderRequestStockEip155Service)

NewV2AccountOrderRequestStockEip155Service 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 (*V2AccountOrderRequestStockEip155Service) NewProxiedOrder

Create a proxied order on EVM from a prepared proxied order. An `OrderRequest` representing the proxied order is returned.

func (*V2AccountOrderRequestStockEip155Service) PrepareProxiedOrder

Prepare a proxied order to be placed on EVM. The returned structure contains the necessary data to create an `OrderRequest` with a `Wallet` that is not Dinari-managed.

type V2AccountOrderRequestStockService

type V2AccountOrderRequestStockService struct {
	Options []option.RequestOption
	Eip155  V2AccountOrderRequestStockEip155Service
}

V2AccountOrderRequestStockService 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 NewV2AccountOrderRequestStockService method instead.

func NewV2AccountOrderRequestStockService

func NewV2AccountOrderRequestStockService(opts ...option.RequestOption) (r V2AccountOrderRequestStockService)

NewV2AccountOrderRequestStockService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type V2AccountOrderService

type V2AccountOrderService struct {
	Options []option.RequestOption
	Stocks  V2AccountOrderStockService
}

V2AccountOrderService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2AccountOrderService method instead.

func NewV2AccountOrderService

func NewV2AccountOrderService(opts ...option.RequestOption) (r V2AccountOrderService)

NewV2AccountOrderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2AccountOrderService) Cancel

func (r *V2AccountOrderService) Cancel(ctx context.Context, orderID string, body V2AccountOrderCancelParams, opts ...option.RequestOption) (res *Order, err error)

Cancel an `Order` by its ID. Note that this requires the `Order` ID, not the `OrderRequest` ID. Once you submit a cancellation request, it cannot be undone. Be advised that orders with a status of PENDING_FILL, PENDING_ESCROW, FILLED, REJECTED, or CANCELLED cannot be cancelled.

`Order` cancellation is not guaranteed nor is it immediate. The `Order` may still be executed if the cancellation request is not received in time.

Check the status using the "Get Order by ID" endpoint to confirm whether the `Order` has been cancelled.

func (*V2AccountOrderService) Get

func (r *V2AccountOrderService) Get(ctx context.Context, orderID string, query V2AccountOrderGetParams, opts ...option.RequestOption) (res *Order, err error)

Get a specific `Order` by its ID.

func (*V2AccountOrderService) 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 or transaction hash.

type V2AccountOrderStockEip155GetFeeQuoteParams

type V2AccountOrderStockEip155GetFeeQuoteParams struct {
	// CAIP-2 chain ID of the blockchain where the `Order` will be placed.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,omitzero,required"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,omitzero,required"`
	// Time in force. Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif,omitzero,required"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,omitzero,required"`
	// Address of payment token.
	PaymentToken string `json:"payment_token,required" format:"eth_address"`
	// The ID of the `Stock` for which the `Order` is being placed.
	StockID string `json:"stock_id,required" format:"uuid"`
	// Amount of dShare asset tokens involved. Required for limit `Orders` and market
	// sell `Orders`.
	AssetTokenQuantity param.Opt[float64] `json:"asset_token_quantity,omitzero"`
	// Price per asset in the asset's native currency. USD for US equities and ETFs.
	// Required for limit `Orders`.
	LimitPrice param.Opt[float64] `json:"limit_price,omitzero"`
	// Amount of payment tokens involved. Required for market buy `Orders`.
	PaymentTokenQuantity param.Opt[float64] `json:"payment_token_quantity,omitzero"`
	// contains filtered or unexported fields
}

func (V2AccountOrderStockEip155GetFeeQuoteParams) MarshalJSON

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

func (*V2AccountOrderStockEip155GetFeeQuoteParams) UnmarshalJSON

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

type V2AccountOrderStockEip155GetFeeQuoteResponse

type V2AccountOrderStockEip155GetFeeQuoteResponse struct {
	// CAIP-2 chain ID of the blockchain where the `Order` will be placed
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,required"`
	// The total quantity of the fees paid via payment token.
	Fee float64 `json:"fee,required"`
	// Opaque fee quote object to pass into the contract when creating an `Order`
	// directly through Dinari's smart contracts.
	OrderFeeContractObject V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObject `json:"order_fee_contract_object,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChainID                respjson.Field
		Fee                    respjson.Field
		OrderFeeContractObject respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (V2AccountOrderStockEip155GetFeeQuoteResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountOrderStockEip155GetFeeQuoteResponse) UnmarshalJSON

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

type V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObject

type V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObject struct {
	// EVM chain ID of the blockchain where the `Order` will be placed.
	//
	// Any of 42161, 1, 8453, 81457, 7887, 98866.
	ChainID int64 `json:"chain_id,required"`
	// `FeeQuote` structure to pass into contracts.
	FeeQuote V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObjectFeeQuote `json:"fee_quote,required"`
	// Signed `FeeQuote` structure to pass into contracts.
	FeeQuoteSignature string `json:"fee_quote_signature,required" format:"hex_string"`
	// Breakdown of fees
	Fees []OrderFeeAmount `json:"fees,required"`
	// Address of payment token used for fees
	PaymentToken string `json:"payment_token,required" format:"eth_address"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChainID           respjson.Field
		FeeQuote          respjson.Field
		FeeQuoteSignature respjson.Field
		Fees              respjson.Field
		PaymentToken      respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Opaque fee quote object to pass into the contract when creating an `Order` directly through Dinari's smart contracts.

func (V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObject) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObject) UnmarshalJSON

type V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObjectFeeQuote

type V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObjectFeeQuote struct {
	Deadline  int64  `json:"deadline,required"`
	Fee       string `json:"fee,required" format:"bigint"`
	OrderID   string `json:"orderId,required" format:"bigint"`
	Requester string `json:"requester,required" format:"eth_address"`
	Timestamp int64  `json:"timestamp,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Deadline    respjson.Field
		Fee         respjson.Field
		OrderID     respjson.Field
		Requester   respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

`FeeQuote` structure to pass into contracts.

func (V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObjectFeeQuote) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountOrderStockEip155GetFeeQuoteResponseOrderFeeContractObjectFeeQuote) UnmarshalJSON

type V2AccountOrderStockEip155PrepareOrderParams

type V2AccountOrderStockEip155PrepareOrderParams struct {
	// CAIP-2 chain ID of the blockchain where the `Order` will be placed.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,omitzero,required"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,omitzero,required"`
	// Time in force. Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif,omitzero,required"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,omitzero,required"`
	// Address of payment token.
	PaymentToken string `json:"payment_token,required" format:"eth_address"`
	// The ID of the `Stock` for which the `Order` is being placed.
	StockID string `json:"stock_id,required" format:"uuid"`
	// Amount of dShare asset tokens involved. Required for limit `Orders` and market
	// sell `Orders`.
	AssetTokenQuantity param.Opt[float64] `json:"asset_token_quantity,omitzero"`
	// Price per asset in the asset's native currency. USD for US equities and ETFs.
	// Required for limit `Orders`.
	LimitPrice param.Opt[float64] `json:"limit_price,omitzero"`
	// Amount of payment tokens involved. Required for market buy `Orders`.
	PaymentTokenQuantity param.Opt[float64] `json:"payment_token_quantity,omitzero"`
	// contains filtered or unexported fields
}

func (V2AccountOrderStockEip155PrepareOrderParams) MarshalJSON

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

func (*V2AccountOrderStockEip155PrepareOrderParams) UnmarshalJSON

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

type V2AccountOrderStockEip155PrepareOrderResponse

type V2AccountOrderStockEip155PrepareOrderResponse struct {
	// Fees included in the order transaction. Provided here as a reference.
	Fees []OrderFeeAmount `json:"fees,required"`
	// List of contract addresses and call data for building transactions to be signed
	// and submitted on chain. Transactions should be submitted on chain in the order
	// provided in this property.
	TransactionData []V2AccountOrderStockEip155PrepareOrderResponseTransactionData `json:"transaction_data,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Fees            respjson.Field
		TransactionData respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Prepared transactions to place an order on an EIP-155 (EVM) chain.

func (V2AccountOrderStockEip155PrepareOrderResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountOrderStockEip155PrepareOrderResponse) UnmarshalJSON

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

type V2AccountOrderStockEip155PrepareOrderResponseTransactionData

type V2AccountOrderStockEip155PrepareOrderResponseTransactionData 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,required"`
	// Arguments to the smart contract function encoded in the transaction. Provided
	// for informational purposes.
	Args any `json:"args,required"`
	// Smart contract address that the transaction should call.
	ContractAddress string `json:"contract_address,required" format:"eth_address"`
	// Hex-encoded function call.
	Data string `json:"data,required" format:"hex_string"`
	// 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
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about a transaction to be signed with a wallet and submitted on chain.

Typically the transactions will include an ERC20 approval transaction to allow the Dinari smart contract to spend the payment token or Dshare asset tokens on behalf of the user, followed by a transaction to call the Dinari smart contract to create an `Order`.

func (V2AccountOrderStockEip155PrepareOrderResponseTransactionData) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountOrderStockEip155PrepareOrderResponseTransactionData) UnmarshalJSON

type V2AccountOrderStockEip155Service

type V2AccountOrderStockEip155Service struct {
	Options []option.RequestOption
}

V2AccountOrderStockEip155Service 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 NewV2AccountOrderStockEip155Service method instead.

func NewV2AccountOrderStockEip155Service

func NewV2AccountOrderStockEip155Service(opts ...option.RequestOption) (r V2AccountOrderStockEip155Service)

NewV2AccountOrderStockEip155Service 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 (*V2AccountOrderStockEip155Service) GetFeeQuote

Get fee quote data for an `Order` to be placed on Dinari's EVM smart contracts.

Dinari's EVM smart contracts require a fee quote to be provided when placing an `Order`. Use this method to retrieve the quote.

The `order_fee_contract_object` property contains the opaque fee quote structure to be used.

func (*V2AccountOrderStockEip155Service) PrepareOrder

Create a set of transactions to create an `Order` using Dinari's EVM smart contracts.

This is a convenience method to prepare the transactions needed to create an `Order` 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.

type V2AccountOrderStockService

type V2AccountOrderStockService struct {
	Options []option.RequestOption
	Eip155  V2AccountOrderStockEip155Service
}

V2AccountOrderStockService 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 NewV2AccountOrderStockService method instead.

func NewV2AccountOrderStockService

func NewV2AccountOrderStockService(opts ...option.RequestOption) (r V2AccountOrderStockService)

NewV2AccountOrderStockService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type V2AccountService

type V2AccountService struct {
	Options            []option.RequestOption
	Wallet             V2AccountWalletService
	Orders             V2AccountOrderService
	OrderFulfillments  V2AccountOrderFulfillmentService
	OrderRequests      V2AccountOrderRequestService
	WithdrawalRequests V2AccountWithdrawalRequestService
	Withdrawals        V2AccountWithdrawalService
}

V2AccountService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2AccountService method instead.

func NewV2AccountService

func NewV2AccountService(opts ...option.RequestOption) (r V2AccountService)

NewV2AccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2AccountService) Deactivate

func (r *V2AccountService) Deactivate(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)

Set the `Account` to be inactive. Inactive accounts cannot be used for trading.

func (*V2AccountService) Get

func (r *V2AccountService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *Account, err error)

Get a specific `Account` by its ID.

func (*V2AccountService) GetCashBalances

func (r *V2AccountService) GetCashBalances(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]V2AccountGetCashBalancesResponse, err error)

Get the cash balances of the `Account`, including stablecoins and other cash equivalents.

func (*V2AccountService) GetDividendPayments

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

func (r *V2AccountService) GetPortfolio(ctx context.Context, accountID string, opts ...option.RequestOption) (res *V2AccountGetPortfolioResponse, err error)

Get the portfolio of the `Account`, excluding cash equivalents such as stablecoins.

func (*V2AccountService) MintSandboxTokens

func (r *V2AccountService) MintSandboxTokens(ctx context.Context, accountID string, body V2AccountMintSandboxTokensParams, opts ...option.RequestOption) (err error)

Mints 1,000 mockUSD sandbox payment tokens to the `Wallet` connected to the `Account`.

This feature is only supported in sandbox mode.

type 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:7887", "eip155:98866", "eip155:11155111", "eip155:421614",
	// "eip155:84532", "eip155:168587773", "eip155:98867", "eip155:31337",
	// "eip155:1337".
	ChainID WalletChainID `json:"chain_id,omitzero,required"`
	// Address of the `Wallet`.
	WalletAddress string `json:"wallet_address,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:7887", "eip155:98866", "eip155:11155111", "eip155:421614",
	// "eip155:84532", "eip155:168587773", "eip155:98867", "eip155:31337",
	// "eip155:1337".
	ChainID WalletChainID `json:"chain_id,omitzero,required"`
	// Nonce contained within the connection message.
	Nonce string `json:"nonce,required" format:"uuid"`
	// Signature payload from signing the connection message with the `Wallet`.
	Signature string `json:"signature,required" format:"hex_string"`
	// Address of the `Wallet`.
	WalletAddress string `json:"wallet_address,required" format:"eth_address"`
	// contains filtered or unexported fields
}

func (V2AccountWalletExternalConnectParams) MarshalJSON

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

func (*V2AccountWalletExternalConnectParams) UnmarshalJSON

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

type V2AccountWalletExternalGetNonceParams

type V2AccountWalletExternalGetNonceParams struct {
	// 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:7887", "eip155:98866", "eip155:11155111", "eip155:421614",
	// "eip155:84532", "eip155:168587773", "eip155:98867", "eip155:31337",
	// "eip155:1337".
	ChainID WalletChainID `query:"chain_id,omitzero,required" json:"-"`
	// Address of the `Wallet` to connect.
	WalletAddress string `query:"wallet_address,required" format:"eth_address" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountWalletExternalGetNonceParams) URLQuery

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

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

type V2AccountWalletExternalGetNonceResponse

type V2AccountWalletExternalGetNonceResponse struct {
	// Message to be signed by the `Wallet`
	Message string `json:"message,required"`
	// Single-use identifier
	Nonce string `json:"nonce,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Nonce       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Connection message to sign to prove ownership of the `Wallet`.

func (V2AccountWalletExternalGetNonceResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2AccountWalletExternalGetNonceResponse) UnmarshalJSON

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

type V2AccountWalletExternalService

type V2AccountWalletExternalService struct {
	Options []option.RequestOption
}

V2AccountWalletExternalService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2AccountWalletExternalService method instead.

func NewV2AccountWalletExternalService

func NewV2AccountWalletExternalService(opts ...option.RequestOption) (r V2AccountWalletExternalService)

NewV2AccountWalletExternalService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2AccountWalletExternalService) Connect

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
	External V2AccountWalletExternalService
}

V2AccountWalletService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2AccountWalletService method instead.

func NewV2AccountWalletService

func NewV2AccountWalletService(opts ...option.RequestOption) (r V2AccountWalletService)

NewV2AccountWalletService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2AccountWalletService) 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,required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type V2AccountWithdrawalListParams

type V2AccountWithdrawalListParams struct {
	Page     param.Opt[int64] `query:"page,omitzero" json:"-"`
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// ID of the `WithdrawalRequest` to find `Withdrawals` for.
	WithdrawalRequestID param.Opt[string] `query:"withdrawal_request_id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (V2AccountWithdrawalListParams) URLQuery

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

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

type V2AccountWithdrawalRequestGetParams

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

type V2AccountWithdrawalRequestListParams

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

func (V2AccountWithdrawalRequestListParams) URLQuery

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

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

type V2AccountWithdrawalRequestNewParams

type V2AccountWithdrawalRequestNewParams struct {
	// Amount of USD+ payment tokens to be withdrawn. Must be greater than 0 and have
	// at most 6 decimal places.
	PaymentTokenQuantity float64 `json:"payment_token_quantity,required"`
	// ID of the `Account` that will receive payment tokens from the `Withdrawal`.
	RecipientAccountID string `json:"recipient_account_id,required" format:"uuid"`
	// contains filtered or unexported fields
}

func (V2AccountWithdrawalRequestNewParams) MarshalJSON

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

func (*V2AccountWithdrawalRequestNewParams) UnmarshalJSON

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

type V2AccountWithdrawalRequestService

type V2AccountWithdrawalRequestService struct {
	Options []option.RequestOption
}

V2AccountWithdrawalRequestService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2AccountWithdrawalRequestService method instead.

func NewV2AccountWithdrawalRequestService

func NewV2AccountWithdrawalRequestService(opts ...option.RequestOption) (r V2AccountWithdrawalRequestService)

NewV2AccountWithdrawalRequestService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2AccountWithdrawalRequestService) Get

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
}

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 V2EntityAccountService

type V2EntityAccountService struct {
	Options []option.RequestOption
}

V2EntityAccountService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2EntityAccountService method instead.

func NewV2EntityAccountService

func NewV2EntityAccountService(opts ...option.RequestOption) (r V2EntityAccountService)

NewV2EntityAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2EntityAccountService) List

func (r *V2EntityAccountService) List(ctx context.Context, entityID string, query V2EntityAccountListParams, opts ...option.RequestOption) (res *[]Account, err error)

Get a list of all `Accounts` that belong to a specific `Entity`. This `Entity` represents your organization itself, or an individual customer of your organization.

func (*V2EntityAccountService) New

func (r *V2EntityAccountService) New(ctx context.Context, entityID string, opts ...option.RequestOption) (res *Account, err error)

Create a new `Account` for a specific `Entity`. This `Entity` represents your organization itself, or an individual customer of your organization.

type V2EntityKYCDocumentGetParams

type V2EntityKYCDocumentGetParams struct {
	EntityID string `path:"entity_id,required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type V2EntityKYCDocumentService

type V2EntityKYCDocumentService struct {
	Options []option.RequestOption
}

V2EntityKYCDocumentService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2EntityKYCDocumentService method instead.

func NewV2EntityKYCDocumentService

func NewV2EntityKYCDocumentService(opts ...option.RequestOption) (r V2EntityKYCDocumentService)

NewV2EntityKYCDocumentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2EntityKYCDocumentService) Get

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,required" format:"uuid" json:"-"`
	// Type of `KYCDocument` to be uploaded.
	//
	// Any of "GOVERNMENT_ID", "SELFIE", "RESIDENCY", "UNKNOWN".
	DocumentType KYCDocumentType `query:"document_type,omitzero,required" json:"-"`
	// File to be uploaded. Must be a valid image or PDF file (jpg, jpeg, png, pdf)
	// less than 10MB in size.
	File io.Reader `json:"file,omitzero,required" format:"binary"`
	// contains filtered or unexported fields
}

func (V2EntityKYCDocumentUploadParams) MarshalMultipart

func (r V2EntityKYCDocumentUploadParams) MarshalMultipart() (data []byte, contentType string, err error)

func (V2EntityKYCDocumentUploadParams) URLQuery

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

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

type V2EntityKYCNewManagedCheckResponse

type V2EntityKYCNewManagedCheckResponse struct {
	// URL of a managed KYC flow interface for the `Entity`.
	EmbedURL string `json:"embed_url,required"`
	// Datetime at which the KYC request will expired. ISO 8601 timestamp.
	ExpirationDt time.Time `json:"expiration_dt,required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EmbedURL     respjson.Field
		ExpirationDt respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

URL for a managed KYC flow for an `Entity`.

func (V2EntityKYCNewManagedCheckResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2EntityKYCNewManagedCheckResponse) UnmarshalJSON

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

type V2EntityKYCService

type V2EntityKYCService struct {
	Options  []option.RequestOption
	Document V2EntityKYCDocumentService
}

V2EntityKYCService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2EntityKYCService method instead.

func NewV2EntityKYCService

func NewV2EntityKYCService(opts ...option.RequestOption) (r V2EntityKYCService)

NewV2EntityKYCService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2EntityKYCService) Get

func (r *V2EntityKYCService) Get(ctx context.Context, entityID string, opts ...option.RequestOption) (res *KYCInfo, err error)

Get most recent KYC data of the `Entity`.

If there are any completed KYC checks, data from the most recent one will be returned. If there are no completed KYC checks, the most recent KYC check information, regardless of status, will be returned.

func (*V2EntityKYCService) NewManagedCheck

func (r *V2EntityKYCService) NewManagedCheck(ctx context.Context, entityID string, opts ...option.RequestOption) (res *V2EntityKYCNewManagedCheckResponse, err error)

Create a Dinari-managed KYC Check and get a URL for your end customer to interact with.

The URL points to a web-based KYC interface that can be presented to the end customer for KYC verification. Once the customer completes this KYC flow, the KYC check will be created and available in the KYC API.

func (*V2EntityKYCService) Submit

func (r *V2EntityKYCService) Submit(ctx context.Context, entityID string, body V2EntityKYCSubmitParams, opts ...option.RequestOption) (res *KYCInfo, err error)

Submit KYC data directly, for partners that are provisioned to provide their own KYC data.

This feature is available for everyone in sandbox mode, and for specifically provisioned partners in production.

type V2EntityKYCSubmitParams

type V2EntityKYCSubmitParams struct {
	// KYC data for an `Entity`.
	Data KYCDataParam `json:"data,omitzero,required"`
	// Name of the KYC provider that provided the KYC information.
	ProviderName string `json:"provider_name,required"`
	// contains filtered or unexported fields
}

func (V2EntityKYCSubmitParams) MarshalJSON

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

func (*V2EntityKYCSubmitParams) UnmarshalJSON

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

type V2EntityListParams added in v0.2.0

type V2EntityListParams struct {
	Page     param.Opt[int64] `query:"page,omitzero" json:"-"`
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Case sensitive unique reference ID for the `Entity`.
	ReferenceID param.Opt[string] `query:"reference_id,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,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 V2EntityAccountService
	KYC      V2EntityKYCService
}

V2EntityService contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2EntityService method instead.

func NewV2EntityService

func NewV2EntityService(opts ...option.RequestOption) (r V2EntityService)

NewV2EntityService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*V2EntityService) GetByID

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

Get a specific customer `Entity` of your organization by their ID.

func (*V2EntityService) GetCurrent

func (r *V2EntityService) GetCurrent(ctx context.Context, opts ...option.RequestOption) (res *Entity, err error)

Get the current authenticated `Entity`, which represents your organization.

func (*V2EntityService) List

func (r *V2EntityService) List(ctx context.Context, 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:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	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,required" format:"uuid"`
	// CAIP-2 formatted chain ID of the blockchain that the `Order` transaction was run
	// on.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,required"`
	// Datetime at which the `Order` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
	// Smart contract address that `Order` was created from.
	OrderContractAddress string `json:"order_contract_address,required" format:"eth_address"`
	// Indicates whether `Order` is a buy or sell.
	//
	// Any of "BUY", "SELL".
	OrderSide OrderSide `json:"order_side,required"`
	// Time in force. Indicates how long `Order` is valid for.
	//
	// Any of "DAY", "GTC", "IOC", "FOK".
	OrderTif OrderTif `json:"order_tif,required"`
	// Transaction hash for the `Order` creation.
	OrderTransactionHash string `json:"order_transaction_hash,required" format:"hex_string"`
	// Type of `Order`.
	//
	// Any of "MARKET", "LIMIT".
	OrderType OrderType `json:"order_type,required"`
	// The payment token (stablecoin) address.
	PaymentToken string `json:"payment_token,required" format:"eth_address"`
	// Status of the `Order`.
	//
	// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
	// "ESCROWED", "SUBMITTED", "CANCELLED", "FILLED", "REJECTED", "REQUIRING_CONTACT",
	// "ERROR".
	Status BrokerageOrderStatus `json:"status,required"`
	// The `Stock` ID associated with the `Order`
	StockID string `json:"stock_id,required" format:"uuid"`
	// Account ID the order was made for.
	AccountID string `json:"account_id" format:"uuid"`
	// The dShare asset token address.
	AssetToken string `json:"asset_token" format:"eth_address"`
	// Total amount of assets involved.
	AssetTokenQuantity float64 `json:"asset_token_quantity"`
	// Transaction hash for cancellation of `Order`, if the `Order` was cancelled.
	CancelTransactionHash string `json:"cancel_transaction_hash" format:"hex_string"`
	// Entity ID of the Order
	EntityID string `json:"entity_id" format:"uuid"`
	// Fee amount associated with `Order`.
	Fee float64 `json:"fee"`
	// For limit `Orders`, the price per asset, specified in the `Stock`'s native
	// currency (USD for US equities and ETFs).
	LimitPrice float64 `json:"limit_price"`
	// Order Request ID for the `Order`
	OrderRequestID string `json:"order_request_id" format:"uuid"`
	// Total amount of payment involved.
	PaymentTokenQuantity float64 `json:"payment_token_quantity"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		ChainID               respjson.Field
		CreatedDt             respjson.Field
		OrderContractAddress  respjson.Field
		OrderSide             respjson.Field
		OrderTif              respjson.Field
		OrderTransactionHash  respjson.Field
		OrderType             respjson.Field
		PaymentToken          respjson.Field
		Status                respjson.Field
		StockID               respjson.Field
		AccountID             respjson.Field
		AssetToken            respjson.Field
		AssetTokenQuantity    respjson.Field
		CancelTransactionHash respjson.Field
		EntityID              respjson.Field
		Fee                   respjson.Field
		LimitPrice            respjson.Field
		OrderRequestID        respjson.Field
		PaymentTokenQuantity  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 V2MarketDataGetMarketHoursResponse

type V2MarketDataGetMarketHoursResponse struct {
	// Whether or not the market is open
	IsMarketOpen bool `json:"is_market_open,required"`
	// Datetime at which the next session closes. ISO 8601 timestamp.
	NextSessionCloseDt time.Time `json:"next_session_close_dt,required" format:"date-time"`
	// Datetime at which the next session opens. ISO 8601 timestamp.
	NextSessionOpenDt time.Time `json:"next_session_open_dt,required" format:"date-time"`
	// Time at which the current session after-hours end.
	CurrentSessionAfterHoursCloseTimeDt time.Time `json:"current_session_after_hours_close_time_dt" format:"date-time"`
	// Datetime at which the current session closes. `null` if the market is currently
	// closed. ISO 8601 timestamp.
	CurrentSessionCloseDt time.Time `json:"current_session_close_dt" format:"date-time"`
	// Datetime at which the current session opened. `null` if the market is currently
	// closed. ISO 8601 timestamp.
	CurrentSessionOpenDt time.Time `json:"current_session_open_dt" format:"date-time"`
	// Time at which the current session overnight starts.
	CurrentSessionOvernightOpenTimeDt time.Time `json:"current_session_overnight_open_time_dt" format:"date-time"`
	// Time at which the current session pre-market hours start.
	CurrentSessionPreMarketOpenTimeDt time.Time `json:"current_session_pre_market_open_time_dt" 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
}

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,required"`
	// ID of the `Stock`
	StockID string `json:"stock_id,required" format:"uuid"`
	// When the Stock Quote was generated.
	Timestamp time.Time `json:"timestamp,required" format:"date-time"`
	// The change in price from the previous close.
	Change float64 `json:"change"`
	// The percentage change in price from the previous close.
	ChangePercent float64 `json:"change_percent"`
	// The close price from the given time period.
	Close float64 `json:"close"`
	// The highest price from the given time period
	High float64 `json:"high"`
	// The lowest price from the given time period.
	Low float64 `json:"low"`
	// The most recent close price of the ticker multiplied by weighted outstanding
	// shares.
	MarketCap int64 `json:"market_cap"`
	// The open price from the given time period.
	Open float64 `json:"open"`
	// The close price for the `Stock` from the previous trading session.
	PreviousClose float64 `json:"previous_close"`
	// The trading volume from the given time period.
	Volume float64 `json:"volume"`
	// The number of shares outstanding in the given time period.
	WeightedSharesOutstanding int64 `json:"weighted_shares_outstanding"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Price                     respjson.Field
		StockID                   respjson.Field
		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,required"`
	// The ask size.
	AskSize float64 `json:"ask_size,required"`
	// The bid price.
	BidPrice float64 `json:"bid_price,required"`
	// The bid size.
	BidSize float64 `json:"bid_size,required"`
	// ID of the `Stock`
	StockID string `json:"stock_id,required" format:"uuid"`
	// When the Stock Quote was generated.
	Timestamp time.Time `json:"timestamp,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"`
	// Currency in which the dividend is paid.
	Currency string `json:"currency"`
	// Date on which the dividend was announced. In ISO 8601 format, YYYY-MM-DD.
	DeclarationDate time.Time `json:"declaration_date" format:"date"`
	// Type of dividend. Dividends that have been paid and/or are expected to be paid
	// on consistent schedules are denoted as `CD`. Special Cash dividends that have
	// been paid that are infrequent or unusual, and/or can not be expected to occur in
	// the future are denoted as `SC`. Long-term and short-term capital gain
	// distributions are denoted as `LT` and `ST`, respectively.
	DividendType string `json:"dividend_type"`
	// Date on or after which a `Stock` is traded without the right to receive the next
	// dividend payment. If you purchase a `Stock` on or after the ex-dividend date,
	// you will not receive the upcoming dividend. In ISO 8601 format, YYYY-MM-DD.
	ExDividendDate time.Time `json:"ex_dividend_date" format:"date"`
	// Frequency of the dividend. The following values are possible:
	//
	// - `1` - Annual
	// - `2` - Semi-Annual
	// - `4` - Quarterly
	// - `12` - Monthly
	// - `52` - Weekly
	// - `365` - Daily
	Frequency int64 `json:"frequency"`
	// Date on which the dividend is paid out. In ISO 8601 format, YYYY-MM-DD.
	PayDate time.Time `json:"pay_date" format:"date"`
	// Date that the shares must be held to receive the dividend; set by the company.
	// In ISO 8601 format, YYYY-MM-DD.
	RecordDate time.Time `json:"record_date" format:"date"`
	// Ticker symbol of the `Stock`.
	Ticker string `json:"ticker"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CashAmount      respjson.Field
		Currency        respjson.Field
		DeclarationDate respjson.Field
		DividendType    respjson.Field
		ExDividendDate  respjson.Field
		Frequency       respjson.Field
		PayDate         respjson.Field
		RecordDate      respjson.Field
		Ticker          respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about a dividend announcement for a `Stock`.

func (V2MarketDataStockGetDividendsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2MarketDataStockGetDividendsResponse) UnmarshalJSON

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

type V2MarketDataStockGetHistoricalPricesParams

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

func (V2MarketDataStockGetHistoricalPricesParams) URLQuery

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

type V2MarketDataStockGetHistoricalPricesParamsTimespan

type V2MarketDataStockGetHistoricalPricesParamsTimespan string

The timespan of the historical prices to query.

const (
	V2MarketDataStockGetHistoricalPricesParamsTimespanDay   V2MarketDataStockGetHistoricalPricesParamsTimespan = "DAY"
	V2MarketDataStockGetHistoricalPricesParamsTimespanWeek  V2MarketDataStockGetHistoricalPricesParamsTimespan = "WEEK"
	V2MarketDataStockGetHistoricalPricesParamsTimespanMonth V2MarketDataStockGetHistoricalPricesParamsTimespan = "MONTH"
	V2MarketDataStockGetHistoricalPricesParamsTimespanYear  V2MarketDataStockGetHistoricalPricesParamsTimespan = "YEAR"
)

type V2MarketDataStockGetHistoricalPricesResponse

type V2MarketDataStockGetHistoricalPricesResponse struct {
	// Close price from the given time period.
	Close float64 `json:"close,required"`
	// Highest price from the given time period.
	High float64 `json:"high,required"`
	// Lowest price from the given time period.
	Low float64 `json:"low,required"`
	// Open price from the given time period.
	Open float64 `json:"open,required"`
	// The UNIX timestamp in seconds for the start of the aggregate window.
	Timestamp int64 `json:"timestamp,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Close       respjson.Field
		High        respjson.Field
		Low         respjson.Field
		Open        respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Datapoint of historical price data for a `Stock`.

func (V2MarketDataStockGetHistoricalPricesResponse) RawJSON

Returns the unmodified JSON received from the API

func (*V2MarketDataStockGetHistoricalPricesResponse) UnmarshalJSON

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

type V2MarketDataStockGetNewsParams

type V2MarketDataStockGetNewsParams struct {
	// The number of articles to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (V2MarketDataStockGetNewsParams) URLQuery

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

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

type V2MarketDataStockGetNewsResponse

type V2MarketDataStockGetNewsResponse struct {
	// URL of the news article
	ArticleURL string `json:"article_url,required"`
	// Description of the news article
	Description string `json:"description,required"`
	// URL of the image for the news article
	ImageURL string `json:"image_url,required"`
	// Datetime when the article was published. ISO 8601 timestamp.
	PublishedDt time.Time `json:"published_dt,required" format:"date-time"`
	// The publisher of the news article
	Publisher string `json:"publisher,required"`
	// Mobile-friendly Accelerated Mobile Page (AMP) URL of the news article, if
	// available
	AmpURL string `json:"amp_url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ArticleURL  respjson.Field
		Description respjson.Field
		ImageURL    respjson.Field
		PublishedDt respjson.Field
		Publisher   respjson.Field
		AmpURL      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A news article relating to a `Stock` which includes a summary of the article and a link to the original source.

func (V2MarketDataStockGetNewsResponse) RawJSON

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,required" format:"uuid"`
	// Whether the `Stock` allows for fractional trading. If it is not fractionable,
	// Dinari only supports limit orders for the `Stock`.
	IsFractionable bool `json:"is_fractionable,required"`
	// Whether the `Stock` is available for trading.
	IsTradable bool `json:"is_tradable,required"`
	// Company name
	Name string `json:"name,required"`
	// Ticker symbol
	Symbol string `json:"symbol,required"`
	// List of CAIP-10 formatted token addresses.
	Tokens []string `json:"tokens,required"`
	// SEC Central Index Key. Refer to
	// [this link](https://www.sec.gov/submit-filings/filer-support-resources/how-do-i-guides/understand-utilize-edgar-ciks-passphrases-access-codes)
	// for more information.
	Cik string `json:"cik,nullable"`
	// Composite FIGI ID. Refer to [this link](https://www.openfigi.com/about/figi) for
	// more information.
	CompositeFigi string `json:"composite_figi,nullable"`
	// CUSIP ID. Refer to [this link](https://www.cusip.com/identifiers.html) for more
	// information.
	Cusip string `json:"cusip,nullable"`
	// Description of the company and their services.
	Description string `json:"description,nullable"`
	// Name of `Stock` for application display. If defined, this supercedes the `name`
	// field for displaying the name.
	DisplayName string `json:"display_name,nullable"`
	// URL of the company's logo. Supported formats are SVG and PNG.
	LogoURL string `json:"logo_url,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		IsFractionable respjson.Field
		IsTradable     respjson.Field
		Name           respjson.Field
		Symbol         respjson.Field
		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
	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
}

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
	MarketData V2MarketDataService
	Entities   V2EntityService
	Accounts   V2AccountService
}

V2Service contains methods and other services that help with interacting with the dinari API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV2Service method instead.

func NewV2Service

func NewV2Service(opts ...option.RequestOption) (r V2Service)

NewV2Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

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,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:7887", "eip155:98866", "eip155:11155111", "eip155:421614",
	// "eip155:84532", "eip155:168587773", "eip155:98867", "eip155:31337",
	// "eip155:1337".
	ChainID WalletChainID `json:"chain_id,required"`
	// Indicates whether the `Wallet` is flagged for AML violation.
	IsAmlFlagged bool `json:"is_aml_flagged,required"`
	// Indicates whether the `Wallet` is a Dinari-managed wallet.
	IsManagedWallet bool `json:"is_managed_wallet,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address         respjson.Field
		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_7887      WalletChainID = "eip155:7887"
	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_31337     WalletChainID = "eip155:31337"
	WalletChainIDEip155_1337      WalletChainID = "eip155:1337"
)

type Withdrawal

type Withdrawal struct {
	// ID of the `Withdrawal`.
	ID string `json:"id,required" format:"uuid"`
	// ID of the `Account` from which the `Withdrawal` is made.
	AccountID string `json:"account_id,required" format:"uuid"`
	// CAIP-2 chain ID of the blockchain where the `Withdrawal` is made.
	//
	// Any of "eip155:1", "eip155:42161", "eip155:8453", "eip155:81457", "eip155:7887",
	// "eip155:98866", "eip155:11155111", "eip155:421614", "eip155:84532",
	// "eip155:168587773", "eip155:98867", "eip155:31337", "eip155:1337".
	ChainID Chain `json:"chain_id,required"`
	// Address of USDC payment token that the `Withdrawal` will be received in.
	PaymentTokenAddress string `json:"payment_token_address,required" format:"eth_address"`
	// Amount of USDC payment tokens to be withdrawn.
	PaymentTokenAmount float64 `json:"payment_token_amount,required"`
	// ID of the `Account` that will receive payment tokens from the `Withdrawal`. This
	// `Account` must be connected to a non-managed `Wallet` and belong to the same
	// `Entity`.
	RecipientAccountID string `json:"recipient_account_id,required" format:"uuid"`
	// Status of the `Withdrawal`.
	//
	// Any of "PENDING_SUBMIT", "PENDING_CANCEL", "PENDING_ESCROW", "PENDING_FILL",
	// "ESCROWED", "SUBMITTED", "CANCELLED", "FILLED", "REJECTED", "REQUIRING_CONTACT",
	// "ERROR".
	Status BrokerageOrderStatus `json:"status,required"`
	// Datetime at which the `Withdrawal` was transacted. ISO 8601 timestamp.
	TransactionDt time.Time `json:"transaction_dt,required" format:"date-time"`
	// Hash of the transaction for the `Withdrawal`.
	TransactionHash string `json:"transaction_hash,required" format:"hex_string"`
	// ID of the `WithdrawalRequest` associated with this `Withdrawal`.
	WithdrawalRequestID string `json:"withdrawal_request_id,required" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		AccountID           respjson.Field
		ChainID             respjson.Field
		PaymentTokenAddress respjson.Field
		PaymentTokenAmount  respjson.Field
		RecipientAccountID  respjson.Field
		Status              respjson.Field
		TransactionDt       respjson.Field
		TransactionHash     respjson.Field
		WithdrawalRequestID respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information for a withdrawal of payment tokens from an `Account` backed by a Dinari-managed `Wallet`.

func (Withdrawal) RawJSON

func (r Withdrawal) RawJSON() string

Returns the unmodified JSON received from the API

func (*Withdrawal) UnmarshalJSON

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

type WithdrawalRequest

type WithdrawalRequest struct {
	// ID of the `WithdrawalRequest`.
	ID string `json:"id,required" format:"uuid"`
	// ID of the `Account` of the `WithdrawalRequest`.
	AccountID string `json:"account_id,required" format:"uuid"`
	// Datetime at which the `WithdrawalRequest` was created. ISO 8601 timestamp.
	CreatedDt time.Time `json:"created_dt,required" format:"date-time"`
	// Amount of USD+ payment tokens submitted for withdrawal.
	PaymentTokenAmount float64 `json:"payment_token_amount,required"`
	// ID of the `Account` that will receive USDC payment tokens from the `Withdrawal`.
	// This `Account` must be connected to a non-managed `Wallet` and belong to the
	// same `Entity`.
	RecipientAccountID string `json:"recipient_account_id,required" format:"uuid"`
	// Status of the `WithdrawalRequest`
	//
	// Any of "PENDING", "SUBMITTED", "ERROR", "CANCELLED".
	Status WithdrawalRequestStatus `json:"status,required"`
	// Datetime at which the `WithdrawalRequest` was updated. ISO 8601 timestamp.
	UpdatedDt time.Time `json:"updated_dt,required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		AccountID          respjson.Field
		CreatedDt          respjson.Field
		PaymentTokenAmount respjson.Field
		RecipientAccountID respjson.Field
		Status             respjson.Field
		UpdatedDt          respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information for a withdrawal request of payment tokens from an `Account` backed by a Dinari-managed `Wallet`.

func (WithdrawalRequest) RawJSON

func (r WithdrawalRequest) RawJSON() string

Returns the unmodified JSON received from the API

func (*WithdrawalRequest) UnmarshalJSON

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

type WithdrawalRequestStatus

type WithdrawalRequestStatus string

Status of the `WithdrawalRequest`

const (
	WithdrawalRequestStatusPending   WithdrawalRequestStatus = "PENDING"
	WithdrawalRequestStatusSubmitted WithdrawalRequestStatus = "SUBMITTED"
	WithdrawalRequestStatusError     WithdrawalRequestStatus = "ERROR"
	WithdrawalRequestStatusCancelled WithdrawalRequestStatus = "CANCELLED"
)

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

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