New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@avalabs/bitcoin-module

Package Overview
Dependencies
Maintainers
0
Versions
378
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@avalabs/bitcoin-module - npm Package Compare versions

Comparing version 0.0.19 to 0.0.20

src/handlers/get-balances/get-balances.test.ts

8

CHANGELOG.md
# @avalabs/bitcoin-module
## 0.0.20
### Patch Changes
- 9bfa82d: Implement balance fetching for BitcoinModule
- Updated dependencies [9bfa82d]
- @avalabs/vm-module-types@0.0.20
## 0.0.19

@@ -4,0 +12,0 @@

5

dist/index.d.ts
import * as _metamask_rpc_errors from '@metamask/rpc-errors';
import * as _avalabs_vm_module_types_dist_transaction_history from '@avalabs/vm-module-types/dist/transaction-history';
import { Module, Environment, Manifest, Network, NetworkFees, GetTransactionHistory, RpcRequest } from '@avalabs/vm-module-types';
import * as _avalabs_vm_module_types_dist_balance from '@avalabs/vm-module-types/dist/balance';
import { Module, Environment, GetBalancesParams, Manifest, Network, NetworkFees, GetTransactionHistory, RpcRequest } from '@avalabs/vm-module-types';

@@ -11,3 +12,3 @@ declare class BitcoinModule implements Module {

getAddress(): Promise<string>;
getBalances(): Promise<{}>;
getBalances({ addresses, currency, network, storage }: GetBalancesParams): Promise<_avalabs_vm_module_types_dist_balance.GetBalancesResponse>;
getManifest(): Manifest | undefined;

@@ -14,0 +15,0 @@ getNetworkFee(network: Network): Promise<NetworkFees>;

14

package.json
{
"name": "@avalabs/bitcoin-module",
"version": "0.0.19",
"version": "0.0.20",
"main": "dist/index.cjs",

@@ -9,7 +9,13 @@ "module": "dist/index.js",

"dependencies": {
"@avalabs/vm-module-types": "0.0.19",
"@avalabs/wallets-sdk": "2.8.0-alpha.188",
"@metamask/rpc-errors": "6.3.0"
"@avalabs/vm-module-types": "0.0.20",
"@avalabs/wallets-sdk": "2.8.0-alpha.193",
"@avalabs/coingecko-sdk": "v2.8.0-alpha.193",
"@avalabs/utils-sdk": "2.8.0-alpha.193",
"@metamask/rpc-errors": "6.3.0",
"big.js": "6.2.1",
"bn.js": "5.2.1"
},
"devDependencies": {
"@types/big.js": "6.2.2",
"@types/bn.js": "5.1.5",
"@types/jest": "29.5.7",

@@ -16,0 +22,0 @@ "jest": "29.7.0",

@@ -5,5 +5,7 @@ import { Environment, type Network } from '@avalabs/vm-module-types';

import { getNetworkFee } from './handlers/get-network-fee';
import { getBalances } from './handlers/get-balances';
import { devEnv, prodEnv } from './env';
jest.mock('./handlers/get-network-fee');
jest.mock('./handlers/get-balances');

@@ -30,2 +32,28 @@ describe('bitcoin-module', () => {

});
describe('getBalances()', () => {
it('uses the get-balances handler', async () => {
const params = {
network: { isTestnet: true } as Network,
addresses: ['address-1'],
currency: 'USD',
};
const devModule = new BitcoinModule({ environment: Environment.DEV });
await devModule.getBalances(params);
expect(getBalances).toHaveBeenCalledWith({
...params,
proxyApiUrl: devEnv.proxyApiUrl,
});
const prodModule = new BitcoinModule({ environment: Environment.PRODUCTION });
await prodModule.getBalances(params);
expect(getBalances).toHaveBeenCalledWith({
...params,
proxyApiUrl: prodEnv.proxyApiUrl,
});
});
});
});

@@ -9,2 +9,3 @@ import type {

Environment,
GetBalancesParams,
} from '@avalabs/vm-module-types';

@@ -18,2 +19,3 @@ import { parseManifest } from '@avalabs/vm-module-types';

import { getTransactionHistory } from './handlers/get-transaction-history';
import { getBalances } from './handlers/get-balances';

@@ -32,4 +34,10 @@ export class BitcoinModule implements Module {

getBalances() {
return Promise.resolve({});
getBalances({ addresses, currency, network, storage }: GetBalancesParams) {
return getBalances({
addresses,
currency,
network,
proxyApiUrl: this.#proxyApiUrl,
storage,
});
}

@@ -36,0 +44,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc