@@ -16,6 +16,7 @@ export enum TransferState {
16
16
SourceFinalized , // Source chain transactions are finalized or whenever we have a message id
17
17
InReview , // Transfer is in review (e.g. held by governor)
18
18
Attested , // VAA or Circle Attestation is available
19
+ Refunded , // Transfer failed and was refunded on the source chain
19
20
DestinationInitiated , // Attestation is submitted to destination chain
20
21
DestinationQueued , // Transfer is queued on destination chain
21
22
DestinationFinalized , // Destination transaction is finalized
@@ -70,6 +71,14 @@ export interface AttestedTransferReceipt<AT, SC extends Chain = Chain, DC extend
70
71
attestation : Required < AT > ;
71
72
}
72
73
74
+ export interface RefundedTransferReceipt < AT , SC extends Chain = Chain , DC extends Chain = Chain >
75
+ extends BaseTransferReceipt < SC , DC > {
76
+ state : TransferState . Refunded ;
77
+ originTxs : TransactionId < SC > [ ] ;
78
+ refundTxs : TransactionId < SC > [ ] ;
79
+ attestation : AT ;
80
+ }
81
+
73
82
export interface RedeemedTransferReceipt < AT , SC extends Chain = Chain , DC extends Chain = Chain >
74
83
extends BaseTransferReceipt < SC , DC > {
75
84
state : TransferState . DestinationInitiated ;
@@ -131,6 +140,12 @@ export function isAttested<AT>(
131
140
return receipt . state === TransferState . Attested ;
132
141
}
133
142
143
+ export function isRefunded < AT > (
144
+ receipt : TransferReceipt < AT > ,
145
+ ) : receipt is RefundedTransferReceipt < AT > {
146
+ return receipt . state === TransferState . Refunded ;
147
+ }
148
+
134
149
export function isRedeemed < AT > (
135
150
receipt : TransferReceipt < AT > ,
136
151
) : receipt is RedeemedTransferReceipt < AT > {
@@ -160,6 +175,7 @@ export type TransferReceipt<AT, SC extends Chain = Chain, DC extends Chain = Cha
160
175
| SourceFinalizedTransferReceipt < AT , SC , DC >
161
176
| InReviewTransferReceipt < AT , SC , DC >
162
177
| AttestedTransferReceipt < AT , SC , DC >
178
+ | RefundedTransferReceipt < AT , SC , DC >
163
179
| RedeemedTransferReceipt < AT , SC , DC >
164
180
| DestinationQueuedTransferReceipt < AT , SC , DC >
165
181
| CompletedTransferReceipt < AT , SC , DC > ;
0 commit comments