diff --git a/api/docs/docs.go b/api/docs/docs.go index a01f568f..f08efdd4 100644 --- a/api/docs/docs.go +++ b/api/docs/docs.go @@ -2876,9 +2876,15 @@ const docTemplate = `{ "fee": { "type": "string" }, + "feeUSD": { + "type": "string" + }, "from": { "type": "string" }, + "gasTokenNotional": { + "type": "string" + }, "status": { "type": "string" }, @@ -2937,9 +2943,18 @@ const docTemplate = `{ "chainId": { "$ref": "#/definitions/vaa.ChainID" }, + "fee": { + "type": "string" + }, + "feeUSD": { + "type": "string" + }, "from": { "type": "string" }, + "gasTokenNotional": { + "type": "string" + }, "status": { "type": "string" }, diff --git a/api/docs/swagger.json b/api/docs/swagger.json index ebf23eb6..176ac5fb 100644 --- a/api/docs/swagger.json +++ b/api/docs/swagger.json @@ -2869,9 +2869,15 @@ "fee": { "type": "string" }, + "feeUSD": { + "type": "string" + }, "from": { "type": "string" }, + "gasTokenNotional": { + "type": "string" + }, "status": { "type": "string" }, @@ -2930,9 +2936,18 @@ "chainId": { "$ref": "#/definitions/vaa.ChainID" }, + "fee": { + "type": "string" + }, + "feeUSD": { + "type": "string" + }, "from": { "type": "string" }, + "gasTokenNotional": { + "type": "string" + }, "status": { "type": "string" }, diff --git a/api/docs/swagger.yaml b/api/docs/swagger.yaml index 02c908fa..bda2afcd 100644 --- a/api/docs/swagger.yaml +++ b/api/docs/swagger.yaml @@ -435,8 +435,12 @@ definitions: $ref: '#/definitions/vaa.ChainID' fee: type: string + feeUSD: + type: string from: type: string + gasTokenNotional: + type: string status: type: string timestamp: @@ -475,8 +479,14 @@ definitions: properties: chainId: $ref: '#/definitions/vaa.ChainID' + fee: + type: string + feeUSD: + type: string from: type: string + gasTokenNotional: + type: string status: type: string timestamp: diff --git a/api/routes/wormscan/operations/response.go b/api/routes/wormscan/operations/response.go index 58fc1b75..4b3a56e0 100644 --- a/api/routes/wormscan/operations/response.go +++ b/api/routes/wormscan/operations/response.go @@ -46,13 +46,15 @@ type Content struct { // SourceChain definition. type SourceChain struct { - ChainId sdk.ChainID `json:"chainId"` - Timestamp *time.Time `json:"timestamp"` - Transaction Transaction `json:"transaction"` - From string `json:"from"` - Status string `json:"status"` - Data *Data `json:"attribute,omitempty"` - Fee *string `json:"fee,omitempty"` + ChainId sdk.ChainID `json:"chainId"` + Timestamp *time.Time `json:"timestamp"` + Transaction Transaction `json:"transaction"` + From string `json:"from"` + Status string `json:"status"` + Data *Data `json:"attribute,omitempty"` + Fee *string `json:"fee,omitempty"` + GasTokenNotional *string `json:"gasTokenNotional,omitempty"` + FeeUSD *string `json:"feeUSD,omitempty"` } // TxHash definition. @@ -63,13 +65,15 @@ type Transaction struct { // TargetChain definition. type TargetChain struct { - ChainId sdk.ChainID `json:"chainId"` - Timestamp *time.Time `json:"timestamp"` - Transaction Transaction `json:"transaction"` - Status string `json:"status"` - From string `json:"from"` - To string `json:"to"` - Fee *string `json:"fee,omitempty"` + ChainId sdk.ChainID `json:"chainId"` + Timestamp *time.Time `json:"timestamp"` + Transaction Transaction `json:"transaction"` + Status string `json:"status"` + From string `json:"from"` + To string `json:"to"` + Fee *string `json:"fee,omitempty"` + GasTokenNotional *string `json:"gasTokenNotional,omitempty"` + FeeUSD *string `json:"feeUSD,omitempty"` } // Data represents a custom attribute for a origin transaction. @@ -205,29 +209,35 @@ func getChainEvents(chainID sdk.ChainID, operation *operations.OperationDto) (*S SecondTxHash: secondTxHash, } - var sourceFee *string + var sourceFee, sourceFeeUSD, sourceGasTokenNotional *string if operation.SourceTx.Fee != nil { sourceFee = &operation.SourceTx.Fee.Fee + sourceFeeUSD = &operation.SourceTx.Fee.FeeUSD + sourceGasTokenNotional = &operation.SourceTx.Fee.GasTokenNotional } sourceChain = &SourceChain{ - ChainId: chainID, - Timestamp: operation.SourceTx.Timestamp, - Transaction: transaction, - From: operation.SourceTx.From, - Status: operation.SourceTx.Status, - Data: data, - Fee: sourceFee, + ChainId: chainID, + Timestamp: operation.SourceTx.Timestamp, + Transaction: transaction, + From: operation.SourceTx.From, + Status: operation.SourceTx.Status, + Data: data, + Fee: sourceFee, + FeeUSD: sourceFeeUSD, + GasTokenNotional: sourceGasTokenNotional, } } // build targetChain var targetChain *TargetChain if operation.DestinationTx != nil { + var targetFee, targetFeeUSD, targetGasTokenNotional *string - var targetFee *string if operation.DestinationTx.Fee != nil { targetFee = &operation.DestinationTx.Fee.Fee + targetFeeUSD = &operation.DestinationTx.Fee.FeeUSD + targetGasTokenNotional = &operation.DestinationTx.Fee.GasTokenNotional } targetChain = &TargetChain{ @@ -236,10 +246,12 @@ func getChainEvents(chainID sdk.ChainID, operation *operations.OperationDto) (*S Transaction: Transaction{ TxHash: operation.DestinationTx.TxHash, }, - Status: operation.DestinationTx.Status, - From: operation.DestinationTx.From, - To: operation.DestinationTx.To, - Fee: targetFee, + Status: operation.DestinationTx.Status, + From: operation.DestinationTx.From, + To: operation.DestinationTx.To, + Fee: targetFee, + FeeUSD: targetFeeUSD, + GasTokenNotional: targetGasTokenNotional, } }