Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Bitcoin transaction index to typescript client (#568)
Also separate `StacksPayload` and `BitcoinPayload` into separate types for easier client-side inference. Bump version to 1.8.0
- Loading branch information
Showing
5 changed files
with
32 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,6 @@ | ||
import { Static, Type } from '@sinclair/typebox'; | ||
import { StacksEventSchema } from './stacks/payload'; | ||
import { BitcoinEventSchema } from './bitcoin/payload'; | ||
import { BitcoinIfThisSchema } from './bitcoin/if_this'; | ||
import { StacksIfThisSchema } from './stacks/if_this'; | ||
import { StacksPayloadSchema } from './stacks/payload'; | ||
import { BitcoinPayloadSchema } from './bitcoin/payload'; | ||
|
||
const EventArray = Type.Union([Type.Array(StacksEventSchema), Type.Array(BitcoinEventSchema)]); | ||
|
||
export const PayloadSchema = Type.Object({ | ||
apply: EventArray, | ||
rollback: EventArray, | ||
chainhook: Type.Object({ | ||
uuid: Type.String(), | ||
predicate: Type.Union([BitcoinIfThisSchema, StacksIfThisSchema]), | ||
is_streaming_blocks: Type.Boolean(), | ||
}), | ||
}); | ||
export const PayloadSchema = Type.Union([BitcoinPayloadSchema, StacksPayloadSchema]); | ||
export type Payload = Static<typeof PayloadSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters