@node-dlc/messaging
Advanced tools
Comparing version 0.22.6 to 0.23.0
@@ -1,1 +0,1 @@ | ||
{"processes":{"769b8329-d7fe-4dff-a42a-684e2a2a6dc8":{"parent":null,"children":[]}},"files":{"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/ChainManager.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcTransactions.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/MessageType.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/util.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/ChainMemoryStore.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/irc/IrcMessage.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/AddressCache.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/CetAdaptorSignaturesV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ContractDescriptor.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/serialize/getTlv.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/PayoutFunction.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/PayoutCurvePiece.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/RoundingIntervalsV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ContractInfo.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcMessage.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcAccept.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/FundingInput.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/NegotiationFields.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcClose.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/FundingSignaturesV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/ScriptWitnessV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcOffer.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/serialize/deserializeTlv.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderIrcInfo.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderMetadata.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderPositionInfo.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcSign.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/NodeAnnouncementMessage.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/domain/Address.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleAnnouncementV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleEventV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/EventDescriptor.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleAttestationV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderAccept.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderNegotiationFields.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OrderOffer.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/validation/validate.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleInfoV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcCancel.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/index.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/DlcStore.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/chain/IChainFilterChainClient.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcCloseMetadata.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcIds.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/DlcInfo.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleEventContainerV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"],"/Users/matthewblack/code/github.com/AtomicFinance/node-dlc/packages/messaging/lib/messages/OracleIdentifierV0.ts":["769b8329-d7fe-4dff-a42a-684e2a2a6dc8"]},"externalIds":{}} | ||
{"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":{}} |
@@ -7,2 +7,3 @@ export * from './chain/ChainManager'; | ||
export * from './messages/AddressCache'; | ||
export * from './messages/BatchFundingGroup'; | ||
export * from './messages/CetAdaptorSignaturesV0'; | ||
@@ -9,0 +10,0 @@ export * from './messages/ContractDescriptor'; |
@@ -19,2 +19,3 @@ "use strict"; | ||
__exportStar(require("./messages/AddressCache"), exports); | ||
__exportStar(require("./messages/BatchFundingGroup"), exports); | ||
__exportStar(require("./messages/CetAdaptorSignaturesV0"), exports); | ||
@@ -21,0 +22,0 @@ __exportStar(require("./messages/ContractDescriptor"), exports); |
/// <reference types="node" /> | ||
import { BitcoinNetwork } from 'bitcoin-networks'; | ||
import { MessageType } from '../MessageType'; | ||
import { BatchFundingGroup, IBatchFundingGroupJSON } from './BatchFundingGroup'; | ||
import { CetAdaptorSignaturesV0, ICetAdaptorSignaturesV0JSON } from './CetAdaptorSignaturesV0'; | ||
@@ -43,2 +44,3 @@ import { IDlcMessage } from './DlcMessage'; | ||
negotiationFields: NegotiationFields; | ||
batchFundingGroups?: BatchFundingGroup[]; | ||
/** | ||
@@ -76,3 +78,4 @@ * Get funding, change and payout address from DlcOffer | ||
readonly negotiationFields: NegotiationFields; | ||
constructor(tempContractId: Buffer, acceptCollateralSatoshis: bigint, fundingPubKey: Buffer, payoutSPK: Buffer, payoutSerialId: bigint, fundingInputs: FundingInputV0[], changeSPK: Buffer, changeSerialId: bigint, negotiationFields: NegotiationFields); | ||
readonly batchFundingGroups?: BatchFundingGroup[]; | ||
constructor(tempContractId: Buffer, acceptCollateralSatoshis: bigint, fundingPubKey: Buffer, payoutSPK: Buffer, payoutSerialId: bigint, fundingInputs: FundingInputV0[], changeSPK: Buffer, changeSerialId: bigint, negotiationFields: NegotiationFields, batchFundingGroups?: BatchFundingGroup[]); | ||
} | ||
@@ -92,2 +95,3 @@ export interface IDlcAcceptV0JSON { | ||
negotiationFields: INegotiationFieldsV0JSON | INegotiationFieldsV1JSON | INegotiationFieldsV2JSON; | ||
tlvs: IBatchFundingGroupJSON[]; | ||
} | ||
@@ -94,0 +98,0 @@ export interface IDlcAcceptV0Addresses { |
@@ -13,3 +13,5 @@ "use strict"; | ||
const MessageType_1 = require("../MessageType"); | ||
const deserializeTlv_1 = require("../serialize/deserializeTlv"); | ||
const getTlv_1 = require("../serialize/getTlv"); | ||
const BatchFundingGroup_1 = require("./BatchFundingGroup"); | ||
const CetAdaptorSignaturesV0_1 = require("./CetAdaptorSignaturesV0"); | ||
@@ -76,2 +78,17 @@ const FundingInput_1 = require("./FundingInput"); | ||
instance.negotiationFields = NegotiationFields_1.NegotiationFields.deserialize(getTlv_1.getTlv(reader)); | ||
while (!reader.eof) { | ||
const buf = getTlv_1.getTlv(reader); | ||
const tlvReader = new bufio_1.BufferReader(buf); | ||
const { type } = deserializeTlv_1.deserializeTlv(tlvReader); | ||
switch (Number(type)) { | ||
case MessageType_1.MessageType.BatchFundingGroup: | ||
if (!instance.batchFundingGroups) { | ||
instance.batchFundingGroups = []; | ||
} | ||
instance.batchFundingGroups.push(BatchFundingGroup_1.BatchFundingGroup.deserialize(buf)); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
return instance; | ||
@@ -147,2 +164,8 @@ } | ||
toJSON() { | ||
const tlvs = []; | ||
if (this.batchFundingGroups) { | ||
this.batchFundingGroups.forEach((group) => { | ||
tlvs.push(group.serialize()); | ||
}); | ||
} | ||
return { | ||
@@ -161,2 +184,3 @@ type: this.type, | ||
negotiationFields: this.negotiationFields.toJSON(), | ||
tlvs, | ||
}; | ||
@@ -186,6 +210,8 @@ } | ||
writer.writeBytes(this.negotiationFields.serialize()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => writer.writeBytes(fundingInfo.serialize())); | ||
return writer.toBuffer(); | ||
} | ||
withoutSigs() { | ||
return new DlcAcceptWithoutSigs(this.tempContractId, this.acceptCollateralSatoshis, this.fundingPubKey, this.payoutSPK, this.payoutSerialId, this.fundingInputs, this.changeSPK, this.changeSerialId, this.negotiationFields); | ||
return new DlcAcceptWithoutSigs(this.tempContractId, this.acceptCollateralSatoshis, this.fundingPubKey, this.payoutSPK, this.payoutSerialId, this.fundingInputs, this.changeSPK, this.changeSerialId, this.negotiationFields, this.batchFundingGroups); | ||
} | ||
@@ -196,3 +222,3 @@ } | ||
class DlcAcceptWithoutSigs { | ||
constructor(tempContractId, acceptCollateralSatoshis, fundingPubKey, payoutSPK, payoutSerialId, fundingInputs, changeSPK, changeSerialId, negotiationFields) { | ||
constructor(tempContractId, acceptCollateralSatoshis, fundingPubKey, payoutSPK, payoutSerialId, fundingInputs, changeSPK, changeSerialId, negotiationFields, batchFundingGroups) { | ||
this.tempContractId = tempContractId; | ||
@@ -207,2 +233,3 @@ this.acceptCollateralSatoshis = acceptCollateralSatoshis; | ||
this.negotiationFields = negotiationFields; | ||
this.batchFundingGroups = batchFundingGroups; | ||
} | ||
@@ -209,0 +236,0 @@ } |
/// <reference types="node" /> | ||
import { BitcoinNetwork } from 'bitcoin-networks'; | ||
import { MessageType } from '../MessageType'; | ||
import { BatchFundingGroup, IBatchFundingGroupJSON } from './BatchFundingGroup'; | ||
import { ContractInfo, IContractInfoV0JSON, IContractInfoV1JSON } from './ContractInfo'; | ||
@@ -52,2 +53,3 @@ import { IDlcMessage } from './DlcMessage'; | ||
positionInfo?: OrderPositionInfo; | ||
batchFundingGroups?: BatchFundingGroup[]; | ||
/** | ||
@@ -90,3 +92,3 @@ * Get funding, change and payout address from DlcOffer | ||
refundLocktime: number; | ||
tlvs: (IOrderMetadataJSON | IOrderIrcInfoJSON | IOrderPositionInfoJSON)[]; | ||
tlvs: (IOrderMetadataJSON | IOrderIrcInfoJSON | IOrderPositionInfoJSON | IBatchFundingGroupJSON)[]; | ||
} | ||
@@ -93,0 +95,0 @@ export interface IDlcOfferV0Addresses { |
@@ -15,2 +15,3 @@ "use strict"; | ||
const getTlv_1 = require("../serialize/getTlv"); | ||
const BatchFundingGroup_1 = require("./BatchFundingGroup"); | ||
const ContractInfo_1 = require("./ContractInfo"); | ||
@@ -90,2 +91,8 @@ const FundingInput_1 = require("./FundingInput"); | ||
break; | ||
case MessageType_1.MessageType.BatchFundingGroup: | ||
if (!instance.batchFundingGroups) { | ||
instance.batchFundingGroups = []; | ||
} | ||
instance.batchFundingGroups.push(BatchFundingGroup_1.BatchFundingGroup.deserialize(buf)); | ||
break; | ||
default: | ||
@@ -206,2 +213,4 @@ break; | ||
tlvs.push(this.positionInfo.toJSON()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => tlvs.push(fundingInfo.toJSON())); | ||
return { | ||
@@ -257,2 +266,4 @@ type: this.type, | ||
writer.writeBytes(this.positionInfo.serialize()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => writer.writeBytes(fundingInfo.serialize())); | ||
return writer.toBuffer(); | ||
@@ -259,0 +270,0 @@ } |
/// <reference types="node" /> | ||
import { IOrderMetadataJSON } from '..'; | ||
import { MessageType } from '../MessageType'; | ||
import { BatchFundingGroup, IBatchFundingGroupJSON } from './BatchFundingGroup'; | ||
import { ContractInfo, IContractInfoV0JSON, IContractInfoV1JSON } from './ContractInfo'; | ||
@@ -41,2 +42,3 @@ import { IDlcMessage } from './DlcMessage'; | ||
positionInfo?: OrderPositionInfo; | ||
batchFundingGroups?: BatchFundingGroup[]; | ||
validate(): void; | ||
@@ -60,3 +62,3 @@ /** | ||
refundLocktime: number; | ||
tlvs: (IOrderMetadataJSON | IOrderIrcInfoJSON | IOrderPositionInfoJSON)[]; | ||
tlvs: (IOrderMetadataJSON | IOrderIrcInfoJSON | IOrderPositionInfoJSON | IBatchFundingGroupJSON)[]; | ||
} |
@@ -9,2 +9,3 @@ "use strict"; | ||
const validate_1 = require("../validation/validate"); | ||
const BatchFundingGroup_1 = require("./BatchFundingGroup"); | ||
const ContractInfo_1 = require("./ContractInfo"); | ||
@@ -69,2 +70,8 @@ const OrderIrcInfo_1 = require("./OrderIrcInfo"); | ||
break; | ||
case MessageType_1.MessageType.BatchFundingGroup: | ||
if (!instance.batchFundingGroups) { | ||
instance.batchFundingGroups = []; | ||
} | ||
instance.batchFundingGroups.push(BatchFundingGroup_1.BatchFundingGroup.deserialize(buf)); | ||
break; | ||
default: | ||
@@ -127,2 +134,4 @@ break; | ||
tlvs.push(this.positionInfo.toJSON()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => tlvs.push(fundingInfo.toJSON())); | ||
return { | ||
@@ -157,2 +166,4 @@ type: this.type, | ||
writer.writeBytes(this.positionInfo.serialize()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => writer.writeBytes(fundingInfo.serialize())); | ||
return writer.toBuffer(); | ||
@@ -159,0 +170,0 @@ } |
@@ -57,2 +57,3 @@ /** | ||
AddressCache = 65132, | ||
BatchFundingGroup = 65430, | ||
IrcMessageV0 = 59314, | ||
@@ -59,0 +60,0 @@ NodeAnnouncement = 51394, |
@@ -61,2 +61,3 @@ "use strict"; | ||
MessageType[MessageType["AddressCache"] = 65132] = "AddressCache"; | ||
MessageType[MessageType["BatchFundingGroup"] = 65430] = "BatchFundingGroup"; | ||
MessageType[MessageType["IrcMessageV0"] = 59314] = "IrcMessageV0"; | ||
@@ -63,0 +64,0 @@ MessageType[MessageType["NodeAnnouncement"] = 51394] = "NodeAnnouncement"; |
@@ -7,2 +7,3 @@ export * from './chain/ChainManager'; | ||
export * from './messages/AddressCache'; | ||
export * from './messages/BatchFundingGroup'; | ||
export * from './messages/CetAdaptorSignaturesV0'; | ||
@@ -9,0 +10,0 @@ export * from './messages/ContractDescriptor'; |
@@ -9,3 +9,5 @@ import { Script } from '@node-lightning/bitcoin'; | ||
import { MessageType } from '../MessageType'; | ||
import { deserializeTlv } from '../serialize/deserializeTlv'; | ||
import { getTlv, skipTlv } from '../serialize/getTlv'; | ||
import { BatchFundingGroup, IBatchFundingGroupJSON } from './BatchFundingGroup'; | ||
import { | ||
@@ -89,2 +91,19 @@ CetAdaptorSignaturesV0, | ||
while (!reader.eof) { | ||
const buf = getTlv(reader); | ||
const tlvReader = new BufferReader(buf); | ||
const { type } = deserializeTlv(tlvReader); | ||
switch (Number(type)) { | ||
case MessageType.BatchFundingGroup: | ||
if (!instance.batchFundingGroups) { | ||
instance.batchFundingGroups = []; | ||
} | ||
instance.batchFundingGroups.push(BatchFundingGroup.deserialize(buf)); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
return instance; | ||
@@ -120,2 +139,4 @@ } | ||
public batchFundingGroups?: BatchFundingGroup[]; | ||
/** | ||
@@ -202,2 +223,10 @@ * Get funding, change and payout address from DlcOffer | ||
public toJSON(): IDlcAcceptV0JSON { | ||
const tlvs = []; | ||
if (this.batchFundingGroups) { | ||
this.batchFundingGroups.forEach((group) => { | ||
tlvs.push(group.serialize()); | ||
}); | ||
} | ||
return { | ||
@@ -216,2 +245,3 @@ type: this.type, | ||
negotiationFields: this.negotiationFields.toJSON(), | ||
tlvs, | ||
}; | ||
@@ -245,2 +275,7 @@ } | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => | ||
writer.writeBytes(fundingInfo.serialize()), | ||
); | ||
return writer.toBuffer(); | ||
@@ -260,2 +295,3 @@ } | ||
this.negotiationFields, | ||
this.batchFundingGroups, | ||
); | ||
@@ -276,2 +312,3 @@ } | ||
readonly negotiationFields: NegotiationFields, | ||
readonly batchFundingGroups?: BatchFundingGroup[], | ||
) {} | ||
@@ -296,2 +333,3 @@ } | ||
| INegotiationFieldsV2JSON; | ||
tlvs: IBatchFundingGroupJSON[]; | ||
} | ||
@@ -298,0 +336,0 @@ |
@@ -11,2 +11,3 @@ import { Script } from '@node-lightning/bitcoin'; | ||
import { getTlv } from '../serialize/getTlv'; | ||
import { BatchFundingGroup, IBatchFundingGroupJSON } from './BatchFundingGroup'; | ||
import { | ||
@@ -115,2 +116,8 @@ ContractInfo, | ||
break; | ||
case MessageType.BatchFundingGroup: | ||
if (!instance.batchFundingGroups) { | ||
instance.batchFundingGroups = []; | ||
} | ||
instance.batchFundingGroups.push(BatchFundingGroup.deserialize(buf)); | ||
break; | ||
default: | ||
@@ -163,2 +170,4 @@ break; | ||
public batchFundingGroups?: BatchFundingGroup[]; | ||
/** | ||
@@ -300,2 +309,6 @@ * Get funding, change and payout address from DlcOffer | ||
if (this.positionInfo) tlvs.push(this.positionInfo.toJSON()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => | ||
tlvs.push(fundingInfo.toJSON()), | ||
); | ||
@@ -353,2 +366,6 @@ return { | ||
if (this.positionInfo) writer.writeBytes(this.positionInfo.serialize()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => | ||
writer.writeBytes(fundingInfo.serialize()), | ||
); | ||
@@ -375,3 +392,8 @@ return writer.toBuffer(); | ||
refundLocktime: number; | ||
tlvs: (IOrderMetadataJSON | IOrderIrcInfoJSON | IOrderPositionInfoJSON)[]; | ||
tlvs: ( | ||
| IOrderMetadataJSON | ||
| IOrderIrcInfoJSON | ||
| IOrderPositionInfoJSON | ||
| IBatchFundingGroupJSON | ||
)[]; | ||
} | ||
@@ -378,0 +400,0 @@ |
@@ -12,2 +12,3 @@ import { BufferReader, BufferWriter } from '@node-lightning/bufio'; | ||
} from '../validation/validate'; | ||
import { BatchFundingGroup, IBatchFundingGroupJSON } from './BatchFundingGroup'; | ||
import { | ||
@@ -90,2 +91,8 @@ ContractInfo, | ||
break; | ||
case MessageType.BatchFundingGroup: | ||
if (!instance.batchFundingGroups) { | ||
instance.batchFundingGroups = []; | ||
} | ||
instance.batchFundingGroups.push(BatchFundingGroup.deserialize(buf)); | ||
break; | ||
default: | ||
@@ -122,2 +129,4 @@ break; | ||
public batchFundingGroups?: BatchFundingGroup[]; | ||
public validate(): void { | ||
@@ -191,2 +200,6 @@ validateBuffer(this.chainHash, 'chainHash', OrderOfferV0.name, 32); | ||
if (this.positionInfo) tlvs.push(this.positionInfo.toJSON()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => | ||
tlvs.push(fundingInfo.toJSON()), | ||
); | ||
@@ -221,2 +234,6 @@ return { | ||
if (this.positionInfo) writer.writeBytes(this.positionInfo.serialize()); | ||
if (this.batchFundingGroups) | ||
this.batchFundingGroups.forEach((fundingInfo) => | ||
writer.writeBytes(fundingInfo.serialize()), | ||
); | ||
@@ -235,3 +252,8 @@ return writer.toBuffer(); | ||
refundLocktime: number; | ||
tlvs: (IOrderMetadataJSON | IOrderIrcInfoJSON | IOrderPositionInfoJSON)[]; | ||
tlvs: ( | ||
| IOrderMetadataJSON | ||
| IOrderIrcInfoJSON | ||
| IOrderPositionInfoJSON | ||
| IBatchFundingGroupJSON | ||
)[]; | ||
} |
@@ -78,2 +78,4 @@ /** | ||
BatchFundingGroup = 65430, | ||
IrcMessageV0 = 59314, | ||
@@ -80,0 +82,0 @@ |
{ | ||
"name": "@node-dlc/messaging", | ||
"version": "0.22.6", | ||
"version": "0.23.0", | ||
"description": "DLC Messaging Protocol", | ||
@@ -25,2 +25,3 @@ "scripts": { | ||
"dependencies": { | ||
"@node-dlc/bitcoin": "^0.23.0", | ||
"@node-lightning/bitcoin": "0.26.1", | ||
@@ -43,3 +44,3 @@ "@node-lightning/bufio": "0.26.1", | ||
}, | ||
"gitHead": "c8a078f5cfa19025b1f99d4f30d81b958362c5ae" | ||
"gitHead": "896e77ea5caca60c20f2d9b40c10b1cfdda4f2be" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3998012
522
24964
8
+ Added@node-dlc/bitcoin@^0.23.0
+ Added@node-dlc/bitcoin@0.23.6(transitive)