Closed hstove closed 2 years ago
Latest commit: 7829721eff8c47d8554e11c29eddb72bc12fb23f
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
hmm yeah there needs to be some updates, see https://github.com/hirosystems/stacks.js/blob/master/packages/transactions/src/builders.ts#L363
It looks like this change does make micro-stacks match the behavior of stacks.js https://github.com/hirosystems/stacks.js/blob/fe831cf28d71de9410c81cfabe256fd511e9aa4d/packages/transactions/src/builders.ts#L449-L451
Looks like stacks.js transforms the response into an actual object from the rather odd string-quoted txid string returned by /v2/transaction
.
ah yes, @hstove can you do a minor change via changesets?
Thanks for the changeset + merge!
So now when you read the data
from an onFinish
callback, you end up having to do something like this:
const onFinish = useCallback(
data => {
const txid = data.txId.txid;
Can that be reduced to data.txid
or data.txId
?
@aviculturist is that what you are currently experiencing?
based off the wallet code, that is not correct: https://github.com/hirosystems/stacks-wallet-web/blob/dev/src/app/common/transactions/broadcast-transaction.ts#L28
Yes, it's what I'm seeing in the data
object with Hiro Wallet v3.0.0.
.
In the latest micro-stacks,
broadcastTransaction
returns{ txid: string }
, but that's not the TypeScript type. You need to do funky workarounds when using this library in TS to get the result you want.A different option is to actually return a
string
, which would also fix the issue (and be backwards compat with stacks.js?)