Surge Tutorial
What You'll Build
Prerequisites
The Conversion Flow
Surge WebSocket → SurgeRawGatewayResponse → EVMUtils.convertSurgeUpdateToEvmFormat() → bytes → Smart ContractThe SurgeRawGatewayResponse Structure
The Conversion Script
The convertSurgeUpdateToEvmFormat Function
EVM Data Structure
Field
Size
Description
Feed Data (per feed)
Field
Size
Description
Signature Data (per signature)
Field
Size
Description
Parsing the Encoded Data
Using with Smart Contracts
TypeScript Integration
Full Integration Pattern
Running the Example
1. Clone the Examples Repository
2. Install Dependencies
3. Run the Conversion Example
Expected Output
Troubleshooting
Error
Solution
Next Steps
Last updated