@jaw.id/ui 0.4.0 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ccip-BzdqKpq_.js +137 -0
- package/dist/hooks/useClearSigningTypedData.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +61750 -61
- package/dist/localBatchGatewayRequest-5ZaE1WvO.js +4438 -0
- package/dist/secp256k1-BG0i42zW.js +2 -0
- package/dist/secp256k1-BJ-4rw4A.js +1187 -0
- package/dist/smartAccount-CPTH7CrY.js +13904 -0
- package/dist/utils/clearSigning.d.ts +6 -2
- package/dist/utils/clearSigning.d.ts.map +1 -1
- package/dist/utils-so0pTN_S.js +269 -0
- package/package.json +2 -2
- package/dist/ccip-BaE8Nb4B.js +0 -147
- package/dist/index-D1Fqo6z9.js +0 -85369
|
@@ -21,6 +21,8 @@ export interface DescriptorField {
|
|
|
21
21
|
$ref?: string;
|
|
22
22
|
visible?: boolean | 'always' | 'never';
|
|
23
23
|
fields?: DescriptorField[];
|
|
24
|
+
mustMatch?: string[];
|
|
25
|
+
ifNotIn?: string[];
|
|
24
26
|
}
|
|
25
27
|
export interface DescriptorFormat {
|
|
26
28
|
$id?: string;
|
|
@@ -64,7 +66,9 @@ export interface Descriptor {
|
|
|
64
66
|
chainId?: number;
|
|
65
67
|
verifyingContract?: string;
|
|
66
68
|
version?: string;
|
|
69
|
+
salt?: string;
|
|
67
70
|
};
|
|
71
|
+
domainSeparator?: Hex;
|
|
68
72
|
schemas?: unknown;
|
|
69
73
|
deployments?: DescriptorDeployment[];
|
|
70
74
|
};
|
|
@@ -136,7 +140,7 @@ export type Eip712Types = Record<string, ReadonlyArray<{
|
|
|
136
140
|
}>>;
|
|
137
141
|
/** Compute the 32-byte EIP-712 type hash for a primaryType, or null if undefined. */
|
|
138
142
|
export declare function eip712TypeHash(types: Eip712Types, primaryType: string): Hex | null;
|
|
139
|
-
export declare function resolveEip712Descriptor(source: DescriptorSource, chainId: number, verifyingContract: string, primaryType: string, types: Eip712Types): Promise<Eip712Match | null>;
|
|
143
|
+
export declare function resolveEip712Descriptor(source: DescriptorSource, chainId: number, verifyingContract: string, primaryType: string, types: Eip712Types, messageDomain?: Record<string, unknown>): Promise<Eip712Match | null>;
|
|
140
144
|
export interface TokenInfo {
|
|
141
145
|
address: string;
|
|
142
146
|
decimals: number;
|
|
@@ -147,7 +151,7 @@ export interface FormatterContext extends PathContext {
|
|
|
147
151
|
resolveToken?: (address: string) => Promise<TokenInfo | null> | TokenInfo | null;
|
|
148
152
|
nativeSymbol?: string;
|
|
149
153
|
}
|
|
150
|
-
export declare function applyFormat(descriptor: Descriptor, format: DescriptorFormat, ctx: FormatterContext): Promise<ClearSigningDisplay>;
|
|
154
|
+
export declare function applyFormat(descriptor: Descriptor, format: DescriptorFormat, ctx: FormatterContext): Promise<ClearSigningDisplay | null>;
|
|
151
155
|
export interface DecodedArgs {
|
|
152
156
|
abiItem: AbiFunction;
|
|
153
157
|
args: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearSigning.d.ts","sourceRoot":"","sources":["../../src/utils/clearSigning.ts"],"names":[],"mappings":"AAcA,OAAO,
|
|
1
|
+
{"version":3,"file":"clearSigning.d.ts","sourceRoot":"","sources":["../../src/utils/clearSigning.ts"],"names":[],"mappings":"AAcA,OAAO,EAYL,KAAK,WAAW,EAChB,KAAK,GAAG,EAET,MAAM,MAAM,CAAC;AAOd,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,aAAa,GACb,aAAa,GACb,QAAQ,GACR,MAAM,GACN,MAAM,GACN,SAAS,GACT,UAAU,GACV,MAAM,GACN,UAAU,CAAC;AAEf,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CA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n >> t & e)
|
|
7
|
+
} : {
|
|
8
|
+
h: Number(n >> t & e) | 0,
|
|
9
|
+
l: Number(n & e) | 0
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function r(e, t = !1) {
|
|
13
|
+
let r = e.length, i = new Uint32Array(r), a = new Uint32Array(r);
|
|
14
|
+
for (let o = 0; o < r; o++) {
|
|
15
|
+
let { h: r, l: s } = n(e[o], t);
|
|
16
|
+
[i[o], a[o]] = [r, s];
|
|
17
|
+
}
|
|
18
|
+
return [i, a];
|
|
19
|
+
}
|
|
20
|
+
var i = (e, t, n) => e >>> n, a = (e, t, n) => e << 32 - n | t >>> n, o = (e, t, n) => e >>> n | t << 32 - n, s = (e, t, n) => e << 32 - n | t >>> n, c = (e, t, n) => e << 64 - n | t >>> n - 32, l = (e, t, n) => e >>> n - 32 | t << 64 - n, u = (e, t, n) => e << n | t >>> 32 - n, d = (e, t, n) => t << n | e >>> 32 - n, ee = (e, t, n) => t << n - 32 | e >>> 64 - n, f = (e, t, n) => e << n - 32 | t >>> 64 - n;
|
|
21
|
+
function p(e, t, n, r) {
|
|
22
|
+
let i = (t >>> 0) + (r >>> 0);
|
|
23
|
+
return {
|
|
24
|
+
h: e + n + (i / 2 ** 32 | 0) | 0,
|
|
25
|
+
l: i | 0
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
var m = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0), h = (e, t, n, r) => t + n + r + (e / 2 ** 32 | 0) | 0, g = (e, t, n, r) => (e >>> 0) + (t >>> 0) + (n >>> 0) + (r >>> 0), _ = (e, t, n, r, i) => t + n + r + i + (e / 2 ** 32 | 0) | 0, v = (e, t, n, r, i) => (e >>> 0) + (t >>> 0) + (n >>> 0) + (r >>> 0) + (i >>> 0), te = (e, t, n, r, i, a) => t + n + r + i + a + (e / 2 ** 32 | 0) | 0, y = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region ../../node_modules/@noble/hashes/esm/utils.js
|
|
31
|
+
function b(e) {
|
|
32
|
+
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
33
|
+
}
|
|
34
|
+
function x(e) {
|
|
35
|
+
if (!Number.isSafeInteger(e) || e < 0) throw Error("positive integer expected, got " + e);
|
|
36
|
+
}
|
|
37
|
+
function S(e, ...t) {
|
|
38
|
+
if (!b(e)) throw Error("Uint8Array expected");
|
|
39
|
+
if (t.length > 0 && !t.includes(e.length)) throw Error("Uint8Array expected of length " + t + ", got length=" + e.length);
|
|
40
|
+
}
|
|
41
|
+
function ne(e) {
|
|
42
|
+
if (typeof e != "function" || typeof e.create != "function") throw Error("Hash should be wrapped by utils.createHasher");
|
|
43
|
+
x(e.outputLen), x(e.blockLen);
|
|
44
|
+
}
|
|
45
|
+
function re(e, t = !0) {
|
|
46
|
+
if (e.destroyed) throw Error("Hash instance has been destroyed");
|
|
47
|
+
if (t && e.finished) throw Error("Hash#digest() has already been called");
|
|
48
|
+
}
|
|
49
|
+
function ie(e, t) {
|
|
50
|
+
S(e);
|
|
51
|
+
let n = t.outputLen;
|
|
52
|
+
if (e.length < n) throw Error("digestInto() expects output buffer of length at least " + n);
|
|
53
|
+
}
|
|
54
|
+
function ae(e) {
|
|
55
|
+
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
56
|
+
}
|
|
57
|
+
function oe(...e) {
|
|
58
|
+
for (let t = 0; t < e.length; t++) e[t].fill(0);
|
|
59
|
+
}
|
|
60
|
+
function se(e) {
|
|
61
|
+
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
62
|
+
}
|
|
63
|
+
function C(e, t) {
|
|
64
|
+
return e << 32 - t | e >>> t;
|
|
65
|
+
}
|
|
66
|
+
var w = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
67
|
+
function T(e) {
|
|
68
|
+
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
69
|
+
}
|
|
70
|
+
function E(e) {
|
|
71
|
+
for (let t = 0; t < e.length; t++) e[t] = T(e[t]);
|
|
72
|
+
return e;
|
|
73
|
+
}
|
|
74
|
+
var D = w ? (e) => e : E;
|
|
75
|
+
function O(e) {
|
|
76
|
+
if (typeof e != "string") throw Error("string expected");
|
|
77
|
+
return new Uint8Array(new TextEncoder().encode(e));
|
|
78
|
+
}
|
|
79
|
+
function k(e) {
|
|
80
|
+
return typeof e == "string" && (e = O(e)), S(e), e;
|
|
81
|
+
}
|
|
82
|
+
function A(...e) {
|
|
83
|
+
let t = 0;
|
|
84
|
+
for (let n = 0; n < e.length; n++) {
|
|
85
|
+
let r = e[n];
|
|
86
|
+
S(r), t += r.length;
|
|
87
|
+
}
|
|
88
|
+
let n = new Uint8Array(t);
|
|
89
|
+
for (let t = 0, r = 0; t < e.length; t++) {
|
|
90
|
+
let i = e[t];
|
|
91
|
+
n.set(i, r), r += i.length;
|
|
92
|
+
}
|
|
93
|
+
return n;
|
|
94
|
+
}
|
|
95
|
+
var j = class {};
|
|
96
|
+
function M(e) {
|
|
97
|
+
let t = (t) => e().update(k(t)).digest(), n = e();
|
|
98
|
+
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
|
|
99
|
+
}
|
|
100
|
+
function N(e = 32) {
|
|
101
|
+
if (y && typeof y.getRandomValues == "function") return y.getRandomValues(new Uint8Array(e));
|
|
102
|
+
if (y && typeof y.randomBytes == "function") return Uint8Array.from(y.randomBytes(e));
|
|
103
|
+
throw Error("crypto.getRandomValues must be defined");
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region ../../node_modules/@noble/curves/esm/abstract/utils.js
|
|
107
|
+
var P = /* @__PURE__ */ BigInt(0), F = /* @__PURE__ */ BigInt(1);
|
|
108
|
+
function I(e) {
|
|
109
|
+
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
110
|
+
}
|
|
111
|
+
function L(e) {
|
|
112
|
+
if (!I(e)) throw Error("Uint8Array expected");
|
|
113
|
+
}
|
|
114
|
+
function R(e, t) {
|
|
115
|
+
if (typeof t != "boolean") throw Error(e + " boolean expected, got " + t);
|
|
116
|
+
}
|
|
117
|
+
function z(e) {
|
|
118
|
+
let t = e.toString(16);
|
|
119
|
+
return t.length & 1 ? "0" + t : t;
|
|
120
|
+
}
|
|
121
|
+
function B(e) {
|
|
122
|
+
if (typeof e != "string") throw Error("hex string expected, got " + typeof e);
|
|
123
|
+
return e === "" ? P : BigInt("0x" + e);
|
|
124
|
+
}
|
|
125
|
+
var V = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", H = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
126
|
+
function U(e) {
|
|
127
|
+
if (L(e), V) return e.toHex();
|
|
128
|
+
let t = "";
|
|
129
|
+
for (let n = 0; n < e.length; n++) t += H[e[n]];
|
|
130
|
+
return t;
|
|
131
|
+
}
|
|
132
|
+
var W = {
|
|
133
|
+
_0: 48,
|
|
134
|
+
_9: 57,
|
|
135
|
+
A: 65,
|
|
136
|
+
F: 70,
|
|
137
|
+
a: 97,
|
|
138
|
+
f: 102
|
|
139
|
+
};
|
|
140
|
+
function G(e) {
|
|
141
|
+
if (e >= W._0 && e <= W._9) return e - W._0;
|
|
142
|
+
if (e >= W.A && e <= W.F) return e - (W.A - 10);
|
|
143
|
+
if (e >= W.a && e <= W.f) return e - (W.a - 10);
|
|
144
|
+
}
|
|
145
|
+
function K(e) {
|
|
146
|
+
if (typeof e != "string") throw Error("hex string expected, got " + typeof e);
|
|
147
|
+
if (V) return Uint8Array.fromHex(e);
|
|
148
|
+
let t = e.length, n = t / 2;
|
|
149
|
+
if (t % 2) throw Error("hex string expected, got unpadded hex of length " + t);
|
|
150
|
+
let r = new Uint8Array(n);
|
|
151
|
+
for (let t = 0, i = 0; t < n; t++, i += 2) {
|
|
152
|
+
let n = G(e.charCodeAt(i)), a = G(e.charCodeAt(i + 1));
|
|
153
|
+
if (n === void 0 || a === void 0) {
|
|
154
|
+
let t = e[i] + e[i + 1];
|
|
155
|
+
throw Error("hex string expected, got non-hex character \"" + t + "\" at index " + i);
|
|
156
|
+
}
|
|
157
|
+
r[t] = n * 16 + a;
|
|
158
|
+
}
|
|
159
|
+
return r;
|
|
160
|
+
}
|
|
161
|
+
function ce(e) {
|
|
162
|
+
return B(U(e));
|
|
163
|
+
}
|
|
164
|
+
function le(e) {
|
|
165
|
+
return L(e), B(U(Uint8Array.from(e).reverse()));
|
|
166
|
+
}
|
|
167
|
+
function q(e, t) {
|
|
168
|
+
return K(e.toString(16).padStart(t * 2, "0"));
|
|
169
|
+
}
|
|
170
|
+
function ue(e, t) {
|
|
171
|
+
return q(e, t).reverse();
|
|
172
|
+
}
|
|
173
|
+
function de(e, t, n) {
|
|
174
|
+
let r;
|
|
175
|
+
if (typeof t == "string") try {
|
|
176
|
+
r = K(t);
|
|
177
|
+
} catch (t) {
|
|
178
|
+
throw Error(e + " must be hex string or Uint8Array, cause: " + t);
|
|
179
|
+
}
|
|
180
|
+
else if (I(t)) r = Uint8Array.from(t);
|
|
181
|
+
else throw Error(e + " must be hex string or Uint8Array");
|
|
182
|
+
let i = r.length;
|
|
183
|
+
if (typeof n == "number" && i !== n) throw Error(e + " of length " + n + " expected, got " + i);
|
|
184
|
+
return r;
|
|
185
|
+
}
|
|
186
|
+
function J(...e) {
|
|
187
|
+
let t = 0;
|
|
188
|
+
for (let n = 0; n < e.length; n++) {
|
|
189
|
+
let r = e[n];
|
|
190
|
+
L(r), t += r.length;
|
|
191
|
+
}
|
|
192
|
+
let n = new Uint8Array(t);
|
|
193
|
+
for (let t = 0, r = 0; t < e.length; t++) {
|
|
194
|
+
let i = e[t];
|
|
195
|
+
n.set(i, r), r += i.length;
|
|
196
|
+
}
|
|
197
|
+
return n;
|
|
198
|
+
}
|
|
199
|
+
var Y = (e) => typeof e == "bigint" && P <= e;
|
|
200
|
+
function X(e, t, n) {
|
|
201
|
+
return Y(e) && Y(t) && Y(n) && t <= e && e < n;
|
|
202
|
+
}
|
|
203
|
+
function fe(e, t, n, r) {
|
|
204
|
+
if (!X(t, n, r)) throw Error("expected valid " + e + ": " + n + " <= n < " + r + ", got " + t);
|
|
205
|
+
}
|
|
206
|
+
function pe(e) {
|
|
207
|
+
let t;
|
|
208
|
+
for (t = 0; e > P; e >>= F, t += 1);
|
|
209
|
+
return t;
|
|
210
|
+
}
|
|
211
|
+
var me = (e) => (F << BigInt(e)) - F, Z = (e) => new Uint8Array(e), Q = (e) => Uint8Array.from(e);
|
|
212
|
+
function he(e, t, n) {
|
|
213
|
+
if (typeof e != "number" || e < 2) throw Error("hashLen must be a number");
|
|
214
|
+
if (typeof t != "number" || t < 2) throw Error("qByteLen must be a number");
|
|
215
|
+
if (typeof n != "function") throw Error("hmacFn must be a function");
|
|
216
|
+
let r = Z(e), i = Z(e), a = 0, o = () => {
|
|
217
|
+
r.fill(1), i.fill(0), a = 0;
|
|
218
|
+
}, s = (...e) => n(i, r, ...e), c = (e = Z(0)) => {
|
|
219
|
+
i = s(Q([0]), e), r = s(), e.length !== 0 && (i = s(Q([1]), e), r = s());
|
|
220
|
+
}, l = () => {
|
|
221
|
+
if (a++ >= 1e3) throw Error("drbg: tried 1000 values");
|
|
222
|
+
let e = 0, n = [];
|
|
223
|
+
for (; e < t;) {
|
|
224
|
+
r = s();
|
|
225
|
+
let t = r.slice();
|
|
226
|
+
n.push(t), e += r.length;
|
|
227
|
+
}
|
|
228
|
+
return J(...n);
|
|
229
|
+
};
|
|
230
|
+
return (e, t) => {
|
|
231
|
+
o(), c(e);
|
|
232
|
+
let n;
|
|
233
|
+
for (; !(n = t(l()));) c();
|
|
234
|
+
return o(), n;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
var ge = {
|
|
238
|
+
bigint: (e) => typeof e == "bigint",
|
|
239
|
+
function: (e) => typeof e == "function",
|
|
240
|
+
boolean: (e) => typeof e == "boolean",
|
|
241
|
+
string: (e) => typeof e == "string",
|
|
242
|
+
stringOrUint8Array: (e) => typeof e == "string" || I(e),
|
|
243
|
+
isSafeInteger: (e) => Number.isSafeInteger(e),
|
|
244
|
+
array: (e) => Array.isArray(e),
|
|
245
|
+
field: (e, t) => t.Fp.isValid(e),
|
|
246
|
+
hash: (e) => typeof e == "function" && Number.isSafeInteger(e.outputLen)
|
|
247
|
+
};
|
|
248
|
+
function $(e, t, n = {}) {
|
|
249
|
+
let r = (t, n, r) => {
|
|
250
|
+
let i = ge[n];
|
|
251
|
+
if (typeof i != "function") throw Error("invalid validator function");
|
|
252
|
+
let a = e[t];
|
|
253
|
+
if (!(r && a === void 0) && !i(a, e)) throw Error("param " + String(t) + " is invalid. Expected " + n + ", got " + a);
|
|
254
|
+
};
|
|
255
|
+
for (let [e, n] of Object.entries(t)) r(e, n, !1);
|
|
256
|
+
for (let [e, t] of Object.entries(n)) r(e, t, !0);
|
|
257
|
+
return e;
|
|
258
|
+
}
|
|
259
|
+
function _e(e) {
|
|
260
|
+
let t = /* @__PURE__ */ new WeakMap();
|
|
261
|
+
return (n, ...r) => {
|
|
262
|
+
let i = t.get(n);
|
|
263
|
+
if (i !== void 0) return i;
|
|
264
|
+
let a = e(n, ...r);
|
|
265
|
+
return t.set(n, a), a;
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
//#endregion
|
|
269
|
+
export { C as A, v as B, x as C, M as D, A as E, h as F, c as G, f as H, m as I, s as J, l as K, _ as L, k as M, ae as N, se as O, p as P, g as R, ne as S, oe as T, u as U, ee as V, d as W, a as X, i as Y, r as Z, z as _, U as a, S as b, J as c, K as d, X as f, ue as g, q as h, me as i, D as j, N as k, he as l, _e as m, R as n, ce as o, I as p, o as q, pe as r, le as s, fe as t, de as u, $ as v, ie as w, re as x, j as y, te as z };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaw.id/ui",
|
|
3
3
|
"description": "Pre-built React dialogs for JAW.id",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react-dom": ">=18.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@jaw.id/core": "0.4.
|
|
43
|
+
"@jaw.id/core": "0.4.2",
|
|
44
44
|
"@hookform/resolvers": "^5.2.2",
|
|
45
45
|
"@justaname.id/sdk": "^0.2.204",
|
|
46
46
|
"@radix-ui/react-accordion": "^1.2.12",
|
package/dist/ccip-BaE8Nb4B.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as R, b as E, e as x, H as y, f as M } from "./index-D1Fqo6z9.js";
|
|
2
|
-
class S extends p {
|
|
3
|
-
constructor({ callbackSelector: s, cause: e, data: o, extraData: n, sender: c, urls: t }) {
|
|
4
|
-
super(e.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
5
|
-
cause: e,
|
|
6
|
-
metaMessages: [
|
|
7
|
-
...e.metaMessages || [],
|
|
8
|
-
e.metaMessages?.length ? "" : [],
|
|
9
|
-
"Offchain Gateway Call:",
|
|
10
|
-
t && [
|
|
11
|
-
" Gateway URL(s):",
|
|
12
|
-
...t.map((i) => ` ${m(i)}`)
|
|
13
|
-
],
|
|
14
|
-
` Sender: ${c}`,
|
|
15
|
-
` Data: ${o}`,
|
|
16
|
-
` Callback selector: ${s}`,
|
|
17
|
-
` Extra data: ${n}`
|
|
18
|
-
].flat(),
|
|
19
|
-
name: "OffchainLookupError"
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
class $ extends p {
|
|
24
|
-
constructor({ result: s, url: e }) {
|
|
25
|
-
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
26
|
-
metaMessages: [
|
|
27
|
-
`Gateway URL: ${m(e)}`,
|
|
28
|
-
`Response: ${w(s)}`
|
|
29
|
-
],
|
|
30
|
-
name: "OffchainLookupResponseMalformedError"
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
class q extends p {
|
|
35
|
-
constructor({ sender: s, to: e }) {
|
|
36
|
-
super("Reverted sender address does not match target contract address (`to`).", {
|
|
37
|
-
metaMessages: [
|
|
38
|
-
`Contract address: ${e}`,
|
|
39
|
-
`OffchainLookup sender address: ${s}`
|
|
40
|
-
],
|
|
41
|
-
name: "OffchainLookupSenderMismatchError"
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const A = "0x556f1830", T = {
|
|
46
|
-
name: "OffchainLookup",
|
|
47
|
-
type: "error",
|
|
48
|
-
inputs: [
|
|
49
|
-
{
|
|
50
|
-
name: "sender",
|
|
51
|
-
type: "address"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: "urls",
|
|
55
|
-
type: "string[]"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: "callData",
|
|
59
|
-
type: "bytes"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "callbackFunction",
|
|
63
|
-
type: "bytes4"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: "extraData",
|
|
67
|
-
type: "bytes"
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
};
|
|
71
|
-
async function D(d, { blockNumber: s, blockTag: e, data: o, to: n }) {
|
|
72
|
-
const { args: c } = k({
|
|
73
|
-
data: o,
|
|
74
|
-
abi: [T]
|
|
75
|
-
}), [t, i, l, a, r] = c, { ccipRead: f } = d, h = f && typeof f?.request == "function" ? f.request : C;
|
|
76
|
-
try {
|
|
77
|
-
if (!b(n, t))
|
|
78
|
-
throw new q({ sender: t, to: n });
|
|
79
|
-
const u = i.includes(L) ? await O({
|
|
80
|
-
data: l,
|
|
81
|
-
ccipRequest: h
|
|
82
|
-
}) : await h({ data: l, sender: t, urls: i }), { data: g } = await R(d, {
|
|
83
|
-
blockNumber: s,
|
|
84
|
-
blockTag: e,
|
|
85
|
-
data: E([
|
|
86
|
-
a,
|
|
87
|
-
x([{ type: "bytes" }, { type: "bytes" }], [u, r])
|
|
88
|
-
]),
|
|
89
|
-
to: n
|
|
90
|
-
});
|
|
91
|
-
return g;
|
|
92
|
-
} catch (u) {
|
|
93
|
-
throw new S({
|
|
94
|
-
callbackSelector: a,
|
|
95
|
-
cause: u,
|
|
96
|
-
data: o,
|
|
97
|
-
extraData: r,
|
|
98
|
-
sender: t,
|
|
99
|
-
urls: i
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
async function C({ data: d, sender: s, urls: e }) {
|
|
104
|
-
let o = new Error("An unknown error occurred.");
|
|
105
|
-
for (let n = 0; n < e.length; n++) {
|
|
106
|
-
const c = e[n], t = c.includes("{data}") ? "GET" : "POST", i = t === "POST" ? { data: d, sender: s } : void 0, l = t === "POST" ? { "Content-Type": "application/json" } : {};
|
|
107
|
-
try {
|
|
108
|
-
const a = await fetch(c.replace("{sender}", s.toLowerCase()).replace("{data}", d), {
|
|
109
|
-
body: JSON.stringify(i),
|
|
110
|
-
headers: l,
|
|
111
|
-
method: t
|
|
112
|
-
});
|
|
113
|
-
let r;
|
|
114
|
-
if (a.headers.get("Content-Type")?.startsWith("application/json") ? r = (await a.json()).data : r = await a.text(), !a.ok) {
|
|
115
|
-
o = new y({
|
|
116
|
-
body: i,
|
|
117
|
-
details: r?.error ? w(r.error) : a.statusText,
|
|
118
|
-
headers: a.headers,
|
|
119
|
-
status: a.status,
|
|
120
|
-
url: c
|
|
121
|
-
});
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
if (!M(r)) {
|
|
125
|
-
o = new $({
|
|
126
|
-
result: r,
|
|
127
|
-
url: c
|
|
128
|
-
});
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
return r;
|
|
132
|
-
} catch (a) {
|
|
133
|
-
o = new y({
|
|
134
|
-
body: i,
|
|
135
|
-
details: a.message,
|
|
136
|
-
url: c
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
throw o;
|
|
141
|
-
}
|
|
142
|
-
export {
|
|
143
|
-
C as ccipRequest,
|
|
144
|
-
D as offchainLookup,
|
|
145
|
-
T as offchainLookupAbiItem,
|
|
146
|
-
A as offchainLookupSignature
|
|
147
|
-
};
|