@ledgerhq/coin-xrp 7.1.0-nightly.2 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.unimportedrc.json +1 -3
  3. package/CHANGELOG.md +19 -20
  4. package/lib/api/index.d.ts.map +1 -1
  5. package/lib/api/index.js +6 -19
  6. package/lib/api/index.js.map +1 -1
  7. package/lib/api/index.test.js +1 -1
  8. package/lib/api/index.test.js.map +1 -1
  9. package/lib/logic/craftTransaction.d.ts +1 -1
  10. package/lib/logic/craftTransaction.d.ts.map +1 -1
  11. package/lib/logic/craftTransaction.js +1 -1
  12. package/lib/logic/craftTransaction.js.map +1 -1
  13. package/lib/logic/craftTransaction.test.js +2 -2
  14. package/lib/logic/craftTransaction.test.js.map +1 -1
  15. package/lib/logic/estimateFees.d.ts +1 -1
  16. package/lib/logic/estimateFees.d.ts.map +1 -1
  17. package/lib/logic/estimateFees.js +1 -1
  18. package/lib/logic/estimateFees.js.map +1 -1
  19. package/lib/logic/estimateFees.test.js +2 -2
  20. package/lib/logic/estimateFees.test.js.map +1 -1
  21. package/lib/logic/getTransactionStatus.d.ts +2 -3
  22. package/lib/logic/getTransactionStatus.d.ts.map +1 -1
  23. package/lib/logic/getTransactionStatus.js +24 -34
  24. package/lib/logic/getTransactionStatus.js.map +1 -1
  25. package/lib/logic/getTransactionStatus.test.js +27 -108
  26. package/lib/logic/getTransactionStatus.test.js.map +1 -1
  27. package/lib/logic/listOperations.js +4 -4
  28. package/lib/logic/listOperations.js.map +1 -1
  29. package/lib/logic/listOperations.test.js +5 -5
  30. package/lib/logic/listOperations.test.js.map +1 -1
  31. package/lib/test/bridgeDatasetTest.js +4 -4
  32. package/lib/test/bridgeDatasetTest.js.map +1 -1
  33. package/lib/test/cli.js +1 -1
  34. package/lib/test/cli.js.map +1 -1
  35. package/lib/transaction.d.ts +2 -2
  36. package/lib/transaction.d.ts.map +1 -1
  37. package/lib/transaction.js +5 -5
  38. package/lib/transaction.js.map +1 -1
  39. package/lib/types/bridge.d.ts +2 -2
  40. package/lib/types/bridge.d.ts.map +1 -1
  41. package/lib-es/api/index.d.ts.map +1 -1
  42. package/lib-es/api/index.js +6 -19
  43. package/lib-es/api/index.js.map +1 -1
  44. package/lib-es/api/index.test.js +1 -1
  45. package/lib-es/api/index.test.js.map +1 -1
  46. package/lib-es/logic/craftTransaction.d.ts +1 -1
  47. package/lib-es/logic/craftTransaction.d.ts.map +1 -1
  48. package/lib-es/logic/craftTransaction.js +1 -1
  49. package/lib-es/logic/craftTransaction.js.map +1 -1
  50. package/lib-es/logic/craftTransaction.test.js +2 -2
  51. package/lib-es/logic/craftTransaction.test.js.map +1 -1
  52. package/lib-es/logic/estimateFees.d.ts +1 -1
  53. package/lib-es/logic/estimateFees.d.ts.map +1 -1
  54. package/lib-es/logic/estimateFees.js +1 -1
  55. package/lib-es/logic/estimateFees.js.map +1 -1
  56. package/lib-es/logic/estimateFees.test.js +2 -2
  57. package/lib-es/logic/estimateFees.test.js.map +1 -1
  58. package/lib-es/logic/getTransactionStatus.d.ts +2 -3
  59. package/lib-es/logic/getTransactionStatus.d.ts.map +1 -1
  60. package/lib-es/logic/getTransactionStatus.js +24 -34
  61. package/lib-es/logic/getTransactionStatus.js.map +1 -1
  62. package/lib-es/logic/getTransactionStatus.test.js +27 -108
  63. package/lib-es/logic/getTransactionStatus.test.js.map +1 -1
  64. package/lib-es/logic/listOperations.js +4 -4
  65. package/lib-es/logic/listOperations.js.map +1 -1
  66. package/lib-es/logic/listOperations.test.js +5 -5
  67. package/lib-es/logic/listOperations.test.js.map +1 -1
  68. package/lib-es/test/bridgeDatasetTest.js +4 -4
  69. package/lib-es/test/bridgeDatasetTest.js.map +1 -1
  70. package/lib-es/test/cli.js +1 -1
  71. package/lib-es/test/cli.js.map +1 -1
  72. package/lib-es/transaction.d.ts +2 -2
  73. package/lib-es/transaction.d.ts.map +1 -1
  74. package/lib-es/transaction.js +5 -5
  75. package/lib-es/transaction.js.map +1 -1
  76. package/lib-es/types/bridge.d.ts +2 -2
  77. package/lib-es/types/bridge.d.ts.map +1 -1
  78. package/package.json +7 -7
  79. package/src/api/index.test.ts +1 -1
  80. package/src/api/index.ts +9 -20
  81. package/src/logic/craftTransaction.test.ts +2 -2
  82. package/src/logic/craftTransaction.ts +2 -2
  83. package/src/logic/estimateFees.test.ts +2 -2
  84. package/src/logic/estimateFees.ts +2 -2
  85. package/src/logic/getTransactionStatus.test.ts +28 -94
  86. package/src/logic/getTransactionStatus.ts +26 -37
  87. package/src/logic/listOperations.test.ts +5 -5
  88. package/src/logic/listOperations.ts +4 -4
  89. package/src/test/bridgeDatasetTest.ts +4 -4
  90. package/src/test/cli.ts +1 -1
  91. package/src/transaction.ts +5 -5
  92. package/src/types/bridge.ts +2 -2
@@ -1,14 +1,8 @@
1
1
  import { getTransactionStatus } from "./getTransactionStatus";
2
2
  import * as utils from "./utils";
3
3
 
4
- const mockGetBalance = jest.fn();
5
-
6
4
  const mockGetServerInfos = jest.fn();
7
5
 
8
- jest.mock("./getBalance", () => ({
9
- getBalance: () => mockGetBalance(),
10
- }));
11
-
12
6
  jest.mock("../network", () => ({
13
7
  getServerInfos: () => mockGetServerInfos(),
14
8
  }));
@@ -26,9 +20,21 @@ const SENDER = "rPSCfmnX3t9jQJG5RNcZtSaP5UhExZDue4";
26
20
  const RECIPIENT = "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe";
27
21
  const RECIPIENT_NEW = "rDKsbvy9uaNpPtvVFraJyNGfjvTw8xivgK";
28
22
 
23
+ const account = {
24
+ address: SENDER,
25
+ balance: 50_000_000n,
26
+ currencyUnit: {
27
+ code: "XRP",
28
+ magnitude: 6,
29
+ name: "XRP",
30
+ symbol: "XRP",
31
+ },
32
+ currencyName: "XRP",
33
+ };
34
+
29
35
  describe("getTransactionStatus", () => {
30
36
  afterEach(() => {
31
- jest.clearAllMocks();
37
+ mockGetServerInfos.mockReset();
32
38
  });
33
39
 
34
40
  it("returns no errors on valid transaction", async () => {
@@ -39,22 +45,13 @@ describe("getTransactionStatus", () => {
39
45
  },
40
46
  },
41
47
  });
42
- mockGetBalance.mockResolvedValue([
43
- {
44
- value: 50_000_000n,
45
- asset: { type: "native" },
46
- locked: 0n,
47
- },
48
- ]);
49
48
 
50
49
  const result = await getTransactionStatus(
51
- // account as any,
50
+ account as any,
52
51
  {
53
- sender: SENDER,
54
52
  amount: 20_000_000n,
55
- fees: 10_000n,
53
+ fee: 10_000n,
56
54
  recipient: RECIPIENT,
57
- asset: { unit: { code: "XRP", magnitude: 6 } },
58
55
  } as any,
59
56
  );
60
57
 
@@ -71,22 +68,13 @@ describe("getTransactionStatus", () => {
71
68
  },
72
69
  },
73
70
  });
74
- mockGetBalance.mockResolvedValue([
75
- {
76
- value: 50_000_000n,
77
- asset: { type: "native" },
78
- locked: 0n,
79
- },
80
- ]);
81
71
 
82
72
  const result = await getTransactionStatus(
83
- // account as any,
73
+ account as any,
84
74
  {
85
- sender: SENDER,
86
75
  amount: 1_000_000n,
87
- fees: 200_000n, // 20%
76
+ fee: 200_000n, // 20%
88
77
  recipient: RECIPIENT,
89
- asset: { unit: { code: "XRP", magnitude: 6 } },
90
78
  } as any,
91
79
  );
92
80
 
@@ -102,21 +90,12 @@ describe("getTransactionStatus", () => {
102
90
  },
103
91
  },
104
92
  });
105
- mockGetBalance.mockResolvedValue([
106
- {
107
- value: 30_000_000n,
108
- asset: { type: "native" },
109
- locked: 0n,
110
- },
111
- ]);
112
93
 
113
94
  const result = await getTransactionStatus(
114
- // account as any,
95
+ account as any,
115
96
  {
116
- sender: SENDER,
117
97
  amount: 10_000_000n,
118
98
  recipient: RECIPIENT,
119
- asset: { unit: { code: "XRP", magnitude: 6 } },
120
99
  } as any,
121
100
  );
122
101
 
@@ -131,22 +110,13 @@ describe("getTransactionStatus", () => {
131
110
  },
132
111
  },
133
112
  });
134
- mockGetBalance.mockResolvedValue([
135
- {
136
- value: 50_000_000n,
137
- asset: { type: "native" },
138
- locked: 0n,
139
- },
140
- ]);
141
113
 
142
114
  const result = await getTransactionStatus(
143
- // account as any,
115
+ account as any,
144
116
  {
145
- sender: SENDER,
146
117
  amount: 10_000_000n,
147
- fees: 10_000n,
118
+ fee: 10_000n,
148
119
  recipient: SENDER,
149
- asset: { unit: { code: "XRP", magnitude: 6 } },
150
120
  } as any,
151
121
  );
152
122
 
@@ -161,22 +131,13 @@ describe("getTransactionStatus", () => {
161
131
  },
162
132
  },
163
133
  });
164
- mockGetBalance.mockResolvedValue([
165
- {
166
- value: 50_000_000n,
167
- asset: { type: "native" },
168
- locked: 0n,
169
- },
170
- ]);
171
134
 
172
135
  const result = await getTransactionStatus(
173
- // account as any,
136
+ account as any,
174
137
  {
175
- sender: SENDER,
176
138
  amount: 5_000_000n,
177
- fees: 10_000n,
139
+ fee: 10_000n,
178
140
  recipient: RECIPIENT_NEW,
179
- asset: { unit: { code: "XRP", magnitude: 6 } },
180
141
  } as any,
181
142
  );
182
143
 
@@ -191,22 +152,13 @@ describe("getTransactionStatus", () => {
191
152
  },
192
153
  },
193
154
  });
194
- mockGetBalance.mockResolvedValue([
195
- {
196
- value: 50_000_000n,
197
- asset: { type: "native" },
198
- locked: 0n,
199
- },
200
- ]);
201
155
 
202
156
  const result = await getTransactionStatus(
203
- // account as any,
157
+ account as any,
204
158
  {
205
- sender: SENDER,
206
159
  amount: 0n,
207
- fees: 10_000n,
160
+ fee: 10_000n,
208
161
  recipient: RECIPIENT,
209
- asset: { unit: { code: "XRP", magnitude: 6 } },
210
162
  } as any,
211
163
  );
212
164
 
@@ -221,21 +173,12 @@ describe("getTransactionStatus", () => {
221
173
  },
222
174
  },
223
175
  });
224
- mockGetBalance.mockResolvedValue([
225
- {
226
- value: 50_000_000n,
227
- asset: { type: "native" },
228
- locked: 0n,
229
- },
230
- ]);
231
176
 
232
177
  const result = await getTransactionStatus(
233
- // account as any,
178
+ account as any,
234
179
  {
235
- sender: SENDER,
236
- asset: { unit: { code: "XRP", magnitude: 6 } },
237
180
  amount: 1_000_000n,
238
- fees: 10_000n,
181
+ fee: 10_000n,
239
182
  recipient: "not-an-address",
240
183
  } as any,
241
184
  );
@@ -251,21 +194,12 @@ describe("getTransactionStatus", () => {
251
194
  },
252
195
  },
253
196
  });
254
- mockGetBalance.mockResolvedValue([
255
- {
256
- value: 50_000_000n,
257
- asset: { type: "native" },
258
- locked: 0n,
259
- },
260
- ]);
261
197
 
262
198
  const result = await getTransactionStatus(
263
- // account as any,
199
+ account as any,
264
200
  {
265
- sender: SENDER,
266
- asset: { unit: { code: "XRP", magnitude: 6 } },
267
201
  amount: 1_000_000n,
268
- fees: 10_000n,
202
+ fee: 10_000n,
269
203
  recipient: "",
270
204
  } as any,
271
205
  );
@@ -14,12 +14,11 @@ import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index";
14
14
  import { getServerInfos } from "../network";
15
15
  import { cachedRecipientIsNew } from "./utils";
16
16
  import { parseAPIValue } from "./common";
17
- import { TransactionValidation, TransactionIntent } from "@ledgerhq/coin-framework/api/types";
18
- import { XrpMapMemo } from "../types";
19
- import { getBalance } from "./getBalance";
17
+ import { Transaction, TransactionValidation, Account } from "@ledgerhq/coin-framework/api/types";
20
18
 
21
19
  export const getTransactionStatus = async (
22
- transactionIntent: TransactionIntent<XrpMapMemo>,
20
+ account: Account,
21
+ transaction: Transaction,
23
22
  ): Promise<TransactionValidation> => {
24
23
  const errors: Record<string, Error> = {};
25
24
  const warnings: Record<string, Error> = {};
@@ -27,57 +26,47 @@ export const getTransactionStatus = async (
27
26
  const reserveBaseXRP = parseAPIValue(
28
27
  serverInfos.info.validated_ledger.reserve_base_xrp.toString(),
29
28
  );
30
- const estimatedFees = transactionIntent.fees || 0n;
31
- const totalSpent = transactionIntent.amount + estimatedFees;
32
- const amount = transactionIntent.amount;
29
+ const estimatedFees = transaction.fee || 0n;
30
+ const totalSpent = transaction.amount + estimatedFees;
31
+ const amount = transaction.amount;
33
32
 
34
33
  if (amount > 0 && estimatedFees * 10n > amount) {
35
34
  warnings.feeTooHigh = new FeeTooHigh();
36
35
  }
37
36
 
38
- const balances = await getBalance(transactionIntent.sender);
39
- const nativeBalance = balances.find(b => b.asset.type === "native");
40
- if (nativeBalance === undefined) {
41
- throw Error("Shouldn't happen");
42
- }
43
-
44
- if (!transactionIntent.fees) {
37
+ if (!transaction.fee) {
45
38
  errors.fee = new FeeNotLoaded();
46
- } else if (transactionIntent.fees == 0n) {
39
+ } else if (transaction.fee == 0n) {
47
40
  errors.fee = new FeeRequired();
48
- } else if (totalSpent > nativeBalance.value - BigInt(reserveBaseXRP.toString())) {
41
+ } else if (totalSpent > account.balance - BigInt(reserveBaseXRP.toString())) {
49
42
  errors.amount = new NotEnoughSpendableBalance("", {
50
- minimumAmount: transactionIntent.asset.unit
51
- ? formatCurrencyUnit(transactionIntent.asset.unit, reserveBaseXRP, {
52
- disableRounding: true,
53
- useGrouping: false,
54
- showCode: true,
55
- })
56
- : "Unknown unit",
43
+ minimumAmount: formatCurrencyUnit(account.currencyUnit, reserveBaseXRP, {
44
+ disableRounding: true,
45
+ useGrouping: false,
46
+ showCode: true,
47
+ }),
57
48
  });
58
49
  } else if (
59
- transactionIntent.recipient &&
60
- (await cachedRecipientIsNew(transactionIntent.recipient)) &&
61
- transactionIntent.amount < BigInt(reserveBaseXRP.toString())
50
+ transaction.recipient &&
51
+ (await cachedRecipientIsNew(transaction.recipient)) &&
52
+ transaction.amount < BigInt(reserveBaseXRP.toString())
62
53
  ) {
63
54
  errors.amount = new NotEnoughBalanceBecauseDestinationNotCreated("", {
64
- minimalAmount: transactionIntent.asset.unit
65
- ? formatCurrencyUnit(transactionIntent.asset.unit, reserveBaseXRP, {
66
- disableRounding: true,
67
- useGrouping: false,
68
- showCode: true,
69
- })
70
- : "Unknown unit",
55
+ minimalAmount: formatCurrencyUnit(account.currencyUnit, reserveBaseXRP, {
56
+ disableRounding: true,
57
+ useGrouping: false,
58
+ showCode: true,
59
+ }),
71
60
  });
72
61
  }
73
62
 
74
- if (!transactionIntent.recipient) {
63
+ if (!transaction.recipient) {
75
64
  errors.recipient = new RecipientRequired("");
76
- } else if (transactionIntent.sender === transactionIntent.recipient) {
65
+ } else if (account.address === transaction.recipient) {
77
66
  errors.recipient = new InvalidAddressBecauseDestinationIsAlsoSource();
78
- } else if (!isValidClassicAddress(transactionIntent.recipient)) {
67
+ } else if (!isValidClassicAddress(transaction.recipient)) {
79
68
  errors.recipient = new InvalidAddress("", {
80
- currencyName: transactionIntent.asset.name ?? "",
69
+ currencyName: account.currencyName,
81
70
  });
82
71
  }
83
72
 
@@ -146,7 +146,7 @@ describe("listOperations", () => {
146
146
  async ({ address, opSender, opDestination, expectedType }) => {
147
147
  // Given
148
148
  const deliveredAmount = 100;
149
- const fees = 10;
149
+ const fee = 10;
150
150
  mockNetworkGetTransactions.mockResolvedValue(
151
151
  mockNetworkTxs([
152
152
  {
@@ -156,7 +156,7 @@ describe("listOperations", () => {
156
156
  meta: { delivered_amount: deliveredAmount.toString() },
157
157
  tx_json: {
158
158
  TransactionType: "Payment",
159
- Fee: fees.toString(),
159
+ Fee: fee.toString(),
160
160
  ledger_index: 1,
161
161
  date: 1000,
162
162
  Account: opSender,
@@ -172,7 +172,7 @@ describe("listOperations", () => {
172
172
  meta: { delivered_amount: deliveredAmount.toString() },
173
173
  tx_json: {
174
174
  TransactionType: "Payment",
175
- Fee: fees.toString(),
175
+ Fee: fee.toString(),
176
176
  ledger_index: 1,
177
177
  date: 1000,
178
178
  Account: opSender,
@@ -189,7 +189,7 @@ describe("listOperations", () => {
189
189
  meta: { delivered_amount: deliveredAmount.toString() },
190
190
  tx_json: {
191
191
  TransactionType: "Payment",
192
- Fee: fees.toString(),
192
+ Fee: fee.toString(),
193
193
  ledger_index: 1,
194
194
  date: 1000,
195
195
  Account: opSender,
@@ -217,7 +217,7 @@ describe("listOperations", () => {
217
217
  expect(mockNetworkGetTransactions).toHaveBeenCalledTimes(1);
218
218
  // if expectedType is "OUT", compute value with fees (i.e. delivered_amount + Fee)
219
219
  const expectedValue =
220
- expectedType === "IN" ? BigInt(deliveredAmount) : BigInt(deliveredAmount + fees);
220
+ expectedType === "IN" ? BigInt(deliveredAmount) : BigInt(deliveredAmount + fee);
221
221
  expect(results).toEqual([
222
222
  {
223
223
  id: "HASH_VALUE",
@@ -125,10 +125,10 @@ const convertToCoreOperation =
125
125
  ? BigInt(delivered_amount)
126
126
  : BigInt(0);
127
127
 
128
- const fees = BigInt(Fee);
128
+ const fee = BigInt(Fee);
129
129
  if (type === "OUT") {
130
- if (!Number.isNaN(fees)) {
131
- value = value + fees;
130
+ if (!Number.isNaN(fee)) {
131
+ value = value + fee;
132
132
  }
133
133
  }
134
134
 
@@ -170,7 +170,7 @@ const convertToCoreOperation =
170
170
  asset: { type: "native" },
171
171
  tx: {
172
172
  hash: hash,
173
- fees: fees,
173
+ fees: fee,
174
174
  date: new Date(toEpochDate),
175
175
  block: {
176
176
  time: new Date(close_time_iso),
@@ -40,7 +40,7 @@ export const dataset: DatasetTest<Transaction> = {
40
40
  recipient: "rB6pwovsyrFWhPYUsjj9V3CHck985QjiXi",
41
41
  amount: "15000000",
42
42
  tag: null,
43
- fees: "1",
43
+ fee: "1",
44
44
  feeCustomUnit: null,
45
45
  networkInfo: null,
46
46
  }),
@@ -75,7 +75,7 @@ export const dataset: DatasetTest<Transaction> = {
75
75
  recipient: newAddress1,
76
76
  amount: "10000000",
77
77
  tag: null,
78
- fees: "1",
78
+ fee: "1",
79
79
  feeCustomUnit: null,
80
80
  networkInfo: null
81
81
  }),
@@ -97,7 +97,7 @@ export const dataset: DatasetTest<Transaction> = {
97
97
  recipient: "rageXHB6Q4VbvvWdTzKANwjeCT4HXFCKX7",
98
98
  amount: "10000000",
99
99
  tag: null,
100
- fees: "10", // NOTE: fee is not customizable, this field is ignored
100
+ fee: "10", // NOTE: fee is not customizable, this field is ignored
101
101
  feeCustomUnit: null,
102
102
  networkInfo: null,
103
103
  }),
@@ -118,7 +118,7 @@ export const dataset: DatasetTest<Transaction> = {
118
118
  recipient: "rB6pwovsyrFWhPYUsjj9V3CHck985QjiXi",
119
119
  amount: "10000000",
120
120
  tag: 12345,
121
- fees: "10", // NOTE: fee is not customizable, this field is ignored
121
+ fee: "10", // NOTE: fee is not customizable, this field is ignored
122
122
  feeCustomUnit: null,
123
123
  networkInfo: null,
124
124
  }),
package/src/test/cli.ts CHANGED
@@ -30,7 +30,7 @@ function inferTransactions(
30
30
  invariant(transaction.family === "xrp", "XRP family");
31
31
  return {
32
32
  ...transaction,
33
- fees: inferAmount(account, opts.fee || "0.001xrp"),
33
+ fee: inferAmount(account, opts.fee || "0.001xrp"),
34
34
  tag: opts.tag,
35
35
  };
36
36
  });
@@ -12,7 +12,7 @@ import { getAccountCurrency } from "@ledgerhq/coin-framework/account/index";
12
12
  import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index";
13
13
 
14
14
  export const formatTransaction = (
15
- { amount, recipient, fees, tag, useAllAmount }: Transaction,
15
+ { amount, recipient, fee, tag, useAllAmount }: Transaction,
16
16
  account: Account,
17
17
  ): string => `
18
18
  SEND ${
@@ -25,9 +25,9 @@ SEND ${
25
25
  }
26
26
  TO ${recipient}
27
27
  with fee=${
28
- !fees
28
+ !fee
29
29
  ? "?"
30
- : formatCurrencyUnit(getAccountCurrency(account).units[0], fees, {
30
+ : formatCurrencyUnit(getAccountCurrency(account).units[0], fee, {
31
31
  showCode: true,
32
32
  disableRounding: true,
33
33
  })
@@ -40,7 +40,7 @@ export const fromTransactionRaw = (tr: TransactionRaw): Transaction => {
40
40
  ...common,
41
41
  family: tr.family,
42
42
  tag: tr.tag,
43
- fees: tr.fees ? new BigNumber(tr.fees) : null,
43
+ fee: tr.fee ? new BigNumber(tr.fee) : null,
44
44
  feeCustomUnit: tr.feeCustomUnit,
45
45
  // FIXME remove this field. this is not good.. we're dereferencing here. we should instead store an index (to lookup in currency.units on UI)
46
46
  networkInfo: networkInfo && {
@@ -58,7 +58,7 @@ export const toTransactionRaw = (t: Transaction): TransactionRaw => {
58
58
  ...common,
59
59
  family: t.family,
60
60
  tag: t.tag,
61
- fees: t.fees ? t.fees.toString() : null,
61
+ fee: t.fee ? t.fee.toString() : null,
62
62
  feeCustomUnit: t.feeCustomUnit,
63
63
  // FIXME remove this field. this is not good.. we're dereferencing here. we should instead store an index (to lookup in currency.units on UI)
64
64
  networkInfo: networkInfo && {
@@ -21,7 +21,7 @@ export type NetworkInfoRaw = {
21
21
 
22
22
  export type Transaction = TransactionCommon & {
23
23
  family: "xrp";
24
- fees: BigNumber | null | undefined;
24
+ fee: BigNumber | null | undefined;
25
25
  networkInfo: NetworkInfo | null | undefined;
26
26
  tag: number | null | undefined;
27
27
  feeCustomUnit: Unit | null | undefined;
@@ -29,7 +29,7 @@ export type Transaction = TransactionCommon & {
29
29
 
30
30
  export type TransactionRaw = TransactionCommonRaw & {
31
31
  family: "xrp";
32
- fees: string | null | undefined;
32
+ fee: string | null | undefined;
33
33
  networkInfo: NetworkInfoRaw | null | undefined;
34
34
  tag: number | null | undefined;
35
35
  feeCustomUnit: Unit | null | undefined;