@awarizon/sdk 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/README.md +182 -0
- package/dist/index.d.mts +615 -0
- package/dist/index.d.ts +615 -0
- package/dist/index.js +1154 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1000 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +40 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import { ApiPromise } from '@polkadot/api';
|
|
2
|
+
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
3
|
+
import { ISubmittableResult } from '@polkadot/types/types';
|
|
4
|
+
import { Keyring } from '@polkadot/keyring';
|
|
5
|
+
import { KeyringPair } from '@polkadot/keyring/types';
|
|
6
|
+
|
|
7
|
+
declare class AwarizonClient {
|
|
8
|
+
private api;
|
|
9
|
+
private endpoint;
|
|
10
|
+
constructor(endpoint?: string);
|
|
11
|
+
connect(): Promise<ApiPromise>;
|
|
12
|
+
disconnect(): Promise<void>;
|
|
13
|
+
getApi(): ApiPromise;
|
|
14
|
+
subscribeNewBlocks(callback: (blockNumber: number, blockHash: string) => void): Promise<() => void>;
|
|
15
|
+
getBalance(address: string): Promise<bigint>;
|
|
16
|
+
}
|
|
17
|
+
declare function connect(endpoint?: string): Promise<AwarizonClient>;
|
|
18
|
+
|
|
19
|
+
type AppCategory = 'DeFi' | 'Gaming' | 'Social' | 'Productivity' | 'Infrastructure' | 'DigitalAssets' | 'DeveloperTools' | 'Education';
|
|
20
|
+
type CampaignStatus = 'Pending' | 'Active' | 'Expired' | 'Terminated';
|
|
21
|
+
type InboxRecordStatus = 'Pending' | 'Delivered' | 'Dismissed' | 'Engaged';
|
|
22
|
+
type DeveloperStatus = 'Unverified' | 'Verified' | 'Suspended';
|
|
23
|
+
type TransactionType = 'Financial' | 'Distribution' | 'System';
|
|
24
|
+
interface TargetingCriteria {
|
|
25
|
+
wallet_age_min: number | null;
|
|
26
|
+
wallet_age_max: number | null;
|
|
27
|
+
riz_balance_min: bigint | null;
|
|
28
|
+
riz_balance_max: bigint | null;
|
|
29
|
+
activity_min: number | null;
|
|
30
|
+
activity_max: number | null;
|
|
31
|
+
region_codes: number[];
|
|
32
|
+
category_history: AppCategory[];
|
|
33
|
+
custom_logic_hash: string | null;
|
|
34
|
+
}
|
|
35
|
+
interface DeveloperProfile {
|
|
36
|
+
account: string;
|
|
37
|
+
staked_riz: bigint;
|
|
38
|
+
status: DeveloperStatus;
|
|
39
|
+
first_distribution_block: number | null;
|
|
40
|
+
violation_count: number;
|
|
41
|
+
total_campaigns: number;
|
|
42
|
+
total_deliveries: bigint;
|
|
43
|
+
}
|
|
44
|
+
interface AppManifest {
|
|
45
|
+
manifest_hash: string;
|
|
46
|
+
developer: string;
|
|
47
|
+
category: AppCategory;
|
|
48
|
+
registered_at: number;
|
|
49
|
+
metadata_uri: string;
|
|
50
|
+
}
|
|
51
|
+
interface Campaign {
|
|
52
|
+
campaign_id: string;
|
|
53
|
+
developer: string;
|
|
54
|
+
manifest_hash: string;
|
|
55
|
+
status: CampaignStatus;
|
|
56
|
+
created_at: number;
|
|
57
|
+
expires_at: number;
|
|
58
|
+
max_deliveries: bigint;
|
|
59
|
+
current_deliveries: bigint;
|
|
60
|
+
storage_fee_paid: bigint;
|
|
61
|
+
}
|
|
62
|
+
interface InboxRecord {
|
|
63
|
+
record_id: string;
|
|
64
|
+
campaign_id: string;
|
|
65
|
+
developer: string;
|
|
66
|
+
manifest_hash: string;
|
|
67
|
+
category: AppCategory;
|
|
68
|
+
status: InboxRecordStatus;
|
|
69
|
+
delivered_at: number;
|
|
70
|
+
engaged_at: number | null;
|
|
71
|
+
reward_claimed: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface ValidatorInfo {
|
|
74
|
+
account: string;
|
|
75
|
+
self_stake: bigint;
|
|
76
|
+
delegated_stake: bigint;
|
|
77
|
+
region_code: number;
|
|
78
|
+
country_code: number;
|
|
79
|
+
uptime_bps: number;
|
|
80
|
+
finality_bps: number;
|
|
81
|
+
blocks_bps: number;
|
|
82
|
+
slash_count: number;
|
|
83
|
+
is_active: boolean;
|
|
84
|
+
epoch_registered: bigint;
|
|
85
|
+
}
|
|
86
|
+
interface Delegation {
|
|
87
|
+
delegator: string;
|
|
88
|
+
validator: string;
|
|
89
|
+
amount: bigint;
|
|
90
|
+
epoch_delegated: bigint;
|
|
91
|
+
}
|
|
92
|
+
interface NetworkStats {
|
|
93
|
+
total_wallets: bigint;
|
|
94
|
+
total_deliveries: bigint;
|
|
95
|
+
active_campaigns: bigint;
|
|
96
|
+
total_staked: string;
|
|
97
|
+
current_epoch: bigint;
|
|
98
|
+
inbox_reserve_balance: string;
|
|
99
|
+
total_extrinsics: number;
|
|
100
|
+
circulating_supply: string;
|
|
101
|
+
non_circulating_supply: string;
|
|
102
|
+
}
|
|
103
|
+
interface TransactionSummary {
|
|
104
|
+
block_number: number;
|
|
105
|
+
extrinsic_index: number;
|
|
106
|
+
success: boolean;
|
|
107
|
+
}
|
|
108
|
+
interface CampaignDeliveryStatus {
|
|
109
|
+
current_deliveries: bigint;
|
|
110
|
+
max_deliveries: bigint;
|
|
111
|
+
remaining: bigint;
|
|
112
|
+
percentage_used: number;
|
|
113
|
+
}
|
|
114
|
+
interface WalletTargetingProfile {
|
|
115
|
+
wallet_age_days: number;
|
|
116
|
+
activity_count: number;
|
|
117
|
+
category_history: number[];
|
|
118
|
+
region_code: number;
|
|
119
|
+
}
|
|
120
|
+
interface ValidatorPerformanceResponse {
|
|
121
|
+
performance_score: number;
|
|
122
|
+
effective_rank: string;
|
|
123
|
+
uptime_bps: number;
|
|
124
|
+
finality_bps: number;
|
|
125
|
+
blocks_bps: number;
|
|
126
|
+
slash_count: number;
|
|
127
|
+
}
|
|
128
|
+
interface TokenStats {
|
|
129
|
+
total_issuance: string;
|
|
130
|
+
engagement_pool_balance: string;
|
|
131
|
+
}
|
|
132
|
+
interface VestingSchedule {
|
|
133
|
+
locked: string;
|
|
134
|
+
per_block: string;
|
|
135
|
+
starting_block: number;
|
|
136
|
+
}
|
|
137
|
+
interface EngagementEvent {
|
|
138
|
+
wallet: string;
|
|
139
|
+
record_id: string;
|
|
140
|
+
session_duration_seconds: number;
|
|
141
|
+
interaction_count: number;
|
|
142
|
+
submitted_at: number;
|
|
143
|
+
}
|
|
144
|
+
interface ValidatorPerformance {
|
|
145
|
+
validator: string;
|
|
146
|
+
uptime_bps: number;
|
|
147
|
+
finality_score_bps: number;
|
|
148
|
+
blocks_produced_bps: number;
|
|
149
|
+
slash_history_bps: number;
|
|
150
|
+
effective_stake: bigint;
|
|
151
|
+
delegated_stake: bigint;
|
|
152
|
+
}
|
|
153
|
+
type ChainType = 'EVM' | 'Solana' | 'Bitcoin' | 'Cosmos' | 'Near';
|
|
154
|
+
type LinkStatus = 'Pending' | 'Verified' | 'Revoked';
|
|
155
|
+
interface LinkedAddress {
|
|
156
|
+
chain: ChainType;
|
|
157
|
+
address: string;
|
|
158
|
+
status: LinkStatus;
|
|
159
|
+
linkedAt: number;
|
|
160
|
+
}
|
|
161
|
+
interface IdentityRecord {
|
|
162
|
+
account: string;
|
|
163
|
+
rizName: string | null;
|
|
164
|
+
rizNameFull: string | null;
|
|
165
|
+
displayName: string | null;
|
|
166
|
+
bio: string | null;
|
|
167
|
+
avatarUri: string | null;
|
|
168
|
+
website: string | null;
|
|
169
|
+
registeredAt: number;
|
|
170
|
+
verified: boolean;
|
|
171
|
+
reputationScore: number;
|
|
172
|
+
linkedAddresses: LinkedAddress[];
|
|
173
|
+
}
|
|
174
|
+
interface NameLookup {
|
|
175
|
+
rizName: string;
|
|
176
|
+
account: string;
|
|
177
|
+
identity: IdentityRecord | null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
declare const PLANCK = 1n;
|
|
181
|
+
declare const RIZ = 1000000000000n;
|
|
182
|
+
declare const MICRO_RIZ = 1000000n;
|
|
183
|
+
declare const MILLI_RIZ = 1000000000n;
|
|
184
|
+
declare const DEFAULT_ENDPOINT = "ws://127.0.0.1:9944";
|
|
185
|
+
declare const CHAIN_NAME = "Awarizon Development";
|
|
186
|
+
declare const GENESIS_VALIDATORS = 51;
|
|
187
|
+
declare const TARGET_VALIDATORS = 121;
|
|
188
|
+
declare const BLOCK_TIME_SECONDS = 3;
|
|
189
|
+
declare const EPOCH_LENGTH_BLOCKS = 28800;
|
|
190
|
+
declare const MIN_CAMPAIGN_DURATION_DAYS = 1;
|
|
191
|
+
declare const MAX_CAMPAIGN_DURATION_DAYS = 90;
|
|
192
|
+
declare const DEFAULT_CAMPAIGN_DURATION_DAYS = 30;
|
|
193
|
+
declare const MIN_SESSION_SECONDS = 120;
|
|
194
|
+
declare const MIN_INTERACTIONS = 5;
|
|
195
|
+
declare const ENGAGEMENT_COOLDOWN_HOURS = 24;
|
|
196
|
+
declare const MAX_ENGAGEMENT_EVENTS_PER_DAY = 10;
|
|
197
|
+
declare const MAX_TARGETING_DIMENSIONS = 6;
|
|
198
|
+
declare const MAX_REGION_CODES_PER_CAMPAIGN = 64;
|
|
199
|
+
declare const MAX_CATEGORY_HISTORY_ENTRIES = 8;
|
|
200
|
+
declare const DEVELOPER_MIN_TENURE_DAYS = 30;
|
|
201
|
+
declare const PERF_WEIGHT_UPTIME_BPS = 5000;
|
|
202
|
+
declare const PERF_WEIGHT_FINALITY_BPS = 2500;
|
|
203
|
+
declare const PERF_WEIGHT_BLOCKS_BPS = 1500;
|
|
204
|
+
declare const PERF_WEIGHT_SLASH_BPS = 1000;
|
|
205
|
+
|
|
206
|
+
declare function formatRiz(planck: bigint, decimals?: number): string;
|
|
207
|
+
declare function parseRiz(riz: string): bigint;
|
|
208
|
+
declare function hexToBytes(hex: string): Uint8Array;
|
|
209
|
+
declare function bytesToHex(bytes: Uint8Array): string;
|
|
210
|
+
declare function generateCampaignId(manifestHash: string): string;
|
|
211
|
+
declare function isValidAddress(address: string): boolean;
|
|
212
|
+
declare function blocksToTime(blocks: number): string;
|
|
213
|
+
declare function parsePlanckString(value: string): bigint;
|
|
214
|
+
|
|
215
|
+
declare const awarizonTypes: {
|
|
216
|
+
AppCategory: {
|
|
217
|
+
_enum: string[];
|
|
218
|
+
};
|
|
219
|
+
CampaignStatus: {
|
|
220
|
+
_enum: string[];
|
|
221
|
+
};
|
|
222
|
+
InboxRecordStatus: {
|
|
223
|
+
_enum: string[];
|
|
224
|
+
};
|
|
225
|
+
DeveloperStatus: {
|
|
226
|
+
_enum: string[];
|
|
227
|
+
};
|
|
228
|
+
TransactionType: {
|
|
229
|
+
_enum: string[];
|
|
230
|
+
};
|
|
231
|
+
TargetingCriteria: {
|
|
232
|
+
wallet_age_min: string;
|
|
233
|
+
wallet_age_max: string;
|
|
234
|
+
riz_balance_min: string;
|
|
235
|
+
riz_balance_max: string;
|
|
236
|
+
activity_min: string;
|
|
237
|
+
activity_max: string;
|
|
238
|
+
region_codes: string;
|
|
239
|
+
category_history: string;
|
|
240
|
+
custom_logic_hash: string;
|
|
241
|
+
};
|
|
242
|
+
DeveloperProfile: {
|
|
243
|
+
account: string;
|
|
244
|
+
staked_riz: string;
|
|
245
|
+
status: string;
|
|
246
|
+
first_distribution_block: string;
|
|
247
|
+
violation_count: string;
|
|
248
|
+
total_campaigns: string;
|
|
249
|
+
total_deliveries: string;
|
|
250
|
+
};
|
|
251
|
+
AppManifest: {
|
|
252
|
+
manifest_hash: string;
|
|
253
|
+
developer: string;
|
|
254
|
+
category: string;
|
|
255
|
+
registered_at: string;
|
|
256
|
+
metadata_uri: string;
|
|
257
|
+
};
|
|
258
|
+
Campaign: {
|
|
259
|
+
campaign_id: string;
|
|
260
|
+
developer: string;
|
|
261
|
+
manifest_hash: string;
|
|
262
|
+
targeting: string;
|
|
263
|
+
status: string;
|
|
264
|
+
created_at: string;
|
|
265
|
+
expires_at: string;
|
|
266
|
+
max_deliveries: string;
|
|
267
|
+
current_deliveries: string;
|
|
268
|
+
storage_fee_paid: string;
|
|
269
|
+
};
|
|
270
|
+
InboxRecord: {
|
|
271
|
+
record_id: string;
|
|
272
|
+
campaign_id: string;
|
|
273
|
+
developer: string;
|
|
274
|
+
manifest_hash: string;
|
|
275
|
+
category: string;
|
|
276
|
+
status: string;
|
|
277
|
+
delivered_at: string;
|
|
278
|
+
engaged_at: string;
|
|
279
|
+
reward_claimed: string;
|
|
280
|
+
};
|
|
281
|
+
ValidatorInfo: {
|
|
282
|
+
account: string;
|
|
283
|
+
self_stake: string;
|
|
284
|
+
delegated_stake: string;
|
|
285
|
+
region_code: string;
|
|
286
|
+
country_code: string;
|
|
287
|
+
uptime_bps: string;
|
|
288
|
+
finality_bps: string;
|
|
289
|
+
blocks_bps: string;
|
|
290
|
+
slash_count: string;
|
|
291
|
+
is_active: string;
|
|
292
|
+
epoch_registered: string;
|
|
293
|
+
};
|
|
294
|
+
Delegation: {
|
|
295
|
+
delegator: string;
|
|
296
|
+
validator: string;
|
|
297
|
+
amount: string;
|
|
298
|
+
epoch_delegated: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
declare const awarizonRpc: {
|
|
302
|
+
awarizon: {
|
|
303
|
+
getDeveloperProfile: {
|
|
304
|
+
description: string;
|
|
305
|
+
params: {
|
|
306
|
+
name: string;
|
|
307
|
+
type: string;
|
|
308
|
+
}[];
|
|
309
|
+
type: string;
|
|
310
|
+
};
|
|
311
|
+
getDeveloperCampaigns: {
|
|
312
|
+
description: string;
|
|
313
|
+
params: {
|
|
314
|
+
name: string;
|
|
315
|
+
type: string;
|
|
316
|
+
}[];
|
|
317
|
+
type: string;
|
|
318
|
+
};
|
|
319
|
+
getDeveloperManifests: {
|
|
320
|
+
description: string;
|
|
321
|
+
params: {
|
|
322
|
+
name: string;
|
|
323
|
+
type: string;
|
|
324
|
+
}[];
|
|
325
|
+
type: string;
|
|
326
|
+
};
|
|
327
|
+
getCampaign: {
|
|
328
|
+
description: string;
|
|
329
|
+
params: {
|
|
330
|
+
name: string;
|
|
331
|
+
type: string;
|
|
332
|
+
}[];
|
|
333
|
+
type: string;
|
|
334
|
+
};
|
|
335
|
+
getActiveCampaignCount: {
|
|
336
|
+
description: string;
|
|
337
|
+
params: never[];
|
|
338
|
+
type: string;
|
|
339
|
+
};
|
|
340
|
+
getCampaignDeliveryStatus: {
|
|
341
|
+
description: string;
|
|
342
|
+
params: {
|
|
343
|
+
name: string;
|
|
344
|
+
type: string;
|
|
345
|
+
}[];
|
|
346
|
+
type: string;
|
|
347
|
+
};
|
|
348
|
+
getInboxCount: {
|
|
349
|
+
description: string;
|
|
350
|
+
params: {
|
|
351
|
+
name: string;
|
|
352
|
+
type: string;
|
|
353
|
+
}[];
|
|
354
|
+
type: string;
|
|
355
|
+
};
|
|
356
|
+
getInboxRecord: {
|
|
357
|
+
description: string;
|
|
358
|
+
params: {
|
|
359
|
+
name: string;
|
|
360
|
+
type: string;
|
|
361
|
+
}[];
|
|
362
|
+
type: string;
|
|
363
|
+
};
|
|
364
|
+
getWalletTargetingProfile: {
|
|
365
|
+
description: string;
|
|
366
|
+
params: {
|
|
367
|
+
name: string;
|
|
368
|
+
type: string;
|
|
369
|
+
}[];
|
|
370
|
+
type: string;
|
|
371
|
+
};
|
|
372
|
+
checkCampaignMatch: {
|
|
373
|
+
description: string;
|
|
374
|
+
params: {
|
|
375
|
+
name: string;
|
|
376
|
+
type: string;
|
|
377
|
+
}[];
|
|
378
|
+
type: string;
|
|
379
|
+
};
|
|
380
|
+
getActiveValidators: {
|
|
381
|
+
description: string;
|
|
382
|
+
params: never[];
|
|
383
|
+
type: string;
|
|
384
|
+
};
|
|
385
|
+
getValidatorCount: {
|
|
386
|
+
description: string;
|
|
387
|
+
params: never[];
|
|
388
|
+
type: string;
|
|
389
|
+
};
|
|
390
|
+
getValidatorPerformance: {
|
|
391
|
+
description: string;
|
|
392
|
+
params: {
|
|
393
|
+
name: string;
|
|
394
|
+
type: string;
|
|
395
|
+
}[];
|
|
396
|
+
type: string;
|
|
397
|
+
};
|
|
398
|
+
getNetworkStats: {
|
|
399
|
+
description: string;
|
|
400
|
+
params: never[];
|
|
401
|
+
type: string;
|
|
402
|
+
};
|
|
403
|
+
getTokenStats: {
|
|
404
|
+
description: string;
|
|
405
|
+
params: never[];
|
|
406
|
+
type: string;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
declare function getDeveloperProfile(api: ApiPromise, account: string): Promise<DeveloperProfile | null>;
|
|
412
|
+
declare function getDeveloperCampaigns(api: ApiPromise, account: string): Promise<string[]>;
|
|
413
|
+
declare function getDeveloperManifests(api: ApiPromise, account: string): Promise<string[]>;
|
|
414
|
+
declare function getCampaign(api: ApiPromise, campaignId: string): Promise<Campaign | null>;
|
|
415
|
+
declare function getActiveCampaignCount(api: ApiPromise): Promise<bigint>;
|
|
416
|
+
declare function getCampaignDeliveryStatus(api: ApiPromise, campaignId: string): Promise<CampaignDeliveryStatus | null>;
|
|
417
|
+
declare function getInboxCount(api: ApiPromise, wallet: string): Promise<number>;
|
|
418
|
+
declare function getInboxRecord(api: ApiPromise, wallet: string, recordId: string): Promise<InboxRecord | null>;
|
|
419
|
+
declare function getWalletTargetingProfile(api: ApiPromise, wallet: string): Promise<WalletTargetingProfile>;
|
|
420
|
+
declare function checkCampaignMatch(api: ApiPromise, campaignId: string, wallet: string): Promise<boolean>;
|
|
421
|
+
declare function getActiveValidators(api: ApiPromise): Promise<string[]>;
|
|
422
|
+
declare function getValidatorCount(api: ApiPromise): Promise<number>;
|
|
423
|
+
declare function getValidatorPerformance(api: ApiPromise, account: string): Promise<ValidatorPerformanceResponse | null>;
|
|
424
|
+
declare function getNetworkStats(api: ApiPromise): Promise<NetworkStats>;
|
|
425
|
+
declare function getTokenStats(api: ApiPromise): Promise<TokenStats>;
|
|
426
|
+
declare function getRecentTransactions(api: ApiPromise): Promise<TransactionSummary[]>;
|
|
427
|
+
declare function getBlockTransactions(api: ApiPromise, blockNumber: number): Promise<TransactionSummary[]>;
|
|
428
|
+
declare function getVestingSchedule(api: ApiPromise, account: string): Promise<VestingSchedule[]>;
|
|
429
|
+
declare function getIdentity(api: ApiPromise, account: string): Promise<IdentityRecord | null>;
|
|
430
|
+
declare function lookupName(api: ApiPromise, name: string): Promise<NameLookup | null>;
|
|
431
|
+
declare function getLinkedAddresses(api: ApiPromise, account: string): Promise<LinkedAddress[]>;
|
|
432
|
+
declare function isNameAvailable(api: ApiPromise, name: string): Promise<boolean>;
|
|
433
|
+
declare function getTotalIdentities(api: ApiPromise): Promise<number>;
|
|
434
|
+
|
|
435
|
+
declare function buildRegisterDeveloper(api: ApiPromise): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
436
|
+
declare function buildStakeRiz(api: ApiPromise, amount: bigint): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
437
|
+
|
|
438
|
+
declare function buildRegisterManifest(api: ApiPromise, manifestHash: string, // 0x-prefixed 32-byte hex
|
|
439
|
+
category: AppCategory, metadataUri: string | Uint8Array): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
440
|
+
|
|
441
|
+
declare function buildCreateCampaign(api: ApiPromise, campaignId: string, // [u8; 32] 0x hex
|
|
442
|
+
manifestHash: string, // [u8; 32] 0x hex
|
|
443
|
+
targeting: TargetingCriteria, durationDays: number, // u32, 1–90
|
|
444
|
+
maxDeliveries: bigint): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
445
|
+
declare function buildTerminateCampaign(api: ApiPromise, campaignId: string): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
446
|
+
declare function buildExpireCampaign(api: ApiPromise, campaignId: string): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
447
|
+
declare function buildAdvanceEpoch(api: ApiPromise): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
448
|
+
declare function buildResetDailyEngagement(api: ApiPromise): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
449
|
+
|
|
450
|
+
declare function buildDeliverToInbox(api: ApiPromise, wallet: string, // SS58 address of target wallet
|
|
451
|
+
campaignId: string, // [u8; 32] 0x hex
|
|
452
|
+
recordId: string): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
453
|
+
declare function buildDismissInboxRecord(api: ApiPromise, recordId: string): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
454
|
+
declare function buildSubmitEngagement(api: ApiPromise, recordId: string, // [u8; 32] 0x hex
|
|
455
|
+
sessionDurationSeconds: number, // u32, must be >= MIN_SESSION_SECONDS (120)
|
|
456
|
+
interactionCount: number): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
457
|
+
declare function buildClaimReward(api: ApiPromise, recordId: string): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
458
|
+
declare function buildUpdateWalletIndex(api: ApiPromise, walletAgeDays: number, // u32
|
|
459
|
+
activityCount: number, // u32
|
|
460
|
+
categoryHistory: number[], // BoundedVec<u8, 8> — AppCategory IDs
|
|
461
|
+
regionCode: number): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
462
|
+
|
|
463
|
+
declare function buildBloomFilter(api: ApiPromise, campaignId: string): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
464
|
+
declare function buildCheckWalletMatch(api: ApiPromise, campaignId: string, // [u8; 32] 0x hex
|
|
465
|
+
wallet: string): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
466
|
+
declare function buildRunTargetingBatch(api: ApiPromise, campaignId: string, // [u8; 32] 0x hex
|
|
467
|
+
wallets: string[]): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
468
|
+
|
|
469
|
+
declare function buildRegisterValidator(api: ApiPromise, selfStake: bigint, // u128 — must be >= MinValidatorStake
|
|
470
|
+
regionCode: number, // u8
|
|
471
|
+
countryCode: number): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
472
|
+
declare function buildDelegateStake(api: ApiPromise, validator: string, // SS58 address
|
|
473
|
+
amount: bigint): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
474
|
+
declare function buildUndelegateStake(api: ApiPromise, validator: string): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
475
|
+
declare function buildUpdatePerformance(api: ApiPromise, validator: string, // SS58 address
|
|
476
|
+
uptimeBps: number, // u32, 0–10000
|
|
477
|
+
finalityBps: number, // u32, 0–10000
|
|
478
|
+
blocksBps: number): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
479
|
+
declare function buildRunEpochElection(api: ApiPromise, epoch: bigint): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
480
|
+
declare function buildSlashValidator(api: ApiPromise, validator: string, // SS58 address
|
|
481
|
+
reason: number): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
482
|
+
|
|
483
|
+
declare function buildCreateAsset(api: ApiPromise, id: number, // AssetId (u32)
|
|
484
|
+
admin: string, // SS58 address — asset admin account
|
|
485
|
+
minBalance: bigint): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
486
|
+
declare function buildMintAsset(api: ApiPromise, id: number, // AssetId (u32)
|
|
487
|
+
beneficiary: string, // SS58 address
|
|
488
|
+
amount: bigint): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
489
|
+
declare function buildTransferAsset(api: ApiPromise, id: number, // AssetId (u32)
|
|
490
|
+
target: string, // SS58 address
|
|
491
|
+
amount: bigint): SubmittableExtrinsic<'promise', ISubmittableResult>;
|
|
492
|
+
|
|
493
|
+
declare function createKeyring(): Keyring;
|
|
494
|
+
declare function keypairFromMnemonic(mnemonic: string): KeyringPair;
|
|
495
|
+
declare function keypairFromSeed(seed: string): KeyringPair;
|
|
496
|
+
declare function aliceKeypair(): KeyringPair;
|
|
497
|
+
declare function bobKeypair(): KeyringPair;
|
|
498
|
+
declare function signAndSend(api: ApiPromise, extrinsic: SubmittableExtrinsic<'promise', ISubmittableResult>, signer: KeyringPair): Promise<{
|
|
499
|
+
blockHash: string;
|
|
500
|
+
txHash: string;
|
|
501
|
+
}>;
|
|
502
|
+
|
|
503
|
+
declare class AwarizonError extends Error {
|
|
504
|
+
readonly code: string;
|
|
505
|
+
readonly details?: unknown | undefined;
|
|
506
|
+
constructor(message: string, code: string, details?: unknown | undefined);
|
|
507
|
+
}
|
|
508
|
+
declare class DeveloperNotFoundError extends AwarizonError {
|
|
509
|
+
constructor();
|
|
510
|
+
}
|
|
511
|
+
declare class DeveloperAlreadyRegisteredError extends AwarizonError {
|
|
512
|
+
constructor();
|
|
513
|
+
}
|
|
514
|
+
declare class DeveloperNotVerifiedError extends AwarizonError {
|
|
515
|
+
constructor();
|
|
516
|
+
}
|
|
517
|
+
declare class DeveloperSuspendedError extends AwarizonError {
|
|
518
|
+
constructor();
|
|
519
|
+
}
|
|
520
|
+
declare class ManifestNotFoundError extends AwarizonError {
|
|
521
|
+
constructor();
|
|
522
|
+
}
|
|
523
|
+
declare class ManifestAlreadyRegisteredError extends AwarizonError {
|
|
524
|
+
constructor();
|
|
525
|
+
}
|
|
526
|
+
declare class ManifestLimitReachedError extends AwarizonError {
|
|
527
|
+
constructor();
|
|
528
|
+
}
|
|
529
|
+
declare class CampaignNotFoundError extends AwarizonError {
|
|
530
|
+
constructor();
|
|
531
|
+
}
|
|
532
|
+
declare class CampaignNotActiveError extends AwarizonError {
|
|
533
|
+
constructor();
|
|
534
|
+
}
|
|
535
|
+
declare class CampaignExpiredError extends AwarizonError {
|
|
536
|
+
constructor();
|
|
537
|
+
}
|
|
538
|
+
declare class CampaignDeliveryLimitReachedError extends AwarizonError {
|
|
539
|
+
constructor();
|
|
540
|
+
}
|
|
541
|
+
declare class InboxRecordNotFoundError extends AwarizonError {
|
|
542
|
+
constructor();
|
|
543
|
+
}
|
|
544
|
+
declare class InboxAlreadyDeliveredError extends AwarizonError {
|
|
545
|
+
constructor();
|
|
546
|
+
}
|
|
547
|
+
declare class InboxFullError extends AwarizonError {
|
|
548
|
+
constructor();
|
|
549
|
+
}
|
|
550
|
+
declare class EngagementCooldownActiveError extends AwarizonError {
|
|
551
|
+
constructor();
|
|
552
|
+
}
|
|
553
|
+
declare class EngagementDailyLimitReachedError extends AwarizonError {
|
|
554
|
+
constructor();
|
|
555
|
+
}
|
|
556
|
+
declare class EngagementInvalidError extends AwarizonError {
|
|
557
|
+
constructor();
|
|
558
|
+
}
|
|
559
|
+
declare class InsufficientStakeError extends AwarizonError {
|
|
560
|
+
constructor();
|
|
561
|
+
}
|
|
562
|
+
declare class InsufficientBalanceError extends AwarizonError {
|
|
563
|
+
constructor();
|
|
564
|
+
}
|
|
565
|
+
declare class TargetingDimensionLimitExceededError extends AwarizonError {
|
|
566
|
+
constructor();
|
|
567
|
+
}
|
|
568
|
+
declare class InvalidManifestHashError extends AwarizonError {
|
|
569
|
+
constructor();
|
|
570
|
+
}
|
|
571
|
+
declare class InvalidCampaignIdError extends AwarizonError {
|
|
572
|
+
constructor();
|
|
573
|
+
}
|
|
574
|
+
declare class UnauthorizedError extends AwarizonError {
|
|
575
|
+
constructor();
|
|
576
|
+
}
|
|
577
|
+
declare class EpochNotReadyError extends AwarizonError {
|
|
578
|
+
constructor();
|
|
579
|
+
}
|
|
580
|
+
declare class NotExpiredYetError extends AwarizonError {
|
|
581
|
+
constructor();
|
|
582
|
+
}
|
|
583
|
+
declare class ResetNotReadyError extends AwarizonError {
|
|
584
|
+
constructor();
|
|
585
|
+
}
|
|
586
|
+
declare class ValidatorAlreadyRegisteredError extends AwarizonError {
|
|
587
|
+
constructor();
|
|
588
|
+
}
|
|
589
|
+
declare class ValidatorNotFoundError extends AwarizonError {
|
|
590
|
+
constructor();
|
|
591
|
+
}
|
|
592
|
+
declare class RegionCapExceededError extends AwarizonError {
|
|
593
|
+
constructor();
|
|
594
|
+
}
|
|
595
|
+
declare class CountryCapExceededError extends AwarizonError {
|
|
596
|
+
constructor();
|
|
597
|
+
}
|
|
598
|
+
declare class DelegationNotFoundError extends AwarizonError {
|
|
599
|
+
constructor();
|
|
600
|
+
}
|
|
601
|
+
declare class CannotDelegateToSelfError extends AwarizonError {
|
|
602
|
+
constructor();
|
|
603
|
+
}
|
|
604
|
+
declare class ValidatorNotActiveError extends AwarizonError {
|
|
605
|
+
constructor();
|
|
606
|
+
}
|
|
607
|
+
declare class AlreadyDelegatedError extends AwarizonError {
|
|
608
|
+
constructor();
|
|
609
|
+
}
|
|
610
|
+
declare class MaxValidatorsReachedError extends AwarizonError {
|
|
611
|
+
constructor();
|
|
612
|
+
}
|
|
613
|
+
declare function parseChainError(error: unknown): AwarizonError;
|
|
614
|
+
|
|
615
|
+
export { AlreadyDelegatedError, type AppCategory, type AppManifest, AwarizonClient, AwarizonError, BLOCK_TIME_SECONDS, CHAIN_NAME, type Campaign, CampaignDeliveryLimitReachedError, type CampaignDeliveryStatus, CampaignExpiredError, CampaignNotActiveError, CampaignNotFoundError, type CampaignStatus, CannotDelegateToSelfError, type ChainType, CountryCapExceededError, DEFAULT_CAMPAIGN_DURATION_DAYS, DEFAULT_ENDPOINT, DEVELOPER_MIN_TENURE_DAYS, type Delegation, DelegationNotFoundError, DeveloperAlreadyRegisteredError, DeveloperNotFoundError, DeveloperNotVerifiedError, type DeveloperProfile, type DeveloperStatus, DeveloperSuspendedError, ENGAGEMENT_COOLDOWN_HOURS, EPOCH_LENGTH_BLOCKS, EngagementCooldownActiveError, EngagementDailyLimitReachedError, type EngagementEvent, EngagementInvalidError, EpochNotReadyError, GENESIS_VALIDATORS, type IdentityRecord, InboxAlreadyDeliveredError, InboxFullError, type InboxRecord, InboxRecordNotFoundError, type InboxRecordStatus, InsufficientBalanceError, InsufficientStakeError, InvalidCampaignIdError, InvalidManifestHashError, type LinkStatus, type LinkedAddress, MAX_CAMPAIGN_DURATION_DAYS, MAX_CATEGORY_HISTORY_ENTRIES, MAX_ENGAGEMENT_EVENTS_PER_DAY, MAX_REGION_CODES_PER_CAMPAIGN, MAX_TARGETING_DIMENSIONS, MICRO_RIZ, MILLI_RIZ, MIN_CAMPAIGN_DURATION_DAYS, MIN_INTERACTIONS, MIN_SESSION_SECONDS, ManifestAlreadyRegisteredError, ManifestLimitReachedError, ManifestNotFoundError, MaxValidatorsReachedError, type NameLookup, type NetworkStats, NotExpiredYetError, PERF_WEIGHT_BLOCKS_BPS, PERF_WEIGHT_FINALITY_BPS, PERF_WEIGHT_SLASH_BPS, PERF_WEIGHT_UPTIME_BPS, PLANCK, RIZ, RegionCapExceededError, ResetNotReadyError, TARGET_VALIDATORS, type TargetingCriteria, TargetingDimensionLimitExceededError, type TokenStats, type TransactionSummary, type TransactionType, UnauthorizedError, ValidatorAlreadyRegisteredError, type ValidatorInfo, ValidatorNotActiveError, ValidatorNotFoundError, type ValidatorPerformance, type ValidatorPerformanceResponse, type VestingSchedule, type WalletTargetingProfile, aliceKeypair, awarizonRpc, awarizonTypes, blocksToTime, bobKeypair, buildAdvanceEpoch, buildBloomFilter, buildCheckWalletMatch, buildClaimReward, buildCreateAsset, buildCreateCampaign, buildDelegateStake, buildDeliverToInbox, buildDismissInboxRecord, buildExpireCampaign, buildMintAsset, buildRegisterDeveloper, buildRegisterManifest, buildRegisterValidator, buildResetDailyEngagement, buildRunEpochElection, buildRunTargetingBatch, buildSlashValidator, buildStakeRiz, buildSubmitEngagement, buildTerminateCampaign, buildTransferAsset, buildUndelegateStake, buildUpdatePerformance, buildUpdateWalletIndex, bytesToHex, checkCampaignMatch, connect, createKeyring, formatRiz, generateCampaignId, getActiveCampaignCount, getActiveValidators, getBlockTransactions, getCampaign, getCampaignDeliveryStatus, getDeveloperCampaigns, getDeveloperManifests, getDeveloperProfile, getIdentity, getInboxCount, getInboxRecord, getLinkedAddresses, getNetworkStats, getRecentTransactions, getTokenStats, getTotalIdentities, getValidatorCount, getValidatorPerformance, getVestingSchedule, getWalletTargetingProfile, hexToBytes, isNameAvailable, isValidAddress, keypairFromMnemonic, keypairFromSeed, lookupName, parseChainError, parsePlanckString, parseRiz, signAndSend };
|