Skip to content

Commit 1c0ba6c

Browse files
authored
fix: Improve openapi spec for evm transaction response (#468)
1 parent 367a6e9 commit 1c0ba6c

File tree

2 files changed

+48
-61
lines changed

2 files changed

+48
-61
lines changed

docs/openapi.json

Lines changed: 45 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4274,6 +4274,31 @@
42744274
}
42754275
}
42764276
},
4277+
"CdpSignerRequestConfig": {
4278+
"type": "object",
4279+
"description": "CDP signer configuration for API requests",
4280+
"required": [
4281+
"api_key_id",
4282+
"api_key_secret",
4283+
"wallet_secret",
4284+
"account_address"
4285+
],
4286+
"properties": {
4287+
"account_address": {
4288+
"type": "string"
4289+
},
4290+
"api_key_id": {
4291+
"type": "string"
4292+
},
4293+
"api_key_secret": {
4294+
"type": "string"
4295+
},
4296+
"wallet_secret": {
4297+
"type": "string"
4298+
}
4299+
},
4300+
"additionalProperties": false
4301+
},
42774302
"ContractSource": {
42784303
"oneOf": [
42794304
{
@@ -4601,8 +4626,7 @@
46014626
"minimum": 0
46024627
},
46034628
"gas_price": {
4604-
"type": "integer",
4605-
"minimum": 0
4629+
"type": "string"
46064630
},
46074631
"hash": {
46084632
"type": "string"
@@ -4611,12 +4635,10 @@
46114635
"type": "string"
46124636
},
46134637
"max_fee_per_gas": {
4614-
"type": "integer",
4615-
"minimum": 0
4638+
"type": "string"
46164639
},
46174640
"max_priority_fee_per_gas": {
4618-
"type": "integer",
4619-
"minimum": 0
4641+
"type": "string"
46204642
},
46214643
"nonce": {
46224644
"type": "integer",
@@ -6285,10 +6307,10 @@
62856307
"$ref": "#/components/schemas/TurnkeySignerRequestConfig"
62866308
},
62876309
{
6288-
"$ref": "#/components/schemas/GoogleCloudKmsSignerRequestConfig"
6310+
"$ref": "#/components/schemas/CdpSignerRequestConfig"
62896311
},
62906312
{
6291-
"$ref": "#/components/schemas/CDPSignerRequestConfig"
6313+
"$ref": "#/components/schemas/GoogleCloudKmsSignerRequestConfig"
62926314
}
62936315
],
62946316
"description": "Signer configuration enum for API requests (without type discriminator)"
@@ -6396,34 +6418,32 @@
63966418
{
63976419
"type": "object",
63986420
"required": [
6399-
"service_account",
6400-
"key"
6421+
"api_key_id",
6422+
"account_address"
64016423
],
64026424
"properties": {
6403-
"key": {
6404-
"$ref": "#/components/schemas/GoogleCloudKmsSignerKeyResponseConfig"
6425+
"account_address": {
6426+
"type": "string"
64056427
},
6406-
"service_account": {
6407-
"$ref": "#/components/schemas/GoogleCloudKmsSignerServiceAccountResponseConfig"
6428+
"api_key_id": {
6429+
"type": "string"
64086430
}
64096431
}
64106432
},
64116433
{
64126434
"type": "object",
64136435
"required": [
6414-
"api_key_id",
6415-
"account_address"
6436+
"service_account",
6437+
"key"
64166438
],
64176439
"properties": {
6418-
"api_key_id": {
6419-
"type": "string"
6440+
"key": {
6441+
"$ref": "#/components/schemas/GoogleCloudKmsSignerKeyResponseConfig"
64206442
},
6421-
"account_address": {
6422-
"type": "string"
6443+
"service_account": {
6444+
"$ref": "#/components/schemas/GoogleCloudKmsSignerServiceAccountResponseConfig"
64236445
}
6424-
},
6425-
"description": "Non-secret CDP signer details.",
6426-
"additionalProperties": false
6446+
}
64276447
},
64286448
{
64296449
"type": "object"
@@ -6498,8 +6518,8 @@
64986518
"vault",
64996519
"vault_transit",
65006520
"turnkey",
6501-
"google_cloud_kms",
6502-
"cdp"
6521+
"cdp",
6522+
"google_cloud_kms"
65036523
]
65046524
},
65056525
"SignerUpdateRequest": {
@@ -7267,39 +7287,6 @@
72677287
},
72687288
"additionalProperties": false
72697289
},
7270-
"CDPSignerRequestConfig": {
7271-
"type": "object",
7272-
"description": "CDP signer configuration for API requests",
7273-
"required": [
7274-
"api_key_id",
7275-
"api_key_secret",
7276-
"wallet_secret",
7277-
"account_address"
7278-
],
7279-
"properties": {
7280-
"api_key_id": {
7281-
"type": "string",
7282-
"minLength": 1
7283-
},
7284-
"api_key_secret": {
7285-
"type": "string",
7286-
"format": "password",
7287-
"writeOnly": true,
7288-
"minLength": 1
7289-
},
7290-
"wallet_secret": {
7291-
"type": "string",
7292-
"format": "password",
7293-
"writeOnly": true,
7294-
"minLength": 1
7295-
},
7296-
"account_address": {
7297-
"type": "string",
7298-
"pattern": "^((0x[0-9a-fA-F]{40})|([1-9A-HJ-NP-Za-km-z]{32,44}))$"
7299-
}
7300-
},
7301-
"additionalProperties": false
7302-
},
73037290
"UpdateRelayerRequest": {
73047291
"type": "object",
73057292
"properties": {

src/models/transaction/response.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub struct EvmTransactionResponse {
3333
deserialize_with = "deserialize_optional_u128",
3434
default
3535
)]
36-
#[schema(nullable = false)]
36+
#[schema(nullable = false, value_type = String)]
3737
pub gas_price: Option<u128>,
3838
#[serde(deserialize_with = "deserialize_optional_u64", default)]
3939
pub gas_limit: Option<u64>,
@@ -53,14 +53,14 @@ pub struct EvmTransactionResponse {
5353
deserialize_with = "deserialize_optional_u128",
5454
default
5555
)]
56-
#[schema(nullable = false)]
56+
#[schema(nullable = false, value_type = String)]
5757
pub max_fee_per_gas: Option<u128>,
5858
#[serde(
5959
serialize_with = "serialize_optional_u128",
6060
deserialize_with = "deserialize_optional_u128",
6161
default
6262
)]
63-
#[schema(nullable = false)]
63+
#[schema(nullable = false, value_type = String)]
6464
pub max_priority_fee_per_gas: Option<u128>,
6565
pub signature: Option<EvmTransactionDataSignature>,
6666
pub speed: Option<Speed>,

0 commit comments

Comments
 (0)