( provider: JsonRpcProvider, owner: SuiAddress, coinTypes: Set<string> )
| 182 | } |
| 183 | |
| 184 | export async function getBalancesForCoinTypes( |
| 185 | provider: JsonRpcProvider, |
| 186 | owner: SuiAddress, |
| 187 | coinTypes: Set<string> |
| 188 | ): Promise<Map<string, BigInt>> { |
| 189 | let coinsBalances = new Map<string, BigInt>(); |
| 190 | |
| 191 | for (let coinType of coinTypes.values()) { |
| 192 | let coinBalance = await provider.getBalance({ |
| 193 | owner, |
| 194 | coinType, |
| 195 | }); |
| 196 | console.log(coinType, " - ", BigInt(coinBalance.totalBalance)); |
| 197 | coinsBalances.set(coinType, BigInt(coinBalance.totalBalance)); |
| 198 | } |
| 199 | |
| 200 | return coinsBalances; |
| 201 | } |
| 202 | |
| 203 | export async function buildInputCoinForAmount( |
| 204 | txb: TransactionBlock, |
nothing calls this directly
no outgoing calls
no test coverage detected