This repository was archived by the owner on Feb 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,11 +172,14 @@ Return all balances for an address
172172
173173#### Arguments
174174
175- 1 . address : ` string ` ** required** . The address in legacy, cash or slp address format
175+ - address (required):
176+ - ` string ` : A single string containing an slp address.
177+ - ` Array ` of strings: Array with maximum of 20 slp addresses.
176178
177179#### Result
178180
179- balances : ` Object ` . The address's balances
181+ - ` Array ` : containing balances Objects.
182+ - ` Array ` : Array of arrays.
180183
181184#### Examples
182185
@@ -243,6 +246,45 @@ balances : `Object`. The address's balances
243246 // balance: '507',
244247 // decimalCount: 2 } ]
245248
249+
250+ // multiple addresses
251+ const addresses = [
252+ "simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9",
253+ "simpleledger:qqss4zp80hn6szsa4jg2s9fupe7g5tcg5ucdyl3r57"
254+ ]
255+ await SLP.Utils.balancesForAddress(addresses)
256+ // returns
257+ // [
258+ // [
259+ // {
260+ // tokenId:
261+ // "df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb",
262+ // balance: 1,
263+ // balanceString: "1",
264+ // slpAddress: "simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9",
265+ // decimalCount: 8
266+ // },
267+ // {
268+ // tokenId:
269+ // "a436c8e1b6bee3d701c6044d190f76f774be83c36de8d34a988af4489e86dd37",
270+ // balance: 1,
271+ // balanceString: "1",
272+ // slpAddress: "simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9",
273+ // decimalCount: 7
274+ // }
275+ // ],
276+ // [
277+ // {
278+ // tokenId:
279+ // "497291b8a1dfe69c8daea50677a3d31a5ef0e9484d8bebb610dac64bbc202fb7",
280+ // balance: 10,
281+ // balanceString: "10",
282+ // slpAddress: "simpleledger:qqss4zp80hn6szsa4jg2s9fupe7g5tcg5ucdyl3r57",
283+ // decimalCount: 8
284+ // }
285+ // ]
286+ // ]
287+
246288### ` balance `
247289
248290Return single balance for an address by token id
You can’t perform that action at this time.
0 commit comments