Convenience method to check both product activation and limits (if sourceAmount is provided)
Most products should invoke this before allowing consumers to transact
OptionalgetAggregateUsage?: (input: GetUsageInput[]) => Promise<BigNumber[]>Applicable to deposit.* and withdraw.* products currently
OptionalregionCode?: string2-letter country subdivision code, e.g. US states
Can be null for products that do not accept source amount upfront
Whether the provided entity and criteria can transact with the given product
// without amount
entityProductService.can({
product: "swap.v1",
entityId: "id_...",
customerId: "cust_...",
sourceCurrency: "MOVEUSD",
targetCurrency: "USDC"
})
// with amount
entityProductService.can({
product: "swap.v1",
entityId: "id_...",
customerId: "cust_...",
sourceCurrency: "MOVEUSD",
targetCurrency: "USDC",
sourceAmount: {
value: new BigNumber(100),
getUsage: (input) => {
return this.getUsage({...input, entityId, customerId });
}
}
})
OptionalregionCode?: string2-letter country subdivision code, e.g. US states
Whether the product is active for the given entity
Entity-aware product service