@d9-network/spec 0.0.3 → 0.0.6

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.
Files changed (59) hide show
  1. package/dist/d9_metadata-KHMVPHO2-BILssUTo.mjs +6 -0
  2. package/dist/d9_metadata-KHMVPHO2-BILssUTo.mjs.map +1 -0
  3. package/dist/d9_metadata-KHMVPHO2-CTHNW2Z9.cjs +7 -0
  4. package/dist/d9_metadata-KHMVPHO2-CTHNW2Z9.cjs.map +1 -0
  5. package/dist/descriptors-KKD7UFMX-BQkrqfg1.mjs +16 -0
  6. package/dist/descriptors-KKD7UFMX-BQkrqfg1.mjs.map +1 -0
  7. package/dist/descriptors-KKD7UFMX-DBUb__c-.cjs +17 -0
  8. package/dist/descriptors-KKD7UFMX-DBUb__c-.cjs.map +1 -0
  9. package/dist/index.cjs +250 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.cts +8712 -0
  12. package/dist/index.d.mts +8712 -0
  13. package/dist/index.mjs +195 -0
  14. package/dist/index.mjs.map +1 -0
  15. package/dist/metadataTypes-LUDFOAMC-DTvnnJbu.cjs +7 -0
  16. package/dist/metadataTypes-LUDFOAMC-DTvnnJbu.cjs.map +1 -0
  17. package/dist/metadataTypes-LUDFOAMC-FMlTA1su.mjs +6 -0
  18. package/dist/metadataTypes-LUDFOAMC-FMlTA1su.mjs.map +1 -0
  19. package/package.json +4 -1
  20. package/.claude/settings.local.json +0 -8
  21. package/.papi/contracts/burnManager.json +0 -1300
  22. package/.papi/contracts/burnMining.json +0 -1385
  23. package/.papi/contracts/crossChainTransfer.json +0 -1693
  24. package/.papi/contracts/marketMaker.json +0 -1470
  25. package/.papi/contracts/merchantMining.json +0 -1750
  26. package/.papi/contracts/miningPool.json +0 -1019
  27. package/.papi/contracts/nodeReward.json +0 -1214
  28. package/.papi/contracts/usdt.json +0 -1036
  29. package/.papi/descriptors/.gitignore +0 -3
  30. package/.papi/descriptors/package.json +0 -24
  31. package/.papi/metadata/d9.scale +0 -0
  32. package/.papi/polkadot-api.json +0 -22
  33. package/assets/ABIs/burn-manager.json +0 -1300
  34. package/assets/ABIs/burn-mining.json +0 -1385
  35. package/assets/ABIs/cross-chain-transfer.json +0 -1693
  36. package/assets/ABIs/market-maker.json +0 -1470
  37. package/assets/ABIs/merchant-mining.json +0 -1750
  38. package/assets/ABIs/mining-pool.json +0 -1019
  39. package/assets/ABIs/node-reward.json +0 -1214
  40. package/assets/ABIs/usdt.json +0 -1036
  41. package/docs/CLAUDE.md +0 -364
  42. package/docs/CONTRACTS.md +0 -603
  43. package/docs/PALLETS.md +0 -726
  44. package/docs/TYPES.md +0 -618
  45. package/scripts/papi-add-ink.ts +0 -104
  46. package/src/client.ts +0 -68
  47. package/src/index.ts +0 -17
  48. package/src/wallet/account.ts +0 -57
  49. package/src/wallet/hex.ts +0 -30
  50. package/src/wallet/index.ts +0 -6
  51. package/src/wallet/mnemonic.ts +0 -19
  52. package/src/wallet/signer.ts +0 -9
  53. package/src/wallet/sr25519.ts +0 -42
  54. package/src/wallet/ss58.ts +0 -14
  55. package/test/client.test.ts +0 -15
  56. package/test/descriptors.test.ts +0 -32
  57. package/test/wallet.test.ts +0 -65
  58. package/tsconfig.json +0 -13
  59. package/tsdown.config.ts +0 -19
package/docs/PALLETS.md DELETED
@@ -1,726 +0,0 @@
1
- # D9 Chain Pallets Documentation
2
-
3
- This document describes all pallets available on the D9 blockchain, including their storage items, extrinsics (calls), events, errors, and constants.
4
-
5
- ## Table of Contents
6
-
7
- 1. [D9 Custom Pallets](#d9-custom-pallets)
8
- - [D9Referral](#d9referral)
9
- - [D9Treasury](#d9treasury)
10
- - [D9NodeVoting](#d9nodevoting)
11
- - [D9NodeRewards](#d9noderewards)
12
- - [CouncilLock](#councillock)
13
- - [D9MultiSig](#d9multisig)
14
- 2. [Standard Substrate Pallets](#standard-substrate-pallets)
15
- - [System](#system)
16
- - [Balances](#balances)
17
- - [Timestamp](#timestamp)
18
- - [Session](#session)
19
- - [Grandpa](#grandpa)
20
- - [Sudo](#sudo)
21
- - [Assets](#assets)
22
- - [Contracts](#contracts)
23
- - [Collective](#collective)
24
- - [Treasury](#treasury)
25
- - [ImOnline](#imonline)
26
-
27
- ---
28
-
29
- ## D9 Custom Pallets
30
-
31
- ### D9Referral
32
-
33
- Manages the referral system and referral relationships between accounts.
34
-
35
- #### Storage
36
-
37
- | Name | Type | Description |
38
- |------|------|-------------|
39
- | `MaxReferralDepth` | `number` | Maximum depth of the referral tree (Nth ancestor node) |
40
- | `ReferralRelationships` | `Map<SS58String, SS58String>` | Child -> Parent referral relationship mapping |
41
- | `DirectReferralsCount` | `Map<SS58String, number>` | Count of direct referrals for each account |
42
-
43
- #### Extrinsics
44
-
45
- | Name | Parameters | Description |
46
- |------|------------|-------------|
47
- | `change_referral_depth` | `depth: number` | Change the maximum referral depth |
48
-
49
- #### Events
50
-
51
- | Name | Data | Description |
52
- |------|------|-------------|
53
- | `NewReferralRelationshipCreated` | `[child, parent]` | A new referral relationship was established |
54
- | `NewReferralDepthSet` | `number` | Maximum referral depth was updated |
55
- | `NewDefaultParentSet` | `SS58String` | Default parent account was set |
56
-
57
- #### Errors
58
-
59
- | Name | Description |
60
- |------|-------------|
61
- | `NoReferralAccountRecord` | No referral record exists for the account |
62
-
63
- ---
64
-
65
- ### D9Treasury
66
-
67
- Manages the D9 network treasury and treasurer.
68
-
69
- #### Storage
70
-
71
- | Name | Type | Description |
72
- |------|------|-------------|
73
- | `Treasurer` | `Option<AccountId>` | The current treasurer account |
74
-
75
- #### Extrinsics
76
-
77
- | Name | Parameters | Description |
78
- |------|------------|-------------|
79
- | `new_treasurer` | `treasurer: AccountId` | Set a new treasurer |
80
-
81
- #### Events
82
-
83
- | Name | Data | Description |
84
- |------|------|-------------|
85
- | `NewTreasurer` | `SS58String` | A new treasurer was appointed |
86
-
87
- #### Errors
88
-
89
- | Name | Description |
90
- |------|-------------|
91
- | `OnlyTreasurerCanDoThis` | Only the treasurer can perform this action |
92
- | `NoTreasurerSet` | No treasurer has been set |
93
-
94
- ---
95
-
96
- ### D9NodeVoting
97
-
98
- Manages node candidacy and voting system for validators.
99
-
100
- #### Storage
101
-
102
- | Name | Type | Description |
103
- |------|------|-------------|
104
- | `UsersVotingInterests` | `Map<SS58String, VotingInterests>` | User's voting power/interests |
105
- | `UserToNodeVotesTotals` | `Map<[User, Node], bigint>` | Votes delegated from user to node |
106
- | `NodeToUserVotesTotals` | `Map<[Node, User], bigint>` | Supporters of a candidate node |
107
- | `NodeAccumulativeVotes` | `Map<SS58String, bigint>` | Total accumulated votes for each node |
108
- | `CurrentNumberOfCandidatesNodes` | `number` | Current number of candidate nodes |
109
- | `SessionNodeList` | `Map<number, Vec<AccountId>>` | List of nodes per session |
110
- | `CurrentSessionIndex` | `number` | Current session index |
111
- | `CurrentValidatorVoteStats` | `Map<SS58String, VoteStats>` | Vote statistics for current validators |
112
- | `NodeMetadata` | `Map<SS58String, NodeMetadata>` | Metadata for each node |
113
- | `PalletAdmin` | `SS58String` | Pallet administrator account |
114
-
115
- #### Extrinsics
116
-
117
- | Name | Parameters | Description |
118
- |------|------------|-------------|
119
- | `submit_candidacy` | `metadata: NodeMetadata` | Submit candidacy to become a validator |
120
- | `add_voting_interest` | `amount: bigint` | Add voting power by burning tokens |
121
- | `delegate_votes` | `delegations: Vec<(Node, Votes)>` | Delegate votes to candidates |
122
- | `remove_candidacy` | - | Remove own candidacy |
123
- | `try_remove_votes_from_candidate` | `node: AccountId, votes: bigint` | Attempt to remove delegated votes |
124
- | `redistribute_votes` | `from: AccountId, to: Vec<(Node, Votes)>` | Redistribute votes between candidates |
125
- | `change_candidate_name` | `name: String` | Change candidate display name |
126
- | `change_candidate_supporter_share` | `share: Percent` | Change supporter reward share percentage |
127
- | `set_pallet_admin` | `admin: AccountId` | Set pallet administrator |
128
-
129
- #### Events
130
-
131
- | Name | Data | Description |
132
- |------|------|-------------|
133
- | `CandidacySubmitted` | `SS58String` | A new candidacy was submitted |
134
- | `VotesDelegatedBy` | `SS58String` | Votes were delegated by an account |
135
- | `CandidacyRemoved` | `SS58String` | A candidacy was removed |
136
-
137
- #### Errors
138
-
139
- | Name | Description |
140
- |------|-------------|
141
- | `HexDecodeError` | Error decoding hex string |
142
- | `EmptyDelegationList` | Delegation list cannot be empty |
143
- | `DelegationListTooLarge` | Too many delegations in list |
144
- | `DelegatorHasNoVotingCapacity` | Delegator has no voting capacity |
145
- | `DelegatorHasNoAvailableVotes` | Delegator has no available votes |
146
- | `DelegatorHasInsufficientVotes` | Insufficient votes for delegation |
147
- | `AttemptingToRemoveMoreVotesThanDelegated` | Trying to remove more votes than delegated |
148
- | `CandidateDoesNotExist` | Candidate not found |
149
- | `CandidateAlreadyExists` | Candidate already registered |
150
- | `ErrorGettingNodeMetadata` | Error retrieving node metadata |
151
- | `VoterDidntDelegateToThisCandidate` | Voter didn't delegate to this candidate |
152
- | `NotActiveValidator` | Not an active validator |
153
- | `AtMaximumNumberOfCandidates` | Maximum candidate limit reached |
154
- | `BurnAmountMustBeGreaterThan100` | Burn amount must exceed 100 |
155
- | `SupporterShareOutOfRange` | Supporter share percentage out of valid range |
156
- | `CurrentValidatorCanNotChangeSharePercentage` | Active validators cannot change share percentage |
157
-
158
- ---
159
-
160
- ### D9NodeRewards
161
-
162
- Manages node reward distribution through smart contracts.
163
-
164
- #### Storage
165
-
166
- | Name | Type | Description |
167
- |------|------|-------------|
168
- | `NodeRewardContract` | `SS58String` | Address of the node reward contract |
169
- | `PalletAdmin` | `SS58String` | Pallet administrator account |
170
-
171
- #### Extrinsics
172
-
173
- | Name | Parameters | Description |
174
- |------|------------|-------------|
175
- | `set_pallet_admin` | `admin: AccountId` | Set pallet administrator |
176
- | `set_node_reward_contract` | `contract: AccountId` | Set the node reward contract address |
177
-
178
- #### Events
179
-
180
- | Name | Data | Description |
181
- |------|------|-------------|
182
- | `ErrorIssuingRewards` | - | Error occurred while issuing rewards |
183
- | `ContractError` | `DispatchError` | Contract call error |
184
-
185
- #### Errors
186
-
187
- | Name | Description |
188
- |------|-------------|
189
- | `RestrictedAccess` | Access is restricted |
190
- | `NodeRewardContractNotSet` | Node reward contract not configured |
191
- | `ErrorUpdatingNodeRewardContract` | Error updating the contract address |
192
-
193
- #### Constants
194
-
195
- | Name | Type | Description |
196
- |------|------|-------------|
197
- | `PalletId` | `[u8; 8]` | Pallet identifier |
198
-
199
- ---
200
-
201
- ### CouncilLock
202
-
203
- Manages account locking through council governance.
204
-
205
- #### Storage
206
-
207
- | Name | Type | Description |
208
- |------|------|-------------|
209
- | `PalletAdmin` | `SS58String` | Pallet administrator |
210
- | `ProposalFee` | `bigint` | Fee required to propose a lock |
211
- | `MiningPoolContract` | `SS58String` | Mining pool contract address |
212
- | `Proposals` | `Map<SS58String, Proposal>` | Lock proposals |
213
- | `Referendums` | `Map<SS58String, Referendum>` | Active referendums |
214
- | `Resolutions` | `Map<[number, SS58String], Resolution>` | Resolved proposals |
215
- | `LockedAccounts` | `Map<SS58String, LockInfo>` | Currently locked accounts |
216
-
217
- #### Extrinsics
218
-
219
- | Name | Parameters | Description |
220
- |------|------------|-------------|
221
- | `set_pallet_admin` | `admin: AccountId` | Set pallet administrator |
222
- | `set_mining_pool_contract` | `contract: AccountId` | Set mining pool contract |
223
- | `propose_lock` | `account: AccountId, reason: String` | Propose to lock an account |
224
- | `propose_unlock` | `account: AccountId` | Propose to unlock an account |
225
- | `vote_in_referendum` | `account: AccountId, vote: bool` | Vote in a referendum |
226
- | `set_proposal_fee` | `fee: bigint` | Set the proposal fee |
227
- | `admin_lock_accounts` | `accounts: Vec<AccountId>` | Admin lock multiple accounts |
228
- | `admin_unlock_accounts` | `accounts: Vec<AccountId>` | Admin unlock multiple accounts |
229
- | `admin_remove_proposal` | `account: AccountId` | Admin remove a proposal |
230
-
231
- #### Events
232
-
233
- | Name | Data | Description |
234
- |------|------|-------------|
235
- | `AccountNominatedForLock` | `SS58String` | Account nominated for locking |
236
- | `ProposalFeePaid` | `{account, fee}` | Proposal fee was paid |
237
- | `VoteRecorded` | `{voter, account, decision}` | Vote was recorded |
238
- | `AccountLocked` | `SS58String` | Account was locked |
239
- | `AccountUnlocked` | `SS58String` | Account was unlocked |
240
- | `AccountNominatedForUnlock` | `SS58String` | Account nominated for unlocking |
241
- | `VoteStarted` | - | Voting period started |
242
- | `VoteEnded` | `{result}` | Voting period ended |
243
-
244
- #### Errors
245
-
246
- | Name | Description |
247
- |------|-------------|
248
- | `NotValidNominator` | Not a valid nominator |
249
- | `ProposalFeeInsufficient` | Proposal fee is insufficient |
250
- | `MiningPoolContractNotSet` | Mining pool contract not configured |
251
- | `ErrorGettingRankedNodes` | Error getting ranked nodes |
252
- | `AccountAlreadyLocked` | Account is already locked |
253
- | `AccountNotLocked` | Account is not locked |
254
- | `ProposalAlreadyExists` | Proposal already exists |
255
- | `AccountAlreadyInReferendum` | Account is already in a referendum |
256
- | `AdminCannotBeNominated` | Admin cannot be nominated |
257
- | `LockCandidatesNotPermittedToInteract` | Lock candidates cannot interact |
258
- | `LockedAccountsNotPermittedToInteract` | Locked accounts cannot interact |
259
- | `LockedAccountCannotVote` | Locked accounts cannot vote |
260
- | `ReferendumDoesNotExist` | Referendum does not exist |
261
- | `NotValidCouncilMember` | Not a valid council member |
262
- | `ErrorCalculatingVotes` | Error calculating votes |
263
- | `VoterAlreadyVoted` | Voter has already voted |
264
-
265
- #### Constants
266
-
267
- | Name | Type | Description |
268
- |------|------|-------------|
269
- | `CouncilPalletId` | `[u8; 8]` | Council pallet identifier |
270
-
271
- ---
272
-
273
- ### D9MultiSig
274
-
275
- Multi-signature account management.
276
-
277
- #### Storage
278
-
279
- | Name | Type | Description |
280
- |------|------|-------------|
281
- | `MultiSignatureAccounts` | `Map<SS58String, MSAInfo>` | Multi-sig account information |
282
- | `UserMultiSigAccounts` | `Map<SS58String, Vec<AccountId>>` | User's associated multi-sig accounts |
283
- | `MinApprovalProposals` | `Map<SS58String, Proposal>` | Pending minimum approval change proposals |
284
-
285
- #### Extrinsics
286
-
287
- | Name | Parameters | Description |
288
- |------|------------|-------------|
289
- | `create_multi_sig_account` | `signatories, authors, min_approvals` | Create a new multi-sig account |
290
- | `author_a_call` | `msa_address, call` | Author a call for a multi-sig account |
291
- | `add_call_approval` | `msa_address, call_id` | Add approval to a pending call |
292
- | `remove_call_approval` | `msa_address, call_id` | Remove approval from a pending call |
293
- | `proposal_msa_new_minimum` | `msa_address, new_min` | Propose new minimum approvals |
294
- | `approve_msa_new_minimum` | `msa_address` | Approve new minimum proposal |
295
- | `revoke_approval_for_msa_new_minimum` | `msa_address` | Revoke approval for minimum change |
296
- | `remove_call` | `msa_address, call_id` | Remove a pending call |
297
-
298
- #### Events
299
-
300
- | Name | Data | Description |
301
- |------|------|-------------|
302
- | `MultiSignatureAccountCreated` | `[creator, msa]` | Multi-sig account created |
303
- | `MultiSignatureAccountUpdated` | `[updater, msa]` | Multi-sig account updated |
304
- | `NewCallAuthored` | `{author, call_id}` | New call authored |
305
- | `ApprovalAdded` | `[msa, approver]` | Approval added |
306
- | `ApprovalRemoved` | `[msa, approver]` | Approval removed |
307
- | `CallExecuted` | `Hash` | Call was executed |
308
- | `MinApprovalsChanged` | `{msa, new_min}` | Minimum approvals changed |
309
-
310
- #### Errors
311
-
312
- | Name | Description |
313
- |------|-------------|
314
- | `DuplicatesInList` | Signatories list contains duplicates |
315
- | `CallerNotSignatory` | Caller is not a signatory |
316
- | `MSAAlreadyExists` | Multi-sig account already exists |
317
- | `MSANotFound` | Multi-sig account not found |
318
- | `SignatoriesTooShort` | Must have at least 2 signatories |
319
- | `SignatoriesTooLong` | Too many signatories |
320
- | `ApprovalExists` | Approval already exists |
321
- | `ApprovalDoesntExist` | Approval doesn't exist |
322
- | `MinApprovalOutOfRange` | Minimum approvals out of range |
323
- | `NewMinimumEqualsCurrentMinimum` | New minimum equals current |
324
- | `AccountAlreadyAuthor` | Account is already an author |
325
- | `OnlyMSAItselfCanDoThis` | Only the MSA itself can do this |
326
- | `AuthorVecTooLong` | Authors list too long |
327
- | `AccountNotAuthor` | Account is not an author |
328
- | `AccountNotSignatory` | Account is not a signatory |
329
- | `AccountErrorMaxAuthors` | Reached maximum authors |
330
- | `CallLimit` | Pending calls limit reached |
331
- | `ApprovalsLimitReached` | Approvals limit reached |
332
- | `CallEncodingFailure` | Failed to encode call |
333
- | `AccountAtMultiSigLimit` | Account at multi-sig limit |
334
- | `FailedToCreatePendingCall` | Failed to create pending call |
335
- | `CallNotFound` | Call not found |
336
- | `FailureDecodingCall` | Failed to decode call |
337
- | `FailedToBuildBoundedVec` | Failed to build bounded vec |
338
- | `ProposalNotFound` | Proposal not found |
339
- | `ProposalAlreadyPending` | Proposal already pending |
340
-
341
- ---
342
-
343
- ## Standard Substrate Pallets
344
-
345
- ### System
346
-
347
- Core system pallet for runtime metadata and account management.
348
-
349
- #### Storage
350
-
351
- | Name | Type | Description |
352
- |------|------|-------------|
353
- | `Account` | `Map<SS58String, AccountInfo>` | Full account information |
354
- | `ExtrinsicCount` | `Option<number>` | Extrinsics count for current block |
355
- | `BlockWeight` | `BlockWeight` | Current block weight |
356
- | `AllExtrinsicsLen` | `Option<number>` | Total extrinsics length |
357
- | `BlockHash` | `Map<number, Hash>` | Block number to hash mapping |
358
- | `ExtrinsicData` | `Map<number, Binary>` | Extrinsic data by index |
359
- | `Number` | `number` | Current block number |
360
- | `ParentHash` | `Hash` | Parent block hash |
361
- | `Digest` | `Digest` | Block digest |
362
- | `Events` | `Vec<EventRecord>` | Events for current block |
363
- | `EventCount` | `number` | Number of events |
364
- | `EventTopics` | `Map<Hash, Vec<(BlockNumber, EventIndex)>>` | Event topics mapping |
365
- | `LastRuntimeUpgrade` | `Option<LastRuntimeUpgradeInfo>` | Last runtime upgrade info |
366
- | `ExecutionPhase` | `Option<Phase>` | Current execution phase |
367
-
368
- #### Extrinsics
369
-
370
- | Name | Parameters | Description |
371
- |------|------------|-------------|
372
- | `remark` | `remark: Binary` | Make an on-chain remark |
373
- | `set_heap_pages` | `pages: number` | Set WebAssembly heap pages |
374
- | `set_code` | `code: Binary` | Set new runtime code |
375
- | `set_code_without_checks` | `code: Binary` | Set runtime code without checks |
376
- | `set_storage` | `items: Vec<(Key, Value)>` | Set storage items |
377
- | `kill_storage` | `keys: Vec<Key>` | Remove storage items |
378
- | `kill_prefix` | `prefix: Binary, subkeys: number` | Remove storage with prefix |
379
- | `remark_with_event` | `remark: Binary` | Make remark and emit event |
380
-
381
- #### Constants
382
-
383
- | Name | Type | Description |
384
- |------|------|-------------|
385
- | `BlockWeights` | `BlockWeights` | Block and extrinsic weight limits |
386
- | `BlockLength` | `BlockLength` | Maximum block length |
387
- | `BlockHashCount` | `number` | Number of block hashes to keep |
388
- | `DbWeight` | `RuntimeDbWeight` | Database operation weights |
389
- | `Version` | `RuntimeVersion` | Chain version info |
390
- | `SS58Prefix` | `number` | SS58 address prefix (9 for D9) |
391
-
392
- ---
393
-
394
- ### Balances
395
-
396
- Native token (D9) balance management.
397
-
398
- #### Storage
399
-
400
- | Name | Type | Description |
401
- |------|------|-------------|
402
- | `TotalIssuance` | `bigint` | Total tokens issued |
403
- | `InactiveIssuance` | `bigint` | Deactivated tokens |
404
- | `Account` | `Map<SS58String, AccountData>` | Account balances (free, reserved, frozen) |
405
- | `Locks` | `Map<SS58String, Vec<BalanceLock>>` | Balance locks |
406
- | `Reserves` | `Map<SS58String, Vec<ReserveData>>` | Named reserves |
407
- | `Holds` | `Map<SS58String, Vec<IdAmount>>` | Balance holds |
408
- | `Freezes` | `Map<SS58String, Vec<IdAmount>>` | Balance freezes |
409
-
410
- #### Extrinsics
411
-
412
- | Name | Parameters | Description |
413
- |------|------------|-------------|
414
- | `transfer_allow_death` | `dest, value` | Transfer, may kill sender account |
415
- | `transfer_keep_alive` | `dest, value` | Transfer, keep sender account alive |
416
- | `transfer_all` | `dest, keep_alive` | Transfer entire transferable balance |
417
- | `force_transfer` | `source, dest, value` | Root-only forced transfer |
418
- | `force_unreserve` | `who, amount` | Root-only unreserve |
419
- | `upgrade_accounts` | `who: Vec<AccountId>` | Upgrade accounts |
420
- | `force_set_balance` | `who, new_free` | Root-only set balance |
421
-
422
- #### Events
423
-
424
- | Name | Data | Description |
425
- |------|------|-------------|
426
- | `Endowed` | `{account, free_balance}` | Account created with balance |
427
- | `DustLost` | `{account, amount}` | Account killed, balance lost |
428
- | `Transfer` | `{from, to, amount}` | Transfer succeeded |
429
- | `BalanceSet` | `{who, free}` | Balance was set |
430
- | `Reserved` | `{who, amount}` | Balance reserved |
431
- | `Unreserved` | `{who, amount}` | Balance unreserved |
432
- | `Deposit` | `{who, amount}` | Amount deposited |
433
- | `Withdraw` | `{who, amount}` | Amount withdrawn |
434
- | `Slashed` | `{who, amount}` | Amount slashed |
435
- | `Minted` | `{who, amount}` | Amount minted |
436
- | `Burned` | `{who, amount}` | Amount burned |
437
- | `Locked` | `{who, amount}` | Balance locked |
438
- | `Unlocked` | `{who, amount}` | Balance unlocked |
439
- | `Frozen` | `{who, amount}` | Balance frozen |
440
- | `Thawed` | `{who, amount}` | Balance thawed |
441
-
442
- #### Constants
443
-
444
- | Name | Type | Description |
445
- |------|------|-------------|
446
- | `ExistentialDeposit` | `bigint` | Minimum balance to keep account alive |
447
- | `MaxLocks` | `number` | Maximum number of locks |
448
- | `MaxReserves` | `number` | Maximum named reserves |
449
- | `MaxHolds` | `number` | Maximum holds |
450
- | `MaxFreezes` | `number` | Maximum freezes |
451
-
452
- ---
453
-
454
- ### Assets
455
-
456
- Fungible assets pallet for managing custom tokens.
457
-
458
- #### Storage
459
-
460
- | Name | Type | Description |
461
- |------|------|-------------|
462
- | `Asset` | `Map<AssetId, AssetDetails>` | Asset details |
463
- | `Account` | `Map<[AssetId, AccountId], AssetBalance>` | Account asset holdings |
464
- | `Approvals` | `Map<[AssetId, Owner, Delegate], Approval>` | Transfer approvals |
465
- | `Metadata` | `Map<AssetId, AssetMetadata>` | Asset metadata (name, symbol, decimals) |
466
-
467
- #### Extrinsics
468
-
469
- | Name | Parameters | Description |
470
- |------|------------|-------------|
471
- | `create` | `id, admin, min_balance` | Create new asset |
472
- | `force_create` | `id, owner, is_sufficient, min_balance` | Force create asset |
473
- | `start_destroy` | `id` | Start destroying asset |
474
- | `destroy_accounts` | `id` | Destroy asset accounts |
475
- | `destroy_approvals` | `id` | Destroy asset approvals |
476
- | `finish_destroy` | `id` | Finish asset destruction |
477
- | `mint` | `id, beneficiary, amount` | Mint assets |
478
- | `burn` | `id, who, amount` | Burn assets |
479
- | `transfer` | `id, target, amount` | Transfer assets |
480
- | `transfer_keep_alive` | `id, target, amount` | Transfer, keep account alive |
481
- | `force_transfer` | `id, source, dest, amount` | Admin transfer |
482
- | `freeze` | `id, who` | Freeze account for asset |
483
- | `thaw` | `id, who` | Thaw frozen account |
484
- | `freeze_asset` | `id` | Freeze entire asset |
485
- | `thaw_asset` | `id` | Thaw asset |
486
- | `transfer_ownership` | `id, owner` | Change asset owner |
487
- | `set_team` | `id, issuer, admin, freezer` | Set asset management team |
488
- | `set_metadata` | `id, name, symbol, decimals` | Set asset metadata |
489
- | `approve_transfer` | `id, delegate, amount` | Approve transfer allowance |
490
- | `cancel_approval` | `id, delegate` | Cancel approval |
491
- | `transfer_approved` | `id, owner, destination, amount` | Execute approved transfer |
492
-
493
- ---
494
-
495
- ### Contracts
496
-
497
- ink! smart contract pallet.
498
-
499
- #### Storage
500
-
501
- | Name | Type | Description |
502
- |------|------|-------------|
503
- | `PristineCode` | `Map<Hash, Binary>` | Original uploaded code |
504
- | `CodeStorage` | `Map<Hash, InstrumentedCode>` | Instrumented WASM code |
505
- | `OwnerInfoOf` | `Map<Hash, OwnerInfo>` | Code owner information |
506
- | `Nonce` | `bigint` | Contract nonce counter |
507
- | `ContractInfoOf` | `Map<SS58String, ContractInfo>` | Contract information |
508
- | `DeletionQueue` | `Map<number, Binary>` | Contracts pending deletion |
509
- | `DeletionQueueCounter` | `Counter` | Deletion queue counters |
510
-
511
- #### Extrinsics
512
-
513
- | Name | Parameters | Description |
514
- |------|------------|-------------|
515
- | `call` | `dest, value, gas_limit, storage_deposit_limit, data` | Call a contract |
516
- | `instantiate_with_code` | `value, gas_limit, storage_deposit_limit, code, data, salt` | Deploy and instantiate contract |
517
- | `instantiate` | `value, gas_limit, storage_deposit_limit, code_hash, data, salt` | Instantiate from existing code |
518
- | `upload_code` | `code, storage_deposit_limit, determinism` | Upload contract code |
519
- | `remove_code` | `code_hash` | Remove uploaded code |
520
- | `set_code` | `dest, code_hash` | Change contract's code |
521
-
522
- #### Events
523
-
524
- | Name | Data | Description |
525
- |------|------|-------------|
526
- | `Instantiated` | `{deployer, contract}` | Contract deployed |
527
- | `Terminated` | `{contract, beneficiary}` | Contract terminated |
528
- | `CodeStored` | `{code_hash}` | Code stored |
529
- | `ContractEmitted` | `{contract, data}` | Contract emitted event |
530
- | `CodeRemoved` | `{code_hash}` | Code removed |
531
- | `ContractCodeUpdated` | `{contract, new_code_hash, old_code_hash}` | Contract code updated |
532
- | `Called` | `{caller, contract}` | Contract called |
533
-
534
- #### Constants
535
-
536
- | Name | Type | Description |
537
- |------|------|-------------|
538
- | `Schedule` | `Schedule` | Cost schedule and limits |
539
- | `DepositPerByte` | `bigint` | Storage cost per byte |
540
- | `DefaultDepositLimit` | `bigint` | Default storage deposit limit |
541
- | `DepositPerItem` | `bigint` | Storage cost per item |
542
- | `MaxCodeLen` | `number` | Maximum code length |
543
- | `MaxStorageKeyLen` | `number` | Maximum storage key length |
544
- | `MaxDebugBufferLen` | `number` | Maximum debug buffer length |
545
-
546
- ---
547
-
548
- ### Session
549
-
550
- Session key management for validators.
551
-
552
- #### Storage
553
-
554
- | Name | Type | Description |
555
- |------|------|-------------|
556
- | `Validators` | `Vec<AccountId>` | Current validators |
557
- | `CurrentIndex` | `number` | Current session index |
558
- | `QueuedChanged` | `bool` | Whether queued set changed |
559
- | `QueuedKeys` | `Vec<(AccountId, Keys)>` | Queued session keys |
560
- | `DisabledValidators` | `Vec<number>` | Disabled validator indices |
561
- | `NextKeys` | `Map<AccountId, Keys>` | Next session keys |
562
- | `KeyOwner` | `Map<(KeyTypeId, Key), AccountId>` | Key owner mapping |
563
-
564
- #### Extrinsics
565
-
566
- | Name | Parameters | Description |
567
- |------|------------|-------------|
568
- | `set_keys` | `keys, proof` | Set session keys |
569
- | `purge_keys` | - | Remove session keys |
570
-
571
- ---
572
-
573
- ### Collective
574
-
575
- Council/collective governance pallet.
576
-
577
- #### Storage
578
-
579
- | Name | Type | Description |
580
- |------|------|-------------|
581
- | `Proposals` | `Vec<Hash>` | Active proposal hashes |
582
- | `ProposalOf` | `Map<Hash, Proposal>` | Proposal content |
583
- | `Voting` | `Map<Hash, Votes>` | Voting status |
584
- | `ProposalCount` | `number` | Total proposals count |
585
- | `Members` | `Vec<AccountId>` | Current members |
586
- | `Prime` | `Option<AccountId>` | Prime member |
587
-
588
- #### Extrinsics
589
-
590
- | Name | Parameters | Description |
591
- |------|------------|-------------|
592
- | `set_members` | `new_members, prime, old_count` | Set collective members |
593
- | `execute` | `proposal, length_bound` | Execute proposal as member |
594
- | `propose` | `threshold, proposal, length_bound` | Create new proposal |
595
- | `vote` | `proposal, index, approve` | Vote on proposal |
596
- | `close` | `proposal_hash, index, weight_bound, length_bound` | Close voting |
597
- | `disapprove_proposal` | `proposal_hash` | Root disapprove proposal |
598
-
599
- ---
600
-
601
- ### Treasury
602
-
603
- On-chain treasury for governance spending.
604
-
605
- #### Storage
606
-
607
- | Name | Type | Description |
608
- |------|------|-------------|
609
- | `ProposalCount` | `number` | Number of proposals |
610
- | `Proposals` | `Map<number, Proposal>` | Spending proposals |
611
- | `Deactivated` | `bigint` | Inactive funds |
612
- | `Approvals` | `Vec<number>` | Approved proposal indices |
613
-
614
- #### Extrinsics
615
-
616
- | Name | Parameters | Description |
617
- |------|------------|-------------|
618
- | `propose_spend` | `value, beneficiary` | Propose treasury spend |
619
- | `reject_proposal` | `proposal_id` | Reject proposal |
620
- | `approve_proposal` | `proposal_id` | Approve proposal |
621
- | `spend` | `amount, beneficiary` | Direct spend |
622
- | `remove_approval` | `proposal_id` | Remove from approval queue |
623
-
624
- #### Constants
625
-
626
- | Name | Type | Description |
627
- |------|------|-------------|
628
- | `ProposalBond` | `Permill` | Proposal bond fraction |
629
- | `ProposalBondMinimum` | `bigint` | Minimum proposal bond |
630
- | `ProposalBondMaximum` | `Option<bigint>` | Maximum proposal bond |
631
- | `SpendPeriod` | `number` | Blocks between spends |
632
- | `Burn` | `Permill` | Percentage burned per spend |
633
- | `PalletId` | `[u8; 8]` | Treasury pallet ID |
634
- | `MaxApprovals` | `number` | Maximum pending approvals |
635
-
636
- ---
637
-
638
- ### Grandpa
639
-
640
- GRANDPA finality gadget.
641
-
642
- #### Storage
643
-
644
- | Name | Type | Description |
645
- |------|------|-------------|
646
- | `State` | `StoredState` | Authority set state |
647
- | `PendingChange` | `Option<StoredPendingChange>` | Pending authority change |
648
- | `NextForced` | `Option<BlockNumber>` | Next forced change block |
649
- | `Stalled` | `Option<(BlockNumber, BlockNumber)>` | Stalled status |
650
- | `CurrentSetId` | `bigint` | Current authority set ID |
651
- | `SetIdSession` | `Map<SetId, SessionIndex>` | Set ID to session mapping |
652
-
653
- #### Extrinsics
654
-
655
- | Name | Parameters | Description |
656
- |------|------------|-------------|
657
- | `report_equivocation` | `equivocation_proof, key_owner_proof` | Report equivocation |
658
- | `report_equivocation_unsigned` | `equivocation_proof, key_owner_proof` | Unsigned equivocation report |
659
- | `note_stalled` | `delay, best_finalized_block_number` | Note GRANDPA stalled |
660
-
661
- ---
662
-
663
- ### Sudo
664
-
665
- Superuser access for runtime operations.
666
-
667
- #### Storage
668
-
669
- | Name | Type | Description |
670
- |------|------|-------------|
671
- | `Key` | `Option<AccountId>` | Sudo key account |
672
-
673
- #### Extrinsics
674
-
675
- | Name | Parameters | Description |
676
- |------|------------|-------------|
677
- | `sudo` | `call` | Execute call as root |
678
- | `sudo_unchecked_weight` | `call, weight` | Execute with specified weight |
679
- | `set_key` | `new` | Change sudo key |
680
- | `sudo_as` | `who, call` | Execute as another account |
681
-
682
- ---
683
-
684
- ### ImOnline
685
-
686
- Heartbeat mechanism for validators.
687
-
688
- #### Storage
689
-
690
- | Name | Type | Description |
691
- |------|------|-------------|
692
- | `HeartbeatAfter` | `BlockNumber` | Block to send heartbeat after |
693
- | `Keys` | `Vec<AuthorityId>` | Current heartbeat keys |
694
- | `ReceivedHeartbeats` | `Map<(SessionIndex, AuthIndex), NetworkState>` | Received heartbeats |
695
- | `AuthoredBlocks` | `Map<(SessionIndex, ValidatorId), number>` | Blocks authored |
696
-
697
- #### Extrinsics
698
-
699
- | Name | Parameters | Description |
700
- |------|------------|-------------|
701
- | `heartbeat` | `heartbeat, signature` | Submit heartbeat |
702
-
703
- ---
704
-
705
- ### Timestamp
706
-
707
- Block timestamp management.
708
-
709
- #### Storage
710
-
711
- | Name | Type | Description |
712
- |------|------|-------------|
713
- | `Now` | `bigint` | Current timestamp (milliseconds) |
714
- | `DidUpdate` | `bool` | Whether timestamp was set |
715
-
716
- #### Extrinsics
717
-
718
- | Name | Parameters | Description |
719
- |------|------------|-------------|
720
- | `set` | `now` | Set current timestamp (inherent) |
721
-
722
- #### Constants
723
-
724
- | Name | Type | Description |
725
- |------|------|-------------|
726
- | `MinimumPeriod` | `bigint` | Minimum period between blocks |