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

@synonymdev/blocktank-lsp-http-client

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synonymdev/blocktank-lsp-http-client - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

src/BlocktankClient.spec.ts

4

CHANGELOG.md
# Changelog
## 0.2.0 - 28.07.2023
- (feat) Added `getMin0ConfTxFee` method.
## 0.1.0 - 13.07.2023
- (enhance) Initial release

@@ -56,3 +56,15 @@ import { IBtInfo, IBtOrder } from './shared';

getOrders(orderIds: string[]): Promise<IBtOrder[]>;
/**
* Open channel to a specific node.
* @param orderId
* @param connectionStringOrPubkey
* @param announceChannel
* @returns
*/
openChannel(orderId: string, connectionStringOrPubkey: string, announceChannel: boolean): Promise<IBtOrder>;
getMin0ConfTxFee(orderId: string): Promise<{
id: string;
validityEndsAt: string;
satPerVByte: number;
}>;
}

@@ -99,2 +99,9 @@ "use strict";

}
/**
* Open channel to a specific node.
* @param orderId
* @param connectionStringOrPubkey
* @param announceChannel
* @returns
*/
async openChannel(orderId, connectionStringOrPubkey, announceChannel) {

@@ -109,4 +116,11 @@ return await this.wrapErrorHandler(`Failed to open the channel for order ${orderId}.`, async () => {

}
async getMin0ConfTxFee(orderId) {
const window = await this.wrapErrorHandler(`Failed to fetch order ${orderId}.`, async () => {
const response = await axios_1.default.get(this.baseUrl + '/channels/' + orderId + '/min-0conf-tx-fee');
return response.data;
});
return window;
}
}
exports.BlocktankClient = BlocktankClient;
//# sourceMappingURL=BlocktankClient.js.map

@@ -10,2 +10,3 @@ import { IBtChannel } from "./IBtChannel";

clientBalanceSat: number;
zeroConf: boolean;
channelExpiryWeeks: number;

@@ -12,0 +13,0 @@ channelExpiresAt: Date;

2

package.json
{
"name": "@synonymdev/blocktank-lsp-http-client",
"version": "0.1.0",
"version": "0.2.0",
"description": "Blocktank Http Api Client",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -24,2 +24,5 @@ # blocktank-lsp-http-client

const expected0ConfFee = await client.getMin0ConfTxFee(order.id)
console.log(`Onchain payments that should be accepted as 0conf need to have a minimal fee of ${expected0ConfFee.satVByte}sat/vbyte.`)
// Check order status

@@ -26,0 +29,0 @@ const updatedOrder = await client.getOrder(order.id)

@@ -114,2 +114,9 @@ import axios from 'axios';

/**
* Open channel to a specific node.
* @param orderId
* @param connectionStringOrPubkey
* @param announceChannel
* @returns
*/
async openChannel(orderId: string, connectionStringOrPubkey: string, announceChannel: boolean): Promise<IBtOrder> {

@@ -125,5 +132,11 @@ return await this.wrapErrorHandler(`Failed to open the channel for order ${orderId}.`, async () => {

async getMin0ConfTxFee(orderId: string): Promise<{id: string, validityEndsAt: string, satPerVByte: number}> {
const window = await this.wrapErrorHandler(`Failed to fetch order ${orderId}.`, async () => {
const response = await axios.get(this.baseUrl + '/channels/' + orderId + '/min-0conf-tx-fee')
return response.data;
})
return window
}
}

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