diff --git a/packages/app/.eslintignore b/packages/app/.eslintignore new file mode 100644 index 0000000000..53c37a1660 --- /dev/null +++ b/packages/app/.eslintignore @@ -0,0 +1 @@ +dist \ No newline at end of file diff --git a/packages/app/src/composables/useTransfers.ts b/packages/app/src/composables/useTransfers.ts index c0e0e1013d..f86d46b542 100644 --- a/packages/app/src/composables/useTransfers.ts +++ b/packages/app/src/composables/useTransfers.ts @@ -18,6 +18,13 @@ export default (address: ComputedRef, context = useContext()) => { ), (transfer: Api.Response.Transfer): Transfer => ({ ...transfer, + token: transfer.token || { + l2Address: transfer.tokenAddress, + l1Address: null, + name: null, + symbol: null, + decimals: 0, + }, fromNetwork: transfer.type === "deposit" ? "L1" : "L2", toNetwork: transfer.type === "withdrawal" ? "L1" : "L2", }) diff --git a/packages/app/tests/composables/useTransfers.spec.ts b/packages/app/tests/composables/useTransfers.spec.ts index fea42ad1ac..11a1f1f11a 100644 --- a/packages/app/tests/composables/useTransfers.spec.ts +++ b/packages/app/tests/composables/useTransfers.spec.ts @@ -30,11 +30,12 @@ vi.mock("ohmyfetch", () => { Promise.resolve({ items: [ { ...baseTransferPayload, type: "transfer" }, + { ...baseTransferPayload, token: null, type: "transfer" }, { ...baseTransferPayload, type: "deposit" }, { ...baseTransferPayload, type: "withdrawal" }, ], meta: { - totalItems: 3, + totalItems: 4, page: 1, pageSize: 10, totalPages: 1, @@ -73,7 +74,7 @@ describe("useTransfers:", () => { const composable = useTransfers(address); await composable.load(1); const transfers = composable.data.value; - expect(composable.data.value?.length).toBe(3); + expect(composable.data.value?.length).toBe(4); expect(transfers).toEqual([ { ...baseTransferPayload, @@ -81,6 +82,19 @@ describe("useTransfers:", () => { fromNetwork: "L2", toNetwork: "L2", }, + { + ...baseTransferPayload, + token: { + decimals: 0, + l1Address: null, + l2Address: "tokenAddress", + name: null, + symbol: null, + }, + type: "transfer", + fromNetwork: "L2", + toNetwork: "L2", + }, { ...baseTransferPayload, type: "deposit",