diff --git a/.gitmodules b/.gitmodules index bd410cf..bfb251e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "vega"] path = vendor/vega url = git@github.com:vegaprotocol/vega.git - branch = release/v0.74.0-preview.5 + branch = release/v0.74.0-preview.7 diff --git a/messages.json b/messages.json index b58e7eb..e38b56c 100644 --- a/messages.json +++ b/messages.json @@ -2885,6 +2885,34 @@ "oneofIndex": 0, "oneofName": "command" }, + { + "name": "batchProposalSubmission", + "number": 1023, + "type": "message", + "wireType": "bytes", + "repeated": false, + "packed": false, + "optional": false, + "typeName": ".vega.commands.v1.BatchProposalSubmission", + "messageType": "BatchProposalSubmission", + "messageTypeLocal": null, + "oneofIndex": 0, + "oneofName": "command" + }, + { + "name": "updatePartyProfile", + "number": 1024, + "type": "message", + "wireType": "bytes", + "repeated": false, + "packed": false, + "optional": false, + "typeName": ".vega.commands.v1.UpdatePartyProfile", + "messageType": "UpdatePartyProfile", + "messageTypeLocal": null, + "oneofIndex": 0, + "oneofName": "command" + }, { "name": "nodeVote", "number": 2002, @@ -3024,34 +3052,6 @@ "messageTypeLocal": null, "oneofIndex": 0, "oneofName": "command" - }, - { - "name": "batchProposalSubmission", - "number": 3002, - "type": "message", - "wireType": "bytes", - "repeated": false, - "packed": false, - "optional": false, - "typeName": ".vega.commands.v1.BatchProposalSubmission", - "messageType": "BatchProposalSubmission", - "messageTypeLocal": null, - "oneofIndex": 0, - "oneofName": "command" - }, - { - "name": "updatePartyProfile", - "number": 3003, - "type": "message", - "wireType": "bytes", - "repeated": false, - "packed": false, - "optional": false, - "typeName": ".vega.commands.v1.UpdatePartyProfile", - "messageType": "UpdatePartyProfile", - "messageTypeLocal": null, - "oneofIndex": 0, - "oneofName": "command" } ] }, @@ -6703,7 +6703,7 @@ "oneofName": null }, { - "name": "indexPriceConfig", + "name": "internalCompositePriceConfig", "number": 13, "type": "message", "wireType": "bytes", @@ -11432,7 +11432,7 @@ "oneofIndex": null }, { - "name": "indexPrice", + "name": "internalCompositePrice", "number": 7, "type": "string", "wireType": "bytes", @@ -11444,7 +11444,7 @@ "oneofIndex": null }, { - "name": "nextIndexPriceCalc", + "name": "nextInternalCompositePriceCalc", "number": 8, "type": "int64", "wireType": "varint", @@ -11456,7 +11456,7 @@ "oneofIndex": null }, { - "name": "indexPriceType", + "name": "internalCompositePriceType", "number": 9, "type": "enumerable", "wireType": "varint", @@ -15191,7 +15191,7 @@ "oneofName": null }, { - "name": "indexPriceConfiguration", + "name": "internalCompositePriceConfiguration", "number": 13, "type": "message", "wireType": "bytes", @@ -16349,7 +16349,7 @@ "oneofName": null }, { - "name": "indexPriceConfiguration", + "name": "internalCompositePriceConfiguration", "number": 13, "type": "message", "wireType": "bytes", diff --git a/package.json b/package.json index bb88582..0c93882 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vegaprotocol/protos", - "version": "0.12.0", + "version": "0.13.0", "description": "Protocol Buffer messages for Vega in Javascript", "scripts": { "test": "brittle tests/**/*.js" diff --git a/tests/proposal-regression.js b/tests/proposal-regression.js index 77efeeb..7cae680 100644 --- a/tests/proposal-regression.js +++ b/tests/proposal-regression.js @@ -243,7 +243,7 @@ test("encode then decode proposal submission", (assert) => { fundingRateScalingFactor: null, fundingRateLowerBound: null, fundingRateUpperBound: null, - indexPriceConfiguration: null, + internalCompositePriceConfiguration: null, }, }, }, @@ -328,6 +328,7 @@ test("encode then decode proposal submission", (assert) => { }; const actual = InputData.decode(InputData.encode({ proposalSubmission })); + assert.alike(actual, expected); assert.end(); diff --git a/vega/Perpetual.d.ts b/vega/Perpetual.d.ts index f4bb779..fdecda9 100644 --- a/vega/Perpetual.d.ts +++ b/vega/Perpetual.d.ts @@ -19,5 +19,5 @@ export type Perpetual = { fundingRateScalingFactor: string | null fundingRateLowerBound: string | null fundingRateUpperBound: string | null - indexPriceConfig: CompositePriceConfiguration | null + internalCompositePriceConfig: CompositePriceConfiguration | null } diff --git a/vega/Perpetual/decode.js b/vega/Perpetual/decode.js index 0548d9c..300b74f 100644 --- a/vega/Perpetual/decode.js +++ b/vega/Perpetual/decode.js @@ -22,7 +22,7 @@ exports.decode = function decode( let field$fundingRateScalingFactor = null let field$fundingRateLowerBound = null let field$fundingRateUpperBound = null - let field$indexPriceConfig = null + let field$internalCompositePriceConfig = null for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { switch (field) { case 1: @@ -77,7 +77,8 @@ exports.decode = function decode( break case 13: - field$indexPriceConfig = _vega_CompositePriceConfiguration.decode(data) + field$internalCompositePriceConfig = + _vega_CompositePriceConfiguration.decode(data) break } } @@ -95,6 +96,6 @@ exports.decode = function decode( fundingRateScalingFactor: field$fundingRateScalingFactor, fundingRateLowerBound: field$fundingRateLowerBound, fundingRateUpperBound: field$fundingRateUpperBound, - indexPriceConfig: field$indexPriceConfig + internalCompositePriceConfig: field$internalCompositePriceConfig } } diff --git a/vega/Perpetual/encode.js b/vega/Perpetual/encode.js index 2435dda..8a02170 100644 --- a/vega/Perpetual/encode.js +++ b/vega/Perpetual/encode.js @@ -35,10 +35,10 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) { writer.bytes(11, obj.fundingRateLowerBound, string) if (obj.fundingRateUpperBound) writer.bytes(12, obj.fundingRateUpperBound, string) - if (obj.indexPriceConfig) + if (obj.internalCompositePriceConfig) writer.bytes( 13, - _vega_CompositePriceConfiguration.encode(obj.indexPriceConfig) + _vega_CompositePriceConfiguration.encode(obj.internalCompositePriceConfig) ) return writer.concat(buf, byteOffset) diff --git a/vega/PerpetualData.d.ts b/vega/PerpetualData.d.ts index 032bf1d..629512c 100644 --- a/vega/PerpetualData.d.ts +++ b/vega/PerpetualData.d.ts @@ -11,7 +11,7 @@ export type PerpetualData = { externalTwap: string seqNum: bigint startTime: bigint - indexPrice: string - nextIndexPriceCalc: bigint - indexPriceType: CompositePriceType + internalCompositePrice: string + nextInternalCompositePriceCalc: bigint + internalCompositePriceType: CompositePriceType } diff --git a/vega/PerpetualData/decode.js b/vega/PerpetualData/decode.js index 262b084..919ac26 100644 --- a/vega/PerpetualData/decode.js +++ b/vega/PerpetualData/decode.js @@ -14,9 +14,9 @@ exports.decode = function decode( let field$externalTwap = '' let field$seqNum = 0n let field$startTime = 0n - let field$indexPrice = '' - let field$nextIndexPriceCalc = 0n - let field$indexPriceType = _vega_CompositePriceType.decode(0) + let field$internalCompositePrice = '' + let field$nextInternalCompositePriceCalc = 0n + let field$internalCompositePriceType = _vega_CompositePriceType.decode(0) for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { switch (field) { case 1: @@ -44,15 +44,15 @@ exports.decode = function decode( break case 7: - field$indexPrice = string(data) + field$internalCompositePrice = string(data) break case 8: - field$nextIndexPriceCalc = int64(data) + field$nextInternalCompositePriceCalc = int64(data) break case 9: - field$indexPriceType = _vega_CompositePriceType.decode(data) + field$internalCompositePriceType = _vega_CompositePriceType.decode(data) break } } @@ -63,8 +63,8 @@ exports.decode = function decode( externalTwap: field$externalTwap, seqNum: field$seqNum, startTime: field$startTime, - indexPrice: field$indexPrice, - nextIndexPriceCalc: field$nextIndexPriceCalc, - indexPriceType: field$indexPriceType + internalCompositePrice: field$internalCompositePrice, + nextInternalCompositePriceCalc: field$nextInternalCompositePriceCalc, + internalCompositePriceType: field$internalCompositePriceType } } diff --git a/vega/PerpetualData/encode.js b/vega/PerpetualData/encode.js index f75f24d..2597030 100644 --- a/vega/PerpetualData/encode.js +++ b/vega/PerpetualData/encode.js @@ -12,10 +12,12 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) { if (obj.externalTwap) writer.bytes(4, obj.externalTwap, string) if (obj.seqNum) writer.varint(5, obj.seqNum, uint64) if (obj.startTime) writer.varint(6, obj.startTime, int64) - if (obj.indexPrice) writer.bytes(7, obj.indexPrice, string) - if (obj.nextIndexPriceCalc) writer.varint(8, obj.nextIndexPriceCalc, int64) - if (obj.indexPriceType) - writer.varint(9, obj.indexPriceType, _vega_CompositePriceType) + if (obj.internalCompositePrice) + writer.bytes(7, obj.internalCompositePrice, string) + if (obj.nextInternalCompositePriceCalc) + writer.varint(8, obj.nextInternalCompositePriceCalc, int64) + if (obj.internalCompositePriceType) + writer.varint(9, obj.internalCompositePriceType, _vega_CompositePriceType) return writer.concat(buf, byteOffset) } diff --git a/vega/PerpetualProduct.d.ts b/vega/PerpetualProduct.d.ts index a3e6a0a..8474ea1 100644 --- a/vega/PerpetualProduct.d.ts +++ b/vega/PerpetualProduct.d.ts @@ -19,5 +19,5 @@ export type PerpetualProduct = { fundingRateScalingFactor: string | null fundingRateLowerBound: string | null fundingRateUpperBound: string | null - indexPriceConfiguration: CompositePriceConfiguration | null + internalCompositePriceConfiguration: CompositePriceConfiguration | null } diff --git a/vega/PerpetualProduct/decode.js b/vega/PerpetualProduct/decode.js index e1dd5bd..a7ab376 100644 --- a/vega/PerpetualProduct/decode.js +++ b/vega/PerpetualProduct/decode.js @@ -22,7 +22,7 @@ exports.decode = function decode( let field$fundingRateScalingFactor = null let field$fundingRateLowerBound = null let field$fundingRateUpperBound = null - let field$indexPriceConfiguration = null + let field$internalCompositePriceConfiguration = null for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { switch (field) { case 1: @@ -77,7 +77,7 @@ exports.decode = function decode( break case 13: - field$indexPriceConfiguration = + field$internalCompositePriceConfiguration = _vega_CompositePriceConfiguration.decode(data) break } @@ -96,6 +96,7 @@ exports.decode = function decode( fundingRateScalingFactor: field$fundingRateScalingFactor, fundingRateLowerBound: field$fundingRateLowerBound, fundingRateUpperBound: field$fundingRateUpperBound, - indexPriceConfiguration: field$indexPriceConfiguration + internalCompositePriceConfiguration: + field$internalCompositePriceConfiguration } } diff --git a/vega/PerpetualProduct/encode.js b/vega/PerpetualProduct/encode.js index 55e7449..dd91d9b 100644 --- a/vega/PerpetualProduct/encode.js +++ b/vega/PerpetualProduct/encode.js @@ -35,10 +35,12 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) { writer.bytes(11, obj.fundingRateLowerBound, string) if (obj.fundingRateUpperBound) writer.bytes(12, obj.fundingRateUpperBound, string) - if (obj.indexPriceConfiguration) + if (obj.internalCompositePriceConfiguration) writer.bytes( 13, - _vega_CompositePriceConfiguration.encode(obj.indexPriceConfiguration) + _vega_CompositePriceConfiguration.encode( + obj.internalCompositePriceConfiguration + ) ) return writer.concat(buf, byteOffset) diff --git a/vega/UpdatePerpetualProduct.d.ts b/vega/UpdatePerpetualProduct.d.ts index b9e2f27..318d991 100644 --- a/vega/UpdatePerpetualProduct.d.ts +++ b/vega/UpdatePerpetualProduct.d.ts @@ -18,5 +18,5 @@ export type UpdatePerpetualProduct = { fundingRateScalingFactor: string | null fundingRateLowerBound: string | null fundingRateUpperBound: string | null - indexPriceConfiguration: CompositePriceConfiguration | null + internalCompositePriceConfiguration: CompositePriceConfiguration | null } diff --git a/vega/UpdatePerpetualProduct/decode.js b/vega/UpdatePerpetualProduct/decode.js index 489b743..dcbcbff 100644 --- a/vega/UpdatePerpetualProduct/decode.js +++ b/vega/UpdatePerpetualProduct/decode.js @@ -21,7 +21,7 @@ exports.decode = function decode( let field$fundingRateScalingFactor = null let field$fundingRateLowerBound = null let field$fundingRateUpperBound = null - let field$indexPriceConfiguration = null + let field$internalCompositePriceConfiguration = null for (const [field, { data }] of reader(buf, byteOffset, byteLength)) { switch (field) { case 1: @@ -72,7 +72,7 @@ exports.decode = function decode( break case 13: - field$indexPriceConfiguration = + field$internalCompositePriceConfiguration = _vega_CompositePriceConfiguration.decode(data) break } @@ -90,6 +90,7 @@ exports.decode = function decode( fundingRateScalingFactor: field$fundingRateScalingFactor, fundingRateLowerBound: field$fundingRateLowerBound, fundingRateUpperBound: field$fundingRateUpperBound, - indexPriceConfiguration: field$indexPriceConfiguration + internalCompositePriceConfiguration: + field$internalCompositePriceConfiguration } } diff --git a/vega/UpdatePerpetualProduct/encode.js b/vega/UpdatePerpetualProduct/encode.js index 2df144a..86fc073 100644 --- a/vega/UpdatePerpetualProduct/encode.js +++ b/vega/UpdatePerpetualProduct/encode.js @@ -34,10 +34,12 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) { writer.bytes(10, obj.fundingRateLowerBound, string) if (obj.fundingRateUpperBound) writer.bytes(11, obj.fundingRateUpperBound, string) - if (obj.indexPriceConfiguration) + if (obj.internalCompositePriceConfiguration) writer.bytes( 13, - _vega_CompositePriceConfiguration.encode(obj.indexPriceConfiguration) + _vega_CompositePriceConfiguration.encode( + obj.internalCompositePriceConfiguration + ) ) return writer.concat(buf, byteOffset) diff --git a/vega/commands/v1/InputData.d.ts b/vega/commands/v1/InputData.d.ts index 10a2957..4649a1d 100644 --- a/vega/commands/v1/InputData.d.ts +++ b/vega/commands/v1/InputData.d.ts @@ -21,6 +21,8 @@ import type { UpdateReferralSet } from './UpdateReferralSet' import type { ApplyReferralCode } from './ApplyReferralCode' import type { UpdateMarginMode } from './UpdateMarginMode' import type { JoinTeam } from './JoinTeam' +import type { BatchProposalSubmission } from './BatchProposalSubmission' +import type { UpdatePartyProfile } from './UpdatePartyProfile' import type { NodeVote } from './NodeVote' import type { NodeSignature } from './NodeSignature' import type { ChainEvent } from './ChainEvent' @@ -31,8 +33,6 @@ import type { EthereumKeyRotateSubmission } from './EthereumKeyRotateSubmission' import type { ProtocolUpgradeProposal } from './ProtocolUpgradeProposal' import type { IssueSignatures } from './IssueSignatures' import type { OracleDataSubmission } from './OracleDataSubmission' -import type { BatchProposalSubmission } from './BatchProposalSubmission' -import type { UpdatePartyProfile } from './UpdatePartyProfile' export * from './InputData/encode.js' export * from './InputData/decode.js' @@ -63,6 +63,8 @@ export type InputData = { | { applyReferralCode: ApplyReferralCode } | { updateMarginMode: UpdateMarginMode } | { joinTeam: JoinTeam } + | { batchProposalSubmission: BatchProposalSubmission } + | { updatePartyProfile: UpdatePartyProfile } | { nodeVote: NodeVote } | { nodeSignature: NodeSignature } | { chainEvent: ChainEvent } @@ -73,7 +75,5 @@ export type InputData = { | { protocolUpgradeProposal: ProtocolUpgradeProposal } | { issueSignatures: IssueSignatures } | { oracleDataSubmission: OracleDataSubmission } - | { batchProposalSubmission: BatchProposalSubmission } - | { updatePartyProfile: UpdatePartyProfile } | null } diff --git a/vega/commands/v1/InputData/decode.js b/vega/commands/v1/InputData/decode.js index f9c1511..fb067e7 100644 --- a/vega/commands/v1/InputData/decode.js +++ b/vega/commands/v1/InputData/decode.js @@ -23,6 +23,8 @@ const _vega_commands_v1_UpdateReferralSet = require('./../UpdateReferralSet/deco const _vega_commands_v1_ApplyReferralCode = require('./../ApplyReferralCode/decode.js') const _vega_commands_v1_UpdateMarginMode = require('./../UpdateMarginMode/decode.js') const _vega_commands_v1_JoinTeam = require('./../JoinTeam/decode.js') +const _vega_commands_v1_BatchProposalSubmission = require('./../BatchProposalSubmission/decode.js') +const _vega_commands_v1_UpdatePartyProfile = require('./../UpdatePartyProfile/decode.js') const _vega_commands_v1_NodeVote = require('./../NodeVote/decode.js') const _vega_commands_v1_NodeSignature = require('./../NodeSignature/decode.js') const _vega_commands_v1_ChainEvent = require('./../ChainEvent/decode.js') @@ -33,8 +35,6 @@ const _vega_commands_v1_EthereumKeyRotateSubmission = require('./../EthereumKeyR const _vega_commands_v1_ProtocolUpgradeProposal = require('./../ProtocolUpgradeProposal/decode.js') const _vega_commands_v1_IssueSignatures = require('./../IssueSignatures/decode.js') const _vega_commands_v1_OracleDataSubmission = require('./../OracleDataSubmission/decode.js') -const _vega_commands_v1_BatchProposalSubmission = require('./../BatchProposalSubmission/decode.js') -const _vega_commands_v1_UpdatePartyProfile = require('./../UpdatePartyProfile/decode.js') exports.decode = function decode( buf, @@ -189,6 +189,19 @@ exports.decode = function decode( field$command = { joinTeam: _vega_commands_v1_JoinTeam.decode(data) } break + case 1023: + field$command = { + batchProposalSubmission: + _vega_commands_v1_BatchProposalSubmission.decode(data) + } + break + + case 1024: + field$command = { + updatePartyProfile: _vega_commands_v1_UpdatePartyProfile.decode(data) + } + break + case 2002: field$command = { nodeVote: _vega_commands_v1_NodeVote.decode(data) } break @@ -251,19 +264,6 @@ exports.decode = function decode( _vega_commands_v1_OracleDataSubmission.decode(data) } break - - case 3002: - field$command = { - batchProposalSubmission: - _vega_commands_v1_BatchProposalSubmission.decode(data) - } - break - - case 3003: - field$command = { - updatePartyProfile: _vega_commands_v1_UpdatePartyProfile.decode(data) - } - break } } return { diff --git a/vega/commands/v1/InputData/encode.js b/vega/commands/v1/InputData/encode.js index 18a007c..d98ca6a 100644 --- a/vega/commands/v1/InputData/encode.js +++ b/vega/commands/v1/InputData/encode.js @@ -23,6 +23,8 @@ const _vega_commands_v1_UpdateReferralSet = require('./../UpdateReferralSet/enco const _vega_commands_v1_ApplyReferralCode = require('./../ApplyReferralCode/encode.js') const _vega_commands_v1_UpdateMarginMode = require('./../UpdateMarginMode/encode.js') const _vega_commands_v1_JoinTeam = require('./../JoinTeam/encode.js') +const _vega_commands_v1_BatchProposalSubmission = require('./../BatchProposalSubmission/encode.js') +const _vega_commands_v1_UpdatePartyProfile = require('./../UpdatePartyProfile/encode.js') const _vega_commands_v1_NodeVote = require('./../NodeVote/encode.js') const _vega_commands_v1_NodeSignature = require('./../NodeSignature/encode.js') const _vega_commands_v1_ChainEvent = require('./../ChainEvent/encode.js') @@ -33,8 +35,6 @@ const _vega_commands_v1_EthereumKeyRotateSubmission = require('./../EthereumKeyR const _vega_commands_v1_ProtocolUpgradeProposal = require('./../ProtocolUpgradeProposal/encode.js') const _vega_commands_v1_IssueSignatures = require('./../IssueSignatures/encode.js') const _vega_commands_v1_OracleDataSubmission = require('./../OracleDataSubmission/encode.js') -const _vega_commands_v1_BatchProposalSubmission = require('./../BatchProposalSubmission/encode.js') -const _vega_commands_v1_UpdatePartyProfile = require('./../UpdatePartyProfile/encode.js') exports.encode = function encode(obj = {}, buf, byteOffset = 0) { const writer = new Writer() @@ -204,6 +204,20 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) { 1022, _vega_commands_v1_JoinTeam.encode(obj.command?.joinTeam ?? obj.joinTeam) ) + if (obj.command?.batchProposalSubmission ?? obj.batchProposalSubmission) + writer.bytes( + 1023, + _vega_commands_v1_BatchProposalSubmission.encode( + obj.command?.batchProposalSubmission ?? obj.batchProposalSubmission + ) + ) + if (obj.command?.updatePartyProfile ?? obj.updatePartyProfile) + writer.bytes( + 1024, + _vega_commands_v1_UpdatePartyProfile.encode( + obj.command?.updatePartyProfile ?? obj.updatePartyProfile + ) + ) if (obj.command?.nodeVote ?? obj.nodeVote) writer.bytes( 2002, @@ -276,20 +290,6 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) { obj.command?.oracleDataSubmission ?? obj.oracleDataSubmission ) ) - if (obj.command?.batchProposalSubmission ?? obj.batchProposalSubmission) - writer.bytes( - 3002, - _vega_commands_v1_BatchProposalSubmission.encode( - obj.command?.batchProposalSubmission ?? obj.batchProposalSubmission - ) - ) - if (obj.command?.updatePartyProfile ?? obj.updatePartyProfile) - writer.bytes( - 3003, - _vega_commands_v1_UpdatePartyProfile.encode( - obj.command?.updatePartyProfile ?? obj.updatePartyProfile - ) - ) return writer.concat(buf, byteOffset) } diff --git a/vendor/vega b/vendor/vega index 3f254c9..66bcf71 160000 --- a/vendor/vega +++ b/vendor/vega @@ -1 +1 @@ -Subproject commit 3f254c95a2799f0d6af12ebc99b0f41588a8cb03 +Subproject commit 66bcf719733532453425536983fff337a2bd41ec