File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 },
Original file line number Diff line number Diff line change @@ -25,11 +25,10 @@ import * as sdk from 'blue-js-sdk';
2525type EncodedMsg = { typeUrl : string ; value : unknown } ;
2626type 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.
3332function 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}
You can’t perform that action at this time.
0 commit comments