Skip to content

Commit 53ad7b0

Browse files
authored
feat: Include method tag in solana rpc result (#437)
1 parent 101338d commit 53ad7b0

File tree

2 files changed

+135
-10
lines changed

2 files changed

+135
-10
lines changed

docs/openapi.json

Lines changed: 134 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6013,8 +6013,7 @@
60136013
"type": [
60146014
"boolean",
60156015
"null"
6016-
],
6017-
"description": "Allow concurrent transactions (essential for channel accounts using different accounts' sequence numbers)"
6016+
]
60186017
},
60196018
"max_fee": {
60206019
"type": [
@@ -6754,25 +6753,151 @@
67546753
"SolanaRpcResult": {
67556754
"oneOf": [
67566755
{
6757-
"$ref": "#/components/schemas/FeeEstimateResult"
6756+
"allOf": [
6757+
{
6758+
"$ref": "#/components/schemas/FeeEstimateResult"
6759+
},
6760+
{
6761+
"type": "object",
6762+
"required": [
6763+
"method"
6764+
],
6765+
"properties": {
6766+
"method": {
6767+
"type": "string",
6768+
"enum": [
6769+
"feeEstimate"
6770+
]
6771+
}
6772+
}
6773+
}
6774+
]
67586775
},
67596776
{
6760-
"$ref": "#/components/schemas/TransferTransactionResult"
6777+
"allOf": [
6778+
{
6779+
"$ref": "#/components/schemas/TransferTransactionResult"
6780+
},
6781+
{
6782+
"type": "object",
6783+
"required": [
6784+
"method"
6785+
],
6786+
"properties": {
6787+
"method": {
6788+
"type": "string",
6789+
"enum": [
6790+
"transferTransaction"
6791+
]
6792+
}
6793+
}
6794+
}
6795+
]
67616796
},
67626797
{
6763-
"$ref": "#/components/schemas/PrepareTransactionResult"
6798+
"allOf": [
6799+
{
6800+
"$ref": "#/components/schemas/PrepareTransactionResult"
6801+
},
6802+
{
6803+
"type": "object",
6804+
"required": [
6805+
"method"
6806+
],
6807+
"properties": {
6808+
"method": {
6809+
"type": "string",
6810+
"enum": [
6811+
"prepareTransaction"
6812+
]
6813+
}
6814+
}
6815+
}
6816+
]
67646817
},
67656818
{
6766-
"$ref": "#/components/schemas/SignTransactionResult"
6819+
"allOf": [
6820+
{
6821+
"$ref": "#/components/schemas/SignTransactionResult"
6822+
},
6823+
{
6824+
"type": "object",
6825+
"required": [
6826+
"method"
6827+
],
6828+
"properties": {
6829+
"method": {
6830+
"type": "string",
6831+
"enum": [
6832+
"signTransaction"
6833+
]
6834+
}
6835+
}
6836+
}
6837+
]
67676838
},
67686839
{
6769-
"$ref": "#/components/schemas/SignAndSendTransactionResult"
6840+
"allOf": [
6841+
{
6842+
"$ref": "#/components/schemas/SignAndSendTransactionResult"
6843+
},
6844+
{
6845+
"type": "object",
6846+
"required": [
6847+
"method"
6848+
],
6849+
"properties": {
6850+
"method": {
6851+
"type": "string",
6852+
"enum": [
6853+
"signAndSendTransaction"
6854+
]
6855+
}
6856+
}
6857+
}
6858+
]
67706859
},
67716860
{
6772-
"$ref": "#/components/schemas/GetSupportedTokensResult"
6861+
"allOf": [
6862+
{
6863+
"$ref": "#/components/schemas/GetSupportedTokensResult"
6864+
},
6865+
{
6866+
"type": "object",
6867+
"required": [
6868+
"method"
6869+
],
6870+
"properties": {
6871+
"method": {
6872+
"type": "string",
6873+
"enum": [
6874+
"getSupportedTokens"
6875+
]
6876+
}
6877+
}
6878+
}
6879+
]
67736880
},
67746881
{
6775-
"$ref": "#/components/schemas/GetFeaturesEnabledResult"
6882+
"allOf": [
6883+
{
6884+
"$ref": "#/components/schemas/GetFeaturesEnabledResult"
6885+
},
6886+
{
6887+
"type": "object",
6888+
"required": [
6889+
"method"
6890+
],
6891+
"properties": {
6892+
"method": {
6893+
"type": "string",
6894+
"enum": [
6895+
"getFeaturesEnabled"
6896+
]
6897+
}
6898+
}
6899+
}
6900+
]
67766901
}
67776902
]
67786903
},

src/models/rpc/solana/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub enum SolanaRpcRequest {
240240
}
241241

242242
#[derive(Debug, Serialize, Deserialize, ToSchema, PartialEq)]
243-
#[serde(untagged)]
243+
#[serde(tag = "method", rename_all = "camelCase")]
244244
pub enum SolanaRpcResult {
245245
FeeEstimate(FeeEstimateResult),
246246
TransferTransaction(TransferTransactionResult),

0 commit comments

Comments
 (0)