@atomichub/atomicassets 2.0.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/LICENSE +23 -0
- package/NOTICE +12 -0
- package/README.md +129 -0
- package/build/atomicassets.global.js +2730 -0
- package/build/index.cjs +2768 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.mts +1149 -0
- package/build/index.d.ts +1149 -0
- package/build/index.mjs +2708 -0
- package/build/index.mjs.map +1 -0
- package/licenses/Apache-2.0.txt +202 -0
- package/package.json +72 -0
|
@@ -0,0 +1,1149 @@
|
|
|
1
|
+
declare class SerializationState {
|
|
2
|
+
readonly data: Uint8Array;
|
|
3
|
+
position: number;
|
|
4
|
+
constructor(data: Uint8Array, position?: number);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface ISchema {
|
|
8
|
+
serialize(data: any): Uint8Array;
|
|
9
|
+
deserialize(state: SerializationState): any;
|
|
10
|
+
}
|
|
11
|
+
type SchemaObject = {
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
parent?: number;
|
|
15
|
+
mediatype?: string;
|
|
16
|
+
};
|
|
17
|
+
declare function ObjectSchema(schema: SchemaObject[]): ISchema;
|
|
18
|
+
declare function CachedObjectSchema(schema: SchemaObject[]): ISchema;
|
|
19
|
+
|
|
20
|
+
type SchemaFormat = SchemaObject[];
|
|
21
|
+
interface ICollectionRow {
|
|
22
|
+
collection_name: string;
|
|
23
|
+
author: string;
|
|
24
|
+
allow_notify: boolean;
|
|
25
|
+
authorized_accounts: string[];
|
|
26
|
+
notify_accounts: string[];
|
|
27
|
+
market_fee: number;
|
|
28
|
+
serialized_data: Uint8Array;
|
|
29
|
+
}
|
|
30
|
+
interface ISchemaRow {
|
|
31
|
+
schema_name: string;
|
|
32
|
+
format: SchemaFormat;
|
|
33
|
+
}
|
|
34
|
+
interface ITemplateRow {
|
|
35
|
+
template_id: number;
|
|
36
|
+
schema_name: string;
|
|
37
|
+
transferable: boolean;
|
|
38
|
+
burnable: boolean;
|
|
39
|
+
max_supply: number;
|
|
40
|
+
issued_supply: number;
|
|
41
|
+
immutable_serialized_data: Uint8Array;
|
|
42
|
+
mutable_serialized_data: Uint8Array;
|
|
43
|
+
}
|
|
44
|
+
interface IAssetRow {
|
|
45
|
+
asset_id: string;
|
|
46
|
+
collection_name: string;
|
|
47
|
+
schema_name: string;
|
|
48
|
+
template_id: string;
|
|
49
|
+
ram_payer: string;
|
|
50
|
+
backed_tokens: string[];
|
|
51
|
+
immutable_serialized_data: Uint8Array;
|
|
52
|
+
mutable_serialized_data: Uint8Array;
|
|
53
|
+
}
|
|
54
|
+
interface IOfferRow {
|
|
55
|
+
offer_id: string;
|
|
56
|
+
sender: string;
|
|
57
|
+
recipient: string;
|
|
58
|
+
sender_asset_ids: string[];
|
|
59
|
+
recipient_asset_ids: string[];
|
|
60
|
+
memo: string;
|
|
61
|
+
}
|
|
62
|
+
interface IConfigRow {
|
|
63
|
+
asset_counter: string;
|
|
64
|
+
offer_counter: string;
|
|
65
|
+
collection_format: SchemaFormat;
|
|
66
|
+
}
|
|
67
|
+
declare class RpcCache {
|
|
68
|
+
private readonly cache;
|
|
69
|
+
constructor();
|
|
70
|
+
getAsset(assetID: string, data?: IAssetRow): IAssetRow | null;
|
|
71
|
+
deleteAsset(assetID: string): void;
|
|
72
|
+
getTemplate(collectionName: string, templateID: string, data?: ITemplateRow): ITemplateRow | null;
|
|
73
|
+
deleteTemplate(collectionName: string, templateID: string): void;
|
|
74
|
+
getSchema(collectionName: string, schemaName: string, data?: ISchemaRow): ISchemaRow | null;
|
|
75
|
+
deleteSchema(collectionName: string, schemaName: string): void;
|
|
76
|
+
getCollection(collectionName: string, data?: ICollectionRow): ICollectionRow | null;
|
|
77
|
+
deleteCollection(collectionName: string): void;
|
|
78
|
+
getOffer(offerID: string, data?: IOfferRow): IOfferRow | null;
|
|
79
|
+
deleteOffer(offerID: string): void;
|
|
80
|
+
private access;
|
|
81
|
+
private delete;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
type EosioAuthorizationObject = {
|
|
85
|
+
actor: string;
|
|
86
|
+
permission: string;
|
|
87
|
+
};
|
|
88
|
+
type EosioActionObject = {
|
|
89
|
+
account: string;
|
|
90
|
+
name: string;
|
|
91
|
+
authorization: EosioAuthorizationObject[];
|
|
92
|
+
data: any;
|
|
93
|
+
};
|
|
94
|
+
type EosioSimpleAction = {
|
|
95
|
+
account: string;
|
|
96
|
+
name: string;
|
|
97
|
+
data: any;
|
|
98
|
+
};
|
|
99
|
+
type AttributeMapEntry = {
|
|
100
|
+
key: string;
|
|
101
|
+
value: [string, any];
|
|
102
|
+
};
|
|
103
|
+
type AttributeMap = AttributeMapEntry[];
|
|
104
|
+
type DecodedAttributeMap = Array<AttributeMapEntry | {
|
|
105
|
+
first: string;
|
|
106
|
+
second: [string, any];
|
|
107
|
+
}>;
|
|
108
|
+
type Format = {
|
|
109
|
+
name: string;
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
type SchemaFormatType = {
|
|
113
|
+
name: string;
|
|
114
|
+
mediatype: string;
|
|
115
|
+
info?: string;
|
|
116
|
+
};
|
|
117
|
+
declare const ATOMIC_ATTRIBUTE: {
|
|
118
|
+
[type: string]: string;
|
|
119
|
+
};
|
|
120
|
+
declare function createAttributeMap(obj: {
|
|
121
|
+
[key: string]: any;
|
|
122
|
+
}, types: {
|
|
123
|
+
[key: string]: string;
|
|
124
|
+
}): AttributeMap;
|
|
125
|
+
declare class ActionBuilder {
|
|
126
|
+
readonly contract: string;
|
|
127
|
+
constructor(contract: string);
|
|
128
|
+
acceptauswap(collection_name: string): EosioSimpleAction;
|
|
129
|
+
acceptoffer(offer_id: string): EosioSimpleAction;
|
|
130
|
+
addcolauth(collection_name: string, account_to_add: string): EosioSimpleAction;
|
|
131
|
+
addconftoken(token_contract: string, token_symbol: string): EosioSimpleAction;
|
|
132
|
+
addnotifyacc(collection_name: string, account_to_add: string): EosioSimpleAction;
|
|
133
|
+
admincoledit(collection_format_extension: Format[]): EosioSimpleAction;
|
|
134
|
+
announcedepo(owner: string, symbol_to_announce: string): EosioSimpleAction;
|
|
135
|
+
backasset(payer: string, asset_owner: string, asset_id: string, token_to_back: string): EosioSimpleAction;
|
|
136
|
+
burnasset(asset_owner: string, asset_id: string): EosioSimpleAction;
|
|
137
|
+
canceloffer(offer_id: string): EosioSimpleAction;
|
|
138
|
+
createauswap(collection_name: string, new_author: string, owner: boolean): EosioSimpleAction;
|
|
139
|
+
createcol(author: string, collection_name: string, allow_notify: boolean, authorized_accounts: string[], notify_accounts: string[], market_fee: number, data: AttributeMap): EosioSimpleAction;
|
|
140
|
+
createoffer(sender: string, recipient: string, sender_asset_ids: string[], recipient_asset_ids: string[], memo: string): EosioSimpleAction;
|
|
141
|
+
createtempl(authorized_creator: string, collection_name: string, schema_name: string, transferable: boolean, burnable: boolean, max_supply: number, immutable_data: AttributeMap): EosioSimpleAction;
|
|
142
|
+
createtempl2(authorized_creator: string, collection_name: string, schema_name: string, transferable: boolean, burnable: boolean, max_supply: number, immutable_data: AttributeMap, mutable_data: AttributeMap): EosioSimpleAction;
|
|
143
|
+
createschema(authorized_creator: string, collection_name: string, schema_name: string, schema_format: Format[]): EosioSimpleAction;
|
|
144
|
+
declineoffer(offer_id: string): EosioSimpleAction;
|
|
145
|
+
deltemplate(authorized_editor: string, collection_name: string, template_id: number): EosioSimpleAction;
|
|
146
|
+
extendschema(authorized_editor: string, collection_name: string, schema_name: string, schema_format_extension: Format[]): EosioSimpleAction;
|
|
147
|
+
forbidnotify(collection_name: string): EosioSimpleAction;
|
|
148
|
+
init(): EosioSimpleAction;
|
|
149
|
+
locktemplate(authorized_editor: string, collection_name: string, template_id: number): EosioSimpleAction;
|
|
150
|
+
mintasset(authorized_minter: string, collection_name: string, schema_name: string, template_id: number, new_asset_owner: string, immutable_data: AttributeMap, mutable_data: AttributeMap, tokens_to_back: string[]): EosioSimpleAction;
|
|
151
|
+
payofferram(payer: string, offer_id: string): EosioSimpleAction;
|
|
152
|
+
redtemplmax(authorized_editor: string, collection_name: string, template_id: number, new_max_supply: number): EosioSimpleAction;
|
|
153
|
+
rejectauswap(collection_name: string): EosioSimpleAction;
|
|
154
|
+
remcolauth(collection_name: string, account_to_remove: string): EosioSimpleAction;
|
|
155
|
+
remnotifyacc(collection_name: string, account_to_remove: string): EosioSimpleAction;
|
|
156
|
+
setassetdata(authorized_editor: string, asset_owner: string, asset_id: string, new_mutable_data: AttributeMap): EosioSimpleAction;
|
|
157
|
+
setcoldata(collection_name: string, data: AttributeMap): EosioSimpleAction;
|
|
158
|
+
setlastpayer(owner: string, collection_name: string): EosioSimpleAction;
|
|
159
|
+
setmarketfee(collection_name: string, market_fee: number): EosioSimpleAction;
|
|
160
|
+
setrampayer(new_payer: string, asset_id: string): EosioSimpleAction;
|
|
161
|
+
settempldata(authorized_editor: string, collection_name: string, template_id: number, new_mutable_data: AttributeMap): EosioSimpleAction;
|
|
162
|
+
setschematyp(authorized_editor: string, collection_name: string, schema_name: string, schema_format_type: SchemaFormatType[]): EosioSimpleAction;
|
|
163
|
+
setversion(new_version: string): EosioSimpleAction;
|
|
164
|
+
transfer(account_from: string, account_to: string, asset_ids: string[], memo: string): EosioSimpleAction;
|
|
165
|
+
withdraw(owner: string, token_to_withdraw: string): EosioSimpleAction;
|
|
166
|
+
protected _action(name: string, data: any): EosioSimpleAction;
|
|
167
|
+
}
|
|
168
|
+
declare class ActionGenerator {
|
|
169
|
+
readonly contract: string;
|
|
170
|
+
protected readonly builder: ActionBuilder;
|
|
171
|
+
constructor(contract: string);
|
|
172
|
+
acceptauswap(authorization: EosioAuthorizationObject[], collection_name: string): Promise<EosioActionObject[]>;
|
|
173
|
+
acceptoffer(authorization: EosioAuthorizationObject[], offer_id: string): Promise<EosioActionObject[]>;
|
|
174
|
+
addcolauth(authorization: EosioAuthorizationObject[], collection_name: string, account_to_add: string): Promise<EosioActionObject[]>;
|
|
175
|
+
addconftoken(authorization: EosioAuthorizationObject[], token_contract: string, token_symbol: string): Promise<EosioActionObject[]>;
|
|
176
|
+
addnotifyacc(authorization: EosioAuthorizationObject[], collection_name: string, account_to_add: string): Promise<EosioActionObject[]>;
|
|
177
|
+
admincoledit(authorization: EosioAuthorizationObject[], collection_format_extension: Format[]): Promise<EosioActionObject[]>;
|
|
178
|
+
announcedepo(authorization: EosioAuthorizationObject[], owner: string, symbol_to_announce: string): Promise<EosioActionObject[]>;
|
|
179
|
+
backasset(authorization: EosioAuthorizationObject[], payer: string, asset_owner: string, asset_id: string, token_to_back: string): Promise<EosioActionObject[]>;
|
|
180
|
+
burnasset(authorization: EosioAuthorizationObject[], asset_owner: string, asset_id: string): Promise<EosioActionObject[]>;
|
|
181
|
+
canceloffer(authorization: EosioAuthorizationObject[], offer_id: string): Promise<EosioActionObject[]>;
|
|
182
|
+
createauswap(authorization: EosioAuthorizationObject[], collection_name: string, new_author: string, owner: boolean): Promise<EosioActionObject[]>;
|
|
183
|
+
createcol(authorization: EosioAuthorizationObject[], author: string, collection_name: string, allow_notify: boolean, authorized_accounts: string[], notify_accounts: string[], market_fee: number, data: AttributeMap): Promise<EosioActionObject[]>;
|
|
184
|
+
createoffer(authorization: EosioAuthorizationObject[], sender: string, recipient: string, sender_asset_ids: string[], recipient_asset_ids: string[], memo: string): Promise<EosioActionObject[]>;
|
|
185
|
+
createtempl(authorization: EosioAuthorizationObject[], authorized_creator: string, collection_name: string, schema_name: string, transferable: boolean, burnable: boolean, max_supply: number, immutable_data: AttributeMap): Promise<EosioActionObject[]>;
|
|
186
|
+
createtempl2(authorization: EosioAuthorizationObject[], authorized_creator: string, collection_name: string, schema_name: string, transferable: boolean, burnable: boolean, max_supply: number, immutable_data: AttributeMap, mutable_data: AttributeMap): Promise<EosioActionObject[]>;
|
|
187
|
+
createschema(authorization: EosioAuthorizationObject[], authorized_creator: string, collection_name: string, schema_name: string, schema_format: Format[]): Promise<EosioActionObject[]>;
|
|
188
|
+
declineoffer(authorization: EosioAuthorizationObject[], offer_id: string): Promise<EosioActionObject[]>;
|
|
189
|
+
deltemplate(authorization: EosioAuthorizationObject[], authorized_editor: string, collection_name: string, template_id: number): Promise<EosioActionObject[]>;
|
|
190
|
+
extendschema(authorization: EosioAuthorizationObject[], authorized_editor: string, collection_name: string, schema_name: string, schema_format_extension: Format[]): Promise<EosioActionObject[]>;
|
|
191
|
+
forbidnotify(authorization: EosioAuthorizationObject[], collection_name: string): Promise<EosioActionObject[]>;
|
|
192
|
+
init(authorization: EosioAuthorizationObject[]): Promise<EosioActionObject[]>;
|
|
193
|
+
locktemplate(authorization: EosioAuthorizationObject[], authorized_editor: string, collection_name: string, template_id: number): Promise<EosioActionObject[]>;
|
|
194
|
+
mintasset(authorization: EosioAuthorizationObject[], authorized_minter: string, collection_name: string, schema_name: string, template_id: number, new_asset_owner: string, immutable_data: AttributeMap, mutable_data: AttributeMap, tokens_to_back: string[]): Promise<EosioActionObject[]>;
|
|
195
|
+
payofferram(authorization: EosioAuthorizationObject[], payer: string, offer_id: string): Promise<EosioActionObject[]>;
|
|
196
|
+
redtemplmax(authorization: EosioAuthorizationObject[], authorized_editor: string, collection_name: string, template_id: number, new_max_supply: number): Promise<EosioActionObject[]>;
|
|
197
|
+
rejectauswap(authorization: EosioAuthorizationObject[], collection_name: string): Promise<EosioActionObject[]>;
|
|
198
|
+
remcolauth(authorization: EosioAuthorizationObject[], collection_name: string, account_to_remove: string): Promise<EosioActionObject[]>;
|
|
199
|
+
remnotifyacc(authorization: EosioAuthorizationObject[], collection_name: string, account_to_remove: string): Promise<EosioActionObject[]>;
|
|
200
|
+
setassetdata(authorization: EosioAuthorizationObject[], authorized_editor: string, asset_owner: string, asset_id: string, new_mutable_data: AttributeMap): Promise<EosioActionObject[]>;
|
|
201
|
+
setcoldata(authorization: EosioAuthorizationObject[], collection_name: string, data: AttributeMap): Promise<EosioActionObject[]>;
|
|
202
|
+
setlastpayer(authorization: EosioAuthorizationObject[], owner: string, collection_name: string): Promise<EosioActionObject[]>;
|
|
203
|
+
setmarketfee(authorization: EosioAuthorizationObject[], collection_name: string, market_fee: number): Promise<EosioActionObject[]>;
|
|
204
|
+
setrampayer(authorization: EosioAuthorizationObject[], new_payer: string, asset_id: string): Promise<EosioActionObject[]>;
|
|
205
|
+
settempldata(authorization: EosioAuthorizationObject[], authorized_editor: string, collection_name: string, template_id: number, new_mutable_data: AttributeMap): Promise<EosioActionObject[]>;
|
|
206
|
+
setschematyp(authorization: EosioAuthorizationObject[], authorized_editor: string, collection_name: string, schema_name: string, schema_format_type: SchemaFormatType[]): Promise<EosioActionObject[]>;
|
|
207
|
+
setversion(authorization: EosioAuthorizationObject[], new_version: string): Promise<EosioActionObject[]>;
|
|
208
|
+
transfer(authorization: EosioAuthorizationObject[], account_from: string, account_to: string, asset_ids: string[], memo: string): Promise<EosioActionObject[]>;
|
|
209
|
+
withdraw(authorization: EosioAuthorizationObject[], owner: string, token_to_withdraw: string): Promise<EosioActionObject[]>;
|
|
210
|
+
protected _authorize(authorization: EosioAuthorizationObject[], action: EosioSimpleAction): EosioActionObject[];
|
|
211
|
+
protected _pack(authorization: EosioAuthorizationObject[], name: string, data: any): EosioActionObject[];
|
|
212
|
+
}
|
|
213
|
+
declare function toAttributeMap(obj: any, schema: SchemaFormat): AttributeMap;
|
|
214
|
+
declare function convertAttributeMapToObject(data: DecodedAttributeMap): {
|
|
215
|
+
[key: string]: any;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
declare enum OfferState {
|
|
219
|
+
Pending = 0,
|
|
220
|
+
Invalid = 1,
|
|
221
|
+
Unknown = 2,
|
|
222
|
+
Accepted = 3,
|
|
223
|
+
Declined = 4,
|
|
224
|
+
Canceled = 5
|
|
225
|
+
}
|
|
226
|
+
declare enum OrderParam {
|
|
227
|
+
Asc = "asc",
|
|
228
|
+
Desc = "desc"
|
|
229
|
+
}
|
|
230
|
+
declare enum AssetsSort {
|
|
231
|
+
AssetId = "asset_id",
|
|
232
|
+
Updated = "updated",
|
|
233
|
+
Transferred = "transferred",
|
|
234
|
+
Minted = "minted",
|
|
235
|
+
TemplateMint = "template_mint",
|
|
236
|
+
Name = "name"
|
|
237
|
+
}
|
|
238
|
+
declare enum CollectionsSort {
|
|
239
|
+
Created = "created",
|
|
240
|
+
CollectionName = "collection_name"
|
|
241
|
+
}
|
|
242
|
+
declare enum OffersSort {
|
|
243
|
+
Created = "created",
|
|
244
|
+
Updated = "updated"
|
|
245
|
+
}
|
|
246
|
+
declare enum SchemasSort {
|
|
247
|
+
Created = "created",
|
|
248
|
+
SchemaName = "schema_name"
|
|
249
|
+
}
|
|
250
|
+
declare enum TemplatesSort {
|
|
251
|
+
Created = "created",
|
|
252
|
+
Name = "name"
|
|
253
|
+
}
|
|
254
|
+
declare enum TransfersSort {
|
|
255
|
+
Created = "created"
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
interface ILightCollection {
|
|
259
|
+
contract: string;
|
|
260
|
+
collection_name: string;
|
|
261
|
+
name: string;
|
|
262
|
+
img: string;
|
|
263
|
+
author: string;
|
|
264
|
+
allow_notify: boolean;
|
|
265
|
+
authorized_accounts: string[];
|
|
266
|
+
notify_accounts: string[];
|
|
267
|
+
market_fee: number;
|
|
268
|
+
data: {
|
|
269
|
+
[key: string]: any;
|
|
270
|
+
};
|
|
271
|
+
created_at_block: string;
|
|
272
|
+
created_at_time: string;
|
|
273
|
+
}
|
|
274
|
+
type ApiSchemaFormatField = SchemaObject & {
|
|
275
|
+
mediatype?: string | null;
|
|
276
|
+
info?: string | null;
|
|
277
|
+
};
|
|
278
|
+
interface ILightSchema {
|
|
279
|
+
schema_name: string;
|
|
280
|
+
format: ApiSchemaFormatField[];
|
|
281
|
+
created_at_block: string;
|
|
282
|
+
created_at_time: string;
|
|
283
|
+
}
|
|
284
|
+
interface ILightTemplate {
|
|
285
|
+
template_id: string;
|
|
286
|
+
max_supply: string;
|
|
287
|
+
is_transferable: boolean;
|
|
288
|
+
is_burnable: boolean;
|
|
289
|
+
issued_supply: string;
|
|
290
|
+
immutable_data: {
|
|
291
|
+
[key: string]: any;
|
|
292
|
+
};
|
|
293
|
+
mutable_data?: {
|
|
294
|
+
[key: string]: any;
|
|
295
|
+
};
|
|
296
|
+
created_at_block: string;
|
|
297
|
+
created_at_time: string;
|
|
298
|
+
}
|
|
299
|
+
interface IAsset {
|
|
300
|
+
contract: string;
|
|
301
|
+
asset_id: string;
|
|
302
|
+
owner: string | null;
|
|
303
|
+
name: string;
|
|
304
|
+
is_transferable: boolean;
|
|
305
|
+
is_burnable: boolean;
|
|
306
|
+
template_mint: string;
|
|
307
|
+
collection: ILightCollection;
|
|
308
|
+
schema: ILightSchema;
|
|
309
|
+
template: ILightTemplate | null;
|
|
310
|
+
backed_tokens: Array<{
|
|
311
|
+
token_contract: string;
|
|
312
|
+
token_symbol: string;
|
|
313
|
+
token_precision: number;
|
|
314
|
+
amount: string;
|
|
315
|
+
}>;
|
|
316
|
+
immutable_data: {
|
|
317
|
+
[key: string]: any;
|
|
318
|
+
};
|
|
319
|
+
mutable_data: {
|
|
320
|
+
[key: string]: any;
|
|
321
|
+
};
|
|
322
|
+
data: {
|
|
323
|
+
[key: string]: any;
|
|
324
|
+
};
|
|
325
|
+
burned_by_account: string | null;
|
|
326
|
+
burned_at_block: string | null;
|
|
327
|
+
burned_at_time: string | null;
|
|
328
|
+
updated_at_block: string;
|
|
329
|
+
updated_at_time: string;
|
|
330
|
+
transferred_at_block: string;
|
|
331
|
+
transferred_at_time: string;
|
|
332
|
+
minted_at_block: string;
|
|
333
|
+
minted_at_time: string;
|
|
334
|
+
}
|
|
335
|
+
interface ICollection extends ILightCollection {
|
|
336
|
+
contract: string;
|
|
337
|
+
}
|
|
338
|
+
interface IApiSchema extends ILightSchema {
|
|
339
|
+
contract: string;
|
|
340
|
+
collection: ILightCollection;
|
|
341
|
+
types?: SchemaFormatType[];
|
|
342
|
+
}
|
|
343
|
+
interface ITemplate extends ILightTemplate {
|
|
344
|
+
contract: string;
|
|
345
|
+
collection: ILightCollection;
|
|
346
|
+
schema: ILightSchema;
|
|
347
|
+
}
|
|
348
|
+
interface IOffer {
|
|
349
|
+
contract: string;
|
|
350
|
+
offer_id: string;
|
|
351
|
+
sender_name: string;
|
|
352
|
+
recipient_name: string;
|
|
353
|
+
memo: string;
|
|
354
|
+
state: OfferState;
|
|
355
|
+
sender_assets: IAsset[];
|
|
356
|
+
recipient_assets: IAsset[];
|
|
357
|
+
is_sender_contract: boolean;
|
|
358
|
+
is_recipient_contract: boolean;
|
|
359
|
+
updated_at_block: string;
|
|
360
|
+
updated_at_time: string;
|
|
361
|
+
created_at_block: string;
|
|
362
|
+
created_at_time: string;
|
|
363
|
+
}
|
|
364
|
+
interface ITransfer {
|
|
365
|
+
contract: string;
|
|
366
|
+
transfer_id: string;
|
|
367
|
+
sender_name: string;
|
|
368
|
+
recipient_name: string;
|
|
369
|
+
memo: string;
|
|
370
|
+
txid: string;
|
|
371
|
+
assets: IAsset[];
|
|
372
|
+
created_at_block: string;
|
|
373
|
+
created_at_time: string;
|
|
374
|
+
}
|
|
375
|
+
interface ILog {
|
|
376
|
+
log_id: string;
|
|
377
|
+
name: string;
|
|
378
|
+
data: {
|
|
379
|
+
[key: string]: any;
|
|
380
|
+
};
|
|
381
|
+
txid: string;
|
|
382
|
+
created_at_block: string;
|
|
383
|
+
created_at_time: string;
|
|
384
|
+
}
|
|
385
|
+
interface IConfig {
|
|
386
|
+
contract: string;
|
|
387
|
+
version: string;
|
|
388
|
+
collection_format: SchemaObject[];
|
|
389
|
+
supported_tokens: Array<{
|
|
390
|
+
token_contract: string;
|
|
391
|
+
token_symbol: string;
|
|
392
|
+
token_precision: number;
|
|
393
|
+
}>;
|
|
394
|
+
}
|
|
395
|
+
interface IAssetStats {
|
|
396
|
+
template_mint: number;
|
|
397
|
+
}
|
|
398
|
+
interface ICollectionStats {
|
|
399
|
+
assets: string;
|
|
400
|
+
burned: string;
|
|
401
|
+
templates: string;
|
|
402
|
+
schemas: string;
|
|
403
|
+
burned_by_template: Array<{
|
|
404
|
+
template_id: string;
|
|
405
|
+
burned: number;
|
|
406
|
+
}>;
|
|
407
|
+
burned_by_schema: Array<{
|
|
408
|
+
schema_name: string;
|
|
409
|
+
burned: number;
|
|
410
|
+
}>;
|
|
411
|
+
}
|
|
412
|
+
interface ISchemaStats {
|
|
413
|
+
assets: string;
|
|
414
|
+
burned: string;
|
|
415
|
+
templates: string;
|
|
416
|
+
}
|
|
417
|
+
interface ITemplateStats {
|
|
418
|
+
assets: string;
|
|
419
|
+
burned: string;
|
|
420
|
+
}
|
|
421
|
+
interface IAccountStats {
|
|
422
|
+
collections: Array<{
|
|
423
|
+
collection: ICollection;
|
|
424
|
+
assets: string;
|
|
425
|
+
}>;
|
|
426
|
+
templates: Array<{
|
|
427
|
+
collection_name: string;
|
|
428
|
+
template_id: string;
|
|
429
|
+
assets: string;
|
|
430
|
+
}>;
|
|
431
|
+
assets: string;
|
|
432
|
+
}
|
|
433
|
+
interface IAccountCollectionStats {
|
|
434
|
+
schemas: Array<{
|
|
435
|
+
schema_name: ICollection;
|
|
436
|
+
assets: string;
|
|
437
|
+
}>;
|
|
438
|
+
templates: Array<{
|
|
439
|
+
template_id: string;
|
|
440
|
+
assets: string;
|
|
441
|
+
}>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
interface GreylistParams {
|
|
445
|
+
collection_blacklist?: string;
|
|
446
|
+
collection_whitelist?: string;
|
|
447
|
+
}
|
|
448
|
+
interface HideOffersParams {
|
|
449
|
+
hide_offers?: boolean;
|
|
450
|
+
}
|
|
451
|
+
interface PrimaryBoundaryParams {
|
|
452
|
+
ids?: string;
|
|
453
|
+
lower_bound?: string;
|
|
454
|
+
upper_bound?: string;
|
|
455
|
+
}
|
|
456
|
+
interface DateBoundaryParams {
|
|
457
|
+
before?: number;
|
|
458
|
+
after?: number;
|
|
459
|
+
}
|
|
460
|
+
interface AssetFilterParams {
|
|
461
|
+
asset_id?: string;
|
|
462
|
+
owner?: string;
|
|
463
|
+
burned?: boolean;
|
|
464
|
+
collection_name?: string;
|
|
465
|
+
schema_name?: string;
|
|
466
|
+
template_id?: number;
|
|
467
|
+
match?: string;
|
|
468
|
+
is_transferable?: boolean;
|
|
469
|
+
is_burnable?: boolean;
|
|
470
|
+
[key: string]: any;
|
|
471
|
+
}
|
|
472
|
+
interface AssetsApiParams extends AssetFilterParams, GreylistParams, HideOffersParams, PrimaryBoundaryParams, DateBoundaryParams {
|
|
473
|
+
authorized_account?: string;
|
|
474
|
+
only_duplicate_templates?: boolean;
|
|
475
|
+
min_template_mint?: number;
|
|
476
|
+
max_template_mint?: number;
|
|
477
|
+
template_blacklist?: string;
|
|
478
|
+
template_whitelist?: string;
|
|
479
|
+
order?: OrderParam;
|
|
480
|
+
sort?: AssetsSort;
|
|
481
|
+
}
|
|
482
|
+
interface CollectionApiParams extends GreylistParams, PrimaryBoundaryParams, DateBoundaryParams {
|
|
483
|
+
author?: string;
|
|
484
|
+
match?: string;
|
|
485
|
+
authorized_account?: string;
|
|
486
|
+
notify_account?: string;
|
|
487
|
+
order?: OrderParam;
|
|
488
|
+
sort?: CollectionsSort;
|
|
489
|
+
}
|
|
490
|
+
interface SchemaApiParams extends GreylistParams, PrimaryBoundaryParams, DateBoundaryParams {
|
|
491
|
+
collection_name?: string;
|
|
492
|
+
schema_name?: string;
|
|
493
|
+
match?: string;
|
|
494
|
+
authorized_account?: string;
|
|
495
|
+
order?: OrderParam;
|
|
496
|
+
sort?: SchemasSort;
|
|
497
|
+
}
|
|
498
|
+
interface TemplateApiParams extends GreylistParams, PrimaryBoundaryParams, DateBoundaryParams {
|
|
499
|
+
collection_name?: string;
|
|
500
|
+
schema_name?: string;
|
|
501
|
+
authorized_account?: string;
|
|
502
|
+
template_id?: string;
|
|
503
|
+
max_supply?: number;
|
|
504
|
+
has_assets?: boolean;
|
|
505
|
+
issued_supply?: number;
|
|
506
|
+
min_issued_supply?: number;
|
|
507
|
+
max_issued_supply?: number;
|
|
508
|
+
is_transferable?: boolean;
|
|
509
|
+
is_burnable?: boolean;
|
|
510
|
+
order?: OrderParam;
|
|
511
|
+
sort?: TemplatesSort;
|
|
512
|
+
[key: string]: any;
|
|
513
|
+
}
|
|
514
|
+
interface TransferApiParams extends GreylistParams, PrimaryBoundaryParams, DateBoundaryParams {
|
|
515
|
+
account?: string;
|
|
516
|
+
sender?: string;
|
|
517
|
+
recipient?: string;
|
|
518
|
+
asset_id?: string;
|
|
519
|
+
order?: OrderParam;
|
|
520
|
+
sort?: TransfersSort;
|
|
521
|
+
}
|
|
522
|
+
interface OfferApiParams extends GreylistParams, PrimaryBoundaryParams, DateBoundaryParams {
|
|
523
|
+
account?: string;
|
|
524
|
+
sender?: string;
|
|
525
|
+
recipient?: string;
|
|
526
|
+
asset_id?: string;
|
|
527
|
+
state?: OfferState;
|
|
528
|
+
is_recipient_contract?: boolean;
|
|
529
|
+
hide_contracts?: boolean;
|
|
530
|
+
recipient_asset_blacklist?: string;
|
|
531
|
+
recipient_asset_whitelist?: string;
|
|
532
|
+
sender_asset_blacklist?: string;
|
|
533
|
+
sender_asset_whitelist?: string;
|
|
534
|
+
account_whitelist?: string;
|
|
535
|
+
account_blacklist?: string;
|
|
536
|
+
order?: OrderParam;
|
|
537
|
+
sort?: OffersSort;
|
|
538
|
+
}
|
|
539
|
+
interface AccountApiParams extends GreylistParams, PrimaryBoundaryParams, DateBoundaryParams {
|
|
540
|
+
match?: string;
|
|
541
|
+
collection_name?: string;
|
|
542
|
+
schema_name?: string;
|
|
543
|
+
template_id?: string;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
type Fetch$1 = (input?: Request | string, init?: RequestInit) => Promise<Response>;
|
|
547
|
+
type ApiArgs$1 = {
|
|
548
|
+
fetch?: Fetch$1;
|
|
549
|
+
};
|
|
550
|
+
type DataOptions = Array<{
|
|
551
|
+
key: string;
|
|
552
|
+
value: any;
|
|
553
|
+
type?: string;
|
|
554
|
+
}>;
|
|
555
|
+
declare class ExplorerApi {
|
|
556
|
+
readonly action: Promise<ExplorerActionGenerator>;
|
|
557
|
+
private readonly endpoint;
|
|
558
|
+
private readonly namespace;
|
|
559
|
+
private readonly fetchBuiltin;
|
|
560
|
+
constructor(endpoint: string, namespace: string, args: ApiArgs$1);
|
|
561
|
+
getConfig(): Promise<IConfig>;
|
|
562
|
+
getAssets(options?: AssetsApiParams, page?: number, limit?: number, data?: DataOptions): Promise<IAsset[]>;
|
|
563
|
+
countAssets(options: AssetsApiParams, data?: DataOptions): Promise<number>;
|
|
564
|
+
getAsset(id: string): Promise<IAsset>;
|
|
565
|
+
getAssetStats(id: string): Promise<IAssetStats>;
|
|
566
|
+
getAssetLogs(id: string, page?: number, limit?: number, order?: string): Promise<ILog[]>;
|
|
567
|
+
getCollections(options?: CollectionApiParams, page?: number, limit?: number): Promise<ICollection[]>;
|
|
568
|
+
countCollections(options?: CollectionApiParams): Promise<number>;
|
|
569
|
+
getCollection(name: string): Promise<ICollection>;
|
|
570
|
+
getCollectionStats(name: string): Promise<ICollectionStats>;
|
|
571
|
+
getCollectionLogs(name: string, page?: number, limit?: number, order?: string): Promise<ILog[]>;
|
|
572
|
+
getSchemas(options?: SchemaApiParams, page?: number, limit?: number): Promise<IApiSchema[]>;
|
|
573
|
+
countSchemas(options?: SchemaApiParams): Promise<number>;
|
|
574
|
+
getSchema(collection: string, name: string): Promise<IApiSchema>;
|
|
575
|
+
getSchemaStats(collection: string, name: string): Promise<ISchemaStats>;
|
|
576
|
+
getSchemaLogs(collection: string, name: string, page?: number, limit?: number, order?: string): Promise<ILog[]>;
|
|
577
|
+
getTemplates(options?: TemplateApiParams, page?: number, limit?: number, data?: DataOptions): Promise<ITemplate[]>;
|
|
578
|
+
countTemplates(options?: TemplateApiParams, data?: DataOptions): Promise<number>;
|
|
579
|
+
getTemplate(collection: string, id: string): Promise<ITemplate>;
|
|
580
|
+
getTemplateStats(collection: string, name: string): Promise<ITemplateStats>;
|
|
581
|
+
getTemplateLogs(collection: string, id: string, page?: number, limit?: number, order?: string): Promise<ILog[]>;
|
|
582
|
+
getTransfers(options?: TransferApiParams, page?: number, limit?: number): Promise<ITransfer[]>;
|
|
583
|
+
countTransfers(options?: TransferApiParams): Promise<number>;
|
|
584
|
+
getOffers(options?: OfferApiParams, page?: number, limit?: number): Promise<IOffer[]>;
|
|
585
|
+
countOffers(options?: OfferApiParams): Promise<number>;
|
|
586
|
+
getOffer(id: string): Promise<IOffer>;
|
|
587
|
+
getAccounts(options?: AccountApiParams, page?: number, limit?: number): Promise<Array<{
|
|
588
|
+
account: string;
|
|
589
|
+
assets: string;
|
|
590
|
+
}>>;
|
|
591
|
+
getBurns(options?: AccountApiParams, page?: number, limit?: number): Promise<Array<{
|
|
592
|
+
account: string;
|
|
593
|
+
assets: string;
|
|
594
|
+
}>>;
|
|
595
|
+
countAccounts(options?: AccountApiParams): Promise<number>;
|
|
596
|
+
getAccount(account: string, options?: GreylistParams & HideOffersParams): Promise<IAccountStats>;
|
|
597
|
+
getAccountCollection(account: string, collection: string): Promise<IAccountCollectionStats>;
|
|
598
|
+
getAccountBurns(account: string, options?: GreylistParams & HideOffersParams): Promise<IAccountStats>;
|
|
599
|
+
fetchEndpoint<T>(path: string, args: any): Promise<T>;
|
|
600
|
+
countEndpoint(path: string, args: any): Promise<number>;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
declare class ExplorerActionGenerator extends ActionGenerator {
|
|
604
|
+
readonly api: ExplorerApi;
|
|
605
|
+
private config;
|
|
606
|
+
constructor(contract: string, api: ExplorerApi);
|
|
607
|
+
createcol(authorization: EosioAuthorizationObject[], author: string, collection_name: string, allow_notify: boolean, authorized_accounts: string[], notify_accounts: string[], market_fee: number, data: object): Promise<EosioActionObject[]>;
|
|
608
|
+
createtempl(authorization: EosioAuthorizationObject[], authorized_creator: string, collection_name: string, schema_name: string, transferable: boolean, burnable: boolean, max_supply: number, immutable_data: object): Promise<EosioActionObject[]>;
|
|
609
|
+
mintasset(authorization: EosioAuthorizationObject[], authorized_minter: string, collection_name: string, schema_name: string, template_id: number, new_owner: string, immutable_data: object, mutable_data: object, tokens_to_back: string[]): Promise<EosioActionObject[]>;
|
|
610
|
+
setassetdata(authorization: EosioAuthorizationObject[], authorized_editor: string, owner: string, asset_id: string, mutable_data: object): Promise<EosioActionObject[]>;
|
|
611
|
+
setcoldata(authorization: EosioAuthorizationObject[], collection_name: string, data: object): Promise<EosioActionObject[]>;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
declare class RpcCollection {
|
|
615
|
+
private readonly api;
|
|
616
|
+
readonly name: string;
|
|
617
|
+
private readonly _data;
|
|
618
|
+
constructor(api: RpcApi, name: string, data?: ICollectionRow, cache?: boolean);
|
|
619
|
+
author(): Promise<string>;
|
|
620
|
+
allowNotify(): Promise<boolean>;
|
|
621
|
+
authorizedAccounts(): Promise<string[]>;
|
|
622
|
+
notifyAccounts(): Promise<string[]>;
|
|
623
|
+
marketFee(): Promise<number>;
|
|
624
|
+
data(): Promise<any>;
|
|
625
|
+
toObject(): Promise<object>;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
declare class RpcSchema {
|
|
629
|
+
private readonly api;
|
|
630
|
+
readonly collection: string;
|
|
631
|
+
readonly name: string;
|
|
632
|
+
private readonly _data;
|
|
633
|
+
private readonly _collection;
|
|
634
|
+
private _formatTypes;
|
|
635
|
+
constructor(api: RpcApi, collection: string, name: string, data?: ISchemaRow, cache?: boolean);
|
|
636
|
+
format(): Promise<ISchema>;
|
|
637
|
+
rawFormat(): Promise<SchemaObject[]>;
|
|
638
|
+
formatTypes(): Promise<SchemaFormatType[]>;
|
|
639
|
+
toObject(): Promise<object>;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
declare class RpcTemplate {
|
|
643
|
+
private readonly api;
|
|
644
|
+
readonly collection: string;
|
|
645
|
+
readonly id: string;
|
|
646
|
+
private readonly _data;
|
|
647
|
+
private readonly _schema;
|
|
648
|
+
constructor(api: RpcApi, collection: string, id: string, data?: ITemplateRow, schema?: RpcSchema, cache?: boolean);
|
|
649
|
+
schema(): Promise<RpcSchema>;
|
|
650
|
+
immutableData(): Promise<object>;
|
|
651
|
+
mutableData(): Promise<object>;
|
|
652
|
+
data(): Promise<object>;
|
|
653
|
+
isTransferable(): Promise<boolean>;
|
|
654
|
+
isBurnable(): Promise<boolean>;
|
|
655
|
+
maxSupply(): Promise<number>;
|
|
656
|
+
circulation(): Promise<number>;
|
|
657
|
+
toObject(): Promise<object>;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
declare class RpcAsset {
|
|
661
|
+
private readonly api;
|
|
662
|
+
readonly owner: string;
|
|
663
|
+
readonly id: string;
|
|
664
|
+
private readonly _data;
|
|
665
|
+
private readonly _template;
|
|
666
|
+
private readonly _collection;
|
|
667
|
+
private readonly _schema;
|
|
668
|
+
constructor(api: RpcApi, owner: string, id: string, data?: IAssetRow, collection?: RpcCollection, schema?: RpcSchema, template?: RpcTemplate, cache?: boolean);
|
|
669
|
+
template(): Promise<RpcTemplate | null>;
|
|
670
|
+
collection(): Promise<RpcCollection>;
|
|
671
|
+
schema(): Promise<RpcSchema>;
|
|
672
|
+
backedTokens(): Promise<string[]>;
|
|
673
|
+
immutableData(): Promise<object>;
|
|
674
|
+
mutableData(): Promise<object>;
|
|
675
|
+
data(): Promise<object>;
|
|
676
|
+
toObject(): Promise<object>;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
declare class RpcOffer {
|
|
680
|
+
private readonly api;
|
|
681
|
+
readonly id: string;
|
|
682
|
+
private readonly _data;
|
|
683
|
+
private readonly _senderAssets;
|
|
684
|
+
private readonly _recipientAssets;
|
|
685
|
+
constructor(api: RpcApi, id: string, data?: IOfferRow, senderAssets?: RpcAsset[], receiverAssets?: RpcAsset[], cache?: boolean);
|
|
686
|
+
sender(): Promise<string>;
|
|
687
|
+
recipient(): Promise<string>;
|
|
688
|
+
senderAssets(): Promise<Array<RpcAsset | string>>;
|
|
689
|
+
recipientAssets(): Promise<Array<RpcAsset | string>>;
|
|
690
|
+
memo(): Promise<string>;
|
|
691
|
+
toObject(): Promise<object>;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
declare class RpcQueue {
|
|
695
|
+
private readonly api;
|
|
696
|
+
private readonly requestLimit;
|
|
697
|
+
private elements;
|
|
698
|
+
private interval;
|
|
699
|
+
private preloadedCollections;
|
|
700
|
+
constructor(api: RpcApi, requestLimit?: number);
|
|
701
|
+
fetchAsset(owner: string, assetID: string, useCache?: boolean): Promise<IAssetRow>;
|
|
702
|
+
fetchAccountAssets(account: string): Promise<IAssetRow[]>;
|
|
703
|
+
fetchTemplate(collectionName: string, templateID: string, useCache?: boolean): Promise<ITemplateRow>;
|
|
704
|
+
fetchSchemaFormatTypes(collectionName: string, schemaName: string): Promise<SchemaFormatType[]>;
|
|
705
|
+
fetchSchema(collectionName: string, schemaName: string, useCache?: boolean): Promise<ISchemaRow>;
|
|
706
|
+
fetchCollection(collectionName: string, useCache?: boolean): Promise<ICollectionRow>;
|
|
707
|
+
fetchCollectionSchemas(collectionName: string): Promise<ISchemaRow[]>;
|
|
708
|
+
fetchCollectionTemplates(collectionName: string): Promise<ITemplateRow[]>;
|
|
709
|
+
preloadCollection(collectionName: string, useCache?: boolean): Promise<void>;
|
|
710
|
+
fetchOffer(offerID: string, useCache?: boolean): Promise<IOfferRow>;
|
|
711
|
+
fetchAccountOffers(account: string): Promise<IOfferRow[]>;
|
|
712
|
+
private dequeue;
|
|
713
|
+
private fetch_optional_row;
|
|
714
|
+
private fetch_single_row;
|
|
715
|
+
private fetch_all_rows;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
type Fetch = (input?: Request | string, init?: RequestInit) => Promise<Response>;
|
|
719
|
+
type ApiArgs = {
|
|
720
|
+
fetch?: Fetch;
|
|
721
|
+
rateLimit?: number;
|
|
722
|
+
};
|
|
723
|
+
declare class RpcApi {
|
|
724
|
+
readonly queue: RpcQueue;
|
|
725
|
+
readonly cache: RpcCache;
|
|
726
|
+
readonly action: RpcActionGenerator;
|
|
727
|
+
readonly endpoint: string;
|
|
728
|
+
readonly contract: string;
|
|
729
|
+
private readonly fetchBuiltin;
|
|
730
|
+
private readonly _config;
|
|
731
|
+
constructor(endpoint: string, contract: string, args?: ApiArgs);
|
|
732
|
+
config(): Promise<IConfigRow>;
|
|
733
|
+
getAsset(owner: string, id: string, cache?: boolean): Promise<RpcAsset>;
|
|
734
|
+
getTemplate(collectionName: string, templateID: string, cache?: boolean): Promise<RpcTemplate>;
|
|
735
|
+
getCollection(collectionName: string, cache?: boolean): Promise<RpcCollection>;
|
|
736
|
+
getCollectionTemplates(collectionName: string): Promise<RpcTemplate[]>;
|
|
737
|
+
getCollectionsSchemas(collectionName: string): Promise<RpcSchema[]>;
|
|
738
|
+
getSchema(collectionName: string, schemaName: string, cache?: boolean): Promise<RpcSchema>;
|
|
739
|
+
getOffer(offerID: string, cache?: boolean): Promise<RpcOffer>;
|
|
740
|
+
getAccountOffers(account: string): Promise<RpcOffer[]>;
|
|
741
|
+
getAccountAssets(account: string): Promise<RpcAsset[]>;
|
|
742
|
+
getCollectionInventory(collectionName: string, account: string): Promise<RpcAsset[]>;
|
|
743
|
+
preloadCollection(collectionName: string, cache?: boolean): Promise<void>;
|
|
744
|
+
getTableRows({ code, scope, table, table_key, lower_bound, upper_bound, index_position, key_type }: any): Promise<any>;
|
|
745
|
+
fetchRpc(path: string, body: any): Promise<any>;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
declare class RpcActionGenerator extends ActionGenerator {
|
|
749
|
+
readonly api: RpcApi;
|
|
750
|
+
constructor(api: RpcApi);
|
|
751
|
+
createcol(authorization: EosioAuthorizationObject[], author: string, collection_name: string, allow_notify: boolean, authorized_accounts: string[], notify_accounts: string[], market_fee: number, data: object): Promise<EosioActionObject[]>;
|
|
752
|
+
createtempl(authorization: EosioAuthorizationObject[], authorized_creator: string, collection_name: string, schema_name: string, transferable: boolean, burnable: boolean, max_supply: number, immutable_data: object): Promise<EosioActionObject[]>;
|
|
753
|
+
mintasset(authorization: EosioAuthorizationObject[], authorized_minter: string, collection_name: string, schema_name: string, template_id: number, new_owner: string, immutable_data: object, mutable_data: object, tokens_to_back: string[]): Promise<EosioActionObject[]>;
|
|
754
|
+
setassetdata(authorization: EosioAuthorizationObject[], authorized_editor: string, owner: string, asset_id: string, mutable_data: object): Promise<EosioActionObject[]>;
|
|
755
|
+
setcoldata(authorization: EosioAuthorizationObject[], collection_name: string, data: object): Promise<EosioActionObject[]>;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
type ByteInput = Uint8Array | number[] | string;
|
|
759
|
+
declare function toByteArray(data: ByteInput): Uint8Array;
|
|
760
|
+
declare function serialize(object: any, schema: ISchema): Uint8Array;
|
|
761
|
+
declare function deserialize(data: ByteInput, schema: ISchema): {
|
|
762
|
+
[key: string]: any;
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
interface ITypeParser {
|
|
766
|
+
serialize(object: any): Uint8Array;
|
|
767
|
+
deserialize(data: SerializationState): any;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
declare const ParserTypes: {
|
|
771
|
+
[id: string]: ITypeParser;
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
type AtomicHubNetwork = 'wax' | 'wax-testnet' | 'vaulta' | 'xpr' | 'xpr-testnet' | 'jungle4';
|
|
775
|
+
declare const NETWORK_ENDPOINTS: Record<AtomicHubNetwork, {
|
|
776
|
+
api: string;
|
|
777
|
+
rpc: string;
|
|
778
|
+
}>;
|
|
779
|
+
declare function explorerApiForNetwork(network: AtomicHubNetwork, options?: ConstructorParameters<typeof ExplorerApi>[2]): ExplorerApi;
|
|
780
|
+
declare function rpcApiForNetwork(network: AtomicHubNetwork, contract?: string, options?: ConstructorParameters<typeof RpcApi>[2]): RpcApi;
|
|
781
|
+
|
|
782
|
+
declare class ApiError extends Error {
|
|
783
|
+
readonly message: any;
|
|
784
|
+
readonly status: number;
|
|
785
|
+
isApiError: boolean;
|
|
786
|
+
constructor(message: any, status: number);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
declare class DeserializationError extends Error {
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
declare class RpcError$1 extends Error {
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
declare class RpcError extends Error {
|
|
796
|
+
json: any;
|
|
797
|
+
constructor(json: any);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
declare class SchemaError extends Error {
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
declare class SerializationError extends Error {
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
type AssetsTableRow = {
|
|
807
|
+
asset_id: string;
|
|
808
|
+
collection_name: string;
|
|
809
|
+
schema_name: string;
|
|
810
|
+
template_id: number;
|
|
811
|
+
ram_payer: string;
|
|
812
|
+
backed_tokens: string[];
|
|
813
|
+
immutable_serialized_data: number[];
|
|
814
|
+
mutable_serialized_data: number[];
|
|
815
|
+
};
|
|
816
|
+
type AuthorSwapsTableRow = {
|
|
817
|
+
collection_name: string;
|
|
818
|
+
current_author: string;
|
|
819
|
+
new_author: string;
|
|
820
|
+
acceptance_date: number;
|
|
821
|
+
};
|
|
822
|
+
type BalancesTableRow = {
|
|
823
|
+
owner: string;
|
|
824
|
+
quantities: string[];
|
|
825
|
+
};
|
|
826
|
+
type CollectionsTableRow = {
|
|
827
|
+
collection_name: string;
|
|
828
|
+
author: string;
|
|
829
|
+
allow_notify: boolean;
|
|
830
|
+
authorized_accounts: string[];
|
|
831
|
+
notify_accounts: string[];
|
|
832
|
+
market_fee: number;
|
|
833
|
+
serialized_data: number[];
|
|
834
|
+
};
|
|
835
|
+
type ConfigTableRow = {
|
|
836
|
+
asset_counter: string;
|
|
837
|
+
template_counter: number;
|
|
838
|
+
offer_counter: string;
|
|
839
|
+
collection_format: Format[];
|
|
840
|
+
supported_tokens: Array<{
|
|
841
|
+
sym: string;
|
|
842
|
+
contract: string;
|
|
843
|
+
}>;
|
|
844
|
+
};
|
|
845
|
+
type OffersTableRow = {
|
|
846
|
+
offer_id: string;
|
|
847
|
+
sender: string;
|
|
848
|
+
recipient: string;
|
|
849
|
+
sender_asset_ids: string[];
|
|
850
|
+
recipient_asset_ids: string[];
|
|
851
|
+
memo: string;
|
|
852
|
+
ram_payer: string;
|
|
853
|
+
};
|
|
854
|
+
type SchemasTableRow = {
|
|
855
|
+
schema_name: string;
|
|
856
|
+
format: Format[];
|
|
857
|
+
};
|
|
858
|
+
type SchemaTypesTableRow = {
|
|
859
|
+
schema_name: string;
|
|
860
|
+
format_type: SchemaFormatType[];
|
|
861
|
+
};
|
|
862
|
+
type TemplatesTableRow = {
|
|
863
|
+
template_id: number;
|
|
864
|
+
schema_name: string;
|
|
865
|
+
transferable: boolean;
|
|
866
|
+
burnable: boolean;
|
|
867
|
+
max_supply: number;
|
|
868
|
+
issued_supply: number;
|
|
869
|
+
immutable_serialized_data: number[];
|
|
870
|
+
};
|
|
871
|
+
type Templates2TableRow = {
|
|
872
|
+
template_id: number;
|
|
873
|
+
schema_name: string;
|
|
874
|
+
mutable_serialized_data: number[];
|
|
875
|
+
};
|
|
876
|
+
type TokenConfigsTableRow = {
|
|
877
|
+
standard: string;
|
|
878
|
+
version: string;
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
type AcceptAuSwapActionData = {
|
|
882
|
+
collection_name: string;
|
|
883
|
+
};
|
|
884
|
+
type AcceptOfferActionData = {
|
|
885
|
+
offer_id: string;
|
|
886
|
+
};
|
|
887
|
+
type AddColAuthActionData = {
|
|
888
|
+
collection_name: string;
|
|
889
|
+
account_to_add: string;
|
|
890
|
+
};
|
|
891
|
+
type AddConfTokenActionData = {
|
|
892
|
+
token_contract: string;
|
|
893
|
+
token_symbol: string;
|
|
894
|
+
};
|
|
895
|
+
type AddNotifyAccActionData = {
|
|
896
|
+
collection_name: string;
|
|
897
|
+
account_to_add: string;
|
|
898
|
+
};
|
|
899
|
+
type AdminColEditActionData = {
|
|
900
|
+
collection_format_extension: Format[];
|
|
901
|
+
};
|
|
902
|
+
type AnnounceDepoActionData = {
|
|
903
|
+
owner: string;
|
|
904
|
+
symbol_to_announce: string;
|
|
905
|
+
};
|
|
906
|
+
type BackAssetActionData = {
|
|
907
|
+
payer: string;
|
|
908
|
+
asset_owner: string;
|
|
909
|
+
asset_id: string;
|
|
910
|
+
token_to_back: string;
|
|
911
|
+
};
|
|
912
|
+
type BurnAssetActionData = {
|
|
913
|
+
asset_owner: string;
|
|
914
|
+
asset_id: string;
|
|
915
|
+
};
|
|
916
|
+
type CancelOfferActionData = {
|
|
917
|
+
offer_id: string;
|
|
918
|
+
};
|
|
919
|
+
type CreateAuSwapActionData = {
|
|
920
|
+
collection_name: string;
|
|
921
|
+
new_author: string;
|
|
922
|
+
owner: boolean;
|
|
923
|
+
};
|
|
924
|
+
type CreateColActionData = {
|
|
925
|
+
author: string;
|
|
926
|
+
collection_name: string;
|
|
927
|
+
allow_notify: boolean;
|
|
928
|
+
authorized_accounts: string[];
|
|
929
|
+
notify_accounts: string[];
|
|
930
|
+
market_fee: number;
|
|
931
|
+
data: AttributeMap;
|
|
932
|
+
};
|
|
933
|
+
type CreateOfferActionData = {
|
|
934
|
+
sender: string;
|
|
935
|
+
recipient: string;
|
|
936
|
+
sender_asset_ids: string[];
|
|
937
|
+
recipient_asset_ids: string[];
|
|
938
|
+
memo: string;
|
|
939
|
+
};
|
|
940
|
+
type CreateSchemaActionData = {
|
|
941
|
+
authorized_creator: string;
|
|
942
|
+
collection_name: string;
|
|
943
|
+
schema_name: string;
|
|
944
|
+
schema_format: Format[];
|
|
945
|
+
};
|
|
946
|
+
type CreateTemplActionData = {
|
|
947
|
+
authorized_creator: string;
|
|
948
|
+
collection_name: string;
|
|
949
|
+
schema_name: string;
|
|
950
|
+
transferable: boolean;
|
|
951
|
+
burnable: boolean;
|
|
952
|
+
max_supply: number;
|
|
953
|
+
immutable_data: AttributeMap;
|
|
954
|
+
};
|
|
955
|
+
type CreateTempl2ActionData = {
|
|
956
|
+
authorized_creator: string;
|
|
957
|
+
collection_name: string;
|
|
958
|
+
schema_name: string;
|
|
959
|
+
transferable: boolean;
|
|
960
|
+
burnable: boolean;
|
|
961
|
+
max_supply: number;
|
|
962
|
+
immutable_data: AttributeMap;
|
|
963
|
+
mutable_data: AttributeMap;
|
|
964
|
+
};
|
|
965
|
+
type DeclineOfferActionData = {
|
|
966
|
+
offer_id: string;
|
|
967
|
+
};
|
|
968
|
+
type DelTemplateActionData = {
|
|
969
|
+
authorized_editor: string;
|
|
970
|
+
collection_name: string;
|
|
971
|
+
template_id: number;
|
|
972
|
+
};
|
|
973
|
+
type ExtendSchemaActionData = {
|
|
974
|
+
authorized_editor: string;
|
|
975
|
+
collection_name: string;
|
|
976
|
+
schema_name: string;
|
|
977
|
+
schema_format_extension: Format[];
|
|
978
|
+
};
|
|
979
|
+
type ForbidNotifyActionData = {
|
|
980
|
+
collection_name: string;
|
|
981
|
+
};
|
|
982
|
+
type InitActionData = Record<string, never>;
|
|
983
|
+
type LockTemplateActionData = {
|
|
984
|
+
authorized_editor: string;
|
|
985
|
+
collection_name: string;
|
|
986
|
+
template_id: number;
|
|
987
|
+
};
|
|
988
|
+
type LogBackAssetActionData = {
|
|
989
|
+
asset_owner: string;
|
|
990
|
+
asset_id: string;
|
|
991
|
+
backed_token: string;
|
|
992
|
+
};
|
|
993
|
+
type LogBurnAssetActionData = {
|
|
994
|
+
asset_owner: string;
|
|
995
|
+
asset_id: string;
|
|
996
|
+
collection_name: string;
|
|
997
|
+
schema_name: string;
|
|
998
|
+
template_id: number;
|
|
999
|
+
backed_tokens: string[];
|
|
1000
|
+
old_immutable_data: DecodedAttributeMap;
|
|
1001
|
+
old_mutable_data: DecodedAttributeMap;
|
|
1002
|
+
asset_ram_payer: string;
|
|
1003
|
+
};
|
|
1004
|
+
type LogMintActionData = {
|
|
1005
|
+
asset_id: string;
|
|
1006
|
+
authorized_minter: string;
|
|
1007
|
+
collection_name: string;
|
|
1008
|
+
schema_name: string;
|
|
1009
|
+
template_id: number;
|
|
1010
|
+
new_asset_owner: string;
|
|
1011
|
+
immutable_data: DecodedAttributeMap;
|
|
1012
|
+
mutable_data: DecodedAttributeMap;
|
|
1013
|
+
backed_tokens: string[];
|
|
1014
|
+
immutable_template_data: DecodedAttributeMap;
|
|
1015
|
+
};
|
|
1016
|
+
type LogNewOfferActionData = {
|
|
1017
|
+
offer_id: string;
|
|
1018
|
+
sender: string;
|
|
1019
|
+
recipient: string;
|
|
1020
|
+
sender_asset_ids: string[];
|
|
1021
|
+
recipient_asset_ids: string[];
|
|
1022
|
+
memo: string;
|
|
1023
|
+
};
|
|
1024
|
+
type LogNewTemplActionData = {
|
|
1025
|
+
template_id: number;
|
|
1026
|
+
authorized_creator: string;
|
|
1027
|
+
collection_name: string;
|
|
1028
|
+
schema_name: string;
|
|
1029
|
+
transferable: boolean;
|
|
1030
|
+
burnable: boolean;
|
|
1031
|
+
max_supply: number;
|
|
1032
|
+
immutable_data: DecodedAttributeMap;
|
|
1033
|
+
};
|
|
1034
|
+
type LogRamPayerActionData = {
|
|
1035
|
+
asset_owner: string;
|
|
1036
|
+
asset_id: string;
|
|
1037
|
+
old_ram_payer: string;
|
|
1038
|
+
new_ram_payer: string;
|
|
1039
|
+
};
|
|
1040
|
+
type LogSetDataActionData = {
|
|
1041
|
+
asset_owner: string;
|
|
1042
|
+
asset_id: string;
|
|
1043
|
+
old_data: DecodedAttributeMap;
|
|
1044
|
+
new_data: DecodedAttributeMap;
|
|
1045
|
+
};
|
|
1046
|
+
type LogSetDataTlActionData = {
|
|
1047
|
+
collection_name: string;
|
|
1048
|
+
schema_name: string;
|
|
1049
|
+
template_id: number;
|
|
1050
|
+
old_data: DecodedAttributeMap;
|
|
1051
|
+
new_data: DecodedAttributeMap;
|
|
1052
|
+
};
|
|
1053
|
+
type LogTransferActionData = {
|
|
1054
|
+
collection_name: string;
|
|
1055
|
+
from: string;
|
|
1056
|
+
to: string;
|
|
1057
|
+
asset_ids: string[];
|
|
1058
|
+
memo: string;
|
|
1059
|
+
};
|
|
1060
|
+
type MintAssetActionData = {
|
|
1061
|
+
authorized_minter: string;
|
|
1062
|
+
collection_name: string;
|
|
1063
|
+
schema_name: string;
|
|
1064
|
+
template_id: number;
|
|
1065
|
+
new_asset_owner: string;
|
|
1066
|
+
immutable_data: AttributeMap;
|
|
1067
|
+
mutable_data: AttributeMap;
|
|
1068
|
+
tokens_to_back: string[];
|
|
1069
|
+
};
|
|
1070
|
+
type PayOfferRamActionData = {
|
|
1071
|
+
payer: string;
|
|
1072
|
+
offer_id: string;
|
|
1073
|
+
};
|
|
1074
|
+
type RedTemplMaxActionData = {
|
|
1075
|
+
authorized_editor: string;
|
|
1076
|
+
collection_name: string;
|
|
1077
|
+
template_id: number;
|
|
1078
|
+
new_max_supply: number;
|
|
1079
|
+
};
|
|
1080
|
+
type RejectAuSwapActionData = {
|
|
1081
|
+
collection_name: string;
|
|
1082
|
+
};
|
|
1083
|
+
type RemColAuthActionData = {
|
|
1084
|
+
collection_name: string;
|
|
1085
|
+
account_to_remove: string;
|
|
1086
|
+
};
|
|
1087
|
+
type RemNotifyAccActionData = {
|
|
1088
|
+
collection_name: string;
|
|
1089
|
+
account_to_remove: string;
|
|
1090
|
+
};
|
|
1091
|
+
type SetAssetDataActionData = {
|
|
1092
|
+
authorized_editor: string;
|
|
1093
|
+
asset_owner: string;
|
|
1094
|
+
asset_id: string;
|
|
1095
|
+
new_mutable_data: AttributeMap;
|
|
1096
|
+
};
|
|
1097
|
+
type SetColDataActionData = {
|
|
1098
|
+
collection_name: string;
|
|
1099
|
+
data: AttributeMap;
|
|
1100
|
+
};
|
|
1101
|
+
type SetLastPayerActionData = {
|
|
1102
|
+
owner: string;
|
|
1103
|
+
collection_name: string;
|
|
1104
|
+
};
|
|
1105
|
+
type SetMarketFeeActionData = {
|
|
1106
|
+
collection_name: string;
|
|
1107
|
+
market_fee: number;
|
|
1108
|
+
};
|
|
1109
|
+
type SetRamPayerActionData = {
|
|
1110
|
+
new_payer: string;
|
|
1111
|
+
asset_id: string;
|
|
1112
|
+
};
|
|
1113
|
+
type SetSchemaTypActionData = {
|
|
1114
|
+
authorized_editor: string;
|
|
1115
|
+
collection_name: string;
|
|
1116
|
+
schema_name: string;
|
|
1117
|
+
schema_format_type: SchemaFormatType[];
|
|
1118
|
+
};
|
|
1119
|
+
type SetTemplDataActionData = {
|
|
1120
|
+
authorized_editor: string;
|
|
1121
|
+
collection_name: string;
|
|
1122
|
+
template_id: number;
|
|
1123
|
+
new_mutable_data: AttributeMap;
|
|
1124
|
+
};
|
|
1125
|
+
type SetVersionActionData = {
|
|
1126
|
+
new_version: string;
|
|
1127
|
+
};
|
|
1128
|
+
type TransferActionData = {
|
|
1129
|
+
from: string;
|
|
1130
|
+
to: string;
|
|
1131
|
+
asset_ids: string[];
|
|
1132
|
+
memo: string;
|
|
1133
|
+
};
|
|
1134
|
+
type WithdrawActionData = {
|
|
1135
|
+
owner: string;
|
|
1136
|
+
token_to_withdraw: string;
|
|
1137
|
+
};
|
|
1138
|
+
|
|
1139
|
+
declare const AtomicAssetsActionNames: readonly ["acceptauswap", "acceptoffer", "addcolauth", "addconftoken", "addnotifyacc", "admincoledit", "announcedepo", "backasset", "burnasset", "canceloffer", "createauswap", "createcol", "createoffer", "createschema", "createtempl", "createtempl2", "declineoffer", "deltemplate", "extendschema", "forbidnotify", "init", "locktemplate", "logbackasset", "logburnasset", "logmint", "lognewoffer", "lognewtempl", "logrampayer", "logsetdata", "logsetdatatl", "logtransfer", "mintasset", "payofferram", "redtemplmax", "rejectauswap", "remcolauth", "remnotifyacc", "setassetdata", "setcoldata", "setlastpayer", "setmarketfee", "setrampayer", "setschematyp", "settempldata", "setversion", "transfer", "withdraw"];
|
|
1140
|
+
type AtomicAssetsActionName = typeof AtomicAssetsActionNames[number];
|
|
1141
|
+
declare const AtomicAssetsActions: { readonly [K in AtomicAssetsActionName]: K; };
|
|
1142
|
+
|
|
1143
|
+
type MergedSchemaFormat = Array<Format & {
|
|
1144
|
+
mediatype: string | null;
|
|
1145
|
+
info: string | null;
|
|
1146
|
+
}>;
|
|
1147
|
+
declare function mergeSchemaFormatTypes(format: Format[], types: SchemaFormatType[]): MergedSchemaFormat;
|
|
1148
|
+
|
|
1149
|
+
export { ATOMIC_ATTRIBUTE, type AcceptAuSwapActionData, type AcceptOfferActionData, type AccountApiParams, ActionBuilder, ActionGenerator, type AddColAuthActionData, type AddConfTokenActionData, type AddNotifyAccActionData, type AdminColEditActionData, type AnnounceDepoActionData, ApiError, type ApiSchemaFormatField, type AssetFilterParams, type AssetsApiParams, AssetsSort, type AssetsTableRow, type AtomicAssetsActionName, AtomicAssetsActionNames, AtomicAssetsActions, type AtomicHubNetwork, type AttributeMap, type AttributeMapEntry, type AuthorSwapsTableRow, type BackAssetActionData, type BalancesTableRow, type BurnAssetActionData, type ByteInput, CachedObjectSchema, type CancelOfferActionData, type CollectionApiParams, CollectionsSort, type CollectionsTableRow, type ConfigTableRow, type CreateAuSwapActionData, type CreateColActionData, type CreateOfferActionData, type CreateSchemaActionData, type CreateTempl2ActionData, type CreateTemplActionData, type DataOptions, type DateBoundaryParams, type DeclineOfferActionData, type DecodedAttributeMap, type DelTemplateActionData, DeserializationError, type EosioActionObject, type EosioAuthorizationObject, type EosioSimpleAction, ExplorerActionGenerator, ExplorerApi, RpcError$1 as ExplorerError, type ExtendSchemaActionData, type ForbidNotifyActionData, type Format, type GreylistParams, type HideOffersParams, type IAccountCollectionStats, type IAccountStats, type IApiSchema, type IAsset, type IAssetRow, type IAssetStats, type ICollection, type ICollectionRow, type ICollectionStats, type IConfig, type IConfigRow, type ILightCollection, type ILightSchema, type ILightTemplate, type ILog, type IOffer, type IOfferRow, type ISchema, type ISchemaRow, type ISchemaStats, type ITemplate, type ITemplateRow, type ITemplateStats, type ITransfer, type InitActionData, type LockTemplateActionData, type LogBackAssetActionData, type LogBurnAssetActionData, type LogMintActionData, type LogNewOfferActionData, type LogNewTemplActionData, type LogRamPayerActionData, type LogSetDataActionData, type LogSetDataTlActionData, type LogTransferActionData, type MergedSchemaFormat, type MintAssetActionData, NETWORK_ENDPOINTS, ObjectSchema, type OfferApiParams, OfferState, OffersSort, type OffersTableRow, OrderParam, ParserTypes, type PayOfferRamActionData, type PrimaryBoundaryParams, type RedTemplMaxActionData, type RejectAuSwapActionData, type RemColAuthActionData, type RemNotifyAccActionData, RpcActionGenerator, RpcApi, RpcError, type SchemaApiParams, SchemaError, type SchemaFormat, type SchemaFormatType, type SchemaObject, type SchemaTypesTableRow, SchemasSort, type SchemasTableRow, SerializationError, type SetAssetDataActionData, type SetColDataActionData, type SetLastPayerActionData, type SetMarketFeeActionData, type SetRamPayerActionData, type SetSchemaTypActionData, type SetTemplDataActionData, type SetVersionActionData, type TemplateApiParams, type Templates2TableRow, TemplatesSort, type TemplatesTableRow, type TokenConfigsTableRow, type TransferActionData, type TransferApiParams, TransfersSort, type WithdrawActionData, convertAttributeMapToObject, createAttributeMap, deserialize, explorerApiForNetwork, mergeSchemaFormatTypes, rpcApiForNetwork, serialize, toAttributeMap, toByteArray };
|