Skip to content

Commit

Permalink
Merge pull request #71 from phantasma-io/dev
Browse files Browse the repository at this point in the history
Updating Ledger Missing types
  • Loading branch information
TeknoPT authored Nov 27, 2023
2 parents a627299 + e4d1afe commit 3a2cb6d
Show file tree
Hide file tree
Showing 19 changed files with 359 additions and 301 deletions.
9 changes: 6 additions & 3 deletions core/ledger/Ledger-Commands.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { PublicKeyResponse } from '..';
import { LedgerConfig } from './interfaces/LedgerConfig';
import { LedgerDeviceInfoResponse } from './interfaces/LedgerDeviceInfoResponse';
import { LedgerBalanceFromLedgerResponse } from './interfaces/LedgerBalanceFromLedgerResponse';
import { LedgerSigner } from './interfaces/LedgerSigner';
/**
*
* @param number
Expand All @@ -26,21 +29,21 @@ export declare const GetLedgerDeviceInfo: (config: LedgerConfig) => Promise<Ledg
* @param accountIx
* @returns
*/
export declare const GetLedgerAccountSigner: (config: LedgerConfig, accountIx: any) => Promise<any>;
export declare const GetLedgerAccountSigner: (config: LedgerConfig, accountIx: any) => Promise<LedgerSigner>;
/**
* GetBalanceFromLedger
* @param config
* @param options
* @returns
*/
export declare const GetBalanceFromLedger: (config: LedgerConfig, options: any) => Promise<any>;
export declare const GetBalanceFromLedger: (config: LedgerConfig, options: any) => Promise<LedgerBalanceFromLedgerResponse>;
/**
* Get Addres from Ledger
* @param config
* @param options
* @returns
*/
export declare const GetAddressFromLedeger: (config: LedgerConfig, options: any) => Promise<string | import("..").PublicKeyResponse>;
export declare const GetAddressFromLedeger: (config: LedgerConfig, options: any) => Promise<string | PublicKeyResponse>;
/**
* SendTransactionLedger
* @param config
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/Ledger-Commands.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions core/ledger/Ledger-Commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ var GetLedgerAccountSigner = function (config, accountIx) { return __awaiter(voi
if (accountIx === undefined) {
throw Error('accountIx is a required parameter.');
}
return [4 /*yield*/, globalThis.TransportWebUSB.list()];
return [4 /*yield*/, config.Transport.list()];
case 1:
paths = _a.sent();
console.log('paths', paths);
Expand All @@ -143,7 +143,6 @@ var GetLedgerAccountSigner = function (config, accountIx) { return __awaiter(voi
})];
case 2:
accountData = _a.sent();
signer = {};
signer.GetPublicKey = function () {
return accountData.publicKey;
};
Expand Down
8 changes: 8 additions & 0 deletions core/ledger/interfaces/LedgerBalanceFromLedgerResponse.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Address } from '../../types';
export interface LedgerBalanceFromLedgerResponse {
success: boolean;
message: string;
publicKey?: string;
address?: Address;
}
//# sourceMappingURL=LedgerBalanceFromLedgerResponse.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions core/ledger/interfaces/LedgerBalanceFromLedgerResponse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
6 changes: 6 additions & 0 deletions core/ledger/interfaces/LedgerSigner.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Address } from '../../types';
export interface LedgerSigner {
GetPublicKey: () => string;
GetAccount: () => Address;
}
//# sourceMappingURL=LedgerSigner.d.ts.map
1 change: 1 addition & 0 deletions core/ledger/interfaces/LedgerSigner.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions core/ledger/interfaces/LedgerSigner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
2 changes: 2 additions & 0 deletions core/ledger/interfaces/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ export * from './LedgerDeviceInfoResponse';
export * from './PublicKeyResponse';
export * from './SignResponse';
export * from './VersionResponse';
export * from './LedgerBalanceFromLedgerResponse';
export * from './LedgerSigner';
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion core/ledger/interfaces/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions core/ledger/interfaces/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ __exportStar(require("./LedgerDeviceInfoResponse"), exports);
__exportStar(require("./PublicKeyResponse"), exports);
__exportStar(require("./SignResponse"), exports);
__exportStar(require("./VersionResponse"), exports);
__exportStar(require("./LedgerBalanceFromLedgerResponse"), exports);
__exportStar(require("./LedgerSigner"), exports);
Loading

0 comments on commit 3a2cb6d

Please sign in to comment.