@agoric/orchestration 0.2.0-u21.0.1 → 0.2.0-u22.0
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/package.json +39 -37
- package/src/axelar-types.d.ts +4 -3
- package/src/axelar-types.d.ts.map +1 -1
- package/src/axelar-types.js +4 -2
- package/src/chain-info.d.ts +1 -1
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +9 -4
- package/src/cosmos-api.d.ts +2 -2
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +2 -2
- package/src/examples/axelar-gmp-account-kit.d.ts +11 -0
- package/src/examples/axelar-gmp-account-kit.d.ts.map +1 -1
- package/src/examples/axelar-gmp-account-kit.js +23 -4
- package/src/examples/axelar-gmp.contract.d.ts.map +1 -1
- package/src/examples/axelar-gmp.contract.js +10 -5
- package/src/examples/axelar-gmp.flows.d.ts.map +1 -1
- package/src/examples/axelar-gmp.flows.js +10 -5
- package/src/examples/stake-bld.contract.d.ts +2 -2
- package/src/exos/chain-hub.d.ts +8 -0
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +16 -0
- package/src/exos/cosmos-interchain-service.d.ts +1 -0
- package/src/exos/cosmos-interchain-service.d.ts.map +1 -1
- package/src/exos/cosmos-interchain-service.js +1 -0
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +87 -36
- package/src/exos/local-orchestration-account.d.ts +6 -6
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +39 -35
- package/src/exos/orchestrator.d.ts +2 -2
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +1 -6
- package/src/exos/packet-tools.d.ts +1 -1
- package/src/fixtures/query-flows.contract.d.ts +1 -1
- package/src/fixtures/query-flows.contract.d.ts.map +1 -1
- package/src/fixtures/query-flows.contract.js +1 -2
- package/src/stubs/viem-abi.d.ts +12 -0
- package/src/stubs/viem-abi.d.ts.map +1 -0
- package/src/stubs/viem-abi.ts +11 -0
- package/src/utils/agd-lib.d.ts +0 -1
- package/src/utils/agd-lib.d.ts.map +1 -1
- package/src/utils/agd-lib.js +9 -18
- package/src/utils/gmp.d.ts +2 -33
- package/src/utils/gmp.d.ts.map +1 -1
- package/src/utils/gmp.js +30 -24
- package/src/utils/packet.d.ts +9 -9
- package/src/utils/packet.d.ts.map +1 -1
- package/src/utils/packet.js +21 -15
- package/src/utils/start-helper.d.ts +1 -0
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/vendor/viem/_esm-YOAV66U4.js +5814 -0
- package/src/vendor/viem/ccip-AAQDZF3N.js +14 -0
- package/src/vendor/viem/chunk-4EF4K2MH.js +4082 -0
- package/src/vendor/viem/chunk-4VNS5WPM.js +42 -0
- package/src/vendor/viem/chunk-XN4LUOIH.js +253 -0
- package/src/vendor/viem/secp256k1-WHBDSQB2.js +1914 -0
- package/src/vendor/viem/viem-abi.d.ts +1 -0
- package/src/vendor/viem/viem-abi.js +12 -0
- package/tools/contract-tests.d.ts +31 -5
- package/tools/contract-tests.d.ts.map +1 -1
- package/tools/contract-tests.ts +39 -10
- package/tools/ibc-mocks.d.ts +35 -23
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +78 -59
- package/tsup.config.ts +26 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
__require,
|
|
39
|
+
__commonJS,
|
|
40
|
+
__export,
|
|
41
|
+
__toESM
|
|
42
|
+
};
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// ../../node_modules/@noble/curves/esm/abstract/utils.js
|
|
2
|
+
var _0n = /* @__PURE__ */ BigInt(0);
|
|
3
|
+
var _1n = /* @__PURE__ */ BigInt(1);
|
|
4
|
+
function isBytes(a) {
|
|
5
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
6
|
+
}
|
|
7
|
+
function abytes(item) {
|
|
8
|
+
if (!isBytes(item))
|
|
9
|
+
throw new Error("Uint8Array expected");
|
|
10
|
+
}
|
|
11
|
+
function abool(title, value) {
|
|
12
|
+
if (typeof value !== "boolean")
|
|
13
|
+
throw new Error(title + " boolean expected, got " + value);
|
|
14
|
+
}
|
|
15
|
+
function numberToHexUnpadded(num) {
|
|
16
|
+
const hex = num.toString(16);
|
|
17
|
+
return hex.length & 1 ? "0" + hex : hex;
|
|
18
|
+
}
|
|
19
|
+
function hexToNumber(hex) {
|
|
20
|
+
if (typeof hex !== "string")
|
|
21
|
+
throw new Error("hex string expected, got " + typeof hex);
|
|
22
|
+
return hex === "" ? _0n : BigInt("0x" + hex);
|
|
23
|
+
}
|
|
24
|
+
var hasHexBuiltin = (
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function"
|
|
27
|
+
);
|
|
28
|
+
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
29
|
+
function bytesToHex(bytes) {
|
|
30
|
+
abytes(bytes);
|
|
31
|
+
if (hasHexBuiltin)
|
|
32
|
+
return bytes.toHex();
|
|
33
|
+
let hex = "";
|
|
34
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
35
|
+
hex += hexes[bytes[i]];
|
|
36
|
+
}
|
|
37
|
+
return hex;
|
|
38
|
+
}
|
|
39
|
+
var asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
40
|
+
function asciiToBase16(ch) {
|
|
41
|
+
if (ch >= asciis._0 && ch <= asciis._9)
|
|
42
|
+
return ch - asciis._0;
|
|
43
|
+
if (ch >= asciis.A && ch <= asciis.F)
|
|
44
|
+
return ch - (asciis.A - 10);
|
|
45
|
+
if (ch >= asciis.a && ch <= asciis.f)
|
|
46
|
+
return ch - (asciis.a - 10);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
function hexToBytes(hex) {
|
|
50
|
+
if (typeof hex !== "string")
|
|
51
|
+
throw new Error("hex string expected, got " + typeof hex);
|
|
52
|
+
if (hasHexBuiltin)
|
|
53
|
+
return Uint8Array.fromHex(hex);
|
|
54
|
+
const hl = hex.length;
|
|
55
|
+
const al = hl / 2;
|
|
56
|
+
if (hl % 2)
|
|
57
|
+
throw new Error("hex string expected, got unpadded hex of length " + hl);
|
|
58
|
+
const array = new Uint8Array(al);
|
|
59
|
+
for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
|
|
60
|
+
const n1 = asciiToBase16(hex.charCodeAt(hi));
|
|
61
|
+
const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
|
|
62
|
+
if (n1 === void 0 || n2 === void 0) {
|
|
63
|
+
const char = hex[hi] + hex[hi + 1];
|
|
64
|
+
throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
|
|
65
|
+
}
|
|
66
|
+
array[ai] = n1 * 16 + n2;
|
|
67
|
+
}
|
|
68
|
+
return array;
|
|
69
|
+
}
|
|
70
|
+
function bytesToNumberBE(bytes) {
|
|
71
|
+
return hexToNumber(bytesToHex(bytes));
|
|
72
|
+
}
|
|
73
|
+
function bytesToNumberLE(bytes) {
|
|
74
|
+
abytes(bytes);
|
|
75
|
+
return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));
|
|
76
|
+
}
|
|
77
|
+
function numberToBytesBE(n, len) {
|
|
78
|
+
return hexToBytes(n.toString(16).padStart(len * 2, "0"));
|
|
79
|
+
}
|
|
80
|
+
function numberToBytesLE(n, len) {
|
|
81
|
+
return numberToBytesBE(n, len).reverse();
|
|
82
|
+
}
|
|
83
|
+
function ensureBytes(title, hex, expectedLength) {
|
|
84
|
+
let res;
|
|
85
|
+
if (typeof hex === "string") {
|
|
86
|
+
try {
|
|
87
|
+
res = hexToBytes(hex);
|
|
88
|
+
} catch (e) {
|
|
89
|
+
throw new Error(title + " must be hex string or Uint8Array, cause: " + e);
|
|
90
|
+
}
|
|
91
|
+
} else if (isBytes(hex)) {
|
|
92
|
+
res = Uint8Array.from(hex);
|
|
93
|
+
} else {
|
|
94
|
+
throw new Error(title + " must be hex string or Uint8Array");
|
|
95
|
+
}
|
|
96
|
+
const len = res.length;
|
|
97
|
+
if (typeof expectedLength === "number" && len !== expectedLength)
|
|
98
|
+
throw new Error(title + " of length " + expectedLength + " expected, got " + len);
|
|
99
|
+
return res;
|
|
100
|
+
}
|
|
101
|
+
function concatBytes(...arrays) {
|
|
102
|
+
let sum = 0;
|
|
103
|
+
for (let i = 0; i < arrays.length; i++) {
|
|
104
|
+
const a = arrays[i];
|
|
105
|
+
abytes(a);
|
|
106
|
+
sum += a.length;
|
|
107
|
+
}
|
|
108
|
+
const res = new Uint8Array(sum);
|
|
109
|
+
for (let i = 0, pad = 0; i < arrays.length; i++) {
|
|
110
|
+
const a = arrays[i];
|
|
111
|
+
res.set(a, pad);
|
|
112
|
+
pad += a.length;
|
|
113
|
+
}
|
|
114
|
+
return res;
|
|
115
|
+
}
|
|
116
|
+
function utf8ToBytes(str) {
|
|
117
|
+
if (typeof str !== "string")
|
|
118
|
+
throw new Error("string expected");
|
|
119
|
+
return new Uint8Array(new TextEncoder().encode(str));
|
|
120
|
+
}
|
|
121
|
+
var isPosBig = (n) => typeof n === "bigint" && _0n <= n;
|
|
122
|
+
function inRange(n, min, max) {
|
|
123
|
+
return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;
|
|
124
|
+
}
|
|
125
|
+
function aInRange(title, n, min, max) {
|
|
126
|
+
if (!inRange(n, min, max))
|
|
127
|
+
throw new Error("expected valid " + title + ": " + min + " <= n < " + max + ", got " + n);
|
|
128
|
+
}
|
|
129
|
+
function bitLen(n) {
|
|
130
|
+
let len;
|
|
131
|
+
for (len = 0; n > _0n; n >>= _1n, len += 1)
|
|
132
|
+
;
|
|
133
|
+
return len;
|
|
134
|
+
}
|
|
135
|
+
var bitMask = (n) => (_1n << BigInt(n)) - _1n;
|
|
136
|
+
var u8n = (len) => new Uint8Array(len);
|
|
137
|
+
var u8fr = (arr) => Uint8Array.from(arr);
|
|
138
|
+
function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
|
139
|
+
if (typeof hashLen !== "number" || hashLen < 2)
|
|
140
|
+
throw new Error("hashLen must be a number");
|
|
141
|
+
if (typeof qByteLen !== "number" || qByteLen < 2)
|
|
142
|
+
throw new Error("qByteLen must be a number");
|
|
143
|
+
if (typeof hmacFn !== "function")
|
|
144
|
+
throw new Error("hmacFn must be a function");
|
|
145
|
+
let v = u8n(hashLen);
|
|
146
|
+
let k = u8n(hashLen);
|
|
147
|
+
let i = 0;
|
|
148
|
+
const reset = () => {
|
|
149
|
+
v.fill(1);
|
|
150
|
+
k.fill(0);
|
|
151
|
+
i = 0;
|
|
152
|
+
};
|
|
153
|
+
const h = (...b) => hmacFn(k, v, ...b);
|
|
154
|
+
const reseed = (seed = u8n(0)) => {
|
|
155
|
+
k = h(u8fr([0]), seed);
|
|
156
|
+
v = h();
|
|
157
|
+
if (seed.length === 0)
|
|
158
|
+
return;
|
|
159
|
+
k = h(u8fr([1]), seed);
|
|
160
|
+
v = h();
|
|
161
|
+
};
|
|
162
|
+
const gen = () => {
|
|
163
|
+
if (i++ >= 1e3)
|
|
164
|
+
throw new Error("drbg: tried 1000 values");
|
|
165
|
+
let len = 0;
|
|
166
|
+
const out = [];
|
|
167
|
+
while (len < qByteLen) {
|
|
168
|
+
v = h();
|
|
169
|
+
const sl = v.slice();
|
|
170
|
+
out.push(sl);
|
|
171
|
+
len += v.length;
|
|
172
|
+
}
|
|
173
|
+
return concatBytes(...out);
|
|
174
|
+
};
|
|
175
|
+
const genUntil = (seed, pred) => {
|
|
176
|
+
reset();
|
|
177
|
+
reseed(seed);
|
|
178
|
+
let res = void 0;
|
|
179
|
+
while (!(res = pred(gen())))
|
|
180
|
+
reseed();
|
|
181
|
+
reset();
|
|
182
|
+
return res;
|
|
183
|
+
};
|
|
184
|
+
return genUntil;
|
|
185
|
+
}
|
|
186
|
+
var validatorFns = {
|
|
187
|
+
bigint: (val) => typeof val === "bigint",
|
|
188
|
+
function: (val) => typeof val === "function",
|
|
189
|
+
boolean: (val) => typeof val === "boolean",
|
|
190
|
+
string: (val) => typeof val === "string",
|
|
191
|
+
stringOrUint8Array: (val) => typeof val === "string" || isBytes(val),
|
|
192
|
+
isSafeInteger: (val) => Number.isSafeInteger(val),
|
|
193
|
+
array: (val) => Array.isArray(val),
|
|
194
|
+
field: (val, object) => object.Fp.isValid(val),
|
|
195
|
+
hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen)
|
|
196
|
+
};
|
|
197
|
+
function validateObject(object, validators, optValidators = {}) {
|
|
198
|
+
const checkField = (fieldName, type, isOptional) => {
|
|
199
|
+
const checkVal = validatorFns[type];
|
|
200
|
+
if (typeof checkVal !== "function")
|
|
201
|
+
throw new Error("invalid validator function");
|
|
202
|
+
const val = object[fieldName];
|
|
203
|
+
if (isOptional && val === void 0)
|
|
204
|
+
return;
|
|
205
|
+
if (!checkVal(val, object)) {
|
|
206
|
+
throw new Error("param " + String(fieldName) + " is invalid. Expected " + type + ", got " + val);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
for (const [fieldName, type] of Object.entries(validators))
|
|
210
|
+
checkField(fieldName, type, false);
|
|
211
|
+
for (const [fieldName, type] of Object.entries(optValidators))
|
|
212
|
+
checkField(fieldName, type, true);
|
|
213
|
+
return object;
|
|
214
|
+
}
|
|
215
|
+
function memoized(fn) {
|
|
216
|
+
const map = /* @__PURE__ */ new WeakMap();
|
|
217
|
+
return (arg, ...args) => {
|
|
218
|
+
const val = map.get(arg);
|
|
219
|
+
if (val !== void 0)
|
|
220
|
+
return val;
|
|
221
|
+
const computed = fn(arg, ...args);
|
|
222
|
+
map.set(arg, computed);
|
|
223
|
+
return computed;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export {
|
|
228
|
+
isBytes,
|
|
229
|
+
abytes,
|
|
230
|
+
abool,
|
|
231
|
+
numberToHexUnpadded,
|
|
232
|
+
bytesToHex,
|
|
233
|
+
hexToBytes,
|
|
234
|
+
bytesToNumberBE,
|
|
235
|
+
bytesToNumberLE,
|
|
236
|
+
numberToBytesBE,
|
|
237
|
+
numberToBytesLE,
|
|
238
|
+
ensureBytes,
|
|
239
|
+
concatBytes,
|
|
240
|
+
utf8ToBytes,
|
|
241
|
+
inRange,
|
|
242
|
+
aInRange,
|
|
243
|
+
bitLen,
|
|
244
|
+
bitMask,
|
|
245
|
+
createHmacDrbg,
|
|
246
|
+
validateObject,
|
|
247
|
+
memoized
|
|
248
|
+
};
|
|
249
|
+
/*! Bundled license information:
|
|
250
|
+
|
|
251
|
+
@noble/curves/esm/abstract/utils.js:
|
|
252
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
253
|
+
*/
|