#Jasuno

1 messages · Page 1 of 1 (latest)

stoic gulchBOT
wary warren
#

Hello

restive dirge
#

const balanceTransactions = await stripe.balanceTransactions.list({ limit: 3, }, { stripeAccount: {{CONNECT_ACCOUNT}} });

#

so that should work?

wary warren
#

Yep that looks good

restive dirge
#

These headers work with all the API functions?

#

One more thing, i'm using typescript in the client side application and i will be sending those transactions to the front end, is there a library of these types? so my front end knows what type it will be receiving?

wary warren
#

The type declarations in StripeJS package will always track to the latest version of the Stripe API.

restive dirge
wary warren
#

Yep

restive dirge
#

I tried this before and i notice that the types there do not match for example if i call
const balance = await stripe.balance.retrieve({ stripeAccount: user?.stripeId, });
There API returns a type of Balance, which does not match the Balance type in that library

wary warren
#

Hmm not super familiar with typescript overall, one moment, let me confer with a colleague

#

Can you show me exactly what you are seeing?

#

They should match as far as I know

restive dirge
#

Hello

wary warren
#

Hey! Okay got more context

restive dirge
#

sorry got pulled in to a meeting

wary warren
#

Basically, Stripe.JS doesn't have types for everything in our API. You can see the types it does support here: https://github.com/stripe/stripe-js/tree/master/types. Instead, for something like the Balance object you would create your own frontend types for this, but you are really better off just parsing the relevant pieces you want when retrieving on the backend and then passing those pieces to the frontend and building types for those specific pieces.

restive dirge
#

Ok so as I understand it, there is no shared library between API types and one that you have access in the front-end, instead we need to create all of our own types, preferably only including what ever we are sending back.

wary warren
restive dirge
#

Thanks that helps a lot, i think thats it, thanks for all the help, it would be cool if more for those types were accessible from the front end.

wary warren
#

I'll pass along that feedback