viz-js-lib 0.15.0 → 0.17.0

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.
@@ -39,9 +39,9 @@ const METHODS = [
39
39
  {api:"database_api",method:"get_vesting_delegations",params:["account","from","limit","type"]},
40
40
  {api:"database_api",method:"get_expiring_vesting_delegations",params:["account","from","limit"]},
41
41
  {api:"database_api",method:"get_proposed_transactions",params:["account","from","limit"]},
42
- {api:"database_api",method:"get_accounts_on_sale",params:["from","limit"]},
43
- {api:"database_api",method:"get_accounts_on_auction",params:["from","limit"]},
44
- {api:"database_api",method:"get_subaccounts_on_sale",params:["from","limit"]},
42
+ {api:"database_api",method:"get_accounts_on_sale",params:["from","limit","name_prefix"]},
43
+ {api:"database_api",method:"get_accounts_on_auction",params:["from","limit","name_prefix"]},
44
+ {api:"database_api",method:"get_subaccounts_on_sale",params:["from","limit","name_prefix"]},
45
45
  {api:"account_by_key",method:"get_key_references",params:["account_name_type"]},
46
46
  {api:"network_broadcast_api",method:"broadcast_transaction",params:["trx"]},
47
47
  {api:"network_broadcast_api",method:"broadcast_transaction_with_callback",params:["confirmationCallback","trx"]},
@@ -53,7 +53,7 @@ const METHODS = [
53
53
  {api:"invite_api",method:"get_invites_list",params:["status"]},
54
54
  {api:"invite_api",method:"get_invite_by_id",params:["id"]},
55
55
  {api:"invite_api",method:"get_invite_by_key",params:["invite_key"]},
56
- {api:"paid_subscription_api",method:"get_paid_subscriptions",params:["from","limit"]},
56
+ {api:"paid_subscription_api",method:"get_paid_subscriptions",params:["from","limit","creator_prefix"]},
57
57
  {api:"paid_subscription_api",method:"get_paid_subscription_options",params:["account"]},
58
58
  {api:"paid_subscription_api",method:"get_paid_subscription_status",params:["subscriber","account"]},
59
59
  {api:"paid_subscription_api",method:"get_active_paid_subscriptions",params:["subscriber"]},
@@ -418,9 +418,9 @@ const SPEC = {
418
418
  get_vesting_delegations: {d:"Returns vesting delegation objects for a given account with pagination.",p:{account:{c:"Account Name",d:"The delegator or delegatee account name."},from:{c:"From",d:"Account name to start from for pagination."},limit:{c:"Limit",d:"Maximum number of results (default 100, max 1000)."},type:{c:"Delegation Type",d:"Filter: 'delegated' (sent) or 'received'."}}},
419
419
  get_expiring_vesting_delegations: {d:"Returns expiring vesting delegation objects for a given account.",p:{account:{c:"Account Name",d:"The delegator account name."},from:{c:"From Date",d:"Start date/time for expiration lookup (ISO timestamp)."},limit:{c:"Limit",d:"Maximum number of results (default 100, max 1000)."}}},
420
420
  get_proposed_transactions: {d:"Returns proposed transactions (proposals) associated with a given account.",p:{account:{c:"Account Name",d:"The account name whose proposals to retrieve."},from:{c:"From Offset",d:"Offset for pagination (number of results to skip)."},limit:{c:"Limit",d:"Maximum number of proposals to return (max 100)."}}},
421
- get_accounts_on_sale: {d:"Returns accounts currently on sale (direct sale, not auction).",p:{from:{c:"From Offset",d:"Number of results to skip for pagination."},limit:{c:"Limit",d:"Maximum number of results (max 1000)."}}},
422
- get_accounts_on_auction: {d:"Returns accounts currently on auction (no target buyer set).",p:{from:{c:"From Offset",d:"Number of results to skip for pagination."},limit:{c:"Limit",d:"Maximum number of results (max 1000)."}}},
423
- get_subaccounts_on_sale: {d:"Returns subaccounts currently on sale.",p:{from:{c:"From Offset",d:"Number of results to skip for pagination."},limit:{c:"Limit",d:"Maximum number of results (max 1000)."}}}
421
+ get_accounts_on_sale: {d:"Returns accounts currently on sale (direct sale, not auction).",p:{from:{c:"From Offset",d:"Number of results to skip for pagination."},limit:{c:"Limit",d:"Maximum number of results (max 1000)."},name_prefix:{c:"Name Prefix",d:"Optional. Only accounts whose name starts with this prefix. Matched against the account-name index, so it searches the whole set and finds accounts past the first page. Empty or omitted returns all."}}},
422
+ get_accounts_on_auction: {d:"Returns accounts currently on auction (no target buyer set).",p:{from:{c:"From Offset",d:"Number of results to skip for pagination."},limit:{c:"Limit",d:"Maximum number of results (max 1000)."},name_prefix:{c:"Name Prefix",d:"Optional. Only accounts whose name starts with this prefix. Matched against the account-name index, so it searches the whole set and finds accounts past the first page. Empty or omitted returns all."}}},
423
+ get_subaccounts_on_sale: {d:"Returns subaccounts currently on sale.",p:{from:{c:"From Offset",d:"Number of results to skip for pagination."},limit:{c:"Limit",d:"Maximum number of results (max 1000)."},name_prefix:{c:"Name Prefix",d:"Optional. Only subaccounts whose name starts with this prefix. Matched against the account-name index, so it searches the whole set and finds subaccounts past the first page. Empty or omitted returns all."}}}
424
424
  },
425
425
  account_by_key: {
426
426
  get_key_references: {d:"Returns all account names that reference the given public keys in their authority.",p:{account_name_type:{c:"Public Keys",d:"Array of public keys to look up.",t:"array"}}}
@@ -442,7 +442,7 @@ const SPEC = {
442
442
  get_invite_by_key: {d:"Returns an invite object by its public key.",p:{invite_key:{c:"Invite Key",d:"The public key associated with the invite."}}}
443
443
  },
444
444
  paid_subscription_api: {
445
- get_paid_subscriptions: {d:"Returns a paginated list of all paid subscription objects.",p:{from:{c:"From Offset",d:"Number of results to skip for pagination."},limit:{c:"Limit",d:"Maximum number of results (max 1000)."}}},
445
+ get_paid_subscriptions: {d:"Returns a paginated list of all paid subscription objects.",p:{from:{c:"From Offset",d:"Number of results to skip for pagination."},limit:{c:"Limit",d:"Maximum number of results (max 1000)."},creator_prefix:{c:"Creator Prefix",d:"Optional. Only subscriptions whose creator account name starts with this prefix. Matched against the creator index, so it searches the whole set and finds subscriptions past the first page. Empty or omitted returns all."}}},
446
446
  get_paid_subscription_options: {d:"Returns the paid subscription settings for a given account (creator).",p:{account:{c:"Account Name",d:"The account name of the subscription creator."}}},
447
447
  get_paid_subscription_status: {d:"Returns the subscription status of a specific subscriber for a given creator.",p:{subscriber:{c:"Subscriber",d:"The account name of the subscriber."},account:{c:"Creator Account",d:"The account name of the subscription creator."}}},
448
448
  get_active_paid_subscriptions: {d:"Returns creator accounts that a given subscriber has active subscriptions to.",p:{subscriber:{c:"Subscriber",d:"The account name of the subscriber."}}},
@@ -643,29 +643,23 @@ function renderMultiRow(paramName, caption, index, value, total) {
643
643
  }
644
644
 
645
645
  function bindMultiInputEvents(wrap) {
646
- // Track whether the last input already had content (to avoid adding a row per keystroke)
647
- let _lastInputHadValue = false;
648
-
649
- wrap.addEventListener('focusin', function(e) {
650
- // Reset tracking when focus enters any input in this wrap
651
- if (e.target.classList.contains('mi-input')) {
652
- const rows = wrap.querySelectorAll('.multi-input-row');
653
- const lastRow = rows[rows.length - 1];
654
- const lastInput = lastRow.querySelector('.mi-input');
655
- _lastInputHadValue = (e.target === lastInput && lastInput.value !== '');
656
- }
657
- });
646
+ // Track last length of each input to detect transition from empty→non-empty
647
+ const lastLengths = new Map();
658
648
 
659
649
  wrap.addEventListener('input', function(e) {
660
650
  if (!e.target.classList.contains('mi-input')) return;
651
+
652
+ const currentLength = e.target.value.length;
653
+ const prevLength = lastLengths.get(e.target) || 0;
654
+ lastLengths.set(e.target, currentLength);
655
+
661
656
  const rows = wrap.querySelectorAll('.multi-input-row');
662
657
  const lastRow = rows[rows.length - 1];
663
658
  const lastInput = lastRow.querySelector('.mi-input');
664
- // Auto-add row only when the last input goes from empty → non-empty
665
- if (e.target === lastInput && !_lastInputHadValue && lastInput.value !== '') {
666
- _lastInputHadValue = true;
659
+
660
+ // Auto-add only when: (1) typing in last input, (2) field goes from empty→non-empty
661
+ if (e.target === lastInput && prevLength === 0 && currentLength > 0) {
667
662
  addMultiRow(wrap);
668
- // _lastInputHadValue resets on next focusin to the new last input
669
663
  }
670
664
  });
671
665
  wrap.addEventListener('click', function(e) {
@@ -690,9 +684,7 @@ function addMultiRow(wrap) {
690
684
  div.innerHTML = renderMultiRow(paramName, caption, idx, '', idx + 1);
691
685
  wrap.appendChild(div.firstElementChild);
692
686
  updateRemoveButtons(wrap);
693
- // Focus new input
694
- const newInput = wrap.querySelector('.multi-input-row:last-child .mi-input');
695
- if (newInput) newInput.focus();
687
+ updatePlaceholders(wrap);
696
688
  }
697
689
 
698
690
  function updateRemoveButtons(wrap) {
@@ -775,6 +775,13 @@
775
775
  "type": "integer",
776
776
  "required": true,
777
777
  "maximum": 1000
778
+ },
779
+ {
780
+ "name": "name_prefix",
781
+ "caption": "Name Prefix",
782
+ "description": "Optional. Only accounts whose name starts with this prefix. Matched against the account-name index, so it searches the whole set rather than the page you are on — an account past the first \"limit\" entries is still found. Empty or omitted returns everything, which is the behaviour without this argument.",
783
+ "type": "string",
784
+ "required": false
778
785
  }
779
786
  ],
780
787
  "returns": {
@@ -800,6 +807,13 @@
800
807
  "type": "integer",
801
808
  "required": true,
802
809
  "maximum": 1000
810
+ },
811
+ {
812
+ "name": "name_prefix",
813
+ "caption": "Name Prefix",
814
+ "description": "Optional. Only accounts whose name starts with this prefix. Matched against the account-name index, so it searches the whole set rather than the page you are on — an account past the first \"limit\" entries is still found. Empty or omitted returns everything, which is the behaviour without this argument.",
815
+ "type": "string",
816
+ "required": false
803
817
  }
804
818
  ],
805
819
  "returns": {
@@ -825,6 +839,13 @@
825
839
  "type": "integer",
826
840
  "required": true,
827
841
  "maximum": 1000
842
+ },
843
+ {
844
+ "name": "name_prefix",
845
+ "caption": "Name Prefix",
846
+ "description": "Optional. Only subaccounts whose name starts with this prefix. Matched against the account-name index, so it searches the whole set rather than the page you are on — a subaccount past the first \"limit\" entries is still found. Empty or omitted returns everything, which is the behaviour without this argument.",
847
+ "type": "string",
848
+ "required": false
828
849
  }
829
850
  ],
830
851
  "returns": {
@@ -1123,6 +1144,13 @@
1123
1144
  "type": "integer",
1124
1145
  "required": true,
1125
1146
  "maximum": 1000
1147
+ },
1148
+ {
1149
+ "name": "creator_prefix",
1150
+ "caption": "Creator Prefix",
1151
+ "description": "Optional. Only subscriptions whose creator account name starts with this prefix. Matched against the creator index, so it searches the whole set rather than the page you are on — a subscription past the first \"limit\" entries is still found. Empty or omitted returns everything, which is the behaviour without this argument.",
1152
+ "type": "string",
1153
+ "required": false
1126
1154
  }
1127
1155
  ],
1128
1156
  "returns": {