new TokenMigration(api)
Creates a new instance of TokenMigration and sets the api
Parameters:
Name | Type | Description |
---|---|---|
api |
object | PolkadotJS API Reference |
- Source:
Methods
asSudoIfNeeded(txn, asSudo) → {object}
Takes an extrinsic and returns a modified extrinsic if it needs to be sent by sudo otherwise returns the given
extrinsic as it is
Parameters:
Name | Type | Default | Description |
---|---|---|---|
txn |
object | The extrinsic to send | |
asSudo |
boolean | false | If the extrinsic needs to be sent by sudo |
- Source:
Returns:
The extrinsic to sign and send.
- Type
- object
claimBonus()
Claim bonus for itself
- Source:
claimBonusForOther(other)
Claim bonus for other account
Parameters:
Name | Type | Description |
---|---|---|
other |
* |
- Source:
claimSwapBonus()
Claim swap bonus for itself
- Source:
claimSwapBonusForOther(other)
Claim swap bonus for other account
Parameters:
Name | Type | Description |
---|---|---|
other |
* |
- Source:
claimVestingBonus()
Claim vesting bonus for itself
- Source:
claimVestingBonusForOther(other)
Claim vesting bonus for other account
Parameters:
Name | Type | Description |
---|---|---|
other |
* |
- Source:
(async) getBonus(address)
Get bonus of given account
Parameters:
Name | Type | Description |
---|---|---|
address |
* |
- Source:
(async) getMigrator(address)
Get detail of a given migrator
Parameters:
Name | Type | Description |
---|---|---|
address |
* |
- Source:
(async) getMigrators()
Get details of all migrators
- Source:
giveBonuses(swapBonuses, vestingBonuses)
swapBonuses should be an array of arrays with each inner array of size 3 where first item is recipient account, 2nd item is bonus amount and 3rd item is offset (u32)
vestingBonuses should be an array of arrays with each inner array of size 3 where first item is recipient account, 2nd item is bonus amount and 3rd item is offset (u32)
Parameters:
Name | Type | Description |
---|---|---|
swapBonuses |
* | |
vestingBonuses |
* |
- Source:
migrate(recipients)
Accepts recipients as an BTreeMap of address -> amount
Parameters:
Name | Type | Description |
---|---|---|
recipients |
* |
- Source:
migrateRecipAsList(recipients)
Accepts recipients as an array of pairs, each pair is (address, amount). Amount can either be a safe JS integer
or a string which will be expected in decimal format. If an address is repeated, its intended amounts are added.
Parameters:
Name | Type | Description |
---|---|---|
recipients |
* |
- Source: