viz-js-lib 0.16.0 → 0.18.1

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,10 @@ 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
+ {api:"database_api",method:"get_agent_permissions",params:["account"]},
45
46
  {api:"account_by_key",method:"get_key_references",params:["account_name_type"]},
46
47
  {api:"network_broadcast_api",method:"broadcast_transaction",params:["trx"]},
47
48
  {api:"network_broadcast_api",method:"broadcast_transaction_with_callback",params:["confirmationCallback","trx"]},
@@ -53,7 +54,7 @@ const METHODS = [
53
54
  {api:"invite_api",method:"get_invites_list",params:["status"]},
54
55
  {api:"invite_api",method:"get_invite_by_id",params:["id"]},
55
56
  {api:"invite_api",method:"get_invite_by_key",params:["invite_key"]},
56
- {api:"paid_subscription_api",method:"get_paid_subscriptions",params:["from","limit"]},
57
+ {api:"paid_subscription_api",method:"get_paid_subscriptions",params:["from","limit","creator_prefix"]},
57
58
  {api:"paid_subscription_api",method:"get_paid_subscription_options",params:["account"]},
58
59
  {api:"paid_subscription_api",method:"get_paid_subscription_status",params:["subscriber","account"]},
59
60
  {api:"paid_subscription_api",method:"get_active_paid_subscriptions",params:["subscriber"]},
@@ -418,9 +419,10 @@ const SPEC = {
418
419
  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
420
  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
421
  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)."}}}
422
+ 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."}}},
423
+ 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."}}},
424
+ 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."}}},
425
+ get_agent_permissions: {d:"Returns the agents of a principal (HF15 agent access): name, public key, allowed operations, expiration (1970-01-01T00:00:00 = perpetual), addons (off-chain scopes such as vizhub) and an expired flag. At most 16 rows, ordered by agent name. Nodes without HF15 answer with an unknown-method error.",p:{account:{c:"Account Name",d:"The principal whose agents to return."}}}
424
426
  },
425
427
  account_by_key: {
426
428
  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 +444,7 @@ const SPEC = {
442
444
  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
445
  },
444
446
  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)."}}},
447
+ 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
448
  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
449
  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
450
  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 +645,23 @@ function renderMultiRow(paramName, caption, index, value, total) {
643
645
  }
644
646
 
645
647
  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
- });
648
+ // Track last length of each input to detect transition from empty→non-empty
649
+ const lastLengths = new Map();
658
650
 
659
651
  wrap.addEventListener('input', function(e) {
660
652
  if (!e.target.classList.contains('mi-input')) return;
653
+
654
+ const currentLength = e.target.value.length;
655
+ const prevLength = lastLengths.get(e.target) || 0;
656
+ lastLengths.set(e.target, currentLength);
657
+
661
658
  const rows = wrap.querySelectorAll('.multi-input-row');
662
659
  const lastRow = rows[rows.length - 1];
663
660
  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;
661
+
662
+ // Auto-add only when: (1) typing in last input, (2) field goes from empty→non-empty
663
+ if (e.target === lastInput && prevLength === 0 && currentLength > 0) {
667
664
  addMultiRow(wrap);
668
- // _lastInputHadValue resets on next focusin to the new last input
669
665
  }
670
666
  });
671
667
  wrap.addEventListener('click', function(e) {
@@ -690,9 +686,7 @@ function addMultiRow(wrap) {
690
686
  div.innerHTML = renderMultiRow(paramName, caption, idx, '', idx + 1);
691
687
  wrap.appendChild(div.firstElementChild);
692
688
  updateRemoveButtons(wrap);
693
- // Focus new input
694
- const newInput = wrap.querySelector('.multi-input-row:last-child .mi-input');
695
- if (newInput) newInput.focus();
689
+ updatePlaceholders(wrap);
696
690
  }
697
691
 
698
692
  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,12 +839,36 @@
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": {
831
852
  "type": "array",
832
853
  "description": "Array of subaccount_on_sale_api_object entries."
833
854
  }
855
+ },
856
+ {
857
+ "method": "get_agent_permissions",
858
+ "description": "Returns the agents of a principal (HF15 agent access), ordered by agent name. At most 16 rows. Expired rows are returned with expired=true: they grant nothing and are removed on the principal's next grant. Nodes without HF15 answer with an unknown-method error.",
859
+ "params": [
860
+ {
861
+ "name": "account",
862
+ "caption": "Account Name",
863
+ "description": "The principal whose agents to return.",
864
+ "type": "string",
865
+ "required": true
866
+ }
867
+ ],
868
+ "returns": {
869
+ "type": "array",
870
+ "description": "Array of agent_permission_api_object: account, agent_name, agent_key, operations, expiration (1970-01-01T00:00:00 = perpetual), addons (off-chain scopes such as vizhub), expired."
871
+ }
834
872
  }
835
873
  ]
836
874
  },
@@ -1123,6 +1161,13 @@
1123
1161
  "type": "integer",
1124
1162
  "required": true,
1125
1163
  "maximum": 1000
1164
+ },
1165
+ {
1166
+ "name": "creator_prefix",
1167
+ "caption": "Creator Prefix",
1168
+ "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.",
1169
+ "type": "string",
1170
+ "required": false
1126
1171
  }
1127
1172
  ],
1128
1173
  "returns": {