# How to get\_asset\_outputs\_for\_amount and get\_asset\_inputs\_for\_amount with TS dsk

**URL:** https://forum.fuel.network/t/how-to-get-asset-outputs-for-amount-and-get-asset-inputs-for-amount-with-ts-dsk/2638
**Category:** TypeScript SDK
**Created:** [May 17, 2023, 7:47pm UTC](https://forum.fuel.network/t/how-to-get-asset-outputs-for-amount-and-get-asset-inputs-for-amount-with-ts-dsk/2638 "2023-05-17T19:47:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sway](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sway/32/103_2.png) [@sway](https://forum.fuel.network/u/sway)
#### Post date: [May 17, 2023, 7:47pm UTC](https://forum.fuel.network/t/how-to-get-asset-outputs-for-amount-and-get-asset-inputs-for-amount-with-ts-dsk/2638/1 "2023-05-17T19:47:23Z")

</div>

To be able to cancel predicate that I have created I need to pass inputs and outputs like in this rust sdk code here

> <https://github.com/compolabs/ethglobal-predicate/blob/8c93dac92fb861cb1d319f5226cb26f42cc9a29d/tests/utils/cotracts_utils/limit_orders_utils.rs#L39>

How can I `get_asset_outputs_for_amount` and `get_asset_inputs_for_amount` with TS sdk?

---

<div class="post-metadata">

### Author: ![danielbate](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/danielbate/32/1617_2.png) [@danielbate](https://forum.fuel.network/u/danielbate)
#### Post date: [May 18, 2023, 9:55am UTC](https://forum.fuel.network/t/how-to-get-asset-outputs-for-amount-and-get-asset-inputs-for-amount-with-ts-dsk/2638/2 "2023-05-18T09:55:29Z")

</div>

Within the TS SDK, a `Predicate` extends the functionality of an `Account`, it is within here that you will find the transactional methods: [link to source code](https://github.com/FuelLabs/fuels-ts/blob/ce74fa49ec2d53db270f2dc3eb3de970702f40a3/packages/wallet/src/account.ts).

Here are some example usages for retrieving asset information:

```auto
const quantities: CoinQuantityLike[] = [
  {
    amount: 1_000_000,
    assetId: NativeAssetId,
  }
];

console.log('unspent resources', await predicate.getResourcesToSpend(quantities));
console.log('coins', await predicate.getCoins());
console.log('balances', await predicate.getBalances());
console.log('balance for a given asset id', await predicate.getBalance(NativeAssetId));

```

Does this help with your use case?
