diff --git a/libs/coin-modules/coin-module-boilerplate/package.json b/libs/coin-modules/coin-module-boilerplate/package.json index 8c272d2b07eb..38e36e0de5dd 100644 --- a/libs/coin-modules/coin-module-boilerplate/package.json +++ b/libs/coin-modules/coin-module-boilerplate/package.json @@ -122,7 +122,7 @@ "scripts": { "clean": "rimraf lib lib-es", "build": "tsc && tsc -m ES6 --outDir lib-es", - "coverage": "jest --coverage --testPathIgnorePatterns='/bridge.integration.test.ts|node_modules|lib-es|lib/' --passWithNoTests && mv coverage/coverage-final.json coverage/coverage-xrp.json", + "coverage": "jest --coverage --testPathIgnorePatterns='/bridge.integration.test.ts|node_modules|lib-es|lib/' --passWithNoTests && mv coverage/coverage-final.json coverage/coverage-boilerplate.json", "prewatch": "pnpm build", "watch": "tsc --watch", "doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts", diff --git a/libs/coin-modules/coin-module-boilerplate/src/bridge/sync.ts b/libs/coin-modules/coin-module-boilerplate/src/bridge/sync.ts index fffe37665760..3ed2bd268721 100644 --- a/libs/coin-modules/coin-module-boilerplate/src/bridge/sync.ts +++ b/libs/coin-modules/coin-module-boilerplate/src/bridge/sync.ts @@ -6,7 +6,7 @@ import { getTransactions } from "../network/indexer"; import { getAccountInfo, getBlockHeight } from "../network/node"; import { encodeOperationId } from "@ledgerhq/coin-framework/operation"; -import { XrplOperation } from "../network/types"; +import { BoilerplateOperation } from "../network/types"; import coinConfig from "../config"; const operationAdapter = @@ -14,7 +14,7 @@ const operationAdapter = ({ meta: { delivered_amount }, tx: { Fee, hash, inLedger, date, Account, Destination, Sequence }, - }: XrplOperation) => { + }: BoilerplateOperation) => { const type = Account === address ? "OUT" : "IN"; let value = delivered_amount && typeof delivered_amount === "string" @@ -47,10 +47,14 @@ const operationAdapter = return op; }; -const filterOperations = (transactions: XrplOperation[], accountId: string, address: string) => { +const filterOperations = ( + transactions: BoilerplateOperation[], + accountId: string, + address: string, +) => { return transactions .filter( - ({ tx, meta }: XrplOperation) => + ({ tx, meta }: BoilerplateOperation) => tx.TransactionType === "Payment" && typeof meta.delivered_amount === "string", ) .map(operationAdapter(accountId, address)) diff --git a/libs/coin-modules/coin-module-boilerplate/src/network/types.ts b/libs/coin-modules/coin-module-boilerplate/src/network/types.ts index e21c0480c138..e8b98b331e8b 100644 --- a/libs/coin-modules/coin-module-boilerplate/src/network/types.ts +++ b/libs/coin-modules/coin-module-boilerplate/src/network/types.ts @@ -1,4 +1,4 @@ -export type XrplOperation = { +export type BoilerplateOperation = { meta: { AffectedNodes: { ModifiedNode: { @@ -80,7 +80,6 @@ export type AccountInfoResponse = { disallowIncomingNFTokenOffer: boolean; disallowIncomingPayChan: boolean; disallowIncomingTrustline: boolean; - disallowIncomingXRP: boolean; globalFreeze: boolean; noFreeze: boolean; passwordSpent: boolean; @@ -129,10 +128,8 @@ export type ServerInfoResponse = { uptime: number; validated_ledger: { age: number; - base_fee_xrp: number; + base_fee: number; hash: string; - reserve_base_xrp: number; - reserve_inc_xrp: number; seq: number; }; validation_quorum: number; @@ -141,7 +138,7 @@ export type ServerInfoResponse = { export type AccountTxResponse = { account: string; - transactions: XrplOperation[]; + transactions: BoilerplateOperation[]; } & ResponseStatus; export type LedgerResponse = { diff --git a/libs/coin-modules/coin-module-boilerplate/src/test/bot-specs.ts b/libs/coin-modules/coin-module-boilerplate/src/test/bot-specs.ts index 7f474ede9155..2ad9893437ce 100644 --- a/libs/coin-modules/coin-module-boilerplate/src/test/bot-specs.ts +++ b/libs/coin-modules/coin-module-boilerplate/src/test/bot-specs.ts @@ -12,12 +12,12 @@ const currency = getCryptoCurrencyById("ripple"); const minAmountCutoff = parseCurrencyUnit(currency.units[0], "0.1"); const reserve = parseCurrencyUnit(currency.units[0], "20"); -const xrp: AppSpec = { - name: "XRP", +const boilerplateSpec: AppSpec = { + name: "BOILERPLATE", currency, appQuery: { model: DeviceModelId.nanoS, - appName: "XRP", + appName: "BOILERPLATE_APP_NAME", }, genericDeviceAction: acceptTransaction, minViableAmount: minAmountCutoff, @@ -69,5 +69,5 @@ const xrp: AppSpec = { ], }; export default { - xrp, + boilerplateSpec, };