From e218c1d0431d5f1f6ad46b2433920fae851b4b32 Mon Sep 17 00:00:00 2001 From: Brandon Meyerowitz Date: Fri, 1 May 2026 18:14:49 -0400 Subject: [PATCH 1/2] regenerate --- api/specs/trading-api.json | 2225 +++++++++++++++++++++++++++- cmd/generate/commands.go | 6 +- internal/api/descriptions.gen.go | 84 +- internal/api/trading_client.gen.go | 32 + internal/api/trading_types.gen.go | 154 +- internal/cmd/testdata/ops.golden | 22 + 6 files changed, 2489 insertions(+), 34 deletions(-) diff --git a/api/specs/trading-api.json b/api/specs/trading-api.json index d7a0304..bd741ca 100644 --- a/api/specs/trading-api.json +++ b/api/specs/trading-api.json @@ -66,6 +66,13 @@ }, { "name": "Crypto Perpetuals Leverage (Beta)" + }, + { + "name": "Tokenization", + "description": "Request minting of tokenized assets and list tokenization requests on the Instant Tokenization Network (ITN)." + }, + { + "name": "Events" } ], "paths": { @@ -213,7 +220,7 @@ "x-stoplight": { "id": "gqhf6gxwkrzr8" }, - "description": "(default) false. If true, order will be eligible to execute in premarket/afterhours. Only works with type limit and time_in_force day." + "description": "(default) false. If true, order will be eligible for execution in the pre-market, after-hours, and overnight sessions. Only works with type `limit` and time_in_force set to either `day` or `gtc`" }, "client_order_id": { "type": "string", @@ -628,7 +635,7 @@ "Orders" ], "summary": "Replace Order by ID", - "description": "Replaces a single order with updated parameters. Each parameter overrides the corresponding attribute of the existing order. The other attributes remain the same as the existing order.\n\nA success return code from a replaced order does NOT guarantee the existing open order has been replaced. If the existing open order is filled before the replacing (new) order reaches the execution venue, the replacing (new) order is rejected, and these events are sent in the trade_updates stream channel.\n\nWhile an order is being replaced, buying power is reduced by the larger of the two orders that have been placed (the old order being replaced, and the newly placed order to replace it). If you are replacing a buy entry order with a higher limit price than the original order, the buying power is calculated based on the newly placed order. If you are replacing it with a lower limit price, the buying power is calculated based on the old order.\n\nNote: Order cannot be replaced when the status is `accepted`, `pending_new`, `pending_cancel` or `pending_replace`.\n", + "description": "Replaces a single order with updated parameters. Each parameter overrides the corresponding attribute of the existing order. The other attributes remain the same as the existing order.\n\nA success return code from a replaced order does NOT guarantee the existing open order has been replaced. If the existing open order is filled before the replacing (new) order reaches the execution venue, the replacing (new) order is rejected, and these events are sent in the trade_updates stream channel.\n\nWhile an order is being replaced, buying power is reduced by the larger of the two orders that have been placed (the old order being replaced, and the newly placed order to replace it). If you are replacing a buy entry order with a higher limit price than the original order, the buying power is calculated based on the newly placed order. If you are replacing it with a lower limit price, the buying power is calculated based on the old order.\n\nNote: Order cannot be replaced when the status is `accepted`, `pending_new`, `pending_cancel` or `pending_replace`.\n\nNote: Notional orders cannot be replaced. Any attempt to modify a notional order via this endpoint will be rejected. To change a notional order, cancel it and submit a new one.\n", "requestBody": { "required": true, "content": { @@ -837,10 +844,6 @@ "description": "Option contract symbol or ID." } ], - "requestBody": { - "description": "Empty request body", - "content": {} - }, "responses": { "200": { "description": "Successful Response\n\nExercise instruction successfully submitted." @@ -910,10 +913,6 @@ "description": "Option contract symbol or ID." } ], - "requestBody": { - "description": "Empty request body", - "content": {} - }, "responses": { "200": { "description": "Successful Response\n\nDo-not-exercise instruction successfully submitted." @@ -1047,7 +1046,19 @@ }, "in": "query", "name": "cashflow_types", - "description": "The cashflow activities to include in the report. One of 'ALL', 'NONE', or a comma-separated list of activity types." + "description": "The cashflow activities to include in the report. One of 'ALL', 'NONE', or a comma-separated list of activity types.", + "examples": { + "all": { + "value": "ALL" + }, + "none": { + "value": "NONE" + }, + "cash_transfers": { + "value": "CSD,CSW,FEE", + "summary": "Include cash deposits, withdraws, and transaction fees" + } + } } ], "responses": { @@ -1565,7 +1576,7 @@ "type": "string", "format": "date-time" }, - "description": "Filter activities by the activity date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported." + "description": "Filter activities by their creation date (created_at), not the activity's settlement date. For non-trade activities such as fees, the creation date is typically the day after the trade date (in UTC). Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported." }, { "name": "until", @@ -1671,7 +1682,7 @@ "type": "string", "format": "date-time" }, - "description": "Filter activities by the activity date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported." + "description": "Filter activities by their creation date (created_at), not the activity's settlement date. For non-trade activities such as fees, the creation date is typically the day after the trade date (in UTC). Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported." }, { "name": "until", @@ -1727,6 +1738,69 @@ ] } }, + "/v2beta1/events/activities": { + "get": { + "summary": "Subscribe to Activity Events (SSE)", + "x-internal": "true,", + "tags": [ + "Events" + ], + "responses": { + "200": { + "description": "Connected. Events will now start streaming as long as you keep the connection open.", + "content": { + "text/event-stream": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityEventV2" + } + } + } + } + } + }, + "parameters": [ + { + "name": "since", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "Format: RFC3339 or YYYY-MM-DD" + }, + { + "name": "until", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "Format: RFC3339 or YYYY-MM-DD" + }, + { + "name": "since_id", + "in": "query", + "schema": { + "type": "string", + "format": "ulid" + } + }, + { + "name": "until_id", + "in": "query", + "schema": { + "type": "string", + "format": "ulid" + } + } + ], + "operationId": "subscribeToActivitiesSSE", + "description": "The Events API sends the real-time events and provides historical queries with SSE (Server Sent Events).\n\nThis endpoint streams events on account activities.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery parameter rules:\n- If `until` is specified, `since` is required.\n- If `until_id` is specified, `since_id` is required.\n- You cannot use `since` and `since_id` together.\nBehavior:\n- If `since` or `since_id` is not specified, this will not return any historic data.\n- If `until` or `until_id` is specified, stream will end at the specified point with status 200.\n\n---\n\nWarning: Currently, OAS-3 does not fully support responses from an SSE API.\n\nIn case the client code is generated from this OAS spec, please do not specify `since` and `until`, as the generated client may hang forever waiting for the response to end.\n\nIf you require the streaming capabilities, we recommend not using the generated clients for this specific endpoint until the OAS-3 standards define how to represent this behavior.\n\n---\n\n### Comment messages\nAccording to the SSE specification, any line that starts with a colon is a comment which does not contain data. It is typically a free text that does not follow any data schema. A few examples mentioned below for comment messages.\n\n##### Slow client\n\nThe server sends a comment when the client is not consuming messages fast enough. Example: `: you are reading too slowly, dropped 10000 messages`\n\n##### Internal server error\n\nAn error message is sent as a comment when the server closes the connection on an internal server error (only sent by the v2 and v2beta1 endpoints). Example: `: internal server error`\n\n---" + }, + "parameters": [] + }, "/v2/calendar": { "get": { "summary": "Get US Market Calendar", @@ -1997,7 +2071,7 @@ }, "in": "query", "name": "attributes", - "description": "Comma separated values to query for more than one attribute. Assets which have any of the given attributes will be included.\n\nSupported values:\n- `ptp_no_exception`: Asset is a Publicly Traded Partnership (PTP) without a qualified notice; non-U.S. customers may incur 10% withholding on gross proceeds as per IRS guidance, and are blocked from being purchased by default.\n- `ptp_with_exception`: Users can open positions in these PTPs without general restrictions.\n- `ipo`: Accepting limit orders only before the stock begins trading on the secondary market.\n- `has_options`: The underlying equity has listed options available on the platform. Note: if the equity had inactive/expired contracts in the past, this will still show up.\n- `options_late_close`: Indicates the underlying asset's options contracts close at 4:15pm ET instead of the standard 4:00pm ET.\n- `fractional_eh_enabled`: Indicates the asset accepts fractional orders during extended hours sessions (pre-market, post-market, and overnight if enabled).\n- `overnight_tradable`: Asset is eligible for overnight (24x5) trading in supported venues on the platform.\n- `overnight_halted`: Asset is not eligible for overnight trading but is currently halted/blocked for overnight sessions due to risk, corporate action, compliance, or venue constraints.", + "description": "Comma separated values to query for more than one attribute. Assets which have any of the given attributes will be included.\n\nSupported values:\n- `ptp_no_exception`: Asset is a Publicly Traded Partnership (PTP) without a qualified notice; non-U.S. customers may incur 10% withholding on gross proceeds as per IRS guidance, and are blocked from being purchased by default.\n- `ptp_with_exception`: Users can open positions in these PTPs without general restrictions.\n- `ipo`: Accepting limit orders only before the stock begins trading on the secondary market.\n- `has_options`: The underlying equity has listed options available on the platform. Note: if the equity had inactive/expired contracts in the past, this will still show up.\n- `options_late_close`: Indicates the underlying asset's options contracts close at 4:15pm ET instead of the standard 4:00pm ET.\n- `fractional_eh_enabled`: Indicates the asset accepts fractional orders during extended hours sessions (pre-market, post-market, and overnight if enabled).\n- `overnight_tradable`: Asset is eligible for overnight (24x5) trading in supported venues on the platform.\n- `overnight_halted`: Asset is eligible for overnight trading but is currently halted/blocked for overnight sessions due to risk, corporate action, compliance, or venue constraints.", "explode": false } ] @@ -2524,7 +2598,7 @@ } }, "operationId": "get-v2-corporate_actions-announcements-id", - "description": "This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/corporateactions-1) instead." + "description": "This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/CorporateActions) instead." } }, "/v2/corporate_actions/announcements": { @@ -2640,7 +2714,7 @@ } }, "operationId": "get-v2-corporate_actions-announcements", - "description": "This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/corporateactions-1) instead.", + "description": "This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/CorporateActions) instead.", "parameters": [ { "schema": { @@ -3358,6 +3432,238 @@ } } } + }, + "/v2/tokenization/mint": { + "post": { + "tags": [ + "Tokenization" + ], + "summary": "Mint a Tokenized Asset", + "operationId": "postTokenizationMint", + "description": "This endpoint is used by an Authorized Participant to request the minting of a tokenized asset.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenizationMintRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully requested minting of a tokenized asset.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenizationMintResponse" + } + } + } + }, + "400": { + "description": "Bad request (e.g. malformed input, insufficient position, or account not authorized to mint).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": 40010000, + "message": "failed to decode request body" + } + } + } + }, + "401": { + "description": "Authentication credentials are missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": 40110000, + "message": "unauthorized" + } + } + } + }, + "403": { + "description": "Caller is not authorized to perform this operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": 40310000, + "message": "forbidden" + } + } + } + }, + "422": { + "description": "One or more request parameters are missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": 40010001, + "message": "issuer is required, network is required" + } + } + } + } + } + } + }, + "/v2/tokenization/requests": { + "get": { + "tags": [ + "Tokenization" + ], + "summary": "List Tokenization Requests", + "operationId": "getTokenizationRequests", + "description": "An Authorized Participant can use this endpoint to list the tokenization requests performed on the Instant Tokenization Network (ITN).", + "parameters": [ + { + "name": "type", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "mint", + "redeem" + ], + "example": "mint" + }, + "description": "Tokenization request type to be queried" + }, + { + "name": "status", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "pending", + "rejected", + "completed" + ], + "example": "pending" + }, + "description": "Tokenization request status to be queried" + }, + { + "name": "underlying_symbol", + "in": "query", + "schema": { + "type": "string" + }, + "description": "Underlying symbol of the tokenization requests to be queried" + }, + { + "name": "issuer", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "xstocks" + ], + "example": "xstocks" + }, + "description": "Issuer of the tokenization requests to be queried" + }, + { + "name": "network", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TokenizationNetwork" + }, + "description": "Network of the tokenization requests to be queried" + }, + { + "name": "after", + "in": "query", + "schema": { + "type": "string", + "format": "date-time", + "example": "2025-09-30T18:38:01.942282Z" + }, + "description": "The response will include only requests created after this timestamp (exclusive)" + }, + { + "name": "before", + "in": "query", + "schema": { + "type": "string", + "format": "date-time", + "example": "2025-09-30T18:38:01.942282Z" + }, + "description": "The response will include only requests created before this timestamp (exclusive)" + } + ], + "responses": { + "200": { + "description": "Successful response\n\nA list of tokenization requests", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TokenizationRequest" + } + } + } + } + }, + "401": { + "description": "Authentication credentials are missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": 40110000, + "message": "unauthorized" + } + } + } + }, + "403": { + "description": "Caller is not authorized to perform this operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": 40310000, + "message": "forbidden" + } + } + } + }, + "422": { + "description": "One or more request parameters are missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": 40010001, + "message": "failed to parse after" + } + } + } + } + } + } } }, "components": { @@ -4300,7 +4606,10 @@ "legs": { "type": "array", "description": "When querying non-simple order_class orders in a nested style, an array of Order entities associated with this order. Otherwise, null.", - "nullable": true + "nullable": true, + "items": { + "$ref": "#/components/schemas/OrderLeg" + } }, "trail_percent": { "type": "string", @@ -4609,7 +4918,7 @@ "x-stoplight": { "id": "40mjg4fj0ykl8" }, - "description": "Unique characteristics of the asset. Supported values:\n- `ptp_no_exception`: Asset is a Publicly Traded Partnership (PTP) without a qualified notice; non-U.S. customers may incur 10% withholding on gross proceeds as per IRS guidance, and are blocked from being purchased by default.\n- `ptp_with_exception`: Users can open positions in these PTPs without general restrictions.\n- `ipo`: Accepting limit orders only before the stock begins trading on the secondary market.\n- `has_options`: The underlying equity has listed options available on the platform. Note: if the equity had inactive/expired contracts in the past, this will still show up.\n- `options_late_close`: Indicates the underlying asset's options contracts close at 4:15pm ET instead of the standard 4:00pm ET.\n- `fractional_eh_enabled`: Indicates the asset accepts fractional orders during extended hours sessions (pre-market, post-market, and overnight if enabled).\n- `overnight_tradable`: Asset is eligible for overnight (24x5) trading in supported venues on the platform.\n- `overnight_halted`: Asset is not eligible for overnight trading but is currently halted/blocked for overnight sessions due to risk, corporate action, compliance, or venue constraints.", + "description": "Unique characteristics of the asset. Supported values:\n- `ptp_no_exception`: Asset is a Publicly Traded Partnership (PTP) without a qualified notice; non-U.S. customers may incur 10% withholding on gross proceeds as per IRS guidance, and are blocked from being purchased by default.\n- `ptp_with_exception`: Users can open positions in these PTPs without general restrictions.\n- `ipo`: Accepting limit orders only before the stock begins trading on the secondary market.\n- `has_options`: The underlying equity has listed options available on the platform. Note: if the equity had inactive/expired contracts in the past, this will still show up.\n- `options_late_close`: Indicates the underlying asset's options contracts close at 4:15pm ET instead of the standard 4:00pm ET.\n- `fractional_eh_enabled`: Indicates the asset accepts fractional orders during extended hours sessions (pre-market, post-market, and overnight if enabled).\n- `overnight_tradable`: Asset is eligible for overnight (24x5) trading in supported venues on the platform.\n- `overnight_halted`: Asset is eligible for overnight trading but is currently halted/blocked for overnight sessions due to risk, corporate action, compliance, or venue constraints.", "items": { "type": "string", "enum": [ @@ -5420,6 +5729,49 @@ ], "base_value": 2784.79, "timeframe": "1D" + }, + "example-cashflows": { + "timestamp": [ + 1775606400, + 1775692800, + 1775779200, + 1775865600 + ], + "equity": [ + 8425.21, + 8639.77, + 8766.1, + 8835.31 + ], + "profit_loss": [ + 12.17, + 214.56, + 126.33, + 69.21 + ], + "profit_loss_pct": [ + 0.0014, + 0.0255, + 0.0146, + 0.0079 + ], + "base_value": 8413.04, + "base_value_asof": "2026-04-06", + "cashflow": { + "DIV": [ + 0, + 0, + 0.63, + 0 + ], + "CSD": [ + 9.93, + 10.13, + 10.16, + 0 + ] + }, + "timeframe": "1D" } } }, @@ -5485,7 +5837,7 @@ "qty": { "type": "string", "example": "4", - "description": "number of shares to trade.\n\nYou can only patch full shares for now.\n\nQty of equity fractional/notional orders are not allowed to change." + "description": "number of shares to trade.\n\nYou can only patch full shares for now.\n\nQty of equity fractional orders are not allowed to change. Notional orders cannot be replaced at all \u2014 no fields (qty, limit_price, stop_price, etc.) can be modified." }, "time_in_force": { "$ref": "#/components/schemas/TimeInForce" @@ -5760,13 +6112,218 @@ "OUTGOING" ] }, - "Error": { - "title": "Error", + "TokenizationMintRequest": { + "title": "TokenizationMintRequest", "type": "object", "properties": { - "code": { - "type": "number" - }, + "underlying_symbol": { + "type": "string", + "description": "The underlying asset symbol" + }, + "qty": { + "type": "string", + "description": "The underlying quantity to convert into the tokenized asset. It can be fractional." + }, + "issuer": { + "$ref": "#/components/schemas/TokenizationIssuer" + }, + "network": { + "$ref": "#/components/schemas/TokenizationNetwork" + }, + "wallet_address": { + "type": "string", + "description": "The wallet address to receive the tokenized asset" + } + }, + "required": [ + "underlying_symbol", + "qty", + "issuer", + "network", + "wallet_address" + ] + }, + "TokenizationMintResponse": { + "title": "TokenizationMintResponse", + "type": "object", + "properties": { + "tokenization_request_id": { + "type": "string", + "description": "Unique identifier of the tokenization request set by Alpaca" + }, + "status": { + "$ref": "#/components/schemas/TokenizationRequestStatus" + }, + "underlying_symbol": { + "type": "string", + "description": "The underlying asset symbol" + }, + "token_symbol": { + "type": "string", + "description": "The tokenized asset symbol" + }, + "qty": { + "type": "string", + "description": "The quantity to convert for this tokenization request. It can be fractional." + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "issuer": { + "$ref": "#/components/schemas/TokenizationIssuer" + }, + "network": { + "$ref": "#/components/schemas/TokenizationNetwork" + } + }, + "required": [ + "tokenization_request_id", + "status", + "underlying_symbol", + "token_symbol", + "qty", + "created_at", + "issuer", + "network" + ] + }, + "TokenizationRequest": { + "title": "TokenizationRequest", + "type": "object", + "properties": { + "tokenization_request_id": { + "type": "string", + "description": "Unique identifier of the tokenization request set by Alpaca" + }, + "issuer_request_id": { + "type": "string", + "description": "Unique identifier of the tokenization request set by the issuer", + "nullable": true + }, + "account": { + "type": "string", + "description": "Alpaca account ID associated with this tokenization request" + }, + "issuer_account": { + "type": "string", + "description": "Issuer's account ID associated with this tokenization request" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/TokenizationRequestType" + }, + "status": { + "$ref": "#/components/schemas/TokenizationRequestStatus" + }, + "underlying_symbol": { + "type": "string", + "description": "The underlying asset symbol" + }, + "token_symbol": { + "type": "string", + "description": "The tokenized asset symbol" + }, + "qty": { + "type": "string", + "description": "The quantity to convert for this tokenization request. It can be fractional." + }, + "issuer": { + "$ref": "#/components/schemas/TokenizationIssuer" + }, + "network": { + "$ref": "#/components/schemas/TokenizationNetwork" + }, + "wallet_address": { + "type": "string", + "description": "The wallet address associated with this tokenization request" + }, + "tx_hash": { + "type": "string", + "nullable": true, + "description": "Transaction hash of the completed request on the blockchain" + }, + "fees": { + "type": "string", + "nullable": true, + "description": "Fees charged for this tokenization request" + } + }, + "required": [ + "tokenization_request_id", + "created_at", + "type", + "status", + "underlying_symbol", + "token_symbol", + "qty", + "issuer", + "network", + "wallet_address" + ] + }, + "TokenizationIssuer": { + "type": "string", + "enum": [ + "xstocks", + "st0x" + ], + "example": "xstocks", + "description": "The tokenized asset's issuer", + "title": "TokenizationIssuer" + }, + "TokenizationNetwork": { + "type": "string", + "enum": [ + "solana", + "arbitrum", + "ethereum", + "binance", + "base", + "ton", + "tron", + "mantle" + ], + "example": "solana", + "description": "The token's blockchain network", + "title": "TokenizationNetwork" + }, + "TokenizationRequestType": { + "type": "string", + "enum": [ + "mint", + "redeem" + ], + "example": "mint", + "description": "Tokenization request type", + "title": "TokenizationRequestType" + }, + "TokenizationRequestStatus": { + "type": "string", + "enum": [ + "pending", + "rejected", + "completed" + ], + "example": "completed", + "description": "Status of the tokenization request", + "title": "TokenizationRequestStatus" + }, + "Error": { + "title": "Error", + "type": "object", + "properties": { + "code": { + "type": "number" + }, "message": { "type": "string" } @@ -6661,6 +7218,1626 @@ "required": [ "clocks" ] + }, + "ActivityEventV2": { + "type": "object", + "description": "Represents an account activity, sent over the Event Streaming API.", + "title": "ActivityEventV2", + "allOf": [ + { + "$ref": "#/components/schemas/ActivityEventV2CommonFields" + }, + { + "type": "object", + "required": [ + "details" + ], + "properties": { + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityV2DetailTRD" + }, + { + "$ref": "#/components/schemas/ActivityV2DetailNTA" + } + ] + } + } + } + ] + }, + "ActivityEventV2CommonFields": { + "type": "object", + "description": "Represents the common fields for all Activity V2 Events", + "required": [ + "at", + "event_id", + "activity_type", + "executed_at", + "status", + "settle_date", + "currency", + "ref_id" + ], + "properties": { + "at": { + "type": "string", + "format": "date-time", + "minLength": 1, + "description": "Timestamp of event" + }, + "event_id": { + "type": "string", + "format": "ulid", + "description": "Lexically sortable, monotonically increasing character string" + }, + "activity_type": { + "type": "string", + "description": "The type of the activity, which can be trade or any of the non trade activities" + }, + "activity_subtype": { + "type": "string", + "description": "Sub category for activity type, if any" + }, + "executed_at": { + "type": "string", + "format": "date-time", + "minLength": 1, + "description": "Execution time for the activity event" + }, + "status": { + "type": "string", + "description": "Status of the activity" + }, + "settle_date": { + "type": "string", + "format": "date", + "minLength": 1, + "description": "Date when the activity settled" + }, + "price": { + "type": "string", + "format": "decimal", + "description": "The price of the security involved with the activity" + }, + "qty": { + "type": "string", + "format": "decimal", + "description": "The quantity of the security involved with the activity" + }, + "net_amount": { + "type": "string", + "format": "decimal", + "description": "The net amount of money (positive or negative) associated with the activity" + }, + "swap_rate": { + "type": "string", + "format": "decimal", + "description": "Conversion rate for local currency activities" + }, + "swap_fee_bps": { + "type": "string", + "format": "decimal", + "description": "Currency conversion fee rate base-point in case of local currency activity" + }, + "currency": { + "type": "string", + "description": "Currency code in ISO format" + }, + "ref_id": { + "type": "string", + "format": "uuid", + "description": "The unique identifier for the activity. For trades, the execution_id is used, for other activities the trns_id is used." + }, + "previous_id": { + "type": "string", + "format": "uuid", + "description": "Previous ID is presented if this activity corrects or cancels a previous trade or non trade activity. It contains execution_id or trns_id respectively" + } + } + }, + "ActivityV2DetailTRD": { + "type": "object", + "description": "Activity details for a fill or partial_fill event", + "required": [ + "order_id", + "side", + "symbol", + "asset_id", + "leaves_qty", + "cum_qty", + "order_status", + "execution_type" + ], + "properties": { + "order_id": { + "type": "string", + "format": "uuid", + "description": "Order ID generated by Alpaca" + }, + "client_order_id": { + "type": "string", + "description": "Order ID provided by the customer" + }, + "side": { + "type": "string", + "description": "Represents what side of the transaction an order was on", + "enum": [ + "buy", + "sell" + ] + }, + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + }, + "cusip": { + "type": "string", + "description": "CUSIP of the security involved with the activity" + }, + "asset_id": { + "type": "string", + "description": "Asset ID (For options this represents the option contract ID)", + "format": "uuid" + }, + "leaves_qty": { + "type": "string", + "format": "decimal", + "description": "Unfilled quantity on the order, when order is filled value could be 0" + }, + "cum_qty": { + "type": "string", + "format": "decimal", + "description": "Total filled quantity on the order" + }, + "order_status": { + "type": "string", + "description": "Identifies the current status of the order" + }, + "execution_type": { + "type": "string", + "description": "The execution type", + "enum": [ + "fill", + "trade_correct", + "trade_bust" + ] + }, + "commission": { + "type": "string", + "format": "decimal", + "description": "Commission to collect from the account holder" + } + } + }, + "ActivityV2DetailNTA": { + "type": "object", + "allOf": [ + { + "oneOf": [ + { + "$ref": "#/components/schemas/DIVSPDActivityV2" + }, + { + "$ref": "#/components/schemas/CDIVActivityV2" + }, + { + "$ref": "#/components/schemas/SDIVActivityV2" + }, + { + "$ref": "#/components/schemas/ForwardSplitActivityV2" + }, + { + "$ref": "#/components/schemas/ReverseSplitActivityV2" + }, + { + "$ref": "#/components/schemas/UnitSplitActivityV2" + }, + { + "$ref": "#/components/schemas/SpinoffActivityV2" + }, + { + "$ref": "#/components/schemas/MAActivityV2" + }, + { + "$ref": "#/components/schemas/NCActivityV2" + }, + { + "$ref": "#/components/schemas/FixedIncomeRedemptionActivityV2" + }, + { + "$ref": "#/components/schemas/RightsDistributionActivityV2" + }, + { + "$ref": "#/components/schemas/WRMActivityV2" + }, + { + "$ref": "#/components/schemas/OpcaCDIVActivityV2" + }, + { + "$ref": "#/components/schemas/OpcaSDIVActivityV2" + }, + { + "$ref": "#/components/schemas/OpcaMAActivityV2" + }, + { + "$ref": "#/components/schemas/OpcaNCActivityV2" + }, + { + "$ref": "#/components/schemas/OpcaSPINActivityV2" + }, + { + "$ref": "#/components/schemas/OpcaFSPLITActivityV2" + }, + { + "$ref": "#/components/schemas/OpcaUSPLITActivityV2" + }, + { + "$ref": "#/components/schemas/OpcaRSPLITActivityV2" + }, + { + "$ref": "#/components/schemas/OPASNActivityV2" + }, + { + "$ref": "#/components/schemas/OPEXCActivityV2" + }, + { + "$ref": "#/components/schemas/OPEXPActivityV2" + }, + { + "$ref": "#/components/schemas/OPTRDActivityV2" + }, + { + "$ref": "#/components/schemas/AcatsActivityV2" + }, + { + "$ref": "#/components/schemas/AcatcActivityV2" + }, + { + "$ref": "#/components/schemas/FOPTActivityV2" + }, + { + "$ref": "#/components/schemas/JNLSActivityV2" + }, + { + "$ref": "#/components/schemas/JNLCActivityV2" + }, + { + "$ref": "#/components/schemas/CSWActivityV2" + }, + { + "$ref": "#/components/schemas/FEEActivityV2" + } + ] + } + ] + }, + "CommonNTAActivityV2": { + "type": "object", + "required": [ + "system_date" + ], + "properties": { + "system_date": { + "type": "string", + "minLength": 1, + "description": "The date when the activity was booked", + "format": "date" + }, + "group_id": { + "type": "string", + "description": "Optional group ID which can help grouping together related activities", + "format": "uuid" + } + } + }, + "CommonCaActivityV2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + }, + { + "type": "object", + "required": [ + "ca_id", + "position_date" + ], + "properties": { + "ca_id": { + "type": "string", + "format": "uuid", + "description": "The unique identifier for this corporate action" + }, + "reorg_id": { + "type": "string", + "description": "The reorg identifier, if present in the source corporate action definition" + }, + "position_date": { + "type": "string", + "minLength": 1, + "description": "The position_date for this corporate action", + "format": "date" + } + } + } + ] + }, + "DIVSPDActivityV2": { + "type": "object", + "description": "Substitute payment in lieu of dividend", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "type": "object", + "required": [ + "entitled_qty", + "cash_payout", + "symbol", + "cusip", + "rate", + "foreign", + "special" + ], + "properties": { + "entitled_qty": { + "type": "string", + "description": "Quantity of shares entitled to receive cash in lieu" + }, + "cash_payout": { + "type": "string", + "description": "Total cash amount paid" + }, + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + }, + "cusip": { + "type": "string", + "description": "The CUSIP of the security involved with the activity" + }, + "rate": { + "type": "string", + "description": "Cash payout per share" + }, + "foreign": { + "type": "boolean", + "description": "Indicates if related to a non-US security" + }, + "special": { + "type": "boolean", + "description": "Indicates if this is a special dividend" + }, + "due_bill_on_date": { + "type": "string", + "minLength": 1, + "description": "When due bills begin to apply for this event", + "format": "date" + }, + "due_bill_off_date": { + "type": "string", + "minLength": 1, + "description": "When due bills stop applying for this event", + "format": "date" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + }, + "payable_date": { + "type": "string", + "minLength": 1, + "description": "The payable_date for this corporate action", + "format": "date" + } + } + } + ] + }, + "CommonCDIVActivityV2": { + "type": "object", + "required": [ + "symbol", + "cusip", + "rate", + "foreign", + "special" + ], + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + }, + "cusip": { + "type": "string", + "description": "The CUSIP of the security involved with the activity" + }, + "rate": { + "type": "string", + "description": "Dividend rate per share" + }, + "foreign": { + "type": "boolean", + "description": "Indicates if related to a non-US security" + }, + "special": { + "type": "boolean", + "description": "Indicates if this is a special dividend" + }, + "due_bill_on_date": { + "type": "string", + "minLength": 1, + "description": "When due bills begin to apply for this event", + "format": "date" + }, + "due_bill_off_date": { + "type": "string", + "minLength": 1, + "description": "When due bills stop applying for this event", + "format": "date" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + }, + "payable_date": { + "type": "string", + "minLength": 1, + "description": "The payable_date for this corporate action", + "format": "date" + } + } + }, + "CDIVActivityV2": { + "type": "object", + "description": "Cash dividend", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "$ref": "#/components/schemas/CommonCDIVActivityV2" + }, + { + "type": "object", + "required": [ + "entitled_qty", + "cash_payout" + ], + "properties": { + "entitled_qty": { + "type": "string", + "description": "Quantity of shares entitled to receive the dividend" + }, + "cash_payout": { + "type": "string", + "description": "Total cash amount paid" + } + } + } + ] + }, + "CommonSDIVActivityV2": { + "type": "object", + "required": [ + "symbol", + "cusip", + "rate" + ], + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + }, + "cusip": { + "type": "string", + "description": "The CUSIP of the security involved with the activity" + }, + "rate": { + "type": "string", + "description": "Dividend rate per share" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + }, + "payable_date": { + "type": "string", + "minLength": 1, + "description": "The payable_date for this corporate action", + "format": "date" + } + } + }, + "SDIVActivityV2": { + "type": "object", + "description": "Stock dividend", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "$ref": "#/components/schemas/CommonSDIVActivityV2" + }, + { + "type": "object", + "required": [ + "entitled_qty", + "paid_qty", + "new_qty" + ], + "properties": { + "entitled_qty": { + "type": "string", + "description": "Quantity of shares entitled to receive the dividend" + }, + "paid_qty": { + "type": "string", + "description": "The paid quantity" + }, + "new_qty": { + "type": "string", + "description": "The total number of shares after the dividend" + } + } + } + ] + }, + "CommonSplitActivityV2": { + "type": "object", + "required": [ + "old_cusip", + "new_cusip", + "old_rate", + "new_rate" + ], + "properties": { + "old_cusip": { + "type": "string", + "description": "CUSIP of the old security before the split" + }, + "new_cusip": { + "type": "string", + "description": "CUSIP of the new security after the split" + }, + "old_rate": { + "type": "string", + "description": "Ratio of old shares exchanged" + }, + "new_rate": { + "type": "string", + "description": "Ratio of new shares received" + }, + "payable_date": { + "type": "string", + "minLength": 1, + "description": "The payable_date for this corporate action", + "format": "date" + } + } + }, + "CommonSplitStockActivityV2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "$ref": "#/components/schemas/CommonSplitActivityV2" + }, + { + "type": "object", + "required": [ + "old_qty", + "new_qty" + ], + "properties": { + "old_qty": { + "type": "string", + "description": "The old quantity before the split" + }, + "new_qty": { + "type": "string", + "description": "The new quantity after the split" + } + } + } + ] + }, + "ForwardSplitActivityV2": { + "type": "object", + "description": "Forward stock split", + "allOf": [ + { + "$ref": "#/components/schemas/CommonSplitStockActivityV2" + }, + { + "type": "object", + "required": [ + "symbol" + ], + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the security being split" + }, + "due_bill_redemption_date": { + "type": "string", + "minLength": 1, + "description": "When due bills related to the split are redeemed", + "format": "date" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + } + } + } + ] + }, + "ReverseSplitActivityV2": { + "type": "object", + "description": "Reverse stock split", + "allOf": [ + { + "$ref": "#/components/schemas/CommonSplitStockActivityV2" + }, + { + "type": "object", + "required": [ + "symbol" + ], + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + }, + "new_symbol": { + "type": "string", + "description": "Symbol of the new security after the split" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + } + } + } + ] + }, + "UnitSplitActivityV2": { + "type": "object", + "description": "Unit split", + "allOf": [ + { + "$ref": "#/components/schemas/CommonSplitStockActivityV2" + }, + { + "type": "object", + "required": [ + "old_symbol", + "new_symbol", + "alternate_cusip", + "alternate_symbol", + "alternate_rate", + "alternate_qty", + "effective_date" + ], + "properties": { + "old_symbol": { + "type": "string", + "description": "Symbol of the old security before the split" + }, + "new_symbol": { + "type": "string", + "description": "Symbol of the new security after the split" + }, + "alternate_cusip": { + "type": "string", + "description": "CUSIP for the alternate security after the split" + }, + "alternate_symbol": { + "type": "string", + "description": "Symbol for the alternate security after the split" + }, + "alternate_rate": { + "type": "string", + "description": "Ratio of alternate shares received" + }, + "alternate_qty": { + "type": "string", + "description": "Quantity of alternate shares received" + }, + "effective_date": { + "type": "string", + "minLength": 1, + "description": "When the unit split becomes effective", + "format": "date" + } + } + } + ] + }, + "CommonSpinoffActivityV2": { + "type": "object", + "required": [ + "source_cusip", + "source_symbol", + "source_rate", + "source_price", + "new_cusip", + "new_symbol", + "new_rate", + "new_price" + ], + "properties": { + "source_cusip": { + "type": "string", + "description": "CUSIP of the parent security" + }, + "source_symbol": { + "type": "string", + "description": "Symbol of the parent security" + }, + "source_rate": { + "type": "string", + "description": "Ratio of parent shares" + }, + "source_price": { + "type": "string", + "description": "Market price of parent shares before the spinoff" + }, + "new_cusip": { + "type": "string", + "description": "CUSIP of the new security" + }, + "new_symbol": { + "type": "string", + "description": "Symbol of the new security" + }, + "new_rate": { + "type": "string", + "description": "Ratio of new shares received" + }, + "new_price": { + "type": "string", + "description": "Market price of new shares after the spinoff" + }, + "due_bill_redemption_date": { + "type": "string", + "minLength": 1, + "description": "When due bills related to the spinoff are redeemed", + "format": "date" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + }, + "payable_date": { + "type": "string", + "minLength": 1, + "description": "The payable_date for this corporate action", + "format": "date" + } + } + }, + "SpinoffActivityV2": { + "type": "object", + "description": "Spinoff", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "$ref": "#/components/schemas/CommonSpinoffActivityV2" + }, + { + "type": "object", + "required": [ + "source_qty", + "new_qty" + ], + "properties": { + "source_qty": { + "type": "string", + "description": "The source quantity" + }, + "new_qty": { + "type": "string", + "description": "The new quantity" + } + } + } + ] + }, + "CommonMAActivityV2": { + "type": "object", + "required": [ + "acquiree_cusip", + "acquiree_symbol", + "effective_date", + "payable_date" + ], + "properties": { + "acquiree_cusip": { + "type": "string", + "description": "CUSIP of the acquiree" + }, + "acquiree_symbol": { + "type": "string", + "description": "Symbol of the acquiree" + }, + "acquiree_rate": { + "type": "string", + "description": "Rate of the acquiree" + }, + "effective_date": { + "type": "string", + "minLength": 1, + "description": "When the merger/acquisition becomes effective", + "format": "date" + }, + "payable_date": { + "type": "string", + "minLength": 1, + "description": "The payable date", + "format": "date" + }, + "acquirer_cusip": { + "type": "string", + "description": "CUSIP of the acquirer" + }, + "acquirer_symbol": { + "type": "string", + "description": "Symbol of the acquirer" + }, + "acquirer_rate": { + "type": "string", + "description": "Rate of the acquirer" + } + } + }, + "MAActivityV2": { + "type": "object", + "description": "Merger and acquisition", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "$ref": "#/components/schemas/CommonMAActivityV2" + }, + { + "type": "object", + "required": [ + "acquiree_qty" + ], + "properties": { + "acquiree_qty": { + "type": "string", + "description": "Quantity of the acquiree" + }, + "acquirer_qty": { + "type": "string", + "description": "Quantity of the acquirer" + }, + "cash_rate": { + "type": "string", + "description": "The cash rate" + }, + "cash_payout": { + "type": "string", + "description": "The cash payout" + } + } + } + ] + }, + "CommonNCActivityV2": { + "type": "object", + "required": [ + "old_cusip", + "old_symbol", + "new_cusip", + "new_symbol" + ], + "properties": { + "old_cusip": { + "type": "string", + "description": "Old CUSIP for the name change" + }, + "old_symbol": { + "type": "string", + "description": "Old symbol for the name change" + }, + "new_cusip": { + "type": "string", + "description": "New CUSIP for the name change" + }, + "new_symbol": { + "type": "string", + "description": "New symbol for the name change" + } + } + }, + "NCActivityV2": { + "type": "object", + "description": "Name change", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "$ref": "#/components/schemas/CommonNCActivityV2" + }, + { + "type": "object", + "required": [ + "position_qty" + ], + "properties": { + "position_qty": { + "type": "string", + "description": "The position quantity" + } + } + } + ] + }, + "FixedIncomeRedemptionActivityV2": { + "type": "object", + "description": "Redemption", + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + }, + { + "type": "object", + "required": [ + "ca_id", + "payment_date", + "cusip", + "qty", + "cash_payout" + ], + "properties": { + "ca_id": { + "type": "string", + "description": "The unique identifier for this corporate action" + }, + "payment_date": { + "type": "string", + "minLength": 1, + "description": "The payment date", + "format": "date" + }, + "cusip": { + "type": "string", + "description": "The CUSIP of the security involved with the activity" + }, + "qty": { + "type": "string", + "description": "Quantity for the redemption" + }, + "cash_payout": { + "type": "string", + "description": "The cash payout" + } + } + } + ] + }, + "RightsDistributionActivityV2": { + "type": "object", + "description": "Rights distribution", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "type": "object", + "required": [ + "source_cusip", + "source_symbol", + "source_qty", + "new_cusip", + "new_symbol", + "new_qty", + "rate" + ], + "properties": { + "source_cusip": { + "type": "string", + "description": "The source CUSIP" + }, + "source_symbol": { + "type": "string", + "description": "The source symbol" + }, + "source_qty": { + "type": "string", + "description": "The source quantity" + }, + "new_cusip": { + "type": "string", + "description": "The new CUSIP" + }, + "new_symbol": { + "type": "string", + "description": "The new symbol" + }, + "new_qty": { + "type": "string", + "description": "The new quantity" + }, + "rate": { + "type": "string", + "description": "The rate for the rights distribution" + }, + "expiration_date": { + "type": "string", + "description": "The expiration date for the rights distribution", + "format": "date" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + }, + "payable_date": { + "type": "string", + "minLength": 1, + "description": "The payable_date for this corporate action", + "format": "date" + } + } + } + ] + }, + "WRMActivityV2": { + "type": "object", + "description": "Worthless Removal", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "type": "object", + "required": [ + "cusip", + "symbol", + "removed_qty" + ], + "properties": { + "cusip": { + "type": "string", + "description": "The CUSIP of the security involved with the activity" + }, + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + }, + "removed_qty": { + "type": "string", + "description": "The removed quantity" + } + } + } + ] + }, + "CommonOptionsActivityV2": { + "type": "object", + "required": [ + "group_id" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + } + ] + }, + "OPASNActivityV2": { + "type": "object", + "description": "Option assignment", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOptionsActivityV2" + } + ] + }, + "OPEXCActivityV2": { + "type": "object", + "description": "Option exercise", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOptionsActivityV2" + } + ] + }, + "OPEXPActivityV2": { + "type": "object", + "description": "Option expiry", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOptionsActivityV2" + } + ] + }, + "OPTRDActivityV2": { + "type": "object", + "description": "Trading activity that is paired with the assignment/exercise", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOptionsActivityV2" + } + ] + }, + "CommonOPCAActivityV2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/CommonCaActivityV2" + }, + { + "type": "object", + "required": [ + "old_contract_symbol", + "new_contract_symbol" + ], + "properties": { + "old_contract_symbol": { + "type": "string", + "description": "The old contract symbol" + }, + "new_contract_symbol": { + "type": "string", + "description": "The new contract symbol" + }, + "qty": { + "type": "string", + "description": "used when the old contract's quantity is equal to the new contract's quantity. Mutually exclusive with 'old_qty' and 'new_qty'" + }, + "old_qty": { + "type": "string", + "description": "used when the old contract's quantity is not equal to the new contract's quantity. Mutually exclusive with 'qty'." + }, + "new_qty": { + "type": "string", + "description": "used when the old contract's quantity is not equal to the new contract's quantity. Mutually exclusive with 'qty'." + } + } + } + ] + }, + "OpcaCDIVActivityV2": { + "type": "object", + "description": "Options corporate action of Cash dividend", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOPCAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonCDIVActivityV2" + } + ] + }, + "OpcaSDIVActivityV2": { + "type": "object", + "description": "Options corporate action of stock dividend", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOPCAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonSDIVActivityV2" + } + ] + }, + "OpcaMAActivityV2": { + "type": "object", + "description": "Options corporate action of Mergers & Acquisitions", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOPCAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonMAActivityV2" + } + ] + }, + "OpcaNCActivityV2": { + "type": "object", + "description": "Options corporate action of name changes", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOPCAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonNCActivityV2" + } + ] + }, + "OpcaSPINActivityV2": { + "type": "object", + "description": "Options corporate action of spin-offs", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOPCAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonSpinoffActivityV2" + } + ] + }, + "OpcaFSPLITActivityV2": { + "type": "object", + "description": "Options corporate action of forward-splits", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOPCAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonSplitActivityV2" + }, + { + "type": "object", + "required": [ + "symbol" + ], + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + }, + "due_bill_redemption_date": { + "type": "string", + "minLength": 1, + "description": "When due bills related to the split are redeemed", + "format": "date" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + } + } + } + ] + }, + "OpcaRSPLITActivityV2": { + "type": "object", + "description": "Options corporate action of reverse-splits", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOPCAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonSplitActivityV2" + }, + { + "type": "object", + "required": [ + "symbol" + ], + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + }, + "new_symbol": { + "type": "string", + "description": "Symbol of the new security after the split" + }, + "ex_date": { + "type": "string", + "minLength": 1, + "description": "The ex_date for this corporate action", + "format": "date" + }, + "record_date": { + "type": "string", + "minLength": 1, + "description": "The record_date for this corporate action", + "format": "date" + } + } + } + ] + }, + "OpcaUSPLITActivityV2": { + "type": "object", + "description": "Options corporate action of unit-splits", + "allOf": [ + { + "$ref": "#/components/schemas/CommonOPCAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonSplitActivityV2" + }, + { + "type": "object", + "required": [ + "old_symbol", + "new_symbol", + "alternate_cusip", + "alternate_symbol", + "alternate_rate", + "effective_date" + ], + "properties": { + "old_symbol": { + "type": "string", + "description": "The old symbol of the security involved with the activity" + }, + "new_symbol": { + "type": "string", + "description": "Symbol of the new security after the unit split" + }, + "alternate_cusip": { + "type": "string", + "description": "CUSIP for the alternate security after the split" + }, + "alternate_symbol": { + "type": "string", + "description": "Symbol for the alternate security after the split" + }, + "alternate_rate": { + "type": "string", + "description": "Ratio of alternate shares received" + }, + "effective_date": { + "type": "string", + "minLength": 1, + "description": "When the unit split becomes effective", + "format": "date" + } + } + } + ] + }, + "CommonAcatActivityV2": { + "type": "object", + "required": [ + "external_id", + "request_id" + ], + "properties": { + "hold_date": { + "type": "string", + "minLength": 1, + "description": "Hold date when the transfers settle", + "format": "date" + }, + "external_id": { + "type": "string", + "description": "The ID that DTCC assigned to this transfer" + }, + "request_id": { + "type": "string", + "description": "The ID for original ACATS request", + "format": "uuid" + } + } + }, + "AcatsActivityV2": { + "type": "object", + "description": "Automated customer account transfer service (stock)", + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonAcatActivityV2" + }, + { + "type": "object", + "required": [ + "symbol" + ], + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + } + } + } + ] + }, + "AcatcActivityV2": { + "type": "object", + "description": "Automated customer account transfer service (cash)", + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + }, + { + "$ref": "#/components/schemas/CommonAcatActivityV2" + } + ] + }, + "FOPTActivityV2": { + "type": "object", + "description": "Free-of-payment (FOP) transfers", + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + }, + { + "type": "object", + "required": [ + "external_id", + "contra", + "symbol" + ], + "properties": { + "external_id": { + "type": "string", + "description": "External ID of the transfer" + }, + "contra": { + "type": "string", + "description": "Contra for the transfer" + }, + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + } + } + } + ] + }, + "CommonJournalActivityV2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + }, + { + "type": "object", + "properties": { + "journal_id": { + "type": "string", + "description": "The journal's ID", + "format": "uuid" + } + } + } + ] + }, + "JNLSActivityV2": { + "type": "object", + "description": "Journal entry (stock)", + "allOf": [ + { + "$ref": "#/components/schemas/CommonJournalActivityV2" + }, + { + "type": "object", + "required": [ + "symbol" + ], + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the security involved with the activity" + } + } + } + ] + }, + "JNLCActivityV2": { + "type": "object", + "description": "Journal entry (cash)", + "allOf": [ + { + "$ref": "#/components/schemas/CommonJournalActivityV2" + } + ] + }, + "CSWActivityV2": { + "type": "object", + "description": "Cash withdrawal", + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + }, + { + "type": "object", + "properties": { + "bank_transaction_id": { + "type": "string", + "description": "The bank transaction's ID", + "format": "uuid" + } + } + } + ] + }, + "FEEActivityV2": { + "type": "object", + "description": "Fee", + "allOf": [ + { + "$ref": "#/components/schemas/CommonNTAActivityV2" + }, + { + "type": "object", + "required": [ + "parent_id" + ], + "properties": { + "parent_id": { + "type": "string", + "description": "The parent transaction's ID", + "format": "uuid" + } + } + } + ] } }, "headers": { diff --git a/cmd/generate/commands.go b/cmd/generate/commands.go index 9290ab7..973a4e5 100644 --- a/cmd/generate/commands.go +++ b/cmd/generate/commands.go @@ -809,7 +809,11 @@ var cmdRegistry = map[string]cmdDef{ }, } -var cmdSkip = map[string]string{} +var cmdSkip = map[string]string{ + "GetTokenizationRequests": "tokenization is restricted to Authorized Participants on the Instant Tokenization Network and not exposed via the CLI", + "PostTokenizationMint": "tokenization is restricted to Authorized Participants on the Instant Tokenization Network and not exposed via the CLI", + "SubscribeToActivitiesSSE": "Server-Sent Events streaming endpoint; the CLI's fetch/JSON model does not support long-lived streams", +} func checkExhaustive(epByOp map[string]*endpointInfo) { var errs []string diff --git a/internal/api/descriptions.gen.go b/internal/api/descriptions.gen.go index b39adf5..dffd86a 100644 --- a/internal/api/descriptions.gen.go +++ b/internal/api/descriptions.gen.go @@ -878,7 +878,7 @@ var GetAccountActivitiesOp = Op{ {Name: "activity-types", OASName: "activity_types", Type: "string", Description: "A comma-separated list of activity types used to filter the results", Source: "query"}, {Name: "after", OASName: "after", Type: "string", Description: "get activities created after this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported", Source: "query"}, {Name: "category", OASName: "category", Type: "string", Description: "activity category. Cannot be used with \"activity_types\" parameter", Completions: []string{"non_trade_activity", "trade_activity"}, Source: "query"}, - {Name: "date", OASName: "date", Type: "string", Description: "filter activities by the activity date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported", Source: "query"}, + {Name: "date", OASName: "date", Type: "string", Description: "filter activities by their creation date (created_at), not the activity's settlement date", Source: "query"}, {Name: "direction", OASName: "direction", Type: "string", Default: "desc", Description: "chronological order of response based on the activity datetime", Completions: []string{"asc", "desc"}, Source: "query"}, {Name: "page-size", OASName: "page_size", Type: "int", Default: "100", Description: "maximum number of entries to return in the response", Source: "query"}, {Name: "page-token", OASName: "page_token", Type: "string", Description: "token used for pagination. Provide the ID of the last activity from the last page to retrieve the next set of results", Source: "query"}, @@ -894,7 +894,7 @@ var GetAccountActivitiesByActivityTypeOp = Op{ Flags: []FlagDef{ {Name: "activity-type", OASName: "activity_type", Type: "string", Description: "activity type you want to view entries for. A list of valid activity types can be found at the bottom of this page", Required: true, Source: "path"}, {Name: "after", OASName: "after", Type: "string", Description: "get activities created after this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported", Source: "query"}, - {Name: "date", OASName: "date", Type: "string", Description: "filter activities by the activity date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported", Source: "query"}, + {Name: "date", OASName: "date", Type: "string", Description: "filter activities by their creation date (created_at), not the activity's settlement date", Source: "query"}, {Name: "direction", OASName: "direction", Type: "string", Default: "desc", Description: "chronological order of response based on the activity datetime", Completions: []string{"asc", "desc"}, Source: "query"}, {Name: "page-size", OASName: "page_size", Type: "int", Default: "100", Description: "maximum number of entries to return in the response", Source: "query"}, {Name: "page-token", OASName: "page_token", Type: "string", Description: "token used for pagination. Provide the ID of the last activity from the last page to retrieve the next set of results", Source: "query"}, @@ -1038,6 +1038,20 @@ var GetOrderByOrderIDOp = Op{ }, } +var GetTokenizationRequestsOp = Op{ + Name: "GetTokenizationRequests", Summary: "List tokenization requests", ReturnsArray: true, + Long: "An Authorized Participant can use this endpoint to list the tokenization requests performed on the Instant Tokenization Network (ITN)", + Flags: []FlagDef{ + {Name: "after", OASName: "after", Type: "string", Description: "response will include only requests created after this timestamp (exclusive)", Source: "query"}, + {Name: "before", OASName: "before", Type: "string", Description: "response will include only requests created before this timestamp (exclusive)", Source: "query"}, + {Name: "issuer", OASName: "issuer", Type: "string", Description: "issuer of the tokenization requests to be queried", Completions: []string{"xstocks"}, Source: "query"}, + {Name: "network", OASName: "network", Type: "string", Description: "network of the tokenization requests to be queried", Completions: []string{"arbitrum", "base", "binance", "ethereum", "mantle", "solana", "ton", "tron"}, Source: "query"}, + {Name: "status", OASName: "status", Type: "string", Description: "tokenization request status to be queried", Completions: []string{"completed", "pending", "rejected"}, Source: "query"}, + {Name: "type", OASName: "type", Type: "string", Description: "tokenization request type to be queried", Completions: []string{"mint", "redeem"}, Source: "query"}, + {Name: "underlying-symbol", OASName: "underlying_symbol", Type: "string", Description: "underlying symbol of the tokenization requests to be queried", Source: "query"}, + }, +} + var GetWatchlistByIDOp = Op{ Name: "GetWatchlistByID", Summary: "Get watchlist by ID", Long: "Returns a watchlist identified by the ID", @@ -1165,7 +1179,7 @@ var PatchOrderByOrderIDOp = Op{ {Name: "client-order-id", OASName: "client_order_id", Type: "string", Description: "A unique identifier for the new order. Automatically generated if not sent. (<= 128 characters)", Source: "body"}, {Name: "limit-price", OASName: "limit_price", Type: "string", Description: "required if original order's type field was limit or stop_limit.", Source: "body"}, {Name: "order-id", OASName: "order_id", Type: "string", Description: "order id", Required: true, Source: "path"}, - {Name: "qty", OASName: "qty", Type: "string", Description: "number of shares to trade.", Source: "body"}, + {Name: "qty", OASName: "qty", Type: "string", Description: "number of shares to trade.\n\nYou can only patch full shares for now.\n\nQty of equity fractional orders are not allowed ...", Source: "body"}, {Name: "stop-price", OASName: "stop_price", Type: "string", Description: "required if original order type is limit or stop_limit", Source: "body"}, {Name: "time-in-force", OASName: "time_in_force", Type: "string", Description: "time-In-Force values supported by Alpaca vary based on the order's security type", Completions: []string{"cls", "day", "fok", "gtc", "ioc", "opg"}, Source: "body"}, {Name: "trail", OASName: "trail", Type: "string", Description: "the new value of the trail_price or trail_percent value (works only for type=“trailing_stop”)", Source: "body"}, @@ -1201,6 +1215,18 @@ var PostOrderOp = Op{ }, } +var PostTokenizationMintOp = Op{ + Name: "PostTokenizationMint", Summary: "Create mint a tokenized asset", + Long: "This endpoint is used by an Authorized Participant to request the minting of a tokenized asset", + Flags: []FlagDef{ + {Name: "issuer", OASName: "issuer", Type: "string", Description: "tokenized asset's issuer", Completions: []string{"st0x", "xstocks"}, Source: "body"}, + {Name: "network", OASName: "network", Type: "string", Description: "token's blockchain network", Completions: []string{"arbitrum", "base", "binance", "ethereum", "mantle", "solana", "ton", "tron"}, Source: "body"}, + {Name: "qty", OASName: "qty", Type: "string", Description: "underlying quantity to convert into the tokenized asset. It can be fractional", Source: "body"}, + {Name: "underlying-symbol", OASName: "underlying_symbol", Type: "string", Description: "underlying asset symbol", Source: "body"}, + {Name: "wallet-address", OASName: "wallet_address", Type: "string", Description: "wallet address to receive the tokenized asset", Source: "body"}, + }, +} + var PostWatchlistOp = Op{ Name: "PostWatchlist", Summary: "Create watchlist", Long: "Create a new watchlist with initial set of assets", @@ -1231,6 +1257,17 @@ var SetCryptoPerpAccountLeverageOp = Op{ }, } +var SubscribeToActivitiesSSEOp = Op{ + Name: "SubscribeToActivitiesSSE", Summary: "Get subscribe to activity events (SSE)", + Long: "The Events API sends the real-time events and provides historical queries with SSE (Server Sent Events)", + Flags: []FlagDef{ + {Name: "since", OASName: "since", Type: "string", Description: "format: RFC3339 or YYYY-MM-DD", Source: "query"}, + {Name: "since-id", OASName: "since_id", Type: "string", Description: "since id", Source: "query"}, + {Name: "until", OASName: "until", Type: "string", Description: "format: RFC3339 or YYYY-MM-DD", Source: "query"}, + {Name: "until-id", OASName: "until_id", Type: "string", Description: "until id", Source: "query"}, + }, +} + var UpdateWatchlistByIDOp = Op{ Name: "UpdateWatchlistByID", Summary: "Update watchlist by id", Long: "Update the name and/or content of watchlist", @@ -1663,8 +1700,26 @@ func ResponseSchema(opName string) ([]ResponseField, bool) { "GetOpenPosition": positionResponseFields, "GetOrderByClientOrderID": orderResponseFields, "GetOrderByOrderID": orderResponseFields, - "GetWatchlistByID": watchlistResponseFields, - "GetWatchlistByName": watchlistResponseFields, + "GetTokenizationRequests": { + {Name: "account", Type: "string", Description: "alpaca account ID associated with this tokenization request"}, + {Name: "created_at", Type: "string", Description: "created at"}, + {Name: "fees", Type: "string", Description: "fees charged for this tokenization request"}, + {Name: "issuer", Type: "enum", Description: "tokenized asset's issuer", EnumValues: []string{"st0x", "xstocks"}}, + {Name: "issuer_account", Type: "string", Description: "issuer's account ID associated with this tokenization request"}, + {Name: "issuer_request_id", Type: "string", Description: "unique identifier of the tokenization request set by the issuer"}, + {Name: "network", Type: "enum", Description: "token's blockchain network", EnumValues: []string{"arbitrum", "base", "binance", "ethereum", "mantle", "solana", "ton", "tron"}}, + {Name: "qty", Type: "string", Description: "quantity to convert for this tokenization request. It can be fractional"}, + {Name: "status", Type: "enum", Description: "status of the tokenization request", EnumValues: []string{"completed", "pending", "rejected"}}, + {Name: "token_symbol", Type: "string", Description: "tokenized asset symbol"}, + {Name: "tokenization_request_id", Type: "string", Description: "unique identifier of the tokenization request set by Alpaca"}, + {Name: "tx_hash", Type: "string", Description: "transaction hash of the completed request on the blockchain"}, + {Name: "type", Type: "enum", Description: "tokenization request type", EnumValues: []string{"mint", "redeem"}}, + {Name: "underlying_symbol", Type: "string", Description: "underlying asset symbol"}, + {Name: "updated_at", Type: "string", Description: "updated at"}, + {Name: "wallet_address", Type: "string", Description: "wallet address associated with this tokenization request"}, + }, + "GetWatchlistByID": watchlistResponseFields, + "GetWatchlistByName": watchlistResponseFields, "GetWatchlists": { {Name: "account_id", Type: "string", Description: "account ID"}, {Name: "created_at", Type: "string", Description: "created at"}, @@ -1683,9 +1738,19 @@ func ResponseSchema(opName string) ([]ResponseField, bool) { {Name: "currency", Type: "string", Description: "currency"}, {Name: "next_page_token", Type: "string", Description: "pagination token for the next page"}, }, - "PatchAccountConfig": accountConfigurationsResponseFields, - "PatchOrderByOrderID": orderResponseFields, - "PostOrder": orderResponseFields, + "PatchAccountConfig": accountConfigurationsResponseFields, + "PatchOrderByOrderID": orderResponseFields, + "PostOrder": orderResponseFields, + "PostTokenizationMint": { + {Name: "created_at", Type: "string", Description: "created at"}, + {Name: "issuer", Type: "enum", Description: "tokenized asset's issuer", EnumValues: []string{"st0x", "xstocks"}}, + {Name: "network", Type: "enum", Description: "token's blockchain network", EnumValues: []string{"arbitrum", "base", "binance", "ethereum", "mantle", "solana", "ton", "tron"}}, + {Name: "qty", Type: "string", Description: "quantity to convert for this tokenization request. It can be fractional"}, + {Name: "status", Type: "enum", Description: "status of the tokenization request", EnumValues: []string{"completed", "pending", "rejected"}}, + {Name: "token_symbol", Type: "string", Description: "tokenized asset symbol"}, + {Name: "tokenization_request_id", Type: "string", Description: "unique identifier of the tokenization request set by Alpaca"}, + {Name: "underlying_symbol", Type: "string", Description: "underlying asset symbol"}, + }, "PostWatchlist": watchlistResponseFields, "RemoveAssetFromWatchlist": watchlistResponseFields, "UpdateWatchlistByID": watchlistResponseFields, @@ -1786,6 +1851,7 @@ var AllOps = []Op{ GetOpenPositionOp, GetOrderByClientOrderIDOp, GetOrderByOrderIDOp, + GetTokenizationRequestsOp, GetWatchlistByIDOp, GetWatchlistByNameOp, GetWatchlistsOp, @@ -1801,9 +1867,11 @@ var AllOps = []Op{ PatchAccountConfigOp, PatchOrderByOrderIDOp, PostOrderOp, + PostTokenizationMintOp, PostWatchlistOp, RemoveAssetFromWatchlistOp, SetCryptoPerpAccountLeverageOp, + SubscribeToActivitiesSSEOp, UpdateWatchlistByIDOp, UpdateWatchlistByNameOp, } diff --git a/internal/api/trading_client.gen.go b/internal/api/trading_client.gen.go index 8ec01d1..2b4e62d 100644 --- a/internal/api/trading_client.gen.go +++ b/internal/api/trading_client.gen.go @@ -247,6 +247,16 @@ func (c *TradingClient) OptionExercise(SymbolOrContractID string) (json.RawMessa return c.Raw.Do("POST", c.baseURL, fmt.Sprintf("/v2/positions/%s/exercise", url.PathEscape(SymbolOrContractID)), nil, nil) } +// PostTokenizationMint — Mint a Tokenized Asset +func (c *TradingClient) PostTokenizationMint(body *TokenizationMintRequest) (*TokenizationMintResponse, error) { + return unmarshal[TokenizationMintResponse](c.Raw.Do("POST", c.baseURL, "/v2/tokenization/mint", nil, body)) +} + +// GetTokenizationRequests — List Tokenization Requests +func (c *TradingClient) GetTokenizationRequests(params url.Values) ([]TokenizationRequest, error) { + return unmarshalSlice[TokenizationRequest](c.Raw.Do("GET", c.baseURL, "/v2/tokenization/requests", params, nil)) +} + // ListCryptoFundingWallets — Retrieve Crypto Funding Wallets func (c *TradingClient) ListCryptoFundingWallets(params url.Values) (*CryptoWallet, error) { return unmarshal[CryptoWallet](c.Raw.Do("GET", c.baseURL, "/v2/wallets", params, nil)) @@ -351,6 +361,11 @@ func (c *TradingClient) DeleteWatchlistByName(params url.Values) (json.RawMessag return c.Raw.Do("DELETE", c.baseURL, "/v2/watchlists:by_name", params, nil) } +// SubscribeToActivitiesSSE — Subscribe to Activity Events (SSE) +func (c *TradingClient) SubscribeToActivitiesSSE(params url.Values) (json.RawMessage, error) { + return c.Raw.Do("GET", c.baseURL, "/v2beta1/events/activities", params, nil) +} + // Calendar — Get Market Calendar func (c *TradingClient) Calendar(Market string, params url.Values) (*PublicCalendarResp, error) { return unmarshal[PublicCalendarResp](c.Raw.Do("GET", c.baseURL, fmt.Sprintf("/v3/calendar/%s", url.PathEscape(Market)), params, nil)) @@ -378,6 +393,23 @@ func (r *CreateCryptoTransferRequest) Validate() error { return nil } +func (r *TokenizationMintRequest) Validate() error { + var missing []string + if r.Qty == "" { + missing = append(missing, "qty") + } + if r.UnderlyingSymbol == "" { + missing = append(missing, "underlying_symbol") + } + if r.WalletAddress == "" { + missing = append(missing, "wallet_address") + } + if len(missing) > 0 { + return fmt.Errorf("missing required fields: %s", strings.Join(missing, ", ")) + } + return nil +} + func (r *UpdateWatchlistRequest) Validate() error { var missing []string if r.Name == "" { diff --git a/internal/api/trading_types.gen.go b/internal/api/trading_types.gen.go index afb727f..f3d9536 100644 --- a/internal/api/trading_types.gen.go +++ b/internal/api/trading_types.gen.go @@ -26,6 +26,14 @@ type PositionIntent string type TimeInForce string +type TokenizationIssuer string + +type TokenizationNetwork string + +type TokenizationRequestStatus string + +type TokenizationRequestType string + type TransferDirection string type BondStatus string @@ -98,6 +106,38 @@ type AccountConfigurations struct { TradeConfirmEmail string `json:"trade_confirm_email,omitempty"` } +type ActivityEventV2CommonFields struct { + ActivitySubtype string `json:"activity_subtype,omitempty"` + ActivityType string `json:"activity_type"` + At string `json:"at"` + Currency string `json:"currency"` + EventID string `json:"event_id"` + ExecutedAt string `json:"executed_at"` + NetAmount string `json:"net_amount,omitempty"` + PreviousID string `json:"previous_id,omitempty"` + Price string `json:"price,omitempty"` + Qty string `json:"qty,omitempty"` + RefID string `json:"ref_id"` + SettleDate string `json:"settle_date"` + Status string `json:"status"` + SwapFeeBps string `json:"swap_fee_bps,omitempty"` + SwapRate string `json:"swap_rate,omitempty"` +} + +type ActivityV2DetailTRD struct { + AssetID string `json:"asset_id"` + ClientOrderID string `json:"client_order_id,omitempty"` + Commission string `json:"commission,omitempty"` + CumQty string `json:"cum_qty"` + Cusip string `json:"cusip,omitempty"` + ExecutionType string `json:"execution_type"` + LeavesQty string `json:"leaves_qty"` + OrderID string `json:"order_id"` + OrderStatus string `json:"order_status"` + Side string `json:"side"` + Symbol string `json:"symbol"` +} + type AddAssetToWatchlistRequest struct { Symbol string `json:"symbol,omitempty"` } @@ -149,6 +189,80 @@ type Clock struct { Timestamp string `json:"timestamp,omitempty"` } +type CommonAcatActivityV2 struct { + ExternalID string `json:"external_id"` + HoldDate string `json:"hold_date,omitempty"` + RequestID string `json:"request_id"` +} + +type CommonCDIVActivityV2 struct { + Cusip string `json:"cusip"` + DueBillOffDate string `json:"due_bill_off_date,omitempty"` + DueBillOnDate string `json:"due_bill_on_date,omitempty"` + ExDate string `json:"ex_date,omitempty"` + Foreign bool `json:"foreign"` + PayableDate string `json:"payable_date,omitempty"` + Rate string `json:"rate"` + RecordDate string `json:"record_date,omitempty"` + Special bool `json:"special"` + Symbol string `json:"symbol"` +} + +type CommonMAActivityV2 struct { + AcquireeCusip string `json:"acquiree_cusip"` + AcquireeRate string `json:"acquiree_rate,omitempty"` + AcquireeSymbol string `json:"acquiree_symbol"` + AcquirerCusip string `json:"acquirer_cusip,omitempty"` + AcquirerRate string `json:"acquirer_rate,omitempty"` + AcquirerSymbol string `json:"acquirer_symbol,omitempty"` + EffectiveDate string `json:"effective_date"` + PayableDate string `json:"payable_date"` +} + +type CommonNCActivityV2 struct { + NewCusip string `json:"new_cusip"` + NewSymbol string `json:"new_symbol"` + OldCusip string `json:"old_cusip"` + OldSymbol string `json:"old_symbol"` +} + +type CommonNTAActivityV2 struct { + GroupID string `json:"group_id,omitempty"` + SystemDate string `json:"system_date"` +} + +type CommonSDIVActivityV2 struct { + Cusip string `json:"cusip"` + ExDate string `json:"ex_date,omitempty"` + PayableDate string `json:"payable_date,omitempty"` + Rate string `json:"rate"` + RecordDate string `json:"record_date,omitempty"` + Symbol string `json:"symbol"` +} + +type CommonSpinoffActivityV2 struct { + DueBillRedemptionDate string `json:"due_bill_redemption_date,omitempty"` + ExDate string `json:"ex_date,omitempty"` + NewCusip string `json:"new_cusip"` + NewPrice string `json:"new_price"` + NewRate string `json:"new_rate"` + NewSymbol string `json:"new_symbol"` + PayableDate string `json:"payable_date,omitempty"` + RecordDate string `json:"record_date,omitempty"` + SourceCusip string `json:"source_cusip"` + SourcePrice string `json:"source_price"` + SourceRate string `json:"source_rate"` + SourceSymbol string `json:"source_symbol"` +} + +type CommonSplitActivityV2 struct { + NewCusip string `json:"new_cusip"` + NewRate string `json:"new_rate"` + OldCusip string `json:"old_cusip"` + OldRate string `json:"old_rate"` + PayableDate string `json:"payable_date,omitempty"` +} + type CreateCryptoTransferRequest struct { Address string `json:"address"` Amount string `json:"amount"` @@ -287,7 +401,7 @@ type OrderLeg struct { FilledQty string `json:"filled_qty,omitempty"` Hwm *string `json:"hwm,omitempty"` ID string `json:"id,omitempty"` - Legs []any `json:"legs,omitempty"` + Legs []OrderLeg `json:"legs,omitempty"` LimitPrice *string `json:"limit_price,omitempty"` Notional *string `json:"notional"` OrderClass OrderClass `json:"order_class,omitempty"` @@ -357,6 +471,44 @@ type PositionClosedReponse struct { Symbol string `json:"symbol"` } +type TokenizationMintRequest struct { + Issuer TokenizationIssuer `json:"issuer"` + Network TokenizationNetwork `json:"network"` + Qty string `json:"qty"` + UnderlyingSymbol string `json:"underlying_symbol"` + WalletAddress string `json:"wallet_address"` +} + +type TokenizationMintResponse struct { + CreatedAt string `json:"created_at"` + Issuer TokenizationIssuer `json:"issuer"` + Network TokenizationNetwork `json:"network"` + Qty string `json:"qty"` + Status TokenizationRequestStatus `json:"status"` + TokenSymbol string `json:"token_symbol"` + TokenizationRequestID string `json:"tokenization_request_id"` + UnderlyingSymbol string `json:"underlying_symbol"` +} + +type TokenizationRequest struct { + Account string `json:"account,omitempty"` + CreatedAt string `json:"created_at"` + Fees *string `json:"fees,omitempty"` + Issuer TokenizationIssuer `json:"issuer"` + IssuerAccount string `json:"issuer_account,omitempty"` + IssuerRequestID *string `json:"issuer_request_id,omitempty"` + Network TokenizationNetwork `json:"network"` + Qty string `json:"qty"` + Status TokenizationRequestStatus `json:"status"` + TokenSymbol string `json:"token_symbol"` + TokenizationRequestID string `json:"tokenization_request_id"` + TxHash *string `json:"tx_hash,omitempty"` + Type TokenizationRequestType `json:"type"` + UnderlyingSymbol string `json:"underlying_symbol"` + UpdatedAt *string `json:"updated_at,omitempty"` + WalletAddress string `json:"wallet_address"` +} + type TradingActivities struct { ActivityType ActivityType `json:"activity_type,omitempty"` CumQty string `json:"cum_qty,omitempty"` diff --git a/internal/cmd/testdata/ops.golden b/internal/cmd/testdata/ops.golden index 6db0071..4e82429 100644 --- a/internal/cmd/testdata/ops.golden +++ b/internal/cmd/testdata/ops.golden @@ -494,6 +494,15 @@ GetOrderByOrderID: "Get order by ID" nested (query, bool) -> nested order-id (path, string, required) -> order_id +GetTokenizationRequests: "List tokenization requests" + after (query, string) -> after + before (query, string) -> before + issuer (query, string) -> issuer + network (query, string) -> network + status (query, string) -> status + type (query, string) -> type + underlying-symbol (query, string) -> underlying_symbol + GetWatchlistByID: "Get watchlist by ID" watchlist-id (path, string, required) -> watchlist_id @@ -574,6 +583,13 @@ PostOrder: "Create an order" trail-price (body, string) -> trail_price type (body, string, default=market) -> type +PostTokenizationMint: "Create mint a tokenized asset" + issuer (body, string) -> issuer + network (body, string) -> network + qty (body, string) -> qty + underlying-symbol (body, string) -> underlying_symbol + wallet-address (body, string) -> wallet_address + PostWatchlist: "Create watchlist" name (body, string) -> name symbols (body, string) -> symbols @@ -586,6 +602,12 @@ SetCryptoPerpAccountLeverage: "Set account leverage for an asset" leverage (query, int) -> leverage symbol (query, string) -> symbol +SubscribeToActivitiesSSE: "Get subscribe to activity events (SSE)" + since (query, string) -> since + since-id (query, string) -> since_id + until (query, string) -> until + until-id (query, string) -> until_id + UpdateWatchlistByID: "Update watchlist by id" name (body, string) -> name symbols (body, string) -> symbols From 2a2715e94ad1ad71827d1095b5c406e31264c4ea Mon Sep 17 00:00:00 2001 From: Brandon Meyerowitz Date: Fri, 1 May 2026 18:22:47 -0400 Subject: [PATCH 2/2] pin lint version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c26f51d..147924e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,4 +77,4 @@ jobs: - uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: latest + version: v2.11.4