@hirosystems/chainhooks-client 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/package.json +11 -1
  2. package/schemas/api/index.d.ts +222 -0
  3. package/schemas/api/index.d.ts.map +1 -0
  4. package/schemas/api/index.js +31 -0
  5. package/schemas/api/index.js.map +1 -0
  6. package/schemas/chainhook/action.d.ts +13 -0
  7. package/schemas/chainhook/action.d.ts.map +1 -0
  8. package/schemas/chainhook/action.js +12 -0
  9. package/schemas/chainhook/action.js.map +1 -0
  10. package/schemas/chainhook/index.d.ts +221 -0
  11. package/schemas/chainhook/index.d.ts.map +1 -0
  12. package/schemas/chainhook/index.js +73 -0
  13. package/schemas/chainhook/index.js.map +1 -0
  14. package/schemas/chainhook/stacks/filters.d.ts +242 -0
  15. package/schemas/chainhook/stacks/filters.d.ts.map +1 -0
  16. package/schemas/chainhook/stacks/filters.js +112 -0
  17. package/schemas/chainhook/stacks/filters.js.map +1 -0
  18. package/schemas/chainhook/stacks/index.d.ts +16 -0
  19. package/schemas/chainhook/stacks/index.d.ts.map +1 -0
  20. package/schemas/chainhook/stacks/index.js +33 -0
  21. package/schemas/chainhook/stacks/index.js.map +1 -0
  22. package/schemas/chainhook-event/common.d.ts +21 -0
  23. package/schemas/chainhook-event/common.d.ts.map +1 -0
  24. package/schemas/chainhook-event/common.js +20 -0
  25. package/schemas/chainhook-event/common.js.map +1 -0
  26. package/schemas/chainhook-event/index.d.ts +725 -0
  27. package/schemas/chainhook-event/index.d.ts.map +1 -0
  28. package/schemas/chainhook-event/index.js +35 -0
  29. package/schemas/chainhook-event/index.js.map +1 -0
  30. package/schemas/chainhook-event/stacks/block.d.ts +385 -0
  31. package/schemas/chainhook-event/stacks/block.d.ts.map +1 -0
  32. package/schemas/chainhook-event/stacks/block.js +47 -0
  33. package/schemas/chainhook-event/stacks/block.js.map +1 -0
  34. package/schemas/chainhook-event/stacks/index.d.ts +14 -0
  35. package/schemas/chainhook-event/stacks/index.d.ts.map +1 -0
  36. package/schemas/chainhook-event/stacks/index.js +30 -0
  37. package/schemas/chainhook-event/stacks/index.js.map +1 -0
  38. package/schemas/chainhook-event/stacks/operations.d.ts +494 -0
  39. package/schemas/chainhook-event/stacks/operations.d.ts.map +1 -0
  40. package/schemas/chainhook-event/stacks/operations.js +169 -0
  41. package/schemas/chainhook-event/stacks/operations.js.map +1 -0
  42. package/schemas/chainhook-event/stacks/post_conditions.d.ts +159 -0
  43. package/schemas/chainhook-event/stacks/post_conditions.d.ts.map +1 -0
  44. package/schemas/chainhook-event/stacks/post_conditions.js +70 -0
  45. package/schemas/chainhook-event/stacks/post_conditions.js.map +1 -0
  46. package/schemas/chainhook-event/stacks/transaction.d.ts +422 -0
  47. package/schemas/chainhook-event/stacks/transaction.d.ts.map +1 -0
  48. package/schemas/chainhook-event/stacks/transaction.js +64 -0
  49. package/schemas/chainhook-event/stacks/transaction.js.map +1 -0
  50. package/schemas/index.d.ts +5 -0
  51. package/schemas/index.d.ts.map +1 -0
  52. package/schemas/index.js +21 -0
  53. package/schemas/index.js.map +1 -0
  54. package/schemas/utils.d.ts +10 -0
  55. package/schemas/utils.d.ts.map +1 -0
  56. package/schemas/utils.js +16 -0
  57. package/schemas/utils.js.map +1 -0
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StacksOperationSchema = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ const common_1 = require("../common");
6
+ const utils_1 = require("../../utils");
7
+ const _1 = require(".");
8
+ const StacksCurrencySchema = typebox_1.Type.Object({
9
+ decimals: typebox_1.Type.Integer(),
10
+ symbol: typebox_1.Type.String(),
11
+ metadata: typebox_1.Type.Optional(typebox_1.Type.Object({
12
+ asset_identifier: (0, utils_1.Nullable)(typebox_1.Type.String()),
13
+ value: typebox_1.Type.Optional(typebox_1.Type.String()),
14
+ token_type: typebox_1.Type.Union([typebox_1.Type.Literal('ft'), typebox_1.Type.Literal('nft')]),
15
+ })),
16
+ });
17
+ const StacksAmountSchema = typebox_1.Type.Object({
18
+ currency: StacksCurrencySchema,
19
+ value: typebox_1.Type.String(),
20
+ });
21
+ const BaseOperationSchema = typebox_1.Type.Object({
22
+ operation_identifier: common_1.OperationIdentifierSchema,
23
+ status: _1.StacksStatusSchema,
24
+ });
25
+ const BaseAccountOperationSchema = typebox_1.Type.Composite([
26
+ BaseOperationSchema,
27
+ typebox_1.Type.Object({
28
+ account: common_1.OperationAccountSchema,
29
+ }),
30
+ ]);
31
+ const BaseAmountOperationSchema = typebox_1.Type.Composite([
32
+ BaseAccountOperationSchema,
33
+ typebox_1.Type.Object({
34
+ amount: StacksAmountSchema,
35
+ }),
36
+ ]);
37
+ const CoinbaseOperationSchema = typebox_1.Type.Composite([
38
+ BaseAccountOperationSchema,
39
+ typebox_1.Type.Object({
40
+ type: typebox_1.Type.Literal('coinbase'),
41
+ metadata: typebox_1.Type.Object({
42
+ alt_recipient: (0, utils_1.Nullable)(typebox_1.Type.String()),
43
+ vrf_proof: (0, utils_1.Nullable)(typebox_1.Type.String()),
44
+ }),
45
+ }),
46
+ ]);
47
+ const FeeOperationSchema = typebox_1.Type.Composite([
48
+ BaseAmountOperationSchema,
49
+ typebox_1.Type.Object({
50
+ type: typebox_1.Type.Literal('fee'),
51
+ metadata: typebox_1.Type.Object({
52
+ sponsored: typebox_1.Type.Boolean(),
53
+ }),
54
+ }),
55
+ ]);
56
+ const TokenTransferOperationSchema = typebox_1.Type.Composite([
57
+ BaseAmountOperationSchema,
58
+ typebox_1.Type.Object({
59
+ type: typebox_1.Type.Literal('token_transfer'),
60
+ metadata: typebox_1.Type.Optional(typebox_1.Type.Object({ memo: (0, utils_1.Nullable)(typebox_1.Type.String()) })),
61
+ }),
62
+ ]);
63
+ const TokenMintOperationSchema = typebox_1.Type.Composite([
64
+ BaseAmountOperationSchema,
65
+ typebox_1.Type.Object({
66
+ type: typebox_1.Type.Literal('token_mint'),
67
+ }),
68
+ ]);
69
+ const TokenBurnOperationSchema = typebox_1.Type.Composite([
70
+ BaseAmountOperationSchema,
71
+ typebox_1.Type.Object({
72
+ type: typebox_1.Type.Literal('token_burn'),
73
+ }),
74
+ ]);
75
+ const ContractCallOperationSchema = typebox_1.Type.Composite([
76
+ BaseAccountOperationSchema,
77
+ typebox_1.Type.Object({
78
+ type: typebox_1.Type.Literal('contract_call'),
79
+ metadata: typebox_1.Type.Object({
80
+ args: typebox_1.Type.Union([
81
+ typebox_1.Type.Array(typebox_1.Type.Object({
82
+ hex: typebox_1.Type.String(),
83
+ repr: typebox_1.Type.String(),
84
+ name: typebox_1.Type.String(),
85
+ type: typebox_1.Type.String(),
86
+ })),
87
+ (0, utils_1.Nullable)(typebox_1.Type.String()),
88
+ ]),
89
+ contract_identifier: typebox_1.Type.String(),
90
+ function_name: typebox_1.Type.String(),
91
+ }),
92
+ }),
93
+ ]);
94
+ const SmartContractOperationSchema = typebox_1.Type.Composite([
95
+ BaseAccountOperationSchema,
96
+ typebox_1.Type.Object({
97
+ type: typebox_1.Type.Literal('smart_contract'),
98
+ metadata: typebox_1.Type.Object({
99
+ contract_identifier: typebox_1.Type.String(),
100
+ clarity_version: (0, utils_1.Nullable)(typebox_1.Type.Integer()),
101
+ source_code: typebox_1.Type.Optional(typebox_1.Type.String()),
102
+ abi: typebox_1.Type.Optional(typebox_1.Type.String()),
103
+ }),
104
+ }),
105
+ ]);
106
+ const TenureChangeOperationSchema = typebox_1.Type.Composite([
107
+ BaseOperationSchema,
108
+ typebox_1.Type.Object({
109
+ type: typebox_1.Type.Literal('tenure_change'),
110
+ metadata: typebox_1.Type.Object({
111
+ tenure_consensus_hash: typebox_1.Type.String(),
112
+ prev_tenure_consensus_hash: typebox_1.Type.String(),
113
+ burn_view_consensus_hash: typebox_1.Type.String(),
114
+ previous_tenure_end: typebox_1.Type.String(),
115
+ previous_tenure_blocks: typebox_1.Type.Integer(),
116
+ cause: typebox_1.Type.Union([
117
+ typebox_1.Type.Literal('block_found'),
118
+ typebox_1.Type.Literal('extended'),
119
+ ]),
120
+ pubkey_hash: typebox_1.Type.String(),
121
+ }),
122
+ }),
123
+ ]);
124
+ const PoisonMicroblockOperationSchema = typebox_1.Type.Composite([
125
+ BaseAccountOperationSchema,
126
+ typebox_1.Type.Object({
127
+ type: typebox_1.Type.Literal('poison_microblock'),
128
+ metadata: typebox_1.Type.Object({
129
+ microblock_header_1: typebox_1.Type.String(),
130
+ microblock_header_2: typebox_1.Type.String(),
131
+ }),
132
+ }),
133
+ ]);
134
+ const StxLockOperationSchema = typebox_1.Type.Composite([
135
+ BaseAmountOperationSchema,
136
+ typebox_1.Type.Object({
137
+ type: typebox_1.Type.Literal('stx_lock'),
138
+ metadata: typebox_1.Type.Object({
139
+ unlock_height: typebox_1.Type.Integer(),
140
+ locked_address: typebox_1.Type.String(),
141
+ contract_name: typebox_1.Type.String(),
142
+ }),
143
+ }),
144
+ ]);
145
+ const ContractLogOperationSchema = typebox_1.Type.Composite([
146
+ BaseOperationSchema,
147
+ typebox_1.Type.Object({
148
+ type: typebox_1.Type.Literal('contract_log'),
149
+ metadata: typebox_1.Type.Object({
150
+ contract_identifier: typebox_1.Type.String(),
151
+ topic: typebox_1.Type.String(),
152
+ value: typebox_1.Type.String(),
153
+ }),
154
+ }),
155
+ ]);
156
+ exports.StacksOperationSchema = typebox_1.Type.Union([
157
+ CoinbaseOperationSchema,
158
+ FeeOperationSchema,
159
+ TokenTransferOperationSchema,
160
+ ContractCallOperationSchema,
161
+ SmartContractOperationSchema,
162
+ TenureChangeOperationSchema,
163
+ PoisonMicroblockOperationSchema,
164
+ TokenMintOperationSchema,
165
+ TokenBurnOperationSchema,
166
+ StxLockOperationSchema,
167
+ ContractLogOperationSchema,
168
+ ]);
169
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../../src/schemas/chainhook-event/stacks/operations.ts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,cAAI,CAAC,MAAM,EAAE;SAC7B,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,0BAA0B,GAAG,cAAI,CAAC,SAAS,CAAC;IAChD,mBAAmB;IACnB,cAAI,CAAC,MAAM,CAAC;QACV,IAAI,EAAE,cAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAClC,QAAQ,EAAE,cAAI,CAAC,MAAM,CAAC;YACpB,mBAAmB,EAAE,cAAI,CAAC,MAAM,EAAE;YAClC,KAAK,EAAE,cAAI,CAAC,MAAM,EAAE;YACpB,KAAK,EAAE,cAAI,CAAC,MAAM,EAAE;SACrB,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAKU,QAAA,qBAAqB,GAAG,cAAI,CAAC,KAAK,CAAC;IAC9C,uBAAuB;IACvB,kBAAkB;IAClB,4BAA4B;IAC5B,2BAA2B;IAC3B,4BAA4B;IAC5B,2BAA2B;IAC3B,+BAA+B;IAC/B,wBAAwB;IACxB,wBAAwB;IACxB,sBAAsB;IACtB,0BAA0B;CAC3B,CAAC,CAAC"}
@@ -0,0 +1,159 @@
1
+ import { Static } from '@sinclair/typebox';
2
+ export declare const StacksPostConditionModeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"allow">, import("@sinclair/typebox").TLiteral<"deny">]>;
3
+ export type StacksPostConditionMode = Static<typeof StacksPostConditionModeSchema>;
4
+ declare const StacksFungiblePostConditionCodeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sent_equal_to">, import("@sinclair/typebox").TLiteral<"sent_greater_than">, import("@sinclair/typebox").TLiteral<"sent_greater_than_or_equal_to">, import("@sinclair/typebox").TLiteral<"sent_less_than">, import("@sinclair/typebox").TLiteral<"sent_less_than_or_equal_to">]>;
5
+ export type StacksFungiblePostConditionCode = Static<typeof StacksFungiblePostConditionCodeSchema>;
6
+ declare const StacksNonFungiblePostConditionCodeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sent">, import("@sinclair/typebox").TLiteral<"not_sent">]>;
7
+ export type StacksNonFungiblePostConditionCode = Static<typeof StacksNonFungiblePostConditionCodeSchema>;
8
+ declare const StacksPostConditionPrincipalStandardSchema: import("@sinclair/typebox").TObject<{
9
+ type_id: import("@sinclair/typebox").TLiteral<"principal_standard">;
10
+ address: import("@sinclair/typebox").TString;
11
+ }>;
12
+ export type StacksPostConditionPrincipalStandard = Static<typeof StacksPostConditionPrincipalStandardSchema>;
13
+ declare const StacksPostConditionPrincipalContractSchema: import("@sinclair/typebox").TObject<{
14
+ type_id: import("@sinclair/typebox").TLiteral<"principal_contract">;
15
+ contract_name: import("@sinclair/typebox").TString;
16
+ address: import("@sinclair/typebox").TString;
17
+ }>;
18
+ export type StacksPostConditionPrincipalContract = Static<typeof StacksPostConditionPrincipalContractSchema>;
19
+ declare const StacksPostConditionPrincipalOriginSchema: import("@sinclair/typebox").TObject<{
20
+ type_id: import("@sinclair/typebox").TLiteral<"principal_origin">;
21
+ }>;
22
+ export type StacksPostConditionPrincipalOrigin = Static<typeof StacksPostConditionPrincipalOriginSchema>;
23
+ declare const StacksPostConditionPrincipalSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
24
+ type_id: import("@sinclair/typebox").TLiteral<"principal_standard">;
25
+ address: import("@sinclair/typebox").TString;
26
+ }>, import("@sinclair/typebox").TObject<{
27
+ type_id: import("@sinclair/typebox").TLiteral<"principal_contract">;
28
+ contract_name: import("@sinclair/typebox").TString;
29
+ address: import("@sinclair/typebox").TString;
30
+ }>, import("@sinclair/typebox").TObject<{
31
+ type_id: import("@sinclair/typebox").TLiteral<"principal_origin">;
32
+ }>]>;
33
+ export type StacksPostConditionPrincipal = Static<typeof StacksPostConditionPrincipalSchema>;
34
+ declare const StacksPostConditionAssetSchema: import("@sinclair/typebox").TObject<{
35
+ contract_name: import("@sinclair/typebox").TString;
36
+ asset_name: import("@sinclair/typebox").TString;
37
+ contract_address: import("@sinclair/typebox").TString;
38
+ }>;
39
+ export type StacksPostConditionAsset = Static<typeof StacksPostConditionAssetSchema>;
40
+ declare const StacksStxPostConditionSchema: import("@sinclair/typebox").TObject<{
41
+ type: import("@sinclair/typebox").TLiteral<"stx">;
42
+ condition_code: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sent_equal_to">, import("@sinclair/typebox").TLiteral<"sent_greater_than">, import("@sinclair/typebox").TLiteral<"sent_greater_than_or_equal_to">, import("@sinclair/typebox").TLiteral<"sent_less_than">, import("@sinclair/typebox").TLiteral<"sent_less_than_or_equal_to">]>;
43
+ amount: import("@sinclair/typebox").TString;
44
+ principal: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
45
+ type_id: import("@sinclair/typebox").TLiteral<"principal_standard">;
46
+ address: import("@sinclair/typebox").TString;
47
+ }>, import("@sinclair/typebox").TObject<{
48
+ type_id: import("@sinclair/typebox").TLiteral<"principal_contract">;
49
+ contract_name: import("@sinclair/typebox").TString;
50
+ address: import("@sinclair/typebox").TString;
51
+ }>, import("@sinclair/typebox").TObject<{
52
+ type_id: import("@sinclair/typebox").TLiteral<"principal_origin">;
53
+ }>]>;
54
+ }>;
55
+ export type StacksStxPostCondition = Static<typeof StacksStxPostConditionSchema>;
56
+ declare const StacksFungiblePostConditionSchema: import("@sinclair/typebox").TObject<{
57
+ type: import("@sinclair/typebox").TLiteral<"fungible">;
58
+ condition_code: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sent_equal_to">, import("@sinclair/typebox").TLiteral<"sent_greater_than">, import("@sinclair/typebox").TLiteral<"sent_greater_than_or_equal_to">, import("@sinclair/typebox").TLiteral<"sent_less_than">, import("@sinclair/typebox").TLiteral<"sent_less_than_or_equal_to">]>;
59
+ amount: import("@sinclair/typebox").TString;
60
+ principal: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
61
+ type_id: import("@sinclair/typebox").TLiteral<"principal_standard">;
62
+ address: import("@sinclair/typebox").TString;
63
+ }>, import("@sinclair/typebox").TObject<{
64
+ type_id: import("@sinclair/typebox").TLiteral<"principal_contract">;
65
+ contract_name: import("@sinclair/typebox").TString;
66
+ address: import("@sinclair/typebox").TString;
67
+ }>, import("@sinclair/typebox").TObject<{
68
+ type_id: import("@sinclair/typebox").TLiteral<"principal_origin">;
69
+ }>]>;
70
+ asset: import("@sinclair/typebox").TObject<{
71
+ contract_name: import("@sinclair/typebox").TString;
72
+ asset_name: import("@sinclair/typebox").TString;
73
+ contract_address: import("@sinclair/typebox").TString;
74
+ }>;
75
+ }>;
76
+ export type StacksFungiblePostCondition = Static<typeof StacksFungiblePostConditionSchema>;
77
+ declare const StacksNonFungiblePostConditionSchema: import("@sinclair/typebox").TObject<{
78
+ type: import("@sinclair/typebox").TLiteral<"non_fungible">;
79
+ condition_code: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sent">, import("@sinclair/typebox").TLiteral<"not_sent">]>;
80
+ principal: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
81
+ type_id: import("@sinclair/typebox").TLiteral<"principal_standard">;
82
+ address: import("@sinclair/typebox").TString;
83
+ }>, import("@sinclair/typebox").TObject<{
84
+ type_id: import("@sinclair/typebox").TLiteral<"principal_contract">;
85
+ contract_name: import("@sinclair/typebox").TString;
86
+ address: import("@sinclair/typebox").TString;
87
+ }>, import("@sinclair/typebox").TObject<{
88
+ type_id: import("@sinclair/typebox").TLiteral<"principal_origin">;
89
+ }>]>;
90
+ asset: import("@sinclair/typebox").TObject<{
91
+ contract_name: import("@sinclair/typebox").TString;
92
+ asset_name: import("@sinclair/typebox").TString;
93
+ contract_address: import("@sinclair/typebox").TString;
94
+ }>;
95
+ asset_value: import("@sinclair/typebox").TObject<{
96
+ hex: import("@sinclair/typebox").TString;
97
+ repr: import("@sinclair/typebox").TString;
98
+ }>;
99
+ }>;
100
+ export type StacksNonFungiblePostCondition = Static<typeof StacksNonFungiblePostConditionSchema>;
101
+ export declare const StacksPostConditionSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
102
+ type: import("@sinclair/typebox").TLiteral<"stx">;
103
+ condition_code: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sent_equal_to">, import("@sinclair/typebox").TLiteral<"sent_greater_than">, import("@sinclair/typebox").TLiteral<"sent_greater_than_or_equal_to">, import("@sinclair/typebox").TLiteral<"sent_less_than">, import("@sinclair/typebox").TLiteral<"sent_less_than_or_equal_to">]>;
104
+ amount: import("@sinclair/typebox").TString;
105
+ principal: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
106
+ type_id: import("@sinclair/typebox").TLiteral<"principal_standard">;
107
+ address: import("@sinclair/typebox").TString;
108
+ }>, import("@sinclair/typebox").TObject<{
109
+ type_id: import("@sinclair/typebox").TLiteral<"principal_contract">;
110
+ contract_name: import("@sinclair/typebox").TString;
111
+ address: import("@sinclair/typebox").TString;
112
+ }>, import("@sinclair/typebox").TObject<{
113
+ type_id: import("@sinclair/typebox").TLiteral<"principal_origin">;
114
+ }>]>;
115
+ }>, import("@sinclair/typebox").TObject<{
116
+ type: import("@sinclair/typebox").TLiteral<"fungible">;
117
+ condition_code: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sent_equal_to">, import("@sinclair/typebox").TLiteral<"sent_greater_than">, import("@sinclair/typebox").TLiteral<"sent_greater_than_or_equal_to">, import("@sinclair/typebox").TLiteral<"sent_less_than">, import("@sinclair/typebox").TLiteral<"sent_less_than_or_equal_to">]>;
118
+ amount: import("@sinclair/typebox").TString;
119
+ principal: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
120
+ type_id: import("@sinclair/typebox").TLiteral<"principal_standard">;
121
+ address: import("@sinclair/typebox").TString;
122
+ }>, import("@sinclair/typebox").TObject<{
123
+ type_id: import("@sinclair/typebox").TLiteral<"principal_contract">;
124
+ contract_name: import("@sinclair/typebox").TString;
125
+ address: import("@sinclair/typebox").TString;
126
+ }>, import("@sinclair/typebox").TObject<{
127
+ type_id: import("@sinclair/typebox").TLiteral<"principal_origin">;
128
+ }>]>;
129
+ asset: import("@sinclair/typebox").TObject<{
130
+ contract_name: import("@sinclair/typebox").TString;
131
+ asset_name: import("@sinclair/typebox").TString;
132
+ contract_address: import("@sinclair/typebox").TString;
133
+ }>;
134
+ }>, import("@sinclair/typebox").TObject<{
135
+ type: import("@sinclair/typebox").TLiteral<"non_fungible">;
136
+ condition_code: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sent">, import("@sinclair/typebox").TLiteral<"not_sent">]>;
137
+ principal: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
138
+ type_id: import("@sinclair/typebox").TLiteral<"principal_standard">;
139
+ address: import("@sinclair/typebox").TString;
140
+ }>, import("@sinclair/typebox").TObject<{
141
+ type_id: import("@sinclair/typebox").TLiteral<"principal_contract">;
142
+ contract_name: import("@sinclair/typebox").TString;
143
+ address: import("@sinclair/typebox").TString;
144
+ }>, import("@sinclair/typebox").TObject<{
145
+ type_id: import("@sinclair/typebox").TLiteral<"principal_origin">;
146
+ }>]>;
147
+ asset: import("@sinclair/typebox").TObject<{
148
+ contract_name: import("@sinclair/typebox").TString;
149
+ asset_name: import("@sinclair/typebox").TString;
150
+ contract_address: import("@sinclair/typebox").TString;
151
+ }>;
152
+ asset_value: import("@sinclair/typebox").TObject<{
153
+ hex: import("@sinclair/typebox").TString;
154
+ repr: import("@sinclair/typebox").TString;
155
+ }>;
156
+ }>]>;
157
+ export type StacksPostCondition = Static<typeof StacksPostConditionSchema>;
158
+ export {};
159
+ //# sourceMappingURL=post_conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post_conditions.d.ts","sourceRoot":"","sources":["../../../../../src/schemas/chainhook-event/stacks/post_conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,6BAA6B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MAAM,CACjD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StacksPostConditionSchema = exports.StacksPostConditionModeSchema = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ exports.StacksPostConditionModeSchema = typebox_1.Type.Union([
6
+ typebox_1.Type.Literal('allow'),
7
+ typebox_1.Type.Literal('deny'),
8
+ ]);
9
+ const StacksFungiblePostConditionCodeSchema = typebox_1.Type.Union([
10
+ typebox_1.Type.Literal('sent_equal_to'),
11
+ typebox_1.Type.Literal('sent_greater_than'),
12
+ typebox_1.Type.Literal('sent_greater_than_or_equal_to'),
13
+ typebox_1.Type.Literal('sent_less_than'),
14
+ typebox_1.Type.Literal('sent_less_than_or_equal_to'),
15
+ ]);
16
+ const StacksNonFungiblePostConditionCodeSchema = typebox_1.Type.Union([
17
+ typebox_1.Type.Literal('sent'),
18
+ typebox_1.Type.Literal('not_sent'),
19
+ ]);
20
+ const StacksPostConditionPrincipalStandardSchema = typebox_1.Type.Object({
21
+ type_id: typebox_1.Type.Literal('principal_standard'),
22
+ address: typebox_1.Type.String(),
23
+ });
24
+ const StacksPostConditionPrincipalContractSchema = typebox_1.Type.Object({
25
+ type_id: typebox_1.Type.Literal('principal_contract'),
26
+ contract_name: typebox_1.Type.String(),
27
+ address: typebox_1.Type.String(),
28
+ });
29
+ const StacksPostConditionPrincipalOriginSchema = typebox_1.Type.Object({
30
+ type_id: typebox_1.Type.Literal('principal_origin'),
31
+ });
32
+ const StacksPostConditionPrincipalSchema = typebox_1.Type.Union([
33
+ StacksPostConditionPrincipalStandardSchema,
34
+ StacksPostConditionPrincipalContractSchema,
35
+ StacksPostConditionPrincipalOriginSchema,
36
+ ]);
37
+ const StacksPostConditionAssetSchema = typebox_1.Type.Object({
38
+ contract_name: typebox_1.Type.String(),
39
+ asset_name: typebox_1.Type.String(),
40
+ contract_address: typebox_1.Type.String(),
41
+ });
42
+ const StacksStxPostConditionSchema = typebox_1.Type.Object({
43
+ type: typebox_1.Type.Literal('stx'),
44
+ condition_code: StacksFungiblePostConditionCodeSchema,
45
+ amount: typebox_1.Type.String(),
46
+ principal: StacksPostConditionPrincipalSchema,
47
+ });
48
+ const StacksFungiblePostConditionSchema = typebox_1.Type.Object({
49
+ type: typebox_1.Type.Literal('fungible'),
50
+ condition_code: StacksFungiblePostConditionCodeSchema,
51
+ amount: typebox_1.Type.String(),
52
+ principal: StacksPostConditionPrincipalSchema,
53
+ asset: StacksPostConditionAssetSchema,
54
+ });
55
+ const StacksNonFungiblePostConditionSchema = typebox_1.Type.Object({
56
+ type: typebox_1.Type.Literal('non_fungible'),
57
+ condition_code: StacksNonFungiblePostConditionCodeSchema,
58
+ principal: StacksPostConditionPrincipalSchema,
59
+ asset: StacksPostConditionAssetSchema,
60
+ asset_value: typebox_1.Type.Object({
61
+ hex: typebox_1.Type.String(),
62
+ repr: typebox_1.Type.String(),
63
+ }),
64
+ });
65
+ exports.StacksPostConditionSchema = typebox_1.Type.Union([
66
+ StacksStxPostConditionSchema,
67
+ StacksFungiblePostConditionSchema,
68
+ StacksNonFungiblePostConditionSchema,
69
+ ]);
70
+ //# sourceMappingURL=post_conditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post_conditions.js","sourceRoot":"","sources":["../../../../../src/schemas/chainhook-event/stacks/post_conditions.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AAEpC,QAAA,6BAA6B,GAAG,cAAI,CAAC,KAAK,CAAC;IACtD,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IACrB,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC;CACrB,CAAC,CAAC;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