This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {expect} from 'chai'; | |
import {findEventFragment} from '../../src/matchers/findEventFragment'; | |
const contract = { | |
interface: { | |
events: | |
{ | |
'One(uint256,string,bytes32)': | |
{ | |
name: 'One', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Contract} from "ethers" | |
export class AmbiguousEvent extends Error { | |
constructor(eventName: string, candidates: string[]) { | |
super(`Ambiguous event ${eventName}, could be ${candidates.join(' or ')}`); | |
} | |
}; | |
export const findEventFragment = (contract: Contract, eventName: string) => { | |
const candidates: [string, object][] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expect('balanceOf').to.be.calledOn(tokenContract); | |
expect('balanceOf').to.be.calledOn(tokenContract).withArgs('0x00...00'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mockContract = await deployMockContract(wallet, Contract.interface); | |
await mockContract.mock.add.returns(1); | |
await mockContract.mock.mul.withArgs(2, 2).returns(4); | |
await mockContract.mock.div.withArgs(3, 0).reverts(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
onboard = Onboard({ | |
... | |
wallets: { | |
{ walletName: 'unilogin', preferred: true }, | |
... | |
} | |
}) | |
this.setState({ onboard }) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UniLoginProvider from '@universal-login/provider'; | |
... | |
web3.setProvider(UniLoginProvider.createPicker(web3.currentProvider)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add @universal-login/provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wallet.addKey(publicKey: string, executionOptions: ExecutionOptions) | |
wallet.addKeys(publicKeys: string[], executionOptions: ExecutionOptions) | |
wallet.removeKey(key: string, executionOptions: ExecutionOptions) | |
wallet.setRequiredSignatures(requiredSignatures: number, executionOptions: ExecutionOptions) | |
wallet.execute(message: Partial<Message>) | |
wallet.keyExist(key: string) | |
wallet.getNonce() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sdk.addKey(to: string, publicKey: string, privateKey: string, executionOptions: SdkExecutionOptions) | |
sdk.addKeys(to: string, publicKeys: string[], privateKey: string, executionOptions: SdkExecutionOptions) | |
sdk.removeKey(to: string, key: string, privateKey: string, executionOptions: SdkExecutionOptions) | |
sdk.setRequiredSignatures(to: string, requiredSignatures: number, privateKey: string, executionOptions: SdkExecutionOptions) | |
sdk.keyExist(walletContractAddress: string, key: string) | |
sdk.getNonce(walletContractAddress: string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deprecated methods: | |
sdk.addKey(to: string, publicKey: string, privateKey: string, executionOptions: SdkExecutionOptions) | |
sdk.addKeys(to: string, publicKeys: string[], privateKey: string, executionOptions: SdkExecutionOptions) | |
sdk.removeKey(to: string, key: string, privateKey: string, executionOptions: SdkExecutionOptions) | |
sdk.setRequiredSignatures(to: string, requiredSignatures: number, privateKey: string, executionOptions: SdkExecutionOptions) | |
sdk.keyExist(walletContractAddress: string, key: string) | |
sdk.getNonce(walletContractAddress: string) | |
Recommended methods: | |
wallet.addKey(publicKey: string, executionOptions: ExecutionOptions) |
NewerOlder