-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.d.ts
4703 lines (4573 loc) · 185 KB
/
index.d.ts
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
declare module 'proton-tsc/allow/allow.contract' {
import { Name, Singleton, Contract, ExtendedSymbol, TableStore } from 'proton-tsc';
import { AllowedActor, AllowedToken, AllowGlobals } from 'proton-tsc/allow/allow.tables';
export class AllowContract extends Contract {
contract: Name;
parentContract: Name;
allowedActorTable: TableStore<AllowedActor>;
allowedTokenTable: TableStore<AllowedToken>;
allowGlobalsSingleton: Singleton<AllowGlobals>;
/**
* Set the global variables
* @param {boolean} isPaused - boolean,
* @param {boolean} isActorStrict - If true, then actors must be registered with the system.
* @param {boolean} isTokenStrict - boolean
*/
setglobals(isPaused: boolean, isActorStrict: boolean, isTokenStrict: boolean, isTokensEnabled: boolean, isNftsEnabled: boolean, isContractsEnabled: boolean): void;
/**
* It updates the isAllowed field of the token.
* @param {ExtendedSymbol} token - The token to be updated.
* @param {boolean} isBlocked - boolean
*/
settoken(token: ExtendedSymbol, isAllowed: boolean, isBlocked: boolean): void;
/**
* It sets the isAllowed field of the actor to the value of isAllowed.
* @param {Name} actor - Name
* @param {boolean} isAllowed - boolean
*/
setactor(actor: Name, isAllowed: boolean, isBlocked: boolean): void;
/**
* Helper functions
*/
protected checkContractIsNotPaused(): void;
protected checkActorIsAllowed(actor: Name, message?: string): void;
protected checkTokenIsAllowed(token: ExtendedSymbol, message?: string): void;
protected checkNftsAreEnabled(message?: string): void;
protected checkTokensAreEnabled(message?: string): void;
protected findAllowedToken(token: ExtendedSymbol): AllowedToken | null;
protected isTokenAllowed(token: ExtendedSymbol): boolean;
protected isActorAllowed(actor: Name): boolean;
protected isTokensEnabled(): boolean;
protected isNftsEnabled(): boolean;
protected isContractsEnabled(): boolean;
protected isContractPaused(): boolean;
}
}
declare module 'proton-tsc/allow/allow.spec' {
export {};
}
declare module 'proton-tsc/allow/allow.tables' {
/// <reference types="assembly" />
import { Name, Table, U128, ExtendedSymbol } from "proton-tsc";
export class AllowGlobals extends Table {
isPaused: boolean;
isActorStrict: boolean;
isTokenStrict: boolean;
isTokensEnabled: boolean;
isNftsEnabled: boolean;
isContractsEnabled: boolean;
constructor(isPaused?: boolean, isActorStrict?: boolean, isTokenStrict?: boolean, isTokensEnabled?: boolean, isNftsEnabled?: boolean, isContractsEnabled?: boolean);
}
export class AllowedActor extends Table {
actor: Name;
isAllowed: boolean;
isBlocked: boolean;
constructor(actor?: Name, isAllowed?: boolean, isBlocked?: boolean);
get primary(): u64;
}
export class AllowedToken extends Table {
index: u64;
token: ExtendedSymbol;
isAllowed: boolean;
isBlocked: boolean;
constructor(index?: u64, token?: ExtendedSymbol, isAllowed?: boolean, isBlocked?: boolean);
get primary(): u64;
get byToken(): U128;
set byToken(value: U128);
}
}
declare module 'proton-tsc/allow/allow.utils' {
import { ExtendedSymbol, U128 } from "proton-tsc";
export const extendedSymbolToU128: (extSym: ExtendedSymbol) => U128;
export const U128ToExtSym: (value: U128) => ExtendedSymbol;
}
declare module 'proton-tsc/allow/allow_test.contract' {
import { Name, ExtendedSymbol } from 'proton-tsc';
import { AllowContract } from 'proton-tsc/allow';
export class AllowTestContract extends AllowContract {
/**
* Helper actions
*/
testpaused(): void;
testactor(actor: Name, message: string): void;
testtoken(token: ExtendedSymbol, message: string): void;
}
}
declare module 'proton-tsc/allow/fixtures/allowed-fixtures.spec' {
export {};
}
declare module 'proton-tsc/allow/fixtures/allowed-fixtures.test' {
import { Fixtures } from "@proton/vert";
export const allowFixtures: Fixtures;
}
declare module 'proton-tsc/allow' {
export * from 'proton-tsc/allow/allow.contract';
export * from 'proton-tsc/allow/allow.tables';
export * from 'proton-tsc/allow/allow.utils';
}
declare module 'proton-tsc/allow/target/allow.contract' {
/// <reference types="assembly" />
import { Name, Singleton, Contract, ExtendedSymbol, TableStore } from 'proton-tsc/allow';
import { AllowedActor, AllowedToken, AllowGlobals } from 'proton-tsc/allow/target/allow.tables';
export class AllowContract extends Contract {
contract: Name;
parentContract: Name;
allowedActorTable: TableStore<AllowedActor>;
allowedTokenTable: TableStore<AllowedToken>;
allowGlobalsSingleton: Singleton<AllowGlobals>;
/**
* Set the global variables
* @param {boolean} isPaused - boolean,
* @param {boolean} isActorStrict - If true, then actors must be registered with the system.
* @param {boolean} isTokenStrict - boolean
*/
setglobals(isPaused: boolean, isActorStrict: boolean, isTokenStrict: boolean, isTokensEnabled: boolean, isNftsEnabled: boolean, isContractsEnabled: boolean): void;
/**
* It updates the isAllowed field of the token.
* @param {ExtendedSymbol} token - The token to be updated.
* @param {boolean} isBlocked - boolean
*/
settoken(token: ExtendedSymbol, isAllowed: boolean, isBlocked: boolean): void;
/**
* It sets the isAllowed field of the actor to the value of isAllowed.
* @param {Name} actor - Name
* @param {boolean} isAllowed - boolean
*/
setactor(actor: Name, isAllowed: boolean, isBlocked: boolean): void;
/**
* Helper functions
*/
protected checkContractIsNotPaused(): void;
protected checkActorIsAllowed(actor: Name, message?: string): void;
protected checkTokenIsAllowed(token: ExtendedSymbol, message?: string): void;
protected checkNftsAreEnabled(message?: string): void;
protected checkTokensAreEnabled(message?: string): void;
protected findAllowedToken(token: ExtendedSymbol): AllowedToken | null;
protected isTokenAllowed(token: ExtendedSymbol): boolean;
protected isActorAllowed(actor: Name): boolean;
protected isTokensEnabled(): boolean;
protected isNftsEnabled(): boolean;
protected isContractsEnabled(): boolean;
protected isContractPaused(): boolean;
}
export function apply(receiver: u64, firstReceiver: u64, action: u64): void;
}
declare module 'proton-tsc/allow/target/allow.tables' {
/// <reference types="assembly" />
import * as _chain from "as-chain";
import { Name, U128, ExtendedSymbol } from "proton-tsc/allow";
export class AllowGlobalsDB extends _chain.MultiIndex<AllowGlobals> {
}
export class AllowGlobals implements _chain.MultiIndexValue {
isPaused: boolean;
isActorStrict: boolean;
isTokenStrict: boolean;
isTokensEnabled: boolean;
isNftsEnabled: boolean;
isContractsEnabled: boolean;
constructor(isPaused?: boolean, isActorStrict?: boolean, isTokenStrict?: boolean, isTokensEnabled?: boolean, isNftsEnabled?: boolean, isContractsEnabled?: boolean);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): _chain.Singleton<AllowGlobals>;
}
export class AllowedActorDB extends _chain.MultiIndex<AllowedActor> {
}
export class AllowedActor implements _chain.MultiIndexValue {
actor: Name;
isAllowed: boolean;
isBlocked: boolean;
constructor(actor?: Name, isAllowed?: boolean, isBlocked?: boolean);
get primary(): u64;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): AllowedActorDB;
}
export class AllowedTokenDB extends _chain.MultiIndex<AllowedToken> {
get byTokenDB(): _chain.IDX128;
updateByToken(idxIt: _chain.SecondaryIterator, value: U128, payer: Name): void;
}
export class AllowedToken implements _chain.MultiIndexValue {
index: u64;
token: ExtendedSymbol;
isAllowed: boolean;
isBlocked: boolean;
constructor(index?: u64, token?: ExtendedSymbol, isAllowed?: boolean, isBlocked?: boolean);
get primary(): u64;
get byToken(): U128;
set byToken(value: U128);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): AllowedTokenDB;
}
}
declare module 'proton-tsc/allow/target/allow_test.contract' {
/// <reference types="assembly" />
import { Name, ExtendedSymbol } from 'proton-tsc/allow';
import { AllowContract } from 'proton-tsc/allow/target';
export class AllowTestContract extends AllowContract {
/**
* Helper actions
*/
testpaused(): void;
testactor(actor: Name, message: string): void;
testtoken(token: ExtendedSymbol, message: string): void;
}
export function apply(receiver: u64, firstReceiver: u64, action: u64): void;
}
declare module 'proton-tsc/allow/target' {
/// <reference types="assembly" />
import * as _chain from "as-chain";
import { PermissionLevel, PublicKey, Name } from "proton-tsc";
export class KeyWeight implements _chain.Packer {
key: PublicKey;
weight: u16;
constructor(key?: PublicKey, weight?: u16);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
export class PermissionLevelWeight implements _chain.Packer {
permission: PermissionLevel;
weight: u16;
constructor(permission?: PermissionLevel, weight?: u16);
static from(actor: Name, permission: string, weight: u16): PermissionLevelWeight;
toAuthority(): Authority;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
export class WaitWeight implements _chain.Packer {
waitSec: u16;
weight: u16;
constructor(waitSec?: u16, weight?: u16);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
export class Authority implements _chain.Packer {
threshold: u32;
keys: KeyWeight[];
accounts: PermissionLevelWeight[];
waits: WaitWeight[];
constructor(threshold?: u32, keys?: KeyWeight[], accounts?: PermissionLevelWeight[], waits?: WaitWeight[]);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
}
declare module 'proton-tsc/allow/target/rng.inline' {
/// <reference types="assembly" />
import * as _chain from "as-chain";
import { Name } from "proton-tsc";
export const RNG_CONTRACT: _chain.Name;
export function sendRequestRandom(contract: Name, customerId: u64, signingValue: u64): void;
}
declare module 'proton-tsc/atomicassets/atomicassets.constants' {
/// <reference types="assembly" />
import { Name } from "proton-tsc";
export const MAX_MARKET_FEE: f64;
export const RESERVED: u64;
export const ATOMICASSETS_CONTRACT: Name;
}
declare module 'proton-tsc/atomicassets/atomicassets.contract' {
export {};
}
declare module 'proton-tsc/atomicassets/atomicassets.inline' {
/// <reference types="assembly" />
import { Name, Symbol, Asset, ActionData } from "proton-tsc";
import { AtomicAttribute, AtomicFormat } from "proton-tsc/atomicassets/atomicdata";
export class TransferNfts extends ActionData {
from: Name;
to: Name;
asset_ids: u64[];
memo: string;
constructor(from?: Name, to?: Name, asset_ids?: u64[], memo?: string);
}
export class AdminColEdit extends ActionData {
collectionFormatExtension: AtomicFormat[];
constructor(collectionFormatExtension?: AtomicFormat[]);
}
export class SetVersion extends ActionData {
newVersion: string;
constructor(newVersion?: string);
}
export class AddConfigToken extends ActionData {
tokenContract: Name;
tokenSymbol: Symbol;
constructor(tokenContract?: Name, tokenSymbol?: Symbol);
}
export class CreateCollection extends ActionData {
author: Name;
collection_name: Name;
allow_notify: boolean;
authorized_accounts: Name[];
notify_accounts: Name[];
market_fee: f64;
data: AtomicAttribute[];
constructor(author?: Name, collection_name?: Name, allow_notify?: boolean, authorized_accounts?: Name[], notify_accounts?: Name[], market_fee?: f64, data?: AtomicAttribute[]);
}
export class SetCollectionData extends ActionData {
collection_name: Name;
data: AtomicAttribute[];
constructor(collection_name?: Name, data?: AtomicAttribute[]);
}
export class AddCollectionAuth extends ActionData {
collection_name: Name;
account_to_add: Name;
constructor(collection_name?: Name, account_to_add?: Name);
}
export class RemoveCollectionAuth extends ActionData {
collection_name: Name;
account_to_remove: Name;
constructor(collection_name?: Name, account_to_remove?: Name);
}
export class AddNotifyAccount extends ActionData {
collection_name: Name;
account_to_add: Name;
constructor(collection_name?: Name, account_to_add?: Name);
}
export class RemoveNotifyAccount extends ActionData {
collection_name: Name;
account_to_remove: Name;
constructor(collection_name?: Name, account_to_remove?: Name);
}
export class SetMarketFee extends ActionData {
collection_name: Name;
market_fee: f64;
constructor(collection_name?: Name, market_fee?: f64);
}
export class ForbidNotify extends ActionData {
collection_name: Name;
constructor(collection_name?: Name);
}
export class CreateSchema extends ActionData {
authorized_creator: Name;
collection_name: Name;
schema_name: Name;
schema_format: AtomicFormat[];
constructor(authorized_creator?: Name, collection_name?: Name, schema_name?: Name, schema_format?: AtomicFormat[]);
}
export class ExtendSchema extends ActionData {
authorized_editor: Name;
collection_name: Name;
schema_name: Name;
schema_format_extension: AtomicFormat[];
constructor(authorized_editor?: Name, collection_name?: Name, schema_name?: Name, schema_format_extension?: AtomicFormat[]);
}
export class CreateTemplate extends ActionData {
authorized_creator: Name;
collection_name: Name;
schema_name: Name;
transferable: boolean;
burnable: boolean;
max_supply: u32;
immutable_data: AtomicAttribute[];
constructor(authorized_creator?: Name, collection_name?: Name, schema_name?: Name, transferable?: boolean, burnable?: boolean, max_supply?: u32, immutable_data?: AtomicAttribute[]);
}
export class LockTemplate extends ActionData {
authorized_editor: Name;
collection_name: Name;
template_id: i32;
constructor(authorized_editor?: Name, collection_name?: Name, template_id?: i32);
}
export class MintAsset extends ActionData {
authorized_minter: Name;
collection_name: Name;
schema_name: Name;
template_id: i32;
newasset_owner: Name;
immutable_data: AtomicAttribute[];
mutable_data: AtomicAttribute[];
tokens_to_back: Asset[];
constructor(authorized_minter?: Name, collection_name?: Name, schema_name?: Name, template_id?: i32, newasset_owner?: Name, immutable_data?: AtomicAttribute[], mutable_data?: AtomicAttribute[], tokens_to_back?: Asset[]);
}
export class SetAssetData extends ActionData {
authorized_editor: Name;
asset_owner: Name;
asset_id: u64;
new_mutable_data: AtomicAttribute[];
constructor(authorized_editor?: Name, asset_owner?: Name, asset_id?: u64, new_mutable_data?: AtomicAttribute[]);
}
export class Withdraw extends ActionData {
owner: Name;
token_to_withdraw: Asset;
constructor(owner?: Name, token_to_withdraw?: Asset);
}
export class BackAsset extends ActionData {
payer: Name;
asset_owner: Name;
asset_id: u64;
token_to_back: Asset;
constructor(payer?: Name, asset_owner?: Name, asset_id?: u64, token_to_back?: Asset);
}
export class BurnAsset extends ActionData {
asset_owner: Name;
asset_id: u64;
constructor(asset_owner?: Name, asset_id?: u64);
}
export class CreateOffer extends ActionData {
sender: Name;
recipient: Name;
sender_asset_ids: u64[];
recipient_asset_ids: u64[];
memo: string;
constructor(sender?: Name, recipient?: Name, sender_asset_ids?: u64[], recipient_asset_ids?: u64[], memo?: string);
}
export class CancelOffer extends ActionData {
offer_id: u64;
constructor(offer_id?: u64);
}
export class AcceptOffer extends ActionData {
offer_id: u64;
constructor(offer_id?: u64);
}
export class DeclineOffer extends ActionData {
offer_id: u64;
constructor(offer_id?: u64);
}
export class PayOfferRam extends ActionData {
payer: Name;
offer_id: u64;
constructor(payer?: Name, offer_id?: u64);
}
/**
* Send a transfer action to the contract with the given parameters
* @param {Name} from - Name of the account that is sending the NFTs
* @param {Name} to - Name of the account to transfer the NFTs to.
* @param {u64[]} nfts - An array of u64s representing the NFTs to transfer.
* @param {string} memo - A string that will be stored in the blockchain as the memo for this transfer.
*/
export function sendTransferNfts(from: Name, to: Name, asset_ids: u64[], memo: string): void;
export function sendAdminCollectionEdit(contract: Name, collectionFormatExtension: AtomicFormat[]): void;
export function sendSetVersion(contract: Name, newVersion: string): void;
export function sendAddConfigToken(contract: Name, tokenContract: Name, tokenSymbol: Symbol): void;
export function sendCreateColllection(contract: Name, author: Name, collection_name: Name, allow_notify: boolean, authorized_accounts: Name[], notify_accounts: Name[], market_fee: f64, data: AtomicAttribute[]): void;
export function sendSetCollectionData(contract: Name, collection_name: Name, data: AtomicAttribute[]): void;
export function sendAddCollectionAuth(contract: Name, collection_name: Name, account_to_add: Name): void;
export function sendRemoveCollectionAuth(contract: Name, collection_name: Name, account_to_remove: Name): void;
export function sendAddNotifyAccount(contract: Name, collection_name: Name, account_to_add: Name): void;
export function sendRemoveNotifyAccount(contract: Name, collection_name: Name, account_to_remove: Name): void;
export function sendSetMarketFee(contract: Name, collection_name: Name, market_fee: f64): void;
export function sendForbidNotify(contract: Name, collection_name: Name): void;
export function sendCreateSchema(contract: Name, authorized_creator: Name, collection_name: Name, schema_name: Name, schema_format: AtomicFormat[]): void;
export function sendExtendSchema(contract: Name, authorized_editor: Name, collection_name: Name, schema_name: Name, schema_format_extension: AtomicFormat[]): void;
export function sendCreateTemplate(contract: Name, authorized_creator: Name, collection_name: Name, schema_name: Name, transferable: boolean, burnable: boolean, max_supply: u32, immutable_data: AtomicAttribute[]): void;
export function sendLockTemplate(contract: Name, authorized_editor: Name, collection_name: Name, template_id: i32): void;
export function sendMintAsset(contract: Name, authorized_minter: Name, collection_name: Name, schema_name: Name, template_id: i32, newasset_owner: Name, immutable_data: AtomicAttribute[], mutable_data: AtomicAttribute[], tokens_to_back: Asset[]): void;
export function sendSetAssetData(contract: Name, authorized_editor: Name, asset_owner: Name, asset_id: u64, new_mutable_data: AtomicAttribute[]): void;
export function sendWithdraw(contract: Name, owner: Name, token_to_withdraw: Asset): void;
export function sendBackAsset(contract: Name, payer: Name, asset_owner: Name, asset_id: u64, token_to_back: Asset): void;
export function sendBurnAsset(contract: Name, asset_owner: Name, asset_id: u64): void;
export function sendCreateOffer(contract: Name, sender: Name, recipient: Name, sender_asset_ids: u64[], recipient_asset_ids: u64[], memo: string): void;
export function sendCancelOffer(contract: Name, offer_id: u64): void;
export function sendAcceptOffer(contract: Name, offer_id: u64): void;
export function sendDeclineOffer(contract: Name, offer_id: u64): void;
export function sendPayOfferRam(contract: Name, payer: Name, offer_id: u64): void;
}
declare module 'proton-tsc/atomicassets/atomicassets.spec' {
export {};
}
declare module 'proton-tsc/atomicassets/atomicassets.tables' {
/// <reference types="assembly" />
import { Name, Table, ExtendedSymbol, Asset } from "proton-tsc";
import { AtomicFormat } from "proton-tsc/atomicassets/atomicdata";
export class Collections extends Table {
collection_name: Name;
author: Name;
allow_notify: boolean;
authorized_accounts: Name[];
notify_accounts: Name[];
market_fee: f64;
serialized_data: u8[];
constructor(collection_name?: Name, author?: Name, allow_notify?: boolean, authorized_accounts?: Name[], notify_accounts?: Name[], market_fee?: f64, serialized_data?: u8[]);
get primary(): u64;
}
export class Schemas extends Table {
schema_name: Name;
format: AtomicFormat[];
constructor(schema_name?: Name, format?: AtomicFormat[]);
get primary(): u64;
}
export class Templates extends Table {
template_id: i32;
schema_name: Name;
transferable: boolean;
burnable: boolean;
max_supply: u32;
issued_supply: u32;
immutable_serialized_data: u8[];
constructor(template_id?: i32, schema_name?: Name, transferable?: boolean, burnable?: boolean, max_supply?: u32, issued_supply?: u32, immutable_serialized_data?: u8[]);
get primary(): u64;
}
export class Assets extends Table {
asset_id: u64;
collection_name: Name;
schema_name: Name;
template_id: i32;
ram_payer: Name;
backed_tokens: Asset[];
immutable_serialized_data: u8[];
mutable_serialized_data: u8[];
constructor(asset_id?: u64, collection_name?: Name, schema_name?: Name, template_id?: i32, ram_payer?: Name, backed_tokens?: Asset[], immutable_serialized_data?: u8[], mutable_serialized_data?: u8[]);
get primary(): u64;
}
export class Offers extends Table {
offer_id: u64;
sender: Name;
recipient: Name;
sender_asset_ids: u64[];
recipient_asset_ids: u64[];
memo: string;
ram_payer: Name;
constructor(offer_id?: u64, sender?: Name, recipient?: Name, sender_asset_ids?: u64[], recipient_asset_ids?: u64[], memo?: string, ram_payer?: Name);
get primary(): u64;
get by_sender(): u64;
set by_sender(value: u64);
get by_recipient(): u64;
set by_recipient(value: u64);
}
export class Config extends Table {
asset_counter: u64;
template_counter: u32;
offer_counter: u64;
collection_format: AtomicFormat[];
supported_tokens: ExtendedSymbol[];
constructor(asset_counter?: u64, template_counter?: u32, offer_counter?: u64, collection_format?: AtomicFormat[], supported_tokens?: ExtendedSymbol[]);
}
}
declare module 'proton-tsc/atomicassets/atomicdata' {
/// <reference types="assembly" />
import { Variant } from "proton-tsc";
export class AtomicFormat {
name: string;
type: string;
constructor(name?: string, type?: string);
}
export class AtomicAttribute {
key: string;
value: AtomicValue;
constructor(key?: string, value?: AtomicValue);
static eq(a: AtomicAttribute, b: AtomicAttribute): bool;
static neq(a: AtomicAttribute, b: AtomicAttribute): bool;
}
export class AtomicValue extends Variant {
i8: i8;
i16: i16;
i32: i32;
i64: i64;
u8: u8;
u16: u16;
u32: u32;
u64: u64;
float: f32;
double: f64;
string: string;
INT8_VEC: i8[];
INT16_VEC: i16[];
INT32_VEC: i32[];
INT64_VEC: i64[];
UINT8_VEC: u8[];
UINT16_VEC: u16[];
UINT32_VEC: u32[];
UINT64_VEC: u64[];
FLOAT_VEC: f32[];
DOUBLE_VEC: f64[];
STRING_VEC: string[];
static new<T>(value: T): AtomicValue;
}
export function unsignedFromVarintBytes(itr: u8[]): u64;
export function toIntBytes(number: u64, byte_amount: u64): u8[];
export function unsignedFromIntBytes(itr: u8[], original_bytes?: u64): u64;
export function zigzagEncode(value: i64): u64;
export function zigzagDecode(value: u64): i64;
export function eraseAttribute(attributes: AtomicAttribute[], toErase: AtomicAttribute): void;
export function toVarintBytes(number: u64, original_bytes?: u64): u8[];
export function findIndexOfAttribute(attributes: AtomicAttribute[], key: string): i32;
export function floatToBytes(float: f32): u8[];
export function doubleToBytes(float: f64): u8[];
export function stringToBytes(string: string): u8[];
export function serialize_attribute(type: string, attr: AtomicValue): u8[];
export function deserialize_attribute(type: string, itr: u8[]): AtomicValue;
export function serialize(attr_map: AtomicAttribute[], format_lines: AtomicFormat[]): u8[];
export function deserialize(data: u8[], format_lines: AtomicFormat[]): AtomicAttribute[];
}
declare module 'proton-tsc/atomicassets/base58' {
/// <reference types="assembly" />
/**
* Encode Uint8Array as a base58 string.
* @param bytes Byte array of type Uint8Array.
*/
export function encode(source: Uint8Array): string;
export function decodeUnsafe(source: string): u8[] | null;
export function decode(source: string): u8[];
}
declare module 'proton-tsc/atomicassets/checkformat' {
import { AtomicAttribute, AtomicFormat } from "proton-tsc/atomicassets/atomicdata";
export function check_format(lines: AtomicFormat[]): void;
/**
* The "name" attribute is limited to 64 characters max for both assets and collections
* This function checks that, if there exists an ATTRIBUTE with name: "name", the value of it
* must be of length <= 64
*/
export function check_name_length(data: AtomicAttribute[]): void;
}
declare module 'proton-tsc/atomicassets' {
export * from 'proton-tsc/atomicassets/atomicassets.constants';
export * from 'proton-tsc/atomicassets/atomicassets.inline';
export * from 'proton-tsc/atomicassets/atomicassets.tables';
export * from 'proton-tsc/atomicassets/atomicdata';
export * from 'proton-tsc/atomicassets/base58';
export * from 'proton-tsc/atomicassets/checkformat';
}
declare module 'proton-tsc/atomicassets/target/atomicassets.contract' {
/// <reference types="assembly" />
export function apply(receiver: u64, firstReceiver: u64, action: u64): void;
}
declare module 'proton-tsc/atomicassets/target/atomicassets.tables' {
/// <reference types="assembly" />
import * as _chain from "as-chain";
import { Name, ExtendedSymbol, Asset } from "proton-tsc/atomicassets";
import { AtomicFormat } from "proton-tsc/atomicassets/target/atomicdata";
export class CollectionsDB extends _chain.MultiIndex<Collections> {
}
export class Collections implements _chain.MultiIndexValue {
collection_name: Name;
author: Name;
allow_notify: boolean;
authorized_accounts: Name[];
notify_accounts: Name[];
market_fee: f64;
serialized_data: u8[];
constructor(collection_name?: Name, author?: Name, allow_notify?: boolean, authorized_accounts?: Name[], notify_accounts?: Name[], market_fee?: f64, serialized_data?: u8[]);
get primary(): u64;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): CollectionsDB;
}
export class SchemasDB extends _chain.MultiIndex<Schemas> {
}
export class Schemas implements _chain.MultiIndexValue {
schema_name: Name;
format: AtomicFormat[];
constructor(schema_name?: Name, format?: AtomicFormat[]);
get primary(): u64;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): SchemasDB;
}
export class TemplatesDB extends _chain.MultiIndex<Templates> {
}
export class Templates implements _chain.MultiIndexValue {
template_id: i32;
schema_name: Name;
transferable: boolean;
burnable: boolean;
max_supply: u32;
issued_supply: u32;
immutable_serialized_data: u8[];
constructor(template_id?: i32, schema_name?: Name, transferable?: boolean, burnable?: boolean, max_supply?: u32, issued_supply?: u32, immutable_serialized_data?: u8[]);
get primary(): u64;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): TemplatesDB;
}
export class AssetsDB extends _chain.MultiIndex<Assets> {
}
export class Assets implements _chain.MultiIndexValue {
asset_id: u64;
collection_name: Name;
schema_name: Name;
template_id: i32;
ram_payer: Name;
backed_tokens: Asset[];
immutable_serialized_data: u8[];
mutable_serialized_data: u8[];
constructor(asset_id?: u64, collection_name?: Name, schema_name?: Name, template_id?: i32, ram_payer?: Name, backed_tokens?: Asset[], immutable_serialized_data?: u8[], mutable_serialized_data?: u8[]);
get primary(): u64;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): AssetsDB;
}
export class OffersDB extends _chain.MultiIndex<Offers> {
get by_senderDB(): _chain.IDX64;
get by_recipientDB(): _chain.IDX64;
updateBy_sender(idxIt: _chain.SecondaryIterator, value: u64, payer: Name): void;
updateBy_recipient(idxIt: _chain.SecondaryIterator, value: u64, payer: Name): void;
}
export class Offers implements _chain.MultiIndexValue {
offer_id: u64;
sender: Name;
recipient: Name;
sender_asset_ids: u64[];
recipient_asset_ids: u64[];
memo: string;
ram_payer: Name;
constructor(offer_id?: u64, sender?: Name, recipient?: Name, sender_asset_ids?: u64[], recipient_asset_ids?: u64[], memo?: string, ram_payer?: Name);
get primary(): u64;
get by_sender(): u64;
set by_sender(value: u64);
get by_recipient(): u64;
set by_recipient(value: u64);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): OffersDB;
}
export class ConfigDB extends _chain.MultiIndex<Config> {
}
export class Config implements _chain.MultiIndexValue {
asset_counter: u64;
template_counter: u32;
offer_counter: u64;
collection_format: AtomicFormat[];
supported_tokens: ExtendedSymbol[];
constructor(asset_counter?: u64, template_counter?: u32, offer_counter?: u64, collection_format?: AtomicFormat[], supported_tokens?: ExtendedSymbol[]);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static get tableName(): _chain.Name;
static tableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getTableName(): _chain.Name;
getTableIndexes(code: _chain.Name, scope: _chain.Name): _chain.IDXDB[];
getPrimaryValue(): u64;
getSecondaryValue(i: i32): _chain.SecondaryValue;
setSecondaryValue(i: i32, value: _chain.SecondaryValue): void;
static new(code: _chain.Name, scope?: _chain.Name): _chain.Singleton<Config>;
}
}
declare module 'proton-tsc/atomicassets/target/atomicdata' {
/// <reference types="assembly" />
import * as _chain from "as-chain";
export class AtomicFormat implements _chain.Packer {
name: string;
type: string;
constructor(name?: string, type?: string);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
export class AtomicAttribute implements _chain.Packer {
key: string;
value: AtomicValue;
constructor(key?: string, value?: AtomicValue);
static eq(a: AtomicAttribute, b: AtomicAttribute): bool;
static neq(a: AtomicAttribute, b: AtomicAttribute): bool;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
export class AtomicValue implements _chain.Packer {
_index: u8;
value: usize;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
static new<T>(value: T): AtomicValue;
isi8(): bool;
geti8(): i8;
isi16(): bool;
geti16(): i16;
isi32(): bool;
geti32(): i32;
isi64(): bool;
geti64(): i64;
isu8(): bool;
getu8(): u8;
isu16(): bool;
getu16(): u16;
isu32(): bool;
getu32(): u32;
isu64(): bool;
getu64(): u64;
isfloat(): bool;
getfloat(): f32;
isdouble(): bool;
getdouble(): f64;
isstring(): bool;
getstring(): string;
isINT8_VEC(): bool;
getINT8_VEC(): i8[];
isINT16_VEC(): bool;
getINT16_VEC(): i16[];
isINT32_VEC(): bool;
getINT32_VEC(): i32[];
isINT64_VEC(): bool;
getINT64_VEC(): i64[];
isUINT8_VEC(): bool;
getUINT8_VEC(): u8[];
isUINT16_VEC(): bool;
getUINT16_VEC(): u16[];
isUINT32_VEC(): bool;
getUINT32_VEC(): u32[];
isUINT64_VEC(): bool;
getUINT64_VEC(): u64[];
isFLOAT_VEC(): bool;
getFLOAT_VEC(): f32[];
isDOUBLE_VEC(): bool;
getDOUBLE_VEC(): f64[];
isSTRING_VEC(): bool;
getSTRING_VEC(): string[];
get<T>(): T;
is<T>(): bool;
}
export function unsignedFromVarintBytes(itr: u8[]): u64;
export function toIntBytes(number: u64, byte_amount: u64): u8[];
export function unsignedFromIntBytes(itr: u8[], original_bytes?: u64): u64;
export function zigzagEncode(value: i64): u64;
export function zigzagDecode(value: u64): i64;
export function eraseAttribute(attributes: AtomicAttribute[], toErase: AtomicAttribute): void;
export function toVarintBytes(number: u64, original_bytes?: u64): u8[];
export function findIndexOfAttribute(attributes: AtomicAttribute[], key: string): i32;
export function floatToBytes(float: f32): u8[];
export function doubleToBytes(float: f64): u8[];
export function stringToBytes(string: string): u8[];
export function serialize_attribute(type: string, attr: AtomicValue): u8[];
export function deserialize_attribute(type: string, itr: u8[]): AtomicValue;
export function serialize(attr_map: AtomicAttribute[], format_lines: AtomicFormat[]): u8[];
export function deserialize(data: u8[], format_lines: AtomicFormat[]): AtomicAttribute[];
}
declare module 'proton-tsc/atomicassets/target/base58' {
/// <reference types="assembly" />
/**
* Encode Uint8Array as a base58 string.
* @param bytes Byte array of type Uint8Array.
*/
export function encode(source: Uint8Array): string;
export function decodeUnsafe(source: string): u8[] | null;
export function decode(source: string): u8[];
}
declare module 'proton-tsc/atomicassets/target' {
/// <reference types="assembly" />
import * as _chain from "as-chain";
import { PermissionLevel, PublicKey, Name } from "proton-tsc";
export class KeyWeight implements _chain.Packer {
key: PublicKey;
weight: u16;
constructor(key?: PublicKey, weight?: u16);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
export class PermissionLevelWeight implements _chain.Packer {
permission: PermissionLevel;
weight: u16;
constructor(permission?: PermissionLevel, weight?: u16);
static from(actor: Name, permission: string, weight: u16): PermissionLevelWeight;
toAuthority(): Authority;
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
export class WaitWeight implements _chain.Packer {
waitSec: u16;
weight: u16;
constructor(waitSec?: u16, weight?: u16);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
export class Authority implements _chain.Packer {
threshold: u32;
keys: KeyWeight[];
accounts: PermissionLevelWeight[];
waits: WaitWeight[];
constructor(threshold?: u32, keys?: KeyWeight[], accounts?: PermissionLevelWeight[], waits?: WaitWeight[]);
pack(): u8[];
unpack(data: u8[]): usize;
getSize(): usize;
}
}
declare module 'proton-tsc/balance/balance.contract' {
/// <reference types="assembly" />
import { ExtendedAsset, Name, TableStore } from 'proton-tsc';
import { AllowContract } from 'proton-tsc/allow';
import { Balance } from 'proton-tsc/balance/balance.tables';
export class BalanceContract extends AllowContract {
balancesTable: TableStore<Balance>;
/**
* Incoming notification of "transfer" action from any contract
* - If the contract is the atomicassets contract, then the action data is an NFT transfer.
* - Else, the action data is a token transfer
* @returns Nothing.
*/
transfer(): void;
/**
* Withdraw tokens and NFTs from an actor and transfer them to another actor
* @param {Name} actor - Name
* @param {ExtendedAsset[]} tokens - An array of `ExtendedAsset` objects.
* @param {u64[]} nfts - u64[]
*/
withdraw(actor: Name, tokens: ExtendedAsset[], nfts: u64[]): void;
/**
* Withdraw all tokens and NFTs from the contract and transfer them to the actor.
* Note:
* - Does not reduce balance
* - Assumes caller has already reduced balance using modifyBalance
* @param {Name} actor - Name
* @param {ExtendedAsset[]} tokens - The list of tokens to transfer.
* @param {u64[]} nfts - u64[]
* @param {string} memo - string
*/