diff --git a/docs/4.-Reading blockchain-Examples.md b/docs/4.-Reading blockchain-Examples.md index 4174c0b3f..ec3a96170 100644 --- a/docs/4.-Reading blockchain-Examples.md +++ b/docs/4.-Reading blockchain-Examples.md @@ -18,11 +18,11 @@ Get the first 10 token balances of account _testacc_. const resp = await rpc.get_table_rows({ json: true, // Get the response as json code: 'eosio.token', // Contract that we target - scope: 'testacc' // Account that owns the data - table: 'accounts' // Table name + scope: 'testacc', // Account that owns the data + table: 'accounts', // Table name limit: 10, // Maximum number of rows that we want to get - reverse = false, // Optional: Get reversed data - show_payer = false, // Optional: Show ram payer + reverse: false, // Optional: Get reversed data + show_payer: false, // Optional: Show ram payer }); console.log(resp.rows); @@ -45,12 +45,12 @@ Output: const resp = await rpc.get_table_rows({ json: true, // Get the response as json code: 'contract', // Contract that we target - scope: 'contract' // Account that owns the data - table: 'profiles' // Table name - lower_bound: 'testacc' // Table primary key value + scope: 'contract', // Account that owns the data + table: 'profiles', // Table name + lower_bound: 'testacc', // Table primary key value limit: 1, // Here we limit to 1 to get only the - reverse = false, // Optional: Get reversed data - show_payer = false, // Optional: Show ram payer + reverse: false, // Optional: Get reversed data + show_payer: false, // Optional: Show ram payer }); console.log(resp.rows); ``` @@ -74,13 +74,13 @@ Output: const resp = await rpc.get_table_rows({ json: true, // Get the response as json code: 'contract', // Contract that we target - scope: 'contract' // Account that owns the data - table: 'profiles' // Table name - table_key: 'age' // Table secondaray key name - lower_bound: 21 // Table secondary key value + scope: 'contract', // Account that owns the data + table: 'profiles', // Table name + table_key: 'age', // Table secondaray key name + lower_bound: 21, // Table secondary key value limit: 1, // Here we limit to 1 to get only row - reverse = false, // Optional: Get reversed data - show_payer = false, // Optional: Show ram payer + reverse: false, // Optional: Get reversed data + show_payer: false, // Optional: Show ram payer }); console.log(resp.rows); ```