File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed
packages/thirdweb/src/bridge Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ describe.runIf(process.env.TW_SECRET_KEY)("Bridge.status", () => {
7
7
// TODO: flaky test
8
8
it . skip ( "should handle successful status" , async ( ) => {
9
9
const result = await status ( {
10
- chainId : 137 ,
10
+ chainId : 8453 ,
11
11
client : TEST_CLIENT ,
12
12
transactionHash :
13
- "0x5959b9321ec581640db531b80bac53cbd968f3d34fc6cb1d5f4ea75f26df2ad7 " ,
13
+ "0x8e8ab7c998bdfef6e10951c801a862373ce87af62c21fb870e62fca57683bf10 " ,
14
14
} ) ;
15
15
16
16
expect ( result ) . toBeDefined ( ) ;
@@ -46,7 +46,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("Bridge.status", () => {
46
46
chain : defineChain ( 8453 ) ,
47
47
client : TEST_CLIENT ,
48
48
transactionHash :
49
- "0x06ac91479b3ea4c6507f9b7bff1f2d5f553253fa79af9a7db3755563b60f7dfb " ,
49
+ "0x8e8ab7c998bdfef6e10951c801a862373ce87af62c21fb870e62fca57683bf10 " ,
50
50
} ) ;
51
51
52
52
expect ( result ) . toBeDefined ( ) ;
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ describe("parseIncomingWebhook", () => {
64
64
] ,
65
65
type : "transfer" ,
66
66
} ,
67
- topic : "pay.onchain-transaction" ,
67
+ type : "pay.onchain-transaction" ,
68
68
version : 2 ,
69
69
} ;
70
70
const validPayload = {
@@ -158,7 +158,7 @@ describe("parseIncomingWebhook", () => {
158
158
data : {
159
159
someField : "value" ,
160
160
} ,
161
- topic : "pay.onchain-transaction" ,
161
+ type : "pay.onchain-transaction" ,
162
162
version : 1 ,
163
163
} ;
164
164
const v1PayloadString = JSON . stringify ( v1Payload ) ;
@@ -585,7 +585,7 @@ describe("parseIncomingWebhook", () => {
585
585
586
586
it ( "should throw error for version 1 payload missing data object" , async ( ) => {
587
587
const invalidPayload = {
588
- topic : "pay.onchain-transaction" ,
588
+ type : "pay.onchain-transaction" ,
589
589
version : 1 ,
590
590
// no data field
591
591
} as unknown as WebhookPayload ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const tokenSchema = z.object({
21
21
const onchainWebhookSchema = z . discriminatedUnion ( "version" , [
22
22
z . object ( {
23
23
data : z . object ( { } ) ,
24
- topic : z . literal ( "pay.onchain-transaction" ) ,
24
+ type : z . literal ( "pay.onchain-transaction" ) ,
25
25
version : z . literal ( 1 ) ,
26
26
} ) ,
27
27
z . object ( {
@@ -49,15 +49,15 @@ const onchainWebhookSchema = z.discriminatedUnion("version", [
49
49
) ,
50
50
type : z . string ( ) ,
51
51
} ) ,
52
- topic : z . literal ( "pay.onchain-transaction" ) ,
52
+ type : 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
- topic : z . literal ( "pay.onramp-transaction" ) ,
60
+ type : z . literal ( "pay.onramp-transaction" ) ,
61
61
version : z . literal ( 1 ) ,
62
62
} ) ,
63
63
z . object ( {
@@ -75,12 +75,12 @@ const onrampWebhookSchema = z.discriminatedUnion("version", [
75
75
token : tokenSchema ,
76
76
transactionHash : z . optional ( hexSchema ) ,
77
77
} ) ,
78
- topic : z . literal ( "pay.onramp-transaction" ) ,
78
+ type : z . literal ( "pay.onramp-transaction" ) ,
79
79
version : z . literal ( 2 ) ,
80
80
} ) ,
81
81
] ) ;
82
82
83
- const webhookSchema = z . discriminatedUnion ( "topic " , [
83
+ const webhookSchema = z . discriminatedUnion ( "type " , [
84
84
onchainWebhookSchema ,
85
85
onrampWebhookSchema ,
86
86
] ) ;
You can’t perform that action at this time.
0 commit comments