@calimero-network/mero-js 25.0.5 → 25.0.6
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/account/application-id.d.ts +3 -1
- package/dist/account/relay-from-invitation.js +3 -2
- package/dist/index.browser.mjs +1 -1
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +7 -3
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
|
@@ -27,7 +27,9 @@ export declare function applicationIdForBundle(pkg: string, signerId: string): P
|
|
|
27
27
|
* one rule for "latest", shared by the version lookup and the id derivation so
|
|
28
28
|
* the two cannot disagree about which bundle an account is founding on.
|
|
29
29
|
*/
|
|
30
|
-
export declare function selectLatestBundle<B extends RegistryBundle>(bundles: readonly B[]): B
|
|
30
|
+
export declare function selectLatestBundle<B extends RegistryBundle>(bundles: readonly B[]): (B & {
|
|
31
|
+
appVersion: string;
|
|
32
|
+
}) | undefined;
|
|
31
33
|
/** The registry's listing of `pkg`, every version. */
|
|
32
34
|
export declare function fetchRegistryBundles(registryUrl: string, pkg: string, fetchFn?: typeof fetch): Promise<RegistryBundle[]>;
|
|
33
35
|
export interface ResolvedApplication {
|
|
@@ -147,7 +147,8 @@ export async function resolveRelayFromInvitation(input) {
|
|
|
147
147
|
const candidates = usable.length > 0 ? usable : named;
|
|
148
148
|
const advisory = usable.length === 0 || !servable;
|
|
149
149
|
const addressable = candidates.filter((n) => typeof n.relayUrl === 'string' && n.relayUrl.length > 0);
|
|
150
|
-
|
|
150
|
+
const [firstAddressable] = addressable;
|
|
151
|
+
if (firstAddressable === undefined) {
|
|
151
152
|
return {
|
|
152
153
|
ok: false,
|
|
153
154
|
step: 'no-relay-url',
|
|
@@ -160,7 +161,7 @@ export async function resolveRelayFromInvitation(input) {
|
|
|
160
161
|
// step that cannot proceed without a node, and authorship is not on the
|
|
161
162
|
// invitation's list at all, so insisting would refuse a perfectly good
|
|
162
163
|
// admitter for a permission admission never needed.
|
|
163
|
-
const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ??
|
|
164
|
+
const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ?? firstAddressable;
|
|
164
165
|
return {
|
|
165
166
|
ok: true,
|
|
166
167
|
relayUrl: chosen.relayUrl,
|