Skip to content

Commit 07a37f3

Browse files
authored
Merge pull request #13 from Sentinel-Bluebuilder/claude/quirky-hofstadter-d0913b
fix(server): bump blue-js-sdk to 2.7.2 — fixes MsgShareSubscription w…
2 parents aa43f39 + 7f1f0f8 commit 07a37f3

3 files changed

Lines changed: 66 additions & 96 deletions

File tree

server/package-lock.json

Lines changed: 60 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@x402/evm": "^2.9.0",
1414
"@x402/express": "^2.9.0",
1515
"@x402/fetch": "^2.10.0",
16-
"blue-js-sdk": "^2.0.3",
16+
"blue-js-sdk": "^2.7.2",
1717
"dotenv": "^16.4.0",
1818
"express": "^4.18.0"
1919
},

server/src/sentinel.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ import * as sdk from 'blue-js-sdk';
2525
type EncodedMsg = { typeUrl: string; value: unknown };
2626
type BroadcastResult = { code: number; transactionHash: string; rawLog?: string };
2727

28-
// Build MsgShareSubscription manually — the SDK version has a camelCase/snake_case mismatch
29-
// between buildMsgShareSubscription (outputs acc_address) and encodeMsgShareSubscription
30-
// (reads accAddress). Field 4 (bytes) is cosmossdk.io/math.Int and must serialize as a
31-
// length-prefixed string on the wire; passing a JS number causes the encoder to emit
32-
// varint and the chain rejects with a wire-type mismatch.
28+
// Build MsgShareSubscription manually — the SDK exports buildMsgShareSubscription
29+
// with an acc_address (snake_case) shape while its internal encoder reads accAddress
30+
// (camelCase). Including both keys keeps the encoder happy regardless of which form
31+
// it consumes.
3332
function buildMsgShareSubscription(opts: {
3433
from: string; id: number; accAddress: string; bytes: number;
3534
}): EncodedMsg {
@@ -40,7 +39,7 @@ function buildMsgShareSubscription(opts: {
4039
id: opts.id,
4140
accAddress: opts.accAddress,
4241
acc_address: opts.accAddress,
43-
bytes: String(opts.bytes),
42+
bytes: opts.bytes,
4443
},
4544
};
4645
}

0 commit comments

Comments
 (0)