Skip to content

Commit

Permalink
feat: alph chain set "group" with optional (#375)
Browse files Browse the repository at this point in the history
* feat: alph chain set "group" with optional

* fix: change || to ??

* fix: ignore group
  • Loading branch information
wabicai authored Oct 10, 2024
1 parent 3b1929d commit 902fcec
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/connect-examples/expo-example/src/data/alephium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const api: PlaygroundProps[] = [
title: 'Get address',
value: {
path: "m/44'/1234'/0'/0/0",
includePublicKey: true,
showOnOneKey: false,
group: 0,
},
Expand All @@ -19,11 +20,13 @@ const api: PlaygroundProps[] = [
bundle: [
{
path: "m/44'/1234'/0'/0/0",
includePublicKey: true,
showOnOneKey: false,
group: 0,
},
{
path: "m/44'/1234'/0'/0/1",
includePublicKey: true,
showOnOneKey: false,
group: 0,
},
Expand Down
2 changes: 2 additions & 0 deletions packages/connect-examples/expo-example/src/data/allnetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ const api: PlaygroundProps[] = [
{
network: 'alph',
path: "m/44'/1234'/0'/0/0",
includePublicKey: true,
showOnOneKey: false,
group: 0,
},
{
network: 'nostr',
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/api/alephium/AlephiumGetAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default class AlephiumGetAddress extends BaseMethod<HardwareAlephiumGetAd
address_n: addressN,
show_display: showOnOneKey,
include_public_key: batch.includePublicKey ?? false,
target_group: batch.group,
// When group is 'null', the 'group' parameter will not be sent
...(batch.group !== null && { target_group: batch.group ?? 0 }),
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/api/alephiumGetAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type AlephiumGetAddressParams = {
path: string | number[];
showOnOneKey?: boolean;
includePublicKey?: boolean;
group: number;
group: number | undefined | null;
};

export declare function alephiumGetAddress(
Expand Down
4 changes: 2 additions & 2 deletions packages/hd-web-sdk/src/iframe/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export const init = async (settings: any) => {
}
}

const manifest = `version=${settings.version as string}`;
const src = `${settings.iframeSrc as string}?${manifest}`;
// const manifest = `version=${settings.version as string}`;
const src = `${settings.iframeSrc as string}`;

instance.setAttribute('src', src);

Expand Down

0 comments on commit 902fcec

Please sign in to comment.