Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Nov 13, 2024
1 parent f2bb256 commit 18344c8
Show file tree
Hide file tree
Showing 10 changed files with 457 additions and 536 deletions.
4 changes: 2 additions & 2 deletions substrate/frame/revive/rpc/examples/js/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export const provider = new JsonRpcProvider(
westend
? 'https://westend-asset-hub-eth-rpc.polkadot.io'
: geth
? 'http://localhost:8546'
: 'http://localhost:8545'
? 'http://localhost:8546'
: 'http://localhost:8545'
)

export const signer = privateKey ? new Wallet(privateKey, provider) : await provider.getSigner()
Expand Down
216 changes: 100 additions & 116 deletions substrate/frame/revive/rpc/examples/js/types/ethers-contracts/Event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,132 +2,116 @@
/* tslint:disable */
/* eslint-disable */
import type {
BaseContract,
BigNumberish,
BytesLike,
FunctionFragment,
Result,
Interface,
EventFragment,
AddressLike,
ContractRunner,
ContractMethod,
Listener,
} from "ethers";
BaseContract,
BigNumberish,
BytesLike,
FunctionFragment,
Result,
Interface,
EventFragment,
AddressLike,
ContractRunner,
ContractMethod,
Listener,
} from 'ethers'
import type {
TypedContractEvent,
TypedDeferredTopicFilter,
TypedEventLog,
TypedLogDescription,
TypedListener,
TypedContractMethod,
} from "./common";
TypedContractEvent,
TypedDeferredTopicFilter,
TypedEventLog,
TypedLogDescription,
TypedListener,
TypedContractMethod,
} from './common'

export interface EventInterface extends Interface {
getFunction(nameOrSignature: "triggerEvent"): FunctionFragment;
getFunction(nameOrSignature: 'triggerEvent'): FunctionFragment

getEvent(nameOrSignatureOrTopic: "ExampleEvent"): EventFragment;
getEvent(nameOrSignatureOrTopic: 'ExampleEvent'): EventFragment

encodeFunctionData(
functionFragment: "triggerEvent",
values?: undefined
): string;
encodeFunctionData(functionFragment: 'triggerEvent', values?: undefined): string

decodeFunctionResult(
functionFragment: "triggerEvent",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: 'triggerEvent', data: BytesLike): Result
}

export namespace ExampleEventEvent {
export type InputTuple = [
sender: AddressLike,
value: BigNumberish,
message: string
];
export type OutputTuple = [sender: string, value: bigint, message: string];
export interface OutputObject {
sender: string;
value: bigint;
message: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
export type InputTuple = [sender: AddressLike, value: BigNumberish, message: string]
export type OutputTuple = [sender: string, value: bigint, message: string]
export interface OutputObject {
sender: string
value: bigint
message: string
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>
export type Filter = TypedDeferredTopicFilter<Event>
export type Log = TypedEventLog<Event>
export type LogDescription = TypedLogDescription<Event>
}

export interface Event extends BaseContract {
connect(runner?: ContractRunner | null): Event;
waitForDeployment(): Promise<this>;

interface: EventInterface;

queryFilter<TCEvent extends TypedContractEvent>(
event: TCEvent,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEventLog<TCEvent>>>;
queryFilter<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEventLog<TCEvent>>>;

on<TCEvent extends TypedContractEvent>(
event: TCEvent,
listener: TypedListener<TCEvent>
): Promise<this>;
on<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
listener: TypedListener<TCEvent>
): Promise<this>;

once<TCEvent extends TypedContractEvent>(
event: TCEvent,
listener: TypedListener<TCEvent>
): Promise<this>;
once<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
listener: TypedListener<TCEvent>
): Promise<this>;

listeners<TCEvent extends TypedContractEvent>(
event: TCEvent
): Promise<Array<TypedListener<TCEvent>>>;
listeners(eventName?: string): Promise<Array<Listener>>;
removeAllListeners<TCEvent extends TypedContractEvent>(
event?: TCEvent
): Promise<this>;

triggerEvent: TypedContractMethod<[], [void], "nonpayable">;

getFunction<T extends ContractMethod = ContractMethod>(
key: string | FunctionFragment
): T;

getFunction(
nameOrSignature: "triggerEvent"
): TypedContractMethod<[], [void], "nonpayable">;

getEvent(
key: "ExampleEvent"
): TypedContractEvent<
ExampleEventEvent.InputTuple,
ExampleEventEvent.OutputTuple,
ExampleEventEvent.OutputObject
>;

filters: {
"ExampleEvent(address,uint256,string)": TypedContractEvent<
ExampleEventEvent.InputTuple,
ExampleEventEvent.OutputTuple,
ExampleEventEvent.OutputObject
>;
ExampleEvent: TypedContractEvent<
ExampleEventEvent.InputTuple,
ExampleEventEvent.OutputTuple,
ExampleEventEvent.OutputObject
>;
};
connect(runner?: ContractRunner | null): Event
waitForDeployment(): Promise<this>

interface: EventInterface

queryFilter<TCEvent extends TypedContractEvent>(
event: TCEvent,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEventLog<TCEvent>>>
queryFilter<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEventLog<TCEvent>>>

on<TCEvent extends TypedContractEvent>(
event: TCEvent,
listener: TypedListener<TCEvent>
): Promise<this>
on<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
listener: TypedListener<TCEvent>
): Promise<this>

once<TCEvent extends TypedContractEvent>(
event: TCEvent,
listener: TypedListener<TCEvent>
): Promise<this>
once<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
listener: TypedListener<TCEvent>
): Promise<this>

listeners<TCEvent extends TypedContractEvent>(
event: TCEvent
): Promise<Array<TypedListener<TCEvent>>>
listeners(eventName?: string): Promise<Array<Listener>>
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>

triggerEvent: TypedContractMethod<[], [void], 'nonpayable'>

getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T

getFunction(nameOrSignature: 'triggerEvent'): TypedContractMethod<[], [void], 'nonpayable'>

getEvent(
key: 'ExampleEvent'
): TypedContractEvent<
ExampleEventEvent.InputTuple,
ExampleEventEvent.OutputTuple,
ExampleEventEvent.OutputObject
>

filters: {
'ExampleEvent(address,uint256,string)': TypedContractEvent<
ExampleEventEvent.InputTuple,
ExampleEventEvent.OutputTuple,
ExampleEventEvent.OutputObject
>
ExampleEvent: TypedContractEvent<
ExampleEventEvent.InputTuple,
ExampleEventEvent.OutputTuple,
ExampleEventEvent.OutputObject
>
}
}
Loading

0 comments on commit 18344c8

Please sign in to comment.