-
Notifications
You must be signed in to change notification settings - Fork 267
Expand file tree
/
Copy pathCommands.ts
More file actions
2618 lines (2503 loc) · 90 KB
/
Copy pathCommands.ts
File metadata and controls
2618 lines (2503 loc) · 90 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import type { PermissionsNotificationPayload } from '../../@types/PermissionsService';
import { i18n } from '../../config/locales';
import { sendCommand } from '../api/sendCommand';
import { addDappBypassPermissions } from '../utils/addDappBypassPermissions';
import type { DispatchPairRequestContext } from '../utils/dispatchPairRequest';
import { normalizeHex } from '../utils/normalizeHex';
import { parseMojos } from '../utils/parseMojos';
import { showNotification } from '../utils/showNotification';
export type ParamSchema = {
name: string;
label: () => string;
isOptional?: boolean;
hide?: boolean; // hidden from the confirm dialog - still showed under json details
type: 'string' | 'number' | 'bool' | 'bigint' | 'json';
humanize?: 'mojo-to-xch' | 'mojo-to-cat';
};
type CommandBase = {
title: () => string;
message: () => string;
confirmLabel: () => string;
params: ParamSchema[];
destructive?: boolean;
};
export type DappCommandDefinition = Partial<CommandBase> & {
command: string;
requiresSync?: boolean;
preserveNestedDataKeys?: boolean; // if true nested JSON keys are treated as data, not field names
defaults?: Record<string, unknown>;
handler?: (params: Record<string, unknown>, context: DappCommandHandlerContext) => Promise<Record<string, unknown>>; // routes to `dappHandlers[handlerKey]` instead of the daemon.
transform?: (data: Record<string, unknown>) => unknown;
allowConfirmationBypass?: boolean;
};
export type DappCommandHandlerContext = DispatchPairRequestContext & {
sendNotification: (notification: PermissionsNotificationPayload) => void;
canBypassCommand: (command: string) => boolean;
};
// all optional fields will be overridden with parent command schema in DappCommands
export type DappCommandSchema = CommandBase &
DappCommandDefinition & {
commandId: string;
};
export type CommandSchema = CommandBase & {
dapp?: DappCommandDefinition[];
};
function getOffer(params: Record<string, unknown>, fileContents: boolean) {
return sendCommand('get_offer', 'chia_wallet', {
trade_id: params.offer_id,
file_contents: fileContents,
});
}
export const Commands: Record<string, CommandSchema> = {
'chia_app.show_notification': {
title: () => i18n._(/* i18n */ { id: 'Confirm Notification' }),
message: () => i18n._(/* i18n */ { id: 'This app wants to show you a notification.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Show' }),
params: [
{
name: 'type',
label: () => i18n._(/* i18n */ { id: 'Type' }),
type: 'string',
},
{
name: 'message',
label: () => i18n._(/* i18n */ { id: 'Message' }),
type: 'string',
isOptional: true,
},
{
name: 'url',
label: () => i18n._(/* i18n */ { id: 'URL' }),
type: 'string',
isOptional: true,
},
{
name: 'offer_data',
label: () => i18n._(/* i18n */ { id: 'Offer Data' }),
type: 'string',
isOptional: true,
},
{
name: 'all_fingerprints',
label: () => i18n._(/* i18n */ { id: 'Is notification visible to the paired fingerprint' }),
type: 'bool',
isOptional: true,
},
],
dapp: [
{
command: 'chia_showNotification',
title: () => i18n._(/* i18n */ { id: 'Show Notification' }),
message: () => i18n._(/* i18n */ { id: 'Show notification with offer or general announcement' }),
handler: showNotification,
},
],
},
'chia_app.request_permissions': {
title: () => i18n._(/* i18n */ { id: 'Request Permissions' }),
message: () => i18n._(/* i18n */ { id: 'This app wants to always allow selected commands without confirmation.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Allow' }),
params: [
{
name: 'commands',
label: () => i18n._(/* i18n */ { id: 'Commands' }),
type: 'json',
},
],
dapp: [
{
command: 'chia_requestPermissions',
title: () => i18n._(/* i18n */ { id: 'Request Permissions' }),
message: () => i18n._(/* i18n */ { id: 'Always allow selected commands without asking for confirmation' }),
handler: async (params, context) =>
addDappBypassPermissions(context.pair, params, {
canBypassCommand: context.canBypassCommand,
}),
},
],
},
'chia_wallet.send_transaction': {
title: () => i18n._(/* i18n */ { id: 'Confirm Send Transaction' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this blockchain transaction.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Send' }),
params: [
{
name: 'amount',
label: () => i18n._(/* i18n */ { id: 'Amount' }),
type: 'bigint',
humanize: 'mojo-to-xch',
},
{
name: 'fee',
label: () => i18n._(/* i18n */ { id: 'Fee' }),
type: 'bigint',
humanize: 'mojo-to-xch',
},
{ name: 'address', label: () => i18n._(/* i18n */ { id: 'Address' }), type: 'string' },
{
name: 'wallet_id',
label: () => i18n._(/* i18n */ { id: 'Wallet Id' }),
type: 'number',
hide: true,
},
{
name: 'memos',
label: () => i18n._(/* i18n */ { id: 'Memos' }),
type: 'json',
isOptional: true,
hide: true,
},
{
name: 'puzzle_decorator',
label: () => i18n._(/* i18n */ { id: 'Puzzle Decorator' }),
type: 'json',
isOptional: true,
},
],
dapp: [
{
command: 'chia_sendTransaction',
title: () => i18n._(/* i18n */ { id: 'Send Transaction' }),
requiresSync: true,
defaults: { wallet_id: 1 },
},
],
},
'chia_wallet.cat_spend': {
title: () => i18n._(/* i18n */ { id: 'Confirm CAT Spend' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this CAT spend.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Send' }),
params: [
{ name: 'wallet_id', label: () => i18n._(/* i18n */ { id: 'Wallet Id' }), type: 'number' },
{ name: 'address', label: () => i18n._(/* i18n */ { id: 'Address' }), type: 'string' },
{
name: 'amount',
label: () => i18n._(/* i18n */ { id: 'Amount' }),
type: 'bigint',
humanize: 'mojo-to-cat',
},
{
name: 'fee',
label: () => i18n._(/* i18n */ { id: 'Fee' }),
type: 'bigint',
humanize: 'mojo-to-xch',
},
{
name: 'memos',
label: () => i18n._(/* i18n */ { id: 'Memos' }),
type: 'json',
isOptional: true,
},
],
dapp: [
{
command: 'chia_spendCAT',
title: () => i18n._(/* i18n */ { id: 'Spend CAT' }),
requiresSync: true,
},
],
},
'chia_wallet.nft_transfer_nft': {
title: () => i18n._(/* i18n */ { id: 'Confirm NFT Transfer' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this NFT transfer.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Transfer' }),
params: [
{ name: 'wallet_id', label: () => i18n._(/* i18n */ { id: 'Wallet Id' }), type: 'number' },
{
name: 'nft_coin_ids',
label: () => i18n._(/* i18n */ { id: 'NFT Coin Ids' }),
type: 'json',
},
{
name: 'target_address',
label: () => i18n._(/* i18n */ { id: 'Target Address' }),
type: 'string',
},
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', humanize: 'mojo-to-xch' },
],
dapp: [
{
command: 'chia_transferNFT',
title: () => i18n._(/* i18n */ { id: 'Transfer NFT' }),
},
],
},
'chia_wallet.nft_transfer_bulk': {
title: () => i18n._(/* i18n */ { id: 'Confirm NFT Transfer' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this NFT transfer.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Transfer' }),
params: [
{ name: 'nft_coin_list', label: () => i18n._(/* i18n */ { id: 'NFT Coin List' }), type: 'json' },
{ name: 'target_address', label: () => i18n._(/* i18n */ { id: 'Target Address' }), type: 'string' },
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', humanize: 'mojo-to-xch' },
],
},
'chia_wallet.cancel_offer': {
title: () => i18n._(/* i18n */ { id: 'Confirm Cancel Offer' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this offer cancellation.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Proceed' }),
destructive: true,
params: [
{ name: 'trade_id', label: () => i18n._(/* i18n */ { id: 'Trade Id' }), type: 'string' },
{ name: 'secure', label: () => i18n._(/* i18n */ { id: 'Secure' }), type: 'bool' },
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', humanize: 'mojo-to-xch' },
],
dapp: [
{
command: 'chia_cancelOffer',
title: () => i18n._(/* i18n */ { id: 'Cancel Offer' }),
defaults: {
secure: true,
},
// override list of params to hide secure
params: [
{ name: 'trade_id', label: () => i18n._(/* i18n */ { id: 'Trade Id' }), type: 'string' },
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', humanize: 'mojo-to-xch' },
],
},
],
},
// TODO verify last 3 params
'chia_wallet.create_offer_for_ids': {
title: () => i18n._(/* i18n */ { id: 'Confirm Create Offer for Ids' }),
message: () =>
i18n._(
/* i18n */ {
id: 'Please carefully review and confirm this offer creation. When creating an offer, any assets that are being offered will be locked and unavailable until the offer is accepted or cancelled, resulting in your spendable balance changing.',
},
),
confirmLabel: () => i18n._(/* i18n */ { id: 'Create' }),
params: [
{
name: 'offer',
label: () => i18n._(/* i18n */ { id: 'Wallet Ids and Amounts' }),
type: 'json',
},
{ name: 'driver_dict', label: () => i18n._(/* i18n */ { id: 'Driver Dict' }), type: 'json' },
{
name: 'validate_only',
label: () => i18n._(/* i18n */ { id: 'Validate Only' }),
type: 'bool',
isOptional: true,
},
{
name: 'disable_json_formatting',
label: () => i18n._(/* i18n */ { id: 'Disable JSON Formatting' }),
type: 'bool',
isOptional: true,
},
{
name: 'fee',
label: () => i18n._(/* i18n */ { id: 'Fee' }),
type: 'bigint',
humanize: 'mojo-to-xch',
isOptional: true,
},
// TODO verify rest if needed for DAPP, if not use for dapp separate params
{
name: 'offer_only',
label: () => i18n._(/* i18n */ { id: 'Omit transactions data' }),
type: 'bool',
isOptional: true,
dappAllowed: true,
},
{
name: 'extra_conditions',
label: () => i18n._(/* i18n */ { id: 'Extra Conditions' }),
type: 'json',
isOptional: true,
},
{
name: 'coin_ids',
label: () => i18n._(/* i18n */ { id: 'Coin Ids' }),
type: 'json',
isOptional: true,
},
{
name: 'allow_unsynced',
label: () => i18n._(/* i18n */ { id: 'Allow Unsynced' }),
type: 'bool',
isOptional: true,
},
],
dapp: [
{
command: 'chia_createOfferForIds',
preserveNestedDataKeys: true,
title: () => i18n._(/* i18n */ { id: 'Create Offer for Ids' }),
},
],
},
'chia_wallet.take_offer': {
title: () => i18n._(/* i18n */ { id: 'Confirm Take Offer' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this offer acceptance.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Accept' }),
params: [
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', humanize: 'mojo-to-xch' },
{ name: 'offer', label: () => i18n._(/* i18n */ { id: 'Offer' }), type: 'string' },
// TODO verify rest if needed for DAPP, if not use for dapp separate params
{
name: 'extra_conditions',
label: () => i18n._(/* i18n */ { id: 'Extra Conditions' }),
type: 'json',
isOptional: true,
},
],
dapp: [
{
command: 'chia_takeOffer',
title: () => i18n._(/* i18n */ { id: 'Take Offer' }),
},
],
},
'chia_wallet.sign_message_by_address': {
title: () => i18n._(/* i18n */ { id: 'Confirm Sign Message' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to sign this message?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Sign' }),
params: [
{ name: 'address', label: () => i18n._(/* i18n */ { id: 'Address' }), type: 'string' },
{ name: 'message', label: () => i18n._(/* i18n */ { id: 'Message' }), type: 'string' },
{
name: 'is_hex',
label: () => i18n._(/* i18n */ { id: 'Message Is Hex Encoded String' }),
type: 'bool',
isOptional: true,
},
{
name: 'safe_mode',
label: () => i18n._(/* i18n */ { id: 'Safe Mode' }),
type: 'bool',
isOptional: true,
},
],
dapp: [
{
command: 'chia_signMessageByAddress',
title: () => i18n._(/* i18n */ { id: 'Sign Message by Address' }),
},
],
},
'chia_wallet.sign_message_by_id': {
title: () => i18n._(/* i18n */ { id: 'Confirm Sign Message' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to sign this message?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Sign' }),
params: [
{ name: 'id', label: () => i18n._(/* i18n */ { id: 'Id' }), type: 'string' },
{ name: 'message', label: () => i18n._(/* i18n */ { id: 'Message' }), type: 'string' },
{
name: 'is_hex',
label: () => i18n._(/* i18n */ { id: 'Message Is Hex Encoded String' }),
type: 'bool',
isOptional: true,
},
],
dapp: [
{
command: 'chia_signMessageById',
title: () => i18n._(/* i18n */ { id: 'Sign Message by Id' }),
},
],
},
'chia_wallet.nft_set_nft_did': {
title: () => i18n._(/* i18n */ { id: 'Confirm Move NFT to DID' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to move this NFT to the specified profile?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Move' }),
params: [
{ name: 'wallet_id', label: () => i18n._(/* i18n */ { id: 'Wallet Id' }), type: 'number' },
{
name: 'nft_launcher_id',
label: () => i18n._(/* i18n */ { id: 'NFT Launcher Id' }),
type: 'string',
},
{
name: 'nft_coin_ids',
label: () => i18n._(/* i18n */ { id: 'NFT Coin Ids' }),
type: 'json',
},
{ name: 'did', label: () => i18n._(/* i18n */ { id: 'DID' }), type: 'string' },
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', humanize: 'mojo-to-xch' },
],
dapp: [
{
command: 'chia_setNFTDID',
title: () => i18n._(/* i18n */ { id: 'Set NFT DID' }),
},
],
},
// TODO verify param names in chia-blockchain
'chia_wallet.nft_set_did_bulk': {
title: () => i18n._(/* i18n */ { id: 'Confirm Move NFTs to DID' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to move these NFTs to the specified profile?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Move' }),
params: [
{ name: 'nft_coin_list', label: () => i18n._(/* i18n */ { id: 'NFT Coin List' }), type: 'json' },
{ name: 'did_id', label: () => i18n._(/* i18n */ { id: 'DID' }), type: 'string' },
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint' },
],
},
// TODO verify param names in chia-blockchain
'chia_wallet.set_auto_claim': {
title: () => i18n._(/* i18n */ { id: 'Confirm Set Auto Claim' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to set auto claim?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Set' }),
params: [
{ name: 'enabled', label: () => i18n._(/* i18n */ { id: 'Enabled' }), type: 'bool' },
{ name: 'tx_fee', label: () => i18n._(/* i18n */ { id: 'Transaction Fee' }), type: 'bigint' },
{ name: 'min_amount', label: () => i18n._(/* i18n */ { id: 'Min Amount' }), type: 'bigint' },
],
},
'chia_wallet.create_new_wallet': {
title: () => i18n._(/* i18n */ { id: 'Confirm Create New Wallet' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to create a new wallet?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Create' }),
params: [
{ name: 'name', label: () => i18n._(/* i18n */ { id: 'Name' }), type: 'string', isOptional: true },
{ name: 'wallet_name', label: () => i18n._(/* i18n */ { id: 'Name' }), type: 'string', isOptional: true },
{ name: 'wallet_type', label: () => i18n._(/* i18n */ { id: 'Type' }), type: 'string' },
{ name: 'asset_id', label: () => i18n._(/* i18n */ { id: 'Asset ID' }), type: 'string', isOptional: true },
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', isOptional: true },
],
dapp: [
{
command: 'chia_addCATToken',
title: () => i18n._(/* i18n */ { id: 'Add CAT Token' }),
params: [
{ name: 'name', label: () => i18n._(/* i18n */ { id: 'Wallet Name' }), type: 'string' },
{ name: 'asset_id', label: () => i18n._(/* i18n */ { id: 'Asset ID' }), type: 'string' },
],
defaults: {
wallet_type: 'cat_wallet',
mode: 'existing',
fee: 0,
},
},
{
command: 'chia_createNewDIDWallet',
title: () => i18n._(/* i18n */ { id: 'Confirm Create DID Wallet' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm creating this DID wallet.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Create' }),
params: [
{ name: 'amount', label: () => i18n._(/* i18n */ { id: 'Amount' }), type: 'bigint', humanize: 'mojo-to-xch' },
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', humanize: 'mojo-to-xch' },
{ name: 'backup_dids', label: () => i18n._(/* i18n */ { id: 'Backup DIDs' }), type: 'json' },
{
name: 'num_of_backup_ids_needed',
label: () => i18n._(/* i18n */ { id: 'Number of Backup Ids Needed' }),
type: 'number',
},
],
defaults: {
wallet_type: 'did_wallet',
did_type: 'new',
},
},
{
command: 'chia_createNewRemoteWallet',
title: () => i18n._(/* i18n */ { id: 'Create new Remote Wallet' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm creating this remote wallet.' }),
params: [
{ name: 'name', label: () => i18n._(/* i18n */ { id: 'Name' }), type: 'string', isOptional: true },
{
name: 'allow_unsynced',
label: () => i18n._(/* i18n */ { id: 'Allow Unsynced' }),
type: 'bool',
isOptional: true,
},
],
defaults: {
wallet_type: 'remote_wallet',
},
},
],
},
'chia_wallet.delete_key': {
title: () => i18n._(/* i18n */ { id: 'Confirm Delete Wallet' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to delete this wallet?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Delete' }),
destructive: true,
params: [{ name: 'fingerprint', label: () => i18n._(/* i18n */ { id: 'Fingerprint' }), type: 'number' }],
},
'chia_harvester.delete_plot': {
title: () => i18n._(/* i18n */ { id: 'Confirm Delete Plot' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to delete this plot?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Delete' }),
destructive: true,
params: [{ name: 'filename', label: () => i18n._(/* i18n */ { id: 'Filename' }), type: 'string' }],
},
'chia_harvester.add_plot_directory': {
title: () => i18n._(/* i18n */ { id: 'Confirm Add Plot Directory' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to add this plot directory?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Add' }),
params: [{ name: 'dirname', label: () => i18n._(/* i18n */ { id: 'Directory' }), type: 'string' }],
},
'chia_harvester.remove_plot_directory': {
title: () => i18n._(/* i18n */ { id: 'Confirm Remove Plot Directory' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to remove this plot directory?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Remove' }),
destructive: true,
params: [{ name: 'dirname', label: () => i18n._(/* i18n */ { id: 'Directory' }), type: 'string' }],
},
'chia_full_node.open_connection': {
title: () => i18n._(/* i18n */ { id: 'Confirm Open Connection' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to open a connection to the specified node?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Connect' }),
params: [
{ name: 'host', label: () => i18n._(/* i18n */ { id: 'Host' }), type: 'string' },
{ name: 'port', label: () => i18n._(/* i18n */ { id: 'Port' }), type: 'string' },
],
},
'chia_full_node.close_connection': {
title: () => i18n._(/* i18n */ { id: 'Confirm Disconnect' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to disconnect from the specified node?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Disconnect' }),
destructive: true,
params: [
{
name: 'node_id',
label: () => i18n._(/* i18n */ { id: 'Node ID' }),
type: 'string',
},
],
},
'chia_farmer.close_connection': {
title: () => i18n._(/* i18n */ { id: 'Confirm Disconnect' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to disconnect from the specified farmer?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Disconnect' }),
destructive: true,
params: [
{
name: 'node_id',
label: () => i18n._(/* i18n */ { id: 'Node ID' }),
type: 'string',
},
],
},
'chia_farmer.set_payout_instructions': {
title: () => i18n._(/* i18n */ { id: 'Confirm Set Payout Instructions' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to set payout instructions?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Set' }),
params: [
{ name: 'payout_instructions', label: () => i18n._(/* i18n */ { id: 'Payout Instructions' }), type: 'string' },
],
},
'daemon.stop_plotting': {
title: () => i18n._(/* i18n */ { id: 'Confirm Stop Plotting' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to stop plotting?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Stop' }),
destructive: true,
params: [{ name: 'id', label: () => i18n._(/* i18n */ { id: 'ID' }), type: 'string' }],
},
'chia_wallet.log_in': {
title: () => i18n._(/* i18n */ { id: 'Confirm Log In' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to switch to this wallet key?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Log In' }),
params: [{ name: 'fingerprint', label: () => i18n._(/* i18n */ { id: 'Fingerprint' }), type: 'number' }],
},
'chia_wallet.spend_clawback_coins': {
title: () => i18n._(/* i18n */ { id: 'Confirm Clawback Spend' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this clawback spend.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Send' }),
params: [
{ name: 'coin_ids', label: () => i18n._(/* i18n */ { id: 'Coin Ids' }), type: 'json' },
{ name: 'fee', label: () => i18n._(/* i18n */ { id: 'Fee' }), type: 'bigint', humanize: 'mojo-to-xch' },
],
dapp: [
{
command: 'chia_spendClawbackCoins',
title: () => i18n._(/* i18n */ { id: 'Claw back or claim claw back transaction' }),
requiresSync: true,
},
],
},
'chia_wallet.push_transactions': {
title: () => i18n._(/* i18n */ { id: 'Confirm Push Transactions' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm pushing this transaction bundle.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Push' }),
params: [
{
name: 'transactions',
label: () => i18n._(/* i18n */ { id: 'Transactions' }),
type: 'json',
},
{
name: 'fee',
label: () => i18n._(/* i18n */ { id: 'Fee' }),
type: 'bigint',
humanize: 'mojo-to-xch',
isOptional: true,
},
{
name: 'push',
label: () => i18n._(/* i18n */ { id: 'Push' }),
type: 'bool',
isOptional: true,
},
{
name: 'sign',
label: () => i18n._(/* i18n */ { id: 'Sign' }),
type: 'bool',
isOptional: true,
},
// TODO verify param names in chia-blockchain
{
name: 'allow_unsynced',
label: () => i18n._(/* i18n */ { id: 'Allow Unsynced' }),
type: 'bool',
isOptional: true,
},
],
dapp: [
{
command: 'chia_pushTransactions',
title: () => i18n._(/* i18n */ { id: 'Push Transactions' }),
message: () => i18n._(/* i18n */ { id: 'Push a list of transactions to the blockchain via the wallet' }),
},
],
},
'chia_full_node.push_tx': {
title: () => i18n._(/* i18n */ { id: 'Confirm Push Transaction' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm pushing this transaction.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Push' }),
params: [{ name: 'spend_bundle', label: () => i18n._(/* i18n */ { id: 'Spend Bundle' }), type: 'json' }],
dapp: [
{
command: 'chia_pushTx',
title: () => i18n._(/* i18n */ { id: 'Push Transaction' }),
message: () => i18n._(/* i18n */ { id: 'Push a spend bundle (transaction) to the blockchain' }),
},
],
},
'chia_wallet.nft_mint_nft': {
title: () => i18n._(/* i18n */ { id: 'Confirm Mint NFT' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this NFT mint.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Mint' }),
params: [
{ name: 'wallet_id', label: () => i18n._(/* i18n */ { id: 'Wallet Id' }), type: 'number' },
{
name: 'royalty_address',
label: () => i18n._(/* i18n */ { id: 'Royalty Address' }),
type: 'string',
isOptional: true,
},
{
name: 'royalty_percentage',
label: () => i18n._(/* i18n */ { id: 'Royalty Percentage' }),
type: 'number',
isOptional: true,
},
{
name: 'target_address',
label: () => i18n._(/* i18n */ { id: 'Target Address' }),
type: 'string',
isOptional: true,
},
{ name: 'uris', label: () => i18n._(/* i18n */ { id: 'Uris' }), type: 'json' },
{ name: 'hash', label: () => i18n._(/* i18n */ { id: 'Hash' }), type: 'string' },
{ name: 'meta_uris', label: () => i18n._(/* i18n */ { id: 'Meta Uris' }), type: 'json' },
{
name: 'meta_hash',
label: () => i18n._(/* i18n */ { id: 'Meta Hash' }),
type: 'string',
isOptional: true,
},
{
name: 'license_uris',
label: () => i18n._(/* i18n */ { id: 'License Uris' }),
type: 'json',
},
{
name: 'license_hash',
label: () => i18n._(/* i18n */ { id: 'License Hash' }),
type: 'string',
isOptional: true,
},
{
name: 'edition_number',
label: () => i18n._(/* i18n */ { id: 'Edition Number' }),
type: 'number',
isOptional: true,
},
{
name: 'edition_total',
label: () => i18n._(/* i18n */ { id: 'Edition Total' }),
type: 'number',
isOptional: true,
},
{
name: 'did_id',
label: () => i18n._(/* i18n */ { id: 'DID Id' }),
type: 'string',
isOptional: true,
},
{
name: 'fee',
label: () => i18n._(/* i18n */ { id: 'Fee' }),
type: 'bigint',
isOptional: true,
humanize: 'mojo-to-xch',
},
],
dapp: [
{
command: 'chia_mintNFT',
title: () => i18n._(/* i18n */ { id: 'Mint NFT' }),
},
],
},
'chia_wallet.nft_mint_bulk': {
title: () => i18n._(/* i18n */ { id: 'Confirm Bulk Mint NFTs' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this bulk NFT mint.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Mint' }),
params: [
{ name: 'wallet_id', label: () => i18n._(/* i18n */ { id: 'Wallet Id' }), type: 'number' },
{
name: 'metadata_list',
label: () => i18n._(/* i18n */ { id: 'Metadata List' }),
type: 'json',
},
{
name: 'royalty_percentage',
label: () => i18n._(/* i18n */ { id: 'Royalty Percentage' }),
type: 'number',
isOptional: true,
},
{
name: 'royalty_address',
label: () => i18n._(/* i18n */ { id: 'Royalty Address' }),
type: 'string',
isOptional: true,
},
{
name: 'target_list',
label: () => i18n._(/* i18n */ { id: 'Target List' }),
type: 'json',
isOptional: true,
},
{
name: 'mint_number_start',
label: () => i18n._(/* i18n */ { id: 'Mint Start Number' }),
type: 'number',
isOptional: true,
},
{
name: 'mint_total',
label: () => i18n._(/* i18n */ { id: 'Mint Total' }),
type: 'number',
isOptional: true,
},
{
name: 'xch_coins',
label: () => i18n._(/* i18n */ { id: 'XCH Coins' }),
type: 'json',
isOptional: true,
},
{
name: 'xch_change_target',
label: () => i18n._(/* i18n */ { id: 'XCH Change Target' }),
type: 'string',
isOptional: true,
},
{
name: 'new_innerpuzhash',
label: () => i18n._(/* i18n */ { id: 'New Inner Puzzle Hash' }),
type: 'json',
isOptional: true,
},
{
name: 'new_p2_puzhash',
label: () => i18n._(/* i18n */ { id: 'New P2 Puzzle Hash' }),
type: 'string',
isOptional: true,
},
{
name: 'did_coin',
label: () => i18n._(/* i18n */ { id: 'DID Coin Dictionary' }),
type: 'json',
isOptional: true,
},
{
name: 'did_lineage_parent',
label: () => i18n._(/* i18n */ { id: 'DID Lineage Parent' }),
type: 'string',
isOptional: true,
},
{
name: 'mint_from_did',
label: () => i18n._(/* i18n */ { id: 'Mint From DID' }),
type: 'bool',
isOptional: true,
},
{
name: 'fee',
label: () => i18n._(/* i18n */ { id: 'Fee' }),
type: 'bigint',
humanize: 'mojo-to-xch',
isOptional: true,
},
{
name: 'reuse_puzhash',
label: () => i18n._(/* i18n */ { id: 'Reuse Puzzle Hash' }),
type: 'bool',
isOptional: true,
},
],
dapp: [
{
command: 'chia_mintBulk',
title: () => i18n._(/* i18n */ { id: 'Mint Bulk' }),
message: () => i18n._(/* i18n */ { id: 'Create a spend bundle to mint multiple NFTs' }),
},
],
},
'chia_wallet.did_find_lost_did': {
title: () => i18n._(/* i18n */ { id: 'Confirm Find Lost DID' }),
message: () => i18n._(/* i18n */ { id: 'Are you sure you want to recover this DID?' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Recover' }),
params: [
{ name: 'coin_id', label: () => i18n._(/* i18n */ { id: 'Coin Id' }), type: 'string' },
{
name: 'recovery_list_hash',
label: () => i18n._(/* i18n */ { id: 'Recovery List Hash' }),
type: 'string',
isOptional: true,
},
{
name: 'num_verification',
label: () => i18n._(/* i18n */ { id: 'Required Number of DIDs for Verification' }),
type: 'number',
isOptional: true,
},
{
name: 'metadata',
label: () => i18n._(/* i18n */ { id: 'DID Metadata' }),
type: 'string',
isOptional: true,
},
],
dapp: [
{
command: 'chia_findLostDID',
title: () => i18n._(/* i18n */ { id: 'Find Lost DID' }),
},
],
},
'chia_wallet.did_update_metadata': {
title: () => i18n._(/* i18n */ { id: 'Confirm Update DID Metadata' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this DID metadata update.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Update' }),
params: [
{ name: 'wallet_id', label: () => i18n._(/* i18n */ { id: 'Wallet Id' }), type: 'number' },
{
name: 'metadata',
label: () => i18n._(/* i18n */ { id: 'DID Metadata' }),
type: 'json',
isOptional: true,
},
{
name: 'fee',
label: () => i18n._(/* i18n */ { id: 'Fee' }),
type: 'bigint',
humanize: 'mojo-to-xch',
isOptional: true,
},
{
name: 'reuse_puzhash',
label: () => i18n._(/* i18n */ { id: 'Reuse Puzzle Hash' }),
type: 'bool',
isOptional: true,
},
],
dapp: [
{
command: 'chia_updateDIDMetadata',
preserveNestedDataKeys: true,
title: () => i18n._(/* i18n */ { id: 'Update DID Metadata' }),
},
],
},
'chia_wallet.did_transfer_did': {
title: () => i18n._(/* i18n */ { id: 'Confirm Transfer DID' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm this DID transfer.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Transfer' }),
params: [
{ name: 'wallet_id', label: () => i18n._(/* i18n */ { id: 'Wallet Id' }), type: 'number' },
{ name: 'inner_address', label: () => i18n._(/* i18n */ { id: 'Inner Address' }), type: 'string' },
{
name: 'fee',
label: () => i18n._(/* i18n */ { id: 'Fee' }),
type: 'bigint',
humanize: 'mojo-to-xch',
isOptional: true,
},
{
name: 'with_recovery_info',
label: () => i18n._(/* i18n */ { id: 'With Recovery Info' }),
type: 'bool',
isOptional: true,
},
{
name: 'reuse_puzhash',
label: () => i18n._(/* i18n */ { id: 'Reuse Puzzle Hash' }),
type: 'bool',
isOptional: true,
},
],
dapp: [
{
command: 'chia_transferDID',
title: () => i18n._(/* i18n */ { id: 'Transfer DID' }),
},
],
},
'chia_wallet.did_set_wallet_name': {
title: () => i18n._(/* i18n */ { id: 'Confirm Set DID Name' }),
message: () => i18n._(/* i18n */ { id: 'Please carefully review and confirm renaming this DID wallet.' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Set' }),
params: [
{ name: 'wallet_id', label: () => i18n._(/* i18n */ { id: 'Wallet Id' }), type: 'number' },