-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathllms.txt
More file actions
13859 lines (13347 loc) · 381 KB
/
Copy pathllms.txt
File metadata and controls
13859 lines (13347 loc) · 381 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
This file is a merged representation of a subset of the codebase, containing files not matching ignore patterns, combined into a single document by Repomix.
The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter).
================================================================
File Summary
================================================================
Purpose:
--------
This file contains a packed representation of a subset of the repository's contents that is considered the most important context.
It is designed to be easily consumable by AI systems for analysis, code review,
or other automated processes.
File Format:
------------
The content is organized as follows:
1. This summary section
2. Repository information
3. Directory structure
4. Repository files (if enabled)
5. Multiple file entries, each consisting of:
a. A separator line (================)
b. The file path (File: path/to/file)
c. Another separator line
d. The full contents of the file
e. A blank line
Usage Guidelines:
-----------------
- This file should be treated as read-only. Any changes should be made to the
original repository files, not this packed version.
- When processing this file, use the file path to distinguish
between different files in the repository.
- Be aware that this file may contain sensitive information. Handle it with
the same level of security as you would the original repository.
Notes:
------
- Some files may have been excluded based on .gitignore rules and Repomix's configuration
- Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files
- Files matching these patterns are excluded: .github/, examples/apidoc/, docs/images/, docs/endpointFunctionList.md, test/, src/util/, dist/, lib/
- Files matching patterns in .gitignore are excluded
- Files matching default ignore patterns are excluded
- Content has been compressed - code blocks are separated by ⋮---- delimiter
- Files are sorted by Git change count (files with more changes are at the bottom)
================================================================
Directory Structure
================================================================
docs/
KRAKEN_SDK_QUICKSTART_GUIDE.md
examples/
Derivatives/
Private/
account.ts
orderManagement.ts
submitOrder.ts
testnet.ts
Public/
marketData.ts
WebSockets/
privateWs.ts
publicWs.ts
testnetWs.ts
Spot/
Private/
account.ts
depositWithdraw.ts
orderManagement.ts
submitOrder.ts
Public/
marketData.ts
WebSockets/
privateWs.ts
publicWs.ts
wsAPI.RAW.ts
wsAPI.ts
src/
lib/
websocket/
logger.ts
rest-client-cache.ts
websocket-util.ts
WsStore.ts
WsStore.types.ts
BaseRestClient.ts
BaseWSClient.ts
misc-util.ts
requestUtils.ts
webCryptoAPI.ts
types/
request/
derivatives.types.ts
institutional.types.ts
partner.types.ts
spot.types.ts
wsapi.types.ts
response/
derivatives.types.ts
institutional.types.ts
partner.types.ts
shared.types.ts
spot.types.ts
ws.ts
wsapi.types.ts
websockets/
ws-api.ts
ws-events.ts
ws-general.ts
ws-subscriptions.ts
DerivativesClient.ts
index.ts
InstitutionalClient.ts
PartnerClient.ts
SpotClient.ts
WebsocketAPIClient.ts
WebsocketClient.ts
webpack/
webpack.config.cjs
.eslintrc.cjs
.gitignore
.nvmrc
.prettierrc
jest.config.ts
LICENSE.md
package.json
postBuild.sh
README.md
tsconfig.cjs.json
tsconfig.esm.json
tsconfig.json
tsconfig.linting.json
================================================================
Files
================================================================
================
File: examples/Spot/Public/marketData.ts
================
import { SpotClient } from '../../../src/index.js';
⋮----
// This example shows how to call Kraken API endpoint with either node.js,
// javascript (js) or typescript (ts) with the npm module "@siebly/kraken-api" for Kraken exchange
// for PUBLIC MARKET DATA that requires no authentication
⋮----
/**
* import { SpotClient } from '@siebly/kraken-api';
*/
⋮----
// you can initialise public client without api keys as public calls do not require auth
⋮----
async function publicCalls()
⋮----
// Get server time
⋮----
// Get system status
⋮----
// Get asset info
⋮----
// Get tradable asset pairs
⋮----
// Get ticker information
⋮----
// Get order book
⋮----
// Get OHLC data (candles)
⋮----
interval: 60, // 1 minute
⋮----
// Get recent trades
⋮----
// Get recent spreads
================
File: src/lib/websocket/logger.ts
================
export type LogParams = null | any;
⋮----
// eslint-disable-next-line @typescript-eslint/no-unused-vars
⋮----
// console.log(_params);
⋮----
export type DefaultLogger = typeof DefaultLogger;
================
File: src/lib/websocket/rest-client-cache.ts
================
import { AxiosRequestConfig } from 'axios';
⋮----
import { DerivativesClient } from '../../DerivativesClient.js';
import { SpotClient } from '../../SpotClient.js';
import { RestClientOptions } from '../requestUtils.js';
import { DefaultLogger } from './logger.js';
⋮----
interface RestClientStore {
spot: SpotClient;
derivatives: DerivativesClient;
}
⋮----
interface WebSocketTokenCache {
spot?: { token: string; expiresAtMs: number };
derivatives?: { token: string; expiresAtMs: number };
}
⋮----
/**
* Caches REST clients and WebSocket tokens to avoid redundant requests.
*/
export class RestClientCache
⋮----
public setLogger(logger: DefaultLogger, loggerCategory: object): void
⋮----
public getSpotRESTClient(
restOptions: RestClientOptions,
requestOptions?: AxiosRequestConfig,
): SpotClient
⋮----
public async fetchSpotWebSocketToken(
restOptions: RestClientOptions,
requestOptions?: AxiosRequestConfig,
): Promise<
⋮----
// still valid for at least 10s
⋮----
public getDerivativesRESTClient(
restOptions: RestClientOptions,
requestOptions?: AxiosRequestConfig,
): DerivativesClient
================
File: src/lib/websocket/WsStore.types.ts
================
import WebSocket from 'isomorphic-ws';
⋮----
export enum WsConnectionStateEnum {
INITIAL = 0,
CONNECTING = 1,
CONNECTED = 2,
CLOSING = 3,
RECONNECTING = 4,
// ERROR_RECONNECTING = 5,
ERROR = 5,
}
⋮----
// ERROR_RECONNECTING = 5,
⋮----
export interface DeferredPromise<TSuccess = any, TError = any> {
resolve?: (value: TSuccess) => TSuccess;
reject?: (value: TError) => TError;
promise?: Promise<TSuccess>;
}
⋮----
export interface WSConnectedResult {
wsKey: string;
ws: WebSocket;
}
⋮----
export interface WsStoredState<TWSTopicSubscribeEvent extends string | object> {
/** The currently active websocket connection */
ws?: WebSocket;
/** The current lifecycle state of the connection (enum) */
connectionState?: WsConnectionStateEnum;
connectionStateChangedAt?: Date;
/** A timer that will send an upstream heartbeat (ping) when it expires */
activePingTimer?: ReturnType<typeof setTimeout> | undefined;
/** A timer tracking that an upstream heartbeat was sent, expecting a reply before it expires */
activePongTimer?: ReturnType<typeof setTimeout> | undefined;
/** If a reconnection is in progress, this will have the timer for the delayed reconnect */
activeReconnectTimer?: ReturnType<typeof setTimeout> | undefined;
/**
* When a connection attempt is in progress (even for reconnect), a promise is stored here.
*
* This promise will resolve once connected (and will then get removed);
*/
deferredPromiseStore: Record<string, DeferredPromise>;
/**
* All the topics we are expected to be subscribed to on this connection (and we automatically resubscribe to if the connection drops)
*
* A "Set" and a deep-object-match are used to ensure we only subscribe to a topic once (tracking a list of unique topics we're expected to be connected to)
*/
subscribedTopics: Set<TWSTopicSubscribeEvent>;
/** Whether this connection has completed authentication (only applies to private connections) */
isAuthenticated?: boolean;
/**
* Whether this connection has completed authentication before for the Websocket API, so it knows to automatically reauth if reconnected
*/
didAuthWSAPI?: boolean;
/** To reauthenticate on the WS API, which channel do we send to? */
WSAPIAuthChannel?: string;
}
⋮----
/** The currently active websocket connection */
⋮----
/** The current lifecycle state of the connection (enum) */
⋮----
/** A timer that will send an upstream heartbeat (ping) when it expires */
⋮----
/** A timer tracking that an upstream heartbeat was sent, expecting a reply before it expires */
⋮----
/** If a reconnection is in progress, this will have the timer for the delayed reconnect */
⋮----
/**
* When a connection attempt is in progress (even for reconnect), a promise is stored here.
*
* This promise will resolve once connected (and will then get removed);
*/
⋮----
/**
* All the topics we are expected to be subscribed to on this connection (and we automatically resubscribe to if the connection drops)
*
* A "Set" and a deep-object-match are used to ensure we only subscribe to a topic once (tracking a list of unique topics we're expected to be connected to)
*/
⋮----
/** Whether this connection has completed authentication (only applies to private connections) */
⋮----
/**
* Whether this connection has completed authentication before for the Websocket API, so it knows to automatically reauth if reconnected
*/
⋮----
/** To reauthenticate on the WS API, which channel do we send to? */
================
File: src/lib/misc-util.ts
================
export function neverGuard(x: never, msg: string): Error
================
File: src/lib/webCryptoAPI.ts
================
import { neverGuard } from './misc-util.js';
⋮----
function bufferToB64(buffer: ArrayBuffer): string
⋮----
function b64ToBytes(b64: string)
⋮----
function latin1ToBytes(s: string)
⋮----
export type SignEncodeMethod = 'hex' | 'base64' | 'binary';
export type SignAlgorithm = 'SHA-256' | 'SHA-512';
⋮----
/**
* Similar to node crypto's `createHash()` function
*/
export async function hashMessage(
message: string,
method: SignEncodeMethod,
algorithm: SignAlgorithm,
): Promise<string>
⋮----
// Equivalent in node:crypto:
// const signMessage = createHash(algorithm)
// .update(signInput)
// .digest('binary');
⋮----
export interface SignMessageOptions {
isSecretB64Encoded?: boolean;
isInputBinaryString?: boolean;
}
⋮----
/**
* Sign a message, with a secret, using the Web Crypto API
*/
export async function signMessage(
message: string,
secret: string,
method: SignEncodeMethod,
algorithm: SignAlgorithm,
options?: SignMessageOptions,
): Promise<string>
⋮----
export function checkWebCryptoAPISupported()
================
File: src/types/request/institutional.types.ts
================
// Custody API - List Vaults
⋮----
export type CustodyOrderDirection = 'asc' | 'desc';
export type CustodyCaseMatching = 'insensitive' | 'sensitive';
⋮----
// Filter types for vault listing
export type CustodyVaultFilterBy =
| 'id'
| 'name'
| 'default_approvals'
| 'created_at'
| 'updated_at'
| 'member';
⋮----
export type CustodyVaultOrderBy = 'id' | 'name' | 'created_at' | 'updated_at';
⋮----
// Individual filter types
export interface CustodyVaultFilterIdEquals {
type: 'equals';
values: string[];
by: 'id';
}
⋮----
export interface CustodyVaultFilterNameEquals {
type: 'equals';
values: string[];
case?: CustodyCaseMatching;
by: 'name';
}
⋮----
export interface CustodyVaultFilterNameStartsWith {
type: 'starts_with';
values: string[];
case?: CustodyCaseMatching;
by: 'name';
}
⋮----
export interface CustodyVaultFilterNameContains {
type: 'contains';
values: string[];
case?: CustodyCaseMatching;
by: 'name';
}
⋮----
export interface CustodyVaultFilterDefaultApprovalsEquals {
type: 'equals';
values: number[];
by: 'default_approvals';
}
⋮----
export interface CustodyVaultFilterDefaultApprovalsIn {
type: 'in';
left?: number;
right?: number;
by: 'default_approvals';
}
⋮----
export interface CustodyVaultFilterCreatedAtEquals {
type: 'equals';
values: string[];
by: 'created_at';
}
⋮----
export interface CustodyVaultFilterCreatedAtIn {
type: 'in';
left?: string;
right?: string;
by: 'created_at';
}
⋮----
export interface CustodyVaultFilterUpdatedAtEquals {
type: 'equals';
values: string[];
by: 'updated_at';
}
⋮----
export interface CustodyVaultFilterUpdatedAtIn {
type: 'in';
left?: string;
right?: string;
by: 'updated_at';
}
⋮----
export interface CustodyVaultFilterMemberEquals {
type: 'equals';
values: string[];
by: 'member';
}
⋮----
export type CustodyVaultFilterCondition =
| CustodyVaultFilterIdEquals
| CustodyVaultFilterNameEquals
| CustodyVaultFilterNameStartsWith
| CustodyVaultFilterNameContains
| CustodyVaultFilterDefaultApprovalsEquals
| CustodyVaultFilterDefaultApprovalsIn
| CustodyVaultFilterCreatedAtEquals
| CustodyVaultFilterCreatedAtIn
| CustodyVaultFilterUpdatedAtEquals
| CustodyVaultFilterUpdatedAtIn
| CustodyVaultFilterMemberEquals;
⋮----
export interface VaultFilterOr {
or: CustodyVaultFilterCondition[];
}
⋮----
export interface VaultFilters {
and?: VaultFilterOr[];
}
⋮----
export interface VaultPagination {
limit: number;
offset: number;
}
⋮----
export interface VaultOrdering {
by: CustodyVaultOrderBy;
direction?: CustodyOrderDirection;
}
⋮----
export interface CustodyListVaultsParams {
nonce?: number;
resolve_policies?: boolean | null;
filters?: VaultFilters;
pagination?: VaultPagination;
orderings?: VaultOrdering[];
}
⋮----
// Custody API - Deposit Methods
export type CustodyAssetClass =
| 'currency'
| 'forex'
| 'equity'
| 'equitypair'
| 'nft'
| 'volume';
⋮----
export interface CustodyDepositMethodsParams {
'x-vault-id': string;
nonce?: number;
asset?: string;
category: 'custody';
aclass?: string;
}
⋮----
// Custody API - Deposit Addresses
export interface CustodyDepositAddressesParams {
'x-vault-id': string;
nonce?: number;
aclass?: CustodyAssetClass;
asset: string;
method: string;
new?: boolean;
}
⋮----
// Custody API - List Custody Transactions
export type CustodyTransactionTypeReq =
| 'unspecified'
| 'deposit'
| 'withdrawal'
| 'trade'
| 'margin'
| 'adjustment'
| 'rollover'
| 'interest'
| 'credit'
| 'transfer'
| 'transfer_peer_to_peer'
| 'settle'
| 'dividend'
| 'nft_trade'
| 'reward'
| 'nft_creator_fee'
| 'nft_rebate'
| 'nft_airdrop'
| 'simple_order'
| 'simple_order_with_deposit'
| 'simple_order_failed'
| 'custom_simple_order'
| 'custom_simple_order_with_deposit'
| 'custom_simple_order_failed'
| 'recurring_simple_order'
| 'recurring_simple_order_with_deposit'
| 'recurring_simple_order_failed'
| 'simple_order_opposite_side'
| 'reserved_fee'
| 'fee_sweep'
| 'ic_settlement'
| 'fee_sweep_dlt'
| 'reward_sweep'
| 'reward_sweep_old'
| 'interest_sweep'
| 'conversion'
| 'dust_sweep'
| 'futures_transfer'
| 'custody_transfer'
| 'deposit_action'
| 'withdrawal_action'
| 'legacy_staking_allocation'
| 'legacy_staking_deallocation'
| 'legacy_staking_reward'
| 'earn_legacy_migration'
| 'block_trade'
| 'equity_trade'
| 'equity_acats'
| 'earn_staking_allocation'
| 'earn_staking_deallocation'
| 'earn_staking_reward'
| 'earn_staking_auto_allocation'
| 'earn_oir_allocation'
| 'earn_oir_deallocation'
| 'earn_oir_reward'
| 'earn_oir_auto_allocation'
| 'earn_base_reward'
| 'earn_base_auto_allocation'
| 'earn_base_auto_deallocation'
| 'custody_staking'
| 'custody_unstaking'
| 'custody_staking_reward'
| 'custody_staking_reward_aggregated'
| 'credit_rollover'
| 'airdrop'
| 'earn_oir_auto_deallocation'
| 'earn_staking_auto_deallocation'
| 'bridge_deposit'
| 'bridge_simple_order'
| 'simple_order_deposit_action'
| 'otc_buy'
| 'otc_sell'
| 'bundle_trade'
| 'equity_fee'
| 'equity_journal'
| 'corporate_action'
| 'user_account_transfer'
| 'earn_restaking'
| 'subscription'
| 'custody_otc_loan_pledge'
| 'custody_otc_collateral_liquidation'
| 'paytag_transfer'
| 'paylink_transfer'
| 'paytag_request_transfer'
| 'paylink_request_transfer'
| 'kard_transfer'
| 'krak_card'
| 'custody_otc_loan_release'
| 'fpsl_reward'
| 'fcm_trade'
| 'boost'
| 'fcm_misc';
⋮----
export type CustodyRefIdType =
| 'funding'
| 'trade'
| 'adjustment'
| 'transfer'
| 'custody_transfer'
| 'nft_transaction'
| 'nft_id'
| 'equity_trade'
| 'legacy_staking_reward'
| 'legacy_staking'
| 'earn_ledger'
| 'earn_strategy'
| 'simple_trade'
| 'simple_order_quote'
| 'legacy_custody_transaction';
⋮----
export type CustodyTransactionAssetClassReq =
| 'currency'
| 'forex'
| 'equity'
| 'equity_pair'
| 'nft'
| 'derivatives'
| 'tokenized_asset'
| 'futures_contract';
⋮----
export interface CustodyQuoteAsset {
asset: string;
class: CustodyTransactionAssetClassReq;
}
⋮----
export interface CustodyTransactionAssetFilter {
asset: string;
class: CustodyTransactionAssetClassReq;
}
⋮----
export interface CustodyTransactionRefIdFilter {
type: CustodyRefIdType;
ref_id: string;
}
⋮----
export interface CustodyTransactionSorting {
order?: 'descending' | 'ascending';
}
⋮----
export interface CustodyListTransactionsParams {
id: string;
nonce?: number;
page_size?: number;
quote?: CustodyQuoteAsset;
preferred_asset_name?: string;
sorting?: CustodyTransactionSorting;
cursor?: string;
types?: CustodyTransactionTypeReq[];
ids?: string[];
assets?: CustodyTransactionAssetFilter[];
ref_ids?: CustodyTransactionRefIdFilter[];
}
⋮----
// Custody API - Get Transaction by ID
export interface CustodyGetTransactionParams {
id: string;
nonce?: number;
vault_id: string;
with_long_timeout?: boolean | null;
quote?: CustodyQuoteAsset;
}
⋮----
// Custody API - Withdraw Methods
export interface CustodyWithdrawMethodsParams {
'x-vault-id': string;
nonce?: number;
asset?: string | null;
category: 'custody';
aclass?: string;
network?: string | null;
}
⋮----
// Custody API - Withdraw Addresses
export type CustodyWithdrawAddressAssetClass =
| 'currency'
| 'equity'
| 'equity-pair'
| 'forex'
| 'nft'
| 'volume';
⋮----
export interface CustodyWithdrawAddressesParams {
'x-vault-id': string;
preferred_asset_name?: 'new' | 'alt';
nonce?: number;
aclass?: CustodyWithdrawAddressAssetClass;
asset?: string | null;
method?: string | null;
key?: string | null;
verified?: boolean | null;
}
⋮----
// Custody API - List Tasks
export type CustodyTaskScope = 'domain' | 'vault';
⋮----
export type CustodyTaskStateReq =
| 'pending'
| 'approved'
| 'denied'
| 'canceled'
| 'expired'
| 'executed'
| 'failed';
⋮----
export type CustodyTaskAction =
| 'update_withdrawal_addresses'
| 'request_withdrawal'
| 'create_vault'
| 'update_group_users'
| 'update_role_users'
| 'update_vault_users'
| 'update_domain_policies'
| 'update_vault_policies'
| 'create_users'
| 'update_vault'
| 'update_status_users'
| 'request_transfer_to_spot'
| 'create_group'
| 'update_permission_users'
| 'create_api_users'
| 'update_api_users'
| 'update_vaults_users'
| 'request_allocation'
| 'request_deallocation';
⋮----
export type CustodyTaskUserDecisionReq = 'approved' | 'denied' | 'undecided';
⋮----
export type CustodyTaskOrderBy =
| 'id'
| 'vault_id'
| 'state'
| 'created_at'
| 'updated_at'
| 'expires_at';
⋮----
interface TaskFilterIdEquals {
type: 'equals';
values: string[];
by: 'id';
}
⋮----
interface TaskFilterApprovalIdEquals {
type: 'equals';
values: string[];
by: 'approval_id';
}
⋮----
interface TaskFilterVaultIdEquals {
type: 'equals';
values: string[];
by: 'vault_id';
}
⋮----
interface TaskFilterScopeEquals {
type: 'equals';
values: CustodyTaskScope[];
by: 'scope';
}
⋮----
interface TaskFilterStateEquals {
type: 'equals';
values: CustodyTaskStateReq[];
by: 'state';
}
⋮----
interface TaskFilterActionEquals {
type: 'equals';
values: CustodyTaskAction[];
by: 'action';
}
⋮----
interface TaskFilterCreatedAtEquals {
type: 'equals';
values: string[];
by: 'created_at';
}
⋮----
interface TaskFilterUpdatedAtEquals {
type: 'equals';
values: string[];
by: 'updated_at';
}
⋮----
interface TaskFilterExpiresAtEquals {
type: 'equals';
values: string[];
by: 'expires_at';
}
⋮----
interface TaskFilterCurrentUserDecisionEquals {
type: 'equals';
values: CustodyTaskUserDecisionReq[];
by: 'current_user_decision';
}
⋮----
export type CustodyTaskFilterCondition =
| TaskFilterIdEquals
| TaskFilterApprovalIdEquals
| TaskFilterVaultIdEquals
| TaskFilterScopeEquals
| TaskFilterStateEquals
| TaskFilterActionEquals
| TaskFilterCreatedAtEquals
| TaskFilterUpdatedAtEquals
| TaskFilterExpiresAtEquals
| TaskFilterCurrentUserDecisionEquals;
⋮----
export interface CustodyTaskFilterOr {
or: CustodyTaskFilterCondition[];
}
⋮----
export interface CustodyTaskFilters {
and?: CustodyTaskFilterOr[];
}
⋮----
export interface CustodyTaskOrdering {
by: CustodyTaskOrderBy;
direction?: CustodyOrderDirection;
}
⋮----
export interface CustodyListTasksParams {
nonce?: number;
filters?: CustodyTaskFilters;
pagination?: VaultPagination;
orderings?: CustodyTaskOrdering[];
}
⋮----
// Custody API - List Activities
type ActivityActionReq =
| 'created'
| 'review_approved'
| 'review_denied'
| 'canceled'
| 'executed'
| 'failed'
| 'expired';
⋮----
type ActivityOrderBy = 'activity_created_at';
⋮----
interface ActivityFilterIdEquals {
type: 'equals';
values: string[];
by: 'id';
}
⋮----
interface ActivityFilterScopeEquals {
type: 'equals';
values: CustodyTaskScope[];
by: 'scope';
}
⋮----
interface ActivityFilterVaultIdEquals {
type: 'equals';
values: string[];
by: 'vault_id';
}
⋮----
interface ActivityFilterTaskIdEquals {
type: 'equals';
values: string[];
by: 'task_id';
}
⋮----
interface ActivityFilterApprovalIdEquals {
type: 'equals';
values: string[];
by: 'approval_id';
}
⋮----
interface ActivityFilterTaskActionEquals {
type: 'equals';
values: CustodyTaskAction[];
by: 'task_action';
}
⋮----
interface ActivityFilterActivityActionEquals {
type: 'equals';
values: ActivityActionReq[];
by: 'activity_action';
}
⋮----
interface ActivityFilterCreatedAtEquals {
type: 'equals';
values: string[];
by: 'created_at';
}
⋮----
interface ActivityFilterUserEquals {
type: 'equals';
values: string[];
by: 'user';
}
⋮----
type ActivityFilterCondition =
| ActivityFilterIdEquals
| ActivityFilterScopeEquals
| ActivityFilterVaultIdEquals
| ActivityFilterTaskIdEquals
| ActivityFilterApprovalIdEquals
| ActivityFilterTaskActionEquals
| ActivityFilterActivityActionEquals
| ActivityFilterCreatedAtEquals
| ActivityFilterUserEquals;
⋮----
interface ActivityFilterOr {
or: ActivityFilterCondition[];
}
⋮----
interface ActivityFilters {
and?: ActivityFilterOr[];
}
⋮----
interface ActivityOrdering {
by: ActivityOrderBy;
direction?: CustodyOrderDirection;
}
⋮----
export interface CustodyListActivitiesParams {
nonce?: number;
filters?: ActivityFilters;
pagination?: VaultPagination;
orderings?: ActivityOrdering[];
}
⋮----
// OTC REST API - Quotes
export type OtcQuoteType = 'buy' | 'sell';
export type OtcQuoteStatus = 'accepted' | 'rejected';
export type OtcSettlement = 'automated' | 'flexible';
⋮----
export interface OTCCreateQuoteRequestParams {
nonce?: number;
base: string;
quote: string;
amount?: string;
total?: string;
type: OtcQuoteType;
}
⋮----
export interface OTCUpdateQuoteParams {
nonce?: number;
quote_id: string;
status: OtcQuoteStatus;
}
================
File: src/types/request/wsapi.types.ts
================
/**
* Websocket API v2 Spot Request Types
*/
⋮----
export interface WSAPIAddSpotOrderParams {
order_type:
| 'limit'
| 'market'
| 'iceberg'
| 'stop-loss'
| 'stop-loss-limit'
| 'take-profit'