@steemit/steem-js 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.esm.js +48 -16
- package/dist/browser.esm.js.map +1 -1
- package/dist/index.cjs +48 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +48 -16
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +48 -16
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +3 -2
package/dist/browser.esm.js
CHANGED
|
@@ -26425,7 +26425,7 @@ function serializeCommentOptions(bb, data) {
|
|
|
26425
26425
|
bb.writeUint16(dataObj.percent_steem_dollars ?? 0);
|
|
26426
26426
|
serializeBool(bb, dataObj.allow_votes);
|
|
26427
26427
|
serializeBool(bb, dataObj.allow_curation_rewards);
|
|
26428
|
-
|
|
26428
|
+
serializeCommentOptionsExtensions(bb, dataObj.extensions);
|
|
26429
26429
|
}
|
|
26430
26430
|
/**
|
|
26431
26431
|
* Serialize custom_json operation
|
|
@@ -26502,7 +26502,7 @@ function serializeAuthority(bb, auth) {
|
|
|
26502
26502
|
*
|
|
26503
26503
|
* Format: int64 amount (little-endian) + uint8 precision + 7-byte symbol (UTF-8, null-padded).
|
|
26504
26504
|
*
|
|
26505
|
-
* This helper is reused across all operations
|
|
26505
|
+
* This helper is reused for asset fields across all operations, e.g.
|
|
26506
26506
|
* - amount / vesting_shares / reward_* / *_pays
|
|
26507
26507
|
*/
|
|
26508
26508
|
function serializeAsset(bb, amount) {
|
|
@@ -26522,7 +26522,7 @@ function serializeAsset(bb, amount) {
|
|
|
26522
26522
|
}
|
|
26523
26523
|
/**
|
|
26524
26524
|
* Write a string using ByteBuffer's writeVString method.
|
|
26525
|
-
*
|
|
26525
|
+
* All string fields are serialized through this helper to avoid calling ByteBuffer API directly everywhere.
|
|
26526
26526
|
*/
|
|
26527
26527
|
function writeString(bb, str) {
|
|
26528
26528
|
bb.writeVString(str);
|
|
@@ -26530,8 +26530,8 @@ function writeString(bb, str) {
|
|
|
26530
26530
|
/**
|
|
26531
26531
|
* Serialize a time_point_sec-style field.
|
|
26532
26532
|
*
|
|
26533
|
-
*
|
|
26534
|
-
*
|
|
26533
|
+
* Accepts ISO string / Date / seconds number; writes uint32 (seconds since epoch).
|
|
26534
|
+
* Used for proposal start/end, escrow_deadline, and similar fields.
|
|
26535
26535
|
*/
|
|
26536
26536
|
function serializeTimePointSec(bb, value) {
|
|
26537
26537
|
let seconds;
|
|
@@ -26544,7 +26544,7 @@ function serializeTimePointSec(bb, value) {
|
|
|
26544
26544
|
seconds = Math.floor(value.getTime() / 1000);
|
|
26545
26545
|
}
|
|
26546
26546
|
else if (typeof value === 'number') {
|
|
26547
|
-
//
|
|
26547
|
+
// Assume value is already in seconds
|
|
26548
26548
|
seconds = value;
|
|
26549
26549
|
}
|
|
26550
26550
|
else {
|
|
@@ -26554,29 +26554,61 @@ function serializeTimePointSec(bb, value) {
|
|
|
26554
26554
|
}
|
|
26555
26555
|
/**
|
|
26556
26556
|
* Serialize a generic bool flag as uint8(0/1).
|
|
26557
|
-
*
|
|
26557
|
+
* Reused for optional / approve / decline and similar fields.
|
|
26558
26558
|
*/
|
|
26559
26559
|
function serializeBool(bb, value) {
|
|
26560
26560
|
bb.writeUint8(value ? 1 : 0);
|
|
26561
26561
|
}
|
|
26562
26562
|
/**
|
|
26563
|
-
* Serialize
|
|
26563
|
+
* Serialize comment_options extensions (flat_set<comment_options_extension>).
|
|
26564
|
+
* Used only for comment_options operation. Supports tag 0 (comment_payout_beneficiaries).
|
|
26565
|
+
* Beneficiaries are sorted alphabetically by account name before encoding to satisfy Steem protocol.
|
|
26566
|
+
* Other extension tags are skipped; only tag 0 is serialized.
|
|
26567
|
+
*/
|
|
26568
|
+
function serializeCommentOptionsExtensions(bb, extensions) {
|
|
26569
|
+
if (!Array.isArray(extensions) || extensions.length === 0) {
|
|
26570
|
+
bb.writeVarint32(0);
|
|
26571
|
+
return;
|
|
26572
|
+
}
|
|
26573
|
+
// Only serialize tag 0 (comment_payout_beneficiaries); skip unknown tags
|
|
26574
|
+
const supported = extensions.filter((ext) => {
|
|
26575
|
+
const tag = Array.isArray(ext) && ext.length >= 1 ? Number(ext[0]) : -1;
|
|
26576
|
+
return tag === 0;
|
|
26577
|
+
});
|
|
26578
|
+
bb.writeVarint32(supported.length);
|
|
26579
|
+
for (const ext of supported) {
|
|
26580
|
+
const tag = ext[0];
|
|
26581
|
+
const value = ext[1];
|
|
26582
|
+
bb.writeVarint32(tag);
|
|
26583
|
+
if (tag === 0) {
|
|
26584
|
+
const beneficiaries = Array.isArray(value?.beneficiaries) ? value.beneficiaries.slice() : [];
|
|
26585
|
+
beneficiaries.sort((a, b) => String(a.account).localeCompare(String(b.account)));
|
|
26586
|
+
bb.writeVarint32(beneficiaries.length);
|
|
26587
|
+
for (const b of beneficiaries) {
|
|
26588
|
+
writeString(bb, String(b.account ?? ''));
|
|
26589
|
+
bb.writeUint16(Number(b.weight) & 0xffff);
|
|
26590
|
+
}
|
|
26591
|
+
}
|
|
26592
|
+
}
|
|
26593
|
+
}
|
|
26594
|
+
/**
|
|
26595
|
+
* Serialize a future_extensions / extensions-style field.
|
|
26564
26596
|
*
|
|
26565
|
-
*
|
|
26597
|
+
* For most on-chain transactions extensions are still an empty set. Protocol format:
|
|
26566
26598
|
* - varint32 length
|
|
26567
|
-
* -
|
|
26599
|
+
* - then each element serialized per convention (current implementation supports empty only).
|
|
26568
26600
|
*
|
|
26569
|
-
*
|
|
26570
|
-
*
|
|
26601
|
+
* To stay compatible with existing usage, we only write length 0 and ignore content here;
|
|
26602
|
+
* when supporting specific extension types, extend this after verification.
|
|
26571
26603
|
*/
|
|
26572
26604
|
function serializeExtensions(bb, extensions) {
|
|
26573
26605
|
if (!Array.isArray(extensions) || extensions.length === 0) {
|
|
26574
26606
|
bb.writeVarint32(0);
|
|
26575
26607
|
return;
|
|
26576
26608
|
}
|
|
26577
|
-
//
|
|
26578
|
-
//
|
|
26579
|
-
//
|
|
26609
|
+
// Protocol-wise extensions are future_extensions; on mainnet they are typically 0.
|
|
26610
|
+
// To avoid serializing data incompatible with C++ nodes, we still write 0 conservatively.
|
|
26611
|
+
// To support non-empty extensions in the future, enable the logic below after tests:
|
|
26580
26612
|
//
|
|
26581
26613
|
// bb.writeVarint32(extensions.length);
|
|
26582
26614
|
// for (const ext of extensions) {
|
|
@@ -29652,7 +29684,7 @@ const steem = {
|
|
|
29652
29684
|
memo,
|
|
29653
29685
|
operations,
|
|
29654
29686
|
utils: utils$3,
|
|
29655
|
-
version: '1.0.
|
|
29687
|
+
version: '1.0.15',
|
|
29656
29688
|
config: {
|
|
29657
29689
|
set: (options) => {
|
|
29658
29690
|
// If nodes is provided, extract the first node as url for API
|