export interface Web3ProviderExtras {
event: string; // event emitted from smart contract
beforeRequest: Function; // useful for cases like change network
afterRequest: Function; // for cases
transactionState: (
state: "started" | "rejected" | "waiting" | "done",
...args: any
) => void; // state of smart contract call, before user accepts and is complete
}
import { SkillWalletContractEventType, Web3SkillWalletProvider } from "@skill-wallet/sw-abi-types";
const address = 0x00000...;
const contract = await Web3SkillWalletProvider(address, {
event: SkillWalletContractEventType.CoreTeamMemberAdded,
transactionState: (state: string) => {
console.log(state); // or use redux to dispatch action;
}
});
try {
const response = await contract.addNewCoreTeamMembers(0x00000);
return response;
} catch (error) {
console.log(error);
}