Skip to content

Commit

Permalink
sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
arobsn committed Jul 3, 2024
1 parent 2175d17 commit 0ac7571
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/device.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RecordStore, openTransportReplayer } from "@ledgerhq/hw-transport-mocker";
import { describe, expect, it } from "vitest";
import { Device, DeviceError, RETURN_CODE } from "./device";
import { RecordStore, openTransportReplayer } from "@ledgerhq/hw-transport-mocker";
import { CLA } from "./erg";

describe("DeviceError construction", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/device.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Transport from "@ledgerhq/hw-transport";
import type { DeviceResponse } from "./types/internal";
import type { Buffer } from "buffer";
import type Transport from "@ledgerhq/hw-transport";
import { ByteWriter } from "./serialization/byteWriter";
import type { DeviceResponse } from "./types/internal";

export const enum COMMAND {
GET_APP_VERSION = 0x01,
Expand Down
4 changes: 2 additions & 2 deletions src/erg.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect, test, vi } from "vitest";
import { RecordStore, openTransportReplayer } from "@ledgerhq/hw-transport-mocker";
import { describe, expect, it, test, vi } from "vitest";
import { ErgoLedgerApp } from "./erg";
import { openTransportReplayer, RecordStore } from "@ledgerhq/hw-transport-mocker";

describe("construction", () => {
it("should construct app with transport", async () => {
Expand Down
28 changes: 14 additions & 14 deletions src/erg.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { Network, uniq } from "@fleet-sdk/common";
import type Transport from "@ledgerhq/hw-transport";
import { Device, DeviceError, RETURN_CODE } from "./device";
import type {
AppName,
UnsignedBox,
DerivedAddress,
ExtendedPublicKey,
Version,
UnsignedTransaction
} from "./types/public";
import type { AttestedBox } from "./types/attestedBox";
import {
attestInput,
deriveAddress,
getAppName,
getExtendedPublicKey,
getAppVersion,
deriveAddress,
getExtendedPublicKey,
showAddress,
attestInput,
signTx
} from "./interactions";
import type { AttestedBox } from "./types/attestedBox";
import type { AttestedTransaction, SignTransactionResponse } from "./types/internal";
import { uniq, Network } from "@fleet-sdk/common";
import type {
AppName,
DerivedAddress,
ExtendedPublicKey,
UnsignedBox,
UnsignedTransaction,
Version
} from "./types/public";

export { DeviceError, RETURN_CODE, Network };
export * from "./types/public";
export { DeviceError, Network, RETURN_CODE };
export const CLA = 0xe0;

/**
Expand Down
10 changes: 5 additions & 5 deletions src/interactions/attestInput.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { COMMAND, MAX_DATA_LENGTH, type Device } from "../device";
import type { AttestedBoxFrame, UnsignedBox, Token } from "../types/public";
import type { DeviceResponse } from "../types/internal";
import { AttestedBox } from "../types/attestedBox";
import { ByteWriter } from "../serialization/byteWriter";
import { chunk } from "@fleet-sdk/common";
import { hex } from "@fleet-sdk/crypto";
import { COMMAND, type Device, MAX_DATA_LENGTH } from "../device";
import { ByteWriter } from "../serialization/byteWriter";
import { AttestedBox } from "../types/attestedBox";
import type { DeviceResponse } from "../types/internal";
import type { AttestedBoxFrame, Token, UnsignedBox } from "../types/public";

const enum P1 {
BOX_START = 0x01,
Expand Down
8 changes: 4 additions & 4 deletions src/interactions/deriveAddress.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { COMMAND, RETURN_CODE, type Device } from "../device";
import type { DerivedAddress } from "../types/public";
import type { DeviceResponse } from "../types/internal";
import type { Network } from "@fleet-sdk/common";
import { ByteWriter } from "../serialization/byteWriter";
import { hex } from "@fleet-sdk/crypto";
import { COMMAND, type Device, RETURN_CODE } from "../device";
import { ByteWriter } from "../serialization/byteWriter";
import { pathToArray } from "../serialization/utils";
import type { DeviceResponse } from "../types/internal";
import type { DerivedAddress } from "../types/public";

const enum ReturnType {
Return = 0x01,
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/getAppName.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { COMMAND, type Device } from "../device";
import type { AppName } from "../types/public";
import { EMPTY_BYTES } from "../serialization/utils";
import type { AppName } from "../types/public";

const enum P1 {
UNUSED = 0x00
Expand Down
4 changes: 2 additions & 2 deletions src/interactions/getExtendedPublicKey.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { COMMAND, type Device } from "../device";
import type { ExtendedPublicKey } from "../types/public";
import { hex } from "@fleet-sdk/crypto";
import { COMMAND, type Device } from "../device";
import { ByteWriter } from "../serialization/byteWriter";
import type { ExtendedPublicKey } from "../types/public";

const enum P1 {
WITHOUT_TOKEN = 0x01,
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/getVersion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Version } from "../types/public";
import { COMMAND, type Device } from "../device";
import { EMPTY_BYTES } from "../serialization/utils";
import type { Version } from "../types/public";

const IS_DEBUG_FLAG = 0x01;

Expand Down
2 changes: 1 addition & 1 deletion src/interactions/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { attestInput } from "./attestInput";
export { deriveAddress, showAddress } from "./deriveAddress";
export { getAppName } from "./getAppName";
export { getExtendedPublicKey } from "./getExtendedPublicKey";
export { getAppVersion } from "./getVersion";
export { attestInput } from "./attestInput";
export { signTx } from "./signTx";
10 changes: 5 additions & 5 deletions src/interactions/signTx.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { ChangeMap, BoxCandidate, Token } from "../types/public";
import { COMMAND, MAX_DATA_LENGTH, type Device } from "../device";
import { chunk } from "@fleet-sdk/common";
import { ErgoAddress, type Network } from "@fleet-sdk/core";
import type { AttestedTransaction } from "../types/internal";
import type { AttestedBox } from "../types/attestedBox";
import { hex } from "@fleet-sdk/crypto";
import { COMMAND, type Device, MAX_DATA_LENGTH } from "../device";
import { ByteWriter } from "../serialization/byteWriter";
import { chunk } from "@fleet-sdk/common";
import { EMPTY_BYTES } from "../serialization/utils";
import type { AttestedBox } from "../types/attestedBox";
import type { AttestedTransaction } from "../types/internal";
import type { BoxCandidate, ChangeMap, Token } from "../types/public";

const MINER_FEE_TREE =
"1005040004000e36100204a00b08cd0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ea02d192a39a8cc7a701730073011001020402d19683030193a38cc7b2a57300000193c2b2a57301007473027303830108cdeeac93b1a57304";
Expand Down
2 changes: 1 addition & 1 deletion src/serialization/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "vitest";
import { describe, expect, it } from "vitest";
import { isErgoPath, pathToArray } from "./utils";

describe("assertions", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/types/attestedBox.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from "@fleet-sdk/common";
import type { UnsignedBox, AttestedBoxFrame } from "./public";
import { ByteWriter } from "../serialization/byteWriter";
import type { AttestedBoxFrame, UnsignedBox } from "./public";

export class AttestedBox {
#box: UnsignedBox;
Expand Down
4 changes: 2 additions & 2 deletions src/types/internal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Buffer } from "buffer";
import type { RETURN_CODE } from "../device";
import type { BoxCandidate, ChangeMap } from "./public";
import type { AttestedBox } from "./attestedBox";
import type { Buffer } from "buffer";
import type { BoxCandidate, ChangeMap } from "./public";

export type DeviceResponse = {
data: Buffer;
Expand Down

0 comments on commit 0ac7571

Please sign in to comment.