@clossir-tech/ts-sdk 0.9.6 → 0.9.8

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 (82) hide show
  1. package/README.md +14 -12
  2. package/esm/funcs/assets-delete-orgs-by-org-id-assets-by-asset-id.d.ts +18 -0
  3. package/esm/funcs/assets-delete-orgs-by-org-id-assets-by-asset-id.d.ts.map +1 -0
  4. package/esm/funcs/assets-delete-orgs-by-org-id-assets-by-asset-id.js +111 -0
  5. package/esm/funcs/assets-delete-orgs-by-org-id-assets-by-asset-id.js.map +1 -0
  6. package/esm/funcs/kyc-post-kyc-webhook-by-provider.d.ts +2 -2
  7. package/esm/funcs/kyc-post-kyc-webhook-by-provider.d.ts.map +1 -1
  8. package/esm/funcs/kyc-post-kyc-webhook-by-provider.js +10 -8
  9. package/esm/funcs/kyc-post-kyc-webhook-by-provider.js.map +1 -1
  10. package/esm/funcs/organizations-post-orgs-by-org-id-invitations-by-invitation-id-resend.js +3 -1
  11. package/esm/funcs/organizations-post-orgs-by-org-id-invitations-by-invitation-id-resend.js.map +1 -1
  12. package/esm/funcs/organizations-post-orgs-by-org-id-members-invite.js +3 -1
  13. package/esm/funcs/organizations-post-orgs-by-org-id-members-invite.js.map +1 -1
  14. package/esm/lib/config.d.ts +2 -2
  15. package/esm/lib/config.js +2 -2
  16. package/esm/models/operations/delete-orgs-by-org-id-assets-by-asset-id.d.ts +26 -0
  17. package/esm/models/operations/delete-orgs-by-org-id-assets-by-asset-id.d.ts.map +1 -0
  18. package/esm/models/operations/delete-orgs-by-org-id-assets-by-asset-id.js +21 -0
  19. package/esm/models/operations/delete-orgs-by-org-id-assets-by-asset-id.js.map +1 -0
  20. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-compliance-policy.d.ts +3 -5
  21. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-compliance-policy.d.ts.map +1 -1
  22. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-compliance-policy.js +1 -7
  23. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-compliance-policy.js.map +1 -1
  24. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets-by-market-id.d.ts +3 -5
  25. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets-by-market-id.d.ts.map +1 -1
  26. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets-by-market-id.js +1 -7
  27. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets-by-market-id.js.map +1 -1
  28. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets.d.ts +3 -5
  29. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets.d.ts.map +1 -1
  30. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets.js +1 -7
  31. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets.js.map +1 -1
  32. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.d.ts +55 -19
  33. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.d.ts.map +1 -1
  34. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.js +37 -24
  35. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.js.map +1 -1
  36. package/esm/models/operations/get-orgs-by-org-id-assets.d.ts +28 -17
  37. package/esm/models/operations/get-orgs-by-org-id-assets.d.ts.map +1 -1
  38. package/esm/models/operations/get-orgs-by-org-id-assets.js +19 -18
  39. package/esm/models/operations/get-orgs-by-org-id-assets.js.map +1 -1
  40. package/esm/models/operations/get-orgs-by-org-id-compliance-stats.d.ts +4 -2
  41. package/esm/models/operations/get-orgs-by-org-id-compliance-stats.d.ts.map +1 -1
  42. package/esm/models/operations/get-orgs-by-org-id-compliance-stats.js +2 -2
  43. package/esm/models/operations/get-orgs-by-org-id-compliance-stats.js.map +1 -1
  44. package/esm/models/operations/index.d.ts +1 -0
  45. package/esm/models/operations/index.d.ts.map +1 -1
  46. package/esm/models/operations/index.js +1 -0
  47. package/esm/models/operations/index.js.map +1 -1
  48. package/esm/models/operations/post-kyc-webhook-by-provider.d.ts +64 -0
  49. package/esm/models/operations/post-kyc-webhook-by-provider.d.ts.map +1 -1
  50. package/esm/models/operations/post-kyc-webhook-by-provider.js +24 -0
  51. package/esm/models/operations/post-kyc-webhook-by-provider.js.map +1 -1
  52. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.d.ts +15 -1
  53. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.d.ts.map +1 -1
  54. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.js +15 -1
  55. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.js.map +1 -1
  56. package/esm/sdk/assets.d.ts +7 -0
  57. package/esm/sdk/assets.d.ts.map +1 -1
  58. package/esm/sdk/assets.js +10 -0
  59. package/esm/sdk/assets.js.map +1 -1
  60. package/esm/sdk/kyc.d.ts +2 -2
  61. package/esm/sdk/kyc.d.ts.map +1 -1
  62. package/esm/sdk/kyc.js +3 -3
  63. package/esm/sdk/kyc.js.map +1 -1
  64. package/jsr.json +1 -1
  65. package/package.json +1 -1
  66. package/src/funcs/assets-delete-orgs-by-org-id-assets-by-asset-id.ts +214 -0
  67. package/src/funcs/kyc-post-kyc-webhook-by-provider.ts +10 -5
  68. package/src/funcs/organizations-post-orgs-by-org-id-invitations-by-invitation-id-resend.ts +3 -0
  69. package/src/funcs/organizations-post-orgs-by-org-id-members-invite.ts +3 -0
  70. package/src/lib/config.ts +2 -2
  71. package/src/models/operations/delete-orgs-by-org-id-assets-by-asset-id.ts +69 -0
  72. package/src/models/operations/get-orgs-by-org-id-assets-by-asset-id-compliance-policy.ts +2 -29
  73. package/src/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets-by-market-id.ts +2 -31
  74. package/src/models/operations/get-orgs-by-org-id-assets-by-asset-id-markets.ts +2 -27
  75. package/src/models/operations/get-orgs-by-org-id-assets-by-asset-id.ts +88 -97
  76. package/src/models/operations/get-orgs-by-org-id-assets.ts +31 -70
  77. package/src/models/operations/get-orgs-by-org-id-compliance-stats.ts +7 -4
  78. package/src/models/operations/index.ts +1 -0
  79. package/src/models/operations/post-kyc-webhook-by-provider.ts +102 -0
  80. package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.ts +23 -2
  81. package/src/sdk/assets.ts +22 -0
  82. package/src/sdk/kyc.ts +3 -1
@@ -5,6 +5,8 @@
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
8
10
  import { Result as SafeParseResult } from "../../types/fp.js";
9
11
  import * as types from "../../types/primitives.js";
10
12
  import { SDKValidationError } from "../errors/sdk-validation-error.js";
@@ -19,13 +21,49 @@ export type GetOrgsByOrgIdAssetsByAssetIdRequest = {
19
21
  assetId: string;
20
22
  };
21
23
 
22
- export type GetOrgsByOrgIdAssetsByAssetIdComplianceRules = {};
24
+ export const GetOrgsByOrgIdAssetsByAssetIdStatus = {
25
+ Draft: "draft",
26
+ PendingReview: "pending_review",
27
+ Approved: "approved",
28
+ Deploying: "deploying",
29
+ Deployed: "deployed",
30
+ Active: "active",
31
+ Paused: "paused",
32
+ Retired: "retired",
33
+ } as const;
34
+ export type GetOrgsByOrgIdAssetsByAssetIdStatus = OpenEnum<
35
+ typeof GetOrgsByOrgIdAssetsByAssetIdStatus
36
+ >;
23
37
 
24
- export type GetOrgsByOrgIdAssetsByAssetIdContractAddresses = {};
25
-
26
- export type GetOrgsByOrgIdAssetsByAssetIdMetadata = {};
27
-
28
- export type DeploymentMetadata = {};
38
+ export type Metadata = {
39
+ /**
40
+ * Raw chain-agent failure message. OPERATOR-FACING: credential-bearing, never render it to a user.
41
+ */
42
+ error?: string | undefined;
43
+ /**
44
+ * Classified failure reason code. Declared ahead of its writer, so it is absent until that writer ships. Open string on the wire; the closed set is enforced by the renderer.
45
+ */
46
+ reasonCode?: string | undefined;
47
+ /**
48
+ * Reader-safe failure reason, authored for the issuer rather than copied from the chain agent. Declared ahead of its writer, so it is absent until that writer ships.
49
+ */
50
+ reason?: string | undefined;
51
+ /**
52
+ * The deployment was reconciled rather than freshly observed.
53
+ */
54
+ reconciled?: boolean | undefined;
55
+ reconciledReason?: string | null | undefined;
56
+ compliancePolicyChecked?: boolean | null | undefined;
57
+ /**
58
+ * Set by the bridge-failure writer, not the deploy writer.
59
+ */
60
+ bridgeFailed?: boolean | undefined;
61
+ /**
62
+ * LayerZero EID of the bridge's source chain.
63
+ */
64
+ srcChainEid?: number | undefined;
65
+ [additionalProperties: string]: unknown;
66
+ };
29
67
 
30
68
  export type Deployment = {
31
69
  id: string;
@@ -38,7 +76,7 @@ export type Deployment = {
38
76
  deployerAddress?: string | null | undefined;
39
77
  status?: string | null | undefined;
40
78
  verified?: boolean | null | undefined;
41
- metadata?: DeploymentMetadata | null | undefined;
79
+ metadata?: Metadata | null | undefined;
42
80
  createdAt?: string | null | undefined;
43
81
  updatedAt?: string | null | undefined;
44
82
  };
@@ -59,20 +97,14 @@ export type GetOrgsByOrgIdAssetsByAssetIdResponse = {
59
97
  maxSupply?: number | null | undefined;
60
98
  decimals?: number | null | undefined;
61
99
  unitPriceUsd?: number | null | undefined;
62
- status: string;
100
+ status: GetOrgsByOrgIdAssetsByAssetIdStatus;
63
101
  orgOnly?: boolean | null | undefined;
64
102
  requiredKycLevel?: number | null | undefined;
65
103
  maxHolders?: number | null | undefined;
66
- complianceRules?:
67
- | GetOrgsByOrgIdAssetsByAssetIdComplianceRules
68
- | null
69
- | undefined;
70
- contractAddresses?:
71
- | GetOrgsByOrgIdAssetsByAssetIdContractAddresses
72
- | null
73
- | undefined;
104
+ complianceRules?: { [k: string]: any } | null | undefined;
105
+ contractAddresses?: { [k: string]: string } | null | undefined;
74
106
  deployedChains?: Array<number> | null | undefined;
75
- metadata?: GetOrgsByOrgIdAssetsByAssetIdMetadata | null | undefined;
107
+ metadata?: { [k: string]: any } | null | undefined;
76
108
  createdBy?: string | null | undefined;
77
109
  launchedAt?: string | null | undefined;
78
110
  logoUrl?: string | null | undefined;
@@ -137,77 +169,44 @@ export function getOrgsByOrgIdAssetsByAssetIdRequestToJSON(
137
169
  }
138
170
 
139
171
  /** @internal */
140
- export const GetOrgsByOrgIdAssetsByAssetIdComplianceRules$inboundSchema:
141
- z.ZodMiniType<GetOrgsByOrgIdAssetsByAssetIdComplianceRules, unknown> = z
142
- .object({});
143
-
144
- export function getOrgsByOrgIdAssetsByAssetIdComplianceRulesFromJSON(
145
- jsonString: string,
146
- ): SafeParseResult<
147
- GetOrgsByOrgIdAssetsByAssetIdComplianceRules,
148
- SDKValidationError
149
- > {
150
- return safeParse(
151
- jsonString,
152
- (x) =>
153
- GetOrgsByOrgIdAssetsByAssetIdComplianceRules$inboundSchema.parse(
154
- JSON.parse(x),
155
- ),
156
- `Failed to parse 'GetOrgsByOrgIdAssetsByAssetIdComplianceRules' from JSON`,
157
- );
158
- }
159
-
160
- /** @internal */
161
- export const GetOrgsByOrgIdAssetsByAssetIdContractAddresses$inboundSchema:
162
- z.ZodMiniType<GetOrgsByOrgIdAssetsByAssetIdContractAddresses, unknown> = z
163
- .object({});
164
-
165
- export function getOrgsByOrgIdAssetsByAssetIdContractAddressesFromJSON(
166
- jsonString: string,
167
- ): SafeParseResult<
168
- GetOrgsByOrgIdAssetsByAssetIdContractAddresses,
169
- SDKValidationError
170
- > {
171
- return safeParse(
172
- jsonString,
173
- (x) =>
174
- GetOrgsByOrgIdAssetsByAssetIdContractAddresses$inboundSchema.parse(
175
- JSON.parse(x),
176
- ),
177
- `Failed to parse 'GetOrgsByOrgIdAssetsByAssetIdContractAddresses' from JSON`,
178
- );
179
- }
180
-
181
- /** @internal */
182
- export const GetOrgsByOrgIdAssetsByAssetIdMetadata$inboundSchema: z.ZodMiniType<
183
- GetOrgsByOrgIdAssetsByAssetIdMetadata,
172
+ export const GetOrgsByOrgIdAssetsByAssetIdStatus$inboundSchema: z.ZodMiniType<
173
+ GetOrgsByOrgIdAssetsByAssetIdStatus,
184
174
  unknown
185
- > = z.object({});
186
-
187
- export function getOrgsByOrgIdAssetsByAssetIdMetadataFromJSON(
188
- jsonString: string,
189
- ): SafeParseResult<GetOrgsByOrgIdAssetsByAssetIdMetadata, SDKValidationError> {
190
- return safeParse(
191
- jsonString,
192
- (x) =>
193
- GetOrgsByOrgIdAssetsByAssetIdMetadata$inboundSchema.parse(JSON.parse(x)),
194
- `Failed to parse 'GetOrgsByOrgIdAssetsByAssetIdMetadata' from JSON`,
195
- );
196
- }
175
+ > = openEnums.inboundSchema(GetOrgsByOrgIdAssetsByAssetIdStatus);
197
176
 
198
177
  /** @internal */
199
- export const DeploymentMetadata$inboundSchema: z.ZodMiniType<
200
- DeploymentMetadata,
201
- unknown
202
- > = z.object({});
178
+ export const Metadata$inboundSchema: z.ZodMiniType<Metadata, unknown> = z.pipe(
179
+ z.catchall(
180
+ z.object({
181
+ error: types.optional(types.string()),
182
+ reason_code: types.optional(types.string()),
183
+ reason: types.optional(types.string()),
184
+ reconciled: types.optional(types.boolean()),
185
+ reconciled_reason: z.optional(z.nullable(types.string())),
186
+ compliance_policy_checked: z.optional(z.nullable(types.boolean())),
187
+ bridge_failed: types.optional(types.boolean()),
188
+ src_chain_eid: types.optional(types.number()),
189
+ }),
190
+ z.any(),
191
+ ),
192
+ z.transform((v) => {
193
+ return remap$(v, {
194
+ "reason_code": "reasonCode",
195
+ "reconciled_reason": "reconciledReason",
196
+ "compliance_policy_checked": "compliancePolicyChecked",
197
+ "bridge_failed": "bridgeFailed",
198
+ "src_chain_eid": "srcChainEid",
199
+ });
200
+ }),
201
+ );
203
202
 
204
- export function deploymentMetadataFromJSON(
203
+ export function metadataFromJSON(
205
204
  jsonString: string,
206
- ): SafeParseResult<DeploymentMetadata, SDKValidationError> {
205
+ ): SafeParseResult<Metadata, SDKValidationError> {
207
206
  return safeParse(
208
207
  jsonString,
209
- (x) => DeploymentMetadata$inboundSchema.parse(JSON.parse(x)),
210
- `Failed to parse 'DeploymentMetadata' from JSON`,
208
+ (x) => Metadata$inboundSchema.parse(JSON.parse(x)),
209
+ `Failed to parse 'Metadata' from JSON`,
211
210
  );
212
211
  }
213
212
 
@@ -225,9 +224,7 @@ export const Deployment$inboundSchema: z.ZodMiniType<Deployment, unknown> = z
225
224
  deployer_address: z.optional(z.nullable(types.string())),
226
225
  status: z.optional(z.nullable(types.string())),
227
226
  verified: z.optional(z.nullable(types.boolean())),
228
- metadata: z.optional(
229
- z.nullable(z.lazy(() => DeploymentMetadata$inboundSchema)),
230
- ),
227
+ metadata: z.optional(z.nullable(z.lazy(() => Metadata$inboundSchema))),
231
228
  created_at: z.optional(z.nullable(types.string())),
232
229
  updated_at: z.optional(z.nullable(types.string())),
233
230
  }),
@@ -274,20 +271,16 @@ export const GetOrgsByOrgIdAssetsByAssetIdResponse$inboundSchema: z.ZodMiniType<
274
271
  max_supply: z.optional(z.nullable(types.number())),
275
272
  decimals: z.optional(z.nullable(types.number())),
276
273
  unit_price_usd: z.optional(z.nullable(types.number())),
277
- status: types.string(),
274
+ status: GetOrgsByOrgIdAssetsByAssetIdStatus$inboundSchema,
278
275
  org_only: z.optional(z.nullable(types.boolean())),
279
276
  required_kyc_level: z.optional(z.nullable(types.number())),
280
277
  max_holders: z.optional(z.nullable(types.number())),
281
- compliance_rules: z.optional(z.nullable(z.lazy(() =>
282
- GetOrgsByOrgIdAssetsByAssetIdComplianceRules$inboundSchema
283
- ))),
284
- contract_addresses: z.optional(z.nullable(z.lazy(() =>
285
- GetOrgsByOrgIdAssetsByAssetIdContractAddresses$inboundSchema
286
- ))),
278
+ compliance_rules: z.optional(z.nullable(z.record(z.string(), z.any()))),
279
+ contract_addresses: z.optional(
280
+ z.nullable(z.record(z.string(), types.string())),
281
+ ),
287
282
  deployed_chains: z.optional(z.nullable(z.array(types.number()))),
288
- metadata: z.optional(z.nullable(z.lazy(() =>
289
- GetOrgsByOrgIdAssetsByAssetIdMetadata$inboundSchema
290
- ))),
283
+ metadata: z.optional(z.nullable(z.record(z.string(), z.any()))),
291
284
  created_by: z.optional(z.nullable(types.string())),
292
285
  launched_at: z.optional(z.nullable(types.string())),
293
286
  logo_url: z.optional(z.nullable(types.string())),
@@ -297,9 +290,7 @@ export const GetOrgsByOrgIdAssetsByAssetIdResponse$inboundSchema: z.ZodMiniType<
297
290
  org_name: z.optional(z.nullable(types.string())),
298
291
  org_logo_url: z.optional(z.nullable(types.string())),
299
292
  org_banner_url: z.optional(z.nullable(types.string())),
300
- deployments: z.array(z.lazy(() =>
301
- Deployment$inboundSchema
302
- )),
293
+ deployments: z.array(z.lazy(() => Deployment$inboundSchema)),
303
294
  }),
304
295
  z.transform((v) => {
305
296
  return remap$(v, {
@@ -5,6 +5,8 @@
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
8
10
  import { Result as SafeParseResult } from "../../types/fp.js";
9
11
  import * as types from "../../types/primitives.js";
10
12
  import { SDKValidationError } from "../errors/sdk-validation-error.js";
@@ -20,14 +22,25 @@ export type GetOrgsByOrgIdAssetsRequest = {
20
22
  status?: string | undefined;
21
23
  };
22
24
 
23
- export type GetOrgsByOrgIdAssetsComplianceRules = {};
24
-
25
25
  /**
26
- * Map of chain EID to contract address
26
+ * Lifecycle status of the asset
27
27
  */
28
- export type GetOrgsByOrgIdAssetsContractAddresses = {};
29
-
30
- export type GetOrgsByOrgIdAssetsMetadata = {};
28
+ export const GetOrgsByOrgIdAssetsStatus = {
29
+ Draft: "draft",
30
+ PendingReview: "pending_review",
31
+ Approved: "approved",
32
+ Deploying: "deploying",
33
+ Deployed: "deployed",
34
+ Active: "active",
35
+ Paused: "paused",
36
+ Retired: "retired",
37
+ } as const;
38
+ /**
39
+ * Lifecycle status of the asset
40
+ */
41
+ export type GetOrgsByOrgIdAssetsStatus = OpenEnum<
42
+ typeof GetOrgsByOrgIdAssetsStatus
43
+ >;
31
44
 
32
45
  export type GetOrgsByOrgIdAssetsAsset = {
33
46
  id: string;
@@ -46,16 +59,16 @@ export type GetOrgsByOrgIdAssetsAsset = {
46
59
  decimals?: number | null | undefined;
47
60
  unitPriceUsd?: number | null | undefined;
48
61
  /**
49
- * Status: draft | deploying | deployed | active | paused | retired
62
+ * Lifecycle status of the asset
50
63
  */
51
- status: string;
64
+ status: GetOrgsByOrgIdAssetsStatus;
52
65
  orgOnly?: boolean | null | undefined;
53
66
  requiredKycLevel?: number | null | undefined;
54
67
  maxHolders?: number | null | undefined;
55
- complianceRules?: GetOrgsByOrgIdAssetsComplianceRules | null | undefined;
56
- contractAddresses?: GetOrgsByOrgIdAssetsContractAddresses | null | undefined;
68
+ complianceRules?: { [k: string]: any } | null | undefined;
69
+ contractAddresses?: { [k: string]: string } | null | undefined;
57
70
  deployedChains?: Array<number> | null | undefined;
58
- metadata?: GetOrgsByOrgIdAssetsMetadata | null | undefined;
71
+ metadata?: { [k: string]: any } | null | undefined;
59
72
  createdBy?: string | null | undefined;
60
73
  launchedAt?: string | null | undefined;
61
74
  logoUrl?: string | null | undefined;
@@ -127,54 +140,10 @@ export function getOrgsByOrgIdAssetsRequestToJSON(
127
140
  }
128
141
 
129
142
  /** @internal */
130
- export const GetOrgsByOrgIdAssetsComplianceRules$inboundSchema: z.ZodMiniType<
131
- GetOrgsByOrgIdAssetsComplianceRules,
132
- unknown
133
- > = z.object({});
134
-
135
- export function getOrgsByOrgIdAssetsComplianceRulesFromJSON(
136
- jsonString: string,
137
- ): SafeParseResult<GetOrgsByOrgIdAssetsComplianceRules, SDKValidationError> {
138
- return safeParse(
139
- jsonString,
140
- (x) =>
141
- GetOrgsByOrgIdAssetsComplianceRules$inboundSchema.parse(JSON.parse(x)),
142
- `Failed to parse 'GetOrgsByOrgIdAssetsComplianceRules' from JSON`,
143
- );
144
- }
145
-
146
- /** @internal */
147
- export const GetOrgsByOrgIdAssetsContractAddresses$inboundSchema: z.ZodMiniType<
148
- GetOrgsByOrgIdAssetsContractAddresses,
149
- unknown
150
- > = z.object({});
151
-
152
- export function getOrgsByOrgIdAssetsContractAddressesFromJSON(
153
- jsonString: string,
154
- ): SafeParseResult<GetOrgsByOrgIdAssetsContractAddresses, SDKValidationError> {
155
- return safeParse(
156
- jsonString,
157
- (x) =>
158
- GetOrgsByOrgIdAssetsContractAddresses$inboundSchema.parse(JSON.parse(x)),
159
- `Failed to parse 'GetOrgsByOrgIdAssetsContractAddresses' from JSON`,
160
- );
161
- }
162
-
163
- /** @internal */
164
- export const GetOrgsByOrgIdAssetsMetadata$inboundSchema: z.ZodMiniType<
165
- GetOrgsByOrgIdAssetsMetadata,
143
+ export const GetOrgsByOrgIdAssetsStatus$inboundSchema: z.ZodMiniType<
144
+ GetOrgsByOrgIdAssetsStatus,
166
145
  unknown
167
- > = z.object({});
168
-
169
- export function getOrgsByOrgIdAssetsMetadataFromJSON(
170
- jsonString: string,
171
- ): SafeParseResult<GetOrgsByOrgIdAssetsMetadata, SDKValidationError> {
172
- return safeParse(
173
- jsonString,
174
- (x) => GetOrgsByOrgIdAssetsMetadata$inboundSchema.parse(JSON.parse(x)),
175
- `Failed to parse 'GetOrgsByOrgIdAssetsMetadata' from JSON`,
176
- );
177
- }
146
+ > = openEnums.inboundSchema(GetOrgsByOrgIdAssetsStatus);
178
147
 
179
148
  /** @internal */
180
149
  export const GetOrgsByOrgIdAssetsAsset$inboundSchema: z.ZodMiniType<
@@ -194,24 +163,16 @@ export const GetOrgsByOrgIdAssetsAsset$inboundSchema: z.ZodMiniType<
194
163
  max_supply: z.optional(z.nullable(types.number())),
195
164
  decimals: z.optional(z.nullable(types.number())),
196
165
  unit_price_usd: z.optional(z.nullable(types.number())),
197
- status: types.string(),
166
+ status: GetOrgsByOrgIdAssetsStatus$inboundSchema,
198
167
  org_only: z.optional(z.nullable(types.boolean())),
199
168
  required_kyc_level: z.optional(z.nullable(types.number())),
200
169
  max_holders: z.optional(z.nullable(types.number())),
201
- compliance_rules: z.optional(
202
- z.nullable(
203
- z.lazy(() => GetOrgsByOrgIdAssetsComplianceRules$inboundSchema),
204
- ),
205
- ),
170
+ compliance_rules: z.optional(z.nullable(z.record(z.string(), z.any()))),
206
171
  contract_addresses: z.optional(
207
- z.nullable(z.lazy(() =>
208
- GetOrgsByOrgIdAssetsContractAddresses$inboundSchema
209
- )),
172
+ z.nullable(z.record(z.string(), types.string())),
210
173
  ),
211
174
  deployed_chains: z.optional(z.nullable(z.array(types.number()))),
212
- metadata: z.optional(
213
- z.nullable(z.lazy(() => GetOrgsByOrgIdAssetsMetadata$inboundSchema)),
214
- ),
175
+ metadata: z.optional(z.nullable(z.record(z.string(), z.any()))),
215
176
  created_by: z.optional(z.nullable(types.string())),
216
177
  launched_at: z.optional(z.nullable(types.string())),
217
178
  logo_url: z.optional(z.nullable(types.string())),
@@ -45,7 +45,7 @@ export type WindowDays = string | number;
45
45
 
46
46
  export type TotalRejections = string | number;
47
47
 
48
- export type ByReasonCode = {};
48
+ export type ByReasonCode = string | number;
49
49
 
50
50
  export type TrendCount = string | number;
51
51
 
@@ -75,7 +75,7 @@ export type GetOrgsByOrgIdComplianceStatsResponse = {
75
75
  windowDays: string | number;
76
76
  totalRejections: string | number;
77
77
  capped: boolean;
78
- byReasonCode: ByReasonCode;
78
+ byReasonCode: { [k: string]: string | number };
79
79
  trend: Array<Trend>;
80
80
  topRejectedWallets: Array<TopRejectedWallet>;
81
81
  topRejectedAssets: Array<TopRejectedAsset>;
@@ -174,7 +174,7 @@ export function totalRejectionsFromJSON(
174
174
 
175
175
  /** @internal */
176
176
  export const ByReasonCode$inboundSchema: z.ZodMiniType<ByReasonCode, unknown> =
177
- z.object({});
177
+ smartUnion([types.string(), types.number()]);
178
178
 
179
179
  export function byReasonCodeFromJSON(
180
180
  jsonString: string,
@@ -294,7 +294,10 @@ export const GetOrgsByOrgIdComplianceStatsResponse$inboundSchema: z.ZodMiniType<
294
294
  windowDays: smartUnion([types.string(), types.number()]),
295
295
  totalRejections: smartUnion([types.string(), types.number()]),
296
296
  capped: types.boolean(),
297
- byReasonCode: z.lazy(() => ByReasonCode$inboundSchema),
297
+ byReasonCode: z.record(
298
+ z.string(),
299
+ smartUnion([types.string(), types.number()]),
300
+ ),
298
301
  trend: z.array(z.lazy(() => Trend$inboundSchema)),
299
302
  topRejectedWallets: z.array(z.lazy(() => TopRejectedWallet$inboundSchema)),
300
303
  topRejectedAssets: z.array(z.lazy(() => TopRejectedAsset$inboundSchema)),
@@ -8,6 +8,7 @@ export * from "./delete-attestations-by-id.js";
8
8
  export * from "./delete-auth-mfa.js";
9
9
  export * from "./delete-orgs-by-org-id-api-keys-by-key-id.js";
10
10
  export * from "./delete-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders-by-order-id.js";
11
+ export * from "./delete-orgs-by-org-id-assets-by-asset-id.js";
11
12
  export * from "./delete-orgs-by-org-id-chains-by-chain-id.js";
12
13
  export * from "./delete-orgs-by-org-id-issuer.js";
13
14
  export * from "./delete-orgs-by-org-id-members-by-user-id.js";
@@ -8,11 +8,53 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import * as types from "../../types/primitives.js";
9
9
  import { SDKValidationError } from "../errors/sdk-validation-error.js";
10
10
 
11
+ export type ReviewResult = {
12
+ /**
13
+ * Review answer: GREEN, RED, etc.
14
+ */
15
+ reviewAnswer?: string | undefined;
16
+ rejectLabels?: Array<string> | undefined;
17
+ reviewRejectType?: string | undefined;
18
+ };
19
+
20
+ export type PostKycWebhookByProviderRequestBody = {
21
+ /**
22
+ * Event type
23
+ */
24
+ type?: string | undefined;
25
+ /**
26
+ * Sumsub applicant ID
27
+ */
28
+ applicantId?: string | undefined;
29
+ /**
30
+ * Inspection ID
31
+ */
32
+ inspectionId?: string | undefined;
33
+ /**
34
+ * Correlation ID
35
+ */
36
+ correlationId?: string | undefined;
37
+ /**
38
+ * External user ID (our user ID)
39
+ */
40
+ externalUserId?: string | undefined;
41
+ reviewResult?: ReviewResult | undefined;
42
+ /**
43
+ * Review status
44
+ */
45
+ reviewStatus?: string | undefined;
46
+ /**
47
+ * Event creation timestamp
48
+ */
49
+ createdAt?: string | undefined;
50
+ };
51
+
11
52
  export type PostKycWebhookByProviderRequest = {
12
53
  /**
13
54
  * KYC provider name: sumsub, mock
14
55
  */
15
56
  provider: string;
57
+ body: PostKycWebhookByProviderRequestBody;
16
58
  };
17
59
 
18
60
  /**
@@ -25,9 +67,68 @@ export type PostKycWebhookByProviderResponse = {
25
67
  success: boolean;
26
68
  };
27
69
 
70
+ /** @internal */
71
+ export type ReviewResult$Outbound = {
72
+ reviewAnswer?: string | undefined;
73
+ rejectLabels?: Array<string> | undefined;
74
+ reviewRejectType?: string | undefined;
75
+ };
76
+
77
+ /** @internal */
78
+ export const ReviewResult$outboundSchema: z.ZodMiniType<
79
+ ReviewResult$Outbound,
80
+ ReviewResult
81
+ > = z.object({
82
+ reviewAnswer: z.optional(z.string()),
83
+ rejectLabels: z.optional(z.array(z.string())),
84
+ reviewRejectType: z.optional(z.string()),
85
+ });
86
+
87
+ export function reviewResultToJSON(reviewResult: ReviewResult): string {
88
+ return JSON.stringify(ReviewResult$outboundSchema.parse(reviewResult));
89
+ }
90
+
91
+ /** @internal */
92
+ export type PostKycWebhookByProviderRequestBody$Outbound = {
93
+ type?: string | undefined;
94
+ applicantId?: string | undefined;
95
+ inspectionId?: string | undefined;
96
+ correlationId?: string | undefined;
97
+ externalUserId?: string | undefined;
98
+ reviewResult?: ReviewResult$Outbound | undefined;
99
+ reviewStatus?: string | undefined;
100
+ createdAt?: string | undefined;
101
+ };
102
+
103
+ /** @internal */
104
+ export const PostKycWebhookByProviderRequestBody$outboundSchema: z.ZodMiniType<
105
+ PostKycWebhookByProviderRequestBody$Outbound,
106
+ PostKycWebhookByProviderRequestBody
107
+ > = z.object({
108
+ type: z.optional(z.string()),
109
+ applicantId: z.optional(z.string()),
110
+ inspectionId: z.optional(z.string()),
111
+ correlationId: z.optional(z.string()),
112
+ externalUserId: z.optional(z.string()),
113
+ reviewResult: z.optional(z.lazy(() => ReviewResult$outboundSchema)),
114
+ reviewStatus: z.optional(z.string()),
115
+ createdAt: z.optional(z.string()),
116
+ });
117
+
118
+ export function postKycWebhookByProviderRequestBodyToJSON(
119
+ postKycWebhookByProviderRequestBody: PostKycWebhookByProviderRequestBody,
120
+ ): string {
121
+ return JSON.stringify(
122
+ PostKycWebhookByProviderRequestBody$outboundSchema.parse(
123
+ postKycWebhookByProviderRequestBody,
124
+ ),
125
+ );
126
+ }
127
+
28
128
  /** @internal */
29
129
  export type PostKycWebhookByProviderRequest$Outbound = {
30
130
  provider: string;
131
+ body: PostKycWebhookByProviderRequestBody$Outbound;
31
132
  };
32
133
 
33
134
  /** @internal */
@@ -36,6 +137,7 @@ export const PostKycWebhookByProviderRequest$outboundSchema: z.ZodMiniType<
36
137
  PostKycWebhookByProviderRequest
37
138
  > = z.object({
38
139
  provider: z.string(),
140
+ body: z.lazy(() => PostKycWebhookByProviderRequestBody$outboundSchema),
39
141
  });
40
142
 
41
143
  export function postKycWebhookByProviderRequestToJSON(
@@ -5,6 +5,8 @@
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
8
10
  import { Result as SafeParseResult } from "../../types/fp.js";
9
11
  import * as types from "../../types/primitives.js";
10
12
  import { SDKValidationError } from "../errors/sdk-validation-error.js";
@@ -27,6 +29,20 @@ export type PostOrgsByOrgIdAssetsByAssetIdDeployRequest = {
27
29
  body: PostOrgsByOrgIdAssetsByAssetIdDeployRequestBody;
28
30
  };
29
31
 
32
+ export const PostOrgsByOrgIdAssetsByAssetIdDeployStatus = {
33
+ Draft: "draft",
34
+ PendingReview: "pending_review",
35
+ Approved: "approved",
36
+ Deploying: "deploying",
37
+ Deployed: "deployed",
38
+ Active: "active",
39
+ Paused: "paused",
40
+ Retired: "retired",
41
+ } as const;
42
+ export type PostOrgsByOrgIdAssetsByAssetIdDeployStatus = OpenEnum<
43
+ typeof PostOrgsByOrgIdAssetsByAssetIdDeployStatus
44
+ >;
45
+
30
46
  /**
31
47
  * Response
32
48
  */
@@ -34,7 +50,7 @@ export type PostOrgsByOrgIdAssetsByAssetIdDeployResponse = {
34
50
  accepted: boolean;
35
51
  assetId: string;
36
52
  chainEid: number;
37
- status: string;
53
+ status: PostOrgsByOrgIdAssetsByAssetIdDeployStatus;
38
54
  requestId: string;
39
55
  message: string;
40
56
  };
@@ -129,6 +145,11 @@ export function postOrgsByOrgIdAssetsByAssetIdDeployRequestToJSON(
129
145
  );
130
146
  }
131
147
 
148
+ /** @internal */
149
+ export const PostOrgsByOrgIdAssetsByAssetIdDeployStatus$inboundSchema:
150
+ z.ZodMiniType<PostOrgsByOrgIdAssetsByAssetIdDeployStatus, unknown> = openEnums
151
+ .inboundSchema(PostOrgsByOrgIdAssetsByAssetIdDeployStatus);
152
+
132
153
  /** @internal */
133
154
  export const PostOrgsByOrgIdAssetsByAssetIdDeployResponse$inboundSchema:
134
155
  z.ZodMiniType<PostOrgsByOrgIdAssetsByAssetIdDeployResponse, unknown> = z
@@ -136,7 +157,7 @@ export const PostOrgsByOrgIdAssetsByAssetIdDeployResponse$inboundSchema:
136
157
  accepted: types.boolean(),
137
158
  assetId: types.string(),
138
159
  chainEid: types.number(),
139
- status: types.string(),
160
+ status: PostOrgsByOrgIdAssetsByAssetIdDeployStatus$inboundSchema,
140
161
  requestId: types.string(),
141
162
  message: types.string(),
142
163
  });
package/src/sdk/assets.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ import { assetsDeleteOrgsByOrgIdAssetsByAssetId } from "../funcs/assets-delete-orgs-by-org-id-assets-by-asset-id.js";
5
6
  import { assetsGetOrgsByOrgIdAssetsByAssetIdCollateral } from "../funcs/assets-get-orgs-by-org-id-assets-by-asset-id-collateral.js";
6
7
  import { assetsGetOrgsByOrgIdAssetsByAssetIdDocuments } from "../funcs/assets-get-orgs-by-org-id-assets-by-asset-id-documents.js";
7
8
  import { assetsGetOrgsByOrgIdAssetsByAssetIdEscrows } from "../funcs/assets-get-orgs-by-org-id-assets-by-asset-id-escrows.js";
@@ -108,6 +109,27 @@ export class Assets extends ClientSDK {
108
109
  ));
109
110
  }
110
111
 
112
+ /**
113
+ * Discard a draft asset
114
+ *
115
+ * @remarks
116
+ * Permanently deletes an asset that is still in `draft`. Synchronous — 204 on success, not a queued command. Answers 409 when the asset exists but is not a draft, or when a live deployment or dependent records block the delete. Requires assets:write and an admin/operator role.
117
+ */
118
+ async deleteOrgsByOrgIdAssetsByAssetId(
119
+ security: operations.DeleteOrgsByOrgIdAssetsByAssetIdSecurity,
120
+ orgId: string,
121
+ assetId: string,
122
+ options?: RequestOptions,
123
+ ): Promise<void> {
124
+ return unwrapAsync(assetsDeleteOrgsByOrgIdAssetsByAssetId(
125
+ this,
126
+ security,
127
+ orgId,
128
+ assetId,
129
+ options,
130
+ ));
131
+ }
132
+
111
133
  /**
112
134
  * List asset documents
113
135
  *