@clossir-tech/ts-sdk 0.10.1 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/README.md +32 -19
  2. package/esm/funcs/{kyc-post-kyc-webhook-by-provider.d.ts → assets-get-assets-by-asset-id.d.ts} +4 -4
  3. package/esm/funcs/assets-get-assets-by-asset-id.d.ts.map +1 -0
  4. package/esm/funcs/assets-get-assets-by-asset-id.js +106 -0
  5. package/esm/funcs/assets-get-assets-by-asset-id.js.map +1 -0
  6. package/esm/funcs/assets-get-assets.d.ts +18 -0
  7. package/esm/funcs/assets-get-assets.d.ts.map +1 -0
  8. package/esm/funcs/assets-get-assets.js +109 -0
  9. package/esm/funcs/assets-get-assets.js.map +1 -0
  10. package/esm/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.js +1 -1
  11. package/esm/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.js.map +1 -1
  12. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.js +1 -3
  13. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.js.map +1 -1
  14. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.d.ts +1 -1
  15. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.js +2 -2
  16. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.js.map +1 -1
  17. package/esm/funcs/assets-post-orgs-by-org-id-assets.js +1 -1
  18. package/esm/funcs/assets-post-orgs-by-org-id-assets.js.map +1 -1
  19. package/esm/funcs/auth-post-auth-switch-org.d.ts +20 -0
  20. package/esm/funcs/auth-post-auth-switch-org.d.ts.map +1 -0
  21. package/esm/funcs/auth-post-auth-switch-org.js +90 -0
  22. package/esm/funcs/auth-post-auth-switch-org.js.map +1 -0
  23. package/esm/funcs/auth-post-auth-verify-email.d.ts +1 -1
  24. package/esm/funcs/auth-post-auth-verify-email.js +1 -1
  25. package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.d.ts +1 -1
  26. package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.js +2 -2
  27. package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.js.map +1 -1
  28. package/esm/funcs/compliance-post-compliance-check.js +1 -3
  29. package/esm/funcs/compliance-post-compliance-check.js.map +1 -1
  30. package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js +1 -1
  31. package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js.map +1 -1
  32. package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.d.ts +20 -0
  33. package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.d.ts.map +1 -0
  34. package/esm/funcs/{kyc-post-kyc-webhook-by-provider.js → kyb-get-orgs-by-org-id-kyb-status.js} +25 -20
  35. package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.js.map +1 -0
  36. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.d.ts +20 -0
  37. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.d.ts.map +1 -0
  38. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.js +96 -0
  39. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.js.map +1 -0
  40. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.d.ts +20 -0
  41. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.d.ts.map +1 -0
  42. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.js +96 -0
  43. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.js.map +1 -0
  44. package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.d.ts +1 -1
  45. package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.js +2 -2
  46. package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.js.map +1 -1
  47. package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.js +1 -1
  48. package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.js.map +1 -1
  49. package/esm/funcs/organizations-post-orgs-by-org-id-members.d.ts +1 -1
  50. package/esm/funcs/organizations-post-orgs-by-org-id-members.js +1 -1
  51. package/esm/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.js +1 -1
  52. package/esm/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.js.map +1 -1
  53. package/esm/funcs/transfers-post-transfers.d.ts +1 -1
  54. package/esm/funcs/transfers-post-transfers.js +2 -2
  55. package/esm/funcs/transfers-post-transfers.js.map +1 -1
  56. package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js +3 -1
  57. package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js.map +1 -1
  58. package/esm/lib/config.d.ts +2 -2
  59. package/esm/lib/config.js +2 -2
  60. package/esm/models/operations/get-assets-by-asset-id.d.ts +85 -0
  61. package/esm/models/operations/get-assets-by-asset-id.d.ts.map +1 -0
  62. package/esm/models/operations/get-assets-by-asset-id.js +119 -0
  63. package/esm/models/operations/get-assets-by-asset-id.js.map +1 -0
  64. package/esm/models/operations/get-assets.d.ts +112 -0
  65. package/esm/models/operations/get-assets.d.ts.map +1 -0
  66. package/esm/models/operations/get-assets.js +100 -0
  67. package/esm/models/operations/get-assets.js.map +1 -0
  68. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.d.ts +4 -4
  69. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.d.ts.map +1 -1
  70. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.js +4 -5
  71. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.js.map +1 -1
  72. package/esm/models/operations/get-orgs-by-org-id-kyb-status.d.ts +33 -0
  73. package/esm/models/operations/get-orgs-by-org-id-kyb-status.d.ts.map +1 -0
  74. package/esm/models/operations/get-orgs-by-org-id-kyb-status.js +28 -0
  75. package/esm/models/operations/get-orgs-by-org-id-kyb-status.js.map +1 -0
  76. package/esm/models/operations/index.d.ts +6 -1
  77. package/esm/models/operations/index.d.ts.map +1 -1
  78. package/esm/models/operations/index.js +6 -1
  79. package/esm/models/operations/index.js.map +1 -1
  80. package/esm/models/operations/post-auth-switch-org.d.ts +212 -0
  81. package/esm/models/operations/post-auth-switch-org.d.ts.map +1 -0
  82. package/esm/models/operations/post-auth-switch-org.js +206 -0
  83. package/esm/models/operations/post-auth-switch-org.js.map +1 -0
  84. package/esm/models/operations/post-auth-verify-email.d.ts +26 -2
  85. package/esm/models/operations/post-auth-verify-email.d.ts.map +1 -1
  86. package/esm/models/operations/post-auth-verify-email.js +18 -1
  87. package/esm/models/operations/post-auth-verify-email.js.map +1 -1
  88. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.d.ts +2 -8
  89. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.d.ts.map +1 -1
  90. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js +2 -6
  91. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js.map +1 -1
  92. package/esm/models/operations/post-orgs-by-org-id-assets.d.ts +5 -0
  93. package/esm/models/operations/post-orgs-by-org-id-assets.d.ts.map +1 -1
  94. package/esm/models/operations/post-orgs-by-org-id-assets.js +2 -0
  95. package/esm/models/operations/post-orgs-by-org-id-assets.js.map +1 -1
  96. package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.d.ts +36 -0
  97. package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.d.ts.map +1 -0
  98. package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.js +34 -0
  99. package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.js.map +1 -0
  100. package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.d.ts +30 -0
  101. package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.d.ts.map +1 -0
  102. package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.js +25 -0
  103. package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.js.map +1 -0
  104. package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.d.ts +5 -0
  105. package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.d.ts.map +1 -1
  106. package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.js +1 -0
  107. package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.js.map +1 -1
  108. package/esm/models/operations/post-orgs-by-org-id-members.d.ts +20 -0
  109. package/esm/models/operations/post-orgs-by-org-id-members.d.ts.map +1 -1
  110. package/esm/models/operations/post-orgs-by-org-id-members.js.map +1 -1
  111. package/esm/sdk/assets.d.ts +15 -1
  112. package/esm/sdk/assets.d.ts.map +1 -1
  113. package/esm/sdk/assets.js +21 -1
  114. package/esm/sdk/assets.js.map +1 -1
  115. package/esm/sdk/auth.d.ts +8 -1
  116. package/esm/sdk/auth.d.ts.map +1 -1
  117. package/esm/sdk/auth.js +11 -1
  118. package/esm/sdk/auth.js.map +1 -1
  119. package/esm/sdk/bridge.d.ts +1 -1
  120. package/esm/sdk/bridge.js +1 -1
  121. package/esm/sdk/kyb.d.ts +26 -0
  122. package/esm/sdk/kyb.d.ts.map +1 -0
  123. package/esm/sdk/kyb.js +38 -0
  124. package/esm/sdk/kyb.js.map +1 -0
  125. package/esm/sdk/kyc.d.ts +0 -7
  126. package/esm/sdk/kyc.d.ts.map +1 -1
  127. package/esm/sdk/kyc.js +0 -10
  128. package/esm/sdk/kyc.js.map +1 -1
  129. package/esm/sdk/markets.d.ts +1 -1
  130. package/esm/sdk/markets.js +1 -1
  131. package/esm/sdk/organizations.d.ts +1 -1
  132. package/esm/sdk/organizations.js +1 -1
  133. package/esm/sdk/sdk.d.ts +3 -0
  134. package/esm/sdk/sdk.d.ts.map +1 -1
  135. package/esm/sdk/sdk.js +5 -0
  136. package/esm/sdk/sdk.js.map +1 -1
  137. package/esm/sdk/transfers.d.ts +1 -1
  138. package/esm/sdk/transfers.js +1 -1
  139. package/jsr.json +1 -1
  140. package/package.json +3 -3
  141. package/src/funcs/assets-get-assets-by-asset-id.ts +203 -0
  142. package/src/funcs/assets-get-assets.ts +205 -0
  143. package/src/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.ts +1 -1
  144. package/src/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.ts +5 -3
  145. package/src/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.ts +2 -2
  146. package/src/funcs/assets-post-orgs-by-org-id-assets.ts +1 -1
  147. package/src/funcs/auth-post-auth-switch-org.ts +180 -0
  148. package/src/funcs/auth-post-auth-verify-email.ts +1 -1
  149. package/src/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.ts +2 -2
  150. package/src/funcs/compliance-post-compliance-check.ts +5 -3
  151. package/src/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.ts +1 -1
  152. package/src/funcs/{kyc-post-kyc-webhook-by-provider.ts → kyb-get-orgs-by-org-id-kyb-status.ts} +31 -28
  153. package/src/funcs/kyb-post-orgs-by-org-id-kyb-access-token.ts +194 -0
  154. package/src/funcs/kyb-post-orgs-by-org-id-kyb-initiate.ts +194 -0
  155. package/src/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.ts +2 -2
  156. package/src/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.ts +1 -1
  157. package/src/funcs/organizations-post-orgs-by-org-id-members.ts +1 -1
  158. package/src/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.ts +1 -1
  159. package/src/funcs/transfers-post-transfers.ts +2 -2
  160. package/src/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.ts +3 -0
  161. package/src/lib/config.ts +2 -2
  162. package/src/models/operations/get-assets-by-asset-id.ts +253 -0
  163. package/src/models/operations/get-assets.ts +250 -0
  164. package/src/models/operations/get-orgs-by-org-id-assets-by-asset-id.ts +17 -9
  165. package/src/models/operations/get-orgs-by-org-id-kyb-status.ts +78 -0
  166. package/src/models/operations/index.ts +6 -1
  167. package/src/models/operations/post-auth-switch-org.ts +549 -0
  168. package/src/models/operations/post-auth-verify-email.ts +56 -5
  169. package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.ts +19 -26
  170. package/src/models/operations/post-orgs-by-org-id-assets.ts +7 -0
  171. package/src/models/operations/post-orgs-by-org-id-kyb-access-token.ts +93 -0
  172. package/src/models/operations/post-orgs-by-org-id-kyb-initiate.ts +73 -0
  173. package/src/models/operations/post-orgs-by-org-id-members-by-user-id-attest.ts +6 -0
  174. package/src/models/operations/post-orgs-by-org-id-members.ts +20 -0
  175. package/src/sdk/assets.ts +41 -1
  176. package/src/sdk/auth.ts +19 -1
  177. package/src/sdk/bridge.ts +1 -1
  178. package/src/sdk/kyb.ts +63 -0
  179. package/src/sdk/kyc.ts +0 -20
  180. package/src/sdk/markets.ts +1 -1
  181. package/src/sdk/organizations.ts +1 -1
  182. package/src/sdk/sdk.ts +6 -0
  183. package/src/sdk/transfers.ts +1 -1
  184. package/esm/funcs/kyc-post-kyc-webhook-by-provider.d.ts.map +0 -1
  185. package/esm/funcs/kyc-post-kyc-webhook-by-provider.js.map +0 -1
  186. package/esm/models/operations/post-kyc-webhook-by-provider.d.ts +0 -93
  187. package/esm/models/operations/post-kyc-webhook-by-provider.d.ts.map +0 -1
  188. package/esm/models/operations/post-kyc-webhook-by-provider.js +0 -45
  189. package/esm/models/operations/post-kyc-webhook-by-provider.js.map +0 -1
  190. package/src/models/operations/post-kyc-webhook-by-provider.ts +0 -169
@@ -0,0 +1,205 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { ClossirCore } from "../core.js";
7
+ import { encodeFormQuery } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { resolveSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/http-client-errors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
24
+ import { SDKError } from "../models/errors/sdk-error.js";
25
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Discover public assets
32
+ *
33
+ * @remarks
34
+ * Returns all publicly available assets across all organizations. Only includes assets where org_only = false and status is deployed or active, plus the caller's own org's assets in the same statuses. Requires authentication but does NOT require org membership. Supports filtering by type, regulation, KYC level, accreditation, and chain.
35
+ */
36
+ export function assetsGetAssets(
37
+ client: ClossirCore,
38
+ security: operations.GetAssetsSecurity,
39
+ request: operations.GetAssetsRequest,
40
+ options?: RequestOptions,
41
+ ): APIPromise<
42
+ Result<
43
+ operations.GetAssetsResponse,
44
+ | errors.ProblemDetailsError
45
+ | SDKError
46
+ | ResponseValidationError
47
+ | ConnectionError
48
+ | RequestAbortedError
49
+ | RequestTimeoutError
50
+ | InvalidRequestError
51
+ | UnexpectedClientError
52
+ | SDKValidationError
53
+ >
54
+ > {
55
+ return new APIPromise($do(
56
+ client,
57
+ security,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: ClossirCore,
65
+ security: operations.GetAssetsSecurity,
66
+ request: operations.GetAssetsRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ operations.GetAssetsResponse,
72
+ | errors.ProblemDetailsError
73
+ | SDKError
74
+ | ResponseValidationError
75
+ | ConnectionError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | InvalidRequestError
79
+ | UnexpectedClientError
80
+ | SDKValidationError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) => z.parse(operations.GetAssetsRequest$outboundSchema, value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const path = pathToFunc("/assets/")();
97
+
98
+ const query = encodeFormQuery({
99
+ "accredited": payload.accredited,
100
+ "chain_eid": payload.chain_eid,
101
+ "eligible": payload.eligible,
102
+ "limit": payload.limit,
103
+ "max_kyc_level": payload.max_kyc_level,
104
+ "offset": payload.offset,
105
+ "regulation_type": payload.regulation_type,
106
+ "scope": payload.scope,
107
+ "type": payload.type,
108
+ });
109
+
110
+ const headers = new Headers(compactMap({
111
+ Accept: "application/json",
112
+ }));
113
+
114
+ const requestSecurity = resolveSecurity(
115
+ [
116
+ {
117
+ fieldName: "Authorization",
118
+ type: "http:bearer",
119
+ value: security?.bearerAuth,
120
+ },
121
+ ],
122
+ [
123
+ {
124
+ fieldName: "x-api-key",
125
+ type: "apiKey:header",
126
+ value: security?.apiKeyAuth,
127
+ },
128
+ ],
129
+ );
130
+
131
+ const context = {
132
+ options: client._options,
133
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
134
+ operationID: "getAssets",
135
+ oAuth2Scopes: null,
136
+
137
+ resolvedSecurity: requestSecurity,
138
+
139
+ securitySource: security,
140
+ retryConfig: options?.retries
141
+ || client._options.retryConfig
142
+ || { strategy: "none" },
143
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
144
+ };
145
+
146
+ const requestRes = client._createRequest(context, {
147
+ security: requestSecurity,
148
+ method: "GET",
149
+ baseURL: options?.serverURL,
150
+ path: path,
151
+ headers: headers,
152
+ query: query,
153
+ body: body,
154
+ userAgent: client._options.userAgent,
155
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
156
+ }, options);
157
+ if (!requestRes.ok) {
158
+ return [requestRes, { status: "invalid" }];
159
+ }
160
+ const req = requestRes.value;
161
+
162
+ const doResult = await client._do(req, {
163
+ context,
164
+ isErrorStatusCode: (statusCode: number) =>
165
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
166
+ retryConfig: context.retryConfig,
167
+ retryCodes: context.retryCodes,
168
+ });
169
+ if (!doResult.ok) {
170
+ return [doResult, { status: "request-error", request: req }];
171
+ }
172
+ const response = doResult.value;
173
+
174
+ const responseFields = {
175
+ HttpMeta: { Response: response, Request: req },
176
+ };
177
+
178
+ const [result] = await M.match<
179
+ operations.GetAssetsResponse,
180
+ | errors.ProblemDetailsError
181
+ | SDKError
182
+ | ResponseValidationError
183
+ | ConnectionError
184
+ | RequestAbortedError
185
+ | RequestTimeoutError
186
+ | InvalidRequestError
187
+ | UnexpectedClientError
188
+ | SDKValidationError
189
+ >(
190
+ M.json(200, operations.GetAssetsResponse$inboundSchema),
191
+ M.jsonErr([400, 401, 428], errors.ProblemDetailsError$inboundSchema, {
192
+ ctype: "application/problem+json",
193
+ }),
194
+ M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
195
+ ctype: "application/problem+json",
196
+ }),
197
+ M.fail("4XX"),
198
+ M.fail("5XX"),
199
+ )(response, req, { extraFields: responseFields });
200
+ if (!result.ok) {
201
+ return [result, { status: "complete", request: req, response }];
202
+ }
203
+
204
+ return [result, { status: "complete", request: req, response }];
205
+ }
@@ -205,7 +205,7 @@ async function $do(
205
205
  202,
206
206
  operations.PatchOrgsByOrgIdAssetsByAssetIdResponse$inboundSchema,
207
207
  ),
208
- M.jsonErr([400, 403, 428], errors.ProblemDetailsError$inboundSchema, {
208
+ M.jsonErr([400, 403, 422, 428], errors.ProblemDetailsError$inboundSchema, {
209
209
  ctype: "application/problem+json",
210
210
  }),
211
211
  M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
@@ -207,9 +207,11 @@ async function $do(
207
207
  202,
208
208
  operations.PostOrgsByOrgIdAssetsByAssetIdAllocateResponse$inboundSchema,
209
209
  ),
210
- M.jsonErr([403, 404, 409, 428], errors.ProblemDetailsError$inboundSchema, {
211
- ctype: "application/problem+json",
212
- }),
210
+ M.jsonErr(
211
+ [403, 404, 409, 422, 428],
212
+ errors.ProblemDetailsError$inboundSchema,
213
+ { ctype: "application/problem+json" },
214
+ ),
213
215
  M.fail("4XX"),
214
216
  M.fail("5XX"),
215
217
  )(response, req, { extraFields: responseFields });
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Deploy asset to chain
32
32
  *
33
33
  * @remarks
34
- * Triggers on-chain deployment of the asset as a compliance-gated OFT (Omnichain Fungible Token). The deployment is processed asynchronously via CQRS — returns 202 Accepted immediately. The asset must be in 'draft' status and the org must have server wallets provisioned. Poll the asset detail endpoint for deployment status updates.
34
+ * Triggers on-chain deployment of the asset as a compliance-gated OFT (Omnichain Fungible Token). The deployment is processed asynchronously via CQRS — returns 202 Accepted immediately. Two paths: (1) first-chain deploy from status draft, pending_review or approved — mints the full supply and transitions the asset to deploying; (2) additional-chain deploy from status deployed — deploys a zero-mint spoke clone and wires SET_PEER mesh with all existing chains, without changing the asset status. The org must have server wallets provisioned. Returns 409 if the asset is already deployed on the target chain, if a deployment to that chain is already in progress, if the asset is active/paused/retired (add a chain through POST /orgs/:orgId/assets/:assetId/markets), or if its status changed while the request was in flight. Returns 409 with title chain_frozen if the target chain is frozen. Poll the asset detail endpoint for deployment status updates.
35
35
  */
36
36
  export function assetsPostOrgsByOrgIdAssetsByAssetIdDeploy(
37
37
  client: ClossirCore,
@@ -206,7 +206,7 @@ async function $do(
206
206
  operations.PostOrgsByOrgIdAssetsByAssetIdDeployResponse$inboundSchema,
207
207
  ),
208
208
  M.jsonErr(
209
- [400, 403, 404, 409, 428, 429],
209
+ [400, 403, 404, 409, 422, 428, 429],
210
210
  errors.ProblemDetailsError$inboundSchema,
211
211
  { ctype: "application/problem+json" },
212
212
  ),
@@ -191,7 +191,7 @@ async function $do(
191
191
  | SDKValidationError
192
192
  >(
193
193
  M.json(202, operations.PostOrgsByOrgIdAssetsResponse$inboundSchema),
194
- M.jsonErr([400, 403, 428], errors.ProblemDetailsError$inboundSchema, {
194
+ M.jsonErr([400, 403, 422, 428], errors.ProblemDetailsError$inboundSchema, {
195
195
  ctype: "application/problem+json",
196
196
  }),
197
197
  M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
@@ -0,0 +1,180 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { ClossirCore } from "../core.js";
7
+ import { encodeJSON } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/http-client-errors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
24
+ import { SDKError } from "../models/errors/sdk-error.js";
25
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Switch active organization
32
+ *
33
+ * @remarks
34
+ * Switch the authenticated user's active organization context. Rotates the refresh token, revokes the old access token, and returns a new token pair scoped to the target organization. Requires direct active membership in the target org.
35
+ *
36
+ * If set, this operation will use {@link Security.bearerAuth} from the global security.
37
+ */
38
+ export function authPostAuthSwitchOrg(
39
+ client: ClossirCore,
40
+ request: operations.PostAuthSwitchOrgRequest,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ operations.PostAuthSwitchOrgResponse,
45
+ | errors.ProblemDetailsError
46
+ | SDKError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: ClossirCore,
65
+ request: operations.PostAuthSwitchOrgRequest,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ operations.PostAuthSwitchOrgResponse,
71
+ | errors.ProblemDetailsError
72
+ | SDKError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const parsed = safeParse(
85
+ request,
86
+ (value) =>
87
+ z.parse(operations.PostAuthSwitchOrgRequest$outboundSchema, value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = encodeJSON("body", payload, { explode: true });
95
+
96
+ const path = pathToFunc("/auth/switch-org")();
97
+
98
+ const headers = new Headers(compactMap({
99
+ "Content-Type": "application/json",
100
+ Accept: "application/json",
101
+ }));
102
+
103
+ const secConfig = await extractSecurity(client._options.bearerAuth);
104
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
105
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
106
+
107
+ const context = {
108
+ options: client._options,
109
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
110
+ operationID: "postAuthSwitch-org",
111
+ oAuth2Scopes: null,
112
+
113
+ resolvedSecurity: requestSecurity,
114
+
115
+ securitySource: client._options.bearerAuth,
116
+ retryConfig: options?.retries
117
+ || client._options.retryConfig
118
+ || { strategy: "none" },
119
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
120
+ };
121
+
122
+ const requestRes = client._createRequest(context, {
123
+ security: requestSecurity,
124
+ method: "POST",
125
+ baseURL: options?.serverURL,
126
+ path: path,
127
+ headers: headers,
128
+ body: body,
129
+ userAgent: client._options.userAgent,
130
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
131
+ }, options);
132
+ if (!requestRes.ok) {
133
+ return [requestRes, { status: "invalid" }];
134
+ }
135
+ const req = requestRes.value;
136
+
137
+ const doResult = await client._do(req, {
138
+ context,
139
+ isErrorStatusCode: (statusCode: number) =>
140
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
141
+ retryConfig: context.retryConfig,
142
+ retryCodes: context.retryCodes,
143
+ });
144
+ if (!doResult.ok) {
145
+ return [doResult, { status: "request-error", request: req }];
146
+ }
147
+ const response = doResult.value;
148
+
149
+ const responseFields = {
150
+ HttpMeta: { Response: response, Request: req },
151
+ };
152
+
153
+ const [result] = await M.match<
154
+ operations.PostAuthSwitchOrgResponse,
155
+ | errors.ProblemDetailsError
156
+ | SDKError
157
+ | ResponseValidationError
158
+ | ConnectionError
159
+ | RequestAbortedError
160
+ | RequestTimeoutError
161
+ | InvalidRequestError
162
+ | UnexpectedClientError
163
+ | SDKValidationError
164
+ >(
165
+ M.json(200, operations.PostAuthSwitchOrgResponse$inboundSchema),
166
+ M.jsonErr([401, 403, 429], errors.ProblemDetailsError$inboundSchema, {
167
+ ctype: "application/problem+json",
168
+ }),
169
+ M.jsonErr([500, 503], errors.ProblemDetailsError$inboundSchema, {
170
+ ctype: "application/problem+json",
171
+ }),
172
+ M.fail("4XX"),
173
+ M.fail("5XX"),
174
+ )(response, req, { extraFields: responseFields });
175
+ if (!result.ok) {
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
178
+
179
+ return [result, { status: "complete", request: req, response }];
180
+ }
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * Verify email address
31
31
  *
32
32
  * @remarks
33
- * Validates the email verification token and activates the user account.
33
+ * Validates an email verification token (from a link) or a 6-digit code (with email) and activates the account, but only while it is awaiting email verification. Accepts either { token } for link verification or { code, email } for code verification. If the account is already active the token is spent and the response is 200 with an "already verified" message. For any other account state (suspended, invited, pending, or no longer present) the token is spent and the response is 400 `invalid_token`; a verification link never re-activates a suspended account.
34
34
  */
35
35
  export function authPostAuthVerifyEmail(
36
36
  client: ClossirCore,
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Initiate cross-chain bridge (CQRS)
32
32
  *
33
33
  * @remarks
34
- * Queues a cross-chain OFT bridge for an asset via LayerZero. The asset must be deployed on at least one chain. Tokens are sent from the org server wallet on the source chain to the recipient address on the destination chain. Optionally include a compose message for SEND_AND_CALL (e.g., attestation sync). Returns 202 Accepted immediately.
34
+ * Queues a cross-chain OFT bridge for an asset via LayerZero. The asset must be deployed on at least one chain. Tokens are sent from the org server wallet on the source chain to the recipient address on the destination chain. Optionally include a compose message for SEND_AND_CALL (e.g., attestation sync). Returns 409 with title chain_frozen if the destination or the source chain is frozen. Returns 202 Accepted immediately.
35
35
  */
36
36
  export function bridgePostOrgsByOrgIdAssetsByAssetIdBridge(
37
37
  client: ClossirCore,
@@ -206,7 +206,7 @@ async function $do(
206
206
  operations.PostOrgsByOrgIdAssetsByAssetIdBridgeResponse$inboundSchema,
207
207
  ),
208
208
  M.jsonErr(
209
- [400, 403, 404, 409, 428, 429],
209
+ [400, 403, 404, 409, 422, 428, 429],
210
210
  errors.ProblemDetailsError$inboundSchema,
211
211
  { ctype: "application/problem+json" },
212
212
  ),
@@ -163,9 +163,11 @@ async function $do(
163
163
  | SDKValidationError
164
164
  >(
165
165
  M.json(202, operations.PostComplianceCheckResponse$inboundSchema),
166
- M.jsonErr([400, 401, 428, 429], errors.ProblemDetailsError$inboundSchema, {
167
- ctype: "application/problem+json",
168
- }),
166
+ M.jsonErr(
167
+ [400, 401, 422, 428, 429],
168
+ errors.ProblemDetailsError$inboundSchema,
169
+ { ctype: "application/problem+json" },
170
+ ),
169
171
  M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
170
172
  ctype: "application/problem+json",
171
173
  }),
@@ -215,7 +215,7 @@ async function $do(
215
215
  operations
216
216
  .PostOrgsByOrgIdAssetsByAssetIdCompliancePolicyResponse$inboundSchema,
217
217
  ),
218
- M.jsonErr([403, 404, 428], errors.ProblemDetailsError$inboundSchema, {
218
+ M.jsonErr([403, 404, 422, 428], errors.ProblemDetailsError$inboundSchema, {
219
219
  ctype: "application/problem+json",
220
220
  }),
221
221
  M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
@@ -4,12 +4,13 @@
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
6
  import { ClossirCore } from "../core.js";
7
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
8
  import { matchStatusCode } from "../lib/http.js";
9
9
  import * as M from "../lib/matchers.js";
10
10
  import { compactMap } from "../lib/primitives.js";
11
11
  import { safeParse } from "../lib/schemas.js";
12
12
  import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
14
  import { pathToFunc } from "../lib/url.js";
14
15
  import {
15
16
  ConnectionError,
@@ -27,19 +28,20 @@ import { APICall, APIPromise } from "../types/async.js";
27
28
  import { Result } from "../types/fp.js";
28
29
 
29
30
  /**
30
- * KYC webhook
31
+ * Get org KYB verification status
31
32
  *
32
33
  * @remarks
33
- * Webhook endpoint for KYC provider callbacks. The digest is verified against the raw request bytes; every rejection returns the same opaque 400.
34
+ * Returns the KYB verification status from org_verifications. Reads through RLS-scoped client. Requires admin or compliance_officer role. JWT only.
35
+ *
36
+ * If set, this operation will use {@link Security.bearerAuth} from the global security.
34
37
  */
35
- export function kycPostKYCWebhookByProvider(
38
+ export function kybGetOrgsByOrgIdKYBStatus(
36
39
  client: ClossirCore,
37
- provider: string,
38
- body: operations.PostKycWebhookByProviderRequestBody,
40
+ orgId: string,
39
41
  options?: RequestOptions,
40
42
  ): APIPromise<
41
43
  Result<
42
- operations.PostKycWebhookByProviderResponse,
44
+ operations.GetOrgsByOrgIdKybStatusResponse,
43
45
  | errors.ProblemDetailsError
44
46
  | SDKError
45
47
  | ResponseValidationError
@@ -53,21 +55,19 @@ export function kycPostKYCWebhookByProvider(
53
55
  > {
54
56
  return new APIPromise($do(
55
57
  client,
56
- provider,
57
- body,
58
+ orgId,
58
59
  options,
59
60
  ));
60
61
  }
61
62
 
62
63
  async function $do(
63
64
  client: ClossirCore,
64
- provider: string,
65
- body: operations.PostKycWebhookByProviderRequestBody,
65
+ orgId: string,
66
66
  options?: RequestOptions,
67
67
  ): Promise<
68
68
  [
69
69
  Result<
70
- operations.PostKycWebhookByProviderResponse,
70
+ operations.GetOrgsByOrgIdKybStatusResponse,
71
71
  | errors.ProblemDetailsError
72
72
  | SDKError
73
73
  | ResponseValidationError
@@ -81,45 +81,47 @@ async function $do(
81
81
  APICall,
82
82
  ]
83
83
  > {
84
- const input: operations.PostKycWebhookByProviderRequest = {
85
- provider: provider,
86
- body: body,
84
+ const input: operations.GetOrgsByOrgIdKybStatusRequest = {
85
+ orgId: orgId,
87
86
  };
88
87
 
89
88
  const parsed = safeParse(
90
89
  input,
91
90
  (value) =>
92
- z.parse(operations.PostKycWebhookByProviderRequest$outboundSchema, value),
91
+ z.parse(operations.GetOrgsByOrgIdKybStatusRequest$outboundSchema, value),
93
92
  "Input validation failed",
94
93
  );
95
94
  if (!parsed.ok) {
96
95
  return [parsed, { status: "invalid" }];
97
96
  }
98
97
  const payload = parsed.value;
99
- const body$ = encodeJSON("body", payload.body, { explode: true });
98
+ const body = null;
100
99
 
101
100
  const pathParams = {
102
- provider: encodeSimple("provider", payload.provider, {
101
+ orgId: encodeSimple("orgId", payload.orgId, {
103
102
  explode: false,
104
103
  charEncoding: "percent",
105
104
  }),
106
105
  };
107
- const path = pathToFunc("/kyc/webhook/{provider}")(pathParams);
106
+ const path = pathToFunc("/orgs/{orgId}/kyb/status")(pathParams);
108
107
 
109
108
  const headers = new Headers(compactMap({
110
- "Content-Type": "application/json",
111
109
  Accept: "application/json",
112
110
  }));
113
111
 
112
+ const secConfig = await extractSecurity(client._options.bearerAuth);
113
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
114
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
115
+
114
116
  const context = {
115
117
  options: client._options,
116
118
  baseURL: options?.serverURL ?? client._baseURL ?? "",
117
- operationID: "postKycWebhookByProvider",
119
+ operationID: "getOrgsByOrgIdKybStatus",
118
120
  oAuth2Scopes: null,
119
121
 
120
- resolvedSecurity: null,
122
+ resolvedSecurity: requestSecurity,
121
123
 
122
- securitySource: null,
124
+ securitySource: client._options.bearerAuth,
123
125
  retryConfig: options?.retries
124
126
  || client._options.retryConfig
125
127
  || { strategy: "none" },
@@ -127,11 +129,12 @@ async function $do(
127
129
  };
128
130
 
129
131
  const requestRes = client._createRequest(context, {
130
- method: "POST",
132
+ security: requestSecurity,
133
+ method: "GET",
131
134
  baseURL: options?.serverURL,
132
135
  path: path,
133
136
  headers: headers,
134
- body: body$,
137
+ body: body,
135
138
  userAgent: client._options.userAgent,
136
139
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
137
140
  }, options);
@@ -157,7 +160,7 @@ async function $do(
157
160
  };
158
161
 
159
162
  const [result] = await M.match<
160
- operations.PostKycWebhookByProviderResponse,
163
+ operations.GetOrgsByOrgIdKybStatusResponse,
161
164
  | errors.ProblemDetailsError
162
165
  | SDKError
163
166
  | ResponseValidationError
@@ -168,8 +171,8 @@ async function $do(
168
171
  | UnexpectedClientError
169
172
  | SDKValidationError
170
173
  >(
171
- M.json(200, operations.PostKycWebhookByProviderResponse$inboundSchema),
172
- M.jsonErr([400, 428, 429], errors.ProblemDetailsError$inboundSchema, {
174
+ M.json(200, operations.GetOrgsByOrgIdKybStatusResponse$inboundSchema),
175
+ M.jsonErr([401, 403, 428], errors.ProblemDetailsError$inboundSchema, {
173
176
  ctype: "application/problem+json",
174
177
  }),
175
178
  M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {