12345678910111213141516171819202122232425262728293031 |
- const script = async ({ api, keyring }) => {
- const sudoAddress = (await api.query.sudo.key()).toString()
- let sudo
- if (typeof window === 'undefined') {
-
- sudo = keyring.getPair(sudoAddress)
- } else {
-
- sudo = sudoAddress
- }
- const transfer = api.tx.balances.transfer(sudoAddress, 100)
- await transfer.signAndSend(sudo)
- }
- if (typeof module === 'undefined') {
-
- script({ api, hashing, keyring, types, util })
- } else {
-
- module.exports = script
- }
|