-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.mts
executable file
·105 lines (90 loc) · 2.28 KB
/
index.d.mts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import type {
SigningKey,
BytesLike,
BigNumberish,
Interface,
Result,
FunctionFragment,
} from "ethers";
type HexString = string;
type AnySync<T> = T | Promise<T>;
interface Record {
addr?(type: bigint): AnySync<BytesLike | undefined>;
text?(key: string): AnySync<string | undefined>;
contenthash?(): AnySync<BytesLike | undefined>;
pubkey?(): AnySync<
{ x: BigNumberish; y: BigNumberish } | BytesLike | undefined
>;
name?(): AnySync<string | undefined>;
ABI?(
types: number
): AnySync<{ type: number; data: BytesLike } | BytesLike | undefined>;
}
type Show = any | any[];
type History = {
level: number;
next?: History;
children: History[];
name?: string;
error?: any;
show?: Show | (() => Show);
enter(): History;
then(): History;
};
type SigningProtocol = "tor" | "ens" | "raw";
type CallContextExtra = { [key: string]: any };
type CallContext = {
origin: HexString;
sender: HexString;
calldata: HexString;
protocol: SigningProtocol;
history: History;
} & CallContextExtra;
type CCIPReadFunction = (
args: Result,
context: CallContext,
history: History
) => AnySync<BytesLike | any[] | undefined>;
type CCIPReadHandler = {
abi: Interface;
frag: FunctionFragment;
fn: CCIPReadFunction;
};
type RecordFunction = (
name: string,
context: CallContext
) => AnySync<Record | undefined>;
type EZCCIPConfig = {
origin?: HexString;
protocol?: SigningProtocol;
signingKey?: SigningKey | HexString;
ttlSec?: number;
recursionLimit?: number;
} & CallContextExtra;
export class EZCCIP {
enableENSIP10(get: RecordFunction, options?: { multicall?: boolean }): void;
register(
abi: string | string[] | Interface,
impl: CCIPReadFunction | { [name: string]: CCIPReadFunction }
): CCIPReadHandler[];
findHandler(key: string | FunctionFragment): CCIPReadHandler | undefined;
handleRead(
sender: HexString,
calldata: HexString,
config: EZCCIPConfig
): Promise<{ data: HexString; history: History }>;
}
export function processENSIP10(
record: Record | undefined,
calldata: HexString,
multicall?: boolean,
history?: History
): HexString;
export function asciiize(s: string): string;
export function labels_from_dns_encoded(v: Uint8Array): string[];
export function error_with(
message: string,
options: Object,
cause?: any
): Error;
export const RESOLVE_ABI: Interface;