import {
MsgCreateNamespace,
MsgBroadcasterWithPk,
} from "@injectivelabs/sdk-ts";
import { Network } from "@injectivelabs/networks";
const injectiveAddress = "inj1...";
const secondAddress = "inj2.....";
const privateKey = "0x...";
const denom = "inj";
const wasmHook = "inj3....";
const mintsPausedValue = false;
const sendsPausedValue = false;
const burnsPausedValue = false;
const role1 = "Everyone";
const permissions1 = 1;
const msg = MsgCreateNamespace.fromJSON({
injectiveAddress,
namespace: {
denom,
wasmHook,
mintsPausedValue,
sendsPausedValue,
burnsPausedValue,
rolePermissions: {
role: role1,
permissions: permissions1,
},
addressRoles: {
address: injectiveAddress,
roles: [role1],
},
},
})
const txHash = await new MsgBroadcasterWithPk({
privateKey,
network: Network.Testnet
}).broadcast({
msgs: msg
});
console.log(txHash);