@coopenomics/sdk 2.2.0

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/dist/index.cjs ADDED
@@ -0,0 +1,3202 @@
1
+ 'use strict';
2
+
3
+ const WebSocket = require('isomorphic-ws');
4
+ const graphqlWs = require('graphql-ws');
5
+ const antelope = require('@wharfkit/antelope');
6
+ const contract = require('@wharfkit/contract');
7
+ const session = require('@wharfkit/session');
8
+ const walletPluginPrivatekey = require('@wharfkit/wallet-plugin-privatekey');
9
+
10
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
11
+
12
+ const WebSocket__default = /*#__PURE__*/_interopDefaultCompat(WebSocket);
13
+
14
+ const AllTypesProps = {
15
+ AccountType: "enum",
16
+ AddParticipantInput: {
17
+ entrepreneur_data: "CreateEntrepreneurDataInput",
18
+ individual_data: "CreateIndividualDataInput",
19
+ organization_data: "CreateOrganizationDataInput",
20
+ type: "AccountType"
21
+ },
22
+ AddTrustedAccountInput: {},
23
+ AgreementInput: {},
24
+ BankAccountDetailsInput: {},
25
+ BankAccountInput: {
26
+ details: "BankAccountDetailsInput"
27
+ },
28
+ Country: "enum",
29
+ CreateBankAccountInput: {
30
+ data: "BankAccountInput"
31
+ },
32
+ CreateBranchInput: {},
33
+ CreateDepositPaymentInput: {},
34
+ CreateEntrepreneurDataInput: {
35
+ bank_account: "BankAccountInput",
36
+ country: "Country",
37
+ details: "EntrepreneurDetailsInput"
38
+ },
39
+ CreateIndividualDataInput: {
40
+ passport: "PassportInput"
41
+ },
42
+ CreateInitialPaymentInput: {},
43
+ CreateOrganizationDataInput: {
44
+ bank_account: "BankAccountInput",
45
+ details: "OrganizationDetailsInput",
46
+ represented_by: "RepresentedByInput",
47
+ type: "OrganizationType"
48
+ },
49
+ CreateProjectFreeDecisionInput: {},
50
+ DateTime: `scalar.DateTime`,
51
+ DeleteAccountInput: {},
52
+ DeleteBranchInput: {},
53
+ DeletePaymentMethodInput: {},
54
+ DeleteTrustedAccountInput: {},
55
+ EditBranchInput: {},
56
+ EntrepreneurDetailsInput: {},
57
+ ExtensionInput: {
58
+ config: "JSON",
59
+ created_at: "DateTime",
60
+ updated_at: "DateTime"
61
+ },
62
+ FreeDecisionGenerateDocumentInput: {},
63
+ GenerateDocumentInput: {},
64
+ GenerateDocumentOptionsInput: {},
65
+ GetAccountInput: {},
66
+ GetAccountsInput: {},
67
+ GetBranchesInput: {},
68
+ GetDocumentsFilterInput: {
69
+ additionalFilters: "JSON"
70
+ },
71
+ GetDocumentsInput: {
72
+ filter: "GetDocumentsFilterInput"
73
+ },
74
+ GetExtensionsInput: {},
75
+ GetPaymentMethodsInput: {},
76
+ GetPaymentsInput: {
77
+ status: "PaymentStatus"
78
+ },
79
+ Init: {
80
+ organization_data: "CreateOrganizationDataInput",
81
+ vars: "VarsInput"
82
+ },
83
+ Install: {
84
+ soviet: "SovietMemberInput"
85
+ },
86
+ JSON: `scalar.JSON`,
87
+ LangType: "enum",
88
+ LoginInput: {},
89
+ LogoutInput: {},
90
+ MetaDocumentInput: {},
91
+ Mutation: {
92
+ addParticipant: {
93
+ data: "AddParticipantInput"
94
+ },
95
+ addTrustedAccount: {
96
+ data: "AddTrustedAccountInput"
97
+ },
98
+ createBankAccount: {
99
+ data: "CreateBankAccountInput"
100
+ },
101
+ createBranch: {
102
+ data: "CreateBranchInput"
103
+ },
104
+ createDepositPayment: {
105
+ data: "CreateDepositPaymentInput"
106
+ },
107
+ createInitialPayment: {
108
+ data: "CreateInitialPaymentInput"
109
+ },
110
+ createProjectOfFreeDecision: {
111
+ data: "CreateProjectFreeDecisionInput"
112
+ },
113
+ deleteAccount: {
114
+ data: "DeleteAccountInput"
115
+ },
116
+ deleteBranch: {
117
+ data: "DeleteBranchInput"
118
+ },
119
+ deletePaymentMethod: {
120
+ data: "DeletePaymentMethodInput"
121
+ },
122
+ deleteTrustedAccount: {
123
+ data: "DeleteTrustedAccountInput"
124
+ },
125
+ editBranch: {
126
+ data: "EditBranchInput"
127
+ },
128
+ generateFreeDecision: {
129
+ data: "FreeDecisionGenerateDocumentInput",
130
+ options: "GenerateDocumentOptionsInput"
131
+ },
132
+ generateParticipantApplication: {
133
+ data: "ParticipantApplicationGenerateDocumentInput",
134
+ options: "GenerateDocumentOptionsInput"
135
+ },
136
+ generateParticipantApplicationDecision: {
137
+ data: "ParticipantApplicationDecisionGenerateDocumentInput",
138
+ options: "GenerateDocumentOptionsInput"
139
+ },
140
+ generatePrivacyAgreement: {
141
+ data: "GenerateDocumentInput",
142
+ options: "GenerateDocumentOptionsInput"
143
+ },
144
+ generateProjectOfFreeDecision: {
145
+ data: "ProjectFreeDecisionGenerateDocumentInput",
146
+ options: "GenerateDocumentOptionsInput"
147
+ },
148
+ generateSelectBranchDocument: {
149
+ data: "SelectBranchGenerateDocumentInput",
150
+ options: "GenerateDocumentOptionsInput"
151
+ },
152
+ generateSignatureAgreement: {
153
+ data: "GenerateDocumentInput",
154
+ options: "GenerateDocumentOptionsInput"
155
+ },
156
+ generateUserAgreement: {
157
+ data: "GenerateDocumentInput",
158
+ options: "GenerateDocumentOptionsInput"
159
+ },
160
+ generateWalletAgreement: {
161
+ data: "GenerateDocumentInput",
162
+ options: "GenerateDocumentOptionsInput"
163
+ },
164
+ initSystem: {
165
+ data: "Init"
166
+ },
167
+ installExtension: {
168
+ data: "ExtensionInput"
169
+ },
170
+ installSystem: {
171
+ data: "Install"
172
+ },
173
+ login: {
174
+ data: "LoginInput"
175
+ },
176
+ logout: {
177
+ data: "LogoutInput"
178
+ },
179
+ publishProjectOfFreeDecision: {
180
+ data: "PublishProjectFreeDecisionInput"
181
+ },
182
+ refresh: {
183
+ data: "RefreshInput"
184
+ },
185
+ registerAccount: {
186
+ data: "RegisterAccountInput"
187
+ },
188
+ registerParticipant: {
189
+ data: "RegisterParticipantInput"
190
+ },
191
+ resetKey: {
192
+ data: "ResetKeyInput"
193
+ },
194
+ selectBranch: {
195
+ data: "SelectBranchInput"
196
+ },
197
+ setPaymentStatus: {
198
+ data: "SetPaymentStatusInput"
199
+ },
200
+ setWif: {
201
+ data: "SetWifInput"
202
+ },
203
+ startResetKey: {
204
+ data: "StartResetKeyInput"
205
+ },
206
+ uninstallExtension: {
207
+ data: "UninstallExtensionInput"
208
+ },
209
+ updateAccount: {
210
+ data: "UpdateAccountInput"
211
+ },
212
+ updateBankAccount: {
213
+ data: "UpdateBankAccountInput"
214
+ },
215
+ updateExtension: {
216
+ data: "ExtensionInput"
217
+ },
218
+ updateSystem: {
219
+ data: "Update"
220
+ }
221
+ },
222
+ OrganizationDetailsInput: {},
223
+ OrganizationType: "enum",
224
+ PaginationInput: {},
225
+ ParticipantApplicationDecisionGenerateDocumentInput: {},
226
+ ParticipantApplicationGenerateDocumentInput: {},
227
+ ParticipantApplicationSignedDocumentInput: {
228
+ meta: "ParticipantApplicationSignedMetaDocumentInput"
229
+ },
230
+ ParticipantApplicationSignedMetaDocumentInput: {},
231
+ PassportInput: {},
232
+ PaymentStatus: "enum",
233
+ ProjectFreeDecisionGenerateDocumentInput: {},
234
+ ProjectFreeDecisionSignedDocumentInput: {
235
+ meta: "ProjectFreeDecisionSignedMetaDocumentInput"
236
+ },
237
+ ProjectFreeDecisionSignedMetaDocumentInput: {},
238
+ PublishProjectFreeDecisionInput: {
239
+ document: "ProjectFreeDecisionSignedDocumentInput"
240
+ },
241
+ Query: {
242
+ getAccount: {
243
+ data: "GetAccountInput"
244
+ },
245
+ getAccounts: {
246
+ data: "GetAccountsInput",
247
+ options: "PaginationInput"
248
+ },
249
+ getBranches: {
250
+ data: "GetBranchesInput"
251
+ },
252
+ getDocuments: {
253
+ data: "GetDocumentsInput"
254
+ },
255
+ getExtensions: {
256
+ data: "GetExtensionsInput"
257
+ },
258
+ getPaymentMethods: {
259
+ data: "GetPaymentMethodsInput"
260
+ },
261
+ getPayments: {
262
+ data: "GetPaymentsInput",
263
+ options: "PaginationInput"
264
+ }
265
+ },
266
+ RefreshInput: {},
267
+ RegisterAccountInput: {
268
+ entrepreneur_data: "CreateEntrepreneurDataInput",
269
+ individual_data: "CreateIndividualDataInput",
270
+ organization_data: "CreateOrganizationDataInput",
271
+ role: "RegisterRole",
272
+ type: "AccountType"
273
+ },
274
+ RegisterParticipantInput: {
275
+ privacy_agreement: "SignedDigitalDocumentInput",
276
+ signature_agreement: "SignedDigitalDocumentInput",
277
+ statement: "ParticipantApplicationSignedDocumentInput",
278
+ user_agreement: "SignedDigitalDocumentInput",
279
+ wallet_agreement: "SignedDigitalDocumentInput"
280
+ },
281
+ RegisterRole: "enum",
282
+ RepresentedByInput: {},
283
+ ResetKeyInput: {},
284
+ SelectBranchGenerateDocumentInput: {},
285
+ SelectBranchInput: {
286
+ document: "SelectBranchSignedDocumentInput"
287
+ },
288
+ SelectBranchSignedDocumentInput: {
289
+ meta: "SelectBranchSignedMetaDocumentInput"
290
+ },
291
+ SelectBranchSignedMetaDocumentInput: {},
292
+ SetPaymentStatusInput: {
293
+ status: "PaymentStatus"
294
+ },
295
+ SetWifInput: {},
296
+ SignedDigitalDocumentInput: {
297
+ meta: "MetaDocumentInput"
298
+ },
299
+ SovietMemberInput: {
300
+ individual_data: "CreateIndividualDataInput"
301
+ },
302
+ StartResetKeyInput: {},
303
+ SystemStatus: "enum",
304
+ UninstallExtensionInput: {},
305
+ Update: {
306
+ organization_data: "UpdateOrganizationDataInput",
307
+ vars: "VarsInput"
308
+ },
309
+ UpdateAccountInput: {
310
+ entrepreneur_data: "UpdateEntrepreneurDataInput",
311
+ individual_data: "UpdateIndividualDataInput",
312
+ organization_data: "UpdateOrganizationDataInput",
313
+ role: "RegisterRole",
314
+ type: "AccountType"
315
+ },
316
+ UpdateBankAccountInput: {
317
+ data: "BankAccountInput"
318
+ },
319
+ UpdateEntrepreneurDataInput: {
320
+ country: "Country",
321
+ details: "EntrepreneurDetailsInput"
322
+ },
323
+ UpdateIndividualDataInput: {
324
+ passport: "PassportInput"
325
+ },
326
+ UpdateOrganizationDataInput: {
327
+ details: "OrganizationDetailsInput",
328
+ represented_by: "RepresentedByInput",
329
+ type: "OrganizationType"
330
+ },
331
+ UserStatus: "enum",
332
+ VarsInput: {
333
+ coopenomics_agreement: "AgreementInput",
334
+ participant_application: "AgreementInput",
335
+ privacy_agreement: "AgreementInput",
336
+ signature_agreement: "AgreementInput",
337
+ user_agreement: "AgreementInput",
338
+ wallet_agreement: "AgreementInput"
339
+ }
340
+ };
341
+ const ReturnTypes = {
342
+ Account: {
343
+ blockchain_account: "BlockchainAccount",
344
+ participant_account: "ParticipantAccount",
345
+ provider_account: "MonoAccount",
346
+ user_account: "UserAccount",
347
+ username: "String"
348
+ },
349
+ AccountRamDelta: {
350
+ account: "String",
351
+ delta: "Int"
352
+ },
353
+ AccountResourceInfo: {
354
+ available: "String",
355
+ current_used: "String",
356
+ last_usage_update_time: "String",
357
+ max: "String",
358
+ used: "String"
359
+ },
360
+ AccountsPaginationResult: {
361
+ currentPage: "Int",
362
+ items: "Account",
363
+ totalCount: "Int",
364
+ totalPages: "Int"
365
+ },
366
+ ActDetail: {
367
+ action: "ExtendedBlockchainAction",
368
+ document: "GeneratedDocument"
369
+ },
370
+ ActionAuthorization: {
371
+ actor: "String",
372
+ permission: "String"
373
+ },
374
+ ActionReceipt: {
375
+ abi_sequence: "Int",
376
+ act_digest: "String",
377
+ auth_sequence: "AuthSequence",
378
+ code_sequence: "Int",
379
+ global_sequence: "String",
380
+ receiver: "String",
381
+ recv_sequence: "String"
382
+ },
383
+ AgendaWithDocuments: {
384
+ action: "BlockchainAction",
385
+ documents: "DocumentPackage",
386
+ table: "BlockchainDecision"
387
+ },
388
+ AgreementVar: {
389
+ protocol_day_month_year: "String",
390
+ protocol_number: "String"
391
+ },
392
+ AuthSequence: {
393
+ account: "String",
394
+ sequence: "String"
395
+ },
396
+ Authority: {
397
+ accounts: "PermissionLevelWeight",
398
+ keys: "KeyWeight",
399
+ threshold: "Int",
400
+ waits: "WaitWeight"
401
+ },
402
+ BankAccount: {
403
+ account_number: "String",
404
+ bank_name: "String",
405
+ card_number: "String",
406
+ currency: "String",
407
+ details: "BankAccountDetails"
408
+ },
409
+ BankAccountDetails: {
410
+ bik: "String",
411
+ corr: "String",
412
+ kpp: "String"
413
+ },
414
+ BankPaymentMethod: {
415
+ created_at: "DateTime",
416
+ data: "BankAccount",
417
+ is_default: "Boolean",
418
+ method_id: "String",
419
+ method_type: "String",
420
+ updated_at: "DateTime",
421
+ username: "String"
422
+ },
423
+ BlockchainAccount: {
424
+ account_name: "String",
425
+ core_liquid_balance: "String",
426
+ cpu_limit: "AccountResourceInfo",
427
+ cpu_weight: "String",
428
+ created: "String",
429
+ head_block_num: "Int",
430
+ head_block_time: "String",
431
+ last_code_update: "String",
432
+ net_limit: "AccountResourceInfo",
433
+ net_weight: "String",
434
+ permissions: "Permission",
435
+ privileged: "Boolean",
436
+ ram_quota: "Int",
437
+ ram_usage: "Int",
438
+ refund_request: "RefundRequest",
439
+ rex_info: "String",
440
+ self_delegated_bandwidth: "ResourceDelegationDTO",
441
+ total_resources: "ResourceOverview",
442
+ voter_info: "String"
443
+ },
444
+ BlockchainAction: {
445
+ account: "String",
446
+ account_ram_deltas: "AccountRamDelta",
447
+ action_ordinal: "Int",
448
+ authorization: "ActionAuthorization",
449
+ block_id: "String",
450
+ block_num: "Int",
451
+ chain_id: "String",
452
+ console: "String",
453
+ context_free: "Boolean",
454
+ creator_action_ordinal: "Int",
455
+ data: "JSON",
456
+ elapsed: "Int",
457
+ global_sequence: "String",
458
+ name: "String",
459
+ receipt: "ActionReceipt",
460
+ receiver: "String",
461
+ transaction_id: "String"
462
+ },
463
+ BlockchainDecision: {
464
+ approved: "Boolean",
465
+ authorization: "SignedBlockchainDocument",
466
+ authorized: "Boolean",
467
+ authorized_by: "String",
468
+ batch_id: "Float",
469
+ coopname: "String",
470
+ created_at: "String",
471
+ expired_at: "String",
472
+ id: "Float",
473
+ meta: "String",
474
+ statement: "SignedBlockchainDocument",
475
+ type: "String",
476
+ username: "String",
477
+ validated: "Boolean",
478
+ votes_against: "String",
479
+ votes_for: "String"
480
+ },
481
+ BlockchainInfoDTO: {
482
+ block_cpu_limit: "Int",
483
+ block_net_limit: "Int",
484
+ chain_id: "String",
485
+ fork_db_head_block_id: "String",
486
+ fork_db_head_block_num: "Int",
487
+ head_block_id: "String",
488
+ head_block_num: "Int",
489
+ head_block_producer: "String",
490
+ head_block_time: "String",
491
+ last_irreversible_block_id: "String",
492
+ last_irreversible_block_num: "Int",
493
+ last_irreversible_block_time: "String",
494
+ server_version: "String",
495
+ server_version_string: "String",
496
+ virtual_block_cpu_limit: "Int",
497
+ virtual_block_net_limit: "Int"
498
+ },
499
+ Branch: {
500
+ bank_account: "BankPaymentMethod",
501
+ braname: "String",
502
+ city: "String",
503
+ coopname: "String",
504
+ country: "String",
505
+ details: "OrganizationDetails",
506
+ email: "String",
507
+ fact_address: "String",
508
+ full_address: "String",
509
+ full_name: "String",
510
+ phone: "String",
511
+ represented_by: "RepresentedBy",
512
+ short_name: "String",
513
+ trusted: "Individual",
514
+ trustee: "Individual",
515
+ type: "String"
516
+ },
517
+ ContactsDTO: {
518
+ chairman: "PublicChairman",
519
+ details: "OrganizationDetails",
520
+ email: "String",
521
+ full_address: "String",
522
+ full_name: "String",
523
+ phone: "String"
524
+ },
525
+ CooperativeOperatorAccount: {
526
+ announce: "String",
527
+ coop_type: "String",
528
+ created_at: "String",
529
+ description: "String",
530
+ document: "SignedBlockchainDocument",
531
+ initial: "String",
532
+ is_branched: "Boolean",
533
+ is_cooperative: "Boolean",
534
+ is_enrolled: "Boolean",
535
+ meta: "String",
536
+ minimum: "String",
537
+ org_initial: "String",
538
+ org_minimum: "String",
539
+ org_registration: "String",
540
+ parent_username: "String",
541
+ referer: "String",
542
+ registered_at: "String",
543
+ registration: "String",
544
+ registrator: "String",
545
+ status: "String",
546
+ storages: "String",
547
+ type: "String",
548
+ username: "String",
549
+ verifications: "Verification"
550
+ },
551
+ CreatedProjectFreeDecision: {
552
+ decision: "String",
553
+ id: "String",
554
+ question: "String"
555
+ },
556
+ DateTime: `scalar.DateTime`,
557
+ DecisionDetail: {
558
+ action: "ExtendedBlockchainAction",
559
+ document: "DecisionDocumentUnion",
560
+ votes_against: "ExtendedBlockchainAction",
561
+ votes_for: "ExtendedBlockchainAction"
562
+ },
563
+ DecisionDocumentUnion: {
564
+ "...on FreeDecisionDocument": "FreeDecisionDocument",
565
+ "...on ParticipantApplicationDecisionDocument": "ParticipantApplicationDecisionDocument"
566
+ },
567
+ DocumentPackage: {
568
+ acts: "ActDetail",
569
+ decision: "DecisionDetail",
570
+ links: "GeneratedDocument",
571
+ statement: "StatementDetail"
572
+ },
573
+ DocumentsPaginationResult: {
574
+ currentPage: "Int",
575
+ items: "DocumentPackage",
576
+ totalCount: "Int",
577
+ totalPages: "Int"
578
+ },
579
+ Entrepreneur: {
580
+ birthdate: "String",
581
+ city: "String",
582
+ country: "String",
583
+ details: "EntrepreneurDetails",
584
+ email: "String",
585
+ first_name: "String",
586
+ full_address: "String",
587
+ last_name: "String",
588
+ middle_name: "String",
589
+ phone: "String",
590
+ username: "String"
591
+ },
592
+ EntrepreneurDetails: {
593
+ inn: "String",
594
+ ogrn: "String"
595
+ },
596
+ ExtendedBlockchainAction: {
597
+ account: "String",
598
+ account_ram_deltas: "AccountRamDelta",
599
+ action_ordinal: "Int",
600
+ authorization: "ActionAuthorization",
601
+ block_id: "String",
602
+ block_num: "Int",
603
+ chain_id: "String",
604
+ console: "String",
605
+ context_free: "Boolean",
606
+ creator_action_ordinal: "Int",
607
+ data: "JSON",
608
+ elapsed: "Int",
609
+ global_sequence: "String",
610
+ name: "String",
611
+ receipt: "ActionReceipt",
612
+ receiver: "String",
613
+ transaction_id: "String",
614
+ user: "UserDataUnion"
615
+ },
616
+ Extension: {
617
+ available: "Boolean",
618
+ config: "JSON",
619
+ created_at: "DateTime",
620
+ description: "String",
621
+ enabled: "Boolean",
622
+ image: "String",
623
+ installed: "Boolean",
624
+ instructions: "String",
625
+ name: "String",
626
+ readme: "String",
627
+ schema: "JSON",
628
+ tags: "String",
629
+ title: "String",
630
+ updated_at: "DateTime"
631
+ },
632
+ FreeDecisionDocument: {
633
+ binary: "String",
634
+ full_title: "String",
635
+ hash: "String",
636
+ html: "String",
637
+ meta: "FreeDecisionMetaDocumentOutput"
638
+ },
639
+ FreeDecisionMetaDocumentOutput: {
640
+ block_num: "Int",
641
+ coopname: "String",
642
+ created_at: "String",
643
+ decision_id: "Float",
644
+ generator: "String",
645
+ lang: "LangType",
646
+ links: "String",
647
+ project_id: "String",
648
+ registry_id: "Int",
649
+ timezone: "String",
650
+ title: "String",
651
+ username: "String",
652
+ version: "String"
653
+ },
654
+ GeneratedDocument: {
655
+ binary: "String",
656
+ full_title: "String",
657
+ hash: "String",
658
+ html: "String",
659
+ meta: "MetaDocument"
660
+ },
661
+ Individual: {
662
+ birthdate: "String",
663
+ email: "String",
664
+ first_name: "String",
665
+ full_address: "String",
666
+ last_name: "String",
667
+ middle_name: "String",
668
+ passport: "Passport",
669
+ phone: "String",
670
+ username: "String"
671
+ },
672
+ JSON: `scalar.JSON`,
673
+ KeyWeight: {
674
+ key: "String",
675
+ weight: "Int"
676
+ },
677
+ MetaDocument: {
678
+ block_num: "Int",
679
+ coopname: "String",
680
+ created_at: "String",
681
+ generator: "String",
682
+ lang: "LangType",
683
+ links: "String",
684
+ registry_id: "Int",
685
+ timezone: "String",
686
+ title: "String",
687
+ username: "String",
688
+ version: "String"
689
+ },
690
+ MonoAccount: {
691
+ email: "String",
692
+ has_account: "Boolean",
693
+ initial_order: "String",
694
+ is_email_verified: "Boolean",
695
+ is_registered: "Boolean",
696
+ message: "String",
697
+ public_key: "String",
698
+ referer: "String",
699
+ role: "String",
700
+ status: "UserStatus",
701
+ type: "String",
702
+ username: "String"
703
+ },
704
+ Mutation: {
705
+ addParticipant: "Account",
706
+ addTrustedAccount: "Branch",
707
+ createBankAccount: "PaymentMethod",
708
+ createBranch: "Branch",
709
+ createDepositPayment: "Payment",
710
+ createInitialPayment: "Payment",
711
+ createProjectOfFreeDecision: "CreatedProjectFreeDecision",
712
+ deleteAccount: "Boolean",
713
+ deleteBranch: "Boolean",
714
+ deletePaymentMethod: "Boolean",
715
+ deleteTrustedAccount: "Branch",
716
+ editBranch: "Branch",
717
+ generateFreeDecision: "ProjectFreeDecisionDocument",
718
+ generateParticipantApplication: "ParticipantApplicationDocument",
719
+ generateParticipantApplicationDecision: "ParticipantApplicationDecisionDocument",
720
+ generatePrivacyAgreement: "GeneratedDocument",
721
+ generateProjectOfFreeDecision: "ProjectFreeDecisionDocument",
722
+ generateSelectBranchDocument: "SelectBranchDocument",
723
+ generateSignatureAgreement: "GeneratedDocument",
724
+ generateUserAgreement: "GeneratedDocument",
725
+ generateWalletAgreement: "GeneratedDocument",
726
+ initSystem: "SystemInfo",
727
+ installExtension: "Extension",
728
+ installSystem: "SystemInfo",
729
+ login: "RegisteredAccount",
730
+ logout: "Boolean",
731
+ publishProjectOfFreeDecision: "Boolean",
732
+ refresh: "RegisteredAccount",
733
+ registerAccount: "RegisteredAccount",
734
+ registerParticipant: "Account",
735
+ resetKey: "Boolean",
736
+ selectBranch: "Boolean",
737
+ setPaymentStatus: "Payment",
738
+ setWif: "Boolean",
739
+ startResetKey: "Boolean",
740
+ uninstallExtension: "Boolean",
741
+ updateAccount: "Account",
742
+ updateBankAccount: "PaymentMethod",
743
+ updateExtension: "Extension",
744
+ updateSystem: "SystemInfo"
745
+ },
746
+ Organization: {
747
+ city: "String",
748
+ country: "String",
749
+ details: "OrganizationDetails",
750
+ email: "String",
751
+ fact_address: "String",
752
+ full_address: "String",
753
+ full_name: "String",
754
+ phone: "String",
755
+ represented_by: "RepresentedBy",
756
+ short_name: "String",
757
+ type: "String",
758
+ username: "String"
759
+ },
760
+ OrganizationDetails: {
761
+ inn: "String",
762
+ kpp: "String",
763
+ ogrn: "String"
764
+ },
765
+ ParticipantAccount: {
766
+ braname: "String",
767
+ created_at: "DateTime",
768
+ has_vote: "Boolean",
769
+ is_initial: "Boolean",
770
+ is_minimum: "Boolean",
771
+ last_min_pay: "DateTime",
772
+ last_update: "DateTime",
773
+ status: "String",
774
+ type: "String",
775
+ username: "String"
776
+ },
777
+ ParticipantApplicationDecisionDocument: {
778
+ binary: "String",
779
+ full_title: "String",
780
+ hash: "String",
781
+ html: "String",
782
+ meta: "ParticipantApplicationDecisionMetaDocumentOutput"
783
+ },
784
+ ParticipantApplicationDecisionMetaDocumentOutput: {
785
+ block_num: "Int",
786
+ coopname: "String",
787
+ created_at: "String",
788
+ decision_id: "Float",
789
+ generator: "String",
790
+ lang: "LangType",
791
+ links: "String",
792
+ registry_id: "Int",
793
+ timezone: "String",
794
+ title: "String",
795
+ username: "String",
796
+ version: "String"
797
+ },
798
+ ParticipantApplicationDocument: {
799
+ binary: "String",
800
+ full_title: "String",
801
+ hash: "String",
802
+ html: "String",
803
+ meta: "ParticipantApplicationMetaDocumentOutput"
804
+ },
805
+ ParticipantApplicationMetaDocumentOutput: {
806
+ block_num: "Int",
807
+ coopname: "String",
808
+ created_at: "String",
809
+ generator: "String",
810
+ lang: "LangType",
811
+ links: "String",
812
+ registry_id: "Int",
813
+ timezone: "String",
814
+ title: "String",
815
+ username: "String",
816
+ version: "String"
817
+ },
818
+ Passport: {
819
+ code: "String",
820
+ issued_at: "String",
821
+ issued_by: "String",
822
+ number: "Int",
823
+ series: "Int"
824
+ },
825
+ Payment: {
826
+ amount: "Float",
827
+ blockchain_id: "Float",
828
+ created_at: "DateTime",
829
+ details: "PaymentDetails",
830
+ expired_at: "DateTime",
831
+ id: "String",
832
+ message: "String",
833
+ provider: "String",
834
+ status: "PaymentStatus",
835
+ symbol: "String",
836
+ updated_at: "DateTime",
837
+ username: "String"
838
+ },
839
+ PaymentDetails: {
840
+ amount_plus_fee: "String",
841
+ amount_without_fee: "String",
842
+ data: "String",
843
+ fact_fee_percent: "Float",
844
+ fee_amount: "String",
845
+ fee_percent: "Float",
846
+ tolerance_percent: "Float"
847
+ },
848
+ PaymentMethod: {
849
+ created_at: "DateTime",
850
+ data: "PaymentMethodData",
851
+ is_default: "Boolean",
852
+ method_id: "String",
853
+ method_type: "String",
854
+ updated_at: "DateTime",
855
+ username: "String"
856
+ },
857
+ PaymentMethodData: {
858
+ "...on BankAccount": "BankAccount",
859
+ "...on SbpAccount": "SbpAccount"
860
+ },
861
+ PaymentMethodPaginationResult: {
862
+ currentPage: "Int",
863
+ items: "PaymentMethod",
864
+ totalCount: "Int",
865
+ totalPages: "Int"
866
+ },
867
+ PaymentPaginationResult: {
868
+ currentPage: "Int",
869
+ items: "Payment",
870
+ totalCount: "Int",
871
+ totalPages: "Int"
872
+ },
873
+ Permission: {
874
+ parent: "String",
875
+ perm_name: "String",
876
+ required_auth: "Authority"
877
+ },
878
+ PermissionLevel: {
879
+ actor: "String",
880
+ permission: "String"
881
+ },
882
+ PermissionLevelWeight: {
883
+ permission: "PermissionLevel",
884
+ weight: "Int"
885
+ },
886
+ ProjectFreeDecisionDocument: {
887
+ binary: "String",
888
+ full_title: "String",
889
+ hash: "String",
890
+ html: "String",
891
+ meta: "ProjectFreeDecisionMetaDocumentOutput"
892
+ },
893
+ ProjectFreeDecisionMetaDocumentOutput: {
894
+ block_num: "Int",
895
+ coopname: "String",
896
+ created_at: "String",
897
+ generator: "String",
898
+ lang: "LangType",
899
+ links: "String",
900
+ project_id: "String",
901
+ registry_id: "Int",
902
+ timezone: "String",
903
+ title: "String",
904
+ username: "String",
905
+ version: "String"
906
+ },
907
+ PublicChairman: {
908
+ first_name: "String",
909
+ last_name: "String",
910
+ middle_name: "String"
911
+ },
912
+ Query: {
913
+ getAccount: "Account",
914
+ getAccounts: "AccountsPaginationResult",
915
+ getAgenda: "AgendaWithDocuments",
916
+ getBranches: "Branch",
917
+ getDocuments: "DocumentsPaginationResult",
918
+ getExtensions: "Extension",
919
+ getPaymentMethods: "PaymentMethodPaginationResult",
920
+ getPayments: "PaymentPaginationResult",
921
+ getSystemInfo: "SystemInfo"
922
+ },
923
+ RefundRequest: {
924
+ cpu_amount: "String",
925
+ net_amount: "String",
926
+ owner: "String",
927
+ request_time: "String"
928
+ },
929
+ RegisteredAccount: {
930
+ account: "Account",
931
+ tokens: "Tokens"
932
+ },
933
+ RepresentedBy: {
934
+ based_on: "String",
935
+ first_name: "String",
936
+ last_name: "String",
937
+ middle_name: "String",
938
+ position: "String"
939
+ },
940
+ ResourceDelegationDTO: {
941
+ cpu_weight: "String",
942
+ from: "String",
943
+ net_weight: "String",
944
+ to: "String"
945
+ },
946
+ ResourceOverview: {
947
+ cpu_weight: "String",
948
+ net_weight: "String",
949
+ owner: "String",
950
+ ram_bytes: "Int"
951
+ },
952
+ SbpAccount: {
953
+ phone: "String"
954
+ },
955
+ SelectBranchDocument: {
956
+ binary: "String",
957
+ full_title: "String",
958
+ hash: "String",
959
+ html: "String",
960
+ meta: "SelectBranchMetaDocumentOutput"
961
+ },
962
+ SelectBranchMetaDocumentOutput: {
963
+ block_num: "Int",
964
+ braname: "String",
965
+ coopname: "String",
966
+ created_at: "String",
967
+ generator: "String",
968
+ lang: "LangType",
969
+ links: "String",
970
+ registry_id: "Int",
971
+ timezone: "String",
972
+ title: "String",
973
+ username: "String",
974
+ version: "String"
975
+ },
976
+ SignedBlockchainDocument: {
977
+ hash: "String",
978
+ meta: "String",
979
+ public_key: "String",
980
+ signature: "String"
981
+ },
982
+ StatementDetail: {
983
+ action: "ExtendedBlockchainAction",
984
+ document: "StatementDocumentUnion"
985
+ },
986
+ StatementDocumentUnion: {
987
+ "...on ParticipantApplicationDocument": "ParticipantApplicationDocument",
988
+ "...on ProjectFreeDecisionDocument": "ProjectFreeDecisionDocument"
989
+ },
990
+ SystemInfo: {
991
+ blockchain_account: "BlockchainAccount",
992
+ blockchain_info: "BlockchainInfoDTO",
993
+ contacts: "ContactsDTO",
994
+ cooperator_account: "CooperativeOperatorAccount",
995
+ coopname: "String",
996
+ system_status: "SystemStatus",
997
+ vars: "Vars"
998
+ },
999
+ Token: {
1000
+ expires: "DateTime",
1001
+ token: "String"
1002
+ },
1003
+ Tokens: {
1004
+ access: "Token",
1005
+ refresh: "Token"
1006
+ },
1007
+ UserAccount: {
1008
+ meta: "String",
1009
+ referer: "String",
1010
+ registered_at: "String",
1011
+ registrator: "String",
1012
+ status: "String",
1013
+ storages: "String",
1014
+ type: "String",
1015
+ username: "String",
1016
+ verifications: "Verification"
1017
+ },
1018
+ UserDataUnion: {
1019
+ "...on Entrepreneur": "Entrepreneur",
1020
+ "...on Individual": "Individual",
1021
+ "...on Organization": "Organization"
1022
+ },
1023
+ Vars: {
1024
+ confidential_email: "String",
1025
+ confidential_link: "String",
1026
+ contact_email: "String",
1027
+ coopenomics_agreement: "AgreementVar",
1028
+ coopname: "String",
1029
+ full_abbr: "String",
1030
+ full_abbr_dative: "String",
1031
+ full_abbr_genitive: "String",
1032
+ name: "String",
1033
+ participant_application: "AgreementVar",
1034
+ passport_request: "String",
1035
+ privacy_agreement: "AgreementVar",
1036
+ short_abbr: "String",
1037
+ signature_agreement: "AgreementVar",
1038
+ user_agreement: "AgreementVar",
1039
+ wallet_agreement: "AgreementVar",
1040
+ website: "String"
1041
+ },
1042
+ Verification: {
1043
+ created_at: "String",
1044
+ is_verified: "Boolean",
1045
+ last_update: "String",
1046
+ notice: "String",
1047
+ procedure: "String",
1048
+ verificator: "String"
1049
+ },
1050
+ WaitWeight: {
1051
+ wait_sec: "Int",
1052
+ weight: "Int"
1053
+ }
1054
+ };
1055
+ const Ops = {
1056
+ query: "Query",
1057
+ mutation: "Mutation"
1058
+ };
1059
+
1060
+ const HOST = "Specify host";
1061
+ const HEADERS = {};
1062
+ const apiSubscription = (options) => {
1063
+ const client = graphqlWs.createClient({
1064
+ url: String(options[0]),
1065
+ connectionParams: Object.fromEntries(new Headers(options[1]?.headers).entries())
1066
+ });
1067
+ const ws = new Proxy(
1068
+ {
1069
+ close: () => client.dispose()
1070
+ },
1071
+ {
1072
+ get(target, key) {
1073
+ if (key === "close")
1074
+ return target.close;
1075
+ throw new Error(`Unimplemented property '${String(key)}', only 'close()' is available.`);
1076
+ }
1077
+ }
1078
+ );
1079
+ return (query) => {
1080
+ let onMessage;
1081
+ let onError;
1082
+ let onClose;
1083
+ client.subscribe(
1084
+ { query },
1085
+ {
1086
+ next({ data }) {
1087
+ onMessage && onMessage(data);
1088
+ },
1089
+ error(error) {
1090
+ onError && onError(error);
1091
+ },
1092
+ complete() {
1093
+ onClose && onClose();
1094
+ }
1095
+ }
1096
+ );
1097
+ return {
1098
+ ws,
1099
+ on(listener) {
1100
+ onMessage = listener;
1101
+ },
1102
+ error(listener) {
1103
+ onError = listener;
1104
+ },
1105
+ open(listener) {
1106
+ client.on("opened", listener);
1107
+ },
1108
+ off(listener) {
1109
+ onClose = listener;
1110
+ }
1111
+ };
1112
+ };
1113
+ };
1114
+ const handleFetchResponse = (response) => {
1115
+ if (!response.ok) {
1116
+ return new Promise((_, reject) => {
1117
+ response.text().then((text) => {
1118
+ try {
1119
+ reject(JSON.parse(text));
1120
+ } catch (err) {
1121
+ reject(text);
1122
+ }
1123
+ }).catch(reject);
1124
+ });
1125
+ }
1126
+ return response.json();
1127
+ };
1128
+ const apiFetch = (options) => (query, variables = {}) => {
1129
+ const fetchOptions = options[1] || {};
1130
+ if (fetchOptions.method && fetchOptions.method === "GET") {
1131
+ return fetch(`${options[0]}?query=${encodeURIComponent(query)}`, fetchOptions).then(handleFetchResponse).then((response) => {
1132
+ if (response.errors) {
1133
+ throw new GraphQLError(response);
1134
+ }
1135
+ return response.data;
1136
+ });
1137
+ }
1138
+ return fetch(`${options[0]}`, {
1139
+ body: JSON.stringify({ query, variables }),
1140
+ method: "POST",
1141
+ headers: {
1142
+ "Content-Type": "application/json"
1143
+ },
1144
+ ...fetchOptions
1145
+ }).then(handleFetchResponse).then((response) => {
1146
+ if (response.errors) {
1147
+ throw new GraphQLError(response);
1148
+ }
1149
+ return response.data;
1150
+ });
1151
+ };
1152
+ const InternalsBuildQuery = ({
1153
+ ops,
1154
+ props,
1155
+ returns,
1156
+ options,
1157
+ scalars
1158
+ }) => {
1159
+ const ibb = (k, o, p = "", root = true, vars = []) => {
1160
+ const keyForPath = purifyGraphQLKey(k);
1161
+ const newPath = [p, keyForPath].join(SEPARATOR);
1162
+ if (!o) {
1163
+ return "";
1164
+ }
1165
+ if (typeof o === "boolean" || typeof o === "number") {
1166
+ return k;
1167
+ }
1168
+ if (typeof o === "string") {
1169
+ return `${k} ${o}`;
1170
+ }
1171
+ if (Array.isArray(o)) {
1172
+ const args = InternalArgsBuilt({
1173
+ props,
1174
+ returns,
1175
+ ops,
1176
+ scalars,
1177
+ vars
1178
+ })(o[0], newPath);
1179
+ return `${ibb(args ? `${k}(${args})` : k, o[1], p, false, vars)}`;
1180
+ }
1181
+ if (k === "__alias") {
1182
+ return Object.entries(o).map(([alias, objectUnderAlias]) => {
1183
+ if (typeof objectUnderAlias !== "object" || Array.isArray(objectUnderAlias)) {
1184
+ throw new Error(
1185
+ "Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}"
1186
+ );
1187
+ }
1188
+ const operationName = Object.keys(objectUnderAlias)[0];
1189
+ const operation = objectUnderAlias[operationName];
1190
+ return ibb(`${alias}:${operationName}`, operation, p, false, vars);
1191
+ }).join("\n");
1192
+ }
1193
+ const hasOperationName = root && options?.operationName ? " " + options.operationName : "";
1194
+ const keyForDirectives = o.__directives ?? "";
1195
+ const query = `{${Object.entries(o).filter(([k2]) => k2 !== "__directives").map((e) => ibb(...e, [p, `field<>${keyForPath}`].join(SEPARATOR), false, vars)).join("\n")}}`;
1196
+ if (!root) {
1197
+ return `${k} ${keyForDirectives}${hasOperationName} ${query}`;
1198
+ }
1199
+ const varsString = vars.map((v) => `${v.name}: ${v.graphQLType}`).join(", ");
1200
+ return `${k} ${keyForDirectives}${hasOperationName}${varsString ? `(${varsString})` : ""} ${query}`;
1201
+ };
1202
+ return ibb;
1203
+ };
1204
+ const Thunder = (fn, thunderGraphQLOptions) => (operation, graphqlOptions) => (o, ops) => {
1205
+ const options = {
1206
+ ...thunderGraphQLOptions,
1207
+ ...graphqlOptions
1208
+ };
1209
+ return fn(
1210
+ Zeus(operation, o, {
1211
+ operationOptions: ops,
1212
+ scalars: options?.scalars
1213
+ }),
1214
+ ops?.variables
1215
+ ).then((data) => {
1216
+ if (options?.scalars) {
1217
+ return decodeScalarsInResponse({
1218
+ response: data,
1219
+ initialOp: operation,
1220
+ initialZeusQuery: o,
1221
+ returns: ReturnTypes,
1222
+ scalars: options.scalars,
1223
+ ops: Ops
1224
+ });
1225
+ }
1226
+ return data;
1227
+ });
1228
+ };
1229
+ const Chain = (...options) => Thunder(apiFetch(options));
1230
+ const SubscriptionThunder = (fn, thunderGraphQLOptions) => (operation, graphqlOptions) => (o, ops) => {
1231
+ const options = {
1232
+ ...thunderGraphQLOptions,
1233
+ ...graphqlOptions
1234
+ };
1235
+ const returnedFunction = fn(
1236
+ Zeus(operation, o, {
1237
+ operationOptions: ops,
1238
+ scalars: options?.scalars
1239
+ })
1240
+ );
1241
+ if (returnedFunction?.on && options?.scalars) {
1242
+ const wrapped = returnedFunction.on;
1243
+ returnedFunction.on = (fnToCall) => wrapped((data) => {
1244
+ if (options?.scalars) {
1245
+ return fnToCall(
1246
+ decodeScalarsInResponse({
1247
+ response: data,
1248
+ initialOp: operation,
1249
+ initialZeusQuery: o,
1250
+ returns: ReturnTypes,
1251
+ scalars: options.scalars,
1252
+ ops: Ops
1253
+ })
1254
+ );
1255
+ }
1256
+ return fnToCall(data);
1257
+ });
1258
+ }
1259
+ return returnedFunction;
1260
+ };
1261
+ const Subscription = (...options) => SubscriptionThunder(apiSubscription(options));
1262
+ const Zeus = (operation, o, ops) => InternalsBuildQuery({
1263
+ props: AllTypesProps,
1264
+ returns: ReturnTypes,
1265
+ ops: Ops,
1266
+ options: ops?.operationOptions,
1267
+ scalars: ops?.scalars
1268
+ })(operation, o);
1269
+ const ZeusSelect = () => (t) => t;
1270
+ const Selector = (key) => key && ZeusSelect();
1271
+ const TypeFromSelector = (key) => key && ZeusSelect();
1272
+ const Gql = Chain(HOST, {
1273
+ headers: {
1274
+ "Content-Type": "application/json",
1275
+ ...HEADERS
1276
+ }
1277
+ });
1278
+ const ZeusScalars = ZeusSelect();
1279
+ const fields = (k) => {
1280
+ const t = ReturnTypes[k];
1281
+ const o = Object.fromEntries(
1282
+ Object.entries(t).filter(([, value]) => {
1283
+ const isReturnType = ReturnTypes[value];
1284
+ if (!isReturnType || typeof isReturnType === "string" && isReturnType.startsWith("scalar.")) {
1285
+ return true;
1286
+ }
1287
+ }).map(([key]) => [key, true])
1288
+ );
1289
+ return o;
1290
+ };
1291
+ const decodeScalarsInResponse = ({
1292
+ response,
1293
+ scalars,
1294
+ returns,
1295
+ ops,
1296
+ initialZeusQuery,
1297
+ initialOp
1298
+ }) => {
1299
+ if (!scalars) {
1300
+ return response;
1301
+ }
1302
+ const builder = PrepareScalarPaths({
1303
+ ops,
1304
+ returns
1305
+ });
1306
+ const scalarPaths = builder(initialOp, ops[initialOp], initialZeusQuery);
1307
+ if (scalarPaths) {
1308
+ const r = traverseResponse({ scalarPaths, resolvers: scalars })(initialOp, response, [ops[initialOp]]);
1309
+ return r;
1310
+ }
1311
+ return response;
1312
+ };
1313
+ const traverseResponse = ({
1314
+ resolvers,
1315
+ scalarPaths
1316
+ }) => {
1317
+ const ibb = (k, o, p = []) => {
1318
+ if (Array.isArray(o)) {
1319
+ return o.map((eachO) => ibb(k, eachO, p));
1320
+ }
1321
+ if (o == null) {
1322
+ return o;
1323
+ }
1324
+ const scalarPathString = p.join(SEPARATOR);
1325
+ const currentScalarString = scalarPaths[scalarPathString];
1326
+ if (currentScalarString) {
1327
+ const currentDecoder = resolvers[currentScalarString.split(".")[1]]?.decode;
1328
+ if (currentDecoder) {
1329
+ return currentDecoder(o);
1330
+ }
1331
+ }
1332
+ if (typeof o === "boolean" || typeof o === "number" || typeof o === "string" || !o) {
1333
+ return o;
1334
+ }
1335
+ const entries = Object.entries(o).map(([k2, v]) => [k2, ibb(k2, v, [...p, purifyGraphQLKey(k2)])]);
1336
+ const objectFromEntries = entries.reduce((a, [k2, v]) => {
1337
+ a[k2] = v;
1338
+ return a;
1339
+ }, {});
1340
+ return objectFromEntries;
1341
+ };
1342
+ return ibb;
1343
+ };
1344
+ const SEPARATOR = "|";
1345
+ class GraphQLError extends Error {
1346
+ constructor(response) {
1347
+ super("");
1348
+ this.response = response;
1349
+ console.error(response);
1350
+ }
1351
+ toString() {
1352
+ return "GraphQL Response Error";
1353
+ }
1354
+ }
1355
+ const ExtractScalar = (mappedParts, returns) => {
1356
+ if (mappedParts.length === 0) {
1357
+ return;
1358
+ }
1359
+ const oKey = mappedParts[0];
1360
+ const returnP1 = returns[oKey];
1361
+ if (typeof returnP1 === "object") {
1362
+ const returnP2 = returnP1[mappedParts[1]];
1363
+ if (returnP2) {
1364
+ return ExtractScalar([returnP2, ...mappedParts.slice(2)], returns);
1365
+ }
1366
+ return void 0;
1367
+ }
1368
+ return returnP1;
1369
+ };
1370
+ const PrepareScalarPaths = ({ ops, returns }) => {
1371
+ const ibb = (k, originalKey, o, p = [], pOriginals = [], root = true) => {
1372
+ if (!o) {
1373
+ return;
1374
+ }
1375
+ if (typeof o === "boolean" || typeof o === "number" || typeof o === "string") {
1376
+ const extractionArray = [...pOriginals, originalKey];
1377
+ const isScalar = ExtractScalar(extractionArray, returns);
1378
+ if (isScalar?.startsWith("scalar")) {
1379
+ const partOfTree = {
1380
+ [[...p, k].join(SEPARATOR)]: isScalar
1381
+ };
1382
+ return partOfTree;
1383
+ }
1384
+ return {};
1385
+ }
1386
+ if (Array.isArray(o)) {
1387
+ return ibb(k, k, o[1], p, pOriginals, false);
1388
+ }
1389
+ if (k === "__alias") {
1390
+ return Object.entries(o).map(([alias, objectUnderAlias]) => {
1391
+ if (typeof objectUnderAlias !== "object" || Array.isArray(objectUnderAlias)) {
1392
+ throw new Error(
1393
+ "Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}"
1394
+ );
1395
+ }
1396
+ const operationName = Object.keys(objectUnderAlias)[0];
1397
+ const operation = objectUnderAlias[operationName];
1398
+ return ibb(alias, operationName, operation, p, pOriginals, false);
1399
+ }).reduce((a, b) => ({
1400
+ ...a,
1401
+ ...b
1402
+ }));
1403
+ }
1404
+ const keyName = root ? ops[k] : k;
1405
+ return Object.entries(o).filter(([k2]) => k2 !== "__directives").map(([k2, v]) => {
1406
+ const isInlineFragment = originalKey.match(/^...\s*on/) != null;
1407
+ return ibb(
1408
+ k2,
1409
+ k2,
1410
+ v,
1411
+ isInlineFragment ? p : [...p, purifyGraphQLKey(keyName || k2)],
1412
+ isInlineFragment ? pOriginals : [...pOriginals, purifyGraphQLKey(originalKey)],
1413
+ false
1414
+ );
1415
+ }).reduce((a, b) => ({
1416
+ ...a,
1417
+ ...b
1418
+ }));
1419
+ };
1420
+ return ibb;
1421
+ };
1422
+ const purifyGraphQLKey = (k) => k.replace(/\([^)]*\)/g, "").replace(/^[^:]*\:/g, "");
1423
+ const mapPart = (p) => {
1424
+ const [isArg, isField] = p.split("<>");
1425
+ if (isField) {
1426
+ return {
1427
+ v: isField,
1428
+ __type: "field"
1429
+ };
1430
+ }
1431
+ return {
1432
+ v: isArg,
1433
+ __type: "arg"
1434
+ };
1435
+ };
1436
+ const ResolveFromPath = (props, returns, ops) => {
1437
+ const ResolvePropsType = (mappedParts) => {
1438
+ const oKey = ops[mappedParts[0].v];
1439
+ const propsP1 = oKey ? props[oKey] : props[mappedParts[0].v];
1440
+ if (propsP1 === "enum" && mappedParts.length === 1) {
1441
+ return "enum";
1442
+ }
1443
+ if (typeof propsP1 === "string" && propsP1.startsWith("scalar.") && mappedParts.length === 1) {
1444
+ return propsP1;
1445
+ }
1446
+ if (typeof propsP1 === "object") {
1447
+ if (mappedParts.length < 2) {
1448
+ return "not";
1449
+ }
1450
+ const propsP2 = propsP1[mappedParts[1].v];
1451
+ if (typeof propsP2 === "string") {
1452
+ return rpp(
1453
+ `${propsP2}${SEPARATOR}${mappedParts.slice(2).map((mp) => mp.v).join(SEPARATOR)}`
1454
+ );
1455
+ }
1456
+ if (typeof propsP2 === "object") {
1457
+ if (mappedParts.length < 3) {
1458
+ return "not";
1459
+ }
1460
+ const propsP3 = propsP2[mappedParts[2].v];
1461
+ if (propsP3 && mappedParts[2].__type === "arg") {
1462
+ return rpp(
1463
+ `${propsP3}${SEPARATOR}${mappedParts.slice(3).map((mp) => mp.v).join(SEPARATOR)}`
1464
+ );
1465
+ }
1466
+ }
1467
+ }
1468
+ };
1469
+ const ResolveReturnType = (mappedParts) => {
1470
+ if (mappedParts.length === 0) {
1471
+ return "not";
1472
+ }
1473
+ const oKey = ops[mappedParts[0].v];
1474
+ const returnP1 = oKey ? returns[oKey] : returns[mappedParts[0].v];
1475
+ if (typeof returnP1 === "object") {
1476
+ if (mappedParts.length < 2)
1477
+ return "not";
1478
+ const returnP2 = returnP1[mappedParts[1].v];
1479
+ if (returnP2) {
1480
+ return rpp(
1481
+ `${returnP2}${SEPARATOR}${mappedParts.slice(2).map((mp) => mp.v).join(SEPARATOR)}`
1482
+ );
1483
+ }
1484
+ }
1485
+ };
1486
+ const rpp = (path) => {
1487
+ const parts = path.split(SEPARATOR).filter((l) => l.length > 0);
1488
+ const mappedParts = parts.map(mapPart);
1489
+ const propsP1 = ResolvePropsType(mappedParts);
1490
+ if (propsP1) {
1491
+ return propsP1;
1492
+ }
1493
+ const returnP1 = ResolveReturnType(mappedParts);
1494
+ if (returnP1) {
1495
+ return returnP1;
1496
+ }
1497
+ return "not";
1498
+ };
1499
+ return rpp;
1500
+ };
1501
+ const InternalArgsBuilt = ({
1502
+ props,
1503
+ ops,
1504
+ returns,
1505
+ scalars,
1506
+ vars
1507
+ }) => {
1508
+ const arb = (a, p = "", root = true) => {
1509
+ if (typeof a === "string") {
1510
+ if (a.startsWith(START_VAR_NAME)) {
1511
+ const [varName, graphQLType] = a.replace(START_VAR_NAME, "$").split(GRAPHQL_TYPE_SEPARATOR);
1512
+ const v = vars.find((v2) => v2.name === varName);
1513
+ if (!v) {
1514
+ vars.push({
1515
+ name: varName,
1516
+ graphQLType
1517
+ });
1518
+ } else {
1519
+ if (v.graphQLType !== graphQLType) {
1520
+ throw new Error(
1521
+ `Invalid variable exists with two different GraphQL Types, "${v.graphQLType}" and ${graphQLType}`
1522
+ );
1523
+ }
1524
+ }
1525
+ return varName;
1526
+ }
1527
+ }
1528
+ const checkType = ResolveFromPath(props, returns, ops)(p);
1529
+ if (checkType.startsWith("scalar.")) {
1530
+ const [_, ...splittedScalar] = checkType.split(".");
1531
+ const scalarKey = splittedScalar.join(".");
1532
+ return scalars?.[scalarKey]?.encode?.(a) || JSON.stringify(a);
1533
+ }
1534
+ if (Array.isArray(a)) {
1535
+ return `[${a.map((arr) => arb(arr, p, false)).join(", ")}]`;
1536
+ }
1537
+ if (typeof a === "string") {
1538
+ if (checkType === "enum") {
1539
+ return a;
1540
+ }
1541
+ return `${JSON.stringify(a)}`;
1542
+ }
1543
+ if (typeof a === "object") {
1544
+ if (a === null) {
1545
+ return `null`;
1546
+ }
1547
+ const returnedObjectString = Object.entries(a).filter(([, v]) => typeof v !== "undefined").map(([k, v]) => `${k}: ${arb(v, [p, k].join(SEPARATOR), false)}`).join(",\n");
1548
+ if (!root) {
1549
+ return `{${returnedObjectString}}`;
1550
+ }
1551
+ return returnedObjectString;
1552
+ }
1553
+ return `${a}`;
1554
+ };
1555
+ return arb;
1556
+ };
1557
+ const resolverFor = (type, field, fn) => fn;
1558
+ const START_VAR_NAME = `$ZEUS_VAR`;
1559
+ const GRAPHQL_TYPE_SEPARATOR = `__$GRAPHQL__`;
1560
+ const $ = (name, graphqlType) => {
1561
+ return START_VAR_NAME + name + GRAPHQL_TYPE_SEPARATOR + graphqlType;
1562
+ };
1563
+ var AccountType = /* @__PURE__ */ ((AccountType2) => {
1564
+ AccountType2["Entrepreneur"] = "Entrepreneur";
1565
+ AccountType2["Individual"] = "Individual";
1566
+ AccountType2["Organization"] = "Organization";
1567
+ return AccountType2;
1568
+ })(AccountType || {});
1569
+ var Country = /* @__PURE__ */ ((Country2) => {
1570
+ Country2["Russia"] = "Russia";
1571
+ return Country2;
1572
+ })(Country || {});
1573
+ var LangType = /* @__PURE__ */ ((LangType2) => {
1574
+ LangType2["ru"] = "ru";
1575
+ return LangType2;
1576
+ })(LangType || {});
1577
+ var OrganizationType = /* @__PURE__ */ ((OrganizationType2) => {
1578
+ OrganizationType2["AO"] = "AO";
1579
+ OrganizationType2["COOP"] = "COOP";
1580
+ OrganizationType2["OAO"] = "OAO";
1581
+ OrganizationType2["OOO"] = "OOO";
1582
+ OrganizationType2["PAO"] = "PAO";
1583
+ OrganizationType2["ZAO"] = "ZAO";
1584
+ return OrganizationType2;
1585
+ })(OrganizationType || {});
1586
+ var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
1587
+ PaymentStatus2["COMPLETED"] = "COMPLETED";
1588
+ PaymentStatus2["EXPIRED"] = "EXPIRED";
1589
+ PaymentStatus2["FAILED"] = "FAILED";
1590
+ PaymentStatus2["PAID"] = "PAID";
1591
+ PaymentStatus2["PENDING"] = "PENDING";
1592
+ PaymentStatus2["REFUNDED"] = "REFUNDED";
1593
+ return PaymentStatus2;
1594
+ })(PaymentStatus || {});
1595
+ var RegisterRole = /* @__PURE__ */ ((RegisterRole2) => {
1596
+ RegisterRole2["User"] = "User";
1597
+ return RegisterRole2;
1598
+ })(RegisterRole || {});
1599
+ var SystemStatus = /* @__PURE__ */ ((SystemStatus2) => {
1600
+ SystemStatus2["active"] = "active";
1601
+ SystemStatus2["install"] = "install";
1602
+ SystemStatus2["maintenance"] = "maintenance";
1603
+ return SystemStatus2;
1604
+ })(SystemStatus || {});
1605
+ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
1606
+ UserStatus2["Active"] = "Active";
1607
+ UserStatus2["Blocked"] = "Blocked";
1608
+ UserStatus2["Created"] = "Created";
1609
+ UserStatus2["Failed"] = "Failed";
1610
+ UserStatus2["Joined"] = "Joined";
1611
+ UserStatus2["Payed"] = "Payed";
1612
+ UserStatus2["Refunded"] = "Refunded";
1613
+ UserStatus2["Registered"] = "Registered";
1614
+ return UserStatus2;
1615
+ })(UserStatus || {});
1616
+
1617
+ const index$l = {
1618
+ __proto__: null,
1619
+ $: $,
1620
+ AccountType: AccountType,
1621
+ Chain: Chain,
1622
+ Country: Country,
1623
+ GRAPHQL_TYPE_SEPARATOR: GRAPHQL_TYPE_SEPARATOR,
1624
+ Gql: Gql,
1625
+ GraphQLError: GraphQLError,
1626
+ HEADERS: HEADERS,
1627
+ HOST: HOST,
1628
+ InternalArgsBuilt: InternalArgsBuilt,
1629
+ InternalsBuildQuery: InternalsBuildQuery,
1630
+ LangType: LangType,
1631
+ OrganizationType: OrganizationType,
1632
+ PaymentStatus: PaymentStatus,
1633
+ PrepareScalarPaths: PrepareScalarPaths,
1634
+ RegisterRole: RegisterRole,
1635
+ ResolveFromPath: ResolveFromPath,
1636
+ SEPARATOR: SEPARATOR,
1637
+ START_VAR_NAME: START_VAR_NAME,
1638
+ Selector: Selector,
1639
+ Subscription: Subscription,
1640
+ SubscriptionThunder: SubscriptionThunder,
1641
+ SystemStatus: SystemStatus,
1642
+ Thunder: Thunder,
1643
+ TypeFromSelector: TypeFromSelector,
1644
+ UserStatus: UserStatus,
1645
+ Zeus: Zeus,
1646
+ ZeusScalars: ZeusScalars,
1647
+ ZeusSelect: ZeusSelect,
1648
+ apiFetch: apiFetch,
1649
+ apiSubscription: apiSubscription,
1650
+ decodeScalarsInResponse: decodeScalarsInResponse,
1651
+ fields: fields,
1652
+ purifyGraphQLKey: purifyGraphQLKey,
1653
+ resolverFor: resolverFor,
1654
+ traverseResponse: traverseResponse
1655
+ };
1656
+
1657
+ var __defProp = Object.defineProperty;
1658
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1659
+ var __publicField = (obj, key, value) => {
1660
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1661
+ return value;
1662
+ };
1663
+ class Wallet {
1664
+ constructor(config) {
1665
+ this.config = config;
1666
+ __publicField(this, "apiClient");
1667
+ __publicField(this, "contractKit");
1668
+ __publicField(this, "session");
1669
+ this.apiClient = new antelope.APIClient({ url: config.chain_url });
1670
+ this.contractKit = new contract.ContractKit({ client: this.apiClient });
1671
+ }
1672
+ /**
1673
+ * Метод установки приватного ключа в кошелёк
1674
+ * @param username - имя пользователя
1675
+ * @param wif - приватный ключ
1676
+ * @returns
1677
+ */
1678
+ setWif(username, wif) {
1679
+ this.session = new session.Session({
1680
+ actor: username,
1681
+ permission: "active",
1682
+ chain: {
1683
+ id: this.config.chain_id,
1684
+ url: this.config.chain_url
1685
+ },
1686
+ walletPlugin: new walletPluginPrivatekey.WalletPluginPrivateKey(antelope.PrivateKey.fromString(wif))
1687
+ });
1688
+ return this;
1689
+ }
1690
+ async transact(actionOrActions, broadcast = true) {
1691
+ if (!this.session)
1692
+ throw new Error("Session is not initialized.");
1693
+ const actions = Array.isArray(actionOrActions) ? await Promise.all(actionOrActions.map((action) => this.formActionFromAbi(action))) : [await this.formActionFromAbi(actionOrActions)];
1694
+ return this.session.transact({ actions }, { broadcast });
1695
+ }
1696
+ async getAllRows(code, scope, tableName) {
1697
+ const abi = await this.getAbi(code);
1698
+ const table = this.createTable(code, tableName, abi);
1699
+ const rows = await table.all({ scope });
1700
+ return JSON.parse(JSON.stringify(rows));
1701
+ }
1702
+ async query(code, scope, tableName, options = { indexPosition: "primary" }) {
1703
+ const { indexPosition = "primary", from, to, maxRows } = options;
1704
+ const abi = await this.getAbi(code);
1705
+ const table = this.createTable(code, tableName, abi);
1706
+ const rows = await table.query({
1707
+ scope,
1708
+ index_position: indexPosition,
1709
+ from,
1710
+ to,
1711
+ maxRows
1712
+ });
1713
+ return JSON.parse(JSON.stringify(rows));
1714
+ }
1715
+ async getRow(code, scope, tableName, primaryKey, indexPosition = "primary") {
1716
+ const abi = await this.getAbi(code);
1717
+ const table = this.createTable(code, tableName, abi);
1718
+ const row = await table.get(String(primaryKey), {
1719
+ scope,
1720
+ index_position: indexPosition
1721
+ });
1722
+ return row ? JSON.parse(JSON.stringify(row)) : null;
1723
+ }
1724
+ async formActionFromAbi(action) {
1725
+ const abi = await this.getAbi(action.account);
1726
+ return antelope.Action.from(action, abi);
1727
+ }
1728
+ async getAbi(account) {
1729
+ const { abi } = await this.apiClient.v1.chain.get_abi(account);
1730
+ if (!abi)
1731
+ throw new Error(`ABI for account "${account}" not found.`);
1732
+ return abi;
1733
+ }
1734
+ createTable(code, tableName, abi) {
1735
+ return new contract.Table({
1736
+ abi,
1737
+ account: code,
1738
+ name: tableName,
1739
+ client: this.apiClient
1740
+ });
1741
+ }
1742
+ }
1743
+
1744
+ const Classes = {
1745
+ __proto__: null,
1746
+ Wallet: Wallet
1747
+ };
1748
+
1749
+ const rawExtensionSelector = {
1750
+ name: true,
1751
+ available: true,
1752
+ enabled: true,
1753
+ updated_at: true,
1754
+ created_at: true,
1755
+ config: true,
1756
+ schema: true,
1757
+ title: true,
1758
+ description: true,
1759
+ image: true,
1760
+ tags: true,
1761
+ readme: true,
1762
+ instructions: true,
1763
+ installed: true
1764
+ };
1765
+ const extensionSelector = Selector("Extension")(rawExtensionSelector);
1766
+
1767
+ const name$M = "installExtension";
1768
+ const mutation$C = Selector("Mutation")({
1769
+ [name$M]: [{ data: $("data", "ExtensionInput!") }, extensionSelector]
1770
+ });
1771
+
1772
+ const installExtension = {
1773
+ __proto__: null,
1774
+ mutation: mutation$C,
1775
+ name: name$M
1776
+ };
1777
+
1778
+ const name$L = "uninstallExtension";
1779
+ const mutation$B = Selector("Mutation")({
1780
+ [name$L]: [{ data: $("data", "UninstallExtensionInput!") }, true]
1781
+ });
1782
+
1783
+ const uninstallExtension = {
1784
+ __proto__: null,
1785
+ mutation: mutation$B,
1786
+ name: name$L
1787
+ };
1788
+
1789
+ const name$K = "updateExtension";
1790
+ const mutation$A = Selector("Mutation")({
1791
+ [name$K]: [{ data: $("data", "ExtensionInput!") }, extensionSelector]
1792
+ });
1793
+
1794
+ const updateExtension = {
1795
+ __proto__: null,
1796
+ mutation: mutation$A,
1797
+ name: name$K
1798
+ };
1799
+
1800
+ const index$k = {
1801
+ __proto__: null,
1802
+ InstallExtension: installExtension,
1803
+ UninstallExtension: uninstallExtension,
1804
+ UpdateExtension: updateExtension
1805
+ };
1806
+
1807
+ const rawBankAccountSelector = {
1808
+ details: {
1809
+ bik: true,
1810
+ corr: true,
1811
+ kpp: true
1812
+ },
1813
+ account_number: true,
1814
+ bank_name: true,
1815
+ card_number: true,
1816
+ currency: true
1817
+ };
1818
+ Selector("BankAccount")(rawBankAccountSelector);
1819
+
1820
+ const rawPaymentMethodSelector = {
1821
+ data: {
1822
+ __typename: true,
1823
+ ["...on BankAccount"]: rawBankAccountSelector,
1824
+ ["...on SbpAccount"]: {
1825
+ phone: true
1826
+ }
1827
+ },
1828
+ is_default: true,
1829
+ created_at: true,
1830
+ updated_at: true,
1831
+ method_id: true,
1832
+ method_type: true,
1833
+ username: true
1834
+ };
1835
+ const paymentMethodSelector = Selector("PaymentMethod")(rawPaymentMethodSelector);
1836
+
1837
+ const name$J = "createBankAccount";
1838
+ const mutation$z = Selector("Mutation")({
1839
+ [name$J]: [{ data: $("data", "CreateBankAccountInput!") }, paymentMethodSelector]
1840
+ });
1841
+
1842
+ const createBankAccount = {
1843
+ __proto__: null,
1844
+ mutation: mutation$z,
1845
+ name: name$J
1846
+ };
1847
+
1848
+ const name$I = "deletePaymentMethod";
1849
+ const mutation$y = Selector("Mutation")({
1850
+ [name$I]: [{ data: $("data", "DeletePaymentMethodInput!") }, true]
1851
+ });
1852
+
1853
+ const deletePaymentMethod = {
1854
+ __proto__: null,
1855
+ mutation: mutation$y,
1856
+ name: name$I
1857
+ };
1858
+
1859
+ const name$H = "updateBankAccount";
1860
+ const mutation$x = Selector("Mutation")({
1861
+ [name$H]: [{ data: $("data", "UpdateBankAccountInput!") }, paymentMethodSelector]
1862
+ });
1863
+
1864
+ const updateBankAccount = {
1865
+ __proto__: null,
1866
+ mutation: mutation$x,
1867
+ name: name$H
1868
+ };
1869
+
1870
+ const index$j = {
1871
+ __proto__: null,
1872
+ CreateBankAccount: createBankAccount,
1873
+ DeletePaymentMethod: deletePaymentMethod,
1874
+ UpdateBankAccount: updateBankAccount
1875
+ };
1876
+
1877
+ const rawBlockchainAccountSelector = {
1878
+ account_name: true,
1879
+ core_liquid_balance: true,
1880
+ cpu_limit: {
1881
+ available: true,
1882
+ current_used: true,
1883
+ last_usage_update_time: true,
1884
+ max: true,
1885
+ used: true
1886
+ },
1887
+ cpu_weight: true,
1888
+ created: true,
1889
+ head_block_num: true,
1890
+ head_block_time: true,
1891
+ last_code_update: true,
1892
+ net_limit: {
1893
+ available: true,
1894
+ current_used: true,
1895
+ last_usage_update_time: true,
1896
+ max: true,
1897
+ used: true
1898
+ },
1899
+ net_weight: true,
1900
+ permissions: {
1901
+ parent: true,
1902
+ perm_name: true,
1903
+ required_auth: {
1904
+ accounts: {
1905
+ permission: {
1906
+ actor: true,
1907
+ permission: true
1908
+ },
1909
+ weight: true
1910
+ },
1911
+ keys: {
1912
+ key: true,
1913
+ weight: true
1914
+ },
1915
+ threshold: true,
1916
+ waits: {
1917
+ wait_sec: true,
1918
+ weight: true
1919
+ }
1920
+ }
1921
+ },
1922
+ privileged: true,
1923
+ ram_quota: true,
1924
+ ram_usage: true,
1925
+ refund_request: {
1926
+ cpu_amount: true,
1927
+ net_amount: true,
1928
+ owner: true,
1929
+ request_time: true
1930
+ },
1931
+ rex_info: true,
1932
+ self_delegated_bandwidth: {
1933
+ cpu_weight: true,
1934
+ from: true,
1935
+ net_weight: true,
1936
+ to: true
1937
+ },
1938
+ total_resources: {
1939
+ cpu_weight: true,
1940
+ net_weight: true,
1941
+ owner: true,
1942
+ ram_bytes: true
1943
+ },
1944
+ voter_info: true
1945
+ };
1946
+ Selector("BlockchainAccount")(
1947
+ rawBlockchainAccountSelector
1948
+ );
1949
+
1950
+ const rawMonoAccountSelector = {
1951
+ email: true,
1952
+ has_account: true,
1953
+ initial_order: true,
1954
+ is_email_verified: true,
1955
+ is_registered: true,
1956
+ message: true,
1957
+ public_key: true,
1958
+ referer: true,
1959
+ role: true,
1960
+ status: true,
1961
+ type: true,
1962
+ username: true
1963
+ };
1964
+ Selector("MonoAccount")(
1965
+ rawMonoAccountSelector
1966
+ );
1967
+
1968
+ const rawParticipantAccountSelector = {
1969
+ braname: true,
1970
+ created_at: true,
1971
+ has_vote: true,
1972
+ is_initial: true,
1973
+ is_minimum: true,
1974
+ last_min_pay: true,
1975
+ last_update: true,
1976
+ status: true,
1977
+ type: true,
1978
+ username: true
1979
+ };
1980
+ Selector("ParticipantAccount")(
1981
+ rawParticipantAccountSelector
1982
+ );
1983
+
1984
+ const rawUserAccountSelector = {
1985
+ meta: true,
1986
+ referer: true,
1987
+ registered_at: true,
1988
+ registrator: true,
1989
+ status: true,
1990
+ storages: true,
1991
+ type: true,
1992
+ username: true,
1993
+ verifications: {
1994
+ created_at: true,
1995
+ is_verified: true,
1996
+ last_update: true,
1997
+ notice: true,
1998
+ procedure: true,
1999
+ verificator: true
2000
+ }
2001
+ };
2002
+ Selector("UserAccount")(
2003
+ rawUserAccountSelector
2004
+ );
2005
+
2006
+ const rawAccountSelector = {
2007
+ username: true,
2008
+ blockchain_account: rawBlockchainAccountSelector,
2009
+ provider_account: rawMonoAccountSelector,
2010
+ participant_account: rawParticipantAccountSelector,
2011
+ user_account: rawUserAccountSelector
2012
+ };
2013
+ const accountSelector = Selector("Account")(rawAccountSelector);
2014
+
2015
+ const rawDocumentMetaSelector = {
2016
+ block_num: true,
2017
+ coopname: true,
2018
+ created_at: true,
2019
+ generator: true,
2020
+ lang: true,
2021
+ links: true,
2022
+ registry_id: true,
2023
+ timezone: true,
2024
+ title: true,
2025
+ username: true,
2026
+ version: true
2027
+ };
2028
+ const rawDocumentSelector = {
2029
+ binary: true,
2030
+ full_title: true,
2031
+ hash: true,
2032
+ html: true,
2033
+ meta: rawDocumentMetaSelector
2034
+ // Общая часть meta
2035
+ };
2036
+ const documentSelector = Selector("GeneratedDocument")(rawDocumentSelector);
2037
+
2038
+ const rawParticipantApplicationDecisionDocumentSelector = {
2039
+ ...rawDocumentSelector,
2040
+ meta: {
2041
+ ...rawDocumentMetaSelector,
2042
+ // Общая часть meta
2043
+ decision_id: true
2044
+ }
2045
+ };
2046
+ const participantApplicationDecisionDocumentSelector = Selector("ParticipantApplicationDecisionDocument")(rawParticipantApplicationDecisionDocumentSelector);
2047
+
2048
+ const rawParticipantApplicationDocumentSelector$1 = {
2049
+ ...rawDocumentSelector,
2050
+ meta: {
2051
+ ...rawDocumentMetaSelector
2052
+ // Общая часть meta
2053
+ }
2054
+ };
2055
+ const participantApplicationDocumentSelector = Selector("ParticipantApplicationDocument")(rawParticipantApplicationDocumentSelector$1);
2056
+
2057
+ const rawBankPaymentMethodSelector = {
2058
+ data: rawBankAccountSelector,
2059
+ is_default: true,
2060
+ created_at: true,
2061
+ updated_at: true,
2062
+ method_id: true,
2063
+ method_type: true,
2064
+ username: true
2065
+ };
2066
+
2067
+ const rawIndividualSelector = {
2068
+ email: true,
2069
+ full_address: true,
2070
+ phone: true,
2071
+ first_name: true,
2072
+ last_name: true,
2073
+ middle_name: true,
2074
+ birthdate: true,
2075
+ passport: {
2076
+ number: true,
2077
+ code: true,
2078
+ issued_at: true,
2079
+ issued_by: true,
2080
+ series: true
2081
+ },
2082
+ username: true
2083
+ };
2084
+
2085
+ const rawBranchSelector = {
2086
+ coopname: true,
2087
+ braname: true,
2088
+ city: true,
2089
+ country: true,
2090
+ details: {
2091
+ kpp: true,
2092
+ inn: true,
2093
+ ogrn: true
2094
+ },
2095
+ email: true,
2096
+ fact_address: true,
2097
+ full_address: true,
2098
+ full_name: true,
2099
+ phone: true,
2100
+ represented_by: {
2101
+ based_on: true,
2102
+ first_name: true,
2103
+ last_name: true,
2104
+ middle_name: true,
2105
+ position: true
2106
+ },
2107
+ short_name: true,
2108
+ trusted: rawIndividualSelector,
2109
+ // Передаём "сырой" объект
2110
+ trustee: rawIndividualSelector,
2111
+ // Передаём "сырой" объект
2112
+ bank_account: rawBankPaymentMethodSelector,
2113
+ type: true
2114
+ };
2115
+ const branchSelector = Selector("Branch")(rawBranchSelector);
2116
+
2117
+ const rawBranchSelectorForUsers = {
2118
+ coopname: true,
2119
+ braname: true,
2120
+ city: true,
2121
+ country: true,
2122
+ details: {
2123
+ kpp: true,
2124
+ inn: true,
2125
+ ogrn: true
2126
+ },
2127
+ email: true,
2128
+ fact_address: true,
2129
+ full_address: true,
2130
+ full_name: true,
2131
+ phone: true,
2132
+ represented_by: {
2133
+ based_on: true,
2134
+ first_name: true,
2135
+ last_name: true,
2136
+ middle_name: true,
2137
+ position: true
2138
+ },
2139
+ short_name: true,
2140
+ bank_account: rawBankPaymentMethodSelector,
2141
+ type: true
2142
+ };
2143
+ const branchSelectorForUsers = Selector("Branch")(
2144
+ rawBranchSelectorForUsers
2145
+ );
2146
+
2147
+ const rawSelectBranchDocumentSelector = {
2148
+ ...rawDocumentSelector,
2149
+ meta: {
2150
+ ...rawDocumentMetaSelector,
2151
+ // Общая часть meta
2152
+ braname: true
2153
+ // Уникальное дополнение
2154
+ }
2155
+ };
2156
+ const generateSelectBranchDocumentSelector = Selector("SelectBranchDocument")(rawSelectBranchDocumentSelector);
2157
+
2158
+ const rawBlockchainInfoSelector = {
2159
+ block_cpu_limit: true,
2160
+ block_net_limit: true,
2161
+ chain_id: true,
2162
+ fork_db_head_block_id: true,
2163
+ fork_db_head_block_num: true,
2164
+ head_block_id: true,
2165
+ head_block_num: true,
2166
+ head_block_producer: true,
2167
+ head_block_time: true,
2168
+ last_irreversible_block_id: true,
2169
+ last_irreversible_block_num: true,
2170
+ last_irreversible_block_time: true,
2171
+ server_version: true,
2172
+ server_version_string: true,
2173
+ virtual_block_cpu_limit: true,
2174
+ virtual_block_net_limit: true
2175
+ };
2176
+ Selector("BlockchainInfoDTO")(
2177
+ rawBlockchainInfoSelector
2178
+ );
2179
+
2180
+ const rawCooperatorAccountSelector = {
2181
+ announce: true,
2182
+ coop_type: true,
2183
+ created_at: true,
2184
+ description: true,
2185
+ document: {
2186
+ hash: true,
2187
+ public_key: true,
2188
+ meta: true,
2189
+ signature: true
2190
+ },
2191
+ initial: true,
2192
+ is_branched: true,
2193
+ is_cooperative: true,
2194
+ is_enrolled: true,
2195
+ meta: true,
2196
+ minimum: true,
2197
+ org_initial: true,
2198
+ org_minimum: true,
2199
+ org_registration: true,
2200
+ parent_username: true,
2201
+ referer: true,
2202
+ registered_at: true,
2203
+ registration: true,
2204
+ registrator: true,
2205
+ status: true,
2206
+ storages: true,
2207
+ type: true,
2208
+ username: true,
2209
+ verifications: {
2210
+ created_at: true,
2211
+ is_verified: true,
2212
+ last_update: true,
2213
+ notice: true,
2214
+ procedure: true,
2215
+ verificator: true
2216
+ }
2217
+ };
2218
+ Selector("CooperativeOperatorAccount")(
2219
+ rawCooperatorAccountSelector
2220
+ );
2221
+
2222
+ const rawContactsSelector = {
2223
+ chairman: {
2224
+ first_name: true,
2225
+ last_name: true,
2226
+ middle_name: true
2227
+ },
2228
+ details: {
2229
+ inn: true,
2230
+ kpp: true,
2231
+ ogrn: true
2232
+ },
2233
+ email: true,
2234
+ full_address: true,
2235
+ full_name: true,
2236
+ phone: true
2237
+ };
2238
+ const rawVarsSelector = {
2239
+ confidential_email: true,
2240
+ confidential_link: true,
2241
+ contact_email: true,
2242
+ coopenomics_agreement: {
2243
+ protocol_day_month_year: true,
2244
+ protocol_number: true
2245
+ },
2246
+ coopname: true,
2247
+ full_abbr: true,
2248
+ full_abbr_dative: true,
2249
+ full_abbr_genitive: true,
2250
+ name: true,
2251
+ participant_application: {
2252
+ protocol_day_month_year: true,
2253
+ protocol_number: true
2254
+ },
2255
+ passport_request: true,
2256
+ privacy_agreement: {
2257
+ protocol_day_month_year: true,
2258
+ protocol_number: true
2259
+ },
2260
+ short_abbr: true,
2261
+ signature_agreement: {
2262
+ protocol_day_month_year: true,
2263
+ protocol_number: true
2264
+ },
2265
+ user_agreement: {
2266
+ protocol_day_month_year: true,
2267
+ protocol_number: true
2268
+ },
2269
+ wallet_agreement: {
2270
+ protocol_day_month_year: true,
2271
+ protocol_number: true
2272
+ },
2273
+ website: true
2274
+ };
2275
+ const rawSystemInfoSelector = {
2276
+ blockchain_info: rawBlockchainInfoSelector,
2277
+ cooperator_account: rawCooperatorAccountSelector,
2278
+ coopname: true,
2279
+ blockchain_account: rawBlockchainAccountSelector,
2280
+ system_status: true,
2281
+ contacts: rawContactsSelector,
2282
+ vars: rawVarsSelector
2283
+ };
2284
+ const systemInfoSelector = Selector("SystemInfo")(rawSystemInfoSelector);
2285
+
2286
+ const rawBlockchainActionSelector = {
2287
+ account: true,
2288
+ account_ram_deltas: {
2289
+ account: true,
2290
+ delta: true
2291
+ },
2292
+ action_ordinal: true,
2293
+ authorization: {
2294
+ actor: true,
2295
+ permission: true
2296
+ },
2297
+ block_id: true,
2298
+ block_num: true,
2299
+ chain_id: true,
2300
+ console: true,
2301
+ context_free: true,
2302
+ creator_action_ordinal: true,
2303
+ data: true,
2304
+ elapsed: true,
2305
+ global_sequence: true,
2306
+ name: true,
2307
+ receipt: {
2308
+ abi_sequence: true,
2309
+ act_digest: true,
2310
+ auth_sequence: {
2311
+ account: true,
2312
+ sequence: true
2313
+ },
2314
+ code_sequence: true,
2315
+ global_sequence: true,
2316
+ receiver: true,
2317
+ recv_sequence: true
2318
+ },
2319
+ receiver: true,
2320
+ transaction_id: true
2321
+ };
2322
+ Selector("BlockchainAction")(
2323
+ rawBlockchainActionSelector
2324
+ );
2325
+
2326
+ const rawOrganizationSelector = {
2327
+ city: true,
2328
+ country: true,
2329
+ details: {
2330
+ inn: true,
2331
+ kpp: true,
2332
+ ogrn: true
2333
+ },
2334
+ email: true,
2335
+ fact_address: true,
2336
+ full_address: true,
2337
+ full_name: true,
2338
+ phone: true,
2339
+ represented_by: {
2340
+ based_on: true,
2341
+ first_name: true,
2342
+ last_name: true,
2343
+ middle_name: true,
2344
+ position: true
2345
+ },
2346
+ short_name: true,
2347
+ type: true,
2348
+ username: true
2349
+ };
2350
+
2351
+ const rawEntrepreneurSelector = {
2352
+ birthdate: true,
2353
+ city: true,
2354
+ country: true,
2355
+ details: {
2356
+ inn: true,
2357
+ ogrn: true
2358
+ },
2359
+ email: true,
2360
+ first_name: true,
2361
+ full_address: true,
2362
+ last_name: true,
2363
+ middle_name: true,
2364
+ phone: true,
2365
+ username: true
2366
+ };
2367
+
2368
+ const name$G = "addTrustedAccount";
2369
+ const mutation$w = Selector("Mutation")({
2370
+ [name$G]: [{ data: $("data", "AddTrustedAccountInput!") }, branchSelector]
2371
+ });
2372
+
2373
+ const addTrustedAccount = {
2374
+ __proto__: null,
2375
+ mutation: mutation$w,
2376
+ name: name$G
2377
+ };
2378
+
2379
+ const name$F = "createBranch";
2380
+ const mutation$v = Selector("Mutation")({
2381
+ [name$F]: [{ data: $("data", "CreateBranchInput!") }, branchSelector]
2382
+ });
2383
+
2384
+ const createBranch = {
2385
+ __proto__: null,
2386
+ mutation: mutation$v,
2387
+ name: name$F
2388
+ };
2389
+
2390
+ const name$E = "deleteBranch";
2391
+ const mutation$u = Selector("Mutation")({
2392
+ [name$E]: [{ data: $("data", "DeleteBranchInput!") }, true]
2393
+ });
2394
+
2395
+ const deleteBranch = {
2396
+ __proto__: null,
2397
+ mutation: mutation$u,
2398
+ name: name$E
2399
+ };
2400
+
2401
+ const name$D = "deleteTrustedAccount";
2402
+ const mutation$t = Selector("Mutation")({
2403
+ [name$D]: [{ data: $("data", "DeleteTrustedAccountInput!") }, branchSelector]
2404
+ });
2405
+
2406
+ const deleteTrustedAccount = {
2407
+ __proto__: null,
2408
+ mutation: mutation$t,
2409
+ name: name$D
2410
+ };
2411
+
2412
+ const name$C = "editBranch";
2413
+ const mutation$s = Selector("Mutation")({
2414
+ [name$C]: [{ data: $("data", "EditBranchInput!") }, branchSelector]
2415
+ });
2416
+
2417
+ const editBranch = {
2418
+ __proto__: null,
2419
+ mutation: mutation$s,
2420
+ name: name$C
2421
+ };
2422
+
2423
+ const name$B = "selectBranch";
2424
+ const mutation$r = Selector("Mutation")({
2425
+ [name$B]: [{ data: $("data", "SelectBranchInput!") }, true]
2426
+ });
2427
+
2428
+ const selectBranch = {
2429
+ __proto__: null,
2430
+ mutation: mutation$r,
2431
+ name: name$B
2432
+ };
2433
+
2434
+ const name$A = "generateSelectBranchDocument";
2435
+ const mutation$q = Selector("Mutation")({
2436
+ [name$A]: [{ data: $("data", "SelectBranchGenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, generateSelectBranchDocumentSelector]
2437
+ });
2438
+
2439
+ const generateSelectBranchDocument = {
2440
+ __proto__: null,
2441
+ mutation: mutation$q,
2442
+ name: name$A
2443
+ };
2444
+
2445
+ const index$i = {
2446
+ __proto__: null,
2447
+ AddTrustedAccount: addTrustedAccount,
2448
+ CreateBranch: createBranch,
2449
+ DeleteBranch: deleteBranch,
2450
+ DeleteTrustedAccount: deleteTrustedAccount,
2451
+ EditBranch: editBranch,
2452
+ GenerateSelectBranchDocument: generateSelectBranchDocument,
2453
+ SelectBranch: selectBranch
2454
+ };
2455
+
2456
+ const rawProjectFreeDecisionDocumentSelector = {
2457
+ ...rawDocumentSelector,
2458
+ meta: {
2459
+ ...rawDocumentMetaSelector,
2460
+ // Общая часть meta
2461
+ project_id: true
2462
+ }
2463
+ };
2464
+ const projectFreeDecisionDocumentSelector = Selector("ProjectFreeDecisionDocument")(rawProjectFreeDecisionDocumentSelector);
2465
+
2466
+ const name$z = "generateProjectOfFreeDecision";
2467
+ const mutation$p = Selector("Mutation")({
2468
+ [name$z]: [{ data: $("data", "ProjectFreeDecisionGenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, projectFreeDecisionDocumentSelector]
2469
+ });
2470
+
2471
+ const generateProjectOfFreeDecisionDocument = {
2472
+ __proto__: null,
2473
+ mutation: mutation$p,
2474
+ name: name$z
2475
+ };
2476
+
2477
+ const rawFreeDecisionDocumentSelector = {
2478
+ ...rawDocumentSelector,
2479
+ meta: {
2480
+ ...rawDocumentMetaSelector,
2481
+ // Общая часть meta
2482
+ project_id: true,
2483
+ // Уникальное дополнение
2484
+ decision_id: true
2485
+ }
2486
+ };
2487
+ const freeDecisionDocumentSelector = Selector("FreeDecisionDocument")(rawFreeDecisionDocumentSelector);
2488
+
2489
+ const rawFreeProjectSelector = {
2490
+ decision: true,
2491
+ id: true,
2492
+ question: true
2493
+ };
2494
+ const createdProjectFreeDecisionSelector = Selector("CreatedProjectFreeDecision")(rawFreeProjectSelector);
2495
+
2496
+ const name$y = "generateFreeDecision";
2497
+ const mutation$o = Selector("Mutation")({
2498
+ [name$y]: [{ data: $("data", "FreeDecisionGenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, freeDecisionDocumentSelector]
2499
+ });
2500
+
2501
+ const generateFreeDecision = {
2502
+ __proto__: null,
2503
+ mutation: mutation$o,
2504
+ name: name$y
2505
+ };
2506
+
2507
+ const name$x = "publishProjectOfFreeDecision";
2508
+ const mutation$n = Selector("Mutation")({
2509
+ [name$x]: [{ data: $("data", "PublishProjectFreeDecisionInput!") }, true]
2510
+ });
2511
+
2512
+ const publishProjectOfFreeDecision = {
2513
+ __proto__: null,
2514
+ mutation: mutation$n,
2515
+ name: name$x
2516
+ };
2517
+
2518
+ const name$w = "createProjectOfFreeDecision";
2519
+ const mutation$m = Selector("Mutation")({
2520
+ [name$w]: [{ data: $("data", "CreateProjectFreeDecisionInput!") }, createdProjectFreeDecisionSelector]
2521
+ });
2522
+
2523
+ const createProjectOfFreeDecision = {
2524
+ __proto__: null,
2525
+ mutation: mutation$m,
2526
+ name: name$w
2527
+ };
2528
+
2529
+ const index$h = {
2530
+ __proto__: null,
2531
+ CreateProjectOfFreeDecision: createProjectOfFreeDecision,
2532
+ GenerateFreeDecision: generateFreeDecision,
2533
+ GenerateProjectOfFreeDecision: generateProjectOfFreeDecisionDocument,
2534
+ PublishProjectOfFreeDecision: publishProjectOfFreeDecision
2535
+ };
2536
+
2537
+ const name$v = "updateAccount";
2538
+ const mutation$l = Selector("Mutation")({
2539
+ [name$v]: [{ data: $("data", "UpdateAccountInput!") }, accountSelector]
2540
+ });
2541
+
2542
+ const updateAccount = {
2543
+ __proto__: null,
2544
+ mutation: mutation$l,
2545
+ name: name$v
2546
+ };
2547
+
2548
+ const rawTokenSelector = {
2549
+ expires: true,
2550
+ token: true
2551
+ };
2552
+ const rawTokensSelector = {
2553
+ access: rawTokenSelector,
2554
+ refresh: rawTokenSelector
2555
+ };
2556
+ const rawRegisteredAccountSelector = {
2557
+ account: rawAccountSelector,
2558
+ tokens: rawTokensSelector
2559
+ };
2560
+ const registeredAccountSelector = Selector("RegisteredAccount")(
2561
+ rawRegisteredAccountSelector
2562
+ );
2563
+
2564
+ const name$u = "registerAccount";
2565
+ const mutation$k = Selector("Mutation")({
2566
+ [name$u]: [{ data: $("data", "RegisterAccountInput!") }, registeredAccountSelector]
2567
+ });
2568
+
2569
+ const registerAccount = {
2570
+ __proto__: null,
2571
+ mutation: mutation$k,
2572
+ name: name$u
2573
+ };
2574
+
2575
+ const name$t = "startResetKey";
2576
+ const mutation$j = Selector("Mutation")({
2577
+ [name$t]: [{ data: $("data", "StartResetKeyInput!") }, true]
2578
+ });
2579
+
2580
+ const startResetKey = {
2581
+ __proto__: null,
2582
+ mutation: mutation$j,
2583
+ name: name$t
2584
+ };
2585
+
2586
+ const name$s = "resetKey";
2587
+ const mutation$i = Selector("Mutation")({
2588
+ [name$s]: [{ data: $("data", "ResetKeyInput!") }, true]
2589
+ });
2590
+
2591
+ const resetKey = {
2592
+ __proto__: null,
2593
+ mutation: mutation$i,
2594
+ name: name$s
2595
+ };
2596
+
2597
+ const index$g = {
2598
+ __proto__: null,
2599
+ RegisterAccount: registerAccount,
2600
+ ResetKey: resetKey,
2601
+ StartResetKey: startResetKey,
2602
+ UpdateAccount: updateAccount
2603
+ };
2604
+
2605
+ const name$r = "refresh";
2606
+ const mutation$h = Selector("Mutation")({
2607
+ [name$r]: [{ data: $("data", "RefreshInput!") }, registeredAccountSelector]
2608
+ });
2609
+
2610
+ const refresh = {
2611
+ __proto__: null,
2612
+ mutation: mutation$h,
2613
+ name: name$r
2614
+ };
2615
+
2616
+ const name$q = "logout";
2617
+ const mutation$g = Selector("Mutation")({
2618
+ [name$q]: [{ data: $("data", "LogoutInput!") }, true]
2619
+ });
2620
+
2621
+ const logout = {
2622
+ __proto__: null,
2623
+ mutation: mutation$g,
2624
+ name: name$q
2625
+ };
2626
+
2627
+ const name$p = "login";
2628
+ const mutation$f = Selector("Mutation")({
2629
+ [name$p]: [{ data: $("data", "LoginInput!") }, registeredAccountSelector]
2630
+ });
2631
+
2632
+ const login = {
2633
+ __proto__: null,
2634
+ mutation: mutation$f,
2635
+ name: name$p
2636
+ };
2637
+
2638
+ const index$f = {
2639
+ __proto__: null,
2640
+ Login: login,
2641
+ Logout: logout,
2642
+ Refresh: refresh
2643
+ };
2644
+
2645
+ const name$o = "initSystem";
2646
+ const mutation$e = Selector("Mutation")({
2647
+ [name$o]: [{ data: $("data", "Init!") }, systemInfoSelector]
2648
+ });
2649
+
2650
+ const initSystem = {
2651
+ __proto__: null,
2652
+ mutation: mutation$e,
2653
+ name: name$o
2654
+ };
2655
+
2656
+ const name$n = "installSystem";
2657
+ const mutation$d = Selector("Mutation")({
2658
+ [name$n]: [{ data: $("data", "Install!") }, systemInfoSelector]
2659
+ });
2660
+
2661
+ const installSystem = {
2662
+ __proto__: null,
2663
+ mutation: mutation$d,
2664
+ name: name$n
2665
+ };
2666
+
2667
+ const name$m = "setWif";
2668
+ const mutation$c = Selector("Mutation")({
2669
+ [name$m]: [{ data: $("data", "Update!") }, true]
2670
+ });
2671
+
2672
+ const setWif = {
2673
+ __proto__: null,
2674
+ mutation: mutation$c,
2675
+ name: name$m
2676
+ };
2677
+
2678
+ const name$l = "updateSystem";
2679
+ const mutation$b = Selector("Mutation")({
2680
+ [name$l]: [{ data: $("data", "Update!") }, systemInfoSelector]
2681
+ });
2682
+
2683
+ const updateSystem = {
2684
+ __proto__: null,
2685
+ mutation: mutation$b,
2686
+ name: name$l
2687
+ };
2688
+
2689
+ const index$e = {
2690
+ __proto__: null,
2691
+ InitSystem: initSystem,
2692
+ InstallSystem: installSystem,
2693
+ SetWif: setWif,
2694
+ UpdateSystem: updateSystem
2695
+ };
2696
+
2697
+ const name$k = "generateParticipantApplication";
2698
+ const mutation$a = Selector("Mutation")({
2699
+ [name$k]: [{ data: $("data", "ParticipantApplicationGenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, participantApplicationDocumentSelector]
2700
+ });
2701
+
2702
+ const generateParticipantApplication = {
2703
+ __proto__: null,
2704
+ mutation: mutation$a,
2705
+ name: name$k
2706
+ };
2707
+
2708
+ const name$j = "generateParticipantApplicationDecision";
2709
+ const mutation$9 = Selector("Mutation")({
2710
+ [name$j]: [{ data: $("data", "ParticipantApplicationDecisionGenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, participantApplicationDecisionDocumentSelector]
2711
+ });
2712
+
2713
+ const generateParticipantApplicationDecision = {
2714
+ __proto__: null,
2715
+ mutation: mutation$9,
2716
+ name: name$j
2717
+ };
2718
+
2719
+ const name$i = "registerParticipant";
2720
+ const mutation$8 = Selector("Mutation")({
2721
+ [name$i]: [{ data: $("data", "RegisterParticipantInput!") }, accountSelector]
2722
+ });
2723
+
2724
+ const registerParticipant = {
2725
+ __proto__: null,
2726
+ mutation: mutation$8,
2727
+ name: name$i
2728
+ };
2729
+
2730
+ const name$h = "addParticipant";
2731
+ const mutation$7 = Selector("Mutation")({
2732
+ [name$h]: [{ data: $("data", "AddParticipantInput!") }, accountSelector]
2733
+ });
2734
+
2735
+ const addParticipant = {
2736
+ __proto__: null,
2737
+ mutation: mutation$7,
2738
+ name: name$h
2739
+ };
2740
+
2741
+ const index$d = {
2742
+ __proto__: null,
2743
+ AddParticipant: addParticipant,
2744
+ GenerateParticipantApplication: generateParticipantApplication,
2745
+ GenerateParticipantApplicationDecision: generateParticipantApplicationDecision,
2746
+ RegisterParticipant: registerParticipant
2747
+ };
2748
+
2749
+ const rawPaymentDetailsSelector = {
2750
+ amount_plus_fee: true,
2751
+ amount_without_fee: true,
2752
+ data: true,
2753
+ fact_fee_percent: true,
2754
+ fee_amount: true,
2755
+ fee_percent: true,
2756
+ tolerance_percent: true
2757
+ };
2758
+ const rawPaymentSelector = {
2759
+ amount: true,
2760
+ blockchain_id: true,
2761
+ created_at: true,
2762
+ details: rawPaymentDetailsSelector,
2763
+ expired_at: true,
2764
+ id: true,
2765
+ message: true,
2766
+ provider: true,
2767
+ status: true,
2768
+ symbol: true,
2769
+ updated_at: true,
2770
+ username: true
2771
+ };
2772
+ const paymentSelector = Selector("Payment")(rawPaymentSelector);
2773
+
2774
+ const name$g = "createInitialPayment";
2775
+ const mutation$6 = Selector("Mutation")({
2776
+ [name$g]: [{ data: $("data", "CreateInitialPaymentInput!") }, paymentSelector]
2777
+ });
2778
+
2779
+ const createInitial = {
2780
+ __proto__: null,
2781
+ mutation: mutation$6,
2782
+ name: name$g
2783
+ };
2784
+
2785
+ const name$f = "createDepositPayment";
2786
+ const mutation$5 = Selector("Mutation")({
2787
+ [name$f]: [{ data: $("data", "CreateDepositPaymentInput!") }, paymentSelector]
2788
+ });
2789
+
2790
+ const createDeposit = {
2791
+ __proto__: null,
2792
+ mutation: mutation$5,
2793
+ name: name$f
2794
+ };
2795
+
2796
+ const name$e = "setPaymentStatus";
2797
+ const mutation$4 = Selector("Mutation")({
2798
+ [name$e]: [{ data: $("data", "SetPaymentStatusInput!") }, paymentSelector]
2799
+ });
2800
+
2801
+ const setPaymentStatus = {
2802
+ __proto__: null,
2803
+ mutation: mutation$4,
2804
+ name: name$e
2805
+ };
2806
+
2807
+ const index$c = {
2808
+ __proto__: null,
2809
+ CreateDepositPayment: createDeposit,
2810
+ CreateInitialPayment: createInitial,
2811
+ SetPaymentStatus: setPaymentStatus
2812
+ };
2813
+
2814
+ const name$d = "generatePrivacyAgreement";
2815
+ const mutation$3 = Selector("Mutation")({
2816
+ [name$d]: [{ data: $("data", "GenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, documentSelector]
2817
+ });
2818
+
2819
+ const generatePrivacyAgreement = {
2820
+ __proto__: null,
2821
+ mutation: mutation$3,
2822
+ name: name$d
2823
+ };
2824
+
2825
+ const name$c = "generateSignatureAgreement";
2826
+ const mutation$2 = Selector("Mutation")({
2827
+ [name$c]: [{ data: $("data", "GenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, documentSelector]
2828
+ });
2829
+
2830
+ const generateSignatureAgreement = {
2831
+ __proto__: null,
2832
+ mutation: mutation$2,
2833
+ name: name$c
2834
+ };
2835
+
2836
+ const name$b = "generateWalletAgreement";
2837
+ const mutation$1 = Selector("Mutation")({
2838
+ [name$b]: [{ data: $("data", "GenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, documentSelector]
2839
+ });
2840
+
2841
+ const generateWalletAgreement = {
2842
+ __proto__: null,
2843
+ mutation: mutation$1,
2844
+ name: name$b
2845
+ };
2846
+
2847
+ const name$a = "generateUserAgreement";
2848
+ const mutation = Selector("Mutation")({
2849
+ [name$a]: [{ data: $("data", "GenerateDocumentInput!"), options: $("options", "GenerateDocumentOptionsInput!") }, documentSelector]
2850
+ });
2851
+
2852
+ const generateUserAgreement = {
2853
+ __proto__: null,
2854
+ mutation: mutation,
2855
+ name: name$a
2856
+ };
2857
+
2858
+ const index$b = {
2859
+ __proto__: null,
2860
+ GeneratePrivacyAgreement: generatePrivacyAgreement,
2861
+ GenerateSignatureAgreement: generateSignatureAgreement,
2862
+ GenerateUserAgreement: generateUserAgreement,
2863
+ GenerateWalletAgreement: generateWalletAgreement
2864
+ };
2865
+
2866
+ const index$a = {
2867
+ __proto__: null,
2868
+ Accounts: index$g,
2869
+ Agreements: index$b,
2870
+ Auth: index$f,
2871
+ Branches: index$i,
2872
+ Extensions: index$k,
2873
+ FreeDecisions: index$h,
2874
+ Participants: index$d,
2875
+ PaymentMethods: index$j,
2876
+ Payments: index$c,
2877
+ System: index$e
2878
+ };
2879
+
2880
+ const name$9 = "getExtensions";
2881
+ const query$9 = Selector("Query")({
2882
+ [name$9]: [{ data: $("data", "GetExtensionsInput") }, extensionSelector]
2883
+ });
2884
+
2885
+ const getExtensions = {
2886
+ __proto__: null,
2887
+ name: name$9,
2888
+ query: query$9
2889
+ };
2890
+
2891
+ const index$9 = {
2892
+ __proto__: null,
2893
+ GetExtensions: getExtensions
2894
+ };
2895
+
2896
+ const paginationSelector = {
2897
+ items: {},
2898
+ totalCount: true,
2899
+ totalPages: true,
2900
+ currentPage: true
2901
+ };
2902
+
2903
+ const rawPaymentMethodPaginationSelector = { ...paginationSelector, items: rawPaymentMethodSelector };
2904
+ Selector("PaymentMethodPaginationResult")(rawPaymentMethodPaginationSelector);
2905
+
2906
+ const name$8 = "getPaymentMethods";
2907
+ const query$8 = Selector("Query")({
2908
+ [name$8]: [{ data: $("data", "GetPaymentMethodsInput") }, rawPaymentMethodPaginationSelector]
2909
+ });
2910
+
2911
+ const getPaymentMethods = {
2912
+ __proto__: null,
2913
+ query: query$8
2914
+ };
2915
+
2916
+ const index$8 = {
2917
+ __proto__: null,
2918
+ GetPaymentMethods: getPaymentMethods
2919
+ };
2920
+
2921
+ const name$7 = "getSystemInfo";
2922
+ const query$7 = Selector("Query")({
2923
+ [name$7]: systemInfoSelector
2924
+ });
2925
+
2926
+ const getSystemInfo = {
2927
+ __proto__: null,
2928
+ name: name$7,
2929
+ query: query$7
2930
+ };
2931
+
2932
+ const index$7 = {
2933
+ __proto__: null,
2934
+ GetSystemInfo: getSystemInfo
2935
+ };
2936
+
2937
+ const name$6 = "getAccount";
2938
+ const query$6 = Selector("Query")({
2939
+ [name$6]: [{ data: $("data", "GetAccountInput!") }, accountSelector]
2940
+ });
2941
+
2942
+ const getAccount = {
2943
+ __proto__: null,
2944
+ name: name$6,
2945
+ query: query$6
2946
+ };
2947
+
2948
+ const rawAccountsPaginationSelector = { ...paginationSelector, items: rawAccountSelector };
2949
+ const accountsPaginationSelector = Selector("AccountsPaginationResult")(rawAccountsPaginationSelector);
2950
+
2951
+ const name$5 = "getAccounts";
2952
+ const query$5 = Selector("Query")({
2953
+ [name$5]: [{ data: $("data", "GetAccountsInput!"), options: $("options", "PaginationInput!") }, accountsPaginationSelector]
2954
+ });
2955
+
2956
+ const getAccounts = {
2957
+ __proto__: null,
2958
+ name: name$5,
2959
+ query: query$5
2960
+ };
2961
+
2962
+ const index$6 = {
2963
+ __proto__: null,
2964
+ GetAccount: getAccount,
2965
+ GetAccounts: getAccounts
2966
+ };
2967
+
2968
+ const name$4 = "getBranches";
2969
+ const query$4 = Selector("Query")({
2970
+ [name$4]: [{ data: $("data", "GetBranchesInput!") }, branchSelector]
2971
+ });
2972
+
2973
+ const getBranches = {
2974
+ __proto__: null,
2975
+ name: name$4,
2976
+ query: query$4
2977
+ };
2978
+
2979
+ const name$3 = "getBranches";
2980
+ const query$3 = Selector("Query")({
2981
+ [name$3]: [{ data: $("data", "GetBranchesInput!") }, branchSelectorForUsers]
2982
+ });
2983
+
2984
+ const getPublicBranches = {
2985
+ __proto__: null,
2986
+ name: name$3,
2987
+ query: query$3
2988
+ };
2989
+
2990
+ const index$5 = {
2991
+ __proto__: null,
2992
+ GetBranches: getBranches,
2993
+ GetPublicBranches: getPublicBranches
2994
+ };
2995
+
2996
+ const paymentPaginationSelector = { ...paginationSelector, items: rawPaymentSelector };
2997
+ const name$2 = "getPayments";
2998
+ const query$2 = Selector("Query")({
2999
+ [name$2]: [{ data: $("data", "GetPaymentsInput") }, paymentPaginationSelector]
3000
+ });
3001
+
3002
+ const getPayments = {
3003
+ __proto__: null,
3004
+ query: query$2
3005
+ };
3006
+
3007
+ const index$4 = {
3008
+ __proto__: null,
3009
+ GetPayments: getPayments
3010
+ };
3011
+
3012
+ const rawParticipantApplicationDocumentSelector = {
3013
+ ...rawDocumentSelector,
3014
+ meta: {
3015
+ ...rawDocumentMetaSelector
3016
+ // Общая часть meta
3017
+ // ничего уникального
3018
+ }
3019
+ };
3020
+ Selector("ParticipantApplicationDocument")(rawParticipantApplicationDocumentSelector);
3021
+
3022
+ const rawDecisionDocumentSelector = {
3023
+ ["...on FreeDecisionDocument"]: rawFreeDecisionDocumentSelector,
3024
+ ["...on ParticipantApplicationDecisionDocument"]: rawParticipantApplicationDecisionDocumentSelector
3025
+ };
3026
+ const rawStatementDocumentSelector = {
3027
+ ["...on ParticipantApplicationDocument"]: rawParticipantApplicationDocumentSelector,
3028
+ ["...on ProjectFreeDecisionDocument"]: projectFreeDecisionDocumentSelector
3029
+ };
3030
+ const rawExtendedBlockchainActionSelector = {
3031
+ ...rawBlockchainActionSelector,
3032
+ user: {
3033
+ ["...on Entrepreneur"]: rawEntrepreneurSelector,
3034
+ ["...on Individual"]: rawIndividualSelector,
3035
+ ["...on Organization"]: rawOrganizationSelector
3036
+ }
3037
+ };
3038
+ const rawActDetailSelector = {
3039
+ action: rawExtendedBlockchainActionSelector,
3040
+ document: rawDocumentSelector
3041
+ };
3042
+ const rawDecisionDetailSelector = {
3043
+ action: rawExtendedBlockchainActionSelector,
3044
+ document: rawDecisionDocumentSelector,
3045
+ votes_against: rawExtendedBlockchainActionSelector,
3046
+ votes_for: rawExtendedBlockchainActionSelector
3047
+ };
3048
+ const rawStatementDetailSelector = {
3049
+ action: rawExtendedBlockchainActionSelector,
3050
+ document: rawStatementDocumentSelector
3051
+ };
3052
+ const rawDocumentPackageSelector = {
3053
+ acts: rawActDetailSelector,
3054
+ decision: rawDecisionDetailSelector,
3055
+ links: rawDocumentSelector,
3056
+ statement: rawStatementDetailSelector
3057
+ };
3058
+ Selector("DocumentPackage")(rawDocumentPackageSelector);
3059
+
3060
+ const documentPaginationSelector = { ...paginationSelector, items: rawDocumentPackageSelector };
3061
+ const name$1 = "getDocuments";
3062
+ const query$1 = Selector("Query")({
3063
+ [name$1]: [{ data: $("data", "GetDocumentsInput") }, documentPaginationSelector]
3064
+ });
3065
+
3066
+ const getDocuments = {
3067
+ __proto__: null,
3068
+ query: query$1
3069
+ };
3070
+
3071
+ const index$3 = {
3072
+ __proto__: null,
3073
+ GetDocuments: getDocuments
3074
+ };
3075
+
3076
+ const rawSignedBlockchainDocumentSelector = {
3077
+ hash: true,
3078
+ meta: true,
3079
+ public_key: true,
3080
+ signature: true
3081
+ };
3082
+ Selector("SignedBlockchainDocument")(rawSignedBlockchainDocumentSelector);
3083
+
3084
+ const rawBlockchainDecisionSelector = {
3085
+ approved: true,
3086
+ authorization: rawSignedBlockchainDocumentSelector,
3087
+ authorized: true,
3088
+ authorized_by: true,
3089
+ batch_id: true,
3090
+ coopname: true,
3091
+ created_at: true,
3092
+ expired_at: true,
3093
+ id: true,
3094
+ meta: true,
3095
+ statement: rawSignedBlockchainDocumentSelector,
3096
+ type: true,
3097
+ username: true,
3098
+ validated: true,
3099
+ votes_against: true,
3100
+ votes_for: true
3101
+ };
3102
+ Selector("SignedBlockchainDocument")(rawSignedBlockchainDocumentSelector);
3103
+
3104
+ const rawAgendaSelector = {
3105
+ action: rawBlockchainActionSelector,
3106
+ documents: rawDocumentPackageSelector,
3107
+ table: rawBlockchainDecisionSelector
3108
+ };
3109
+ const agendaSelector = Selector("AgendaWithDocuments")(rawAgendaSelector);
3110
+
3111
+ const name = "getAgenda";
3112
+ const query = Selector("Query")({
3113
+ [name]: agendaSelector
3114
+ });
3115
+
3116
+ const getAgenda = {
3117
+ __proto__: null,
3118
+ name: name,
3119
+ query: query
3120
+ };
3121
+
3122
+ const index$2 = {
3123
+ __proto__: null,
3124
+ GetAgenda: getAgenda
3125
+ };
3126
+
3127
+ const index$1 = {
3128
+ __proto__: null,
3129
+ Accounts: index$6,
3130
+ Agenda: index$2,
3131
+ Branches: index$5,
3132
+ Documents: index$3,
3133
+ Extensions: index$9,
3134
+ PaymentMethods: index$8,
3135
+ Payments: index$4,
3136
+ System: index$7
3137
+ };
3138
+
3139
+ const index = {
3140
+ __proto__: null
3141
+ };
3142
+
3143
+ if (typeof globalThis.WebSocket === "undefined") {
3144
+ globalThis.WebSocket = WebSocket__default;
3145
+ }
3146
+ let currentHeaders = {};
3147
+ function createThunder(baseUrl) {
3148
+ return Thunder(async (query, variables) => {
3149
+ const response = await fetch(baseUrl, {
3150
+ body: JSON.stringify({ query, variables }),
3151
+ method: "POST",
3152
+ headers: {
3153
+ "Content-Type": "application/json",
3154
+ ...currentHeaders
3155
+ // Используем текущие заголовки, включая Authorization
3156
+ }
3157
+ });
3158
+ if (!response.ok) {
3159
+ return new Promise((resolve, reject) => {
3160
+ response.text().then((text) => {
3161
+ try {
3162
+ reject(JSON.parse(text));
3163
+ } catch (err) {
3164
+ reject(text);
3165
+ }
3166
+ }).catch(reject);
3167
+ });
3168
+ }
3169
+ const json = await response.json();
3170
+ if (json.errors) {
3171
+ console.log("json.errors", json.errors);
3172
+ throw json.errors;
3173
+ }
3174
+ return json.data;
3175
+ });
3176
+ }
3177
+ function createClient(options) {
3178
+ currentHeaders = options.headers || {};
3179
+ const thunder = createThunder(options.api_url);
3180
+ const wallet = new Wallet(options);
3181
+ if (options.wif && options.username)
3182
+ wallet.setWif(options.username, options.wif);
3183
+ else if (options.wif && !options.username || !options.wif && options.username) {
3184
+ throw new Error("wif \u0438 username \u0434\u043E\u043B\u0436\u043D\u044B \u0431\u044B\u0442\u044C \u0443\u043A\u0430\u0437\u0430\u043D\u044B \u043E\u0434\u043D\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E");
3185
+ }
3186
+ return {
3187
+ setToken: (token) => {
3188
+ currentHeaders.Authorization = `Bearer ${token}`;
3189
+ },
3190
+ Query: thunder("query"),
3191
+ Mutation: thunder("mutation"),
3192
+ Subscription: Subscription(options.api_url.replace(/^http/, "ws")),
3193
+ Wallet: wallet
3194
+ };
3195
+ }
3196
+
3197
+ exports.Classes = Classes;
3198
+ exports.Mutations = index$a;
3199
+ exports.Queries = index$1;
3200
+ exports.Types = index;
3201
+ exports.Zeus = index$l;
3202
+ exports.createClient = createClient;