Skip to content

Commit b0bf43a

Browse files
committed
handle versions properly
1 parent cbe6e12 commit b0bf43a

8 files changed

Lines changed: 19 additions & 17 deletions

File tree

.mise.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,16 @@ run = [
4040
[tasks.gen-openapi]
4141
description = "Generate the Rust code for the Privy API"
4242
depends = ["pull-openapi"]
43-
run = [
44-
"cargo-progenitor progenitor --input openapi.json --name privy-openapi -o crates/privy-openapi --version 0.1.0 --no-rustfmt true --license-name \"MIT OR Apache-2.0\"",
45-
"cargo +nightly fmt"
46-
]
43+
run = """
44+
#!/usr/bin/env bash
45+
46+
# get current crate version
47+
VERSION=$(grep -m 1 "^version" Cargo.toml | cut -d '"' -f 2)
48+
cargo-progenitor progenitor --input openapi.json --name privy-openapi -o crates/privy-openapi --version $VERSION --no-rustfmt true --license-name "MIT OR Apache-2.0"
49+
# insert description using sed
50+
sed -i '2i description="Privy OpenAPI Bindings"' crates/privy-openapi/Cargo.toml
51+
cargo +nightly fmt
52+
""""
4753

4854
[tasks.gen-p256-key]
4955
description = "Generate P-256 key pair for Privy wallet owner"

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ serde = { version = "1.0", features = ["derive"] }
1616
serde_json = "1.0"
1717
tokio = { version = "1", features = ["full"] }
1818
uuid = { version = "1.18.1", features = ["serde"] }
19-
privy-openapi = { path = "crates/privy-openapi", version = "0" }
19+
privy-openapi = { path = "crates/privy-openapi", version = "0.1.0-alpha.0" }
2020

2121
# crypto
2222
p256 = { version = "0.13.2", features = ["pem", "ecdsa", "pkcs8"] }

crates/privy-openapi/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
2+
description="Privy OpenAPI Bindings"
23
name = "privy-openapi"
3-
version = "0.1.0"
4+
version = "0.1.0-alpha.0"
45
edition = "2021"
56
license = "MIT OR Apache-2.0"
67

crates/privy-openapi/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34280,7 +34280,6 @@ pub mod types {
3428034280
#[doc = " \"id\","]
3428134281
#[doc = " \"imported\","]
3428234282
#[doc = " \"latest_verified_at\","]
34283-
#[doc = " \"public_key\","]
3428434283
#[doc = " \"recovery_method\","]
3428534284
#[doc = " \"type\","]
3428634285
#[doc = " \"verified_at\","]
@@ -34386,7 +34385,8 @@ pub mod types {
3438634385
pub id: ::std::option::Option<::std::string::String>,
3438734386
pub imported: bool,
3438834387
pub latest_verified_at: ::std::option::Option<f64>,
34389-
pub public_key: ::std::string::String,
34388+
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
34389+
pub public_key: ::std::option::Option<::std::string::String>,
3439034390
pub recovery_method: LinkedAccountSolanaEmbeddedWalletRecoveryMethod,
3439134391
#[serde(rename = "type")]
3439234392
pub type_: LinkedAccountSolanaEmbeddedWalletType,

src/subclients/key_quorums.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
use super::ResponseValue;
12
use crate::{
23
AuthorizationContext, PrivySignedApiError, generate_authorization_signatures,
34
subclients::KeyQuorumsClient,
45
};
56

6-
use super::ResponseValue;
7-
87
impl KeyQuorumsClient {
98
/// Update a key quorum
109
///

src/subclients/policies.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
use super::ResponseValue;
12
use crate::{
23
AuthorizationContext, PrivySignedApiError, generate_authorization_signatures,
34
generated::types::{Policy, UpdatePolicyBody, UpdatePolicyPolicyId},
45
subclients::PoliciesClient,
56
};
67

7-
use super::ResponseValue;
8-
98
impl PoliciesClient {
109
/// Update a policy
1110
///

src/subclients/wallets.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use super::{Error, ResponseValue, types};
12
use crate::{
23
AuthorizationContext, PrivyApiError, PrivyExportError, PrivyHpke, PrivySignedApiError,
34
ethereum::EthereumService,
@@ -12,8 +13,6 @@ use crate::{
1213
subclients::WalletsClient,
1314
};
1415

15-
use super::{Error, ResponseValue, types};
16-
1716
impl WalletsClient {
1817
/// Make a wallet rpc call
1918
///
@@ -139,8 +138,6 @@ impl WalletsClient {
139138
/// Import a wallet into the Privy app
140139
///
141140
/// # Errors
142-
///
143-
///
144141
pub async fn import(
145142
&self,
146143
address: String,

0 commit comments

Comments
 (0)