@@ -21,18 +21,18 @@ const tokenSchema = z.object({
21
21
const onchainWebhookSchema = z . discriminatedUnion ( "version" , [
22
22
z . object ( {
23
23
data : z . object ( { } ) ,
24
- type : z . literal ( "ONCHAIN " ) ,
24
+ topic : z . literal ( "pay.onchain-transaction " ) ,
25
25
version : z . literal ( 1 ) ,
26
26
} ) ,
27
27
z . object ( {
28
28
data : z . object ( {
29
29
action : z . enum ( [ "TRANSFER" , "BUY" , "SELL" ] ) ,
30
30
clientId : z . string ( ) ,
31
- destinationAmount : z . string ( ) ,
31
+ destinationAmount : z . coerce . bigint ( ) ,
32
32
destinationToken : tokenSchema ,
33
33
developerFeeBps : z . coerce . number ( ) ,
34
34
developerFeeRecipient : addressSchema ,
35
- originAmount : z . string ( ) ,
35
+ originAmount : z . coerce . bigint ( ) ,
36
36
originToken : tokenSchema ,
37
37
paymentId : z . string ( ) ,
38
38
// only exists when the payment was triggered from a developer specified payment link
@@ -49,20 +49,20 @@ const onchainWebhookSchema = z.discriminatedUnion("version", [
49
49
) ,
50
50
type : z . string ( ) ,
51
51
} ) ,
52
- type : z . literal ( "ONCHAIN " ) ,
52
+ topic : z . literal ( "pay.onchain-transaction " ) ,
53
53
version : z . literal ( 2 ) ,
54
54
} ) ,
55
55
] ) ;
56
56
57
57
const onrampWebhookSchema = z . discriminatedUnion ( "version" , [
58
58
z . object ( {
59
59
data : z . object ( { } ) ,
60
- type : z . literal ( "ONRAMP " ) ,
60
+ topic : z . literal ( "pay.onramp-transaction " ) ,
61
61
version : z . literal ( 1 ) ,
62
62
} ) ,
63
63
z . object ( {
64
64
data : z . object ( {
65
- amount : z . string ( ) ,
65
+ amount : z . coerce . bigint ( ) ,
66
66
currency : z . string ( ) ,
67
67
currencyAmount : z . number ( ) ,
68
68
id : z . string ( ) ,
@@ -75,7 +75,7 @@ const onrampWebhookSchema = z.discriminatedUnion("version", [
75
75
token : tokenSchema ,
76
76
transactionHash : z . optional ( hexSchema ) ,
77
77
} ) ,
78
- type : z . literal ( "ONRAMP " ) ,
78
+ topic : z . literal ( "pay.onramp-transaction " ) ,
79
79
version : z . literal ( 2 ) ,
80
80
} ) ,
81
81
] ) ;
0 commit comments