Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coinbase/coinbase-sdk

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coinbase/coinbase-sdk - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

7

dist/coinbase/balance.d.ts

@@ -33,9 +33,2 @@ import Decimal from "decimal.js";

static fromModelAndAssetId(model: BalanceModel, assetId: string): Balance;
/**
* Converts a BalanceModel of which the amount is in the most common denomination such as ETH, BTC, etc.
*
* @param {BalanceModel} model - The balance model object.
* @returns {Balance} The Balance object.
*/
static fromModelWithAmountInWholeUnits(model: BalanceModel): Balance;
}

@@ -45,13 +45,3 @@ "use strict";

}
/**
* Converts a BalanceModel of which the amount is in the most common denomination such as ETH, BTC, etc.
*
* @param {BalanceModel} model - The balance model object.
* @returns {Balance} The Balance object.
*/
static fromModelWithAmountInWholeUnits(model) {
const asset = asset_1.Asset.fromModel(model.asset);
return new Balance(new decimal_js_1.default(model.amount), asset.getAssetId(), asset);
}
}
exports.Balance = Balance;

4

dist/coinbase/staking_balance.js

@@ -51,3 +51,3 @@ "use strict";

bondedStake() {
return balance_1.Balance.fromModelWithAmountInWholeUnits(this.model.bonded_stake);
return balance_1.Balance.fromModel(this.model.bonded_stake);
}

@@ -60,3 +60,3 @@ /**

unbondedBalance() {
return balance_1.Balance.fromModelWithAmountInWholeUnits(this.model.unbonded_balance);
return balance_1.Balance.fromModel(this.model.unbonded_balance);
}

@@ -63,0 +63,0 @@ /**

@@ -45,21 +45,2 @@ "use strict";

});
describe(".fromModelWithAmountInWholeUnits", () => {
const amount = new decimal_js_1.Decimal(32);
const balanceModel = {
asset: {
asset_id: coinbase_1.Coinbase.assets.Eth,
network_id: coinbase_1.Coinbase.networks.BaseSepolia,
decimals: 18,
contract_address: "0x",
},
amount: "32",
};
const balance = balance_1.Balance.fromModelWithAmountInWholeUnits(balanceModel);
it("returns a new Balance object with the correct amount", () => {
expect(balance.amount).toEqual(amount);
});
it("returns a new Balance object with the correct asset_id", () => {
expect(balance.assetId).toBe(coinbase_1.Coinbase.assets.Eth);
});
});
});

@@ -18,7 +18,7 @@ "use strict";

const bondedStake = {
amount: "32",
amount: "32000000000000000000",
asset: asset,
};
const unbondedBalance = {
amount: "2",
amount: "2000000000000000000",
asset: asset,

@@ -25,0 +25,0 @@ };

@@ -279,3 +279,3 @@ "use strict";

bonded_stake: {
amount: "32",
amount: "32000000000000000000",
asset: {

@@ -288,3 +288,3 @@ asset_id: coinbase_1.Coinbase.assets.Eth,

unbonded_balance: {
amount: "2",
amount: "2000000000000000000",
asset: {

@@ -302,3 +302,3 @@ asset_id: coinbase_1.Coinbase.assets.Eth,

bonded_stake: {
amount: "34",
amount: "34000000000000000000",
asset: {

@@ -311,3 +311,3 @@ asset_id: coinbase_1.Coinbase.assets.Eth,

unbonded_balance: {
amount: "3",
amount: "3000000000000000000",
asset: {

@@ -314,0 +314,0 @@ asset_id: coinbase_1.Coinbase.assets.Eth,

@@ -187,3 +187,3 @@ "use strict";

bonded_stake: {
amount: "32",
amount: "32000000000000000000",
asset: {

@@ -196,3 +196,3 @@ asset_id: coinbase_1.Coinbase.assets.Eth,

unbonded_balance: {
amount: "2",
amount: "2000000000000000000",
asset: {

@@ -210,3 +210,3 @@ asset_id: coinbase_1.Coinbase.assets.Eth,

bonded_stake: {
amount: "32",
amount: "32000000000000000000",
asset: {

@@ -219,3 +219,3 @@ asset_id: coinbase_1.Coinbase.assets.Eth,

unbonded_balance: {
amount: "2",
amount: "2000000000000000000",
asset: {

@@ -222,0 +222,0 @@ asset_id: coinbase_1.Coinbase.assets.Eth,

@@ -7,3 +7,3 @@ {

"repository": "https://github.com/coinbase/coinbase-sdk-nodejs",
"version": "0.1.0",
"version": "0.1.1",
"main": "dist/index.js",

@@ -10,0 +10,0 @@ "types": "dist/index.d.ts",

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