@@ -2,7 +2,7 @@ import { Static, Type } from '@sinclair/typebox';
2
2
import {
3
3
BlockIdentifierSchema ,
4
4
Nullable ,
5
- OperationIdentifierSchema ,
5
+ RosettaOperationSchema ,
6
6
TransactionIdentifierSchema ,
7
7
} from '../common' ;
8
8
import { StacksTransactionEventSchema } from './tx_events' ;
@@ -53,54 +53,9 @@ export const StacksTransactionMetadataSchema = Type.Object({
53
53
} ) ;
54
54
export type StacksTransactionMetadata = Static < typeof StacksTransactionMetadataSchema > ;
55
55
56
- export const StacksOperationAccountSchema = Type . Object ( {
57
- address : StacksPrincipalSchema ,
58
- sub_account : Type . Optional ( StacksPrincipalSchema ) ,
59
- } ) ;
60
- export type StacksOperationAccount = Static < typeof StacksOperationAccountSchema > ;
61
-
62
- export const StacksOperationAmountSchema = Type . Object ( {
63
- currency : Type . Object ( {
64
- decimals : Type . Integer ( ) ,
65
- symbol : Type . String ( ) ,
66
- metadata : Type . Object ( {
67
- asset_class_identifier : Type . String ( ) ,
68
- asset_identifier : Nullable ( Type . String ( ) ) ,
69
- standard : Type . String ( ) ,
70
- } ) ,
71
- } ) ,
72
- value : Type . Integer ( ) ,
73
- } ) ;
74
- export type StacksOperationAmount = Static < typeof StacksOperationAmountSchema > ;
75
-
76
- export const StacksOperationPublicKeySchema = Type . Object ( {
77
- hex_bytes : Type . Optional ( Type . String ( ) ) ,
78
- curve_type : Type . String ( ) ,
79
- } ) ;
80
- export type StacksOperationPublicKey = Static < typeof StacksOperationPublicKeySchema > ;
81
-
82
- export const StacksOperationMetadataSchema = Type . Object ( {
83
- public_key : Type . Optional ( StacksOperationPublicKeySchema ) ,
84
- code : Type . Optional ( Type . String ( ) ) ,
85
- method_name : Type . Optional ( Type . String ( ) ) ,
86
- args : Type . Optional ( Type . String ( ) ) ,
87
- } ) ;
88
- export type StacksOperationMetadata = Static < typeof StacksOperationMetadataSchema > ;
89
-
90
- export const StacksOperationSchema = Type . Object ( {
91
- account : StacksOperationAccountSchema ,
92
- amount : Type . Optional ( StacksOperationAmountSchema ) ,
93
- metadata : Type . Optional ( StacksOperationMetadataSchema ) ,
94
- operation_identifier : OperationIdentifierSchema ,
95
- related_operations : Type . Optional ( Type . Array ( OperationIdentifierSchema ) ) ,
96
- status : Type . Optional ( Type . Literal ( 'SUCCESS' ) ) ,
97
- type : Type . Union ( [ Type . Literal ( 'CREDIT' ) , Type . Literal ( 'DEBIT' ) , Type . Literal ( 'LOCK' ) ] ) ,
98
- } ) ;
99
- export type StacksOperation = Static < typeof StacksOperationSchema > ;
100
-
101
56
const StacksTransactionSchema = Type . Object ( {
102
57
transaction_identifier : TransactionIdentifierSchema ,
103
- operations : Type . Array ( StacksOperationSchema ) ,
58
+ operations : Type . Array ( RosettaOperationSchema ) ,
104
59
metadata : StacksTransactionMetadataSchema ,
105
60
} ) ;
106
61
export type StacksTransaction = Static < typeof StacksTransactionSchema > ;
0 commit comments