@clossir-tech/ts-sdk 0.10.4 → 0.10.5

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 (65) hide show
  1. package/README.md +22 -17
  2. package/esm/funcs/commands-get-commands-by-command-id.d.ts +20 -0
  3. package/esm/funcs/commands-get-commands-by-command-id.d.ts.map +1 -0
  4. package/esm/funcs/commands-get-commands-by-command-id.js +98 -0
  5. package/esm/funcs/commands-get-commands-by-command-id.js.map +1 -0
  6. package/esm/funcs/organizations-get-orgs-by-org-id-members-by-user-id-holdings.js +3 -1
  7. package/esm/funcs/organizations-get-orgs-by-org-id-members-by-user-id-holdings.js.map +1 -1
  8. package/esm/funcs/organizations-get-orgs-by-org-id-users-by-user-id-balance-summary.js +1 -1
  9. package/esm/funcs/organizations-get-orgs-by-org-id-users-by-user-id-balance-summary.js.map +1 -1
  10. package/esm/funcs/organizations-get-orgs-by-org-id-users-by-user-id-holdings.js +1 -1
  11. package/esm/funcs/organizations-get-orgs-by-org-id-users-by-user-id-holdings.js.map +1 -1
  12. package/esm/lib/config.d.ts +2 -2
  13. package/esm/lib/config.js +2 -2
  14. package/esm/models/operations/get-commands-by-command-id.d.ts +91 -0
  15. package/esm/models/operations/get-commands-by-command-id.d.ts.map +1 -0
  16. package/esm/models/operations/get-commands-by-command-id.js +73 -0
  17. package/esm/models/operations/get-commands-by-command-id.js.map +1 -0
  18. package/esm/models/operations/index.d.ts +1 -0
  19. package/esm/models/operations/index.d.ts.map +1 -1
  20. package/esm/models/operations/index.js +1 -0
  21. package/esm/models/operations/index.js.map +1 -1
  22. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-allocate.d.ts +1 -0
  23. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-allocate.d.ts.map +1 -1
  24. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-allocate.js +1 -0
  25. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-allocate.js.map +1 -1
  26. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.d.ts +1 -0
  27. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.d.ts.map +1 -1
  28. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.js +1 -0
  29. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.js.map +1 -1
  30. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-markets.d.ts +1 -0
  31. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-markets.d.ts.map +1 -1
  32. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-markets.js +1 -0
  33. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-markets.js.map +1 -1
  34. package/esm/models/operations/post-orgs-by-org-id-issuer-register.d.ts +11 -0
  35. package/esm/models/operations/post-orgs-by-org-id-issuer-register.d.ts.map +1 -1
  36. package/esm/models/operations/post-orgs-by-org-id-issuer-register.js +9 -0
  37. package/esm/models/operations/post-orgs-by-org-id-issuer-register.js.map +1 -1
  38. package/esm/models/operations/post-transfers.d.ts +1 -0
  39. package/esm/models/operations/post-transfers.d.ts.map +1 -1
  40. package/esm/models/operations/post-transfers.js +1 -0
  41. package/esm/models/operations/post-transfers.js.map +1 -1
  42. package/esm/sdk/commands.d.ts +12 -0
  43. package/esm/sdk/commands.d.ts.map +1 -0
  44. package/esm/sdk/commands.js +18 -0
  45. package/esm/sdk/commands.js.map +1 -0
  46. package/esm/sdk/sdk.d.ts +3 -0
  47. package/esm/sdk/sdk.d.ts.map +1 -1
  48. package/esm/sdk/sdk.js +5 -0
  49. package/esm/sdk/sdk.js.map +1 -1
  50. package/jsr.json +1 -1
  51. package/package.json +1 -1
  52. package/src/funcs/commands-get-commands-by-command-id.ts +189 -0
  53. package/src/funcs/organizations-get-orgs-by-org-id-members-by-user-id-holdings.ts +4 -1
  54. package/src/funcs/organizations-get-orgs-by-org-id-users-by-user-id-balance-summary.ts +1 -1
  55. package/src/funcs/organizations-get-orgs-by-org-id-users-by-user-id-holdings.ts +1 -1
  56. package/src/lib/config.ts +2 -2
  57. package/src/models/operations/get-commands-by-command-id.ts +199 -0
  58. package/src/models/operations/index.ts +1 -0
  59. package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-allocate.ts +2 -0
  60. package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-deploy.ts +2 -0
  61. package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-markets.ts +2 -0
  62. package/src/models/operations/post-orgs-by-org-id-issuer-register.ts +26 -0
  63. package/src/models/operations/post-transfers.ts +2 -0
  64. package/src/sdk/commands.ts +27 -0
  65. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,199 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.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 GetCommandsByCommandIdRequest = {
13
+ commandId: string;
14
+ };
15
+
16
+ export type Unconfirmed = {
17
+ /**
18
+ * no_broadcast_seen | dropped | stuck_unmined
19
+ */
20
+ reason: string;
21
+ since: Date;
22
+ };
23
+
24
+ export const Leg = {
25
+ Source: "source",
26
+ } as const;
27
+ export type Leg = ClosedEnum<typeof Leg>;
28
+
29
+ export type TxUnconfirmed = {
30
+ /**
31
+ * no_broadcast_seen | dropped | stuck_unmined
32
+ */
33
+ reason: string;
34
+ since: Date;
35
+ };
36
+
37
+ export type Tx = {
38
+ hash: string;
39
+ /**
40
+ * submitted | mined | final | reverted | failed | superseded
41
+ */
42
+ stage: string;
43
+ receiptStatus: string | null;
44
+ blockNumber: number | null;
45
+ blockHash: string | null;
46
+ reason: string | null;
47
+ unconfirmed: TxUnconfirmed | null;
48
+ submittedAt: Date;
49
+ minedAt: Date | null;
50
+ terminalAt: Date | null;
51
+ };
52
+
53
+ /**
54
+ * Response
55
+ */
56
+ export type GetCommandsByCommandIdResponse = {
57
+ commandId: string;
58
+ /**
59
+ * TRANSFER | DEPLOY_ASSET | REGISTER_ISSUER
60
+ */
61
+ commandType: string;
62
+ /**
63
+ * accepted | submitted | mined | final | reverted | failed
64
+ */
65
+ stage: string;
66
+ reason: string | null;
67
+ /**
68
+ * final, with another tx of the command reverted or failed
69
+ */
70
+ partial: boolean;
71
+ unconfirmed: Unconfirmed | null;
72
+ leg: Leg;
73
+ chainEid: number;
74
+ dstChainEid: number | null;
75
+ acceptedAt: Date;
76
+ submittedAt: Date | null;
77
+ minedAt: Date | null;
78
+ terminalAt: Date | null;
79
+ updatedAt: Date;
80
+ txs: Array<Tx>;
81
+ };
82
+
83
+ /** @internal */
84
+ export type GetCommandsByCommandIdRequest$Outbound = {
85
+ commandId: string;
86
+ };
87
+
88
+ /** @internal */
89
+ export const GetCommandsByCommandIdRequest$outboundSchema: z.ZodMiniType<
90
+ GetCommandsByCommandIdRequest$Outbound,
91
+ GetCommandsByCommandIdRequest
92
+ > = z.object({
93
+ commandId: z.string(),
94
+ });
95
+
96
+ export function getCommandsByCommandIdRequestToJSON(
97
+ getCommandsByCommandIdRequest: GetCommandsByCommandIdRequest,
98
+ ): string {
99
+ return JSON.stringify(
100
+ GetCommandsByCommandIdRequest$outboundSchema.parse(
101
+ getCommandsByCommandIdRequest,
102
+ ),
103
+ );
104
+ }
105
+
106
+ /** @internal */
107
+ export const Unconfirmed$inboundSchema: z.ZodMiniType<Unconfirmed, unknown> = z
108
+ .object({
109
+ reason: types.string(),
110
+ since: types.date(),
111
+ });
112
+
113
+ export function unconfirmedFromJSON(
114
+ jsonString: string,
115
+ ): SafeParseResult<Unconfirmed, SDKValidationError> {
116
+ return safeParse(
117
+ jsonString,
118
+ (x) => Unconfirmed$inboundSchema.parse(JSON.parse(x)),
119
+ `Failed to parse 'Unconfirmed' from JSON`,
120
+ );
121
+ }
122
+
123
+ /** @internal */
124
+ export const Leg$inboundSchema: z.ZodMiniEnum<typeof Leg> = z.enum(Leg);
125
+
126
+ /** @internal */
127
+ export const TxUnconfirmed$inboundSchema: z.ZodMiniType<
128
+ TxUnconfirmed,
129
+ unknown
130
+ > = z.object({
131
+ reason: types.string(),
132
+ since: types.date(),
133
+ });
134
+
135
+ export function txUnconfirmedFromJSON(
136
+ jsonString: string,
137
+ ): SafeParseResult<TxUnconfirmed, SDKValidationError> {
138
+ return safeParse(
139
+ jsonString,
140
+ (x) => TxUnconfirmed$inboundSchema.parse(JSON.parse(x)),
141
+ `Failed to parse 'TxUnconfirmed' from JSON`,
142
+ );
143
+ }
144
+
145
+ /** @internal */
146
+ export const Tx$inboundSchema: z.ZodMiniType<Tx, unknown> = z.object({
147
+ hash: types.string(),
148
+ stage: types.string(),
149
+ receiptStatus: types.nullable(types.string()),
150
+ blockNumber: types.nullable(types.number()),
151
+ blockHash: types.nullable(types.string()),
152
+ reason: types.nullable(types.string()),
153
+ unconfirmed: types.nullable(z.lazy(() => TxUnconfirmed$inboundSchema)),
154
+ submittedAt: types.date(),
155
+ minedAt: types.nullable(types.date()),
156
+ terminalAt: types.nullable(types.date()),
157
+ });
158
+
159
+ export function txFromJSON(
160
+ jsonString: string,
161
+ ): SafeParseResult<Tx, SDKValidationError> {
162
+ return safeParse(
163
+ jsonString,
164
+ (x) => Tx$inboundSchema.parse(JSON.parse(x)),
165
+ `Failed to parse 'Tx' from JSON`,
166
+ );
167
+ }
168
+
169
+ /** @internal */
170
+ export const GetCommandsByCommandIdResponse$inboundSchema: z.ZodMiniType<
171
+ GetCommandsByCommandIdResponse,
172
+ unknown
173
+ > = z.object({
174
+ commandId: types.string(),
175
+ commandType: types.string(),
176
+ stage: types.string(),
177
+ reason: types.nullable(types.string()),
178
+ partial: types.boolean(),
179
+ unconfirmed: types.nullable(z.lazy(() => Unconfirmed$inboundSchema)),
180
+ leg: Leg$inboundSchema,
181
+ chainEid: types.number(),
182
+ dstChainEid: types.nullable(types.number()),
183
+ acceptedAt: types.date(),
184
+ submittedAt: types.nullable(types.date()),
185
+ minedAt: types.nullable(types.date()),
186
+ terminalAt: types.nullable(types.date()),
187
+ updatedAt: types.date(),
188
+ txs: z.array(z.lazy(() => Tx$inboundSchema)),
189
+ });
190
+
191
+ export function getCommandsByCommandIdResponseFromJSON(
192
+ jsonString: string,
193
+ ): SafeParseResult<GetCommandsByCommandIdResponse, SDKValidationError> {
194
+ return safeParse(
195
+ jsonString,
196
+ (x) => GetCommandsByCommandIdResponse$inboundSchema.parse(JSON.parse(x)),
197
+ `Failed to parse 'GetCommandsByCommandIdResponse' from JSON`,
198
+ );
199
+ }
@@ -43,6 +43,7 @@ export * from "./get-chain-events-by-tx-by-tx-hash.js";
43
43
  export * from "./get-chain-events.js";
44
44
  export * from "./get-chains-by-eid.js";
45
45
  export * from "./get-chains.js";
46
+ export * from "./get-commands-by-command-id.js";
46
47
  export * from "./get-compliance-by-wallet.js";
47
48
  export * from "./get-compliance-dossier-by-wallet-address.js";
48
49
  export * from "./get-compliance-transfer-rejections.js";
@@ -53,6 +53,7 @@ export type ErrorT = {
53
53
  export type PostOrgsByOrgIdAssetsByAssetIdAllocateResponse = {
54
54
  accepted: boolean;
55
55
  transferIds: Array<string>;
56
+ commandIds: Array<string | null>;
56
57
  requestId: string;
57
58
  errors?: Array<ErrorT> | undefined;
58
59
  };
@@ -185,6 +186,7 @@ export const PostOrgsByOrgIdAssetsByAssetIdAllocateResponse$inboundSchema:
185
186
  .object({
186
187
  accepted: types.boolean(),
187
188
  transferIds: z.array(types.string()),
189
+ commandIds: z.array(types.nullable(types.string())),
188
190
  requestId: types.string(),
189
191
  errors: types.optional(z.array(z.lazy(() => ErrorT$inboundSchema))),
190
192
  });
@@ -52,6 +52,7 @@ export type PostOrgsByOrgIdAssetsByAssetIdDeployResponse = {
52
52
  chainEid: number;
53
53
  status: PostOrgsByOrgIdAssetsByAssetIdDeployStatus;
54
54
  requestId: string;
55
+ commandId: string | null;
55
56
  message: string;
56
57
  };
57
58
 
@@ -159,6 +160,7 @@ export const PostOrgsByOrgIdAssetsByAssetIdDeployResponse$inboundSchema:
159
160
  chainEid: types.number(),
160
161
  status: PostOrgsByOrgIdAssetsByAssetIdDeployStatus$inboundSchema,
161
162
  requestId: types.string(),
163
+ commandId: types.nullable(types.string()),
162
164
  message: types.string(),
163
165
  });
164
166
 
@@ -81,6 +81,7 @@ export type PostOrgsByOrgIdAssetsByAssetIdMarketsResponse = {
81
81
  chainEid: number;
82
82
  status: string;
83
83
  requestId: string;
84
+ commandId: string | null;
84
85
  message: string;
85
86
  };
86
87
 
@@ -217,6 +218,7 @@ export const PostOrgsByOrgIdAssetsByAssetIdMarketsResponse$inboundSchema:
217
218
  chainEid: types.number(),
218
219
  status: types.string(),
219
220
  requestId: types.string(),
221
+ commandId: types.nullable(types.string()),
220
222
  message: types.string(),
221
223
  });
222
224
 
@@ -25,12 +25,21 @@ export type PostOrgsByOrgIdIssuerRegisterRequest = {
25
25
  body: PostOrgsByOrgIdIssuerRegisterRequestBody;
26
26
  };
27
27
 
28
+ export type Command = {
29
+ chainEid: number;
30
+ commandId: string | null;
31
+ };
32
+
28
33
  /**
29
34
  * Response
30
35
  */
31
36
  export type PostOrgsByOrgIdIssuerRegisterResponse = {
32
37
  registered: boolean;
33
38
  issuer?: any | null | undefined;
39
+ /**
40
+ * One entry per chain leg the org has a server wallet for.
41
+ */
42
+ commands: Array<Command>;
34
43
  };
35
44
 
36
45
  /** @internal */
@@ -121,6 +130,22 @@ export function postOrgsByOrgIdIssuerRegisterRequestToJSON(
121
130
  );
122
131
  }
123
132
 
133
+ /** @internal */
134
+ export const Command$inboundSchema: z.ZodMiniType<Command, unknown> = z.object({
135
+ chainEid: types.number(),
136
+ commandId: types.nullable(types.string()),
137
+ });
138
+
139
+ export function commandFromJSON(
140
+ jsonString: string,
141
+ ): SafeParseResult<Command, SDKValidationError> {
142
+ return safeParse(
143
+ jsonString,
144
+ (x) => Command$inboundSchema.parse(JSON.parse(x)),
145
+ `Failed to parse 'Command' from JSON`,
146
+ );
147
+ }
148
+
124
149
  /** @internal */
125
150
  export const PostOrgsByOrgIdIssuerRegisterResponse$inboundSchema: z.ZodMiniType<
126
151
  PostOrgsByOrgIdIssuerRegisterResponse,
@@ -128,6 +153,7 @@ export const PostOrgsByOrgIdIssuerRegisterResponse$inboundSchema: z.ZodMiniType<
128
153
  > = z.object({
129
154
  registered: types.boolean(),
130
155
  issuer: z.optional(z.nullable(z.any())),
156
+ commands: z.array(z.lazy(() => Command$inboundSchema)),
131
157
  });
132
158
 
133
159
  export function postOrgsByOrgIdIssuerRegisterResponseFromJSON(
@@ -62,6 +62,7 @@ export type PostTransfersStatus = ClosedEnum<typeof PostTransfersStatus>;
62
62
  export type PostTransfersResponse = {
63
63
  accepted: true;
64
64
  transferId: string;
65
+ commandId: string | null;
65
66
  status: PostTransfersStatus;
66
67
  message: string;
67
68
  };
@@ -145,6 +146,7 @@ export const PostTransfersResponse$inboundSchema: z.ZodMiniType<
145
146
  > = z.object({
146
147
  accepted: types.literal(true),
147
148
  transferId: types.string(),
149
+ commandId: types.nullable(types.string()),
148
150
  status: PostTransfersStatus$inboundSchema,
149
151
  message: types.string(),
150
152
  });
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { commandsGetCommandsByCommandId } from "../funcs/commands-get-commands-by-command-id.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as operations from "../models/operations/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Commands extends ClientSDK {
11
+ /**
12
+ * Get command lifecycle
13
+ *
14
+ * @remarks
15
+ * Returns the lifecycle of one on-chain command the caller can see: org commands to members of the org, initiator commands to the user who initiated them. API keys see org commands only. Another org's command, another user's command, a malformed id and an absent id all return the same 404. stage moves accepted -> submitted -> mined -> final | reverted | failed. final = SOURCE-chain finality (leg is always "source"); for a cross-chain transfer, LayerZero delivery to dstChainEid is tracked separately. unconfirmed is a non-terminal flag (no_broadcast_seen | dropped | stuck_unmined) and is null once the command is terminal. partial = final with another tx of the command reverted or failed.
16
+ */
17
+ async getCommandsByCommandId(
18
+ commandId: string,
19
+ options?: RequestOptions,
20
+ ): Promise<operations.GetCommandsByCommandIdResponse> {
21
+ return unwrapAsync(commandsGetCommandsByCommandId(
22
+ this,
23
+ commandId,
24
+ options,
25
+ ));
26
+ }
27
+ }
package/src/sdk/sdk.ts CHANGED
@@ -13,6 +13,7 @@ import { Auth } from "./auth.js";
13
13
  import { Bridge } from "./bridge.js";
14
14
  import { ChainEvents } from "./chain-events.js";
15
15
  import { Chains } from "./chains.js";
16
+ import { Commands } from "./commands.js";
16
17
  import { Compliance } from "./compliance.js";
17
18
  import { Distributions } from "./distributions.js";
18
19
  import { Fees } from "./fees.js";
@@ -105,6 +106,11 @@ export class Clossir extends ClientSDK {
105
106
  return (this._transfers ??= new Transfers(this._options));
106
107
  }
107
108
 
109
+ private _commands?: Commands;
110
+ get commands(): Commands {
111
+ return (this._commands ??= new Commands(this._options));
112
+ }
113
+
108
114
  private _bridge?: Bridge;
109
115
  get bridge(): Bridge {
110
116
  return (this._bridge ??= new Bridge(this._options));