
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
@mojaloop/accounts-and-balances-bc-grpc-client-lib
Advanced tools
Accounts and Balances BC - gRPC Client Library
This is the gRPC client library for the Accounts and Balances bounded context.
It allows for the following operations:
$ npm install @mojaloop/accounts-and-balances-bc-grpc-client-lib @mojaloop/logging-bc-client-lib
import {ILogger} from "@mojaloop/logging-bc-public-types-lib";
import {DefaultLogger} from "@mojaloop/logging-bc-client-lib";
import {GrpcClient} from "@mojaloop/accounts-and-balances-bc-grpc-client-lib";
const BOUNDED_CONTEXT_NAME: string = "some-bc";
const SERVICE_NAME: string = "some-svc";
const SERVICE_VERSION: string = "0.0.1";
const ACCOUNTS_AND_BALANCES_GRPC_SERVICE_HOST: string = "localhost";
const ACCOUNTS_AND_BALANCES_GRPC_SERVICE_PORT_NO: number = 5678;
const ACCOUNTS_AND_BALANCES_GRPC_CLIENT_TIMEOUT_MS: number = 5000;
const logger: ILogger = new DefaultLogger(BOUNDED_CONTEXT_NAME, SERVICE_NAME, SERVICE_VERSION);
const grpcClient: GrpcClient = new GrpcClient(
logger,
ACCOUNTS_AND_BALANCES_GRPC_SERVICE_HOST,
ACCOUNTS_AND_BALANCES_GRPC_SERVICE_PORT_NO,
ACCOUNTS_AND_BALANCES_GRPC_CLIENT_TIMEOUT_MS
);
await grpcClient.init();
await grpcClient.destroy();
const accountDto: IAccountDto = {
id: null,
externalId: null,
state: AccountState.ACTIVE,
type: AccountType.POSITION,
currencyCode: "EUR",
currencyDecimals: null,
debitBalance: "0",
creditBalance: "0",
timestampLastJournalEntry: null
};
try {
const accountId: string = await grpcClient.createAccount(accountDto);
} catch (error: unknown) {
logger.error(error);
}
// Before creating a journal entry, the respective accounts need to be created.
// Account A.
const accountDtoA: IAccountDto = {
id: null,
externalId: null,
state: AccountState.ACTIVE,
type: AccountType.POSITION,
currencyCode: "EUR",
currencyDecimals: null,
debitBalance: "0",
creditBalance: "0",
timestampLastJournalEntry: null
};
const idAccountA: string = await grpcClient.createAccount(accountDtoA);
// Account B.
const accountDtoB: IAccountDto = {
id: null,
externalId: null,
state: AccountState.ACTIVE,
type: AccountType.POSITION,
currencyCode: "EUR",
currencyDecimals: null,
debitBalance: "0",
creditBalance: "0",
timestampLastJournalEntry: null
};
const idAccountB: string = await grpcClient.createAccount(accountDtoB);
// TODO: credit accounts A and B with an hub account.
// Journal entry A.
const journalEntryDtoA: IJournalEntryDto = {
id: null,
externalId: null,
externalCategory: null,
currencyCode: "EUR",
currencyDecimals: null,
amount: "5",
debitedAccountId: idAccountA,
creditedAccountId: idAccountB,
timestamp: null
};
// Journal entry B.
const journalEntryDtoB: IJournalEntryDto = {
id: null,
externalId: null,
externalCategory: null,
currencyCode: "EUR",
currencyDecimals: null,
amount: "5",
debitedAccountId: idAccountB,
creditedAccountId: idAccountA,
timestamp: null
};
try {
const idsJournalEntries: string[] = await grpcClient.createJournalEntries([journalEntryDtoA, journalEntryDtoB]);
} catch (error: unknown) {
logger.error(error);
}
const accountId: string = "a";
try {
const accountDto: IAccountDto | null = await grpcClient.getAccountById(accountId);
} catch (error: unknown) {
logger.error(error);
}
const externalId: string = "a";
try {
const accountDtos: IAccountDto[] = await grpcClient.getAccountsByExternalId(externalId);
} catch (error: unknown) {
logger.error(error);
}
const accountId: string = "a";
try {
const journalEntryDtos: IJournalEntryDto[] = await grpcClient.getJournalEntriesByAccountId(accountId);
} catch (error: unknown) {
logger.error(error);
}
FAQs
Accounts and Balances BC - gRPC Client Library
We found that @mojaloop/accounts-and-balances-bc-grpc-client-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Googleâs UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.