Skip to content

Commit

Permalink
Add metaUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Jul 9, 2024
1 parent 36f3a30 commit b657fee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/hw-ledger/src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ function sign (method: 'sign' | 'signRaw', message: Uint8Array, slip44: number,
export class Ledger {
readonly #transportDef: TransportDef;
readonly #slip44: number;
readonly #chainId: string;
readonly #chainId?: string;
readonly #metaUrl?: string;

#app: PolkadotGenericApp | null = null;

constructor (transport: TransportType, chain: Chain, chainId: string, slip44: number) {
constructor (transport: TransportType, chain: Chain, slip44: number, chainId?: string, metaUrl?: string) {
const ledgerName = ledgerApps[chain];
const transportDef = transports.find(({ type }) => type === transport);

Expand All @@ -83,6 +84,7 @@ export class Ledger {
throw new Error(`Unsupported Ledger transport ${transport}`);
}

this.#metaUrl = metaUrl;
this.#chainId = chainId;
this.#slip44 = slip44;
this.#transportDef = transportDef;
Expand Down Expand Up @@ -151,7 +153,7 @@ export class Ledger {
// esm.sh versions this yields problematic outputs)
//
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
this.#app = new PolkadotGenericApp(transport as any, this.#chainId, 'https://api.zondax.ch/polkadot/transaction/metadata');
this.#app = new PolkadotGenericApp(transport as any, this.#chainId, this.#metaUrl);
}

return await fn(this.#app);
Expand Down

0 comments on commit b657fee

Please sign in to comment.