File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Cancel Relayer Transaction By Id Example
3+ *
4+ * This example demonstrates how to use the OpenZeppelin Relayer SDK to cancel a relayer transaction by id.
5+ *
6+ * IMPORTANT: This is provided as a demonstration only. For production use:
7+ * - Use proper error handling and transaction confirmation checks
8+ * - Implement appropriate security measures for API keys and tokens
9+ * - Consider rate limiting and monitoring for production applications
10+ * - Test thoroughly on devnet/testnet before using on mainnet
11+ * - Use https connection for production applications
12+ *
13+ * Usage:
14+ * ts-node cancelTransactionById.ts
15+ */
16+ import { Configuration , RelayersApi } from '../../src' ;
17+
18+ // example dev config
19+ const config = new Configuration ( {
20+ basePath : 'http://localhost:8080' ,
21+ accessToken : 'Bearer example-123456' ,
22+ } ) ;
23+
24+ const relayersApi = new RelayersApi ( config ) ;
25+
26+ const relayer_id = 'sepolia-example' ;
27+
28+ const transaction_id = '305ff83d-6653-465f-8fa3-e8a46271fb83' ;
29+
30+ relayersApi
31+ . cancelTransaction ( relayer_id , transaction_id )
32+ . then ( ( transaction ) => console . log ( JSON . stringify ( transaction . data , null , 2 ) ) )
33+ . catch ( console . error ) ;
You can’t perform that action at this time.
0 commit comments