@clossir-tech/ts-sdk 0.10.2 → 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.
- package/README.md +32 -19
- package/esm/funcs/{kyc-post-kyc-webhook-by-provider.d.ts → assets-get-assets-by-asset-id.d.ts} +4 -4
- package/esm/funcs/assets-get-assets-by-asset-id.d.ts.map +1 -0
- package/esm/funcs/assets-get-assets-by-asset-id.js +106 -0
- package/esm/funcs/assets-get-assets-by-asset-id.js.map +1 -0
- package/esm/funcs/assets-get-assets.d.ts +18 -0
- package/esm/funcs/assets-get-assets.d.ts.map +1 -0
- package/esm/funcs/assets-get-assets.js +109 -0
- package/esm/funcs/assets-get-assets.js.map +1 -0
- package/esm/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.js +1 -1
- package/esm/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.js.map +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.js +1 -3
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.js.map +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.d.ts +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.js +2 -2
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.js.map +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets.js +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets.js.map +1 -1
- package/esm/funcs/auth-post-auth-switch-org.d.ts +20 -0
- package/esm/funcs/auth-post-auth-switch-org.d.ts.map +1 -0
- package/esm/funcs/auth-post-auth-switch-org.js +90 -0
- package/esm/funcs/auth-post-auth-switch-org.js.map +1 -0
- package/esm/funcs/auth-post-auth-verify-email.d.ts +1 -1
- package/esm/funcs/auth-post-auth-verify-email.js +1 -1
- package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.d.ts +1 -1
- package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.js +2 -2
- package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.js.map +1 -1
- package/esm/funcs/compliance-post-compliance-check.js +1 -3
- package/esm/funcs/compliance-post-compliance-check.js.map +1 -1
- package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js +1 -1
- package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js.map +1 -1
- package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.d.ts +20 -0
- package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.d.ts.map +1 -0
- package/esm/funcs/{kyc-post-kyc-webhook-by-provider.js → kyb-get-orgs-by-org-id-kyb-status.js} +25 -20
- package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.js.map +1 -0
- package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.d.ts +20 -0
- package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.d.ts.map +1 -0
- package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.js +96 -0
- package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.js.map +1 -0
- package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.d.ts +20 -0
- package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.d.ts.map +1 -0
- package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.js +96 -0
- package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.js.map +1 -0
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.d.ts +1 -1
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.js +2 -2
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.js.map +1 -1
- package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.js +1 -1
- package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.js.map +1 -1
- package/esm/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.js +1 -1
- package/esm/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.js.map +1 -1
- package/esm/funcs/transfers-post-transfers.d.ts +1 -1
- package/esm/funcs/transfers-post-transfers.js +2 -2
- package/esm/funcs/transfers-post-transfers.js.map +1 -1
- package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js +3 -1
- package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/operations/get-assets-by-asset-id.d.ts +85 -0
- package/esm/models/operations/get-assets-by-asset-id.d.ts.map +1 -0
- package/esm/models/operations/get-assets-by-asset-id.js +119 -0
- package/esm/models/operations/get-assets-by-asset-id.js.map +1 -0
- package/esm/models/operations/get-assets.d.ts +112 -0
- package/esm/models/operations/get-assets.d.ts.map +1 -0
- package/esm/models/operations/get-assets.js +100 -0
- package/esm/models/operations/get-assets.js.map +1 -0
- package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.d.ts +4 -4
- package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.d.ts.map +1 -1
- package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.js +4 -5
- package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.js.map +1 -1
- package/esm/models/operations/get-orgs-by-org-id-kyb-status.d.ts +33 -0
- package/esm/models/operations/get-orgs-by-org-id-kyb-status.d.ts.map +1 -0
- package/esm/models/operations/get-orgs-by-org-id-kyb-status.js +28 -0
- package/esm/models/operations/get-orgs-by-org-id-kyb-status.js.map +1 -0
- package/esm/models/operations/index.d.ts +6 -1
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +6 -1
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/post-auth-switch-org.d.ts +212 -0
- package/esm/models/operations/post-auth-switch-org.d.ts.map +1 -0
- package/esm/models/operations/post-auth-switch-org.js +206 -0
- package/esm/models/operations/post-auth-switch-org.js.map +1 -0
- package/esm/models/operations/post-auth-verify-email.d.ts +26 -2
- package/esm/models/operations/post-auth-verify-email.d.ts.map +1 -1
- package/esm/models/operations/post-auth-verify-email.js +18 -1
- package/esm/models/operations/post-auth-verify-email.js.map +1 -1
- package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.d.ts +2 -8
- package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.d.ts.map +1 -1
- package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js +2 -6
- package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js.map +1 -1
- package/esm/models/operations/post-orgs-by-org-id-assets.d.ts +5 -0
- package/esm/models/operations/post-orgs-by-org-id-assets.d.ts.map +1 -1
- package/esm/models/operations/post-orgs-by-org-id-assets.js +2 -0
- package/esm/models/operations/post-orgs-by-org-id-assets.js.map +1 -1
- package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.d.ts +36 -0
- package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.d.ts.map +1 -0
- package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.js +34 -0
- package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.js.map +1 -0
- package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.d.ts +30 -0
- package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.d.ts.map +1 -0
- package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.js +25 -0
- package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.js.map +1 -0
- package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.d.ts +5 -0
- package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.d.ts.map +1 -1
- package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.js +1 -0
- package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.js.map +1 -1
- package/esm/sdk/assets.d.ts +15 -1
- package/esm/sdk/assets.d.ts.map +1 -1
- package/esm/sdk/assets.js +21 -1
- package/esm/sdk/assets.js.map +1 -1
- package/esm/sdk/auth.d.ts +8 -1
- package/esm/sdk/auth.d.ts.map +1 -1
- package/esm/sdk/auth.js +11 -1
- package/esm/sdk/auth.js.map +1 -1
- package/esm/sdk/bridge.d.ts +1 -1
- package/esm/sdk/bridge.js +1 -1
- package/esm/sdk/kyb.d.ts +26 -0
- package/esm/sdk/kyb.d.ts.map +1 -0
- package/esm/sdk/kyb.js +38 -0
- package/esm/sdk/kyb.js.map +1 -0
- package/esm/sdk/kyc.d.ts +0 -7
- package/esm/sdk/kyc.d.ts.map +1 -1
- package/esm/sdk/kyc.js +0 -10
- package/esm/sdk/kyc.js.map +1 -1
- package/esm/sdk/markets.d.ts +1 -1
- package/esm/sdk/markets.js +1 -1
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/transfers.d.ts +1 -1
- package/esm/sdk/transfers.js +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/funcs/assets-get-assets-by-asset-id.ts +203 -0
- package/src/funcs/assets-get-assets.ts +205 -0
- package/src/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.ts +1 -1
- package/src/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.ts +5 -3
- package/src/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.ts +2 -2
- package/src/funcs/assets-post-orgs-by-org-id-assets.ts +1 -1
- package/src/funcs/auth-post-auth-switch-org.ts +180 -0
- package/src/funcs/auth-post-auth-verify-email.ts +1 -1
- package/src/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.ts +2 -2
- package/src/funcs/compliance-post-compliance-check.ts +5 -3
- package/src/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.ts +1 -1
- package/src/funcs/{kyc-post-kyc-webhook-by-provider.ts → kyb-get-orgs-by-org-id-kyb-status.ts} +31 -28
- package/src/funcs/kyb-post-orgs-by-org-id-kyb-access-token.ts +194 -0
- package/src/funcs/kyb-post-orgs-by-org-id-kyb-initiate.ts +194 -0
- package/src/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.ts +2 -2
- package/src/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.ts +1 -1
- package/src/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.ts +1 -1
- package/src/funcs/transfers-post-transfers.ts +2 -2
- package/src/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.ts +3 -0
- package/src/lib/config.ts +2 -2
- package/src/models/operations/get-assets-by-asset-id.ts +253 -0
- package/src/models/operations/get-assets.ts +250 -0
- package/src/models/operations/get-orgs-by-org-id-assets-by-asset-id.ts +17 -9
- package/src/models/operations/get-orgs-by-org-id-kyb-status.ts +78 -0
- package/src/models/operations/index.ts +6 -1
- package/src/models/operations/post-auth-switch-org.ts +549 -0
- package/src/models/operations/post-auth-verify-email.ts +56 -5
- package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.ts +19 -26
- package/src/models/operations/post-orgs-by-org-id-assets.ts +7 -0
- package/src/models/operations/post-orgs-by-org-id-kyb-access-token.ts +93 -0
- package/src/models/operations/post-orgs-by-org-id-kyb-initiate.ts +73 -0
- package/src/models/operations/post-orgs-by-org-id-members-by-user-id-attest.ts +6 -0
- package/src/sdk/assets.ts +41 -1
- package/src/sdk/auth.ts +19 -1
- package/src/sdk/bridge.ts +1 -1
- package/src/sdk/kyb.ts +63 -0
- package/src/sdk/kyc.ts +0 -20
- package/src/sdk/markets.ts +1 -1
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/transfers.ts +1 -1
- package/esm/funcs/kyc-post-kyc-webhook-by-provider.d.ts.map +0 -1
- package/esm/funcs/kyc-post-kyc-webhook-by-provider.js.map +0 -1
- package/esm/models/operations/post-kyc-webhook-by-provider.d.ts +0 -93
- package/esm/models/operations/post-kyc-webhook-by-provider.d.ts.map +0 -1
- package/esm/models/operations/post-kyc-webhook-by-provider.js +0 -45
- package/esm/models/operations/post-kyc-webhook-by-provider.js.map +0 -1
- package/src/models/operations/post-kyc-webhook-by-provider.ts +0 -169
|
@@ -0,0 +1,194 @@
|
|
|
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 { encodeSimple } 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
|
+
* Initiate org KYB verification
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Create the org's Sumsub company applicant and org_verifications row. Idempotent: returns existing row if already initiated. Requires direct admin membership. JWT only.
|
|
35
|
+
*
|
|
36
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
37
|
+
*/
|
|
38
|
+
export function kybPostOrgsByOrgIdKYBInitiate(
|
|
39
|
+
client: ClossirCore,
|
|
40
|
+
orgId: string,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<
|
|
43
|
+
Result<
|
|
44
|
+
operations.PostOrgsByOrgIdKybInitiateResponse,
|
|
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
|
+
orgId,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: ClossirCore,
|
|
65
|
+
orgId: string,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
operations.PostOrgsByOrgIdKybInitiateResponse,
|
|
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 input: operations.PostOrgsByOrgIdKybInitiateRequest = {
|
|
85
|
+
orgId: orgId,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const parsed = safeParse(
|
|
89
|
+
input,
|
|
90
|
+
(value) =>
|
|
91
|
+
z.parse(
|
|
92
|
+
operations.PostOrgsByOrgIdKybInitiateRequest$outboundSchema,
|
|
93
|
+
value,
|
|
94
|
+
),
|
|
95
|
+
"Input validation failed",
|
|
96
|
+
);
|
|
97
|
+
if (!parsed.ok) {
|
|
98
|
+
return [parsed, { status: "invalid" }];
|
|
99
|
+
}
|
|
100
|
+
const payload = parsed.value;
|
|
101
|
+
const body = null;
|
|
102
|
+
|
|
103
|
+
const pathParams = {
|
|
104
|
+
orgId: encodeSimple("orgId", payload.orgId, {
|
|
105
|
+
explode: false,
|
|
106
|
+
charEncoding: "percent",
|
|
107
|
+
}),
|
|
108
|
+
};
|
|
109
|
+
const path = pathToFunc("/orgs/{orgId}/kyb/initiate")(pathParams);
|
|
110
|
+
|
|
111
|
+
const headers = new Headers(compactMap({
|
|
112
|
+
Accept: "application/json",
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
116
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
117
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
118
|
+
|
|
119
|
+
const context = {
|
|
120
|
+
options: client._options,
|
|
121
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
122
|
+
operationID: "postOrgsByOrgIdKybInitiate",
|
|
123
|
+
oAuth2Scopes: null,
|
|
124
|
+
|
|
125
|
+
resolvedSecurity: requestSecurity,
|
|
126
|
+
|
|
127
|
+
securitySource: client._options.bearerAuth,
|
|
128
|
+
retryConfig: options?.retries
|
|
129
|
+
|| client._options.retryConfig
|
|
130
|
+
|| { strategy: "none" },
|
|
131
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const requestRes = client._createRequest(context, {
|
|
135
|
+
security: requestSecurity,
|
|
136
|
+
method: "POST",
|
|
137
|
+
baseURL: options?.serverURL,
|
|
138
|
+
path: path,
|
|
139
|
+
headers: headers,
|
|
140
|
+
body: body,
|
|
141
|
+
userAgent: client._options.userAgent,
|
|
142
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
143
|
+
}, options);
|
|
144
|
+
if (!requestRes.ok) {
|
|
145
|
+
return [requestRes, { status: "invalid" }];
|
|
146
|
+
}
|
|
147
|
+
const req = requestRes.value;
|
|
148
|
+
|
|
149
|
+
const doResult = await client._do(req, {
|
|
150
|
+
context,
|
|
151
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
152
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
153
|
+
retryConfig: context.retryConfig,
|
|
154
|
+
retryCodes: context.retryCodes,
|
|
155
|
+
});
|
|
156
|
+
if (!doResult.ok) {
|
|
157
|
+
return [doResult, { status: "request-error", request: req }];
|
|
158
|
+
}
|
|
159
|
+
const response = doResult.value;
|
|
160
|
+
|
|
161
|
+
const responseFields = {
|
|
162
|
+
HttpMeta: { Response: response, Request: req },
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const [result] = await M.match<
|
|
166
|
+
operations.PostOrgsByOrgIdKybInitiateResponse,
|
|
167
|
+
| errors.ProblemDetailsError
|
|
168
|
+
| SDKError
|
|
169
|
+
| ResponseValidationError
|
|
170
|
+
| ConnectionError
|
|
171
|
+
| RequestAbortedError
|
|
172
|
+
| RequestTimeoutError
|
|
173
|
+
| InvalidRequestError
|
|
174
|
+
| UnexpectedClientError
|
|
175
|
+
| SDKValidationError
|
|
176
|
+
>(
|
|
177
|
+
M.json(200, operations.PostOrgsByOrgIdKybInitiateResponse$inboundSchema),
|
|
178
|
+
M.jsonErr(
|
|
179
|
+
[401, 403, 409, 428, 429],
|
|
180
|
+
errors.ProblemDetailsError$inboundSchema,
|
|
181
|
+
{ ctype: "application/problem+json" },
|
|
182
|
+
),
|
|
183
|
+
M.jsonErr([500, 502], errors.ProblemDetailsError$inboundSchema, {
|
|
184
|
+
ctype: "application/problem+json",
|
|
185
|
+
}),
|
|
186
|
+
M.fail("4XX"),
|
|
187
|
+
M.fail("5XX"),
|
|
188
|
+
)(response, req, { extraFields: responseFields });
|
|
189
|
+
if (!result.ok) {
|
|
190
|
+
return [result, { status: "complete", request: req, response }];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return [result, { status: "complete", request: req, response }];
|
|
194
|
+
}
|
|
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Deploy a market for an asset
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Triggers on-chain deployment of a compliance-gated secondary market for a deployed asset. If the asset is not yet deployed on the target chain, the system will auto-bridge the asset first, then automatically deploy the market once the bridge completes — no extra user interaction needed. The deployment is processed asynchronously via CQRS — returns 202 Accepted immediately. Fee collection is configured with the org wallet as fee collector and Signum protocol wallet for protocol fees. Poll the market detail endpoint for deployment status updates.
|
|
34
|
+
* Triggers on-chain deployment of a compliance-gated secondary market for a deployed asset. If the asset is not yet deployed on the target chain, the system will auto-bridge the asset first, then automatically deploy the market once the bridge completes — no extra user interaction needed. Returns 409 with title chain_frozen if the target chain is frozen (it takes no new markets). The deployment is processed asynchronously via CQRS — returns 202 Accepted immediately. Fee collection is configured with the org wallet as fee collector and Signum protocol wallet for protocol fees. Poll the market detail endpoint for deployment status updates.
|
|
35
35
|
*/
|
|
36
36
|
export function marketsPostOrgsByOrgIdAssetsByAssetIdMarkets(
|
|
37
37
|
client: ClossirCore,
|
|
@@ -206,7 +206,7 @@ async function $do(
|
|
|
206
206
|
operations.PostOrgsByOrgIdAssetsByAssetIdMarketsResponse$inboundSchema,
|
|
207
207
|
),
|
|
208
208
|
M.jsonErr(
|
|
209
|
-
[400, 403, 404, 409, 428],
|
|
209
|
+
[400, 403, 404, 409, 422, 428],
|
|
210
210
|
errors.ProblemDetailsError$inboundSchema,
|
|
211
211
|
{ ctype: "application/problem+json" },
|
|
212
212
|
),
|
|
@@ -206,7 +206,7 @@ async function $do(
|
|
|
206
206
|
operations.PostOrgsByOrgIdMembersByUserIdAttestResponse$inboundSchema,
|
|
207
207
|
),
|
|
208
208
|
M.jsonErr(
|
|
209
|
-
[400, 401, 403, 404, 409, 428],
|
|
209
|
+
[400, 401, 403, 404, 409, 422, 428],
|
|
210
210
|
errors.ProblemDetailsError$inboundSchema,
|
|
211
211
|
{ ctype: "application/problem+json" },
|
|
212
212
|
),
|
|
@@ -181,7 +181,7 @@ async function $do(
|
|
|
181
181
|
200,
|
|
182
182
|
operations.GetOrgsByOrgIdHoldingsByUserIdResponse$inboundSchema,
|
|
183
183
|
),
|
|
184
|
-
M.jsonErr([403, 428], errors.ProblemDetailsError$inboundSchema, {
|
|
184
|
+
M.jsonErr([403, 404, 428], errors.ProblemDetailsError$inboundSchema, {
|
|
185
185
|
ctype: "application/problem+json",
|
|
186
186
|
}),
|
|
187
187
|
M.jsonErr(503, errors.ProblemDetailsError$inboundSchema, {
|
|
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Create transfer (async)
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Queues a token transfer via LayerZero (CQRS pattern). Runs the full 8-rule compliance check (transfer_restricted, allow_pep, max_risk_score, blocked_countries, accredited_investor_required, lockup_period_days, max_transaction_amount, cooling_off_period_hours) against the asset's compliance_rules before accepting. Creates a pending record in transfer_queue and publishes a command to Kafka. Returns 202 Accepted immediately. Returns 403 Forbidden with a reason and rejection code if any rule fails.
|
|
34
|
+
* Queues a token transfer via LayerZero (CQRS pattern). Runs the full 8-rule compliance check (transfer_restricted, allow_pep, max_risk_score, blocked_countries, accredited_investor_required, lockup_period_days, max_transaction_amount, cooling_off_period_hours) against the asset's compliance_rules before accepting. Creates a pending record in transfer_queue and publishes a command to Kafka. Returns 202 Accepted immediately. Returns 403 Forbidden with a reason and rejection code if any rule fails. Returns 422 self_custody_unsupported when the sender wallet has no server-side signer (self-custody).
|
|
35
35
|
*
|
|
36
36
|
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
37
37
|
*/
|
|
@@ -163,7 +163,7 @@ async function $do(
|
|
|
163
163
|
>(
|
|
164
164
|
M.json(202, operations.PostTransfersResponse$inboundSchema),
|
|
165
165
|
M.jsonErr(
|
|
166
|
-
[400, 401, 403, 404, 409, 428, 429],
|
|
166
|
+
[400, 401, 403, 404, 409, 422, 428, 429],
|
|
167
167
|
errors.ProblemDetailsError$inboundSchema,
|
|
168
168
|
{ ctype: "application/problem+json" },
|
|
169
169
|
),
|
|
@@ -192,6 +192,9 @@ async function $do(
|
|
|
192
192
|
errors.ProblemDetailsError$inboundSchema,
|
|
193
193
|
{ ctype: "application/problem+json" },
|
|
194
194
|
),
|
|
195
|
+
M.jsonErr(503, errors.ProblemDetailsError$inboundSchema, {
|
|
196
|
+
ctype: "application/problem+json",
|
|
197
|
+
}),
|
|
195
198
|
M.fail("4XX"),
|
|
196
199
|
M.fail("5XX"),
|
|
197
200
|
)(response, req, { extraFields: responseFields });
|
package/src/lib/config.ts
CHANGED
|
@@ -65,8 +65,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "2.0.0",
|
|
68
|
-
sdkVersion: "0.10.
|
|
68
|
+
sdkVersion: "0.10.3",
|
|
69
69
|
genVersion: "2.916.4",
|
|
70
70
|
userAgent:
|
|
71
|
-
"speakeasy-sdk/typescript 0.10.
|
|
71
|
+
"speakeasy-sdk/typescript 0.10.3 2.916.4 2.0.0 @clossir-tech/ts-sdk",
|
|
72
72
|
} as const;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
11
|
+
|
|
12
|
+
export type GetAssetsByAssetIdSecurity = {
|
|
13
|
+
bearerAuth?: string | undefined;
|
|
14
|
+
apiKeyAuth?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type GetAssetsByAssetIdRequest = {
|
|
18
|
+
assetId: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type GetAssetsByAssetIdDeployment = {
|
|
22
|
+
chainEid: number;
|
|
23
|
+
contractAddress: string | null;
|
|
24
|
+
contractType?: string | null | undefined;
|
|
25
|
+
deployTxHash?: string | null | undefined;
|
|
26
|
+
deployedAt?: string | null | undefined;
|
|
27
|
+
status?: string | null | undefined;
|
|
28
|
+
verified?: boolean | null | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type Compliance = {
|
|
32
|
+
accreditedInvestorRequired?: boolean | null | undefined;
|
|
33
|
+
blockedCountries?: Array<string> | null | undefined;
|
|
34
|
+
lockupPeriodDays?: number | null | undefined;
|
|
35
|
+
transferRestricted?: boolean | null | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Response
|
|
40
|
+
*/
|
|
41
|
+
export type GetAssetsByAssetIdResponse = {
|
|
42
|
+
id: string;
|
|
43
|
+
organizationId: string;
|
|
44
|
+
name: string;
|
|
45
|
+
symbol?: string | null | undefined;
|
|
46
|
+
description?: string | null | undefined;
|
|
47
|
+
assetType: string;
|
|
48
|
+
assetSubtype?: string | null | undefined;
|
|
49
|
+
regulationType?: string | null | undefined;
|
|
50
|
+
totalSupply?: number | null | undefined;
|
|
51
|
+
decimals?: number | null | undefined;
|
|
52
|
+
status: string;
|
|
53
|
+
orgOnly?: boolean | null | undefined;
|
|
54
|
+
requiredKycLevel?: number | null | undefined;
|
|
55
|
+
maxHolders?: number | null | undefined;
|
|
56
|
+
deployedChains?: Array<number> | null | undefined;
|
|
57
|
+
contractAddresses?: { [k: string]: string } | null | undefined;
|
|
58
|
+
unitPriceUsd?: number | null | undefined;
|
|
59
|
+
logoUrl?: string | null | undefined;
|
|
60
|
+
bannerUrl?: string | null | undefined;
|
|
61
|
+
launchedAt?: string | null | undefined;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
orgName: string;
|
|
64
|
+
orgLogoUrl?: string | null | undefined;
|
|
65
|
+
orgBannerUrl?: string | null | undefined;
|
|
66
|
+
isOwnOrg: boolean;
|
|
67
|
+
heldBalance: number | null;
|
|
68
|
+
deployments: Array<GetAssetsByAssetIdDeployment>;
|
|
69
|
+
compliance: Compliance;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** @internal */
|
|
73
|
+
export type GetAssetsByAssetIdSecurity$Outbound = {
|
|
74
|
+
bearerAuth?: string | undefined;
|
|
75
|
+
apiKeyAuth?: string | undefined;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** @internal */
|
|
79
|
+
export const GetAssetsByAssetIdSecurity$outboundSchema: z.ZodMiniType<
|
|
80
|
+
GetAssetsByAssetIdSecurity$Outbound,
|
|
81
|
+
GetAssetsByAssetIdSecurity
|
|
82
|
+
> = z.object({
|
|
83
|
+
bearerAuth: z.optional(z.string()),
|
|
84
|
+
apiKeyAuth: z.optional(z.string()),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export function getAssetsByAssetIdSecurityToJSON(
|
|
88
|
+
getAssetsByAssetIdSecurity: GetAssetsByAssetIdSecurity,
|
|
89
|
+
): string {
|
|
90
|
+
return JSON.stringify(
|
|
91
|
+
GetAssetsByAssetIdSecurity$outboundSchema.parse(getAssetsByAssetIdSecurity),
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export type GetAssetsByAssetIdRequest$Outbound = {
|
|
97
|
+
assetId: string;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export const GetAssetsByAssetIdRequest$outboundSchema: z.ZodMiniType<
|
|
102
|
+
GetAssetsByAssetIdRequest$Outbound,
|
|
103
|
+
GetAssetsByAssetIdRequest
|
|
104
|
+
> = z.object({
|
|
105
|
+
assetId: z.string(),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export function getAssetsByAssetIdRequestToJSON(
|
|
109
|
+
getAssetsByAssetIdRequest: GetAssetsByAssetIdRequest,
|
|
110
|
+
): string {
|
|
111
|
+
return JSON.stringify(
|
|
112
|
+
GetAssetsByAssetIdRequest$outboundSchema.parse(getAssetsByAssetIdRequest),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** @internal */
|
|
117
|
+
export const GetAssetsByAssetIdDeployment$inboundSchema: z.ZodMiniType<
|
|
118
|
+
GetAssetsByAssetIdDeployment,
|
|
119
|
+
unknown
|
|
120
|
+
> = z.pipe(
|
|
121
|
+
z.object({
|
|
122
|
+
chain_eid: types.number(),
|
|
123
|
+
contract_address: types.nullable(types.string()),
|
|
124
|
+
contract_type: z.optional(z.nullable(types.string())),
|
|
125
|
+
deploy_tx_hash: z.optional(z.nullable(types.string())),
|
|
126
|
+
deployed_at: z.optional(z.nullable(types.string())),
|
|
127
|
+
status: z.optional(z.nullable(types.string())),
|
|
128
|
+
verified: z.optional(z.nullable(types.boolean())),
|
|
129
|
+
}),
|
|
130
|
+
z.transform((v) => {
|
|
131
|
+
return remap$(v, {
|
|
132
|
+
"chain_eid": "chainEid",
|
|
133
|
+
"contract_address": "contractAddress",
|
|
134
|
+
"contract_type": "contractType",
|
|
135
|
+
"deploy_tx_hash": "deployTxHash",
|
|
136
|
+
"deployed_at": "deployedAt",
|
|
137
|
+
});
|
|
138
|
+
}),
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
export function getAssetsByAssetIdDeploymentFromJSON(
|
|
142
|
+
jsonString: string,
|
|
143
|
+
): SafeParseResult<GetAssetsByAssetIdDeployment, SDKValidationError> {
|
|
144
|
+
return safeParse(
|
|
145
|
+
jsonString,
|
|
146
|
+
(x) => GetAssetsByAssetIdDeployment$inboundSchema.parse(JSON.parse(x)),
|
|
147
|
+
`Failed to parse 'GetAssetsByAssetIdDeployment' from JSON`,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** @internal */
|
|
152
|
+
export const Compliance$inboundSchema: z.ZodMiniType<Compliance, unknown> = z
|
|
153
|
+
.pipe(
|
|
154
|
+
z.object({
|
|
155
|
+
accredited_investor_required: z.optional(z.nullable(types.boolean())),
|
|
156
|
+
blocked_countries: z.optional(z.nullable(z.array(types.string()))),
|
|
157
|
+
lockup_period_days: z.optional(z.nullable(types.number())),
|
|
158
|
+
transfer_restricted: z.optional(z.nullable(types.boolean())),
|
|
159
|
+
}),
|
|
160
|
+
z.transform((v) => {
|
|
161
|
+
return remap$(v, {
|
|
162
|
+
"accredited_investor_required": "accreditedInvestorRequired",
|
|
163
|
+
"blocked_countries": "blockedCountries",
|
|
164
|
+
"lockup_period_days": "lockupPeriodDays",
|
|
165
|
+
"transfer_restricted": "transferRestricted",
|
|
166
|
+
});
|
|
167
|
+
}),
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
export function complianceFromJSON(
|
|
171
|
+
jsonString: string,
|
|
172
|
+
): SafeParseResult<Compliance, SDKValidationError> {
|
|
173
|
+
return safeParse(
|
|
174
|
+
jsonString,
|
|
175
|
+
(x) => Compliance$inboundSchema.parse(JSON.parse(x)),
|
|
176
|
+
`Failed to parse 'Compliance' from JSON`,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** @internal */
|
|
181
|
+
export const GetAssetsByAssetIdResponse$inboundSchema: z.ZodMiniType<
|
|
182
|
+
GetAssetsByAssetIdResponse,
|
|
183
|
+
unknown
|
|
184
|
+
> = z.pipe(
|
|
185
|
+
z.object({
|
|
186
|
+
id: types.string(),
|
|
187
|
+
organization_id: types.string(),
|
|
188
|
+
name: types.string(),
|
|
189
|
+
symbol: z.optional(z.nullable(types.string())),
|
|
190
|
+
description: z.optional(z.nullable(types.string())),
|
|
191
|
+
asset_type: types.string(),
|
|
192
|
+
asset_subtype: z.optional(z.nullable(types.string())),
|
|
193
|
+
regulation_type: z.optional(z.nullable(types.string())),
|
|
194
|
+
total_supply: z.optional(z.nullable(types.number())),
|
|
195
|
+
decimals: z.optional(z.nullable(types.number())),
|
|
196
|
+
status: types.string(),
|
|
197
|
+
org_only: z.optional(z.nullable(types.boolean())),
|
|
198
|
+
required_kyc_level: z.optional(z.nullable(types.number())),
|
|
199
|
+
max_holders: z.optional(z.nullable(types.number())),
|
|
200
|
+
deployed_chains: z.optional(z.nullable(z.array(types.number()))),
|
|
201
|
+
contract_addresses: z.optional(
|
|
202
|
+
z.nullable(z.record(z.string(), types.string())),
|
|
203
|
+
),
|
|
204
|
+
unit_price_usd: z.optional(z.nullable(types.number())),
|
|
205
|
+
logo_url: z.optional(z.nullable(types.string())),
|
|
206
|
+
banner_url: z.optional(z.nullable(types.string())),
|
|
207
|
+
launched_at: z.optional(z.nullable(types.string())),
|
|
208
|
+
created_at: types.string(),
|
|
209
|
+
org_name: types.string(),
|
|
210
|
+
org_logo_url: z.optional(z.nullable(types.string())),
|
|
211
|
+
org_banner_url: z.optional(z.nullable(types.string())),
|
|
212
|
+
is_own_org: types.boolean(),
|
|
213
|
+
held_balance: types.nullable(types.number()),
|
|
214
|
+
deployments: z.array(
|
|
215
|
+
z.lazy(() => GetAssetsByAssetIdDeployment$inboundSchema),
|
|
216
|
+
),
|
|
217
|
+
compliance: z.lazy(() => Compliance$inboundSchema),
|
|
218
|
+
}),
|
|
219
|
+
z.transform((v) => {
|
|
220
|
+
return remap$(v, {
|
|
221
|
+
"organization_id": "organizationId",
|
|
222
|
+
"asset_type": "assetType",
|
|
223
|
+
"asset_subtype": "assetSubtype",
|
|
224
|
+
"regulation_type": "regulationType",
|
|
225
|
+
"total_supply": "totalSupply",
|
|
226
|
+
"org_only": "orgOnly",
|
|
227
|
+
"required_kyc_level": "requiredKycLevel",
|
|
228
|
+
"max_holders": "maxHolders",
|
|
229
|
+
"deployed_chains": "deployedChains",
|
|
230
|
+
"contract_addresses": "contractAddresses",
|
|
231
|
+
"unit_price_usd": "unitPriceUsd",
|
|
232
|
+
"logo_url": "logoUrl",
|
|
233
|
+
"banner_url": "bannerUrl",
|
|
234
|
+
"launched_at": "launchedAt",
|
|
235
|
+
"created_at": "createdAt",
|
|
236
|
+
"org_name": "orgName",
|
|
237
|
+
"org_logo_url": "orgLogoUrl",
|
|
238
|
+
"org_banner_url": "orgBannerUrl",
|
|
239
|
+
"is_own_org": "isOwnOrg",
|
|
240
|
+
"held_balance": "heldBalance",
|
|
241
|
+
});
|
|
242
|
+
}),
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
export function getAssetsByAssetIdResponseFromJSON(
|
|
246
|
+
jsonString: string,
|
|
247
|
+
): SafeParseResult<GetAssetsByAssetIdResponse, SDKValidationError> {
|
|
248
|
+
return safeParse(
|
|
249
|
+
jsonString,
|
|
250
|
+
(x) => GetAssetsByAssetIdResponse$inboundSchema.parse(JSON.parse(x)),
|
|
251
|
+
`Failed to parse 'GetAssetsByAssetIdResponse' from JSON`,
|
|
252
|
+
);
|
|
253
|
+
}
|