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

@node-dlc/messaging

Package Overview
Dependencies
Maintainers
3
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-dlc/messaging - npm Package Compare versions

Comparing version 0.23.2 to 0.23.3

.nyc_output/6866ee3c-078d-4c12-a387-5b58becbb427.json

26

__tests__/messages/DlcAcceptV0.spec.ts

@@ -5,3 +5,7 @@ import { BitcoinNetworks } from 'bitcoin-networks';

import { CetAdaptorSignaturesV0 } from '../../lib/messages/CetAdaptorSignaturesV0';
import { DlcAccept, DlcAcceptV0 } from '../../lib/messages/DlcAccept';
import {
DlcAccept,
DlcAcceptContainer,
DlcAcceptV0,
} from '../../lib/messages/DlcAccept';
import { FundingInputV0 } from '../../lib/messages/FundingInput';

@@ -118,3 +122,3 @@ import { NegotiationFields } from '../../lib/messages/NegotiationFields';

it('should throw if incorrect type', () => {
instance.type = 0x123;
instance.type = 0x123 as MessageType;
expect(function () {

@@ -292,2 +296,20 @@ DlcAccept.deserialize(instance.serialize());

});
describe('DlcAcceptContainer', () => {
it('should serialize and deserialize', () => {
const dlcAccept = DlcAcceptV0.deserialize(dlcAcceptHex);
// swap payout and change spk to differentiate between dlcaccepts
const dlcAccept2 = DlcAcceptV0.deserialize(dlcAcceptHex);
dlcAccept2.payoutSPK = dlcAccept.changeSPK;
dlcAccept2.changeSPK = dlcAccept.payoutSPK;
const container = new DlcAcceptContainer();
container.addAccept(dlcAccept);
container.addAccept(dlcAccept2);
const instance = DlcAcceptContainer.deserialize(container.serialize());
expect(container.serialize()).to.deep.equal(instance.serialize());
});
});
});

@@ -8,2 +8,3 @@ import { BitcoinNetworks } from 'bitcoin-networks';

DlcOffer,
DlcOfferContainer,
DlcOfferV0,

@@ -143,3 +144,3 @@ LOCKTIME_THRESHOLD,

it('should throw if incorrect type', () => {
instance.type = 0x123;
instance.type = 0x123 as MessageType;
expect(function () {

@@ -416,2 +417,20 @@ DlcOffer.deserialize(instance.serialize());

});
describe('DlcOfferContainer', () => {
it('should serialize and deserialize', () => {
const dlcOffer = DlcOfferV0.deserialize(dlcOfferHex);
// swap payout and change spk to differentiate between dlcoffers
const dlcOffer2 = DlcOfferV0.deserialize(dlcOfferHex);
dlcOffer2.payoutSPK = dlcOffer.changeSPK;
dlcOffer2.changeSPK = dlcOffer.payoutSPK;
const container = new DlcOfferContainer();
container.addOffer(dlcOffer);
container.addOffer(dlcOffer2);
const instance = DlcOfferContainer.deserialize(container.serialize());
expect(container.serialize()).to.deep.equal(instance.serialize());
});
});
});
import { expect } from 'chai';
import { MessageType } from '../../lib';
import { CetAdaptorSignaturesV0 } from '../../lib/messages/CetAdaptorSignaturesV0';
import { DlcSign, DlcSignV0 } from '../../lib/messages/DlcSign';
import {
DlcSign,
DlcSignContainer,
DlcSignV0,
} from '../../lib/messages/DlcSign';
import { FundingSignaturesV0 } from '../../lib/messages/FundingSignaturesV0';

@@ -17,2 +22,7 @@

const contractId2 = Buffer.from(
'4946fe172de3778fa660b9858d0624044f4494667757f50388abe6fe523376e8',
'hex',
);
const cetAdaptorSignaturesV0 = Buffer.from(

@@ -48,3 +58,3 @@ 'fda716' + // type cet_adaptor_signatures_v0

const dlcAcceptHex = Buffer.concat([
const dlcSignHex = Buffer.concat([
type,

@@ -72,3 +82,3 @@ contractId,

it('should throw if incorrect type', () => {
instance.type = 0x123;
instance.type = 0x123 as MessageType;
expect(function () {

@@ -90,3 +100,3 @@ DlcSign.deserialize(instance.serialize());

expect(instance.serialize().toString('hex')).to.equal(
dlcAcceptHex.toString('hex'),
dlcSignHex.toString('hex'),
);

@@ -98,3 +108,3 @@ });

it('deserializes', () => {
const instance = DlcSignV0.deserialize(dlcAcceptHex);
const instance = DlcSignV0.deserialize(dlcSignHex);
expect(instance.contractId).to.deep.equal(contractId);

@@ -119,2 +129,19 @@ expect(instance.cetSignatures.serialize().toString('hex')).to.equal(

});
describe('DlcSignContainer', () => {
it('should serialize and deserialize', () => {
const dlcSign = DlcSignV0.deserialize(dlcSignHex);
// swap payout and change spk to differentiate between dlcaccepts
const dlcSign2 = DlcSignV0.deserialize(dlcSignHex);
dlcSign2.contractId = contractId2;
const container = new DlcSignContainer();
container.addSign(dlcSign);
container.addSign(dlcSign2);
const instance = DlcSignContainer.deserialize(container.serialize());
expect(container.serialize()).to.deep.equal(instance.serialize());
});
});
});
import { expect } from 'chai';
import { OrderAcceptV0 } from '../../lib/messages/OrderAccept';
import {
OrderAcceptContainer,
OrderAcceptV0,
} from '../../lib/messages/OrderAccept';
import { OrderNegotiationFieldsV0 } from '../../lib/messages/OrderNegotiationFields';

@@ -12,2 +15,7 @@

const tempOrderId2 = Buffer.from(
'0ef55fca0e3d0a95609ddce833d2f8ba6c2ee37bbe8583bc2068256c51a32914',
'hex',
);
describe('serialize', () => {

@@ -47,2 +55,25 @@ it('serializes', () => {

});
describe('OrderAcceptContainer', () => {
it('should serialize and deserialize', () => {
const orderAccept = new OrderAcceptV0();
orderAccept.tempOrderId = tempOrderId;
orderAccept.negotiationFields = OrderNegotiationFieldsV0.deserialize(
Buffer.from('fdff3600', 'hex'),
);
// swap payout and change spk to differentiate between dlcoffers
const orderAccept2 = OrderAcceptV0.deserialize(orderAccept.serialize());
orderAccept2.tempOrderId = tempOrderId2;
const container = new OrderAcceptContainer();
container.addAccept(orderAccept);
container.addAccept(orderAccept2);
const instance = OrderAcceptContainer.deserialize(container.serialize());
expect(container.serialize()).to.deep.equal(instance.serialize());
});
});
});

@@ -6,2 +6,3 @@ import { expect } from 'chai';

MessageType,
OrderOfferContainer,
OrderPositionInfoV0,

@@ -530,2 +531,19 @@ } from '../../lib';

});
describe('OrderOfferContainer', () => {
it('should serialize and deserialize', () => {
const orderOffer = OrderOfferV0.deserialize(buf);
// swap payout and change spk to differentiate between dlcoffers
const orderOffer2 = OrderOfferV0.deserialize(buf);
orderOffer2.refundLocktime = 300;
const container = new OrderOfferContainer();
container.addOffer(orderOffer);
container.addOffer(orderOffer2);
const instance = OrderOfferContainer.deserialize(container.serialize());
expect(container.serialize()).to.deep.equal(instance.serialize());
});
});
});

2

.nyc_output/processinfo/index.json

@@ -1,1 +0,1 @@

{"processes":{"75ea72e4-64c7-417f-b9a5-f94774dc8eee":{"parent":null,"children":[]}},"files":{"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/ChainManager.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcTransactions.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/MessageType.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/util.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/ChainMemoryStore.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/irc/IrcMessage.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/AddressCache.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/index.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/DlcStore.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/IChainFilterChainClient.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/domain/Address.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/BatchFundingGroup.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/CetAdaptorSignaturesV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ContractDescriptor.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/serialize/getTlv.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/PayoutFunction.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/PayoutCurvePiece.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/RoundingIntervalsV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ContractInfo.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcMessage.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcAccept.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/serialize/deserializeTlv.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/FundingInput.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/NegotiationFields.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcClose.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/FundingSignaturesV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ScriptWitnessV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcOffer.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderIrcInfo.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderMetadata.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderPositionInfo.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcSign.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/NodeAnnouncementMessage.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleAnnouncementV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleEventV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/EventDescriptor.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleAttestationV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderAccept.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderNegotiationFields.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderOffer.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/validation/validate.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleInfoV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcCancel.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcCloseMetadata.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcIds.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcInfo.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleEventContainerV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleIdentifierV0.ts":["75ea72e4-64c7-417f-b9a5-f94774dc8eee"]},"externalIds":{}}
{"processes":{"6866ee3c-078d-4c12-a387-5b58becbb427":{"parent":null,"children":[]}},"files":{"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/ChainManager.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcTransactions.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/MessageType.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/util.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/ChainMemoryStore.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/irc/IrcMessage.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/AddressCache.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/index.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/DlcStore.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/IChainFilterChainClient.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/domain/Address.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/BatchFundingGroup.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/CetAdaptorSignaturesV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ContractDescriptor.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/serialize/getTlv.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/PayoutFunction.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/PayoutCurvePiece.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/RoundingIntervalsV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ContractInfo.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcMessage.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcAccept.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/serialize/deserializeTlv.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/FundingInput.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/NegotiationFields.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcClose.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/FundingSignaturesV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ScriptWitnessV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcOffer.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderIrcInfo.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderMetadata.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderPositionInfo.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcSign.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/NodeAnnouncementMessage.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleAnnouncementV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleEventV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/EventDescriptor.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleAttestationV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderAccept.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderNegotiationFields.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderOffer.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/validation/validate.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleInfoV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcCancel.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcCloseMetadata.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcIds.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcInfo.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleEventContainerV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleIdentifierV0.ts":["6866ee3c-078d-4c12-a387-5b58becbb427"]},"externalIds":{}}

@@ -100,1 +100,25 @@ /// <reference types="node" />

}
export declare class DlcAcceptContainer {
private accepts;
/**
* Adds a DlcAccept to the container.
* @param accept The DlcAccept to add.
*/
addAccept(accept: DlcAccept): void;
/**
* Returns all DlcAccepts in the container.
* @returns An array of DlcAccept instances.
*/
getAccepts(): DlcAccept[];
/**
* Serializes all DlcAccepts in the container to a Buffer.
* @returns A Buffer containing the serialized DlcAccepts.
*/
serialize(): Buffer;
/**
* Deserializes a Buffer into a DlcAcceptContainer with DlcAccepts.
* @param buf The Buffer to deserialize.
* @returns A DlcAcceptContainer instance.
*/
static deserialize(buf: Buffer, parseCets?: boolean): DlcAcceptContainer;
}

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.DlcAcceptWithoutSigs = exports.DlcAcceptV0 = exports.DlcAccept = void 0;
exports.DlcAcceptContainer = exports.DlcAcceptWithoutSigs = exports.DlcAcceptV0 = exports.DlcAccept = void 0;
const bitcoin_1 = require("@node-lightning/bitcoin");

@@ -232,2 +232,56 @@ const bufio_1 = require("@node-lightning/bufio");

exports.DlcAcceptWithoutSigs = DlcAcceptWithoutSigs;
class DlcAcceptContainer {
constructor() {
this.accepts = [];
}
/**
* Adds a DlcAccept to the container.
* @param accept The DlcAccept to add.
*/
addAccept(accept) {
this.accepts.push(accept);
}
/**
* Returns all DlcAccepts in the container.
* @returns An array of DlcAccept instances.
*/
getAccepts() {
return this.accepts;
}
/**
* Serializes all DlcAccepts in the container to a Buffer.
* @returns A Buffer containing the serialized DlcAccepts.
*/
serialize() {
const writer = new bufio_1.BufferWriter();
// Write the number of accepts in the container first.
writer.writeUInt16BE(this.accepts.length);
// Serialize each accept and write it.
this.accepts.forEach((accept) => {
const serializedAccept = accept.serialize();
// Optionally, write the length of the serialized accept for easier deserialization.
writer.writeUInt16BE(serializedAccept.length);
writer.writeBytes(serializedAccept);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into a DlcAcceptContainer with DlcAccepts.
* @param buf The Buffer to deserialize.
* @returns A DlcAcceptContainer instance.
*/
static deserialize(buf, parseCets = true) {
const reader = new bufio_1.BufferReader(buf);
const container = new DlcAcceptContainer();
const acceptsCount = reader.readUInt16BE();
for (let i = 0; i < acceptsCount; i++) {
const acceptLength = reader.readUInt16BE();
const acceptBuf = reader.readBytes(acceptLength);
const accept = DlcAccept.deserialize(acceptBuf, parseCets); // Adjust based on actual implementation.
container.addAccept(accept);
}
return container;
}
}
exports.DlcAcceptContainer = DlcAcceptContainer;
//# sourceMappingURL=DlcAccept.js.map

@@ -98,1 +98,25 @@ /// <reference types="node" />

}
export declare class DlcOfferContainer {
private offers;
/**
* Adds a DlcOffer to the container.
* @param offer The DlcOffer to add.
*/
addOffer(offer: DlcOffer): void;
/**
* Returns all DlcOffers in the container.
* @returns An array of DlcOffer instances.
*/
getOffers(): DlcOffer[];
/**
* Serializes all DlcOffers in the container to a Buffer.
* @returns A Buffer containing the serialized DlcOffers.
*/
serialize(): Buffer;
/**
* Deserializes a Buffer into a DlcOfferContainer with DlcOffers.
* @param buf The Buffer to deserialize.
* @returns A DlcOfferContainer instance.
*/
static deserialize(buf: Buffer): DlcOfferContainer;
}

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.DlcOfferV0 = exports.DlcOffer = exports.LOCKTIME_THRESHOLD = void 0;
exports.DlcOfferContainer = exports.DlcOfferV0 = exports.DlcOffer = exports.LOCKTIME_THRESHOLD = void 0;
const bitcoin_1 = require("@node-lightning/bitcoin");

@@ -271,2 +271,57 @@ const bufio_1 = require("@node-lightning/bufio");

DlcOfferV0.type = MessageType_1.MessageType.DlcOfferV0;
class DlcOfferContainer {
constructor() {
this.offers = [];
}
/**
* Adds a DlcOffer to the container.
* @param offer The DlcOffer to add.
*/
addOffer(offer) {
this.offers.push(offer);
}
/**
* Returns all DlcOffers in the container.
* @returns An array of DlcOffer instances.
*/
getOffers() {
return this.offers;
}
/**
* Serializes all DlcOffers in the container to a Buffer.
* @returns A Buffer containing the serialized DlcOffers.
*/
serialize() {
const writer = new bufio_1.BufferWriter();
// Write the number of offers in the container first.
writer.writeUInt16BE(this.offers.length);
// Serialize each offer and write it.
this.offers.forEach((offer) => {
const serializedOffer = offer.serialize();
// Optionally, write the length of the serialized offer for easier deserialization.
writer.writeUInt16BE(serializedOffer.length);
writer.writeBytes(serializedOffer);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into a DlcOfferContainer with DlcOffers.
* @param buf The Buffer to deserialize.
* @returns A DlcOfferContainer instance.
*/
static deserialize(buf) {
const reader = new bufio_1.BufferReader(buf);
const container = new DlcOfferContainer();
const offersCount = reader.readUInt16BE();
for (let i = 0; i < offersCount; i++) {
// Optionally, read the length of the serialized offer if it was written during serialization.
const offerLength = reader.readUInt16BE();
const offerBuf = reader.readBytes(offerLength);
const offer = DlcOffer.deserialize(offerBuf); // This needs to be adjusted based on actual implementation.
container.addOffer(offer);
}
return container;
}
}
exports.DlcOfferContainer = DlcOfferContainer;
//# sourceMappingURL=DlcOffer.js.map

@@ -48,1 +48,25 @@ /// <reference types="node" />

}
export declare class DlcSignContainer {
private signs;
/**
* Adds a DlcSign to the container.
* @param sign The DlcSign to add.
*/
addSign(sign: DlcSign): void;
/**
* Returns all DlcSigns in the container.
* @returns An array of DlcSign instances.
*/
getSigns(): DlcSign[];
/**
* Serializes all DlcSigns in the container to a Buffer.
* @returns A Buffer containing the serialized DlcSigns.
*/
serialize(): Buffer;
/**
* Deserializes a Buffer into a DlcSignContainer with DlcSigns.
* @param buf The Buffer to deserialize.
* @returns A DlcSignContainer instance.
*/
static deserialize(buf: Buffer): DlcSignContainer;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DlcSignV0 = exports.DlcSign = void 0;
exports.DlcSignContainer = exports.DlcSignV0 = exports.DlcSign = void 0;
const bufio_1 = require("@node-lightning/bufio");

@@ -76,2 +76,57 @@ const MessageType_1 = require("../MessageType");

DlcSignV0.type = MessageType_1.MessageType.DlcSignV0;
class DlcSignContainer {
constructor() {
this.signs = [];
}
/**
* Adds a DlcSign to the container.
* @param sign The DlcSign to add.
*/
addSign(sign) {
this.signs.push(sign);
}
/**
* Returns all DlcSigns in the container.
* @returns An array of DlcSign instances.
*/
getSigns() {
return this.signs;
}
/**
* Serializes all DlcSigns in the container to a Buffer.
* @returns A Buffer containing the serialized DlcSigns.
*/
serialize() {
const writer = new bufio_1.BufferWriter();
// Write the number of signs in the container first.
writer.writeUInt16BE(this.signs.length);
// Serialize each sign and write it.
this.signs.forEach((sign) => {
const serializedSign = sign.serialize();
// Optionally, write the length of the serialized sign for easier deserialization.
writer.writeUInt16BE(serializedSign.length);
writer.writeBytes(serializedSign);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into a DlcSignContainer with DlcSigns.
* @param buf The Buffer to deserialize.
* @returns A DlcSignContainer instance.
*/
static deserialize(buf) {
const reader = new bufio_1.BufferReader(buf);
const container = new DlcSignContainer();
const signsCount = reader.readUInt16BE();
for (let i = 0; i < signsCount; i++) {
// Optionally, read the length of the serialized sign if it was written during serialization.
const signLength = reader.readUInt16BE();
const signBuf = reader.readBytes(signLength);
const sign = DlcSign.deserialize(signBuf); // Adjust based on actual implementation.
container.addSign(sign);
}
return container;
}
}
exports.DlcSignContainer = DlcSignContainer;
//# sourceMappingURL=DlcSign.js.map

@@ -43,1 +43,25 @@ /// <reference types="node" />

}
export declare class OrderAcceptContainer {
private accepts;
/**
* Adds an OrderAccept to the container.
* @param accept The OrderAccept to add.
*/
addAccept(accept: OrderAccept): void;
/**
* Returns all OrderAccepts in the container.
* @returns An array of OrderAccept instances.
*/
getAccepts(): OrderAccept[];
/**
* Serializes all OrderAccepts in the container to a Buffer.
* @returns A Buffer containing the serialized OrderAccepts.
*/
serialize(): Buffer;
/**
* Deserializes a Buffer into an OrderAcceptContainer with OrderAccepts.
* @param buf The Buffer to deserialize.
* @returns An OrderAcceptContainer instance.
*/
static deserialize(buf: Buffer): OrderAcceptContainer;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrderAcceptV0 = exports.OrderAccept = void 0;
exports.OrderAcceptContainer = exports.OrderAcceptV0 = exports.OrderAccept = void 0;
const bufio_1 = require("@node-lightning/bufio");

@@ -69,2 +69,55 @@ const MessageType_1 = require("../MessageType");

OrderAcceptV0.type = MessageType_1.MessageType.OrderAcceptV0;
class OrderAcceptContainer {
constructor() {
this.accepts = [];
}
/**
* Adds an OrderAccept to the container.
* @param accept The OrderAccept to add.
*/
addAccept(accept) {
this.accepts.push(accept);
}
/**
* Returns all OrderAccepts in the container.
* @returns An array of OrderAccept instances.
*/
getAccepts() {
return this.accepts;
}
/**
* Serializes all OrderAccepts in the container to a Buffer.
* @returns A Buffer containing the serialized OrderAccepts.
*/
serialize() {
const writer = new bufio_1.BufferWriter();
// Write the number of accepts in the container first.
writer.writeUInt16BE(this.accepts.length);
// Serialize each accept and write it.
this.accepts.forEach((accept) => {
const serializedAccept = accept.serialize();
writer.writeUInt16BE(serializedAccept.length);
writer.writeBytes(serializedAccept);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into an OrderAcceptContainer with OrderAccepts.
* @param buf The Buffer to deserialize.
* @returns An OrderAcceptContainer instance.
*/
static deserialize(buf) {
const reader = new bufio_1.BufferReader(buf);
const container = new OrderAcceptContainer();
const acceptsCount = reader.readUInt16BE();
for (let i = 0; i < acceptsCount; i++) {
const acceptLength = reader.readUInt16BE();
const acceptBuf = reader.readBytes(acceptLength);
const accept = OrderAccept.deserialize(acceptBuf); // Adjust based on actual implementation.
container.addAccept(accept);
}
return container;
}
}
exports.OrderAcceptContainer = OrderAcceptContainer;
//# sourceMappingURL=OrderAccept.js.map

@@ -63,1 +63,25 @@ /// <reference types="node" />

}
export declare class OrderOfferContainer {
private offers;
/**
* Adds an OrderOffer to the container.
* @param offer The OrderOffer to add.
*/
addOffer(offer: OrderOffer): void;
/**
* Returns all OrderOffers in the container.
* @returns An array of OrderOffer instances.
*/
getOffers(): OrderOffer[];
/**
* Serializes all OrderOffers in the container to a Buffer.
* @returns A Buffer containing the serialized OrderOffers.
*/
serialize(): Buffer;
/**
* Deserializes a Buffer into an OrderOfferContainer with OrderOffers.
* @param buf The Buffer to deserialize.
* @returns An OrderOfferContainer instance.
*/
static deserialize(buf: Buffer): OrderOfferContainer;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrderOfferV0 = exports.OrderOffer = void 0;
exports.OrderOfferContainer = exports.OrderOfferV0 = exports.OrderOffer = void 0;
const bufio_1 = require("@node-lightning/bufio");

@@ -170,2 +170,57 @@ const MessageType_1 = require("../MessageType");

OrderOfferV0.type = MessageType_1.MessageType.OrderOfferV0;
class OrderOfferContainer {
constructor() {
this.offers = [];
}
/**
* Adds an OrderOffer to the container.
* @param offer The OrderOffer to add.
*/
addOffer(offer) {
this.offers.push(offer);
}
/**
* Returns all OrderOffers in the container.
* @returns An array of OrderOffer instances.
*/
getOffers() {
return this.offers;
}
/**
* Serializes all OrderOffers in the container to a Buffer.
* @returns A Buffer containing the serialized OrderOffers.
*/
serialize() {
const writer = new bufio_1.BufferWriter();
// Write the number of offers in the container first.
writer.writeUInt16BE(this.offers.length);
// Serialize each offer and write it.
this.offers.forEach((offer) => {
const serializedOffer = offer.serialize();
// Optionally, write the length of the serialized offer for easier deserialization.
writer.writeUInt16BE(serializedOffer.length);
writer.writeBytes(serializedOffer);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into an OrderOfferContainer with OrderOffers.
* @param buf The Buffer to deserialize.
* @returns An OrderOfferContainer instance.
*/
static deserialize(buf) {
const reader = new bufio_1.BufferReader(buf);
const container = new OrderOfferContainer();
const offersCount = reader.readUInt16BE();
for (let i = 0; i < offersCount; i++) {
// Optionally, read the length of the serialized offer if it was written during serialization.
const offerLength = reader.readUInt16BE();
const offerBuf = reader.readBytes(offerLength);
const offer = OrderOffer.deserialize(offerBuf); // Adjust based on actual implementation.
container.addOffer(offer);
}
return container;
}
}
exports.OrderOfferContainer = OrderOfferContainer;
//# sourceMappingURL=OrderOffer.js.map

@@ -333,1 +333,57 @@ import { Script } from '@node-lightning/bitcoin';

}
export class DlcAcceptContainer {
private accepts: DlcAccept[] = [];
/**
* Adds a DlcAccept to the container.
* @param accept The DlcAccept to add.
*/
public addAccept(accept: DlcAccept): void {
this.accepts.push(accept);
}
/**
* Returns all DlcAccepts in the container.
* @returns An array of DlcAccept instances.
*/
public getAccepts(): DlcAccept[] {
return this.accepts;
}
/**
* Serializes all DlcAccepts in the container to a Buffer.
* @returns A Buffer containing the serialized DlcAccepts.
*/
public serialize(): Buffer {
const writer = new BufferWriter();
// Write the number of accepts in the container first.
writer.writeUInt16BE(this.accepts.length);
// Serialize each accept and write it.
this.accepts.forEach((accept) => {
const serializedAccept = accept.serialize();
// Optionally, write the length of the serialized accept for easier deserialization.
writer.writeUInt16BE(serializedAccept.length);
writer.writeBytes(serializedAccept);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into a DlcAcceptContainer with DlcAccepts.
* @param buf The Buffer to deserialize.
* @returns A DlcAcceptContainer instance.
*/
public static deserialize(buf: Buffer, parseCets = true): DlcAcceptContainer {
const reader = new BufferReader(buf);
const container = new DlcAcceptContainer();
const acceptsCount = reader.readUInt16BE();
for (let i = 0; i < acceptsCount; i++) {
const acceptLength = reader.readUInt16BE();
const acceptBuf = reader.readBytes(acceptLength);
const accept = DlcAccept.deserialize(acceptBuf, parseCets); // Adjust based on actual implementation.
container.addAccept(accept);
}
return container;
}
}

@@ -400,1 +400,58 @@ import { Script } from '@node-lightning/bitcoin';

}
export class DlcOfferContainer {
private offers: DlcOffer[] = [];
/**
* Adds a DlcOffer to the container.
* @param offer The DlcOffer to add.
*/
public addOffer(offer: DlcOffer): void {
this.offers.push(offer);
}
/**
* Returns all DlcOffers in the container.
* @returns An array of DlcOffer instances.
*/
public getOffers(): DlcOffer[] {
return this.offers;
}
/**
* Serializes all DlcOffers in the container to a Buffer.
* @returns A Buffer containing the serialized DlcOffers.
*/
public serialize(): Buffer {
const writer = new BufferWriter();
// Write the number of offers in the container first.
writer.writeUInt16BE(this.offers.length);
// Serialize each offer and write it.
this.offers.forEach((offer) => {
const serializedOffer = offer.serialize();
// Optionally, write the length of the serialized offer for easier deserialization.
writer.writeUInt16BE(serializedOffer.length);
writer.writeBytes(serializedOffer);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into a DlcOfferContainer with DlcOffers.
* @param buf The Buffer to deserialize.
* @returns A DlcOfferContainer instance.
*/
public static deserialize(buf: Buffer): DlcOfferContainer {
const reader = new BufferReader(buf);
const container = new DlcOfferContainer();
const offersCount = reader.readUInt16BE();
for (let i = 0; i < offersCount; i++) {
// Optionally, read the length of the serialized offer if it was written during serialization.
const offerLength = reader.readUInt16BE();
const offerBuf = reader.readBytes(offerLength);
const offer = DlcOffer.deserialize(offerBuf); // This needs to be adjusted based on actual implementation.
container.addOffer(offer);
}
return container;
}
}

@@ -111,1 +111,58 @@ import { BufferReader, BufferWriter } from '@node-lightning/bufio';

}
export class DlcSignContainer {
private signs: DlcSign[] = [];
/**
* Adds a DlcSign to the container.
* @param sign The DlcSign to add.
*/
public addSign(sign: DlcSign): void {
this.signs.push(sign);
}
/**
* Returns all DlcSigns in the container.
* @returns An array of DlcSign instances.
*/
public getSigns(): DlcSign[] {
return this.signs;
}
/**
* Serializes all DlcSigns in the container to a Buffer.
* @returns A Buffer containing the serialized DlcSigns.
*/
public serialize(): Buffer {
const writer = new BufferWriter();
// Write the number of signs in the container first.
writer.writeUInt16BE(this.signs.length);
// Serialize each sign and write it.
this.signs.forEach((sign) => {
const serializedSign = sign.serialize();
// Optionally, write the length of the serialized sign for easier deserialization.
writer.writeUInt16BE(serializedSign.length);
writer.writeBytes(serializedSign);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into a DlcSignContainer with DlcSigns.
* @param buf The Buffer to deserialize.
* @returns A DlcSignContainer instance.
*/
public static deserialize(buf: Buffer): DlcSignContainer {
const reader = new BufferReader(buf);
const container = new DlcSignContainer();
const signsCount = reader.readUInt16BE();
for (let i = 0; i < signsCount; i++) {
// Optionally, read the length of the serialized sign if it was written during serialization.
const signLength = reader.readUInt16BE();
const signBuf = reader.readBytes(signLength);
const sign = DlcSign.deserialize(signBuf); // Adjust based on actual implementation.
container.addSign(sign);
}
return container;
}
}

@@ -98,1 +98,56 @@ import { BufferReader, BufferWriter } from '@node-lightning/bufio';

}
export class OrderAcceptContainer {
private accepts: OrderAccept[] = [];
/**
* Adds an OrderAccept to the container.
* @param accept The OrderAccept to add.
*/
public addAccept(accept: OrderAccept): void {
this.accepts.push(accept);
}
/**
* Returns all OrderAccepts in the container.
* @returns An array of OrderAccept instances.
*/
public getAccepts(): OrderAccept[] {
return this.accepts;
}
/**
* Serializes all OrderAccepts in the container to a Buffer.
* @returns A Buffer containing the serialized OrderAccepts.
*/
public serialize(): Buffer {
const writer = new BufferWriter();
// Write the number of accepts in the container first.
writer.writeUInt16BE(this.accepts.length);
// Serialize each accept and write it.
this.accepts.forEach((accept) => {
const serializedAccept = accept.serialize();
writer.writeUInt16BE(serializedAccept.length);
writer.writeBytes(serializedAccept);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into an OrderAcceptContainer with OrderAccepts.
* @param buf The Buffer to deserialize.
* @returns An OrderAcceptContainer instance.
*/
public static deserialize(buf: Buffer): OrderAcceptContainer {
const reader = new BufferReader(buf);
const container = new OrderAcceptContainer();
const acceptsCount = reader.readUInt16BE();
for (let i = 0; i < acceptsCount; i++) {
const acceptLength = reader.readUInt16BE();
const acceptBuf = reader.readBytes(acceptLength);
const accept = OrderAccept.deserialize(acceptBuf); // Adjust based on actual implementation.
container.addAccept(accept);
}
return container;
}
}

@@ -254,1 +254,58 @@ import { BufferReader, BufferWriter } from '@node-lightning/bufio';

}
export class OrderOfferContainer {
private offers: OrderOffer[] = [];
/**
* Adds an OrderOffer to the container.
* @param offer The OrderOffer to add.
*/
public addOffer(offer: OrderOffer): void {
this.offers.push(offer);
}
/**
* Returns all OrderOffers in the container.
* @returns An array of OrderOffer instances.
*/
public getOffers(): OrderOffer[] {
return this.offers;
}
/**
* Serializes all OrderOffers in the container to a Buffer.
* @returns A Buffer containing the serialized OrderOffers.
*/
public serialize(): Buffer {
const writer = new BufferWriter();
// Write the number of offers in the container first.
writer.writeUInt16BE(this.offers.length);
// Serialize each offer and write it.
this.offers.forEach((offer) => {
const serializedOffer = offer.serialize();
// Optionally, write the length of the serialized offer for easier deserialization.
writer.writeUInt16BE(serializedOffer.length);
writer.writeBytes(serializedOffer);
});
return writer.toBuffer();
}
/**
* Deserializes a Buffer into an OrderOfferContainer with OrderOffers.
* @param buf The Buffer to deserialize.
* @returns An OrderOfferContainer instance.
*/
public static deserialize(buf: Buffer): OrderOfferContainer {
const reader = new BufferReader(buf);
const container = new OrderOfferContainer();
const offersCount = reader.readUInt16BE();
for (let i = 0; i < offersCount; i++) {
// Optionally, read the length of the serialized offer if it was written during serialization.
const offerLength = reader.readUInt16BE();
const offerBuf = reader.readBytes(offerLength);
const offer = OrderOffer.deserialize(offerBuf); // Adjust based on actual implementation.
container.addOffer(offer);
}
return container;
}
}
{
"name": "@node-dlc/messaging",
"version": "0.23.2",
"version": "0.23.3",
"description": "DLC Messaging Protocol",

@@ -25,3 +25,3 @@ "scripts": {

"dependencies": {
"@node-dlc/bitcoin": "^0.23.2",
"@node-dlc/bitcoin": "^0.23.3",
"@node-lightning/bitcoin": "0.26.1",

@@ -44,3 +44,3 @@ "@node-lightning/bufio": "0.26.1",

},
"gitHead": "cf3c9351c0f9fb719633d4cf9d26c87ba252fd03"
"gitHead": "99b218a59a310b8d4a4c0fb0a3ee457944760360"
}

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 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 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 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 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 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 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 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 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 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

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