const ethUtils = require("ethereumjs-utils");
const address = "0x41186AE17A2a11B7259D8c60b40AFd0256b9DdC7";
const pk = "4759582d5d163f2c269575b62d11abd99403166b036e7f828a2b3afcaa67d6a8";
const provider = "https://rinkeby.infura.io/v3/16a004343234ffb464f22567147";
const myCustomConnector = {
sign: async (msgHash) => {
const msgBuff = Buffer.from(ethUtils.stripHexPrefix(msgHash), "hex");
const sig = ethUtils.ecsign(
send: async (params) => {
let response = await fetch(provider, {
body: JSON.stringify(params),
Accept: "application/json",
"Content-Type": "application/json",
let data = await response.json();
throw data.error.message;
connector: myCustomConnector,
}, { network: 'rinkeby' });