1#[allow(unused_imports)]
2use progenitor_middleware_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt};
3#[allow(unused_imports)]
4pub use progenitor_middleware_client::{ByteStream, ClientInfo, Error, ResponseValue};
5#[allow(clippy::all)]
7pub mod types {
8 pub mod error {
10 pub struct ConversionError(::std::borrow::Cow<'static, str>);
12 impl ::std::error::Error for ConversionError {}
13 impl ::std::fmt::Display for ConversionError {
14 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
15 ::std::fmt::Display::fmt(&self.0, f)
16 }
17 }
18 impl ::std::fmt::Debug for ConversionError {
19 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
20 ::std::fmt::Debug::fmt(&self.0, f)
21 }
22 }
23 impl From<&'static str> for ConversionError {
24 fn from(value: &'static str) -> Self {
25 Self(value.into())
26 }
27 }
28 impl From<String> for ConversionError {
29 fn from(value: String) -> Self {
30 Self(value.into())
31 }
32 }
33 }
34 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
109 #[serde(transparent)]
110 pub struct Abi(pub ::std::vec::Vec<AbiItem>);
111 impl ::std::ops::Deref for Abi {
112 type Target = ::std::vec::Vec<AbiItem>;
113 fn deref(&self) -> &::std::vec::Vec<AbiItem> {
114 &self.0
115 }
116 }
117 impl ::std::convert::From<Abi> for ::std::vec::Vec<AbiItem> {
118 fn from(value: Abi) -> Self {
119 value.0
120 }
121 }
122 impl ::std::convert::From<&Abi> for Abi {
123 fn from(value: &Abi) -> Self {
124 value.clone()
125 }
126 }
127 impl ::std::convert::From<::std::vec::Vec<AbiItem>> for Abi {
128 fn from(value: ::std::vec::Vec<AbiItem>) -> Self {
129 Self(value)
130 }
131 }
132 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
247 pub struct AbiFunction {
248 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
250 pub constant: ::std::option::Option<bool>,
251 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
253 pub gas: ::std::option::Option<i64>,
254 pub inputs: ::std::vec::Vec<AbiParameter>,
256 pub name: ::std::string::String,
258 pub outputs: ::std::vec::Vec<AbiParameter>,
260 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
262 pub payable: ::std::option::Option<bool>,
263 #[serde(rename = "stateMutability")]
264 pub state_mutability: AbiStateMutability,
265 #[serde(rename = "type")]
267 pub type_: AbiFunctionType,
268 }
269 impl ::std::convert::From<&AbiFunction> for AbiFunction {
270 fn from(value: &AbiFunction) -> Self {
271 value.clone()
272 }
273 }
274 impl AbiFunction {
275 pub fn builder() -> builder::AbiFunction {
276 Default::default()
277 }
278 }
279 #[derive(
297 ::serde::Deserialize,
298 ::serde::Serialize,
299 Clone,
300 Copy,
301 Debug,
302 Eq,
303 Hash,
304 Ord,
305 PartialEq,
306 PartialOrd,
307 )]
308 pub enum AbiFunctionType {
309 #[serde(rename = "function")]
310 Function,
311 }
312 impl ::std::convert::From<&Self> for AbiFunctionType {
313 fn from(value: &AbiFunctionType) -> Self {
314 value.clone()
315 }
316 }
317 impl ::std::fmt::Display for AbiFunctionType {
318 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
319 match *self {
320 Self::Function => f.write_str("function"),
321 }
322 }
323 }
324 impl ::std::str::FromStr for AbiFunctionType {
325 type Err = self::error::ConversionError;
326 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
327 match value {
328 "function" => Ok(Self::Function),
329 _ => Err("invalid value".into()),
330 }
331 }
332 }
333 impl ::std::convert::TryFrom<&str> for AbiFunctionType {
334 type Error = self::error::ConversionError;
335 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
336 value.parse()
337 }
338 }
339 impl ::std::convert::TryFrom<&::std::string::String> for AbiFunctionType {
340 type Error = self::error::ConversionError;
341 fn try_from(
342 value: &::std::string::String,
343 ) -> ::std::result::Result<Self, self::error::ConversionError> {
344 value.parse()
345 }
346 }
347 impl ::std::convert::TryFrom<::std::string::String> for AbiFunctionType {
348 type Error = self::error::ConversionError;
349 fn try_from(
350 value: ::std::string::String,
351 ) -> ::std::result::Result<Self, self::error::ConversionError> {
352 value.parse()
353 }
354 }
355 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
404 pub struct AbiInput {
405 #[serde(
407 rename = "additionalProperties",
408 default,
409 skip_serializing_if = "::std::option::Option::is_none"
410 )]
411 pub additional_properties: ::std::option::Option<::serde_json::Value>,
412 #[serde(rename = "type")]
414 pub type_: AbiInputType,
415 }
416 impl ::std::convert::From<&AbiInput> for AbiInput {
417 fn from(value: &AbiInput) -> Self {
418 value.clone()
419 }
420 }
421 impl AbiInput {
422 pub fn builder() -> builder::AbiInput {
423 Default::default()
424 }
425 }
426 #[derive(
448 ::serde::Deserialize,
449 ::serde::Serialize,
450 Clone,
451 Copy,
452 Debug,
453 Eq,
454 Hash,
455 Ord,
456 PartialEq,
457 PartialOrd,
458 )]
459 pub enum AbiInputType {
460 #[serde(rename = "constructor")]
461 Constructor,
462 #[serde(rename = "error")]
463 Error,
464 #[serde(rename = "event")]
465 Event,
466 #[serde(rename = "fallback")]
467 Fallback,
468 #[serde(rename = "receive")]
469 Receive,
470 }
471 impl ::std::convert::From<&Self> for AbiInputType {
472 fn from(value: &AbiInputType) -> Self {
473 value.clone()
474 }
475 }
476 impl ::std::fmt::Display for AbiInputType {
477 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
478 match *self {
479 Self::Constructor => f.write_str("constructor"),
480 Self::Error => f.write_str("error"),
481 Self::Event => f.write_str("event"),
482 Self::Fallback => f.write_str("fallback"),
483 Self::Receive => f.write_str("receive"),
484 }
485 }
486 }
487 impl ::std::str::FromStr for AbiInputType {
488 type Err = self::error::ConversionError;
489 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
490 match value {
491 "constructor" => Ok(Self::Constructor),
492 "error" => Ok(Self::Error),
493 "event" => Ok(Self::Event),
494 "fallback" => Ok(Self::Fallback),
495 "receive" => Ok(Self::Receive),
496 _ => Err("invalid value".into()),
497 }
498 }
499 }
500 impl ::std::convert::TryFrom<&str> for AbiInputType {
501 type Error = self::error::ConversionError;
502 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
503 value.parse()
504 }
505 }
506 impl ::std::convert::TryFrom<&::std::string::String> for AbiInputType {
507 type Error = self::error::ConversionError;
508 fn try_from(
509 value: &::std::string::String,
510 ) -> ::std::result::Result<Self, self::error::ConversionError> {
511 value.parse()
512 }
513 }
514 impl ::std::convert::TryFrom<::std::string::String> for AbiInputType {
515 type Error = self::error::ConversionError;
516 fn try_from(
517 value: ::std::string::String,
518 ) -> ::std::result::Result<Self, self::error::ConversionError> {
519 value.parse()
520 }
521 }
522 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
540 #[serde(untagged)]
541 pub enum AbiItem {
542 Function(AbiFunction),
543 Input(AbiInput),
544 }
545 impl ::std::convert::From<&Self> for AbiItem {
546 fn from(value: &AbiItem) -> Self {
547 value.clone()
548 }
549 }
550 impl ::std::convert::From<AbiFunction> for AbiItem {
551 fn from(value: AbiFunction) -> Self {
552 Self::Function(value)
553 }
554 }
555 impl ::std::convert::From<AbiInput> for AbiItem {
556 fn from(value: AbiInput) -> Self {
557 Self::Input(value)
558 }
559 }
560 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
621 pub struct AbiParameter {
622 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
624 pub components: ::std::vec::Vec<AbiParameter>,
625 #[serde(
627 rename = "internalType",
628 default,
629 skip_serializing_if = "::std::option::Option::is_none"
630 )]
631 pub internal_type: ::std::option::Option<::std::string::String>,
632 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
634 pub name: ::std::option::Option<::std::string::String>,
635 #[serde(rename = "type")]
637 pub type_: ::std::string::String,
638 }
639 impl ::std::convert::From<&AbiParameter> for AbiParameter {
640 fn from(value: &AbiParameter) -> Self {
641 value.clone()
642 }
643 }
644 impl AbiParameter {
645 pub fn builder() -> builder::AbiParameter {
646 Default::default()
647 }
648 }
649 #[derive(
671 ::serde::Deserialize,
672 ::serde::Serialize,
673 Clone,
674 Copy,
675 Debug,
676 Eq,
677 Hash,
678 Ord,
679 PartialEq,
680 PartialOrd,
681 )]
682 pub enum AbiStateMutability {
683 #[serde(rename = "pure")]
684 Pure,
685 #[serde(rename = "view")]
686 View,
687 #[serde(rename = "nonpayable")]
688 Nonpayable,
689 #[serde(rename = "payable")]
690 Payable,
691 }
692 impl ::std::convert::From<&Self> for AbiStateMutability {
693 fn from(value: &AbiStateMutability) -> Self {
694 value.clone()
695 }
696 }
697 impl ::std::fmt::Display for AbiStateMutability {
698 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
699 match *self {
700 Self::Pure => f.write_str("pure"),
701 Self::View => f.write_str("view"),
702 Self::Nonpayable => f.write_str("nonpayable"),
703 Self::Payable => f.write_str("payable"),
704 }
705 }
706 }
707 impl ::std::str::FromStr for AbiStateMutability {
708 type Err = self::error::ConversionError;
709 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
710 match value {
711 "pure" => Ok(Self::Pure),
712 "view" => Ok(Self::View),
713 "nonpayable" => Ok(Self::Nonpayable),
714 "payable" => Ok(Self::Payable),
715 _ => Err("invalid value".into()),
716 }
717 }
718 }
719 impl ::std::convert::TryFrom<&str> for AbiStateMutability {
720 type Error = self::error::ConversionError;
721 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
722 value.parse()
723 }
724 }
725 impl ::std::convert::TryFrom<&::std::string::String> for AbiStateMutability {
726 type Error = self::error::ConversionError;
727 fn try_from(
728 value: &::std::string::String,
729 ) -> ::std::result::Result<Self, self::error::ConversionError> {
730 value.parse()
731 }
732 }
733 impl ::std::convert::TryFrom<::std::string::String> for AbiStateMutability {
734 type Error = self::error::ConversionError;
735 fn try_from(
736 value: ::std::string::String,
737 ) -> ::std::result::Result<Self, self::error::ConversionError> {
738 value.parse()
739 }
740 }
741 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
786 pub struct AccountTokenAddressesResponse {
787 #[serde(
789 rename = "accountAddress",
790 default,
791 skip_serializing_if = "::std::option::Option::is_none"
792 )]
793 pub account_address: ::std::option::Option<::std::string::String>,
794 #[serde(
796 rename = "tokenAddresses",
797 default,
798 skip_serializing_if = "::std::vec::Vec::is_empty"
799 )]
800 pub token_addresses: ::std::vec::Vec<AccountTokenAddressesResponseTokenAddressesItem>,
801 #[serde(
803 rename = "totalCount",
804 default,
805 skip_serializing_if = "::std::option::Option::is_none"
806 )]
807 pub total_count: ::std::option::Option<u64>,
808 }
809 impl ::std::convert::From<&AccountTokenAddressesResponse> for AccountTokenAddressesResponse {
810 fn from(value: &AccountTokenAddressesResponse) -> Self {
811 value.clone()
812 }
813 }
814 impl ::std::default::Default for AccountTokenAddressesResponse {
815 fn default() -> Self {
816 Self {
817 account_address: Default::default(),
818 token_addresses: Default::default(),
819 total_count: Default::default(),
820 }
821 }
822 }
823 impl AccountTokenAddressesResponse {
824 pub fn builder() -> builder::AccountTokenAddressesResponse {
825 Default::default()
826 }
827 }
828 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
841 #[serde(transparent)]
842 pub struct AccountTokenAddressesResponseTokenAddressesItem(::std::string::String);
843 impl ::std::ops::Deref for AccountTokenAddressesResponseTokenAddressesItem {
844 type Target = ::std::string::String;
845 fn deref(&self) -> &::std::string::String {
846 &self.0
847 }
848 }
849 impl ::std::convert::From<AccountTokenAddressesResponseTokenAddressesItem>
850 for ::std::string::String
851 {
852 fn from(value: AccountTokenAddressesResponseTokenAddressesItem) -> Self {
853 value.0
854 }
855 }
856 impl ::std::convert::From<&AccountTokenAddressesResponseTokenAddressesItem>
857 for AccountTokenAddressesResponseTokenAddressesItem
858 {
859 fn from(value: &AccountTokenAddressesResponseTokenAddressesItem) -> Self {
860 value.clone()
861 }
862 }
863 impl ::std::str::FromStr for AccountTokenAddressesResponseTokenAddressesItem {
864 type Err = self::error::ConversionError;
865 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
866 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
867 ::std::sync::LazyLock::new(|| {
868 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
869 });
870 if PATTERN.find(value).is_none() {
871 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
872 }
873 Ok(Self(value.to_string()))
874 }
875 }
876 impl ::std::convert::TryFrom<&str> for AccountTokenAddressesResponseTokenAddressesItem {
877 type Error = self::error::ConversionError;
878 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
879 value.parse()
880 }
881 }
882 impl ::std::convert::TryFrom<&::std::string::String>
883 for AccountTokenAddressesResponseTokenAddressesItem
884 {
885 type Error = self::error::ConversionError;
886 fn try_from(
887 value: &::std::string::String,
888 ) -> ::std::result::Result<Self, self::error::ConversionError> {
889 value.parse()
890 }
891 }
892 impl ::std::convert::TryFrom<::std::string::String>
893 for AccountTokenAddressesResponseTokenAddressesItem
894 {
895 type Error = self::error::ConversionError;
896 fn try_from(
897 value: ::std::string::String,
898 ) -> ::std::result::Result<Self, self::error::ConversionError> {
899 value.parse()
900 }
901 }
902 impl<'de> ::serde::Deserialize<'de> for AccountTokenAddressesResponseTokenAddressesItem {
903 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
904 where
905 D: ::serde::Deserializer<'de>,
906 {
907 ::std::string::String::deserialize(deserializer)?
908 .parse()
909 .map_err(|e: self::error::ConversionError| {
910 <D::Error as ::serde::de::Error>::custom(e.to_string())
911 })
912 }
913 }
914 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
939 #[serde(untagged)]
940 pub enum AuthenticationMethod {
941 EmailAuthentication(EmailAuthentication),
942 SmsAuthentication(SmsAuthentication),
943 DeveloperJwtAuthentication(DeveloperJwtAuthentication),
944 OAuth2Authentication(OAuth2Authentication),
945 }
946 impl ::std::convert::From<&Self> for AuthenticationMethod {
947 fn from(value: &AuthenticationMethod) -> Self {
948 value.clone()
949 }
950 }
951 impl ::std::convert::From<EmailAuthentication> for AuthenticationMethod {
952 fn from(value: EmailAuthentication) -> Self {
953 Self::EmailAuthentication(value)
954 }
955 }
956 impl ::std::convert::From<SmsAuthentication> for AuthenticationMethod {
957 fn from(value: SmsAuthentication) -> Self {
958 Self::SmsAuthentication(value)
959 }
960 }
961 impl ::std::convert::From<DeveloperJwtAuthentication> for AuthenticationMethod {
962 fn from(value: DeveloperJwtAuthentication) -> Self {
963 Self::DeveloperJwtAuthentication(value)
964 }
965 }
966 impl ::std::convert::From<OAuth2Authentication> for AuthenticationMethod {
967 fn from(value: OAuth2Authentication) -> Self {
968 Self::OAuth2Authentication(value)
969 }
970 }
971 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1008 #[serde(transparent)]
1009 pub struct AuthenticationMethods(pub ::std::vec::Vec<AuthenticationMethod>);
1010 impl ::std::ops::Deref for AuthenticationMethods {
1011 type Target = ::std::vec::Vec<AuthenticationMethod>;
1012 fn deref(&self) -> &::std::vec::Vec<AuthenticationMethod> {
1013 &self.0
1014 }
1015 }
1016 impl ::std::convert::From<AuthenticationMethods> for ::std::vec::Vec<AuthenticationMethod> {
1017 fn from(value: AuthenticationMethods) -> Self {
1018 value.0
1019 }
1020 }
1021 impl ::std::convert::From<&AuthenticationMethods> for AuthenticationMethods {
1022 fn from(value: &AuthenticationMethods) -> Self {
1023 value.clone()
1024 }
1025 }
1026 impl ::std::convert::From<::std::vec::Vec<AuthenticationMethod>> for AuthenticationMethods {
1027 fn from(value: ::std::vec::Vec<AuthenticationMethod>) -> Self {
1028 Self(value)
1029 }
1030 }
1031 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1301 pub struct CommonSwapResponse {
1302 #[serde(rename = "blockNumber")]
1304 pub block_number: CommonSwapResponseBlockNumber,
1305 pub fees: CommonSwapResponseFees,
1306 #[serde(rename = "fromAmount")]
1308 pub from_amount: CommonSwapResponseFromAmount,
1309 #[serde(rename = "fromToken")]
1311 pub from_token: CommonSwapResponseFromToken,
1312 pub issues: CommonSwapResponseIssues,
1313 #[serde(rename = "liquidityAvailable")]
1315 pub liquidity_available: bool,
1316 #[serde(rename = "minToAmount")]
1318 pub min_to_amount: CommonSwapResponseMinToAmount,
1319 #[serde(rename = "toAmount")]
1321 pub to_amount: CommonSwapResponseToAmount,
1322 #[serde(rename = "toToken")]
1324 pub to_token: CommonSwapResponseToToken,
1325 }
1326 impl ::std::convert::From<&CommonSwapResponse> for CommonSwapResponse {
1327 fn from(value: &CommonSwapResponse) -> Self {
1328 value.clone()
1329 }
1330 }
1331 impl CommonSwapResponse {
1332 pub fn builder() -> builder::CommonSwapResponse {
1333 Default::default()
1334 }
1335 }
1336 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1352 #[serde(transparent)]
1353 pub struct CommonSwapResponseBlockNumber(::std::string::String);
1354 impl ::std::ops::Deref for CommonSwapResponseBlockNumber {
1355 type Target = ::std::string::String;
1356 fn deref(&self) -> &::std::string::String {
1357 &self.0
1358 }
1359 }
1360 impl ::std::convert::From<CommonSwapResponseBlockNumber> for ::std::string::String {
1361 fn from(value: CommonSwapResponseBlockNumber) -> Self {
1362 value.0
1363 }
1364 }
1365 impl ::std::convert::From<&CommonSwapResponseBlockNumber> for CommonSwapResponseBlockNumber {
1366 fn from(value: &CommonSwapResponseBlockNumber) -> Self {
1367 value.clone()
1368 }
1369 }
1370 impl ::std::str::FromStr for CommonSwapResponseBlockNumber {
1371 type Err = self::error::ConversionError;
1372 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1373 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
1374 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[1-9]\\d*$").unwrap());
1375 if PATTERN.find(value).is_none() {
1376 return Err("doesn't match pattern \"^[1-9]\\d*$\"".into());
1377 }
1378 Ok(Self(value.to_string()))
1379 }
1380 }
1381 impl ::std::convert::TryFrom<&str> for CommonSwapResponseBlockNumber {
1382 type Error = self::error::ConversionError;
1383 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1384 value.parse()
1385 }
1386 }
1387 impl ::std::convert::TryFrom<&::std::string::String> for CommonSwapResponseBlockNumber {
1388 type Error = self::error::ConversionError;
1389 fn try_from(
1390 value: &::std::string::String,
1391 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1392 value.parse()
1393 }
1394 }
1395 impl ::std::convert::TryFrom<::std::string::String> for CommonSwapResponseBlockNumber {
1396 type Error = self::error::ConversionError;
1397 fn try_from(
1398 value: ::std::string::String,
1399 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1400 value.parse()
1401 }
1402 }
1403 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseBlockNumber {
1404 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
1405 where
1406 D: ::serde::Deserializer<'de>,
1407 {
1408 ::std::string::String::deserialize(deserializer)?
1409 .parse()
1410 .map_err(|e: self::error::ConversionError| {
1411 <D::Error as ::serde::de::Error>::custom(e.to_string())
1412 })
1413 }
1414 }
1415 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1469 pub struct CommonSwapResponseFees {
1470 #[serde(rename = "gasFee")]
1472 pub gas_fee: ::std::option::Option<TokenFee>,
1473 #[serde(rename = "protocolFee")]
1475 pub protocol_fee: ::std::option::Option<TokenFee>,
1476 }
1477 impl ::std::convert::From<&CommonSwapResponseFees> for CommonSwapResponseFees {
1478 fn from(value: &CommonSwapResponseFees) -> Self {
1479 value.clone()
1480 }
1481 }
1482 impl CommonSwapResponseFees {
1483 pub fn builder() -> builder::CommonSwapResponseFees {
1484 Default::default()
1485 }
1486 }
1487 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1503 #[serde(transparent)]
1504 pub struct CommonSwapResponseFromAmount(::std::string::String);
1505 impl ::std::ops::Deref for CommonSwapResponseFromAmount {
1506 type Target = ::std::string::String;
1507 fn deref(&self) -> &::std::string::String {
1508 &self.0
1509 }
1510 }
1511 impl ::std::convert::From<CommonSwapResponseFromAmount> for ::std::string::String {
1512 fn from(value: CommonSwapResponseFromAmount) -> Self {
1513 value.0
1514 }
1515 }
1516 impl ::std::convert::From<&CommonSwapResponseFromAmount> for CommonSwapResponseFromAmount {
1517 fn from(value: &CommonSwapResponseFromAmount) -> Self {
1518 value.clone()
1519 }
1520 }
1521 impl ::std::str::FromStr for CommonSwapResponseFromAmount {
1522 type Err = self::error::ConversionError;
1523 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1524 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
1525 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
1526 if PATTERN.find(value).is_none() {
1527 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
1528 }
1529 Ok(Self(value.to_string()))
1530 }
1531 }
1532 impl ::std::convert::TryFrom<&str> for CommonSwapResponseFromAmount {
1533 type Error = self::error::ConversionError;
1534 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1535 value.parse()
1536 }
1537 }
1538 impl ::std::convert::TryFrom<&::std::string::String> for CommonSwapResponseFromAmount {
1539 type Error = self::error::ConversionError;
1540 fn try_from(
1541 value: &::std::string::String,
1542 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1543 value.parse()
1544 }
1545 }
1546 impl ::std::convert::TryFrom<::std::string::String> for CommonSwapResponseFromAmount {
1547 type Error = self::error::ConversionError;
1548 fn try_from(
1549 value: ::std::string::String,
1550 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1551 value.parse()
1552 }
1553 }
1554 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseFromAmount {
1555 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
1556 where
1557 D: ::serde::Deserializer<'de>,
1558 {
1559 ::std::string::String::deserialize(deserializer)?
1560 .parse()
1561 .map_err(|e: self::error::ConversionError| {
1562 <D::Error as ::serde::de::Error>::custom(e.to_string())
1563 })
1564 }
1565 }
1566 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1582 #[serde(transparent)]
1583 pub struct CommonSwapResponseFromToken(::std::string::String);
1584 impl ::std::ops::Deref for CommonSwapResponseFromToken {
1585 type Target = ::std::string::String;
1586 fn deref(&self) -> &::std::string::String {
1587 &self.0
1588 }
1589 }
1590 impl ::std::convert::From<CommonSwapResponseFromToken> for ::std::string::String {
1591 fn from(value: CommonSwapResponseFromToken) -> Self {
1592 value.0
1593 }
1594 }
1595 impl ::std::convert::From<&CommonSwapResponseFromToken> for CommonSwapResponseFromToken {
1596 fn from(value: &CommonSwapResponseFromToken) -> Self {
1597 value.clone()
1598 }
1599 }
1600 impl ::std::str::FromStr for CommonSwapResponseFromToken {
1601 type Err = self::error::ConversionError;
1602 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1603 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
1604 ::std::sync::LazyLock::new(|| {
1605 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
1606 });
1607 if PATTERN.find(value).is_none() {
1608 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
1609 }
1610 Ok(Self(value.to_string()))
1611 }
1612 }
1613 impl ::std::convert::TryFrom<&str> for CommonSwapResponseFromToken {
1614 type Error = self::error::ConversionError;
1615 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1616 value.parse()
1617 }
1618 }
1619 impl ::std::convert::TryFrom<&::std::string::String> for CommonSwapResponseFromToken {
1620 type Error = self::error::ConversionError;
1621 fn try_from(
1622 value: &::std::string::String,
1623 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1624 value.parse()
1625 }
1626 }
1627 impl ::std::convert::TryFrom<::std::string::String> for CommonSwapResponseFromToken {
1628 type Error = self::error::ConversionError;
1629 fn try_from(
1630 value: ::std::string::String,
1631 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1632 value.parse()
1633 }
1634 }
1635 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseFromToken {
1636 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
1637 where
1638 D: ::serde::Deserializer<'de>,
1639 {
1640 ::std::string::String::deserialize(deserializer)?
1641 .parse()
1642 .map_err(|e: self::error::ConversionError| {
1643 <D::Error as ::serde::de::Error>::custom(e.to_string())
1644 })
1645 }
1646 }
1647 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1764 pub struct CommonSwapResponseIssues {
1765 pub allowance: ::std::option::Option<CommonSwapResponseIssuesAllowance>,
1767 pub balance: ::std::option::Option<CommonSwapResponseIssuesBalance>,
1769 #[serde(rename = "simulationIncomplete")]
1771 pub simulation_incomplete: bool,
1772 }
1773 impl ::std::convert::From<&CommonSwapResponseIssues> for CommonSwapResponseIssues {
1774 fn from(value: &CommonSwapResponseIssues) -> Self {
1775 value.clone()
1776 }
1777 }
1778 impl CommonSwapResponseIssues {
1779 pub fn builder() -> builder::CommonSwapResponseIssues {
1780 Default::default()
1781 }
1782 }
1783 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1823 pub struct CommonSwapResponseIssuesAllowance {
1824 #[serde(rename = "currentAllowance")]
1826 pub current_allowance: CommonSwapResponseIssuesAllowanceCurrentAllowance,
1827 pub spender: CommonSwapResponseIssuesAllowanceSpender,
1829 }
1830 impl ::std::convert::From<&CommonSwapResponseIssuesAllowance>
1831 for CommonSwapResponseIssuesAllowance
1832 {
1833 fn from(value: &CommonSwapResponseIssuesAllowance) -> Self {
1834 value.clone()
1835 }
1836 }
1837 impl CommonSwapResponseIssuesAllowance {
1838 pub fn builder() -> builder::CommonSwapResponseIssuesAllowance {
1839 Default::default()
1840 }
1841 }
1842 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1858 #[serde(transparent)]
1859 pub struct CommonSwapResponseIssuesAllowanceCurrentAllowance(::std::string::String);
1860 impl ::std::ops::Deref for CommonSwapResponseIssuesAllowanceCurrentAllowance {
1861 type Target = ::std::string::String;
1862 fn deref(&self) -> &::std::string::String {
1863 &self.0
1864 }
1865 }
1866 impl ::std::convert::From<CommonSwapResponseIssuesAllowanceCurrentAllowance>
1867 for ::std::string::String
1868 {
1869 fn from(value: CommonSwapResponseIssuesAllowanceCurrentAllowance) -> Self {
1870 value.0
1871 }
1872 }
1873 impl ::std::convert::From<&CommonSwapResponseIssuesAllowanceCurrentAllowance>
1874 for CommonSwapResponseIssuesAllowanceCurrentAllowance
1875 {
1876 fn from(value: &CommonSwapResponseIssuesAllowanceCurrentAllowance) -> Self {
1877 value.clone()
1878 }
1879 }
1880 impl ::std::str::FromStr for CommonSwapResponseIssuesAllowanceCurrentAllowance {
1881 type Err = self::error::ConversionError;
1882 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1883 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
1884 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
1885 if PATTERN.find(value).is_none() {
1886 return Err("doesn't match pattern \"^\\d+$\"".into());
1887 }
1888 Ok(Self(value.to_string()))
1889 }
1890 }
1891 impl ::std::convert::TryFrom<&str> for CommonSwapResponseIssuesAllowanceCurrentAllowance {
1892 type Error = self::error::ConversionError;
1893 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1894 value.parse()
1895 }
1896 }
1897 impl ::std::convert::TryFrom<&::std::string::String>
1898 for CommonSwapResponseIssuesAllowanceCurrentAllowance
1899 {
1900 type Error = self::error::ConversionError;
1901 fn try_from(
1902 value: &::std::string::String,
1903 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1904 value.parse()
1905 }
1906 }
1907 impl ::std::convert::TryFrom<::std::string::String>
1908 for CommonSwapResponseIssuesAllowanceCurrentAllowance
1909 {
1910 type Error = self::error::ConversionError;
1911 fn try_from(
1912 value: ::std::string::String,
1913 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1914 value.parse()
1915 }
1916 }
1917 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseIssuesAllowanceCurrentAllowance {
1918 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
1919 where
1920 D: ::serde::Deserializer<'de>,
1921 {
1922 ::std::string::String::deserialize(deserializer)?
1923 .parse()
1924 .map_err(|e: self::error::ConversionError| {
1925 <D::Error as ::serde::de::Error>::custom(e.to_string())
1926 })
1927 }
1928 }
1929 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1945 #[serde(transparent)]
1946 pub struct CommonSwapResponseIssuesAllowanceSpender(::std::string::String);
1947 impl ::std::ops::Deref for CommonSwapResponseIssuesAllowanceSpender {
1948 type Target = ::std::string::String;
1949 fn deref(&self) -> &::std::string::String {
1950 &self.0
1951 }
1952 }
1953 impl ::std::convert::From<CommonSwapResponseIssuesAllowanceSpender> for ::std::string::String {
1954 fn from(value: CommonSwapResponseIssuesAllowanceSpender) -> Self {
1955 value.0
1956 }
1957 }
1958 impl ::std::convert::From<&CommonSwapResponseIssuesAllowanceSpender>
1959 for CommonSwapResponseIssuesAllowanceSpender
1960 {
1961 fn from(value: &CommonSwapResponseIssuesAllowanceSpender) -> Self {
1962 value.clone()
1963 }
1964 }
1965 impl ::std::str::FromStr for CommonSwapResponseIssuesAllowanceSpender {
1966 type Err = self::error::ConversionError;
1967 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1968 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
1969 ::std::sync::LazyLock::new(|| {
1970 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
1971 });
1972 if PATTERN.find(value).is_none() {
1973 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
1974 }
1975 Ok(Self(value.to_string()))
1976 }
1977 }
1978 impl ::std::convert::TryFrom<&str> for CommonSwapResponseIssuesAllowanceSpender {
1979 type Error = self::error::ConversionError;
1980 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1981 value.parse()
1982 }
1983 }
1984 impl ::std::convert::TryFrom<&::std::string::String> for CommonSwapResponseIssuesAllowanceSpender {
1985 type Error = self::error::ConversionError;
1986 fn try_from(
1987 value: &::std::string::String,
1988 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1989 value.parse()
1990 }
1991 }
1992 impl ::std::convert::TryFrom<::std::string::String> for CommonSwapResponseIssuesAllowanceSpender {
1993 type Error = self::error::ConversionError;
1994 fn try_from(
1995 value: ::std::string::String,
1996 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1997 value.parse()
1998 }
1999 }
2000 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseIssuesAllowanceSpender {
2001 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2002 where
2003 D: ::serde::Deserializer<'de>,
2004 {
2005 ::std::string::String::deserialize(deserializer)?
2006 .parse()
2007 .map_err(|e: self::error::ConversionError| {
2008 <D::Error as ::serde::de::Error>::custom(e.to_string())
2009 })
2010 }
2011 }
2012 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2059 pub struct CommonSwapResponseIssuesBalance {
2060 #[serde(rename = "currentBalance")]
2062 pub current_balance: CommonSwapResponseIssuesBalanceCurrentBalance,
2063 #[serde(rename = "requiredBalance")]
2065 pub required_balance: CommonSwapResponseIssuesBalanceRequiredBalance,
2066 pub token: CommonSwapResponseIssuesBalanceToken,
2068 }
2069 impl ::std::convert::From<&CommonSwapResponseIssuesBalance> for CommonSwapResponseIssuesBalance {
2070 fn from(value: &CommonSwapResponseIssuesBalance) -> Self {
2071 value.clone()
2072 }
2073 }
2074 impl CommonSwapResponseIssuesBalance {
2075 pub fn builder() -> builder::CommonSwapResponseIssuesBalance {
2076 Default::default()
2077 }
2078 }
2079 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2095 #[serde(transparent)]
2096 pub struct CommonSwapResponseIssuesBalanceCurrentBalance(::std::string::String);
2097 impl ::std::ops::Deref for CommonSwapResponseIssuesBalanceCurrentBalance {
2098 type Target = ::std::string::String;
2099 fn deref(&self) -> &::std::string::String {
2100 &self.0
2101 }
2102 }
2103 impl ::std::convert::From<CommonSwapResponseIssuesBalanceCurrentBalance> for ::std::string::String {
2104 fn from(value: CommonSwapResponseIssuesBalanceCurrentBalance) -> Self {
2105 value.0
2106 }
2107 }
2108 impl ::std::convert::From<&CommonSwapResponseIssuesBalanceCurrentBalance>
2109 for CommonSwapResponseIssuesBalanceCurrentBalance
2110 {
2111 fn from(value: &CommonSwapResponseIssuesBalanceCurrentBalance) -> Self {
2112 value.clone()
2113 }
2114 }
2115 impl ::std::str::FromStr for CommonSwapResponseIssuesBalanceCurrentBalance {
2116 type Err = self::error::ConversionError;
2117 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2118 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
2119 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
2120 if PATTERN.find(value).is_none() {
2121 return Err("doesn't match pattern \"^\\d+$\"".into());
2122 }
2123 Ok(Self(value.to_string()))
2124 }
2125 }
2126 impl ::std::convert::TryFrom<&str> for CommonSwapResponseIssuesBalanceCurrentBalance {
2127 type Error = self::error::ConversionError;
2128 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2129 value.parse()
2130 }
2131 }
2132 impl ::std::convert::TryFrom<&::std::string::String>
2133 for CommonSwapResponseIssuesBalanceCurrentBalance
2134 {
2135 type Error = self::error::ConversionError;
2136 fn try_from(
2137 value: &::std::string::String,
2138 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2139 value.parse()
2140 }
2141 }
2142 impl ::std::convert::TryFrom<::std::string::String>
2143 for CommonSwapResponseIssuesBalanceCurrentBalance
2144 {
2145 type Error = self::error::ConversionError;
2146 fn try_from(
2147 value: ::std::string::String,
2148 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2149 value.parse()
2150 }
2151 }
2152 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseIssuesBalanceCurrentBalance {
2153 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2154 where
2155 D: ::serde::Deserializer<'de>,
2156 {
2157 ::std::string::String::deserialize(deserializer)?
2158 .parse()
2159 .map_err(|e: self::error::ConversionError| {
2160 <D::Error as ::serde::de::Error>::custom(e.to_string())
2161 })
2162 }
2163 }
2164 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2180 #[serde(transparent)]
2181 pub struct CommonSwapResponseIssuesBalanceRequiredBalance(::std::string::String);
2182 impl ::std::ops::Deref for CommonSwapResponseIssuesBalanceRequiredBalance {
2183 type Target = ::std::string::String;
2184 fn deref(&self) -> &::std::string::String {
2185 &self.0
2186 }
2187 }
2188 impl ::std::convert::From<CommonSwapResponseIssuesBalanceRequiredBalance>
2189 for ::std::string::String
2190 {
2191 fn from(value: CommonSwapResponseIssuesBalanceRequiredBalance) -> Self {
2192 value.0
2193 }
2194 }
2195 impl ::std::convert::From<&CommonSwapResponseIssuesBalanceRequiredBalance>
2196 for CommonSwapResponseIssuesBalanceRequiredBalance
2197 {
2198 fn from(value: &CommonSwapResponseIssuesBalanceRequiredBalance) -> Self {
2199 value.clone()
2200 }
2201 }
2202 impl ::std::str::FromStr for CommonSwapResponseIssuesBalanceRequiredBalance {
2203 type Err = self::error::ConversionError;
2204 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2205 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
2206 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
2207 if PATTERN.find(value).is_none() {
2208 return Err("doesn't match pattern \"^\\d+$\"".into());
2209 }
2210 Ok(Self(value.to_string()))
2211 }
2212 }
2213 impl ::std::convert::TryFrom<&str> for CommonSwapResponseIssuesBalanceRequiredBalance {
2214 type Error = self::error::ConversionError;
2215 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2216 value.parse()
2217 }
2218 }
2219 impl ::std::convert::TryFrom<&::std::string::String>
2220 for CommonSwapResponseIssuesBalanceRequiredBalance
2221 {
2222 type Error = self::error::ConversionError;
2223 fn try_from(
2224 value: &::std::string::String,
2225 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2226 value.parse()
2227 }
2228 }
2229 impl ::std::convert::TryFrom<::std::string::String>
2230 for CommonSwapResponseIssuesBalanceRequiredBalance
2231 {
2232 type Error = self::error::ConversionError;
2233 fn try_from(
2234 value: ::std::string::String,
2235 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2236 value.parse()
2237 }
2238 }
2239 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseIssuesBalanceRequiredBalance {
2240 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2241 where
2242 D: ::serde::Deserializer<'de>,
2243 {
2244 ::std::string::String::deserialize(deserializer)?
2245 .parse()
2246 .map_err(|e: self::error::ConversionError| {
2247 <D::Error as ::serde::de::Error>::custom(e.to_string())
2248 })
2249 }
2250 }
2251 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2264 #[serde(transparent)]
2265 pub struct CommonSwapResponseIssuesBalanceToken(::std::string::String);
2266 impl ::std::ops::Deref for CommonSwapResponseIssuesBalanceToken {
2267 type Target = ::std::string::String;
2268 fn deref(&self) -> &::std::string::String {
2269 &self.0
2270 }
2271 }
2272 impl ::std::convert::From<CommonSwapResponseIssuesBalanceToken> for ::std::string::String {
2273 fn from(value: CommonSwapResponseIssuesBalanceToken) -> Self {
2274 value.0
2275 }
2276 }
2277 impl ::std::convert::From<&CommonSwapResponseIssuesBalanceToken>
2278 for CommonSwapResponseIssuesBalanceToken
2279 {
2280 fn from(value: &CommonSwapResponseIssuesBalanceToken) -> Self {
2281 value.clone()
2282 }
2283 }
2284 impl ::std::str::FromStr for CommonSwapResponseIssuesBalanceToken {
2285 type Err = self::error::ConversionError;
2286 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2287 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
2288 ::std::sync::LazyLock::new(|| {
2289 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
2290 });
2291 if PATTERN.find(value).is_none() {
2292 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
2293 }
2294 Ok(Self(value.to_string()))
2295 }
2296 }
2297 impl ::std::convert::TryFrom<&str> for CommonSwapResponseIssuesBalanceToken {
2298 type Error = self::error::ConversionError;
2299 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2300 value.parse()
2301 }
2302 }
2303 impl ::std::convert::TryFrom<&::std::string::String> for CommonSwapResponseIssuesBalanceToken {
2304 type Error = self::error::ConversionError;
2305 fn try_from(
2306 value: &::std::string::String,
2307 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2308 value.parse()
2309 }
2310 }
2311 impl ::std::convert::TryFrom<::std::string::String> for CommonSwapResponseIssuesBalanceToken {
2312 type Error = self::error::ConversionError;
2313 fn try_from(
2314 value: ::std::string::String,
2315 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2316 value.parse()
2317 }
2318 }
2319 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseIssuesBalanceToken {
2320 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2321 where
2322 D: ::serde::Deserializer<'de>,
2323 {
2324 ::std::string::String::deserialize(deserializer)?
2325 .parse()
2326 .map_err(|e: self::error::ConversionError| {
2327 <D::Error as ::serde::de::Error>::custom(e.to_string())
2328 })
2329 }
2330 }
2331 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2347 #[serde(transparent)]
2348 pub struct CommonSwapResponseMinToAmount(::std::string::String);
2349 impl ::std::ops::Deref for CommonSwapResponseMinToAmount {
2350 type Target = ::std::string::String;
2351 fn deref(&self) -> &::std::string::String {
2352 &self.0
2353 }
2354 }
2355 impl ::std::convert::From<CommonSwapResponseMinToAmount> for ::std::string::String {
2356 fn from(value: CommonSwapResponseMinToAmount) -> Self {
2357 value.0
2358 }
2359 }
2360 impl ::std::convert::From<&CommonSwapResponseMinToAmount> for CommonSwapResponseMinToAmount {
2361 fn from(value: &CommonSwapResponseMinToAmount) -> Self {
2362 value.clone()
2363 }
2364 }
2365 impl ::std::str::FromStr for CommonSwapResponseMinToAmount {
2366 type Err = self::error::ConversionError;
2367 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2368 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
2369 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
2370 if PATTERN.find(value).is_none() {
2371 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
2372 }
2373 Ok(Self(value.to_string()))
2374 }
2375 }
2376 impl ::std::convert::TryFrom<&str> for CommonSwapResponseMinToAmount {
2377 type Error = self::error::ConversionError;
2378 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2379 value.parse()
2380 }
2381 }
2382 impl ::std::convert::TryFrom<&::std::string::String> for CommonSwapResponseMinToAmount {
2383 type Error = self::error::ConversionError;
2384 fn try_from(
2385 value: &::std::string::String,
2386 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2387 value.parse()
2388 }
2389 }
2390 impl ::std::convert::TryFrom<::std::string::String> for CommonSwapResponseMinToAmount {
2391 type Error = self::error::ConversionError;
2392 fn try_from(
2393 value: ::std::string::String,
2394 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2395 value.parse()
2396 }
2397 }
2398 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseMinToAmount {
2399 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2400 where
2401 D: ::serde::Deserializer<'de>,
2402 {
2403 ::std::string::String::deserialize(deserializer)?
2404 .parse()
2405 .map_err(|e: self::error::ConversionError| {
2406 <D::Error as ::serde::de::Error>::custom(e.to_string())
2407 })
2408 }
2409 }
2410 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2426 #[serde(transparent)]
2427 pub struct CommonSwapResponseToAmount(::std::string::String);
2428 impl ::std::ops::Deref for CommonSwapResponseToAmount {
2429 type Target = ::std::string::String;
2430 fn deref(&self) -> &::std::string::String {
2431 &self.0
2432 }
2433 }
2434 impl ::std::convert::From<CommonSwapResponseToAmount> for ::std::string::String {
2435 fn from(value: CommonSwapResponseToAmount) -> Self {
2436 value.0
2437 }
2438 }
2439 impl ::std::convert::From<&CommonSwapResponseToAmount> for CommonSwapResponseToAmount {
2440 fn from(value: &CommonSwapResponseToAmount) -> Self {
2441 value.clone()
2442 }
2443 }
2444 impl ::std::str::FromStr for CommonSwapResponseToAmount {
2445 type Err = self::error::ConversionError;
2446 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2447 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
2448 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
2449 if PATTERN.find(value).is_none() {
2450 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
2451 }
2452 Ok(Self(value.to_string()))
2453 }
2454 }
2455 impl ::std::convert::TryFrom<&str> for CommonSwapResponseToAmount {
2456 type Error = self::error::ConversionError;
2457 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2458 value.parse()
2459 }
2460 }
2461 impl ::std::convert::TryFrom<&::std::string::String> for CommonSwapResponseToAmount {
2462 type Error = self::error::ConversionError;
2463 fn try_from(
2464 value: &::std::string::String,
2465 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2466 value.parse()
2467 }
2468 }
2469 impl ::std::convert::TryFrom<::std::string::String> for CommonSwapResponseToAmount {
2470 type Error = self::error::ConversionError;
2471 fn try_from(
2472 value: ::std::string::String,
2473 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2474 value.parse()
2475 }
2476 }
2477 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseToAmount {
2478 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2479 where
2480 D: ::serde::Deserializer<'de>,
2481 {
2482 ::std::string::String::deserialize(deserializer)?
2483 .parse()
2484 .map_err(|e: self::error::ConversionError| {
2485 <D::Error as ::serde::de::Error>::custom(e.to_string())
2486 })
2487 }
2488 }
2489 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2505 #[serde(transparent)]
2506 pub struct CommonSwapResponseToToken(::std::string::String);
2507 impl ::std::ops::Deref for CommonSwapResponseToToken {
2508 type Target = ::std::string::String;
2509 fn deref(&self) -> &::std::string::String {
2510 &self.0
2511 }
2512 }
2513 impl ::std::convert::From<CommonSwapResponseToToken> for ::std::string::String {
2514 fn from(value: CommonSwapResponseToToken) -> Self {
2515 value.0
2516 }
2517 }
2518 impl ::std::convert::From<&CommonSwapResponseToToken> for CommonSwapResponseToToken {
2519 fn from(value: &CommonSwapResponseToToken) -> Self {
2520 value.clone()
2521 }
2522 }
2523 impl ::std::str::FromStr for CommonSwapResponseToToken {
2524 type Err = self::error::ConversionError;
2525 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2526 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
2527 ::std::sync::LazyLock::new(|| {
2528 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
2529 });
2530 if PATTERN.find(value).is_none() {
2531 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
2532 }
2533 Ok(Self(value.to_string()))
2534 }
2535 }
2536 impl ::std::convert::TryFrom<&str> for CommonSwapResponseToToken {
2537 type Error = self::error::ConversionError;
2538 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2539 value.parse()
2540 }
2541 }
2542 impl ::std::convert::TryFrom<&::std::string::String> for CommonSwapResponseToToken {
2543 type Error = self::error::ConversionError;
2544 fn try_from(
2545 value: &::std::string::String,
2546 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2547 value.parse()
2548 }
2549 }
2550 impl ::std::convert::TryFrom<::std::string::String> for CommonSwapResponseToToken {
2551 type Error = self::error::ConversionError;
2552 fn try_from(
2553 value: ::std::string::String,
2554 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2555 value.parse()
2556 }
2557 }
2558 impl<'de> ::serde::Deserialize<'de> for CommonSwapResponseToToken {
2559 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2560 where
2561 D: ::serde::Deserializer<'de>,
2562 {
2563 ::std::string::String::deserialize(deserializer)?
2564 .parse()
2565 .map_err(|e: self::error::ConversionError| {
2566 <D::Error as ::serde::de::Error>::custom(e.to_string())
2567 })
2568 }
2569 }
2570 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2625 pub struct CreateEndUserBody {
2626 #[serde(rename = "authenticationMethods")]
2627 pub authentication_methods: AuthenticationMethods,
2628 #[serde(
2629 rename = "evmAccount",
2630 default,
2631 skip_serializing_if = "::std::option::Option::is_none"
2632 )]
2633 pub evm_account: ::std::option::Option<CreateEndUserBodyEvmAccount>,
2634 #[serde(
2635 rename = "solanaAccount",
2636 default,
2637 skip_serializing_if = "::std::option::Option::is_none"
2638 )]
2639 pub solana_account: ::std::option::Option<CreateEndUserBodySolanaAccount>,
2640 #[serde(
2644 rename = "userId",
2645 default,
2646 skip_serializing_if = "::std::option::Option::is_none"
2647 )]
2648 pub user_id: ::std::option::Option<CreateEndUserBodyUserId>,
2649 }
2650 impl ::std::convert::From<&CreateEndUserBody> for CreateEndUserBody {
2651 fn from(value: &CreateEndUserBody) -> Self {
2652 value.clone()
2653 }
2654 }
2655 impl CreateEndUserBody {
2656 pub fn builder() -> builder::CreateEndUserBody {
2657 Default::default()
2658 }
2659 }
2660 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2682 pub struct CreateEndUserBodyEvmAccount {
2683 #[serde(rename = "createSmartAccount", default)]
2685 pub create_smart_account: bool,
2686 }
2687 impl ::std::convert::From<&CreateEndUserBodyEvmAccount> for CreateEndUserBodyEvmAccount {
2688 fn from(value: &CreateEndUserBodyEvmAccount) -> Self {
2689 value.clone()
2690 }
2691 }
2692 impl ::std::default::Default for CreateEndUserBodyEvmAccount {
2693 fn default() -> Self {
2694 Self {
2695 create_smart_account: Default::default(),
2696 }
2697 }
2698 }
2699 impl CreateEndUserBodyEvmAccount {
2700 pub fn builder() -> builder::CreateEndUserBodyEvmAccount {
2701 Default::default()
2702 }
2703 }
2704 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2726 pub struct CreateEndUserBodySolanaAccount {
2727 #[serde(rename = "createSmartAccount", default)]
2729 pub create_smart_account: bool,
2730 }
2731 impl ::std::convert::From<&CreateEndUserBodySolanaAccount> for CreateEndUserBodySolanaAccount {
2732 fn from(value: &CreateEndUserBodySolanaAccount) -> Self {
2733 value.clone()
2734 }
2735 }
2736 impl ::std::default::Default for CreateEndUserBodySolanaAccount {
2737 fn default() -> Self {
2738 Self {
2739 create_smart_account: Default::default(),
2740 }
2741 }
2742 }
2743 impl CreateEndUserBodySolanaAccount {
2744 pub fn builder() -> builder::CreateEndUserBodySolanaAccount {
2745 Default::default()
2746 }
2747 }
2748 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2766 #[serde(transparent)]
2767 pub struct CreateEndUserBodyUserId(::std::string::String);
2768 impl ::std::ops::Deref for CreateEndUserBodyUserId {
2769 type Target = ::std::string::String;
2770 fn deref(&self) -> &::std::string::String {
2771 &self.0
2772 }
2773 }
2774 impl ::std::convert::From<CreateEndUserBodyUserId> for ::std::string::String {
2775 fn from(value: CreateEndUserBodyUserId) -> Self {
2776 value.0
2777 }
2778 }
2779 impl ::std::convert::From<&CreateEndUserBodyUserId> for CreateEndUserBodyUserId {
2780 fn from(value: &CreateEndUserBodyUserId) -> Self {
2781 value.clone()
2782 }
2783 }
2784 impl ::std::str::FromStr for CreateEndUserBodyUserId {
2785 type Err = self::error::ConversionError;
2786 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2787 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
2788 ::std::sync::LazyLock::new(|| {
2789 ::regress::Regex::new("^[a-zA-Z0-9-]{1,100}$").unwrap()
2790 });
2791 if PATTERN.find(value).is_none() {
2792 return Err("doesn't match pattern \"^[a-zA-Z0-9-]{1,100}$\"".into());
2793 }
2794 Ok(Self(value.to_string()))
2795 }
2796 }
2797 impl ::std::convert::TryFrom<&str> for CreateEndUserBodyUserId {
2798 type Error = self::error::ConversionError;
2799 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2800 value.parse()
2801 }
2802 }
2803 impl ::std::convert::TryFrom<&::std::string::String> for CreateEndUserBodyUserId {
2804 type Error = self::error::ConversionError;
2805 fn try_from(
2806 value: &::std::string::String,
2807 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2808 value.parse()
2809 }
2810 }
2811 impl ::std::convert::TryFrom<::std::string::String> for CreateEndUserBodyUserId {
2812 type Error = self::error::ConversionError;
2813 fn try_from(
2814 value: ::std::string::String,
2815 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2816 value.parse()
2817 }
2818 }
2819 impl<'de> ::serde::Deserialize<'de> for CreateEndUserBodyUserId {
2820 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2821 where
2822 D: ::serde::Deserializer<'de>,
2823 {
2824 ::std::string::String::deserialize(deserializer)?
2825 .parse()
2826 .map_err(|e: self::error::ConversionError| {
2827 <D::Error as ::serde::de::Error>::custom(e.to_string())
2828 })
2829 }
2830 }
2831 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2845 #[serde(transparent)]
2846 pub struct CreateEndUserXIdempotencyKey(::std::string::String);
2847 impl ::std::ops::Deref for CreateEndUserXIdempotencyKey {
2848 type Target = ::std::string::String;
2849 fn deref(&self) -> &::std::string::String {
2850 &self.0
2851 }
2852 }
2853 impl ::std::convert::From<CreateEndUserXIdempotencyKey> for ::std::string::String {
2854 fn from(value: CreateEndUserXIdempotencyKey) -> Self {
2855 value.0
2856 }
2857 }
2858 impl ::std::convert::From<&CreateEndUserXIdempotencyKey> for CreateEndUserXIdempotencyKey {
2859 fn from(value: &CreateEndUserXIdempotencyKey) -> Self {
2860 value.clone()
2861 }
2862 }
2863 impl ::std::str::FromStr for CreateEndUserXIdempotencyKey {
2864 type Err = self::error::ConversionError;
2865 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2866 if value.chars().count() > 36usize {
2867 return Err("longer than 36 characters".into());
2868 }
2869 if value.chars().count() < 36usize {
2870 return Err("shorter than 36 characters".into());
2871 }
2872 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
2873 ::std::sync::LazyLock::new(|| {
2874 ::regress::Regex::new(
2875 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
2876 )
2877 .unwrap()
2878 });
2879 if PATTERN.find(value).is_none() {
2880 return Err(
2881 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
2882 .into(),
2883 );
2884 }
2885 Ok(Self(value.to_string()))
2886 }
2887 }
2888 impl ::std::convert::TryFrom<&str> for CreateEndUserXIdempotencyKey {
2889 type Error = self::error::ConversionError;
2890 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2891 value.parse()
2892 }
2893 }
2894 impl ::std::convert::TryFrom<&::std::string::String> for CreateEndUserXIdempotencyKey {
2895 type Error = self::error::ConversionError;
2896 fn try_from(
2897 value: &::std::string::String,
2898 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2899 value.parse()
2900 }
2901 }
2902 impl ::std::convert::TryFrom<::std::string::String> for CreateEndUserXIdempotencyKey {
2903 type Error = self::error::ConversionError;
2904 fn try_from(
2905 value: ::std::string::String,
2906 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2907 value.parse()
2908 }
2909 }
2910 impl<'de> ::serde::Deserialize<'de> for CreateEndUserXIdempotencyKey {
2911 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
2912 where
2913 D: ::serde::Deserializer<'de>,
2914 {
2915 ::std::string::String::deserialize(deserializer)?
2916 .parse()
2917 .map_err(|e: self::error::ConversionError| {
2918 <D::Error as ::serde::de::Error>::custom(e.to_string())
2919 })
2920 }
2921 }
2922 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2952 pub struct CreateEvmAccountBody {
2953 #[serde(
2955 rename = "accountPolicy",
2956 default,
2957 skip_serializing_if = "::std::option::Option::is_none"
2958 )]
2959 pub account_policy: ::std::option::Option<CreateEvmAccountBodyAccountPolicy>,
2960 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2964 pub name: ::std::option::Option<CreateEvmAccountBodyName>,
2965 }
2966 impl ::std::convert::From<&CreateEvmAccountBody> for CreateEvmAccountBody {
2967 fn from(value: &CreateEvmAccountBody) -> Self {
2968 value.clone()
2969 }
2970 }
2971 impl ::std::default::Default for CreateEvmAccountBody {
2972 fn default() -> Self {
2973 Self {
2974 account_policy: Default::default(),
2975 name: Default::default(),
2976 }
2977 }
2978 }
2979 impl CreateEvmAccountBody {
2980 pub fn builder() -> builder::CreateEvmAccountBody {
2981 Default::default()
2982 }
2983 }
2984 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3001 #[serde(transparent)]
3002 pub struct CreateEvmAccountBodyAccountPolicy(::std::string::String);
3003 impl ::std::ops::Deref for CreateEvmAccountBodyAccountPolicy {
3004 type Target = ::std::string::String;
3005 fn deref(&self) -> &::std::string::String {
3006 &self.0
3007 }
3008 }
3009 impl ::std::convert::From<CreateEvmAccountBodyAccountPolicy> for ::std::string::String {
3010 fn from(value: CreateEvmAccountBodyAccountPolicy) -> Self {
3011 value.0
3012 }
3013 }
3014 impl ::std::convert::From<&CreateEvmAccountBodyAccountPolicy>
3015 for CreateEvmAccountBodyAccountPolicy
3016 {
3017 fn from(value: &CreateEvmAccountBodyAccountPolicy) -> Self {
3018 value.clone()
3019 }
3020 }
3021 impl ::std::str::FromStr for CreateEvmAccountBodyAccountPolicy {
3022 type Err = self::error::ConversionError;
3023 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3024 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
3025 || {
3026 ::regress::Regex::new(
3027 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
3028 )
3029 .unwrap()
3030 },
3031 );
3032 if PATTERN.find(value).is_none() {
3033 return Err(
3034 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
3035 .into(),
3036 );
3037 }
3038 Ok(Self(value.to_string()))
3039 }
3040 }
3041 impl ::std::convert::TryFrom<&str> for CreateEvmAccountBodyAccountPolicy {
3042 type Error = self::error::ConversionError;
3043 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3044 value.parse()
3045 }
3046 }
3047 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmAccountBodyAccountPolicy {
3048 type Error = self::error::ConversionError;
3049 fn try_from(
3050 value: &::std::string::String,
3051 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3052 value.parse()
3053 }
3054 }
3055 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmAccountBodyAccountPolicy {
3056 type Error = self::error::ConversionError;
3057 fn try_from(
3058 value: ::std::string::String,
3059 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3060 value.parse()
3061 }
3062 }
3063 impl<'de> ::serde::Deserialize<'de> for CreateEvmAccountBodyAccountPolicy {
3064 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3065 where
3066 D: ::serde::Deserializer<'de>,
3067 {
3068 ::std::string::String::deserialize(deserializer)?
3069 .parse()
3070 .map_err(|e: self::error::ConversionError| {
3071 <D::Error as ::serde::de::Error>::custom(e.to_string())
3072 })
3073 }
3074 }
3075 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3093 #[serde(transparent)]
3094 pub struct CreateEvmAccountBodyName(::std::string::String);
3095 impl ::std::ops::Deref for CreateEvmAccountBodyName {
3096 type Target = ::std::string::String;
3097 fn deref(&self) -> &::std::string::String {
3098 &self.0
3099 }
3100 }
3101 impl ::std::convert::From<CreateEvmAccountBodyName> for ::std::string::String {
3102 fn from(value: CreateEvmAccountBodyName) -> Self {
3103 value.0
3104 }
3105 }
3106 impl ::std::convert::From<&CreateEvmAccountBodyName> for CreateEvmAccountBodyName {
3107 fn from(value: &CreateEvmAccountBodyName) -> Self {
3108 value.clone()
3109 }
3110 }
3111 impl ::std::str::FromStr for CreateEvmAccountBodyName {
3112 type Err = self::error::ConversionError;
3113 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3114 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3115 ::std::sync::LazyLock::new(|| {
3116 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
3117 });
3118 if PATTERN.find(value).is_none() {
3119 return Err(
3120 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
3121 );
3122 }
3123 Ok(Self(value.to_string()))
3124 }
3125 }
3126 impl ::std::convert::TryFrom<&str> for CreateEvmAccountBodyName {
3127 type Error = self::error::ConversionError;
3128 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3129 value.parse()
3130 }
3131 }
3132 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmAccountBodyName {
3133 type Error = self::error::ConversionError;
3134 fn try_from(
3135 value: &::std::string::String,
3136 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3137 value.parse()
3138 }
3139 }
3140 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmAccountBodyName {
3141 type Error = self::error::ConversionError;
3142 fn try_from(
3143 value: ::std::string::String,
3144 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3145 value.parse()
3146 }
3147 }
3148 impl<'de> ::serde::Deserialize<'de> for CreateEvmAccountBodyName {
3149 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3150 where
3151 D: ::serde::Deserializer<'de>,
3152 {
3153 ::std::string::String::deserialize(deserializer)?
3154 .parse()
3155 .map_err(|e: self::error::ConversionError| {
3156 <D::Error as ::serde::de::Error>::custom(e.to_string())
3157 })
3158 }
3159 }
3160 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3174 #[serde(transparent)]
3175 pub struct CreateEvmAccountXIdempotencyKey(::std::string::String);
3176 impl ::std::ops::Deref for CreateEvmAccountXIdempotencyKey {
3177 type Target = ::std::string::String;
3178 fn deref(&self) -> &::std::string::String {
3179 &self.0
3180 }
3181 }
3182 impl ::std::convert::From<CreateEvmAccountXIdempotencyKey> for ::std::string::String {
3183 fn from(value: CreateEvmAccountXIdempotencyKey) -> Self {
3184 value.0
3185 }
3186 }
3187 impl ::std::convert::From<&CreateEvmAccountXIdempotencyKey> for CreateEvmAccountXIdempotencyKey {
3188 fn from(value: &CreateEvmAccountXIdempotencyKey) -> Self {
3189 value.clone()
3190 }
3191 }
3192 impl ::std::str::FromStr for CreateEvmAccountXIdempotencyKey {
3193 type Err = self::error::ConversionError;
3194 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3195 if value.chars().count() > 36usize {
3196 return Err("longer than 36 characters".into());
3197 }
3198 if value.chars().count() < 36usize {
3199 return Err("shorter than 36 characters".into());
3200 }
3201 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3202 ::std::sync::LazyLock::new(|| {
3203 ::regress::Regex::new(
3204 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
3205 )
3206 .unwrap()
3207 });
3208 if PATTERN.find(value).is_none() {
3209 return Err(
3210 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
3211 .into(),
3212 );
3213 }
3214 Ok(Self(value.to_string()))
3215 }
3216 }
3217 impl ::std::convert::TryFrom<&str> for CreateEvmAccountXIdempotencyKey {
3218 type Error = self::error::ConversionError;
3219 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3220 value.parse()
3221 }
3222 }
3223 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmAccountXIdempotencyKey {
3224 type Error = self::error::ConversionError;
3225 fn try_from(
3226 value: &::std::string::String,
3227 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3228 value.parse()
3229 }
3230 }
3231 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmAccountXIdempotencyKey {
3232 type Error = self::error::ConversionError;
3233 fn try_from(
3234 value: ::std::string::String,
3235 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3236 value.parse()
3237 }
3238 }
3239 impl<'de> ::serde::Deserialize<'de> for CreateEvmAccountXIdempotencyKey {
3240 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3241 where
3242 D: ::serde::Deserializer<'de>,
3243 {
3244 ::std::string::String::deserialize(deserializer)?
3245 .parse()
3246 .map_err(|e: self::error::ConversionError| {
3247 <D::Error as ::serde::de::Error>::custom(e.to_string())
3248 })
3249 }
3250 }
3251 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3288 pub struct CreateEvmSmartAccountBody {
3289 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3293 pub name: ::std::option::Option<CreateEvmSmartAccountBodyName>,
3294 pub owners: ::std::vec::Vec<CreateEvmSmartAccountBodyOwnersItem>,
3296 }
3297 impl ::std::convert::From<&CreateEvmSmartAccountBody> for CreateEvmSmartAccountBody {
3298 fn from(value: &CreateEvmSmartAccountBody) -> Self {
3299 value.clone()
3300 }
3301 }
3302 impl CreateEvmSmartAccountBody {
3303 pub fn builder() -> builder::CreateEvmSmartAccountBody {
3304 Default::default()
3305 }
3306 }
3307 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3325 #[serde(transparent)]
3326 pub struct CreateEvmSmartAccountBodyName(::std::string::String);
3327 impl ::std::ops::Deref for CreateEvmSmartAccountBodyName {
3328 type Target = ::std::string::String;
3329 fn deref(&self) -> &::std::string::String {
3330 &self.0
3331 }
3332 }
3333 impl ::std::convert::From<CreateEvmSmartAccountBodyName> for ::std::string::String {
3334 fn from(value: CreateEvmSmartAccountBodyName) -> Self {
3335 value.0
3336 }
3337 }
3338 impl ::std::convert::From<&CreateEvmSmartAccountBodyName> for CreateEvmSmartAccountBodyName {
3339 fn from(value: &CreateEvmSmartAccountBodyName) -> Self {
3340 value.clone()
3341 }
3342 }
3343 impl ::std::str::FromStr for CreateEvmSmartAccountBodyName {
3344 type Err = self::error::ConversionError;
3345 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3346 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3347 ::std::sync::LazyLock::new(|| {
3348 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
3349 });
3350 if PATTERN.find(value).is_none() {
3351 return Err(
3352 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
3353 );
3354 }
3355 Ok(Self(value.to_string()))
3356 }
3357 }
3358 impl ::std::convert::TryFrom<&str> for CreateEvmSmartAccountBodyName {
3359 type Error = self::error::ConversionError;
3360 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3361 value.parse()
3362 }
3363 }
3364 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSmartAccountBodyName {
3365 type Error = self::error::ConversionError;
3366 fn try_from(
3367 value: &::std::string::String,
3368 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3369 value.parse()
3370 }
3371 }
3372 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSmartAccountBodyName {
3373 type Error = self::error::ConversionError;
3374 fn try_from(
3375 value: ::std::string::String,
3376 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3377 value.parse()
3378 }
3379 }
3380 impl<'de> ::serde::Deserialize<'de> for CreateEvmSmartAccountBodyName {
3381 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3382 where
3383 D: ::serde::Deserializer<'de>,
3384 {
3385 ::std::string::String::deserialize(deserializer)?
3386 .parse()
3387 .map_err(|e: self::error::ConversionError| {
3388 <D::Error as ::serde::de::Error>::custom(e.to_string())
3389 })
3390 }
3391 }
3392 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3404 #[serde(transparent)]
3405 pub struct CreateEvmSmartAccountBodyOwnersItem(::std::string::String);
3406 impl ::std::ops::Deref for CreateEvmSmartAccountBodyOwnersItem {
3407 type Target = ::std::string::String;
3408 fn deref(&self) -> &::std::string::String {
3409 &self.0
3410 }
3411 }
3412 impl ::std::convert::From<CreateEvmSmartAccountBodyOwnersItem> for ::std::string::String {
3413 fn from(value: CreateEvmSmartAccountBodyOwnersItem) -> Self {
3414 value.0
3415 }
3416 }
3417 impl ::std::convert::From<&CreateEvmSmartAccountBodyOwnersItem>
3418 for CreateEvmSmartAccountBodyOwnersItem
3419 {
3420 fn from(value: &CreateEvmSmartAccountBodyOwnersItem) -> Self {
3421 value.clone()
3422 }
3423 }
3424 impl ::std::str::FromStr for CreateEvmSmartAccountBodyOwnersItem {
3425 type Err = self::error::ConversionError;
3426 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3427 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3428 ::std::sync::LazyLock::new(|| {
3429 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
3430 });
3431 if PATTERN.find(value).is_none() {
3432 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
3433 }
3434 Ok(Self(value.to_string()))
3435 }
3436 }
3437 impl ::std::convert::TryFrom<&str> for CreateEvmSmartAccountBodyOwnersItem {
3438 type Error = self::error::ConversionError;
3439 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3440 value.parse()
3441 }
3442 }
3443 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSmartAccountBodyOwnersItem {
3444 type Error = self::error::ConversionError;
3445 fn try_from(
3446 value: &::std::string::String,
3447 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3448 value.parse()
3449 }
3450 }
3451 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSmartAccountBodyOwnersItem {
3452 type Error = self::error::ConversionError;
3453 fn try_from(
3454 value: ::std::string::String,
3455 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3456 value.parse()
3457 }
3458 }
3459 impl<'de> ::serde::Deserialize<'de> for CreateEvmSmartAccountBodyOwnersItem {
3460 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3461 where
3462 D: ::serde::Deserializer<'de>,
3463 {
3464 ::std::string::String::deserialize(deserializer)?
3465 .parse()
3466 .map_err(|e: self::error::ConversionError| {
3467 <D::Error as ::serde::de::Error>::custom(e.to_string())
3468 })
3469 }
3470 }
3471 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3485 #[serde(transparent)]
3486 pub struct CreateEvmSmartAccountXIdempotencyKey(::std::string::String);
3487 impl ::std::ops::Deref for CreateEvmSmartAccountXIdempotencyKey {
3488 type Target = ::std::string::String;
3489 fn deref(&self) -> &::std::string::String {
3490 &self.0
3491 }
3492 }
3493 impl ::std::convert::From<CreateEvmSmartAccountXIdempotencyKey> for ::std::string::String {
3494 fn from(value: CreateEvmSmartAccountXIdempotencyKey) -> Self {
3495 value.0
3496 }
3497 }
3498 impl ::std::convert::From<&CreateEvmSmartAccountXIdempotencyKey>
3499 for CreateEvmSmartAccountXIdempotencyKey
3500 {
3501 fn from(value: &CreateEvmSmartAccountXIdempotencyKey) -> Self {
3502 value.clone()
3503 }
3504 }
3505 impl ::std::str::FromStr for CreateEvmSmartAccountXIdempotencyKey {
3506 type Err = self::error::ConversionError;
3507 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3508 if value.chars().count() > 36usize {
3509 return Err("longer than 36 characters".into());
3510 }
3511 if value.chars().count() < 36usize {
3512 return Err("shorter than 36 characters".into());
3513 }
3514 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3515 ::std::sync::LazyLock::new(|| {
3516 ::regress::Regex::new(
3517 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
3518 )
3519 .unwrap()
3520 });
3521 if PATTERN.find(value).is_none() {
3522 return Err(
3523 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
3524 .into(),
3525 );
3526 }
3527 Ok(Self(value.to_string()))
3528 }
3529 }
3530 impl ::std::convert::TryFrom<&str> for CreateEvmSmartAccountXIdempotencyKey {
3531 type Error = self::error::ConversionError;
3532 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3533 value.parse()
3534 }
3535 }
3536 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSmartAccountXIdempotencyKey {
3537 type Error = self::error::ConversionError;
3538 fn try_from(
3539 value: &::std::string::String,
3540 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3541 value.parse()
3542 }
3543 }
3544 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSmartAccountXIdempotencyKey {
3545 type Error = self::error::ConversionError;
3546 fn try_from(
3547 value: ::std::string::String,
3548 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3549 value.parse()
3550 }
3551 }
3552 impl<'de> ::serde::Deserialize<'de> for CreateEvmSmartAccountXIdempotencyKey {
3553 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3554 where
3555 D: ::serde::Deserializer<'de>,
3556 {
3557 ::std::string::String::deserialize(deserializer)?
3558 .parse()
3559 .map_err(|e: self::error::ConversionError| {
3560 <D::Error as ::serde::de::Error>::custom(e.to_string())
3561 })
3562 }
3563 }
3564 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3645 pub struct CreateEvmSwapQuoteBody {
3646 #[serde(rename = "fromAmount")]
3648 pub from_amount: CreateEvmSwapQuoteBodyFromAmount,
3649 #[serde(rename = "fromToken")]
3651 pub from_token: CreateEvmSwapQuoteBodyFromToken,
3652 #[serde(
3654 rename = "gasPrice",
3655 default,
3656 skip_serializing_if = "::std::option::Option::is_none"
3657 )]
3658 pub gas_price: ::std::option::Option<CreateEvmSwapQuoteBodyGasPrice>,
3659 pub network: EvmSwapsNetwork,
3660 #[serde(
3662 rename = "signerAddress",
3663 default,
3664 skip_serializing_if = "::std::option::Option::is_none"
3665 )]
3666 pub signer_address: ::std::option::Option<CreateEvmSwapQuoteBodySignerAddress>,
3667 #[serde(rename = "slippageBps", default = "defaults::default_u64::<i64, 100>")]
3669 pub slippage_bps: i64,
3670 pub taker: CreateEvmSwapQuoteBodyTaker,
3672 #[serde(rename = "toToken")]
3674 pub to_token: CreateEvmSwapQuoteBodyToToken,
3675 }
3676 impl ::std::convert::From<&CreateEvmSwapQuoteBody> for CreateEvmSwapQuoteBody {
3677 fn from(value: &CreateEvmSwapQuoteBody) -> Self {
3678 value.clone()
3679 }
3680 }
3681 impl CreateEvmSwapQuoteBody {
3682 pub fn builder() -> builder::CreateEvmSwapQuoteBody {
3683 Default::default()
3684 }
3685 }
3686 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3702 #[serde(transparent)]
3703 pub struct CreateEvmSwapQuoteBodyFromAmount(::std::string::String);
3704 impl ::std::ops::Deref for CreateEvmSwapQuoteBodyFromAmount {
3705 type Target = ::std::string::String;
3706 fn deref(&self) -> &::std::string::String {
3707 &self.0
3708 }
3709 }
3710 impl ::std::convert::From<CreateEvmSwapQuoteBodyFromAmount> for ::std::string::String {
3711 fn from(value: CreateEvmSwapQuoteBodyFromAmount) -> Self {
3712 value.0
3713 }
3714 }
3715 impl ::std::convert::From<&CreateEvmSwapQuoteBodyFromAmount> for CreateEvmSwapQuoteBodyFromAmount {
3716 fn from(value: &CreateEvmSwapQuoteBodyFromAmount) -> Self {
3717 value.clone()
3718 }
3719 }
3720 impl ::std::str::FromStr for CreateEvmSwapQuoteBodyFromAmount {
3721 type Err = self::error::ConversionError;
3722 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3723 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3724 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
3725 if PATTERN.find(value).is_none() {
3726 return Err("doesn't match pattern \"^\\d+$\"".into());
3727 }
3728 Ok(Self(value.to_string()))
3729 }
3730 }
3731 impl ::std::convert::TryFrom<&str> for CreateEvmSwapQuoteBodyFromAmount {
3732 type Error = self::error::ConversionError;
3733 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3734 value.parse()
3735 }
3736 }
3737 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSwapQuoteBodyFromAmount {
3738 type Error = self::error::ConversionError;
3739 fn try_from(
3740 value: &::std::string::String,
3741 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3742 value.parse()
3743 }
3744 }
3745 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSwapQuoteBodyFromAmount {
3746 type Error = self::error::ConversionError;
3747 fn try_from(
3748 value: ::std::string::String,
3749 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3750 value.parse()
3751 }
3752 }
3753 impl<'de> ::serde::Deserialize<'de> for CreateEvmSwapQuoteBodyFromAmount {
3754 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3755 where
3756 D: ::serde::Deserializer<'de>,
3757 {
3758 ::std::string::String::deserialize(deserializer)?
3759 .parse()
3760 .map_err(|e: self::error::ConversionError| {
3761 <D::Error as ::serde::de::Error>::custom(e.to_string())
3762 })
3763 }
3764 }
3765 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3781 #[serde(transparent)]
3782 pub struct CreateEvmSwapQuoteBodyFromToken(::std::string::String);
3783 impl ::std::ops::Deref for CreateEvmSwapQuoteBodyFromToken {
3784 type Target = ::std::string::String;
3785 fn deref(&self) -> &::std::string::String {
3786 &self.0
3787 }
3788 }
3789 impl ::std::convert::From<CreateEvmSwapQuoteBodyFromToken> for ::std::string::String {
3790 fn from(value: CreateEvmSwapQuoteBodyFromToken) -> Self {
3791 value.0
3792 }
3793 }
3794 impl ::std::convert::From<&CreateEvmSwapQuoteBodyFromToken> for CreateEvmSwapQuoteBodyFromToken {
3795 fn from(value: &CreateEvmSwapQuoteBodyFromToken) -> Self {
3796 value.clone()
3797 }
3798 }
3799 impl ::std::str::FromStr for CreateEvmSwapQuoteBodyFromToken {
3800 type Err = self::error::ConversionError;
3801 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3802 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3803 ::std::sync::LazyLock::new(|| {
3804 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
3805 });
3806 if PATTERN.find(value).is_none() {
3807 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
3808 }
3809 Ok(Self(value.to_string()))
3810 }
3811 }
3812 impl ::std::convert::TryFrom<&str> for CreateEvmSwapQuoteBodyFromToken {
3813 type Error = self::error::ConversionError;
3814 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3815 value.parse()
3816 }
3817 }
3818 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSwapQuoteBodyFromToken {
3819 type Error = self::error::ConversionError;
3820 fn try_from(
3821 value: &::std::string::String,
3822 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3823 value.parse()
3824 }
3825 }
3826 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSwapQuoteBodyFromToken {
3827 type Error = self::error::ConversionError;
3828 fn try_from(
3829 value: ::std::string::String,
3830 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3831 value.parse()
3832 }
3833 }
3834 impl<'de> ::serde::Deserialize<'de> for CreateEvmSwapQuoteBodyFromToken {
3835 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3836 where
3837 D: ::serde::Deserializer<'de>,
3838 {
3839 ::std::string::String::deserialize(deserializer)?
3840 .parse()
3841 .map_err(|e: self::error::ConversionError| {
3842 <D::Error as ::serde::de::Error>::custom(e.to_string())
3843 })
3844 }
3845 }
3846 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3862 #[serde(transparent)]
3863 pub struct CreateEvmSwapQuoteBodyGasPrice(::std::string::String);
3864 impl ::std::ops::Deref for CreateEvmSwapQuoteBodyGasPrice {
3865 type Target = ::std::string::String;
3866 fn deref(&self) -> &::std::string::String {
3867 &self.0
3868 }
3869 }
3870 impl ::std::convert::From<CreateEvmSwapQuoteBodyGasPrice> for ::std::string::String {
3871 fn from(value: CreateEvmSwapQuoteBodyGasPrice) -> Self {
3872 value.0
3873 }
3874 }
3875 impl ::std::convert::From<&CreateEvmSwapQuoteBodyGasPrice> for CreateEvmSwapQuoteBodyGasPrice {
3876 fn from(value: &CreateEvmSwapQuoteBodyGasPrice) -> Self {
3877 value.clone()
3878 }
3879 }
3880 impl ::std::str::FromStr for CreateEvmSwapQuoteBodyGasPrice {
3881 type Err = self::error::ConversionError;
3882 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3883 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3884 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
3885 if PATTERN.find(value).is_none() {
3886 return Err("doesn't match pattern \"^\\d+$\"".into());
3887 }
3888 Ok(Self(value.to_string()))
3889 }
3890 }
3891 impl ::std::convert::TryFrom<&str> for CreateEvmSwapQuoteBodyGasPrice {
3892 type Error = self::error::ConversionError;
3893 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3894 value.parse()
3895 }
3896 }
3897 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSwapQuoteBodyGasPrice {
3898 type Error = self::error::ConversionError;
3899 fn try_from(
3900 value: &::std::string::String,
3901 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3902 value.parse()
3903 }
3904 }
3905 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSwapQuoteBodyGasPrice {
3906 type Error = self::error::ConversionError;
3907 fn try_from(
3908 value: ::std::string::String,
3909 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3910 value.parse()
3911 }
3912 }
3913 impl<'de> ::serde::Deserialize<'de> for CreateEvmSwapQuoteBodyGasPrice {
3914 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3915 where
3916 D: ::serde::Deserializer<'de>,
3917 {
3918 ::std::string::String::deserialize(deserializer)?
3919 .parse()
3920 .map_err(|e: self::error::ConversionError| {
3921 <D::Error as ::serde::de::Error>::custom(e.to_string())
3922 })
3923 }
3924 }
3925 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3941 #[serde(transparent)]
3942 pub struct CreateEvmSwapQuoteBodySignerAddress(::std::string::String);
3943 impl ::std::ops::Deref for CreateEvmSwapQuoteBodySignerAddress {
3944 type Target = ::std::string::String;
3945 fn deref(&self) -> &::std::string::String {
3946 &self.0
3947 }
3948 }
3949 impl ::std::convert::From<CreateEvmSwapQuoteBodySignerAddress> for ::std::string::String {
3950 fn from(value: CreateEvmSwapQuoteBodySignerAddress) -> Self {
3951 value.0
3952 }
3953 }
3954 impl ::std::convert::From<&CreateEvmSwapQuoteBodySignerAddress>
3955 for CreateEvmSwapQuoteBodySignerAddress
3956 {
3957 fn from(value: &CreateEvmSwapQuoteBodySignerAddress) -> Self {
3958 value.clone()
3959 }
3960 }
3961 impl ::std::str::FromStr for CreateEvmSwapQuoteBodySignerAddress {
3962 type Err = self::error::ConversionError;
3963 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3964 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
3965 ::std::sync::LazyLock::new(|| {
3966 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
3967 });
3968 if PATTERN.find(value).is_none() {
3969 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
3970 }
3971 Ok(Self(value.to_string()))
3972 }
3973 }
3974 impl ::std::convert::TryFrom<&str> for CreateEvmSwapQuoteBodySignerAddress {
3975 type Error = self::error::ConversionError;
3976 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3977 value.parse()
3978 }
3979 }
3980 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSwapQuoteBodySignerAddress {
3981 type Error = self::error::ConversionError;
3982 fn try_from(
3983 value: &::std::string::String,
3984 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3985 value.parse()
3986 }
3987 }
3988 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSwapQuoteBodySignerAddress {
3989 type Error = self::error::ConversionError;
3990 fn try_from(
3991 value: ::std::string::String,
3992 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3993 value.parse()
3994 }
3995 }
3996 impl<'de> ::serde::Deserialize<'de> for CreateEvmSwapQuoteBodySignerAddress {
3997 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
3998 where
3999 D: ::serde::Deserializer<'de>,
4000 {
4001 ::std::string::String::deserialize(deserializer)?
4002 .parse()
4003 .map_err(|e: self::error::ConversionError| {
4004 <D::Error as ::serde::de::Error>::custom(e.to_string())
4005 })
4006 }
4007 }
4008 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
4024 #[serde(transparent)]
4025 pub struct CreateEvmSwapQuoteBodyTaker(::std::string::String);
4026 impl ::std::ops::Deref for CreateEvmSwapQuoteBodyTaker {
4027 type Target = ::std::string::String;
4028 fn deref(&self) -> &::std::string::String {
4029 &self.0
4030 }
4031 }
4032 impl ::std::convert::From<CreateEvmSwapQuoteBodyTaker> for ::std::string::String {
4033 fn from(value: CreateEvmSwapQuoteBodyTaker) -> Self {
4034 value.0
4035 }
4036 }
4037 impl ::std::convert::From<&CreateEvmSwapQuoteBodyTaker> for CreateEvmSwapQuoteBodyTaker {
4038 fn from(value: &CreateEvmSwapQuoteBodyTaker) -> Self {
4039 value.clone()
4040 }
4041 }
4042 impl ::std::str::FromStr for CreateEvmSwapQuoteBodyTaker {
4043 type Err = self::error::ConversionError;
4044 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4045 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
4046 ::std::sync::LazyLock::new(|| {
4047 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
4048 });
4049 if PATTERN.find(value).is_none() {
4050 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
4051 }
4052 Ok(Self(value.to_string()))
4053 }
4054 }
4055 impl ::std::convert::TryFrom<&str> for CreateEvmSwapQuoteBodyTaker {
4056 type Error = self::error::ConversionError;
4057 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4058 value.parse()
4059 }
4060 }
4061 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSwapQuoteBodyTaker {
4062 type Error = self::error::ConversionError;
4063 fn try_from(
4064 value: &::std::string::String,
4065 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4066 value.parse()
4067 }
4068 }
4069 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSwapQuoteBodyTaker {
4070 type Error = self::error::ConversionError;
4071 fn try_from(
4072 value: ::std::string::String,
4073 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4074 value.parse()
4075 }
4076 }
4077 impl<'de> ::serde::Deserialize<'de> for CreateEvmSwapQuoteBodyTaker {
4078 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
4079 where
4080 D: ::serde::Deserializer<'de>,
4081 {
4082 ::std::string::String::deserialize(deserializer)?
4083 .parse()
4084 .map_err(|e: self::error::ConversionError| {
4085 <D::Error as ::serde::de::Error>::custom(e.to_string())
4086 })
4087 }
4088 }
4089 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
4105 #[serde(transparent)]
4106 pub struct CreateEvmSwapQuoteBodyToToken(::std::string::String);
4107 impl ::std::ops::Deref for CreateEvmSwapQuoteBodyToToken {
4108 type Target = ::std::string::String;
4109 fn deref(&self) -> &::std::string::String {
4110 &self.0
4111 }
4112 }
4113 impl ::std::convert::From<CreateEvmSwapQuoteBodyToToken> for ::std::string::String {
4114 fn from(value: CreateEvmSwapQuoteBodyToToken) -> Self {
4115 value.0
4116 }
4117 }
4118 impl ::std::convert::From<&CreateEvmSwapQuoteBodyToToken> for CreateEvmSwapQuoteBodyToToken {
4119 fn from(value: &CreateEvmSwapQuoteBodyToToken) -> Self {
4120 value.clone()
4121 }
4122 }
4123 impl ::std::str::FromStr for CreateEvmSwapQuoteBodyToToken {
4124 type Err = self::error::ConversionError;
4125 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4126 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
4127 ::std::sync::LazyLock::new(|| {
4128 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
4129 });
4130 if PATTERN.find(value).is_none() {
4131 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
4132 }
4133 Ok(Self(value.to_string()))
4134 }
4135 }
4136 impl ::std::convert::TryFrom<&str> for CreateEvmSwapQuoteBodyToToken {
4137 type Error = self::error::ConversionError;
4138 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4139 value.parse()
4140 }
4141 }
4142 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSwapQuoteBodyToToken {
4143 type Error = self::error::ConversionError;
4144 fn try_from(
4145 value: &::std::string::String,
4146 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4147 value.parse()
4148 }
4149 }
4150 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSwapQuoteBodyToToken {
4151 type Error = self::error::ConversionError;
4152 fn try_from(
4153 value: ::std::string::String,
4154 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4155 value.parse()
4156 }
4157 }
4158 impl<'de> ::serde::Deserialize<'de> for CreateEvmSwapQuoteBodyToToken {
4159 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
4160 where
4161 D: ::serde::Deserializer<'de>,
4162 {
4163 ::std::string::String::deserialize(deserializer)?
4164 .parse()
4165 .map_err(|e: self::error::ConversionError| {
4166 <D::Error as ::serde::de::Error>::custom(e.to_string())
4167 })
4168 }
4169 }
4170 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
4184 #[serde(transparent)]
4185 pub struct CreateEvmSwapQuoteXIdempotencyKey(::std::string::String);
4186 impl ::std::ops::Deref for CreateEvmSwapQuoteXIdempotencyKey {
4187 type Target = ::std::string::String;
4188 fn deref(&self) -> &::std::string::String {
4189 &self.0
4190 }
4191 }
4192 impl ::std::convert::From<CreateEvmSwapQuoteXIdempotencyKey> for ::std::string::String {
4193 fn from(value: CreateEvmSwapQuoteXIdempotencyKey) -> Self {
4194 value.0
4195 }
4196 }
4197 impl ::std::convert::From<&CreateEvmSwapQuoteXIdempotencyKey>
4198 for CreateEvmSwapQuoteXIdempotencyKey
4199 {
4200 fn from(value: &CreateEvmSwapQuoteXIdempotencyKey) -> Self {
4201 value.clone()
4202 }
4203 }
4204 impl ::std::str::FromStr for CreateEvmSwapQuoteXIdempotencyKey {
4205 type Err = self::error::ConversionError;
4206 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4207 if value.chars().count() > 36usize {
4208 return Err("longer than 36 characters".into());
4209 }
4210 if value.chars().count() < 36usize {
4211 return Err("shorter than 36 characters".into());
4212 }
4213 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
4214 ::std::sync::LazyLock::new(|| {
4215 ::regress::Regex::new(
4216 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
4217 )
4218 .unwrap()
4219 });
4220 if PATTERN.find(value).is_none() {
4221 return Err(
4222 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
4223 .into(),
4224 );
4225 }
4226 Ok(Self(value.to_string()))
4227 }
4228 }
4229 impl ::std::convert::TryFrom<&str> for CreateEvmSwapQuoteXIdempotencyKey {
4230 type Error = self::error::ConversionError;
4231 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4232 value.parse()
4233 }
4234 }
4235 impl ::std::convert::TryFrom<&::std::string::String> for CreateEvmSwapQuoteXIdempotencyKey {
4236 type Error = self::error::ConversionError;
4237 fn try_from(
4238 value: &::std::string::String,
4239 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4240 value.parse()
4241 }
4242 }
4243 impl ::std::convert::TryFrom<::std::string::String> for CreateEvmSwapQuoteXIdempotencyKey {
4244 type Error = self::error::ConversionError;
4245 fn try_from(
4246 value: ::std::string::String,
4247 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4248 value.parse()
4249 }
4250 }
4251 impl<'de> ::serde::Deserialize<'de> for CreateEvmSwapQuoteXIdempotencyKey {
4252 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
4253 where
4254 D: ::serde::Deserializer<'de>,
4255 {
4256 ::std::string::String::deserialize(deserializer)?
4257 .parse()
4258 .map_err(|e: self::error::ConversionError| {
4259 <D::Error as ::serde::de::Error>::custom(e.to_string())
4260 })
4261 }
4262 }
4263 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4396 pub struct CreateOnrampOrderBody {
4397 #[serde(rename = "agreementAcceptedAt")]
4399 pub agreement_accepted_at: ::chrono::DateTime<::chrono::offset::Utc>,
4400 #[serde(
4402 rename = "clientIp",
4403 default,
4404 skip_serializing_if = "::std::option::Option::is_none"
4405 )]
4406 pub client_ip: ::std::option::Option<::std::string::String>,
4407 #[serde(rename = "destinationAddress")]
4409 pub destination_address: ::std::string::String,
4410 #[serde(rename = "destinationNetwork")]
4414 pub destination_network: ::std::string::String,
4415 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4417 pub domain: ::std::option::Option<::std::string::String>,
4418 pub email: ::std::string::String,
4420 #[serde(rename = "isQuote", default)]
4422 pub is_quote: bool,
4423 #[serde(
4425 rename = "partnerOrderRef",
4426 default,
4427 skip_serializing_if = "::std::option::Option::is_none"
4428 )]
4429 pub partner_order_ref: ::std::option::Option<::std::string::String>,
4430 #[serde(rename = "partnerUserRef")]
4434 pub partner_user_ref: ::std::string::String,
4435 #[serde(
4437 rename = "paymentAmount",
4438 default,
4439 skip_serializing_if = "::std::option::Option::is_none"
4440 )]
4441 pub payment_amount: ::std::option::Option<::std::string::String>,
4442 #[serde(rename = "paymentCurrency")]
4444 pub payment_currency: ::std::string::String,
4445 #[serde(rename = "paymentMethod")]
4446 pub payment_method: OnrampOrderPaymentMethodTypeId,
4447 #[serde(rename = "phoneNumber")]
4451 pub phone_number: ::std::string::String,
4452 #[serde(rename = "phoneNumberVerifiedAt")]
4454 pub phone_number_verified_at: ::chrono::DateTime<::chrono::offset::Utc>,
4455 #[serde(
4457 rename = "purchaseAmount",
4458 default,
4459 skip_serializing_if = "::std::option::Option::is_none"
4460 )]
4461 pub purchase_amount: ::std::option::Option<::std::string::String>,
4462 #[serde(rename = "purchaseCurrency")]
4466 pub purchase_currency: ::std::string::String,
4467 }
4468 impl ::std::convert::From<&CreateOnrampOrderBody> for CreateOnrampOrderBody {
4469 fn from(value: &CreateOnrampOrderBody) -> Self {
4470 value.clone()
4471 }
4472 }
4473 impl CreateOnrampOrderBody {
4474 pub fn builder() -> builder::CreateOnrampOrderBody {
4475 Default::default()
4476 }
4477 }
4478 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4500 pub struct CreateOnrampOrderResponse {
4501 pub order: OnrampOrder,
4502 #[serde(
4503 rename = "paymentLink",
4504 default,
4505 skip_serializing_if = "::std::option::Option::is_none"
4506 )]
4507 pub payment_link: ::std::option::Option<OnrampPaymentLink>,
4508 }
4509 impl ::std::convert::From<&CreateOnrampOrderResponse> for CreateOnrampOrderResponse {
4510 fn from(value: &CreateOnrampOrderResponse) -> Self {
4511 value.clone()
4512 }
4513 }
4514 impl CreateOnrampOrderResponse {
4515 pub fn builder() -> builder::CreateOnrampOrderResponse {
4516 Default::default()
4517 }
4518 }
4519 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4614 pub struct CreateOnrampSessionBody {
4615 #[serde(
4617 rename = "clientIp",
4618 default,
4619 skip_serializing_if = "::std::option::Option::is_none"
4620 )]
4621 pub client_ip: ::std::option::Option<::std::string::String>,
4622 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4624 pub country: ::std::option::Option<::std::string::String>,
4625 #[serde(rename = "destinationAddress")]
4627 pub destination_address: ::std::string::String,
4628 #[serde(rename = "destinationNetwork")]
4632 pub destination_network: ::std::string::String,
4633 #[serde(
4637 rename = "partnerUserRef",
4638 default,
4639 skip_serializing_if = "::std::option::Option::is_none"
4640 )]
4641 pub partner_user_ref: ::std::option::Option<::std::string::String>,
4642 #[serde(
4644 rename = "paymentAmount",
4645 default,
4646 skip_serializing_if = "::std::option::Option::is_none"
4647 )]
4648 pub payment_amount: ::std::option::Option<::std::string::String>,
4649 #[serde(
4651 rename = "paymentCurrency",
4652 default,
4653 skip_serializing_if = "::std::option::Option::is_none"
4654 )]
4655 pub payment_currency: ::std::option::Option<::std::string::String>,
4656 #[serde(
4657 rename = "paymentMethod",
4658 default,
4659 skip_serializing_if = "::std::option::Option::is_none"
4660 )]
4661 pub payment_method: ::std::option::Option<OnrampQuotePaymentMethodTypeId>,
4662 #[serde(rename = "purchaseCurrency")]
4666 pub purchase_currency: ::std::string::String,
4667 #[serde(
4669 rename = "redirectUrl",
4670 default,
4671 skip_serializing_if = "::std::option::Option::is_none"
4672 )]
4673 pub redirect_url: ::std::option::Option<Uri>,
4674 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4676 pub subdivision: ::std::option::Option<::std::string::String>,
4677 }
4678 impl ::std::convert::From<&CreateOnrampSessionBody> for CreateOnrampSessionBody {
4679 fn from(value: &CreateOnrampSessionBody) -> Self {
4680 value.clone()
4681 }
4682 }
4683 impl CreateOnrampSessionBody {
4684 pub fn builder() -> builder::CreateOnrampSessionBody {
4685 Default::default()
4686 }
4687 }
4688 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4710 pub struct CreateOnrampSessionResponse {
4711 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4712 pub quote: ::std::option::Option<OnrampQuote>,
4713 pub session: OnrampSession,
4714 }
4715 impl ::std::convert::From<&CreateOnrampSessionResponse> for CreateOnrampSessionResponse {
4716 fn from(value: &CreateOnrampSessionResponse) -> Self {
4717 value.clone()
4718 }
4719 }
4720 impl CreateOnrampSessionResponse {
4721 pub fn builder() -> builder::CreateOnrampSessionResponse {
4722 Default::default()
4723 }
4724 }
4725 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4768 pub struct CreatePolicyBody {
4769 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4772 pub description: ::std::option::Option<CreatePolicyBodyDescription>,
4773 pub rules: ::std::vec::Vec<Rule>,
4775 pub scope: CreatePolicyBodyScope,
4777 }
4778 impl ::std::convert::From<&CreatePolicyBody> for CreatePolicyBody {
4779 fn from(value: &CreatePolicyBody) -> Self {
4780 value.clone()
4781 }
4782 }
4783 impl CreatePolicyBody {
4784 pub fn builder() -> builder::CreatePolicyBody {
4785 Default::default()
4786 }
4787 }
4788 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
4805 #[serde(transparent)]
4806 pub struct CreatePolicyBodyDescription(::std::string::String);
4807 impl ::std::ops::Deref for CreatePolicyBodyDescription {
4808 type Target = ::std::string::String;
4809 fn deref(&self) -> &::std::string::String {
4810 &self.0
4811 }
4812 }
4813 impl ::std::convert::From<CreatePolicyBodyDescription> for ::std::string::String {
4814 fn from(value: CreatePolicyBodyDescription) -> Self {
4815 value.0
4816 }
4817 }
4818 impl ::std::convert::From<&CreatePolicyBodyDescription> for CreatePolicyBodyDescription {
4819 fn from(value: &CreatePolicyBodyDescription) -> Self {
4820 value.clone()
4821 }
4822 }
4823 impl ::std::str::FromStr for CreatePolicyBodyDescription {
4824 type Err = self::error::ConversionError;
4825 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4826 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
4827 ::std::sync::LazyLock::new(|| {
4828 ::regress::Regex::new("^[A-Za-z0-9 ,.]{1,50}$").unwrap()
4829 });
4830 if PATTERN.find(value).is_none() {
4831 return Err("doesn't match pattern \"^[A-Za-z0-9 ,.]{1,50}$\"".into());
4832 }
4833 Ok(Self(value.to_string()))
4834 }
4835 }
4836 impl ::std::convert::TryFrom<&str> for CreatePolicyBodyDescription {
4837 type Error = self::error::ConversionError;
4838 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4839 value.parse()
4840 }
4841 }
4842 impl ::std::convert::TryFrom<&::std::string::String> for CreatePolicyBodyDescription {
4843 type Error = self::error::ConversionError;
4844 fn try_from(
4845 value: &::std::string::String,
4846 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4847 value.parse()
4848 }
4849 }
4850 impl ::std::convert::TryFrom<::std::string::String> for CreatePolicyBodyDescription {
4851 type Error = self::error::ConversionError;
4852 fn try_from(
4853 value: ::std::string::String,
4854 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4855 value.parse()
4856 }
4857 }
4858 impl<'de> ::serde::Deserialize<'de> for CreatePolicyBodyDescription {
4859 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
4860 where
4861 D: ::serde::Deserializer<'de>,
4862 {
4863 ::std::string::String::deserialize(deserializer)?
4864 .parse()
4865 .map_err(|e: self::error::ConversionError| {
4866 <D::Error as ::serde::de::Error>::custom(e.to_string())
4867 })
4868 }
4869 }
4870 #[derive(
4889 ::serde::Deserialize,
4890 ::serde::Serialize,
4891 Clone,
4892 Copy,
4893 Debug,
4894 Eq,
4895 Hash,
4896 Ord,
4897 PartialEq,
4898 PartialOrd,
4899 )]
4900 pub enum CreatePolicyBodyScope {
4901 #[serde(rename = "project")]
4902 Project,
4903 #[serde(rename = "account")]
4904 Account,
4905 }
4906 impl ::std::convert::From<&Self> for CreatePolicyBodyScope {
4907 fn from(value: &CreatePolicyBodyScope) -> Self {
4908 value.clone()
4909 }
4910 }
4911 impl ::std::fmt::Display for CreatePolicyBodyScope {
4912 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4913 match *self {
4914 Self::Project => f.write_str("project"),
4915 Self::Account => f.write_str("account"),
4916 }
4917 }
4918 }
4919 impl ::std::str::FromStr for CreatePolicyBodyScope {
4920 type Err = self::error::ConversionError;
4921 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4922 match value {
4923 "project" => Ok(Self::Project),
4924 "account" => Ok(Self::Account),
4925 _ => Err("invalid value".into()),
4926 }
4927 }
4928 }
4929 impl ::std::convert::TryFrom<&str> for CreatePolicyBodyScope {
4930 type Error = self::error::ConversionError;
4931 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4932 value.parse()
4933 }
4934 }
4935 impl ::std::convert::TryFrom<&::std::string::String> for CreatePolicyBodyScope {
4936 type Error = self::error::ConversionError;
4937 fn try_from(
4938 value: &::std::string::String,
4939 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4940 value.parse()
4941 }
4942 }
4943 impl ::std::convert::TryFrom<::std::string::String> for CreatePolicyBodyScope {
4944 type Error = self::error::ConversionError;
4945 fn try_from(
4946 value: ::std::string::String,
4947 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4948 value.parse()
4949 }
4950 }
4951 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
4965 #[serde(transparent)]
4966 pub struct CreatePolicyXIdempotencyKey(::std::string::String);
4967 impl ::std::ops::Deref for CreatePolicyXIdempotencyKey {
4968 type Target = ::std::string::String;
4969 fn deref(&self) -> &::std::string::String {
4970 &self.0
4971 }
4972 }
4973 impl ::std::convert::From<CreatePolicyXIdempotencyKey> for ::std::string::String {
4974 fn from(value: CreatePolicyXIdempotencyKey) -> Self {
4975 value.0
4976 }
4977 }
4978 impl ::std::convert::From<&CreatePolicyXIdempotencyKey> for CreatePolicyXIdempotencyKey {
4979 fn from(value: &CreatePolicyXIdempotencyKey) -> Self {
4980 value.clone()
4981 }
4982 }
4983 impl ::std::str::FromStr for CreatePolicyXIdempotencyKey {
4984 type Err = self::error::ConversionError;
4985 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4986 if value.chars().count() > 36usize {
4987 return Err("longer than 36 characters".into());
4988 }
4989 if value.chars().count() < 36usize {
4990 return Err("shorter than 36 characters".into());
4991 }
4992 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
4993 ::std::sync::LazyLock::new(|| {
4994 ::regress::Regex::new(
4995 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
4996 )
4997 .unwrap()
4998 });
4999 if PATTERN.find(value).is_none() {
5000 return Err(
5001 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
5002 .into(),
5003 );
5004 }
5005 Ok(Self(value.to_string()))
5006 }
5007 }
5008 impl ::std::convert::TryFrom<&str> for CreatePolicyXIdempotencyKey {
5009 type Error = self::error::ConversionError;
5010 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5011 value.parse()
5012 }
5013 }
5014 impl ::std::convert::TryFrom<&::std::string::String> for CreatePolicyXIdempotencyKey {
5015 type Error = self::error::ConversionError;
5016 fn try_from(
5017 value: &::std::string::String,
5018 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5019 value.parse()
5020 }
5021 }
5022 impl ::std::convert::TryFrom<::std::string::String> for CreatePolicyXIdempotencyKey {
5023 type Error = self::error::ConversionError;
5024 fn try_from(
5025 value: ::std::string::String,
5026 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5027 value.parse()
5028 }
5029 }
5030 impl<'de> ::serde::Deserialize<'de> for CreatePolicyXIdempotencyKey {
5031 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5032 where
5033 D: ::serde::Deserializer<'de>,
5034 {
5035 ::std::string::String::deserialize(deserializer)?
5036 .parse()
5037 .map_err(|e: self::error::ConversionError| {
5038 <D::Error as ::serde::de::Error>::custom(e.to_string())
5039 })
5040 }
5041 }
5042 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5072 pub struct CreateSolanaAccountBody {
5073 #[serde(
5075 rename = "accountPolicy",
5076 default,
5077 skip_serializing_if = "::std::option::Option::is_none"
5078 )]
5079 pub account_policy: ::std::option::Option<CreateSolanaAccountBodyAccountPolicy>,
5080 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5084 pub name: ::std::option::Option<CreateSolanaAccountBodyName>,
5085 }
5086 impl ::std::convert::From<&CreateSolanaAccountBody> for CreateSolanaAccountBody {
5087 fn from(value: &CreateSolanaAccountBody) -> Self {
5088 value.clone()
5089 }
5090 }
5091 impl ::std::default::Default for CreateSolanaAccountBody {
5092 fn default() -> Self {
5093 Self {
5094 account_policy: Default::default(),
5095 name: Default::default(),
5096 }
5097 }
5098 }
5099 impl CreateSolanaAccountBody {
5100 pub fn builder() -> builder::CreateSolanaAccountBody {
5101 Default::default()
5102 }
5103 }
5104 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5121 #[serde(transparent)]
5122 pub struct CreateSolanaAccountBodyAccountPolicy(::std::string::String);
5123 impl ::std::ops::Deref for CreateSolanaAccountBodyAccountPolicy {
5124 type Target = ::std::string::String;
5125 fn deref(&self) -> &::std::string::String {
5126 &self.0
5127 }
5128 }
5129 impl ::std::convert::From<CreateSolanaAccountBodyAccountPolicy> for ::std::string::String {
5130 fn from(value: CreateSolanaAccountBodyAccountPolicy) -> Self {
5131 value.0
5132 }
5133 }
5134 impl ::std::convert::From<&CreateSolanaAccountBodyAccountPolicy>
5135 for CreateSolanaAccountBodyAccountPolicy
5136 {
5137 fn from(value: &CreateSolanaAccountBodyAccountPolicy) -> Self {
5138 value.clone()
5139 }
5140 }
5141 impl ::std::str::FromStr for CreateSolanaAccountBodyAccountPolicy {
5142 type Err = self::error::ConversionError;
5143 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5144 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
5145 || {
5146 ::regress::Regex::new(
5147 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
5148 )
5149 .unwrap()
5150 },
5151 );
5152 if PATTERN.find(value).is_none() {
5153 return Err(
5154 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
5155 .into(),
5156 );
5157 }
5158 Ok(Self(value.to_string()))
5159 }
5160 }
5161 impl ::std::convert::TryFrom<&str> for CreateSolanaAccountBodyAccountPolicy {
5162 type Error = self::error::ConversionError;
5163 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5164 value.parse()
5165 }
5166 }
5167 impl ::std::convert::TryFrom<&::std::string::String> for CreateSolanaAccountBodyAccountPolicy {
5168 type Error = self::error::ConversionError;
5169 fn try_from(
5170 value: &::std::string::String,
5171 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5172 value.parse()
5173 }
5174 }
5175 impl ::std::convert::TryFrom<::std::string::String> for CreateSolanaAccountBodyAccountPolicy {
5176 type Error = self::error::ConversionError;
5177 fn try_from(
5178 value: ::std::string::String,
5179 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5180 value.parse()
5181 }
5182 }
5183 impl<'de> ::serde::Deserialize<'de> for CreateSolanaAccountBodyAccountPolicy {
5184 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5185 where
5186 D: ::serde::Deserializer<'de>,
5187 {
5188 ::std::string::String::deserialize(deserializer)?
5189 .parse()
5190 .map_err(|e: self::error::ConversionError| {
5191 <D::Error as ::serde::de::Error>::custom(e.to_string())
5192 })
5193 }
5194 }
5195 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5213 #[serde(transparent)]
5214 pub struct CreateSolanaAccountBodyName(::std::string::String);
5215 impl ::std::ops::Deref for CreateSolanaAccountBodyName {
5216 type Target = ::std::string::String;
5217 fn deref(&self) -> &::std::string::String {
5218 &self.0
5219 }
5220 }
5221 impl ::std::convert::From<CreateSolanaAccountBodyName> for ::std::string::String {
5222 fn from(value: CreateSolanaAccountBodyName) -> Self {
5223 value.0
5224 }
5225 }
5226 impl ::std::convert::From<&CreateSolanaAccountBodyName> for CreateSolanaAccountBodyName {
5227 fn from(value: &CreateSolanaAccountBodyName) -> Self {
5228 value.clone()
5229 }
5230 }
5231 impl ::std::str::FromStr for CreateSolanaAccountBodyName {
5232 type Err = self::error::ConversionError;
5233 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5234 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
5235 ::std::sync::LazyLock::new(|| {
5236 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
5237 });
5238 if PATTERN.find(value).is_none() {
5239 return Err(
5240 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
5241 );
5242 }
5243 Ok(Self(value.to_string()))
5244 }
5245 }
5246 impl ::std::convert::TryFrom<&str> for CreateSolanaAccountBodyName {
5247 type Error = self::error::ConversionError;
5248 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5249 value.parse()
5250 }
5251 }
5252 impl ::std::convert::TryFrom<&::std::string::String> for CreateSolanaAccountBodyName {
5253 type Error = self::error::ConversionError;
5254 fn try_from(
5255 value: &::std::string::String,
5256 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5257 value.parse()
5258 }
5259 }
5260 impl ::std::convert::TryFrom<::std::string::String> for CreateSolanaAccountBodyName {
5261 type Error = self::error::ConversionError;
5262 fn try_from(
5263 value: ::std::string::String,
5264 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5265 value.parse()
5266 }
5267 }
5268 impl<'de> ::serde::Deserialize<'de> for CreateSolanaAccountBodyName {
5269 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5270 where
5271 D: ::serde::Deserializer<'de>,
5272 {
5273 ::std::string::String::deserialize(deserializer)?
5274 .parse()
5275 .map_err(|e: self::error::ConversionError| {
5276 <D::Error as ::serde::de::Error>::custom(e.to_string())
5277 })
5278 }
5279 }
5280 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5294 #[serde(transparent)]
5295 pub struct CreateSolanaAccountXIdempotencyKey(::std::string::String);
5296 impl ::std::ops::Deref for CreateSolanaAccountXIdempotencyKey {
5297 type Target = ::std::string::String;
5298 fn deref(&self) -> &::std::string::String {
5299 &self.0
5300 }
5301 }
5302 impl ::std::convert::From<CreateSolanaAccountXIdempotencyKey> for ::std::string::String {
5303 fn from(value: CreateSolanaAccountXIdempotencyKey) -> Self {
5304 value.0
5305 }
5306 }
5307 impl ::std::convert::From<&CreateSolanaAccountXIdempotencyKey>
5308 for CreateSolanaAccountXIdempotencyKey
5309 {
5310 fn from(value: &CreateSolanaAccountXIdempotencyKey) -> Self {
5311 value.clone()
5312 }
5313 }
5314 impl ::std::str::FromStr for CreateSolanaAccountXIdempotencyKey {
5315 type Err = self::error::ConversionError;
5316 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5317 if value.chars().count() > 36usize {
5318 return Err("longer than 36 characters".into());
5319 }
5320 if value.chars().count() < 36usize {
5321 return Err("shorter than 36 characters".into());
5322 }
5323 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
5324 ::std::sync::LazyLock::new(|| {
5325 ::regress::Regex::new(
5326 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
5327 )
5328 .unwrap()
5329 });
5330 if PATTERN.find(value).is_none() {
5331 return Err(
5332 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
5333 .into(),
5334 );
5335 }
5336 Ok(Self(value.to_string()))
5337 }
5338 }
5339 impl ::std::convert::TryFrom<&str> for CreateSolanaAccountXIdempotencyKey {
5340 type Error = self::error::ConversionError;
5341 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5342 value.parse()
5343 }
5344 }
5345 impl ::std::convert::TryFrom<&::std::string::String> for CreateSolanaAccountXIdempotencyKey {
5346 type Error = self::error::ConversionError;
5347 fn try_from(
5348 value: &::std::string::String,
5349 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5350 value.parse()
5351 }
5352 }
5353 impl ::std::convert::TryFrom<::std::string::String> for CreateSolanaAccountXIdempotencyKey {
5354 type Error = self::error::ConversionError;
5355 fn try_from(
5356 value: ::std::string::String,
5357 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5358 value.parse()
5359 }
5360 }
5361 impl<'de> ::serde::Deserialize<'de> for CreateSolanaAccountXIdempotencyKey {
5362 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5363 where
5364 D: ::serde::Deserializer<'de>,
5365 {
5366 ::std::string::String::deserialize(deserializer)?
5367 .parse()
5368 .map_err(|e: self::error::ConversionError| {
5369 <D::Error as ::serde::de::Error>::custom(e.to_string())
5370 })
5371 }
5372 }
5373 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5385 #[serde(transparent)]
5386 pub struct CreateSpendPermissionAddress(::std::string::String);
5387 impl ::std::ops::Deref for CreateSpendPermissionAddress {
5388 type Target = ::std::string::String;
5389 fn deref(&self) -> &::std::string::String {
5390 &self.0
5391 }
5392 }
5393 impl ::std::convert::From<CreateSpendPermissionAddress> for ::std::string::String {
5394 fn from(value: CreateSpendPermissionAddress) -> Self {
5395 value.0
5396 }
5397 }
5398 impl ::std::convert::From<&CreateSpendPermissionAddress> for CreateSpendPermissionAddress {
5399 fn from(value: &CreateSpendPermissionAddress) -> Self {
5400 value.clone()
5401 }
5402 }
5403 impl ::std::str::FromStr for CreateSpendPermissionAddress {
5404 type Err = self::error::ConversionError;
5405 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5406 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
5407 ::std::sync::LazyLock::new(|| {
5408 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
5409 });
5410 if PATTERN.find(value).is_none() {
5411 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
5412 }
5413 Ok(Self(value.to_string()))
5414 }
5415 }
5416 impl ::std::convert::TryFrom<&str> for CreateSpendPermissionAddress {
5417 type Error = self::error::ConversionError;
5418 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5419 value.parse()
5420 }
5421 }
5422 impl ::std::convert::TryFrom<&::std::string::String> for CreateSpendPermissionAddress {
5423 type Error = self::error::ConversionError;
5424 fn try_from(
5425 value: &::std::string::String,
5426 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5427 value.parse()
5428 }
5429 }
5430 impl ::std::convert::TryFrom<::std::string::String> for CreateSpendPermissionAddress {
5431 type Error = self::error::ConversionError;
5432 fn try_from(
5433 value: ::std::string::String,
5434 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5435 value.parse()
5436 }
5437 }
5438 impl<'de> ::serde::Deserialize<'de> for CreateSpendPermissionAddress {
5439 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5440 where
5441 D: ::serde::Deserializer<'de>,
5442 {
5443 ::std::string::String::deserialize(deserializer)?
5444 .parse()
5445 .map_err(|e: self::error::ConversionError| {
5446 <D::Error as ::serde::de::Error>::custom(e.to_string())
5447 })
5448 }
5449 }
5450 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5545 pub struct CreateSpendPermissionRequest {
5546 pub allowance: ::std::string::String,
5548 pub end: ::std::string::String,
5550 #[serde(
5552 rename = "extraData",
5553 default,
5554 skip_serializing_if = "::std::option::Option::is_none"
5555 )]
5556 pub extra_data: ::std::option::Option<::std::string::String>,
5557 pub network: SpendPermissionNetwork,
5558 #[serde(
5560 rename = "paymasterUrl",
5561 default,
5562 skip_serializing_if = "::std::option::Option::is_none"
5563 )]
5564 pub paymaster_url: ::std::option::Option<Url>,
5565 pub period: ::std::string::String,
5567 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5569 pub salt: ::std::option::Option<::std::string::String>,
5570 pub spender: CreateSpendPermissionRequestSpender,
5572 pub start: ::std::string::String,
5574 pub token: CreateSpendPermissionRequestToken,
5576 }
5577 impl ::std::convert::From<&CreateSpendPermissionRequest> for CreateSpendPermissionRequest {
5578 fn from(value: &CreateSpendPermissionRequest) -> Self {
5579 value.clone()
5580 }
5581 }
5582 impl CreateSpendPermissionRequest {
5583 pub fn builder() -> builder::CreateSpendPermissionRequest {
5584 Default::default()
5585 }
5586 }
5587 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5603 #[serde(transparent)]
5604 pub struct CreateSpendPermissionRequestSpender(::std::string::String);
5605 impl ::std::ops::Deref for CreateSpendPermissionRequestSpender {
5606 type Target = ::std::string::String;
5607 fn deref(&self) -> &::std::string::String {
5608 &self.0
5609 }
5610 }
5611 impl ::std::convert::From<CreateSpendPermissionRequestSpender> for ::std::string::String {
5612 fn from(value: CreateSpendPermissionRequestSpender) -> Self {
5613 value.0
5614 }
5615 }
5616 impl ::std::convert::From<&CreateSpendPermissionRequestSpender>
5617 for CreateSpendPermissionRequestSpender
5618 {
5619 fn from(value: &CreateSpendPermissionRequestSpender) -> Self {
5620 value.clone()
5621 }
5622 }
5623 impl ::std::str::FromStr for CreateSpendPermissionRequestSpender {
5624 type Err = self::error::ConversionError;
5625 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5626 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
5627 ::std::sync::LazyLock::new(|| {
5628 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
5629 });
5630 if PATTERN.find(value).is_none() {
5631 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
5632 }
5633 Ok(Self(value.to_string()))
5634 }
5635 }
5636 impl ::std::convert::TryFrom<&str> for CreateSpendPermissionRequestSpender {
5637 type Error = self::error::ConversionError;
5638 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5639 value.parse()
5640 }
5641 }
5642 impl ::std::convert::TryFrom<&::std::string::String> for CreateSpendPermissionRequestSpender {
5643 type Error = self::error::ConversionError;
5644 fn try_from(
5645 value: &::std::string::String,
5646 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5647 value.parse()
5648 }
5649 }
5650 impl ::std::convert::TryFrom<::std::string::String> for CreateSpendPermissionRequestSpender {
5651 type Error = self::error::ConversionError;
5652 fn try_from(
5653 value: ::std::string::String,
5654 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5655 value.parse()
5656 }
5657 }
5658 impl<'de> ::serde::Deserialize<'de> for CreateSpendPermissionRequestSpender {
5659 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5660 where
5661 D: ::serde::Deserializer<'de>,
5662 {
5663 ::std::string::String::deserialize(deserializer)?
5664 .parse()
5665 .map_err(|e: self::error::ConversionError| {
5666 <D::Error as ::serde::de::Error>::custom(e.to_string())
5667 })
5668 }
5669 }
5670 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5686 #[serde(transparent)]
5687 pub struct CreateSpendPermissionRequestToken(::std::string::String);
5688 impl ::std::ops::Deref for CreateSpendPermissionRequestToken {
5689 type Target = ::std::string::String;
5690 fn deref(&self) -> &::std::string::String {
5691 &self.0
5692 }
5693 }
5694 impl ::std::convert::From<CreateSpendPermissionRequestToken> for ::std::string::String {
5695 fn from(value: CreateSpendPermissionRequestToken) -> Self {
5696 value.0
5697 }
5698 }
5699 impl ::std::convert::From<&CreateSpendPermissionRequestToken>
5700 for CreateSpendPermissionRequestToken
5701 {
5702 fn from(value: &CreateSpendPermissionRequestToken) -> Self {
5703 value.clone()
5704 }
5705 }
5706 impl ::std::str::FromStr for CreateSpendPermissionRequestToken {
5707 type Err = self::error::ConversionError;
5708 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5709 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
5710 ::std::sync::LazyLock::new(|| {
5711 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
5712 });
5713 if PATTERN.find(value).is_none() {
5714 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
5715 }
5716 Ok(Self(value.to_string()))
5717 }
5718 }
5719 impl ::std::convert::TryFrom<&str> for CreateSpendPermissionRequestToken {
5720 type Error = self::error::ConversionError;
5721 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5722 value.parse()
5723 }
5724 }
5725 impl ::std::convert::TryFrom<&::std::string::String> for CreateSpendPermissionRequestToken {
5726 type Error = self::error::ConversionError;
5727 fn try_from(
5728 value: &::std::string::String,
5729 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5730 value.parse()
5731 }
5732 }
5733 impl ::std::convert::TryFrom<::std::string::String> for CreateSpendPermissionRequestToken {
5734 type Error = self::error::ConversionError;
5735 fn try_from(
5736 value: ::std::string::String,
5737 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5738 value.parse()
5739 }
5740 }
5741 impl<'de> ::serde::Deserialize<'de> for CreateSpendPermissionRequestToken {
5742 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5743 where
5744 D: ::serde::Deserializer<'de>,
5745 {
5746 ::std::string::String::deserialize(deserializer)?
5747 .parse()
5748 .map_err(|e: self::error::ConversionError| {
5749 <D::Error as ::serde::de::Error>::custom(e.to_string())
5750 })
5751 }
5752 }
5753 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5767 #[serde(transparent)]
5768 pub struct CreateSpendPermissionXIdempotencyKey(::std::string::String);
5769 impl ::std::ops::Deref for CreateSpendPermissionXIdempotencyKey {
5770 type Target = ::std::string::String;
5771 fn deref(&self) -> &::std::string::String {
5772 &self.0
5773 }
5774 }
5775 impl ::std::convert::From<CreateSpendPermissionXIdempotencyKey> for ::std::string::String {
5776 fn from(value: CreateSpendPermissionXIdempotencyKey) -> Self {
5777 value.0
5778 }
5779 }
5780 impl ::std::convert::From<&CreateSpendPermissionXIdempotencyKey>
5781 for CreateSpendPermissionXIdempotencyKey
5782 {
5783 fn from(value: &CreateSpendPermissionXIdempotencyKey) -> Self {
5784 value.clone()
5785 }
5786 }
5787 impl ::std::str::FromStr for CreateSpendPermissionXIdempotencyKey {
5788 type Err = self::error::ConversionError;
5789 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5790 if value.chars().count() > 36usize {
5791 return Err("longer than 36 characters".into());
5792 }
5793 if value.chars().count() < 36usize {
5794 return Err("shorter than 36 characters".into());
5795 }
5796 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
5797 ::std::sync::LazyLock::new(|| {
5798 ::regress::Regex::new(
5799 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
5800 )
5801 .unwrap()
5802 });
5803 if PATTERN.find(value).is_none() {
5804 return Err(
5805 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
5806 .into(),
5807 );
5808 }
5809 Ok(Self(value.to_string()))
5810 }
5811 }
5812 impl ::std::convert::TryFrom<&str> for CreateSpendPermissionXIdempotencyKey {
5813 type Error = self::error::ConversionError;
5814 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5815 value.parse()
5816 }
5817 }
5818 impl ::std::convert::TryFrom<&::std::string::String> for CreateSpendPermissionXIdempotencyKey {
5819 type Error = self::error::ConversionError;
5820 fn try_from(
5821 value: &::std::string::String,
5822 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5823 value.parse()
5824 }
5825 }
5826 impl ::std::convert::TryFrom<::std::string::String> for CreateSpendPermissionXIdempotencyKey {
5827 type Error = self::error::ConversionError;
5828 fn try_from(
5829 value: ::std::string::String,
5830 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5831 value.parse()
5832 }
5833 }
5834 impl<'de> ::serde::Deserialize<'de> for CreateSpendPermissionXIdempotencyKey {
5835 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5836 where
5837 D: ::serde::Deserializer<'de>,
5838 {
5839 ::std::string::String::deserialize(deserializer)?
5840 .parse()
5841 .map_err(|e: self::error::ConversionError| {
5842 <D::Error as ::serde::de::Error>::custom(e.to_string())
5843 })
5844 }
5845 }
5846 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5947 pub struct CreateSwapQuoteResponse {
5948 #[serde(rename = "blockNumber")]
5950 pub block_number: CreateSwapQuoteResponseBlockNumber,
5951 pub fees: CreateSwapQuoteResponseFees,
5952 #[serde(rename = "fromAmount")]
5954 pub from_amount: CreateSwapQuoteResponseFromAmount,
5955 #[serde(rename = "fromToken")]
5957 pub from_token: CreateSwapQuoteResponseFromToken,
5958 pub issues: CreateSwapQuoteResponseIssues,
5959 #[serde(rename = "liquidityAvailable")]
5961 pub liquidity_available: bool,
5962 #[serde(rename = "minToAmount")]
5964 pub min_to_amount: CreateSwapQuoteResponseMinToAmount,
5965 pub permit2: ::std::option::Option<CreateSwapQuoteResponsePermit2>,
5967 #[serde(rename = "toAmount")]
5969 pub to_amount: CreateSwapQuoteResponseToAmount,
5970 #[serde(rename = "toToken")]
5972 pub to_token: CreateSwapQuoteResponseToToken,
5973 pub transaction: CreateSwapQuoteResponseTransaction,
5974 }
5975 impl ::std::convert::From<&CreateSwapQuoteResponse> for CreateSwapQuoteResponse {
5976 fn from(value: &CreateSwapQuoteResponse) -> Self {
5977 value.clone()
5978 }
5979 }
5980 impl CreateSwapQuoteResponse {
5981 pub fn builder() -> builder::CreateSwapQuoteResponse {
5982 Default::default()
5983 }
5984 }
5985 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6001 #[serde(transparent)]
6002 pub struct CreateSwapQuoteResponseBlockNumber(::std::string::String);
6003 impl ::std::ops::Deref for CreateSwapQuoteResponseBlockNumber {
6004 type Target = ::std::string::String;
6005 fn deref(&self) -> &::std::string::String {
6006 &self.0
6007 }
6008 }
6009 impl ::std::convert::From<CreateSwapQuoteResponseBlockNumber> for ::std::string::String {
6010 fn from(value: CreateSwapQuoteResponseBlockNumber) -> Self {
6011 value.0
6012 }
6013 }
6014 impl ::std::convert::From<&CreateSwapQuoteResponseBlockNumber>
6015 for CreateSwapQuoteResponseBlockNumber
6016 {
6017 fn from(value: &CreateSwapQuoteResponseBlockNumber) -> Self {
6018 value.clone()
6019 }
6020 }
6021 impl ::std::str::FromStr for CreateSwapQuoteResponseBlockNumber {
6022 type Err = self::error::ConversionError;
6023 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6024 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
6025 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[1-9]\\d*$").unwrap());
6026 if PATTERN.find(value).is_none() {
6027 return Err("doesn't match pattern \"^[1-9]\\d*$\"".into());
6028 }
6029 Ok(Self(value.to_string()))
6030 }
6031 }
6032 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseBlockNumber {
6033 type Error = self::error::ConversionError;
6034 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6035 value.parse()
6036 }
6037 }
6038 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseBlockNumber {
6039 type Error = self::error::ConversionError;
6040 fn try_from(
6041 value: &::std::string::String,
6042 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6043 value.parse()
6044 }
6045 }
6046 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseBlockNumber {
6047 type Error = self::error::ConversionError;
6048 fn try_from(
6049 value: ::std::string::String,
6050 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6051 value.parse()
6052 }
6053 }
6054 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseBlockNumber {
6055 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
6056 where
6057 D: ::serde::Deserializer<'de>,
6058 {
6059 ::std::string::String::deserialize(deserializer)?
6060 .parse()
6061 .map_err(|e: self::error::ConversionError| {
6062 <D::Error as ::serde::de::Error>::custom(e.to_string())
6063 })
6064 }
6065 }
6066 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6120 pub struct CreateSwapQuoteResponseFees {
6121 #[serde(rename = "gasFee")]
6123 pub gas_fee: ::std::option::Option<TokenFee>,
6124 #[serde(rename = "protocolFee")]
6126 pub protocol_fee: ::std::option::Option<TokenFee>,
6127 }
6128 impl ::std::convert::From<&CreateSwapQuoteResponseFees> for CreateSwapQuoteResponseFees {
6129 fn from(value: &CreateSwapQuoteResponseFees) -> Self {
6130 value.clone()
6131 }
6132 }
6133 impl CreateSwapQuoteResponseFees {
6134 pub fn builder() -> builder::CreateSwapQuoteResponseFees {
6135 Default::default()
6136 }
6137 }
6138 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6154 #[serde(transparent)]
6155 pub struct CreateSwapQuoteResponseFromAmount(::std::string::String);
6156 impl ::std::ops::Deref for CreateSwapQuoteResponseFromAmount {
6157 type Target = ::std::string::String;
6158 fn deref(&self) -> &::std::string::String {
6159 &self.0
6160 }
6161 }
6162 impl ::std::convert::From<CreateSwapQuoteResponseFromAmount> for ::std::string::String {
6163 fn from(value: CreateSwapQuoteResponseFromAmount) -> Self {
6164 value.0
6165 }
6166 }
6167 impl ::std::convert::From<&CreateSwapQuoteResponseFromAmount>
6168 for CreateSwapQuoteResponseFromAmount
6169 {
6170 fn from(value: &CreateSwapQuoteResponseFromAmount) -> Self {
6171 value.clone()
6172 }
6173 }
6174 impl ::std::str::FromStr for CreateSwapQuoteResponseFromAmount {
6175 type Err = self::error::ConversionError;
6176 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6177 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
6178 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
6179 if PATTERN.find(value).is_none() {
6180 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
6181 }
6182 Ok(Self(value.to_string()))
6183 }
6184 }
6185 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseFromAmount {
6186 type Error = self::error::ConversionError;
6187 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6188 value.parse()
6189 }
6190 }
6191 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseFromAmount {
6192 type Error = self::error::ConversionError;
6193 fn try_from(
6194 value: &::std::string::String,
6195 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6196 value.parse()
6197 }
6198 }
6199 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseFromAmount {
6200 type Error = self::error::ConversionError;
6201 fn try_from(
6202 value: ::std::string::String,
6203 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6204 value.parse()
6205 }
6206 }
6207 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseFromAmount {
6208 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
6209 where
6210 D: ::serde::Deserializer<'de>,
6211 {
6212 ::std::string::String::deserialize(deserializer)?
6213 .parse()
6214 .map_err(|e: self::error::ConversionError| {
6215 <D::Error as ::serde::de::Error>::custom(e.to_string())
6216 })
6217 }
6218 }
6219 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6235 #[serde(transparent)]
6236 pub struct CreateSwapQuoteResponseFromToken(::std::string::String);
6237 impl ::std::ops::Deref for CreateSwapQuoteResponseFromToken {
6238 type Target = ::std::string::String;
6239 fn deref(&self) -> &::std::string::String {
6240 &self.0
6241 }
6242 }
6243 impl ::std::convert::From<CreateSwapQuoteResponseFromToken> for ::std::string::String {
6244 fn from(value: CreateSwapQuoteResponseFromToken) -> Self {
6245 value.0
6246 }
6247 }
6248 impl ::std::convert::From<&CreateSwapQuoteResponseFromToken> for CreateSwapQuoteResponseFromToken {
6249 fn from(value: &CreateSwapQuoteResponseFromToken) -> Self {
6250 value.clone()
6251 }
6252 }
6253 impl ::std::str::FromStr for CreateSwapQuoteResponseFromToken {
6254 type Err = self::error::ConversionError;
6255 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6256 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
6257 ::std::sync::LazyLock::new(|| {
6258 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
6259 });
6260 if PATTERN.find(value).is_none() {
6261 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
6262 }
6263 Ok(Self(value.to_string()))
6264 }
6265 }
6266 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseFromToken {
6267 type Error = self::error::ConversionError;
6268 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6269 value.parse()
6270 }
6271 }
6272 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseFromToken {
6273 type Error = self::error::ConversionError;
6274 fn try_from(
6275 value: &::std::string::String,
6276 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6277 value.parse()
6278 }
6279 }
6280 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseFromToken {
6281 type Error = self::error::ConversionError;
6282 fn try_from(
6283 value: ::std::string::String,
6284 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6285 value.parse()
6286 }
6287 }
6288 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseFromToken {
6289 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
6290 where
6291 D: ::serde::Deserializer<'de>,
6292 {
6293 ::std::string::String::deserialize(deserializer)?
6294 .parse()
6295 .map_err(|e: self::error::ConversionError| {
6296 <D::Error as ::serde::de::Error>::custom(e.to_string())
6297 })
6298 }
6299 }
6300 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6417 pub struct CreateSwapQuoteResponseIssues {
6418 pub allowance: ::std::option::Option<CreateSwapQuoteResponseIssuesAllowance>,
6420 pub balance: ::std::option::Option<CreateSwapQuoteResponseIssuesBalance>,
6422 #[serde(rename = "simulationIncomplete")]
6424 pub simulation_incomplete: bool,
6425 }
6426 impl ::std::convert::From<&CreateSwapQuoteResponseIssues> for CreateSwapQuoteResponseIssues {
6427 fn from(value: &CreateSwapQuoteResponseIssues) -> Self {
6428 value.clone()
6429 }
6430 }
6431 impl CreateSwapQuoteResponseIssues {
6432 pub fn builder() -> builder::CreateSwapQuoteResponseIssues {
6433 Default::default()
6434 }
6435 }
6436 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6476 pub struct CreateSwapQuoteResponseIssuesAllowance {
6477 #[serde(rename = "currentAllowance")]
6479 pub current_allowance: CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance,
6480 pub spender: CreateSwapQuoteResponseIssuesAllowanceSpender,
6482 }
6483 impl ::std::convert::From<&CreateSwapQuoteResponseIssuesAllowance>
6484 for CreateSwapQuoteResponseIssuesAllowance
6485 {
6486 fn from(value: &CreateSwapQuoteResponseIssuesAllowance) -> Self {
6487 value.clone()
6488 }
6489 }
6490 impl CreateSwapQuoteResponseIssuesAllowance {
6491 pub fn builder() -> builder::CreateSwapQuoteResponseIssuesAllowance {
6492 Default::default()
6493 }
6494 }
6495 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6511 #[serde(transparent)]
6512 pub struct CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance(::std::string::String);
6513 impl ::std::ops::Deref for CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance {
6514 type Target = ::std::string::String;
6515 fn deref(&self) -> &::std::string::String {
6516 &self.0
6517 }
6518 }
6519 impl ::std::convert::From<CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance>
6520 for ::std::string::String
6521 {
6522 fn from(value: CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance) -> Self {
6523 value.0
6524 }
6525 }
6526 impl ::std::convert::From<&CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance>
6527 for CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance
6528 {
6529 fn from(value: &CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance) -> Self {
6530 value.clone()
6531 }
6532 }
6533 impl ::std::str::FromStr for CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance {
6534 type Err = self::error::ConversionError;
6535 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6536 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
6537 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
6538 if PATTERN.find(value).is_none() {
6539 return Err("doesn't match pattern \"^\\d+$\"".into());
6540 }
6541 Ok(Self(value.to_string()))
6542 }
6543 }
6544 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance {
6545 type Error = self::error::ConversionError;
6546 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6547 value.parse()
6548 }
6549 }
6550 impl ::std::convert::TryFrom<&::std::string::String>
6551 for CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance
6552 {
6553 type Error = self::error::ConversionError;
6554 fn try_from(
6555 value: &::std::string::String,
6556 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6557 value.parse()
6558 }
6559 }
6560 impl ::std::convert::TryFrom<::std::string::String>
6561 for CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance
6562 {
6563 type Error = self::error::ConversionError;
6564 fn try_from(
6565 value: ::std::string::String,
6566 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6567 value.parse()
6568 }
6569 }
6570 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance {
6571 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
6572 where
6573 D: ::serde::Deserializer<'de>,
6574 {
6575 ::std::string::String::deserialize(deserializer)?
6576 .parse()
6577 .map_err(|e: self::error::ConversionError| {
6578 <D::Error as ::serde::de::Error>::custom(e.to_string())
6579 })
6580 }
6581 }
6582 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6598 #[serde(transparent)]
6599 pub struct CreateSwapQuoteResponseIssuesAllowanceSpender(::std::string::String);
6600 impl ::std::ops::Deref for CreateSwapQuoteResponseIssuesAllowanceSpender {
6601 type Target = ::std::string::String;
6602 fn deref(&self) -> &::std::string::String {
6603 &self.0
6604 }
6605 }
6606 impl ::std::convert::From<CreateSwapQuoteResponseIssuesAllowanceSpender> for ::std::string::String {
6607 fn from(value: CreateSwapQuoteResponseIssuesAllowanceSpender) -> Self {
6608 value.0
6609 }
6610 }
6611 impl ::std::convert::From<&CreateSwapQuoteResponseIssuesAllowanceSpender>
6612 for CreateSwapQuoteResponseIssuesAllowanceSpender
6613 {
6614 fn from(value: &CreateSwapQuoteResponseIssuesAllowanceSpender) -> Self {
6615 value.clone()
6616 }
6617 }
6618 impl ::std::str::FromStr for CreateSwapQuoteResponseIssuesAllowanceSpender {
6619 type Err = self::error::ConversionError;
6620 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6621 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
6622 ::std::sync::LazyLock::new(|| {
6623 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
6624 });
6625 if PATTERN.find(value).is_none() {
6626 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
6627 }
6628 Ok(Self(value.to_string()))
6629 }
6630 }
6631 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseIssuesAllowanceSpender {
6632 type Error = self::error::ConversionError;
6633 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6634 value.parse()
6635 }
6636 }
6637 impl ::std::convert::TryFrom<&::std::string::String>
6638 for CreateSwapQuoteResponseIssuesAllowanceSpender
6639 {
6640 type Error = self::error::ConversionError;
6641 fn try_from(
6642 value: &::std::string::String,
6643 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6644 value.parse()
6645 }
6646 }
6647 impl ::std::convert::TryFrom<::std::string::String>
6648 for CreateSwapQuoteResponseIssuesAllowanceSpender
6649 {
6650 type Error = self::error::ConversionError;
6651 fn try_from(
6652 value: ::std::string::String,
6653 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6654 value.parse()
6655 }
6656 }
6657 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseIssuesAllowanceSpender {
6658 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
6659 where
6660 D: ::serde::Deserializer<'de>,
6661 {
6662 ::std::string::String::deserialize(deserializer)?
6663 .parse()
6664 .map_err(|e: self::error::ConversionError| {
6665 <D::Error as ::serde::de::Error>::custom(e.to_string())
6666 })
6667 }
6668 }
6669 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6716 pub struct CreateSwapQuoteResponseIssuesBalance {
6717 #[serde(rename = "currentBalance")]
6719 pub current_balance: CreateSwapQuoteResponseIssuesBalanceCurrentBalance,
6720 #[serde(rename = "requiredBalance")]
6722 pub required_balance: CreateSwapQuoteResponseIssuesBalanceRequiredBalance,
6723 pub token: CreateSwapQuoteResponseIssuesBalanceToken,
6725 }
6726 impl ::std::convert::From<&CreateSwapQuoteResponseIssuesBalance>
6727 for CreateSwapQuoteResponseIssuesBalance
6728 {
6729 fn from(value: &CreateSwapQuoteResponseIssuesBalance) -> Self {
6730 value.clone()
6731 }
6732 }
6733 impl CreateSwapQuoteResponseIssuesBalance {
6734 pub fn builder() -> builder::CreateSwapQuoteResponseIssuesBalance {
6735 Default::default()
6736 }
6737 }
6738 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6754 #[serde(transparent)]
6755 pub struct CreateSwapQuoteResponseIssuesBalanceCurrentBalance(::std::string::String);
6756 impl ::std::ops::Deref for CreateSwapQuoteResponseIssuesBalanceCurrentBalance {
6757 type Target = ::std::string::String;
6758 fn deref(&self) -> &::std::string::String {
6759 &self.0
6760 }
6761 }
6762 impl ::std::convert::From<CreateSwapQuoteResponseIssuesBalanceCurrentBalance>
6763 for ::std::string::String
6764 {
6765 fn from(value: CreateSwapQuoteResponseIssuesBalanceCurrentBalance) -> Self {
6766 value.0
6767 }
6768 }
6769 impl ::std::convert::From<&CreateSwapQuoteResponseIssuesBalanceCurrentBalance>
6770 for CreateSwapQuoteResponseIssuesBalanceCurrentBalance
6771 {
6772 fn from(value: &CreateSwapQuoteResponseIssuesBalanceCurrentBalance) -> Self {
6773 value.clone()
6774 }
6775 }
6776 impl ::std::str::FromStr for CreateSwapQuoteResponseIssuesBalanceCurrentBalance {
6777 type Err = self::error::ConversionError;
6778 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6779 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
6780 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
6781 if PATTERN.find(value).is_none() {
6782 return Err("doesn't match pattern \"^\\d+$\"".into());
6783 }
6784 Ok(Self(value.to_string()))
6785 }
6786 }
6787 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseIssuesBalanceCurrentBalance {
6788 type Error = self::error::ConversionError;
6789 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6790 value.parse()
6791 }
6792 }
6793 impl ::std::convert::TryFrom<&::std::string::String>
6794 for CreateSwapQuoteResponseIssuesBalanceCurrentBalance
6795 {
6796 type Error = self::error::ConversionError;
6797 fn try_from(
6798 value: &::std::string::String,
6799 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6800 value.parse()
6801 }
6802 }
6803 impl ::std::convert::TryFrom<::std::string::String>
6804 for CreateSwapQuoteResponseIssuesBalanceCurrentBalance
6805 {
6806 type Error = self::error::ConversionError;
6807 fn try_from(
6808 value: ::std::string::String,
6809 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6810 value.parse()
6811 }
6812 }
6813 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseIssuesBalanceCurrentBalance {
6814 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
6815 where
6816 D: ::serde::Deserializer<'de>,
6817 {
6818 ::std::string::String::deserialize(deserializer)?
6819 .parse()
6820 .map_err(|e: self::error::ConversionError| {
6821 <D::Error as ::serde::de::Error>::custom(e.to_string())
6822 })
6823 }
6824 }
6825 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6841 #[serde(transparent)]
6842 pub struct CreateSwapQuoteResponseIssuesBalanceRequiredBalance(::std::string::String);
6843 impl ::std::ops::Deref for CreateSwapQuoteResponseIssuesBalanceRequiredBalance {
6844 type Target = ::std::string::String;
6845 fn deref(&self) -> &::std::string::String {
6846 &self.0
6847 }
6848 }
6849 impl ::std::convert::From<CreateSwapQuoteResponseIssuesBalanceRequiredBalance>
6850 for ::std::string::String
6851 {
6852 fn from(value: CreateSwapQuoteResponseIssuesBalanceRequiredBalance) -> Self {
6853 value.0
6854 }
6855 }
6856 impl ::std::convert::From<&CreateSwapQuoteResponseIssuesBalanceRequiredBalance>
6857 for CreateSwapQuoteResponseIssuesBalanceRequiredBalance
6858 {
6859 fn from(value: &CreateSwapQuoteResponseIssuesBalanceRequiredBalance) -> Self {
6860 value.clone()
6861 }
6862 }
6863 impl ::std::str::FromStr for CreateSwapQuoteResponseIssuesBalanceRequiredBalance {
6864 type Err = self::error::ConversionError;
6865 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6866 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
6867 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
6868 if PATTERN.find(value).is_none() {
6869 return Err("doesn't match pattern \"^\\d+$\"".into());
6870 }
6871 Ok(Self(value.to_string()))
6872 }
6873 }
6874 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseIssuesBalanceRequiredBalance {
6875 type Error = self::error::ConversionError;
6876 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6877 value.parse()
6878 }
6879 }
6880 impl ::std::convert::TryFrom<&::std::string::String>
6881 for CreateSwapQuoteResponseIssuesBalanceRequiredBalance
6882 {
6883 type Error = self::error::ConversionError;
6884 fn try_from(
6885 value: &::std::string::String,
6886 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6887 value.parse()
6888 }
6889 }
6890 impl ::std::convert::TryFrom<::std::string::String>
6891 for CreateSwapQuoteResponseIssuesBalanceRequiredBalance
6892 {
6893 type Error = self::error::ConversionError;
6894 fn try_from(
6895 value: ::std::string::String,
6896 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6897 value.parse()
6898 }
6899 }
6900 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseIssuesBalanceRequiredBalance {
6901 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
6902 where
6903 D: ::serde::Deserializer<'de>,
6904 {
6905 ::std::string::String::deserialize(deserializer)?
6906 .parse()
6907 .map_err(|e: self::error::ConversionError| {
6908 <D::Error as ::serde::de::Error>::custom(e.to_string())
6909 })
6910 }
6911 }
6912 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6925 #[serde(transparent)]
6926 pub struct CreateSwapQuoteResponseIssuesBalanceToken(::std::string::String);
6927 impl ::std::ops::Deref for CreateSwapQuoteResponseIssuesBalanceToken {
6928 type Target = ::std::string::String;
6929 fn deref(&self) -> &::std::string::String {
6930 &self.0
6931 }
6932 }
6933 impl ::std::convert::From<CreateSwapQuoteResponseIssuesBalanceToken> for ::std::string::String {
6934 fn from(value: CreateSwapQuoteResponseIssuesBalanceToken) -> Self {
6935 value.0
6936 }
6937 }
6938 impl ::std::convert::From<&CreateSwapQuoteResponseIssuesBalanceToken>
6939 for CreateSwapQuoteResponseIssuesBalanceToken
6940 {
6941 fn from(value: &CreateSwapQuoteResponseIssuesBalanceToken) -> Self {
6942 value.clone()
6943 }
6944 }
6945 impl ::std::str::FromStr for CreateSwapQuoteResponseIssuesBalanceToken {
6946 type Err = self::error::ConversionError;
6947 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6948 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
6949 ::std::sync::LazyLock::new(|| {
6950 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
6951 });
6952 if PATTERN.find(value).is_none() {
6953 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
6954 }
6955 Ok(Self(value.to_string()))
6956 }
6957 }
6958 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseIssuesBalanceToken {
6959 type Error = self::error::ConversionError;
6960 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6961 value.parse()
6962 }
6963 }
6964 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseIssuesBalanceToken {
6965 type Error = self::error::ConversionError;
6966 fn try_from(
6967 value: &::std::string::String,
6968 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6969 value.parse()
6970 }
6971 }
6972 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseIssuesBalanceToken {
6973 type Error = self::error::ConversionError;
6974 fn try_from(
6975 value: ::std::string::String,
6976 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6977 value.parse()
6978 }
6979 }
6980 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseIssuesBalanceToken {
6981 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
6982 where
6983 D: ::serde::Deserializer<'de>,
6984 {
6985 ::std::string::String::deserialize(deserializer)?
6986 .parse()
6987 .map_err(|e: self::error::ConversionError| {
6988 <D::Error as ::serde::de::Error>::custom(e.to_string())
6989 })
6990 }
6991 }
6992 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7008 #[serde(transparent)]
7009 pub struct CreateSwapQuoteResponseMinToAmount(::std::string::String);
7010 impl ::std::ops::Deref for CreateSwapQuoteResponseMinToAmount {
7011 type Target = ::std::string::String;
7012 fn deref(&self) -> &::std::string::String {
7013 &self.0
7014 }
7015 }
7016 impl ::std::convert::From<CreateSwapQuoteResponseMinToAmount> for ::std::string::String {
7017 fn from(value: CreateSwapQuoteResponseMinToAmount) -> Self {
7018 value.0
7019 }
7020 }
7021 impl ::std::convert::From<&CreateSwapQuoteResponseMinToAmount>
7022 for CreateSwapQuoteResponseMinToAmount
7023 {
7024 fn from(value: &CreateSwapQuoteResponseMinToAmount) -> Self {
7025 value.clone()
7026 }
7027 }
7028 impl ::std::str::FromStr for CreateSwapQuoteResponseMinToAmount {
7029 type Err = self::error::ConversionError;
7030 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7031 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7032 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
7033 if PATTERN.find(value).is_none() {
7034 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
7035 }
7036 Ok(Self(value.to_string()))
7037 }
7038 }
7039 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseMinToAmount {
7040 type Error = self::error::ConversionError;
7041 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7042 value.parse()
7043 }
7044 }
7045 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseMinToAmount {
7046 type Error = self::error::ConversionError;
7047 fn try_from(
7048 value: &::std::string::String,
7049 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7050 value.parse()
7051 }
7052 }
7053 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseMinToAmount {
7054 type Error = self::error::ConversionError;
7055 fn try_from(
7056 value: ::std::string::String,
7057 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7058 value.parse()
7059 }
7060 }
7061 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseMinToAmount {
7062 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7063 where
7064 D: ::serde::Deserializer<'de>,
7065 {
7066 ::std::string::String::deserialize(deserializer)?
7067 .parse()
7068 .map_err(|e: self::error::ConversionError| {
7069 <D::Error as ::serde::de::Error>::custom(e.to_string())
7070 })
7071 }
7072 }
7073 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7102 pub struct CreateSwapQuoteResponsePermit2 {
7103 pub eip712: Eip712Message,
7104 pub hash: CreateSwapQuoteResponsePermit2Hash,
7106 }
7107 impl ::std::convert::From<&CreateSwapQuoteResponsePermit2> for CreateSwapQuoteResponsePermit2 {
7108 fn from(value: &CreateSwapQuoteResponsePermit2) -> Self {
7109 value.clone()
7110 }
7111 }
7112 impl CreateSwapQuoteResponsePermit2 {
7113 pub fn builder() -> builder::CreateSwapQuoteResponsePermit2 {
7114 Default::default()
7115 }
7116 }
7117 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7133 #[serde(transparent)]
7134 pub struct CreateSwapQuoteResponsePermit2Hash(::std::string::String);
7135 impl ::std::ops::Deref for CreateSwapQuoteResponsePermit2Hash {
7136 type Target = ::std::string::String;
7137 fn deref(&self) -> &::std::string::String {
7138 &self.0
7139 }
7140 }
7141 impl ::std::convert::From<CreateSwapQuoteResponsePermit2Hash> for ::std::string::String {
7142 fn from(value: CreateSwapQuoteResponsePermit2Hash) -> Self {
7143 value.0
7144 }
7145 }
7146 impl ::std::convert::From<&CreateSwapQuoteResponsePermit2Hash>
7147 for CreateSwapQuoteResponsePermit2Hash
7148 {
7149 fn from(value: &CreateSwapQuoteResponsePermit2Hash) -> Self {
7150 value.clone()
7151 }
7152 }
7153 impl ::std::str::FromStr for CreateSwapQuoteResponsePermit2Hash {
7154 type Err = self::error::ConversionError;
7155 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7156 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7157 ::std::sync::LazyLock::new(|| {
7158 ::regress::Regex::new("^0x[a-fA-F0-9]{64}$").unwrap()
7159 });
7160 if PATTERN.find(value).is_none() {
7161 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{64}$\"".into());
7162 }
7163 Ok(Self(value.to_string()))
7164 }
7165 }
7166 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponsePermit2Hash {
7167 type Error = self::error::ConversionError;
7168 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7169 value.parse()
7170 }
7171 }
7172 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponsePermit2Hash {
7173 type Error = self::error::ConversionError;
7174 fn try_from(
7175 value: &::std::string::String,
7176 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7177 value.parse()
7178 }
7179 }
7180 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponsePermit2Hash {
7181 type Error = self::error::ConversionError;
7182 fn try_from(
7183 value: ::std::string::String,
7184 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7185 value.parse()
7186 }
7187 }
7188 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponsePermit2Hash {
7189 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7190 where
7191 D: ::serde::Deserializer<'de>,
7192 {
7193 ::std::string::String::deserialize(deserializer)?
7194 .parse()
7195 .map_err(|e: self::error::ConversionError| {
7196 <D::Error as ::serde::de::Error>::custom(e.to_string())
7197 })
7198 }
7199 }
7200 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7216 #[serde(transparent)]
7217 pub struct CreateSwapQuoteResponseToAmount(::std::string::String);
7218 impl ::std::ops::Deref for CreateSwapQuoteResponseToAmount {
7219 type Target = ::std::string::String;
7220 fn deref(&self) -> &::std::string::String {
7221 &self.0
7222 }
7223 }
7224 impl ::std::convert::From<CreateSwapQuoteResponseToAmount> for ::std::string::String {
7225 fn from(value: CreateSwapQuoteResponseToAmount) -> Self {
7226 value.0
7227 }
7228 }
7229 impl ::std::convert::From<&CreateSwapQuoteResponseToAmount> for CreateSwapQuoteResponseToAmount {
7230 fn from(value: &CreateSwapQuoteResponseToAmount) -> Self {
7231 value.clone()
7232 }
7233 }
7234 impl ::std::str::FromStr for CreateSwapQuoteResponseToAmount {
7235 type Err = self::error::ConversionError;
7236 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7237 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7238 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
7239 if PATTERN.find(value).is_none() {
7240 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
7241 }
7242 Ok(Self(value.to_string()))
7243 }
7244 }
7245 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseToAmount {
7246 type Error = self::error::ConversionError;
7247 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7248 value.parse()
7249 }
7250 }
7251 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseToAmount {
7252 type Error = self::error::ConversionError;
7253 fn try_from(
7254 value: &::std::string::String,
7255 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7256 value.parse()
7257 }
7258 }
7259 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseToAmount {
7260 type Error = self::error::ConversionError;
7261 fn try_from(
7262 value: ::std::string::String,
7263 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7264 value.parse()
7265 }
7266 }
7267 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseToAmount {
7268 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7269 where
7270 D: ::serde::Deserializer<'de>,
7271 {
7272 ::std::string::String::deserialize(deserializer)?
7273 .parse()
7274 .map_err(|e: self::error::ConversionError| {
7275 <D::Error as ::serde::de::Error>::custom(e.to_string())
7276 })
7277 }
7278 }
7279 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7295 #[serde(transparent)]
7296 pub struct CreateSwapQuoteResponseToToken(::std::string::String);
7297 impl ::std::ops::Deref for CreateSwapQuoteResponseToToken {
7298 type Target = ::std::string::String;
7299 fn deref(&self) -> &::std::string::String {
7300 &self.0
7301 }
7302 }
7303 impl ::std::convert::From<CreateSwapQuoteResponseToToken> for ::std::string::String {
7304 fn from(value: CreateSwapQuoteResponseToToken) -> Self {
7305 value.0
7306 }
7307 }
7308 impl ::std::convert::From<&CreateSwapQuoteResponseToToken> for CreateSwapQuoteResponseToToken {
7309 fn from(value: &CreateSwapQuoteResponseToToken) -> Self {
7310 value.clone()
7311 }
7312 }
7313 impl ::std::str::FromStr for CreateSwapQuoteResponseToToken {
7314 type Err = self::error::ConversionError;
7315 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7316 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7317 ::std::sync::LazyLock::new(|| {
7318 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
7319 });
7320 if PATTERN.find(value).is_none() {
7321 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
7322 }
7323 Ok(Self(value.to_string()))
7324 }
7325 }
7326 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseToToken {
7327 type Error = self::error::ConversionError;
7328 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7329 value.parse()
7330 }
7331 }
7332 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseToToken {
7333 type Error = self::error::ConversionError;
7334 fn try_from(
7335 value: &::std::string::String,
7336 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7337 value.parse()
7338 }
7339 }
7340 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseToToken {
7341 type Error = self::error::ConversionError;
7342 fn try_from(
7343 value: ::std::string::String,
7344 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7345 value.parse()
7346 }
7347 }
7348 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseToToken {
7349 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7350 where
7351 D: ::serde::Deserializer<'de>,
7352 {
7353 ::std::string::String::deserialize(deserializer)?
7354 .parse()
7355 .map_err(|e: self::error::ConversionError| {
7356 <D::Error as ::serde::de::Error>::custom(e.to_string())
7357 })
7358 }
7359 }
7360 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7420 pub struct CreateSwapQuoteResponseTransaction {
7421 pub data: ::std::string::String,
7423 pub gas: CreateSwapQuoteResponseTransactionGas,
7425 #[serde(rename = "gasPrice")]
7427 pub gas_price: CreateSwapQuoteResponseTransactionGasPrice,
7428 pub to: CreateSwapQuoteResponseTransactionTo,
7430 pub value: CreateSwapQuoteResponseTransactionValue,
7432 }
7433 impl ::std::convert::From<&CreateSwapQuoteResponseTransaction>
7434 for CreateSwapQuoteResponseTransaction
7435 {
7436 fn from(value: &CreateSwapQuoteResponseTransaction) -> Self {
7437 value.clone()
7438 }
7439 }
7440 impl CreateSwapQuoteResponseTransaction {
7441 pub fn builder() -> builder::CreateSwapQuoteResponseTransaction {
7442 Default::default()
7443 }
7444 }
7445 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7461 #[serde(transparent)]
7462 pub struct CreateSwapQuoteResponseTransactionGas(::std::string::String);
7463 impl ::std::ops::Deref for CreateSwapQuoteResponseTransactionGas {
7464 type Target = ::std::string::String;
7465 fn deref(&self) -> &::std::string::String {
7466 &self.0
7467 }
7468 }
7469 impl ::std::convert::From<CreateSwapQuoteResponseTransactionGas> for ::std::string::String {
7470 fn from(value: CreateSwapQuoteResponseTransactionGas) -> Self {
7471 value.0
7472 }
7473 }
7474 impl ::std::convert::From<&CreateSwapQuoteResponseTransactionGas>
7475 for CreateSwapQuoteResponseTransactionGas
7476 {
7477 fn from(value: &CreateSwapQuoteResponseTransactionGas) -> Self {
7478 value.clone()
7479 }
7480 }
7481 impl ::std::str::FromStr for CreateSwapQuoteResponseTransactionGas {
7482 type Err = self::error::ConversionError;
7483 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7484 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7485 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
7486 if PATTERN.find(value).is_none() {
7487 return Err("doesn't match pattern \"^\\d+$\"".into());
7488 }
7489 Ok(Self(value.to_string()))
7490 }
7491 }
7492 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseTransactionGas {
7493 type Error = self::error::ConversionError;
7494 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7495 value.parse()
7496 }
7497 }
7498 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseTransactionGas {
7499 type Error = self::error::ConversionError;
7500 fn try_from(
7501 value: &::std::string::String,
7502 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7503 value.parse()
7504 }
7505 }
7506 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseTransactionGas {
7507 type Error = self::error::ConversionError;
7508 fn try_from(
7509 value: ::std::string::String,
7510 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7511 value.parse()
7512 }
7513 }
7514 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseTransactionGas {
7515 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7516 where
7517 D: ::serde::Deserializer<'de>,
7518 {
7519 ::std::string::String::deserialize(deserializer)?
7520 .parse()
7521 .map_err(|e: self::error::ConversionError| {
7522 <D::Error as ::serde::de::Error>::custom(e.to_string())
7523 })
7524 }
7525 }
7526 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7542 #[serde(transparent)]
7543 pub struct CreateSwapQuoteResponseTransactionGasPrice(::std::string::String);
7544 impl ::std::ops::Deref for CreateSwapQuoteResponseTransactionGasPrice {
7545 type Target = ::std::string::String;
7546 fn deref(&self) -> &::std::string::String {
7547 &self.0
7548 }
7549 }
7550 impl ::std::convert::From<CreateSwapQuoteResponseTransactionGasPrice> for ::std::string::String {
7551 fn from(value: CreateSwapQuoteResponseTransactionGasPrice) -> Self {
7552 value.0
7553 }
7554 }
7555 impl ::std::convert::From<&CreateSwapQuoteResponseTransactionGasPrice>
7556 for CreateSwapQuoteResponseTransactionGasPrice
7557 {
7558 fn from(value: &CreateSwapQuoteResponseTransactionGasPrice) -> Self {
7559 value.clone()
7560 }
7561 }
7562 impl ::std::str::FromStr for CreateSwapQuoteResponseTransactionGasPrice {
7563 type Err = self::error::ConversionError;
7564 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7565 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7566 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
7567 if PATTERN.find(value).is_none() {
7568 return Err("doesn't match pattern \"^\\d+$\"".into());
7569 }
7570 Ok(Self(value.to_string()))
7571 }
7572 }
7573 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseTransactionGasPrice {
7574 type Error = self::error::ConversionError;
7575 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7576 value.parse()
7577 }
7578 }
7579 impl ::std::convert::TryFrom<&::std::string::String>
7580 for CreateSwapQuoteResponseTransactionGasPrice
7581 {
7582 type Error = self::error::ConversionError;
7583 fn try_from(
7584 value: &::std::string::String,
7585 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7586 value.parse()
7587 }
7588 }
7589 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseTransactionGasPrice {
7590 type Error = self::error::ConversionError;
7591 fn try_from(
7592 value: ::std::string::String,
7593 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7594 value.parse()
7595 }
7596 }
7597 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseTransactionGasPrice {
7598 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7599 where
7600 D: ::serde::Deserializer<'de>,
7601 {
7602 ::std::string::String::deserialize(deserializer)?
7603 .parse()
7604 .map_err(|e: self::error::ConversionError| {
7605 <D::Error as ::serde::de::Error>::custom(e.to_string())
7606 })
7607 }
7608 }
7609 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7625 #[serde(transparent)]
7626 pub struct CreateSwapQuoteResponseTransactionTo(::std::string::String);
7627 impl ::std::ops::Deref for CreateSwapQuoteResponseTransactionTo {
7628 type Target = ::std::string::String;
7629 fn deref(&self) -> &::std::string::String {
7630 &self.0
7631 }
7632 }
7633 impl ::std::convert::From<CreateSwapQuoteResponseTransactionTo> for ::std::string::String {
7634 fn from(value: CreateSwapQuoteResponseTransactionTo) -> Self {
7635 value.0
7636 }
7637 }
7638 impl ::std::convert::From<&CreateSwapQuoteResponseTransactionTo>
7639 for CreateSwapQuoteResponseTransactionTo
7640 {
7641 fn from(value: &CreateSwapQuoteResponseTransactionTo) -> Self {
7642 value.clone()
7643 }
7644 }
7645 impl ::std::str::FromStr for CreateSwapQuoteResponseTransactionTo {
7646 type Err = self::error::ConversionError;
7647 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7648 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7649 ::std::sync::LazyLock::new(|| {
7650 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
7651 });
7652 if PATTERN.find(value).is_none() {
7653 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
7654 }
7655 Ok(Self(value.to_string()))
7656 }
7657 }
7658 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseTransactionTo {
7659 type Error = self::error::ConversionError;
7660 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7661 value.parse()
7662 }
7663 }
7664 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseTransactionTo {
7665 type Error = self::error::ConversionError;
7666 fn try_from(
7667 value: &::std::string::String,
7668 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7669 value.parse()
7670 }
7671 }
7672 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseTransactionTo {
7673 type Error = self::error::ConversionError;
7674 fn try_from(
7675 value: ::std::string::String,
7676 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7677 value.parse()
7678 }
7679 }
7680 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseTransactionTo {
7681 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7682 where
7683 D: ::serde::Deserializer<'de>,
7684 {
7685 ::std::string::String::deserialize(deserializer)?
7686 .parse()
7687 .map_err(|e: self::error::ConversionError| {
7688 <D::Error as ::serde::de::Error>::custom(e.to_string())
7689 })
7690 }
7691 }
7692 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7708 #[serde(transparent)]
7709 pub struct CreateSwapQuoteResponseTransactionValue(::std::string::String);
7710 impl ::std::ops::Deref for CreateSwapQuoteResponseTransactionValue {
7711 type Target = ::std::string::String;
7712 fn deref(&self) -> &::std::string::String {
7713 &self.0
7714 }
7715 }
7716 impl ::std::convert::From<CreateSwapQuoteResponseTransactionValue> for ::std::string::String {
7717 fn from(value: CreateSwapQuoteResponseTransactionValue) -> Self {
7718 value.0
7719 }
7720 }
7721 impl ::std::convert::From<&CreateSwapQuoteResponseTransactionValue>
7722 for CreateSwapQuoteResponseTransactionValue
7723 {
7724 fn from(value: &CreateSwapQuoteResponseTransactionValue) -> Self {
7725 value.clone()
7726 }
7727 }
7728 impl ::std::str::FromStr for CreateSwapQuoteResponseTransactionValue {
7729 type Err = self::error::ConversionError;
7730 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7731 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7732 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
7733 if PATTERN.find(value).is_none() {
7734 return Err("doesn't match pattern \"^\\d+$\"".into());
7735 }
7736 Ok(Self(value.to_string()))
7737 }
7738 }
7739 impl ::std::convert::TryFrom<&str> for CreateSwapQuoteResponseTransactionValue {
7740 type Error = self::error::ConversionError;
7741 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7742 value.parse()
7743 }
7744 }
7745 impl ::std::convert::TryFrom<&::std::string::String> for CreateSwapQuoteResponseTransactionValue {
7746 type Error = self::error::ConversionError;
7747 fn try_from(
7748 value: &::std::string::String,
7749 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7750 value.parse()
7751 }
7752 }
7753 impl ::std::convert::TryFrom<::std::string::String> for CreateSwapQuoteResponseTransactionValue {
7754 type Error = self::error::ConversionError;
7755 fn try_from(
7756 value: ::std::string::String,
7757 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7758 value.parse()
7759 }
7760 }
7761 impl<'de> ::serde::Deserialize<'de> for CreateSwapQuoteResponseTransactionValue {
7762 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7763 where
7764 D: ::serde::Deserializer<'de>,
7765 {
7766 ::std::string::String::deserialize(deserializer)?
7767 .parse()
7768 .map_err(|e: self::error::ConversionError| {
7769 <D::Error as ::serde::de::Error>::custom(e.to_string())
7770 })
7771 }
7772 }
7773 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7792 #[serde(untagged)]
7793 pub enum CreateSwapQuoteResponseWrapper {
7794 CreateSwapQuoteResponse(CreateSwapQuoteResponse),
7795 SwapUnavailableResponse(SwapUnavailableResponse),
7796 }
7797 impl ::std::convert::From<&Self> for CreateSwapQuoteResponseWrapper {
7798 fn from(value: &CreateSwapQuoteResponseWrapper) -> Self {
7799 value.clone()
7800 }
7801 }
7802 impl ::std::convert::From<CreateSwapQuoteResponse> for CreateSwapQuoteResponseWrapper {
7803 fn from(value: CreateSwapQuoteResponse) -> Self {
7804 Self::CreateSwapQuoteResponse(value)
7805 }
7806 }
7807 impl ::std::convert::From<SwapUnavailableResponse> for CreateSwapQuoteResponseWrapper {
7808 fn from(value: SwapUnavailableResponse) -> Self {
7809 Self::SwapUnavailableResponse(value)
7810 }
7811 }
7812 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7824 #[serde(transparent)]
7825 pub struct DeletePolicyPolicyId(::std::string::String);
7826 impl ::std::ops::Deref for DeletePolicyPolicyId {
7827 type Target = ::std::string::String;
7828 fn deref(&self) -> &::std::string::String {
7829 &self.0
7830 }
7831 }
7832 impl ::std::convert::From<DeletePolicyPolicyId> for ::std::string::String {
7833 fn from(value: DeletePolicyPolicyId) -> Self {
7834 value.0
7835 }
7836 }
7837 impl ::std::convert::From<&DeletePolicyPolicyId> for DeletePolicyPolicyId {
7838 fn from(value: &DeletePolicyPolicyId) -> Self {
7839 value.clone()
7840 }
7841 }
7842 impl ::std::str::FromStr for DeletePolicyPolicyId {
7843 type Err = self::error::ConversionError;
7844 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7845 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
7846 || {
7847 ::regress::Regex::new(
7848 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
7849 )
7850 .unwrap()
7851 },
7852 );
7853 if PATTERN.find(value).is_none() {
7854 return Err(
7855 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
7856 .into(),
7857 );
7858 }
7859 Ok(Self(value.to_string()))
7860 }
7861 }
7862 impl ::std::convert::TryFrom<&str> for DeletePolicyPolicyId {
7863 type Error = self::error::ConversionError;
7864 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7865 value.parse()
7866 }
7867 }
7868 impl ::std::convert::TryFrom<&::std::string::String> for DeletePolicyPolicyId {
7869 type Error = self::error::ConversionError;
7870 fn try_from(
7871 value: &::std::string::String,
7872 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7873 value.parse()
7874 }
7875 }
7876 impl ::std::convert::TryFrom<::std::string::String> for DeletePolicyPolicyId {
7877 type Error = self::error::ConversionError;
7878 fn try_from(
7879 value: ::std::string::String,
7880 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7881 value.parse()
7882 }
7883 }
7884 impl<'de> ::serde::Deserialize<'de> for DeletePolicyPolicyId {
7885 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7886 where
7887 D: ::serde::Deserializer<'de>,
7888 {
7889 ::std::string::String::deserialize(deserializer)?
7890 .parse()
7891 .map_err(|e: self::error::ConversionError| {
7892 <D::Error as ::serde::de::Error>::custom(e.to_string())
7893 })
7894 }
7895 }
7896 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7910 #[serde(transparent)]
7911 pub struct DeletePolicyXIdempotencyKey(::std::string::String);
7912 impl ::std::ops::Deref for DeletePolicyXIdempotencyKey {
7913 type Target = ::std::string::String;
7914 fn deref(&self) -> &::std::string::String {
7915 &self.0
7916 }
7917 }
7918 impl ::std::convert::From<DeletePolicyXIdempotencyKey> for ::std::string::String {
7919 fn from(value: DeletePolicyXIdempotencyKey) -> Self {
7920 value.0
7921 }
7922 }
7923 impl ::std::convert::From<&DeletePolicyXIdempotencyKey> for DeletePolicyXIdempotencyKey {
7924 fn from(value: &DeletePolicyXIdempotencyKey) -> Self {
7925 value.clone()
7926 }
7927 }
7928 impl ::std::str::FromStr for DeletePolicyXIdempotencyKey {
7929 type Err = self::error::ConversionError;
7930 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7931 if value.chars().count() > 36usize {
7932 return Err("longer than 36 characters".into());
7933 }
7934 if value.chars().count() < 36usize {
7935 return Err("shorter than 36 characters".into());
7936 }
7937 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
7938 ::std::sync::LazyLock::new(|| {
7939 ::regress::Regex::new(
7940 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
7941 )
7942 .unwrap()
7943 });
7944 if PATTERN.find(value).is_none() {
7945 return Err(
7946 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
7947 .into(),
7948 );
7949 }
7950 Ok(Self(value.to_string()))
7951 }
7952 }
7953 impl ::std::convert::TryFrom<&str> for DeletePolicyXIdempotencyKey {
7954 type Error = self::error::ConversionError;
7955 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
7956 value.parse()
7957 }
7958 }
7959 impl ::std::convert::TryFrom<&::std::string::String> for DeletePolicyXIdempotencyKey {
7960 type Error = self::error::ConversionError;
7961 fn try_from(
7962 value: &::std::string::String,
7963 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7964 value.parse()
7965 }
7966 }
7967 impl ::std::convert::TryFrom<::std::string::String> for DeletePolicyXIdempotencyKey {
7968 type Error = self::error::ConversionError;
7969 fn try_from(
7970 value: ::std::string::String,
7971 ) -> ::std::result::Result<Self, self::error::ConversionError> {
7972 value.parse()
7973 }
7974 }
7975 impl<'de> ::serde::Deserialize<'de> for DeletePolicyXIdempotencyKey {
7976 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
7977 where
7978 D: ::serde::Deserializer<'de>,
7979 {
7980 ::std::string::String::deserialize(deserializer)?
7981 .parse()
7982 .map_err(|e: self::error::ConversionError| {
7983 <D::Error as ::serde::de::Error>::custom(e.to_string())
7984 })
7985 }
7986 }
7987 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8031 pub struct DeveloperJwtAuthentication {
8032 pub kid: ::std::string::String,
8034 pub sub: ::std::string::String,
8036 #[serde(rename = "type")]
8038 pub type_: DeveloperJwtAuthenticationType,
8039 }
8040 impl ::std::convert::From<&DeveloperJwtAuthentication> for DeveloperJwtAuthentication {
8041 fn from(value: &DeveloperJwtAuthentication) -> Self {
8042 value.clone()
8043 }
8044 }
8045 impl DeveloperJwtAuthentication {
8046 pub fn builder() -> builder::DeveloperJwtAuthentication {
8047 Default::default()
8048 }
8049 }
8050 #[derive(
8068 ::serde::Deserialize,
8069 ::serde::Serialize,
8070 Clone,
8071 Copy,
8072 Debug,
8073 Eq,
8074 Hash,
8075 Ord,
8076 PartialEq,
8077 PartialOrd,
8078 )]
8079 pub enum DeveloperJwtAuthenticationType {
8080 #[serde(rename = "jwt")]
8081 Jwt,
8082 }
8083 impl ::std::convert::From<&Self> for DeveloperJwtAuthenticationType {
8084 fn from(value: &DeveloperJwtAuthenticationType) -> Self {
8085 value.clone()
8086 }
8087 }
8088 impl ::std::fmt::Display for DeveloperJwtAuthenticationType {
8089 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
8090 match *self {
8091 Self::Jwt => f.write_str("jwt"),
8092 }
8093 }
8094 }
8095 impl ::std::str::FromStr for DeveloperJwtAuthenticationType {
8096 type Err = self::error::ConversionError;
8097 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
8098 match value {
8099 "jwt" => Ok(Self::Jwt),
8100 _ => Err("invalid value".into()),
8101 }
8102 }
8103 }
8104 impl ::std::convert::TryFrom<&str> for DeveloperJwtAuthenticationType {
8105 type Error = self::error::ConversionError;
8106 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
8107 value.parse()
8108 }
8109 }
8110 impl ::std::convert::TryFrom<&::std::string::String> for DeveloperJwtAuthenticationType {
8111 type Error = self::error::ConversionError;
8112 fn try_from(
8113 value: &::std::string::String,
8114 ) -> ::std::result::Result<Self, self::error::ConversionError> {
8115 value.parse()
8116 }
8117 }
8118 impl ::std::convert::TryFrom<::std::string::String> for DeveloperJwtAuthenticationType {
8119 type Error = self::error::ConversionError;
8120 fn try_from(
8121 value: ::std::string::String,
8122 ) -> ::std::result::Result<Self, self::error::ConversionError> {
8123 value.parse()
8124 }
8125 }
8126 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8185 pub struct Eip712Domain {
8186 #[serde(
8188 rename = "chainId",
8189 default,
8190 skip_serializing_if = "::std::option::Option::is_none"
8191 )]
8192 pub chain_id: ::std::option::Option<i64>,
8193 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8195 pub name: ::std::option::Option<::std::string::String>,
8196 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8198 pub salt: ::std::option::Option<Eip712DomainSalt>,
8199 #[serde(
8201 rename = "verifyingContract",
8202 default,
8203 skip_serializing_if = "::std::option::Option::is_none"
8204 )]
8205 pub verifying_contract: ::std::option::Option<Eip712DomainVerifyingContract>,
8206 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8208 pub version: ::std::option::Option<::std::string::String>,
8209 }
8210 impl ::std::convert::From<&Eip712Domain> for Eip712Domain {
8211 fn from(value: &Eip712Domain) -> Self {
8212 value.clone()
8213 }
8214 }
8215 impl ::std::default::Default for Eip712Domain {
8216 fn default() -> Self {
8217 Self {
8218 chain_id: Default::default(),
8219 name: Default::default(),
8220 salt: Default::default(),
8221 verifying_contract: Default::default(),
8222 version: Default::default(),
8223 }
8224 }
8225 }
8226 impl Eip712Domain {
8227 pub fn builder() -> builder::Eip712Domain {
8228 Default::default()
8229 }
8230 }
8231 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
8247 #[serde(transparent)]
8248 pub struct Eip712DomainSalt(::std::string::String);
8249 impl ::std::ops::Deref for Eip712DomainSalt {
8250 type Target = ::std::string::String;
8251 fn deref(&self) -> &::std::string::String {
8252 &self.0
8253 }
8254 }
8255 impl ::std::convert::From<Eip712DomainSalt> for ::std::string::String {
8256 fn from(value: Eip712DomainSalt) -> Self {
8257 value.0
8258 }
8259 }
8260 impl ::std::convert::From<&Eip712DomainSalt> for Eip712DomainSalt {
8261 fn from(value: &Eip712DomainSalt) -> Self {
8262 value.clone()
8263 }
8264 }
8265 impl ::std::str::FromStr for Eip712DomainSalt {
8266 type Err = self::error::ConversionError;
8267 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
8268 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
8269 ::std::sync::LazyLock::new(|| {
8270 ::regress::Regex::new("^0x[a-fA-F0-9]{64}$").unwrap()
8271 });
8272 if PATTERN.find(value).is_none() {
8273 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{64}$\"".into());
8274 }
8275 Ok(Self(value.to_string()))
8276 }
8277 }
8278 impl ::std::convert::TryFrom<&str> for Eip712DomainSalt {
8279 type Error = self::error::ConversionError;
8280 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
8281 value.parse()
8282 }
8283 }
8284 impl ::std::convert::TryFrom<&::std::string::String> for Eip712DomainSalt {
8285 type Error = self::error::ConversionError;
8286 fn try_from(
8287 value: &::std::string::String,
8288 ) -> ::std::result::Result<Self, self::error::ConversionError> {
8289 value.parse()
8290 }
8291 }
8292 impl ::std::convert::TryFrom<::std::string::String> for Eip712DomainSalt {
8293 type Error = self::error::ConversionError;
8294 fn try_from(
8295 value: ::std::string::String,
8296 ) -> ::std::result::Result<Self, self::error::ConversionError> {
8297 value.parse()
8298 }
8299 }
8300 impl<'de> ::serde::Deserialize<'de> for Eip712DomainSalt {
8301 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
8302 where
8303 D: ::serde::Deserializer<'de>,
8304 {
8305 ::std::string::String::deserialize(deserializer)?
8306 .parse()
8307 .map_err(|e: self::error::ConversionError| {
8308 <D::Error as ::serde::de::Error>::custom(e.to_string())
8309 })
8310 }
8311 }
8312 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
8328 #[serde(transparent)]
8329 pub struct Eip712DomainVerifyingContract(::std::string::String);
8330 impl ::std::ops::Deref for Eip712DomainVerifyingContract {
8331 type Target = ::std::string::String;
8332 fn deref(&self) -> &::std::string::String {
8333 &self.0
8334 }
8335 }
8336 impl ::std::convert::From<Eip712DomainVerifyingContract> for ::std::string::String {
8337 fn from(value: Eip712DomainVerifyingContract) -> Self {
8338 value.0
8339 }
8340 }
8341 impl ::std::convert::From<&Eip712DomainVerifyingContract> for Eip712DomainVerifyingContract {
8342 fn from(value: &Eip712DomainVerifyingContract) -> Self {
8343 value.clone()
8344 }
8345 }
8346 impl ::std::str::FromStr for Eip712DomainVerifyingContract {
8347 type Err = self::error::ConversionError;
8348 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
8349 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
8350 ::std::sync::LazyLock::new(|| {
8351 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
8352 });
8353 if PATTERN.find(value).is_none() {
8354 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
8355 }
8356 Ok(Self(value.to_string()))
8357 }
8358 }
8359 impl ::std::convert::TryFrom<&str> for Eip712DomainVerifyingContract {
8360 type Error = self::error::ConversionError;
8361 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
8362 value.parse()
8363 }
8364 }
8365 impl ::std::convert::TryFrom<&::std::string::String> for Eip712DomainVerifyingContract {
8366 type Error = self::error::ConversionError;
8367 fn try_from(
8368 value: &::std::string::String,
8369 ) -> ::std::result::Result<Self, self::error::ConversionError> {
8370 value.parse()
8371 }
8372 }
8373 impl ::std::convert::TryFrom<::std::string::String> for Eip712DomainVerifyingContract {
8374 type Error = self::error::ConversionError;
8375 fn try_from(
8376 value: ::std::string::String,
8377 ) -> ::std::result::Result<Self, self::error::ConversionError> {
8378 value.parse()
8379 }
8380 }
8381 impl<'de> ::serde::Deserialize<'de> for Eip712DomainVerifyingContract {
8382 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
8383 where
8384 D: ::serde::Deserializer<'de>,
8385 {
8386 ::std::string::String::deserialize(deserializer)?
8387 .parse()
8388 .map_err(|e: self::error::ConversionError| {
8389 <D::Error as ::serde::de::Error>::custom(e.to_string())
8390 })
8391 }
8392 }
8393 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8504 pub struct Eip712Message {
8505 pub domain: Eip712Domain,
8506 pub message: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
8508 #[serde(rename = "primaryType")]
8510 pub primary_type: ::std::string::String,
8511 pub types: Eip712Types,
8512 }
8513 impl ::std::convert::From<&Eip712Message> for Eip712Message {
8514 fn from(value: &Eip712Message) -> Self {
8515 value.clone()
8516 }
8517 }
8518 impl Eip712Message {
8519 pub fn builder() -> builder::Eip712Message {
8520 Default::default()
8521 }
8522 }
8523 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8583 #[serde(transparent)]
8584 pub struct Eip712Types(pub ::serde_json::Map<::std::string::String, ::serde_json::Value>);
8585 impl ::std::ops::Deref for Eip712Types {
8586 type Target = ::serde_json::Map<::std::string::String, ::serde_json::Value>;
8587 fn deref(&self) -> &::serde_json::Map<::std::string::String, ::serde_json::Value> {
8588 &self.0
8589 }
8590 }
8591 impl ::std::convert::From<Eip712Types>
8592 for ::serde_json::Map<::std::string::String, ::serde_json::Value>
8593 {
8594 fn from(value: Eip712Types) -> Self {
8595 value.0
8596 }
8597 }
8598 impl ::std::convert::From<&Eip712Types> for Eip712Types {
8599 fn from(value: &Eip712Types) -> Self {
8600 value.clone()
8601 }
8602 }
8603 impl ::std::convert::From<::serde_json::Map<::std::string::String, ::serde_json::Value>>
8604 for Eip712Types
8605 {
8606 fn from(value: ::serde_json::Map<::std::string::String, ::serde_json::Value>) -> Self {
8607 Self(value)
8608 }
8609 }
8610 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8647 pub struct EmailAuthentication {
8648 pub email: ::std::string::String,
8650 #[serde(rename = "type")]
8652 pub type_: EmailAuthenticationType,
8653 }
8654 impl ::std::convert::From<&EmailAuthentication> for EmailAuthentication {
8655 fn from(value: &EmailAuthentication) -> Self {
8656 value.clone()
8657 }
8658 }
8659 impl EmailAuthentication {
8660 pub fn builder() -> builder::EmailAuthentication {
8661 Default::default()
8662 }
8663 }
8664 #[derive(
8682 ::serde::Deserialize,
8683 ::serde::Serialize,
8684 Clone,
8685 Copy,
8686 Debug,
8687 Eq,
8688 Hash,
8689 Ord,
8690 PartialEq,
8691 PartialOrd,
8692 )]
8693 pub enum EmailAuthenticationType {
8694 #[serde(rename = "email")]
8695 Email,
8696 }
8697 impl ::std::convert::From<&Self> for EmailAuthenticationType {
8698 fn from(value: &EmailAuthenticationType) -> Self {
8699 value.clone()
8700 }
8701 }
8702 impl ::std::fmt::Display for EmailAuthenticationType {
8703 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
8704 match *self {
8705 Self::Email => f.write_str("email"),
8706 }
8707 }
8708 }
8709 impl ::std::str::FromStr for EmailAuthenticationType {
8710 type Err = self::error::ConversionError;
8711 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
8712 match value {
8713 "email" => Ok(Self::Email),
8714 _ => Err("invalid value".into()),
8715 }
8716 }
8717 }
8718 impl ::std::convert::TryFrom<&str> for EmailAuthenticationType {
8719 type Error = self::error::ConversionError;
8720 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
8721 value.parse()
8722 }
8723 }
8724 impl ::std::convert::TryFrom<&::std::string::String> for EmailAuthenticationType {
8725 type Error = self::error::ConversionError;
8726 fn try_from(
8727 value: &::std::string::String,
8728 ) -> ::std::result::Result<Self, self::error::ConversionError> {
8729 value.parse()
8730 }
8731 }
8732 impl ::std::convert::TryFrom<::std::string::String> for EmailAuthenticationType {
8733 type Error = self::error::ConversionError;
8734 fn try_from(
8735 value: ::std::string::String,
8736 ) -> ::std::result::Result<Self, self::error::ConversionError> {
8737 value.parse()
8738 }
8739 }
8740 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8895 pub struct EndUser {
8896 #[serde(rename = "authenticationMethods")]
8897 pub authentication_methods: AuthenticationMethods,
8898 #[serde(rename = "createdAt")]
8900 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
8901 #[serde(rename = "evmAccountObjects")]
8903 pub evm_account_objects: ::std::vec::Vec<EndUserEvmAccount>,
8904 #[serde(rename = "evmAccounts")]
8906 pub evm_accounts: ::std::vec::Vec<EndUserEvmAccountsItem>,
8907 #[serde(rename = "evmSmartAccountObjects")]
8909 pub evm_smart_account_objects: ::std::vec::Vec<EndUserEvmSmartAccount>,
8910 #[serde(rename = "evmSmartAccounts")]
8912 pub evm_smart_accounts: ::std::vec::Vec<EndUserEvmSmartAccountsItem>,
8913 #[serde(rename = "solanaAccountObjects")]
8915 pub solana_account_objects: ::std::vec::Vec<EndUserSolanaAccount>,
8916 #[serde(rename = "solanaAccounts")]
8918 pub solana_accounts: ::std::vec::Vec<EndUserSolanaAccountsItem>,
8919 #[serde(rename = "userId")]
8921 pub user_id: EndUserUserId,
8922 }
8923 impl ::std::convert::From<&EndUser> for EndUser {
8924 fn from(value: &EndUser) -> Self {
8925 value.clone()
8926 }
8927 }
8928 impl EndUser {
8929 pub fn builder() -> builder::EndUser {
8930 Default::default()
8931 }
8932 }
8933 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8967 pub struct EndUserEvmAccount {
8968 pub address: EndUserEvmAccountAddress,
8970 #[serde(rename = "createdAt")]
8972 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
8973 }
8974 impl ::std::convert::From<&EndUserEvmAccount> for EndUserEvmAccount {
8975 fn from(value: &EndUserEvmAccount) -> Self {
8976 value.clone()
8977 }
8978 }
8979 impl EndUserEvmAccount {
8980 pub fn builder() -> builder::EndUserEvmAccount {
8981 Default::default()
8982 }
8983 }
8984 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9000 #[serde(transparent)]
9001 pub struct EndUserEvmAccountAddress(::std::string::String);
9002 impl ::std::ops::Deref for EndUserEvmAccountAddress {
9003 type Target = ::std::string::String;
9004 fn deref(&self) -> &::std::string::String {
9005 &self.0
9006 }
9007 }
9008 impl ::std::convert::From<EndUserEvmAccountAddress> for ::std::string::String {
9009 fn from(value: EndUserEvmAccountAddress) -> Self {
9010 value.0
9011 }
9012 }
9013 impl ::std::convert::From<&EndUserEvmAccountAddress> for EndUserEvmAccountAddress {
9014 fn from(value: &EndUserEvmAccountAddress) -> Self {
9015 value.clone()
9016 }
9017 }
9018 impl ::std::str::FromStr for EndUserEvmAccountAddress {
9019 type Err = self::error::ConversionError;
9020 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9021 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
9022 ::std::sync::LazyLock::new(|| {
9023 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
9024 });
9025 if PATTERN.find(value).is_none() {
9026 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
9027 }
9028 Ok(Self(value.to_string()))
9029 }
9030 }
9031 impl ::std::convert::TryFrom<&str> for EndUserEvmAccountAddress {
9032 type Error = self::error::ConversionError;
9033 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9034 value.parse()
9035 }
9036 }
9037 impl ::std::convert::TryFrom<&::std::string::String> for EndUserEvmAccountAddress {
9038 type Error = self::error::ConversionError;
9039 fn try_from(
9040 value: &::std::string::String,
9041 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9042 value.parse()
9043 }
9044 }
9045 impl ::std::convert::TryFrom<::std::string::String> for EndUserEvmAccountAddress {
9046 type Error = self::error::ConversionError;
9047 fn try_from(
9048 value: ::std::string::String,
9049 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9050 value.parse()
9051 }
9052 }
9053 impl<'de> ::serde::Deserialize<'de> for EndUserEvmAccountAddress {
9054 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
9055 where
9056 D: ::serde::Deserializer<'de>,
9057 {
9058 ::std::string::String::deserialize(deserializer)?
9059 .parse()
9060 .map_err(|e: self::error::ConversionError| {
9061 <D::Error as ::serde::de::Error>::custom(e.to_string())
9062 })
9063 }
9064 }
9065 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9081 #[serde(transparent)]
9082 pub struct EndUserEvmAccountsItem(::std::string::String);
9083 impl ::std::ops::Deref for EndUserEvmAccountsItem {
9084 type Target = ::std::string::String;
9085 fn deref(&self) -> &::std::string::String {
9086 &self.0
9087 }
9088 }
9089 impl ::std::convert::From<EndUserEvmAccountsItem> for ::std::string::String {
9090 fn from(value: EndUserEvmAccountsItem) -> Self {
9091 value.0
9092 }
9093 }
9094 impl ::std::convert::From<&EndUserEvmAccountsItem> for EndUserEvmAccountsItem {
9095 fn from(value: &EndUserEvmAccountsItem) -> Self {
9096 value.clone()
9097 }
9098 }
9099 impl ::std::str::FromStr for EndUserEvmAccountsItem {
9100 type Err = self::error::ConversionError;
9101 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9102 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
9103 ::std::sync::LazyLock::new(|| {
9104 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
9105 });
9106 if PATTERN.find(value).is_none() {
9107 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
9108 }
9109 Ok(Self(value.to_string()))
9110 }
9111 }
9112 impl ::std::convert::TryFrom<&str> for EndUserEvmAccountsItem {
9113 type Error = self::error::ConversionError;
9114 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9115 value.parse()
9116 }
9117 }
9118 impl ::std::convert::TryFrom<&::std::string::String> for EndUserEvmAccountsItem {
9119 type Error = self::error::ConversionError;
9120 fn try_from(
9121 value: &::std::string::String,
9122 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9123 value.parse()
9124 }
9125 }
9126 impl ::std::convert::TryFrom<::std::string::String> for EndUserEvmAccountsItem {
9127 type Error = self::error::ConversionError;
9128 fn try_from(
9129 value: ::std::string::String,
9130 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9131 value.parse()
9132 }
9133 }
9134 impl<'de> ::serde::Deserialize<'de> for EndUserEvmAccountsItem {
9135 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
9136 where
9137 D: ::serde::Deserializer<'de>,
9138 {
9139 ::std::string::String::deserialize(deserializer)?
9140 .parse()
9141 .map_err(|e: self::error::ConversionError| {
9142 <D::Error as ::serde::de::Error>::custom(e.to_string())
9143 })
9144 }
9145 }
9146 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9199 pub struct EndUserEvmSmartAccount {
9200 pub address: EndUserEvmSmartAccountAddress,
9202 #[serde(rename = "createdAt")]
9204 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
9205 #[serde(rename = "ownerAddresses")]
9207 pub owner_addresses: ::std::vec::Vec<EndUserEvmSmartAccountOwnerAddressesItem>,
9208 }
9209 impl ::std::convert::From<&EndUserEvmSmartAccount> for EndUserEvmSmartAccount {
9210 fn from(value: &EndUserEvmSmartAccount) -> Self {
9211 value.clone()
9212 }
9213 }
9214 impl EndUserEvmSmartAccount {
9215 pub fn builder() -> builder::EndUserEvmSmartAccount {
9216 Default::default()
9217 }
9218 }
9219 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9235 #[serde(transparent)]
9236 pub struct EndUserEvmSmartAccountAddress(::std::string::String);
9237 impl ::std::ops::Deref for EndUserEvmSmartAccountAddress {
9238 type Target = ::std::string::String;
9239 fn deref(&self) -> &::std::string::String {
9240 &self.0
9241 }
9242 }
9243 impl ::std::convert::From<EndUserEvmSmartAccountAddress> for ::std::string::String {
9244 fn from(value: EndUserEvmSmartAccountAddress) -> Self {
9245 value.0
9246 }
9247 }
9248 impl ::std::convert::From<&EndUserEvmSmartAccountAddress> for EndUserEvmSmartAccountAddress {
9249 fn from(value: &EndUserEvmSmartAccountAddress) -> Self {
9250 value.clone()
9251 }
9252 }
9253 impl ::std::str::FromStr for EndUserEvmSmartAccountAddress {
9254 type Err = self::error::ConversionError;
9255 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9256 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
9257 ::std::sync::LazyLock::new(|| {
9258 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
9259 });
9260 if PATTERN.find(value).is_none() {
9261 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
9262 }
9263 Ok(Self(value.to_string()))
9264 }
9265 }
9266 impl ::std::convert::TryFrom<&str> for EndUserEvmSmartAccountAddress {
9267 type Error = self::error::ConversionError;
9268 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9269 value.parse()
9270 }
9271 }
9272 impl ::std::convert::TryFrom<&::std::string::String> for EndUserEvmSmartAccountAddress {
9273 type Error = self::error::ConversionError;
9274 fn try_from(
9275 value: &::std::string::String,
9276 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9277 value.parse()
9278 }
9279 }
9280 impl ::std::convert::TryFrom<::std::string::String> for EndUserEvmSmartAccountAddress {
9281 type Error = self::error::ConversionError;
9282 fn try_from(
9283 value: ::std::string::String,
9284 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9285 value.parse()
9286 }
9287 }
9288 impl<'de> ::serde::Deserialize<'de> for EndUserEvmSmartAccountAddress {
9289 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
9290 where
9291 D: ::serde::Deserializer<'de>,
9292 {
9293 ::std::string::String::deserialize(deserializer)?
9294 .parse()
9295 .map_err(|e: self::error::ConversionError| {
9296 <D::Error as ::serde::de::Error>::custom(e.to_string())
9297 })
9298 }
9299 }
9300 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9316 #[serde(transparent)]
9317 pub struct EndUserEvmSmartAccountOwnerAddressesItem(::std::string::String);
9318 impl ::std::ops::Deref for EndUserEvmSmartAccountOwnerAddressesItem {
9319 type Target = ::std::string::String;
9320 fn deref(&self) -> &::std::string::String {
9321 &self.0
9322 }
9323 }
9324 impl ::std::convert::From<EndUserEvmSmartAccountOwnerAddressesItem> for ::std::string::String {
9325 fn from(value: EndUserEvmSmartAccountOwnerAddressesItem) -> Self {
9326 value.0
9327 }
9328 }
9329 impl ::std::convert::From<&EndUserEvmSmartAccountOwnerAddressesItem>
9330 for EndUserEvmSmartAccountOwnerAddressesItem
9331 {
9332 fn from(value: &EndUserEvmSmartAccountOwnerAddressesItem) -> Self {
9333 value.clone()
9334 }
9335 }
9336 impl ::std::str::FromStr for EndUserEvmSmartAccountOwnerAddressesItem {
9337 type Err = self::error::ConversionError;
9338 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9339 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
9340 ::std::sync::LazyLock::new(|| {
9341 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
9342 });
9343 if PATTERN.find(value).is_none() {
9344 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
9345 }
9346 Ok(Self(value.to_string()))
9347 }
9348 }
9349 impl ::std::convert::TryFrom<&str> for EndUserEvmSmartAccountOwnerAddressesItem {
9350 type Error = self::error::ConversionError;
9351 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9352 value.parse()
9353 }
9354 }
9355 impl ::std::convert::TryFrom<&::std::string::String> for EndUserEvmSmartAccountOwnerAddressesItem {
9356 type Error = self::error::ConversionError;
9357 fn try_from(
9358 value: &::std::string::String,
9359 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9360 value.parse()
9361 }
9362 }
9363 impl ::std::convert::TryFrom<::std::string::String> for EndUserEvmSmartAccountOwnerAddressesItem {
9364 type Error = self::error::ConversionError;
9365 fn try_from(
9366 value: ::std::string::String,
9367 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9368 value.parse()
9369 }
9370 }
9371 impl<'de> ::serde::Deserialize<'de> for EndUserEvmSmartAccountOwnerAddressesItem {
9372 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
9373 where
9374 D: ::serde::Deserializer<'de>,
9375 {
9376 ::std::string::String::deserialize(deserializer)?
9377 .parse()
9378 .map_err(|e: self::error::ConversionError| {
9379 <D::Error as ::serde::de::Error>::custom(e.to_string())
9380 })
9381 }
9382 }
9383 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9399 #[serde(transparent)]
9400 pub struct EndUserEvmSmartAccountsItem(::std::string::String);
9401 impl ::std::ops::Deref for EndUserEvmSmartAccountsItem {
9402 type Target = ::std::string::String;
9403 fn deref(&self) -> &::std::string::String {
9404 &self.0
9405 }
9406 }
9407 impl ::std::convert::From<EndUserEvmSmartAccountsItem> for ::std::string::String {
9408 fn from(value: EndUserEvmSmartAccountsItem) -> Self {
9409 value.0
9410 }
9411 }
9412 impl ::std::convert::From<&EndUserEvmSmartAccountsItem> for EndUserEvmSmartAccountsItem {
9413 fn from(value: &EndUserEvmSmartAccountsItem) -> Self {
9414 value.clone()
9415 }
9416 }
9417 impl ::std::str::FromStr for EndUserEvmSmartAccountsItem {
9418 type Err = self::error::ConversionError;
9419 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9420 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
9421 ::std::sync::LazyLock::new(|| {
9422 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
9423 });
9424 if PATTERN.find(value).is_none() {
9425 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
9426 }
9427 Ok(Self(value.to_string()))
9428 }
9429 }
9430 impl ::std::convert::TryFrom<&str> for EndUserEvmSmartAccountsItem {
9431 type Error = self::error::ConversionError;
9432 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9433 value.parse()
9434 }
9435 }
9436 impl ::std::convert::TryFrom<&::std::string::String> for EndUserEvmSmartAccountsItem {
9437 type Error = self::error::ConversionError;
9438 fn try_from(
9439 value: &::std::string::String,
9440 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9441 value.parse()
9442 }
9443 }
9444 impl ::std::convert::TryFrom<::std::string::String> for EndUserEvmSmartAccountsItem {
9445 type Error = self::error::ConversionError;
9446 fn try_from(
9447 value: ::std::string::String,
9448 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9449 value.parse()
9450 }
9451 }
9452 impl<'de> ::serde::Deserialize<'de> for EndUserEvmSmartAccountsItem {
9453 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
9454 where
9455 D: ::serde::Deserializer<'de>,
9456 {
9457 ::std::string::String::deserialize(deserializer)?
9458 .parse()
9459 .map_err(|e: self::error::ConversionError| {
9460 <D::Error as ::serde::de::Error>::custom(e.to_string())
9461 })
9462 }
9463 }
9464 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9498 pub struct EndUserSolanaAccount {
9499 pub address: EndUserSolanaAccountAddress,
9501 #[serde(rename = "createdAt")]
9503 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
9504 }
9505 impl ::std::convert::From<&EndUserSolanaAccount> for EndUserSolanaAccount {
9506 fn from(value: &EndUserSolanaAccount) -> Self {
9507 value.clone()
9508 }
9509 }
9510 impl EndUserSolanaAccount {
9511 pub fn builder() -> builder::EndUserSolanaAccount {
9512 Default::default()
9513 }
9514 }
9515 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9531 #[serde(transparent)]
9532 pub struct EndUserSolanaAccountAddress(::std::string::String);
9533 impl ::std::ops::Deref for EndUserSolanaAccountAddress {
9534 type Target = ::std::string::String;
9535 fn deref(&self) -> &::std::string::String {
9536 &self.0
9537 }
9538 }
9539 impl ::std::convert::From<EndUserSolanaAccountAddress> for ::std::string::String {
9540 fn from(value: EndUserSolanaAccountAddress) -> Self {
9541 value.0
9542 }
9543 }
9544 impl ::std::convert::From<&EndUserSolanaAccountAddress> for EndUserSolanaAccountAddress {
9545 fn from(value: &EndUserSolanaAccountAddress) -> Self {
9546 value.clone()
9547 }
9548 }
9549 impl ::std::str::FromStr for EndUserSolanaAccountAddress {
9550 type Err = self::error::ConversionError;
9551 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9552 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
9553 ::std::sync::LazyLock::new(|| {
9554 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
9555 });
9556 if PATTERN.find(value).is_none() {
9557 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
9558 }
9559 Ok(Self(value.to_string()))
9560 }
9561 }
9562 impl ::std::convert::TryFrom<&str> for EndUserSolanaAccountAddress {
9563 type Error = self::error::ConversionError;
9564 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9565 value.parse()
9566 }
9567 }
9568 impl ::std::convert::TryFrom<&::std::string::String> for EndUserSolanaAccountAddress {
9569 type Error = self::error::ConversionError;
9570 fn try_from(
9571 value: &::std::string::String,
9572 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9573 value.parse()
9574 }
9575 }
9576 impl ::std::convert::TryFrom<::std::string::String> for EndUserSolanaAccountAddress {
9577 type Error = self::error::ConversionError;
9578 fn try_from(
9579 value: ::std::string::String,
9580 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9581 value.parse()
9582 }
9583 }
9584 impl<'de> ::serde::Deserialize<'de> for EndUserSolanaAccountAddress {
9585 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
9586 where
9587 D: ::serde::Deserializer<'de>,
9588 {
9589 ::std::string::String::deserialize(deserializer)?
9590 .parse()
9591 .map_err(|e: self::error::ConversionError| {
9592 <D::Error as ::serde::de::Error>::custom(e.to_string())
9593 })
9594 }
9595 }
9596 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9612 #[serde(transparent)]
9613 pub struct EndUserSolanaAccountsItem(::std::string::String);
9614 impl ::std::ops::Deref for EndUserSolanaAccountsItem {
9615 type Target = ::std::string::String;
9616 fn deref(&self) -> &::std::string::String {
9617 &self.0
9618 }
9619 }
9620 impl ::std::convert::From<EndUserSolanaAccountsItem> for ::std::string::String {
9621 fn from(value: EndUserSolanaAccountsItem) -> Self {
9622 value.0
9623 }
9624 }
9625 impl ::std::convert::From<&EndUserSolanaAccountsItem> for EndUserSolanaAccountsItem {
9626 fn from(value: &EndUserSolanaAccountsItem) -> Self {
9627 value.clone()
9628 }
9629 }
9630 impl ::std::str::FromStr for EndUserSolanaAccountsItem {
9631 type Err = self::error::ConversionError;
9632 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9633 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
9634 ::std::sync::LazyLock::new(|| {
9635 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
9636 });
9637 if PATTERN.find(value).is_none() {
9638 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
9639 }
9640 Ok(Self(value.to_string()))
9641 }
9642 }
9643 impl ::std::convert::TryFrom<&str> for EndUserSolanaAccountsItem {
9644 type Error = self::error::ConversionError;
9645 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9646 value.parse()
9647 }
9648 }
9649 impl ::std::convert::TryFrom<&::std::string::String> for EndUserSolanaAccountsItem {
9650 type Error = self::error::ConversionError;
9651 fn try_from(
9652 value: &::std::string::String,
9653 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9654 value.parse()
9655 }
9656 }
9657 impl ::std::convert::TryFrom<::std::string::String> for EndUserSolanaAccountsItem {
9658 type Error = self::error::ConversionError;
9659 fn try_from(
9660 value: ::std::string::String,
9661 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9662 value.parse()
9663 }
9664 }
9665 impl<'de> ::serde::Deserialize<'de> for EndUserSolanaAccountsItem {
9666 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
9667 where
9668 D: ::serde::Deserializer<'de>,
9669 {
9670 ::std::string::String::deserialize(deserializer)?
9671 .parse()
9672 .map_err(|e: self::error::ConversionError| {
9673 <D::Error as ::serde::de::Error>::custom(e.to_string())
9674 })
9675 }
9676 }
9677 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9693 #[serde(transparent)]
9694 pub struct EndUserUserId(::std::string::String);
9695 impl ::std::ops::Deref for EndUserUserId {
9696 type Target = ::std::string::String;
9697 fn deref(&self) -> &::std::string::String {
9698 &self.0
9699 }
9700 }
9701 impl ::std::convert::From<EndUserUserId> for ::std::string::String {
9702 fn from(value: EndUserUserId) -> Self {
9703 value.0
9704 }
9705 }
9706 impl ::std::convert::From<&EndUserUserId> for EndUserUserId {
9707 fn from(value: &EndUserUserId) -> Self {
9708 value.clone()
9709 }
9710 }
9711 impl ::std::str::FromStr for EndUserUserId {
9712 type Err = self::error::ConversionError;
9713 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9714 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
9715 ::std::sync::LazyLock::new(|| {
9716 ::regress::Regex::new("^[a-zA-Z0-9-]{1,100}$").unwrap()
9717 });
9718 if PATTERN.find(value).is_none() {
9719 return Err("doesn't match pattern \"^[a-zA-Z0-9-]{1,100}$\"".into());
9720 }
9721 Ok(Self(value.to_string()))
9722 }
9723 }
9724 impl ::std::convert::TryFrom<&str> for EndUserUserId {
9725 type Error = self::error::ConversionError;
9726 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
9727 value.parse()
9728 }
9729 }
9730 impl ::std::convert::TryFrom<&::std::string::String> for EndUserUserId {
9731 type Error = self::error::ConversionError;
9732 fn try_from(
9733 value: &::std::string::String,
9734 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9735 value.parse()
9736 }
9737 }
9738 impl ::std::convert::TryFrom<::std::string::String> for EndUserUserId {
9739 type Error = self::error::ConversionError;
9740 fn try_from(
9741 value: ::std::string::String,
9742 ) -> ::std::result::Result<Self, self::error::ConversionError> {
9743 value.parse()
9744 }
9745 }
9746 impl<'de> ::serde::Deserialize<'de> for EndUserUserId {
9747 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
9748 where
9749 D: ::serde::Deserializer<'de>,
9750 {
9751 ::std::string::String::deserialize(deserializer)?
9752 .parse()
9753 .map_err(|e: self::error::ConversionError| {
9754 <D::Error as ::serde::de::Error>::custom(e.to_string())
9755 })
9756 }
9757 }
9758 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9812 pub struct Error {
9813 #[serde(
9815 rename = "correlationId",
9816 default,
9817 skip_serializing_if = "::std::option::Option::is_none"
9818 )]
9819 pub correlation_id: ::std::option::Option<::std::string::String>,
9820 #[serde(
9822 rename = "errorLink",
9823 default,
9824 skip_serializing_if = "::std::option::Option::is_none"
9825 )]
9826 pub error_link: ::std::option::Option<Url>,
9827 #[serde(rename = "errorMessage")]
9829 pub error_message: ::std::string::String,
9830 #[serde(rename = "errorType")]
9831 pub error_type: ErrorType,
9832 }
9833 impl ::std::convert::From<&Error> for Error {
9834 fn from(value: &Error) -> Self {
9835 value.clone()
9836 }
9837 }
9838 impl Error {
9839 pub fn builder() -> builder::Error {
9840 Default::default()
9841 }
9842 }
9843 #[derive(
9936 ::serde::Deserialize,
9937 ::serde::Serialize,
9938 Clone,
9939 Copy,
9940 Debug,
9941 Eq,
9942 Hash,
9943 Ord,
9944 PartialEq,
9945 PartialOrd,
9946 )]
9947 pub enum ErrorType {
9948 #[serde(rename = "already_exists")]
9949 AlreadyExists,
9950 #[serde(rename = "bad_gateway")]
9951 BadGateway,
9952 #[serde(rename = "faucet_limit_exceeded")]
9953 FaucetLimitExceeded,
9954 #[serde(rename = "forbidden")]
9955 Forbidden,
9956 #[serde(rename = "idempotency_error")]
9957 IdempotencyError,
9958 #[serde(rename = "internal_server_error")]
9959 InternalServerError,
9960 #[serde(rename = "invalid_request")]
9961 InvalidRequest,
9962 #[serde(rename = "invalid_sql_query")]
9963 InvalidSqlQuery,
9964 #[serde(rename = "invalid_signature")]
9965 InvalidSignature,
9966 #[serde(rename = "malformed_transaction")]
9967 MalformedTransaction,
9968 #[serde(rename = "not_found")]
9969 NotFound,
9970 #[serde(rename = "payment_method_required")]
9971 PaymentMethodRequired,
9972 #[serde(rename = "rate_limit_exceeded")]
9973 RateLimitExceeded,
9974 #[serde(rename = "request_canceled")]
9975 RequestCanceled,
9976 #[serde(rename = "service_unavailable")]
9977 ServiceUnavailable,
9978 #[serde(rename = "timed_out")]
9979 TimedOut,
9980 #[serde(rename = "unauthorized")]
9981 Unauthorized,
9982 #[serde(rename = "policy_violation")]
9983 PolicyViolation,
9984 #[serde(rename = "policy_in_use")]
9985 PolicyInUse,
9986 #[serde(rename = "account_limit_exceeded")]
9987 AccountLimitExceeded,
9988 #[serde(rename = "network_not_tradable")]
9989 NetworkNotTradable,
9990 #[serde(rename = "guest_permission_denied")]
9991 GuestPermissionDenied,
9992 #[serde(rename = "guest_region_forbidden")]
9993 GuestRegionForbidden,
9994 #[serde(rename = "guest_transaction_limit")]
9995 GuestTransactionLimit,
9996 #[serde(rename = "guest_transaction_count")]
9997 GuestTransactionCount,
9998 #[serde(rename = "phone_number_verification_expired")]
9999 PhoneNumberVerificationExpired,
10000 #[serde(rename = "document_verification_failed")]
10001 DocumentVerificationFailed,
10002 #[serde(rename = "recipient_allowlist_violation")]
10003 RecipientAllowlistViolation,
10004 #[serde(rename = "recipient_allowlist_pending")]
10005 RecipientAllowlistPending,
10006 #[serde(rename = "travel_rules_recipient_violation")]
10007 TravelRulesRecipientViolation,
10008 #[serde(rename = "transfer_amount_out_of_bounds")]
10009 TransferAmountOutOfBounds,
10010 #[serde(rename = "transfer_recipient_address_invalid")]
10011 TransferRecipientAddressInvalid,
10012 #[serde(rename = "transfer_quote_expired")]
10013 TransferQuoteExpired,
10014 #[serde(rename = "mfa_already_enrolled")]
10015 MfaAlreadyEnrolled,
10016 #[serde(rename = "mfa_invalid_code")]
10017 MfaInvalidCode,
10018 #[serde(rename = "mfa_flow_expired")]
10019 MfaFlowExpired,
10020 #[serde(rename = "mfa_required")]
10021 MfaRequired,
10022 #[serde(rename = "mfa_not_enrolled")]
10023 MfaNotEnrolled,
10024 }
10025 impl ::std::convert::From<&Self> for ErrorType {
10026 fn from(value: &ErrorType) -> Self {
10027 value.clone()
10028 }
10029 }
10030 impl ::std::fmt::Display for ErrorType {
10031 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
10032 match *self {
10033 Self::AlreadyExists => f.write_str("already_exists"),
10034 Self::BadGateway => f.write_str("bad_gateway"),
10035 Self::FaucetLimitExceeded => f.write_str("faucet_limit_exceeded"),
10036 Self::Forbidden => f.write_str("forbidden"),
10037 Self::IdempotencyError => f.write_str("idempotency_error"),
10038 Self::InternalServerError => f.write_str("internal_server_error"),
10039 Self::InvalidRequest => f.write_str("invalid_request"),
10040 Self::InvalidSqlQuery => f.write_str("invalid_sql_query"),
10041 Self::InvalidSignature => f.write_str("invalid_signature"),
10042 Self::MalformedTransaction => f.write_str("malformed_transaction"),
10043 Self::NotFound => f.write_str("not_found"),
10044 Self::PaymentMethodRequired => f.write_str("payment_method_required"),
10045 Self::RateLimitExceeded => f.write_str("rate_limit_exceeded"),
10046 Self::RequestCanceled => f.write_str("request_canceled"),
10047 Self::ServiceUnavailable => f.write_str("service_unavailable"),
10048 Self::TimedOut => f.write_str("timed_out"),
10049 Self::Unauthorized => f.write_str("unauthorized"),
10050 Self::PolicyViolation => f.write_str("policy_violation"),
10051 Self::PolicyInUse => f.write_str("policy_in_use"),
10052 Self::AccountLimitExceeded => f.write_str("account_limit_exceeded"),
10053 Self::NetworkNotTradable => f.write_str("network_not_tradable"),
10054 Self::GuestPermissionDenied => f.write_str("guest_permission_denied"),
10055 Self::GuestRegionForbidden => f.write_str("guest_region_forbidden"),
10056 Self::GuestTransactionLimit => f.write_str("guest_transaction_limit"),
10057 Self::GuestTransactionCount => f.write_str("guest_transaction_count"),
10058 Self::PhoneNumberVerificationExpired => {
10059 f.write_str("phone_number_verification_expired")
10060 }
10061 Self::DocumentVerificationFailed => f.write_str("document_verification_failed"),
10062 Self::RecipientAllowlistViolation => f.write_str("recipient_allowlist_violation"),
10063 Self::RecipientAllowlistPending => f.write_str("recipient_allowlist_pending"),
10064 Self::TravelRulesRecipientViolation => {
10065 f.write_str("travel_rules_recipient_violation")
10066 }
10067 Self::TransferAmountOutOfBounds => f.write_str("transfer_amount_out_of_bounds"),
10068 Self::TransferRecipientAddressInvalid => {
10069 f.write_str("transfer_recipient_address_invalid")
10070 }
10071 Self::TransferQuoteExpired => f.write_str("transfer_quote_expired"),
10072 Self::MfaAlreadyEnrolled => f.write_str("mfa_already_enrolled"),
10073 Self::MfaInvalidCode => f.write_str("mfa_invalid_code"),
10074 Self::MfaFlowExpired => f.write_str("mfa_flow_expired"),
10075 Self::MfaRequired => f.write_str("mfa_required"),
10076 Self::MfaNotEnrolled => f.write_str("mfa_not_enrolled"),
10077 }
10078 }
10079 }
10080 impl ::std::str::FromStr for ErrorType {
10081 type Err = self::error::ConversionError;
10082 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10083 match value {
10084 "already_exists" => Ok(Self::AlreadyExists),
10085 "bad_gateway" => Ok(Self::BadGateway),
10086 "faucet_limit_exceeded" => Ok(Self::FaucetLimitExceeded),
10087 "forbidden" => Ok(Self::Forbidden),
10088 "idempotency_error" => Ok(Self::IdempotencyError),
10089 "internal_server_error" => Ok(Self::InternalServerError),
10090 "invalid_request" => Ok(Self::InvalidRequest),
10091 "invalid_sql_query" => Ok(Self::InvalidSqlQuery),
10092 "invalid_signature" => Ok(Self::InvalidSignature),
10093 "malformed_transaction" => Ok(Self::MalformedTransaction),
10094 "not_found" => Ok(Self::NotFound),
10095 "payment_method_required" => Ok(Self::PaymentMethodRequired),
10096 "rate_limit_exceeded" => Ok(Self::RateLimitExceeded),
10097 "request_canceled" => Ok(Self::RequestCanceled),
10098 "service_unavailable" => Ok(Self::ServiceUnavailable),
10099 "timed_out" => Ok(Self::TimedOut),
10100 "unauthorized" => Ok(Self::Unauthorized),
10101 "policy_violation" => Ok(Self::PolicyViolation),
10102 "policy_in_use" => Ok(Self::PolicyInUse),
10103 "account_limit_exceeded" => Ok(Self::AccountLimitExceeded),
10104 "network_not_tradable" => Ok(Self::NetworkNotTradable),
10105 "guest_permission_denied" => Ok(Self::GuestPermissionDenied),
10106 "guest_region_forbidden" => Ok(Self::GuestRegionForbidden),
10107 "guest_transaction_limit" => Ok(Self::GuestTransactionLimit),
10108 "guest_transaction_count" => Ok(Self::GuestTransactionCount),
10109 "phone_number_verification_expired" => Ok(Self::PhoneNumberVerificationExpired),
10110 "document_verification_failed" => Ok(Self::DocumentVerificationFailed),
10111 "recipient_allowlist_violation" => Ok(Self::RecipientAllowlistViolation),
10112 "recipient_allowlist_pending" => Ok(Self::RecipientAllowlistPending),
10113 "travel_rules_recipient_violation" => Ok(Self::TravelRulesRecipientViolation),
10114 "transfer_amount_out_of_bounds" => Ok(Self::TransferAmountOutOfBounds),
10115 "transfer_recipient_address_invalid" => Ok(Self::TransferRecipientAddressInvalid),
10116 "transfer_quote_expired" => Ok(Self::TransferQuoteExpired),
10117 "mfa_already_enrolled" => Ok(Self::MfaAlreadyEnrolled),
10118 "mfa_invalid_code" => Ok(Self::MfaInvalidCode),
10119 "mfa_flow_expired" => Ok(Self::MfaFlowExpired),
10120 "mfa_required" => Ok(Self::MfaRequired),
10121 "mfa_not_enrolled" => Ok(Self::MfaNotEnrolled),
10122 _ => Err("invalid value".into()),
10123 }
10124 }
10125 }
10126 impl ::std::convert::TryFrom<&str> for ErrorType {
10127 type Error = self::error::ConversionError;
10128 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10129 value.parse()
10130 }
10131 }
10132 impl ::std::convert::TryFrom<&::std::string::String> for ErrorType {
10133 type Error = self::error::ConversionError;
10134 fn try_from(
10135 value: &::std::string::String,
10136 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10137 value.parse()
10138 }
10139 }
10140 impl ::std::convert::TryFrom<::std::string::String> for ErrorType {
10141 type Error = self::error::ConversionError;
10142 fn try_from(
10143 value: ::std::string::String,
10144 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10145 value.parse()
10146 }
10147 }
10148 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10200 pub struct EthValueCriterion {
10201 #[serde(rename = "ethValue")]
10203 pub eth_value: EthValueCriterionEthValue,
10204 pub operator: EthValueCriterionOperator,
10206 #[serde(rename = "type")]
10208 pub type_: EthValueCriterionType,
10209 }
10210 impl ::std::convert::From<&EthValueCriterion> for EthValueCriterion {
10211 fn from(value: &EthValueCriterion) -> Self {
10212 value.clone()
10213 }
10214 }
10215 impl EthValueCriterion {
10216 pub fn builder() -> builder::EthValueCriterion {
10217 Default::default()
10218 }
10219 }
10220 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
10236 #[serde(transparent)]
10237 pub struct EthValueCriterionEthValue(::std::string::String);
10238 impl ::std::ops::Deref for EthValueCriterionEthValue {
10239 type Target = ::std::string::String;
10240 fn deref(&self) -> &::std::string::String {
10241 &self.0
10242 }
10243 }
10244 impl ::std::convert::From<EthValueCriterionEthValue> for ::std::string::String {
10245 fn from(value: EthValueCriterionEthValue) -> Self {
10246 value.0
10247 }
10248 }
10249 impl ::std::convert::From<&EthValueCriterionEthValue> for EthValueCriterionEthValue {
10250 fn from(value: &EthValueCriterionEthValue) -> Self {
10251 value.clone()
10252 }
10253 }
10254 impl ::std::str::FromStr for EthValueCriterionEthValue {
10255 type Err = self::error::ConversionError;
10256 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10257 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
10258 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[0-9]+$").unwrap());
10259 if PATTERN.find(value).is_none() {
10260 return Err("doesn't match pattern \"^[0-9]+$\"".into());
10261 }
10262 Ok(Self(value.to_string()))
10263 }
10264 }
10265 impl ::std::convert::TryFrom<&str> for EthValueCriterionEthValue {
10266 type Error = self::error::ConversionError;
10267 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10268 value.parse()
10269 }
10270 }
10271 impl ::std::convert::TryFrom<&::std::string::String> for EthValueCriterionEthValue {
10272 type Error = self::error::ConversionError;
10273 fn try_from(
10274 value: &::std::string::String,
10275 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10276 value.parse()
10277 }
10278 }
10279 impl ::std::convert::TryFrom<::std::string::String> for EthValueCriterionEthValue {
10280 type Error = self::error::ConversionError;
10281 fn try_from(
10282 value: ::std::string::String,
10283 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10284 value.parse()
10285 }
10286 }
10287 impl<'de> ::serde::Deserialize<'de> for EthValueCriterionEthValue {
10288 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
10289 where
10290 D: ::serde::Deserializer<'de>,
10291 {
10292 ::std::string::String::deserialize(deserializer)?
10293 .parse()
10294 .map_err(|e: self::error::ConversionError| {
10295 <D::Error as ::serde::de::Error>::custom(e.to_string())
10296 })
10297 }
10298 }
10299 #[derive(
10321 ::serde::Deserialize,
10322 ::serde::Serialize,
10323 Clone,
10324 Copy,
10325 Debug,
10326 Eq,
10327 Hash,
10328 Ord,
10329 PartialEq,
10330 PartialOrd,
10331 )]
10332 pub enum EthValueCriterionOperator {
10333 GreaterThan,
10334 GreaterThanOrEqual,
10335 LessThan,
10336 LessThanOrEqual,
10337 Equal,
10338 }
10339 impl ::std::convert::From<&Self> for EthValueCriterionOperator {
10340 fn from(value: &EthValueCriterionOperator) -> Self {
10341 value.clone()
10342 }
10343 }
10344 impl ::std::fmt::Display for EthValueCriterionOperator {
10345 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
10346 match *self {
10347 Self::GreaterThan => f.write_str("GreaterThan"),
10348 Self::GreaterThanOrEqual => f.write_str("GreaterThanOrEqual"),
10349 Self::LessThan => f.write_str("LessThan"),
10350 Self::LessThanOrEqual => f.write_str("LessThanOrEqual"),
10351 Self::Equal => f.write_str("Equal"),
10352 }
10353 }
10354 }
10355 impl ::std::str::FromStr for EthValueCriterionOperator {
10356 type Err = self::error::ConversionError;
10357 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10358 match value {
10359 "GreaterThan" => Ok(Self::GreaterThan),
10360 "GreaterThanOrEqual" => Ok(Self::GreaterThanOrEqual),
10361 "LessThan" => Ok(Self::LessThan),
10362 "LessThanOrEqual" => Ok(Self::LessThanOrEqual),
10363 "Equal" => Ok(Self::Equal),
10364 _ => Err("invalid value".into()),
10365 }
10366 }
10367 }
10368 impl ::std::convert::TryFrom<&str> for EthValueCriterionOperator {
10369 type Error = self::error::ConversionError;
10370 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10371 value.parse()
10372 }
10373 }
10374 impl ::std::convert::TryFrom<&::std::string::String> for EthValueCriterionOperator {
10375 type Error = self::error::ConversionError;
10376 fn try_from(
10377 value: &::std::string::String,
10378 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10379 value.parse()
10380 }
10381 }
10382 impl ::std::convert::TryFrom<::std::string::String> for EthValueCriterionOperator {
10383 type Error = self::error::ConversionError;
10384 fn try_from(
10385 value: ::std::string::String,
10386 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10387 value.parse()
10388 }
10389 }
10390 #[derive(
10408 ::serde::Deserialize,
10409 ::serde::Serialize,
10410 Clone,
10411 Copy,
10412 Debug,
10413 Eq,
10414 Hash,
10415 Ord,
10416 PartialEq,
10417 PartialOrd,
10418 )]
10419 pub enum EthValueCriterionType {
10420 #[serde(rename = "ethValue")]
10421 EthValue,
10422 }
10423 impl ::std::convert::From<&Self> for EthValueCriterionType {
10424 fn from(value: &EthValueCriterionType) -> Self {
10425 value.clone()
10426 }
10427 }
10428 impl ::std::fmt::Display for EthValueCriterionType {
10429 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
10430 match *self {
10431 Self::EthValue => f.write_str("ethValue"),
10432 }
10433 }
10434 }
10435 impl ::std::str::FromStr for EthValueCriterionType {
10436 type Err = self::error::ConversionError;
10437 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10438 match value {
10439 "ethValue" => Ok(Self::EthValue),
10440 _ => Err("invalid value".into()),
10441 }
10442 }
10443 }
10444 impl ::std::convert::TryFrom<&str> for EthValueCriterionType {
10445 type Error = self::error::ConversionError;
10446 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10447 value.parse()
10448 }
10449 }
10450 impl ::std::convert::TryFrom<&::std::string::String> for EthValueCriterionType {
10451 type Error = self::error::ConversionError;
10452 fn try_from(
10453 value: &::std::string::String,
10454 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10455 value.parse()
10456 }
10457 }
10458 impl ::std::convert::TryFrom<::std::string::String> for EthValueCriterionType {
10459 type Error = self::error::ConversionError;
10460 fn try_from(
10461 value: ::std::string::String,
10462 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10463 value.parse()
10464 }
10465 }
10466 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10528 pub struct EvmAccount {
10529 pub address: EvmAccountAddress,
10531 #[serde(
10533 rename = "createdAt",
10534 default,
10535 skip_serializing_if = "::std::option::Option::is_none"
10536 )]
10537 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
10538 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10542 pub name: ::std::option::Option<EvmAccountName>,
10543 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
10545 pub policies: ::std::vec::Vec<EvmAccountPoliciesItem>,
10546 #[serde(
10548 rename = "updatedAt",
10549 default,
10550 skip_serializing_if = "::std::option::Option::is_none"
10551 )]
10552 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
10553 }
10554 impl ::std::convert::From<&EvmAccount> for EvmAccount {
10555 fn from(value: &EvmAccount) -> Self {
10556 value.clone()
10557 }
10558 }
10559 impl EvmAccount {
10560 pub fn builder() -> builder::EvmAccount {
10561 Default::default()
10562 }
10563 }
10564 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
10580 #[serde(transparent)]
10581 pub struct EvmAccountAddress(::std::string::String);
10582 impl ::std::ops::Deref for EvmAccountAddress {
10583 type Target = ::std::string::String;
10584 fn deref(&self) -> &::std::string::String {
10585 &self.0
10586 }
10587 }
10588 impl ::std::convert::From<EvmAccountAddress> for ::std::string::String {
10589 fn from(value: EvmAccountAddress) -> Self {
10590 value.0
10591 }
10592 }
10593 impl ::std::convert::From<&EvmAccountAddress> for EvmAccountAddress {
10594 fn from(value: &EvmAccountAddress) -> Self {
10595 value.clone()
10596 }
10597 }
10598 impl ::std::str::FromStr for EvmAccountAddress {
10599 type Err = self::error::ConversionError;
10600 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10601 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
10602 ::std::sync::LazyLock::new(|| {
10603 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
10604 });
10605 if PATTERN.find(value).is_none() {
10606 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
10607 }
10608 Ok(Self(value.to_string()))
10609 }
10610 }
10611 impl ::std::convert::TryFrom<&str> for EvmAccountAddress {
10612 type Error = self::error::ConversionError;
10613 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10614 value.parse()
10615 }
10616 }
10617 impl ::std::convert::TryFrom<&::std::string::String> for EvmAccountAddress {
10618 type Error = self::error::ConversionError;
10619 fn try_from(
10620 value: &::std::string::String,
10621 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10622 value.parse()
10623 }
10624 }
10625 impl ::std::convert::TryFrom<::std::string::String> for EvmAccountAddress {
10626 type Error = self::error::ConversionError;
10627 fn try_from(
10628 value: ::std::string::String,
10629 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10630 value.parse()
10631 }
10632 }
10633 impl<'de> ::serde::Deserialize<'de> for EvmAccountAddress {
10634 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
10635 where
10636 D: ::serde::Deserializer<'de>,
10637 {
10638 ::std::string::String::deserialize(deserializer)?
10639 .parse()
10640 .map_err(|e: self::error::ConversionError| {
10641 <D::Error as ::serde::de::Error>::custom(e.to_string())
10642 })
10643 }
10644 }
10645 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
10663 #[serde(transparent)]
10664 pub struct EvmAccountName(::std::string::String);
10665 impl ::std::ops::Deref for EvmAccountName {
10666 type Target = ::std::string::String;
10667 fn deref(&self) -> &::std::string::String {
10668 &self.0
10669 }
10670 }
10671 impl ::std::convert::From<EvmAccountName> for ::std::string::String {
10672 fn from(value: EvmAccountName) -> Self {
10673 value.0
10674 }
10675 }
10676 impl ::std::convert::From<&EvmAccountName> for EvmAccountName {
10677 fn from(value: &EvmAccountName) -> Self {
10678 value.clone()
10679 }
10680 }
10681 impl ::std::str::FromStr for EvmAccountName {
10682 type Err = self::error::ConversionError;
10683 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10684 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
10685 ::std::sync::LazyLock::new(|| {
10686 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
10687 });
10688 if PATTERN.find(value).is_none() {
10689 return Err(
10690 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
10691 );
10692 }
10693 Ok(Self(value.to_string()))
10694 }
10695 }
10696 impl ::std::convert::TryFrom<&str> for EvmAccountName {
10697 type Error = self::error::ConversionError;
10698 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10699 value.parse()
10700 }
10701 }
10702 impl ::std::convert::TryFrom<&::std::string::String> for EvmAccountName {
10703 type Error = self::error::ConversionError;
10704 fn try_from(
10705 value: &::std::string::String,
10706 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10707 value.parse()
10708 }
10709 }
10710 impl ::std::convert::TryFrom<::std::string::String> for EvmAccountName {
10711 type Error = self::error::ConversionError;
10712 fn try_from(
10713 value: ::std::string::String,
10714 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10715 value.parse()
10716 }
10717 }
10718 impl<'de> ::serde::Deserialize<'de> for EvmAccountName {
10719 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
10720 where
10721 D: ::serde::Deserializer<'de>,
10722 {
10723 ::std::string::String::deserialize(deserializer)?
10724 .parse()
10725 .map_err(|e: self::error::ConversionError| {
10726 <D::Error as ::serde::de::Error>::custom(e.to_string())
10727 })
10728 }
10729 }
10730 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
10742 #[serde(transparent)]
10743 pub struct EvmAccountPoliciesItem(::std::string::String);
10744 impl ::std::ops::Deref for EvmAccountPoliciesItem {
10745 type Target = ::std::string::String;
10746 fn deref(&self) -> &::std::string::String {
10747 &self.0
10748 }
10749 }
10750 impl ::std::convert::From<EvmAccountPoliciesItem> for ::std::string::String {
10751 fn from(value: EvmAccountPoliciesItem) -> Self {
10752 value.0
10753 }
10754 }
10755 impl ::std::convert::From<&EvmAccountPoliciesItem> for EvmAccountPoliciesItem {
10756 fn from(value: &EvmAccountPoliciesItem) -> Self {
10757 value.clone()
10758 }
10759 }
10760 impl ::std::str::FromStr for EvmAccountPoliciesItem {
10761 type Err = self::error::ConversionError;
10762 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10763 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
10764 || {
10765 ::regress::Regex::new(
10766 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
10767 )
10768 .unwrap()
10769 },
10770 );
10771 if PATTERN.find(value).is_none() {
10772 return Err(
10773 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
10774 .into(),
10775 );
10776 }
10777 Ok(Self(value.to_string()))
10778 }
10779 }
10780 impl ::std::convert::TryFrom<&str> for EvmAccountPoliciesItem {
10781 type Error = self::error::ConversionError;
10782 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10783 value.parse()
10784 }
10785 }
10786 impl ::std::convert::TryFrom<&::std::string::String> for EvmAccountPoliciesItem {
10787 type Error = self::error::ConversionError;
10788 fn try_from(
10789 value: &::std::string::String,
10790 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10791 value.parse()
10792 }
10793 }
10794 impl ::std::convert::TryFrom<::std::string::String> for EvmAccountPoliciesItem {
10795 type Error = self::error::ConversionError;
10796 fn try_from(
10797 value: ::std::string::String,
10798 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10799 value.parse()
10800 }
10801 }
10802 impl<'de> ::serde::Deserialize<'de> for EvmAccountPoliciesItem {
10803 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
10804 where
10805 D: ::serde::Deserializer<'de>,
10806 {
10807 ::std::string::String::deserialize(deserializer)?
10808 .parse()
10809 .map_err(|e: self::error::ConversionError| {
10810 <D::Error as ::serde::de::Error>::custom(e.to_string())
10811 })
10812 }
10813 }
10814 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10871 pub struct EvmAddressCriterion {
10872 pub addresses: ::std::vec::Vec<EvmAddressCriterionAddressesItem>,
10874 pub operator: EvmAddressCriterionOperator,
10876 #[serde(rename = "type")]
10878 pub type_: EvmAddressCriterionType,
10879 }
10880 impl ::std::convert::From<&EvmAddressCriterion> for EvmAddressCriterion {
10881 fn from(value: &EvmAddressCriterion) -> Self {
10882 value.clone()
10883 }
10884 }
10885 impl EvmAddressCriterion {
10886 pub fn builder() -> builder::EvmAddressCriterion {
10887 Default::default()
10888 }
10889 }
10890 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
10903 #[serde(transparent)]
10904 pub struct EvmAddressCriterionAddressesItem(::std::string::String);
10905 impl ::std::ops::Deref for EvmAddressCriterionAddressesItem {
10906 type Target = ::std::string::String;
10907 fn deref(&self) -> &::std::string::String {
10908 &self.0
10909 }
10910 }
10911 impl ::std::convert::From<EvmAddressCriterionAddressesItem> for ::std::string::String {
10912 fn from(value: EvmAddressCriterionAddressesItem) -> Self {
10913 value.0
10914 }
10915 }
10916 impl ::std::convert::From<&EvmAddressCriterionAddressesItem> for EvmAddressCriterionAddressesItem {
10917 fn from(value: &EvmAddressCriterionAddressesItem) -> Self {
10918 value.clone()
10919 }
10920 }
10921 impl ::std::str::FromStr for EvmAddressCriterionAddressesItem {
10922 type Err = self::error::ConversionError;
10923 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10924 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
10925 ::std::sync::LazyLock::new(|| {
10926 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
10927 });
10928 if PATTERN.find(value).is_none() {
10929 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
10930 }
10931 Ok(Self(value.to_string()))
10932 }
10933 }
10934 impl ::std::convert::TryFrom<&str> for EvmAddressCriterionAddressesItem {
10935 type Error = self::error::ConversionError;
10936 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
10937 value.parse()
10938 }
10939 }
10940 impl ::std::convert::TryFrom<&::std::string::String> for EvmAddressCriterionAddressesItem {
10941 type Error = self::error::ConversionError;
10942 fn try_from(
10943 value: &::std::string::String,
10944 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10945 value.parse()
10946 }
10947 }
10948 impl ::std::convert::TryFrom<::std::string::String> for EvmAddressCriterionAddressesItem {
10949 type Error = self::error::ConversionError;
10950 fn try_from(
10951 value: ::std::string::String,
10952 ) -> ::std::result::Result<Self, self::error::ConversionError> {
10953 value.parse()
10954 }
10955 }
10956 impl<'de> ::serde::Deserialize<'de> for EvmAddressCriterionAddressesItem {
10957 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
10958 where
10959 D: ::serde::Deserializer<'de>,
10960 {
10961 ::std::string::String::deserialize(deserializer)?
10962 .parse()
10963 .map_err(|e: self::error::ConversionError| {
10964 <D::Error as ::serde::de::Error>::custom(e.to_string())
10965 })
10966 }
10967 }
10968 #[derive(
10987 ::serde::Deserialize,
10988 ::serde::Serialize,
10989 Clone,
10990 Copy,
10991 Debug,
10992 Eq,
10993 Hash,
10994 Ord,
10995 PartialEq,
10996 PartialOrd,
10997 )]
10998 pub enum EvmAddressCriterionOperator {
10999 #[serde(rename = "in")]
11000 In,
11001 #[serde(rename = "not in")]
11002 NotIn,
11003 }
11004 impl ::std::convert::From<&Self> for EvmAddressCriterionOperator {
11005 fn from(value: &EvmAddressCriterionOperator) -> Self {
11006 value.clone()
11007 }
11008 }
11009 impl ::std::fmt::Display for EvmAddressCriterionOperator {
11010 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
11011 match *self {
11012 Self::In => f.write_str("in"),
11013 Self::NotIn => f.write_str("not in"),
11014 }
11015 }
11016 }
11017 impl ::std::str::FromStr for EvmAddressCriterionOperator {
11018 type Err = self::error::ConversionError;
11019 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11020 match value {
11021 "in" => Ok(Self::In),
11022 "not in" => Ok(Self::NotIn),
11023 _ => Err("invalid value".into()),
11024 }
11025 }
11026 }
11027 impl ::std::convert::TryFrom<&str> for EvmAddressCriterionOperator {
11028 type Error = self::error::ConversionError;
11029 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11030 value.parse()
11031 }
11032 }
11033 impl ::std::convert::TryFrom<&::std::string::String> for EvmAddressCriterionOperator {
11034 type Error = self::error::ConversionError;
11035 fn try_from(
11036 value: &::std::string::String,
11037 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11038 value.parse()
11039 }
11040 }
11041 impl ::std::convert::TryFrom<::std::string::String> for EvmAddressCriterionOperator {
11042 type Error = self::error::ConversionError;
11043 fn try_from(
11044 value: ::std::string::String,
11045 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11046 value.parse()
11047 }
11048 }
11049 #[derive(
11067 ::serde::Deserialize,
11068 ::serde::Serialize,
11069 Clone,
11070 Copy,
11071 Debug,
11072 Eq,
11073 Hash,
11074 Ord,
11075 PartialEq,
11076 PartialOrd,
11077 )]
11078 pub enum EvmAddressCriterionType {
11079 #[serde(rename = "evmAddress")]
11080 EvmAddress,
11081 }
11082 impl ::std::convert::From<&Self> for EvmAddressCriterionType {
11083 fn from(value: &EvmAddressCriterionType) -> Self {
11084 value.clone()
11085 }
11086 }
11087 impl ::std::fmt::Display for EvmAddressCriterionType {
11088 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
11089 match *self {
11090 Self::EvmAddress => f.write_str("evmAddress"),
11091 }
11092 }
11093 }
11094 impl ::std::str::FromStr for EvmAddressCriterionType {
11095 type Err = self::error::ConversionError;
11096 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11097 match value {
11098 "evmAddress" => Ok(Self::EvmAddress),
11099 _ => Err("invalid value".into()),
11100 }
11101 }
11102 }
11103 impl ::std::convert::TryFrom<&str> for EvmAddressCriterionType {
11104 type Error = self::error::ConversionError;
11105 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11106 value.parse()
11107 }
11108 }
11109 impl ::std::convert::TryFrom<&::std::string::String> for EvmAddressCriterionType {
11110 type Error = self::error::ConversionError;
11111 fn try_from(
11112 value: &::std::string::String,
11113 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11114 value.parse()
11115 }
11116 }
11117 impl ::std::convert::TryFrom<::std::string::String> for EvmAddressCriterionType {
11118 type Error = self::error::ConversionError;
11119 fn try_from(
11120 value: ::std::string::String,
11121 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11122 value.parse()
11123 }
11124 }
11125 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
11173 pub struct EvmCall {
11174 pub data: EvmCallData,
11176 #[serde(
11178 rename = "overrideGasLimit",
11179 default,
11180 skip_serializing_if = "::std::option::Option::is_none"
11181 )]
11182 pub override_gas_limit: ::std::option::Option<::std::string::String>,
11183 pub to: EvmCallTo,
11185 pub value: ::std::string::String,
11187 }
11188 impl ::std::convert::From<&EvmCall> for EvmCall {
11189 fn from(value: &EvmCall) -> Self {
11190 value.clone()
11191 }
11192 }
11193 impl EvmCall {
11194 pub fn builder() -> builder::EvmCall {
11195 Default::default()
11196 }
11197 }
11198 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
11214 #[serde(transparent)]
11215 pub struct EvmCallData(::std::string::String);
11216 impl ::std::ops::Deref for EvmCallData {
11217 type Target = ::std::string::String;
11218 fn deref(&self) -> &::std::string::String {
11219 &self.0
11220 }
11221 }
11222 impl ::std::convert::From<EvmCallData> for ::std::string::String {
11223 fn from(value: EvmCallData) -> Self {
11224 value.0
11225 }
11226 }
11227 impl ::std::convert::From<&EvmCallData> for EvmCallData {
11228 fn from(value: &EvmCallData) -> Self {
11229 value.clone()
11230 }
11231 }
11232 impl ::std::str::FromStr for EvmCallData {
11233 type Err = self::error::ConversionError;
11234 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11235 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
11236 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^0x[0-9a-fA-F]*$").unwrap());
11237 if PATTERN.find(value).is_none() {
11238 return Err("doesn't match pattern \"^0x[0-9a-fA-F]*$\"".into());
11239 }
11240 Ok(Self(value.to_string()))
11241 }
11242 }
11243 impl ::std::convert::TryFrom<&str> for EvmCallData {
11244 type Error = self::error::ConversionError;
11245 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11246 value.parse()
11247 }
11248 }
11249 impl ::std::convert::TryFrom<&::std::string::String> for EvmCallData {
11250 type Error = self::error::ConversionError;
11251 fn try_from(
11252 value: &::std::string::String,
11253 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11254 value.parse()
11255 }
11256 }
11257 impl ::std::convert::TryFrom<::std::string::String> for EvmCallData {
11258 type Error = self::error::ConversionError;
11259 fn try_from(
11260 value: ::std::string::String,
11261 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11262 value.parse()
11263 }
11264 }
11265 impl<'de> ::serde::Deserialize<'de> for EvmCallData {
11266 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
11267 where
11268 D: ::serde::Deserializer<'de>,
11269 {
11270 ::std::string::String::deserialize(deserializer)?
11271 .parse()
11272 .map_err(|e: self::error::ConversionError| {
11273 <D::Error as ::serde::de::Error>::custom(e.to_string())
11274 })
11275 }
11276 }
11277 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
11293 #[serde(transparent)]
11294 pub struct EvmCallTo(::std::string::String);
11295 impl ::std::ops::Deref for EvmCallTo {
11296 type Target = ::std::string::String;
11297 fn deref(&self) -> &::std::string::String {
11298 &self.0
11299 }
11300 }
11301 impl ::std::convert::From<EvmCallTo> for ::std::string::String {
11302 fn from(value: EvmCallTo) -> Self {
11303 value.0
11304 }
11305 }
11306 impl ::std::convert::From<&EvmCallTo> for EvmCallTo {
11307 fn from(value: &EvmCallTo) -> Self {
11308 value.clone()
11309 }
11310 }
11311 impl ::std::str::FromStr for EvmCallTo {
11312 type Err = self::error::ConversionError;
11313 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11314 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
11315 ::std::sync::LazyLock::new(|| {
11316 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
11317 });
11318 if PATTERN.find(value).is_none() {
11319 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
11320 }
11321 Ok(Self(value.to_string()))
11322 }
11323 }
11324 impl ::std::convert::TryFrom<&str> for EvmCallTo {
11325 type Error = self::error::ConversionError;
11326 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11327 value.parse()
11328 }
11329 }
11330 impl ::std::convert::TryFrom<&::std::string::String> for EvmCallTo {
11331 type Error = self::error::ConversionError;
11332 fn try_from(
11333 value: &::std::string::String,
11334 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11335 value.parse()
11336 }
11337 }
11338 impl ::std::convert::TryFrom<::std::string::String> for EvmCallTo {
11339 type Error = self::error::ConversionError;
11340 fn try_from(
11341 value: ::std::string::String,
11342 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11343 value.parse()
11344 }
11345 }
11346 impl<'de> ::serde::Deserialize<'de> for EvmCallTo {
11347 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
11348 where
11349 D: ::serde::Deserializer<'de>,
11350 {
11351 ::std::string::String::deserialize(deserializer)?
11352 .parse()
11353 .map_err(|e: self::error::ConversionError| {
11354 <D::Error as ::serde::de::Error>::custom(e.to_string())
11355 })
11356 }
11357 }
11358 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
11433 pub struct EvmDataCondition {
11434 pub function: ::std::string::String,
11436 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
11438 pub params: ::std::vec::Vec<EvmDataConditionParamsItem>,
11439 }
11440 impl ::std::convert::From<&EvmDataCondition> for EvmDataCondition {
11441 fn from(value: &EvmDataCondition) -> Self {
11442 value.clone()
11443 }
11444 }
11445 impl EvmDataCondition {
11446 pub fn builder() -> builder::EvmDataCondition {
11447 Default::default()
11448 }
11449 }
11450 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
11469 #[serde(untagged)]
11470 pub enum EvmDataConditionParamsItem {
11471 Variant0(EvmDataParameterCondition),
11472 Variant1(EvmDataParameterConditionList),
11473 }
11474 impl ::std::convert::From<&Self> for EvmDataConditionParamsItem {
11475 fn from(value: &EvmDataConditionParamsItem) -> Self {
11476 value.clone()
11477 }
11478 }
11479 impl ::std::convert::From<EvmDataParameterCondition> for EvmDataConditionParamsItem {
11480 fn from(value: EvmDataParameterCondition) -> Self {
11481 Self::Variant0(value)
11482 }
11483 }
11484 impl ::std::convert::From<EvmDataParameterConditionList> for EvmDataConditionParamsItem {
11485 fn from(value: EvmDataParameterConditionList) -> Self {
11486 Self::Variant1(value)
11487 }
11488 }
11489 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
11565 pub struct EvmDataCriterion {
11566 pub abi: EvmDataCriterionAbi,
11568 pub conditions: ::std::vec::Vec<EvmDataCondition>,
11570 #[serde(rename = "type")]
11572 pub type_: EvmDataCriterionType,
11573 }
11574 impl ::std::convert::From<&EvmDataCriterion> for EvmDataCriterion {
11575 fn from(value: &EvmDataCriterion) -> Self {
11576 value.clone()
11577 }
11578 }
11579 impl EvmDataCriterion {
11580 pub fn builder() -> builder::EvmDataCriterion {
11581 Default::default()
11582 }
11583 }
11584 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
11606 #[serde(untagged)]
11607 pub enum EvmDataCriterionAbi {
11608 KnownAbiType(KnownAbiType),
11609 Abi(Abi),
11610 }
11611 impl ::std::convert::From<&Self> for EvmDataCriterionAbi {
11612 fn from(value: &EvmDataCriterionAbi) -> Self {
11613 value.clone()
11614 }
11615 }
11616 impl ::std::convert::From<KnownAbiType> for EvmDataCriterionAbi {
11617 fn from(value: KnownAbiType) -> Self {
11618 Self::KnownAbiType(value)
11619 }
11620 }
11621 impl ::std::convert::From<Abi> for EvmDataCriterionAbi {
11622 fn from(value: Abi) -> Self {
11623 Self::Abi(value)
11624 }
11625 }
11626 #[derive(
11644 ::serde::Deserialize,
11645 ::serde::Serialize,
11646 Clone,
11647 Copy,
11648 Debug,
11649 Eq,
11650 Hash,
11651 Ord,
11652 PartialEq,
11653 PartialOrd,
11654 )]
11655 pub enum EvmDataCriterionType {
11656 #[serde(rename = "evmData")]
11657 EvmData,
11658 }
11659 impl ::std::convert::From<&Self> for EvmDataCriterionType {
11660 fn from(value: &EvmDataCriterionType) -> Self {
11661 value.clone()
11662 }
11663 }
11664 impl ::std::fmt::Display for EvmDataCriterionType {
11665 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
11666 match *self {
11667 Self::EvmData => f.write_str("evmData"),
11668 }
11669 }
11670 }
11671 impl ::std::str::FromStr for EvmDataCriterionType {
11672 type Err = self::error::ConversionError;
11673 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11674 match value {
11675 "evmData" => Ok(Self::EvmData),
11676 _ => Err("invalid value".into()),
11677 }
11678 }
11679 }
11680 impl ::std::convert::TryFrom<&str> for EvmDataCriterionType {
11681 type Error = self::error::ConversionError;
11682 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11683 value.parse()
11684 }
11685 }
11686 impl ::std::convert::TryFrom<&::std::string::String> for EvmDataCriterionType {
11687 type Error = self::error::ConversionError;
11688 fn try_from(
11689 value: &::std::string::String,
11690 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11691 value.parse()
11692 }
11693 }
11694 impl ::std::convert::TryFrom<::std::string::String> for EvmDataCriterionType {
11695 type Error = self::error::ConversionError;
11696 fn try_from(
11697 value: ::std::string::String,
11698 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11699 value.parse()
11700 }
11701 }
11702 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
11750 pub struct EvmDataParameterCondition {
11751 pub name: ::std::string::String,
11753 pub operator: EvmDataParameterConditionOperator,
11755 pub value: ::std::string::String,
11757 }
11758 impl ::std::convert::From<&EvmDataParameterCondition> for EvmDataParameterCondition {
11759 fn from(value: &EvmDataParameterCondition) -> Self {
11760 value.clone()
11761 }
11762 }
11763 impl EvmDataParameterCondition {
11764 pub fn builder() -> builder::EvmDataParameterCondition {
11765 Default::default()
11766 }
11767 }
11768 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
11822 pub struct EvmDataParameterConditionList {
11823 pub name: ::std::string::String,
11825 pub operator: EvmDataParameterConditionListOperator,
11827 pub values: ::std::vec::Vec<::std::string::String>,
11829 }
11830 impl ::std::convert::From<&EvmDataParameterConditionList> for EvmDataParameterConditionList {
11831 fn from(value: &EvmDataParameterConditionList) -> Self {
11832 value.clone()
11833 }
11834 }
11835 impl EvmDataParameterConditionList {
11836 pub fn builder() -> builder::EvmDataParameterConditionList {
11837 Default::default()
11838 }
11839 }
11840 #[derive(
11859 ::serde::Deserialize,
11860 ::serde::Serialize,
11861 Clone,
11862 Copy,
11863 Debug,
11864 Eq,
11865 Hash,
11866 Ord,
11867 PartialEq,
11868 PartialOrd,
11869 )]
11870 pub enum EvmDataParameterConditionListOperator {
11871 #[serde(rename = "in")]
11872 In,
11873 #[serde(rename = "not in")]
11874 NotIn,
11875 }
11876 impl ::std::convert::From<&Self> for EvmDataParameterConditionListOperator {
11877 fn from(value: &EvmDataParameterConditionListOperator) -> Self {
11878 value.clone()
11879 }
11880 }
11881 impl ::std::fmt::Display for EvmDataParameterConditionListOperator {
11882 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
11883 match *self {
11884 Self::In => f.write_str("in"),
11885 Self::NotIn => f.write_str("not in"),
11886 }
11887 }
11888 }
11889 impl ::std::str::FromStr for EvmDataParameterConditionListOperator {
11890 type Err = self::error::ConversionError;
11891 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11892 match value {
11893 "in" => Ok(Self::In),
11894 "not in" => Ok(Self::NotIn),
11895 _ => Err("invalid value".into()),
11896 }
11897 }
11898 }
11899 impl ::std::convert::TryFrom<&str> for EvmDataParameterConditionListOperator {
11900 type Error = self::error::ConversionError;
11901 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11902 value.parse()
11903 }
11904 }
11905 impl ::std::convert::TryFrom<&::std::string::String> for EvmDataParameterConditionListOperator {
11906 type Error = self::error::ConversionError;
11907 fn try_from(
11908 value: &::std::string::String,
11909 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11910 value.parse()
11911 }
11912 }
11913 impl ::std::convert::TryFrom<::std::string::String> for EvmDataParameterConditionListOperator {
11914 type Error = self::error::ConversionError;
11915 fn try_from(
11916 value: ::std::string::String,
11917 ) -> ::std::result::Result<Self, self::error::ConversionError> {
11918 value.parse()
11919 }
11920 }
11921 #[derive(
11943 ::serde::Deserialize,
11944 ::serde::Serialize,
11945 Clone,
11946 Copy,
11947 Debug,
11948 Eq,
11949 Hash,
11950 Ord,
11951 PartialEq,
11952 PartialOrd,
11953 )]
11954 pub enum EvmDataParameterConditionOperator {
11955 GreaterThan,
11956 GreaterThanOrEqual,
11957 LessThan,
11958 LessThanOrEqual,
11959 Equal,
11960 }
11961 impl ::std::convert::From<&Self> for EvmDataParameterConditionOperator {
11962 fn from(value: &EvmDataParameterConditionOperator) -> Self {
11963 value.clone()
11964 }
11965 }
11966 impl ::std::fmt::Display for EvmDataParameterConditionOperator {
11967 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
11968 match *self {
11969 Self::GreaterThan => f.write_str("GreaterThan"),
11970 Self::GreaterThanOrEqual => f.write_str("GreaterThanOrEqual"),
11971 Self::LessThan => f.write_str("LessThan"),
11972 Self::LessThanOrEqual => f.write_str("LessThanOrEqual"),
11973 Self::Equal => f.write_str("Equal"),
11974 }
11975 }
11976 }
11977 impl ::std::str::FromStr for EvmDataParameterConditionOperator {
11978 type Err = self::error::ConversionError;
11979 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11980 match value {
11981 "GreaterThan" => Ok(Self::GreaterThan),
11982 "GreaterThanOrEqual" => Ok(Self::GreaterThanOrEqual),
11983 "LessThan" => Ok(Self::LessThan),
11984 "LessThanOrEqual" => Ok(Self::LessThanOrEqual),
11985 "Equal" => Ok(Self::Equal),
11986 _ => Err("invalid value".into()),
11987 }
11988 }
11989 }
11990 impl ::std::convert::TryFrom<&str> for EvmDataParameterConditionOperator {
11991 type Error = self::error::ConversionError;
11992 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
11993 value.parse()
11994 }
11995 }
11996 impl ::std::convert::TryFrom<&::std::string::String> for EvmDataParameterConditionOperator {
11997 type Error = self::error::ConversionError;
11998 fn try_from(
11999 value: &::std::string::String,
12000 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12001 value.parse()
12002 }
12003 }
12004 impl ::std::convert::TryFrom<::std::string::String> for EvmDataParameterConditionOperator {
12005 type Error = self::error::ConversionError;
12006 fn try_from(
12007 value: ::std::string::String,
12008 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12009 value.parse()
12010 }
12011 }
12012 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
12049 pub struct EvmMessageCriterion {
12050 #[serde(rename = "match")]
12052 pub match_: ::std::string::String,
12053 #[serde(rename = "type")]
12055 pub type_: EvmMessageCriterionType,
12056 }
12057 impl ::std::convert::From<&EvmMessageCriterion> for EvmMessageCriterion {
12058 fn from(value: &EvmMessageCriterion) -> Self {
12059 value.clone()
12060 }
12061 }
12062 impl EvmMessageCriterion {
12063 pub fn builder() -> builder::EvmMessageCriterion {
12064 Default::default()
12065 }
12066 }
12067 #[derive(
12085 ::serde::Deserialize,
12086 ::serde::Serialize,
12087 Clone,
12088 Copy,
12089 Debug,
12090 Eq,
12091 Hash,
12092 Ord,
12093 PartialEq,
12094 PartialOrd,
12095 )]
12096 pub enum EvmMessageCriterionType {
12097 #[serde(rename = "evmMessage")]
12098 EvmMessage,
12099 }
12100 impl ::std::convert::From<&Self> for EvmMessageCriterionType {
12101 fn from(value: &EvmMessageCriterionType) -> Self {
12102 value.clone()
12103 }
12104 }
12105 impl ::std::fmt::Display for EvmMessageCriterionType {
12106 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
12107 match *self {
12108 Self::EvmMessage => f.write_str("evmMessage"),
12109 }
12110 }
12111 }
12112 impl ::std::str::FromStr for EvmMessageCriterionType {
12113 type Err = self::error::ConversionError;
12114 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12115 match value {
12116 "evmMessage" => Ok(Self::EvmMessage),
12117 _ => Err("invalid value".into()),
12118 }
12119 }
12120 }
12121 impl ::std::convert::TryFrom<&str> for EvmMessageCriterionType {
12122 type Error = self::error::ConversionError;
12123 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12124 value.parse()
12125 }
12126 }
12127 impl ::std::convert::TryFrom<&::std::string::String> for EvmMessageCriterionType {
12128 type Error = self::error::ConversionError;
12129 fn try_from(
12130 value: &::std::string::String,
12131 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12132 value.parse()
12133 }
12134 }
12135 impl ::std::convert::TryFrom<::std::string::String> for EvmMessageCriterionType {
12136 type Error = self::error::ConversionError;
12137 fn try_from(
12138 value: ::std::string::String,
12139 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12140 value.parse()
12141 }
12142 }
12143 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
12214 pub struct EvmNetworkCriterion {
12215 pub networks: ::std::vec::Vec<EvmNetworkCriterionNetworksItem>,
12217 pub operator: EvmNetworkCriterionOperator,
12219 #[serde(rename = "type")]
12221 pub type_: EvmNetworkCriterionType,
12222 }
12223 impl ::std::convert::From<&EvmNetworkCriterion> for EvmNetworkCriterion {
12224 fn from(value: &EvmNetworkCriterion) -> Self {
12225 value.clone()
12226 }
12227 }
12228 impl EvmNetworkCriterion {
12229 pub fn builder() -> builder::EvmNetworkCriterion {
12230 Default::default()
12231 }
12232 }
12233 #[derive(
12260 ::serde::Deserialize,
12261 ::serde::Serialize,
12262 Clone,
12263 Copy,
12264 Debug,
12265 Eq,
12266 Hash,
12267 Ord,
12268 PartialEq,
12269 PartialOrd,
12270 )]
12271 pub enum EvmNetworkCriterionNetworksItem {
12272 #[serde(rename = "base-sepolia")]
12273 BaseSepolia,
12274 #[serde(rename = "base")]
12275 Base,
12276 #[serde(rename = "ethereum")]
12277 Ethereum,
12278 #[serde(rename = "ethereum-sepolia")]
12279 EthereumSepolia,
12280 #[serde(rename = "avalanche")]
12281 Avalanche,
12282 #[serde(rename = "polygon")]
12283 Polygon,
12284 #[serde(rename = "optimism")]
12285 Optimism,
12286 #[serde(rename = "arbitrum")]
12287 Arbitrum,
12288 #[serde(rename = "zora")]
12289 Zora,
12290 #[serde(rename = "bnb")]
12291 Bnb,
12292 }
12293 impl ::std::convert::From<&Self> for EvmNetworkCriterionNetworksItem {
12294 fn from(value: &EvmNetworkCriterionNetworksItem) -> Self {
12295 value.clone()
12296 }
12297 }
12298 impl ::std::fmt::Display for EvmNetworkCriterionNetworksItem {
12299 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
12300 match *self {
12301 Self::BaseSepolia => f.write_str("base-sepolia"),
12302 Self::Base => f.write_str("base"),
12303 Self::Ethereum => f.write_str("ethereum"),
12304 Self::EthereumSepolia => f.write_str("ethereum-sepolia"),
12305 Self::Avalanche => f.write_str("avalanche"),
12306 Self::Polygon => f.write_str("polygon"),
12307 Self::Optimism => f.write_str("optimism"),
12308 Self::Arbitrum => f.write_str("arbitrum"),
12309 Self::Zora => f.write_str("zora"),
12310 Self::Bnb => f.write_str("bnb"),
12311 }
12312 }
12313 }
12314 impl ::std::str::FromStr for EvmNetworkCriterionNetworksItem {
12315 type Err = self::error::ConversionError;
12316 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12317 match value {
12318 "base-sepolia" => Ok(Self::BaseSepolia),
12319 "base" => Ok(Self::Base),
12320 "ethereum" => Ok(Self::Ethereum),
12321 "ethereum-sepolia" => Ok(Self::EthereumSepolia),
12322 "avalanche" => Ok(Self::Avalanche),
12323 "polygon" => Ok(Self::Polygon),
12324 "optimism" => Ok(Self::Optimism),
12325 "arbitrum" => Ok(Self::Arbitrum),
12326 "zora" => Ok(Self::Zora),
12327 "bnb" => Ok(Self::Bnb),
12328 _ => Err("invalid value".into()),
12329 }
12330 }
12331 }
12332 impl ::std::convert::TryFrom<&str> for EvmNetworkCriterionNetworksItem {
12333 type Error = self::error::ConversionError;
12334 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12335 value.parse()
12336 }
12337 }
12338 impl ::std::convert::TryFrom<&::std::string::String> for EvmNetworkCriterionNetworksItem {
12339 type Error = self::error::ConversionError;
12340 fn try_from(
12341 value: &::std::string::String,
12342 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12343 value.parse()
12344 }
12345 }
12346 impl ::std::convert::TryFrom<::std::string::String> for EvmNetworkCriterionNetworksItem {
12347 type Error = self::error::ConversionError;
12348 fn try_from(
12349 value: ::std::string::String,
12350 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12351 value.parse()
12352 }
12353 }
12354 #[derive(
12373 ::serde::Deserialize,
12374 ::serde::Serialize,
12375 Clone,
12376 Copy,
12377 Debug,
12378 Eq,
12379 Hash,
12380 Ord,
12381 PartialEq,
12382 PartialOrd,
12383 )]
12384 pub enum EvmNetworkCriterionOperator {
12385 #[serde(rename = "in")]
12386 In,
12387 #[serde(rename = "not in")]
12388 NotIn,
12389 }
12390 impl ::std::convert::From<&Self> for EvmNetworkCriterionOperator {
12391 fn from(value: &EvmNetworkCriterionOperator) -> Self {
12392 value.clone()
12393 }
12394 }
12395 impl ::std::fmt::Display for EvmNetworkCriterionOperator {
12396 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
12397 match *self {
12398 Self::In => f.write_str("in"),
12399 Self::NotIn => f.write_str("not in"),
12400 }
12401 }
12402 }
12403 impl ::std::str::FromStr for EvmNetworkCriterionOperator {
12404 type Err = self::error::ConversionError;
12405 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12406 match value {
12407 "in" => Ok(Self::In),
12408 "not in" => Ok(Self::NotIn),
12409 _ => Err("invalid value".into()),
12410 }
12411 }
12412 }
12413 impl ::std::convert::TryFrom<&str> for EvmNetworkCriterionOperator {
12414 type Error = self::error::ConversionError;
12415 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12416 value.parse()
12417 }
12418 }
12419 impl ::std::convert::TryFrom<&::std::string::String> for EvmNetworkCriterionOperator {
12420 type Error = self::error::ConversionError;
12421 fn try_from(
12422 value: &::std::string::String,
12423 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12424 value.parse()
12425 }
12426 }
12427 impl ::std::convert::TryFrom<::std::string::String> for EvmNetworkCriterionOperator {
12428 type Error = self::error::ConversionError;
12429 fn try_from(
12430 value: ::std::string::String,
12431 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12432 value.parse()
12433 }
12434 }
12435 #[derive(
12453 ::serde::Deserialize,
12454 ::serde::Serialize,
12455 Clone,
12456 Copy,
12457 Debug,
12458 Eq,
12459 Hash,
12460 Ord,
12461 PartialEq,
12462 PartialOrd,
12463 )]
12464 pub enum EvmNetworkCriterionType {
12465 #[serde(rename = "evmNetwork")]
12466 EvmNetwork,
12467 }
12468 impl ::std::convert::From<&Self> for EvmNetworkCriterionType {
12469 fn from(value: &EvmNetworkCriterionType) -> Self {
12470 value.clone()
12471 }
12472 }
12473 impl ::std::fmt::Display for EvmNetworkCriterionType {
12474 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
12475 match *self {
12476 Self::EvmNetwork => f.write_str("evmNetwork"),
12477 }
12478 }
12479 }
12480 impl ::std::str::FromStr for EvmNetworkCriterionType {
12481 type Err = self::error::ConversionError;
12482 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12483 match value {
12484 "evmNetwork" => Ok(Self::EvmNetwork),
12485 _ => Err("invalid value".into()),
12486 }
12487 }
12488 }
12489 impl ::std::convert::TryFrom<&str> for EvmNetworkCriterionType {
12490 type Error = self::error::ConversionError;
12491 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12492 value.parse()
12493 }
12494 }
12495 impl ::std::convert::TryFrom<&::std::string::String> for EvmNetworkCriterionType {
12496 type Error = self::error::ConversionError;
12497 fn try_from(
12498 value: &::std::string::String,
12499 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12500 value.parse()
12501 }
12502 }
12503 impl ::std::convert::TryFrom<::std::string::String> for EvmNetworkCriterionType {
12504 type Error = self::error::ConversionError;
12505 fn try_from(
12506 value: ::std::string::String,
12507 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12508 value.parse()
12509 }
12510 }
12511 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
12587 pub struct EvmSmartAccount {
12588 pub address: EvmSmartAccountAddress,
12590 #[serde(
12592 rename = "createdAt",
12593 default,
12594 skip_serializing_if = "::std::option::Option::is_none"
12595 )]
12596 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
12597 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
12601 pub name: ::std::option::Option<EvmSmartAccountName>,
12602 pub owners: ::std::vec::Vec<EvmSmartAccountOwnersItem>,
12604 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
12606 pub policies: ::std::vec::Vec<EvmSmartAccountPoliciesItem>,
12607 #[serde(
12609 rename = "updatedAt",
12610 default,
12611 skip_serializing_if = "::std::option::Option::is_none"
12612 )]
12613 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
12614 }
12615 impl ::std::convert::From<&EvmSmartAccount> for EvmSmartAccount {
12616 fn from(value: &EvmSmartAccount) -> Self {
12617 value.clone()
12618 }
12619 }
12620 impl EvmSmartAccount {
12621 pub fn builder() -> builder::EvmSmartAccount {
12622 Default::default()
12623 }
12624 }
12625 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12641 #[serde(transparent)]
12642 pub struct EvmSmartAccountAddress(::std::string::String);
12643 impl ::std::ops::Deref for EvmSmartAccountAddress {
12644 type Target = ::std::string::String;
12645 fn deref(&self) -> &::std::string::String {
12646 &self.0
12647 }
12648 }
12649 impl ::std::convert::From<EvmSmartAccountAddress> for ::std::string::String {
12650 fn from(value: EvmSmartAccountAddress) -> Self {
12651 value.0
12652 }
12653 }
12654 impl ::std::convert::From<&EvmSmartAccountAddress> for EvmSmartAccountAddress {
12655 fn from(value: &EvmSmartAccountAddress) -> Self {
12656 value.clone()
12657 }
12658 }
12659 impl ::std::str::FromStr for EvmSmartAccountAddress {
12660 type Err = self::error::ConversionError;
12661 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12662 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
12663 ::std::sync::LazyLock::new(|| {
12664 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
12665 });
12666 if PATTERN.find(value).is_none() {
12667 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
12668 }
12669 Ok(Self(value.to_string()))
12670 }
12671 }
12672 impl ::std::convert::TryFrom<&str> for EvmSmartAccountAddress {
12673 type Error = self::error::ConversionError;
12674 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12675 value.parse()
12676 }
12677 }
12678 impl ::std::convert::TryFrom<&::std::string::String> for EvmSmartAccountAddress {
12679 type Error = self::error::ConversionError;
12680 fn try_from(
12681 value: &::std::string::String,
12682 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12683 value.parse()
12684 }
12685 }
12686 impl ::std::convert::TryFrom<::std::string::String> for EvmSmartAccountAddress {
12687 type Error = self::error::ConversionError;
12688 fn try_from(
12689 value: ::std::string::String,
12690 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12691 value.parse()
12692 }
12693 }
12694 impl<'de> ::serde::Deserialize<'de> for EvmSmartAccountAddress {
12695 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
12696 where
12697 D: ::serde::Deserializer<'de>,
12698 {
12699 ::std::string::String::deserialize(deserializer)?
12700 .parse()
12701 .map_err(|e: self::error::ConversionError| {
12702 <D::Error as ::serde::de::Error>::custom(e.to_string())
12703 })
12704 }
12705 }
12706 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12724 #[serde(transparent)]
12725 pub struct EvmSmartAccountName(::std::string::String);
12726 impl ::std::ops::Deref for EvmSmartAccountName {
12727 type Target = ::std::string::String;
12728 fn deref(&self) -> &::std::string::String {
12729 &self.0
12730 }
12731 }
12732 impl ::std::convert::From<EvmSmartAccountName> for ::std::string::String {
12733 fn from(value: EvmSmartAccountName) -> Self {
12734 value.0
12735 }
12736 }
12737 impl ::std::convert::From<&EvmSmartAccountName> for EvmSmartAccountName {
12738 fn from(value: &EvmSmartAccountName) -> Self {
12739 value.clone()
12740 }
12741 }
12742 impl ::std::str::FromStr for EvmSmartAccountName {
12743 type Err = self::error::ConversionError;
12744 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12745 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
12746 ::std::sync::LazyLock::new(|| {
12747 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
12748 });
12749 if PATTERN.find(value).is_none() {
12750 return Err(
12751 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
12752 );
12753 }
12754 Ok(Self(value.to_string()))
12755 }
12756 }
12757 impl ::std::convert::TryFrom<&str> for EvmSmartAccountName {
12758 type Error = self::error::ConversionError;
12759 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12760 value.parse()
12761 }
12762 }
12763 impl ::std::convert::TryFrom<&::std::string::String> for EvmSmartAccountName {
12764 type Error = self::error::ConversionError;
12765 fn try_from(
12766 value: &::std::string::String,
12767 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12768 value.parse()
12769 }
12770 }
12771 impl ::std::convert::TryFrom<::std::string::String> for EvmSmartAccountName {
12772 type Error = self::error::ConversionError;
12773 fn try_from(
12774 value: ::std::string::String,
12775 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12776 value.parse()
12777 }
12778 }
12779 impl<'de> ::serde::Deserialize<'de> for EvmSmartAccountName {
12780 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
12781 where
12782 D: ::serde::Deserializer<'de>,
12783 {
12784 ::std::string::String::deserialize(deserializer)?
12785 .parse()
12786 .map_err(|e: self::error::ConversionError| {
12787 <D::Error as ::serde::de::Error>::custom(e.to_string())
12788 })
12789 }
12790 }
12791 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12803 #[serde(transparent)]
12804 pub struct EvmSmartAccountOwnersItem(::std::string::String);
12805 impl ::std::ops::Deref for EvmSmartAccountOwnersItem {
12806 type Target = ::std::string::String;
12807 fn deref(&self) -> &::std::string::String {
12808 &self.0
12809 }
12810 }
12811 impl ::std::convert::From<EvmSmartAccountOwnersItem> for ::std::string::String {
12812 fn from(value: EvmSmartAccountOwnersItem) -> Self {
12813 value.0
12814 }
12815 }
12816 impl ::std::convert::From<&EvmSmartAccountOwnersItem> for EvmSmartAccountOwnersItem {
12817 fn from(value: &EvmSmartAccountOwnersItem) -> Self {
12818 value.clone()
12819 }
12820 }
12821 impl ::std::str::FromStr for EvmSmartAccountOwnersItem {
12822 type Err = self::error::ConversionError;
12823 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12824 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
12825 ::std::sync::LazyLock::new(|| {
12826 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
12827 });
12828 if PATTERN.find(value).is_none() {
12829 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
12830 }
12831 Ok(Self(value.to_string()))
12832 }
12833 }
12834 impl ::std::convert::TryFrom<&str> for EvmSmartAccountOwnersItem {
12835 type Error = self::error::ConversionError;
12836 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12837 value.parse()
12838 }
12839 }
12840 impl ::std::convert::TryFrom<&::std::string::String> for EvmSmartAccountOwnersItem {
12841 type Error = self::error::ConversionError;
12842 fn try_from(
12843 value: &::std::string::String,
12844 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12845 value.parse()
12846 }
12847 }
12848 impl ::std::convert::TryFrom<::std::string::String> for EvmSmartAccountOwnersItem {
12849 type Error = self::error::ConversionError;
12850 fn try_from(
12851 value: ::std::string::String,
12852 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12853 value.parse()
12854 }
12855 }
12856 impl<'de> ::serde::Deserialize<'de> for EvmSmartAccountOwnersItem {
12857 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
12858 where
12859 D: ::serde::Deserializer<'de>,
12860 {
12861 ::std::string::String::deserialize(deserializer)?
12862 .parse()
12863 .map_err(|e: self::error::ConversionError| {
12864 <D::Error as ::serde::de::Error>::custom(e.to_string())
12865 })
12866 }
12867 }
12868 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12880 #[serde(transparent)]
12881 pub struct EvmSmartAccountPoliciesItem(::std::string::String);
12882 impl ::std::ops::Deref for EvmSmartAccountPoliciesItem {
12883 type Target = ::std::string::String;
12884 fn deref(&self) -> &::std::string::String {
12885 &self.0
12886 }
12887 }
12888 impl ::std::convert::From<EvmSmartAccountPoliciesItem> for ::std::string::String {
12889 fn from(value: EvmSmartAccountPoliciesItem) -> Self {
12890 value.0
12891 }
12892 }
12893 impl ::std::convert::From<&EvmSmartAccountPoliciesItem> for EvmSmartAccountPoliciesItem {
12894 fn from(value: &EvmSmartAccountPoliciesItem) -> Self {
12895 value.clone()
12896 }
12897 }
12898 impl ::std::str::FromStr for EvmSmartAccountPoliciesItem {
12899 type Err = self::error::ConversionError;
12900 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12901 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
12902 || {
12903 ::regress::Regex::new(
12904 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
12905 )
12906 .unwrap()
12907 },
12908 );
12909 if PATTERN.find(value).is_none() {
12910 return Err(
12911 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
12912 .into(),
12913 );
12914 }
12915 Ok(Self(value.to_string()))
12916 }
12917 }
12918 impl ::std::convert::TryFrom<&str> for EvmSmartAccountPoliciesItem {
12919 type Error = self::error::ConversionError;
12920 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
12921 value.parse()
12922 }
12923 }
12924 impl ::std::convert::TryFrom<&::std::string::String> for EvmSmartAccountPoliciesItem {
12925 type Error = self::error::ConversionError;
12926 fn try_from(
12927 value: &::std::string::String,
12928 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12929 value.parse()
12930 }
12931 }
12932 impl ::std::convert::TryFrom<::std::string::String> for EvmSmartAccountPoliciesItem {
12933 type Error = self::error::ConversionError;
12934 fn try_from(
12935 value: ::std::string::String,
12936 ) -> ::std::result::Result<Self, self::error::ConversionError> {
12937 value.parse()
12938 }
12939 }
12940 impl<'de> ::serde::Deserialize<'de> for EvmSmartAccountPoliciesItem {
12941 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
12942 where
12943 D: ::serde::Deserializer<'de>,
12944 {
12945 ::std::string::String::deserialize(deserializer)?
12946 .parse()
12947 .map_err(|e: self::error::ConversionError| {
12948 <D::Error as ::serde::de::Error>::custom(e.to_string())
12949 })
12950 }
12951 }
12952 #[derive(
12973 ::serde::Deserialize,
12974 ::serde::Serialize,
12975 Clone,
12976 Copy,
12977 Debug,
12978 Eq,
12979 Hash,
12980 Ord,
12981 PartialEq,
12982 PartialOrd,
12983 )]
12984 pub enum EvmSwapsNetwork {
12985 #[serde(rename = "base")]
12986 Base,
12987 #[serde(rename = "ethereum")]
12988 Ethereum,
12989 #[serde(rename = "arbitrum")]
12990 Arbitrum,
12991 #[serde(rename = "optimism")]
12992 Optimism,
12993 }
12994 impl ::std::convert::From<&Self> for EvmSwapsNetwork {
12995 fn from(value: &EvmSwapsNetwork) -> Self {
12996 value.clone()
12997 }
12998 }
12999 impl ::std::fmt::Display for EvmSwapsNetwork {
13000 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
13001 match *self {
13002 Self::Base => f.write_str("base"),
13003 Self::Ethereum => f.write_str("ethereum"),
13004 Self::Arbitrum => f.write_str("arbitrum"),
13005 Self::Optimism => f.write_str("optimism"),
13006 }
13007 }
13008 }
13009 impl ::std::str::FromStr for EvmSwapsNetwork {
13010 type Err = self::error::ConversionError;
13011 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13012 match value {
13013 "base" => Ok(Self::Base),
13014 "ethereum" => Ok(Self::Ethereum),
13015 "arbitrum" => Ok(Self::Arbitrum),
13016 "optimism" => Ok(Self::Optimism),
13017 _ => Err("invalid value".into()),
13018 }
13019 }
13020 }
13021 impl ::std::convert::TryFrom<&str> for EvmSwapsNetwork {
13022 type Error = self::error::ConversionError;
13023 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13024 value.parse()
13025 }
13026 }
13027 impl ::std::convert::TryFrom<&::std::string::String> for EvmSwapsNetwork {
13028 type Error = self::error::ConversionError;
13029 fn try_from(
13030 value: &::std::string::String,
13031 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13032 value.parse()
13033 }
13034 }
13035 impl ::std::convert::TryFrom<::std::string::String> for EvmSwapsNetwork {
13036 type Error = self::error::ConversionError;
13037 fn try_from(
13038 value: ::std::string::String,
13039 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13040 value.parse()
13041 }
13042 }
13043 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
13097 pub struct EvmTypedAddressCondition {
13098 pub addresses: ::std::vec::Vec<EvmTypedAddressConditionAddressesItem>,
13100 pub operator: EvmTypedAddressConditionOperator,
13102 pub path: ::std::string::String,
13104 }
13105 impl ::std::convert::From<&EvmTypedAddressCondition> for EvmTypedAddressCondition {
13106 fn from(value: &EvmTypedAddressCondition) -> Self {
13107 value.clone()
13108 }
13109 }
13110 impl EvmTypedAddressCondition {
13111 pub fn builder() -> builder::EvmTypedAddressCondition {
13112 Default::default()
13113 }
13114 }
13115 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
13128 #[serde(transparent)]
13129 pub struct EvmTypedAddressConditionAddressesItem(::std::string::String);
13130 impl ::std::ops::Deref for EvmTypedAddressConditionAddressesItem {
13131 type Target = ::std::string::String;
13132 fn deref(&self) -> &::std::string::String {
13133 &self.0
13134 }
13135 }
13136 impl ::std::convert::From<EvmTypedAddressConditionAddressesItem> for ::std::string::String {
13137 fn from(value: EvmTypedAddressConditionAddressesItem) -> Self {
13138 value.0
13139 }
13140 }
13141 impl ::std::convert::From<&EvmTypedAddressConditionAddressesItem>
13142 for EvmTypedAddressConditionAddressesItem
13143 {
13144 fn from(value: &EvmTypedAddressConditionAddressesItem) -> Self {
13145 value.clone()
13146 }
13147 }
13148 impl ::std::str::FromStr for EvmTypedAddressConditionAddressesItem {
13149 type Err = self::error::ConversionError;
13150 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13151 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
13152 ::std::sync::LazyLock::new(|| {
13153 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
13154 });
13155 if PATTERN.find(value).is_none() {
13156 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
13157 }
13158 Ok(Self(value.to_string()))
13159 }
13160 }
13161 impl ::std::convert::TryFrom<&str> for EvmTypedAddressConditionAddressesItem {
13162 type Error = self::error::ConversionError;
13163 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13164 value.parse()
13165 }
13166 }
13167 impl ::std::convert::TryFrom<&::std::string::String> for EvmTypedAddressConditionAddressesItem {
13168 type Error = self::error::ConversionError;
13169 fn try_from(
13170 value: &::std::string::String,
13171 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13172 value.parse()
13173 }
13174 }
13175 impl ::std::convert::TryFrom<::std::string::String> for EvmTypedAddressConditionAddressesItem {
13176 type Error = self::error::ConversionError;
13177 fn try_from(
13178 value: ::std::string::String,
13179 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13180 value.parse()
13181 }
13182 }
13183 impl<'de> ::serde::Deserialize<'de> for EvmTypedAddressConditionAddressesItem {
13184 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
13185 where
13186 D: ::serde::Deserializer<'de>,
13187 {
13188 ::std::string::String::deserialize(deserializer)?
13189 .parse()
13190 .map_err(|e: self::error::ConversionError| {
13191 <D::Error as ::serde::de::Error>::custom(e.to_string())
13192 })
13193 }
13194 }
13195 #[derive(
13214 ::serde::Deserialize,
13215 ::serde::Serialize,
13216 Clone,
13217 Copy,
13218 Debug,
13219 Eq,
13220 Hash,
13221 Ord,
13222 PartialEq,
13223 PartialOrd,
13224 )]
13225 pub enum EvmTypedAddressConditionOperator {
13226 #[serde(rename = "in")]
13227 In,
13228 #[serde(rename = "not in")]
13229 NotIn,
13230 }
13231 impl ::std::convert::From<&Self> for EvmTypedAddressConditionOperator {
13232 fn from(value: &EvmTypedAddressConditionOperator) -> Self {
13233 value.clone()
13234 }
13235 }
13236 impl ::std::fmt::Display for EvmTypedAddressConditionOperator {
13237 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
13238 match *self {
13239 Self::In => f.write_str("in"),
13240 Self::NotIn => f.write_str("not in"),
13241 }
13242 }
13243 }
13244 impl ::std::str::FromStr for EvmTypedAddressConditionOperator {
13245 type Err = self::error::ConversionError;
13246 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13247 match value {
13248 "in" => Ok(Self::In),
13249 "not in" => Ok(Self::NotIn),
13250 _ => Err("invalid value".into()),
13251 }
13252 }
13253 }
13254 impl ::std::convert::TryFrom<&str> for EvmTypedAddressConditionOperator {
13255 type Error = self::error::ConversionError;
13256 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13257 value.parse()
13258 }
13259 }
13260 impl ::std::convert::TryFrom<&::std::string::String> for EvmTypedAddressConditionOperator {
13261 type Error = self::error::ConversionError;
13262 fn try_from(
13263 value: &::std::string::String,
13264 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13265 value.parse()
13266 }
13267 }
13268 impl ::std::convert::TryFrom<::std::string::String> for EvmTypedAddressConditionOperator {
13269 type Error = self::error::ConversionError;
13270 fn try_from(
13271 value: ::std::string::String,
13272 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13273 value.parse()
13274 }
13275 }
13276 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
13326 pub struct EvmTypedNumericalCondition {
13327 pub operator: EvmTypedNumericalConditionOperator,
13329 pub path: ::std::string::String,
13331 pub value: EvmTypedNumericalConditionValue,
13333 }
13334 impl ::std::convert::From<&EvmTypedNumericalCondition> for EvmTypedNumericalCondition {
13335 fn from(value: &EvmTypedNumericalCondition) -> Self {
13336 value.clone()
13337 }
13338 }
13339 impl EvmTypedNumericalCondition {
13340 pub fn builder() -> builder::EvmTypedNumericalCondition {
13341 Default::default()
13342 }
13343 }
13344 #[derive(
13366 ::serde::Deserialize,
13367 ::serde::Serialize,
13368 Clone,
13369 Copy,
13370 Debug,
13371 Eq,
13372 Hash,
13373 Ord,
13374 PartialEq,
13375 PartialOrd,
13376 )]
13377 pub enum EvmTypedNumericalConditionOperator {
13378 GreaterThan,
13379 GreaterThanOrEqual,
13380 LessThan,
13381 LessThanOrEqual,
13382 Equal,
13383 }
13384 impl ::std::convert::From<&Self> for EvmTypedNumericalConditionOperator {
13385 fn from(value: &EvmTypedNumericalConditionOperator) -> Self {
13386 value.clone()
13387 }
13388 }
13389 impl ::std::fmt::Display for EvmTypedNumericalConditionOperator {
13390 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
13391 match *self {
13392 Self::GreaterThan => f.write_str("GreaterThan"),
13393 Self::GreaterThanOrEqual => f.write_str("GreaterThanOrEqual"),
13394 Self::LessThan => f.write_str("LessThan"),
13395 Self::LessThanOrEqual => f.write_str("LessThanOrEqual"),
13396 Self::Equal => f.write_str("Equal"),
13397 }
13398 }
13399 }
13400 impl ::std::str::FromStr for EvmTypedNumericalConditionOperator {
13401 type Err = self::error::ConversionError;
13402 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13403 match value {
13404 "GreaterThan" => Ok(Self::GreaterThan),
13405 "GreaterThanOrEqual" => Ok(Self::GreaterThanOrEqual),
13406 "LessThan" => Ok(Self::LessThan),
13407 "LessThanOrEqual" => Ok(Self::LessThanOrEqual),
13408 "Equal" => Ok(Self::Equal),
13409 _ => Err("invalid value".into()),
13410 }
13411 }
13412 }
13413 impl ::std::convert::TryFrom<&str> for EvmTypedNumericalConditionOperator {
13414 type Error = self::error::ConversionError;
13415 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13416 value.parse()
13417 }
13418 }
13419 impl ::std::convert::TryFrom<&::std::string::String> for EvmTypedNumericalConditionOperator {
13420 type Error = self::error::ConversionError;
13421 fn try_from(
13422 value: &::std::string::String,
13423 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13424 value.parse()
13425 }
13426 }
13427 impl ::std::convert::TryFrom<::std::string::String> for EvmTypedNumericalConditionOperator {
13428 type Error = self::error::ConversionError;
13429 fn try_from(
13430 value: ::std::string::String,
13431 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13432 value.parse()
13433 }
13434 }
13435 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
13451 #[serde(transparent)]
13452 pub struct EvmTypedNumericalConditionValue(::std::string::String);
13453 impl ::std::ops::Deref for EvmTypedNumericalConditionValue {
13454 type Target = ::std::string::String;
13455 fn deref(&self) -> &::std::string::String {
13456 &self.0
13457 }
13458 }
13459 impl ::std::convert::From<EvmTypedNumericalConditionValue> for ::std::string::String {
13460 fn from(value: EvmTypedNumericalConditionValue) -> Self {
13461 value.0
13462 }
13463 }
13464 impl ::std::convert::From<&EvmTypedNumericalConditionValue> for EvmTypedNumericalConditionValue {
13465 fn from(value: &EvmTypedNumericalConditionValue) -> Self {
13466 value.clone()
13467 }
13468 }
13469 impl ::std::str::FromStr for EvmTypedNumericalConditionValue {
13470 type Err = self::error::ConversionError;
13471 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13472 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
13473 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[0-9]+$").unwrap());
13474 if PATTERN.find(value).is_none() {
13475 return Err("doesn't match pattern \"^[0-9]+$\"".into());
13476 }
13477 Ok(Self(value.to_string()))
13478 }
13479 }
13480 impl ::std::convert::TryFrom<&str> for EvmTypedNumericalConditionValue {
13481 type Error = self::error::ConversionError;
13482 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13483 value.parse()
13484 }
13485 }
13486 impl ::std::convert::TryFrom<&::std::string::String> for EvmTypedNumericalConditionValue {
13487 type Error = self::error::ConversionError;
13488 fn try_from(
13489 value: &::std::string::String,
13490 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13491 value.parse()
13492 }
13493 }
13494 impl ::std::convert::TryFrom<::std::string::String> for EvmTypedNumericalConditionValue {
13495 type Error = self::error::ConversionError;
13496 fn try_from(
13497 value: ::std::string::String,
13498 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13499 value.parse()
13500 }
13501 }
13502 impl<'de> ::serde::Deserialize<'de> for EvmTypedNumericalConditionValue {
13503 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
13504 where
13505 D: ::serde::Deserializer<'de>,
13506 {
13507 ::std::string::String::deserialize(deserializer)?
13508 .parse()
13509 .map_err(|e: self::error::ConversionError| {
13510 <D::Error as ::serde::de::Error>::custom(e.to_string())
13511 })
13512 }
13513 }
13514 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
13548 pub struct EvmTypedStringCondition {
13549 #[serde(rename = "match")]
13551 pub match_: ::std::string::String,
13552 pub path: ::std::string::String,
13554 }
13555 impl ::std::convert::From<&EvmTypedStringCondition> for EvmTypedStringCondition {
13556 fn from(value: &EvmTypedStringCondition) -> Self {
13557 value.clone()
13558 }
13559 }
13560 impl EvmTypedStringCondition {
13561 pub fn builder() -> builder::EvmTypedStringCondition {
13562 Default::default()
13563 }
13564 }
13565 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
13659 pub struct EvmUserOperation {
13660 pub calls: ::std::vec::Vec<EvmCall>,
13662 pub network: EvmUserOperationNetwork,
13663 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
13665 pub receipts: ::std::vec::Vec<UserOperationReceipt>,
13666 pub status: EvmUserOperationStatus,
13668 #[serde(
13670 rename = "transactionHash",
13671 default,
13672 skip_serializing_if = "::std::option::Option::is_none"
13673 )]
13674 pub transaction_hash: ::std::option::Option<EvmUserOperationTransactionHash>,
13675 #[serde(rename = "userOpHash")]
13677 pub user_op_hash: EvmUserOperationUserOpHash,
13678 }
13679 impl ::std::convert::From<&EvmUserOperation> for EvmUserOperation {
13680 fn from(value: &EvmUserOperation) -> Self {
13681 value.clone()
13682 }
13683 }
13684 impl EvmUserOperation {
13685 pub fn builder() -> builder::EvmUserOperation {
13686 Default::default()
13687 }
13688 }
13689 #[derive(
13716 ::serde::Deserialize,
13717 ::serde::Serialize,
13718 Clone,
13719 Copy,
13720 Debug,
13721 Eq,
13722 Hash,
13723 Ord,
13724 PartialEq,
13725 PartialOrd,
13726 )]
13727 pub enum EvmUserOperationNetwork {
13728 #[serde(rename = "base-sepolia")]
13729 BaseSepolia,
13730 #[serde(rename = "base")]
13731 Base,
13732 #[serde(rename = "arbitrum")]
13733 Arbitrum,
13734 #[serde(rename = "optimism")]
13735 Optimism,
13736 #[serde(rename = "zora")]
13737 Zora,
13738 #[serde(rename = "polygon")]
13739 Polygon,
13740 #[serde(rename = "bnb")]
13741 Bnb,
13742 #[serde(rename = "avalanche")]
13743 Avalanche,
13744 #[serde(rename = "ethereum")]
13745 Ethereum,
13746 #[serde(rename = "ethereum-sepolia")]
13747 EthereumSepolia,
13748 }
13749 impl ::std::convert::From<&Self> for EvmUserOperationNetwork {
13750 fn from(value: &EvmUserOperationNetwork) -> Self {
13751 value.clone()
13752 }
13753 }
13754 impl ::std::fmt::Display for EvmUserOperationNetwork {
13755 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
13756 match *self {
13757 Self::BaseSepolia => f.write_str("base-sepolia"),
13758 Self::Base => f.write_str("base"),
13759 Self::Arbitrum => f.write_str("arbitrum"),
13760 Self::Optimism => f.write_str("optimism"),
13761 Self::Zora => f.write_str("zora"),
13762 Self::Polygon => f.write_str("polygon"),
13763 Self::Bnb => f.write_str("bnb"),
13764 Self::Avalanche => f.write_str("avalanche"),
13765 Self::Ethereum => f.write_str("ethereum"),
13766 Self::EthereumSepolia => f.write_str("ethereum-sepolia"),
13767 }
13768 }
13769 }
13770 impl ::std::str::FromStr for EvmUserOperationNetwork {
13771 type Err = self::error::ConversionError;
13772 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13773 match value {
13774 "base-sepolia" => Ok(Self::BaseSepolia),
13775 "base" => Ok(Self::Base),
13776 "arbitrum" => Ok(Self::Arbitrum),
13777 "optimism" => Ok(Self::Optimism),
13778 "zora" => Ok(Self::Zora),
13779 "polygon" => Ok(Self::Polygon),
13780 "bnb" => Ok(Self::Bnb),
13781 "avalanche" => Ok(Self::Avalanche),
13782 "ethereum" => Ok(Self::Ethereum),
13783 "ethereum-sepolia" => Ok(Self::EthereumSepolia),
13784 _ => Err("invalid value".into()),
13785 }
13786 }
13787 }
13788 impl ::std::convert::TryFrom<&str> for EvmUserOperationNetwork {
13789 type Error = self::error::ConversionError;
13790 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13791 value.parse()
13792 }
13793 }
13794 impl ::std::convert::TryFrom<&::std::string::String> for EvmUserOperationNetwork {
13795 type Error = self::error::ConversionError;
13796 fn try_from(
13797 value: &::std::string::String,
13798 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13799 value.parse()
13800 }
13801 }
13802 impl ::std::convert::TryFrom<::std::string::String> for EvmUserOperationNetwork {
13803 type Error = self::error::ConversionError;
13804 fn try_from(
13805 value: ::std::string::String,
13806 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13807 value.parse()
13808 }
13809 }
13810 #[derive(
13833 ::serde::Deserialize,
13834 ::serde::Serialize,
13835 Clone,
13836 Copy,
13837 Debug,
13838 Eq,
13839 Hash,
13840 Ord,
13841 PartialEq,
13842 PartialOrd,
13843 )]
13844 pub enum EvmUserOperationStatus {
13845 #[serde(rename = "pending")]
13846 Pending,
13847 #[serde(rename = "signed")]
13848 Signed,
13849 #[serde(rename = "broadcast")]
13850 Broadcast,
13851 #[serde(rename = "complete")]
13852 Complete,
13853 #[serde(rename = "dropped")]
13854 Dropped,
13855 #[serde(rename = "failed")]
13856 Failed,
13857 }
13858 impl ::std::convert::From<&Self> for EvmUserOperationStatus {
13859 fn from(value: &EvmUserOperationStatus) -> Self {
13860 value.clone()
13861 }
13862 }
13863 impl ::std::fmt::Display for EvmUserOperationStatus {
13864 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
13865 match *self {
13866 Self::Pending => f.write_str("pending"),
13867 Self::Signed => f.write_str("signed"),
13868 Self::Broadcast => f.write_str("broadcast"),
13869 Self::Complete => f.write_str("complete"),
13870 Self::Dropped => f.write_str("dropped"),
13871 Self::Failed => f.write_str("failed"),
13872 }
13873 }
13874 }
13875 impl ::std::str::FromStr for EvmUserOperationStatus {
13876 type Err = self::error::ConversionError;
13877 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13878 match value {
13879 "pending" => Ok(Self::Pending),
13880 "signed" => Ok(Self::Signed),
13881 "broadcast" => Ok(Self::Broadcast),
13882 "complete" => Ok(Self::Complete),
13883 "dropped" => Ok(Self::Dropped),
13884 "failed" => Ok(Self::Failed),
13885 _ => Err("invalid value".into()),
13886 }
13887 }
13888 }
13889 impl ::std::convert::TryFrom<&str> for EvmUserOperationStatus {
13890 type Error = self::error::ConversionError;
13891 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13892 value.parse()
13893 }
13894 }
13895 impl ::std::convert::TryFrom<&::std::string::String> for EvmUserOperationStatus {
13896 type Error = self::error::ConversionError;
13897 fn try_from(
13898 value: &::std::string::String,
13899 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13900 value.parse()
13901 }
13902 }
13903 impl ::std::convert::TryFrom<::std::string::String> for EvmUserOperationStatus {
13904 type Error = self::error::ConversionError;
13905 fn try_from(
13906 value: ::std::string::String,
13907 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13908 value.parse()
13909 }
13910 }
13911 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
13927 #[serde(transparent)]
13928 pub struct EvmUserOperationTransactionHash(::std::string::String);
13929 impl ::std::ops::Deref for EvmUserOperationTransactionHash {
13930 type Target = ::std::string::String;
13931 fn deref(&self) -> &::std::string::String {
13932 &self.0
13933 }
13934 }
13935 impl ::std::convert::From<EvmUserOperationTransactionHash> for ::std::string::String {
13936 fn from(value: EvmUserOperationTransactionHash) -> Self {
13937 value.0
13938 }
13939 }
13940 impl ::std::convert::From<&EvmUserOperationTransactionHash> for EvmUserOperationTransactionHash {
13941 fn from(value: &EvmUserOperationTransactionHash) -> Self {
13942 value.clone()
13943 }
13944 }
13945 impl ::std::str::FromStr for EvmUserOperationTransactionHash {
13946 type Err = self::error::ConversionError;
13947 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13948 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
13949 ::std::sync::LazyLock::new(|| {
13950 ::regress::Regex::new("^0x[0-9a-fA-F]{64}$|^$").unwrap()
13951 });
13952 if PATTERN.find(value).is_none() {
13953 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{64}$|^$\"".into());
13954 }
13955 Ok(Self(value.to_string()))
13956 }
13957 }
13958 impl ::std::convert::TryFrom<&str> for EvmUserOperationTransactionHash {
13959 type Error = self::error::ConversionError;
13960 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
13961 value.parse()
13962 }
13963 }
13964 impl ::std::convert::TryFrom<&::std::string::String> for EvmUserOperationTransactionHash {
13965 type Error = self::error::ConversionError;
13966 fn try_from(
13967 value: &::std::string::String,
13968 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13969 value.parse()
13970 }
13971 }
13972 impl ::std::convert::TryFrom<::std::string::String> for EvmUserOperationTransactionHash {
13973 type Error = self::error::ConversionError;
13974 fn try_from(
13975 value: ::std::string::String,
13976 ) -> ::std::result::Result<Self, self::error::ConversionError> {
13977 value.parse()
13978 }
13979 }
13980 impl<'de> ::serde::Deserialize<'de> for EvmUserOperationTransactionHash {
13981 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
13982 where
13983 D: ::serde::Deserializer<'de>,
13984 {
13985 ::std::string::String::deserialize(deserializer)?
13986 .parse()
13987 .map_err(|e: self::error::ConversionError| {
13988 <D::Error as ::serde::de::Error>::custom(e.to_string())
13989 })
13990 }
13991 }
13992 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14008 #[serde(transparent)]
14009 pub struct EvmUserOperationUserOpHash(::std::string::String);
14010 impl ::std::ops::Deref for EvmUserOperationUserOpHash {
14011 type Target = ::std::string::String;
14012 fn deref(&self) -> &::std::string::String {
14013 &self.0
14014 }
14015 }
14016 impl ::std::convert::From<EvmUserOperationUserOpHash> for ::std::string::String {
14017 fn from(value: EvmUserOperationUserOpHash) -> Self {
14018 value.0
14019 }
14020 }
14021 impl ::std::convert::From<&EvmUserOperationUserOpHash> for EvmUserOperationUserOpHash {
14022 fn from(value: &EvmUserOperationUserOpHash) -> Self {
14023 value.clone()
14024 }
14025 }
14026 impl ::std::str::FromStr for EvmUserOperationUserOpHash {
14027 type Err = self::error::ConversionError;
14028 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14029 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
14030 ::std::sync::LazyLock::new(|| {
14031 ::regress::Regex::new("^0x[0-9a-fA-F]{64}$").unwrap()
14032 });
14033 if PATTERN.find(value).is_none() {
14034 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{64}$\"".into());
14035 }
14036 Ok(Self(value.to_string()))
14037 }
14038 }
14039 impl ::std::convert::TryFrom<&str> for EvmUserOperationUserOpHash {
14040 type Error = self::error::ConversionError;
14041 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14042 value.parse()
14043 }
14044 }
14045 impl ::std::convert::TryFrom<&::std::string::String> for EvmUserOperationUserOpHash {
14046 type Error = self::error::ConversionError;
14047 fn try_from(
14048 value: &::std::string::String,
14049 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14050 value.parse()
14051 }
14052 }
14053 impl ::std::convert::TryFrom<::std::string::String> for EvmUserOperationUserOpHash {
14054 type Error = self::error::ConversionError;
14055 fn try_from(
14056 value: ::std::string::String,
14057 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14058 value.parse()
14059 }
14060 }
14061 impl<'de> ::serde::Deserialize<'de> for EvmUserOperationUserOpHash {
14062 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
14063 where
14064 D: ::serde::Deserializer<'de>,
14065 {
14066 ::std::string::String::deserialize(deserializer)?
14067 .parse()
14068 .map_err(|e: self::error::ConversionError| {
14069 <D::Error as ::serde::de::Error>::custom(e.to_string())
14070 })
14071 }
14072 }
14073 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14085 #[serde(transparent)]
14086 pub struct ExportEvmAccountAddress(::std::string::String);
14087 impl ::std::ops::Deref for ExportEvmAccountAddress {
14088 type Target = ::std::string::String;
14089 fn deref(&self) -> &::std::string::String {
14090 &self.0
14091 }
14092 }
14093 impl ::std::convert::From<ExportEvmAccountAddress> for ::std::string::String {
14094 fn from(value: ExportEvmAccountAddress) -> Self {
14095 value.0
14096 }
14097 }
14098 impl ::std::convert::From<&ExportEvmAccountAddress> for ExportEvmAccountAddress {
14099 fn from(value: &ExportEvmAccountAddress) -> Self {
14100 value.clone()
14101 }
14102 }
14103 impl ::std::str::FromStr for ExportEvmAccountAddress {
14104 type Err = self::error::ConversionError;
14105 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14106 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
14107 ::std::sync::LazyLock::new(|| {
14108 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
14109 });
14110 if PATTERN.find(value).is_none() {
14111 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
14112 }
14113 Ok(Self(value.to_string()))
14114 }
14115 }
14116 impl ::std::convert::TryFrom<&str> for ExportEvmAccountAddress {
14117 type Error = self::error::ConversionError;
14118 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14119 value.parse()
14120 }
14121 }
14122 impl ::std::convert::TryFrom<&::std::string::String> for ExportEvmAccountAddress {
14123 type Error = self::error::ConversionError;
14124 fn try_from(
14125 value: &::std::string::String,
14126 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14127 value.parse()
14128 }
14129 }
14130 impl ::std::convert::TryFrom<::std::string::String> for ExportEvmAccountAddress {
14131 type Error = self::error::ConversionError;
14132 fn try_from(
14133 value: ::std::string::String,
14134 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14135 value.parse()
14136 }
14137 }
14138 impl<'de> ::serde::Deserialize<'de> for ExportEvmAccountAddress {
14139 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
14140 where
14141 D: ::serde::Deserializer<'de>,
14142 {
14143 ::std::string::String::deserialize(deserializer)?
14144 .parse()
14145 .map_err(|e: self::error::ConversionError| {
14146 <D::Error as ::serde::de::Error>::custom(e.to_string())
14147 })
14148 }
14149 }
14150 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
14173 pub struct ExportEvmAccountBody {
14174 #[serde(rename = "exportEncryptionKey")]
14176 pub export_encryption_key: ::std::string::String,
14177 }
14178 impl ::std::convert::From<&ExportEvmAccountBody> for ExportEvmAccountBody {
14179 fn from(value: &ExportEvmAccountBody) -> Self {
14180 value.clone()
14181 }
14182 }
14183 impl ExportEvmAccountBody {
14184 pub fn builder() -> builder::ExportEvmAccountBody {
14185 Default::default()
14186 }
14187 }
14188 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
14211 pub struct ExportEvmAccountByNameBody {
14212 #[serde(rename = "exportEncryptionKey")]
14214 pub export_encryption_key: ::std::string::String,
14215 }
14216 impl ::std::convert::From<&ExportEvmAccountByNameBody> for ExportEvmAccountByNameBody {
14217 fn from(value: &ExportEvmAccountByNameBody) -> Self {
14218 value.clone()
14219 }
14220 }
14221 impl ExportEvmAccountByNameBody {
14222 pub fn builder() -> builder::ExportEvmAccountByNameBody {
14223 Default::default()
14224 }
14225 }
14226 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
14249 pub struct ExportEvmAccountByNameResponse {
14250 #[serde(rename = "encryptedPrivateKey")]
14252 pub encrypted_private_key: ::std::string::String,
14253 }
14254 impl ::std::convert::From<&ExportEvmAccountByNameResponse> for ExportEvmAccountByNameResponse {
14255 fn from(value: &ExportEvmAccountByNameResponse) -> Self {
14256 value.clone()
14257 }
14258 }
14259 impl ExportEvmAccountByNameResponse {
14260 pub fn builder() -> builder::ExportEvmAccountByNameResponse {
14261 Default::default()
14262 }
14263 }
14264 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14278 #[serde(transparent)]
14279 pub struct ExportEvmAccountByNameXIdempotencyKey(::std::string::String);
14280 impl ::std::ops::Deref for ExportEvmAccountByNameXIdempotencyKey {
14281 type Target = ::std::string::String;
14282 fn deref(&self) -> &::std::string::String {
14283 &self.0
14284 }
14285 }
14286 impl ::std::convert::From<ExportEvmAccountByNameXIdempotencyKey> for ::std::string::String {
14287 fn from(value: ExportEvmAccountByNameXIdempotencyKey) -> Self {
14288 value.0
14289 }
14290 }
14291 impl ::std::convert::From<&ExportEvmAccountByNameXIdempotencyKey>
14292 for ExportEvmAccountByNameXIdempotencyKey
14293 {
14294 fn from(value: &ExportEvmAccountByNameXIdempotencyKey) -> Self {
14295 value.clone()
14296 }
14297 }
14298 impl ::std::str::FromStr for ExportEvmAccountByNameXIdempotencyKey {
14299 type Err = self::error::ConversionError;
14300 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14301 if value.chars().count() > 36usize {
14302 return Err("longer than 36 characters".into());
14303 }
14304 if value.chars().count() < 36usize {
14305 return Err("shorter than 36 characters".into());
14306 }
14307 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
14308 ::std::sync::LazyLock::new(|| {
14309 ::regress::Regex::new(
14310 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
14311 )
14312 .unwrap()
14313 });
14314 if PATTERN.find(value).is_none() {
14315 return Err(
14316 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
14317 .into(),
14318 );
14319 }
14320 Ok(Self(value.to_string()))
14321 }
14322 }
14323 impl ::std::convert::TryFrom<&str> for ExportEvmAccountByNameXIdempotencyKey {
14324 type Error = self::error::ConversionError;
14325 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14326 value.parse()
14327 }
14328 }
14329 impl ::std::convert::TryFrom<&::std::string::String> for ExportEvmAccountByNameXIdempotencyKey {
14330 type Error = self::error::ConversionError;
14331 fn try_from(
14332 value: &::std::string::String,
14333 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14334 value.parse()
14335 }
14336 }
14337 impl ::std::convert::TryFrom<::std::string::String> for ExportEvmAccountByNameXIdempotencyKey {
14338 type Error = self::error::ConversionError;
14339 fn try_from(
14340 value: ::std::string::String,
14341 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14342 value.parse()
14343 }
14344 }
14345 impl<'de> ::serde::Deserialize<'de> for ExportEvmAccountByNameXIdempotencyKey {
14346 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
14347 where
14348 D: ::serde::Deserializer<'de>,
14349 {
14350 ::std::string::String::deserialize(deserializer)?
14351 .parse()
14352 .map_err(|e: self::error::ConversionError| {
14353 <D::Error as ::serde::de::Error>::custom(e.to_string())
14354 })
14355 }
14356 }
14357 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
14380 pub struct ExportEvmAccountResponse {
14381 #[serde(rename = "encryptedPrivateKey")]
14383 pub encrypted_private_key: ::std::string::String,
14384 }
14385 impl ::std::convert::From<&ExportEvmAccountResponse> for ExportEvmAccountResponse {
14386 fn from(value: &ExportEvmAccountResponse) -> Self {
14387 value.clone()
14388 }
14389 }
14390 impl ExportEvmAccountResponse {
14391 pub fn builder() -> builder::ExportEvmAccountResponse {
14392 Default::default()
14393 }
14394 }
14395 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14409 #[serde(transparent)]
14410 pub struct ExportEvmAccountXIdempotencyKey(::std::string::String);
14411 impl ::std::ops::Deref for ExportEvmAccountXIdempotencyKey {
14412 type Target = ::std::string::String;
14413 fn deref(&self) -> &::std::string::String {
14414 &self.0
14415 }
14416 }
14417 impl ::std::convert::From<ExportEvmAccountXIdempotencyKey> for ::std::string::String {
14418 fn from(value: ExportEvmAccountXIdempotencyKey) -> Self {
14419 value.0
14420 }
14421 }
14422 impl ::std::convert::From<&ExportEvmAccountXIdempotencyKey> for ExportEvmAccountXIdempotencyKey {
14423 fn from(value: &ExportEvmAccountXIdempotencyKey) -> Self {
14424 value.clone()
14425 }
14426 }
14427 impl ::std::str::FromStr for ExportEvmAccountXIdempotencyKey {
14428 type Err = self::error::ConversionError;
14429 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14430 if value.chars().count() > 36usize {
14431 return Err("longer than 36 characters".into());
14432 }
14433 if value.chars().count() < 36usize {
14434 return Err("shorter than 36 characters".into());
14435 }
14436 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
14437 ::std::sync::LazyLock::new(|| {
14438 ::regress::Regex::new(
14439 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
14440 )
14441 .unwrap()
14442 });
14443 if PATTERN.find(value).is_none() {
14444 return Err(
14445 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
14446 .into(),
14447 );
14448 }
14449 Ok(Self(value.to_string()))
14450 }
14451 }
14452 impl ::std::convert::TryFrom<&str> for ExportEvmAccountXIdempotencyKey {
14453 type Error = self::error::ConversionError;
14454 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14455 value.parse()
14456 }
14457 }
14458 impl ::std::convert::TryFrom<&::std::string::String> for ExportEvmAccountXIdempotencyKey {
14459 type Error = self::error::ConversionError;
14460 fn try_from(
14461 value: &::std::string::String,
14462 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14463 value.parse()
14464 }
14465 }
14466 impl ::std::convert::TryFrom<::std::string::String> for ExportEvmAccountXIdempotencyKey {
14467 type Error = self::error::ConversionError;
14468 fn try_from(
14469 value: ::std::string::String,
14470 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14471 value.parse()
14472 }
14473 }
14474 impl<'de> ::serde::Deserialize<'de> for ExportEvmAccountXIdempotencyKey {
14475 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
14476 where
14477 D: ::serde::Deserializer<'de>,
14478 {
14479 ::std::string::String::deserialize(deserializer)?
14480 .parse()
14481 .map_err(|e: self::error::ConversionError| {
14482 <D::Error as ::serde::de::Error>::custom(e.to_string())
14483 })
14484 }
14485 }
14486 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14498 #[serde(transparent)]
14499 pub struct ExportSolanaAccountAddress(::std::string::String);
14500 impl ::std::ops::Deref for ExportSolanaAccountAddress {
14501 type Target = ::std::string::String;
14502 fn deref(&self) -> &::std::string::String {
14503 &self.0
14504 }
14505 }
14506 impl ::std::convert::From<ExportSolanaAccountAddress> for ::std::string::String {
14507 fn from(value: ExportSolanaAccountAddress) -> Self {
14508 value.0
14509 }
14510 }
14511 impl ::std::convert::From<&ExportSolanaAccountAddress> for ExportSolanaAccountAddress {
14512 fn from(value: &ExportSolanaAccountAddress) -> Self {
14513 value.clone()
14514 }
14515 }
14516 impl ::std::str::FromStr for ExportSolanaAccountAddress {
14517 type Err = self::error::ConversionError;
14518 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14519 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
14520 ::std::sync::LazyLock::new(|| {
14521 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
14522 });
14523 if PATTERN.find(value).is_none() {
14524 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
14525 }
14526 Ok(Self(value.to_string()))
14527 }
14528 }
14529 impl ::std::convert::TryFrom<&str> for ExportSolanaAccountAddress {
14530 type Error = self::error::ConversionError;
14531 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14532 value.parse()
14533 }
14534 }
14535 impl ::std::convert::TryFrom<&::std::string::String> for ExportSolanaAccountAddress {
14536 type Error = self::error::ConversionError;
14537 fn try_from(
14538 value: &::std::string::String,
14539 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14540 value.parse()
14541 }
14542 }
14543 impl ::std::convert::TryFrom<::std::string::String> for ExportSolanaAccountAddress {
14544 type Error = self::error::ConversionError;
14545 fn try_from(
14546 value: ::std::string::String,
14547 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14548 value.parse()
14549 }
14550 }
14551 impl<'de> ::serde::Deserialize<'de> for ExportSolanaAccountAddress {
14552 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
14553 where
14554 D: ::serde::Deserializer<'de>,
14555 {
14556 ::std::string::String::deserialize(deserializer)?
14557 .parse()
14558 .map_err(|e: self::error::ConversionError| {
14559 <D::Error as ::serde::de::Error>::custom(e.to_string())
14560 })
14561 }
14562 }
14563 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
14586 pub struct ExportSolanaAccountBody {
14587 #[serde(rename = "exportEncryptionKey")]
14589 pub export_encryption_key: ::std::string::String,
14590 }
14591 impl ::std::convert::From<&ExportSolanaAccountBody> for ExportSolanaAccountBody {
14592 fn from(value: &ExportSolanaAccountBody) -> Self {
14593 value.clone()
14594 }
14595 }
14596 impl ExportSolanaAccountBody {
14597 pub fn builder() -> builder::ExportSolanaAccountBody {
14598 Default::default()
14599 }
14600 }
14601 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
14624 pub struct ExportSolanaAccountByNameBody {
14625 #[serde(rename = "exportEncryptionKey")]
14627 pub export_encryption_key: ::std::string::String,
14628 }
14629 impl ::std::convert::From<&ExportSolanaAccountByNameBody> for ExportSolanaAccountByNameBody {
14630 fn from(value: &ExportSolanaAccountByNameBody) -> Self {
14631 value.clone()
14632 }
14633 }
14634 impl ExportSolanaAccountByNameBody {
14635 pub fn builder() -> builder::ExportSolanaAccountByNameBody {
14636 Default::default()
14637 }
14638 }
14639 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
14662 pub struct ExportSolanaAccountByNameResponse {
14663 #[serde(rename = "encryptedPrivateKey")]
14665 pub encrypted_private_key: ::std::string::String,
14666 }
14667 impl ::std::convert::From<&ExportSolanaAccountByNameResponse>
14668 for ExportSolanaAccountByNameResponse
14669 {
14670 fn from(value: &ExportSolanaAccountByNameResponse) -> Self {
14671 value.clone()
14672 }
14673 }
14674 impl ExportSolanaAccountByNameResponse {
14675 pub fn builder() -> builder::ExportSolanaAccountByNameResponse {
14676 Default::default()
14677 }
14678 }
14679 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14693 #[serde(transparent)]
14694 pub struct ExportSolanaAccountByNameXIdempotencyKey(::std::string::String);
14695 impl ::std::ops::Deref for ExportSolanaAccountByNameXIdempotencyKey {
14696 type Target = ::std::string::String;
14697 fn deref(&self) -> &::std::string::String {
14698 &self.0
14699 }
14700 }
14701 impl ::std::convert::From<ExportSolanaAccountByNameXIdempotencyKey> for ::std::string::String {
14702 fn from(value: ExportSolanaAccountByNameXIdempotencyKey) -> Self {
14703 value.0
14704 }
14705 }
14706 impl ::std::convert::From<&ExportSolanaAccountByNameXIdempotencyKey>
14707 for ExportSolanaAccountByNameXIdempotencyKey
14708 {
14709 fn from(value: &ExportSolanaAccountByNameXIdempotencyKey) -> Self {
14710 value.clone()
14711 }
14712 }
14713 impl ::std::str::FromStr for ExportSolanaAccountByNameXIdempotencyKey {
14714 type Err = self::error::ConversionError;
14715 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14716 if value.chars().count() > 36usize {
14717 return Err("longer than 36 characters".into());
14718 }
14719 if value.chars().count() < 36usize {
14720 return Err("shorter than 36 characters".into());
14721 }
14722 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
14723 ::std::sync::LazyLock::new(|| {
14724 ::regress::Regex::new(
14725 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
14726 )
14727 .unwrap()
14728 });
14729 if PATTERN.find(value).is_none() {
14730 return Err(
14731 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
14732 .into(),
14733 );
14734 }
14735 Ok(Self(value.to_string()))
14736 }
14737 }
14738 impl ::std::convert::TryFrom<&str> for ExportSolanaAccountByNameXIdempotencyKey {
14739 type Error = self::error::ConversionError;
14740 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14741 value.parse()
14742 }
14743 }
14744 impl ::std::convert::TryFrom<&::std::string::String> for ExportSolanaAccountByNameXIdempotencyKey {
14745 type Error = self::error::ConversionError;
14746 fn try_from(
14747 value: &::std::string::String,
14748 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14749 value.parse()
14750 }
14751 }
14752 impl ::std::convert::TryFrom<::std::string::String> for ExportSolanaAccountByNameXIdempotencyKey {
14753 type Error = self::error::ConversionError;
14754 fn try_from(
14755 value: ::std::string::String,
14756 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14757 value.parse()
14758 }
14759 }
14760 impl<'de> ::serde::Deserialize<'de> for ExportSolanaAccountByNameXIdempotencyKey {
14761 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
14762 where
14763 D: ::serde::Deserializer<'de>,
14764 {
14765 ::std::string::String::deserialize(deserializer)?
14766 .parse()
14767 .map_err(|e: self::error::ConversionError| {
14768 <D::Error as ::serde::de::Error>::custom(e.to_string())
14769 })
14770 }
14771 }
14772 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
14795 pub struct ExportSolanaAccountResponse {
14796 #[serde(rename = "encryptedPrivateKey")]
14798 pub encrypted_private_key: ::std::string::String,
14799 }
14800 impl ::std::convert::From<&ExportSolanaAccountResponse> for ExportSolanaAccountResponse {
14801 fn from(value: &ExportSolanaAccountResponse) -> Self {
14802 value.clone()
14803 }
14804 }
14805 impl ExportSolanaAccountResponse {
14806 pub fn builder() -> builder::ExportSolanaAccountResponse {
14807 Default::default()
14808 }
14809 }
14810 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14824 #[serde(transparent)]
14825 pub struct ExportSolanaAccountXIdempotencyKey(::std::string::String);
14826 impl ::std::ops::Deref for ExportSolanaAccountXIdempotencyKey {
14827 type Target = ::std::string::String;
14828 fn deref(&self) -> &::std::string::String {
14829 &self.0
14830 }
14831 }
14832 impl ::std::convert::From<ExportSolanaAccountXIdempotencyKey> for ::std::string::String {
14833 fn from(value: ExportSolanaAccountXIdempotencyKey) -> Self {
14834 value.0
14835 }
14836 }
14837 impl ::std::convert::From<&ExportSolanaAccountXIdempotencyKey>
14838 for ExportSolanaAccountXIdempotencyKey
14839 {
14840 fn from(value: &ExportSolanaAccountXIdempotencyKey) -> Self {
14841 value.clone()
14842 }
14843 }
14844 impl ::std::str::FromStr for ExportSolanaAccountXIdempotencyKey {
14845 type Err = self::error::ConversionError;
14846 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14847 if value.chars().count() > 36usize {
14848 return Err("longer than 36 characters".into());
14849 }
14850 if value.chars().count() < 36usize {
14851 return Err("shorter than 36 characters".into());
14852 }
14853 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
14854 ::std::sync::LazyLock::new(|| {
14855 ::regress::Regex::new(
14856 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
14857 )
14858 .unwrap()
14859 });
14860 if PATTERN.find(value).is_none() {
14861 return Err(
14862 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
14863 .into(),
14864 );
14865 }
14866 Ok(Self(value.to_string()))
14867 }
14868 }
14869 impl ::std::convert::TryFrom<&str> for ExportSolanaAccountXIdempotencyKey {
14870 type Error = self::error::ConversionError;
14871 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14872 value.parse()
14873 }
14874 }
14875 impl ::std::convert::TryFrom<&::std::string::String> for ExportSolanaAccountXIdempotencyKey {
14876 type Error = self::error::ConversionError;
14877 fn try_from(
14878 value: &::std::string::String,
14879 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14880 value.parse()
14881 }
14882 }
14883 impl ::std::convert::TryFrom<::std::string::String> for ExportSolanaAccountXIdempotencyKey {
14884 type Error = self::error::ConversionError;
14885 fn try_from(
14886 value: ::std::string::String,
14887 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14888 value.parse()
14889 }
14890 }
14891 impl<'de> ::serde::Deserialize<'de> for ExportSolanaAccountXIdempotencyKey {
14892 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
14893 where
14894 D: ::serde::Deserializer<'de>,
14895 {
14896 ::std::string::String::deserialize(deserializer)?
14897 .parse()
14898 .map_err(|e: self::error::ConversionError| {
14899 <D::Error as ::serde::de::Error>::custom(e.to_string())
14900 })
14901 }
14902 }
14903 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14919 #[serde(transparent)]
14920 pub struct FromAmount(::std::string::String);
14921 impl ::std::ops::Deref for FromAmount {
14922 type Target = ::std::string::String;
14923 fn deref(&self) -> &::std::string::String {
14924 &self.0
14925 }
14926 }
14927 impl ::std::convert::From<FromAmount> for ::std::string::String {
14928 fn from(value: FromAmount) -> Self {
14929 value.0
14930 }
14931 }
14932 impl ::std::convert::From<&FromAmount> for FromAmount {
14933 fn from(value: &FromAmount) -> Self {
14934 value.clone()
14935 }
14936 }
14937 impl ::std::str::FromStr for FromAmount {
14938 type Err = self::error::ConversionError;
14939 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14940 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
14941 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
14942 if PATTERN.find(value).is_none() {
14943 return Err("doesn't match pattern \"^\\d+$\"".into());
14944 }
14945 Ok(Self(value.to_string()))
14946 }
14947 }
14948 impl ::std::convert::TryFrom<&str> for FromAmount {
14949 type Error = self::error::ConversionError;
14950 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
14951 value.parse()
14952 }
14953 }
14954 impl ::std::convert::TryFrom<&::std::string::String> for FromAmount {
14955 type Error = self::error::ConversionError;
14956 fn try_from(
14957 value: &::std::string::String,
14958 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14959 value.parse()
14960 }
14961 }
14962 impl ::std::convert::TryFrom<::std::string::String> for FromAmount {
14963 type Error = self::error::ConversionError;
14964 fn try_from(
14965 value: ::std::string::String,
14966 ) -> ::std::result::Result<Self, self::error::ConversionError> {
14967 value.parse()
14968 }
14969 }
14970 impl<'de> ::serde::Deserialize<'de> for FromAmount {
14971 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
14972 where
14973 D: ::serde::Deserializer<'de>,
14974 {
14975 ::std::string::String::deserialize(deserializer)?
14976 .parse()
14977 .map_err(|e: self::error::ConversionError| {
14978 <D::Error as ::serde::de::Error>::custom(e.to_string())
14979 })
14980 }
14981 }
14982 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14998 #[serde(transparent)]
14999 pub struct FromToken(::std::string::String);
15000 impl ::std::ops::Deref for FromToken {
15001 type Target = ::std::string::String;
15002 fn deref(&self) -> &::std::string::String {
15003 &self.0
15004 }
15005 }
15006 impl ::std::convert::From<FromToken> for ::std::string::String {
15007 fn from(value: FromToken) -> Self {
15008 value.0
15009 }
15010 }
15011 impl ::std::convert::From<&FromToken> for FromToken {
15012 fn from(value: &FromToken) -> Self {
15013 value.clone()
15014 }
15015 }
15016 impl ::std::str::FromStr for FromToken {
15017 type Err = self::error::ConversionError;
15018 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15019 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15020 ::std::sync::LazyLock::new(|| {
15021 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
15022 });
15023 if PATTERN.find(value).is_none() {
15024 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
15025 }
15026 Ok(Self(value.to_string()))
15027 }
15028 }
15029 impl ::std::convert::TryFrom<&str> for FromToken {
15030 type Error = self::error::ConversionError;
15031 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15032 value.parse()
15033 }
15034 }
15035 impl ::std::convert::TryFrom<&::std::string::String> for FromToken {
15036 type Error = self::error::ConversionError;
15037 fn try_from(
15038 value: &::std::string::String,
15039 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15040 value.parse()
15041 }
15042 }
15043 impl ::std::convert::TryFrom<::std::string::String> for FromToken {
15044 type Error = self::error::ConversionError;
15045 fn try_from(
15046 value: ::std::string::String,
15047 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15048 value.parse()
15049 }
15050 }
15051 impl<'de> ::serde::Deserialize<'de> for FromToken {
15052 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15053 where
15054 D: ::serde::Deserializer<'de>,
15055 {
15056 ::std::string::String::deserialize(deserializer)?
15057 .parse()
15058 .map_err(|e: self::error::ConversionError| {
15059 <D::Error as ::serde::de::Error>::custom(e.to_string())
15060 })
15061 }
15062 }
15063 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15079 #[serde(transparent)]
15080 pub struct GasPrice(::std::string::String);
15081 impl ::std::ops::Deref for GasPrice {
15082 type Target = ::std::string::String;
15083 fn deref(&self) -> &::std::string::String {
15084 &self.0
15085 }
15086 }
15087 impl ::std::convert::From<GasPrice> for ::std::string::String {
15088 fn from(value: GasPrice) -> Self {
15089 value.0
15090 }
15091 }
15092 impl ::std::convert::From<&GasPrice> for GasPrice {
15093 fn from(value: &GasPrice) -> Self {
15094 value.clone()
15095 }
15096 }
15097 impl ::std::str::FromStr for GasPrice {
15098 type Err = self::error::ConversionError;
15099 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15100 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15101 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
15102 if PATTERN.find(value).is_none() {
15103 return Err("doesn't match pattern \"^\\d+$\"".into());
15104 }
15105 Ok(Self(value.to_string()))
15106 }
15107 }
15108 impl ::std::convert::TryFrom<&str> for GasPrice {
15109 type Error = self::error::ConversionError;
15110 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15111 value.parse()
15112 }
15113 }
15114 impl ::std::convert::TryFrom<&::std::string::String> for GasPrice {
15115 type Error = self::error::ConversionError;
15116 fn try_from(
15117 value: &::std::string::String,
15118 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15119 value.parse()
15120 }
15121 }
15122 impl ::std::convert::TryFrom<::std::string::String> for GasPrice {
15123 type Error = self::error::ConversionError;
15124 fn try_from(
15125 value: ::std::string::String,
15126 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15127 value.parse()
15128 }
15129 }
15130 impl<'de> ::serde::Deserialize<'de> for GasPrice {
15131 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15132 where
15133 D: ::serde::Deserializer<'de>,
15134 {
15135 ::std::string::String::deserialize(deserializer)?
15136 .parse()
15137 .map_err(|e: self::error::ConversionError| {
15138 <D::Error as ::serde::de::Error>::custom(e.to_string())
15139 })
15140 }
15141 }
15142 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15154 #[serde(transparent)]
15155 pub struct GetEndUserUserId(::std::string::String);
15156 impl ::std::ops::Deref for GetEndUserUserId {
15157 type Target = ::std::string::String;
15158 fn deref(&self) -> &::std::string::String {
15159 &self.0
15160 }
15161 }
15162 impl ::std::convert::From<GetEndUserUserId> for ::std::string::String {
15163 fn from(value: GetEndUserUserId) -> Self {
15164 value.0
15165 }
15166 }
15167 impl ::std::convert::From<&GetEndUserUserId> for GetEndUserUserId {
15168 fn from(value: &GetEndUserUserId) -> Self {
15169 value.clone()
15170 }
15171 }
15172 impl ::std::str::FromStr for GetEndUserUserId {
15173 type Err = self::error::ConversionError;
15174 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15175 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15176 ::std::sync::LazyLock::new(|| {
15177 ::regress::Regex::new("^[a-zA-Z0-9-]{1,100}$").unwrap()
15178 });
15179 if PATTERN.find(value).is_none() {
15180 return Err("doesn't match pattern \"^[a-zA-Z0-9-]{1,100}$\"".into());
15181 }
15182 Ok(Self(value.to_string()))
15183 }
15184 }
15185 impl ::std::convert::TryFrom<&str> for GetEndUserUserId {
15186 type Error = self::error::ConversionError;
15187 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15188 value.parse()
15189 }
15190 }
15191 impl ::std::convert::TryFrom<&::std::string::String> for GetEndUserUserId {
15192 type Error = self::error::ConversionError;
15193 fn try_from(
15194 value: &::std::string::String,
15195 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15196 value.parse()
15197 }
15198 }
15199 impl ::std::convert::TryFrom<::std::string::String> for GetEndUserUserId {
15200 type Error = self::error::ConversionError;
15201 fn try_from(
15202 value: ::std::string::String,
15203 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15204 value.parse()
15205 }
15206 }
15207 impl<'de> ::serde::Deserialize<'de> for GetEndUserUserId {
15208 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15209 where
15210 D: ::serde::Deserializer<'de>,
15211 {
15212 ::std::string::String::deserialize(deserializer)?
15213 .parse()
15214 .map_err(|e: self::error::ConversionError| {
15215 <D::Error as ::serde::de::Error>::custom(e.to_string())
15216 })
15217 }
15218 }
15219 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15231 #[serde(transparent)]
15232 pub struct GetEvmAccountAddress(::std::string::String);
15233 impl ::std::ops::Deref for GetEvmAccountAddress {
15234 type Target = ::std::string::String;
15235 fn deref(&self) -> &::std::string::String {
15236 &self.0
15237 }
15238 }
15239 impl ::std::convert::From<GetEvmAccountAddress> for ::std::string::String {
15240 fn from(value: GetEvmAccountAddress) -> Self {
15241 value.0
15242 }
15243 }
15244 impl ::std::convert::From<&GetEvmAccountAddress> for GetEvmAccountAddress {
15245 fn from(value: &GetEvmAccountAddress) -> Self {
15246 value.clone()
15247 }
15248 }
15249 impl ::std::str::FromStr for GetEvmAccountAddress {
15250 type Err = self::error::ConversionError;
15251 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15252 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15253 ::std::sync::LazyLock::new(|| {
15254 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
15255 });
15256 if PATTERN.find(value).is_none() {
15257 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
15258 }
15259 Ok(Self(value.to_string()))
15260 }
15261 }
15262 impl ::std::convert::TryFrom<&str> for GetEvmAccountAddress {
15263 type Error = self::error::ConversionError;
15264 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15265 value.parse()
15266 }
15267 }
15268 impl ::std::convert::TryFrom<&::std::string::String> for GetEvmAccountAddress {
15269 type Error = self::error::ConversionError;
15270 fn try_from(
15271 value: &::std::string::String,
15272 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15273 value.parse()
15274 }
15275 }
15276 impl ::std::convert::TryFrom<::std::string::String> for GetEvmAccountAddress {
15277 type Error = self::error::ConversionError;
15278 fn try_from(
15279 value: ::std::string::String,
15280 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15281 value.parse()
15282 }
15283 }
15284 impl<'de> ::serde::Deserialize<'de> for GetEvmAccountAddress {
15285 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15286 where
15287 D: ::serde::Deserializer<'de>,
15288 {
15289 ::std::string::String::deserialize(deserializer)?
15290 .parse()
15291 .map_err(|e: self::error::ConversionError| {
15292 <D::Error as ::serde::de::Error>::custom(e.to_string())
15293 })
15294 }
15295 }
15296 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15308 #[serde(transparent)]
15309 pub struct GetEvmSmartAccountAddress(::std::string::String);
15310 impl ::std::ops::Deref for GetEvmSmartAccountAddress {
15311 type Target = ::std::string::String;
15312 fn deref(&self) -> &::std::string::String {
15313 &self.0
15314 }
15315 }
15316 impl ::std::convert::From<GetEvmSmartAccountAddress> for ::std::string::String {
15317 fn from(value: GetEvmSmartAccountAddress) -> Self {
15318 value.0
15319 }
15320 }
15321 impl ::std::convert::From<&GetEvmSmartAccountAddress> for GetEvmSmartAccountAddress {
15322 fn from(value: &GetEvmSmartAccountAddress) -> Self {
15323 value.clone()
15324 }
15325 }
15326 impl ::std::str::FromStr for GetEvmSmartAccountAddress {
15327 type Err = self::error::ConversionError;
15328 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15329 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15330 ::std::sync::LazyLock::new(|| {
15331 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
15332 });
15333 if PATTERN.find(value).is_none() {
15334 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
15335 }
15336 Ok(Self(value.to_string()))
15337 }
15338 }
15339 impl ::std::convert::TryFrom<&str> for GetEvmSmartAccountAddress {
15340 type Error = self::error::ConversionError;
15341 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15342 value.parse()
15343 }
15344 }
15345 impl ::std::convert::TryFrom<&::std::string::String> for GetEvmSmartAccountAddress {
15346 type Error = self::error::ConversionError;
15347 fn try_from(
15348 value: &::std::string::String,
15349 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15350 value.parse()
15351 }
15352 }
15353 impl ::std::convert::TryFrom<::std::string::String> for GetEvmSmartAccountAddress {
15354 type Error = self::error::ConversionError;
15355 fn try_from(
15356 value: ::std::string::String,
15357 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15358 value.parse()
15359 }
15360 }
15361 impl<'de> ::serde::Deserialize<'de> for GetEvmSmartAccountAddress {
15362 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15363 where
15364 D: ::serde::Deserializer<'de>,
15365 {
15366 ::std::string::String::deserialize(deserializer)?
15367 .parse()
15368 .map_err(|e: self::error::ConversionError| {
15369 <D::Error as ::serde::de::Error>::custom(e.to_string())
15370 })
15371 }
15372 }
15373 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
15392 pub struct GetOnrampOrderByIdResponse {
15393 pub order: OnrampOrder,
15394 }
15395 impl ::std::convert::From<&GetOnrampOrderByIdResponse> for GetOnrampOrderByIdResponse {
15396 fn from(value: &GetOnrampOrderByIdResponse) -> Self {
15397 value.clone()
15398 }
15399 }
15400 impl GetOnrampOrderByIdResponse {
15401 pub fn builder() -> builder::GetOnrampOrderByIdResponse {
15402 Default::default()
15403 }
15404 }
15405 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15417 #[serde(transparent)]
15418 pub struct GetPolicyByIdPolicyId(::std::string::String);
15419 impl ::std::ops::Deref for GetPolicyByIdPolicyId {
15420 type Target = ::std::string::String;
15421 fn deref(&self) -> &::std::string::String {
15422 &self.0
15423 }
15424 }
15425 impl ::std::convert::From<GetPolicyByIdPolicyId> for ::std::string::String {
15426 fn from(value: GetPolicyByIdPolicyId) -> Self {
15427 value.0
15428 }
15429 }
15430 impl ::std::convert::From<&GetPolicyByIdPolicyId> for GetPolicyByIdPolicyId {
15431 fn from(value: &GetPolicyByIdPolicyId) -> Self {
15432 value.clone()
15433 }
15434 }
15435 impl ::std::str::FromStr for GetPolicyByIdPolicyId {
15436 type Err = self::error::ConversionError;
15437 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15438 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
15439 || {
15440 ::regress::Regex::new(
15441 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
15442 )
15443 .unwrap()
15444 },
15445 );
15446 if PATTERN.find(value).is_none() {
15447 return Err(
15448 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
15449 .into(),
15450 );
15451 }
15452 Ok(Self(value.to_string()))
15453 }
15454 }
15455 impl ::std::convert::TryFrom<&str> for GetPolicyByIdPolicyId {
15456 type Error = self::error::ConversionError;
15457 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15458 value.parse()
15459 }
15460 }
15461 impl ::std::convert::TryFrom<&::std::string::String> for GetPolicyByIdPolicyId {
15462 type Error = self::error::ConversionError;
15463 fn try_from(
15464 value: &::std::string::String,
15465 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15466 value.parse()
15467 }
15468 }
15469 impl ::std::convert::TryFrom<::std::string::String> for GetPolicyByIdPolicyId {
15470 type Error = self::error::ConversionError;
15471 fn try_from(
15472 value: ::std::string::String,
15473 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15474 value.parse()
15475 }
15476 }
15477 impl<'de> ::serde::Deserialize<'de> for GetPolicyByIdPolicyId {
15478 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15479 where
15480 D: ::serde::Deserializer<'de>,
15481 {
15482 ::std::string::String::deserialize(deserializer)?
15483 .parse()
15484 .map_err(|e: self::error::ConversionError| {
15485 <D::Error as ::serde::de::Error>::custom(e.to_string())
15486 })
15487 }
15488 }
15489 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15501 #[serde(transparent)]
15502 pub struct GetSolanaAccountAddress(::std::string::String);
15503 impl ::std::ops::Deref for GetSolanaAccountAddress {
15504 type Target = ::std::string::String;
15505 fn deref(&self) -> &::std::string::String {
15506 &self.0
15507 }
15508 }
15509 impl ::std::convert::From<GetSolanaAccountAddress> for ::std::string::String {
15510 fn from(value: GetSolanaAccountAddress) -> Self {
15511 value.0
15512 }
15513 }
15514 impl ::std::convert::From<&GetSolanaAccountAddress> for GetSolanaAccountAddress {
15515 fn from(value: &GetSolanaAccountAddress) -> Self {
15516 value.clone()
15517 }
15518 }
15519 impl ::std::str::FromStr for GetSolanaAccountAddress {
15520 type Err = self::error::ConversionError;
15521 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15522 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15523 ::std::sync::LazyLock::new(|| {
15524 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
15525 });
15526 if PATTERN.find(value).is_none() {
15527 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
15528 }
15529 Ok(Self(value.to_string()))
15530 }
15531 }
15532 impl ::std::convert::TryFrom<&str> for GetSolanaAccountAddress {
15533 type Error = self::error::ConversionError;
15534 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15535 value.parse()
15536 }
15537 }
15538 impl ::std::convert::TryFrom<&::std::string::String> for GetSolanaAccountAddress {
15539 type Error = self::error::ConversionError;
15540 fn try_from(
15541 value: &::std::string::String,
15542 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15543 value.parse()
15544 }
15545 }
15546 impl ::std::convert::TryFrom<::std::string::String> for GetSolanaAccountAddress {
15547 type Error = self::error::ConversionError;
15548 fn try_from(
15549 value: ::std::string::String,
15550 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15551 value.parse()
15552 }
15553 }
15554 impl<'de> ::serde::Deserialize<'de> for GetSolanaAccountAddress {
15555 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15556 where
15557 D: ::serde::Deserializer<'de>,
15558 {
15559 ::std::string::String::deserialize(deserializer)?
15560 .parse()
15561 .map_err(|e: self::error::ConversionError| {
15562 <D::Error as ::serde::de::Error>::custom(e.to_string())
15563 })
15564 }
15565 }
15566 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
15610 pub struct GetSwapPriceResponse {
15611 #[serde(rename = "blockNumber")]
15613 pub block_number: GetSwapPriceResponseBlockNumber,
15614 pub fees: GetSwapPriceResponseFees,
15615 #[serde(rename = "fromAmount")]
15617 pub from_amount: GetSwapPriceResponseFromAmount,
15618 #[serde(rename = "fromToken")]
15620 pub from_token: GetSwapPriceResponseFromToken,
15621 pub gas: ::std::option::Option<GetSwapPriceResponseGas>,
15623 #[serde(rename = "gasPrice")]
15625 pub gas_price: GetSwapPriceResponseGasPrice,
15626 pub issues: GetSwapPriceResponseIssues,
15627 #[serde(rename = "liquidityAvailable")]
15629 pub liquidity_available: bool,
15630 #[serde(rename = "minToAmount")]
15632 pub min_to_amount: GetSwapPriceResponseMinToAmount,
15633 #[serde(rename = "toAmount")]
15635 pub to_amount: GetSwapPriceResponseToAmount,
15636 #[serde(rename = "toToken")]
15638 pub to_token: GetSwapPriceResponseToToken,
15639 }
15640 impl ::std::convert::From<&GetSwapPriceResponse> for GetSwapPriceResponse {
15641 fn from(value: &GetSwapPriceResponse) -> Self {
15642 value.clone()
15643 }
15644 }
15645 impl GetSwapPriceResponse {
15646 pub fn builder() -> builder::GetSwapPriceResponse {
15647 Default::default()
15648 }
15649 }
15650 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15666 #[serde(transparent)]
15667 pub struct GetSwapPriceResponseBlockNumber(::std::string::String);
15668 impl ::std::ops::Deref for GetSwapPriceResponseBlockNumber {
15669 type Target = ::std::string::String;
15670 fn deref(&self) -> &::std::string::String {
15671 &self.0
15672 }
15673 }
15674 impl ::std::convert::From<GetSwapPriceResponseBlockNumber> for ::std::string::String {
15675 fn from(value: GetSwapPriceResponseBlockNumber) -> Self {
15676 value.0
15677 }
15678 }
15679 impl ::std::convert::From<&GetSwapPriceResponseBlockNumber> for GetSwapPriceResponseBlockNumber {
15680 fn from(value: &GetSwapPriceResponseBlockNumber) -> Self {
15681 value.clone()
15682 }
15683 }
15684 impl ::std::str::FromStr for GetSwapPriceResponseBlockNumber {
15685 type Err = self::error::ConversionError;
15686 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15687 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15688 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[1-9]\\d*$").unwrap());
15689 if PATTERN.find(value).is_none() {
15690 return Err("doesn't match pattern \"^[1-9]\\d*$\"".into());
15691 }
15692 Ok(Self(value.to_string()))
15693 }
15694 }
15695 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseBlockNumber {
15696 type Error = self::error::ConversionError;
15697 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15698 value.parse()
15699 }
15700 }
15701 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseBlockNumber {
15702 type Error = self::error::ConversionError;
15703 fn try_from(
15704 value: &::std::string::String,
15705 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15706 value.parse()
15707 }
15708 }
15709 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseBlockNumber {
15710 type Error = self::error::ConversionError;
15711 fn try_from(
15712 value: ::std::string::String,
15713 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15714 value.parse()
15715 }
15716 }
15717 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseBlockNumber {
15718 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15719 where
15720 D: ::serde::Deserializer<'de>,
15721 {
15722 ::std::string::String::deserialize(deserializer)?
15723 .parse()
15724 .map_err(|e: self::error::ConversionError| {
15725 <D::Error as ::serde::de::Error>::custom(e.to_string())
15726 })
15727 }
15728 }
15729 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
15783 pub struct GetSwapPriceResponseFees {
15784 #[serde(rename = "gasFee")]
15786 pub gas_fee: ::std::option::Option<TokenFee>,
15787 #[serde(rename = "protocolFee")]
15789 pub protocol_fee: ::std::option::Option<TokenFee>,
15790 }
15791 impl ::std::convert::From<&GetSwapPriceResponseFees> for GetSwapPriceResponseFees {
15792 fn from(value: &GetSwapPriceResponseFees) -> Self {
15793 value.clone()
15794 }
15795 }
15796 impl GetSwapPriceResponseFees {
15797 pub fn builder() -> builder::GetSwapPriceResponseFees {
15798 Default::default()
15799 }
15800 }
15801 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15817 #[serde(transparent)]
15818 pub struct GetSwapPriceResponseFromAmount(::std::string::String);
15819 impl ::std::ops::Deref for GetSwapPriceResponseFromAmount {
15820 type Target = ::std::string::String;
15821 fn deref(&self) -> &::std::string::String {
15822 &self.0
15823 }
15824 }
15825 impl ::std::convert::From<GetSwapPriceResponseFromAmount> for ::std::string::String {
15826 fn from(value: GetSwapPriceResponseFromAmount) -> Self {
15827 value.0
15828 }
15829 }
15830 impl ::std::convert::From<&GetSwapPriceResponseFromAmount> for GetSwapPriceResponseFromAmount {
15831 fn from(value: &GetSwapPriceResponseFromAmount) -> Self {
15832 value.clone()
15833 }
15834 }
15835 impl ::std::str::FromStr for GetSwapPriceResponseFromAmount {
15836 type Err = self::error::ConversionError;
15837 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15838 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15839 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
15840 if PATTERN.find(value).is_none() {
15841 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
15842 }
15843 Ok(Self(value.to_string()))
15844 }
15845 }
15846 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseFromAmount {
15847 type Error = self::error::ConversionError;
15848 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15849 value.parse()
15850 }
15851 }
15852 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseFromAmount {
15853 type Error = self::error::ConversionError;
15854 fn try_from(
15855 value: &::std::string::String,
15856 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15857 value.parse()
15858 }
15859 }
15860 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseFromAmount {
15861 type Error = self::error::ConversionError;
15862 fn try_from(
15863 value: ::std::string::String,
15864 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15865 value.parse()
15866 }
15867 }
15868 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseFromAmount {
15869 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15870 where
15871 D: ::serde::Deserializer<'de>,
15872 {
15873 ::std::string::String::deserialize(deserializer)?
15874 .parse()
15875 .map_err(|e: self::error::ConversionError| {
15876 <D::Error as ::serde::de::Error>::custom(e.to_string())
15877 })
15878 }
15879 }
15880 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15896 #[serde(transparent)]
15897 pub struct GetSwapPriceResponseFromToken(::std::string::String);
15898 impl ::std::ops::Deref for GetSwapPriceResponseFromToken {
15899 type Target = ::std::string::String;
15900 fn deref(&self) -> &::std::string::String {
15901 &self.0
15902 }
15903 }
15904 impl ::std::convert::From<GetSwapPriceResponseFromToken> for ::std::string::String {
15905 fn from(value: GetSwapPriceResponseFromToken) -> Self {
15906 value.0
15907 }
15908 }
15909 impl ::std::convert::From<&GetSwapPriceResponseFromToken> for GetSwapPriceResponseFromToken {
15910 fn from(value: &GetSwapPriceResponseFromToken) -> Self {
15911 value.clone()
15912 }
15913 }
15914 impl ::std::str::FromStr for GetSwapPriceResponseFromToken {
15915 type Err = self::error::ConversionError;
15916 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15917 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15918 ::std::sync::LazyLock::new(|| {
15919 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
15920 });
15921 if PATTERN.find(value).is_none() {
15922 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
15923 }
15924 Ok(Self(value.to_string()))
15925 }
15926 }
15927 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseFromToken {
15928 type Error = self::error::ConversionError;
15929 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15930 value.parse()
15931 }
15932 }
15933 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseFromToken {
15934 type Error = self::error::ConversionError;
15935 fn try_from(
15936 value: &::std::string::String,
15937 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15938 value.parse()
15939 }
15940 }
15941 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseFromToken {
15942 type Error = self::error::ConversionError;
15943 fn try_from(
15944 value: ::std::string::String,
15945 ) -> ::std::result::Result<Self, self::error::ConversionError> {
15946 value.parse()
15947 }
15948 }
15949 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseFromToken {
15950 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
15951 where
15952 D: ::serde::Deserializer<'de>,
15953 {
15954 ::std::string::String::deserialize(deserializer)?
15955 .parse()
15956 .map_err(|e: self::error::ConversionError| {
15957 <D::Error as ::serde::de::Error>::custom(e.to_string())
15958 })
15959 }
15960 }
15961 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15977 #[serde(transparent)]
15978 pub struct GetSwapPriceResponseGas(::std::string::String);
15979 impl ::std::ops::Deref for GetSwapPriceResponseGas {
15980 type Target = ::std::string::String;
15981 fn deref(&self) -> &::std::string::String {
15982 &self.0
15983 }
15984 }
15985 impl ::std::convert::From<GetSwapPriceResponseGas> for ::std::string::String {
15986 fn from(value: GetSwapPriceResponseGas) -> Self {
15987 value.0
15988 }
15989 }
15990 impl ::std::convert::From<&GetSwapPriceResponseGas> for GetSwapPriceResponseGas {
15991 fn from(value: &GetSwapPriceResponseGas) -> Self {
15992 value.clone()
15993 }
15994 }
15995 impl ::std::str::FromStr for GetSwapPriceResponseGas {
15996 type Err = self::error::ConversionError;
15997 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
15998 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
15999 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
16000 if PATTERN.find(value).is_none() {
16001 return Err("doesn't match pattern \"^\\d+$\"".into());
16002 }
16003 Ok(Self(value.to_string()))
16004 }
16005 }
16006 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseGas {
16007 type Error = self::error::ConversionError;
16008 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16009 value.parse()
16010 }
16011 }
16012 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseGas {
16013 type Error = self::error::ConversionError;
16014 fn try_from(
16015 value: &::std::string::String,
16016 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16017 value.parse()
16018 }
16019 }
16020 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseGas {
16021 type Error = self::error::ConversionError;
16022 fn try_from(
16023 value: ::std::string::String,
16024 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16025 value.parse()
16026 }
16027 }
16028 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseGas {
16029 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16030 where
16031 D: ::serde::Deserializer<'de>,
16032 {
16033 ::std::string::String::deserialize(deserializer)?
16034 .parse()
16035 .map_err(|e: self::error::ConversionError| {
16036 <D::Error as ::serde::de::Error>::custom(e.to_string())
16037 })
16038 }
16039 }
16040 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16056 #[serde(transparent)]
16057 pub struct GetSwapPriceResponseGasPrice(::std::string::String);
16058 impl ::std::ops::Deref for GetSwapPriceResponseGasPrice {
16059 type Target = ::std::string::String;
16060 fn deref(&self) -> &::std::string::String {
16061 &self.0
16062 }
16063 }
16064 impl ::std::convert::From<GetSwapPriceResponseGasPrice> for ::std::string::String {
16065 fn from(value: GetSwapPriceResponseGasPrice) -> Self {
16066 value.0
16067 }
16068 }
16069 impl ::std::convert::From<&GetSwapPriceResponseGasPrice> for GetSwapPriceResponseGasPrice {
16070 fn from(value: &GetSwapPriceResponseGasPrice) -> Self {
16071 value.clone()
16072 }
16073 }
16074 impl ::std::str::FromStr for GetSwapPriceResponseGasPrice {
16075 type Err = self::error::ConversionError;
16076 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16077 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
16078 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
16079 if PATTERN.find(value).is_none() {
16080 return Err("doesn't match pattern \"^\\d+$\"".into());
16081 }
16082 Ok(Self(value.to_string()))
16083 }
16084 }
16085 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseGasPrice {
16086 type Error = self::error::ConversionError;
16087 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16088 value.parse()
16089 }
16090 }
16091 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseGasPrice {
16092 type Error = self::error::ConversionError;
16093 fn try_from(
16094 value: &::std::string::String,
16095 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16096 value.parse()
16097 }
16098 }
16099 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseGasPrice {
16100 type Error = self::error::ConversionError;
16101 fn try_from(
16102 value: ::std::string::String,
16103 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16104 value.parse()
16105 }
16106 }
16107 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseGasPrice {
16108 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16109 where
16110 D: ::serde::Deserializer<'de>,
16111 {
16112 ::std::string::String::deserialize(deserializer)?
16113 .parse()
16114 .map_err(|e: self::error::ConversionError| {
16115 <D::Error as ::serde::de::Error>::custom(e.to_string())
16116 })
16117 }
16118 }
16119 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
16236 pub struct GetSwapPriceResponseIssues {
16237 pub allowance: ::std::option::Option<GetSwapPriceResponseIssuesAllowance>,
16239 pub balance: ::std::option::Option<GetSwapPriceResponseIssuesBalance>,
16241 #[serde(rename = "simulationIncomplete")]
16243 pub simulation_incomplete: bool,
16244 }
16245 impl ::std::convert::From<&GetSwapPriceResponseIssues> for GetSwapPriceResponseIssues {
16246 fn from(value: &GetSwapPriceResponseIssues) -> Self {
16247 value.clone()
16248 }
16249 }
16250 impl GetSwapPriceResponseIssues {
16251 pub fn builder() -> builder::GetSwapPriceResponseIssues {
16252 Default::default()
16253 }
16254 }
16255 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
16295 pub struct GetSwapPriceResponseIssuesAllowance {
16296 #[serde(rename = "currentAllowance")]
16298 pub current_allowance: GetSwapPriceResponseIssuesAllowanceCurrentAllowance,
16299 pub spender: GetSwapPriceResponseIssuesAllowanceSpender,
16301 }
16302 impl ::std::convert::From<&GetSwapPriceResponseIssuesAllowance>
16303 for GetSwapPriceResponseIssuesAllowance
16304 {
16305 fn from(value: &GetSwapPriceResponseIssuesAllowance) -> Self {
16306 value.clone()
16307 }
16308 }
16309 impl GetSwapPriceResponseIssuesAllowance {
16310 pub fn builder() -> builder::GetSwapPriceResponseIssuesAllowance {
16311 Default::default()
16312 }
16313 }
16314 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16330 #[serde(transparent)]
16331 pub struct GetSwapPriceResponseIssuesAllowanceCurrentAllowance(::std::string::String);
16332 impl ::std::ops::Deref for GetSwapPriceResponseIssuesAllowanceCurrentAllowance {
16333 type Target = ::std::string::String;
16334 fn deref(&self) -> &::std::string::String {
16335 &self.0
16336 }
16337 }
16338 impl ::std::convert::From<GetSwapPriceResponseIssuesAllowanceCurrentAllowance>
16339 for ::std::string::String
16340 {
16341 fn from(value: GetSwapPriceResponseIssuesAllowanceCurrentAllowance) -> Self {
16342 value.0
16343 }
16344 }
16345 impl ::std::convert::From<&GetSwapPriceResponseIssuesAllowanceCurrentAllowance>
16346 for GetSwapPriceResponseIssuesAllowanceCurrentAllowance
16347 {
16348 fn from(value: &GetSwapPriceResponseIssuesAllowanceCurrentAllowance) -> Self {
16349 value.clone()
16350 }
16351 }
16352 impl ::std::str::FromStr for GetSwapPriceResponseIssuesAllowanceCurrentAllowance {
16353 type Err = self::error::ConversionError;
16354 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16355 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
16356 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
16357 if PATTERN.find(value).is_none() {
16358 return Err("doesn't match pattern \"^\\d+$\"".into());
16359 }
16360 Ok(Self(value.to_string()))
16361 }
16362 }
16363 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseIssuesAllowanceCurrentAllowance {
16364 type Error = self::error::ConversionError;
16365 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16366 value.parse()
16367 }
16368 }
16369 impl ::std::convert::TryFrom<&::std::string::String>
16370 for GetSwapPriceResponseIssuesAllowanceCurrentAllowance
16371 {
16372 type Error = self::error::ConversionError;
16373 fn try_from(
16374 value: &::std::string::String,
16375 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16376 value.parse()
16377 }
16378 }
16379 impl ::std::convert::TryFrom<::std::string::String>
16380 for GetSwapPriceResponseIssuesAllowanceCurrentAllowance
16381 {
16382 type Error = self::error::ConversionError;
16383 fn try_from(
16384 value: ::std::string::String,
16385 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16386 value.parse()
16387 }
16388 }
16389 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseIssuesAllowanceCurrentAllowance {
16390 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16391 where
16392 D: ::serde::Deserializer<'de>,
16393 {
16394 ::std::string::String::deserialize(deserializer)?
16395 .parse()
16396 .map_err(|e: self::error::ConversionError| {
16397 <D::Error as ::serde::de::Error>::custom(e.to_string())
16398 })
16399 }
16400 }
16401 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16417 #[serde(transparent)]
16418 pub struct GetSwapPriceResponseIssuesAllowanceSpender(::std::string::String);
16419 impl ::std::ops::Deref for GetSwapPriceResponseIssuesAllowanceSpender {
16420 type Target = ::std::string::String;
16421 fn deref(&self) -> &::std::string::String {
16422 &self.0
16423 }
16424 }
16425 impl ::std::convert::From<GetSwapPriceResponseIssuesAllowanceSpender> for ::std::string::String {
16426 fn from(value: GetSwapPriceResponseIssuesAllowanceSpender) -> Self {
16427 value.0
16428 }
16429 }
16430 impl ::std::convert::From<&GetSwapPriceResponseIssuesAllowanceSpender>
16431 for GetSwapPriceResponseIssuesAllowanceSpender
16432 {
16433 fn from(value: &GetSwapPriceResponseIssuesAllowanceSpender) -> Self {
16434 value.clone()
16435 }
16436 }
16437 impl ::std::str::FromStr for GetSwapPriceResponseIssuesAllowanceSpender {
16438 type Err = self::error::ConversionError;
16439 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16440 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
16441 ::std::sync::LazyLock::new(|| {
16442 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
16443 });
16444 if PATTERN.find(value).is_none() {
16445 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
16446 }
16447 Ok(Self(value.to_string()))
16448 }
16449 }
16450 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseIssuesAllowanceSpender {
16451 type Error = self::error::ConversionError;
16452 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16453 value.parse()
16454 }
16455 }
16456 impl ::std::convert::TryFrom<&::std::string::String>
16457 for GetSwapPriceResponseIssuesAllowanceSpender
16458 {
16459 type Error = self::error::ConversionError;
16460 fn try_from(
16461 value: &::std::string::String,
16462 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16463 value.parse()
16464 }
16465 }
16466 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseIssuesAllowanceSpender {
16467 type Error = self::error::ConversionError;
16468 fn try_from(
16469 value: ::std::string::String,
16470 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16471 value.parse()
16472 }
16473 }
16474 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseIssuesAllowanceSpender {
16475 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16476 where
16477 D: ::serde::Deserializer<'de>,
16478 {
16479 ::std::string::String::deserialize(deserializer)?
16480 .parse()
16481 .map_err(|e: self::error::ConversionError| {
16482 <D::Error as ::serde::de::Error>::custom(e.to_string())
16483 })
16484 }
16485 }
16486 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
16533 pub struct GetSwapPriceResponseIssuesBalance {
16534 #[serde(rename = "currentBalance")]
16536 pub current_balance: GetSwapPriceResponseIssuesBalanceCurrentBalance,
16537 #[serde(rename = "requiredBalance")]
16539 pub required_balance: GetSwapPriceResponseIssuesBalanceRequiredBalance,
16540 pub token: GetSwapPriceResponseIssuesBalanceToken,
16542 }
16543 impl ::std::convert::From<&GetSwapPriceResponseIssuesBalance>
16544 for GetSwapPriceResponseIssuesBalance
16545 {
16546 fn from(value: &GetSwapPriceResponseIssuesBalance) -> Self {
16547 value.clone()
16548 }
16549 }
16550 impl GetSwapPriceResponseIssuesBalance {
16551 pub fn builder() -> builder::GetSwapPriceResponseIssuesBalance {
16552 Default::default()
16553 }
16554 }
16555 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16571 #[serde(transparent)]
16572 pub struct GetSwapPriceResponseIssuesBalanceCurrentBalance(::std::string::String);
16573 impl ::std::ops::Deref for GetSwapPriceResponseIssuesBalanceCurrentBalance {
16574 type Target = ::std::string::String;
16575 fn deref(&self) -> &::std::string::String {
16576 &self.0
16577 }
16578 }
16579 impl ::std::convert::From<GetSwapPriceResponseIssuesBalanceCurrentBalance>
16580 for ::std::string::String
16581 {
16582 fn from(value: GetSwapPriceResponseIssuesBalanceCurrentBalance) -> Self {
16583 value.0
16584 }
16585 }
16586 impl ::std::convert::From<&GetSwapPriceResponseIssuesBalanceCurrentBalance>
16587 for GetSwapPriceResponseIssuesBalanceCurrentBalance
16588 {
16589 fn from(value: &GetSwapPriceResponseIssuesBalanceCurrentBalance) -> Self {
16590 value.clone()
16591 }
16592 }
16593 impl ::std::str::FromStr for GetSwapPriceResponseIssuesBalanceCurrentBalance {
16594 type Err = self::error::ConversionError;
16595 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16596 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
16597 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
16598 if PATTERN.find(value).is_none() {
16599 return Err("doesn't match pattern \"^\\d+$\"".into());
16600 }
16601 Ok(Self(value.to_string()))
16602 }
16603 }
16604 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseIssuesBalanceCurrentBalance {
16605 type Error = self::error::ConversionError;
16606 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16607 value.parse()
16608 }
16609 }
16610 impl ::std::convert::TryFrom<&::std::string::String>
16611 for GetSwapPriceResponseIssuesBalanceCurrentBalance
16612 {
16613 type Error = self::error::ConversionError;
16614 fn try_from(
16615 value: &::std::string::String,
16616 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16617 value.parse()
16618 }
16619 }
16620 impl ::std::convert::TryFrom<::std::string::String>
16621 for GetSwapPriceResponseIssuesBalanceCurrentBalance
16622 {
16623 type Error = self::error::ConversionError;
16624 fn try_from(
16625 value: ::std::string::String,
16626 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16627 value.parse()
16628 }
16629 }
16630 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseIssuesBalanceCurrentBalance {
16631 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16632 where
16633 D: ::serde::Deserializer<'de>,
16634 {
16635 ::std::string::String::deserialize(deserializer)?
16636 .parse()
16637 .map_err(|e: self::error::ConversionError| {
16638 <D::Error as ::serde::de::Error>::custom(e.to_string())
16639 })
16640 }
16641 }
16642 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16658 #[serde(transparent)]
16659 pub struct GetSwapPriceResponseIssuesBalanceRequiredBalance(::std::string::String);
16660 impl ::std::ops::Deref for GetSwapPriceResponseIssuesBalanceRequiredBalance {
16661 type Target = ::std::string::String;
16662 fn deref(&self) -> &::std::string::String {
16663 &self.0
16664 }
16665 }
16666 impl ::std::convert::From<GetSwapPriceResponseIssuesBalanceRequiredBalance>
16667 for ::std::string::String
16668 {
16669 fn from(value: GetSwapPriceResponseIssuesBalanceRequiredBalance) -> Self {
16670 value.0
16671 }
16672 }
16673 impl ::std::convert::From<&GetSwapPriceResponseIssuesBalanceRequiredBalance>
16674 for GetSwapPriceResponseIssuesBalanceRequiredBalance
16675 {
16676 fn from(value: &GetSwapPriceResponseIssuesBalanceRequiredBalance) -> Self {
16677 value.clone()
16678 }
16679 }
16680 impl ::std::str::FromStr for GetSwapPriceResponseIssuesBalanceRequiredBalance {
16681 type Err = self::error::ConversionError;
16682 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16683 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
16684 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
16685 if PATTERN.find(value).is_none() {
16686 return Err("doesn't match pattern \"^\\d+$\"".into());
16687 }
16688 Ok(Self(value.to_string()))
16689 }
16690 }
16691 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseIssuesBalanceRequiredBalance {
16692 type Error = self::error::ConversionError;
16693 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16694 value.parse()
16695 }
16696 }
16697 impl ::std::convert::TryFrom<&::std::string::String>
16698 for GetSwapPriceResponseIssuesBalanceRequiredBalance
16699 {
16700 type Error = self::error::ConversionError;
16701 fn try_from(
16702 value: &::std::string::String,
16703 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16704 value.parse()
16705 }
16706 }
16707 impl ::std::convert::TryFrom<::std::string::String>
16708 for GetSwapPriceResponseIssuesBalanceRequiredBalance
16709 {
16710 type Error = self::error::ConversionError;
16711 fn try_from(
16712 value: ::std::string::String,
16713 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16714 value.parse()
16715 }
16716 }
16717 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseIssuesBalanceRequiredBalance {
16718 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16719 where
16720 D: ::serde::Deserializer<'de>,
16721 {
16722 ::std::string::String::deserialize(deserializer)?
16723 .parse()
16724 .map_err(|e: self::error::ConversionError| {
16725 <D::Error as ::serde::de::Error>::custom(e.to_string())
16726 })
16727 }
16728 }
16729 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16742 #[serde(transparent)]
16743 pub struct GetSwapPriceResponseIssuesBalanceToken(::std::string::String);
16744 impl ::std::ops::Deref for GetSwapPriceResponseIssuesBalanceToken {
16745 type Target = ::std::string::String;
16746 fn deref(&self) -> &::std::string::String {
16747 &self.0
16748 }
16749 }
16750 impl ::std::convert::From<GetSwapPriceResponseIssuesBalanceToken> for ::std::string::String {
16751 fn from(value: GetSwapPriceResponseIssuesBalanceToken) -> Self {
16752 value.0
16753 }
16754 }
16755 impl ::std::convert::From<&GetSwapPriceResponseIssuesBalanceToken>
16756 for GetSwapPriceResponseIssuesBalanceToken
16757 {
16758 fn from(value: &GetSwapPriceResponseIssuesBalanceToken) -> Self {
16759 value.clone()
16760 }
16761 }
16762 impl ::std::str::FromStr for GetSwapPriceResponseIssuesBalanceToken {
16763 type Err = self::error::ConversionError;
16764 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16765 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
16766 ::std::sync::LazyLock::new(|| {
16767 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
16768 });
16769 if PATTERN.find(value).is_none() {
16770 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
16771 }
16772 Ok(Self(value.to_string()))
16773 }
16774 }
16775 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseIssuesBalanceToken {
16776 type Error = self::error::ConversionError;
16777 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16778 value.parse()
16779 }
16780 }
16781 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseIssuesBalanceToken {
16782 type Error = self::error::ConversionError;
16783 fn try_from(
16784 value: &::std::string::String,
16785 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16786 value.parse()
16787 }
16788 }
16789 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseIssuesBalanceToken {
16790 type Error = self::error::ConversionError;
16791 fn try_from(
16792 value: ::std::string::String,
16793 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16794 value.parse()
16795 }
16796 }
16797 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseIssuesBalanceToken {
16798 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16799 where
16800 D: ::serde::Deserializer<'de>,
16801 {
16802 ::std::string::String::deserialize(deserializer)?
16803 .parse()
16804 .map_err(|e: self::error::ConversionError| {
16805 <D::Error as ::serde::de::Error>::custom(e.to_string())
16806 })
16807 }
16808 }
16809 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16825 #[serde(transparent)]
16826 pub struct GetSwapPriceResponseMinToAmount(::std::string::String);
16827 impl ::std::ops::Deref for GetSwapPriceResponseMinToAmount {
16828 type Target = ::std::string::String;
16829 fn deref(&self) -> &::std::string::String {
16830 &self.0
16831 }
16832 }
16833 impl ::std::convert::From<GetSwapPriceResponseMinToAmount> for ::std::string::String {
16834 fn from(value: GetSwapPriceResponseMinToAmount) -> Self {
16835 value.0
16836 }
16837 }
16838 impl ::std::convert::From<&GetSwapPriceResponseMinToAmount> for GetSwapPriceResponseMinToAmount {
16839 fn from(value: &GetSwapPriceResponseMinToAmount) -> Self {
16840 value.clone()
16841 }
16842 }
16843 impl ::std::str::FromStr for GetSwapPriceResponseMinToAmount {
16844 type Err = self::error::ConversionError;
16845 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16846 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
16847 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
16848 if PATTERN.find(value).is_none() {
16849 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
16850 }
16851 Ok(Self(value.to_string()))
16852 }
16853 }
16854 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseMinToAmount {
16855 type Error = self::error::ConversionError;
16856 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16857 value.parse()
16858 }
16859 }
16860 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseMinToAmount {
16861 type Error = self::error::ConversionError;
16862 fn try_from(
16863 value: &::std::string::String,
16864 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16865 value.parse()
16866 }
16867 }
16868 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseMinToAmount {
16869 type Error = self::error::ConversionError;
16870 fn try_from(
16871 value: ::std::string::String,
16872 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16873 value.parse()
16874 }
16875 }
16876 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseMinToAmount {
16877 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16878 where
16879 D: ::serde::Deserializer<'de>,
16880 {
16881 ::std::string::String::deserialize(deserializer)?
16882 .parse()
16883 .map_err(|e: self::error::ConversionError| {
16884 <D::Error as ::serde::de::Error>::custom(e.to_string())
16885 })
16886 }
16887 }
16888 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16904 #[serde(transparent)]
16905 pub struct GetSwapPriceResponseToAmount(::std::string::String);
16906 impl ::std::ops::Deref for GetSwapPriceResponseToAmount {
16907 type Target = ::std::string::String;
16908 fn deref(&self) -> &::std::string::String {
16909 &self.0
16910 }
16911 }
16912 impl ::std::convert::From<GetSwapPriceResponseToAmount> for ::std::string::String {
16913 fn from(value: GetSwapPriceResponseToAmount) -> Self {
16914 value.0
16915 }
16916 }
16917 impl ::std::convert::From<&GetSwapPriceResponseToAmount> for GetSwapPriceResponseToAmount {
16918 fn from(value: &GetSwapPriceResponseToAmount) -> Self {
16919 value.clone()
16920 }
16921 }
16922 impl ::std::str::FromStr for GetSwapPriceResponseToAmount {
16923 type Err = self::error::ConversionError;
16924 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16925 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
16926 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^(0|[1-9]\\d*)$").unwrap());
16927 if PATTERN.find(value).is_none() {
16928 return Err("doesn't match pattern \"^(0|[1-9]\\d*)$\"".into());
16929 }
16930 Ok(Self(value.to_string()))
16931 }
16932 }
16933 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseToAmount {
16934 type Error = self::error::ConversionError;
16935 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
16936 value.parse()
16937 }
16938 }
16939 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseToAmount {
16940 type Error = self::error::ConversionError;
16941 fn try_from(
16942 value: &::std::string::String,
16943 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16944 value.parse()
16945 }
16946 }
16947 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseToAmount {
16948 type Error = self::error::ConversionError;
16949 fn try_from(
16950 value: ::std::string::String,
16951 ) -> ::std::result::Result<Self, self::error::ConversionError> {
16952 value.parse()
16953 }
16954 }
16955 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseToAmount {
16956 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
16957 where
16958 D: ::serde::Deserializer<'de>,
16959 {
16960 ::std::string::String::deserialize(deserializer)?
16961 .parse()
16962 .map_err(|e: self::error::ConversionError| {
16963 <D::Error as ::serde::de::Error>::custom(e.to_string())
16964 })
16965 }
16966 }
16967 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16983 #[serde(transparent)]
16984 pub struct GetSwapPriceResponseToToken(::std::string::String);
16985 impl ::std::ops::Deref for GetSwapPriceResponseToToken {
16986 type Target = ::std::string::String;
16987 fn deref(&self) -> &::std::string::String {
16988 &self.0
16989 }
16990 }
16991 impl ::std::convert::From<GetSwapPriceResponseToToken> for ::std::string::String {
16992 fn from(value: GetSwapPriceResponseToToken) -> Self {
16993 value.0
16994 }
16995 }
16996 impl ::std::convert::From<&GetSwapPriceResponseToToken> for GetSwapPriceResponseToToken {
16997 fn from(value: &GetSwapPriceResponseToToken) -> Self {
16998 value.clone()
16999 }
17000 }
17001 impl ::std::str::FromStr for GetSwapPriceResponseToToken {
17002 type Err = self::error::ConversionError;
17003 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17004 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
17005 ::std::sync::LazyLock::new(|| {
17006 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
17007 });
17008 if PATTERN.find(value).is_none() {
17009 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
17010 }
17011 Ok(Self(value.to_string()))
17012 }
17013 }
17014 impl ::std::convert::TryFrom<&str> for GetSwapPriceResponseToToken {
17015 type Error = self::error::ConversionError;
17016 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17017 value.parse()
17018 }
17019 }
17020 impl ::std::convert::TryFrom<&::std::string::String> for GetSwapPriceResponseToToken {
17021 type Error = self::error::ConversionError;
17022 fn try_from(
17023 value: &::std::string::String,
17024 ) -> ::std::result::Result<Self, self::error::ConversionError> {
17025 value.parse()
17026 }
17027 }
17028 impl ::std::convert::TryFrom<::std::string::String> for GetSwapPriceResponseToToken {
17029 type Error = self::error::ConversionError;
17030 fn try_from(
17031 value: ::std::string::String,
17032 ) -> ::std::result::Result<Self, self::error::ConversionError> {
17033 value.parse()
17034 }
17035 }
17036 impl<'de> ::serde::Deserialize<'de> for GetSwapPriceResponseToToken {
17037 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
17038 where
17039 D: ::serde::Deserializer<'de>,
17040 {
17041 ::std::string::String::deserialize(deserializer)?
17042 .parse()
17043 .map_err(|e: self::error::ConversionError| {
17044 <D::Error as ::serde::de::Error>::custom(e.to_string())
17045 })
17046 }
17047 }
17048 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
17067 #[serde(untagged)]
17068 pub enum GetSwapPriceResponseWrapper {
17069 GetSwapPriceResponse(GetSwapPriceResponse),
17070 SwapUnavailableResponse(SwapUnavailableResponse),
17071 }
17072 impl ::std::convert::From<&Self> for GetSwapPriceResponseWrapper {
17073 fn from(value: &GetSwapPriceResponseWrapper) -> Self {
17074 value.clone()
17075 }
17076 }
17077 impl ::std::convert::From<GetSwapPriceResponse> for GetSwapPriceResponseWrapper {
17078 fn from(value: GetSwapPriceResponse) -> Self {
17079 Self::GetSwapPriceResponse(value)
17080 }
17081 }
17082 impl ::std::convert::From<SwapUnavailableResponse> for GetSwapPriceResponseWrapper {
17083 fn from(value: SwapUnavailableResponse) -> Self {
17084 Self::SwapUnavailableResponse(value)
17085 }
17086 }
17087 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
17099 #[serde(transparent)]
17100 pub struct GetUserOperationAddress(::std::string::String);
17101 impl ::std::ops::Deref for GetUserOperationAddress {
17102 type Target = ::std::string::String;
17103 fn deref(&self) -> &::std::string::String {
17104 &self.0
17105 }
17106 }
17107 impl ::std::convert::From<GetUserOperationAddress> for ::std::string::String {
17108 fn from(value: GetUserOperationAddress) -> Self {
17109 value.0
17110 }
17111 }
17112 impl ::std::convert::From<&GetUserOperationAddress> for GetUserOperationAddress {
17113 fn from(value: &GetUserOperationAddress) -> Self {
17114 value.clone()
17115 }
17116 }
17117 impl ::std::str::FromStr for GetUserOperationAddress {
17118 type Err = self::error::ConversionError;
17119 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17120 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
17121 ::std::sync::LazyLock::new(|| {
17122 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
17123 });
17124 if PATTERN.find(value).is_none() {
17125 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
17126 }
17127 Ok(Self(value.to_string()))
17128 }
17129 }
17130 impl ::std::convert::TryFrom<&str> for GetUserOperationAddress {
17131 type Error = self::error::ConversionError;
17132 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17133 value.parse()
17134 }
17135 }
17136 impl ::std::convert::TryFrom<&::std::string::String> for GetUserOperationAddress {
17137 type Error = self::error::ConversionError;
17138 fn try_from(
17139 value: &::std::string::String,
17140 ) -> ::std::result::Result<Self, self::error::ConversionError> {
17141 value.parse()
17142 }
17143 }
17144 impl ::std::convert::TryFrom<::std::string::String> for GetUserOperationAddress {
17145 type Error = self::error::ConversionError;
17146 fn try_from(
17147 value: ::std::string::String,
17148 ) -> ::std::result::Result<Self, self::error::ConversionError> {
17149 value.parse()
17150 }
17151 }
17152 impl<'de> ::serde::Deserialize<'de> for GetUserOperationAddress {
17153 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
17154 where
17155 D: ::serde::Deserializer<'de>,
17156 {
17157 ::std::string::String::deserialize(deserializer)?
17158 .parse()
17159 .map_err(|e: self::error::ConversionError| {
17160 <D::Error as ::serde::de::Error>::custom(e.to_string())
17161 })
17162 }
17163 }
17164 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
17176 #[serde(transparent)]
17177 pub struct GetUserOperationUserOpHash(::std::string::String);
17178 impl ::std::ops::Deref for GetUserOperationUserOpHash {
17179 type Target = ::std::string::String;
17180 fn deref(&self) -> &::std::string::String {
17181 &self.0
17182 }
17183 }
17184 impl ::std::convert::From<GetUserOperationUserOpHash> for ::std::string::String {
17185 fn from(value: GetUserOperationUserOpHash) -> Self {
17186 value.0
17187 }
17188 }
17189 impl ::std::convert::From<&GetUserOperationUserOpHash> for GetUserOperationUserOpHash {
17190 fn from(value: &GetUserOperationUserOpHash) -> Self {
17191 value.clone()
17192 }
17193 }
17194 impl ::std::str::FromStr for GetUserOperationUserOpHash {
17195 type Err = self::error::ConversionError;
17196 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17197 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
17198 ::std::sync::LazyLock::new(|| {
17199 ::regress::Regex::new("^0x[0-9a-fA-F]{64}$").unwrap()
17200 });
17201 if PATTERN.find(value).is_none() {
17202 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{64}$\"".into());
17203 }
17204 Ok(Self(value.to_string()))
17205 }
17206 }
17207 impl ::std::convert::TryFrom<&str> for GetUserOperationUserOpHash {
17208 type Error = self::error::ConversionError;
17209 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17210 value.parse()
17211 }
17212 }
17213 impl ::std::convert::TryFrom<&::std::string::String> for GetUserOperationUserOpHash {
17214 type Error = self::error::ConversionError;
17215 fn try_from(
17216 value: &::std::string::String,
17217 ) -> ::std::result::Result<Self, self::error::ConversionError> {
17218 value.parse()
17219 }
17220 }
17221 impl ::std::convert::TryFrom<::std::string::String> for GetUserOperationUserOpHash {
17222 type Error = self::error::ConversionError;
17223 fn try_from(
17224 value: ::std::string::String,
17225 ) -> ::std::result::Result<Self, self::error::ConversionError> {
17226 value.parse()
17227 }
17228 }
17229 impl<'de> ::serde::Deserialize<'de> for GetUserOperationUserOpHash {
17230 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
17231 where
17232 D: ::serde::Deserializer<'de>,
17233 {
17234 ::std::string::String::deserialize(deserializer)?
17235 .parse()
17236 .map_err(|e: self::error::ConversionError| {
17237 <D::Error as ::serde::de::Error>::custom(e.to_string())
17238 })
17239 }
17240 }
17241 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
17466 pub struct Idl {
17467 pub address: ::std::string::String,
17469 pub instructions: ::std::vec::Vec<IdlInstructionsItem>,
17471 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
17472 pub metadata: ::std::option::Option<IdlMetadata>,
17473 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
17475 pub types: ::std::vec::Vec<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
17476 }
17477 impl ::std::convert::From<&Idl> for Idl {
17478 fn from(value: &Idl) -> Self {
17479 value.clone()
17480 }
17481 }
17482 impl Idl {
17483 pub fn builder() -> builder::Idl {
17484 Default::default()
17485 }
17486 }
17487 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
17595 pub struct IdlInstructionsItem {
17596 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
17598 pub accounts: ::std::vec::Vec<IdlInstructionsItemAccountsItem>,
17599 pub args: ::std::vec::Vec<IdlInstructionsItemArgsItem>,
17601 pub discriminator: [u8; 8usize],
17603 pub name: ::std::string::String,
17605 }
17606 impl ::std::convert::From<&IdlInstructionsItem> for IdlInstructionsItem {
17607 fn from(value: &IdlInstructionsItem) -> Self {
17608 value.clone()
17609 }
17610 }
17611 impl IdlInstructionsItem {
17612 pub fn builder() -> builder::IdlInstructionsItem {
17613 Default::default()
17614 }
17615 }
17616 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
17653 pub struct IdlInstructionsItemAccountsItem {
17654 pub name: ::std::string::String,
17656 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
17658 pub signer: ::std::option::Option<bool>,
17659 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
17661 pub writable: ::std::option::Option<bool>,
17662 }
17663 impl ::std::convert::From<&IdlInstructionsItemAccountsItem> for IdlInstructionsItemAccountsItem {
17664 fn from(value: &IdlInstructionsItemAccountsItem) -> Self {
17665 value.clone()
17666 }
17667 }
17668 impl IdlInstructionsItemAccountsItem {
17669 pub fn builder() -> builder::IdlInstructionsItemAccountsItem {
17670 Default::default()
17671 }
17672 }
17673 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
17704 pub struct IdlInstructionsItemArgsItem {
17705 pub name: ::std::string::String,
17707 #[serde(rename = "type")]
17709 pub type_: ::std::string::String,
17710 }
17711 impl ::std::convert::From<&IdlInstructionsItemArgsItem> for IdlInstructionsItemArgsItem {
17712 fn from(value: &IdlInstructionsItemArgsItem) -> Self {
17713 value.clone()
17714 }
17715 }
17716 impl IdlInstructionsItemArgsItem {
17717 pub fn builder() -> builder::IdlInstructionsItemArgsItem {
17718 Default::default()
17719 }
17720 }
17721 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
17763 pub struct IdlMetadata {
17764 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
17766 pub name: ::std::option::Option<::std::string::String>,
17767 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
17769 pub spec: ::std::option::Option<::std::string::String>,
17770 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
17772 pub version: ::std::option::Option<::std::string::String>,
17773 }
17774 impl ::std::convert::From<&IdlMetadata> for IdlMetadata {
17775 fn from(value: &IdlMetadata) -> Self {
17776 value.clone()
17777 }
17778 }
17779 impl ::std::default::Default for IdlMetadata {
17780 fn default() -> Self {
17781 Self {
17782 name: Default::default(),
17783 spec: Default::default(),
17784 version: Default::default(),
17785 }
17786 }
17787 }
17788 impl IdlMetadata {
17789 pub fn builder() -> builder::IdlMetadata {
17790 Default::default()
17791 }
17792 }
17793 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
17833 pub struct ImportEvmAccountBody {
17834 #[serde(
17836 rename = "accountPolicy",
17837 default,
17838 skip_serializing_if = "::std::option::Option::is_none"
17839 )]
17840 pub account_policy: ::std::option::Option<ImportEvmAccountBodyAccountPolicy>,
17841 #[serde(rename = "encryptedPrivateKey")]
17843 pub encrypted_private_key: ::std::string::String,
17844 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
17848 pub name: ::std::option::Option<ImportEvmAccountBodyName>,
17849 }
17850 impl ::std::convert::From<&ImportEvmAccountBody> for ImportEvmAccountBody {
17851 fn from(value: &ImportEvmAccountBody) -> Self {
17852 value.clone()
17853 }
17854 }
17855 impl ImportEvmAccountBody {
17856 pub fn builder() -> builder::ImportEvmAccountBody {
17857 Default::default()
17858 }
17859 }
17860 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
17877 #[serde(transparent)]
17878 pub struct ImportEvmAccountBodyAccountPolicy(::std::string::String);
17879 impl ::std::ops::Deref for ImportEvmAccountBodyAccountPolicy {
17880 type Target = ::std::string::String;
17881 fn deref(&self) -> &::std::string::String {
17882 &self.0
17883 }
17884 }
17885 impl ::std::convert::From<ImportEvmAccountBodyAccountPolicy> for ::std::string::String {
17886 fn from(value: ImportEvmAccountBodyAccountPolicy) -> Self {
17887 value.0
17888 }
17889 }
17890 impl ::std::convert::From<&ImportEvmAccountBodyAccountPolicy>
17891 for ImportEvmAccountBodyAccountPolicy
17892 {
17893 fn from(value: &ImportEvmAccountBodyAccountPolicy) -> Self {
17894 value.clone()
17895 }
17896 }
17897 impl ::std::str::FromStr for ImportEvmAccountBodyAccountPolicy {
17898 type Err = self::error::ConversionError;
17899 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17900 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
17901 || {
17902 ::regress::Regex::new(
17903 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
17904 )
17905 .unwrap()
17906 },
17907 );
17908 if PATTERN.find(value).is_none() {
17909 return Err(
17910 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
17911 .into(),
17912 );
17913 }
17914 Ok(Self(value.to_string()))
17915 }
17916 }
17917 impl ::std::convert::TryFrom<&str> for ImportEvmAccountBodyAccountPolicy {
17918 type Error = self::error::ConversionError;
17919 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17920 value.parse()
17921 }
17922 }
17923 impl ::std::convert::TryFrom<&::std::string::String> for ImportEvmAccountBodyAccountPolicy {
17924 type Error = self::error::ConversionError;
17925 fn try_from(
17926 value: &::std::string::String,
17927 ) -> ::std::result::Result<Self, self::error::ConversionError> {
17928 value.parse()
17929 }
17930 }
17931 impl ::std::convert::TryFrom<::std::string::String> for ImportEvmAccountBodyAccountPolicy {
17932 type Error = self::error::ConversionError;
17933 fn try_from(
17934 value: ::std::string::String,
17935 ) -> ::std::result::Result<Self, self::error::ConversionError> {
17936 value.parse()
17937 }
17938 }
17939 impl<'de> ::serde::Deserialize<'de> for ImportEvmAccountBodyAccountPolicy {
17940 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
17941 where
17942 D: ::serde::Deserializer<'de>,
17943 {
17944 ::std::string::String::deserialize(deserializer)?
17945 .parse()
17946 .map_err(|e: self::error::ConversionError| {
17947 <D::Error as ::serde::de::Error>::custom(e.to_string())
17948 })
17949 }
17950 }
17951 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
17969 #[serde(transparent)]
17970 pub struct ImportEvmAccountBodyName(::std::string::String);
17971 impl ::std::ops::Deref for ImportEvmAccountBodyName {
17972 type Target = ::std::string::String;
17973 fn deref(&self) -> &::std::string::String {
17974 &self.0
17975 }
17976 }
17977 impl ::std::convert::From<ImportEvmAccountBodyName> for ::std::string::String {
17978 fn from(value: ImportEvmAccountBodyName) -> Self {
17979 value.0
17980 }
17981 }
17982 impl ::std::convert::From<&ImportEvmAccountBodyName> for ImportEvmAccountBodyName {
17983 fn from(value: &ImportEvmAccountBodyName) -> Self {
17984 value.clone()
17985 }
17986 }
17987 impl ::std::str::FromStr for ImportEvmAccountBodyName {
17988 type Err = self::error::ConversionError;
17989 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
17990 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
17991 ::std::sync::LazyLock::new(|| {
17992 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
17993 });
17994 if PATTERN.find(value).is_none() {
17995 return Err(
17996 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
17997 );
17998 }
17999 Ok(Self(value.to_string()))
18000 }
18001 }
18002 impl ::std::convert::TryFrom<&str> for ImportEvmAccountBodyName {
18003 type Error = self::error::ConversionError;
18004 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18005 value.parse()
18006 }
18007 }
18008 impl ::std::convert::TryFrom<&::std::string::String> for ImportEvmAccountBodyName {
18009 type Error = self::error::ConversionError;
18010 fn try_from(
18011 value: &::std::string::String,
18012 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18013 value.parse()
18014 }
18015 }
18016 impl ::std::convert::TryFrom<::std::string::String> for ImportEvmAccountBodyName {
18017 type Error = self::error::ConversionError;
18018 fn try_from(
18019 value: ::std::string::String,
18020 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18021 value.parse()
18022 }
18023 }
18024 impl<'de> ::serde::Deserialize<'de> for ImportEvmAccountBodyName {
18025 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
18026 where
18027 D: ::serde::Deserializer<'de>,
18028 {
18029 ::std::string::String::deserialize(deserializer)?
18030 .parse()
18031 .map_err(|e: self::error::ConversionError| {
18032 <D::Error as ::serde::de::Error>::custom(e.to_string())
18033 })
18034 }
18035 }
18036 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
18050 #[serde(transparent)]
18051 pub struct ImportEvmAccountXIdempotencyKey(::std::string::String);
18052 impl ::std::ops::Deref for ImportEvmAccountXIdempotencyKey {
18053 type Target = ::std::string::String;
18054 fn deref(&self) -> &::std::string::String {
18055 &self.0
18056 }
18057 }
18058 impl ::std::convert::From<ImportEvmAccountXIdempotencyKey> for ::std::string::String {
18059 fn from(value: ImportEvmAccountXIdempotencyKey) -> Self {
18060 value.0
18061 }
18062 }
18063 impl ::std::convert::From<&ImportEvmAccountXIdempotencyKey> for ImportEvmAccountXIdempotencyKey {
18064 fn from(value: &ImportEvmAccountXIdempotencyKey) -> Self {
18065 value.clone()
18066 }
18067 }
18068 impl ::std::str::FromStr for ImportEvmAccountXIdempotencyKey {
18069 type Err = self::error::ConversionError;
18070 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18071 if value.chars().count() > 36usize {
18072 return Err("longer than 36 characters".into());
18073 }
18074 if value.chars().count() < 36usize {
18075 return Err("shorter than 36 characters".into());
18076 }
18077 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
18078 ::std::sync::LazyLock::new(|| {
18079 ::regress::Regex::new(
18080 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
18081 )
18082 .unwrap()
18083 });
18084 if PATTERN.find(value).is_none() {
18085 return Err(
18086 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
18087 .into(),
18088 );
18089 }
18090 Ok(Self(value.to_string()))
18091 }
18092 }
18093 impl ::std::convert::TryFrom<&str> for ImportEvmAccountXIdempotencyKey {
18094 type Error = self::error::ConversionError;
18095 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18096 value.parse()
18097 }
18098 }
18099 impl ::std::convert::TryFrom<&::std::string::String> for ImportEvmAccountXIdempotencyKey {
18100 type Error = self::error::ConversionError;
18101 fn try_from(
18102 value: &::std::string::String,
18103 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18104 value.parse()
18105 }
18106 }
18107 impl ::std::convert::TryFrom<::std::string::String> for ImportEvmAccountXIdempotencyKey {
18108 type Error = self::error::ConversionError;
18109 fn try_from(
18110 value: ::std::string::String,
18111 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18112 value.parse()
18113 }
18114 }
18115 impl<'de> ::serde::Deserialize<'de> for ImportEvmAccountXIdempotencyKey {
18116 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
18117 where
18118 D: ::serde::Deserializer<'de>,
18119 {
18120 ::std::string::String::deserialize(deserializer)?
18121 .parse()
18122 .map_err(|e: self::error::ConversionError| {
18123 <D::Error as ::serde::de::Error>::custom(e.to_string())
18124 })
18125 }
18126 }
18127 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
18158 pub struct ImportSolanaAccountBody {
18159 #[serde(rename = "encryptedPrivateKey")]
18161 pub encrypted_private_key: ::std::string::String,
18162 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
18166 pub name: ::std::option::Option<ImportSolanaAccountBodyName>,
18167 }
18168 impl ::std::convert::From<&ImportSolanaAccountBody> for ImportSolanaAccountBody {
18169 fn from(value: &ImportSolanaAccountBody) -> Self {
18170 value.clone()
18171 }
18172 }
18173 impl ImportSolanaAccountBody {
18174 pub fn builder() -> builder::ImportSolanaAccountBody {
18175 Default::default()
18176 }
18177 }
18178 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
18196 #[serde(transparent)]
18197 pub struct ImportSolanaAccountBodyName(::std::string::String);
18198 impl ::std::ops::Deref for ImportSolanaAccountBodyName {
18199 type Target = ::std::string::String;
18200 fn deref(&self) -> &::std::string::String {
18201 &self.0
18202 }
18203 }
18204 impl ::std::convert::From<ImportSolanaAccountBodyName> for ::std::string::String {
18205 fn from(value: ImportSolanaAccountBodyName) -> Self {
18206 value.0
18207 }
18208 }
18209 impl ::std::convert::From<&ImportSolanaAccountBodyName> for ImportSolanaAccountBodyName {
18210 fn from(value: &ImportSolanaAccountBodyName) -> Self {
18211 value.clone()
18212 }
18213 }
18214 impl ::std::str::FromStr for ImportSolanaAccountBodyName {
18215 type Err = self::error::ConversionError;
18216 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18217 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
18218 ::std::sync::LazyLock::new(|| {
18219 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
18220 });
18221 if PATTERN.find(value).is_none() {
18222 return Err(
18223 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
18224 );
18225 }
18226 Ok(Self(value.to_string()))
18227 }
18228 }
18229 impl ::std::convert::TryFrom<&str> for ImportSolanaAccountBodyName {
18230 type Error = self::error::ConversionError;
18231 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18232 value.parse()
18233 }
18234 }
18235 impl ::std::convert::TryFrom<&::std::string::String> for ImportSolanaAccountBodyName {
18236 type Error = self::error::ConversionError;
18237 fn try_from(
18238 value: &::std::string::String,
18239 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18240 value.parse()
18241 }
18242 }
18243 impl ::std::convert::TryFrom<::std::string::String> for ImportSolanaAccountBodyName {
18244 type Error = self::error::ConversionError;
18245 fn try_from(
18246 value: ::std::string::String,
18247 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18248 value.parse()
18249 }
18250 }
18251 impl<'de> ::serde::Deserialize<'de> for ImportSolanaAccountBodyName {
18252 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
18253 where
18254 D: ::serde::Deserializer<'de>,
18255 {
18256 ::std::string::String::deserialize(deserializer)?
18257 .parse()
18258 .map_err(|e: self::error::ConversionError| {
18259 <D::Error as ::serde::de::Error>::custom(e.to_string())
18260 })
18261 }
18262 }
18263 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
18277 #[serde(transparent)]
18278 pub struct ImportSolanaAccountXIdempotencyKey(::std::string::String);
18279 impl ::std::ops::Deref for ImportSolanaAccountXIdempotencyKey {
18280 type Target = ::std::string::String;
18281 fn deref(&self) -> &::std::string::String {
18282 &self.0
18283 }
18284 }
18285 impl ::std::convert::From<ImportSolanaAccountXIdempotencyKey> for ::std::string::String {
18286 fn from(value: ImportSolanaAccountXIdempotencyKey) -> Self {
18287 value.0
18288 }
18289 }
18290 impl ::std::convert::From<&ImportSolanaAccountXIdempotencyKey>
18291 for ImportSolanaAccountXIdempotencyKey
18292 {
18293 fn from(value: &ImportSolanaAccountXIdempotencyKey) -> Self {
18294 value.clone()
18295 }
18296 }
18297 impl ::std::str::FromStr for ImportSolanaAccountXIdempotencyKey {
18298 type Err = self::error::ConversionError;
18299 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18300 if value.chars().count() > 36usize {
18301 return Err("longer than 36 characters".into());
18302 }
18303 if value.chars().count() < 36usize {
18304 return Err("shorter than 36 characters".into());
18305 }
18306 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
18307 ::std::sync::LazyLock::new(|| {
18308 ::regress::Regex::new(
18309 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
18310 )
18311 .unwrap()
18312 });
18313 if PATTERN.find(value).is_none() {
18314 return Err(
18315 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
18316 .into(),
18317 );
18318 }
18319 Ok(Self(value.to_string()))
18320 }
18321 }
18322 impl ::std::convert::TryFrom<&str> for ImportSolanaAccountXIdempotencyKey {
18323 type Error = self::error::ConversionError;
18324 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18325 value.parse()
18326 }
18327 }
18328 impl ::std::convert::TryFrom<&::std::string::String> for ImportSolanaAccountXIdempotencyKey {
18329 type Error = self::error::ConversionError;
18330 fn try_from(
18331 value: &::std::string::String,
18332 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18333 value.parse()
18334 }
18335 }
18336 impl ::std::convert::TryFrom<::std::string::String> for ImportSolanaAccountXIdempotencyKey {
18337 type Error = self::error::ConversionError;
18338 fn try_from(
18339 value: ::std::string::String,
18340 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18341 value.parse()
18342 }
18343 }
18344 impl<'de> ::serde::Deserialize<'de> for ImportSolanaAccountXIdempotencyKey {
18345 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
18346 where
18347 D: ::serde::Deserializer<'de>,
18348 {
18349 ::std::string::String::deserialize(deserializer)?
18350 .parse()
18351 .map_err(|e: self::error::ConversionError| {
18352 <D::Error as ::serde::de::Error>::custom(e.to_string())
18353 })
18354 }
18355 }
18356 #[derive(
18377 ::serde::Deserialize,
18378 ::serde::Serialize,
18379 Clone,
18380 Copy,
18381 Debug,
18382 Eq,
18383 Hash,
18384 Ord,
18385 PartialEq,
18386 PartialOrd,
18387 )]
18388 pub enum KnownAbiType {
18389 #[serde(rename = "erc20")]
18390 Erc20,
18391 #[serde(rename = "erc721")]
18392 Erc721,
18393 #[serde(rename = "erc1155")]
18394 Erc1155,
18395 }
18396 impl ::std::convert::From<&Self> for KnownAbiType {
18397 fn from(value: &KnownAbiType) -> Self {
18398 value.clone()
18399 }
18400 }
18401 impl ::std::fmt::Display for KnownAbiType {
18402 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
18403 match *self {
18404 Self::Erc20 => f.write_str("erc20"),
18405 Self::Erc721 => f.write_str("erc721"),
18406 Self::Erc1155 => f.write_str("erc1155"),
18407 }
18408 }
18409 }
18410 impl ::std::str::FromStr for KnownAbiType {
18411 type Err = self::error::ConversionError;
18412 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18413 match value {
18414 "erc20" => Ok(Self::Erc20),
18415 "erc721" => Ok(Self::Erc721),
18416 "erc1155" => Ok(Self::Erc1155),
18417 _ => Err("invalid value".into()),
18418 }
18419 }
18420 }
18421 impl ::std::convert::TryFrom<&str> for KnownAbiType {
18422 type Error = self::error::ConversionError;
18423 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18424 value.parse()
18425 }
18426 }
18427 impl ::std::convert::TryFrom<&::std::string::String> for KnownAbiType {
18428 type Error = self::error::ConversionError;
18429 fn try_from(
18430 value: &::std::string::String,
18431 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18432 value.parse()
18433 }
18434 }
18435 impl ::std::convert::TryFrom<::std::string::String> for KnownAbiType {
18436 type Error = self::error::ConversionError;
18437 fn try_from(
18438 value: ::std::string::String,
18439 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18440 value.parse()
18441 }
18442 }
18443 #[derive(
18465 ::serde::Deserialize,
18466 ::serde::Serialize,
18467 Clone,
18468 Copy,
18469 Debug,
18470 Eq,
18471 Hash,
18472 Ord,
18473 PartialEq,
18474 PartialOrd,
18475 )]
18476 pub enum KnownIdlType {
18477 SystemProgram,
18478 TokenProgram,
18479 AssociatedTokenProgram,
18480 }
18481 impl ::std::convert::From<&Self> for KnownIdlType {
18482 fn from(value: &KnownIdlType) -> Self {
18483 value.clone()
18484 }
18485 }
18486 impl ::std::fmt::Display for KnownIdlType {
18487 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
18488 match *self {
18489 Self::SystemProgram => f.write_str("SystemProgram"),
18490 Self::TokenProgram => f.write_str("TokenProgram"),
18491 Self::AssociatedTokenProgram => f.write_str("AssociatedTokenProgram"),
18492 }
18493 }
18494 }
18495 impl ::std::str::FromStr for KnownIdlType {
18496 type Err = self::error::ConversionError;
18497 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18498 match value {
18499 "SystemProgram" => Ok(Self::SystemProgram),
18500 "TokenProgram" => Ok(Self::TokenProgram),
18501 "AssociatedTokenProgram" => Ok(Self::AssociatedTokenProgram),
18502 _ => Err("invalid value".into()),
18503 }
18504 }
18505 }
18506 impl ::std::convert::TryFrom<&str> for KnownIdlType {
18507 type Error = self::error::ConversionError;
18508 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18509 value.parse()
18510 }
18511 }
18512 impl ::std::convert::TryFrom<&::std::string::String> for KnownIdlType {
18513 type Error = self::error::ConversionError;
18514 fn try_from(
18515 value: &::std::string::String,
18516 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18517 value.parse()
18518 }
18519 }
18520 impl ::std::convert::TryFrom<::std::string::String> for KnownIdlType {
18521 type Error = self::error::ConversionError;
18522 fn try_from(
18523 value: ::std::string::String,
18524 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18525 value.parse()
18526 }
18527 }
18528 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
18540 #[serde(transparent)]
18541 pub struct ListDataTokenBalancesAddress(::std::string::String);
18542 impl ::std::ops::Deref for ListDataTokenBalancesAddress {
18543 type Target = ::std::string::String;
18544 fn deref(&self) -> &::std::string::String {
18545 &self.0
18546 }
18547 }
18548 impl ::std::convert::From<ListDataTokenBalancesAddress> for ::std::string::String {
18549 fn from(value: ListDataTokenBalancesAddress) -> Self {
18550 value.0
18551 }
18552 }
18553 impl ::std::convert::From<&ListDataTokenBalancesAddress> for ListDataTokenBalancesAddress {
18554 fn from(value: &ListDataTokenBalancesAddress) -> Self {
18555 value.clone()
18556 }
18557 }
18558 impl ::std::str::FromStr for ListDataTokenBalancesAddress {
18559 type Err = self::error::ConversionError;
18560 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18561 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
18562 ::std::sync::LazyLock::new(|| {
18563 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
18564 });
18565 if PATTERN.find(value).is_none() {
18566 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
18567 }
18568 Ok(Self(value.to_string()))
18569 }
18570 }
18571 impl ::std::convert::TryFrom<&str> for ListDataTokenBalancesAddress {
18572 type Error = self::error::ConversionError;
18573 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18574 value.parse()
18575 }
18576 }
18577 impl ::std::convert::TryFrom<&::std::string::String> for ListDataTokenBalancesAddress {
18578 type Error = self::error::ConversionError;
18579 fn try_from(
18580 value: &::std::string::String,
18581 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18582 value.parse()
18583 }
18584 }
18585 impl ::std::convert::TryFrom<::std::string::String> for ListDataTokenBalancesAddress {
18586 type Error = self::error::ConversionError;
18587 fn try_from(
18588 value: ::std::string::String,
18589 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18590 value.parse()
18591 }
18592 }
18593 impl<'de> ::serde::Deserialize<'de> for ListDataTokenBalancesAddress {
18594 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
18595 where
18596 D: ::serde::Deserializer<'de>,
18597 {
18598 ::std::string::String::deserialize(deserializer)?
18599 .parse()
18600 .map_err(|e: self::error::ConversionError| {
18601 <D::Error as ::serde::de::Error>::custom(e.to_string())
18602 })
18603 }
18604 }
18605 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
18663 pub struct ListDataTokenBalancesResponse {
18664 pub balances: ::std::vec::Vec<TokenBalance>,
18666 #[serde(
18668 rename = "nextPageToken",
18669 default,
18670 skip_serializing_if = "::std::option::Option::is_none"
18671 )]
18672 pub next_page_token: ::std::option::Option<::std::string::String>,
18673 }
18674 impl ::std::convert::From<&ListDataTokenBalancesResponse> for ListDataTokenBalancesResponse {
18675 fn from(value: &ListDataTokenBalancesResponse) -> Self {
18676 value.clone()
18677 }
18678 }
18679 impl ListDataTokenBalancesResponse {
18680 pub fn builder() -> builder::ListDataTokenBalancesResponse {
18681 Default::default()
18682 }
18683 }
18684 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
18714 pub struct ListEndUsersResponse {
18715 #[serde(rename = "endUsers")]
18717 pub end_users: ::std::vec::Vec<EndUser>,
18718 #[serde(
18720 rename = "nextPageToken",
18721 default,
18722 skip_serializing_if = "::std::option::Option::is_none"
18723 )]
18724 pub next_page_token: ::std::option::Option<::std::string::String>,
18725 }
18726 impl ::std::convert::From<&ListEndUsersResponse> for ListEndUsersResponse {
18727 fn from(value: &ListEndUsersResponse) -> Self {
18728 value.clone()
18729 }
18730 }
18731 impl ListEndUsersResponse {
18732 pub fn builder() -> builder::ListEndUsersResponse {
18733 Default::default()
18734 }
18735 }
18736 #[derive(
18751 ::serde::Deserialize,
18752 ::serde::Serialize,
18753 Clone,
18754 Copy,
18755 Debug,
18756 Eq,
18757 Hash,
18758 Ord,
18759 PartialEq,
18760 PartialOrd,
18761 )]
18762 pub enum ListEndUsersSortItem {
18763 #[serde(rename = "createdAt=asc")]
18764 CreatedAtAsc,
18765 #[serde(rename = "createdAt=desc")]
18766 CreatedAtDesc,
18767 }
18768 impl ::std::convert::From<&Self> for ListEndUsersSortItem {
18769 fn from(value: &ListEndUsersSortItem) -> Self {
18770 value.clone()
18771 }
18772 }
18773 impl ::std::fmt::Display for ListEndUsersSortItem {
18774 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
18775 match *self {
18776 Self::CreatedAtAsc => f.write_str("createdAt=asc"),
18777 Self::CreatedAtDesc => f.write_str("createdAt=desc"),
18778 }
18779 }
18780 }
18781 impl ::std::str::FromStr for ListEndUsersSortItem {
18782 type Err = self::error::ConversionError;
18783 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18784 match value {
18785 "createdAt=asc" => Ok(Self::CreatedAtAsc),
18786 "createdAt=desc" => Ok(Self::CreatedAtDesc),
18787 _ => Err("invalid value".into()),
18788 }
18789 }
18790 }
18791 impl ::std::convert::TryFrom<&str> for ListEndUsersSortItem {
18792 type Error = self::error::ConversionError;
18793 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18794 value.parse()
18795 }
18796 }
18797 impl ::std::convert::TryFrom<&::std::string::String> for ListEndUsersSortItem {
18798 type Error = self::error::ConversionError;
18799 fn try_from(
18800 value: &::std::string::String,
18801 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18802 value.parse()
18803 }
18804 }
18805 impl ::std::convert::TryFrom<::std::string::String> for ListEndUsersSortItem {
18806 type Error = self::error::ConversionError;
18807 fn try_from(
18808 value: ::std::string::String,
18809 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18810 value.parse()
18811 }
18812 }
18813 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
18843 pub struct ListEvmAccountsResponse {
18844 pub accounts: ::std::vec::Vec<EvmAccount>,
18846 #[serde(
18848 rename = "nextPageToken",
18849 default,
18850 skip_serializing_if = "::std::option::Option::is_none"
18851 )]
18852 pub next_page_token: ::std::option::Option<::std::string::String>,
18853 }
18854 impl ::std::convert::From<&ListEvmAccountsResponse> for ListEvmAccountsResponse {
18855 fn from(value: &ListEvmAccountsResponse) -> Self {
18856 value.clone()
18857 }
18858 }
18859 impl ListEvmAccountsResponse {
18860 pub fn builder() -> builder::ListEvmAccountsResponse {
18861 Default::default()
18862 }
18863 }
18864 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
18894 pub struct ListEvmSmartAccountsResponse {
18895 pub accounts: ::std::vec::Vec<EvmSmartAccount>,
18897 #[serde(
18899 rename = "nextPageToken",
18900 default,
18901 skip_serializing_if = "::std::option::Option::is_none"
18902 )]
18903 pub next_page_token: ::std::option::Option<::std::string::String>,
18904 }
18905 impl ::std::convert::From<&ListEvmSmartAccountsResponse> for ListEvmSmartAccountsResponse {
18906 fn from(value: &ListEvmSmartAccountsResponse) -> Self {
18907 value.clone()
18908 }
18909 }
18910 impl ListEvmSmartAccountsResponse {
18911 pub fn builder() -> builder::ListEvmSmartAccountsResponse {
18912 Default::default()
18913 }
18914 }
18915 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
18927 #[serde(transparent)]
18928 pub struct ListEvmTokenBalancesAddress(::std::string::String);
18929 impl ::std::ops::Deref for ListEvmTokenBalancesAddress {
18930 type Target = ::std::string::String;
18931 fn deref(&self) -> &::std::string::String {
18932 &self.0
18933 }
18934 }
18935 impl ::std::convert::From<ListEvmTokenBalancesAddress> for ::std::string::String {
18936 fn from(value: ListEvmTokenBalancesAddress) -> Self {
18937 value.0
18938 }
18939 }
18940 impl ::std::convert::From<&ListEvmTokenBalancesAddress> for ListEvmTokenBalancesAddress {
18941 fn from(value: &ListEvmTokenBalancesAddress) -> Self {
18942 value.clone()
18943 }
18944 }
18945 impl ::std::str::FromStr for ListEvmTokenBalancesAddress {
18946 type Err = self::error::ConversionError;
18947 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18948 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
18949 ::std::sync::LazyLock::new(|| {
18950 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
18951 });
18952 if PATTERN.find(value).is_none() {
18953 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
18954 }
18955 Ok(Self(value.to_string()))
18956 }
18957 }
18958 impl ::std::convert::TryFrom<&str> for ListEvmTokenBalancesAddress {
18959 type Error = self::error::ConversionError;
18960 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
18961 value.parse()
18962 }
18963 }
18964 impl ::std::convert::TryFrom<&::std::string::String> for ListEvmTokenBalancesAddress {
18965 type Error = self::error::ConversionError;
18966 fn try_from(
18967 value: &::std::string::String,
18968 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18969 value.parse()
18970 }
18971 }
18972 impl ::std::convert::TryFrom<::std::string::String> for ListEvmTokenBalancesAddress {
18973 type Error = self::error::ConversionError;
18974 fn try_from(
18975 value: ::std::string::String,
18976 ) -> ::std::result::Result<Self, self::error::ConversionError> {
18977 value.parse()
18978 }
18979 }
18980 impl<'de> ::serde::Deserialize<'de> for ListEvmTokenBalancesAddress {
18981 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
18982 where
18983 D: ::serde::Deserializer<'de>,
18984 {
18985 ::std::string::String::deserialize(deserializer)?
18986 .parse()
18987 .map_err(|e: self::error::ConversionError| {
18988 <D::Error as ::serde::de::Error>::custom(e.to_string())
18989 })
18990 }
18991 }
18992 #[derive(
19012 ::serde::Deserialize,
19013 ::serde::Serialize,
19014 Clone,
19015 Copy,
19016 Debug,
19017 Eq,
19018 Hash,
19019 Ord,
19020 PartialEq,
19021 PartialOrd,
19022 )]
19023 pub enum ListEvmTokenBalancesNetwork {
19024 #[serde(rename = "base")]
19025 Base,
19026 #[serde(rename = "base-sepolia")]
19027 BaseSepolia,
19028 #[serde(rename = "ethereum")]
19029 Ethereum,
19030 }
19031 impl ::std::convert::From<&Self> for ListEvmTokenBalancesNetwork {
19032 fn from(value: &ListEvmTokenBalancesNetwork) -> Self {
19033 value.clone()
19034 }
19035 }
19036 impl ::std::fmt::Display for ListEvmTokenBalancesNetwork {
19037 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
19038 match *self {
19039 Self::Base => f.write_str("base"),
19040 Self::BaseSepolia => f.write_str("base-sepolia"),
19041 Self::Ethereum => f.write_str("ethereum"),
19042 }
19043 }
19044 }
19045 impl ::std::str::FromStr for ListEvmTokenBalancesNetwork {
19046 type Err = self::error::ConversionError;
19047 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19048 match value {
19049 "base" => Ok(Self::Base),
19050 "base-sepolia" => Ok(Self::BaseSepolia),
19051 "ethereum" => Ok(Self::Ethereum),
19052 _ => Err("invalid value".into()),
19053 }
19054 }
19055 }
19056 impl ::std::convert::TryFrom<&str> for ListEvmTokenBalancesNetwork {
19057 type Error = self::error::ConversionError;
19058 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19059 value.parse()
19060 }
19061 }
19062 impl ::std::convert::TryFrom<&::std::string::String> for ListEvmTokenBalancesNetwork {
19063 type Error = self::error::ConversionError;
19064 fn try_from(
19065 value: &::std::string::String,
19066 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19067 value.parse()
19068 }
19069 }
19070 impl ::std::convert::TryFrom<::std::string::String> for ListEvmTokenBalancesNetwork {
19071 type Error = self::error::ConversionError;
19072 fn try_from(
19073 value: ::std::string::String,
19074 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19075 value.parse()
19076 }
19077 }
19078 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
19136 pub struct ListEvmTokenBalancesResponse {
19137 pub balances: ::std::vec::Vec<TokenBalance>,
19139 #[serde(
19141 rename = "nextPageToken",
19142 default,
19143 skip_serializing_if = "::std::option::Option::is_none"
19144 )]
19145 pub next_page_token: ::std::option::Option<::std::string::String>,
19146 }
19147 impl ::std::convert::From<&ListEvmTokenBalancesResponse> for ListEvmTokenBalancesResponse {
19148 fn from(value: &ListEvmTokenBalancesResponse) -> Self {
19149 value.clone()
19150 }
19151 }
19152 impl ListEvmTokenBalancesResponse {
19153 pub fn builder() -> builder::ListEvmTokenBalancesResponse {
19154 Default::default()
19155 }
19156 }
19157 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
19187 pub struct ListPoliciesResponse {
19188 #[serde(
19190 rename = "nextPageToken",
19191 default,
19192 skip_serializing_if = "::std::option::Option::is_none"
19193 )]
19194 pub next_page_token: ::std::option::Option<::std::string::String>,
19195 pub policies: ::std::vec::Vec<Policy>,
19197 }
19198 impl ::std::convert::From<&ListPoliciesResponse> for ListPoliciesResponse {
19199 fn from(value: &ListPoliciesResponse) -> Self {
19200 value.clone()
19201 }
19202 }
19203 impl ListPoliciesResponse {
19204 pub fn builder() -> builder::ListPoliciesResponse {
19205 Default::default()
19206 }
19207 }
19208 #[derive(
19223 ::serde::Deserialize,
19224 ::serde::Serialize,
19225 Clone,
19226 Copy,
19227 Debug,
19228 Eq,
19229 Hash,
19230 Ord,
19231 PartialEq,
19232 PartialOrd,
19233 )]
19234 pub enum ListPoliciesScope {
19235 #[serde(rename = "project")]
19236 Project,
19237 #[serde(rename = "account")]
19238 Account,
19239 }
19240 impl ::std::convert::From<&Self> for ListPoliciesScope {
19241 fn from(value: &ListPoliciesScope) -> Self {
19242 value.clone()
19243 }
19244 }
19245 impl ::std::fmt::Display for ListPoliciesScope {
19246 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
19247 match *self {
19248 Self::Project => f.write_str("project"),
19249 Self::Account => f.write_str("account"),
19250 }
19251 }
19252 }
19253 impl ::std::str::FromStr for ListPoliciesScope {
19254 type Err = self::error::ConversionError;
19255 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19256 match value {
19257 "project" => Ok(Self::Project),
19258 "account" => Ok(Self::Account),
19259 _ => Err("invalid value".into()),
19260 }
19261 }
19262 }
19263 impl ::std::convert::TryFrom<&str> for ListPoliciesScope {
19264 type Error = self::error::ConversionError;
19265 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19266 value.parse()
19267 }
19268 }
19269 impl ::std::convert::TryFrom<&::std::string::String> for ListPoliciesScope {
19270 type Error = self::error::ConversionError;
19271 fn try_from(
19272 value: &::std::string::String,
19273 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19274 value.parse()
19275 }
19276 }
19277 impl ::std::convert::TryFrom<::std::string::String> for ListPoliciesScope {
19278 type Error = self::error::ConversionError;
19279 fn try_from(
19280 value: ::std::string::String,
19281 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19282 value.parse()
19283 }
19284 }
19285 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
19305 pub struct ListResponse {
19306 #[serde(
19308 rename = "nextPageToken",
19309 default,
19310 skip_serializing_if = "::std::option::Option::is_none"
19311 )]
19312 pub next_page_token: ::std::option::Option<::std::string::String>,
19313 }
19314 impl ::std::convert::From<&ListResponse> for ListResponse {
19315 fn from(value: &ListResponse) -> Self {
19316 value.clone()
19317 }
19318 }
19319 impl ::std::default::Default for ListResponse {
19320 fn default() -> Self {
19321 Self {
19322 next_page_token: Default::default(),
19323 }
19324 }
19325 }
19326 impl ListResponse {
19327 pub fn builder() -> builder::ListResponse {
19328 Default::default()
19329 }
19330 }
19331 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
19361 pub struct ListSolanaAccountsResponse {
19362 pub accounts: ::std::vec::Vec<SolanaAccount>,
19364 #[serde(
19366 rename = "nextPageToken",
19367 default,
19368 skip_serializing_if = "::std::option::Option::is_none"
19369 )]
19370 pub next_page_token: ::std::option::Option<::std::string::String>,
19371 }
19372 impl ::std::convert::From<&ListSolanaAccountsResponse> for ListSolanaAccountsResponse {
19373 fn from(value: &ListSolanaAccountsResponse) -> Self {
19374 value.clone()
19375 }
19376 }
19377 impl ListSolanaAccountsResponse {
19378 pub fn builder() -> builder::ListSolanaAccountsResponse {
19379 Default::default()
19380 }
19381 }
19382 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19394 #[serde(transparent)]
19395 pub struct ListSolanaTokenBalancesAddress(::std::string::String);
19396 impl ::std::ops::Deref for ListSolanaTokenBalancesAddress {
19397 type Target = ::std::string::String;
19398 fn deref(&self) -> &::std::string::String {
19399 &self.0
19400 }
19401 }
19402 impl ::std::convert::From<ListSolanaTokenBalancesAddress> for ::std::string::String {
19403 fn from(value: ListSolanaTokenBalancesAddress) -> Self {
19404 value.0
19405 }
19406 }
19407 impl ::std::convert::From<&ListSolanaTokenBalancesAddress> for ListSolanaTokenBalancesAddress {
19408 fn from(value: &ListSolanaTokenBalancesAddress) -> Self {
19409 value.clone()
19410 }
19411 }
19412 impl ::std::str::FromStr for ListSolanaTokenBalancesAddress {
19413 type Err = self::error::ConversionError;
19414 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19415 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
19416 ::std::sync::LazyLock::new(|| {
19417 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
19418 });
19419 if PATTERN.find(value).is_none() {
19420 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
19421 }
19422 Ok(Self(value.to_string()))
19423 }
19424 }
19425 impl ::std::convert::TryFrom<&str> for ListSolanaTokenBalancesAddress {
19426 type Error = self::error::ConversionError;
19427 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19428 value.parse()
19429 }
19430 }
19431 impl ::std::convert::TryFrom<&::std::string::String> for ListSolanaTokenBalancesAddress {
19432 type Error = self::error::ConversionError;
19433 fn try_from(
19434 value: &::std::string::String,
19435 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19436 value.parse()
19437 }
19438 }
19439 impl ::std::convert::TryFrom<::std::string::String> for ListSolanaTokenBalancesAddress {
19440 type Error = self::error::ConversionError;
19441 fn try_from(
19442 value: ::std::string::String,
19443 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19444 value.parse()
19445 }
19446 }
19447 impl<'de> ::serde::Deserialize<'de> for ListSolanaTokenBalancesAddress {
19448 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
19449 where
19450 D: ::serde::Deserializer<'de>,
19451 {
19452 ::std::string::String::deserialize(deserializer)?
19453 .parse()
19454 .map_err(|e: self::error::ConversionError| {
19455 <D::Error as ::serde::de::Error>::custom(e.to_string())
19456 })
19457 }
19458 }
19459 #[derive(
19478 ::serde::Deserialize,
19479 ::serde::Serialize,
19480 Clone,
19481 Copy,
19482 Debug,
19483 Eq,
19484 Hash,
19485 Ord,
19486 PartialEq,
19487 PartialOrd,
19488 )]
19489 pub enum ListSolanaTokenBalancesNetwork {
19490 #[serde(rename = "solana")]
19491 Solana,
19492 #[serde(rename = "solana-devnet")]
19493 SolanaDevnet,
19494 }
19495 impl ::std::convert::From<&Self> for ListSolanaTokenBalancesNetwork {
19496 fn from(value: &ListSolanaTokenBalancesNetwork) -> Self {
19497 value.clone()
19498 }
19499 }
19500 impl ::std::fmt::Display for ListSolanaTokenBalancesNetwork {
19501 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
19502 match *self {
19503 Self::Solana => f.write_str("solana"),
19504 Self::SolanaDevnet => f.write_str("solana-devnet"),
19505 }
19506 }
19507 }
19508 impl ::std::str::FromStr for ListSolanaTokenBalancesNetwork {
19509 type Err = self::error::ConversionError;
19510 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19511 match value {
19512 "solana" => Ok(Self::Solana),
19513 "solana-devnet" => Ok(Self::SolanaDevnet),
19514 _ => Err("invalid value".into()),
19515 }
19516 }
19517 }
19518 impl ::std::convert::TryFrom<&str> for ListSolanaTokenBalancesNetwork {
19519 type Error = self::error::ConversionError;
19520 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19521 value.parse()
19522 }
19523 }
19524 impl ::std::convert::TryFrom<&::std::string::String> for ListSolanaTokenBalancesNetwork {
19525 type Error = self::error::ConversionError;
19526 fn try_from(
19527 value: &::std::string::String,
19528 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19529 value.parse()
19530 }
19531 }
19532 impl ::std::convert::TryFrom<::std::string::String> for ListSolanaTokenBalancesNetwork {
19533 type Error = self::error::ConversionError;
19534 fn try_from(
19535 value: ::std::string::String,
19536 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19537 value.parse()
19538 }
19539 }
19540 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
19596 pub struct ListSolanaTokenBalancesResponse {
19597 pub balances: ::std::vec::Vec<SolanaTokenBalance>,
19599 #[serde(
19601 rename = "nextPageToken",
19602 default,
19603 skip_serializing_if = "::std::option::Option::is_none"
19604 )]
19605 pub next_page_token: ::std::option::Option<::std::string::String>,
19606 }
19607 impl ::std::convert::From<&ListSolanaTokenBalancesResponse> for ListSolanaTokenBalancesResponse {
19608 fn from(value: &ListSolanaTokenBalancesResponse) -> Self {
19609 value.clone()
19610 }
19611 }
19612 impl ListSolanaTokenBalancesResponse {
19613 pub fn builder() -> builder::ListSolanaTokenBalancesResponse {
19614 Default::default()
19615 }
19616 }
19617 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19629 #[serde(transparent)]
19630 pub struct ListSpendPermissionsAddress(::std::string::String);
19631 impl ::std::ops::Deref for ListSpendPermissionsAddress {
19632 type Target = ::std::string::String;
19633 fn deref(&self) -> &::std::string::String {
19634 &self.0
19635 }
19636 }
19637 impl ::std::convert::From<ListSpendPermissionsAddress> for ::std::string::String {
19638 fn from(value: ListSpendPermissionsAddress) -> Self {
19639 value.0
19640 }
19641 }
19642 impl ::std::convert::From<&ListSpendPermissionsAddress> for ListSpendPermissionsAddress {
19643 fn from(value: &ListSpendPermissionsAddress) -> Self {
19644 value.clone()
19645 }
19646 }
19647 impl ::std::str::FromStr for ListSpendPermissionsAddress {
19648 type Err = self::error::ConversionError;
19649 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19650 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
19651 ::std::sync::LazyLock::new(|| {
19652 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
19653 });
19654 if PATTERN.find(value).is_none() {
19655 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
19656 }
19657 Ok(Self(value.to_string()))
19658 }
19659 }
19660 impl ::std::convert::TryFrom<&str> for ListSpendPermissionsAddress {
19661 type Error = self::error::ConversionError;
19662 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19663 value.parse()
19664 }
19665 }
19666 impl ::std::convert::TryFrom<&::std::string::String> for ListSpendPermissionsAddress {
19667 type Error = self::error::ConversionError;
19668 fn try_from(
19669 value: &::std::string::String,
19670 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19671 value.parse()
19672 }
19673 }
19674 impl ::std::convert::TryFrom<::std::string::String> for ListSpendPermissionsAddress {
19675 type Error = self::error::ConversionError;
19676 fn try_from(
19677 value: ::std::string::String,
19678 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19679 value.parse()
19680 }
19681 }
19682 impl<'de> ::serde::Deserialize<'de> for ListSpendPermissionsAddress {
19683 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
19684 where
19685 D: ::serde::Deserializer<'de>,
19686 {
19687 ::std::string::String::deserialize(deserializer)?
19688 .parse()
19689 .map_err(|e: self::error::ConversionError| {
19690 <D::Error as ::serde::de::Error>::custom(e.to_string())
19691 })
19692 }
19693 }
19694 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
19724 pub struct ListSpendPermissionsResponse {
19725 #[serde(
19727 rename = "nextPageToken",
19728 default,
19729 skip_serializing_if = "::std::option::Option::is_none"
19730 )]
19731 pub next_page_token: ::std::option::Option<::std::string::String>,
19732 #[serde(rename = "spendPermissions")]
19734 pub spend_permissions: ::std::vec::Vec<SpendPermissionResponseObject>,
19735 }
19736 impl ::std::convert::From<&ListSpendPermissionsResponse> for ListSpendPermissionsResponse {
19737 fn from(value: &ListSpendPermissionsResponse) -> Self {
19738 value.clone()
19739 }
19740 }
19741 impl ListSpendPermissionsResponse {
19742 pub fn builder() -> builder::ListSpendPermissionsResponse {
19743 Default::default()
19744 }
19745 }
19746 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19758 #[serde(transparent)]
19759 pub struct ListTokensForAccountAddress(::std::string::String);
19760 impl ::std::ops::Deref for ListTokensForAccountAddress {
19761 type Target = ::std::string::String;
19762 fn deref(&self) -> &::std::string::String {
19763 &self.0
19764 }
19765 }
19766 impl ::std::convert::From<ListTokensForAccountAddress> for ::std::string::String {
19767 fn from(value: ListTokensForAccountAddress) -> Self {
19768 value.0
19769 }
19770 }
19771 impl ::std::convert::From<&ListTokensForAccountAddress> for ListTokensForAccountAddress {
19772 fn from(value: &ListTokensForAccountAddress) -> Self {
19773 value.clone()
19774 }
19775 }
19776 impl ::std::str::FromStr for ListTokensForAccountAddress {
19777 type Err = self::error::ConversionError;
19778 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19779 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
19780 ::std::sync::LazyLock::new(|| {
19781 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
19782 });
19783 if PATTERN.find(value).is_none() {
19784 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
19785 }
19786 Ok(Self(value.to_string()))
19787 }
19788 }
19789 impl ::std::convert::TryFrom<&str> for ListTokensForAccountAddress {
19790 type Error = self::error::ConversionError;
19791 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19792 value.parse()
19793 }
19794 }
19795 impl ::std::convert::TryFrom<&::std::string::String> for ListTokensForAccountAddress {
19796 type Error = self::error::ConversionError;
19797 fn try_from(
19798 value: &::std::string::String,
19799 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19800 value.parse()
19801 }
19802 }
19803 impl ::std::convert::TryFrom<::std::string::String> for ListTokensForAccountAddress {
19804 type Error = self::error::ConversionError;
19805 fn try_from(
19806 value: ::std::string::String,
19807 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19808 value.parse()
19809 }
19810 }
19811 impl<'de> ::serde::Deserialize<'de> for ListTokensForAccountAddress {
19812 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
19813 where
19814 D: ::serde::Deserializer<'de>,
19815 {
19816 ::std::string::String::deserialize(deserializer)?
19817 .parse()
19818 .map_err(|e: self::error::ConversionError| {
19819 <D::Error as ::serde::de::Error>::custom(e.to_string())
19820 })
19821 }
19822 }
19823 #[derive(
19838 ::serde::Deserialize,
19839 ::serde::Serialize,
19840 Clone,
19841 Copy,
19842 Debug,
19843 Eq,
19844 Hash,
19845 Ord,
19846 PartialEq,
19847 PartialOrd,
19848 )]
19849 pub enum ListTokensForAccountNetwork {
19850 #[serde(rename = "base")]
19851 Base,
19852 #[serde(rename = "base-sepolia")]
19853 BaseSepolia,
19854 }
19855 impl ::std::convert::From<&Self> for ListTokensForAccountNetwork {
19856 fn from(value: &ListTokensForAccountNetwork) -> Self {
19857 value.clone()
19858 }
19859 }
19860 impl ::std::fmt::Display for ListTokensForAccountNetwork {
19861 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
19862 match *self {
19863 Self::Base => f.write_str("base"),
19864 Self::BaseSepolia => f.write_str("base-sepolia"),
19865 }
19866 }
19867 }
19868 impl ::std::str::FromStr for ListTokensForAccountNetwork {
19869 type Err = self::error::ConversionError;
19870 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19871 match value {
19872 "base" => Ok(Self::Base),
19873 "base-sepolia" => Ok(Self::BaseSepolia),
19874 _ => Err("invalid value".into()),
19875 }
19876 }
19877 }
19878 impl ::std::convert::TryFrom<&str> for ListTokensForAccountNetwork {
19879 type Error = self::error::ConversionError;
19880 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
19881 value.parse()
19882 }
19883 }
19884 impl ::std::convert::TryFrom<&::std::string::String> for ListTokensForAccountNetwork {
19885 type Error = self::error::ConversionError;
19886 fn try_from(
19887 value: &::std::string::String,
19888 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19889 value.parse()
19890 }
19891 }
19892 impl ::std::convert::TryFrom<::std::string::String> for ListTokensForAccountNetwork {
19893 type Error = self::error::ConversionError;
19894 fn try_from(
19895 value: ::std::string::String,
19896 ) -> ::std::result::Result<Self, self::error::ConversionError> {
19897 value.parse()
19898 }
19899 }
19900 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
19956 pub struct MintAddressCriterion {
19957 pub addresses: ::std::vec::Vec<MintAddressCriterionAddressesItem>,
19959 pub operator: MintAddressCriterionOperator,
19961 #[serde(rename = "type")]
19963 pub type_: MintAddressCriterionType,
19964 }
19965 impl ::std::convert::From<&MintAddressCriterion> for MintAddressCriterion {
19966 fn from(value: &MintAddressCriterion) -> Self {
19967 value.clone()
19968 }
19969 }
19970 impl MintAddressCriterion {
19971 pub fn builder() -> builder::MintAddressCriterion {
19972 Default::default()
19973 }
19974 }
19975 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19988 #[serde(transparent)]
19989 pub struct MintAddressCriterionAddressesItem(::std::string::String);
19990 impl ::std::ops::Deref for MintAddressCriterionAddressesItem {
19991 type Target = ::std::string::String;
19992 fn deref(&self) -> &::std::string::String {
19993 &self.0
19994 }
19995 }
19996 impl ::std::convert::From<MintAddressCriterionAddressesItem> for ::std::string::String {
19997 fn from(value: MintAddressCriterionAddressesItem) -> Self {
19998 value.0
19999 }
20000 }
20001 impl ::std::convert::From<&MintAddressCriterionAddressesItem>
20002 for MintAddressCriterionAddressesItem
20003 {
20004 fn from(value: &MintAddressCriterionAddressesItem) -> Self {
20005 value.clone()
20006 }
20007 }
20008 impl ::std::str::FromStr for MintAddressCriterionAddressesItem {
20009 type Err = self::error::ConversionError;
20010 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20011 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
20012 ::std::sync::LazyLock::new(|| {
20013 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
20014 });
20015 if PATTERN.find(value).is_none() {
20016 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
20017 }
20018 Ok(Self(value.to_string()))
20019 }
20020 }
20021 impl ::std::convert::TryFrom<&str> for MintAddressCriterionAddressesItem {
20022 type Error = self::error::ConversionError;
20023 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20024 value.parse()
20025 }
20026 }
20027 impl ::std::convert::TryFrom<&::std::string::String> for MintAddressCriterionAddressesItem {
20028 type Error = self::error::ConversionError;
20029 fn try_from(
20030 value: &::std::string::String,
20031 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20032 value.parse()
20033 }
20034 }
20035 impl ::std::convert::TryFrom<::std::string::String> for MintAddressCriterionAddressesItem {
20036 type Error = self::error::ConversionError;
20037 fn try_from(
20038 value: ::std::string::String,
20039 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20040 value.parse()
20041 }
20042 }
20043 impl<'de> ::serde::Deserialize<'de> for MintAddressCriterionAddressesItem {
20044 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
20045 where
20046 D: ::serde::Deserializer<'de>,
20047 {
20048 ::std::string::String::deserialize(deserializer)?
20049 .parse()
20050 .map_err(|e: self::error::ConversionError| {
20051 <D::Error as ::serde::de::Error>::custom(e.to_string())
20052 })
20053 }
20054 }
20055 #[derive(
20074 ::serde::Deserialize,
20075 ::serde::Serialize,
20076 Clone,
20077 Copy,
20078 Debug,
20079 Eq,
20080 Hash,
20081 Ord,
20082 PartialEq,
20083 PartialOrd,
20084 )]
20085 pub enum MintAddressCriterionOperator {
20086 #[serde(rename = "in")]
20087 In,
20088 #[serde(rename = "not in")]
20089 NotIn,
20090 }
20091 impl ::std::convert::From<&Self> for MintAddressCriterionOperator {
20092 fn from(value: &MintAddressCriterionOperator) -> Self {
20093 value.clone()
20094 }
20095 }
20096 impl ::std::fmt::Display for MintAddressCriterionOperator {
20097 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
20098 match *self {
20099 Self::In => f.write_str("in"),
20100 Self::NotIn => f.write_str("not in"),
20101 }
20102 }
20103 }
20104 impl ::std::str::FromStr for MintAddressCriterionOperator {
20105 type Err = self::error::ConversionError;
20106 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20107 match value {
20108 "in" => Ok(Self::In),
20109 "not in" => Ok(Self::NotIn),
20110 _ => Err("invalid value".into()),
20111 }
20112 }
20113 }
20114 impl ::std::convert::TryFrom<&str> for MintAddressCriterionOperator {
20115 type Error = self::error::ConversionError;
20116 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20117 value.parse()
20118 }
20119 }
20120 impl ::std::convert::TryFrom<&::std::string::String> for MintAddressCriterionOperator {
20121 type Error = self::error::ConversionError;
20122 fn try_from(
20123 value: &::std::string::String,
20124 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20125 value.parse()
20126 }
20127 }
20128 impl ::std::convert::TryFrom<::std::string::String> for MintAddressCriterionOperator {
20129 type Error = self::error::ConversionError;
20130 fn try_from(
20131 value: ::std::string::String,
20132 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20133 value.parse()
20134 }
20135 }
20136 #[derive(
20154 ::serde::Deserialize,
20155 ::serde::Serialize,
20156 Clone,
20157 Copy,
20158 Debug,
20159 Eq,
20160 Hash,
20161 Ord,
20162 PartialEq,
20163 PartialOrd,
20164 )]
20165 pub enum MintAddressCriterionType {
20166 #[serde(rename = "mintAddress")]
20167 MintAddress,
20168 }
20169 impl ::std::convert::From<&Self> for MintAddressCriterionType {
20170 fn from(value: &MintAddressCriterionType) -> Self {
20171 value.clone()
20172 }
20173 }
20174 impl ::std::fmt::Display for MintAddressCriterionType {
20175 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
20176 match *self {
20177 Self::MintAddress => f.write_str("mintAddress"),
20178 }
20179 }
20180 }
20181 impl ::std::str::FromStr for MintAddressCriterionType {
20182 type Err = self::error::ConversionError;
20183 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20184 match value {
20185 "mintAddress" => Ok(Self::MintAddress),
20186 _ => Err("invalid value".into()),
20187 }
20188 }
20189 }
20190 impl ::std::convert::TryFrom<&str> for MintAddressCriterionType {
20191 type Error = self::error::ConversionError;
20192 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20193 value.parse()
20194 }
20195 }
20196 impl ::std::convert::TryFrom<&::std::string::String> for MintAddressCriterionType {
20197 type Error = self::error::ConversionError;
20198 fn try_from(
20199 value: &::std::string::String,
20200 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20201 value.parse()
20202 }
20203 }
20204 impl ::std::convert::TryFrom<::std::string::String> for MintAddressCriterionType {
20205 type Error = self::error::ConversionError;
20206 fn try_from(
20207 value: ::std::string::String,
20208 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20209 value.parse()
20210 }
20211 }
20212 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
20263 pub struct NetUsdChangeCriterion {
20264 #[serde(rename = "changeCents")]
20266 pub change_cents: i64,
20267 pub operator: NetUsdChangeCriterionOperator,
20269 #[serde(rename = "type")]
20271 pub type_: NetUsdChangeCriterionType,
20272 }
20273 impl ::std::convert::From<&NetUsdChangeCriterion> for NetUsdChangeCriterion {
20274 fn from(value: &NetUsdChangeCriterion) -> Self {
20275 value.clone()
20276 }
20277 }
20278 impl NetUsdChangeCriterion {
20279 pub fn builder() -> builder::NetUsdChangeCriterion {
20280 Default::default()
20281 }
20282 }
20283 #[derive(
20305 ::serde::Deserialize,
20306 ::serde::Serialize,
20307 Clone,
20308 Copy,
20309 Debug,
20310 Eq,
20311 Hash,
20312 Ord,
20313 PartialEq,
20314 PartialOrd,
20315 )]
20316 pub enum NetUsdChangeCriterionOperator {
20317 GreaterThan,
20318 GreaterThanOrEqual,
20319 LessThan,
20320 LessThanOrEqual,
20321 Equal,
20322 }
20323 impl ::std::convert::From<&Self> for NetUsdChangeCriterionOperator {
20324 fn from(value: &NetUsdChangeCriterionOperator) -> Self {
20325 value.clone()
20326 }
20327 }
20328 impl ::std::fmt::Display for NetUsdChangeCriterionOperator {
20329 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
20330 match *self {
20331 Self::GreaterThan => f.write_str("GreaterThan"),
20332 Self::GreaterThanOrEqual => f.write_str("GreaterThanOrEqual"),
20333 Self::LessThan => f.write_str("LessThan"),
20334 Self::LessThanOrEqual => f.write_str("LessThanOrEqual"),
20335 Self::Equal => f.write_str("Equal"),
20336 }
20337 }
20338 }
20339 impl ::std::str::FromStr for NetUsdChangeCriterionOperator {
20340 type Err = self::error::ConversionError;
20341 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20342 match value {
20343 "GreaterThan" => Ok(Self::GreaterThan),
20344 "GreaterThanOrEqual" => Ok(Self::GreaterThanOrEqual),
20345 "LessThan" => Ok(Self::LessThan),
20346 "LessThanOrEqual" => Ok(Self::LessThanOrEqual),
20347 "Equal" => Ok(Self::Equal),
20348 _ => Err("invalid value".into()),
20349 }
20350 }
20351 }
20352 impl ::std::convert::TryFrom<&str> for NetUsdChangeCriterionOperator {
20353 type Error = self::error::ConversionError;
20354 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20355 value.parse()
20356 }
20357 }
20358 impl ::std::convert::TryFrom<&::std::string::String> for NetUsdChangeCriterionOperator {
20359 type Error = self::error::ConversionError;
20360 fn try_from(
20361 value: &::std::string::String,
20362 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20363 value.parse()
20364 }
20365 }
20366 impl ::std::convert::TryFrom<::std::string::String> for NetUsdChangeCriterionOperator {
20367 type Error = self::error::ConversionError;
20368 fn try_from(
20369 value: ::std::string::String,
20370 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20371 value.parse()
20372 }
20373 }
20374 #[derive(
20392 ::serde::Deserialize,
20393 ::serde::Serialize,
20394 Clone,
20395 Copy,
20396 Debug,
20397 Eq,
20398 Hash,
20399 Ord,
20400 PartialEq,
20401 PartialOrd,
20402 )]
20403 pub enum NetUsdChangeCriterionType {
20404 #[serde(rename = "netUSDChange")]
20405 NetUsdChange,
20406 }
20407 impl ::std::convert::From<&Self> for NetUsdChangeCriterionType {
20408 fn from(value: &NetUsdChangeCriterionType) -> Self {
20409 value.clone()
20410 }
20411 }
20412 impl ::std::fmt::Display for NetUsdChangeCriterionType {
20413 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
20414 match *self {
20415 Self::NetUsdChange => f.write_str("netUSDChange"),
20416 }
20417 }
20418 }
20419 impl ::std::str::FromStr for NetUsdChangeCriterionType {
20420 type Err = self::error::ConversionError;
20421 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20422 match value {
20423 "netUSDChange" => Ok(Self::NetUsdChange),
20424 _ => Err("invalid value".into()),
20425 }
20426 }
20427 }
20428 impl ::std::convert::TryFrom<&str> for NetUsdChangeCriterionType {
20429 type Error = self::error::ConversionError;
20430 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20431 value.parse()
20432 }
20433 }
20434 impl ::std::convert::TryFrom<&::std::string::String> for NetUsdChangeCriterionType {
20435 type Error = self::error::ConversionError;
20436 fn try_from(
20437 value: &::std::string::String,
20438 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20439 value.parse()
20440 }
20441 }
20442 impl ::std::convert::TryFrom<::std::string::String> for NetUsdChangeCriterionType {
20443 type Error = self::error::ConversionError;
20444 fn try_from(
20445 value: ::std::string::String,
20446 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20447 value.parse()
20448 }
20449 }
20450 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
20500 pub struct OAuth2Authentication {
20501 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
20503 pub email: ::std::option::Option<::std::string::String>,
20504 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
20506 pub name: ::std::option::Option<::std::string::String>,
20507 pub sub: ::std::string::String,
20509 #[serde(rename = "type")]
20510 pub type_: OAuth2ProviderType,
20511 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
20513 pub username: ::std::option::Option<::std::string::String>,
20514 }
20515 impl ::std::convert::From<&OAuth2Authentication> for OAuth2Authentication {
20516 fn from(value: &OAuth2Authentication) -> Self {
20517 value.clone()
20518 }
20519 }
20520 impl OAuth2Authentication {
20521 pub fn builder() -> builder::OAuth2Authentication {
20522 Default::default()
20523 }
20524 }
20525 #[derive(
20545 ::serde::Deserialize,
20546 ::serde::Serialize,
20547 Clone,
20548 Copy,
20549 Debug,
20550 Eq,
20551 Hash,
20552 Ord,
20553 PartialEq,
20554 PartialOrd,
20555 )]
20556 pub enum OAuth2ProviderType {
20557 #[serde(rename = "google")]
20558 Google,
20559 #[serde(rename = "apple")]
20560 Apple,
20561 #[serde(rename = "x")]
20562 X,
20563 }
20564 impl ::std::convert::From<&Self> for OAuth2ProviderType {
20565 fn from(value: &OAuth2ProviderType) -> Self {
20566 value.clone()
20567 }
20568 }
20569 impl ::std::fmt::Display for OAuth2ProviderType {
20570 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
20571 match *self {
20572 Self::Google => f.write_str("google"),
20573 Self::Apple => f.write_str("apple"),
20574 Self::X => f.write_str("x"),
20575 }
20576 }
20577 }
20578 impl ::std::str::FromStr for OAuth2ProviderType {
20579 type Err = self::error::ConversionError;
20580 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20581 match value {
20582 "google" => Ok(Self::Google),
20583 "apple" => Ok(Self::Apple),
20584 "x" => Ok(Self::X),
20585 _ => Err("invalid value".into()),
20586 }
20587 }
20588 }
20589 impl ::std::convert::TryFrom<&str> for OAuth2ProviderType {
20590 type Error = self::error::ConversionError;
20591 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20592 value.parse()
20593 }
20594 }
20595 impl ::std::convert::TryFrom<&::std::string::String> for OAuth2ProviderType {
20596 type Error = self::error::ConversionError;
20597 fn try_from(
20598 value: &::std::string::String,
20599 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20600 value.parse()
20601 }
20602 }
20603 impl ::std::convert::TryFrom<::std::string::String> for OAuth2ProviderType {
20604 type Error = self::error::ConversionError;
20605 fn try_from(
20606 value: ::std::string::String,
20607 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20608 value.parse()
20609 }
20610 }
20611 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
20659 pub struct OnchainDataQuery {
20660 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
20661 pub cache: ::std::option::Option<QueryResultCacheConfiguration>,
20662 pub sql: OnchainDataQuerySql,
20664 }
20665 impl ::std::convert::From<&OnchainDataQuery> for OnchainDataQuery {
20666 fn from(value: &OnchainDataQuery) -> Self {
20667 value.clone()
20668 }
20669 }
20670 impl OnchainDataQuery {
20671 pub fn builder() -> builder::OnchainDataQuery {
20672 Default::default()
20673 }
20674 }
20675 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
20692 #[serde(transparent)]
20693 pub struct OnchainDataQuerySql(::std::string::String);
20694 impl ::std::ops::Deref for OnchainDataQuerySql {
20695 type Target = ::std::string::String;
20696 fn deref(&self) -> &::std::string::String {
20697 &self.0
20698 }
20699 }
20700 impl ::std::convert::From<OnchainDataQuerySql> for ::std::string::String {
20701 fn from(value: OnchainDataQuerySql) -> Self {
20702 value.0
20703 }
20704 }
20705 impl ::std::convert::From<&OnchainDataQuerySql> for OnchainDataQuerySql {
20706 fn from(value: &OnchainDataQuerySql) -> Self {
20707 value.clone()
20708 }
20709 }
20710 impl ::std::str::FromStr for OnchainDataQuerySql {
20711 type Err = self::error::ConversionError;
20712 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20713 if value.chars().count() > 100000usize {
20714 return Err("longer than 100000 characters".into());
20715 }
20716 if value.chars().count() < 1usize {
20717 return Err("shorter than 1 characters".into());
20718 }
20719 Ok(Self(value.to_string()))
20720 }
20721 }
20722 impl ::std::convert::TryFrom<&str> for OnchainDataQuerySql {
20723 type Error = self::error::ConversionError;
20724 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
20725 value.parse()
20726 }
20727 }
20728 impl ::std::convert::TryFrom<&::std::string::String> for OnchainDataQuerySql {
20729 type Error = self::error::ConversionError;
20730 fn try_from(
20731 value: &::std::string::String,
20732 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20733 value.parse()
20734 }
20735 }
20736 impl ::std::convert::TryFrom<::std::string::String> for OnchainDataQuerySql {
20737 type Error = self::error::ConversionError;
20738 fn try_from(
20739 value: ::std::string::String,
20740 ) -> ::std::result::Result<Self, self::error::ConversionError> {
20741 value.parse()
20742 }
20743 }
20744 impl<'de> ::serde::Deserialize<'de> for OnchainDataQuerySql {
20745 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
20746 where
20747 D: ::serde::Deserializer<'de>,
20748 {
20749 ::std::string::String::deserialize(deserializer)?
20750 .parse()
20751 .map_err(|e: self::error::ConversionError| {
20752 <D::Error as ::serde::de::Error>::custom(e.to_string())
20753 })
20754 }
20755 }
20756 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
20912 pub struct OnchainDataResult {
20913 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
20914 pub metadata: ::std::option::Option<OnchainDataResultMetadata>,
20915 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
20917 pub result: ::std::vec::Vec<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
20918 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
20919 pub schema: ::std::option::Option<OnchainDataResultSchema>,
20920 }
20921 impl ::std::convert::From<&OnchainDataResult> for OnchainDataResult {
20922 fn from(value: &OnchainDataResult) -> Self {
20923 value.clone()
20924 }
20925 }
20926 impl ::std::default::Default for OnchainDataResult {
20927 fn default() -> Self {
20928 Self {
20929 metadata: Default::default(),
20930 result: Default::default(),
20931 schema: Default::default(),
20932 }
20933 }
20934 }
20935 impl OnchainDataResult {
20936 pub fn builder() -> builder::OnchainDataResult {
20937 Default::default()
20938 }
20939 }
20940 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
20991 pub struct OnchainDataResultMetadata {
20992 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
20994 pub cached: ::std::option::Option<bool>,
20995 #[serde(
20997 rename = "executionTimeMs",
20998 default,
20999 skip_serializing_if = "::std::option::Option::is_none"
21000 )]
21001 pub execution_time_ms: ::std::option::Option<i64>,
21002 #[serde(
21004 rename = "executionTimestamp",
21005 default,
21006 skip_serializing_if = "::std::option::Option::is_none"
21007 )]
21008 pub execution_timestamp: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
21009 #[serde(
21011 rename = "rowCount",
21012 default,
21013 skip_serializing_if = "::std::option::Option::is_none"
21014 )]
21015 pub row_count: ::std::option::Option<i64>,
21016 }
21017 impl ::std::convert::From<&OnchainDataResultMetadata> for OnchainDataResultMetadata {
21018 fn from(value: &OnchainDataResultMetadata) -> Self {
21019 value.clone()
21020 }
21021 }
21022 impl ::std::default::Default for OnchainDataResultMetadata {
21023 fn default() -> Self {
21024 Self {
21025 cached: Default::default(),
21026 execution_time_ms: Default::default(),
21027 execution_timestamp: Default::default(),
21028 row_count: Default::default(),
21029 }
21030 }
21031 }
21032 impl OnchainDataResultMetadata {
21033 pub fn builder() -> builder::OnchainDataResultMetadata {
21034 Default::default()
21035 }
21036 }
21037 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
21112 pub struct OnchainDataResultSchema {
21113 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
21115 pub columns: ::std::vec::Vec<OnchainDataResultSchemaColumnsItem>,
21116 }
21117 impl ::std::convert::From<&OnchainDataResultSchema> for OnchainDataResultSchema {
21118 fn from(value: &OnchainDataResultSchema) -> Self {
21119 value.clone()
21120 }
21121 }
21122 impl ::std::default::Default for OnchainDataResultSchema {
21123 fn default() -> Self {
21124 Self {
21125 columns: Default::default(),
21126 }
21127 }
21128 }
21129 impl OnchainDataResultSchema {
21130 pub fn builder() -> builder::OnchainDataResultSchema {
21131 Default::default()
21132 }
21133 }
21134 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
21184 pub struct OnchainDataResultSchemaColumnsItem {
21185 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
21187 pub name: ::std::option::Option<::std::string::String>,
21188 #[serde(
21190 rename = "type",
21191 default,
21192 skip_serializing_if = "::std::option::Option::is_none"
21193 )]
21194 pub type_: ::std::option::Option<OnchainDataResultSchemaColumnsItemType>,
21195 }
21196 impl ::std::convert::From<&OnchainDataResultSchemaColumnsItem>
21197 for OnchainDataResultSchemaColumnsItem
21198 {
21199 fn from(value: &OnchainDataResultSchemaColumnsItem) -> Self {
21200 value.clone()
21201 }
21202 }
21203 impl ::std::default::Default for OnchainDataResultSchemaColumnsItem {
21204 fn default() -> Self {
21205 Self {
21206 name: Default::default(),
21207 type_: Default::default(),
21208 }
21209 }
21210 }
21211 impl OnchainDataResultSchemaColumnsItem {
21212 pub fn builder() -> builder::OnchainDataResultSchemaColumnsItem {
21213 Default::default()
21214 }
21215 }
21216 #[derive(
21250 ::serde::Deserialize,
21251 ::serde::Serialize,
21252 Clone,
21253 Copy,
21254 Debug,
21255 Eq,
21256 Hash,
21257 Ord,
21258 PartialEq,
21259 PartialOrd,
21260 )]
21261 pub enum OnchainDataResultSchemaColumnsItemType {
21262 String,
21263 UInt8,
21264 UInt16,
21265 UInt32,
21266 UInt64,
21267 UInt128,
21268 UInt256,
21269 Int8,
21270 Int16,
21271 Int32,
21272 Int64,
21273 Int128,
21274 Int256,
21275 Float32,
21276 Float64,
21277 Bool,
21278 Date,
21279 DateTime,
21280 DateTime64,
21281 #[serde(rename = "UUID")]
21282 Uuid,
21283 }
21284 impl ::std::convert::From<&Self> for OnchainDataResultSchemaColumnsItemType {
21285 fn from(value: &OnchainDataResultSchemaColumnsItemType) -> Self {
21286 value.clone()
21287 }
21288 }
21289 impl ::std::fmt::Display for OnchainDataResultSchemaColumnsItemType {
21290 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
21291 match *self {
21292 Self::String => f.write_str("String"),
21293 Self::UInt8 => f.write_str("UInt8"),
21294 Self::UInt16 => f.write_str("UInt16"),
21295 Self::UInt32 => f.write_str("UInt32"),
21296 Self::UInt64 => f.write_str("UInt64"),
21297 Self::UInt128 => f.write_str("UInt128"),
21298 Self::UInt256 => f.write_str("UInt256"),
21299 Self::Int8 => f.write_str("Int8"),
21300 Self::Int16 => f.write_str("Int16"),
21301 Self::Int32 => f.write_str("Int32"),
21302 Self::Int64 => f.write_str("Int64"),
21303 Self::Int128 => f.write_str("Int128"),
21304 Self::Int256 => f.write_str("Int256"),
21305 Self::Float32 => f.write_str("Float32"),
21306 Self::Float64 => f.write_str("Float64"),
21307 Self::Bool => f.write_str("Bool"),
21308 Self::Date => f.write_str("Date"),
21309 Self::DateTime => f.write_str("DateTime"),
21310 Self::DateTime64 => f.write_str("DateTime64"),
21311 Self::Uuid => f.write_str("UUID"),
21312 }
21313 }
21314 }
21315 impl ::std::str::FromStr for OnchainDataResultSchemaColumnsItemType {
21316 type Err = self::error::ConversionError;
21317 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21318 match value {
21319 "String" => Ok(Self::String),
21320 "UInt8" => Ok(Self::UInt8),
21321 "UInt16" => Ok(Self::UInt16),
21322 "UInt32" => Ok(Self::UInt32),
21323 "UInt64" => Ok(Self::UInt64),
21324 "UInt128" => Ok(Self::UInt128),
21325 "UInt256" => Ok(Self::UInt256),
21326 "Int8" => Ok(Self::Int8),
21327 "Int16" => Ok(Self::Int16),
21328 "Int32" => Ok(Self::Int32),
21329 "Int64" => Ok(Self::Int64),
21330 "Int128" => Ok(Self::Int128),
21331 "Int256" => Ok(Self::Int256),
21332 "Float32" => Ok(Self::Float32),
21333 "Float64" => Ok(Self::Float64),
21334 "Bool" => Ok(Self::Bool),
21335 "Date" => Ok(Self::Date),
21336 "DateTime" => Ok(Self::DateTime),
21337 "DateTime64" => Ok(Self::DateTime64),
21338 "UUID" => Ok(Self::Uuid),
21339 _ => Err("invalid value".into()),
21340 }
21341 }
21342 }
21343 impl ::std::convert::TryFrom<&str> for OnchainDataResultSchemaColumnsItemType {
21344 type Error = self::error::ConversionError;
21345 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21346 value.parse()
21347 }
21348 }
21349 impl ::std::convert::TryFrom<&::std::string::String> for OnchainDataResultSchemaColumnsItemType {
21350 type Error = self::error::ConversionError;
21351 fn try_from(
21352 value: &::std::string::String,
21353 ) -> ::std::result::Result<Self, self::error::ConversionError> {
21354 value.parse()
21355 }
21356 }
21357 impl ::std::convert::TryFrom<::std::string::String> for OnchainDataResultSchemaColumnsItemType {
21358 type Error = self::error::ConversionError;
21359 fn try_from(
21360 value: ::std::string::String,
21361 ) -> ::std::result::Result<Self, self::error::ConversionError> {
21362 value.parse()
21363 }
21364 }
21365 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
21513 pub struct OnrampOrder {
21514 #[serde(rename = "createdAt")]
21516 pub created_at: ::std::string::String,
21517 #[serde(rename = "destinationAddress")]
21519 pub destination_address: ::std::string::String,
21520 #[serde(rename = "destinationNetwork")]
21522 pub destination_network: ::std::string::String,
21523 #[serde(rename = "exchangeRate")]
21525 pub exchange_rate: ::std::string::String,
21526 pub fees: ::std::vec::Vec<OnrampOrderFee>,
21528 #[serde(rename = "orderId")]
21530 pub order_id: ::std::string::String,
21531 #[serde(
21533 rename = "partnerUserRef",
21534 default,
21535 skip_serializing_if = "::std::option::Option::is_none"
21536 )]
21537 pub partner_user_ref: ::std::option::Option<::std::string::String>,
21538 #[serde(rename = "paymentCurrency")]
21540 pub payment_currency: ::std::string::String,
21541 #[serde(rename = "paymentMethod")]
21542 pub payment_method: OnrampOrderPaymentMethodTypeId,
21543 #[serde(rename = "paymentSubtotal")]
21545 pub payment_subtotal: ::std::string::String,
21546 #[serde(rename = "paymentTotal")]
21548 pub payment_total: ::std::string::String,
21549 #[serde(rename = "purchaseAmount")]
21551 pub purchase_amount: ::std::string::String,
21552 #[serde(rename = "purchaseCurrency")]
21554 pub purchase_currency: ::std::string::String,
21555 pub status: OnrampOrderStatus,
21556 #[serde(
21558 rename = "txHash",
21559 default,
21560 skip_serializing_if = "::std::option::Option::is_none"
21561 )]
21562 pub tx_hash: ::std::option::Option<::std::string::String>,
21563 #[serde(rename = "updatedAt")]
21565 pub updated_at: ::std::string::String,
21566 }
21567 impl ::std::convert::From<&OnrampOrder> for OnrampOrder {
21568 fn from(value: &OnrampOrder) -> Self {
21569 value.clone()
21570 }
21571 }
21572 impl OnrampOrder {
21573 pub fn builder() -> builder::OnrampOrder {
21574 Default::default()
21575 }
21576 }
21577 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
21621 pub struct OnrampOrderFee {
21622 pub amount: ::std::string::String,
21624 pub currency: ::std::string::String,
21626 #[serde(rename = "type")]
21628 pub type_: OnrampOrderFeeType,
21629 }
21630 impl ::std::convert::From<&OnrampOrderFee> for OnrampOrderFee {
21631 fn from(value: &OnrampOrderFee) -> Self {
21632 value.clone()
21633 }
21634 }
21635 impl OnrampOrderFee {
21636 pub fn builder() -> builder::OnrampOrderFee {
21637 Default::default()
21638 }
21639 }
21640 #[derive(
21659 ::serde::Deserialize,
21660 ::serde::Serialize,
21661 Clone,
21662 Copy,
21663 Debug,
21664 Eq,
21665 Hash,
21666 Ord,
21667 PartialEq,
21668 PartialOrd,
21669 )]
21670 pub enum OnrampOrderFeeType {
21671 #[serde(rename = "FEE_TYPE_NETWORK")]
21672 FeeTypeNetwork,
21673 #[serde(rename = "FEE_TYPE_EXCHANGE")]
21674 FeeTypeExchange,
21675 }
21676 impl ::std::convert::From<&Self> for OnrampOrderFeeType {
21677 fn from(value: &OnrampOrderFeeType) -> Self {
21678 value.clone()
21679 }
21680 }
21681 impl ::std::fmt::Display for OnrampOrderFeeType {
21682 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
21683 match *self {
21684 Self::FeeTypeNetwork => f.write_str("FEE_TYPE_NETWORK"),
21685 Self::FeeTypeExchange => f.write_str("FEE_TYPE_EXCHANGE"),
21686 }
21687 }
21688 }
21689 impl ::std::str::FromStr for OnrampOrderFeeType {
21690 type Err = self::error::ConversionError;
21691 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21692 match value {
21693 "FEE_TYPE_NETWORK" => Ok(Self::FeeTypeNetwork),
21694 "FEE_TYPE_EXCHANGE" => Ok(Self::FeeTypeExchange),
21695 _ => Err("invalid value".into()),
21696 }
21697 }
21698 }
21699 impl ::std::convert::TryFrom<&str> for OnrampOrderFeeType {
21700 type Error = self::error::ConversionError;
21701 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21702 value.parse()
21703 }
21704 }
21705 impl ::std::convert::TryFrom<&::std::string::String> for OnrampOrderFeeType {
21706 type Error = self::error::ConversionError;
21707 fn try_from(
21708 value: &::std::string::String,
21709 ) -> ::std::result::Result<Self, self::error::ConversionError> {
21710 value.parse()
21711 }
21712 }
21713 impl ::std::convert::TryFrom<::std::string::String> for OnrampOrderFeeType {
21714 type Error = self::error::ConversionError;
21715 fn try_from(
21716 value: ::std::string::String,
21717 ) -> ::std::result::Result<Self, self::error::ConversionError> {
21718 value.parse()
21719 }
21720 }
21721 #[derive(
21739 ::serde::Deserialize,
21740 ::serde::Serialize,
21741 Clone,
21742 Copy,
21743 Debug,
21744 Eq,
21745 Hash,
21746 Ord,
21747 PartialEq,
21748 PartialOrd,
21749 )]
21750 pub enum OnrampOrderPaymentMethodTypeId {
21751 #[serde(rename = "GUEST_CHECKOUT_APPLE_PAY")]
21752 GuestCheckoutApplePay,
21753 }
21754 impl ::std::convert::From<&Self> for OnrampOrderPaymentMethodTypeId {
21755 fn from(value: &OnrampOrderPaymentMethodTypeId) -> Self {
21756 value.clone()
21757 }
21758 }
21759 impl ::std::fmt::Display for OnrampOrderPaymentMethodTypeId {
21760 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
21761 match *self {
21762 Self::GuestCheckoutApplePay => f.write_str("GUEST_CHECKOUT_APPLE_PAY"),
21763 }
21764 }
21765 }
21766 impl ::std::str::FromStr for OnrampOrderPaymentMethodTypeId {
21767 type Err = self::error::ConversionError;
21768 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21769 match value {
21770 "GUEST_CHECKOUT_APPLE_PAY" => Ok(Self::GuestCheckoutApplePay),
21771 _ => Err("invalid value".into()),
21772 }
21773 }
21774 }
21775 impl ::std::convert::TryFrom<&str> for OnrampOrderPaymentMethodTypeId {
21776 type Error = self::error::ConversionError;
21777 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21778 value.parse()
21779 }
21780 }
21781 impl ::std::convert::TryFrom<&::std::string::String> for OnrampOrderPaymentMethodTypeId {
21782 type Error = self::error::ConversionError;
21783 fn try_from(
21784 value: &::std::string::String,
21785 ) -> ::std::result::Result<Self, self::error::ConversionError> {
21786 value.parse()
21787 }
21788 }
21789 impl ::std::convert::TryFrom<::std::string::String> for OnrampOrderPaymentMethodTypeId {
21790 type Error = self::error::ConversionError;
21791 fn try_from(
21792 value: ::std::string::String,
21793 ) -> ::std::result::Result<Self, self::error::ConversionError> {
21794 value.parse()
21795 }
21796 }
21797 #[derive(
21819 ::serde::Deserialize,
21820 ::serde::Serialize,
21821 Clone,
21822 Copy,
21823 Debug,
21824 Eq,
21825 Hash,
21826 Ord,
21827 PartialEq,
21828 PartialOrd,
21829 )]
21830 pub enum OnrampOrderStatus {
21831 #[serde(rename = "ONRAMP_ORDER_STATUS_PENDING_AUTH")]
21832 OnrampOrderStatusPendingAuth,
21833 #[serde(rename = "ONRAMP_ORDER_STATUS_PENDING_PAYMENT")]
21834 OnrampOrderStatusPendingPayment,
21835 #[serde(rename = "ONRAMP_ORDER_STATUS_PROCESSING")]
21836 OnrampOrderStatusProcessing,
21837 #[serde(rename = "ONRAMP_ORDER_STATUS_COMPLETED")]
21838 OnrampOrderStatusCompleted,
21839 #[serde(rename = "ONRAMP_ORDER_STATUS_FAILED")]
21840 OnrampOrderStatusFailed,
21841 }
21842 impl ::std::convert::From<&Self> for OnrampOrderStatus {
21843 fn from(value: &OnrampOrderStatus) -> Self {
21844 value.clone()
21845 }
21846 }
21847 impl ::std::fmt::Display for OnrampOrderStatus {
21848 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
21849 match *self {
21850 Self::OnrampOrderStatusPendingAuth => {
21851 f.write_str("ONRAMP_ORDER_STATUS_PENDING_AUTH")
21852 }
21853 Self::OnrampOrderStatusPendingPayment => {
21854 f.write_str("ONRAMP_ORDER_STATUS_PENDING_PAYMENT")
21855 }
21856 Self::OnrampOrderStatusProcessing => f.write_str("ONRAMP_ORDER_STATUS_PROCESSING"),
21857 Self::OnrampOrderStatusCompleted => f.write_str("ONRAMP_ORDER_STATUS_COMPLETED"),
21858 Self::OnrampOrderStatusFailed => f.write_str("ONRAMP_ORDER_STATUS_FAILED"),
21859 }
21860 }
21861 }
21862 impl ::std::str::FromStr for OnrampOrderStatus {
21863 type Err = self::error::ConversionError;
21864 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21865 match value {
21866 "ONRAMP_ORDER_STATUS_PENDING_AUTH" => Ok(Self::OnrampOrderStatusPendingAuth),
21867 "ONRAMP_ORDER_STATUS_PENDING_PAYMENT" => Ok(Self::OnrampOrderStatusPendingPayment),
21868 "ONRAMP_ORDER_STATUS_PROCESSING" => Ok(Self::OnrampOrderStatusProcessing),
21869 "ONRAMP_ORDER_STATUS_COMPLETED" => Ok(Self::OnrampOrderStatusCompleted),
21870 "ONRAMP_ORDER_STATUS_FAILED" => Ok(Self::OnrampOrderStatusFailed),
21871 _ => Err("invalid value".into()),
21872 }
21873 }
21874 }
21875 impl ::std::convert::TryFrom<&str> for OnrampOrderStatus {
21876 type Error = self::error::ConversionError;
21877 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21878 value.parse()
21879 }
21880 }
21881 impl ::std::convert::TryFrom<&::std::string::String> for OnrampOrderStatus {
21882 type Error = self::error::ConversionError;
21883 fn try_from(
21884 value: &::std::string::String,
21885 ) -> ::std::result::Result<Self, self::error::ConversionError> {
21886 value.parse()
21887 }
21888 }
21889 impl ::std::convert::TryFrom<::std::string::String> for OnrampOrderStatus {
21890 type Error = self::error::ConversionError;
21891 fn try_from(
21892 value: ::std::string::String,
21893 ) -> ::std::result::Result<Self, self::error::ConversionError> {
21894 value.parse()
21895 }
21896 }
21897 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
21931 pub struct OnrampPaymentLink {
21932 #[serde(rename = "paymentLinkType")]
21933 pub payment_link_type: OnrampPaymentLinkType,
21934 pub url: Url,
21936 }
21937 impl ::std::convert::From<&OnrampPaymentLink> for OnrampPaymentLink {
21938 fn from(value: &OnrampPaymentLink) -> Self {
21939 value.clone()
21940 }
21941 }
21942 impl OnrampPaymentLink {
21943 pub fn builder() -> builder::OnrampPaymentLink {
21944 Default::default()
21945 }
21946 }
21947 #[derive(
21965 ::serde::Deserialize,
21966 ::serde::Serialize,
21967 Clone,
21968 Copy,
21969 Debug,
21970 Eq,
21971 Hash,
21972 Ord,
21973 PartialEq,
21974 PartialOrd,
21975 )]
21976 pub enum OnrampPaymentLinkType {
21977 #[serde(rename = "PAYMENT_LINK_TYPE_APPLE_PAY_BUTTON")]
21978 PaymentLinkTypeApplePayButton,
21979 }
21980 impl ::std::convert::From<&Self> for OnrampPaymentLinkType {
21981 fn from(value: &OnrampPaymentLinkType) -> Self {
21982 value.clone()
21983 }
21984 }
21985 impl ::std::fmt::Display for OnrampPaymentLinkType {
21986 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
21987 match *self {
21988 Self::PaymentLinkTypeApplePayButton => {
21989 f.write_str("PAYMENT_LINK_TYPE_APPLE_PAY_BUTTON")
21990 }
21991 }
21992 }
21993 }
21994 impl ::std::str::FromStr for OnrampPaymentLinkType {
21995 type Err = self::error::ConversionError;
21996 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
21997 match value {
21998 "PAYMENT_LINK_TYPE_APPLE_PAY_BUTTON" => Ok(Self::PaymentLinkTypeApplePayButton),
21999 _ => Err("invalid value".into()),
22000 }
22001 }
22002 }
22003 impl ::std::convert::TryFrom<&str> for OnrampPaymentLinkType {
22004 type Error = self::error::ConversionError;
22005 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22006 value.parse()
22007 }
22008 }
22009 impl ::std::convert::TryFrom<&::std::string::String> for OnrampPaymentLinkType {
22010 type Error = self::error::ConversionError;
22011 fn try_from(
22012 value: &::std::string::String,
22013 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22014 value.parse()
22015 }
22016 }
22017 impl ::std::convert::TryFrom<::std::string::String> for OnrampPaymentLinkType {
22018 type Error = self::error::ConversionError;
22019 fn try_from(
22020 value: ::std::string::String,
22021 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22022 value.parse()
22023 }
22024 }
22025 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
22142 pub struct OnrampQuote {
22143 #[serde(rename = "destinationNetwork")]
22145 pub destination_network: ::std::string::String,
22146 #[serde(rename = "exchangeRate")]
22148 pub exchange_rate: ::std::string::String,
22149 pub fees: ::std::vec::Vec<OnrampOrderFee>,
22151 #[serde(rename = "paymentCurrency")]
22153 pub payment_currency: ::std::string::String,
22154 #[serde(rename = "paymentSubtotal")]
22156 pub payment_subtotal: ::std::string::String,
22157 #[serde(rename = "paymentTotal")]
22159 pub payment_total: ::std::string::String,
22160 #[serde(rename = "purchaseAmount")]
22162 pub purchase_amount: ::std::string::String,
22163 #[serde(rename = "purchaseCurrency")]
22165 pub purchase_currency: ::std::string::String,
22166 }
22167 impl ::std::convert::From<&OnrampQuote> for OnrampQuote {
22168 fn from(value: &OnrampQuote) -> Self {
22169 value.clone()
22170 }
22171 }
22172 impl OnrampQuote {
22173 pub fn builder() -> builder::OnrampQuote {
22174 Default::default()
22175 }
22176 }
22177 #[derive(
22200 ::serde::Deserialize,
22201 ::serde::Serialize,
22202 Clone,
22203 Copy,
22204 Debug,
22205 Eq,
22206 Hash,
22207 Ord,
22208 PartialEq,
22209 PartialOrd,
22210 )]
22211 pub enum OnrampQuotePaymentMethodTypeId {
22212 #[serde(rename = "CARD")]
22213 Card,
22214 #[serde(rename = "ACH")]
22215 Ach,
22216 #[serde(rename = "APPLE_PAY")]
22217 ApplePay,
22218 #[serde(rename = "PAYPAL")]
22219 Paypal,
22220 #[serde(rename = "FIAT_WALLET")]
22221 FiatWallet,
22222 #[serde(rename = "CRYPTO_WALLET")]
22223 CryptoWallet,
22224 }
22225 impl ::std::convert::From<&Self> for OnrampQuotePaymentMethodTypeId {
22226 fn from(value: &OnrampQuotePaymentMethodTypeId) -> Self {
22227 value.clone()
22228 }
22229 }
22230 impl ::std::fmt::Display for OnrampQuotePaymentMethodTypeId {
22231 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
22232 match *self {
22233 Self::Card => f.write_str("CARD"),
22234 Self::Ach => f.write_str("ACH"),
22235 Self::ApplePay => f.write_str("APPLE_PAY"),
22236 Self::Paypal => f.write_str("PAYPAL"),
22237 Self::FiatWallet => f.write_str("FIAT_WALLET"),
22238 Self::CryptoWallet => f.write_str("CRYPTO_WALLET"),
22239 }
22240 }
22241 }
22242 impl ::std::str::FromStr for OnrampQuotePaymentMethodTypeId {
22243 type Err = self::error::ConversionError;
22244 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22245 match value {
22246 "CARD" => Ok(Self::Card),
22247 "ACH" => Ok(Self::Ach),
22248 "APPLE_PAY" => Ok(Self::ApplePay),
22249 "PAYPAL" => Ok(Self::Paypal),
22250 "FIAT_WALLET" => Ok(Self::FiatWallet),
22251 "CRYPTO_WALLET" => Ok(Self::CryptoWallet),
22252 _ => Err("invalid value".into()),
22253 }
22254 }
22255 }
22256 impl ::std::convert::TryFrom<&str> for OnrampQuotePaymentMethodTypeId {
22257 type Error = self::error::ConversionError;
22258 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22259 value.parse()
22260 }
22261 }
22262 impl ::std::convert::TryFrom<&::std::string::String> for OnrampQuotePaymentMethodTypeId {
22263 type Error = self::error::ConversionError;
22264 fn try_from(
22265 value: &::std::string::String,
22266 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22267 value.parse()
22268 }
22269 }
22270 impl ::std::convert::TryFrom<::std::string::String> for OnrampQuotePaymentMethodTypeId {
22271 type Error = self::error::ConversionError;
22272 fn try_from(
22273 value: ::std::string::String,
22274 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22275 value.parse()
22276 }
22277 }
22278 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
22311 pub struct OnrampSession {
22312 #[serde(rename = "onrampUrl")]
22314 pub onramp_url: Url,
22315 }
22316 impl ::std::convert::From<&OnrampSession> for OnrampSession {
22317 fn from(value: &OnrampSession) -> Self {
22318 value.clone()
22319 }
22320 }
22321 impl OnrampSession {
22322 pub fn builder() -> builder::OnrampSession {
22323 Default::default()
22324 }
22325 }
22326 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
22430 pub struct Policy {
22431 #[serde(rename = "createdAt")]
22433 pub created_at: ::std::string::String,
22434 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
22437 pub description: ::std::option::Option<PolicyDescription>,
22438 pub id: PolicyId,
22440 pub rules: ::std::vec::Vec<Rule>,
22442 pub scope: PolicyScope,
22444 #[serde(rename = "updatedAt")]
22446 pub updated_at: ::std::string::String,
22447 }
22448 impl ::std::convert::From<&Policy> for Policy {
22449 fn from(value: &Policy) -> Self {
22450 value.clone()
22451 }
22452 }
22453 impl Policy {
22454 pub fn builder() -> builder::Policy {
22455 Default::default()
22456 }
22457 }
22458 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22475 #[serde(transparent)]
22476 pub struct PolicyDescription(::std::string::String);
22477 impl ::std::ops::Deref for PolicyDescription {
22478 type Target = ::std::string::String;
22479 fn deref(&self) -> &::std::string::String {
22480 &self.0
22481 }
22482 }
22483 impl ::std::convert::From<PolicyDescription> for ::std::string::String {
22484 fn from(value: PolicyDescription) -> Self {
22485 value.0
22486 }
22487 }
22488 impl ::std::convert::From<&PolicyDescription> for PolicyDescription {
22489 fn from(value: &PolicyDescription) -> Self {
22490 value.clone()
22491 }
22492 }
22493 impl ::std::str::FromStr for PolicyDescription {
22494 type Err = self::error::ConversionError;
22495 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22496 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
22497 ::std::sync::LazyLock::new(|| {
22498 ::regress::Regex::new("^[A-Za-z0-9 ,.]{1,50}$").unwrap()
22499 });
22500 if PATTERN.find(value).is_none() {
22501 return Err("doesn't match pattern \"^[A-Za-z0-9 ,.]{1,50}$\"".into());
22502 }
22503 Ok(Self(value.to_string()))
22504 }
22505 }
22506 impl ::std::convert::TryFrom<&str> for PolicyDescription {
22507 type Error = self::error::ConversionError;
22508 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22509 value.parse()
22510 }
22511 }
22512 impl ::std::convert::TryFrom<&::std::string::String> for PolicyDescription {
22513 type Error = self::error::ConversionError;
22514 fn try_from(
22515 value: &::std::string::String,
22516 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22517 value.parse()
22518 }
22519 }
22520 impl ::std::convert::TryFrom<::std::string::String> for PolicyDescription {
22521 type Error = self::error::ConversionError;
22522 fn try_from(
22523 value: ::std::string::String,
22524 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22525 value.parse()
22526 }
22527 }
22528 impl<'de> ::serde::Deserialize<'de> for PolicyDescription {
22529 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
22530 where
22531 D: ::serde::Deserializer<'de>,
22532 {
22533 ::std::string::String::deserialize(deserializer)?
22534 .parse()
22535 .map_err(|e: self::error::ConversionError| {
22536 <D::Error as ::serde::de::Error>::custom(e.to_string())
22537 })
22538 }
22539 }
22540 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22556 #[serde(transparent)]
22557 pub struct PolicyId(::std::string::String);
22558 impl ::std::ops::Deref for PolicyId {
22559 type Target = ::std::string::String;
22560 fn deref(&self) -> &::std::string::String {
22561 &self.0
22562 }
22563 }
22564 impl ::std::convert::From<PolicyId> for ::std::string::String {
22565 fn from(value: PolicyId) -> Self {
22566 value.0
22567 }
22568 }
22569 impl ::std::convert::From<&PolicyId> for PolicyId {
22570 fn from(value: &PolicyId) -> Self {
22571 value.clone()
22572 }
22573 }
22574 impl ::std::str::FromStr for PolicyId {
22575 type Err = self::error::ConversionError;
22576 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22577 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
22578 || {
22579 ::regress::Regex::new(
22580 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
22581 )
22582 .unwrap()
22583 },
22584 );
22585 if PATTERN.find(value).is_none() {
22586 return Err(
22587 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
22588 .into(),
22589 );
22590 }
22591 Ok(Self(value.to_string()))
22592 }
22593 }
22594 impl ::std::convert::TryFrom<&str> for PolicyId {
22595 type Error = self::error::ConversionError;
22596 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22597 value.parse()
22598 }
22599 }
22600 impl ::std::convert::TryFrom<&::std::string::String> for PolicyId {
22601 type Error = self::error::ConversionError;
22602 fn try_from(
22603 value: &::std::string::String,
22604 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22605 value.parse()
22606 }
22607 }
22608 impl ::std::convert::TryFrom<::std::string::String> for PolicyId {
22609 type Error = self::error::ConversionError;
22610 fn try_from(
22611 value: ::std::string::String,
22612 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22613 value.parse()
22614 }
22615 }
22616 impl<'de> ::serde::Deserialize<'de> for PolicyId {
22617 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
22618 where
22619 D: ::serde::Deserializer<'de>,
22620 {
22621 ::std::string::String::deserialize(deserializer)?
22622 .parse()
22623 .map_err(|e: self::error::ConversionError| {
22624 <D::Error as ::serde::de::Error>::custom(e.to_string())
22625 })
22626 }
22627 }
22628 #[derive(
22647 ::serde::Deserialize,
22648 ::serde::Serialize,
22649 Clone,
22650 Copy,
22651 Debug,
22652 Eq,
22653 Hash,
22654 Ord,
22655 PartialEq,
22656 PartialOrd,
22657 )]
22658 pub enum PolicyScope {
22659 #[serde(rename = "project")]
22660 Project,
22661 #[serde(rename = "account")]
22662 Account,
22663 }
22664 impl ::std::convert::From<&Self> for PolicyScope {
22665 fn from(value: &PolicyScope) -> Self {
22666 value.clone()
22667 }
22668 }
22669 impl ::std::fmt::Display for PolicyScope {
22670 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
22671 match *self {
22672 Self::Project => f.write_str("project"),
22673 Self::Account => f.write_str("account"),
22674 }
22675 }
22676 }
22677 impl ::std::str::FromStr for PolicyScope {
22678 type Err = self::error::ConversionError;
22679 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22680 match value {
22681 "project" => Ok(Self::Project),
22682 "account" => Ok(Self::Account),
22683 _ => Err("invalid value".into()),
22684 }
22685 }
22686 }
22687 impl ::std::convert::TryFrom<&str> for PolicyScope {
22688 type Error = self::error::ConversionError;
22689 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22690 value.parse()
22691 }
22692 }
22693 impl ::std::convert::TryFrom<&::std::string::String> for PolicyScope {
22694 type Error = self::error::ConversionError;
22695 fn try_from(
22696 value: &::std::string::String,
22697 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22698 value.parse()
22699 }
22700 }
22701 impl ::std::convert::TryFrom<::std::string::String> for PolicyScope {
22702 type Error = self::error::ConversionError;
22703 fn try_from(
22704 value: ::std::string::String,
22705 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22706 value.parse()
22707 }
22708 }
22709 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22721 #[serde(transparent)]
22722 pub struct PrepareAndSendUserOperationAddress(::std::string::String);
22723 impl ::std::ops::Deref for PrepareAndSendUserOperationAddress {
22724 type Target = ::std::string::String;
22725 fn deref(&self) -> &::std::string::String {
22726 &self.0
22727 }
22728 }
22729 impl ::std::convert::From<PrepareAndSendUserOperationAddress> for ::std::string::String {
22730 fn from(value: PrepareAndSendUserOperationAddress) -> Self {
22731 value.0
22732 }
22733 }
22734 impl ::std::convert::From<&PrepareAndSendUserOperationAddress>
22735 for PrepareAndSendUserOperationAddress
22736 {
22737 fn from(value: &PrepareAndSendUserOperationAddress) -> Self {
22738 value.clone()
22739 }
22740 }
22741 impl ::std::str::FromStr for PrepareAndSendUserOperationAddress {
22742 type Err = self::error::ConversionError;
22743 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22744 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
22745 ::std::sync::LazyLock::new(|| {
22746 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
22747 });
22748 if PATTERN.find(value).is_none() {
22749 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
22750 }
22751 Ok(Self(value.to_string()))
22752 }
22753 }
22754 impl ::std::convert::TryFrom<&str> for PrepareAndSendUserOperationAddress {
22755 type Error = self::error::ConversionError;
22756 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22757 value.parse()
22758 }
22759 }
22760 impl ::std::convert::TryFrom<&::std::string::String> for PrepareAndSendUserOperationAddress {
22761 type Error = self::error::ConversionError;
22762 fn try_from(
22763 value: &::std::string::String,
22764 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22765 value.parse()
22766 }
22767 }
22768 impl ::std::convert::TryFrom<::std::string::String> for PrepareAndSendUserOperationAddress {
22769 type Error = self::error::ConversionError;
22770 fn try_from(
22771 value: ::std::string::String,
22772 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22773 value.parse()
22774 }
22775 }
22776 impl<'de> ::serde::Deserialize<'de> for PrepareAndSendUserOperationAddress {
22777 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
22778 where
22779 D: ::serde::Deserializer<'de>,
22780 {
22781 ::std::string::String::deserialize(deserializer)?
22782 .parse()
22783 .map_err(|e: self::error::ConversionError| {
22784 <D::Error as ::serde::de::Error>::custom(e.to_string())
22785 })
22786 }
22787 }
22788 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
22826 pub struct PrepareAndSendUserOperationBody {
22827 pub calls: ::std::vec::Vec<EvmCall>,
22829 pub network: EvmUserOperationNetwork,
22830 #[serde(
22832 rename = "paymasterUrl",
22833 default,
22834 skip_serializing_if = "::std::option::Option::is_none"
22835 )]
22836 pub paymaster_url: ::std::option::Option<Url>,
22837 }
22838 impl ::std::convert::From<&PrepareAndSendUserOperationBody> for PrepareAndSendUserOperationBody {
22839 fn from(value: &PrepareAndSendUserOperationBody) -> Self {
22840 value.clone()
22841 }
22842 }
22843 impl PrepareAndSendUserOperationBody {
22844 pub fn builder() -> builder::PrepareAndSendUserOperationBody {
22845 Default::default()
22846 }
22847 }
22848 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22862 #[serde(transparent)]
22863 pub struct PrepareAndSendUserOperationXIdempotencyKey(::std::string::String);
22864 impl ::std::ops::Deref for PrepareAndSendUserOperationXIdempotencyKey {
22865 type Target = ::std::string::String;
22866 fn deref(&self) -> &::std::string::String {
22867 &self.0
22868 }
22869 }
22870 impl ::std::convert::From<PrepareAndSendUserOperationXIdempotencyKey> for ::std::string::String {
22871 fn from(value: PrepareAndSendUserOperationXIdempotencyKey) -> Self {
22872 value.0
22873 }
22874 }
22875 impl ::std::convert::From<&PrepareAndSendUserOperationXIdempotencyKey>
22876 for PrepareAndSendUserOperationXIdempotencyKey
22877 {
22878 fn from(value: &PrepareAndSendUserOperationXIdempotencyKey) -> Self {
22879 value.clone()
22880 }
22881 }
22882 impl ::std::str::FromStr for PrepareAndSendUserOperationXIdempotencyKey {
22883 type Err = self::error::ConversionError;
22884 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22885 if value.chars().count() > 36usize {
22886 return Err("longer than 36 characters".into());
22887 }
22888 if value.chars().count() < 36usize {
22889 return Err("shorter than 36 characters".into());
22890 }
22891 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
22892 ::std::sync::LazyLock::new(|| {
22893 ::regress::Regex::new(
22894 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
22895 )
22896 .unwrap()
22897 });
22898 if PATTERN.find(value).is_none() {
22899 return Err(
22900 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
22901 .into(),
22902 );
22903 }
22904 Ok(Self(value.to_string()))
22905 }
22906 }
22907 impl ::std::convert::TryFrom<&str> for PrepareAndSendUserOperationXIdempotencyKey {
22908 type Error = self::error::ConversionError;
22909 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22910 value.parse()
22911 }
22912 }
22913 impl ::std::convert::TryFrom<&::std::string::String>
22914 for PrepareAndSendUserOperationXIdempotencyKey
22915 {
22916 type Error = self::error::ConversionError;
22917 fn try_from(
22918 value: &::std::string::String,
22919 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22920 value.parse()
22921 }
22922 }
22923 impl ::std::convert::TryFrom<::std::string::String> for PrepareAndSendUserOperationXIdempotencyKey {
22924 type Error = self::error::ConversionError;
22925 fn try_from(
22926 value: ::std::string::String,
22927 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22928 value.parse()
22929 }
22930 }
22931 impl<'de> ::serde::Deserialize<'de> for PrepareAndSendUserOperationXIdempotencyKey {
22932 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
22933 where
22934 D: ::serde::Deserializer<'de>,
22935 {
22936 ::std::string::String::deserialize(deserializer)?
22937 .parse()
22938 .map_err(|e: self::error::ConversionError| {
22939 <D::Error as ::serde::de::Error>::custom(e.to_string())
22940 })
22941 }
22942 }
22943 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22955 #[serde(transparent)]
22956 pub struct PrepareUserOperationAddress(::std::string::String);
22957 impl ::std::ops::Deref for PrepareUserOperationAddress {
22958 type Target = ::std::string::String;
22959 fn deref(&self) -> &::std::string::String {
22960 &self.0
22961 }
22962 }
22963 impl ::std::convert::From<PrepareUserOperationAddress> for ::std::string::String {
22964 fn from(value: PrepareUserOperationAddress) -> Self {
22965 value.0
22966 }
22967 }
22968 impl ::std::convert::From<&PrepareUserOperationAddress> for PrepareUserOperationAddress {
22969 fn from(value: &PrepareUserOperationAddress) -> Self {
22970 value.clone()
22971 }
22972 }
22973 impl ::std::str::FromStr for PrepareUserOperationAddress {
22974 type Err = self::error::ConversionError;
22975 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22976 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
22977 ::std::sync::LazyLock::new(|| {
22978 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
22979 });
22980 if PATTERN.find(value).is_none() {
22981 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
22982 }
22983 Ok(Self(value.to_string()))
22984 }
22985 }
22986 impl ::std::convert::TryFrom<&str> for PrepareUserOperationAddress {
22987 type Error = self::error::ConversionError;
22988 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
22989 value.parse()
22990 }
22991 }
22992 impl ::std::convert::TryFrom<&::std::string::String> for PrepareUserOperationAddress {
22993 type Error = self::error::ConversionError;
22994 fn try_from(
22995 value: &::std::string::String,
22996 ) -> ::std::result::Result<Self, self::error::ConversionError> {
22997 value.parse()
22998 }
22999 }
23000 impl ::std::convert::TryFrom<::std::string::String> for PrepareUserOperationAddress {
23001 type Error = self::error::ConversionError;
23002 fn try_from(
23003 value: ::std::string::String,
23004 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23005 value.parse()
23006 }
23007 }
23008 impl<'de> ::serde::Deserialize<'de> for PrepareUserOperationAddress {
23009 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
23010 where
23011 D: ::serde::Deserializer<'de>,
23012 {
23013 ::std::string::String::deserialize(deserializer)?
23014 .parse()
23015 .map_err(|e: self::error::ConversionError| {
23016 <D::Error as ::serde::de::Error>::custom(e.to_string())
23017 })
23018 }
23019 }
23020 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
23066 pub struct PrepareUserOperationBody {
23067 pub calls: ::std::vec::Vec<EvmCall>,
23069 #[serde(
23071 rename = "dataSuffix",
23072 default,
23073 skip_serializing_if = "::std::option::Option::is_none"
23074 )]
23075 pub data_suffix: ::std::option::Option<PrepareUserOperationBodyDataSuffix>,
23076 pub network: EvmUserOperationNetwork,
23077 #[serde(
23079 rename = "paymasterUrl",
23080 default,
23081 skip_serializing_if = "::std::option::Option::is_none"
23082 )]
23083 pub paymaster_url: ::std::option::Option<Url>,
23084 }
23085 impl ::std::convert::From<&PrepareUserOperationBody> for PrepareUserOperationBody {
23086 fn from(value: &PrepareUserOperationBody) -> Self {
23087 value.clone()
23088 }
23089 }
23090 impl PrepareUserOperationBody {
23091 pub fn builder() -> builder::PrepareUserOperationBody {
23092 Default::default()
23093 }
23094 }
23095 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
23111 #[serde(transparent)]
23112 pub struct PrepareUserOperationBodyDataSuffix(::std::string::String);
23113 impl ::std::ops::Deref for PrepareUserOperationBodyDataSuffix {
23114 type Target = ::std::string::String;
23115 fn deref(&self) -> &::std::string::String {
23116 &self.0
23117 }
23118 }
23119 impl ::std::convert::From<PrepareUserOperationBodyDataSuffix> for ::std::string::String {
23120 fn from(value: PrepareUserOperationBodyDataSuffix) -> Self {
23121 value.0
23122 }
23123 }
23124 impl ::std::convert::From<&PrepareUserOperationBodyDataSuffix>
23125 for PrepareUserOperationBodyDataSuffix
23126 {
23127 fn from(value: &PrepareUserOperationBodyDataSuffix) -> Self {
23128 value.clone()
23129 }
23130 }
23131 impl ::std::str::FromStr for PrepareUserOperationBodyDataSuffix {
23132 type Err = self::error::ConversionError;
23133 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23134 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
23135 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^0x[0-9a-fA-F]+$").unwrap());
23136 if PATTERN.find(value).is_none() {
23137 return Err("doesn't match pattern \"^0x[0-9a-fA-F]+$\"".into());
23138 }
23139 Ok(Self(value.to_string()))
23140 }
23141 }
23142 impl ::std::convert::TryFrom<&str> for PrepareUserOperationBodyDataSuffix {
23143 type Error = self::error::ConversionError;
23144 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23145 value.parse()
23146 }
23147 }
23148 impl ::std::convert::TryFrom<&::std::string::String> for PrepareUserOperationBodyDataSuffix {
23149 type Error = self::error::ConversionError;
23150 fn try_from(
23151 value: &::std::string::String,
23152 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23153 value.parse()
23154 }
23155 }
23156 impl ::std::convert::TryFrom<::std::string::String> for PrepareUserOperationBodyDataSuffix {
23157 type Error = self::error::ConversionError;
23158 fn try_from(
23159 value: ::std::string::String,
23160 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23161 value.parse()
23162 }
23163 }
23164 impl<'de> ::serde::Deserialize<'de> for PrepareUserOperationBodyDataSuffix {
23165 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
23166 where
23167 D: ::serde::Deserializer<'de>,
23168 {
23169 ::std::string::String::deserialize(deserializer)?
23170 .parse()
23171 .map_err(|e: self::error::ConversionError| {
23172 <D::Error as ::serde::de::Error>::custom(e.to_string())
23173 })
23174 }
23175 }
23176 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
23224 #[serde(transparent)]
23225 pub struct PrepareUserOperationCriteria(pub ::std::vec::Vec<PrepareUserOperationCriteriaItem>);
23226 impl ::std::ops::Deref for PrepareUserOperationCriteria {
23227 type Target = ::std::vec::Vec<PrepareUserOperationCriteriaItem>;
23228 fn deref(&self) -> &::std::vec::Vec<PrepareUserOperationCriteriaItem> {
23229 &self.0
23230 }
23231 }
23232 impl ::std::convert::From<PrepareUserOperationCriteria>
23233 for ::std::vec::Vec<PrepareUserOperationCriteriaItem>
23234 {
23235 fn from(value: PrepareUserOperationCriteria) -> Self {
23236 value.0
23237 }
23238 }
23239 impl ::std::convert::From<&PrepareUserOperationCriteria> for PrepareUserOperationCriteria {
23240 fn from(value: &PrepareUserOperationCriteria) -> Self {
23241 value.clone()
23242 }
23243 }
23244 impl ::std::convert::From<::std::vec::Vec<PrepareUserOperationCriteriaItem>>
23245 for PrepareUserOperationCriteria
23246 {
23247 fn from(value: ::std::vec::Vec<PrepareUserOperationCriteriaItem>) -> Self {
23248 Self(value)
23249 }
23250 }
23251 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
23278 #[serde(untagged)]
23279 pub enum PrepareUserOperationCriteriaItem {
23280 EthValueCriterion(EthValueCriterion),
23281 EvmAddressCriterion(EvmAddressCriterion),
23282 EvmNetworkCriterion(EvmNetworkCriterion),
23283 EvmDataCriterion(EvmDataCriterion),
23284 NetUsdChangeCriterion(NetUsdChangeCriterion),
23285 }
23286 impl ::std::convert::From<&Self> for PrepareUserOperationCriteriaItem {
23287 fn from(value: &PrepareUserOperationCriteriaItem) -> Self {
23288 value.clone()
23289 }
23290 }
23291 impl ::std::convert::From<EthValueCriterion> for PrepareUserOperationCriteriaItem {
23292 fn from(value: EthValueCriterion) -> Self {
23293 Self::EthValueCriterion(value)
23294 }
23295 }
23296 impl ::std::convert::From<EvmAddressCriterion> for PrepareUserOperationCriteriaItem {
23297 fn from(value: EvmAddressCriterion) -> Self {
23298 Self::EvmAddressCriterion(value)
23299 }
23300 }
23301 impl ::std::convert::From<EvmNetworkCriterion> for PrepareUserOperationCriteriaItem {
23302 fn from(value: EvmNetworkCriterion) -> Self {
23303 Self::EvmNetworkCriterion(value)
23304 }
23305 }
23306 impl ::std::convert::From<EvmDataCriterion> for PrepareUserOperationCriteriaItem {
23307 fn from(value: EvmDataCriterion) -> Self {
23308 Self::EvmDataCriterion(value)
23309 }
23310 }
23311 impl ::std::convert::From<NetUsdChangeCriterion> for PrepareUserOperationCriteriaItem {
23312 fn from(value: NetUsdChangeCriterion) -> Self {
23313 Self::NetUsdChangeCriterion(value)
23314 }
23315 }
23316 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
23359 pub struct PrepareUserOperationRule {
23360 pub action: PrepareUserOperationRuleAction,
23362 pub criteria: PrepareUserOperationCriteria,
23363 pub operation: PrepareUserOperationRuleOperation,
23365 }
23366 impl ::std::convert::From<&PrepareUserOperationRule> for PrepareUserOperationRule {
23367 fn from(value: &PrepareUserOperationRule) -> Self {
23368 value.clone()
23369 }
23370 }
23371 impl PrepareUserOperationRule {
23372 pub fn builder() -> builder::PrepareUserOperationRule {
23373 Default::default()
23374 }
23375 }
23376 #[derive(
23395 ::serde::Deserialize,
23396 ::serde::Serialize,
23397 Clone,
23398 Copy,
23399 Debug,
23400 Eq,
23401 Hash,
23402 Ord,
23403 PartialEq,
23404 PartialOrd,
23405 )]
23406 pub enum PrepareUserOperationRuleAction {
23407 #[serde(rename = "reject")]
23408 Reject,
23409 #[serde(rename = "accept")]
23410 Accept,
23411 }
23412 impl ::std::convert::From<&Self> for PrepareUserOperationRuleAction {
23413 fn from(value: &PrepareUserOperationRuleAction) -> Self {
23414 value.clone()
23415 }
23416 }
23417 impl ::std::fmt::Display for PrepareUserOperationRuleAction {
23418 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23419 match *self {
23420 Self::Reject => f.write_str("reject"),
23421 Self::Accept => f.write_str("accept"),
23422 }
23423 }
23424 }
23425 impl ::std::str::FromStr for PrepareUserOperationRuleAction {
23426 type Err = self::error::ConversionError;
23427 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23428 match value {
23429 "reject" => Ok(Self::Reject),
23430 "accept" => Ok(Self::Accept),
23431 _ => Err("invalid value".into()),
23432 }
23433 }
23434 }
23435 impl ::std::convert::TryFrom<&str> for PrepareUserOperationRuleAction {
23436 type Error = self::error::ConversionError;
23437 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23438 value.parse()
23439 }
23440 }
23441 impl ::std::convert::TryFrom<&::std::string::String> for PrepareUserOperationRuleAction {
23442 type Error = self::error::ConversionError;
23443 fn try_from(
23444 value: &::std::string::String,
23445 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23446 value.parse()
23447 }
23448 }
23449 impl ::std::convert::TryFrom<::std::string::String> for PrepareUserOperationRuleAction {
23450 type Error = self::error::ConversionError;
23451 fn try_from(
23452 value: ::std::string::String,
23453 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23454 value.parse()
23455 }
23456 }
23457 #[derive(
23475 ::serde::Deserialize,
23476 ::serde::Serialize,
23477 Clone,
23478 Copy,
23479 Debug,
23480 Eq,
23481 Hash,
23482 Ord,
23483 PartialEq,
23484 PartialOrd,
23485 )]
23486 pub enum PrepareUserOperationRuleOperation {
23487 #[serde(rename = "prepareUserOperation")]
23488 PrepareUserOperation,
23489 }
23490 impl ::std::convert::From<&Self> for PrepareUserOperationRuleOperation {
23491 fn from(value: &PrepareUserOperationRuleOperation) -> Self {
23492 value.clone()
23493 }
23494 }
23495 impl ::std::fmt::Display for PrepareUserOperationRuleOperation {
23496 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23497 match *self {
23498 Self::PrepareUserOperation => f.write_str("prepareUserOperation"),
23499 }
23500 }
23501 }
23502 impl ::std::str::FromStr for PrepareUserOperationRuleOperation {
23503 type Err = self::error::ConversionError;
23504 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23505 match value {
23506 "prepareUserOperation" => Ok(Self::PrepareUserOperation),
23507 _ => Err("invalid value".into()),
23508 }
23509 }
23510 }
23511 impl ::std::convert::TryFrom<&str> for PrepareUserOperationRuleOperation {
23512 type Error = self::error::ConversionError;
23513 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23514 value.parse()
23515 }
23516 }
23517 impl ::std::convert::TryFrom<&::std::string::String> for PrepareUserOperationRuleOperation {
23518 type Error = self::error::ConversionError;
23519 fn try_from(
23520 value: &::std::string::String,
23521 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23522 value.parse()
23523 }
23524 }
23525 impl ::std::convert::TryFrom<::std::string::String> for PrepareUserOperationRuleOperation {
23526 type Error = self::error::ConversionError;
23527 fn try_from(
23528 value: ::std::string::String,
23529 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23530 value.parse()
23531 }
23532 }
23533 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
23590 pub struct ProgramIdCriterion {
23591 pub operator: ProgramIdCriterionOperator,
23593 #[serde(rename = "programIds")]
23595 pub program_ids: ::std::vec::Vec<ProgramIdCriterionProgramIdsItem>,
23596 #[serde(rename = "type")]
23598 pub type_: ProgramIdCriterionType,
23599 }
23600 impl ::std::convert::From<&ProgramIdCriterion> for ProgramIdCriterion {
23601 fn from(value: &ProgramIdCriterion) -> Self {
23602 value.clone()
23603 }
23604 }
23605 impl ProgramIdCriterion {
23606 pub fn builder() -> builder::ProgramIdCriterion {
23607 Default::default()
23608 }
23609 }
23610 #[derive(
23629 ::serde::Deserialize,
23630 ::serde::Serialize,
23631 Clone,
23632 Copy,
23633 Debug,
23634 Eq,
23635 Hash,
23636 Ord,
23637 PartialEq,
23638 PartialOrd,
23639 )]
23640 pub enum ProgramIdCriterionOperator {
23641 #[serde(rename = "in")]
23642 In,
23643 #[serde(rename = "not in")]
23644 NotIn,
23645 }
23646 impl ::std::convert::From<&Self> for ProgramIdCriterionOperator {
23647 fn from(value: &ProgramIdCriterionOperator) -> Self {
23648 value.clone()
23649 }
23650 }
23651 impl ::std::fmt::Display for ProgramIdCriterionOperator {
23652 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23653 match *self {
23654 Self::In => f.write_str("in"),
23655 Self::NotIn => f.write_str("not in"),
23656 }
23657 }
23658 }
23659 impl ::std::str::FromStr for ProgramIdCriterionOperator {
23660 type Err = self::error::ConversionError;
23661 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23662 match value {
23663 "in" => Ok(Self::In),
23664 "not in" => Ok(Self::NotIn),
23665 _ => Err("invalid value".into()),
23666 }
23667 }
23668 }
23669 impl ::std::convert::TryFrom<&str> for ProgramIdCriterionOperator {
23670 type Error = self::error::ConversionError;
23671 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23672 value.parse()
23673 }
23674 }
23675 impl ::std::convert::TryFrom<&::std::string::String> for ProgramIdCriterionOperator {
23676 type Error = self::error::ConversionError;
23677 fn try_from(
23678 value: &::std::string::String,
23679 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23680 value.parse()
23681 }
23682 }
23683 impl ::std::convert::TryFrom<::std::string::String> for ProgramIdCriterionOperator {
23684 type Error = self::error::ConversionError;
23685 fn try_from(
23686 value: ::std::string::String,
23687 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23688 value.parse()
23689 }
23690 }
23691 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
23704 #[serde(transparent)]
23705 pub struct ProgramIdCriterionProgramIdsItem(::std::string::String);
23706 impl ::std::ops::Deref for ProgramIdCriterionProgramIdsItem {
23707 type Target = ::std::string::String;
23708 fn deref(&self) -> &::std::string::String {
23709 &self.0
23710 }
23711 }
23712 impl ::std::convert::From<ProgramIdCriterionProgramIdsItem> for ::std::string::String {
23713 fn from(value: ProgramIdCriterionProgramIdsItem) -> Self {
23714 value.0
23715 }
23716 }
23717 impl ::std::convert::From<&ProgramIdCriterionProgramIdsItem> for ProgramIdCriterionProgramIdsItem {
23718 fn from(value: &ProgramIdCriterionProgramIdsItem) -> Self {
23719 value.clone()
23720 }
23721 }
23722 impl ::std::str::FromStr for ProgramIdCriterionProgramIdsItem {
23723 type Err = self::error::ConversionError;
23724 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23725 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
23726 ::std::sync::LazyLock::new(|| {
23727 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
23728 });
23729 if PATTERN.find(value).is_none() {
23730 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
23731 }
23732 Ok(Self(value.to_string()))
23733 }
23734 }
23735 impl ::std::convert::TryFrom<&str> for ProgramIdCriterionProgramIdsItem {
23736 type Error = self::error::ConversionError;
23737 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23738 value.parse()
23739 }
23740 }
23741 impl ::std::convert::TryFrom<&::std::string::String> for ProgramIdCriterionProgramIdsItem {
23742 type Error = self::error::ConversionError;
23743 fn try_from(
23744 value: &::std::string::String,
23745 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23746 value.parse()
23747 }
23748 }
23749 impl ::std::convert::TryFrom<::std::string::String> for ProgramIdCriterionProgramIdsItem {
23750 type Error = self::error::ConversionError;
23751 fn try_from(
23752 value: ::std::string::String,
23753 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23754 value.parse()
23755 }
23756 }
23757 impl<'de> ::serde::Deserialize<'de> for ProgramIdCriterionProgramIdsItem {
23758 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
23759 where
23760 D: ::serde::Deserializer<'de>,
23761 {
23762 ::std::string::String::deserialize(deserializer)?
23763 .parse()
23764 .map_err(|e: self::error::ConversionError| {
23765 <D::Error as ::serde::de::Error>::custom(e.to_string())
23766 })
23767 }
23768 }
23769 #[derive(
23787 ::serde::Deserialize,
23788 ::serde::Serialize,
23789 Clone,
23790 Copy,
23791 Debug,
23792 Eq,
23793 Hash,
23794 Ord,
23795 PartialEq,
23796 PartialOrd,
23797 )]
23798 pub enum ProgramIdCriterionType {
23799 #[serde(rename = "programId")]
23800 ProgramId,
23801 }
23802 impl ::std::convert::From<&Self> for ProgramIdCriterionType {
23803 fn from(value: &ProgramIdCriterionType) -> Self {
23804 value.clone()
23805 }
23806 }
23807 impl ::std::fmt::Display for ProgramIdCriterionType {
23808 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23809 match *self {
23810 Self::ProgramId => f.write_str("programId"),
23811 }
23812 }
23813 }
23814 impl ::std::str::FromStr for ProgramIdCriterionType {
23815 type Err = self::error::ConversionError;
23816 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23817 match value {
23818 "programId" => Ok(Self::ProgramId),
23819 _ => Err("invalid value".into()),
23820 }
23821 }
23822 }
23823 impl ::std::convert::TryFrom<&str> for ProgramIdCriterionType {
23824 type Error = self::error::ConversionError;
23825 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
23826 value.parse()
23827 }
23828 }
23829 impl ::std::convert::TryFrom<&::std::string::String> for ProgramIdCriterionType {
23830 type Error = self::error::ConversionError;
23831 fn try_from(
23832 value: &::std::string::String,
23833 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23834 value.parse()
23835 }
23836 }
23837 impl ::std::convert::TryFrom<::std::string::String> for ProgramIdCriterionType {
23838 type Error = self::error::ConversionError;
23839 fn try_from(
23840 value: ::std::string::String,
23841 ) -> ::std::result::Result<Self, self::error::ConversionError> {
23842 value.parse()
23843 }
23844 }
23845 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
23878 pub struct QueryResultCacheConfiguration {
23879 #[serde(rename = "maxAgeMs", default = "defaults::default_u64::<i64, 500>")]
23881 pub max_age_ms: i64,
23882 }
23883 impl ::std::convert::From<&QueryResultCacheConfiguration> for QueryResultCacheConfiguration {
23884 fn from(value: &QueryResultCacheConfiguration) -> Self {
23885 value.clone()
23886 }
23887 }
23888 impl ::std::default::Default for QueryResultCacheConfiguration {
23889 fn default() -> Self {
23890 Self {
23891 max_age_ms: defaults::default_u64::<i64, 500>(),
23892 }
23893 }
23894 }
23895 impl QueryResultCacheConfiguration {
23896 pub fn builder() -> builder::QueryResultCacheConfiguration {
23897 Default::default()
23898 }
23899 }
23900 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
23951 pub struct RequestEvmFaucetBody {
23952 pub address: RequestEvmFaucetBodyAddress,
23954 pub network: RequestEvmFaucetBodyNetwork,
23956 pub token: RequestEvmFaucetBodyToken,
23958 }
23959 impl ::std::convert::From<&RequestEvmFaucetBody> for RequestEvmFaucetBody {
23960 fn from(value: &RequestEvmFaucetBody) -> Self {
23961 value.clone()
23962 }
23963 }
23964 impl RequestEvmFaucetBody {
23965 pub fn builder() -> builder::RequestEvmFaucetBody {
23966 Default::default()
23967 }
23968 }
23969 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
23985 #[serde(transparent)]
23986 pub struct RequestEvmFaucetBodyAddress(::std::string::String);
23987 impl ::std::ops::Deref for RequestEvmFaucetBodyAddress {
23988 type Target = ::std::string::String;
23989 fn deref(&self) -> &::std::string::String {
23990 &self.0
23991 }
23992 }
23993 impl ::std::convert::From<RequestEvmFaucetBodyAddress> for ::std::string::String {
23994 fn from(value: RequestEvmFaucetBodyAddress) -> Self {
23995 value.0
23996 }
23997 }
23998 impl ::std::convert::From<&RequestEvmFaucetBodyAddress> for RequestEvmFaucetBodyAddress {
23999 fn from(value: &RequestEvmFaucetBodyAddress) -> Self {
24000 value.clone()
24001 }
24002 }
24003 impl ::std::str::FromStr for RequestEvmFaucetBodyAddress {
24004 type Err = self::error::ConversionError;
24005 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24006 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
24007 ::std::sync::LazyLock::new(|| {
24008 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
24009 });
24010 if PATTERN.find(value).is_none() {
24011 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
24012 }
24013 Ok(Self(value.to_string()))
24014 }
24015 }
24016 impl ::std::convert::TryFrom<&str> for RequestEvmFaucetBodyAddress {
24017 type Error = self::error::ConversionError;
24018 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24019 value.parse()
24020 }
24021 }
24022 impl ::std::convert::TryFrom<&::std::string::String> for RequestEvmFaucetBodyAddress {
24023 type Error = self::error::ConversionError;
24024 fn try_from(
24025 value: &::std::string::String,
24026 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24027 value.parse()
24028 }
24029 }
24030 impl ::std::convert::TryFrom<::std::string::String> for RequestEvmFaucetBodyAddress {
24031 type Error = self::error::ConversionError;
24032 fn try_from(
24033 value: ::std::string::String,
24034 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24035 value.parse()
24036 }
24037 }
24038 impl<'de> ::serde::Deserialize<'de> for RequestEvmFaucetBodyAddress {
24039 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
24040 where
24041 D: ::serde::Deserializer<'de>,
24042 {
24043 ::std::string::String::deserialize(deserializer)?
24044 .parse()
24045 .map_err(|e: self::error::ConversionError| {
24046 <D::Error as ::serde::de::Error>::custom(e.to_string())
24047 })
24048 }
24049 }
24050 #[derive(
24070 ::serde::Deserialize,
24071 ::serde::Serialize,
24072 Clone,
24073 Copy,
24074 Debug,
24075 Eq,
24076 Hash,
24077 Ord,
24078 PartialEq,
24079 PartialOrd,
24080 )]
24081 pub enum RequestEvmFaucetBodyNetwork {
24082 #[serde(rename = "base-sepolia")]
24083 BaseSepolia,
24084 #[serde(rename = "ethereum-sepolia")]
24085 EthereumSepolia,
24086 #[serde(rename = "ethereum-hoodi")]
24087 EthereumHoodi,
24088 }
24089 impl ::std::convert::From<&Self> for RequestEvmFaucetBodyNetwork {
24090 fn from(value: &RequestEvmFaucetBodyNetwork) -> Self {
24091 value.clone()
24092 }
24093 }
24094 impl ::std::fmt::Display for RequestEvmFaucetBodyNetwork {
24095 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
24096 match *self {
24097 Self::BaseSepolia => f.write_str("base-sepolia"),
24098 Self::EthereumSepolia => f.write_str("ethereum-sepolia"),
24099 Self::EthereumHoodi => f.write_str("ethereum-hoodi"),
24100 }
24101 }
24102 }
24103 impl ::std::str::FromStr for RequestEvmFaucetBodyNetwork {
24104 type Err = self::error::ConversionError;
24105 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24106 match value {
24107 "base-sepolia" => Ok(Self::BaseSepolia),
24108 "ethereum-sepolia" => Ok(Self::EthereumSepolia),
24109 "ethereum-hoodi" => Ok(Self::EthereumHoodi),
24110 _ => Err("invalid value".into()),
24111 }
24112 }
24113 }
24114 impl ::std::convert::TryFrom<&str> for RequestEvmFaucetBodyNetwork {
24115 type Error = self::error::ConversionError;
24116 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24117 value.parse()
24118 }
24119 }
24120 impl ::std::convert::TryFrom<&::std::string::String> for RequestEvmFaucetBodyNetwork {
24121 type Error = self::error::ConversionError;
24122 fn try_from(
24123 value: &::std::string::String,
24124 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24125 value.parse()
24126 }
24127 }
24128 impl ::std::convert::TryFrom<::std::string::String> for RequestEvmFaucetBodyNetwork {
24129 type Error = self::error::ConversionError;
24130 fn try_from(
24131 value: ::std::string::String,
24132 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24133 value.parse()
24134 }
24135 }
24136 #[derive(
24157 ::serde::Deserialize,
24158 ::serde::Serialize,
24159 Clone,
24160 Copy,
24161 Debug,
24162 Eq,
24163 Hash,
24164 Ord,
24165 PartialEq,
24166 PartialOrd,
24167 )]
24168 pub enum RequestEvmFaucetBodyToken {
24169 #[serde(rename = "eth")]
24170 Eth,
24171 #[serde(rename = "usdc")]
24172 Usdc,
24173 #[serde(rename = "eurc")]
24174 Eurc,
24175 #[serde(rename = "cbbtc")]
24176 Cbbtc,
24177 }
24178 impl ::std::convert::From<&Self> for RequestEvmFaucetBodyToken {
24179 fn from(value: &RequestEvmFaucetBodyToken) -> Self {
24180 value.clone()
24181 }
24182 }
24183 impl ::std::fmt::Display for RequestEvmFaucetBodyToken {
24184 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
24185 match *self {
24186 Self::Eth => f.write_str("eth"),
24187 Self::Usdc => f.write_str("usdc"),
24188 Self::Eurc => f.write_str("eurc"),
24189 Self::Cbbtc => f.write_str("cbbtc"),
24190 }
24191 }
24192 }
24193 impl ::std::str::FromStr for RequestEvmFaucetBodyToken {
24194 type Err = self::error::ConversionError;
24195 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24196 match value {
24197 "eth" => Ok(Self::Eth),
24198 "usdc" => Ok(Self::Usdc),
24199 "eurc" => Ok(Self::Eurc),
24200 "cbbtc" => Ok(Self::Cbbtc),
24201 _ => Err("invalid value".into()),
24202 }
24203 }
24204 }
24205 impl ::std::convert::TryFrom<&str> for RequestEvmFaucetBodyToken {
24206 type Error = self::error::ConversionError;
24207 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24208 value.parse()
24209 }
24210 }
24211 impl ::std::convert::TryFrom<&::std::string::String> for RequestEvmFaucetBodyToken {
24212 type Error = self::error::ConversionError;
24213 fn try_from(
24214 value: &::std::string::String,
24215 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24216 value.parse()
24217 }
24218 }
24219 impl ::std::convert::TryFrom<::std::string::String> for RequestEvmFaucetBodyToken {
24220 type Error = self::error::ConversionError;
24221 fn try_from(
24222 value: ::std::string::String,
24223 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24224 value.parse()
24225 }
24226 }
24227 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
24250 pub struct RequestEvmFaucetResponse {
24251 #[serde(rename = "transactionHash")]
24254 pub transaction_hash: ::std::string::String,
24255 }
24256 impl ::std::convert::From<&RequestEvmFaucetResponse> for RequestEvmFaucetResponse {
24257 fn from(value: &RequestEvmFaucetResponse) -> Self {
24258 value.clone()
24259 }
24260 }
24261 impl RequestEvmFaucetResponse {
24262 pub fn builder() -> builder::RequestEvmFaucetResponse {
24263 Default::default()
24264 }
24265 }
24266 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
24302 pub struct RequestSolanaFaucetBody {
24303 pub address: RequestSolanaFaucetBodyAddress,
24305 pub token: RequestSolanaFaucetBodyToken,
24307 }
24308 impl ::std::convert::From<&RequestSolanaFaucetBody> for RequestSolanaFaucetBody {
24309 fn from(value: &RequestSolanaFaucetBody) -> Self {
24310 value.clone()
24311 }
24312 }
24313 impl RequestSolanaFaucetBody {
24314 pub fn builder() -> builder::RequestSolanaFaucetBody {
24315 Default::default()
24316 }
24317 }
24318 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24334 #[serde(transparent)]
24335 pub struct RequestSolanaFaucetBodyAddress(::std::string::String);
24336 impl ::std::ops::Deref for RequestSolanaFaucetBodyAddress {
24337 type Target = ::std::string::String;
24338 fn deref(&self) -> &::std::string::String {
24339 &self.0
24340 }
24341 }
24342 impl ::std::convert::From<RequestSolanaFaucetBodyAddress> for ::std::string::String {
24343 fn from(value: RequestSolanaFaucetBodyAddress) -> Self {
24344 value.0
24345 }
24346 }
24347 impl ::std::convert::From<&RequestSolanaFaucetBodyAddress> for RequestSolanaFaucetBodyAddress {
24348 fn from(value: &RequestSolanaFaucetBodyAddress) -> Self {
24349 value.clone()
24350 }
24351 }
24352 impl ::std::str::FromStr for RequestSolanaFaucetBodyAddress {
24353 type Err = self::error::ConversionError;
24354 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24355 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
24356 ::std::sync::LazyLock::new(|| {
24357 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
24358 });
24359 if PATTERN.find(value).is_none() {
24360 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
24361 }
24362 Ok(Self(value.to_string()))
24363 }
24364 }
24365 impl ::std::convert::TryFrom<&str> for RequestSolanaFaucetBodyAddress {
24366 type Error = self::error::ConversionError;
24367 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24368 value.parse()
24369 }
24370 }
24371 impl ::std::convert::TryFrom<&::std::string::String> for RequestSolanaFaucetBodyAddress {
24372 type Error = self::error::ConversionError;
24373 fn try_from(
24374 value: &::std::string::String,
24375 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24376 value.parse()
24377 }
24378 }
24379 impl ::std::convert::TryFrom<::std::string::String> for RequestSolanaFaucetBodyAddress {
24380 type Error = self::error::ConversionError;
24381 fn try_from(
24382 value: ::std::string::String,
24383 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24384 value.parse()
24385 }
24386 }
24387 impl<'de> ::serde::Deserialize<'de> for RequestSolanaFaucetBodyAddress {
24388 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
24389 where
24390 D: ::serde::Deserializer<'de>,
24391 {
24392 ::std::string::String::deserialize(deserializer)?
24393 .parse()
24394 .map_err(|e: self::error::ConversionError| {
24395 <D::Error as ::serde::de::Error>::custom(e.to_string())
24396 })
24397 }
24398 }
24399 #[derive(
24418 ::serde::Deserialize,
24419 ::serde::Serialize,
24420 Clone,
24421 Copy,
24422 Debug,
24423 Eq,
24424 Hash,
24425 Ord,
24426 PartialEq,
24427 PartialOrd,
24428 )]
24429 pub enum RequestSolanaFaucetBodyToken {
24430 #[serde(rename = "sol")]
24431 Sol,
24432 #[serde(rename = "usdc")]
24433 Usdc,
24434 }
24435 impl ::std::convert::From<&Self> for RequestSolanaFaucetBodyToken {
24436 fn from(value: &RequestSolanaFaucetBodyToken) -> Self {
24437 value.clone()
24438 }
24439 }
24440 impl ::std::fmt::Display for RequestSolanaFaucetBodyToken {
24441 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
24442 match *self {
24443 Self::Sol => f.write_str("sol"),
24444 Self::Usdc => f.write_str("usdc"),
24445 }
24446 }
24447 }
24448 impl ::std::str::FromStr for RequestSolanaFaucetBodyToken {
24449 type Err = self::error::ConversionError;
24450 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24451 match value {
24452 "sol" => Ok(Self::Sol),
24453 "usdc" => Ok(Self::Usdc),
24454 _ => Err("invalid value".into()),
24455 }
24456 }
24457 }
24458 impl ::std::convert::TryFrom<&str> for RequestSolanaFaucetBodyToken {
24459 type Error = self::error::ConversionError;
24460 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24461 value.parse()
24462 }
24463 }
24464 impl ::std::convert::TryFrom<&::std::string::String> for RequestSolanaFaucetBodyToken {
24465 type Error = self::error::ConversionError;
24466 fn try_from(
24467 value: &::std::string::String,
24468 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24469 value.parse()
24470 }
24471 }
24472 impl ::std::convert::TryFrom<::std::string::String> for RequestSolanaFaucetBodyToken {
24473 type Error = self::error::ConversionError;
24474 fn try_from(
24475 value: ::std::string::String,
24476 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24477 value.parse()
24478 }
24479 }
24480 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
24503 pub struct RequestSolanaFaucetResponse {
24504 #[serde(rename = "transactionSignature")]
24506 pub transaction_signature: ::std::string::String,
24507 }
24508 impl ::std::convert::From<&RequestSolanaFaucetResponse> for RequestSolanaFaucetResponse {
24509 fn from(value: &RequestSolanaFaucetResponse) -> Self {
24510 value.clone()
24511 }
24512 }
24513 impl RequestSolanaFaucetResponse {
24514 pub fn builder() -> builder::RequestSolanaFaucetResponse {
24515 Default::default()
24516 }
24517 }
24518 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24530 #[serde(transparent)]
24531 pub struct RevokeSpendPermissionAddress(::std::string::String);
24532 impl ::std::ops::Deref for RevokeSpendPermissionAddress {
24533 type Target = ::std::string::String;
24534 fn deref(&self) -> &::std::string::String {
24535 &self.0
24536 }
24537 }
24538 impl ::std::convert::From<RevokeSpendPermissionAddress> for ::std::string::String {
24539 fn from(value: RevokeSpendPermissionAddress) -> Self {
24540 value.0
24541 }
24542 }
24543 impl ::std::convert::From<&RevokeSpendPermissionAddress> for RevokeSpendPermissionAddress {
24544 fn from(value: &RevokeSpendPermissionAddress) -> Self {
24545 value.clone()
24546 }
24547 }
24548 impl ::std::str::FromStr for RevokeSpendPermissionAddress {
24549 type Err = self::error::ConversionError;
24550 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24551 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
24552 ::std::sync::LazyLock::new(|| {
24553 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
24554 });
24555 if PATTERN.find(value).is_none() {
24556 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
24557 }
24558 Ok(Self(value.to_string()))
24559 }
24560 }
24561 impl ::std::convert::TryFrom<&str> for RevokeSpendPermissionAddress {
24562 type Error = self::error::ConversionError;
24563 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24564 value.parse()
24565 }
24566 }
24567 impl ::std::convert::TryFrom<&::std::string::String> for RevokeSpendPermissionAddress {
24568 type Error = self::error::ConversionError;
24569 fn try_from(
24570 value: &::std::string::String,
24571 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24572 value.parse()
24573 }
24574 }
24575 impl ::std::convert::TryFrom<::std::string::String> for RevokeSpendPermissionAddress {
24576 type Error = self::error::ConversionError;
24577 fn try_from(
24578 value: ::std::string::String,
24579 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24580 value.parse()
24581 }
24582 }
24583 impl<'de> ::serde::Deserialize<'de> for RevokeSpendPermissionAddress {
24584 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
24585 where
24586 D: ::serde::Deserializer<'de>,
24587 {
24588 ::std::string::String::deserialize(deserializer)?
24589 .parse()
24590 .map_err(|e: self::error::ConversionError| {
24591 <D::Error as ::serde::de::Error>::custom(e.to_string())
24592 })
24593 }
24594 }
24595 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
24634 pub struct RevokeSpendPermissionRequest {
24635 pub network: SpendPermissionNetwork,
24636 #[serde(
24638 rename = "paymasterUrl",
24639 default,
24640 skip_serializing_if = "::std::option::Option::is_none"
24641 )]
24642 pub paymaster_url: ::std::option::Option<Url>,
24643 #[serde(rename = "permissionHash")]
24645 pub permission_hash: ::std::string::String,
24646 }
24647 impl ::std::convert::From<&RevokeSpendPermissionRequest> for RevokeSpendPermissionRequest {
24648 fn from(value: &RevokeSpendPermissionRequest) -> Self {
24649 value.clone()
24650 }
24651 }
24652 impl RevokeSpendPermissionRequest {
24653 pub fn builder() -> builder::RevokeSpendPermissionRequest {
24654 Default::default()
24655 }
24656 }
24657 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24671 #[serde(transparent)]
24672 pub struct RevokeSpendPermissionXIdempotencyKey(::std::string::String);
24673 impl ::std::ops::Deref for RevokeSpendPermissionXIdempotencyKey {
24674 type Target = ::std::string::String;
24675 fn deref(&self) -> &::std::string::String {
24676 &self.0
24677 }
24678 }
24679 impl ::std::convert::From<RevokeSpendPermissionXIdempotencyKey> for ::std::string::String {
24680 fn from(value: RevokeSpendPermissionXIdempotencyKey) -> Self {
24681 value.0
24682 }
24683 }
24684 impl ::std::convert::From<&RevokeSpendPermissionXIdempotencyKey>
24685 for RevokeSpendPermissionXIdempotencyKey
24686 {
24687 fn from(value: &RevokeSpendPermissionXIdempotencyKey) -> Self {
24688 value.clone()
24689 }
24690 }
24691 impl ::std::str::FromStr for RevokeSpendPermissionXIdempotencyKey {
24692 type Err = self::error::ConversionError;
24693 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24694 if value.chars().count() > 36usize {
24695 return Err("longer than 36 characters".into());
24696 }
24697 if value.chars().count() < 36usize {
24698 return Err("shorter than 36 characters".into());
24699 }
24700 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
24701 ::std::sync::LazyLock::new(|| {
24702 ::regress::Regex::new(
24703 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
24704 )
24705 .unwrap()
24706 });
24707 if PATTERN.find(value).is_none() {
24708 return Err(
24709 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
24710 .into(),
24711 );
24712 }
24713 Ok(Self(value.to_string()))
24714 }
24715 }
24716 impl ::std::convert::TryFrom<&str> for RevokeSpendPermissionXIdempotencyKey {
24717 type Error = self::error::ConversionError;
24718 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24719 value.parse()
24720 }
24721 }
24722 impl ::std::convert::TryFrom<&::std::string::String> for RevokeSpendPermissionXIdempotencyKey {
24723 type Error = self::error::ConversionError;
24724 fn try_from(
24725 value: &::std::string::String,
24726 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24727 value.parse()
24728 }
24729 }
24730 impl ::std::convert::TryFrom<::std::string::String> for RevokeSpendPermissionXIdempotencyKey {
24731 type Error = self::error::ConversionError;
24732 fn try_from(
24733 value: ::std::string::String,
24734 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24735 value.parse()
24736 }
24737 }
24738 impl<'de> ::serde::Deserialize<'de> for RevokeSpendPermissionXIdempotencyKey {
24739 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
24740 where
24741 D: ::serde::Deserializer<'de>,
24742 {
24743 ::std::string::String::deserialize(deserializer)?
24744 .parse()
24745 .map_err(|e: self::error::ConversionError| {
24746 <D::Error as ::serde::de::Error>::custom(e.to_string())
24747 })
24748 }
24749 }
24750 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
24814 #[serde(untagged)]
24815 pub enum Rule {
24816 SignEvmTransactionRule(SignEvmTransactionRule),
24817 SendEvmTransactionRule(SendEvmTransactionRule),
24818 SignEvmMessageRule(SignEvmMessageRule),
24819 SignEvmTypedDataRule(SignEvmTypedDataRule),
24820 SignSolTransactionRule(SignSolTransactionRule),
24821 SendSolTransactionRule(SendSolTransactionRule),
24822 SignSolMessageRule(SignSolMessageRule),
24823 SignEvmHashRule(SignEvmHashRule),
24824 PrepareUserOperationRule(PrepareUserOperationRule),
24825 SendUserOperationRule(SendUserOperationRule),
24826 }
24827 impl ::std::convert::From<&Self> for Rule {
24828 fn from(value: &Rule) -> Self {
24829 value.clone()
24830 }
24831 }
24832 impl ::std::convert::From<SignEvmTransactionRule> for Rule {
24833 fn from(value: SignEvmTransactionRule) -> Self {
24834 Self::SignEvmTransactionRule(value)
24835 }
24836 }
24837 impl ::std::convert::From<SendEvmTransactionRule> for Rule {
24838 fn from(value: SendEvmTransactionRule) -> Self {
24839 Self::SendEvmTransactionRule(value)
24840 }
24841 }
24842 impl ::std::convert::From<SignEvmMessageRule> for Rule {
24843 fn from(value: SignEvmMessageRule) -> Self {
24844 Self::SignEvmMessageRule(value)
24845 }
24846 }
24847 impl ::std::convert::From<SignEvmTypedDataRule> for Rule {
24848 fn from(value: SignEvmTypedDataRule) -> Self {
24849 Self::SignEvmTypedDataRule(value)
24850 }
24851 }
24852 impl ::std::convert::From<SignSolTransactionRule> for Rule {
24853 fn from(value: SignSolTransactionRule) -> Self {
24854 Self::SignSolTransactionRule(value)
24855 }
24856 }
24857 impl ::std::convert::From<SendSolTransactionRule> for Rule {
24858 fn from(value: SendSolTransactionRule) -> Self {
24859 Self::SendSolTransactionRule(value)
24860 }
24861 }
24862 impl ::std::convert::From<SignSolMessageRule> for Rule {
24863 fn from(value: SignSolMessageRule) -> Self {
24864 Self::SignSolMessageRule(value)
24865 }
24866 }
24867 impl ::std::convert::From<SignEvmHashRule> for Rule {
24868 fn from(value: SignEvmHashRule) -> Self {
24869 Self::SignEvmHashRule(value)
24870 }
24871 }
24872 impl ::std::convert::From<PrepareUserOperationRule> for Rule {
24873 fn from(value: PrepareUserOperationRule) -> Self {
24874 Self::PrepareUserOperationRule(value)
24875 }
24876 }
24877 impl ::std::convert::From<SendUserOperationRule> for Rule {
24878 fn from(value: SendUserOperationRule) -> Self {
24879 Self::SendUserOperationRule(value)
24880 }
24881 }
24882 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24894 #[serde(transparent)]
24895 pub struct SendEvmTransactionAddress(::std::string::String);
24896 impl ::std::ops::Deref for SendEvmTransactionAddress {
24897 type Target = ::std::string::String;
24898 fn deref(&self) -> &::std::string::String {
24899 &self.0
24900 }
24901 }
24902 impl ::std::convert::From<SendEvmTransactionAddress> for ::std::string::String {
24903 fn from(value: SendEvmTransactionAddress) -> Self {
24904 value.0
24905 }
24906 }
24907 impl ::std::convert::From<&SendEvmTransactionAddress> for SendEvmTransactionAddress {
24908 fn from(value: &SendEvmTransactionAddress) -> Self {
24909 value.clone()
24910 }
24911 }
24912 impl ::std::str::FromStr for SendEvmTransactionAddress {
24913 type Err = self::error::ConversionError;
24914 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24915 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
24916 ::std::sync::LazyLock::new(|| {
24917 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
24918 });
24919 if PATTERN.find(value).is_none() {
24920 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
24921 }
24922 Ok(Self(value.to_string()))
24923 }
24924 }
24925 impl ::std::convert::TryFrom<&str> for SendEvmTransactionAddress {
24926 type Error = self::error::ConversionError;
24927 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
24928 value.parse()
24929 }
24930 }
24931 impl ::std::convert::TryFrom<&::std::string::String> for SendEvmTransactionAddress {
24932 type Error = self::error::ConversionError;
24933 fn try_from(
24934 value: &::std::string::String,
24935 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24936 value.parse()
24937 }
24938 }
24939 impl ::std::convert::TryFrom<::std::string::String> for SendEvmTransactionAddress {
24940 type Error = self::error::ConversionError;
24941 fn try_from(
24942 value: ::std::string::String,
24943 ) -> ::std::result::Result<Self, self::error::ConversionError> {
24944 value.parse()
24945 }
24946 }
24947 impl<'de> ::serde::Deserialize<'de> for SendEvmTransactionAddress {
24948 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
24949 where
24950 D: ::serde::Deserializer<'de>,
24951 {
24952 ::std::string::String::deserialize(deserializer)?
24953 .parse()
24954 .map_err(|e: self::error::ConversionError| {
24955 <D::Error as ::serde::de::Error>::custom(e.to_string())
24956 })
24957 }
24958 }
24959 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
25000 pub struct SendEvmTransactionBody {
25001 pub network: SendEvmTransactionBodyNetwork,
25003 pub transaction: ::std::string::String,
25005 }
25006 impl ::std::convert::From<&SendEvmTransactionBody> for SendEvmTransactionBody {
25007 fn from(value: &SendEvmTransactionBody) -> Self {
25008 value.clone()
25009 }
25010 }
25011 impl SendEvmTransactionBody {
25012 pub fn builder() -> builder::SendEvmTransactionBody {
25013 Default::default()
25014 }
25015 }
25016 #[derive(
25041 ::serde::Deserialize,
25042 ::serde::Serialize,
25043 Clone,
25044 Copy,
25045 Debug,
25046 Eq,
25047 Hash,
25048 Ord,
25049 PartialEq,
25050 PartialOrd,
25051 )]
25052 pub enum SendEvmTransactionBodyNetwork {
25053 #[serde(rename = "base")]
25054 Base,
25055 #[serde(rename = "base-sepolia")]
25056 BaseSepolia,
25057 #[serde(rename = "ethereum")]
25058 Ethereum,
25059 #[serde(rename = "ethereum-sepolia")]
25060 EthereumSepolia,
25061 #[serde(rename = "avalanche")]
25062 Avalanche,
25063 #[serde(rename = "polygon")]
25064 Polygon,
25065 #[serde(rename = "optimism")]
25066 Optimism,
25067 #[serde(rename = "arbitrum")]
25068 Arbitrum,
25069 }
25070 impl ::std::convert::From<&Self> for SendEvmTransactionBodyNetwork {
25071 fn from(value: &SendEvmTransactionBodyNetwork) -> Self {
25072 value.clone()
25073 }
25074 }
25075 impl ::std::fmt::Display for SendEvmTransactionBodyNetwork {
25076 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
25077 match *self {
25078 Self::Base => f.write_str("base"),
25079 Self::BaseSepolia => f.write_str("base-sepolia"),
25080 Self::Ethereum => f.write_str("ethereum"),
25081 Self::EthereumSepolia => f.write_str("ethereum-sepolia"),
25082 Self::Avalanche => f.write_str("avalanche"),
25083 Self::Polygon => f.write_str("polygon"),
25084 Self::Optimism => f.write_str("optimism"),
25085 Self::Arbitrum => f.write_str("arbitrum"),
25086 }
25087 }
25088 }
25089 impl ::std::str::FromStr for SendEvmTransactionBodyNetwork {
25090 type Err = self::error::ConversionError;
25091 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25092 match value {
25093 "base" => Ok(Self::Base),
25094 "base-sepolia" => Ok(Self::BaseSepolia),
25095 "ethereum" => Ok(Self::Ethereum),
25096 "ethereum-sepolia" => Ok(Self::EthereumSepolia),
25097 "avalanche" => Ok(Self::Avalanche),
25098 "polygon" => Ok(Self::Polygon),
25099 "optimism" => Ok(Self::Optimism),
25100 "arbitrum" => Ok(Self::Arbitrum),
25101 _ => Err("invalid value".into()),
25102 }
25103 }
25104 }
25105 impl ::std::convert::TryFrom<&str> for SendEvmTransactionBodyNetwork {
25106 type Error = self::error::ConversionError;
25107 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25108 value.parse()
25109 }
25110 }
25111 impl ::std::convert::TryFrom<&::std::string::String> for SendEvmTransactionBodyNetwork {
25112 type Error = self::error::ConversionError;
25113 fn try_from(
25114 value: &::std::string::String,
25115 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25116 value.parse()
25117 }
25118 }
25119 impl ::std::convert::TryFrom<::std::string::String> for SendEvmTransactionBodyNetwork {
25120 type Error = self::error::ConversionError;
25121 fn try_from(
25122 value: ::std::string::String,
25123 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25124 value.parse()
25125 }
25126 }
25127 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
25175 #[serde(transparent)]
25176 pub struct SendEvmTransactionCriteria(pub ::std::vec::Vec<SendEvmTransactionCriteriaItem>);
25177 impl ::std::ops::Deref for SendEvmTransactionCriteria {
25178 type Target = ::std::vec::Vec<SendEvmTransactionCriteriaItem>;
25179 fn deref(&self) -> &::std::vec::Vec<SendEvmTransactionCriteriaItem> {
25180 &self.0
25181 }
25182 }
25183 impl ::std::convert::From<SendEvmTransactionCriteria>
25184 for ::std::vec::Vec<SendEvmTransactionCriteriaItem>
25185 {
25186 fn from(value: SendEvmTransactionCriteria) -> Self {
25187 value.0
25188 }
25189 }
25190 impl ::std::convert::From<&SendEvmTransactionCriteria> for SendEvmTransactionCriteria {
25191 fn from(value: &SendEvmTransactionCriteria) -> Self {
25192 value.clone()
25193 }
25194 }
25195 impl ::std::convert::From<::std::vec::Vec<SendEvmTransactionCriteriaItem>>
25196 for SendEvmTransactionCriteria
25197 {
25198 fn from(value: ::std::vec::Vec<SendEvmTransactionCriteriaItem>) -> Self {
25199 Self(value)
25200 }
25201 }
25202 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
25229 #[serde(untagged)]
25230 pub enum SendEvmTransactionCriteriaItem {
25231 EthValueCriterion(EthValueCriterion),
25232 EvmAddressCriterion(EvmAddressCriterion),
25233 EvmNetworkCriterion(EvmNetworkCriterion),
25234 EvmDataCriterion(EvmDataCriterion),
25235 NetUsdChangeCriterion(NetUsdChangeCriterion),
25236 }
25237 impl ::std::convert::From<&Self> for SendEvmTransactionCriteriaItem {
25238 fn from(value: &SendEvmTransactionCriteriaItem) -> Self {
25239 value.clone()
25240 }
25241 }
25242 impl ::std::convert::From<EthValueCriterion> for SendEvmTransactionCriteriaItem {
25243 fn from(value: EthValueCriterion) -> Self {
25244 Self::EthValueCriterion(value)
25245 }
25246 }
25247 impl ::std::convert::From<EvmAddressCriterion> for SendEvmTransactionCriteriaItem {
25248 fn from(value: EvmAddressCriterion) -> Self {
25249 Self::EvmAddressCriterion(value)
25250 }
25251 }
25252 impl ::std::convert::From<EvmNetworkCriterion> for SendEvmTransactionCriteriaItem {
25253 fn from(value: EvmNetworkCriterion) -> Self {
25254 Self::EvmNetworkCriterion(value)
25255 }
25256 }
25257 impl ::std::convert::From<EvmDataCriterion> for SendEvmTransactionCriteriaItem {
25258 fn from(value: EvmDataCriterion) -> Self {
25259 Self::EvmDataCriterion(value)
25260 }
25261 }
25262 impl ::std::convert::From<NetUsdChangeCriterion> for SendEvmTransactionCriteriaItem {
25263 fn from(value: NetUsdChangeCriterion) -> Self {
25264 Self::NetUsdChangeCriterion(value)
25265 }
25266 }
25267 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
25290 pub struct SendEvmTransactionResponse {
25291 #[serde(rename = "transactionHash")]
25293 pub transaction_hash: ::std::string::String,
25294 }
25295 impl ::std::convert::From<&SendEvmTransactionResponse> for SendEvmTransactionResponse {
25296 fn from(value: &SendEvmTransactionResponse) -> Self {
25297 value.clone()
25298 }
25299 }
25300 impl SendEvmTransactionResponse {
25301 pub fn builder() -> builder::SendEvmTransactionResponse {
25302 Default::default()
25303 }
25304 }
25305 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
25348 pub struct SendEvmTransactionRule {
25349 pub action: SendEvmTransactionRuleAction,
25351 pub criteria: SendEvmTransactionCriteria,
25352 pub operation: SendEvmTransactionRuleOperation,
25354 }
25355 impl ::std::convert::From<&SendEvmTransactionRule> for SendEvmTransactionRule {
25356 fn from(value: &SendEvmTransactionRule) -> Self {
25357 value.clone()
25358 }
25359 }
25360 impl SendEvmTransactionRule {
25361 pub fn builder() -> builder::SendEvmTransactionRule {
25362 Default::default()
25363 }
25364 }
25365 #[derive(
25384 ::serde::Deserialize,
25385 ::serde::Serialize,
25386 Clone,
25387 Copy,
25388 Debug,
25389 Eq,
25390 Hash,
25391 Ord,
25392 PartialEq,
25393 PartialOrd,
25394 )]
25395 pub enum SendEvmTransactionRuleAction {
25396 #[serde(rename = "reject")]
25397 Reject,
25398 #[serde(rename = "accept")]
25399 Accept,
25400 }
25401 impl ::std::convert::From<&Self> for SendEvmTransactionRuleAction {
25402 fn from(value: &SendEvmTransactionRuleAction) -> Self {
25403 value.clone()
25404 }
25405 }
25406 impl ::std::fmt::Display for SendEvmTransactionRuleAction {
25407 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
25408 match *self {
25409 Self::Reject => f.write_str("reject"),
25410 Self::Accept => f.write_str("accept"),
25411 }
25412 }
25413 }
25414 impl ::std::str::FromStr for SendEvmTransactionRuleAction {
25415 type Err = self::error::ConversionError;
25416 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25417 match value {
25418 "reject" => Ok(Self::Reject),
25419 "accept" => Ok(Self::Accept),
25420 _ => Err("invalid value".into()),
25421 }
25422 }
25423 }
25424 impl ::std::convert::TryFrom<&str> for SendEvmTransactionRuleAction {
25425 type Error = self::error::ConversionError;
25426 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25427 value.parse()
25428 }
25429 }
25430 impl ::std::convert::TryFrom<&::std::string::String> for SendEvmTransactionRuleAction {
25431 type Error = self::error::ConversionError;
25432 fn try_from(
25433 value: &::std::string::String,
25434 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25435 value.parse()
25436 }
25437 }
25438 impl ::std::convert::TryFrom<::std::string::String> for SendEvmTransactionRuleAction {
25439 type Error = self::error::ConversionError;
25440 fn try_from(
25441 value: ::std::string::String,
25442 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25443 value.parse()
25444 }
25445 }
25446 #[derive(
25464 ::serde::Deserialize,
25465 ::serde::Serialize,
25466 Clone,
25467 Copy,
25468 Debug,
25469 Eq,
25470 Hash,
25471 Ord,
25472 PartialEq,
25473 PartialOrd,
25474 )]
25475 pub enum SendEvmTransactionRuleOperation {
25476 #[serde(rename = "sendEvmTransaction")]
25477 SendEvmTransaction,
25478 }
25479 impl ::std::convert::From<&Self> for SendEvmTransactionRuleOperation {
25480 fn from(value: &SendEvmTransactionRuleOperation) -> Self {
25481 value.clone()
25482 }
25483 }
25484 impl ::std::fmt::Display for SendEvmTransactionRuleOperation {
25485 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
25486 match *self {
25487 Self::SendEvmTransaction => f.write_str("sendEvmTransaction"),
25488 }
25489 }
25490 }
25491 impl ::std::str::FromStr for SendEvmTransactionRuleOperation {
25492 type Err = self::error::ConversionError;
25493 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25494 match value {
25495 "sendEvmTransaction" => Ok(Self::SendEvmTransaction),
25496 _ => Err("invalid value".into()),
25497 }
25498 }
25499 }
25500 impl ::std::convert::TryFrom<&str> for SendEvmTransactionRuleOperation {
25501 type Error = self::error::ConversionError;
25502 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25503 value.parse()
25504 }
25505 }
25506 impl ::std::convert::TryFrom<&::std::string::String> for SendEvmTransactionRuleOperation {
25507 type Error = self::error::ConversionError;
25508 fn try_from(
25509 value: &::std::string::String,
25510 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25511 value.parse()
25512 }
25513 }
25514 impl ::std::convert::TryFrom<::std::string::String> for SendEvmTransactionRuleOperation {
25515 type Error = self::error::ConversionError;
25516 fn try_from(
25517 value: ::std::string::String,
25518 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25519 value.parse()
25520 }
25521 }
25522 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25536 #[serde(transparent)]
25537 pub struct SendEvmTransactionXIdempotencyKey(::std::string::String);
25538 impl ::std::ops::Deref for SendEvmTransactionXIdempotencyKey {
25539 type Target = ::std::string::String;
25540 fn deref(&self) -> &::std::string::String {
25541 &self.0
25542 }
25543 }
25544 impl ::std::convert::From<SendEvmTransactionXIdempotencyKey> for ::std::string::String {
25545 fn from(value: SendEvmTransactionXIdempotencyKey) -> Self {
25546 value.0
25547 }
25548 }
25549 impl ::std::convert::From<&SendEvmTransactionXIdempotencyKey>
25550 for SendEvmTransactionXIdempotencyKey
25551 {
25552 fn from(value: &SendEvmTransactionXIdempotencyKey) -> Self {
25553 value.clone()
25554 }
25555 }
25556 impl ::std::str::FromStr for SendEvmTransactionXIdempotencyKey {
25557 type Err = self::error::ConversionError;
25558 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25559 if value.chars().count() > 36usize {
25560 return Err("longer than 36 characters".into());
25561 }
25562 if value.chars().count() < 36usize {
25563 return Err("shorter than 36 characters".into());
25564 }
25565 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
25566 ::std::sync::LazyLock::new(|| {
25567 ::regress::Regex::new(
25568 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
25569 )
25570 .unwrap()
25571 });
25572 if PATTERN.find(value).is_none() {
25573 return Err(
25574 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
25575 .into(),
25576 );
25577 }
25578 Ok(Self(value.to_string()))
25579 }
25580 }
25581 impl ::std::convert::TryFrom<&str> for SendEvmTransactionXIdempotencyKey {
25582 type Error = self::error::ConversionError;
25583 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25584 value.parse()
25585 }
25586 }
25587 impl ::std::convert::TryFrom<&::std::string::String> for SendEvmTransactionXIdempotencyKey {
25588 type Error = self::error::ConversionError;
25589 fn try_from(
25590 value: &::std::string::String,
25591 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25592 value.parse()
25593 }
25594 }
25595 impl ::std::convert::TryFrom<::std::string::String> for SendEvmTransactionXIdempotencyKey {
25596 type Error = self::error::ConversionError;
25597 fn try_from(
25598 value: ::std::string::String,
25599 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25600 value.parse()
25601 }
25602 }
25603 impl<'de> ::serde::Deserialize<'de> for SendEvmTransactionXIdempotencyKey {
25604 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
25605 where
25606 D: ::serde::Deserializer<'de>,
25607 {
25608 ::std::string::String::deserialize(deserializer)?
25609 .parse()
25610 .map_err(|e: self::error::ConversionError| {
25611 <D::Error as ::serde::de::Error>::custom(e.to_string())
25612 })
25613 }
25614 }
25615 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
25672 #[serde(transparent)]
25673 pub struct SendSolTransactionCriteria(pub ::std::vec::Vec<SendSolTransactionCriteriaItem>);
25674 impl ::std::ops::Deref for SendSolTransactionCriteria {
25675 type Target = ::std::vec::Vec<SendSolTransactionCriteriaItem>;
25676 fn deref(&self) -> &::std::vec::Vec<SendSolTransactionCriteriaItem> {
25677 &self.0
25678 }
25679 }
25680 impl ::std::convert::From<SendSolTransactionCriteria>
25681 for ::std::vec::Vec<SendSolTransactionCriteriaItem>
25682 {
25683 fn from(value: SendSolTransactionCriteria) -> Self {
25684 value.0
25685 }
25686 }
25687 impl ::std::convert::From<&SendSolTransactionCriteria> for SendSolTransactionCriteria {
25688 fn from(value: &SendSolTransactionCriteria) -> Self {
25689 value.clone()
25690 }
25691 }
25692 impl ::std::convert::From<::std::vec::Vec<SendSolTransactionCriteriaItem>>
25693 for SendSolTransactionCriteria
25694 {
25695 fn from(value: ::std::vec::Vec<SendSolTransactionCriteriaItem>) -> Self {
25696 Self(value)
25697 }
25698 }
25699 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
25735 #[serde(untagged)]
25736 pub enum SendSolTransactionCriteriaItem {
25737 SolAddressCriterion(SolAddressCriterion),
25738 SolValueCriterion(SolValueCriterion),
25739 SplAddressCriterion(SplAddressCriterion),
25740 SplValueCriterion(SplValueCriterion),
25741 MintAddressCriterion(MintAddressCriterion),
25742 SolDataCriterion(SolDataCriterion),
25743 ProgramIdCriterion(ProgramIdCriterion),
25744 SolNetworkCriterion(SolNetworkCriterion),
25745 }
25746 impl ::std::convert::From<&Self> for SendSolTransactionCriteriaItem {
25747 fn from(value: &SendSolTransactionCriteriaItem) -> Self {
25748 value.clone()
25749 }
25750 }
25751 impl ::std::convert::From<SolAddressCriterion> for SendSolTransactionCriteriaItem {
25752 fn from(value: SolAddressCriterion) -> Self {
25753 Self::SolAddressCriterion(value)
25754 }
25755 }
25756 impl ::std::convert::From<SolValueCriterion> for SendSolTransactionCriteriaItem {
25757 fn from(value: SolValueCriterion) -> Self {
25758 Self::SolValueCriterion(value)
25759 }
25760 }
25761 impl ::std::convert::From<SplAddressCriterion> for SendSolTransactionCriteriaItem {
25762 fn from(value: SplAddressCriterion) -> Self {
25763 Self::SplAddressCriterion(value)
25764 }
25765 }
25766 impl ::std::convert::From<SplValueCriterion> for SendSolTransactionCriteriaItem {
25767 fn from(value: SplValueCriterion) -> Self {
25768 Self::SplValueCriterion(value)
25769 }
25770 }
25771 impl ::std::convert::From<MintAddressCriterion> for SendSolTransactionCriteriaItem {
25772 fn from(value: MintAddressCriterion) -> Self {
25773 Self::MintAddressCriterion(value)
25774 }
25775 }
25776 impl ::std::convert::From<SolDataCriterion> for SendSolTransactionCriteriaItem {
25777 fn from(value: SolDataCriterion) -> Self {
25778 Self::SolDataCriterion(value)
25779 }
25780 }
25781 impl ::std::convert::From<ProgramIdCriterion> for SendSolTransactionCriteriaItem {
25782 fn from(value: ProgramIdCriterion) -> Self {
25783 Self::ProgramIdCriterion(value)
25784 }
25785 }
25786 impl ::std::convert::From<SolNetworkCriterion> for SendSolTransactionCriteriaItem {
25787 fn from(value: SolNetworkCriterion) -> Self {
25788 Self::SolNetworkCriterion(value)
25789 }
25790 }
25791 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
25834 pub struct SendSolTransactionRule {
25835 pub action: SendSolTransactionRuleAction,
25837 pub criteria: SendSolTransactionCriteria,
25838 pub operation: SendSolTransactionRuleOperation,
25840 }
25841 impl ::std::convert::From<&SendSolTransactionRule> for SendSolTransactionRule {
25842 fn from(value: &SendSolTransactionRule) -> Self {
25843 value.clone()
25844 }
25845 }
25846 impl SendSolTransactionRule {
25847 pub fn builder() -> builder::SendSolTransactionRule {
25848 Default::default()
25849 }
25850 }
25851 #[derive(
25870 ::serde::Deserialize,
25871 ::serde::Serialize,
25872 Clone,
25873 Copy,
25874 Debug,
25875 Eq,
25876 Hash,
25877 Ord,
25878 PartialEq,
25879 PartialOrd,
25880 )]
25881 pub enum SendSolTransactionRuleAction {
25882 #[serde(rename = "reject")]
25883 Reject,
25884 #[serde(rename = "accept")]
25885 Accept,
25886 }
25887 impl ::std::convert::From<&Self> for SendSolTransactionRuleAction {
25888 fn from(value: &SendSolTransactionRuleAction) -> Self {
25889 value.clone()
25890 }
25891 }
25892 impl ::std::fmt::Display for SendSolTransactionRuleAction {
25893 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
25894 match *self {
25895 Self::Reject => f.write_str("reject"),
25896 Self::Accept => f.write_str("accept"),
25897 }
25898 }
25899 }
25900 impl ::std::str::FromStr for SendSolTransactionRuleAction {
25901 type Err = self::error::ConversionError;
25902 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25903 match value {
25904 "reject" => Ok(Self::Reject),
25905 "accept" => Ok(Self::Accept),
25906 _ => Err("invalid value".into()),
25907 }
25908 }
25909 }
25910 impl ::std::convert::TryFrom<&str> for SendSolTransactionRuleAction {
25911 type Error = self::error::ConversionError;
25912 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25913 value.parse()
25914 }
25915 }
25916 impl ::std::convert::TryFrom<&::std::string::String> for SendSolTransactionRuleAction {
25917 type Error = self::error::ConversionError;
25918 fn try_from(
25919 value: &::std::string::String,
25920 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25921 value.parse()
25922 }
25923 }
25924 impl ::std::convert::TryFrom<::std::string::String> for SendSolTransactionRuleAction {
25925 type Error = self::error::ConversionError;
25926 fn try_from(
25927 value: ::std::string::String,
25928 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25929 value.parse()
25930 }
25931 }
25932 #[derive(
25950 ::serde::Deserialize,
25951 ::serde::Serialize,
25952 Clone,
25953 Copy,
25954 Debug,
25955 Eq,
25956 Hash,
25957 Ord,
25958 PartialEq,
25959 PartialOrd,
25960 )]
25961 pub enum SendSolTransactionRuleOperation {
25962 #[serde(rename = "sendSolTransaction")]
25963 SendSolTransaction,
25964 }
25965 impl ::std::convert::From<&Self> for SendSolTransactionRuleOperation {
25966 fn from(value: &SendSolTransactionRuleOperation) -> Self {
25967 value.clone()
25968 }
25969 }
25970 impl ::std::fmt::Display for SendSolTransactionRuleOperation {
25971 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
25972 match *self {
25973 Self::SendSolTransaction => f.write_str("sendSolTransaction"),
25974 }
25975 }
25976 }
25977 impl ::std::str::FromStr for SendSolTransactionRuleOperation {
25978 type Err = self::error::ConversionError;
25979 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25980 match value {
25981 "sendSolTransaction" => Ok(Self::SendSolTransaction),
25982 _ => Err("invalid value".into()),
25983 }
25984 }
25985 }
25986 impl ::std::convert::TryFrom<&str> for SendSolTransactionRuleOperation {
25987 type Error = self::error::ConversionError;
25988 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
25989 value.parse()
25990 }
25991 }
25992 impl ::std::convert::TryFrom<&::std::string::String> for SendSolTransactionRuleOperation {
25993 type Error = self::error::ConversionError;
25994 fn try_from(
25995 value: &::std::string::String,
25996 ) -> ::std::result::Result<Self, self::error::ConversionError> {
25997 value.parse()
25998 }
25999 }
26000 impl ::std::convert::TryFrom<::std::string::String> for SendSolTransactionRuleOperation {
26001 type Error = self::error::ConversionError;
26002 fn try_from(
26003 value: ::std::string::String,
26004 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26005 value.parse()
26006 }
26007 }
26008 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
26043 pub struct SendSolanaTransactionBody {
26044 pub network: SendSolanaTransactionBodyNetwork,
26046 pub transaction: ::std::string::String,
26048 }
26049 impl ::std::convert::From<&SendSolanaTransactionBody> for SendSolanaTransactionBody {
26050 fn from(value: &SendSolanaTransactionBody) -> Self {
26051 value.clone()
26052 }
26053 }
26054 impl SendSolanaTransactionBody {
26055 pub fn builder() -> builder::SendSolanaTransactionBody {
26056 Default::default()
26057 }
26058 }
26059 #[derive(
26078 ::serde::Deserialize,
26079 ::serde::Serialize,
26080 Clone,
26081 Copy,
26082 Debug,
26083 Eq,
26084 Hash,
26085 Ord,
26086 PartialEq,
26087 PartialOrd,
26088 )]
26089 pub enum SendSolanaTransactionBodyNetwork {
26090 #[serde(rename = "solana")]
26091 Solana,
26092 #[serde(rename = "solana-devnet")]
26093 SolanaDevnet,
26094 }
26095 impl ::std::convert::From<&Self> for SendSolanaTransactionBodyNetwork {
26096 fn from(value: &SendSolanaTransactionBodyNetwork) -> Self {
26097 value.clone()
26098 }
26099 }
26100 impl ::std::fmt::Display for SendSolanaTransactionBodyNetwork {
26101 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
26102 match *self {
26103 Self::Solana => f.write_str("solana"),
26104 Self::SolanaDevnet => f.write_str("solana-devnet"),
26105 }
26106 }
26107 }
26108 impl ::std::str::FromStr for SendSolanaTransactionBodyNetwork {
26109 type Err = self::error::ConversionError;
26110 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26111 match value {
26112 "solana" => Ok(Self::Solana),
26113 "solana-devnet" => Ok(Self::SolanaDevnet),
26114 _ => Err("invalid value".into()),
26115 }
26116 }
26117 }
26118 impl ::std::convert::TryFrom<&str> for SendSolanaTransactionBodyNetwork {
26119 type Error = self::error::ConversionError;
26120 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26121 value.parse()
26122 }
26123 }
26124 impl ::std::convert::TryFrom<&::std::string::String> for SendSolanaTransactionBodyNetwork {
26125 type Error = self::error::ConversionError;
26126 fn try_from(
26127 value: &::std::string::String,
26128 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26129 value.parse()
26130 }
26131 }
26132 impl ::std::convert::TryFrom<::std::string::String> for SendSolanaTransactionBodyNetwork {
26133 type Error = self::error::ConversionError;
26134 fn try_from(
26135 value: ::std::string::String,
26136 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26137 value.parse()
26138 }
26139 }
26140 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
26163 pub struct SendSolanaTransactionResponse {
26164 #[serde(rename = "transactionSignature")]
26166 pub transaction_signature: ::std::string::String,
26167 }
26168 impl ::std::convert::From<&SendSolanaTransactionResponse> for SendSolanaTransactionResponse {
26169 fn from(value: &SendSolanaTransactionResponse) -> Self {
26170 value.clone()
26171 }
26172 }
26173 impl SendSolanaTransactionResponse {
26174 pub fn builder() -> builder::SendSolanaTransactionResponse {
26175 Default::default()
26176 }
26177 }
26178 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26192 #[serde(transparent)]
26193 pub struct SendSolanaTransactionXIdempotencyKey(::std::string::String);
26194 impl ::std::ops::Deref for SendSolanaTransactionXIdempotencyKey {
26195 type Target = ::std::string::String;
26196 fn deref(&self) -> &::std::string::String {
26197 &self.0
26198 }
26199 }
26200 impl ::std::convert::From<SendSolanaTransactionXIdempotencyKey> for ::std::string::String {
26201 fn from(value: SendSolanaTransactionXIdempotencyKey) -> Self {
26202 value.0
26203 }
26204 }
26205 impl ::std::convert::From<&SendSolanaTransactionXIdempotencyKey>
26206 for SendSolanaTransactionXIdempotencyKey
26207 {
26208 fn from(value: &SendSolanaTransactionXIdempotencyKey) -> Self {
26209 value.clone()
26210 }
26211 }
26212 impl ::std::str::FromStr for SendSolanaTransactionXIdempotencyKey {
26213 type Err = self::error::ConversionError;
26214 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26215 if value.chars().count() > 36usize {
26216 return Err("longer than 36 characters".into());
26217 }
26218 if value.chars().count() < 36usize {
26219 return Err("shorter than 36 characters".into());
26220 }
26221 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
26222 ::std::sync::LazyLock::new(|| {
26223 ::regress::Regex::new(
26224 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
26225 )
26226 .unwrap()
26227 });
26228 if PATTERN.find(value).is_none() {
26229 return Err(
26230 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
26231 .into(),
26232 );
26233 }
26234 Ok(Self(value.to_string()))
26235 }
26236 }
26237 impl ::std::convert::TryFrom<&str> for SendSolanaTransactionXIdempotencyKey {
26238 type Error = self::error::ConversionError;
26239 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26240 value.parse()
26241 }
26242 }
26243 impl ::std::convert::TryFrom<&::std::string::String> for SendSolanaTransactionXIdempotencyKey {
26244 type Error = self::error::ConversionError;
26245 fn try_from(
26246 value: &::std::string::String,
26247 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26248 value.parse()
26249 }
26250 }
26251 impl ::std::convert::TryFrom<::std::string::String> for SendSolanaTransactionXIdempotencyKey {
26252 type Error = self::error::ConversionError;
26253 fn try_from(
26254 value: ::std::string::String,
26255 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26256 value.parse()
26257 }
26258 }
26259 impl<'de> ::serde::Deserialize<'de> for SendSolanaTransactionXIdempotencyKey {
26260 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
26261 where
26262 D: ::serde::Deserializer<'de>,
26263 {
26264 ::std::string::String::deserialize(deserializer)?
26265 .parse()
26266 .map_err(|e: self::error::ConversionError| {
26267 <D::Error as ::serde::de::Error>::custom(e.to_string())
26268 })
26269 }
26270 }
26271 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26283 #[serde(transparent)]
26284 pub struct SendUserOperationAddress(::std::string::String);
26285 impl ::std::ops::Deref for SendUserOperationAddress {
26286 type Target = ::std::string::String;
26287 fn deref(&self) -> &::std::string::String {
26288 &self.0
26289 }
26290 }
26291 impl ::std::convert::From<SendUserOperationAddress> for ::std::string::String {
26292 fn from(value: SendUserOperationAddress) -> Self {
26293 value.0
26294 }
26295 }
26296 impl ::std::convert::From<&SendUserOperationAddress> for SendUserOperationAddress {
26297 fn from(value: &SendUserOperationAddress) -> Self {
26298 value.clone()
26299 }
26300 }
26301 impl ::std::str::FromStr for SendUserOperationAddress {
26302 type Err = self::error::ConversionError;
26303 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26304 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
26305 ::std::sync::LazyLock::new(|| {
26306 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
26307 });
26308 if PATTERN.find(value).is_none() {
26309 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
26310 }
26311 Ok(Self(value.to_string()))
26312 }
26313 }
26314 impl ::std::convert::TryFrom<&str> for SendUserOperationAddress {
26315 type Error = self::error::ConversionError;
26316 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26317 value.parse()
26318 }
26319 }
26320 impl ::std::convert::TryFrom<&::std::string::String> for SendUserOperationAddress {
26321 type Error = self::error::ConversionError;
26322 fn try_from(
26323 value: &::std::string::String,
26324 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26325 value.parse()
26326 }
26327 }
26328 impl ::std::convert::TryFrom<::std::string::String> for SendUserOperationAddress {
26329 type Error = self::error::ConversionError;
26330 fn try_from(
26331 value: ::std::string::String,
26332 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26333 value.parse()
26334 }
26335 }
26336 impl<'de> ::serde::Deserialize<'de> for SendUserOperationAddress {
26337 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
26338 where
26339 D: ::serde::Deserializer<'de>,
26340 {
26341 ::std::string::String::deserialize(deserializer)?
26342 .parse()
26343 .map_err(|e: self::error::ConversionError| {
26344 <D::Error as ::serde::de::Error>::custom(e.to_string())
26345 })
26346 }
26347 }
26348 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
26371 pub struct SendUserOperationBody {
26372 pub signature: ::std::string::String,
26374 }
26375 impl ::std::convert::From<&SendUserOperationBody> for SendUserOperationBody {
26376 fn from(value: &SendUserOperationBody) -> Self {
26377 value.clone()
26378 }
26379 }
26380 impl SendUserOperationBody {
26381 pub fn builder() -> builder::SendUserOperationBody {
26382 Default::default()
26383 }
26384 }
26385 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
26430 #[serde(transparent)]
26431 pub struct SendUserOperationCriteria(pub ::std::vec::Vec<SendUserOperationCriteriaItem>);
26432 impl ::std::ops::Deref for SendUserOperationCriteria {
26433 type Target = ::std::vec::Vec<SendUserOperationCriteriaItem>;
26434 fn deref(&self) -> &::std::vec::Vec<SendUserOperationCriteriaItem> {
26435 &self.0
26436 }
26437 }
26438 impl ::std::convert::From<SendUserOperationCriteria>
26439 for ::std::vec::Vec<SendUserOperationCriteriaItem>
26440 {
26441 fn from(value: SendUserOperationCriteria) -> Self {
26442 value.0
26443 }
26444 }
26445 impl ::std::convert::From<&SendUserOperationCriteria> for SendUserOperationCriteria {
26446 fn from(value: &SendUserOperationCriteria) -> Self {
26447 value.clone()
26448 }
26449 }
26450 impl ::std::convert::From<::std::vec::Vec<SendUserOperationCriteriaItem>>
26451 for SendUserOperationCriteria
26452 {
26453 fn from(value: ::std::vec::Vec<SendUserOperationCriteriaItem>) -> Self {
26454 Self(value)
26455 }
26456 }
26457 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
26481 #[serde(untagged)]
26482 pub enum SendUserOperationCriteriaItem {
26483 EthValueCriterion(EthValueCriterion),
26484 EvmAddressCriterion(EvmAddressCriterion),
26485 EvmDataCriterion(EvmDataCriterion),
26486 NetUsdChangeCriterion(NetUsdChangeCriterion),
26487 }
26488 impl ::std::convert::From<&Self> for SendUserOperationCriteriaItem {
26489 fn from(value: &SendUserOperationCriteriaItem) -> Self {
26490 value.clone()
26491 }
26492 }
26493 impl ::std::convert::From<EthValueCriterion> for SendUserOperationCriteriaItem {
26494 fn from(value: EthValueCriterion) -> Self {
26495 Self::EthValueCriterion(value)
26496 }
26497 }
26498 impl ::std::convert::From<EvmAddressCriterion> for SendUserOperationCriteriaItem {
26499 fn from(value: EvmAddressCriterion) -> Self {
26500 Self::EvmAddressCriterion(value)
26501 }
26502 }
26503 impl ::std::convert::From<EvmDataCriterion> for SendUserOperationCriteriaItem {
26504 fn from(value: EvmDataCriterion) -> Self {
26505 Self::EvmDataCriterion(value)
26506 }
26507 }
26508 impl ::std::convert::From<NetUsdChangeCriterion> for SendUserOperationCriteriaItem {
26509 fn from(value: NetUsdChangeCriterion) -> Self {
26510 Self::NetUsdChangeCriterion(value)
26511 }
26512 }
26513 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
26556 pub struct SendUserOperationRule {
26557 pub action: SendUserOperationRuleAction,
26559 pub criteria: SendUserOperationCriteria,
26560 pub operation: SendUserOperationRuleOperation,
26562 }
26563 impl ::std::convert::From<&SendUserOperationRule> for SendUserOperationRule {
26564 fn from(value: &SendUserOperationRule) -> Self {
26565 value.clone()
26566 }
26567 }
26568 impl SendUserOperationRule {
26569 pub fn builder() -> builder::SendUserOperationRule {
26570 Default::default()
26571 }
26572 }
26573 #[derive(
26592 ::serde::Deserialize,
26593 ::serde::Serialize,
26594 Clone,
26595 Copy,
26596 Debug,
26597 Eq,
26598 Hash,
26599 Ord,
26600 PartialEq,
26601 PartialOrd,
26602 )]
26603 pub enum SendUserOperationRuleAction {
26604 #[serde(rename = "reject")]
26605 Reject,
26606 #[serde(rename = "accept")]
26607 Accept,
26608 }
26609 impl ::std::convert::From<&Self> for SendUserOperationRuleAction {
26610 fn from(value: &SendUserOperationRuleAction) -> Self {
26611 value.clone()
26612 }
26613 }
26614 impl ::std::fmt::Display for SendUserOperationRuleAction {
26615 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
26616 match *self {
26617 Self::Reject => f.write_str("reject"),
26618 Self::Accept => f.write_str("accept"),
26619 }
26620 }
26621 }
26622 impl ::std::str::FromStr for SendUserOperationRuleAction {
26623 type Err = self::error::ConversionError;
26624 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26625 match value {
26626 "reject" => Ok(Self::Reject),
26627 "accept" => Ok(Self::Accept),
26628 _ => Err("invalid value".into()),
26629 }
26630 }
26631 }
26632 impl ::std::convert::TryFrom<&str> for SendUserOperationRuleAction {
26633 type Error = self::error::ConversionError;
26634 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26635 value.parse()
26636 }
26637 }
26638 impl ::std::convert::TryFrom<&::std::string::String> for SendUserOperationRuleAction {
26639 type Error = self::error::ConversionError;
26640 fn try_from(
26641 value: &::std::string::String,
26642 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26643 value.parse()
26644 }
26645 }
26646 impl ::std::convert::TryFrom<::std::string::String> for SendUserOperationRuleAction {
26647 type Error = self::error::ConversionError;
26648 fn try_from(
26649 value: ::std::string::String,
26650 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26651 value.parse()
26652 }
26653 }
26654 #[derive(
26672 ::serde::Deserialize,
26673 ::serde::Serialize,
26674 Clone,
26675 Copy,
26676 Debug,
26677 Eq,
26678 Hash,
26679 Ord,
26680 PartialEq,
26681 PartialOrd,
26682 )]
26683 pub enum SendUserOperationRuleOperation {
26684 #[serde(rename = "sendUserOperation")]
26685 SendUserOperation,
26686 }
26687 impl ::std::convert::From<&Self> for SendUserOperationRuleOperation {
26688 fn from(value: &SendUserOperationRuleOperation) -> Self {
26689 value.clone()
26690 }
26691 }
26692 impl ::std::fmt::Display for SendUserOperationRuleOperation {
26693 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
26694 match *self {
26695 Self::SendUserOperation => f.write_str("sendUserOperation"),
26696 }
26697 }
26698 }
26699 impl ::std::str::FromStr for SendUserOperationRuleOperation {
26700 type Err = self::error::ConversionError;
26701 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26702 match value {
26703 "sendUserOperation" => Ok(Self::SendUserOperation),
26704 _ => Err("invalid value".into()),
26705 }
26706 }
26707 }
26708 impl ::std::convert::TryFrom<&str> for SendUserOperationRuleOperation {
26709 type Error = self::error::ConversionError;
26710 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26711 value.parse()
26712 }
26713 }
26714 impl ::std::convert::TryFrom<&::std::string::String> for SendUserOperationRuleOperation {
26715 type Error = self::error::ConversionError;
26716 fn try_from(
26717 value: &::std::string::String,
26718 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26719 value.parse()
26720 }
26721 }
26722 impl ::std::convert::TryFrom<::std::string::String> for SendUserOperationRuleOperation {
26723 type Error = self::error::ConversionError;
26724 fn try_from(
26725 value: ::std::string::String,
26726 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26727 value.parse()
26728 }
26729 }
26730 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26742 #[serde(transparent)]
26743 pub struct SendUserOperationUserOpHash(::std::string::String);
26744 impl ::std::ops::Deref for SendUserOperationUserOpHash {
26745 type Target = ::std::string::String;
26746 fn deref(&self) -> &::std::string::String {
26747 &self.0
26748 }
26749 }
26750 impl ::std::convert::From<SendUserOperationUserOpHash> for ::std::string::String {
26751 fn from(value: SendUserOperationUserOpHash) -> Self {
26752 value.0
26753 }
26754 }
26755 impl ::std::convert::From<&SendUserOperationUserOpHash> for SendUserOperationUserOpHash {
26756 fn from(value: &SendUserOperationUserOpHash) -> Self {
26757 value.clone()
26758 }
26759 }
26760 impl ::std::str::FromStr for SendUserOperationUserOpHash {
26761 type Err = self::error::ConversionError;
26762 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26763 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
26764 ::std::sync::LazyLock::new(|| {
26765 ::regress::Regex::new("^0x[0-9a-fA-F]{64}$").unwrap()
26766 });
26767 if PATTERN.find(value).is_none() {
26768 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{64}$\"".into());
26769 }
26770 Ok(Self(value.to_string()))
26771 }
26772 }
26773 impl ::std::convert::TryFrom<&str> for SendUserOperationUserOpHash {
26774 type Error = self::error::ConversionError;
26775 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26776 value.parse()
26777 }
26778 }
26779 impl ::std::convert::TryFrom<&::std::string::String> for SendUserOperationUserOpHash {
26780 type Error = self::error::ConversionError;
26781 fn try_from(
26782 value: &::std::string::String,
26783 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26784 value.parse()
26785 }
26786 }
26787 impl ::std::convert::TryFrom<::std::string::String> for SendUserOperationUserOpHash {
26788 type Error = self::error::ConversionError;
26789 fn try_from(
26790 value: ::std::string::String,
26791 ) -> ::std::result::Result<Self, self::error::ConversionError> {
26792 value.parse()
26793 }
26794 }
26795 impl<'de> ::serde::Deserialize<'de> for SendUserOperationUserOpHash {
26796 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
26797 where
26798 D: ::serde::Deserializer<'de>,
26799 {
26800 ::std::string::String::deserialize(deserializer)?
26801 .parse()
26802 .map_err(|e: self::error::ConversionError| {
26803 <D::Error as ::serde::de::Error>::custom(e.to_string())
26804 })
26805 }
26806 }
26807 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
26834 pub struct SettleX402PaymentBody {
26835 #[serde(rename = "paymentPayload")]
26836 pub payment_payload: X402PaymentPayload,
26837 #[serde(rename = "paymentRequirements")]
26838 pub payment_requirements: X402PaymentRequirements,
26839 #[serde(rename = "x402Version")]
26840 pub x402_version: X402Version,
26841 }
26842 impl ::std::convert::From<&SettleX402PaymentBody> for SettleX402PaymentBody {
26843 fn from(value: &SettleX402PaymentBody) -> Self {
26844 value.clone()
26845 }
26846 }
26847 impl SettleX402PaymentBody {
26848 pub fn builder() -> builder::SettleX402PaymentBody {
26849 Default::default()
26850 }
26851 }
26852 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
26904 pub struct SettleX402PaymentResponse {
26905 #[serde(
26906 rename = "errorReason",
26907 default,
26908 skip_serializing_if = "::std::option::Option::is_none"
26909 )]
26910 pub error_reason: ::std::option::Option<X402SettleErrorReason>,
26911 pub network: ::std::string::String,
26913 pub payer: SettleX402PaymentResponsePayer,
26919 pub success: bool,
26921 pub transaction: SettleX402PaymentResponseTransaction,
26925 }
26926 impl ::std::convert::From<&SettleX402PaymentResponse> for SettleX402PaymentResponse {
26927 fn from(value: &SettleX402PaymentResponse) -> Self {
26928 value.clone()
26929 }
26930 }
26931 impl SettleX402PaymentResponse {
26932 pub fn builder() -> builder::SettleX402PaymentResponse {
26933 Default::default()
26934 }
26935 }
26936 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26956 #[serde(transparent)]
26957 pub struct SettleX402PaymentResponsePayer(::std::string::String);
26958 impl ::std::ops::Deref for SettleX402PaymentResponsePayer {
26959 type Target = ::std::string::String;
26960 fn deref(&self) -> &::std::string::String {
26961 &self.0
26962 }
26963 }
26964 impl ::std::convert::From<SettleX402PaymentResponsePayer> for ::std::string::String {
26965 fn from(value: SettleX402PaymentResponsePayer) -> Self {
26966 value.0
26967 }
26968 }
26969 impl ::std::convert::From<&SettleX402PaymentResponsePayer> for SettleX402PaymentResponsePayer {
26970 fn from(value: &SettleX402PaymentResponsePayer) -> Self {
26971 value.clone()
26972 }
26973 }
26974 impl ::std::str::FromStr for SettleX402PaymentResponsePayer {
26975 type Err = self::error::ConversionError;
26976 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26977 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
26978 ::std::sync::LazyLock::new(|| {
26979 ::regress::Regex::new("^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$")
26980 .unwrap()
26981 });
26982 if PATTERN.find(value).is_none() {
26983 return Err(
26984 "doesn't match pattern \"^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$\""
26985 .into(),
26986 );
26987 }
26988 Ok(Self(value.to_string()))
26989 }
26990 }
26991 impl ::std::convert::TryFrom<&str> for SettleX402PaymentResponsePayer {
26992 type Error = self::error::ConversionError;
26993 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
26994 value.parse()
26995 }
26996 }
26997 impl ::std::convert::TryFrom<&::std::string::String> for SettleX402PaymentResponsePayer {
26998 type Error = self::error::ConversionError;
26999 fn try_from(
27000 value: &::std::string::String,
27001 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27002 value.parse()
27003 }
27004 }
27005 impl ::std::convert::TryFrom<::std::string::String> for SettleX402PaymentResponsePayer {
27006 type Error = self::error::ConversionError;
27007 fn try_from(
27008 value: ::std::string::String,
27009 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27010 value.parse()
27011 }
27012 }
27013 impl<'de> ::serde::Deserialize<'de> for SettleX402PaymentResponsePayer {
27014 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
27015 where
27016 D: ::serde::Deserializer<'de>,
27017 {
27018 ::std::string::String::deserialize(deserializer)?
27019 .parse()
27020 .map_err(|e: self::error::ConversionError| {
27021 <D::Error as ::serde::de::Error>::custom(e.to_string())
27022 })
27023 }
27024 }
27025 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27043 #[serde(transparent)]
27044 pub struct SettleX402PaymentResponseTransaction(::std::string::String);
27045 impl ::std::ops::Deref for SettleX402PaymentResponseTransaction {
27046 type Target = ::std::string::String;
27047 fn deref(&self) -> &::std::string::String {
27048 &self.0
27049 }
27050 }
27051 impl ::std::convert::From<SettleX402PaymentResponseTransaction> for ::std::string::String {
27052 fn from(value: SettleX402PaymentResponseTransaction) -> Self {
27053 value.0
27054 }
27055 }
27056 impl ::std::convert::From<&SettleX402PaymentResponseTransaction>
27057 for SettleX402PaymentResponseTransaction
27058 {
27059 fn from(value: &SettleX402PaymentResponseTransaction) -> Self {
27060 value.clone()
27061 }
27062 }
27063 impl ::std::str::FromStr for SettleX402PaymentResponseTransaction {
27064 type Err = self::error::ConversionError;
27065 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27066 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
27067 ::std::sync::LazyLock::new(|| {
27068 ::regress::Regex::new("^(0x[a-fA-F0-9]{64}|[1-9A-HJ-NP-Za-km-z]{87,88})$")
27069 .unwrap()
27070 });
27071 if PATTERN.find(value).is_none() {
27072 return Err(
27073 "doesn't match pattern \"^(0x[a-fA-F0-9]{64}|[1-9A-HJ-NP-Za-km-z]{87,88})$\""
27074 .into(),
27075 );
27076 }
27077 Ok(Self(value.to_string()))
27078 }
27079 }
27080 impl ::std::convert::TryFrom<&str> for SettleX402PaymentResponseTransaction {
27081 type Error = self::error::ConversionError;
27082 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27083 value.parse()
27084 }
27085 }
27086 impl ::std::convert::TryFrom<&::std::string::String> for SettleX402PaymentResponseTransaction {
27087 type Error = self::error::ConversionError;
27088 fn try_from(
27089 value: &::std::string::String,
27090 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27091 value.parse()
27092 }
27093 }
27094 impl ::std::convert::TryFrom<::std::string::String> for SettleX402PaymentResponseTransaction {
27095 type Error = self::error::ConversionError;
27096 fn try_from(
27097 value: ::std::string::String,
27098 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27099 value.parse()
27100 }
27101 }
27102 impl<'de> ::serde::Deserialize<'de> for SettleX402PaymentResponseTransaction {
27103 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
27104 where
27105 D: ::serde::Deserializer<'de>,
27106 {
27107 ::std::string::String::deserialize(deserializer)?
27108 .parse()
27109 .map_err(|e: self::error::ConversionError| {
27110 <D::Error as ::serde::de::Error>::custom(e.to_string())
27111 })
27112 }
27113 }
27114 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27126 #[serde(transparent)]
27127 pub struct SignEvmHashAddress(::std::string::String);
27128 impl ::std::ops::Deref for SignEvmHashAddress {
27129 type Target = ::std::string::String;
27130 fn deref(&self) -> &::std::string::String {
27131 &self.0
27132 }
27133 }
27134 impl ::std::convert::From<SignEvmHashAddress> for ::std::string::String {
27135 fn from(value: SignEvmHashAddress) -> Self {
27136 value.0
27137 }
27138 }
27139 impl ::std::convert::From<&SignEvmHashAddress> for SignEvmHashAddress {
27140 fn from(value: &SignEvmHashAddress) -> Self {
27141 value.clone()
27142 }
27143 }
27144 impl ::std::str::FromStr for SignEvmHashAddress {
27145 type Err = self::error::ConversionError;
27146 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27147 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
27148 ::std::sync::LazyLock::new(|| {
27149 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
27150 });
27151 if PATTERN.find(value).is_none() {
27152 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
27153 }
27154 Ok(Self(value.to_string()))
27155 }
27156 }
27157 impl ::std::convert::TryFrom<&str> for SignEvmHashAddress {
27158 type Error = self::error::ConversionError;
27159 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27160 value.parse()
27161 }
27162 }
27163 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmHashAddress {
27164 type Error = self::error::ConversionError;
27165 fn try_from(
27166 value: &::std::string::String,
27167 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27168 value.parse()
27169 }
27170 }
27171 impl ::std::convert::TryFrom<::std::string::String> for SignEvmHashAddress {
27172 type Error = self::error::ConversionError;
27173 fn try_from(
27174 value: ::std::string::String,
27175 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27176 value.parse()
27177 }
27178 }
27179 impl<'de> ::serde::Deserialize<'de> for SignEvmHashAddress {
27180 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
27181 where
27182 D: ::serde::Deserializer<'de>,
27183 {
27184 ::std::string::String::deserialize(deserializer)?
27185 .parse()
27186 .map_err(|e: self::error::ConversionError| {
27187 <D::Error as ::serde::de::Error>::custom(e.to_string())
27188 })
27189 }
27190 }
27191 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
27214 pub struct SignEvmHashBody {
27215 pub hash: ::std::string::String,
27217 }
27218 impl ::std::convert::From<&SignEvmHashBody> for SignEvmHashBody {
27219 fn from(value: &SignEvmHashBody) -> Self {
27220 value.clone()
27221 }
27222 }
27223 impl SignEvmHashBody {
27224 pub fn builder() -> builder::SignEvmHashBody {
27225 Default::default()
27226 }
27227 }
27228 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
27251 pub struct SignEvmHashResponse {
27252 pub signature: ::std::string::String,
27254 }
27255 impl ::std::convert::From<&SignEvmHashResponse> for SignEvmHashResponse {
27256 fn from(value: &SignEvmHashResponse) -> Self {
27257 value.clone()
27258 }
27259 }
27260 impl SignEvmHashResponse {
27261 pub fn builder() -> builder::SignEvmHashResponse {
27262 Default::default()
27263 }
27264 }
27265 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
27304 pub struct SignEvmHashRule {
27305 pub action: SignEvmHashRuleAction,
27307 pub operation: SignEvmHashRuleOperation,
27309 }
27310 impl ::std::convert::From<&SignEvmHashRule> for SignEvmHashRule {
27311 fn from(value: &SignEvmHashRule) -> Self {
27312 value.clone()
27313 }
27314 }
27315 impl SignEvmHashRule {
27316 pub fn builder() -> builder::SignEvmHashRule {
27317 Default::default()
27318 }
27319 }
27320 #[derive(
27339 ::serde::Deserialize,
27340 ::serde::Serialize,
27341 Clone,
27342 Copy,
27343 Debug,
27344 Eq,
27345 Hash,
27346 Ord,
27347 PartialEq,
27348 PartialOrd,
27349 )]
27350 pub enum SignEvmHashRuleAction {
27351 #[serde(rename = "reject")]
27352 Reject,
27353 #[serde(rename = "accept")]
27354 Accept,
27355 }
27356 impl ::std::convert::From<&Self> for SignEvmHashRuleAction {
27357 fn from(value: &SignEvmHashRuleAction) -> Self {
27358 value.clone()
27359 }
27360 }
27361 impl ::std::fmt::Display for SignEvmHashRuleAction {
27362 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
27363 match *self {
27364 Self::Reject => f.write_str("reject"),
27365 Self::Accept => f.write_str("accept"),
27366 }
27367 }
27368 }
27369 impl ::std::str::FromStr for SignEvmHashRuleAction {
27370 type Err = self::error::ConversionError;
27371 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27372 match value {
27373 "reject" => Ok(Self::Reject),
27374 "accept" => Ok(Self::Accept),
27375 _ => Err("invalid value".into()),
27376 }
27377 }
27378 }
27379 impl ::std::convert::TryFrom<&str> for SignEvmHashRuleAction {
27380 type Error = self::error::ConversionError;
27381 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27382 value.parse()
27383 }
27384 }
27385 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmHashRuleAction {
27386 type Error = self::error::ConversionError;
27387 fn try_from(
27388 value: &::std::string::String,
27389 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27390 value.parse()
27391 }
27392 }
27393 impl ::std::convert::TryFrom<::std::string::String> for SignEvmHashRuleAction {
27394 type Error = self::error::ConversionError;
27395 fn try_from(
27396 value: ::std::string::String,
27397 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27398 value.parse()
27399 }
27400 }
27401 #[derive(
27419 ::serde::Deserialize,
27420 ::serde::Serialize,
27421 Clone,
27422 Copy,
27423 Debug,
27424 Eq,
27425 Hash,
27426 Ord,
27427 PartialEq,
27428 PartialOrd,
27429 )]
27430 pub enum SignEvmHashRuleOperation {
27431 #[serde(rename = "signEvmHash")]
27432 SignEvmHash,
27433 }
27434 impl ::std::convert::From<&Self> for SignEvmHashRuleOperation {
27435 fn from(value: &SignEvmHashRuleOperation) -> Self {
27436 value.clone()
27437 }
27438 }
27439 impl ::std::fmt::Display for SignEvmHashRuleOperation {
27440 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
27441 match *self {
27442 Self::SignEvmHash => f.write_str("signEvmHash"),
27443 }
27444 }
27445 }
27446 impl ::std::str::FromStr for SignEvmHashRuleOperation {
27447 type Err = self::error::ConversionError;
27448 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27449 match value {
27450 "signEvmHash" => Ok(Self::SignEvmHash),
27451 _ => Err("invalid value".into()),
27452 }
27453 }
27454 }
27455 impl ::std::convert::TryFrom<&str> for SignEvmHashRuleOperation {
27456 type Error = self::error::ConversionError;
27457 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27458 value.parse()
27459 }
27460 }
27461 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmHashRuleOperation {
27462 type Error = self::error::ConversionError;
27463 fn try_from(
27464 value: &::std::string::String,
27465 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27466 value.parse()
27467 }
27468 }
27469 impl ::std::convert::TryFrom<::std::string::String> for SignEvmHashRuleOperation {
27470 type Error = self::error::ConversionError;
27471 fn try_from(
27472 value: ::std::string::String,
27473 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27474 value.parse()
27475 }
27476 }
27477 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27491 #[serde(transparent)]
27492 pub struct SignEvmHashXIdempotencyKey(::std::string::String);
27493 impl ::std::ops::Deref for SignEvmHashXIdempotencyKey {
27494 type Target = ::std::string::String;
27495 fn deref(&self) -> &::std::string::String {
27496 &self.0
27497 }
27498 }
27499 impl ::std::convert::From<SignEvmHashXIdempotencyKey> for ::std::string::String {
27500 fn from(value: SignEvmHashXIdempotencyKey) -> Self {
27501 value.0
27502 }
27503 }
27504 impl ::std::convert::From<&SignEvmHashXIdempotencyKey> for SignEvmHashXIdempotencyKey {
27505 fn from(value: &SignEvmHashXIdempotencyKey) -> Self {
27506 value.clone()
27507 }
27508 }
27509 impl ::std::str::FromStr for SignEvmHashXIdempotencyKey {
27510 type Err = self::error::ConversionError;
27511 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27512 if value.chars().count() > 36usize {
27513 return Err("longer than 36 characters".into());
27514 }
27515 if value.chars().count() < 36usize {
27516 return Err("shorter than 36 characters".into());
27517 }
27518 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
27519 ::std::sync::LazyLock::new(|| {
27520 ::regress::Regex::new(
27521 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
27522 )
27523 .unwrap()
27524 });
27525 if PATTERN.find(value).is_none() {
27526 return Err(
27527 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
27528 .into(),
27529 );
27530 }
27531 Ok(Self(value.to_string()))
27532 }
27533 }
27534 impl ::std::convert::TryFrom<&str> for SignEvmHashXIdempotencyKey {
27535 type Error = self::error::ConversionError;
27536 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27537 value.parse()
27538 }
27539 }
27540 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmHashXIdempotencyKey {
27541 type Error = self::error::ConversionError;
27542 fn try_from(
27543 value: &::std::string::String,
27544 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27545 value.parse()
27546 }
27547 }
27548 impl ::std::convert::TryFrom<::std::string::String> for SignEvmHashXIdempotencyKey {
27549 type Error = self::error::ConversionError;
27550 fn try_from(
27551 value: ::std::string::String,
27552 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27553 value.parse()
27554 }
27555 }
27556 impl<'de> ::serde::Deserialize<'de> for SignEvmHashXIdempotencyKey {
27557 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
27558 where
27559 D: ::serde::Deserializer<'de>,
27560 {
27561 ::std::string::String::deserialize(deserializer)?
27562 .parse()
27563 .map_err(|e: self::error::ConversionError| {
27564 <D::Error as ::serde::de::Error>::custom(e.to_string())
27565 })
27566 }
27567 }
27568 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27580 #[serde(transparent)]
27581 pub struct SignEvmMessageAddress(::std::string::String);
27582 impl ::std::ops::Deref for SignEvmMessageAddress {
27583 type Target = ::std::string::String;
27584 fn deref(&self) -> &::std::string::String {
27585 &self.0
27586 }
27587 }
27588 impl ::std::convert::From<SignEvmMessageAddress> for ::std::string::String {
27589 fn from(value: SignEvmMessageAddress) -> Self {
27590 value.0
27591 }
27592 }
27593 impl ::std::convert::From<&SignEvmMessageAddress> for SignEvmMessageAddress {
27594 fn from(value: &SignEvmMessageAddress) -> Self {
27595 value.clone()
27596 }
27597 }
27598 impl ::std::str::FromStr for SignEvmMessageAddress {
27599 type Err = self::error::ConversionError;
27600 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27601 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
27602 ::std::sync::LazyLock::new(|| {
27603 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
27604 });
27605 if PATTERN.find(value).is_none() {
27606 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
27607 }
27608 Ok(Self(value.to_string()))
27609 }
27610 }
27611 impl ::std::convert::TryFrom<&str> for SignEvmMessageAddress {
27612 type Error = self::error::ConversionError;
27613 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27614 value.parse()
27615 }
27616 }
27617 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmMessageAddress {
27618 type Error = self::error::ConversionError;
27619 fn try_from(
27620 value: &::std::string::String,
27621 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27622 value.parse()
27623 }
27624 }
27625 impl ::std::convert::TryFrom<::std::string::String> for SignEvmMessageAddress {
27626 type Error = self::error::ConversionError;
27627 fn try_from(
27628 value: ::std::string::String,
27629 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27630 value.parse()
27631 }
27632 }
27633 impl<'de> ::serde::Deserialize<'de> for SignEvmMessageAddress {
27634 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
27635 where
27636 D: ::serde::Deserializer<'de>,
27637 {
27638 ::std::string::String::deserialize(deserializer)?
27639 .parse()
27640 .map_err(|e: self::error::ConversionError| {
27641 <D::Error as ::serde::de::Error>::custom(e.to_string())
27642 })
27643 }
27644 }
27645 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
27668 pub struct SignEvmMessageBody {
27669 pub message: ::std::string::String,
27671 }
27672 impl ::std::convert::From<&SignEvmMessageBody> for SignEvmMessageBody {
27673 fn from(value: &SignEvmMessageBody) -> Self {
27674 value.clone()
27675 }
27676 }
27677 impl SignEvmMessageBody {
27678 pub fn builder() -> builder::SignEvmMessageBody {
27679 Default::default()
27680 }
27681 }
27682 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
27710 #[serde(transparent)]
27711 pub struct SignEvmMessageCriteria(pub ::std::vec::Vec<EvmMessageCriterion>);
27712 impl ::std::ops::Deref for SignEvmMessageCriteria {
27713 type Target = ::std::vec::Vec<EvmMessageCriterion>;
27714 fn deref(&self) -> &::std::vec::Vec<EvmMessageCriterion> {
27715 &self.0
27716 }
27717 }
27718 impl ::std::convert::From<SignEvmMessageCriteria> for ::std::vec::Vec<EvmMessageCriterion> {
27719 fn from(value: SignEvmMessageCriteria) -> Self {
27720 value.0
27721 }
27722 }
27723 impl ::std::convert::From<&SignEvmMessageCriteria> for SignEvmMessageCriteria {
27724 fn from(value: &SignEvmMessageCriteria) -> Self {
27725 value.clone()
27726 }
27727 }
27728 impl ::std::convert::From<::std::vec::Vec<EvmMessageCriterion>> for SignEvmMessageCriteria {
27729 fn from(value: ::std::vec::Vec<EvmMessageCriterion>) -> Self {
27730 Self(value)
27731 }
27732 }
27733 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
27756 pub struct SignEvmMessageResponse {
27757 pub signature: ::std::string::String,
27759 }
27760 impl ::std::convert::From<&SignEvmMessageResponse> for SignEvmMessageResponse {
27761 fn from(value: &SignEvmMessageResponse) -> Self {
27762 value.clone()
27763 }
27764 }
27765 impl SignEvmMessageResponse {
27766 pub fn builder() -> builder::SignEvmMessageResponse {
27767 Default::default()
27768 }
27769 }
27770 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
27813 pub struct SignEvmMessageRule {
27814 pub action: SignEvmMessageRuleAction,
27816 pub criteria: SignEvmMessageCriteria,
27817 pub operation: SignEvmMessageRuleOperation,
27819 }
27820 impl ::std::convert::From<&SignEvmMessageRule> for SignEvmMessageRule {
27821 fn from(value: &SignEvmMessageRule) -> Self {
27822 value.clone()
27823 }
27824 }
27825 impl SignEvmMessageRule {
27826 pub fn builder() -> builder::SignEvmMessageRule {
27827 Default::default()
27828 }
27829 }
27830 #[derive(
27849 ::serde::Deserialize,
27850 ::serde::Serialize,
27851 Clone,
27852 Copy,
27853 Debug,
27854 Eq,
27855 Hash,
27856 Ord,
27857 PartialEq,
27858 PartialOrd,
27859 )]
27860 pub enum SignEvmMessageRuleAction {
27861 #[serde(rename = "reject")]
27862 Reject,
27863 #[serde(rename = "accept")]
27864 Accept,
27865 }
27866 impl ::std::convert::From<&Self> for SignEvmMessageRuleAction {
27867 fn from(value: &SignEvmMessageRuleAction) -> Self {
27868 value.clone()
27869 }
27870 }
27871 impl ::std::fmt::Display for SignEvmMessageRuleAction {
27872 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
27873 match *self {
27874 Self::Reject => f.write_str("reject"),
27875 Self::Accept => f.write_str("accept"),
27876 }
27877 }
27878 }
27879 impl ::std::str::FromStr for SignEvmMessageRuleAction {
27880 type Err = self::error::ConversionError;
27881 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27882 match value {
27883 "reject" => Ok(Self::Reject),
27884 "accept" => Ok(Self::Accept),
27885 _ => Err("invalid value".into()),
27886 }
27887 }
27888 }
27889 impl ::std::convert::TryFrom<&str> for SignEvmMessageRuleAction {
27890 type Error = self::error::ConversionError;
27891 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27892 value.parse()
27893 }
27894 }
27895 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmMessageRuleAction {
27896 type Error = self::error::ConversionError;
27897 fn try_from(
27898 value: &::std::string::String,
27899 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27900 value.parse()
27901 }
27902 }
27903 impl ::std::convert::TryFrom<::std::string::String> for SignEvmMessageRuleAction {
27904 type Error = self::error::ConversionError;
27905 fn try_from(
27906 value: ::std::string::String,
27907 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27908 value.parse()
27909 }
27910 }
27911 #[derive(
27929 ::serde::Deserialize,
27930 ::serde::Serialize,
27931 Clone,
27932 Copy,
27933 Debug,
27934 Eq,
27935 Hash,
27936 Ord,
27937 PartialEq,
27938 PartialOrd,
27939 )]
27940 pub enum SignEvmMessageRuleOperation {
27941 #[serde(rename = "signEvmMessage")]
27942 SignEvmMessage,
27943 }
27944 impl ::std::convert::From<&Self> for SignEvmMessageRuleOperation {
27945 fn from(value: &SignEvmMessageRuleOperation) -> Self {
27946 value.clone()
27947 }
27948 }
27949 impl ::std::fmt::Display for SignEvmMessageRuleOperation {
27950 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
27951 match *self {
27952 Self::SignEvmMessage => f.write_str("signEvmMessage"),
27953 }
27954 }
27955 }
27956 impl ::std::str::FromStr for SignEvmMessageRuleOperation {
27957 type Err = self::error::ConversionError;
27958 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27959 match value {
27960 "signEvmMessage" => Ok(Self::SignEvmMessage),
27961 _ => Err("invalid value".into()),
27962 }
27963 }
27964 }
27965 impl ::std::convert::TryFrom<&str> for SignEvmMessageRuleOperation {
27966 type Error = self::error::ConversionError;
27967 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
27968 value.parse()
27969 }
27970 }
27971 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmMessageRuleOperation {
27972 type Error = self::error::ConversionError;
27973 fn try_from(
27974 value: &::std::string::String,
27975 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27976 value.parse()
27977 }
27978 }
27979 impl ::std::convert::TryFrom<::std::string::String> for SignEvmMessageRuleOperation {
27980 type Error = self::error::ConversionError;
27981 fn try_from(
27982 value: ::std::string::String,
27983 ) -> ::std::result::Result<Self, self::error::ConversionError> {
27984 value.parse()
27985 }
27986 }
27987 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28001 #[serde(transparent)]
28002 pub struct SignEvmMessageXIdempotencyKey(::std::string::String);
28003 impl ::std::ops::Deref for SignEvmMessageXIdempotencyKey {
28004 type Target = ::std::string::String;
28005 fn deref(&self) -> &::std::string::String {
28006 &self.0
28007 }
28008 }
28009 impl ::std::convert::From<SignEvmMessageXIdempotencyKey> for ::std::string::String {
28010 fn from(value: SignEvmMessageXIdempotencyKey) -> Self {
28011 value.0
28012 }
28013 }
28014 impl ::std::convert::From<&SignEvmMessageXIdempotencyKey> for SignEvmMessageXIdempotencyKey {
28015 fn from(value: &SignEvmMessageXIdempotencyKey) -> Self {
28016 value.clone()
28017 }
28018 }
28019 impl ::std::str::FromStr for SignEvmMessageXIdempotencyKey {
28020 type Err = self::error::ConversionError;
28021 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28022 if value.chars().count() > 36usize {
28023 return Err("longer than 36 characters".into());
28024 }
28025 if value.chars().count() < 36usize {
28026 return Err("shorter than 36 characters".into());
28027 }
28028 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
28029 ::std::sync::LazyLock::new(|| {
28030 ::regress::Regex::new(
28031 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
28032 )
28033 .unwrap()
28034 });
28035 if PATTERN.find(value).is_none() {
28036 return Err(
28037 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
28038 .into(),
28039 );
28040 }
28041 Ok(Self(value.to_string()))
28042 }
28043 }
28044 impl ::std::convert::TryFrom<&str> for SignEvmMessageXIdempotencyKey {
28045 type Error = self::error::ConversionError;
28046 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28047 value.parse()
28048 }
28049 }
28050 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmMessageXIdempotencyKey {
28051 type Error = self::error::ConversionError;
28052 fn try_from(
28053 value: &::std::string::String,
28054 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28055 value.parse()
28056 }
28057 }
28058 impl ::std::convert::TryFrom<::std::string::String> for SignEvmMessageXIdempotencyKey {
28059 type Error = self::error::ConversionError;
28060 fn try_from(
28061 value: ::std::string::String,
28062 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28063 value.parse()
28064 }
28065 }
28066 impl<'de> ::serde::Deserialize<'de> for SignEvmMessageXIdempotencyKey {
28067 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
28068 where
28069 D: ::serde::Deserializer<'de>,
28070 {
28071 ::std::string::String::deserialize(deserializer)?
28072 .parse()
28073 .map_err(|e: self::error::ConversionError| {
28074 <D::Error as ::serde::de::Error>::custom(e.to_string())
28075 })
28076 }
28077 }
28078 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28090 #[serde(transparent)]
28091 pub struct SignEvmTransactionAddress(::std::string::String);
28092 impl ::std::ops::Deref for SignEvmTransactionAddress {
28093 type Target = ::std::string::String;
28094 fn deref(&self) -> &::std::string::String {
28095 &self.0
28096 }
28097 }
28098 impl ::std::convert::From<SignEvmTransactionAddress> for ::std::string::String {
28099 fn from(value: SignEvmTransactionAddress) -> Self {
28100 value.0
28101 }
28102 }
28103 impl ::std::convert::From<&SignEvmTransactionAddress> for SignEvmTransactionAddress {
28104 fn from(value: &SignEvmTransactionAddress) -> Self {
28105 value.clone()
28106 }
28107 }
28108 impl ::std::str::FromStr for SignEvmTransactionAddress {
28109 type Err = self::error::ConversionError;
28110 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28111 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
28112 ::std::sync::LazyLock::new(|| {
28113 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
28114 });
28115 if PATTERN.find(value).is_none() {
28116 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
28117 }
28118 Ok(Self(value.to_string()))
28119 }
28120 }
28121 impl ::std::convert::TryFrom<&str> for SignEvmTransactionAddress {
28122 type Error = self::error::ConversionError;
28123 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28124 value.parse()
28125 }
28126 }
28127 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTransactionAddress {
28128 type Error = self::error::ConversionError;
28129 fn try_from(
28130 value: &::std::string::String,
28131 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28132 value.parse()
28133 }
28134 }
28135 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTransactionAddress {
28136 type Error = self::error::ConversionError;
28137 fn try_from(
28138 value: ::std::string::String,
28139 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28140 value.parse()
28141 }
28142 }
28143 impl<'de> ::serde::Deserialize<'de> for SignEvmTransactionAddress {
28144 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
28145 where
28146 D: ::serde::Deserializer<'de>,
28147 {
28148 ::std::string::String::deserialize(deserializer)?
28149 .parse()
28150 .map_err(|e: self::error::ConversionError| {
28151 <D::Error as ::serde::de::Error>::custom(e.to_string())
28152 })
28153 }
28154 }
28155 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
28178 pub struct SignEvmTransactionBody {
28179 pub transaction: ::std::string::String,
28181 }
28182 impl ::std::convert::From<&SignEvmTransactionBody> for SignEvmTransactionBody {
28183 fn from(value: &SignEvmTransactionBody) -> Self {
28184 value.clone()
28185 }
28186 }
28187 impl SignEvmTransactionBody {
28188 pub fn builder() -> builder::SignEvmTransactionBody {
28189 Default::default()
28190 }
28191 }
28192 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
28236 #[serde(transparent)]
28237 pub struct SignEvmTransactionCriteria(pub ::std::vec::Vec<SignEvmTransactionCriteriaItem>);
28238 impl ::std::ops::Deref for SignEvmTransactionCriteria {
28239 type Target = ::std::vec::Vec<SignEvmTransactionCriteriaItem>;
28240 fn deref(&self) -> &::std::vec::Vec<SignEvmTransactionCriteriaItem> {
28241 &self.0
28242 }
28243 }
28244 impl ::std::convert::From<SignEvmTransactionCriteria>
28245 for ::std::vec::Vec<SignEvmTransactionCriteriaItem>
28246 {
28247 fn from(value: SignEvmTransactionCriteria) -> Self {
28248 value.0
28249 }
28250 }
28251 impl ::std::convert::From<&SignEvmTransactionCriteria> for SignEvmTransactionCriteria {
28252 fn from(value: &SignEvmTransactionCriteria) -> Self {
28253 value.clone()
28254 }
28255 }
28256 impl ::std::convert::From<::std::vec::Vec<SignEvmTransactionCriteriaItem>>
28257 for SignEvmTransactionCriteria
28258 {
28259 fn from(value: ::std::vec::Vec<SignEvmTransactionCriteriaItem>) -> Self {
28260 Self(value)
28261 }
28262 }
28263 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
28287 #[serde(untagged)]
28288 pub enum SignEvmTransactionCriteriaItem {
28289 EthValueCriterion(EthValueCriterion),
28290 EvmAddressCriterion(EvmAddressCriterion),
28291 EvmDataCriterion(EvmDataCriterion),
28292 NetUsdChangeCriterion(NetUsdChangeCriterion),
28293 }
28294 impl ::std::convert::From<&Self> for SignEvmTransactionCriteriaItem {
28295 fn from(value: &SignEvmTransactionCriteriaItem) -> Self {
28296 value.clone()
28297 }
28298 }
28299 impl ::std::convert::From<EthValueCriterion> for SignEvmTransactionCriteriaItem {
28300 fn from(value: EthValueCriterion) -> Self {
28301 Self::EthValueCriterion(value)
28302 }
28303 }
28304 impl ::std::convert::From<EvmAddressCriterion> for SignEvmTransactionCriteriaItem {
28305 fn from(value: EvmAddressCriterion) -> Self {
28306 Self::EvmAddressCriterion(value)
28307 }
28308 }
28309 impl ::std::convert::From<EvmDataCriterion> for SignEvmTransactionCriteriaItem {
28310 fn from(value: EvmDataCriterion) -> Self {
28311 Self::EvmDataCriterion(value)
28312 }
28313 }
28314 impl ::std::convert::From<NetUsdChangeCriterion> for SignEvmTransactionCriteriaItem {
28315 fn from(value: NetUsdChangeCriterion) -> Self {
28316 Self::NetUsdChangeCriterion(value)
28317 }
28318 }
28319 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
28342 pub struct SignEvmTransactionResponse {
28343 #[serde(rename = "signedTransaction")]
28345 pub signed_transaction: ::std::string::String,
28346 }
28347 impl ::std::convert::From<&SignEvmTransactionResponse> for SignEvmTransactionResponse {
28348 fn from(value: &SignEvmTransactionResponse) -> Self {
28349 value.clone()
28350 }
28351 }
28352 impl SignEvmTransactionResponse {
28353 pub fn builder() -> builder::SignEvmTransactionResponse {
28354 Default::default()
28355 }
28356 }
28357 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
28399 pub struct SignEvmTransactionRule {
28400 pub action: SignEvmTransactionRuleAction,
28402 pub criteria: SignEvmTransactionCriteria,
28403 pub operation: SignEvmTransactionRuleOperation,
28405 }
28406 impl ::std::convert::From<&SignEvmTransactionRule> for SignEvmTransactionRule {
28407 fn from(value: &SignEvmTransactionRule) -> Self {
28408 value.clone()
28409 }
28410 }
28411 impl SignEvmTransactionRule {
28412 pub fn builder() -> builder::SignEvmTransactionRule {
28413 Default::default()
28414 }
28415 }
28416 #[derive(
28435 ::serde::Deserialize,
28436 ::serde::Serialize,
28437 Clone,
28438 Copy,
28439 Debug,
28440 Eq,
28441 Hash,
28442 Ord,
28443 PartialEq,
28444 PartialOrd,
28445 )]
28446 pub enum SignEvmTransactionRuleAction {
28447 #[serde(rename = "reject")]
28448 Reject,
28449 #[serde(rename = "accept")]
28450 Accept,
28451 }
28452 impl ::std::convert::From<&Self> for SignEvmTransactionRuleAction {
28453 fn from(value: &SignEvmTransactionRuleAction) -> Self {
28454 value.clone()
28455 }
28456 }
28457 impl ::std::fmt::Display for SignEvmTransactionRuleAction {
28458 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
28459 match *self {
28460 Self::Reject => f.write_str("reject"),
28461 Self::Accept => f.write_str("accept"),
28462 }
28463 }
28464 }
28465 impl ::std::str::FromStr for SignEvmTransactionRuleAction {
28466 type Err = self::error::ConversionError;
28467 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28468 match value {
28469 "reject" => Ok(Self::Reject),
28470 "accept" => Ok(Self::Accept),
28471 _ => Err("invalid value".into()),
28472 }
28473 }
28474 }
28475 impl ::std::convert::TryFrom<&str> for SignEvmTransactionRuleAction {
28476 type Error = self::error::ConversionError;
28477 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28478 value.parse()
28479 }
28480 }
28481 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTransactionRuleAction {
28482 type Error = self::error::ConversionError;
28483 fn try_from(
28484 value: &::std::string::String,
28485 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28486 value.parse()
28487 }
28488 }
28489 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTransactionRuleAction {
28490 type Error = self::error::ConversionError;
28491 fn try_from(
28492 value: ::std::string::String,
28493 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28494 value.parse()
28495 }
28496 }
28497 #[derive(
28515 ::serde::Deserialize,
28516 ::serde::Serialize,
28517 Clone,
28518 Copy,
28519 Debug,
28520 Eq,
28521 Hash,
28522 Ord,
28523 PartialEq,
28524 PartialOrd,
28525 )]
28526 pub enum SignEvmTransactionRuleOperation {
28527 #[serde(rename = "signEvmTransaction")]
28528 SignEvmTransaction,
28529 }
28530 impl ::std::convert::From<&Self> for SignEvmTransactionRuleOperation {
28531 fn from(value: &SignEvmTransactionRuleOperation) -> Self {
28532 value.clone()
28533 }
28534 }
28535 impl ::std::fmt::Display for SignEvmTransactionRuleOperation {
28536 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
28537 match *self {
28538 Self::SignEvmTransaction => f.write_str("signEvmTransaction"),
28539 }
28540 }
28541 }
28542 impl ::std::str::FromStr for SignEvmTransactionRuleOperation {
28543 type Err = self::error::ConversionError;
28544 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28545 match value {
28546 "signEvmTransaction" => Ok(Self::SignEvmTransaction),
28547 _ => Err("invalid value".into()),
28548 }
28549 }
28550 }
28551 impl ::std::convert::TryFrom<&str> for SignEvmTransactionRuleOperation {
28552 type Error = self::error::ConversionError;
28553 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28554 value.parse()
28555 }
28556 }
28557 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTransactionRuleOperation {
28558 type Error = self::error::ConversionError;
28559 fn try_from(
28560 value: &::std::string::String,
28561 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28562 value.parse()
28563 }
28564 }
28565 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTransactionRuleOperation {
28566 type Error = self::error::ConversionError;
28567 fn try_from(
28568 value: ::std::string::String,
28569 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28570 value.parse()
28571 }
28572 }
28573 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28587 #[serde(transparent)]
28588 pub struct SignEvmTransactionXIdempotencyKey(::std::string::String);
28589 impl ::std::ops::Deref for SignEvmTransactionXIdempotencyKey {
28590 type Target = ::std::string::String;
28591 fn deref(&self) -> &::std::string::String {
28592 &self.0
28593 }
28594 }
28595 impl ::std::convert::From<SignEvmTransactionXIdempotencyKey> for ::std::string::String {
28596 fn from(value: SignEvmTransactionXIdempotencyKey) -> Self {
28597 value.0
28598 }
28599 }
28600 impl ::std::convert::From<&SignEvmTransactionXIdempotencyKey>
28601 for SignEvmTransactionXIdempotencyKey
28602 {
28603 fn from(value: &SignEvmTransactionXIdempotencyKey) -> Self {
28604 value.clone()
28605 }
28606 }
28607 impl ::std::str::FromStr for SignEvmTransactionXIdempotencyKey {
28608 type Err = self::error::ConversionError;
28609 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28610 if value.chars().count() > 36usize {
28611 return Err("longer than 36 characters".into());
28612 }
28613 if value.chars().count() < 36usize {
28614 return Err("shorter than 36 characters".into());
28615 }
28616 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
28617 ::std::sync::LazyLock::new(|| {
28618 ::regress::Regex::new(
28619 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
28620 )
28621 .unwrap()
28622 });
28623 if PATTERN.find(value).is_none() {
28624 return Err(
28625 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
28626 .into(),
28627 );
28628 }
28629 Ok(Self(value.to_string()))
28630 }
28631 }
28632 impl ::std::convert::TryFrom<&str> for SignEvmTransactionXIdempotencyKey {
28633 type Error = self::error::ConversionError;
28634 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28635 value.parse()
28636 }
28637 }
28638 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTransactionXIdempotencyKey {
28639 type Error = self::error::ConversionError;
28640 fn try_from(
28641 value: &::std::string::String,
28642 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28643 value.parse()
28644 }
28645 }
28646 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTransactionXIdempotencyKey {
28647 type Error = self::error::ConversionError;
28648 fn try_from(
28649 value: ::std::string::String,
28650 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28651 value.parse()
28652 }
28653 }
28654 impl<'de> ::serde::Deserialize<'de> for SignEvmTransactionXIdempotencyKey {
28655 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
28656 where
28657 D: ::serde::Deserializer<'de>,
28658 {
28659 ::std::string::String::deserialize(deserializer)?
28660 .parse()
28661 .map_err(|e: self::error::ConversionError| {
28662 <D::Error as ::serde::de::Error>::custom(e.to_string())
28663 })
28664 }
28665 }
28666 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28678 #[serde(transparent)]
28679 pub struct SignEvmTypedDataAddress(::std::string::String);
28680 impl ::std::ops::Deref for SignEvmTypedDataAddress {
28681 type Target = ::std::string::String;
28682 fn deref(&self) -> &::std::string::String {
28683 &self.0
28684 }
28685 }
28686 impl ::std::convert::From<SignEvmTypedDataAddress> for ::std::string::String {
28687 fn from(value: SignEvmTypedDataAddress) -> Self {
28688 value.0
28689 }
28690 }
28691 impl ::std::convert::From<&SignEvmTypedDataAddress> for SignEvmTypedDataAddress {
28692 fn from(value: &SignEvmTypedDataAddress) -> Self {
28693 value.clone()
28694 }
28695 }
28696 impl ::std::str::FromStr for SignEvmTypedDataAddress {
28697 type Err = self::error::ConversionError;
28698 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28699 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
28700 ::std::sync::LazyLock::new(|| {
28701 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
28702 });
28703 if PATTERN.find(value).is_none() {
28704 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
28705 }
28706 Ok(Self(value.to_string()))
28707 }
28708 }
28709 impl ::std::convert::TryFrom<&str> for SignEvmTypedDataAddress {
28710 type Error = self::error::ConversionError;
28711 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
28712 value.parse()
28713 }
28714 }
28715 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTypedDataAddress {
28716 type Error = self::error::ConversionError;
28717 fn try_from(
28718 value: &::std::string::String,
28719 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28720 value.parse()
28721 }
28722 }
28723 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTypedDataAddress {
28724 type Error = self::error::ConversionError;
28725 fn try_from(
28726 value: ::std::string::String,
28727 ) -> ::std::result::Result<Self, self::error::ConversionError> {
28728 value.parse()
28729 }
28730 }
28731 impl<'de> ::serde::Deserialize<'de> for SignEvmTypedDataAddress {
28732 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
28733 where
28734 D: ::serde::Deserializer<'de>,
28735 {
28736 ::std::string::String::deserialize(deserializer)?
28737 .parse()
28738 .map_err(|e: self::error::ConversionError| {
28739 <D::Error as ::serde::de::Error>::custom(e.to_string())
28740 })
28741 }
28742 }
28743 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
28831 #[serde(transparent)]
28832 pub struct SignEvmTypedDataCriteria(pub ::std::vec::Vec<SignEvmTypedDataCriteriaItem>);
28833 impl ::std::ops::Deref for SignEvmTypedDataCriteria {
28834 type Target = ::std::vec::Vec<SignEvmTypedDataCriteriaItem>;
28835 fn deref(&self) -> &::std::vec::Vec<SignEvmTypedDataCriteriaItem> {
28836 &self.0
28837 }
28838 }
28839 impl ::std::convert::From<SignEvmTypedDataCriteria>
28840 for ::std::vec::Vec<SignEvmTypedDataCriteriaItem>
28841 {
28842 fn from(value: SignEvmTypedDataCriteria) -> Self {
28843 value.0
28844 }
28845 }
28846 impl ::std::convert::From<&SignEvmTypedDataCriteria> for SignEvmTypedDataCriteria {
28847 fn from(value: &SignEvmTypedDataCriteria) -> Self {
28848 value.clone()
28849 }
28850 }
28851 impl ::std::convert::From<::std::vec::Vec<SignEvmTypedDataCriteriaItem>>
28852 for SignEvmTypedDataCriteria
28853 {
28854 fn from(value: ::std::vec::Vec<SignEvmTypedDataCriteriaItem>) -> Self {
28855 Self(value)
28856 }
28857 }
28858 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
28876 #[serde(untagged)]
28877 pub enum SignEvmTypedDataCriteriaItem {
28878 FieldCriterion(SignEvmTypedDataFieldCriterion),
28879 VerifyingContractCriterion(SignEvmTypedDataVerifyingContractCriterion),
28880 }
28881 impl ::std::convert::From<&Self> for SignEvmTypedDataCriteriaItem {
28882 fn from(value: &SignEvmTypedDataCriteriaItem) -> Self {
28883 value.clone()
28884 }
28885 }
28886 impl ::std::convert::From<SignEvmTypedDataFieldCriterion> for SignEvmTypedDataCriteriaItem {
28887 fn from(value: SignEvmTypedDataFieldCriterion) -> Self {
28888 Self::FieldCriterion(value)
28889 }
28890 }
28891 impl ::std::convert::From<SignEvmTypedDataVerifyingContractCriterion>
28892 for SignEvmTypedDataCriteriaItem
28893 {
28894 fn from(value: SignEvmTypedDataVerifyingContractCriterion) -> Self {
28895 Self::VerifyingContractCriterion(value)
28896 }
28897 }
28898 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
29035 pub struct SignEvmTypedDataFieldCriterion {
29036 pub conditions: ::std::vec::Vec<SignEvmTypedDataFieldCriterionConditionsItem>,
29038 #[serde(rename = "type")]
29040 pub type_: SignEvmTypedDataFieldCriterionType,
29041 pub types: SignEvmTypedDataFieldCriterionTypes,
29042 }
29043 impl ::std::convert::From<&SignEvmTypedDataFieldCriterion> for SignEvmTypedDataFieldCriterion {
29044 fn from(value: &SignEvmTypedDataFieldCriterion) -> Self {
29045 value.clone()
29046 }
29047 }
29048 impl SignEvmTypedDataFieldCriterion {
29049 pub fn builder() -> builder::SignEvmTypedDataFieldCriterion {
29050 Default::default()
29051 }
29052 }
29053 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
29074 #[serde(untagged)]
29075 pub enum SignEvmTypedDataFieldCriterionConditionsItem {
29076 AddressCondition(EvmTypedAddressCondition),
29077 NumericalCondition(EvmTypedNumericalCondition),
29078 StringCondition(EvmTypedStringCondition),
29079 }
29080 impl ::std::convert::From<&Self> for SignEvmTypedDataFieldCriterionConditionsItem {
29081 fn from(value: &SignEvmTypedDataFieldCriterionConditionsItem) -> Self {
29082 value.clone()
29083 }
29084 }
29085 impl ::std::convert::From<EvmTypedAddressCondition>
29086 for SignEvmTypedDataFieldCriterionConditionsItem
29087 {
29088 fn from(value: EvmTypedAddressCondition) -> Self {
29089 Self::AddressCondition(value)
29090 }
29091 }
29092 impl ::std::convert::From<EvmTypedNumericalCondition>
29093 for SignEvmTypedDataFieldCriterionConditionsItem
29094 {
29095 fn from(value: EvmTypedNumericalCondition) -> Self {
29096 Self::NumericalCondition(value)
29097 }
29098 }
29099 impl ::std::convert::From<EvmTypedStringCondition>
29100 for SignEvmTypedDataFieldCriterionConditionsItem
29101 {
29102 fn from(value: EvmTypedStringCondition) -> Self {
29103 Self::StringCondition(value)
29104 }
29105 }
29106 #[derive(
29124 ::serde::Deserialize,
29125 ::serde::Serialize,
29126 Clone,
29127 Copy,
29128 Debug,
29129 Eq,
29130 Hash,
29131 Ord,
29132 PartialEq,
29133 PartialOrd,
29134 )]
29135 pub enum SignEvmTypedDataFieldCriterionType {
29136 #[serde(rename = "evmTypedDataField")]
29137 EvmTypedDataField,
29138 }
29139 impl ::std::convert::From<&Self> for SignEvmTypedDataFieldCriterionType {
29140 fn from(value: &SignEvmTypedDataFieldCriterionType) -> Self {
29141 value.clone()
29142 }
29143 }
29144 impl ::std::fmt::Display for SignEvmTypedDataFieldCriterionType {
29145 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
29146 match *self {
29147 Self::EvmTypedDataField => f.write_str("evmTypedDataField"),
29148 }
29149 }
29150 }
29151 impl ::std::str::FromStr for SignEvmTypedDataFieldCriterionType {
29152 type Err = self::error::ConversionError;
29153 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29154 match value {
29155 "evmTypedDataField" => Ok(Self::EvmTypedDataField),
29156 _ => Err("invalid value".into()),
29157 }
29158 }
29159 }
29160 impl ::std::convert::TryFrom<&str> for SignEvmTypedDataFieldCriterionType {
29161 type Error = self::error::ConversionError;
29162 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29163 value.parse()
29164 }
29165 }
29166 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTypedDataFieldCriterionType {
29167 type Error = self::error::ConversionError;
29168 fn try_from(
29169 value: &::std::string::String,
29170 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29171 value.parse()
29172 }
29173 }
29174 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTypedDataFieldCriterionType {
29175 type Error = self::error::ConversionError;
29176 fn try_from(
29177 value: ::std::string::String,
29178 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29179 value.parse()
29180 }
29181 }
29182 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
29260 pub struct SignEvmTypedDataFieldCriterionTypes {
29261 #[serde(rename = "primaryType")]
29263 pub primary_type: ::std::string::String,
29264 pub types: ::std::collections::HashMap<
29266 ::std::string::String,
29267 ::std::vec::Vec<SignEvmTypedDataFieldCriterionTypesTypesValueItem>,
29268 >,
29269 }
29270 impl ::std::convert::From<&SignEvmTypedDataFieldCriterionTypes>
29271 for SignEvmTypedDataFieldCriterionTypes
29272 {
29273 fn from(value: &SignEvmTypedDataFieldCriterionTypes) -> Self {
29274 value.clone()
29275 }
29276 }
29277 impl SignEvmTypedDataFieldCriterionTypes {
29278 pub fn builder() -> builder::SignEvmTypedDataFieldCriterionTypes {
29279 Default::default()
29280 }
29281 }
29282 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
29303 pub struct SignEvmTypedDataFieldCriterionTypesTypesValueItem {
29304 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
29306 pub name: ::std::option::Option<::std::string::String>,
29307 #[serde(
29309 rename = "type",
29310 default,
29311 skip_serializing_if = "::std::option::Option::is_none"
29312 )]
29313 pub type_: ::std::option::Option<::std::string::String>,
29314 }
29315 impl ::std::convert::From<&SignEvmTypedDataFieldCriterionTypesTypesValueItem>
29316 for SignEvmTypedDataFieldCriterionTypesTypesValueItem
29317 {
29318 fn from(value: &SignEvmTypedDataFieldCriterionTypesTypesValueItem) -> Self {
29319 value.clone()
29320 }
29321 }
29322 impl ::std::default::Default for SignEvmTypedDataFieldCriterionTypesTypesValueItem {
29323 fn default() -> Self {
29324 Self {
29325 name: Default::default(),
29326 type_: Default::default(),
29327 }
29328 }
29329 }
29330 impl SignEvmTypedDataFieldCriterionTypesTypesValueItem {
29331 pub fn builder() -> builder::SignEvmTypedDataFieldCriterionTypesTypesValueItem {
29332 Default::default()
29333 }
29334 }
29335 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
29358 pub struct SignEvmTypedDataResponse {
29359 pub signature: ::std::string::String,
29361 }
29362 impl ::std::convert::From<&SignEvmTypedDataResponse> for SignEvmTypedDataResponse {
29363 fn from(value: &SignEvmTypedDataResponse) -> Self {
29364 value.clone()
29365 }
29366 }
29367 impl SignEvmTypedDataResponse {
29368 pub fn builder() -> builder::SignEvmTypedDataResponse {
29369 Default::default()
29370 }
29371 }
29372 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
29415 pub struct SignEvmTypedDataRule {
29416 pub action: SignEvmTypedDataRuleAction,
29418 pub criteria: SignEvmTypedDataCriteria,
29419 pub operation: SignEvmTypedDataRuleOperation,
29421 }
29422 impl ::std::convert::From<&SignEvmTypedDataRule> for SignEvmTypedDataRule {
29423 fn from(value: &SignEvmTypedDataRule) -> Self {
29424 value.clone()
29425 }
29426 }
29427 impl SignEvmTypedDataRule {
29428 pub fn builder() -> builder::SignEvmTypedDataRule {
29429 Default::default()
29430 }
29431 }
29432 #[derive(
29451 ::serde::Deserialize,
29452 ::serde::Serialize,
29453 Clone,
29454 Copy,
29455 Debug,
29456 Eq,
29457 Hash,
29458 Ord,
29459 PartialEq,
29460 PartialOrd,
29461 )]
29462 pub enum SignEvmTypedDataRuleAction {
29463 #[serde(rename = "reject")]
29464 Reject,
29465 #[serde(rename = "accept")]
29466 Accept,
29467 }
29468 impl ::std::convert::From<&Self> for SignEvmTypedDataRuleAction {
29469 fn from(value: &SignEvmTypedDataRuleAction) -> Self {
29470 value.clone()
29471 }
29472 }
29473 impl ::std::fmt::Display for SignEvmTypedDataRuleAction {
29474 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
29475 match *self {
29476 Self::Reject => f.write_str("reject"),
29477 Self::Accept => f.write_str("accept"),
29478 }
29479 }
29480 }
29481 impl ::std::str::FromStr for SignEvmTypedDataRuleAction {
29482 type Err = self::error::ConversionError;
29483 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29484 match value {
29485 "reject" => Ok(Self::Reject),
29486 "accept" => Ok(Self::Accept),
29487 _ => Err("invalid value".into()),
29488 }
29489 }
29490 }
29491 impl ::std::convert::TryFrom<&str> for SignEvmTypedDataRuleAction {
29492 type Error = self::error::ConversionError;
29493 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29494 value.parse()
29495 }
29496 }
29497 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTypedDataRuleAction {
29498 type Error = self::error::ConversionError;
29499 fn try_from(
29500 value: &::std::string::String,
29501 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29502 value.parse()
29503 }
29504 }
29505 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTypedDataRuleAction {
29506 type Error = self::error::ConversionError;
29507 fn try_from(
29508 value: ::std::string::String,
29509 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29510 value.parse()
29511 }
29512 }
29513 #[derive(
29531 ::serde::Deserialize,
29532 ::serde::Serialize,
29533 Clone,
29534 Copy,
29535 Debug,
29536 Eq,
29537 Hash,
29538 Ord,
29539 PartialEq,
29540 PartialOrd,
29541 )]
29542 pub enum SignEvmTypedDataRuleOperation {
29543 #[serde(rename = "signEvmTypedData")]
29544 SignEvmTypedData,
29545 }
29546 impl ::std::convert::From<&Self> for SignEvmTypedDataRuleOperation {
29547 fn from(value: &SignEvmTypedDataRuleOperation) -> Self {
29548 value.clone()
29549 }
29550 }
29551 impl ::std::fmt::Display for SignEvmTypedDataRuleOperation {
29552 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
29553 match *self {
29554 Self::SignEvmTypedData => f.write_str("signEvmTypedData"),
29555 }
29556 }
29557 }
29558 impl ::std::str::FromStr for SignEvmTypedDataRuleOperation {
29559 type Err = self::error::ConversionError;
29560 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29561 match value {
29562 "signEvmTypedData" => Ok(Self::SignEvmTypedData),
29563 _ => Err("invalid value".into()),
29564 }
29565 }
29566 }
29567 impl ::std::convert::TryFrom<&str> for SignEvmTypedDataRuleOperation {
29568 type Error = self::error::ConversionError;
29569 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29570 value.parse()
29571 }
29572 }
29573 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTypedDataRuleOperation {
29574 type Error = self::error::ConversionError;
29575 fn try_from(
29576 value: &::std::string::String,
29577 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29578 value.parse()
29579 }
29580 }
29581 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTypedDataRuleOperation {
29582 type Error = self::error::ConversionError;
29583 fn try_from(
29584 value: ::std::string::String,
29585 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29586 value.parse()
29587 }
29588 }
29589 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
29646 pub struct SignEvmTypedDataVerifyingContractCriterion {
29647 pub addresses: ::std::vec::Vec<SignEvmTypedDataVerifyingContractCriterionAddressesItem>,
29649 pub operator: SignEvmTypedDataVerifyingContractCriterionOperator,
29651 #[serde(rename = "type")]
29653 pub type_: SignEvmTypedDataVerifyingContractCriterionType,
29654 }
29655 impl ::std::convert::From<&SignEvmTypedDataVerifyingContractCriterion>
29656 for SignEvmTypedDataVerifyingContractCriterion
29657 {
29658 fn from(value: &SignEvmTypedDataVerifyingContractCriterion) -> Self {
29659 value.clone()
29660 }
29661 }
29662 impl SignEvmTypedDataVerifyingContractCriterion {
29663 pub fn builder() -> builder::SignEvmTypedDataVerifyingContractCriterion {
29664 Default::default()
29665 }
29666 }
29667 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29680 #[serde(transparent)]
29681 pub struct SignEvmTypedDataVerifyingContractCriterionAddressesItem(::std::string::String);
29682 impl ::std::ops::Deref for SignEvmTypedDataVerifyingContractCriterionAddressesItem {
29683 type Target = ::std::string::String;
29684 fn deref(&self) -> &::std::string::String {
29685 &self.0
29686 }
29687 }
29688 impl ::std::convert::From<SignEvmTypedDataVerifyingContractCriterionAddressesItem>
29689 for ::std::string::String
29690 {
29691 fn from(value: SignEvmTypedDataVerifyingContractCriterionAddressesItem) -> Self {
29692 value.0
29693 }
29694 }
29695 impl ::std::convert::From<&SignEvmTypedDataVerifyingContractCriterionAddressesItem>
29696 for SignEvmTypedDataVerifyingContractCriterionAddressesItem
29697 {
29698 fn from(value: &SignEvmTypedDataVerifyingContractCriterionAddressesItem) -> Self {
29699 value.clone()
29700 }
29701 }
29702 impl ::std::str::FromStr for SignEvmTypedDataVerifyingContractCriterionAddressesItem {
29703 type Err = self::error::ConversionError;
29704 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29705 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
29706 ::std::sync::LazyLock::new(|| {
29707 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
29708 });
29709 if PATTERN.find(value).is_none() {
29710 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
29711 }
29712 Ok(Self(value.to_string()))
29713 }
29714 }
29715 impl ::std::convert::TryFrom<&str> for SignEvmTypedDataVerifyingContractCriterionAddressesItem {
29716 type Error = self::error::ConversionError;
29717 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29718 value.parse()
29719 }
29720 }
29721 impl ::std::convert::TryFrom<&::std::string::String>
29722 for SignEvmTypedDataVerifyingContractCriterionAddressesItem
29723 {
29724 type Error = self::error::ConversionError;
29725 fn try_from(
29726 value: &::std::string::String,
29727 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29728 value.parse()
29729 }
29730 }
29731 impl ::std::convert::TryFrom<::std::string::String>
29732 for SignEvmTypedDataVerifyingContractCriterionAddressesItem
29733 {
29734 type Error = self::error::ConversionError;
29735 fn try_from(
29736 value: ::std::string::String,
29737 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29738 value.parse()
29739 }
29740 }
29741 impl<'de> ::serde::Deserialize<'de> for SignEvmTypedDataVerifyingContractCriterionAddressesItem {
29742 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
29743 where
29744 D: ::serde::Deserializer<'de>,
29745 {
29746 ::std::string::String::deserialize(deserializer)?
29747 .parse()
29748 .map_err(|e: self::error::ConversionError| {
29749 <D::Error as ::serde::de::Error>::custom(e.to_string())
29750 })
29751 }
29752 }
29753 #[derive(
29772 ::serde::Deserialize,
29773 ::serde::Serialize,
29774 Clone,
29775 Copy,
29776 Debug,
29777 Eq,
29778 Hash,
29779 Ord,
29780 PartialEq,
29781 PartialOrd,
29782 )]
29783 pub enum SignEvmTypedDataVerifyingContractCriterionOperator {
29784 #[serde(rename = "in")]
29785 In,
29786 #[serde(rename = "not in")]
29787 NotIn,
29788 }
29789 impl ::std::convert::From<&Self> for SignEvmTypedDataVerifyingContractCriterionOperator {
29790 fn from(value: &SignEvmTypedDataVerifyingContractCriterionOperator) -> Self {
29791 value.clone()
29792 }
29793 }
29794 impl ::std::fmt::Display for SignEvmTypedDataVerifyingContractCriterionOperator {
29795 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
29796 match *self {
29797 Self::In => f.write_str("in"),
29798 Self::NotIn => f.write_str("not in"),
29799 }
29800 }
29801 }
29802 impl ::std::str::FromStr for SignEvmTypedDataVerifyingContractCriterionOperator {
29803 type Err = self::error::ConversionError;
29804 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29805 match value {
29806 "in" => Ok(Self::In),
29807 "not in" => Ok(Self::NotIn),
29808 _ => Err("invalid value".into()),
29809 }
29810 }
29811 }
29812 impl ::std::convert::TryFrom<&str> for SignEvmTypedDataVerifyingContractCriterionOperator {
29813 type Error = self::error::ConversionError;
29814 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29815 value.parse()
29816 }
29817 }
29818 impl ::std::convert::TryFrom<&::std::string::String>
29819 for SignEvmTypedDataVerifyingContractCriterionOperator
29820 {
29821 type Error = self::error::ConversionError;
29822 fn try_from(
29823 value: &::std::string::String,
29824 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29825 value.parse()
29826 }
29827 }
29828 impl ::std::convert::TryFrom<::std::string::String>
29829 for SignEvmTypedDataVerifyingContractCriterionOperator
29830 {
29831 type Error = self::error::ConversionError;
29832 fn try_from(
29833 value: ::std::string::String,
29834 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29835 value.parse()
29836 }
29837 }
29838 #[derive(
29856 ::serde::Deserialize,
29857 ::serde::Serialize,
29858 Clone,
29859 Copy,
29860 Debug,
29861 Eq,
29862 Hash,
29863 Ord,
29864 PartialEq,
29865 PartialOrd,
29866 )]
29867 pub enum SignEvmTypedDataVerifyingContractCriterionType {
29868 #[serde(rename = "evmTypedDataVerifyingContract")]
29869 EvmTypedDataVerifyingContract,
29870 }
29871 impl ::std::convert::From<&Self> for SignEvmTypedDataVerifyingContractCriterionType {
29872 fn from(value: &SignEvmTypedDataVerifyingContractCriterionType) -> Self {
29873 value.clone()
29874 }
29875 }
29876 impl ::std::fmt::Display for SignEvmTypedDataVerifyingContractCriterionType {
29877 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
29878 match *self {
29879 Self::EvmTypedDataVerifyingContract => f.write_str("evmTypedDataVerifyingContract"),
29880 }
29881 }
29882 }
29883 impl ::std::str::FromStr for SignEvmTypedDataVerifyingContractCriterionType {
29884 type Err = self::error::ConversionError;
29885 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29886 match value {
29887 "evmTypedDataVerifyingContract" => Ok(Self::EvmTypedDataVerifyingContract),
29888 _ => Err("invalid value".into()),
29889 }
29890 }
29891 }
29892 impl ::std::convert::TryFrom<&str> for SignEvmTypedDataVerifyingContractCriterionType {
29893 type Error = self::error::ConversionError;
29894 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29895 value.parse()
29896 }
29897 }
29898 impl ::std::convert::TryFrom<&::std::string::String>
29899 for SignEvmTypedDataVerifyingContractCriterionType
29900 {
29901 type Error = self::error::ConversionError;
29902 fn try_from(
29903 value: &::std::string::String,
29904 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29905 value.parse()
29906 }
29907 }
29908 impl ::std::convert::TryFrom<::std::string::String>
29909 for SignEvmTypedDataVerifyingContractCriterionType
29910 {
29911 type Error = self::error::ConversionError;
29912 fn try_from(
29913 value: ::std::string::String,
29914 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29915 value.parse()
29916 }
29917 }
29918 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29932 #[serde(transparent)]
29933 pub struct SignEvmTypedDataXIdempotencyKey(::std::string::String);
29934 impl ::std::ops::Deref for SignEvmTypedDataXIdempotencyKey {
29935 type Target = ::std::string::String;
29936 fn deref(&self) -> &::std::string::String {
29937 &self.0
29938 }
29939 }
29940 impl ::std::convert::From<SignEvmTypedDataXIdempotencyKey> for ::std::string::String {
29941 fn from(value: SignEvmTypedDataXIdempotencyKey) -> Self {
29942 value.0
29943 }
29944 }
29945 impl ::std::convert::From<&SignEvmTypedDataXIdempotencyKey> for SignEvmTypedDataXIdempotencyKey {
29946 fn from(value: &SignEvmTypedDataXIdempotencyKey) -> Self {
29947 value.clone()
29948 }
29949 }
29950 impl ::std::str::FromStr for SignEvmTypedDataXIdempotencyKey {
29951 type Err = self::error::ConversionError;
29952 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29953 if value.chars().count() > 36usize {
29954 return Err("longer than 36 characters".into());
29955 }
29956 if value.chars().count() < 36usize {
29957 return Err("shorter than 36 characters".into());
29958 }
29959 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
29960 ::std::sync::LazyLock::new(|| {
29961 ::regress::Regex::new(
29962 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
29963 )
29964 .unwrap()
29965 });
29966 if PATTERN.find(value).is_none() {
29967 return Err(
29968 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
29969 .into(),
29970 );
29971 }
29972 Ok(Self(value.to_string()))
29973 }
29974 }
29975 impl ::std::convert::TryFrom<&str> for SignEvmTypedDataXIdempotencyKey {
29976 type Error = self::error::ConversionError;
29977 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
29978 value.parse()
29979 }
29980 }
29981 impl ::std::convert::TryFrom<&::std::string::String> for SignEvmTypedDataXIdempotencyKey {
29982 type Error = self::error::ConversionError;
29983 fn try_from(
29984 value: &::std::string::String,
29985 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29986 value.parse()
29987 }
29988 }
29989 impl ::std::convert::TryFrom<::std::string::String> for SignEvmTypedDataXIdempotencyKey {
29990 type Error = self::error::ConversionError;
29991 fn try_from(
29992 value: ::std::string::String,
29993 ) -> ::std::result::Result<Self, self::error::ConversionError> {
29994 value.parse()
29995 }
29996 }
29997 impl<'de> ::serde::Deserialize<'de> for SignEvmTypedDataXIdempotencyKey {
29998 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
29999 where
30000 D: ::serde::Deserializer<'de>,
30001 {
30002 ::std::string::String::deserialize(deserializer)?
30003 .parse()
30004 .map_err(|e: self::error::ConversionError| {
30005 <D::Error as ::serde::de::Error>::custom(e.to_string())
30006 })
30007 }
30008 }
30009 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
30037 #[serde(transparent)]
30038 pub struct SignSolMessageCriteria(pub ::std::vec::Vec<SolMessageCriterion>);
30039 impl ::std::ops::Deref for SignSolMessageCriteria {
30040 type Target = ::std::vec::Vec<SolMessageCriterion>;
30041 fn deref(&self) -> &::std::vec::Vec<SolMessageCriterion> {
30042 &self.0
30043 }
30044 }
30045 impl ::std::convert::From<SignSolMessageCriteria> for ::std::vec::Vec<SolMessageCriterion> {
30046 fn from(value: SignSolMessageCriteria) -> Self {
30047 value.0
30048 }
30049 }
30050 impl ::std::convert::From<&SignSolMessageCriteria> for SignSolMessageCriteria {
30051 fn from(value: &SignSolMessageCriteria) -> Self {
30052 value.clone()
30053 }
30054 }
30055 impl ::std::convert::From<::std::vec::Vec<SolMessageCriterion>> for SignSolMessageCriteria {
30056 fn from(value: ::std::vec::Vec<SolMessageCriterion>) -> Self {
30057 Self(value)
30058 }
30059 }
30060 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
30103 pub struct SignSolMessageRule {
30104 pub action: SignSolMessageRuleAction,
30106 pub criteria: SignSolMessageCriteria,
30107 pub operation: SignSolMessageRuleOperation,
30109 }
30110 impl ::std::convert::From<&SignSolMessageRule> for SignSolMessageRule {
30111 fn from(value: &SignSolMessageRule) -> Self {
30112 value.clone()
30113 }
30114 }
30115 impl SignSolMessageRule {
30116 pub fn builder() -> builder::SignSolMessageRule {
30117 Default::default()
30118 }
30119 }
30120 #[derive(
30139 ::serde::Deserialize,
30140 ::serde::Serialize,
30141 Clone,
30142 Copy,
30143 Debug,
30144 Eq,
30145 Hash,
30146 Ord,
30147 PartialEq,
30148 PartialOrd,
30149 )]
30150 pub enum SignSolMessageRuleAction {
30151 #[serde(rename = "reject")]
30152 Reject,
30153 #[serde(rename = "accept")]
30154 Accept,
30155 }
30156 impl ::std::convert::From<&Self> for SignSolMessageRuleAction {
30157 fn from(value: &SignSolMessageRuleAction) -> Self {
30158 value.clone()
30159 }
30160 }
30161 impl ::std::fmt::Display for SignSolMessageRuleAction {
30162 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30163 match *self {
30164 Self::Reject => f.write_str("reject"),
30165 Self::Accept => f.write_str("accept"),
30166 }
30167 }
30168 }
30169 impl ::std::str::FromStr for SignSolMessageRuleAction {
30170 type Err = self::error::ConversionError;
30171 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30172 match value {
30173 "reject" => Ok(Self::Reject),
30174 "accept" => Ok(Self::Accept),
30175 _ => Err("invalid value".into()),
30176 }
30177 }
30178 }
30179 impl ::std::convert::TryFrom<&str> for SignSolMessageRuleAction {
30180 type Error = self::error::ConversionError;
30181 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30182 value.parse()
30183 }
30184 }
30185 impl ::std::convert::TryFrom<&::std::string::String> for SignSolMessageRuleAction {
30186 type Error = self::error::ConversionError;
30187 fn try_from(
30188 value: &::std::string::String,
30189 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30190 value.parse()
30191 }
30192 }
30193 impl ::std::convert::TryFrom<::std::string::String> for SignSolMessageRuleAction {
30194 type Error = self::error::ConversionError;
30195 fn try_from(
30196 value: ::std::string::String,
30197 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30198 value.parse()
30199 }
30200 }
30201 #[derive(
30219 ::serde::Deserialize,
30220 ::serde::Serialize,
30221 Clone,
30222 Copy,
30223 Debug,
30224 Eq,
30225 Hash,
30226 Ord,
30227 PartialEq,
30228 PartialOrd,
30229 )]
30230 pub enum SignSolMessageRuleOperation {
30231 #[serde(rename = "signSolMessage")]
30232 SignSolMessage,
30233 }
30234 impl ::std::convert::From<&Self> for SignSolMessageRuleOperation {
30235 fn from(value: &SignSolMessageRuleOperation) -> Self {
30236 value.clone()
30237 }
30238 }
30239 impl ::std::fmt::Display for SignSolMessageRuleOperation {
30240 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30241 match *self {
30242 Self::SignSolMessage => f.write_str("signSolMessage"),
30243 }
30244 }
30245 }
30246 impl ::std::str::FromStr for SignSolMessageRuleOperation {
30247 type Err = self::error::ConversionError;
30248 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30249 match value {
30250 "signSolMessage" => Ok(Self::SignSolMessage),
30251 _ => Err("invalid value".into()),
30252 }
30253 }
30254 }
30255 impl ::std::convert::TryFrom<&str> for SignSolMessageRuleOperation {
30256 type Error = self::error::ConversionError;
30257 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30258 value.parse()
30259 }
30260 }
30261 impl ::std::convert::TryFrom<&::std::string::String> for SignSolMessageRuleOperation {
30262 type Error = self::error::ConversionError;
30263 fn try_from(
30264 value: &::std::string::String,
30265 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30266 value.parse()
30267 }
30268 }
30269 impl ::std::convert::TryFrom<::std::string::String> for SignSolMessageRuleOperation {
30270 type Error = self::error::ConversionError;
30271 fn try_from(
30272 value: ::std::string::String,
30273 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30274 value.parse()
30275 }
30276 }
30277 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
30326 #[serde(transparent)]
30327 pub struct SignSolTransactionCriteria(pub ::std::vec::Vec<SignSolTransactionCriteriaItem>);
30328 impl ::std::ops::Deref for SignSolTransactionCriteria {
30329 type Target = ::std::vec::Vec<SignSolTransactionCriteriaItem>;
30330 fn deref(&self) -> &::std::vec::Vec<SignSolTransactionCriteriaItem> {
30331 &self.0
30332 }
30333 }
30334 impl ::std::convert::From<SignSolTransactionCriteria>
30335 for ::std::vec::Vec<SignSolTransactionCriteriaItem>
30336 {
30337 fn from(value: SignSolTransactionCriteria) -> Self {
30338 value.0
30339 }
30340 }
30341 impl ::std::convert::From<&SignSolTransactionCriteria> for SignSolTransactionCriteria {
30342 fn from(value: &SignSolTransactionCriteria) -> Self {
30343 value.clone()
30344 }
30345 }
30346 impl ::std::convert::From<::std::vec::Vec<SignSolTransactionCriteriaItem>>
30347 for SignSolTransactionCriteria
30348 {
30349 fn from(value: ::std::vec::Vec<SignSolTransactionCriteriaItem>) -> Self {
30350 Self(value)
30351 }
30352 }
30353 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
30386 #[serde(untagged)]
30387 pub enum SignSolTransactionCriteriaItem {
30388 SolAddressCriterion(SolAddressCriterion),
30389 SolValueCriterion(SolValueCriterion),
30390 SplAddressCriterion(SplAddressCriterion),
30391 SplValueCriterion(SplValueCriterion),
30392 MintAddressCriterion(MintAddressCriterion),
30393 SolDataCriterion(SolDataCriterion),
30394 ProgramIdCriterion(ProgramIdCriterion),
30395 }
30396 impl ::std::convert::From<&Self> for SignSolTransactionCriteriaItem {
30397 fn from(value: &SignSolTransactionCriteriaItem) -> Self {
30398 value.clone()
30399 }
30400 }
30401 impl ::std::convert::From<SolAddressCriterion> for SignSolTransactionCriteriaItem {
30402 fn from(value: SolAddressCriterion) -> Self {
30403 Self::SolAddressCriterion(value)
30404 }
30405 }
30406 impl ::std::convert::From<SolValueCriterion> for SignSolTransactionCriteriaItem {
30407 fn from(value: SolValueCriterion) -> Self {
30408 Self::SolValueCriterion(value)
30409 }
30410 }
30411 impl ::std::convert::From<SplAddressCriterion> for SignSolTransactionCriteriaItem {
30412 fn from(value: SplAddressCriterion) -> Self {
30413 Self::SplAddressCriterion(value)
30414 }
30415 }
30416 impl ::std::convert::From<SplValueCriterion> for SignSolTransactionCriteriaItem {
30417 fn from(value: SplValueCriterion) -> Self {
30418 Self::SplValueCriterion(value)
30419 }
30420 }
30421 impl ::std::convert::From<MintAddressCriterion> for SignSolTransactionCriteriaItem {
30422 fn from(value: MintAddressCriterion) -> Self {
30423 Self::MintAddressCriterion(value)
30424 }
30425 }
30426 impl ::std::convert::From<SolDataCriterion> for SignSolTransactionCriteriaItem {
30427 fn from(value: SolDataCriterion) -> Self {
30428 Self::SolDataCriterion(value)
30429 }
30430 }
30431 impl ::std::convert::From<ProgramIdCriterion> for SignSolTransactionCriteriaItem {
30432 fn from(value: ProgramIdCriterion) -> Self {
30433 Self::ProgramIdCriterion(value)
30434 }
30435 }
30436 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
30478 pub struct SignSolTransactionRule {
30479 pub action: SignSolTransactionRuleAction,
30481 pub criteria: SignSolTransactionCriteria,
30482 pub operation: SignSolTransactionRuleOperation,
30484 }
30485 impl ::std::convert::From<&SignSolTransactionRule> for SignSolTransactionRule {
30486 fn from(value: &SignSolTransactionRule) -> Self {
30487 value.clone()
30488 }
30489 }
30490 impl SignSolTransactionRule {
30491 pub fn builder() -> builder::SignSolTransactionRule {
30492 Default::default()
30493 }
30494 }
30495 #[derive(
30514 ::serde::Deserialize,
30515 ::serde::Serialize,
30516 Clone,
30517 Copy,
30518 Debug,
30519 Eq,
30520 Hash,
30521 Ord,
30522 PartialEq,
30523 PartialOrd,
30524 )]
30525 pub enum SignSolTransactionRuleAction {
30526 #[serde(rename = "reject")]
30527 Reject,
30528 #[serde(rename = "accept")]
30529 Accept,
30530 }
30531 impl ::std::convert::From<&Self> for SignSolTransactionRuleAction {
30532 fn from(value: &SignSolTransactionRuleAction) -> Self {
30533 value.clone()
30534 }
30535 }
30536 impl ::std::fmt::Display for SignSolTransactionRuleAction {
30537 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30538 match *self {
30539 Self::Reject => f.write_str("reject"),
30540 Self::Accept => f.write_str("accept"),
30541 }
30542 }
30543 }
30544 impl ::std::str::FromStr for SignSolTransactionRuleAction {
30545 type Err = self::error::ConversionError;
30546 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30547 match value {
30548 "reject" => Ok(Self::Reject),
30549 "accept" => Ok(Self::Accept),
30550 _ => Err("invalid value".into()),
30551 }
30552 }
30553 }
30554 impl ::std::convert::TryFrom<&str> for SignSolTransactionRuleAction {
30555 type Error = self::error::ConversionError;
30556 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30557 value.parse()
30558 }
30559 }
30560 impl ::std::convert::TryFrom<&::std::string::String> for SignSolTransactionRuleAction {
30561 type Error = self::error::ConversionError;
30562 fn try_from(
30563 value: &::std::string::String,
30564 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30565 value.parse()
30566 }
30567 }
30568 impl ::std::convert::TryFrom<::std::string::String> for SignSolTransactionRuleAction {
30569 type Error = self::error::ConversionError;
30570 fn try_from(
30571 value: ::std::string::String,
30572 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30573 value.parse()
30574 }
30575 }
30576 #[derive(
30594 ::serde::Deserialize,
30595 ::serde::Serialize,
30596 Clone,
30597 Copy,
30598 Debug,
30599 Eq,
30600 Hash,
30601 Ord,
30602 PartialEq,
30603 PartialOrd,
30604 )]
30605 pub enum SignSolTransactionRuleOperation {
30606 #[serde(rename = "signSolTransaction")]
30607 SignSolTransaction,
30608 }
30609 impl ::std::convert::From<&Self> for SignSolTransactionRuleOperation {
30610 fn from(value: &SignSolTransactionRuleOperation) -> Self {
30611 value.clone()
30612 }
30613 }
30614 impl ::std::fmt::Display for SignSolTransactionRuleOperation {
30615 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30616 match *self {
30617 Self::SignSolTransaction => f.write_str("signSolTransaction"),
30618 }
30619 }
30620 }
30621 impl ::std::str::FromStr for SignSolTransactionRuleOperation {
30622 type Err = self::error::ConversionError;
30623 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30624 match value {
30625 "signSolTransaction" => Ok(Self::SignSolTransaction),
30626 _ => Err("invalid value".into()),
30627 }
30628 }
30629 }
30630 impl ::std::convert::TryFrom<&str> for SignSolTransactionRuleOperation {
30631 type Error = self::error::ConversionError;
30632 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30633 value.parse()
30634 }
30635 }
30636 impl ::std::convert::TryFrom<&::std::string::String> for SignSolTransactionRuleOperation {
30637 type Error = self::error::ConversionError;
30638 fn try_from(
30639 value: &::std::string::String,
30640 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30641 value.parse()
30642 }
30643 }
30644 impl ::std::convert::TryFrom<::std::string::String> for SignSolTransactionRuleOperation {
30645 type Error = self::error::ConversionError;
30646 fn try_from(
30647 value: ::std::string::String,
30648 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30649 value.parse()
30650 }
30651 }
30652 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
30664 #[serde(transparent)]
30665 pub struct SignSolanaMessageAddress(::std::string::String);
30666 impl ::std::ops::Deref for SignSolanaMessageAddress {
30667 type Target = ::std::string::String;
30668 fn deref(&self) -> &::std::string::String {
30669 &self.0
30670 }
30671 }
30672 impl ::std::convert::From<SignSolanaMessageAddress> for ::std::string::String {
30673 fn from(value: SignSolanaMessageAddress) -> Self {
30674 value.0
30675 }
30676 }
30677 impl ::std::convert::From<&SignSolanaMessageAddress> for SignSolanaMessageAddress {
30678 fn from(value: &SignSolanaMessageAddress) -> Self {
30679 value.clone()
30680 }
30681 }
30682 impl ::std::str::FromStr for SignSolanaMessageAddress {
30683 type Err = self::error::ConversionError;
30684 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30685 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
30686 ::std::sync::LazyLock::new(|| {
30687 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
30688 });
30689 if PATTERN.find(value).is_none() {
30690 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
30691 }
30692 Ok(Self(value.to_string()))
30693 }
30694 }
30695 impl ::std::convert::TryFrom<&str> for SignSolanaMessageAddress {
30696 type Error = self::error::ConversionError;
30697 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30698 value.parse()
30699 }
30700 }
30701 impl ::std::convert::TryFrom<&::std::string::String> for SignSolanaMessageAddress {
30702 type Error = self::error::ConversionError;
30703 fn try_from(
30704 value: &::std::string::String,
30705 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30706 value.parse()
30707 }
30708 }
30709 impl ::std::convert::TryFrom<::std::string::String> for SignSolanaMessageAddress {
30710 type Error = self::error::ConversionError;
30711 fn try_from(
30712 value: ::std::string::String,
30713 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30714 value.parse()
30715 }
30716 }
30717 impl<'de> ::serde::Deserialize<'de> for SignSolanaMessageAddress {
30718 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
30719 where
30720 D: ::serde::Deserializer<'de>,
30721 {
30722 ::std::string::String::deserialize(deserializer)?
30723 .parse()
30724 .map_err(|e: self::error::ConversionError| {
30725 <D::Error as ::serde::de::Error>::custom(e.to_string())
30726 })
30727 }
30728 }
30729 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
30752 pub struct SignSolanaMessageBody {
30753 pub message: ::std::string::String,
30755 }
30756 impl ::std::convert::From<&SignSolanaMessageBody> for SignSolanaMessageBody {
30757 fn from(value: &SignSolanaMessageBody) -> Self {
30758 value.clone()
30759 }
30760 }
30761 impl SignSolanaMessageBody {
30762 pub fn builder() -> builder::SignSolanaMessageBody {
30763 Default::default()
30764 }
30765 }
30766 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
30789 pub struct SignSolanaMessageResponse {
30790 pub signature: ::std::string::String,
30792 }
30793 impl ::std::convert::From<&SignSolanaMessageResponse> for SignSolanaMessageResponse {
30794 fn from(value: &SignSolanaMessageResponse) -> Self {
30795 value.clone()
30796 }
30797 }
30798 impl SignSolanaMessageResponse {
30799 pub fn builder() -> builder::SignSolanaMessageResponse {
30800 Default::default()
30801 }
30802 }
30803 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
30817 #[serde(transparent)]
30818 pub struct SignSolanaMessageXIdempotencyKey(::std::string::String);
30819 impl ::std::ops::Deref for SignSolanaMessageXIdempotencyKey {
30820 type Target = ::std::string::String;
30821 fn deref(&self) -> &::std::string::String {
30822 &self.0
30823 }
30824 }
30825 impl ::std::convert::From<SignSolanaMessageXIdempotencyKey> for ::std::string::String {
30826 fn from(value: SignSolanaMessageXIdempotencyKey) -> Self {
30827 value.0
30828 }
30829 }
30830 impl ::std::convert::From<&SignSolanaMessageXIdempotencyKey> for SignSolanaMessageXIdempotencyKey {
30831 fn from(value: &SignSolanaMessageXIdempotencyKey) -> Self {
30832 value.clone()
30833 }
30834 }
30835 impl ::std::str::FromStr for SignSolanaMessageXIdempotencyKey {
30836 type Err = self::error::ConversionError;
30837 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30838 if value.chars().count() > 36usize {
30839 return Err("longer than 36 characters".into());
30840 }
30841 if value.chars().count() < 36usize {
30842 return Err("shorter than 36 characters".into());
30843 }
30844 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
30845 ::std::sync::LazyLock::new(|| {
30846 ::regress::Regex::new(
30847 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
30848 )
30849 .unwrap()
30850 });
30851 if PATTERN.find(value).is_none() {
30852 return Err(
30853 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
30854 .into(),
30855 );
30856 }
30857 Ok(Self(value.to_string()))
30858 }
30859 }
30860 impl ::std::convert::TryFrom<&str> for SignSolanaMessageXIdempotencyKey {
30861 type Error = self::error::ConversionError;
30862 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30863 value.parse()
30864 }
30865 }
30866 impl ::std::convert::TryFrom<&::std::string::String> for SignSolanaMessageXIdempotencyKey {
30867 type Error = self::error::ConversionError;
30868 fn try_from(
30869 value: &::std::string::String,
30870 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30871 value.parse()
30872 }
30873 }
30874 impl ::std::convert::TryFrom<::std::string::String> for SignSolanaMessageXIdempotencyKey {
30875 type Error = self::error::ConversionError;
30876 fn try_from(
30877 value: ::std::string::String,
30878 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30879 value.parse()
30880 }
30881 }
30882 impl<'de> ::serde::Deserialize<'de> for SignSolanaMessageXIdempotencyKey {
30883 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
30884 where
30885 D: ::serde::Deserializer<'de>,
30886 {
30887 ::std::string::String::deserialize(deserializer)?
30888 .parse()
30889 .map_err(|e: self::error::ConversionError| {
30890 <D::Error as ::serde::de::Error>::custom(e.to_string())
30891 })
30892 }
30893 }
30894 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
30906 #[serde(transparent)]
30907 pub struct SignSolanaTransactionAddress(::std::string::String);
30908 impl ::std::ops::Deref for SignSolanaTransactionAddress {
30909 type Target = ::std::string::String;
30910 fn deref(&self) -> &::std::string::String {
30911 &self.0
30912 }
30913 }
30914 impl ::std::convert::From<SignSolanaTransactionAddress> for ::std::string::String {
30915 fn from(value: SignSolanaTransactionAddress) -> Self {
30916 value.0
30917 }
30918 }
30919 impl ::std::convert::From<&SignSolanaTransactionAddress> for SignSolanaTransactionAddress {
30920 fn from(value: &SignSolanaTransactionAddress) -> Self {
30921 value.clone()
30922 }
30923 }
30924 impl ::std::str::FromStr for SignSolanaTransactionAddress {
30925 type Err = self::error::ConversionError;
30926 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30927 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
30928 ::std::sync::LazyLock::new(|| {
30929 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
30930 });
30931 if PATTERN.find(value).is_none() {
30932 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
30933 }
30934 Ok(Self(value.to_string()))
30935 }
30936 }
30937 impl ::std::convert::TryFrom<&str> for SignSolanaTransactionAddress {
30938 type Error = self::error::ConversionError;
30939 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
30940 value.parse()
30941 }
30942 }
30943 impl ::std::convert::TryFrom<&::std::string::String> for SignSolanaTransactionAddress {
30944 type Error = self::error::ConversionError;
30945 fn try_from(
30946 value: &::std::string::String,
30947 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30948 value.parse()
30949 }
30950 }
30951 impl ::std::convert::TryFrom<::std::string::String> for SignSolanaTransactionAddress {
30952 type Error = self::error::ConversionError;
30953 fn try_from(
30954 value: ::std::string::String,
30955 ) -> ::std::result::Result<Self, self::error::ConversionError> {
30956 value.parse()
30957 }
30958 }
30959 impl<'de> ::serde::Deserialize<'de> for SignSolanaTransactionAddress {
30960 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
30961 where
30962 D: ::serde::Deserializer<'de>,
30963 {
30964 ::std::string::String::deserialize(deserializer)?
30965 .parse()
30966 .map_err(|e: self::error::ConversionError| {
30967 <D::Error as ::serde::de::Error>::custom(e.to_string())
30968 })
30969 }
30970 }
30971 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
30994 pub struct SignSolanaTransactionBody {
30995 pub transaction: ::std::string::String,
30997 }
30998 impl ::std::convert::From<&SignSolanaTransactionBody> for SignSolanaTransactionBody {
30999 fn from(value: &SignSolanaTransactionBody) -> Self {
31000 value.clone()
31001 }
31002 }
31003 impl SignSolanaTransactionBody {
31004 pub fn builder() -> builder::SignSolanaTransactionBody {
31005 Default::default()
31006 }
31007 }
31008 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
31031 pub struct SignSolanaTransactionResponse {
31032 #[serde(rename = "signedTransaction")]
31034 pub signed_transaction: ::std::string::String,
31035 }
31036 impl ::std::convert::From<&SignSolanaTransactionResponse> for SignSolanaTransactionResponse {
31037 fn from(value: &SignSolanaTransactionResponse) -> Self {
31038 value.clone()
31039 }
31040 }
31041 impl SignSolanaTransactionResponse {
31042 pub fn builder() -> builder::SignSolanaTransactionResponse {
31043 Default::default()
31044 }
31045 }
31046 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31060 #[serde(transparent)]
31061 pub struct SignSolanaTransactionXIdempotencyKey(::std::string::String);
31062 impl ::std::ops::Deref for SignSolanaTransactionXIdempotencyKey {
31063 type Target = ::std::string::String;
31064 fn deref(&self) -> &::std::string::String {
31065 &self.0
31066 }
31067 }
31068 impl ::std::convert::From<SignSolanaTransactionXIdempotencyKey> for ::std::string::String {
31069 fn from(value: SignSolanaTransactionXIdempotencyKey) -> Self {
31070 value.0
31071 }
31072 }
31073 impl ::std::convert::From<&SignSolanaTransactionXIdempotencyKey>
31074 for SignSolanaTransactionXIdempotencyKey
31075 {
31076 fn from(value: &SignSolanaTransactionXIdempotencyKey) -> Self {
31077 value.clone()
31078 }
31079 }
31080 impl ::std::str::FromStr for SignSolanaTransactionXIdempotencyKey {
31081 type Err = self::error::ConversionError;
31082 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31083 if value.chars().count() > 36usize {
31084 return Err("longer than 36 characters".into());
31085 }
31086 if value.chars().count() < 36usize {
31087 return Err("shorter than 36 characters".into());
31088 }
31089 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
31090 ::std::sync::LazyLock::new(|| {
31091 ::regress::Regex::new(
31092 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
31093 )
31094 .unwrap()
31095 });
31096 if PATTERN.find(value).is_none() {
31097 return Err(
31098 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
31099 .into(),
31100 );
31101 }
31102 Ok(Self(value.to_string()))
31103 }
31104 }
31105 impl ::std::convert::TryFrom<&str> for SignSolanaTransactionXIdempotencyKey {
31106 type Error = self::error::ConversionError;
31107 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31108 value.parse()
31109 }
31110 }
31111 impl ::std::convert::TryFrom<&::std::string::String> for SignSolanaTransactionXIdempotencyKey {
31112 type Error = self::error::ConversionError;
31113 fn try_from(
31114 value: &::std::string::String,
31115 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31116 value.parse()
31117 }
31118 }
31119 impl ::std::convert::TryFrom<::std::string::String> for SignSolanaTransactionXIdempotencyKey {
31120 type Error = self::error::ConversionError;
31121 fn try_from(
31122 value: ::std::string::String,
31123 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31124 value.parse()
31125 }
31126 }
31127 impl<'de> ::serde::Deserialize<'de> for SignSolanaTransactionXIdempotencyKey {
31128 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
31129 where
31130 D: ::serde::Deserializer<'de>,
31131 {
31132 ::std::string::String::deserialize(deserializer)?
31133 .parse()
31134 .map_err(|e: self::error::ConversionError| {
31135 <D::Error as ::serde::de::Error>::custom(e.to_string())
31136 })
31137 }
31138 }
31139 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31155 #[serde(transparent)]
31156 pub struct SignerAddress(::std::string::String);
31157 impl ::std::ops::Deref for SignerAddress {
31158 type Target = ::std::string::String;
31159 fn deref(&self) -> &::std::string::String {
31160 &self.0
31161 }
31162 }
31163 impl ::std::convert::From<SignerAddress> for ::std::string::String {
31164 fn from(value: SignerAddress) -> Self {
31165 value.0
31166 }
31167 }
31168 impl ::std::convert::From<&SignerAddress> for SignerAddress {
31169 fn from(value: &SignerAddress) -> Self {
31170 value.clone()
31171 }
31172 }
31173 impl ::std::str::FromStr for SignerAddress {
31174 type Err = self::error::ConversionError;
31175 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31176 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
31177 ::std::sync::LazyLock::new(|| {
31178 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
31179 });
31180 if PATTERN.find(value).is_none() {
31181 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
31182 }
31183 Ok(Self(value.to_string()))
31184 }
31185 }
31186 impl ::std::convert::TryFrom<&str> for SignerAddress {
31187 type Error = self::error::ConversionError;
31188 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31189 value.parse()
31190 }
31191 }
31192 impl ::std::convert::TryFrom<&::std::string::String> for SignerAddress {
31193 type Error = self::error::ConversionError;
31194 fn try_from(
31195 value: &::std::string::String,
31196 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31197 value.parse()
31198 }
31199 }
31200 impl ::std::convert::TryFrom<::std::string::String> for SignerAddress {
31201 type Error = self::error::ConversionError;
31202 fn try_from(
31203 value: ::std::string::String,
31204 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31205 value.parse()
31206 }
31207 }
31208 impl<'de> ::serde::Deserialize<'de> for SignerAddress {
31209 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
31210 where
31211 D: ::serde::Deserializer<'de>,
31212 {
31213 ::std::string::String::deserialize(deserializer)?
31214 .parse()
31215 .map_err(|e: self::error::ConversionError| {
31216 <D::Error as ::serde::de::Error>::custom(e.to_string())
31217 })
31218 }
31219 }
31220 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
31238 #[serde(transparent)]
31239 pub struct SlippageBps(pub i64);
31240 impl ::std::ops::Deref for SlippageBps {
31241 type Target = i64;
31242 fn deref(&self) -> &i64 {
31243 &self.0
31244 }
31245 }
31246 impl ::std::convert::From<SlippageBps> for i64 {
31247 fn from(value: SlippageBps) -> Self {
31248 value.0
31249 }
31250 }
31251 impl ::std::convert::From<&SlippageBps> for SlippageBps {
31252 fn from(value: &SlippageBps) -> Self {
31253 value.clone()
31254 }
31255 }
31256 impl ::std::convert::From<i64> for SlippageBps {
31257 fn from(value: i64) -> Self {
31258 Self(value)
31259 }
31260 }
31261 impl ::std::str::FromStr for SlippageBps {
31262 type Err = <i64 as ::std::str::FromStr>::Err;
31263 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
31264 Ok(Self(value.parse()?))
31265 }
31266 }
31267 impl ::std::convert::TryFrom<&str> for SlippageBps {
31268 type Error = <i64 as ::std::str::FromStr>::Err;
31269 fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
31270 value.parse()
31271 }
31272 }
31273 impl ::std::convert::TryFrom<&String> for SlippageBps {
31274 type Error = <i64 as ::std::str::FromStr>::Err;
31275 fn try_from(value: &String) -> ::std::result::Result<Self, Self::Error> {
31276 value.parse()
31277 }
31278 }
31279 impl ::std::convert::TryFrom<String> for SlippageBps {
31280 type Error = <i64 as ::std::str::FromStr>::Err;
31281 fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
31282 value.parse()
31283 }
31284 }
31285 impl ::std::fmt::Display for SlippageBps {
31286 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31287 self.0.fmt(f)
31288 }
31289 }
31290 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
31327 pub struct SmsAuthentication {
31328 #[serde(rename = "phoneNumber")]
31330 pub phone_number: SmsAuthenticationPhoneNumber,
31331 #[serde(rename = "type")]
31333 pub type_: SmsAuthenticationType,
31334 }
31335 impl ::std::convert::From<&SmsAuthentication> for SmsAuthentication {
31336 fn from(value: &SmsAuthentication) -> Self {
31337 value.clone()
31338 }
31339 }
31340 impl SmsAuthentication {
31341 pub fn builder() -> builder::SmsAuthentication {
31342 Default::default()
31343 }
31344 }
31345 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31361 #[serde(transparent)]
31362 pub struct SmsAuthenticationPhoneNumber(::std::string::String);
31363 impl ::std::ops::Deref for SmsAuthenticationPhoneNumber {
31364 type Target = ::std::string::String;
31365 fn deref(&self) -> &::std::string::String {
31366 &self.0
31367 }
31368 }
31369 impl ::std::convert::From<SmsAuthenticationPhoneNumber> for ::std::string::String {
31370 fn from(value: SmsAuthenticationPhoneNumber) -> Self {
31371 value.0
31372 }
31373 }
31374 impl ::std::convert::From<&SmsAuthenticationPhoneNumber> for SmsAuthenticationPhoneNumber {
31375 fn from(value: &SmsAuthenticationPhoneNumber) -> Self {
31376 value.clone()
31377 }
31378 }
31379 impl ::std::str::FromStr for SmsAuthenticationPhoneNumber {
31380 type Err = self::error::ConversionError;
31381 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31382 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
31383 ::std::sync::LazyLock::new(|| {
31384 ::regress::Regex::new("^\\+[1-9]\\d{1,14}$").unwrap()
31385 });
31386 if PATTERN.find(value).is_none() {
31387 return Err("doesn't match pattern \"^\\+[1-9]\\d{1,14}$\"".into());
31388 }
31389 Ok(Self(value.to_string()))
31390 }
31391 }
31392 impl ::std::convert::TryFrom<&str> for SmsAuthenticationPhoneNumber {
31393 type Error = self::error::ConversionError;
31394 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31395 value.parse()
31396 }
31397 }
31398 impl ::std::convert::TryFrom<&::std::string::String> for SmsAuthenticationPhoneNumber {
31399 type Error = self::error::ConversionError;
31400 fn try_from(
31401 value: &::std::string::String,
31402 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31403 value.parse()
31404 }
31405 }
31406 impl ::std::convert::TryFrom<::std::string::String> for SmsAuthenticationPhoneNumber {
31407 type Error = self::error::ConversionError;
31408 fn try_from(
31409 value: ::std::string::String,
31410 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31411 value.parse()
31412 }
31413 }
31414 impl<'de> ::serde::Deserialize<'de> for SmsAuthenticationPhoneNumber {
31415 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
31416 where
31417 D: ::serde::Deserializer<'de>,
31418 {
31419 ::std::string::String::deserialize(deserializer)?
31420 .parse()
31421 .map_err(|e: self::error::ConversionError| {
31422 <D::Error as ::serde::de::Error>::custom(e.to_string())
31423 })
31424 }
31425 }
31426 #[derive(
31444 ::serde::Deserialize,
31445 ::serde::Serialize,
31446 Clone,
31447 Copy,
31448 Debug,
31449 Eq,
31450 Hash,
31451 Ord,
31452 PartialEq,
31453 PartialOrd,
31454 )]
31455 pub enum SmsAuthenticationType {
31456 #[serde(rename = "sms")]
31457 Sms,
31458 }
31459 impl ::std::convert::From<&Self> for SmsAuthenticationType {
31460 fn from(value: &SmsAuthenticationType) -> Self {
31461 value.clone()
31462 }
31463 }
31464 impl ::std::fmt::Display for SmsAuthenticationType {
31465 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31466 match *self {
31467 Self::Sms => f.write_str("sms"),
31468 }
31469 }
31470 }
31471 impl ::std::str::FromStr for SmsAuthenticationType {
31472 type Err = self::error::ConversionError;
31473 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31474 match value {
31475 "sms" => Ok(Self::Sms),
31476 _ => Err("invalid value".into()),
31477 }
31478 }
31479 }
31480 impl ::std::convert::TryFrom<&str> for SmsAuthenticationType {
31481 type Error = self::error::ConversionError;
31482 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31483 value.parse()
31484 }
31485 }
31486 impl ::std::convert::TryFrom<&::std::string::String> for SmsAuthenticationType {
31487 type Error = self::error::ConversionError;
31488 fn try_from(
31489 value: &::std::string::String,
31490 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31491 value.parse()
31492 }
31493 }
31494 impl ::std::convert::TryFrom<::std::string::String> for SmsAuthenticationType {
31495 type Error = self::error::ConversionError;
31496 fn try_from(
31497 value: ::std::string::String,
31498 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31499 value.parse()
31500 }
31501 }
31502 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
31557 pub struct SolAddressCriterion {
31558 pub addresses: ::std::vec::Vec<SolAddressCriterionAddressesItem>,
31560 pub operator: SolAddressCriterionOperator,
31562 #[serde(rename = "type")]
31564 pub type_: SolAddressCriterionType,
31565 }
31566 impl ::std::convert::From<&SolAddressCriterion> for SolAddressCriterion {
31567 fn from(value: &SolAddressCriterion) -> Self {
31568 value.clone()
31569 }
31570 }
31571 impl SolAddressCriterion {
31572 pub fn builder() -> builder::SolAddressCriterion {
31573 Default::default()
31574 }
31575 }
31576 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31589 #[serde(transparent)]
31590 pub struct SolAddressCriterionAddressesItem(::std::string::String);
31591 impl ::std::ops::Deref for SolAddressCriterionAddressesItem {
31592 type Target = ::std::string::String;
31593 fn deref(&self) -> &::std::string::String {
31594 &self.0
31595 }
31596 }
31597 impl ::std::convert::From<SolAddressCriterionAddressesItem> for ::std::string::String {
31598 fn from(value: SolAddressCriterionAddressesItem) -> Self {
31599 value.0
31600 }
31601 }
31602 impl ::std::convert::From<&SolAddressCriterionAddressesItem> for SolAddressCriterionAddressesItem {
31603 fn from(value: &SolAddressCriterionAddressesItem) -> Self {
31604 value.clone()
31605 }
31606 }
31607 impl ::std::str::FromStr for SolAddressCriterionAddressesItem {
31608 type Err = self::error::ConversionError;
31609 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31610 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
31611 ::std::sync::LazyLock::new(|| {
31612 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
31613 });
31614 if PATTERN.find(value).is_none() {
31615 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
31616 }
31617 Ok(Self(value.to_string()))
31618 }
31619 }
31620 impl ::std::convert::TryFrom<&str> for SolAddressCriterionAddressesItem {
31621 type Error = self::error::ConversionError;
31622 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31623 value.parse()
31624 }
31625 }
31626 impl ::std::convert::TryFrom<&::std::string::String> for SolAddressCriterionAddressesItem {
31627 type Error = self::error::ConversionError;
31628 fn try_from(
31629 value: &::std::string::String,
31630 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31631 value.parse()
31632 }
31633 }
31634 impl ::std::convert::TryFrom<::std::string::String> for SolAddressCriterionAddressesItem {
31635 type Error = self::error::ConversionError;
31636 fn try_from(
31637 value: ::std::string::String,
31638 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31639 value.parse()
31640 }
31641 }
31642 impl<'de> ::serde::Deserialize<'de> for SolAddressCriterionAddressesItem {
31643 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
31644 where
31645 D: ::serde::Deserializer<'de>,
31646 {
31647 ::std::string::String::deserialize(deserializer)?
31648 .parse()
31649 .map_err(|e: self::error::ConversionError| {
31650 <D::Error as ::serde::de::Error>::custom(e.to_string())
31651 })
31652 }
31653 }
31654 #[derive(
31673 ::serde::Deserialize,
31674 ::serde::Serialize,
31675 Clone,
31676 Copy,
31677 Debug,
31678 Eq,
31679 Hash,
31680 Ord,
31681 PartialEq,
31682 PartialOrd,
31683 )]
31684 pub enum SolAddressCriterionOperator {
31685 #[serde(rename = "in")]
31686 In,
31687 #[serde(rename = "not in")]
31688 NotIn,
31689 }
31690 impl ::std::convert::From<&Self> for SolAddressCriterionOperator {
31691 fn from(value: &SolAddressCriterionOperator) -> Self {
31692 value.clone()
31693 }
31694 }
31695 impl ::std::fmt::Display for SolAddressCriterionOperator {
31696 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31697 match *self {
31698 Self::In => f.write_str("in"),
31699 Self::NotIn => f.write_str("not in"),
31700 }
31701 }
31702 }
31703 impl ::std::str::FromStr for SolAddressCriterionOperator {
31704 type Err = self::error::ConversionError;
31705 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31706 match value {
31707 "in" => Ok(Self::In),
31708 "not in" => Ok(Self::NotIn),
31709 _ => Err("invalid value".into()),
31710 }
31711 }
31712 }
31713 impl ::std::convert::TryFrom<&str> for SolAddressCriterionOperator {
31714 type Error = self::error::ConversionError;
31715 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31716 value.parse()
31717 }
31718 }
31719 impl ::std::convert::TryFrom<&::std::string::String> for SolAddressCriterionOperator {
31720 type Error = self::error::ConversionError;
31721 fn try_from(
31722 value: &::std::string::String,
31723 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31724 value.parse()
31725 }
31726 }
31727 impl ::std::convert::TryFrom<::std::string::String> for SolAddressCriterionOperator {
31728 type Error = self::error::ConversionError;
31729 fn try_from(
31730 value: ::std::string::String,
31731 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31732 value.parse()
31733 }
31734 }
31735 #[derive(
31753 ::serde::Deserialize,
31754 ::serde::Serialize,
31755 Clone,
31756 Copy,
31757 Debug,
31758 Eq,
31759 Hash,
31760 Ord,
31761 PartialEq,
31762 PartialOrd,
31763 )]
31764 pub enum SolAddressCriterionType {
31765 #[serde(rename = "solAddress")]
31766 SolAddress,
31767 }
31768 impl ::std::convert::From<&Self> for SolAddressCriterionType {
31769 fn from(value: &SolAddressCriterionType) -> Self {
31770 value.clone()
31771 }
31772 }
31773 impl ::std::fmt::Display for SolAddressCriterionType {
31774 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31775 match *self {
31776 Self::SolAddress => f.write_str("solAddress"),
31777 }
31778 }
31779 }
31780 impl ::std::str::FromStr for SolAddressCriterionType {
31781 type Err = self::error::ConversionError;
31782 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31783 match value {
31784 "solAddress" => Ok(Self::SolAddress),
31785 _ => Err("invalid value".into()),
31786 }
31787 }
31788 }
31789 impl ::std::convert::TryFrom<&str> for SolAddressCriterionType {
31790 type Error = self::error::ConversionError;
31791 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
31792 value.parse()
31793 }
31794 }
31795 impl ::std::convert::TryFrom<&::std::string::String> for SolAddressCriterionType {
31796 type Error = self::error::ConversionError;
31797 fn try_from(
31798 value: &::std::string::String,
31799 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31800 value.parse()
31801 }
31802 }
31803 impl ::std::convert::TryFrom<::std::string::String> for SolAddressCriterionType {
31804 type Error = self::error::ConversionError;
31805 fn try_from(
31806 value: ::std::string::String,
31807 ) -> ::std::result::Result<Self, self::error::ConversionError> {
31808 value.parse()
31809 }
31810 }
31811 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
31873 pub struct SolDataCondition {
31874 pub instruction: ::std::string::String,
31876 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
31878 pub params: ::std::vec::Vec<SolDataConditionParamsItem>,
31879 }
31880 impl ::std::convert::From<&SolDataCondition> for SolDataCondition {
31881 fn from(value: &SolDataCondition) -> Self {
31882 value.clone()
31883 }
31884 }
31885 impl SolDataCondition {
31886 pub fn builder() -> builder::SolDataCondition {
31887 Default::default()
31888 }
31889 }
31890 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
31909 #[serde(untagged)]
31910 pub enum SolDataConditionParamsItem {
31911 Variant0(SolDataParameterCondition),
31912 Variant1(SolDataParameterConditionList),
31913 }
31914 impl ::std::convert::From<&Self> for SolDataConditionParamsItem {
31915 fn from(value: &SolDataConditionParamsItem) -> Self {
31916 value.clone()
31917 }
31918 }
31919 impl ::std::convert::From<SolDataParameterCondition> for SolDataConditionParamsItem {
31920 fn from(value: SolDataParameterCondition) -> Self {
31921 Self::Variant0(value)
31922 }
31923 }
31924 impl ::std::convert::From<SolDataParameterConditionList> for SolDataConditionParamsItem {
31925 fn from(value: SolDataParameterConditionList) -> Self {
31926 Self::Variant1(value)
31927 }
31928 }
31929 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
32033 pub struct SolDataCriterion {
32034 pub conditions: ::std::vec::Vec<SolDataCondition>,
32036 pub idls: ::std::vec::Vec<SolDataCriterionIdlsItem>,
32038 #[serde(rename = "type")]
32040 pub type_: SolDataCriterionType,
32041 }
32042 impl ::std::convert::From<&SolDataCriterion> for SolDataCriterion {
32043 fn from(value: &SolDataCriterion) -> Self {
32044 value.clone()
32045 }
32046 }
32047 impl SolDataCriterion {
32048 pub fn builder() -> builder::SolDataCriterion {
32049 Default::default()
32050 }
32051 }
32052 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
32070 #[serde(untagged)]
32071 pub enum SolDataCriterionIdlsItem {
32072 KnownIdlType(KnownIdlType),
32073 Idl(Idl),
32074 }
32075 impl ::std::convert::From<&Self> for SolDataCriterionIdlsItem {
32076 fn from(value: &SolDataCriterionIdlsItem) -> Self {
32077 value.clone()
32078 }
32079 }
32080 impl ::std::convert::From<KnownIdlType> for SolDataCriterionIdlsItem {
32081 fn from(value: KnownIdlType) -> Self {
32082 Self::KnownIdlType(value)
32083 }
32084 }
32085 impl ::std::convert::From<Idl> for SolDataCriterionIdlsItem {
32086 fn from(value: Idl) -> Self {
32087 Self::Idl(value)
32088 }
32089 }
32090 #[derive(
32108 ::serde::Deserialize,
32109 ::serde::Serialize,
32110 Clone,
32111 Copy,
32112 Debug,
32113 Eq,
32114 Hash,
32115 Ord,
32116 PartialEq,
32117 PartialOrd,
32118 )]
32119 pub enum SolDataCriterionType {
32120 #[serde(rename = "solData")]
32121 SolData,
32122 }
32123 impl ::std::convert::From<&Self> for SolDataCriterionType {
32124 fn from(value: &SolDataCriterionType) -> Self {
32125 value.clone()
32126 }
32127 }
32128 impl ::std::fmt::Display for SolDataCriterionType {
32129 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32130 match *self {
32131 Self::SolData => f.write_str("solData"),
32132 }
32133 }
32134 }
32135 impl ::std::str::FromStr for SolDataCriterionType {
32136 type Err = self::error::ConversionError;
32137 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32138 match value {
32139 "solData" => Ok(Self::SolData),
32140 _ => Err("invalid value".into()),
32141 }
32142 }
32143 }
32144 impl ::std::convert::TryFrom<&str> for SolDataCriterionType {
32145 type Error = self::error::ConversionError;
32146 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32147 value.parse()
32148 }
32149 }
32150 impl ::std::convert::TryFrom<&::std::string::String> for SolDataCriterionType {
32151 type Error = self::error::ConversionError;
32152 fn try_from(
32153 value: &::std::string::String,
32154 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32155 value.parse()
32156 }
32157 }
32158 impl ::std::convert::TryFrom<::std::string::String> for SolDataCriterionType {
32159 type Error = self::error::ConversionError;
32160 fn try_from(
32161 value: ::std::string::String,
32162 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32163 value.parse()
32164 }
32165 }
32166 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
32215 pub struct SolDataParameterCondition {
32216 pub name: ::std::string::String,
32218 pub operator: SolDataParameterConditionOperator,
32220 pub value: ::std::string::String,
32222 }
32223 impl ::std::convert::From<&SolDataParameterCondition> for SolDataParameterCondition {
32224 fn from(value: &SolDataParameterCondition) -> Self {
32225 value.clone()
32226 }
32227 }
32228 impl SolDataParameterCondition {
32229 pub fn builder() -> builder::SolDataParameterCondition {
32230 Default::default()
32231 }
32232 }
32233 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
32290 pub struct SolDataParameterConditionList {
32291 pub name: ::std::string::String,
32293 pub operator: SolDataParameterConditionListOperator,
32295 pub values: ::std::vec::Vec<::std::string::String>,
32297 }
32298 impl ::std::convert::From<&SolDataParameterConditionList> for SolDataParameterConditionList {
32299 fn from(value: &SolDataParameterConditionList) -> Self {
32300 value.clone()
32301 }
32302 }
32303 impl SolDataParameterConditionList {
32304 pub fn builder() -> builder::SolDataParameterConditionList {
32305 Default::default()
32306 }
32307 }
32308 #[derive(
32327 ::serde::Deserialize,
32328 ::serde::Serialize,
32329 Clone,
32330 Copy,
32331 Debug,
32332 Eq,
32333 Hash,
32334 Ord,
32335 PartialEq,
32336 PartialOrd,
32337 )]
32338 pub enum SolDataParameterConditionListOperator {
32339 #[serde(rename = "in")]
32340 In,
32341 #[serde(rename = "not in")]
32342 NotIn,
32343 }
32344 impl ::std::convert::From<&Self> for SolDataParameterConditionListOperator {
32345 fn from(value: &SolDataParameterConditionListOperator) -> Self {
32346 value.clone()
32347 }
32348 }
32349 impl ::std::fmt::Display for SolDataParameterConditionListOperator {
32350 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32351 match *self {
32352 Self::In => f.write_str("in"),
32353 Self::NotIn => f.write_str("not in"),
32354 }
32355 }
32356 }
32357 impl ::std::str::FromStr for SolDataParameterConditionListOperator {
32358 type Err = self::error::ConversionError;
32359 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32360 match value {
32361 "in" => Ok(Self::In),
32362 "not in" => Ok(Self::NotIn),
32363 _ => Err("invalid value".into()),
32364 }
32365 }
32366 }
32367 impl ::std::convert::TryFrom<&str> for SolDataParameterConditionListOperator {
32368 type Error = self::error::ConversionError;
32369 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32370 value.parse()
32371 }
32372 }
32373 impl ::std::convert::TryFrom<&::std::string::String> for SolDataParameterConditionListOperator {
32374 type Error = self::error::ConversionError;
32375 fn try_from(
32376 value: &::std::string::String,
32377 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32378 value.parse()
32379 }
32380 }
32381 impl ::std::convert::TryFrom<::std::string::String> for SolDataParameterConditionListOperator {
32382 type Error = self::error::ConversionError;
32383 fn try_from(
32384 value: ::std::string::String,
32385 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32386 value.parse()
32387 }
32388 }
32389 #[derive(
32411 ::serde::Deserialize,
32412 ::serde::Serialize,
32413 Clone,
32414 Copy,
32415 Debug,
32416 Eq,
32417 Hash,
32418 Ord,
32419 PartialEq,
32420 PartialOrd,
32421 )]
32422 pub enum SolDataParameterConditionOperator {
32423 GreaterThan,
32424 GreaterThanOrEqual,
32425 LessThan,
32426 LessThanOrEqual,
32427 Equal,
32428 }
32429 impl ::std::convert::From<&Self> for SolDataParameterConditionOperator {
32430 fn from(value: &SolDataParameterConditionOperator) -> Self {
32431 value.clone()
32432 }
32433 }
32434 impl ::std::fmt::Display for SolDataParameterConditionOperator {
32435 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32436 match *self {
32437 Self::GreaterThan => f.write_str("GreaterThan"),
32438 Self::GreaterThanOrEqual => f.write_str("GreaterThanOrEqual"),
32439 Self::LessThan => f.write_str("LessThan"),
32440 Self::LessThanOrEqual => f.write_str("LessThanOrEqual"),
32441 Self::Equal => f.write_str("Equal"),
32442 }
32443 }
32444 }
32445 impl ::std::str::FromStr for SolDataParameterConditionOperator {
32446 type Err = self::error::ConversionError;
32447 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32448 match value {
32449 "GreaterThan" => Ok(Self::GreaterThan),
32450 "GreaterThanOrEqual" => Ok(Self::GreaterThanOrEqual),
32451 "LessThan" => Ok(Self::LessThan),
32452 "LessThanOrEqual" => Ok(Self::LessThanOrEqual),
32453 "Equal" => Ok(Self::Equal),
32454 _ => Err("invalid value".into()),
32455 }
32456 }
32457 }
32458 impl ::std::convert::TryFrom<&str> for SolDataParameterConditionOperator {
32459 type Error = self::error::ConversionError;
32460 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32461 value.parse()
32462 }
32463 }
32464 impl ::std::convert::TryFrom<&::std::string::String> for SolDataParameterConditionOperator {
32465 type Error = self::error::ConversionError;
32466 fn try_from(
32467 value: &::std::string::String,
32468 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32469 value.parse()
32470 }
32471 }
32472 impl ::std::convert::TryFrom<::std::string::String> for SolDataParameterConditionOperator {
32473 type Error = self::error::ConversionError;
32474 fn try_from(
32475 value: ::std::string::String,
32476 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32477 value.parse()
32478 }
32479 }
32480 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
32517 pub struct SolMessageCriterion {
32518 #[serde(rename = "match")]
32520 pub match_: ::std::string::String,
32521 #[serde(rename = "type")]
32523 pub type_: SolMessageCriterionType,
32524 }
32525 impl ::std::convert::From<&SolMessageCriterion> for SolMessageCriterion {
32526 fn from(value: &SolMessageCriterion) -> Self {
32527 value.clone()
32528 }
32529 }
32530 impl SolMessageCriterion {
32531 pub fn builder() -> builder::SolMessageCriterion {
32532 Default::default()
32533 }
32534 }
32535 #[derive(
32553 ::serde::Deserialize,
32554 ::serde::Serialize,
32555 Clone,
32556 Copy,
32557 Debug,
32558 Eq,
32559 Hash,
32560 Ord,
32561 PartialEq,
32562 PartialOrd,
32563 )]
32564 pub enum SolMessageCriterionType {
32565 #[serde(rename = "solMessage")]
32566 SolMessage,
32567 }
32568 impl ::std::convert::From<&Self> for SolMessageCriterionType {
32569 fn from(value: &SolMessageCriterionType) -> Self {
32570 value.clone()
32571 }
32572 }
32573 impl ::std::fmt::Display for SolMessageCriterionType {
32574 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32575 match *self {
32576 Self::SolMessage => f.write_str("solMessage"),
32577 }
32578 }
32579 }
32580 impl ::std::str::FromStr for SolMessageCriterionType {
32581 type Err = self::error::ConversionError;
32582 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32583 match value {
32584 "solMessage" => Ok(Self::SolMessage),
32585 _ => Err("invalid value".into()),
32586 }
32587 }
32588 }
32589 impl ::std::convert::TryFrom<&str> for SolMessageCriterionType {
32590 type Error = self::error::ConversionError;
32591 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32592 value.parse()
32593 }
32594 }
32595 impl ::std::convert::TryFrom<&::std::string::String> for SolMessageCriterionType {
32596 type Error = self::error::ConversionError;
32597 fn try_from(
32598 value: &::std::string::String,
32599 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32600 value.parse()
32601 }
32602 }
32603 impl ::std::convert::TryFrom<::std::string::String> for SolMessageCriterionType {
32604 type Error = self::error::ConversionError;
32605 fn try_from(
32606 value: ::std::string::String,
32607 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32608 value.parse()
32609 }
32610 }
32611 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
32674 pub struct SolNetworkCriterion {
32675 pub networks: ::std::vec::Vec<SolNetworkCriterionNetworksItem>,
32677 pub operator: SolNetworkCriterionOperator,
32679 #[serde(rename = "type")]
32681 pub type_: SolNetworkCriterionType,
32682 }
32683 impl ::std::convert::From<&SolNetworkCriterion> for SolNetworkCriterion {
32684 fn from(value: &SolNetworkCriterion) -> Self {
32685 value.clone()
32686 }
32687 }
32688 impl SolNetworkCriterion {
32689 pub fn builder() -> builder::SolNetworkCriterion {
32690 Default::default()
32691 }
32692 }
32693 #[derive(
32712 ::serde::Deserialize,
32713 ::serde::Serialize,
32714 Clone,
32715 Copy,
32716 Debug,
32717 Eq,
32718 Hash,
32719 Ord,
32720 PartialEq,
32721 PartialOrd,
32722 )]
32723 pub enum SolNetworkCriterionNetworksItem {
32724 #[serde(rename = "solana-devnet")]
32725 SolanaDevnet,
32726 #[serde(rename = "solana")]
32727 Solana,
32728 }
32729 impl ::std::convert::From<&Self> for SolNetworkCriterionNetworksItem {
32730 fn from(value: &SolNetworkCriterionNetworksItem) -> Self {
32731 value.clone()
32732 }
32733 }
32734 impl ::std::fmt::Display for SolNetworkCriterionNetworksItem {
32735 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32736 match *self {
32737 Self::SolanaDevnet => f.write_str("solana-devnet"),
32738 Self::Solana => f.write_str("solana"),
32739 }
32740 }
32741 }
32742 impl ::std::str::FromStr for SolNetworkCriterionNetworksItem {
32743 type Err = self::error::ConversionError;
32744 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32745 match value {
32746 "solana-devnet" => Ok(Self::SolanaDevnet),
32747 "solana" => Ok(Self::Solana),
32748 _ => Err("invalid value".into()),
32749 }
32750 }
32751 }
32752 impl ::std::convert::TryFrom<&str> for SolNetworkCriterionNetworksItem {
32753 type Error = self::error::ConversionError;
32754 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32755 value.parse()
32756 }
32757 }
32758 impl ::std::convert::TryFrom<&::std::string::String> for SolNetworkCriterionNetworksItem {
32759 type Error = self::error::ConversionError;
32760 fn try_from(
32761 value: &::std::string::String,
32762 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32763 value.parse()
32764 }
32765 }
32766 impl ::std::convert::TryFrom<::std::string::String> for SolNetworkCriterionNetworksItem {
32767 type Error = self::error::ConversionError;
32768 fn try_from(
32769 value: ::std::string::String,
32770 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32771 value.parse()
32772 }
32773 }
32774 #[derive(
32793 ::serde::Deserialize,
32794 ::serde::Serialize,
32795 Clone,
32796 Copy,
32797 Debug,
32798 Eq,
32799 Hash,
32800 Ord,
32801 PartialEq,
32802 PartialOrd,
32803 )]
32804 pub enum SolNetworkCriterionOperator {
32805 #[serde(rename = "in")]
32806 In,
32807 #[serde(rename = "not in")]
32808 NotIn,
32809 }
32810 impl ::std::convert::From<&Self> for SolNetworkCriterionOperator {
32811 fn from(value: &SolNetworkCriterionOperator) -> Self {
32812 value.clone()
32813 }
32814 }
32815 impl ::std::fmt::Display for SolNetworkCriterionOperator {
32816 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32817 match *self {
32818 Self::In => f.write_str("in"),
32819 Self::NotIn => f.write_str("not in"),
32820 }
32821 }
32822 }
32823 impl ::std::str::FromStr for SolNetworkCriterionOperator {
32824 type Err = self::error::ConversionError;
32825 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32826 match value {
32827 "in" => Ok(Self::In),
32828 "not in" => Ok(Self::NotIn),
32829 _ => Err("invalid value".into()),
32830 }
32831 }
32832 }
32833 impl ::std::convert::TryFrom<&str> for SolNetworkCriterionOperator {
32834 type Error = self::error::ConversionError;
32835 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32836 value.parse()
32837 }
32838 }
32839 impl ::std::convert::TryFrom<&::std::string::String> for SolNetworkCriterionOperator {
32840 type Error = self::error::ConversionError;
32841 fn try_from(
32842 value: &::std::string::String,
32843 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32844 value.parse()
32845 }
32846 }
32847 impl ::std::convert::TryFrom<::std::string::String> for SolNetworkCriterionOperator {
32848 type Error = self::error::ConversionError;
32849 fn try_from(
32850 value: ::std::string::String,
32851 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32852 value.parse()
32853 }
32854 }
32855 #[derive(
32873 ::serde::Deserialize,
32874 ::serde::Serialize,
32875 Clone,
32876 Copy,
32877 Debug,
32878 Eq,
32879 Hash,
32880 Ord,
32881 PartialEq,
32882 PartialOrd,
32883 )]
32884 pub enum SolNetworkCriterionType {
32885 #[serde(rename = "solNetwork")]
32886 SolNetwork,
32887 }
32888 impl ::std::convert::From<&Self> for SolNetworkCriterionType {
32889 fn from(value: &SolNetworkCriterionType) -> Self {
32890 value.clone()
32891 }
32892 }
32893 impl ::std::fmt::Display for SolNetworkCriterionType {
32894 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32895 match *self {
32896 Self::SolNetwork => f.write_str("solNetwork"),
32897 }
32898 }
32899 }
32900 impl ::std::str::FromStr for SolNetworkCriterionType {
32901 type Err = self::error::ConversionError;
32902 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32903 match value {
32904 "solNetwork" => Ok(Self::SolNetwork),
32905 _ => Err("invalid value".into()),
32906 }
32907 }
32908 }
32909 impl ::std::convert::TryFrom<&str> for SolNetworkCriterionType {
32910 type Error = self::error::ConversionError;
32911 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
32912 value.parse()
32913 }
32914 }
32915 impl ::std::convert::TryFrom<&::std::string::String> for SolNetworkCriterionType {
32916 type Error = self::error::ConversionError;
32917 fn try_from(
32918 value: &::std::string::String,
32919 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32920 value.parse()
32921 }
32922 }
32923 impl ::std::convert::TryFrom<::std::string::String> for SolNetworkCriterionType {
32924 type Error = self::error::ConversionError;
32925 fn try_from(
32926 value: ::std::string::String,
32927 ) -> ::std::result::Result<Self, self::error::ConversionError> {
32928 value.parse()
32929 }
32930 }
32931 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
32983 pub struct SolValueCriterion {
32984 pub operator: SolValueCriterionOperator,
32986 #[serde(rename = "solValue")]
32988 pub sol_value: ::std::string::String,
32989 #[serde(rename = "type")]
32991 pub type_: SolValueCriterionType,
32992 }
32993 impl ::std::convert::From<&SolValueCriterion> for SolValueCriterion {
32994 fn from(value: &SolValueCriterion) -> Self {
32995 value.clone()
32996 }
32997 }
32998 impl SolValueCriterion {
32999 pub fn builder() -> builder::SolValueCriterion {
33000 Default::default()
33001 }
33002 }
33003 #[derive(
33025 ::serde::Deserialize,
33026 ::serde::Serialize,
33027 Clone,
33028 Copy,
33029 Debug,
33030 Eq,
33031 Hash,
33032 Ord,
33033 PartialEq,
33034 PartialOrd,
33035 )]
33036 pub enum SolValueCriterionOperator {
33037 GreaterThan,
33038 GreaterThanOrEqual,
33039 LessThan,
33040 LessThanOrEqual,
33041 Equal,
33042 }
33043 impl ::std::convert::From<&Self> for SolValueCriterionOperator {
33044 fn from(value: &SolValueCriterionOperator) -> Self {
33045 value.clone()
33046 }
33047 }
33048 impl ::std::fmt::Display for SolValueCriterionOperator {
33049 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
33050 match *self {
33051 Self::GreaterThan => f.write_str("GreaterThan"),
33052 Self::GreaterThanOrEqual => f.write_str("GreaterThanOrEqual"),
33053 Self::LessThan => f.write_str("LessThan"),
33054 Self::LessThanOrEqual => f.write_str("LessThanOrEqual"),
33055 Self::Equal => f.write_str("Equal"),
33056 }
33057 }
33058 }
33059 impl ::std::str::FromStr for SolValueCriterionOperator {
33060 type Err = self::error::ConversionError;
33061 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33062 match value {
33063 "GreaterThan" => Ok(Self::GreaterThan),
33064 "GreaterThanOrEqual" => Ok(Self::GreaterThanOrEqual),
33065 "LessThan" => Ok(Self::LessThan),
33066 "LessThanOrEqual" => Ok(Self::LessThanOrEqual),
33067 "Equal" => Ok(Self::Equal),
33068 _ => Err("invalid value".into()),
33069 }
33070 }
33071 }
33072 impl ::std::convert::TryFrom<&str> for SolValueCriterionOperator {
33073 type Error = self::error::ConversionError;
33074 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33075 value.parse()
33076 }
33077 }
33078 impl ::std::convert::TryFrom<&::std::string::String> for SolValueCriterionOperator {
33079 type Error = self::error::ConversionError;
33080 fn try_from(
33081 value: &::std::string::String,
33082 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33083 value.parse()
33084 }
33085 }
33086 impl ::std::convert::TryFrom<::std::string::String> for SolValueCriterionOperator {
33087 type Error = self::error::ConversionError;
33088 fn try_from(
33089 value: ::std::string::String,
33090 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33091 value.parse()
33092 }
33093 }
33094 #[derive(
33112 ::serde::Deserialize,
33113 ::serde::Serialize,
33114 Clone,
33115 Copy,
33116 Debug,
33117 Eq,
33118 Hash,
33119 Ord,
33120 PartialEq,
33121 PartialOrd,
33122 )]
33123 pub enum SolValueCriterionType {
33124 #[serde(rename = "solValue")]
33125 SolValue,
33126 }
33127 impl ::std::convert::From<&Self> for SolValueCriterionType {
33128 fn from(value: &SolValueCriterionType) -> Self {
33129 value.clone()
33130 }
33131 }
33132 impl ::std::fmt::Display for SolValueCriterionType {
33133 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
33134 match *self {
33135 Self::SolValue => f.write_str("solValue"),
33136 }
33137 }
33138 }
33139 impl ::std::str::FromStr for SolValueCriterionType {
33140 type Err = self::error::ConversionError;
33141 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33142 match value {
33143 "solValue" => Ok(Self::SolValue),
33144 _ => Err("invalid value".into()),
33145 }
33146 }
33147 }
33148 impl ::std::convert::TryFrom<&str> for SolValueCriterionType {
33149 type Error = self::error::ConversionError;
33150 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33151 value.parse()
33152 }
33153 }
33154 impl ::std::convert::TryFrom<&::std::string::String> for SolValueCriterionType {
33155 type Error = self::error::ConversionError;
33156 fn try_from(
33157 value: &::std::string::String,
33158 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33159 value.parse()
33160 }
33161 }
33162 impl ::std::convert::TryFrom<::std::string::String> for SolValueCriterionType {
33163 type Error = self::error::ConversionError;
33164 fn try_from(
33165 value: ::std::string::String,
33166 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33167 value.parse()
33168 }
33169 }
33170 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
33232 pub struct SolanaAccount {
33233 pub address: SolanaAccountAddress,
33235 #[serde(
33237 rename = "createdAt",
33238 default,
33239 skip_serializing_if = "::std::option::Option::is_none"
33240 )]
33241 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
33242 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
33246 pub name: ::std::option::Option<SolanaAccountName>,
33247 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
33249 pub policies: ::std::vec::Vec<SolanaAccountPoliciesItem>,
33250 #[serde(
33252 rename = "updatedAt",
33253 default,
33254 skip_serializing_if = "::std::option::Option::is_none"
33255 )]
33256 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
33257 }
33258 impl ::std::convert::From<&SolanaAccount> for SolanaAccount {
33259 fn from(value: &SolanaAccount) -> Self {
33260 value.clone()
33261 }
33262 }
33263 impl SolanaAccount {
33264 pub fn builder() -> builder::SolanaAccount {
33265 Default::default()
33266 }
33267 }
33268 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33284 #[serde(transparent)]
33285 pub struct SolanaAccountAddress(::std::string::String);
33286 impl ::std::ops::Deref for SolanaAccountAddress {
33287 type Target = ::std::string::String;
33288 fn deref(&self) -> &::std::string::String {
33289 &self.0
33290 }
33291 }
33292 impl ::std::convert::From<SolanaAccountAddress> for ::std::string::String {
33293 fn from(value: SolanaAccountAddress) -> Self {
33294 value.0
33295 }
33296 }
33297 impl ::std::convert::From<&SolanaAccountAddress> for SolanaAccountAddress {
33298 fn from(value: &SolanaAccountAddress) -> Self {
33299 value.clone()
33300 }
33301 }
33302 impl ::std::str::FromStr for SolanaAccountAddress {
33303 type Err = self::error::ConversionError;
33304 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33305 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
33306 ::std::sync::LazyLock::new(|| {
33307 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
33308 });
33309 if PATTERN.find(value).is_none() {
33310 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
33311 }
33312 Ok(Self(value.to_string()))
33313 }
33314 }
33315 impl ::std::convert::TryFrom<&str> for SolanaAccountAddress {
33316 type Error = self::error::ConversionError;
33317 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33318 value.parse()
33319 }
33320 }
33321 impl ::std::convert::TryFrom<&::std::string::String> for SolanaAccountAddress {
33322 type Error = self::error::ConversionError;
33323 fn try_from(
33324 value: &::std::string::String,
33325 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33326 value.parse()
33327 }
33328 }
33329 impl ::std::convert::TryFrom<::std::string::String> for SolanaAccountAddress {
33330 type Error = self::error::ConversionError;
33331 fn try_from(
33332 value: ::std::string::String,
33333 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33334 value.parse()
33335 }
33336 }
33337 impl<'de> ::serde::Deserialize<'de> for SolanaAccountAddress {
33338 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
33339 where
33340 D: ::serde::Deserializer<'de>,
33341 {
33342 ::std::string::String::deserialize(deserializer)?
33343 .parse()
33344 .map_err(|e: self::error::ConversionError| {
33345 <D::Error as ::serde::de::Error>::custom(e.to_string())
33346 })
33347 }
33348 }
33349 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33367 #[serde(transparent)]
33368 pub struct SolanaAccountName(::std::string::String);
33369 impl ::std::ops::Deref for SolanaAccountName {
33370 type Target = ::std::string::String;
33371 fn deref(&self) -> &::std::string::String {
33372 &self.0
33373 }
33374 }
33375 impl ::std::convert::From<SolanaAccountName> for ::std::string::String {
33376 fn from(value: SolanaAccountName) -> Self {
33377 value.0
33378 }
33379 }
33380 impl ::std::convert::From<&SolanaAccountName> for SolanaAccountName {
33381 fn from(value: &SolanaAccountName) -> Self {
33382 value.clone()
33383 }
33384 }
33385 impl ::std::str::FromStr for SolanaAccountName {
33386 type Err = self::error::ConversionError;
33387 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33388 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
33389 ::std::sync::LazyLock::new(|| {
33390 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
33391 });
33392 if PATTERN.find(value).is_none() {
33393 return Err(
33394 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
33395 );
33396 }
33397 Ok(Self(value.to_string()))
33398 }
33399 }
33400 impl ::std::convert::TryFrom<&str> for SolanaAccountName {
33401 type Error = self::error::ConversionError;
33402 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33403 value.parse()
33404 }
33405 }
33406 impl ::std::convert::TryFrom<&::std::string::String> for SolanaAccountName {
33407 type Error = self::error::ConversionError;
33408 fn try_from(
33409 value: &::std::string::String,
33410 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33411 value.parse()
33412 }
33413 }
33414 impl ::std::convert::TryFrom<::std::string::String> for SolanaAccountName {
33415 type Error = self::error::ConversionError;
33416 fn try_from(
33417 value: ::std::string::String,
33418 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33419 value.parse()
33420 }
33421 }
33422 impl<'de> ::serde::Deserialize<'de> for SolanaAccountName {
33423 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
33424 where
33425 D: ::serde::Deserializer<'de>,
33426 {
33427 ::std::string::String::deserialize(deserializer)?
33428 .parse()
33429 .map_err(|e: self::error::ConversionError| {
33430 <D::Error as ::serde::de::Error>::custom(e.to_string())
33431 })
33432 }
33433 }
33434 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33446 #[serde(transparent)]
33447 pub struct SolanaAccountPoliciesItem(::std::string::String);
33448 impl ::std::ops::Deref for SolanaAccountPoliciesItem {
33449 type Target = ::std::string::String;
33450 fn deref(&self) -> &::std::string::String {
33451 &self.0
33452 }
33453 }
33454 impl ::std::convert::From<SolanaAccountPoliciesItem> for ::std::string::String {
33455 fn from(value: SolanaAccountPoliciesItem) -> Self {
33456 value.0
33457 }
33458 }
33459 impl ::std::convert::From<&SolanaAccountPoliciesItem> for SolanaAccountPoliciesItem {
33460 fn from(value: &SolanaAccountPoliciesItem) -> Self {
33461 value.clone()
33462 }
33463 }
33464 impl ::std::str::FromStr for SolanaAccountPoliciesItem {
33465 type Err = self::error::ConversionError;
33466 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33467 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
33468 || {
33469 ::regress::Regex::new(
33470 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
33471 )
33472 .unwrap()
33473 },
33474 );
33475 if PATTERN.find(value).is_none() {
33476 return Err(
33477 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
33478 .into(),
33479 );
33480 }
33481 Ok(Self(value.to_string()))
33482 }
33483 }
33484 impl ::std::convert::TryFrom<&str> for SolanaAccountPoliciesItem {
33485 type Error = self::error::ConversionError;
33486 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33487 value.parse()
33488 }
33489 }
33490 impl ::std::convert::TryFrom<&::std::string::String> for SolanaAccountPoliciesItem {
33491 type Error = self::error::ConversionError;
33492 fn try_from(
33493 value: &::std::string::String,
33494 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33495 value.parse()
33496 }
33497 }
33498 impl ::std::convert::TryFrom<::std::string::String> for SolanaAccountPoliciesItem {
33499 type Error = self::error::ConversionError;
33500 fn try_from(
33501 value: ::std::string::String,
33502 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33503 value.parse()
33504 }
33505 }
33506 impl<'de> ::serde::Deserialize<'de> for SolanaAccountPoliciesItem {
33507 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
33508 where
33509 D: ::serde::Deserializer<'de>,
33510 {
33511 ::std::string::String::deserialize(deserializer)?
33512 .parse()
33513 .map_err(|e: self::error::ConversionError| {
33514 <D::Error as ::serde::de::Error>::custom(e.to_string())
33515 })
33516 }
33517 }
33518 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
33564 pub struct SolanaToken {
33565 #[serde(rename = "mintAddress")]
33568 pub mint_address: SolanaTokenMintAddress,
33569 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
33574 pub name: ::std::option::Option<::std::string::String>,
33575 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
33580 pub symbol: ::std::option::Option<::std::string::String>,
33581 }
33582 impl ::std::convert::From<&SolanaToken> for SolanaToken {
33583 fn from(value: &SolanaToken) -> Self {
33584 value.clone()
33585 }
33586 }
33587 impl SolanaToken {
33588 pub fn builder() -> builder::SolanaToken {
33589 Default::default()
33590 }
33591 }
33592 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
33632 pub struct SolanaTokenAmount {
33633 pub amount: SolanaTokenAmountAmount,
33635 pub decimals: i64,
33638 }
33639 impl ::std::convert::From<&SolanaTokenAmount> for SolanaTokenAmount {
33640 fn from(value: &SolanaTokenAmount) -> Self {
33641 value.clone()
33642 }
33643 }
33644 impl SolanaTokenAmount {
33645 pub fn builder() -> builder::SolanaTokenAmount {
33646 Default::default()
33647 }
33648 }
33649 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33665 #[serde(transparent)]
33666 pub struct SolanaTokenAmountAmount(::std::string::String);
33667 impl ::std::ops::Deref for SolanaTokenAmountAmount {
33668 type Target = ::std::string::String;
33669 fn deref(&self) -> &::std::string::String {
33670 &self.0
33671 }
33672 }
33673 impl ::std::convert::From<SolanaTokenAmountAmount> for ::std::string::String {
33674 fn from(value: SolanaTokenAmountAmount) -> Self {
33675 value.0
33676 }
33677 }
33678 impl ::std::convert::From<&SolanaTokenAmountAmount> for SolanaTokenAmountAmount {
33679 fn from(value: &SolanaTokenAmountAmount) -> Self {
33680 value.clone()
33681 }
33682 }
33683 impl ::std::str::FromStr for SolanaTokenAmountAmount {
33684 type Err = self::error::ConversionError;
33685 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33686 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
33687 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[0-9]+$").unwrap());
33688 if PATTERN.find(value).is_none() {
33689 return Err("doesn't match pattern \"^[0-9]+$\"".into());
33690 }
33691 Ok(Self(value.to_string()))
33692 }
33693 }
33694 impl ::std::convert::TryFrom<&str> for SolanaTokenAmountAmount {
33695 type Error = self::error::ConversionError;
33696 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33697 value.parse()
33698 }
33699 }
33700 impl ::std::convert::TryFrom<&::std::string::String> for SolanaTokenAmountAmount {
33701 type Error = self::error::ConversionError;
33702 fn try_from(
33703 value: &::std::string::String,
33704 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33705 value.parse()
33706 }
33707 }
33708 impl ::std::convert::TryFrom<::std::string::String> for SolanaTokenAmountAmount {
33709 type Error = self::error::ConversionError;
33710 fn try_from(
33711 value: ::std::string::String,
33712 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33713 value.parse()
33714 }
33715 }
33716 impl<'de> ::serde::Deserialize<'de> for SolanaTokenAmountAmount {
33717 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
33718 where
33719 D: ::serde::Deserializer<'de>,
33720 {
33721 ::std::string::String::deserialize(deserializer)?
33722 .parse()
33723 .map_err(|e: self::error::ConversionError| {
33724 <D::Error as ::serde::de::Error>::custom(e.to_string())
33725 })
33726 }
33727 }
33728 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
33751 pub struct SolanaTokenBalance {
33752 pub amount: SolanaTokenAmount,
33753 pub token: SolanaToken,
33754 }
33755 impl ::std::convert::From<&SolanaTokenBalance> for SolanaTokenBalance {
33756 fn from(value: &SolanaTokenBalance) -> Self {
33757 value.clone()
33758 }
33759 }
33760 impl SolanaTokenBalance {
33761 pub fn builder() -> builder::SolanaTokenBalance {
33762 Default::default()
33763 }
33764 }
33765 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33782 #[serde(transparent)]
33783 pub struct SolanaTokenMintAddress(::std::string::String);
33784 impl ::std::ops::Deref for SolanaTokenMintAddress {
33785 type Target = ::std::string::String;
33786 fn deref(&self) -> &::std::string::String {
33787 &self.0
33788 }
33789 }
33790 impl ::std::convert::From<SolanaTokenMintAddress> for ::std::string::String {
33791 fn from(value: SolanaTokenMintAddress) -> Self {
33792 value.0
33793 }
33794 }
33795 impl ::std::convert::From<&SolanaTokenMintAddress> for SolanaTokenMintAddress {
33796 fn from(value: &SolanaTokenMintAddress) -> Self {
33797 value.clone()
33798 }
33799 }
33800 impl ::std::str::FromStr for SolanaTokenMintAddress {
33801 type Err = self::error::ConversionError;
33802 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33803 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
33804 ::std::sync::LazyLock::new(|| {
33805 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
33806 });
33807 if PATTERN.find(value).is_none() {
33808 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
33809 }
33810 Ok(Self(value.to_string()))
33811 }
33812 }
33813 impl ::std::convert::TryFrom<&str> for SolanaTokenMintAddress {
33814 type Error = self::error::ConversionError;
33815 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
33816 value.parse()
33817 }
33818 }
33819 impl ::std::convert::TryFrom<&::std::string::String> for SolanaTokenMintAddress {
33820 type Error = self::error::ConversionError;
33821 fn try_from(
33822 value: &::std::string::String,
33823 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33824 value.parse()
33825 }
33826 }
33827 impl ::std::convert::TryFrom<::std::string::String> for SolanaTokenMintAddress {
33828 type Error = self::error::ConversionError;
33829 fn try_from(
33830 value: ::std::string::String,
33831 ) -> ::std::result::Result<Self, self::error::ConversionError> {
33832 value.parse()
33833 }
33834 }
33835 impl<'de> ::serde::Deserialize<'de> for SolanaTokenMintAddress {
33836 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
33837 where
33838 D: ::serde::Deserializer<'de>,
33839 {
33840 ::std::string::String::deserialize(deserializer)?
33841 .parse()
33842 .map_err(|e: self::error::ConversionError| {
33843 <D::Error as ::serde::de::Error>::custom(e.to_string())
33844 })
33845 }
33846 }
33847 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
33951 pub struct SpendPermission {
33952 pub account: SpendPermissionAccount,
33954 pub allowance: ::std::string::String,
33956 pub end: ::std::string::String,
33958 #[serde(rename = "extraData")]
33960 pub extra_data: ::std::string::String,
33961 pub period: ::std::string::String,
33963 pub salt: ::std::string::String,
33965 pub spender: SpendPermissionSpender,
33967 pub start: ::std::string::String,
33969 pub token: SpendPermissionToken,
33971 }
33972 impl ::std::convert::From<&SpendPermission> for SpendPermission {
33973 fn from(value: &SpendPermission) -> Self {
33974 value.clone()
33975 }
33976 }
33977 impl SpendPermission {
33978 pub fn builder() -> builder::SpendPermission {
33979 Default::default()
33980 }
33981 }
33982 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33998 #[serde(transparent)]
33999 pub struct SpendPermissionAccount(::std::string::String);
34000 impl ::std::ops::Deref for SpendPermissionAccount {
34001 type Target = ::std::string::String;
34002 fn deref(&self) -> &::std::string::String {
34003 &self.0
34004 }
34005 }
34006 impl ::std::convert::From<SpendPermissionAccount> for ::std::string::String {
34007 fn from(value: SpendPermissionAccount) -> Self {
34008 value.0
34009 }
34010 }
34011 impl ::std::convert::From<&SpendPermissionAccount> for SpendPermissionAccount {
34012 fn from(value: &SpendPermissionAccount) -> Self {
34013 value.clone()
34014 }
34015 }
34016 impl ::std::str::FromStr for SpendPermissionAccount {
34017 type Err = self::error::ConversionError;
34018 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34019 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
34020 ::std::sync::LazyLock::new(|| {
34021 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
34022 });
34023 if PATTERN.find(value).is_none() {
34024 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
34025 }
34026 Ok(Self(value.to_string()))
34027 }
34028 }
34029 impl ::std::convert::TryFrom<&str> for SpendPermissionAccount {
34030 type Error = self::error::ConversionError;
34031 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34032 value.parse()
34033 }
34034 }
34035 impl ::std::convert::TryFrom<&::std::string::String> for SpendPermissionAccount {
34036 type Error = self::error::ConversionError;
34037 fn try_from(
34038 value: &::std::string::String,
34039 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34040 value.parse()
34041 }
34042 }
34043 impl ::std::convert::TryFrom<::std::string::String> for SpendPermissionAccount {
34044 type Error = self::error::ConversionError;
34045 fn try_from(
34046 value: ::std::string::String,
34047 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34048 value.parse()
34049 }
34050 }
34051 impl<'de> ::serde::Deserialize<'de> for SpendPermissionAccount {
34052 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
34053 where
34054 D: ::serde::Deserializer<'de>,
34055 {
34056 ::std::string::String::deserialize(deserializer)?
34057 .parse()
34058 .map_err(|e: self::error::ConversionError| {
34059 <D::Error as ::serde::de::Error>::custom(e.to_string())
34060 })
34061 }
34062 }
34063 #[derive(
34088 ::serde::Deserialize,
34089 ::serde::Serialize,
34090 Clone,
34091 Copy,
34092 Debug,
34093 Eq,
34094 Hash,
34095 Ord,
34096 PartialEq,
34097 PartialOrd,
34098 )]
34099 pub enum SpendPermissionNetwork {
34100 #[serde(rename = "base")]
34101 Base,
34102 #[serde(rename = "base-sepolia")]
34103 BaseSepolia,
34104 #[serde(rename = "ethereum")]
34105 Ethereum,
34106 #[serde(rename = "ethereum-sepolia")]
34107 EthereumSepolia,
34108 #[serde(rename = "optimism")]
34109 Optimism,
34110 #[serde(rename = "arbitrum")]
34111 Arbitrum,
34112 #[serde(rename = "avalanche")]
34113 Avalanche,
34114 #[serde(rename = "polygon")]
34115 Polygon,
34116 }
34117 impl ::std::convert::From<&Self> for SpendPermissionNetwork {
34118 fn from(value: &SpendPermissionNetwork) -> Self {
34119 value.clone()
34120 }
34121 }
34122 impl ::std::fmt::Display for SpendPermissionNetwork {
34123 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
34124 match *self {
34125 Self::Base => f.write_str("base"),
34126 Self::BaseSepolia => f.write_str("base-sepolia"),
34127 Self::Ethereum => f.write_str("ethereum"),
34128 Self::EthereumSepolia => f.write_str("ethereum-sepolia"),
34129 Self::Optimism => f.write_str("optimism"),
34130 Self::Arbitrum => f.write_str("arbitrum"),
34131 Self::Avalanche => f.write_str("avalanche"),
34132 Self::Polygon => f.write_str("polygon"),
34133 }
34134 }
34135 }
34136 impl ::std::str::FromStr for SpendPermissionNetwork {
34137 type Err = self::error::ConversionError;
34138 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34139 match value {
34140 "base" => Ok(Self::Base),
34141 "base-sepolia" => Ok(Self::BaseSepolia),
34142 "ethereum" => Ok(Self::Ethereum),
34143 "ethereum-sepolia" => Ok(Self::EthereumSepolia),
34144 "optimism" => Ok(Self::Optimism),
34145 "arbitrum" => Ok(Self::Arbitrum),
34146 "avalanche" => Ok(Self::Avalanche),
34147 "polygon" => Ok(Self::Polygon),
34148 _ => Err("invalid value".into()),
34149 }
34150 }
34151 }
34152 impl ::std::convert::TryFrom<&str> for SpendPermissionNetwork {
34153 type Error = self::error::ConversionError;
34154 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34155 value.parse()
34156 }
34157 }
34158 impl ::std::convert::TryFrom<&::std::string::String> for SpendPermissionNetwork {
34159 type Error = self::error::ConversionError;
34160 fn try_from(
34161 value: &::std::string::String,
34162 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34163 value.parse()
34164 }
34165 }
34166 impl ::std::convert::TryFrom<::std::string::String> for SpendPermissionNetwork {
34167 type Error = self::error::ConversionError;
34168 fn try_from(
34169 value: ::std::string::String,
34170 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34171 value.parse()
34172 }
34173 }
34174 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
34230 pub struct SpendPermissionResponseObject {
34231 #[serde(rename = "createdAt")]
34233 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
34234 pub network: SpendPermissionNetwork,
34235 pub permission: SpendPermission,
34236 #[serde(rename = "permissionHash")]
34238 pub permission_hash: ::std::string::String,
34239 pub revoked: bool,
34241 #[serde(
34243 rename = "revokedAt",
34244 default,
34245 skip_serializing_if = "::std::option::Option::is_none"
34246 )]
34247 pub revoked_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
34248 }
34249 impl ::std::convert::From<&SpendPermissionResponseObject> for SpendPermissionResponseObject {
34250 fn from(value: &SpendPermissionResponseObject) -> Self {
34251 value.clone()
34252 }
34253 }
34254 impl SpendPermissionResponseObject {
34255 pub fn builder() -> builder::SpendPermissionResponseObject {
34256 Default::default()
34257 }
34258 }
34259 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34275 #[serde(transparent)]
34276 pub struct SpendPermissionSpender(::std::string::String);
34277 impl ::std::ops::Deref for SpendPermissionSpender {
34278 type Target = ::std::string::String;
34279 fn deref(&self) -> &::std::string::String {
34280 &self.0
34281 }
34282 }
34283 impl ::std::convert::From<SpendPermissionSpender> for ::std::string::String {
34284 fn from(value: SpendPermissionSpender) -> Self {
34285 value.0
34286 }
34287 }
34288 impl ::std::convert::From<&SpendPermissionSpender> for SpendPermissionSpender {
34289 fn from(value: &SpendPermissionSpender) -> Self {
34290 value.clone()
34291 }
34292 }
34293 impl ::std::str::FromStr for SpendPermissionSpender {
34294 type Err = self::error::ConversionError;
34295 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34296 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
34297 ::std::sync::LazyLock::new(|| {
34298 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
34299 });
34300 if PATTERN.find(value).is_none() {
34301 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
34302 }
34303 Ok(Self(value.to_string()))
34304 }
34305 }
34306 impl ::std::convert::TryFrom<&str> for SpendPermissionSpender {
34307 type Error = self::error::ConversionError;
34308 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34309 value.parse()
34310 }
34311 }
34312 impl ::std::convert::TryFrom<&::std::string::String> for SpendPermissionSpender {
34313 type Error = self::error::ConversionError;
34314 fn try_from(
34315 value: &::std::string::String,
34316 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34317 value.parse()
34318 }
34319 }
34320 impl ::std::convert::TryFrom<::std::string::String> for SpendPermissionSpender {
34321 type Error = self::error::ConversionError;
34322 fn try_from(
34323 value: ::std::string::String,
34324 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34325 value.parse()
34326 }
34327 }
34328 impl<'de> ::serde::Deserialize<'de> for SpendPermissionSpender {
34329 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
34330 where
34331 D: ::serde::Deserializer<'de>,
34332 {
34333 ::std::string::String::deserialize(deserializer)?
34334 .parse()
34335 .map_err(|e: self::error::ConversionError| {
34336 <D::Error as ::serde::de::Error>::custom(e.to_string())
34337 })
34338 }
34339 }
34340 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34356 #[serde(transparent)]
34357 pub struct SpendPermissionToken(::std::string::String);
34358 impl ::std::ops::Deref for SpendPermissionToken {
34359 type Target = ::std::string::String;
34360 fn deref(&self) -> &::std::string::String {
34361 &self.0
34362 }
34363 }
34364 impl ::std::convert::From<SpendPermissionToken> for ::std::string::String {
34365 fn from(value: SpendPermissionToken) -> Self {
34366 value.0
34367 }
34368 }
34369 impl ::std::convert::From<&SpendPermissionToken> for SpendPermissionToken {
34370 fn from(value: &SpendPermissionToken) -> Self {
34371 value.clone()
34372 }
34373 }
34374 impl ::std::str::FromStr for SpendPermissionToken {
34375 type Err = self::error::ConversionError;
34376 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34377 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
34378 ::std::sync::LazyLock::new(|| {
34379 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
34380 });
34381 if PATTERN.find(value).is_none() {
34382 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
34383 }
34384 Ok(Self(value.to_string()))
34385 }
34386 }
34387 impl ::std::convert::TryFrom<&str> for SpendPermissionToken {
34388 type Error = self::error::ConversionError;
34389 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34390 value.parse()
34391 }
34392 }
34393 impl ::std::convert::TryFrom<&::std::string::String> for SpendPermissionToken {
34394 type Error = self::error::ConversionError;
34395 fn try_from(
34396 value: &::std::string::String,
34397 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34398 value.parse()
34399 }
34400 }
34401 impl ::std::convert::TryFrom<::std::string::String> for SpendPermissionToken {
34402 type Error = self::error::ConversionError;
34403 fn try_from(
34404 value: ::std::string::String,
34405 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34406 value.parse()
34407 }
34408 }
34409 impl<'de> ::serde::Deserialize<'de> for SpendPermissionToken {
34410 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
34411 where
34412 D: ::serde::Deserializer<'de>,
34413 {
34414 ::std::string::String::deserialize(deserializer)?
34415 .parse()
34416 .map_err(|e: self::error::ConversionError| {
34417 <D::Error as ::serde::de::Error>::custom(e.to_string())
34418 })
34419 }
34420 }
34421 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
34477 pub struct SplAddressCriterion {
34478 pub addresses: ::std::vec::Vec<SplAddressCriterionAddressesItem>,
34480 pub operator: SplAddressCriterionOperator,
34482 #[serde(rename = "type")]
34484 pub type_: SplAddressCriterionType,
34485 }
34486 impl ::std::convert::From<&SplAddressCriterion> for SplAddressCriterion {
34487 fn from(value: &SplAddressCriterion) -> Self {
34488 value.clone()
34489 }
34490 }
34491 impl SplAddressCriterion {
34492 pub fn builder() -> builder::SplAddressCriterion {
34493 Default::default()
34494 }
34495 }
34496 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34509 #[serde(transparent)]
34510 pub struct SplAddressCriterionAddressesItem(::std::string::String);
34511 impl ::std::ops::Deref for SplAddressCriterionAddressesItem {
34512 type Target = ::std::string::String;
34513 fn deref(&self) -> &::std::string::String {
34514 &self.0
34515 }
34516 }
34517 impl ::std::convert::From<SplAddressCriterionAddressesItem> for ::std::string::String {
34518 fn from(value: SplAddressCriterionAddressesItem) -> Self {
34519 value.0
34520 }
34521 }
34522 impl ::std::convert::From<&SplAddressCriterionAddressesItem> for SplAddressCriterionAddressesItem {
34523 fn from(value: &SplAddressCriterionAddressesItem) -> Self {
34524 value.clone()
34525 }
34526 }
34527 impl ::std::str::FromStr for SplAddressCriterionAddressesItem {
34528 type Err = self::error::ConversionError;
34529 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34530 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
34531 ::std::sync::LazyLock::new(|| {
34532 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
34533 });
34534 if PATTERN.find(value).is_none() {
34535 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
34536 }
34537 Ok(Self(value.to_string()))
34538 }
34539 }
34540 impl ::std::convert::TryFrom<&str> for SplAddressCriterionAddressesItem {
34541 type Error = self::error::ConversionError;
34542 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34543 value.parse()
34544 }
34545 }
34546 impl ::std::convert::TryFrom<&::std::string::String> for SplAddressCriterionAddressesItem {
34547 type Error = self::error::ConversionError;
34548 fn try_from(
34549 value: &::std::string::String,
34550 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34551 value.parse()
34552 }
34553 }
34554 impl ::std::convert::TryFrom<::std::string::String> for SplAddressCriterionAddressesItem {
34555 type Error = self::error::ConversionError;
34556 fn try_from(
34557 value: ::std::string::String,
34558 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34559 value.parse()
34560 }
34561 }
34562 impl<'de> ::serde::Deserialize<'de> for SplAddressCriterionAddressesItem {
34563 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
34564 where
34565 D: ::serde::Deserializer<'de>,
34566 {
34567 ::std::string::String::deserialize(deserializer)?
34568 .parse()
34569 .map_err(|e: self::error::ConversionError| {
34570 <D::Error as ::serde::de::Error>::custom(e.to_string())
34571 })
34572 }
34573 }
34574 #[derive(
34593 ::serde::Deserialize,
34594 ::serde::Serialize,
34595 Clone,
34596 Copy,
34597 Debug,
34598 Eq,
34599 Hash,
34600 Ord,
34601 PartialEq,
34602 PartialOrd,
34603 )]
34604 pub enum SplAddressCriterionOperator {
34605 #[serde(rename = "in")]
34606 In,
34607 #[serde(rename = "not in")]
34608 NotIn,
34609 }
34610 impl ::std::convert::From<&Self> for SplAddressCriterionOperator {
34611 fn from(value: &SplAddressCriterionOperator) -> Self {
34612 value.clone()
34613 }
34614 }
34615 impl ::std::fmt::Display for SplAddressCriterionOperator {
34616 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
34617 match *self {
34618 Self::In => f.write_str("in"),
34619 Self::NotIn => f.write_str("not in"),
34620 }
34621 }
34622 }
34623 impl ::std::str::FromStr for SplAddressCriterionOperator {
34624 type Err = self::error::ConversionError;
34625 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34626 match value {
34627 "in" => Ok(Self::In),
34628 "not in" => Ok(Self::NotIn),
34629 _ => Err("invalid value".into()),
34630 }
34631 }
34632 }
34633 impl ::std::convert::TryFrom<&str> for SplAddressCriterionOperator {
34634 type Error = self::error::ConversionError;
34635 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34636 value.parse()
34637 }
34638 }
34639 impl ::std::convert::TryFrom<&::std::string::String> for SplAddressCriterionOperator {
34640 type Error = self::error::ConversionError;
34641 fn try_from(
34642 value: &::std::string::String,
34643 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34644 value.parse()
34645 }
34646 }
34647 impl ::std::convert::TryFrom<::std::string::String> for SplAddressCriterionOperator {
34648 type Error = self::error::ConversionError;
34649 fn try_from(
34650 value: ::std::string::String,
34651 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34652 value.parse()
34653 }
34654 }
34655 #[derive(
34673 ::serde::Deserialize,
34674 ::serde::Serialize,
34675 Clone,
34676 Copy,
34677 Debug,
34678 Eq,
34679 Hash,
34680 Ord,
34681 PartialEq,
34682 PartialOrd,
34683 )]
34684 pub enum SplAddressCriterionType {
34685 #[serde(rename = "splAddress")]
34686 SplAddress,
34687 }
34688 impl ::std::convert::From<&Self> for SplAddressCriterionType {
34689 fn from(value: &SplAddressCriterionType) -> Self {
34690 value.clone()
34691 }
34692 }
34693 impl ::std::fmt::Display for SplAddressCriterionType {
34694 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
34695 match *self {
34696 Self::SplAddress => f.write_str("splAddress"),
34697 }
34698 }
34699 }
34700 impl ::std::str::FromStr for SplAddressCriterionType {
34701 type Err = self::error::ConversionError;
34702 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34703 match value {
34704 "splAddress" => Ok(Self::SplAddress),
34705 _ => Err("invalid value".into()),
34706 }
34707 }
34708 }
34709 impl ::std::convert::TryFrom<&str> for SplAddressCriterionType {
34710 type Error = self::error::ConversionError;
34711 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34712 value.parse()
34713 }
34714 }
34715 impl ::std::convert::TryFrom<&::std::string::String> for SplAddressCriterionType {
34716 type Error = self::error::ConversionError;
34717 fn try_from(
34718 value: &::std::string::String,
34719 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34720 value.parse()
34721 }
34722 }
34723 impl ::std::convert::TryFrom<::std::string::String> for SplAddressCriterionType {
34724 type Error = self::error::ConversionError;
34725 fn try_from(
34726 value: ::std::string::String,
34727 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34728 value.parse()
34729 }
34730 }
34731 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
34783 pub struct SplValueCriterion {
34784 pub operator: SplValueCriterionOperator,
34786 #[serde(rename = "splValue")]
34788 pub spl_value: ::std::string::String,
34789 #[serde(rename = "type")]
34791 pub type_: SplValueCriterionType,
34792 }
34793 impl ::std::convert::From<&SplValueCriterion> for SplValueCriterion {
34794 fn from(value: &SplValueCriterion) -> Self {
34795 value.clone()
34796 }
34797 }
34798 impl SplValueCriterion {
34799 pub fn builder() -> builder::SplValueCriterion {
34800 Default::default()
34801 }
34802 }
34803 #[derive(
34825 ::serde::Deserialize,
34826 ::serde::Serialize,
34827 Clone,
34828 Copy,
34829 Debug,
34830 Eq,
34831 Hash,
34832 Ord,
34833 PartialEq,
34834 PartialOrd,
34835 )]
34836 pub enum SplValueCriterionOperator {
34837 GreaterThan,
34838 GreaterThanOrEqual,
34839 LessThan,
34840 LessThanOrEqual,
34841 Equal,
34842 }
34843 impl ::std::convert::From<&Self> for SplValueCriterionOperator {
34844 fn from(value: &SplValueCriterionOperator) -> Self {
34845 value.clone()
34846 }
34847 }
34848 impl ::std::fmt::Display for SplValueCriterionOperator {
34849 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
34850 match *self {
34851 Self::GreaterThan => f.write_str("GreaterThan"),
34852 Self::GreaterThanOrEqual => f.write_str("GreaterThanOrEqual"),
34853 Self::LessThan => f.write_str("LessThan"),
34854 Self::LessThanOrEqual => f.write_str("LessThanOrEqual"),
34855 Self::Equal => f.write_str("Equal"),
34856 }
34857 }
34858 }
34859 impl ::std::str::FromStr for SplValueCriterionOperator {
34860 type Err = self::error::ConversionError;
34861 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34862 match value {
34863 "GreaterThan" => Ok(Self::GreaterThan),
34864 "GreaterThanOrEqual" => Ok(Self::GreaterThanOrEqual),
34865 "LessThan" => Ok(Self::LessThan),
34866 "LessThanOrEqual" => Ok(Self::LessThanOrEqual),
34867 "Equal" => Ok(Self::Equal),
34868 _ => Err("invalid value".into()),
34869 }
34870 }
34871 }
34872 impl ::std::convert::TryFrom<&str> for SplValueCriterionOperator {
34873 type Error = self::error::ConversionError;
34874 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34875 value.parse()
34876 }
34877 }
34878 impl ::std::convert::TryFrom<&::std::string::String> for SplValueCriterionOperator {
34879 type Error = self::error::ConversionError;
34880 fn try_from(
34881 value: &::std::string::String,
34882 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34883 value.parse()
34884 }
34885 }
34886 impl ::std::convert::TryFrom<::std::string::String> for SplValueCriterionOperator {
34887 type Error = self::error::ConversionError;
34888 fn try_from(
34889 value: ::std::string::String,
34890 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34891 value.parse()
34892 }
34893 }
34894 #[derive(
34912 ::serde::Deserialize,
34913 ::serde::Serialize,
34914 Clone,
34915 Copy,
34916 Debug,
34917 Eq,
34918 Hash,
34919 Ord,
34920 PartialEq,
34921 PartialOrd,
34922 )]
34923 pub enum SplValueCriterionType {
34924 #[serde(rename = "splValue")]
34925 SplValue,
34926 }
34927 impl ::std::convert::From<&Self> for SplValueCriterionType {
34928 fn from(value: &SplValueCriterionType) -> Self {
34929 value.clone()
34930 }
34931 }
34932 impl ::std::fmt::Display for SplValueCriterionType {
34933 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
34934 match *self {
34935 Self::SplValue => f.write_str("splValue"),
34936 }
34937 }
34938 }
34939 impl ::std::str::FromStr for SplValueCriterionType {
34940 type Err = self::error::ConversionError;
34941 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34942 match value {
34943 "splValue" => Ok(Self::SplValue),
34944 _ => Err("invalid value".into()),
34945 }
34946 }
34947 }
34948 impl ::std::convert::TryFrom<&str> for SplValueCriterionType {
34949 type Error = self::error::ConversionError;
34950 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
34951 value.parse()
34952 }
34953 }
34954 impl ::std::convert::TryFrom<&::std::string::String> for SplValueCriterionType {
34955 type Error = self::error::ConversionError;
34956 fn try_from(
34957 value: &::std::string::String,
34958 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34959 value.parse()
34960 }
34961 }
34962 impl ::std::convert::TryFrom<::std::string::String> for SplValueCriterionType {
34963 type Error = self::error::ConversionError;
34964 fn try_from(
34965 value: ::std::string::String,
34966 ) -> ::std::result::Result<Self, self::error::ConversionError> {
34967 value.parse()
34968 }
34969 }
34970 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
35052 pub struct SupportedX402PaymentKindsResponse {
35053 pub extensions: ::std::vec::Vec<::std::string::String>,
35055 pub kinds: ::std::vec::Vec<X402SupportedPaymentKind>,
35057 pub signers: ::std::collections::HashMap<
35059 ::std::string::String,
35060 ::std::vec::Vec<::std::string::String>,
35061 >,
35062 }
35063 impl ::std::convert::From<&SupportedX402PaymentKindsResponse>
35064 for SupportedX402PaymentKindsResponse
35065 {
35066 fn from(value: &SupportedX402PaymentKindsResponse) -> Self {
35067 value.clone()
35068 }
35069 }
35070 impl SupportedX402PaymentKindsResponse {
35071 pub fn builder() -> builder::SupportedX402PaymentKindsResponse {
35072 Default::default()
35073 }
35074 }
35075 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
35107 pub struct SwapUnavailableResponse {
35108 #[serde(rename = "liquidityAvailable")]
35110 pub liquidity_available: bool,
35111 }
35112 impl ::std::convert::From<&SwapUnavailableResponse> for SwapUnavailableResponse {
35113 fn from(value: &SwapUnavailableResponse) -> Self {
35114 value.clone()
35115 }
35116 }
35117 impl SwapUnavailableResponse {
35118 pub fn builder() -> builder::SwapUnavailableResponse {
35119 Default::default()
35120 }
35121 }
35122 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35138 #[serde(transparent)]
35139 pub struct Taker(::std::string::String);
35140 impl ::std::ops::Deref for Taker {
35141 type Target = ::std::string::String;
35142 fn deref(&self) -> &::std::string::String {
35143 &self.0
35144 }
35145 }
35146 impl ::std::convert::From<Taker> for ::std::string::String {
35147 fn from(value: Taker) -> Self {
35148 value.0
35149 }
35150 }
35151 impl ::std::convert::From<&Taker> for Taker {
35152 fn from(value: &Taker) -> Self {
35153 value.clone()
35154 }
35155 }
35156 impl ::std::str::FromStr for Taker {
35157 type Err = self::error::ConversionError;
35158 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35159 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
35160 ::std::sync::LazyLock::new(|| {
35161 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
35162 });
35163 if PATTERN.find(value).is_none() {
35164 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
35165 }
35166 Ok(Self(value.to_string()))
35167 }
35168 }
35169 impl ::std::convert::TryFrom<&str> for Taker {
35170 type Error = self::error::ConversionError;
35171 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35172 value.parse()
35173 }
35174 }
35175 impl ::std::convert::TryFrom<&::std::string::String> for Taker {
35176 type Error = self::error::ConversionError;
35177 fn try_from(
35178 value: &::std::string::String,
35179 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35180 value.parse()
35181 }
35182 }
35183 impl ::std::convert::TryFrom<::std::string::String> for Taker {
35184 type Error = self::error::ConversionError;
35185 fn try_from(
35186 value: ::std::string::String,
35187 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35188 value.parse()
35189 }
35190 }
35191 impl<'de> ::serde::Deserialize<'de> for Taker {
35192 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
35193 where
35194 D: ::serde::Deserializer<'de>,
35195 {
35196 ::std::string::String::deserialize(deserializer)?
35197 .parse()
35198 .map_err(|e: self::error::ConversionError| {
35199 <D::Error as ::serde::de::Error>::custom(e.to_string())
35200 })
35201 }
35202 }
35203 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35219 #[serde(transparent)]
35220 pub struct ToToken(::std::string::String);
35221 impl ::std::ops::Deref for ToToken {
35222 type Target = ::std::string::String;
35223 fn deref(&self) -> &::std::string::String {
35224 &self.0
35225 }
35226 }
35227 impl ::std::convert::From<ToToken> for ::std::string::String {
35228 fn from(value: ToToken) -> Self {
35229 value.0
35230 }
35231 }
35232 impl ::std::convert::From<&ToToken> for ToToken {
35233 fn from(value: &ToToken) -> Self {
35234 value.clone()
35235 }
35236 }
35237 impl ::std::str::FromStr for ToToken {
35238 type Err = self::error::ConversionError;
35239 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35240 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
35241 ::std::sync::LazyLock::new(|| {
35242 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
35243 });
35244 if PATTERN.find(value).is_none() {
35245 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
35246 }
35247 Ok(Self(value.to_string()))
35248 }
35249 }
35250 impl ::std::convert::TryFrom<&str> for ToToken {
35251 type Error = self::error::ConversionError;
35252 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35253 value.parse()
35254 }
35255 }
35256 impl ::std::convert::TryFrom<&::std::string::String> for ToToken {
35257 type Error = self::error::ConversionError;
35258 fn try_from(
35259 value: &::std::string::String,
35260 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35261 value.parse()
35262 }
35263 }
35264 impl ::std::convert::TryFrom<::std::string::String> for ToToken {
35265 type Error = self::error::ConversionError;
35266 fn try_from(
35267 value: ::std::string::String,
35268 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35269 value.parse()
35270 }
35271 }
35272 impl<'de> ::serde::Deserialize<'de> for ToToken {
35273 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
35274 where
35275 D: ::serde::Deserializer<'de>,
35276 {
35277 ::std::string::String::deserialize(deserializer)?
35278 .parse()
35279 .map_err(|e: self::error::ConversionError| {
35280 <D::Error as ::serde::de::Error>::custom(e.to_string())
35281 })
35282 }
35283 }
35284 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
35335 pub struct Token {
35336 #[serde(rename = "contractAddress")]
35339 pub contract_address: TokenContractAddress,
35340 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
35346 pub name: ::std::option::Option<::std::string::String>,
35347 pub network: ListEvmTokenBalancesNetwork,
35348 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
35354 pub symbol: ::std::option::Option<::std::string::String>,
35355 }
35356 impl ::std::convert::From<&Token> for Token {
35357 fn from(value: &Token) -> Self {
35358 value.clone()
35359 }
35360 }
35361 impl Token {
35362 pub fn builder() -> builder::Token {
35363 Default::default()
35364 }
35365 }
35366 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
35406 pub struct TokenAmount {
35407 pub amount: TokenAmountAmount,
35409 pub decimals: i64,
35414 }
35415 impl ::std::convert::From<&TokenAmount> for TokenAmount {
35416 fn from(value: &TokenAmount) -> Self {
35417 value.clone()
35418 }
35419 }
35420 impl TokenAmount {
35421 pub fn builder() -> builder::TokenAmount {
35422 Default::default()
35423 }
35424 }
35425 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35441 #[serde(transparent)]
35442 pub struct TokenAmountAmount(::std::string::String);
35443 impl ::std::ops::Deref for TokenAmountAmount {
35444 type Target = ::std::string::String;
35445 fn deref(&self) -> &::std::string::String {
35446 &self.0
35447 }
35448 }
35449 impl ::std::convert::From<TokenAmountAmount> for ::std::string::String {
35450 fn from(value: TokenAmountAmount) -> Self {
35451 value.0
35452 }
35453 }
35454 impl ::std::convert::From<&TokenAmountAmount> for TokenAmountAmount {
35455 fn from(value: &TokenAmountAmount) -> Self {
35456 value.clone()
35457 }
35458 }
35459 impl ::std::str::FromStr for TokenAmountAmount {
35460 type Err = self::error::ConversionError;
35461 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35462 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
35463 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[0-9]+$").unwrap());
35464 if PATTERN.find(value).is_none() {
35465 return Err("doesn't match pattern \"^[0-9]+$\"".into());
35466 }
35467 Ok(Self(value.to_string()))
35468 }
35469 }
35470 impl ::std::convert::TryFrom<&str> for TokenAmountAmount {
35471 type Error = self::error::ConversionError;
35472 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35473 value.parse()
35474 }
35475 }
35476 impl ::std::convert::TryFrom<&::std::string::String> for TokenAmountAmount {
35477 type Error = self::error::ConversionError;
35478 fn try_from(
35479 value: &::std::string::String,
35480 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35481 value.parse()
35482 }
35483 }
35484 impl ::std::convert::TryFrom<::std::string::String> for TokenAmountAmount {
35485 type Error = self::error::ConversionError;
35486 fn try_from(
35487 value: ::std::string::String,
35488 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35489 value.parse()
35490 }
35491 }
35492 impl<'de> ::serde::Deserialize<'de> for TokenAmountAmount {
35493 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
35494 where
35495 D: ::serde::Deserializer<'de>,
35496 {
35497 ::std::string::String::deserialize(deserializer)?
35498 .parse()
35499 .map_err(|e: self::error::ConversionError| {
35500 <D::Error as ::serde::de::Error>::custom(e.to_string())
35501 })
35502 }
35503 }
35504 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
35527 pub struct TokenBalance {
35528 pub amount: TokenAmount,
35529 pub token: Token,
35530 }
35531 impl ::std::convert::From<&TokenBalance> for TokenBalance {
35532 fn from(value: &TokenBalance) -> Self {
35533 value.clone()
35534 }
35535 }
35536 impl TokenBalance {
35537 pub fn builder() -> builder::TokenBalance {
35538 Default::default()
35539 }
35540 }
35541 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35558 #[serde(transparent)]
35559 pub struct TokenContractAddress(::std::string::String);
35560 impl ::std::ops::Deref for TokenContractAddress {
35561 type Target = ::std::string::String;
35562 fn deref(&self) -> &::std::string::String {
35563 &self.0
35564 }
35565 }
35566 impl ::std::convert::From<TokenContractAddress> for ::std::string::String {
35567 fn from(value: TokenContractAddress) -> Self {
35568 value.0
35569 }
35570 }
35571 impl ::std::convert::From<&TokenContractAddress> for TokenContractAddress {
35572 fn from(value: &TokenContractAddress) -> Self {
35573 value.clone()
35574 }
35575 }
35576 impl ::std::str::FromStr for TokenContractAddress {
35577 type Err = self::error::ConversionError;
35578 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35579 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
35580 ::std::sync::LazyLock::new(|| {
35581 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
35582 });
35583 if PATTERN.find(value).is_none() {
35584 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
35585 }
35586 Ok(Self(value.to_string()))
35587 }
35588 }
35589 impl ::std::convert::TryFrom<&str> for TokenContractAddress {
35590 type Error = self::error::ConversionError;
35591 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35592 value.parse()
35593 }
35594 }
35595 impl ::std::convert::TryFrom<&::std::string::String> for TokenContractAddress {
35596 type Error = self::error::ConversionError;
35597 fn try_from(
35598 value: &::std::string::String,
35599 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35600 value.parse()
35601 }
35602 }
35603 impl ::std::convert::TryFrom<::std::string::String> for TokenContractAddress {
35604 type Error = self::error::ConversionError;
35605 fn try_from(
35606 value: ::std::string::String,
35607 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35608 value.parse()
35609 }
35610 }
35611 impl<'de> ::serde::Deserialize<'de> for TokenContractAddress {
35612 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
35613 where
35614 D: ::serde::Deserializer<'de>,
35615 {
35616 ::std::string::String::deserialize(deserializer)?
35617 .parse()
35618 .map_err(|e: self::error::ConversionError| {
35619 <D::Error as ::serde::de::Error>::custom(e.to_string())
35620 })
35621 }
35622 }
35623 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
35656 pub struct TokenFee {
35657 pub amount: TokenFeeAmount,
35659 pub token: TokenFeeToken,
35661 }
35662 impl ::std::convert::From<&TokenFee> for TokenFee {
35663 fn from(value: &TokenFee) -> Self {
35664 value.clone()
35665 }
35666 }
35667 impl TokenFee {
35668 pub fn builder() -> builder::TokenFee {
35669 Default::default()
35670 }
35671 }
35672 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35688 #[serde(transparent)]
35689 pub struct TokenFeeAmount(::std::string::String);
35690 impl ::std::ops::Deref for TokenFeeAmount {
35691 type Target = ::std::string::String;
35692 fn deref(&self) -> &::std::string::String {
35693 &self.0
35694 }
35695 }
35696 impl ::std::convert::From<TokenFeeAmount> for ::std::string::String {
35697 fn from(value: TokenFeeAmount) -> Self {
35698 value.0
35699 }
35700 }
35701 impl ::std::convert::From<&TokenFeeAmount> for TokenFeeAmount {
35702 fn from(value: &TokenFeeAmount) -> Self {
35703 value.clone()
35704 }
35705 }
35706 impl ::std::str::FromStr for TokenFeeAmount {
35707 type Err = self::error::ConversionError;
35708 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35709 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
35710 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d+$").unwrap());
35711 if PATTERN.find(value).is_none() {
35712 return Err("doesn't match pattern \"^\\d+$\"".into());
35713 }
35714 Ok(Self(value.to_string()))
35715 }
35716 }
35717 impl ::std::convert::TryFrom<&str> for TokenFeeAmount {
35718 type Error = self::error::ConversionError;
35719 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35720 value.parse()
35721 }
35722 }
35723 impl ::std::convert::TryFrom<&::std::string::String> for TokenFeeAmount {
35724 type Error = self::error::ConversionError;
35725 fn try_from(
35726 value: &::std::string::String,
35727 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35728 value.parse()
35729 }
35730 }
35731 impl ::std::convert::TryFrom<::std::string::String> for TokenFeeAmount {
35732 type Error = self::error::ConversionError;
35733 fn try_from(
35734 value: ::std::string::String,
35735 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35736 value.parse()
35737 }
35738 }
35739 impl<'de> ::serde::Deserialize<'de> for TokenFeeAmount {
35740 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
35741 where
35742 D: ::serde::Deserializer<'de>,
35743 {
35744 ::std::string::String::deserialize(deserializer)?
35745 .parse()
35746 .map_err(|e: self::error::ConversionError| {
35747 <D::Error as ::serde::de::Error>::custom(e.to_string())
35748 })
35749 }
35750 }
35751 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35767 #[serde(transparent)]
35768 pub struct TokenFeeToken(::std::string::String);
35769 impl ::std::ops::Deref for TokenFeeToken {
35770 type Target = ::std::string::String;
35771 fn deref(&self) -> &::std::string::String {
35772 &self.0
35773 }
35774 }
35775 impl ::std::convert::From<TokenFeeToken> for ::std::string::String {
35776 fn from(value: TokenFeeToken) -> Self {
35777 value.0
35778 }
35779 }
35780 impl ::std::convert::From<&TokenFeeToken> for TokenFeeToken {
35781 fn from(value: &TokenFeeToken) -> Self {
35782 value.clone()
35783 }
35784 }
35785 impl ::std::str::FromStr for TokenFeeToken {
35786 type Err = self::error::ConversionError;
35787 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35788 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
35789 ::std::sync::LazyLock::new(|| {
35790 ::regress::Regex::new("^0x[a-fA-F0-9]{40}$").unwrap()
35791 });
35792 if PATTERN.find(value).is_none() {
35793 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{40}$\"".into());
35794 }
35795 Ok(Self(value.to_string()))
35796 }
35797 }
35798 impl ::std::convert::TryFrom<&str> for TokenFeeToken {
35799 type Error = self::error::ConversionError;
35800 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35801 value.parse()
35802 }
35803 }
35804 impl ::std::convert::TryFrom<&::std::string::String> for TokenFeeToken {
35805 type Error = self::error::ConversionError;
35806 fn try_from(
35807 value: &::std::string::String,
35808 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35809 value.parse()
35810 }
35811 }
35812 impl ::std::convert::TryFrom<::std::string::String> for TokenFeeToken {
35813 type Error = self::error::ConversionError;
35814 fn try_from(
35815 value: ::std::string::String,
35816 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35817 value.parse()
35818 }
35819 }
35820 impl<'de> ::serde::Deserialize<'de> for TokenFeeToken {
35821 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
35822 where
35823 D: ::serde::Deserializer<'de>,
35824 {
35825 ::std::string::String::deserialize(deserializer)?
35826 .parse()
35827 .map_err(|e: self::error::ConversionError| {
35828 <D::Error as ::serde::de::Error>::custom(e.to_string())
35829 })
35830 }
35831 }
35832 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35844 #[serde(transparent)]
35845 pub struct UpdateEvmAccountAddress(::std::string::String);
35846 impl ::std::ops::Deref for UpdateEvmAccountAddress {
35847 type Target = ::std::string::String;
35848 fn deref(&self) -> &::std::string::String {
35849 &self.0
35850 }
35851 }
35852 impl ::std::convert::From<UpdateEvmAccountAddress> for ::std::string::String {
35853 fn from(value: UpdateEvmAccountAddress) -> Self {
35854 value.0
35855 }
35856 }
35857 impl ::std::convert::From<&UpdateEvmAccountAddress> for UpdateEvmAccountAddress {
35858 fn from(value: &UpdateEvmAccountAddress) -> Self {
35859 value.clone()
35860 }
35861 }
35862 impl ::std::str::FromStr for UpdateEvmAccountAddress {
35863 type Err = self::error::ConversionError;
35864 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35865 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
35866 ::std::sync::LazyLock::new(|| {
35867 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
35868 });
35869 if PATTERN.find(value).is_none() {
35870 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
35871 }
35872 Ok(Self(value.to_string()))
35873 }
35874 }
35875 impl ::std::convert::TryFrom<&str> for UpdateEvmAccountAddress {
35876 type Error = self::error::ConversionError;
35877 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
35878 value.parse()
35879 }
35880 }
35881 impl ::std::convert::TryFrom<&::std::string::String> for UpdateEvmAccountAddress {
35882 type Error = self::error::ConversionError;
35883 fn try_from(
35884 value: &::std::string::String,
35885 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35886 value.parse()
35887 }
35888 }
35889 impl ::std::convert::TryFrom<::std::string::String> for UpdateEvmAccountAddress {
35890 type Error = self::error::ConversionError;
35891 fn try_from(
35892 value: ::std::string::String,
35893 ) -> ::std::result::Result<Self, self::error::ConversionError> {
35894 value.parse()
35895 }
35896 }
35897 impl<'de> ::serde::Deserialize<'de> for UpdateEvmAccountAddress {
35898 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
35899 where
35900 D: ::serde::Deserializer<'de>,
35901 {
35902 ::std::string::String::deserialize(deserializer)?
35903 .parse()
35904 .map_err(|e: self::error::ConversionError| {
35905 <D::Error as ::serde::de::Error>::custom(e.to_string())
35906 })
35907 }
35908 }
35909 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
35939 pub struct UpdateEvmAccountBody {
35940 #[serde(
35942 rename = "accountPolicy",
35943 default,
35944 skip_serializing_if = "::std::option::Option::is_none"
35945 )]
35946 pub account_policy: ::std::option::Option<UpdateEvmAccountBodyAccountPolicy>,
35947 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
35951 pub name: ::std::option::Option<UpdateEvmAccountBodyName>,
35952 }
35953 impl ::std::convert::From<&UpdateEvmAccountBody> for UpdateEvmAccountBody {
35954 fn from(value: &UpdateEvmAccountBody) -> Self {
35955 value.clone()
35956 }
35957 }
35958 impl ::std::default::Default for UpdateEvmAccountBody {
35959 fn default() -> Self {
35960 Self {
35961 account_policy: Default::default(),
35962 name: Default::default(),
35963 }
35964 }
35965 }
35966 impl UpdateEvmAccountBody {
35967 pub fn builder() -> builder::UpdateEvmAccountBody {
35968 Default::default()
35969 }
35970 }
35971 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35988 #[serde(transparent)]
35989 pub struct UpdateEvmAccountBodyAccountPolicy(::std::string::String);
35990 impl ::std::ops::Deref for UpdateEvmAccountBodyAccountPolicy {
35991 type Target = ::std::string::String;
35992 fn deref(&self) -> &::std::string::String {
35993 &self.0
35994 }
35995 }
35996 impl ::std::convert::From<UpdateEvmAccountBodyAccountPolicy> for ::std::string::String {
35997 fn from(value: UpdateEvmAccountBodyAccountPolicy) -> Self {
35998 value.0
35999 }
36000 }
36001 impl ::std::convert::From<&UpdateEvmAccountBodyAccountPolicy>
36002 for UpdateEvmAccountBodyAccountPolicy
36003 {
36004 fn from(value: &UpdateEvmAccountBodyAccountPolicy) -> Self {
36005 value.clone()
36006 }
36007 }
36008 impl ::std::str::FromStr for UpdateEvmAccountBodyAccountPolicy {
36009 type Err = self::error::ConversionError;
36010 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36011 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
36012 || {
36013 ::regress::Regex::new(
36014 "(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)|(^$)",
36015 )
36016 .unwrap()
36017 },
36018 );
36019 if PATTERN.find(value).is_none() {
36020 return Err(
36021 "doesn't match pattern \"(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)|(^$)\""
36022 .into(),
36023 );
36024 }
36025 Ok(Self(value.to_string()))
36026 }
36027 }
36028 impl ::std::convert::TryFrom<&str> for UpdateEvmAccountBodyAccountPolicy {
36029 type Error = self::error::ConversionError;
36030 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36031 value.parse()
36032 }
36033 }
36034 impl ::std::convert::TryFrom<&::std::string::String> for UpdateEvmAccountBodyAccountPolicy {
36035 type Error = self::error::ConversionError;
36036 fn try_from(
36037 value: &::std::string::String,
36038 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36039 value.parse()
36040 }
36041 }
36042 impl ::std::convert::TryFrom<::std::string::String> for UpdateEvmAccountBodyAccountPolicy {
36043 type Error = self::error::ConversionError;
36044 fn try_from(
36045 value: ::std::string::String,
36046 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36047 value.parse()
36048 }
36049 }
36050 impl<'de> ::serde::Deserialize<'de> for UpdateEvmAccountBodyAccountPolicy {
36051 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36052 where
36053 D: ::serde::Deserializer<'de>,
36054 {
36055 ::std::string::String::deserialize(deserializer)?
36056 .parse()
36057 .map_err(|e: self::error::ConversionError| {
36058 <D::Error as ::serde::de::Error>::custom(e.to_string())
36059 })
36060 }
36061 }
36062 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36080 #[serde(transparent)]
36081 pub struct UpdateEvmAccountBodyName(::std::string::String);
36082 impl ::std::ops::Deref for UpdateEvmAccountBodyName {
36083 type Target = ::std::string::String;
36084 fn deref(&self) -> &::std::string::String {
36085 &self.0
36086 }
36087 }
36088 impl ::std::convert::From<UpdateEvmAccountBodyName> for ::std::string::String {
36089 fn from(value: UpdateEvmAccountBodyName) -> Self {
36090 value.0
36091 }
36092 }
36093 impl ::std::convert::From<&UpdateEvmAccountBodyName> for UpdateEvmAccountBodyName {
36094 fn from(value: &UpdateEvmAccountBodyName) -> Self {
36095 value.clone()
36096 }
36097 }
36098 impl ::std::str::FromStr for UpdateEvmAccountBodyName {
36099 type Err = self::error::ConversionError;
36100 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36101 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
36102 ::std::sync::LazyLock::new(|| {
36103 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
36104 });
36105 if PATTERN.find(value).is_none() {
36106 return Err(
36107 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
36108 );
36109 }
36110 Ok(Self(value.to_string()))
36111 }
36112 }
36113 impl ::std::convert::TryFrom<&str> for UpdateEvmAccountBodyName {
36114 type Error = self::error::ConversionError;
36115 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36116 value.parse()
36117 }
36118 }
36119 impl ::std::convert::TryFrom<&::std::string::String> for UpdateEvmAccountBodyName {
36120 type Error = self::error::ConversionError;
36121 fn try_from(
36122 value: &::std::string::String,
36123 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36124 value.parse()
36125 }
36126 }
36127 impl ::std::convert::TryFrom<::std::string::String> for UpdateEvmAccountBodyName {
36128 type Error = self::error::ConversionError;
36129 fn try_from(
36130 value: ::std::string::String,
36131 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36132 value.parse()
36133 }
36134 }
36135 impl<'de> ::serde::Deserialize<'de> for UpdateEvmAccountBodyName {
36136 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36137 where
36138 D: ::serde::Deserializer<'de>,
36139 {
36140 ::std::string::String::deserialize(deserializer)?
36141 .parse()
36142 .map_err(|e: self::error::ConversionError| {
36143 <D::Error as ::serde::de::Error>::custom(e.to_string())
36144 })
36145 }
36146 }
36147 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36161 #[serde(transparent)]
36162 pub struct UpdateEvmAccountXIdempotencyKey(::std::string::String);
36163 impl ::std::ops::Deref for UpdateEvmAccountXIdempotencyKey {
36164 type Target = ::std::string::String;
36165 fn deref(&self) -> &::std::string::String {
36166 &self.0
36167 }
36168 }
36169 impl ::std::convert::From<UpdateEvmAccountXIdempotencyKey> for ::std::string::String {
36170 fn from(value: UpdateEvmAccountXIdempotencyKey) -> Self {
36171 value.0
36172 }
36173 }
36174 impl ::std::convert::From<&UpdateEvmAccountXIdempotencyKey> for UpdateEvmAccountXIdempotencyKey {
36175 fn from(value: &UpdateEvmAccountXIdempotencyKey) -> Self {
36176 value.clone()
36177 }
36178 }
36179 impl ::std::str::FromStr for UpdateEvmAccountXIdempotencyKey {
36180 type Err = self::error::ConversionError;
36181 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36182 if value.chars().count() > 36usize {
36183 return Err("longer than 36 characters".into());
36184 }
36185 if value.chars().count() < 36usize {
36186 return Err("shorter than 36 characters".into());
36187 }
36188 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
36189 ::std::sync::LazyLock::new(|| {
36190 ::regress::Regex::new(
36191 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
36192 )
36193 .unwrap()
36194 });
36195 if PATTERN.find(value).is_none() {
36196 return Err(
36197 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
36198 .into(),
36199 );
36200 }
36201 Ok(Self(value.to_string()))
36202 }
36203 }
36204 impl ::std::convert::TryFrom<&str> for UpdateEvmAccountXIdempotencyKey {
36205 type Error = self::error::ConversionError;
36206 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36207 value.parse()
36208 }
36209 }
36210 impl ::std::convert::TryFrom<&::std::string::String> for UpdateEvmAccountXIdempotencyKey {
36211 type Error = self::error::ConversionError;
36212 fn try_from(
36213 value: &::std::string::String,
36214 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36215 value.parse()
36216 }
36217 }
36218 impl ::std::convert::TryFrom<::std::string::String> for UpdateEvmAccountXIdempotencyKey {
36219 type Error = self::error::ConversionError;
36220 fn try_from(
36221 value: ::std::string::String,
36222 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36223 value.parse()
36224 }
36225 }
36226 impl<'de> ::serde::Deserialize<'de> for UpdateEvmAccountXIdempotencyKey {
36227 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36228 where
36229 D: ::serde::Deserializer<'de>,
36230 {
36231 ::std::string::String::deserialize(deserializer)?
36232 .parse()
36233 .map_err(|e: self::error::ConversionError| {
36234 <D::Error as ::serde::de::Error>::custom(e.to_string())
36235 })
36236 }
36237 }
36238 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36250 #[serde(transparent)]
36251 pub struct UpdateEvmSmartAccountAddress(::std::string::String);
36252 impl ::std::ops::Deref for UpdateEvmSmartAccountAddress {
36253 type Target = ::std::string::String;
36254 fn deref(&self) -> &::std::string::String {
36255 &self.0
36256 }
36257 }
36258 impl ::std::convert::From<UpdateEvmSmartAccountAddress> for ::std::string::String {
36259 fn from(value: UpdateEvmSmartAccountAddress) -> Self {
36260 value.0
36261 }
36262 }
36263 impl ::std::convert::From<&UpdateEvmSmartAccountAddress> for UpdateEvmSmartAccountAddress {
36264 fn from(value: &UpdateEvmSmartAccountAddress) -> Self {
36265 value.clone()
36266 }
36267 }
36268 impl ::std::str::FromStr for UpdateEvmSmartAccountAddress {
36269 type Err = self::error::ConversionError;
36270 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36271 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
36272 ::std::sync::LazyLock::new(|| {
36273 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
36274 });
36275 if PATTERN.find(value).is_none() {
36276 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
36277 }
36278 Ok(Self(value.to_string()))
36279 }
36280 }
36281 impl ::std::convert::TryFrom<&str> for UpdateEvmSmartAccountAddress {
36282 type Error = self::error::ConversionError;
36283 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36284 value.parse()
36285 }
36286 }
36287 impl ::std::convert::TryFrom<&::std::string::String> for UpdateEvmSmartAccountAddress {
36288 type Error = self::error::ConversionError;
36289 fn try_from(
36290 value: &::std::string::String,
36291 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36292 value.parse()
36293 }
36294 }
36295 impl ::std::convert::TryFrom<::std::string::String> for UpdateEvmSmartAccountAddress {
36296 type Error = self::error::ConversionError;
36297 fn try_from(
36298 value: ::std::string::String,
36299 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36300 value.parse()
36301 }
36302 }
36303 impl<'de> ::serde::Deserialize<'de> for UpdateEvmSmartAccountAddress {
36304 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36305 where
36306 D: ::serde::Deserializer<'de>,
36307 {
36308 ::std::string::String::deserialize(deserializer)?
36309 .parse()
36310 .map_err(|e: self::error::ConversionError| {
36311 <D::Error as ::serde::de::Error>::custom(e.to_string())
36312 })
36313 }
36314 }
36315 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
36336 pub struct UpdateEvmSmartAccountBody {
36337 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
36341 pub name: ::std::option::Option<UpdateEvmSmartAccountBodyName>,
36342 }
36343 impl ::std::convert::From<&UpdateEvmSmartAccountBody> for UpdateEvmSmartAccountBody {
36344 fn from(value: &UpdateEvmSmartAccountBody) -> Self {
36345 value.clone()
36346 }
36347 }
36348 impl ::std::default::Default for UpdateEvmSmartAccountBody {
36349 fn default() -> Self {
36350 Self {
36351 name: Default::default(),
36352 }
36353 }
36354 }
36355 impl UpdateEvmSmartAccountBody {
36356 pub fn builder() -> builder::UpdateEvmSmartAccountBody {
36357 Default::default()
36358 }
36359 }
36360 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36378 #[serde(transparent)]
36379 pub struct UpdateEvmSmartAccountBodyName(::std::string::String);
36380 impl ::std::ops::Deref for UpdateEvmSmartAccountBodyName {
36381 type Target = ::std::string::String;
36382 fn deref(&self) -> &::std::string::String {
36383 &self.0
36384 }
36385 }
36386 impl ::std::convert::From<UpdateEvmSmartAccountBodyName> for ::std::string::String {
36387 fn from(value: UpdateEvmSmartAccountBodyName) -> Self {
36388 value.0
36389 }
36390 }
36391 impl ::std::convert::From<&UpdateEvmSmartAccountBodyName> for UpdateEvmSmartAccountBodyName {
36392 fn from(value: &UpdateEvmSmartAccountBodyName) -> Self {
36393 value.clone()
36394 }
36395 }
36396 impl ::std::str::FromStr for UpdateEvmSmartAccountBodyName {
36397 type Err = self::error::ConversionError;
36398 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36399 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
36400 ::std::sync::LazyLock::new(|| {
36401 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
36402 });
36403 if PATTERN.find(value).is_none() {
36404 return Err(
36405 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
36406 );
36407 }
36408 Ok(Self(value.to_string()))
36409 }
36410 }
36411 impl ::std::convert::TryFrom<&str> for UpdateEvmSmartAccountBodyName {
36412 type Error = self::error::ConversionError;
36413 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36414 value.parse()
36415 }
36416 }
36417 impl ::std::convert::TryFrom<&::std::string::String> for UpdateEvmSmartAccountBodyName {
36418 type Error = self::error::ConversionError;
36419 fn try_from(
36420 value: &::std::string::String,
36421 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36422 value.parse()
36423 }
36424 }
36425 impl ::std::convert::TryFrom<::std::string::String> for UpdateEvmSmartAccountBodyName {
36426 type Error = self::error::ConversionError;
36427 fn try_from(
36428 value: ::std::string::String,
36429 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36430 value.parse()
36431 }
36432 }
36433 impl<'de> ::serde::Deserialize<'de> for UpdateEvmSmartAccountBodyName {
36434 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36435 where
36436 D: ::serde::Deserializer<'de>,
36437 {
36438 ::std::string::String::deserialize(deserializer)?
36439 .parse()
36440 .map_err(|e: self::error::ConversionError| {
36441 <D::Error as ::serde::de::Error>::custom(e.to_string())
36442 })
36443 }
36444 }
36445 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
36476 pub struct UpdatePolicyBody {
36477 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
36480 pub description: ::std::option::Option<UpdatePolicyBodyDescription>,
36481 pub rules: ::std::vec::Vec<Rule>,
36483 }
36484 impl ::std::convert::From<&UpdatePolicyBody> for UpdatePolicyBody {
36485 fn from(value: &UpdatePolicyBody) -> Self {
36486 value.clone()
36487 }
36488 }
36489 impl UpdatePolicyBody {
36490 pub fn builder() -> builder::UpdatePolicyBody {
36491 Default::default()
36492 }
36493 }
36494 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36511 #[serde(transparent)]
36512 pub struct UpdatePolicyBodyDescription(::std::string::String);
36513 impl ::std::ops::Deref for UpdatePolicyBodyDescription {
36514 type Target = ::std::string::String;
36515 fn deref(&self) -> &::std::string::String {
36516 &self.0
36517 }
36518 }
36519 impl ::std::convert::From<UpdatePolicyBodyDescription> for ::std::string::String {
36520 fn from(value: UpdatePolicyBodyDescription) -> Self {
36521 value.0
36522 }
36523 }
36524 impl ::std::convert::From<&UpdatePolicyBodyDescription> for UpdatePolicyBodyDescription {
36525 fn from(value: &UpdatePolicyBodyDescription) -> Self {
36526 value.clone()
36527 }
36528 }
36529 impl ::std::str::FromStr for UpdatePolicyBodyDescription {
36530 type Err = self::error::ConversionError;
36531 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36532 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
36533 ::std::sync::LazyLock::new(|| {
36534 ::regress::Regex::new("^[A-Za-z0-9 ,.]{1,50}$").unwrap()
36535 });
36536 if PATTERN.find(value).is_none() {
36537 return Err("doesn't match pattern \"^[A-Za-z0-9 ,.]{1,50}$\"".into());
36538 }
36539 Ok(Self(value.to_string()))
36540 }
36541 }
36542 impl ::std::convert::TryFrom<&str> for UpdatePolicyBodyDescription {
36543 type Error = self::error::ConversionError;
36544 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36545 value.parse()
36546 }
36547 }
36548 impl ::std::convert::TryFrom<&::std::string::String> for UpdatePolicyBodyDescription {
36549 type Error = self::error::ConversionError;
36550 fn try_from(
36551 value: &::std::string::String,
36552 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36553 value.parse()
36554 }
36555 }
36556 impl ::std::convert::TryFrom<::std::string::String> for UpdatePolicyBodyDescription {
36557 type Error = self::error::ConversionError;
36558 fn try_from(
36559 value: ::std::string::String,
36560 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36561 value.parse()
36562 }
36563 }
36564 impl<'de> ::serde::Deserialize<'de> for UpdatePolicyBodyDescription {
36565 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36566 where
36567 D: ::serde::Deserializer<'de>,
36568 {
36569 ::std::string::String::deserialize(deserializer)?
36570 .parse()
36571 .map_err(|e: self::error::ConversionError| {
36572 <D::Error as ::serde::de::Error>::custom(e.to_string())
36573 })
36574 }
36575 }
36576 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36588 #[serde(transparent)]
36589 pub struct UpdatePolicyPolicyId(::std::string::String);
36590 impl ::std::ops::Deref for UpdatePolicyPolicyId {
36591 type Target = ::std::string::String;
36592 fn deref(&self) -> &::std::string::String {
36593 &self.0
36594 }
36595 }
36596 impl ::std::convert::From<UpdatePolicyPolicyId> for ::std::string::String {
36597 fn from(value: UpdatePolicyPolicyId) -> Self {
36598 value.0
36599 }
36600 }
36601 impl ::std::convert::From<&UpdatePolicyPolicyId> for UpdatePolicyPolicyId {
36602 fn from(value: &UpdatePolicyPolicyId) -> Self {
36603 value.clone()
36604 }
36605 }
36606 impl ::std::str::FromStr for UpdatePolicyPolicyId {
36607 type Err = self::error::ConversionError;
36608 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36609 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
36610 || {
36611 ::regress::Regex::new(
36612 "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
36613 )
36614 .unwrap()
36615 },
36616 );
36617 if PATTERN.find(value).is_none() {
36618 return Err(
36619 "doesn't match pattern \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\""
36620 .into(),
36621 );
36622 }
36623 Ok(Self(value.to_string()))
36624 }
36625 }
36626 impl ::std::convert::TryFrom<&str> for UpdatePolicyPolicyId {
36627 type Error = self::error::ConversionError;
36628 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36629 value.parse()
36630 }
36631 }
36632 impl ::std::convert::TryFrom<&::std::string::String> for UpdatePolicyPolicyId {
36633 type Error = self::error::ConversionError;
36634 fn try_from(
36635 value: &::std::string::String,
36636 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36637 value.parse()
36638 }
36639 }
36640 impl ::std::convert::TryFrom<::std::string::String> for UpdatePolicyPolicyId {
36641 type Error = self::error::ConversionError;
36642 fn try_from(
36643 value: ::std::string::String,
36644 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36645 value.parse()
36646 }
36647 }
36648 impl<'de> ::serde::Deserialize<'de> for UpdatePolicyPolicyId {
36649 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36650 where
36651 D: ::serde::Deserializer<'de>,
36652 {
36653 ::std::string::String::deserialize(deserializer)?
36654 .parse()
36655 .map_err(|e: self::error::ConversionError| {
36656 <D::Error as ::serde::de::Error>::custom(e.to_string())
36657 })
36658 }
36659 }
36660 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36674 #[serde(transparent)]
36675 pub struct UpdatePolicyXIdempotencyKey(::std::string::String);
36676 impl ::std::ops::Deref for UpdatePolicyXIdempotencyKey {
36677 type Target = ::std::string::String;
36678 fn deref(&self) -> &::std::string::String {
36679 &self.0
36680 }
36681 }
36682 impl ::std::convert::From<UpdatePolicyXIdempotencyKey> for ::std::string::String {
36683 fn from(value: UpdatePolicyXIdempotencyKey) -> Self {
36684 value.0
36685 }
36686 }
36687 impl ::std::convert::From<&UpdatePolicyXIdempotencyKey> for UpdatePolicyXIdempotencyKey {
36688 fn from(value: &UpdatePolicyXIdempotencyKey) -> Self {
36689 value.clone()
36690 }
36691 }
36692 impl ::std::str::FromStr for UpdatePolicyXIdempotencyKey {
36693 type Err = self::error::ConversionError;
36694 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36695 if value.chars().count() > 36usize {
36696 return Err("longer than 36 characters".into());
36697 }
36698 if value.chars().count() < 36usize {
36699 return Err("shorter than 36 characters".into());
36700 }
36701 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
36702 ::std::sync::LazyLock::new(|| {
36703 ::regress::Regex::new(
36704 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
36705 )
36706 .unwrap()
36707 });
36708 if PATTERN.find(value).is_none() {
36709 return Err(
36710 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
36711 .into(),
36712 );
36713 }
36714 Ok(Self(value.to_string()))
36715 }
36716 }
36717 impl ::std::convert::TryFrom<&str> for UpdatePolicyXIdempotencyKey {
36718 type Error = self::error::ConversionError;
36719 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36720 value.parse()
36721 }
36722 }
36723 impl ::std::convert::TryFrom<&::std::string::String> for UpdatePolicyXIdempotencyKey {
36724 type Error = self::error::ConversionError;
36725 fn try_from(
36726 value: &::std::string::String,
36727 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36728 value.parse()
36729 }
36730 }
36731 impl ::std::convert::TryFrom<::std::string::String> for UpdatePolicyXIdempotencyKey {
36732 type Error = self::error::ConversionError;
36733 fn try_from(
36734 value: ::std::string::String,
36735 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36736 value.parse()
36737 }
36738 }
36739 impl<'de> ::serde::Deserialize<'de> for UpdatePolicyXIdempotencyKey {
36740 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36741 where
36742 D: ::serde::Deserializer<'de>,
36743 {
36744 ::std::string::String::deserialize(deserializer)?
36745 .parse()
36746 .map_err(|e: self::error::ConversionError| {
36747 <D::Error as ::serde::de::Error>::custom(e.to_string())
36748 })
36749 }
36750 }
36751 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36763 #[serde(transparent)]
36764 pub struct UpdateSolanaAccountAddress(::std::string::String);
36765 impl ::std::ops::Deref for UpdateSolanaAccountAddress {
36766 type Target = ::std::string::String;
36767 fn deref(&self) -> &::std::string::String {
36768 &self.0
36769 }
36770 }
36771 impl ::std::convert::From<UpdateSolanaAccountAddress> for ::std::string::String {
36772 fn from(value: UpdateSolanaAccountAddress) -> Self {
36773 value.0
36774 }
36775 }
36776 impl ::std::convert::From<&UpdateSolanaAccountAddress> for UpdateSolanaAccountAddress {
36777 fn from(value: &UpdateSolanaAccountAddress) -> Self {
36778 value.clone()
36779 }
36780 }
36781 impl ::std::str::FromStr for UpdateSolanaAccountAddress {
36782 type Err = self::error::ConversionError;
36783 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36784 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
36785 ::std::sync::LazyLock::new(|| {
36786 ::regress::Regex::new("^[1-9A-HJ-NP-Za-km-z]{32,44}$").unwrap()
36787 });
36788 if PATTERN.find(value).is_none() {
36789 return Err("doesn't match pattern \"^[1-9A-HJ-NP-Za-km-z]{32,44}$\"".into());
36790 }
36791 Ok(Self(value.to_string()))
36792 }
36793 }
36794 impl ::std::convert::TryFrom<&str> for UpdateSolanaAccountAddress {
36795 type Error = self::error::ConversionError;
36796 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36797 value.parse()
36798 }
36799 }
36800 impl ::std::convert::TryFrom<&::std::string::String> for UpdateSolanaAccountAddress {
36801 type Error = self::error::ConversionError;
36802 fn try_from(
36803 value: &::std::string::String,
36804 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36805 value.parse()
36806 }
36807 }
36808 impl ::std::convert::TryFrom<::std::string::String> for UpdateSolanaAccountAddress {
36809 type Error = self::error::ConversionError;
36810 fn try_from(
36811 value: ::std::string::String,
36812 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36813 value.parse()
36814 }
36815 }
36816 impl<'de> ::serde::Deserialize<'de> for UpdateSolanaAccountAddress {
36817 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36818 where
36819 D: ::serde::Deserializer<'de>,
36820 {
36821 ::std::string::String::deserialize(deserializer)?
36822 .parse()
36823 .map_err(|e: self::error::ConversionError| {
36824 <D::Error as ::serde::de::Error>::custom(e.to_string())
36825 })
36826 }
36827 }
36828 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
36858 pub struct UpdateSolanaAccountBody {
36859 #[serde(
36861 rename = "accountPolicy",
36862 default,
36863 skip_serializing_if = "::std::option::Option::is_none"
36864 )]
36865 pub account_policy: ::std::option::Option<UpdateSolanaAccountBodyAccountPolicy>,
36866 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
36869 pub name: ::std::option::Option<UpdateSolanaAccountBodyName>,
36870 }
36871 impl ::std::convert::From<&UpdateSolanaAccountBody> for UpdateSolanaAccountBody {
36872 fn from(value: &UpdateSolanaAccountBody) -> Self {
36873 value.clone()
36874 }
36875 }
36876 impl ::std::default::Default for UpdateSolanaAccountBody {
36877 fn default() -> Self {
36878 Self {
36879 account_policy: Default::default(),
36880 name: Default::default(),
36881 }
36882 }
36883 }
36884 impl UpdateSolanaAccountBody {
36885 pub fn builder() -> builder::UpdateSolanaAccountBody {
36886 Default::default()
36887 }
36888 }
36889 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36906 #[serde(transparent)]
36907 pub struct UpdateSolanaAccountBodyAccountPolicy(::std::string::String);
36908 impl ::std::ops::Deref for UpdateSolanaAccountBodyAccountPolicy {
36909 type Target = ::std::string::String;
36910 fn deref(&self) -> &::std::string::String {
36911 &self.0
36912 }
36913 }
36914 impl ::std::convert::From<UpdateSolanaAccountBodyAccountPolicy> for ::std::string::String {
36915 fn from(value: UpdateSolanaAccountBodyAccountPolicy) -> Self {
36916 value.0
36917 }
36918 }
36919 impl ::std::convert::From<&UpdateSolanaAccountBodyAccountPolicy>
36920 for UpdateSolanaAccountBodyAccountPolicy
36921 {
36922 fn from(value: &UpdateSolanaAccountBodyAccountPolicy) -> Self {
36923 value.clone()
36924 }
36925 }
36926 impl ::std::str::FromStr for UpdateSolanaAccountBodyAccountPolicy {
36927 type Err = self::error::ConversionError;
36928 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36929 static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(
36930 || {
36931 ::regress::Regex::new(
36932 "(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)|(^$)",
36933 )
36934 .unwrap()
36935 },
36936 );
36937 if PATTERN.find(value).is_none() {
36938 return Err(
36939 "doesn't match pattern \"(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)|(^$)\""
36940 .into(),
36941 );
36942 }
36943 Ok(Self(value.to_string()))
36944 }
36945 }
36946 impl ::std::convert::TryFrom<&str> for UpdateSolanaAccountBodyAccountPolicy {
36947 type Error = self::error::ConversionError;
36948 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
36949 value.parse()
36950 }
36951 }
36952 impl ::std::convert::TryFrom<&::std::string::String> for UpdateSolanaAccountBodyAccountPolicy {
36953 type Error = self::error::ConversionError;
36954 fn try_from(
36955 value: &::std::string::String,
36956 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36957 value.parse()
36958 }
36959 }
36960 impl ::std::convert::TryFrom<::std::string::String> for UpdateSolanaAccountBodyAccountPolicy {
36961 type Error = self::error::ConversionError;
36962 fn try_from(
36963 value: ::std::string::String,
36964 ) -> ::std::result::Result<Self, self::error::ConversionError> {
36965 value.parse()
36966 }
36967 }
36968 impl<'de> ::serde::Deserialize<'de> for UpdateSolanaAccountBodyAccountPolicy {
36969 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
36970 where
36971 D: ::serde::Deserializer<'de>,
36972 {
36973 ::std::string::String::deserialize(deserializer)?
36974 .parse()
36975 .map_err(|e: self::error::ConversionError| {
36976 <D::Error as ::serde::de::Error>::custom(e.to_string())
36977 })
36978 }
36979 }
36980 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36997 #[serde(transparent)]
36998 pub struct UpdateSolanaAccountBodyName(::std::string::String);
36999 impl ::std::ops::Deref for UpdateSolanaAccountBodyName {
37000 type Target = ::std::string::String;
37001 fn deref(&self) -> &::std::string::String {
37002 &self.0
37003 }
37004 }
37005 impl ::std::convert::From<UpdateSolanaAccountBodyName> for ::std::string::String {
37006 fn from(value: UpdateSolanaAccountBodyName) -> Self {
37007 value.0
37008 }
37009 }
37010 impl ::std::convert::From<&UpdateSolanaAccountBodyName> for UpdateSolanaAccountBodyName {
37011 fn from(value: &UpdateSolanaAccountBodyName) -> Self {
37012 value.clone()
37013 }
37014 }
37015 impl ::std::str::FromStr for UpdateSolanaAccountBodyName {
37016 type Err = self::error::ConversionError;
37017 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37018 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
37019 ::std::sync::LazyLock::new(|| {
37020 ::regress::Regex::new("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$").unwrap()
37021 });
37022 if PATTERN.find(value).is_none() {
37023 return Err(
37024 "doesn't match pattern \"^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$\"".into(),
37025 );
37026 }
37027 Ok(Self(value.to_string()))
37028 }
37029 }
37030 impl ::std::convert::TryFrom<&str> for UpdateSolanaAccountBodyName {
37031 type Error = self::error::ConversionError;
37032 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37033 value.parse()
37034 }
37035 }
37036 impl ::std::convert::TryFrom<&::std::string::String> for UpdateSolanaAccountBodyName {
37037 type Error = self::error::ConversionError;
37038 fn try_from(
37039 value: &::std::string::String,
37040 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37041 value.parse()
37042 }
37043 }
37044 impl ::std::convert::TryFrom<::std::string::String> for UpdateSolanaAccountBodyName {
37045 type Error = self::error::ConversionError;
37046 fn try_from(
37047 value: ::std::string::String,
37048 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37049 value.parse()
37050 }
37051 }
37052 impl<'de> ::serde::Deserialize<'de> for UpdateSolanaAccountBodyName {
37053 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
37054 where
37055 D: ::serde::Deserializer<'de>,
37056 {
37057 ::std::string::String::deserialize(deserializer)?
37058 .parse()
37059 .map_err(|e: self::error::ConversionError| {
37060 <D::Error as ::serde::de::Error>::custom(e.to_string())
37061 })
37062 }
37063 }
37064 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37078 #[serde(transparent)]
37079 pub struct UpdateSolanaAccountXIdempotencyKey(::std::string::String);
37080 impl ::std::ops::Deref for UpdateSolanaAccountXIdempotencyKey {
37081 type Target = ::std::string::String;
37082 fn deref(&self) -> &::std::string::String {
37083 &self.0
37084 }
37085 }
37086 impl ::std::convert::From<UpdateSolanaAccountXIdempotencyKey> for ::std::string::String {
37087 fn from(value: UpdateSolanaAccountXIdempotencyKey) -> Self {
37088 value.0
37089 }
37090 }
37091 impl ::std::convert::From<&UpdateSolanaAccountXIdempotencyKey>
37092 for UpdateSolanaAccountXIdempotencyKey
37093 {
37094 fn from(value: &UpdateSolanaAccountXIdempotencyKey) -> Self {
37095 value.clone()
37096 }
37097 }
37098 impl ::std::str::FromStr for UpdateSolanaAccountXIdempotencyKey {
37099 type Err = self::error::ConversionError;
37100 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37101 if value.chars().count() > 36usize {
37102 return Err("longer than 36 characters".into());
37103 }
37104 if value.chars().count() < 36usize {
37105 return Err("shorter than 36 characters".into());
37106 }
37107 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
37108 ::std::sync::LazyLock::new(|| {
37109 ::regress::Regex::new(
37110 "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
37111 )
37112 .unwrap()
37113 });
37114 if PATTERN.find(value).is_none() {
37115 return Err(
37116 "doesn't match pattern \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\""
37117 .into(),
37118 );
37119 }
37120 Ok(Self(value.to_string()))
37121 }
37122 }
37123 impl ::std::convert::TryFrom<&str> for UpdateSolanaAccountXIdempotencyKey {
37124 type Error = self::error::ConversionError;
37125 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37126 value.parse()
37127 }
37128 }
37129 impl ::std::convert::TryFrom<&::std::string::String> for UpdateSolanaAccountXIdempotencyKey {
37130 type Error = self::error::ConversionError;
37131 fn try_from(
37132 value: &::std::string::String,
37133 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37134 value.parse()
37135 }
37136 }
37137 impl ::std::convert::TryFrom<::std::string::String> for UpdateSolanaAccountXIdempotencyKey {
37138 type Error = self::error::ConversionError;
37139 fn try_from(
37140 value: ::std::string::String,
37141 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37142 value.parse()
37143 }
37144 }
37145 impl<'de> ::serde::Deserialize<'de> for UpdateSolanaAccountXIdempotencyKey {
37146 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
37147 where
37148 D: ::serde::Deserializer<'de>,
37149 {
37150 ::std::string::String::deserialize(deserializer)?
37151 .parse()
37152 .map_err(|e: self::error::ConversionError| {
37153 <D::Error as ::serde::de::Error>::custom(e.to_string())
37154 })
37155 }
37156 }
37157 #[derive(
37176 ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
37177 )]
37178 #[serde(transparent)]
37179 pub struct Uri(pub ::std::string::String);
37180 impl ::std::ops::Deref for Uri {
37181 type Target = ::std::string::String;
37182 fn deref(&self) -> &::std::string::String {
37183 &self.0
37184 }
37185 }
37186 impl ::std::convert::From<Uri> for ::std::string::String {
37187 fn from(value: Uri) -> Self {
37188 value.0
37189 }
37190 }
37191 impl ::std::convert::From<&Uri> for Uri {
37192 fn from(value: &Uri) -> Self {
37193 value.clone()
37194 }
37195 }
37196 impl ::std::convert::From<::std::string::String> for Uri {
37197 fn from(value: ::std::string::String) -> Self {
37198 Self(value)
37199 }
37200 }
37201 impl ::std::str::FromStr for Uri {
37202 type Err = ::std::convert::Infallible;
37203 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
37204 Ok(Self(value.to_string()))
37205 }
37206 }
37207 impl ::std::fmt::Display for Uri {
37208 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
37209 self.0.fmt(f)
37210 }
37211 }
37212 #[derive(
37231 ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
37232 )]
37233 #[serde(transparent)]
37234 pub struct Url(pub ::std::string::String);
37235 impl ::std::ops::Deref for Url {
37236 type Target = ::std::string::String;
37237 fn deref(&self) -> &::std::string::String {
37238 &self.0
37239 }
37240 }
37241 impl ::std::convert::From<Url> for ::std::string::String {
37242 fn from(value: Url) -> Self {
37243 value.0
37244 }
37245 }
37246 impl ::std::convert::From<&Url> for Url {
37247 fn from(value: &Url) -> Self {
37248 value.clone()
37249 }
37250 }
37251 impl ::std::convert::From<::std::string::String> for Url {
37252 fn from(value: ::std::string::String) -> Self {
37253 Self(value)
37254 }
37255 }
37256 impl ::std::str::FromStr for Url {
37257 type Err = ::std::convert::Infallible;
37258 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
37259 Ok(Self(value.to_string()))
37260 }
37261 }
37262 impl ::std::fmt::Display for Url {
37263 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
37264 self.0.fmt(f)
37265 }
37266 }
37267 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
37325 pub struct UserOperationReceipt {
37326 #[serde(
37328 rename = "blockHash",
37329 default,
37330 skip_serializing_if = "::std::option::Option::is_none"
37331 )]
37332 pub block_hash: ::std::option::Option<UserOperationReceiptBlockHash>,
37333 #[serde(
37335 rename = "blockNumber",
37336 default,
37337 skip_serializing_if = "::std::option::Option::is_none"
37338 )]
37339 pub block_number: ::std::option::Option<i64>,
37340 #[serde(
37342 rename = "gasUsed",
37343 default,
37344 skip_serializing_if = "::std::option::Option::is_none"
37345 )]
37346 pub gas_used: ::std::option::Option<::std::string::String>,
37347 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
37348 pub revert: ::std::option::Option<UserOperationReceiptRevert>,
37349 #[serde(
37351 rename = "transactionHash",
37352 default,
37353 skip_serializing_if = "::std::option::Option::is_none"
37354 )]
37355 pub transaction_hash: ::std::option::Option<UserOperationReceiptTransactionHash>,
37356 }
37357 impl ::std::convert::From<&UserOperationReceipt> for UserOperationReceipt {
37358 fn from(value: &UserOperationReceipt) -> Self {
37359 value.clone()
37360 }
37361 }
37362 impl ::std::default::Default for UserOperationReceipt {
37363 fn default() -> Self {
37364 Self {
37365 block_hash: Default::default(),
37366 block_number: Default::default(),
37367 gas_used: Default::default(),
37368 revert: Default::default(),
37369 transaction_hash: Default::default(),
37370 }
37371 }
37372 }
37373 impl UserOperationReceipt {
37374 pub fn builder() -> builder::UserOperationReceipt {
37375 Default::default()
37376 }
37377 }
37378 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37394 #[serde(transparent)]
37395 pub struct UserOperationReceiptBlockHash(::std::string::String);
37396 impl ::std::ops::Deref for UserOperationReceiptBlockHash {
37397 type Target = ::std::string::String;
37398 fn deref(&self) -> &::std::string::String {
37399 &self.0
37400 }
37401 }
37402 impl ::std::convert::From<UserOperationReceiptBlockHash> for ::std::string::String {
37403 fn from(value: UserOperationReceiptBlockHash) -> Self {
37404 value.0
37405 }
37406 }
37407 impl ::std::convert::From<&UserOperationReceiptBlockHash> for UserOperationReceiptBlockHash {
37408 fn from(value: &UserOperationReceiptBlockHash) -> Self {
37409 value.clone()
37410 }
37411 }
37412 impl ::std::str::FromStr for UserOperationReceiptBlockHash {
37413 type Err = self::error::ConversionError;
37414 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37415 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
37416 ::std::sync::LazyLock::new(|| {
37417 ::regress::Regex::new("^0x[0-9a-fA-F]{64}$|^$").unwrap()
37418 });
37419 if PATTERN.find(value).is_none() {
37420 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{64}$|^$\"".into());
37421 }
37422 Ok(Self(value.to_string()))
37423 }
37424 }
37425 impl ::std::convert::TryFrom<&str> for UserOperationReceiptBlockHash {
37426 type Error = self::error::ConversionError;
37427 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37428 value.parse()
37429 }
37430 }
37431 impl ::std::convert::TryFrom<&::std::string::String> for UserOperationReceiptBlockHash {
37432 type Error = self::error::ConversionError;
37433 fn try_from(
37434 value: &::std::string::String,
37435 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37436 value.parse()
37437 }
37438 }
37439 impl ::std::convert::TryFrom<::std::string::String> for UserOperationReceiptBlockHash {
37440 type Error = self::error::ConversionError;
37441 fn try_from(
37442 value: ::std::string::String,
37443 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37444 value.parse()
37445 }
37446 }
37447 impl<'de> ::serde::Deserialize<'de> for UserOperationReceiptBlockHash {
37448 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
37449 where
37450 D: ::serde::Deserializer<'de>,
37451 {
37452 ::std::string::String::deserialize(deserializer)?
37453 .parse()
37454 .map_err(|e: self::error::ConversionError| {
37455 <D::Error as ::serde::de::Error>::custom(e.to_string())
37456 })
37457 }
37458 }
37459 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
37498 pub struct UserOperationReceiptRevert {
37499 pub data: UserOperationReceiptRevertData,
37501 pub message: ::std::string::String,
37503 }
37504 impl ::std::convert::From<&UserOperationReceiptRevert> for UserOperationReceiptRevert {
37505 fn from(value: &UserOperationReceiptRevert) -> Self {
37506 value.clone()
37507 }
37508 }
37509 impl UserOperationReceiptRevert {
37510 pub fn builder() -> builder::UserOperationReceiptRevert {
37511 Default::default()
37512 }
37513 }
37514 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37530 #[serde(transparent)]
37531 pub struct UserOperationReceiptRevertData(::std::string::String);
37532 impl ::std::ops::Deref for UserOperationReceiptRevertData {
37533 type Target = ::std::string::String;
37534 fn deref(&self) -> &::std::string::String {
37535 &self.0
37536 }
37537 }
37538 impl ::std::convert::From<UserOperationReceiptRevertData> for ::std::string::String {
37539 fn from(value: UserOperationReceiptRevertData) -> Self {
37540 value.0
37541 }
37542 }
37543 impl ::std::convert::From<&UserOperationReceiptRevertData> for UserOperationReceiptRevertData {
37544 fn from(value: &UserOperationReceiptRevertData) -> Self {
37545 value.clone()
37546 }
37547 }
37548 impl ::std::str::FromStr for UserOperationReceiptRevertData {
37549 type Err = self::error::ConversionError;
37550 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37551 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
37552 ::std::sync::LazyLock::new(|| ::regress::Regex::new("^0x[0-9a-fA-F]*$").unwrap());
37553 if PATTERN.find(value).is_none() {
37554 return Err("doesn't match pattern \"^0x[0-9a-fA-F]*$\"".into());
37555 }
37556 Ok(Self(value.to_string()))
37557 }
37558 }
37559 impl ::std::convert::TryFrom<&str> for UserOperationReceiptRevertData {
37560 type Error = self::error::ConversionError;
37561 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37562 value.parse()
37563 }
37564 }
37565 impl ::std::convert::TryFrom<&::std::string::String> for UserOperationReceiptRevertData {
37566 type Error = self::error::ConversionError;
37567 fn try_from(
37568 value: &::std::string::String,
37569 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37570 value.parse()
37571 }
37572 }
37573 impl ::std::convert::TryFrom<::std::string::String> for UserOperationReceiptRevertData {
37574 type Error = self::error::ConversionError;
37575 fn try_from(
37576 value: ::std::string::String,
37577 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37578 value.parse()
37579 }
37580 }
37581 impl<'de> ::serde::Deserialize<'de> for UserOperationReceiptRevertData {
37582 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
37583 where
37584 D: ::serde::Deserializer<'de>,
37585 {
37586 ::std::string::String::deserialize(deserializer)?
37587 .parse()
37588 .map_err(|e: self::error::ConversionError| {
37589 <D::Error as ::serde::de::Error>::custom(e.to_string())
37590 })
37591 }
37592 }
37593 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37609 #[serde(transparent)]
37610 pub struct UserOperationReceiptTransactionHash(::std::string::String);
37611 impl ::std::ops::Deref for UserOperationReceiptTransactionHash {
37612 type Target = ::std::string::String;
37613 fn deref(&self) -> &::std::string::String {
37614 &self.0
37615 }
37616 }
37617 impl ::std::convert::From<UserOperationReceiptTransactionHash> for ::std::string::String {
37618 fn from(value: UserOperationReceiptTransactionHash) -> Self {
37619 value.0
37620 }
37621 }
37622 impl ::std::convert::From<&UserOperationReceiptTransactionHash>
37623 for UserOperationReceiptTransactionHash
37624 {
37625 fn from(value: &UserOperationReceiptTransactionHash) -> Self {
37626 value.clone()
37627 }
37628 }
37629 impl ::std::str::FromStr for UserOperationReceiptTransactionHash {
37630 type Err = self::error::ConversionError;
37631 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37632 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
37633 ::std::sync::LazyLock::new(|| {
37634 ::regress::Regex::new("^0x[a-fA-F0-9]{64}$").unwrap()
37635 });
37636 if PATTERN.find(value).is_none() {
37637 return Err("doesn't match pattern \"^0x[a-fA-F0-9]{64}$\"".into());
37638 }
37639 Ok(Self(value.to_string()))
37640 }
37641 }
37642 impl ::std::convert::TryFrom<&str> for UserOperationReceiptTransactionHash {
37643 type Error = self::error::ConversionError;
37644 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37645 value.parse()
37646 }
37647 }
37648 impl ::std::convert::TryFrom<&::std::string::String> for UserOperationReceiptTransactionHash {
37649 type Error = self::error::ConversionError;
37650 fn try_from(
37651 value: &::std::string::String,
37652 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37653 value.parse()
37654 }
37655 }
37656 impl ::std::convert::TryFrom<::std::string::String> for UserOperationReceiptTransactionHash {
37657 type Error = self::error::ConversionError;
37658 fn try_from(
37659 value: ::std::string::String,
37660 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37661 value.parse()
37662 }
37663 }
37664 impl<'de> ::serde::Deserialize<'de> for UserOperationReceiptTransactionHash {
37665 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
37666 where
37667 D: ::serde::Deserializer<'de>,
37668 {
37669 ::std::string::String::deserialize(deserializer)?
37670 .parse()
37671 .map_err(|e: self::error::ConversionError| {
37672 <D::Error as ::serde::de::Error>::custom(e.to_string())
37673 })
37674 }
37675 }
37676 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
37700 pub struct ValidateEndUserAccessTokenBody {
37701 #[serde(rename = "accessToken")]
37703 pub access_token: ::std::string::String,
37704 }
37705 impl ::std::convert::From<&ValidateEndUserAccessTokenBody> for ValidateEndUserAccessTokenBody {
37706 fn from(value: &ValidateEndUserAccessTokenBody) -> Self {
37707 value.clone()
37708 }
37709 }
37710 impl ValidateEndUserAccessTokenBody {
37711 pub fn builder() -> builder::ValidateEndUserAccessTokenBody {
37712 Default::default()
37713 }
37714 }
37715 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
37742 pub struct VerifyX402PaymentBody {
37743 #[serde(rename = "paymentPayload")]
37744 pub payment_payload: X402PaymentPayload,
37745 #[serde(rename = "paymentRequirements")]
37746 pub payment_requirements: X402PaymentRequirements,
37747 #[serde(rename = "x402Version")]
37748 pub x402_version: X402Version,
37749 }
37750 impl ::std::convert::From<&VerifyX402PaymentBody> for VerifyX402PaymentBody {
37751 fn from(value: &VerifyX402PaymentBody) -> Self {
37752 value.clone()
37753 }
37754 }
37755 impl VerifyX402PaymentBody {
37756 pub fn builder() -> builder::VerifyX402PaymentBody {
37757 Default::default()
37758 }
37759 }
37760 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
37795 pub struct VerifyX402PaymentResponse {
37796 #[serde(
37797 rename = "invalidReason",
37798 default,
37799 skip_serializing_if = "::std::option::Option::is_none"
37800 )]
37801 pub invalid_reason: ::std::option::Option<X402VerifyInvalidReason>,
37802 #[serde(rename = "isValid")]
37804 pub is_valid: bool,
37805 pub payer: VerifyX402PaymentResponsePayer,
37811 }
37812 impl ::std::convert::From<&VerifyX402PaymentResponse> for VerifyX402PaymentResponse {
37813 fn from(value: &VerifyX402PaymentResponse) -> Self {
37814 value.clone()
37815 }
37816 }
37817 impl VerifyX402PaymentResponse {
37818 pub fn builder() -> builder::VerifyX402PaymentResponse {
37819 Default::default()
37820 }
37821 }
37822 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37842 #[serde(transparent)]
37843 pub struct VerifyX402PaymentResponsePayer(::std::string::String);
37844 impl ::std::ops::Deref for VerifyX402PaymentResponsePayer {
37845 type Target = ::std::string::String;
37846 fn deref(&self) -> &::std::string::String {
37847 &self.0
37848 }
37849 }
37850 impl ::std::convert::From<VerifyX402PaymentResponsePayer> for ::std::string::String {
37851 fn from(value: VerifyX402PaymentResponsePayer) -> Self {
37852 value.0
37853 }
37854 }
37855 impl ::std::convert::From<&VerifyX402PaymentResponsePayer> for VerifyX402PaymentResponsePayer {
37856 fn from(value: &VerifyX402PaymentResponsePayer) -> Self {
37857 value.clone()
37858 }
37859 }
37860 impl ::std::str::FromStr for VerifyX402PaymentResponsePayer {
37861 type Err = self::error::ConversionError;
37862 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37863 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
37864 ::std::sync::LazyLock::new(|| {
37865 ::regress::Regex::new("^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$")
37866 .unwrap()
37867 });
37868 if PATTERN.find(value).is_none() {
37869 return Err(
37870 "doesn't match pattern \"^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$\""
37871 .into(),
37872 );
37873 }
37874 Ok(Self(value.to_string()))
37875 }
37876 }
37877 impl ::std::convert::TryFrom<&str> for VerifyX402PaymentResponsePayer {
37878 type Error = self::error::ConversionError;
37879 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
37880 value.parse()
37881 }
37882 }
37883 impl ::std::convert::TryFrom<&::std::string::String> for VerifyX402PaymentResponsePayer {
37884 type Error = self::error::ConversionError;
37885 fn try_from(
37886 value: &::std::string::String,
37887 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37888 value.parse()
37889 }
37890 }
37891 impl ::std::convert::TryFrom<::std::string::String> for VerifyX402PaymentResponsePayer {
37892 type Error = self::error::ConversionError;
37893 fn try_from(
37894 value: ::std::string::String,
37895 ) -> ::std::result::Result<Self, self::error::ConversionError> {
37896 value.parse()
37897 }
37898 }
37899 impl<'de> ::serde::Deserialize<'de> for VerifyX402PaymentResponsePayer {
37900 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
37901 where
37902 D: ::serde::Deserializer<'de>,
37903 {
37904 ::std::string::String::deserialize(deserializer)?
37905 .parse()
37906 .map_err(|e: self::error::ConversionError| {
37907 <D::Error as ::serde::de::Error>::custom(e.to_string())
37908 })
37909 }
37910 }
37911 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
37942 pub struct WebhookSubscriptionListResponse {
37943 #[serde(
37945 rename = "nextPageToken",
37946 default,
37947 skip_serializing_if = "::std::option::Option::is_none"
37948 )]
37949 pub next_page_token: ::std::option::Option<::std::string::String>,
37950 pub subscriptions: ::std::vec::Vec<WebhookSubscriptionResponse>,
37952 }
37953 impl ::std::convert::From<&WebhookSubscriptionListResponse> for WebhookSubscriptionListResponse {
37954 fn from(value: &WebhookSubscriptionListResponse) -> Self {
37955 value.clone()
37956 }
37957 }
37958 impl WebhookSubscriptionListResponse {
37959 pub fn builder() -> builder::WebhookSubscriptionListResponse {
37960 Default::default()
37961 }
37962 }
37963 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
38087 #[serde(untagged)]
38088 pub enum WebhookSubscriptionRequest {
38089 Variant0(WebhookSubscriptionRequestVariant0),
38090 Variant1(WebhookSubscriptionRequestVariant1),
38091 }
38092 impl ::std::convert::From<&Self> for WebhookSubscriptionRequest {
38093 fn from(value: &WebhookSubscriptionRequest) -> Self {
38094 value.clone()
38095 }
38096 }
38097 impl ::std::convert::From<WebhookSubscriptionRequestVariant0> for WebhookSubscriptionRequest {
38098 fn from(value: WebhookSubscriptionRequestVariant0) -> Self {
38099 Self::Variant0(value)
38100 }
38101 }
38102 impl ::std::convert::From<WebhookSubscriptionRequestVariant1> for WebhookSubscriptionRequest {
38103 fn from(value: WebhookSubscriptionRequestVariant1) -> Self {
38104 Self::Variant1(value)
38105 }
38106 }
38107 #[derive(
38232 ::serde::Deserialize,
38233 ::serde::Serialize,
38234 Clone,
38235 Copy,
38236 Debug,
38237 Eq,
38238 Hash,
38239 Ord,
38240 PartialEq,
38241 PartialOrd,
38242 )]
38243 #[serde(deny_unknown_fields)]
38244 pub enum WebhookSubscriptionRequestVariant0 {}
38245 impl ::std::convert::From<&Self> for WebhookSubscriptionRequestVariant0 {
38246 fn from(value: &WebhookSubscriptionRequestVariant0) -> Self {
38247 value.clone()
38248 }
38249 }
38250 #[derive(
38375 ::serde::Deserialize,
38376 ::serde::Serialize,
38377 Clone,
38378 Copy,
38379 Debug,
38380 Eq,
38381 Hash,
38382 Ord,
38383 PartialEq,
38384 PartialOrd,
38385 )]
38386 #[serde(deny_unknown_fields)]
38387 pub enum WebhookSubscriptionRequestVariant1 {}
38388 impl ::std::convert::From<&Self> for WebhookSubscriptionRequestVariant1 {
38389 fn from(value: &WebhookSubscriptionRequestVariant1) -> Self {
38390 value.clone()
38391 }
38392 }
38393 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
38542 pub struct WebhookSubscriptionResponse {
38543 #[serde(rename = "createdAt")]
38545 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
38546 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
38548 pub description: ::std::option::Option<::std::string::String>,
38549 #[serde(rename = "eventTypes")]
38553 pub event_types: ::std::vec::Vec<::std::string::String>,
38554 #[serde(rename = "isEnabled")]
38556 pub is_enabled: bool,
38557 #[serde(
38560 rename = "labelKey",
38561 default,
38562 skip_serializing_if = "::std::option::Option::is_none"
38563 )]
38564 pub label_key: ::std::option::Option<::std::string::String>,
38565 #[serde(
38568 rename = "labelValue",
38569 default,
38570 skip_serializing_if = "::std::option::Option::is_none"
38571 )]
38572 pub label_value: ::std::option::Option<::std::string::String>,
38573 #[serde(
38577 default,
38578 skip_serializing_if = ":: std :: collections :: HashMap::is_empty"
38579 )]
38580 pub labels: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
38581 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
38582 pub metadata: ::std::option::Option<WebhookSubscriptionResponseMetadata>,
38583 pub secret: ::uuid::Uuid,
38585 #[serde(rename = "subscriptionId")]
38587 pub subscription_id: ::uuid::Uuid,
38588 pub target: WebhookTarget,
38589 }
38590 impl ::std::convert::From<&WebhookSubscriptionResponse> for WebhookSubscriptionResponse {
38591 fn from(value: &WebhookSubscriptionResponse) -> Self {
38592 value.clone()
38593 }
38594 }
38595 impl WebhookSubscriptionResponse {
38596 pub fn builder() -> builder::WebhookSubscriptionResponse {
38597 Default::default()
38598 }
38599 }
38600 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
38628 pub struct WebhookSubscriptionResponseMetadata {
38629 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
38631 pub secret: ::std::option::Option<::uuid::Uuid>,
38632 }
38633 impl ::std::convert::From<&WebhookSubscriptionResponseMetadata>
38634 for WebhookSubscriptionResponseMetadata
38635 {
38636 fn from(value: &WebhookSubscriptionResponseMetadata) -> Self {
38637 value.clone()
38638 }
38639 }
38640 impl ::std::default::Default for WebhookSubscriptionResponseMetadata {
38641 fn default() -> Self {
38642 Self {
38643 secret: Default::default(),
38644 }
38645 }
38646 }
38647 impl WebhookSubscriptionResponseMetadata {
38648 pub fn builder() -> builder::WebhookSubscriptionResponseMetadata {
38649 Default::default()
38650 }
38651 }
38652 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
38775 #[serde(untagged)]
38776 pub enum WebhookSubscriptionUpdateRequest {
38777 Variant0(WebhookSubscriptionUpdateRequestVariant0),
38778 Variant1(WebhookSubscriptionUpdateRequestVariant1),
38779 }
38780 impl ::std::convert::From<&Self> for WebhookSubscriptionUpdateRequest {
38781 fn from(value: &WebhookSubscriptionUpdateRequest) -> Self {
38782 value.clone()
38783 }
38784 }
38785 impl ::std::convert::From<WebhookSubscriptionUpdateRequestVariant0>
38786 for WebhookSubscriptionUpdateRequest
38787 {
38788 fn from(value: WebhookSubscriptionUpdateRequestVariant0) -> Self {
38789 Self::Variant0(value)
38790 }
38791 }
38792 impl ::std::convert::From<WebhookSubscriptionUpdateRequestVariant1>
38793 for WebhookSubscriptionUpdateRequest
38794 {
38795 fn from(value: WebhookSubscriptionUpdateRequestVariant1) -> Self {
38796 Self::Variant1(value)
38797 }
38798 }
38799 #[derive(
38923 ::serde::Deserialize,
38924 ::serde::Serialize,
38925 Clone,
38926 Copy,
38927 Debug,
38928 Eq,
38929 Hash,
38930 Ord,
38931 PartialEq,
38932 PartialOrd,
38933 )]
38934 #[serde(deny_unknown_fields)]
38935 pub enum WebhookSubscriptionUpdateRequestVariant0 {}
38936 impl ::std::convert::From<&Self> for WebhookSubscriptionUpdateRequestVariant0 {
38937 fn from(value: &WebhookSubscriptionUpdateRequestVariant0) -> Self {
38938 value.clone()
38939 }
38940 }
38941 #[derive(
39065 ::serde::Deserialize,
39066 ::serde::Serialize,
39067 Clone,
39068 Copy,
39069 Debug,
39070 Eq,
39071 Hash,
39072 Ord,
39073 PartialEq,
39074 PartialOrd,
39075 )]
39076 #[serde(deny_unknown_fields)]
39077 pub enum WebhookSubscriptionUpdateRequestVariant1 {}
39078 impl ::std::convert::From<&Self> for WebhookSubscriptionUpdateRequestVariant1 {
39079 fn from(value: &WebhookSubscriptionUpdateRequestVariant1) -> Self {
39080 value.clone()
39081 }
39082 }
39083 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
39135 pub struct WebhookTarget {
39136 #[serde(
39138 default,
39139 skip_serializing_if = ":: std :: collections :: HashMap::is_empty"
39140 )]
39141 pub headers: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
39142 pub url: Url,
39144 }
39145 impl ::std::convert::From<&WebhookTarget> for WebhookTarget {
39146 fn from(value: &WebhookTarget) -> Self {
39147 value.clone()
39148 }
39149 }
39150 impl WebhookTarget {
39151 pub fn builder() -> builder::WebhookTarget {
39152 Default::default()
39153 }
39154 }
39155 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
39262 pub struct X402ExactEvmPayload {
39263 pub authorization: X402ExactEvmPayloadAuthorization,
39264 pub signature: ::std::string::String,
39266 }
39267 impl ::std::convert::From<&X402ExactEvmPayload> for X402ExactEvmPayload {
39268 fn from(value: &X402ExactEvmPayload) -> Self {
39269 value.clone()
39270 }
39271 }
39272 impl X402ExactEvmPayload {
39273 pub fn builder() -> builder::X402ExactEvmPayload {
39274 Default::default()
39275 }
39276 }
39277 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
39353 pub struct X402ExactEvmPayloadAuthorization {
39354 pub from: X402ExactEvmPayloadAuthorizationFrom,
39356 pub nonce: ::std::string::String,
39358 pub to: X402ExactEvmPayloadAuthorizationTo,
39360 #[serde(rename = "validAfter")]
39362 pub valid_after: ::std::string::String,
39363 #[serde(rename = "validBefore")]
39365 pub valid_before: ::std::string::String,
39366 pub value: ::std::string::String,
39368 }
39369 impl ::std::convert::From<&X402ExactEvmPayloadAuthorization> for X402ExactEvmPayloadAuthorization {
39370 fn from(value: &X402ExactEvmPayloadAuthorization) -> Self {
39371 value.clone()
39372 }
39373 }
39374 impl X402ExactEvmPayloadAuthorization {
39375 pub fn builder() -> builder::X402ExactEvmPayloadAuthorization {
39376 Default::default()
39377 }
39378 }
39379 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39395 #[serde(transparent)]
39396 pub struct X402ExactEvmPayloadAuthorizationFrom(::std::string::String);
39397 impl ::std::ops::Deref for X402ExactEvmPayloadAuthorizationFrom {
39398 type Target = ::std::string::String;
39399 fn deref(&self) -> &::std::string::String {
39400 &self.0
39401 }
39402 }
39403 impl ::std::convert::From<X402ExactEvmPayloadAuthorizationFrom> for ::std::string::String {
39404 fn from(value: X402ExactEvmPayloadAuthorizationFrom) -> Self {
39405 value.0
39406 }
39407 }
39408 impl ::std::convert::From<&X402ExactEvmPayloadAuthorizationFrom>
39409 for X402ExactEvmPayloadAuthorizationFrom
39410 {
39411 fn from(value: &X402ExactEvmPayloadAuthorizationFrom) -> Self {
39412 value.clone()
39413 }
39414 }
39415 impl ::std::str::FromStr for X402ExactEvmPayloadAuthorizationFrom {
39416 type Err = self::error::ConversionError;
39417 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
39418 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
39419 ::std::sync::LazyLock::new(|| {
39420 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
39421 });
39422 if PATTERN.find(value).is_none() {
39423 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
39424 }
39425 Ok(Self(value.to_string()))
39426 }
39427 }
39428 impl ::std::convert::TryFrom<&str> for X402ExactEvmPayloadAuthorizationFrom {
39429 type Error = self::error::ConversionError;
39430 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
39431 value.parse()
39432 }
39433 }
39434 impl ::std::convert::TryFrom<&::std::string::String> for X402ExactEvmPayloadAuthorizationFrom {
39435 type Error = self::error::ConversionError;
39436 fn try_from(
39437 value: &::std::string::String,
39438 ) -> ::std::result::Result<Self, self::error::ConversionError> {
39439 value.parse()
39440 }
39441 }
39442 impl ::std::convert::TryFrom<::std::string::String> for X402ExactEvmPayloadAuthorizationFrom {
39443 type Error = self::error::ConversionError;
39444 fn try_from(
39445 value: ::std::string::String,
39446 ) -> ::std::result::Result<Self, self::error::ConversionError> {
39447 value.parse()
39448 }
39449 }
39450 impl<'de> ::serde::Deserialize<'de> for X402ExactEvmPayloadAuthorizationFrom {
39451 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
39452 where
39453 D: ::serde::Deserializer<'de>,
39454 {
39455 ::std::string::String::deserialize(deserializer)?
39456 .parse()
39457 .map_err(|e: self::error::ConversionError| {
39458 <D::Error as ::serde::de::Error>::custom(e.to_string())
39459 })
39460 }
39461 }
39462 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39478 #[serde(transparent)]
39479 pub struct X402ExactEvmPayloadAuthorizationTo(::std::string::String);
39480 impl ::std::ops::Deref for X402ExactEvmPayloadAuthorizationTo {
39481 type Target = ::std::string::String;
39482 fn deref(&self) -> &::std::string::String {
39483 &self.0
39484 }
39485 }
39486 impl ::std::convert::From<X402ExactEvmPayloadAuthorizationTo> for ::std::string::String {
39487 fn from(value: X402ExactEvmPayloadAuthorizationTo) -> Self {
39488 value.0
39489 }
39490 }
39491 impl ::std::convert::From<&X402ExactEvmPayloadAuthorizationTo>
39492 for X402ExactEvmPayloadAuthorizationTo
39493 {
39494 fn from(value: &X402ExactEvmPayloadAuthorizationTo) -> Self {
39495 value.clone()
39496 }
39497 }
39498 impl ::std::str::FromStr for X402ExactEvmPayloadAuthorizationTo {
39499 type Err = self::error::ConversionError;
39500 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
39501 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
39502 ::std::sync::LazyLock::new(|| {
39503 ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap()
39504 });
39505 if PATTERN.find(value).is_none() {
39506 return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
39507 }
39508 Ok(Self(value.to_string()))
39509 }
39510 }
39511 impl ::std::convert::TryFrom<&str> for X402ExactEvmPayloadAuthorizationTo {
39512 type Error = self::error::ConversionError;
39513 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
39514 value.parse()
39515 }
39516 }
39517 impl ::std::convert::TryFrom<&::std::string::String> for X402ExactEvmPayloadAuthorizationTo {
39518 type Error = self::error::ConversionError;
39519 fn try_from(
39520 value: &::std::string::String,
39521 ) -> ::std::result::Result<Self, self::error::ConversionError> {
39522 value.parse()
39523 }
39524 }
39525 impl ::std::convert::TryFrom<::std::string::String> for X402ExactEvmPayloadAuthorizationTo {
39526 type Error = self::error::ConversionError;
39527 fn try_from(
39528 value: ::std::string::String,
39529 ) -> ::std::result::Result<Self, self::error::ConversionError> {
39530 value.parse()
39531 }
39532 }
39533 impl<'de> ::serde::Deserialize<'de> for X402ExactEvmPayloadAuthorizationTo {
39534 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
39535 where
39536 D: ::serde::Deserializer<'de>,
39537 {
39538 ::std::string::String::deserialize(deserializer)?
39539 .parse()
39540 .map_err(|e: self::error::ConversionError| {
39541 <D::Error as ::serde::de::Error>::custom(e.to_string())
39542 })
39543 }
39544 }
39545 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
39575 pub struct X402ExactSolanaPayload {
39576 pub transaction: ::std::string::String,
39578 }
39579 impl ::std::convert::From<&X402ExactSolanaPayload> for X402ExactSolanaPayload {
39580 fn from(value: &X402ExactSolanaPayload) -> Self {
39581 value.clone()
39582 }
39583 }
39584 impl X402ExactSolanaPayload {
39585 pub fn builder() -> builder::X402ExactSolanaPayload {
39586 Default::default()
39587 }
39588 }
39589 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
39609 #[serde(untagged)]
39610 pub enum X402PaymentPayload {
39611 #[serde(rename = "X402V1PaymentPayload")]
39612 X402v1PaymentPayload(X402V1PaymentPayload),
39613 #[serde(rename = "X402V2PaymentPayload")]
39614 X402v2PaymentPayload(X402V2PaymentPayload),
39615 }
39616 impl ::std::convert::From<&Self> for X402PaymentPayload {
39617 fn from(value: &X402PaymentPayload) -> Self {
39618 value.clone()
39619 }
39620 }
39621 impl ::std::convert::From<X402V1PaymentPayload> for X402PaymentPayload {
39622 fn from(value: X402V1PaymentPayload) -> Self {
39623 Self::X402v1PaymentPayload(value)
39624 }
39625 }
39626 impl ::std::convert::From<X402V2PaymentPayload> for X402PaymentPayload {
39627 fn from(value: X402V2PaymentPayload) -> Self {
39628 Self::X402v2PaymentPayload(value)
39629 }
39630 }
39631 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
39651 #[serde(untagged)]
39652 pub enum X402PaymentRequirements {
39653 #[serde(rename = "X402V1PaymentRequirements")]
39654 X402v1PaymentRequirements(X402V1PaymentRequirements),
39655 #[serde(rename = "X402V2PaymentRequirements")]
39656 X402v2PaymentRequirements(X402V2PaymentRequirements),
39657 }
39658 impl ::std::convert::From<&Self> for X402PaymentRequirements {
39659 fn from(value: &X402PaymentRequirements) -> Self {
39660 value.clone()
39661 }
39662 }
39663 impl ::std::convert::From<X402V1PaymentRequirements> for X402PaymentRequirements {
39664 fn from(value: X402V1PaymentRequirements) -> Self {
39665 Self::X402v1PaymentRequirements(value)
39666 }
39667 }
39668 impl ::std::convert::From<X402V2PaymentRequirements> for X402PaymentRequirements {
39669 fn from(value: X402V2PaymentRequirements) -> Self {
39670 Self::X402v2PaymentRequirements(value)
39671 }
39672 }
39673 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
39708 pub struct X402ResourceInfo {
39709 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
39711 pub description: ::std::option::Option<::std::string::String>,
39712 #[serde(
39714 rename = "mimeType",
39715 default,
39716 skip_serializing_if = "::std::option::Option::is_none"
39717 )]
39718 pub mime_type: ::std::option::Option<::std::string::String>,
39719 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
39721 pub url: ::std::option::Option<::std::string::String>,
39722 }
39723 impl ::std::convert::From<&X402ResourceInfo> for X402ResourceInfo {
39724 fn from(value: &X402ResourceInfo) -> Self {
39725 value.clone()
39726 }
39727 }
39728 impl ::std::default::Default for X402ResourceInfo {
39729 fn default() -> Self {
39730 Self {
39731 description: Default::default(),
39732 mime_type: Default::default(),
39733 url: Default::default(),
39734 }
39735 }
39736 }
39737 impl X402ResourceInfo {
39738 pub fn builder() -> builder::X402ResourceInfo {
39739 Default::default()
39740 }
39741 }
39742 #[derive(
39774 ::serde::Deserialize,
39775 ::serde::Serialize,
39776 Clone,
39777 Copy,
39778 Debug,
39779 Eq,
39780 Hash,
39781 Ord,
39782 PartialEq,
39783 PartialOrd,
39784 )]
39785 pub enum X402SettleErrorReason {
39786 #[serde(rename = "insufficient_funds")]
39787 InsufficientFunds,
39788 #[serde(rename = "invalid_scheme")]
39789 InvalidScheme,
39790 #[serde(rename = "invalid_network")]
39791 InvalidNetwork,
39792 #[serde(rename = "invalid_x402_version")]
39793 InvalidX402Version,
39794 #[serde(rename = "invalid_payment_requirements")]
39795 InvalidPaymentRequirements,
39796 #[serde(rename = "invalid_payload")]
39797 InvalidPayload,
39798 #[serde(rename = "invalid_exact_evm_payload_authorization_value")]
39799 InvalidExactEvmPayloadAuthorizationValue,
39800 #[serde(rename = "invalid_exact_evm_payload_authorization_valid_after")]
39801 InvalidExactEvmPayloadAuthorizationValidAfter,
39802 #[serde(rename = "invalid_exact_evm_payload_authorization_valid_before")]
39803 InvalidExactEvmPayloadAuthorizationValidBefore,
39804 #[serde(rename = "invalid_exact_evm_payload_authorization_typed_data_message")]
39805 InvalidExactEvmPayloadAuthorizationTypedDataMessage,
39806 #[serde(rename = "invalid_exact_evm_payload_authorization_from_address_kyt")]
39807 InvalidExactEvmPayloadAuthorizationFromAddressKyt,
39808 #[serde(rename = "invalid_exact_evm_payload_authorization_to_address_kyt")]
39809 InvalidExactEvmPayloadAuthorizationToAddressKyt,
39810 #[serde(rename = "invalid_exact_evm_payload_signature_address")]
39811 InvalidExactEvmPayloadSignatureAddress,
39812 #[serde(rename = "settle_exact_svm_block_height_exceeded")]
39813 SettleExactSvmBlockHeightExceeded,
39814 #[serde(rename = "settle_exact_svm_transaction_confirmation_timed_out")]
39815 SettleExactSvmTransactionConfirmationTimedOut,
39816 }
39817 impl ::std::convert::From<&Self> for X402SettleErrorReason {
39818 fn from(value: &X402SettleErrorReason) -> Self {
39819 value.clone()
39820 }
39821 }
39822 impl ::std::fmt::Display for X402SettleErrorReason {
39823 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
39824 match *self {
39825 Self::InsufficientFunds => f.write_str("insufficient_funds"),
39826 Self::InvalidScheme => f.write_str("invalid_scheme"),
39827 Self::InvalidNetwork => f.write_str("invalid_network"),
39828 Self::InvalidX402Version => f.write_str("invalid_x402_version"),
39829 Self::InvalidPaymentRequirements => f.write_str("invalid_payment_requirements"),
39830 Self::InvalidPayload => f.write_str("invalid_payload"),
39831 Self::InvalidExactEvmPayloadAuthorizationValue => {
39832 f.write_str("invalid_exact_evm_payload_authorization_value")
39833 }
39834 Self::InvalidExactEvmPayloadAuthorizationValidAfter => {
39835 f.write_str("invalid_exact_evm_payload_authorization_valid_after")
39836 }
39837 Self::InvalidExactEvmPayloadAuthorizationValidBefore => {
39838 f.write_str("invalid_exact_evm_payload_authorization_valid_before")
39839 }
39840 Self::InvalidExactEvmPayloadAuthorizationTypedDataMessage => {
39841 f.write_str("invalid_exact_evm_payload_authorization_typed_data_message")
39842 }
39843 Self::InvalidExactEvmPayloadAuthorizationFromAddressKyt => {
39844 f.write_str("invalid_exact_evm_payload_authorization_from_address_kyt")
39845 }
39846 Self::InvalidExactEvmPayloadAuthorizationToAddressKyt => {
39847 f.write_str("invalid_exact_evm_payload_authorization_to_address_kyt")
39848 }
39849 Self::InvalidExactEvmPayloadSignatureAddress => {
39850 f.write_str("invalid_exact_evm_payload_signature_address")
39851 }
39852 Self::SettleExactSvmBlockHeightExceeded => {
39853 f.write_str("settle_exact_svm_block_height_exceeded")
39854 }
39855 Self::SettleExactSvmTransactionConfirmationTimedOut => {
39856 f.write_str("settle_exact_svm_transaction_confirmation_timed_out")
39857 }
39858 }
39859 }
39860 }
39861 impl ::std::str::FromStr for X402SettleErrorReason {
39862 type Err = self::error::ConversionError;
39863 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
39864 match value {
39865 "insufficient_funds" => Ok(Self::InsufficientFunds),
39866 "invalid_scheme" => Ok(Self::InvalidScheme),
39867 "invalid_network" => Ok(Self::InvalidNetwork),
39868 "invalid_x402_version" => Ok(Self::InvalidX402Version),
39869 "invalid_payment_requirements" => Ok(Self::InvalidPaymentRequirements),
39870 "invalid_payload" => Ok(Self::InvalidPayload),
39871 "invalid_exact_evm_payload_authorization_value" => {
39872 Ok(Self::InvalidExactEvmPayloadAuthorizationValue)
39873 }
39874 "invalid_exact_evm_payload_authorization_valid_after" => {
39875 Ok(Self::InvalidExactEvmPayloadAuthorizationValidAfter)
39876 }
39877 "invalid_exact_evm_payload_authorization_valid_before" => {
39878 Ok(Self::InvalidExactEvmPayloadAuthorizationValidBefore)
39879 }
39880 "invalid_exact_evm_payload_authorization_typed_data_message" => {
39881 Ok(Self::InvalidExactEvmPayloadAuthorizationTypedDataMessage)
39882 }
39883 "invalid_exact_evm_payload_authorization_from_address_kyt" => {
39884 Ok(Self::InvalidExactEvmPayloadAuthorizationFromAddressKyt)
39885 }
39886 "invalid_exact_evm_payload_authorization_to_address_kyt" => {
39887 Ok(Self::InvalidExactEvmPayloadAuthorizationToAddressKyt)
39888 }
39889 "invalid_exact_evm_payload_signature_address" => {
39890 Ok(Self::InvalidExactEvmPayloadSignatureAddress)
39891 }
39892 "settle_exact_svm_block_height_exceeded" => {
39893 Ok(Self::SettleExactSvmBlockHeightExceeded)
39894 }
39895 "settle_exact_svm_transaction_confirmation_timed_out" => {
39896 Ok(Self::SettleExactSvmTransactionConfirmationTimedOut)
39897 }
39898 _ => Err("invalid value".into()),
39899 }
39900 }
39901 }
39902 impl ::std::convert::TryFrom<&str> for X402SettleErrorReason {
39903 type Error = self::error::ConversionError;
39904 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
39905 value.parse()
39906 }
39907 }
39908 impl ::std::convert::TryFrom<&::std::string::String> for X402SettleErrorReason {
39909 type Error = self::error::ConversionError;
39910 fn try_from(
39911 value: &::std::string::String,
39912 ) -> ::std::result::Result<Self, self::error::ConversionError> {
39913 value.parse()
39914 }
39915 }
39916 impl ::std::convert::TryFrom<::std::string::String> for X402SettleErrorReason {
39917 type Error = self::error::ConversionError;
39918 fn try_from(
39919 value: ::std::string::String,
39920 ) -> ::std::result::Result<Self, self::error::ConversionError> {
39921 value.parse()
39922 }
39923 }
39924 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
39973 pub struct X402SupportedPaymentKind {
39974 #[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
39976 pub extra: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
39977 pub network: ::std::string::String,
39979 pub scheme: X402SupportedPaymentKindScheme,
39981 #[serde(rename = "x402Version")]
39982 pub x402_version: X402Version,
39983 }
39984 impl ::std::convert::From<&X402SupportedPaymentKind> for X402SupportedPaymentKind {
39985 fn from(value: &X402SupportedPaymentKind) -> Self {
39986 value.clone()
39987 }
39988 }
39989 impl X402SupportedPaymentKind {
39990 pub fn builder() -> builder::X402SupportedPaymentKind {
39991 Default::default()
39992 }
39993 }
39994 #[derive(
40015 ::serde::Deserialize,
40016 ::serde::Serialize,
40017 Clone,
40018 Copy,
40019 Debug,
40020 Eq,
40021 Hash,
40022 Ord,
40023 PartialEq,
40024 PartialOrd,
40025 )]
40026 pub enum X402SupportedPaymentKindNetwork {
40027 #[serde(rename = "base-sepolia")]
40028 BaseSepolia,
40029 #[serde(rename = "base")]
40030 Base,
40031 #[serde(rename = "solana-devnet")]
40032 SolanaDevnet,
40033 #[serde(rename = "solana")]
40034 Solana,
40035 }
40036 impl ::std::convert::From<&Self> for X402SupportedPaymentKindNetwork {
40037 fn from(value: &X402SupportedPaymentKindNetwork) -> Self {
40038 value.clone()
40039 }
40040 }
40041 impl ::std::fmt::Display for X402SupportedPaymentKindNetwork {
40042 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
40043 match *self {
40044 Self::BaseSepolia => f.write_str("base-sepolia"),
40045 Self::Base => f.write_str("base"),
40046 Self::SolanaDevnet => f.write_str("solana-devnet"),
40047 Self::Solana => f.write_str("solana"),
40048 }
40049 }
40050 }
40051 impl ::std::str::FromStr for X402SupportedPaymentKindNetwork {
40052 type Err = self::error::ConversionError;
40053 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
40054 match value {
40055 "base-sepolia" => Ok(Self::BaseSepolia),
40056 "base" => Ok(Self::Base),
40057 "solana-devnet" => Ok(Self::SolanaDevnet),
40058 "solana" => Ok(Self::Solana),
40059 _ => Err("invalid value".into()),
40060 }
40061 }
40062 }
40063 impl ::std::convert::TryFrom<&str> for X402SupportedPaymentKindNetwork {
40064 type Error = self::error::ConversionError;
40065 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
40066 value.parse()
40067 }
40068 }
40069 impl ::std::convert::TryFrom<&::std::string::String> for X402SupportedPaymentKindNetwork {
40070 type Error = self::error::ConversionError;
40071 fn try_from(
40072 value: &::std::string::String,
40073 ) -> ::std::result::Result<Self, self::error::ConversionError> {
40074 value.parse()
40075 }
40076 }
40077 impl ::std::convert::TryFrom<::std::string::String> for X402SupportedPaymentKindNetwork {
40078 type Error = self::error::ConversionError;
40079 fn try_from(
40080 value: ::std::string::String,
40081 ) -> ::std::result::Result<Self, self::error::ConversionError> {
40082 value.parse()
40083 }
40084 }
40085 #[derive(
40103 ::serde::Deserialize,
40104 ::serde::Serialize,
40105 Clone,
40106 Copy,
40107 Debug,
40108 Eq,
40109 Hash,
40110 Ord,
40111 PartialEq,
40112 PartialOrd,
40113 )]
40114 pub enum X402SupportedPaymentKindScheme {
40115 #[serde(rename = "exact")]
40116 Exact,
40117 }
40118 impl ::std::convert::From<&Self> for X402SupportedPaymentKindScheme {
40119 fn from(value: &X402SupportedPaymentKindScheme) -> Self {
40120 value.clone()
40121 }
40122 }
40123 impl ::std::fmt::Display for X402SupportedPaymentKindScheme {
40124 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
40125 match *self {
40126 Self::Exact => f.write_str("exact"),
40127 }
40128 }
40129 }
40130 impl ::std::str::FromStr for X402SupportedPaymentKindScheme {
40131 type Err = self::error::ConversionError;
40132 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
40133 match value {
40134 "exact" => Ok(Self::Exact),
40135 _ => Err("invalid value".into()),
40136 }
40137 }
40138 }
40139 impl ::std::convert::TryFrom<&str> for X402SupportedPaymentKindScheme {
40140 type Error = self::error::ConversionError;
40141 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
40142 value.parse()
40143 }
40144 }
40145 impl ::std::convert::TryFrom<&::std::string::String> for X402SupportedPaymentKindScheme {
40146 type Error = self::error::ConversionError;
40147 fn try_from(
40148 value: &::std::string::String,
40149 ) -> ::std::result::Result<Self, self::error::ConversionError> {
40150 value.parse()
40151 }
40152 }
40153 impl ::std::convert::TryFrom<::std::string::String> for X402SupportedPaymentKindScheme {
40154 type Error = self::error::ConversionError;
40155 fn try_from(
40156 value: ::std::string::String,
40157 ) -> ::std::result::Result<Self, self::error::ConversionError> {
40158 value.parse()
40159 }
40160 }
40161 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
40250 pub struct X402V1PaymentPayload {
40251 pub network: X402v1PaymentPayloadNetwork,
40253 pub payload: X402v1PaymentPayloadPayload,
40255 pub scheme: X402v1PaymentPayloadScheme,
40257 #[serde(rename = "x402Version")]
40258 pub x402_version: X402Version,
40259 }
40260 impl ::std::convert::From<&X402V1PaymentPayload> for X402V1PaymentPayload {
40261 fn from(value: &X402V1PaymentPayload) -> Self {
40262 value.clone()
40263 }
40264 }
40265 impl X402V1PaymentPayload {
40266 pub fn builder() -> builder::X402V1PaymentPayload {
40267 Default::default()
40268 }
40269 }
40270 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
40389 pub struct X402V1PaymentRequirements {
40390 pub asset: X402v1PaymentRequirementsAsset,
40396 pub description: ::std::string::String,
40398 #[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
40400 pub extra: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
40401 #[serde(rename = "maxAmountRequired")]
40403 pub max_amount_required: ::std::string::String,
40404 #[serde(rename = "maxTimeoutSeconds")]
40406 pub max_timeout_seconds: i64,
40407 #[serde(rename = "mimeType")]
40409 pub mime_type: ::std::string::String,
40410 pub network: X402v1PaymentRequirementsNetwork,
40412 #[serde(
40414 rename = "outputSchema",
40415 default,
40416 skip_serializing_if = "::serde_json::Map::is_empty"
40417 )]
40418 pub output_schema: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
40419 #[serde(rename = "payTo")]
40425 pub pay_to: X402v1PaymentRequirementsPayTo,
40426 pub resource: ::std::string::String,
40428 pub scheme: X402v1PaymentRequirementsScheme,
40430 }
40431 impl ::std::convert::From<&X402V1PaymentRequirements> for X402V1PaymentRequirements {
40432 fn from(value: &X402V1PaymentRequirements) -> Self {
40433 value.clone()
40434 }
40435 }
40436 impl X402V1PaymentRequirements {
40437 pub fn builder() -> builder::X402V1PaymentRequirements {
40438 Default::default()
40439 }
40440 }
40441 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
40539 pub struct X402V2PaymentPayload {
40540 pub accepted: X402V2PaymentRequirements,
40541 #[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
40543 pub extensions: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
40544 pub payload: X402v2PaymentPayloadPayload,
40546 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
40547 pub resource: ::std::option::Option<X402ResourceInfo>,
40548 #[serde(rename = "x402Version")]
40549 pub x402_version: X402Version,
40550 }
40551 impl ::std::convert::From<&X402V2PaymentPayload> for X402V2PaymentPayload {
40552 fn from(value: &X402V2PaymentPayload) -> Self {
40553 value.clone()
40554 }
40555 }
40556 impl X402V2PaymentPayload {
40557 pub fn builder() -> builder::X402V2PaymentPayload {
40558 Default::default()
40559 }
40560 }
40561 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
40641 pub struct X402V2PaymentRequirements {
40642 pub amount: ::std::string::String,
40644 pub asset: X402v2PaymentRequirementsAsset,
40650 #[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
40652 pub extra: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
40653 #[serde(rename = "maxTimeoutSeconds")]
40655 pub max_timeout_seconds: i64,
40656 pub network: ::std::string::String,
40658 #[serde(rename = "payTo")]
40664 pub pay_to: X402v2PaymentRequirementsPayTo,
40665 pub scheme: X402v2PaymentRequirementsScheme,
40667 }
40668 impl ::std::convert::From<&X402V2PaymentRequirements> for X402V2PaymentRequirements {
40669 fn from(value: &X402V2PaymentRequirements) -> Self {
40670 value.clone()
40671 }
40672 }
40673 impl X402V2PaymentRequirements {
40674 pub fn builder() -> builder::X402V2PaymentRequirements {
40675 Default::default()
40676 }
40677 }
40678 #[derive(
40730 ::serde::Deserialize,
40731 ::serde::Serialize,
40732 Clone,
40733 Copy,
40734 Debug,
40735 Eq,
40736 Hash,
40737 Ord,
40738 PartialEq,
40739 PartialOrd,
40740 )]
40741 pub enum X402VerifyInvalidReason {
40742 #[serde(rename = "insufficient_funds")]
40743 InsufficientFunds,
40744 #[serde(rename = "invalid_scheme")]
40745 InvalidScheme,
40746 #[serde(rename = "invalid_network")]
40747 InvalidNetwork,
40748 #[serde(rename = "invalid_x402_version")]
40749 InvalidX402Version,
40750 #[serde(rename = "invalid_payment_requirements")]
40751 InvalidPaymentRequirements,
40752 #[serde(rename = "invalid_payload")]
40753 InvalidPayload,
40754 #[serde(rename = "invalid_exact_evm_payload_authorization_value")]
40755 InvalidExactEvmPayloadAuthorizationValue,
40756 #[serde(rename = "invalid_exact_evm_payload_authorization_value_too_low")]
40757 InvalidExactEvmPayloadAuthorizationValueTooLow,
40758 #[serde(rename = "invalid_exact_evm_payload_authorization_valid_after")]
40759 InvalidExactEvmPayloadAuthorizationValidAfter,
40760 #[serde(rename = "invalid_exact_evm_payload_authorization_valid_before")]
40761 InvalidExactEvmPayloadAuthorizationValidBefore,
40762 #[serde(rename = "invalid_exact_evm_payload_authorization_typed_data_message")]
40763 InvalidExactEvmPayloadAuthorizationTypedDataMessage,
40764 #[serde(rename = "invalid_exact_evm_payload_authorization_from_address_kyt")]
40765 InvalidExactEvmPayloadAuthorizationFromAddressKyt,
40766 #[serde(rename = "invalid_exact_evm_payload_authorization_to_address_kyt")]
40767 InvalidExactEvmPayloadAuthorizationToAddressKyt,
40768 #[serde(rename = "invalid_exact_evm_payload_signature")]
40769 InvalidExactEvmPayloadSignature,
40770 #[serde(rename = "invalid_exact_evm_payload_signature_address")]
40771 InvalidExactEvmPayloadSignatureAddress,
40772 #[serde(rename = "invalid_exact_svm_payload_transaction")]
40773 InvalidExactSvmPayloadTransaction,
40774 #[serde(rename = "invalid_exact_svm_payload_transaction_amount_mismatch")]
40775 InvalidExactSvmPayloadTransactionAmountMismatch,
40776 #[serde(rename = "invalid_exact_svm_payload_transaction_create_ata_instruction")]
40777 InvalidExactSvmPayloadTransactionCreateAtaInstruction,
40778 #[serde(
40779 rename = "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee"
40780 )]
40781 InvalidExactSvmPayloadTransactionCreateAtaInstructionIncorrectPayee,
40782 #[serde(
40783 rename = "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset"
40784 )]
40785 InvalidExactSvmPayloadTransactionCreateAtaInstructionIncorrectAsset,
40786 #[serde(rename = "invalid_exact_svm_payload_transaction_instructions")]
40787 InvalidExactSvmPayloadTransactionInstructions,
40788 #[serde(rename = "invalid_exact_svm_payload_transaction_instructions_length")]
40789 InvalidExactSvmPayloadTransactionInstructionsLength,
40790 #[serde(
40791 rename = "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction"
40792 )]
40793 InvalidExactSvmPayloadTransactionInstructionsComputeLimitInstruction,
40794 #[serde(
40795 rename = "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction"
40796 )]
40797 InvalidExactSvmPayloadTransactionInstructionsComputePriceInstruction,
40798 #[serde(
40799 rename = "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high"
40800 )]
40801 InvalidExactSvmPayloadTransactionInstructionsComputePriceInstructionTooHigh,
40802 #[serde(
40803 rename = "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked"
40804 )]
40805 InvalidExactSvmPayloadTransactionInstructionNotSplTokenTransferChecked,
40806 #[serde(
40807 rename = "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked"
40808 )]
40809 InvalidExactSvmPayloadTransactionInstructionNotToken2022TransferChecked,
40810 #[serde(rename = "invalid_exact_svm_payload_transaction_not_a_transfer_instruction")]
40811 InvalidExactSvmPayloadTransactionNotATransferInstruction,
40812 #[serde(rename = "invalid_exact_svm_payload_transaction_cannot_derive_receiver_ata")]
40813 InvalidExactSvmPayloadTransactionCannotDeriveReceiverAta,
40814 #[serde(rename = "invalid_exact_svm_payload_transaction_receiver_ata_not_found")]
40815 InvalidExactSvmPayloadTransactionReceiverAtaNotFound,
40816 #[serde(rename = "invalid_exact_svm_payload_transaction_sender_ata_not_found")]
40817 InvalidExactSvmPayloadTransactionSenderAtaNotFound,
40818 #[serde(rename = "invalid_exact_svm_payload_transaction_simulation_failed")]
40819 InvalidExactSvmPayloadTransactionSimulationFailed,
40820 #[serde(rename = "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata")]
40821 InvalidExactSvmPayloadTransactionTransferToIncorrectAta,
40822 #[serde(
40823 rename = "invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts"
40824 )]
40825 InvalidExactSvmPayloadTransactionFeePayerIncludedInInstructionAccounts,
40826 #[serde(rename = "invalid_exact_svm_payload_transaction_fee_payer_transferring_funds")]
40827 InvalidExactSvmPayloadTransactionFeePayerTransferringFunds,
40828 }
40829 impl ::std::convert::From<&Self> for X402VerifyInvalidReason {
40830 fn from(value: &X402VerifyInvalidReason) -> Self {
40831 value.clone()
40832 }
40833 }
40834 impl ::std::fmt::Display for X402VerifyInvalidReason {
40835 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
40836 match *self {
40837 Self::InsufficientFunds => f.write_str("insufficient_funds"),
40838 Self::InvalidScheme => f.write_str("invalid_scheme"),
40839 Self::InvalidNetwork => f.write_str("invalid_network"),
40840 Self::InvalidX402Version => f.write_str("invalid_x402_version"),
40841 Self::InvalidPaymentRequirements => {
40842 f.write_str("invalid_payment_requirements")
40843 }
40844 Self::InvalidPayload => f.write_str("invalid_payload"),
40845 Self::InvalidExactEvmPayloadAuthorizationValue => {
40846 f.write_str("invalid_exact_evm_payload_authorization_value")
40847 }
40848 Self::InvalidExactEvmPayloadAuthorizationValueTooLow => {
40849 f.write_str("invalid_exact_evm_payload_authorization_value_too_low")
40850 }
40851 Self::InvalidExactEvmPayloadAuthorizationValidAfter => {
40852 f.write_str("invalid_exact_evm_payload_authorization_valid_after")
40853 }
40854 Self::InvalidExactEvmPayloadAuthorizationValidBefore => {
40855 f.write_str("invalid_exact_evm_payload_authorization_valid_before")
40856 }
40857 Self::InvalidExactEvmPayloadAuthorizationTypedDataMessage => {
40858 f.write_str(
40859 "invalid_exact_evm_payload_authorization_typed_data_message",
40860 )
40861 }
40862 Self::InvalidExactEvmPayloadAuthorizationFromAddressKyt => {
40863 f.write_str(
40864 "invalid_exact_evm_payload_authorization_from_address_kyt",
40865 )
40866 }
40867 Self::InvalidExactEvmPayloadAuthorizationToAddressKyt => {
40868 f.write_str("invalid_exact_evm_payload_authorization_to_address_kyt")
40869 }
40870 Self::InvalidExactEvmPayloadSignature => {
40871 f.write_str("invalid_exact_evm_payload_signature")
40872 }
40873 Self::InvalidExactEvmPayloadSignatureAddress => {
40874 f.write_str("invalid_exact_evm_payload_signature_address")
40875 }
40876 Self::InvalidExactSvmPayloadTransaction => {
40877 f.write_str("invalid_exact_svm_payload_transaction")
40878 }
40879 Self::InvalidExactSvmPayloadTransactionAmountMismatch => {
40880 f.write_str("invalid_exact_svm_payload_transaction_amount_mismatch")
40881 }
40882 Self::InvalidExactSvmPayloadTransactionCreateAtaInstruction => {
40883 f.write_str(
40884 "invalid_exact_svm_payload_transaction_create_ata_instruction",
40885 )
40886 }
40887 Self::InvalidExactSvmPayloadTransactionCreateAtaInstructionIncorrectPayee => {
40888 f.write_str(
40889 "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee",
40890 )
40891 }
40892 Self::InvalidExactSvmPayloadTransactionCreateAtaInstructionIncorrectAsset => {
40893 f.write_str(
40894 "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset",
40895 )
40896 }
40897 Self::InvalidExactSvmPayloadTransactionInstructions => {
40898 f.write_str("invalid_exact_svm_payload_transaction_instructions")
40899 }
40900 Self::InvalidExactSvmPayloadTransactionInstructionsLength => {
40901 f.write_str(
40902 "invalid_exact_svm_payload_transaction_instructions_length",
40903 )
40904 }
40905 Self::InvalidExactSvmPayloadTransactionInstructionsComputeLimitInstruction => {
40906 f.write_str(
40907 "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction",
40908 )
40909 }
40910 Self::InvalidExactSvmPayloadTransactionInstructionsComputePriceInstruction => {
40911 f.write_str(
40912 "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction",
40913 )
40914 }
40915 Self::InvalidExactSvmPayloadTransactionInstructionsComputePriceInstructionTooHigh => {
40916 f.write_str(
40917 "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high",
40918 )
40919 }
40920 Self::InvalidExactSvmPayloadTransactionInstructionNotSplTokenTransferChecked => {
40921 f.write_str(
40922 "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked",
40923 )
40924 }
40925 Self::InvalidExactSvmPayloadTransactionInstructionNotToken2022TransferChecked => {
40926 f.write_str(
40927 "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked",
40928 )
40929 }
40930 Self::InvalidExactSvmPayloadTransactionNotATransferInstruction => {
40931 f.write_str(
40932 "invalid_exact_svm_payload_transaction_not_a_transfer_instruction",
40933 )
40934 }
40935 Self::InvalidExactSvmPayloadTransactionCannotDeriveReceiverAta => {
40936 f.write_str(
40937 "invalid_exact_svm_payload_transaction_cannot_derive_receiver_ata",
40938 )
40939 }
40940 Self::InvalidExactSvmPayloadTransactionReceiverAtaNotFound => {
40941 f.write_str(
40942 "invalid_exact_svm_payload_transaction_receiver_ata_not_found",
40943 )
40944 }
40945 Self::InvalidExactSvmPayloadTransactionSenderAtaNotFound => {
40946 f.write_str(
40947 "invalid_exact_svm_payload_transaction_sender_ata_not_found",
40948 )
40949 }
40950 Self::InvalidExactSvmPayloadTransactionSimulationFailed => {
40951 f.write_str(
40952 "invalid_exact_svm_payload_transaction_simulation_failed",
40953 )
40954 }
40955 Self::InvalidExactSvmPayloadTransactionTransferToIncorrectAta => {
40956 f.write_str(
40957 "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata",
40958 )
40959 }
40960 Self::InvalidExactSvmPayloadTransactionFeePayerIncludedInInstructionAccounts => {
40961 f.write_str(
40962 "invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts",
40963 )
40964 }
40965 Self::InvalidExactSvmPayloadTransactionFeePayerTransferringFunds => {
40966 f.write_str(
40967 "invalid_exact_svm_payload_transaction_fee_payer_transferring_funds",
40968 )
40969 }
40970 }
40971 }
40972 }
40973 impl ::std::str::FromStr for X402VerifyInvalidReason {
40974 type Err = self::error::ConversionError;
40975 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
40976 match value {
40977 "insufficient_funds" => Ok(Self::InsufficientFunds),
40978 "invalid_scheme" => Ok(Self::InvalidScheme),
40979 "invalid_network" => Ok(Self::InvalidNetwork),
40980 "invalid_x402_version" => Ok(Self::InvalidX402Version),
40981 "invalid_payment_requirements" => Ok(Self::InvalidPaymentRequirements),
40982 "invalid_payload" => Ok(Self::InvalidPayload),
40983 "invalid_exact_evm_payload_authorization_value" => {
40984 Ok(Self::InvalidExactEvmPayloadAuthorizationValue)
40985 }
40986 "invalid_exact_evm_payload_authorization_value_too_low" => {
40987 Ok(Self::InvalidExactEvmPayloadAuthorizationValueTooLow)
40988 }
40989 "invalid_exact_evm_payload_authorization_valid_after" => {
40990 Ok(Self::InvalidExactEvmPayloadAuthorizationValidAfter)
40991 }
40992 "invalid_exact_evm_payload_authorization_valid_before" => {
40993 Ok(Self::InvalidExactEvmPayloadAuthorizationValidBefore)
40994 }
40995 "invalid_exact_evm_payload_authorization_typed_data_message" => {
40996 Ok(Self::InvalidExactEvmPayloadAuthorizationTypedDataMessage)
40997 }
40998 "invalid_exact_evm_payload_authorization_from_address_kyt" => {
40999 Ok(Self::InvalidExactEvmPayloadAuthorizationFromAddressKyt)
41000 }
41001 "invalid_exact_evm_payload_authorization_to_address_kyt" => {
41002 Ok(Self::InvalidExactEvmPayloadAuthorizationToAddressKyt)
41003 }
41004 "invalid_exact_evm_payload_signature" => {
41005 Ok(Self::InvalidExactEvmPayloadSignature)
41006 }
41007 "invalid_exact_evm_payload_signature_address" => {
41008 Ok(Self::InvalidExactEvmPayloadSignatureAddress)
41009 }
41010 "invalid_exact_svm_payload_transaction" => {
41011 Ok(Self::InvalidExactSvmPayloadTransaction)
41012 }
41013 "invalid_exact_svm_payload_transaction_amount_mismatch" => {
41014 Ok(Self::InvalidExactSvmPayloadTransactionAmountMismatch)
41015 }
41016 "invalid_exact_svm_payload_transaction_create_ata_instruction" => {
41017 Ok(Self::InvalidExactSvmPayloadTransactionCreateAtaInstruction)
41018 }
41019 "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee" => {
41020 Ok(
41021 Self::InvalidExactSvmPayloadTransactionCreateAtaInstructionIncorrectPayee,
41022 )
41023 }
41024 "invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset" => {
41025 Ok(
41026 Self::InvalidExactSvmPayloadTransactionCreateAtaInstructionIncorrectAsset,
41027 )
41028 }
41029 "invalid_exact_svm_payload_transaction_instructions" => {
41030 Ok(Self::InvalidExactSvmPayloadTransactionInstructions)
41031 }
41032 "invalid_exact_svm_payload_transaction_instructions_length" => {
41033 Ok(Self::InvalidExactSvmPayloadTransactionInstructionsLength)
41034 }
41035 "invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction" => {
41036 Ok(
41037 Self::InvalidExactSvmPayloadTransactionInstructionsComputeLimitInstruction,
41038 )
41039 }
41040 "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction" => {
41041 Ok(
41042 Self::InvalidExactSvmPayloadTransactionInstructionsComputePriceInstruction,
41043 )
41044 }
41045 "invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high" => {
41046 Ok(
41047 Self::InvalidExactSvmPayloadTransactionInstructionsComputePriceInstructionTooHigh,
41048 )
41049 }
41050 "invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked" => {
41051 Ok(
41052 Self::InvalidExactSvmPayloadTransactionInstructionNotSplTokenTransferChecked,
41053 )
41054 }
41055 "invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked" => {
41056 Ok(
41057 Self::InvalidExactSvmPayloadTransactionInstructionNotToken2022TransferChecked,
41058 )
41059 }
41060 "invalid_exact_svm_payload_transaction_not_a_transfer_instruction" => {
41061 Ok(Self::InvalidExactSvmPayloadTransactionNotATransferInstruction)
41062 }
41063 "invalid_exact_svm_payload_transaction_cannot_derive_receiver_ata" => {
41064 Ok(Self::InvalidExactSvmPayloadTransactionCannotDeriveReceiverAta)
41065 }
41066 "invalid_exact_svm_payload_transaction_receiver_ata_not_found" => {
41067 Ok(Self::InvalidExactSvmPayloadTransactionReceiverAtaNotFound)
41068 }
41069 "invalid_exact_svm_payload_transaction_sender_ata_not_found" => {
41070 Ok(Self::InvalidExactSvmPayloadTransactionSenderAtaNotFound)
41071 }
41072 "invalid_exact_svm_payload_transaction_simulation_failed" => {
41073 Ok(Self::InvalidExactSvmPayloadTransactionSimulationFailed)
41074 }
41075 "invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata" => {
41076 Ok(Self::InvalidExactSvmPayloadTransactionTransferToIncorrectAta)
41077 }
41078 "invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts" => {
41079 Ok(
41080 Self::InvalidExactSvmPayloadTransactionFeePayerIncludedInInstructionAccounts,
41081 )
41082 }
41083 "invalid_exact_svm_payload_transaction_fee_payer_transferring_funds" => {
41084 Ok(Self::InvalidExactSvmPayloadTransactionFeePayerTransferringFunds)
41085 }
41086 _ => Err("invalid value".into()),
41087 }
41088 }
41089 }
41090 impl ::std::convert::TryFrom<&str> for X402VerifyInvalidReason {
41091 type Error = self::error::ConversionError;
41092 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41093 value.parse()
41094 }
41095 }
41096 impl ::std::convert::TryFrom<&::std::string::String> for X402VerifyInvalidReason {
41097 type Error = self::error::ConversionError;
41098 fn try_from(
41099 value: &::std::string::String,
41100 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41101 value.parse()
41102 }
41103 }
41104 impl ::std::convert::TryFrom<::std::string::String> for X402VerifyInvalidReason {
41105 type Error = self::error::ConversionError;
41106 fn try_from(
41107 value: ::std::string::String,
41108 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41109 value.parse()
41110 }
41111 }
41112 #[derive(::serde::Serialize, Clone, Debug)]
41131 #[serde(transparent)]
41132 pub struct X402Version(i64);
41133 impl ::std::ops::Deref for X402Version {
41134 type Target = i64;
41135 fn deref(&self) -> &i64 {
41136 &self.0
41137 }
41138 }
41139 impl ::std::convert::From<X402Version> for i64 {
41140 fn from(value: X402Version) -> Self {
41141 value.0
41142 }
41143 }
41144 impl ::std::convert::From<&X402Version> for X402Version {
41145 fn from(value: &X402Version) -> Self {
41146 value.clone()
41147 }
41148 }
41149 impl ::std::convert::TryFrom<i64> for X402Version {
41150 type Error = self::error::ConversionError;
41151 fn try_from(value: i64) -> ::std::result::Result<Self, self::error::ConversionError> {
41152 if ![1_i64, 2_i64].contains(&value) {
41153 Err("invalid value".into())
41154 } else {
41155 Ok(Self(value))
41156 }
41157 }
41158 }
41159 impl<'de> ::serde::Deserialize<'de> for X402Version {
41160 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
41161 where
41162 D: ::serde::Deserializer<'de>,
41163 {
41164 Self::try_from(<i64>::deserialize(deserializer)?)
41165 .map_err(|e| <D::Error as ::serde::de::Error>::custom(e.to_string()))
41166 }
41167 }
41168 #[derive(
41189 ::serde::Deserialize,
41190 ::serde::Serialize,
41191 Clone,
41192 Copy,
41193 Debug,
41194 Eq,
41195 Hash,
41196 Ord,
41197 PartialEq,
41198 PartialOrd,
41199 )]
41200 pub enum X402v1PaymentPayloadNetwork {
41201 #[serde(rename = "base-sepolia")]
41202 BaseSepolia,
41203 #[serde(rename = "base")]
41204 Base,
41205 #[serde(rename = "solana-devnet")]
41206 SolanaDevnet,
41207 #[serde(rename = "solana")]
41208 Solana,
41209 }
41210 impl ::std::convert::From<&Self> for X402v1PaymentPayloadNetwork {
41211 fn from(value: &X402v1PaymentPayloadNetwork) -> Self {
41212 value.clone()
41213 }
41214 }
41215 impl ::std::fmt::Display for X402v1PaymentPayloadNetwork {
41216 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
41217 match *self {
41218 Self::BaseSepolia => f.write_str("base-sepolia"),
41219 Self::Base => f.write_str("base"),
41220 Self::SolanaDevnet => f.write_str("solana-devnet"),
41221 Self::Solana => f.write_str("solana"),
41222 }
41223 }
41224 }
41225 impl ::std::str::FromStr for X402v1PaymentPayloadNetwork {
41226 type Err = self::error::ConversionError;
41227 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41228 match value {
41229 "base-sepolia" => Ok(Self::BaseSepolia),
41230 "base" => Ok(Self::Base),
41231 "solana-devnet" => Ok(Self::SolanaDevnet),
41232 "solana" => Ok(Self::Solana),
41233 _ => Err("invalid value".into()),
41234 }
41235 }
41236 }
41237 impl ::std::convert::TryFrom<&str> for X402v1PaymentPayloadNetwork {
41238 type Error = self::error::ConversionError;
41239 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41240 value.parse()
41241 }
41242 }
41243 impl ::std::convert::TryFrom<&::std::string::String> for X402v1PaymentPayloadNetwork {
41244 type Error = self::error::ConversionError;
41245 fn try_from(
41246 value: &::std::string::String,
41247 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41248 value.parse()
41249 }
41250 }
41251 impl ::std::convert::TryFrom<::std::string::String> for X402v1PaymentPayloadNetwork {
41252 type Error = self::error::ConversionError;
41253 fn try_from(
41254 value: ::std::string::String,
41255 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41256 value.parse()
41257 }
41258 }
41259 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
41292 #[serde(untagged)]
41293 pub enum X402v1PaymentPayloadPayload {
41294 EvmPayload(X402ExactEvmPayload),
41295 SolanaPayload(X402ExactSolanaPayload),
41296 }
41297 impl ::std::convert::From<&Self> for X402v1PaymentPayloadPayload {
41298 fn from(value: &X402v1PaymentPayloadPayload) -> Self {
41299 value.clone()
41300 }
41301 }
41302 impl ::std::convert::From<X402ExactEvmPayload> for X402v1PaymentPayloadPayload {
41303 fn from(value: X402ExactEvmPayload) -> Self {
41304 Self::EvmPayload(value)
41305 }
41306 }
41307 impl ::std::convert::From<X402ExactSolanaPayload> for X402v1PaymentPayloadPayload {
41308 fn from(value: X402ExactSolanaPayload) -> Self {
41309 Self::SolanaPayload(value)
41310 }
41311 }
41312 #[derive(
41330 ::serde::Deserialize,
41331 ::serde::Serialize,
41332 Clone,
41333 Copy,
41334 Debug,
41335 Eq,
41336 Hash,
41337 Ord,
41338 PartialEq,
41339 PartialOrd,
41340 )]
41341 pub enum X402v1PaymentPayloadScheme {
41342 #[serde(rename = "exact")]
41343 Exact,
41344 }
41345 impl ::std::convert::From<&Self> for X402v1PaymentPayloadScheme {
41346 fn from(value: &X402v1PaymentPayloadScheme) -> Self {
41347 value.clone()
41348 }
41349 }
41350 impl ::std::fmt::Display for X402v1PaymentPayloadScheme {
41351 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
41352 match *self {
41353 Self::Exact => f.write_str("exact"),
41354 }
41355 }
41356 }
41357 impl ::std::str::FromStr for X402v1PaymentPayloadScheme {
41358 type Err = self::error::ConversionError;
41359 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41360 match value {
41361 "exact" => Ok(Self::Exact),
41362 _ => Err("invalid value".into()),
41363 }
41364 }
41365 }
41366 impl ::std::convert::TryFrom<&str> for X402v1PaymentPayloadScheme {
41367 type Error = self::error::ConversionError;
41368 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41369 value.parse()
41370 }
41371 }
41372 impl ::std::convert::TryFrom<&::std::string::String> for X402v1PaymentPayloadScheme {
41373 type Error = self::error::ConversionError;
41374 fn try_from(
41375 value: &::std::string::String,
41376 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41377 value.parse()
41378 }
41379 }
41380 impl ::std::convert::TryFrom<::std::string::String> for X402v1PaymentPayloadScheme {
41381 type Error = self::error::ConversionError;
41382 fn try_from(
41383 value: ::std::string::String,
41384 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41385 value.parse()
41386 }
41387 }
41388 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41408 #[serde(transparent)]
41409 pub struct X402v1PaymentRequirementsAsset(::std::string::String);
41410 impl ::std::ops::Deref for X402v1PaymentRequirementsAsset {
41411 type Target = ::std::string::String;
41412 fn deref(&self) -> &::std::string::String {
41413 &self.0
41414 }
41415 }
41416 impl ::std::convert::From<X402v1PaymentRequirementsAsset> for ::std::string::String {
41417 fn from(value: X402v1PaymentRequirementsAsset) -> Self {
41418 value.0
41419 }
41420 }
41421 impl ::std::convert::From<&X402v1PaymentRequirementsAsset> for X402v1PaymentRequirementsAsset {
41422 fn from(value: &X402v1PaymentRequirementsAsset) -> Self {
41423 value.clone()
41424 }
41425 }
41426 impl ::std::str::FromStr for X402v1PaymentRequirementsAsset {
41427 type Err = self::error::ConversionError;
41428 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41429 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
41430 ::std::sync::LazyLock::new(|| {
41431 ::regress::Regex::new("^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$")
41432 .unwrap()
41433 });
41434 if PATTERN.find(value).is_none() {
41435 return Err(
41436 "doesn't match pattern \"^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$\""
41437 .into(),
41438 );
41439 }
41440 Ok(Self(value.to_string()))
41441 }
41442 }
41443 impl ::std::convert::TryFrom<&str> for X402v1PaymentRequirementsAsset {
41444 type Error = self::error::ConversionError;
41445 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41446 value.parse()
41447 }
41448 }
41449 impl ::std::convert::TryFrom<&::std::string::String> for X402v1PaymentRequirementsAsset {
41450 type Error = self::error::ConversionError;
41451 fn try_from(
41452 value: &::std::string::String,
41453 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41454 value.parse()
41455 }
41456 }
41457 impl ::std::convert::TryFrom<::std::string::String> for X402v1PaymentRequirementsAsset {
41458 type Error = self::error::ConversionError;
41459 fn try_from(
41460 value: ::std::string::String,
41461 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41462 value.parse()
41463 }
41464 }
41465 impl<'de> ::serde::Deserialize<'de> for X402v1PaymentRequirementsAsset {
41466 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
41467 where
41468 D: ::serde::Deserializer<'de>,
41469 {
41470 ::std::string::String::deserialize(deserializer)?
41471 .parse()
41472 .map_err(|e: self::error::ConversionError| {
41473 <D::Error as ::serde::de::Error>::custom(e.to_string())
41474 })
41475 }
41476 }
41477 #[derive(
41498 ::serde::Deserialize,
41499 ::serde::Serialize,
41500 Clone,
41501 Copy,
41502 Debug,
41503 Eq,
41504 Hash,
41505 Ord,
41506 PartialEq,
41507 PartialOrd,
41508 )]
41509 pub enum X402v1PaymentRequirementsNetwork {
41510 #[serde(rename = "base-sepolia")]
41511 BaseSepolia,
41512 #[serde(rename = "base")]
41513 Base,
41514 #[serde(rename = "solana-devnet")]
41515 SolanaDevnet,
41516 #[serde(rename = "solana")]
41517 Solana,
41518 }
41519 impl ::std::convert::From<&Self> for X402v1PaymentRequirementsNetwork {
41520 fn from(value: &X402v1PaymentRequirementsNetwork) -> Self {
41521 value.clone()
41522 }
41523 }
41524 impl ::std::fmt::Display for X402v1PaymentRequirementsNetwork {
41525 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
41526 match *self {
41527 Self::BaseSepolia => f.write_str("base-sepolia"),
41528 Self::Base => f.write_str("base"),
41529 Self::SolanaDevnet => f.write_str("solana-devnet"),
41530 Self::Solana => f.write_str("solana"),
41531 }
41532 }
41533 }
41534 impl ::std::str::FromStr for X402v1PaymentRequirementsNetwork {
41535 type Err = self::error::ConversionError;
41536 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41537 match value {
41538 "base-sepolia" => Ok(Self::BaseSepolia),
41539 "base" => Ok(Self::Base),
41540 "solana-devnet" => Ok(Self::SolanaDevnet),
41541 "solana" => Ok(Self::Solana),
41542 _ => Err("invalid value".into()),
41543 }
41544 }
41545 }
41546 impl ::std::convert::TryFrom<&str> for X402v1PaymentRequirementsNetwork {
41547 type Error = self::error::ConversionError;
41548 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41549 value.parse()
41550 }
41551 }
41552 impl ::std::convert::TryFrom<&::std::string::String> for X402v1PaymentRequirementsNetwork {
41553 type Error = self::error::ConversionError;
41554 fn try_from(
41555 value: &::std::string::String,
41556 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41557 value.parse()
41558 }
41559 }
41560 impl ::std::convert::TryFrom<::std::string::String> for X402v1PaymentRequirementsNetwork {
41561 type Error = self::error::ConversionError;
41562 fn try_from(
41563 value: ::std::string::String,
41564 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41565 value.parse()
41566 }
41567 }
41568 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41588 #[serde(transparent)]
41589 pub struct X402v1PaymentRequirementsPayTo(::std::string::String);
41590 impl ::std::ops::Deref for X402v1PaymentRequirementsPayTo {
41591 type Target = ::std::string::String;
41592 fn deref(&self) -> &::std::string::String {
41593 &self.0
41594 }
41595 }
41596 impl ::std::convert::From<X402v1PaymentRequirementsPayTo> for ::std::string::String {
41597 fn from(value: X402v1PaymentRequirementsPayTo) -> Self {
41598 value.0
41599 }
41600 }
41601 impl ::std::convert::From<&X402v1PaymentRequirementsPayTo> for X402v1PaymentRequirementsPayTo {
41602 fn from(value: &X402v1PaymentRequirementsPayTo) -> Self {
41603 value.clone()
41604 }
41605 }
41606 impl ::std::str::FromStr for X402v1PaymentRequirementsPayTo {
41607 type Err = self::error::ConversionError;
41608 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41609 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
41610 ::std::sync::LazyLock::new(|| {
41611 ::regress::Regex::new("^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$")
41612 .unwrap()
41613 });
41614 if PATTERN.find(value).is_none() {
41615 return Err(
41616 "doesn't match pattern \"^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$\""
41617 .into(),
41618 );
41619 }
41620 Ok(Self(value.to_string()))
41621 }
41622 }
41623 impl ::std::convert::TryFrom<&str> for X402v1PaymentRequirementsPayTo {
41624 type Error = self::error::ConversionError;
41625 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41626 value.parse()
41627 }
41628 }
41629 impl ::std::convert::TryFrom<&::std::string::String> for X402v1PaymentRequirementsPayTo {
41630 type Error = self::error::ConversionError;
41631 fn try_from(
41632 value: &::std::string::String,
41633 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41634 value.parse()
41635 }
41636 }
41637 impl ::std::convert::TryFrom<::std::string::String> for X402v1PaymentRequirementsPayTo {
41638 type Error = self::error::ConversionError;
41639 fn try_from(
41640 value: ::std::string::String,
41641 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41642 value.parse()
41643 }
41644 }
41645 impl<'de> ::serde::Deserialize<'de> for X402v1PaymentRequirementsPayTo {
41646 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
41647 where
41648 D: ::serde::Deserializer<'de>,
41649 {
41650 ::std::string::String::deserialize(deserializer)?
41651 .parse()
41652 .map_err(|e: self::error::ConversionError| {
41653 <D::Error as ::serde::de::Error>::custom(e.to_string())
41654 })
41655 }
41656 }
41657 #[derive(
41675 ::serde::Deserialize,
41676 ::serde::Serialize,
41677 Clone,
41678 Copy,
41679 Debug,
41680 Eq,
41681 Hash,
41682 Ord,
41683 PartialEq,
41684 PartialOrd,
41685 )]
41686 pub enum X402v1PaymentRequirementsScheme {
41687 #[serde(rename = "exact")]
41688 Exact,
41689 }
41690 impl ::std::convert::From<&Self> for X402v1PaymentRequirementsScheme {
41691 fn from(value: &X402v1PaymentRequirementsScheme) -> Self {
41692 value.clone()
41693 }
41694 }
41695 impl ::std::fmt::Display for X402v1PaymentRequirementsScheme {
41696 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
41697 match *self {
41698 Self::Exact => f.write_str("exact"),
41699 }
41700 }
41701 }
41702 impl ::std::str::FromStr for X402v1PaymentRequirementsScheme {
41703 type Err = self::error::ConversionError;
41704 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41705 match value {
41706 "exact" => Ok(Self::Exact),
41707 _ => Err("invalid value".into()),
41708 }
41709 }
41710 }
41711 impl ::std::convert::TryFrom<&str> for X402v1PaymentRequirementsScheme {
41712 type Error = self::error::ConversionError;
41713 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41714 value.parse()
41715 }
41716 }
41717 impl ::std::convert::TryFrom<&::std::string::String> for X402v1PaymentRequirementsScheme {
41718 type Error = self::error::ConversionError;
41719 fn try_from(
41720 value: &::std::string::String,
41721 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41722 value.parse()
41723 }
41724 }
41725 impl ::std::convert::TryFrom<::std::string::String> for X402v1PaymentRequirementsScheme {
41726 type Error = self::error::ConversionError;
41727 fn try_from(
41728 value: ::std::string::String,
41729 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41730 value.parse()
41731 }
41732 }
41733 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
41766 #[serde(untagged)]
41767 pub enum X402v2PaymentPayloadPayload {
41768 EvmPayload(X402ExactEvmPayload),
41769 SolanaPayload(X402ExactSolanaPayload),
41770 }
41771 impl ::std::convert::From<&Self> for X402v2PaymentPayloadPayload {
41772 fn from(value: &X402v2PaymentPayloadPayload) -> Self {
41773 value.clone()
41774 }
41775 }
41776 impl ::std::convert::From<X402ExactEvmPayload> for X402v2PaymentPayloadPayload {
41777 fn from(value: X402ExactEvmPayload) -> Self {
41778 Self::EvmPayload(value)
41779 }
41780 }
41781 impl ::std::convert::From<X402ExactSolanaPayload> for X402v2PaymentPayloadPayload {
41782 fn from(value: X402ExactSolanaPayload) -> Self {
41783 Self::SolanaPayload(value)
41784 }
41785 }
41786 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41806 #[serde(transparent)]
41807 pub struct X402v2PaymentRequirementsAsset(::std::string::String);
41808 impl ::std::ops::Deref for X402v2PaymentRequirementsAsset {
41809 type Target = ::std::string::String;
41810 fn deref(&self) -> &::std::string::String {
41811 &self.0
41812 }
41813 }
41814 impl ::std::convert::From<X402v2PaymentRequirementsAsset> for ::std::string::String {
41815 fn from(value: X402v2PaymentRequirementsAsset) -> Self {
41816 value.0
41817 }
41818 }
41819 impl ::std::convert::From<&X402v2PaymentRequirementsAsset> for X402v2PaymentRequirementsAsset {
41820 fn from(value: &X402v2PaymentRequirementsAsset) -> Self {
41821 value.clone()
41822 }
41823 }
41824 impl ::std::str::FromStr for X402v2PaymentRequirementsAsset {
41825 type Err = self::error::ConversionError;
41826 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41827 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
41828 ::std::sync::LazyLock::new(|| {
41829 ::regress::Regex::new("^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$")
41830 .unwrap()
41831 });
41832 if PATTERN.find(value).is_none() {
41833 return Err(
41834 "doesn't match pattern \"^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$\""
41835 .into(),
41836 );
41837 }
41838 Ok(Self(value.to_string()))
41839 }
41840 }
41841 impl ::std::convert::TryFrom<&str> for X402v2PaymentRequirementsAsset {
41842 type Error = self::error::ConversionError;
41843 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41844 value.parse()
41845 }
41846 }
41847 impl ::std::convert::TryFrom<&::std::string::String> for X402v2PaymentRequirementsAsset {
41848 type Error = self::error::ConversionError;
41849 fn try_from(
41850 value: &::std::string::String,
41851 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41852 value.parse()
41853 }
41854 }
41855 impl ::std::convert::TryFrom<::std::string::String> for X402v2PaymentRequirementsAsset {
41856 type Error = self::error::ConversionError;
41857 fn try_from(
41858 value: ::std::string::String,
41859 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41860 value.parse()
41861 }
41862 }
41863 impl<'de> ::serde::Deserialize<'de> for X402v2PaymentRequirementsAsset {
41864 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
41865 where
41866 D: ::serde::Deserializer<'de>,
41867 {
41868 ::std::string::String::deserialize(deserializer)?
41869 .parse()
41870 .map_err(|e: self::error::ConversionError| {
41871 <D::Error as ::serde::de::Error>::custom(e.to_string())
41872 })
41873 }
41874 }
41875 #[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41895 #[serde(transparent)]
41896 pub struct X402v2PaymentRequirementsPayTo(::std::string::String);
41897 impl ::std::ops::Deref for X402v2PaymentRequirementsPayTo {
41898 type Target = ::std::string::String;
41899 fn deref(&self) -> &::std::string::String {
41900 &self.0
41901 }
41902 }
41903 impl ::std::convert::From<X402v2PaymentRequirementsPayTo> for ::std::string::String {
41904 fn from(value: X402v2PaymentRequirementsPayTo) -> Self {
41905 value.0
41906 }
41907 }
41908 impl ::std::convert::From<&X402v2PaymentRequirementsPayTo> for X402v2PaymentRequirementsPayTo {
41909 fn from(value: &X402v2PaymentRequirementsPayTo) -> Self {
41910 value.clone()
41911 }
41912 }
41913 impl ::std::str::FromStr for X402v2PaymentRequirementsPayTo {
41914 type Err = self::error::ConversionError;
41915 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41916 static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
41917 ::std::sync::LazyLock::new(|| {
41918 ::regress::Regex::new("^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$")
41919 .unwrap()
41920 });
41921 if PATTERN.find(value).is_none() {
41922 return Err(
41923 "doesn't match pattern \"^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$\""
41924 .into(),
41925 );
41926 }
41927 Ok(Self(value.to_string()))
41928 }
41929 }
41930 impl ::std::convert::TryFrom<&str> for X402v2PaymentRequirementsPayTo {
41931 type Error = self::error::ConversionError;
41932 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
41933 value.parse()
41934 }
41935 }
41936 impl ::std::convert::TryFrom<&::std::string::String> for X402v2PaymentRequirementsPayTo {
41937 type Error = self::error::ConversionError;
41938 fn try_from(
41939 value: &::std::string::String,
41940 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41941 value.parse()
41942 }
41943 }
41944 impl ::std::convert::TryFrom<::std::string::String> for X402v2PaymentRequirementsPayTo {
41945 type Error = self::error::ConversionError;
41946 fn try_from(
41947 value: ::std::string::String,
41948 ) -> ::std::result::Result<Self, self::error::ConversionError> {
41949 value.parse()
41950 }
41951 }
41952 impl<'de> ::serde::Deserialize<'de> for X402v2PaymentRequirementsPayTo {
41953 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
41954 where
41955 D: ::serde::Deserializer<'de>,
41956 {
41957 ::std::string::String::deserialize(deserializer)?
41958 .parse()
41959 .map_err(|e: self::error::ConversionError| {
41960 <D::Error as ::serde::de::Error>::custom(e.to_string())
41961 })
41962 }
41963 }
41964 #[derive(
41982 ::serde::Deserialize,
41983 ::serde::Serialize,
41984 Clone,
41985 Copy,
41986 Debug,
41987 Eq,
41988 Hash,
41989 Ord,
41990 PartialEq,
41991 PartialOrd,
41992 )]
41993 pub enum X402v2PaymentRequirementsScheme {
41994 #[serde(rename = "exact")]
41995 Exact,
41996 }
41997 impl ::std::convert::From<&Self> for X402v2PaymentRequirementsScheme {
41998 fn from(value: &X402v2PaymentRequirementsScheme) -> Self {
41999 value.clone()
42000 }
42001 }
42002 impl ::std::fmt::Display for X402v2PaymentRequirementsScheme {
42003 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
42004 match *self {
42005 Self::Exact => f.write_str("exact"),
42006 }
42007 }
42008 }
42009 impl ::std::str::FromStr for X402v2PaymentRequirementsScheme {
42010 type Err = self::error::ConversionError;
42011 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
42012 match value {
42013 "exact" => Ok(Self::Exact),
42014 _ => Err("invalid value".into()),
42015 }
42016 }
42017 }
42018 impl ::std::convert::TryFrom<&str> for X402v2PaymentRequirementsScheme {
42019 type Error = self::error::ConversionError;
42020 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
42021 value.parse()
42022 }
42023 }
42024 impl ::std::convert::TryFrom<&::std::string::String> for X402v2PaymentRequirementsScheme {
42025 type Error = self::error::ConversionError;
42026 fn try_from(
42027 value: &::std::string::String,
42028 ) -> ::std::result::Result<Self, self::error::ConversionError> {
42029 value.parse()
42030 }
42031 }
42032 impl ::std::convert::TryFrom<::std::string::String> for X402v2PaymentRequirementsScheme {
42033 type Error = self::error::ConversionError;
42034 fn try_from(
42035 value: ::std::string::String,
42036 ) -> ::std::result::Result<Self, self::error::ConversionError> {
42037 value.parse()
42038 }
42039 }
42040 pub mod builder {
42042 #[derive(Clone, Debug)]
42043 pub struct AbiFunction {
42044 constant: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
42045 gas: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
42046 inputs:
42047 ::std::result::Result<::std::vec::Vec<super::AbiParameter>, ::std::string::String>,
42048 name: ::std::result::Result<::std::string::String, ::std::string::String>,
42049 outputs:
42050 ::std::result::Result<::std::vec::Vec<super::AbiParameter>, ::std::string::String>,
42051 payable: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
42052 state_mutability:
42053 ::std::result::Result<super::AbiStateMutability, ::std::string::String>,
42054 type_: ::std::result::Result<super::AbiFunctionType, ::std::string::String>,
42055 }
42056 impl ::std::default::Default for AbiFunction {
42057 fn default() -> Self {
42058 Self {
42059 constant: Ok(Default::default()),
42060 gas: Ok(Default::default()),
42061 inputs: Err("no value supplied for inputs".to_string()),
42062 name: Err("no value supplied for name".to_string()),
42063 outputs: Err("no value supplied for outputs".to_string()),
42064 payable: Ok(Default::default()),
42065 state_mutability: Err("no value supplied for state_mutability".to_string()),
42066 type_: Err("no value supplied for type_".to_string()),
42067 }
42068 }
42069 }
42070 impl AbiFunction {
42071 pub fn constant<T>(mut self, value: T) -> Self
42072 where
42073 T: ::std::convert::TryInto<::std::option::Option<bool>>,
42074 T::Error: ::std::fmt::Display,
42075 {
42076 self.constant = value
42077 .try_into()
42078 .map_err(|e| format!("error converting supplied value for constant: {}", e));
42079 self
42080 }
42081 pub fn gas<T>(mut self, value: T) -> Self
42082 where
42083 T: ::std::convert::TryInto<::std::option::Option<i64>>,
42084 T::Error: ::std::fmt::Display,
42085 {
42086 self.gas = value
42087 .try_into()
42088 .map_err(|e| format!("error converting supplied value for gas: {}", e));
42089 self
42090 }
42091 pub fn inputs<T>(mut self, value: T) -> Self
42092 where
42093 T: ::std::convert::TryInto<::std::vec::Vec<super::AbiParameter>>,
42094 T::Error: ::std::fmt::Display,
42095 {
42096 self.inputs = value
42097 .try_into()
42098 .map_err(|e| format!("error converting supplied value for inputs: {}", e));
42099 self
42100 }
42101 pub fn name<T>(mut self, value: T) -> Self
42102 where
42103 T: ::std::convert::TryInto<::std::string::String>,
42104 T::Error: ::std::fmt::Display,
42105 {
42106 self.name = value
42107 .try_into()
42108 .map_err(|e| format!("error converting supplied value for name: {}", e));
42109 self
42110 }
42111 pub fn outputs<T>(mut self, value: T) -> Self
42112 where
42113 T: ::std::convert::TryInto<::std::vec::Vec<super::AbiParameter>>,
42114 T::Error: ::std::fmt::Display,
42115 {
42116 self.outputs = value
42117 .try_into()
42118 .map_err(|e| format!("error converting supplied value for outputs: {}", e));
42119 self
42120 }
42121 pub fn payable<T>(mut self, value: T) -> Self
42122 where
42123 T: ::std::convert::TryInto<::std::option::Option<bool>>,
42124 T::Error: ::std::fmt::Display,
42125 {
42126 self.payable = value
42127 .try_into()
42128 .map_err(|e| format!("error converting supplied value for payable: {}", e));
42129 self
42130 }
42131 pub fn state_mutability<T>(mut self, value: T) -> Self
42132 where
42133 T: ::std::convert::TryInto<super::AbiStateMutability>,
42134 T::Error: ::std::fmt::Display,
42135 {
42136 self.state_mutability = value.try_into().map_err(|e| {
42137 format!(
42138 "error converting supplied value for state_mutability: {}",
42139 e
42140 )
42141 });
42142 self
42143 }
42144 pub fn type_<T>(mut self, value: T) -> Self
42145 where
42146 T: ::std::convert::TryInto<super::AbiFunctionType>,
42147 T::Error: ::std::fmt::Display,
42148 {
42149 self.type_ = value
42150 .try_into()
42151 .map_err(|e| format!("error converting supplied value for type_: {}", e));
42152 self
42153 }
42154 }
42155 impl ::std::convert::TryFrom<AbiFunction> for super::AbiFunction {
42156 type Error = super::error::ConversionError;
42157 fn try_from(
42158 value: AbiFunction,
42159 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42160 Ok(Self {
42161 constant: value.constant?,
42162 gas: value.gas?,
42163 inputs: value.inputs?,
42164 name: value.name?,
42165 outputs: value.outputs?,
42166 payable: value.payable?,
42167 state_mutability: value.state_mutability?,
42168 type_: value.type_?,
42169 })
42170 }
42171 }
42172 impl ::std::convert::From<super::AbiFunction> for AbiFunction {
42173 fn from(value: super::AbiFunction) -> Self {
42174 Self {
42175 constant: Ok(value.constant),
42176 gas: Ok(value.gas),
42177 inputs: Ok(value.inputs),
42178 name: Ok(value.name),
42179 outputs: Ok(value.outputs),
42180 payable: Ok(value.payable),
42181 state_mutability: Ok(value.state_mutability),
42182 type_: Ok(value.type_),
42183 }
42184 }
42185 }
42186 #[derive(Clone, Debug)]
42187 pub struct AbiInput {
42188 additional_properties: ::std::result::Result<
42189 ::std::option::Option<::serde_json::Value>,
42190 ::std::string::String,
42191 >,
42192 type_: ::std::result::Result<super::AbiInputType, ::std::string::String>,
42193 }
42194 impl ::std::default::Default for AbiInput {
42195 fn default() -> Self {
42196 Self {
42197 additional_properties: Ok(Default::default()),
42198 type_: Err("no value supplied for type_".to_string()),
42199 }
42200 }
42201 }
42202 impl AbiInput {
42203 pub fn additional_properties<T>(mut self, value: T) -> Self
42204 where
42205 T: ::std::convert::TryInto<::std::option::Option<::serde_json::Value>>,
42206 T::Error: ::std::fmt::Display,
42207 {
42208 self.additional_properties = value.try_into().map_err(|e| {
42209 format!(
42210 "error converting supplied value for additional_properties: {}",
42211 e
42212 )
42213 });
42214 self
42215 }
42216 pub fn type_<T>(mut self, value: T) -> Self
42217 where
42218 T: ::std::convert::TryInto<super::AbiInputType>,
42219 T::Error: ::std::fmt::Display,
42220 {
42221 self.type_ = value
42222 .try_into()
42223 .map_err(|e| format!("error converting supplied value for type_: {}", e));
42224 self
42225 }
42226 }
42227 impl ::std::convert::TryFrom<AbiInput> for super::AbiInput {
42228 type Error = super::error::ConversionError;
42229 fn try_from(
42230 value: AbiInput,
42231 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42232 Ok(Self {
42233 additional_properties: value.additional_properties?,
42234 type_: value.type_?,
42235 })
42236 }
42237 }
42238 impl ::std::convert::From<super::AbiInput> for AbiInput {
42239 fn from(value: super::AbiInput) -> Self {
42240 Self {
42241 additional_properties: Ok(value.additional_properties),
42242 type_: Ok(value.type_),
42243 }
42244 }
42245 }
42246 #[derive(Clone, Debug)]
42247 pub struct AbiParameter {
42248 components:
42249 ::std::result::Result<::std::vec::Vec<super::AbiParameter>, ::std::string::String>,
42250 internal_type: ::std::result::Result<
42251 ::std::option::Option<::std::string::String>,
42252 ::std::string::String,
42253 >,
42254 name: ::std::result::Result<
42255 ::std::option::Option<::std::string::String>,
42256 ::std::string::String,
42257 >,
42258 type_: ::std::result::Result<::std::string::String, ::std::string::String>,
42259 }
42260 impl ::std::default::Default for AbiParameter {
42261 fn default() -> Self {
42262 Self {
42263 components: Ok(Default::default()),
42264 internal_type: Ok(Default::default()),
42265 name: Ok(Default::default()),
42266 type_: Err("no value supplied for type_".to_string()),
42267 }
42268 }
42269 }
42270 impl AbiParameter {
42271 pub fn components<T>(mut self, value: T) -> Self
42272 where
42273 T: ::std::convert::TryInto<::std::vec::Vec<super::AbiParameter>>,
42274 T::Error: ::std::fmt::Display,
42275 {
42276 self.components = value
42277 .try_into()
42278 .map_err(|e| format!("error converting supplied value for components: {}", e));
42279 self
42280 }
42281 pub fn internal_type<T>(mut self, value: T) -> Self
42282 where
42283 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
42284 T::Error: ::std::fmt::Display,
42285 {
42286 self.internal_type = value.try_into().map_err(|e| {
42287 format!("error converting supplied value for internal_type: {}", e)
42288 });
42289 self
42290 }
42291 pub fn name<T>(mut self, value: T) -> Self
42292 where
42293 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
42294 T::Error: ::std::fmt::Display,
42295 {
42296 self.name = value
42297 .try_into()
42298 .map_err(|e| format!("error converting supplied value for name: {}", e));
42299 self
42300 }
42301 pub fn type_<T>(mut self, value: T) -> Self
42302 where
42303 T: ::std::convert::TryInto<::std::string::String>,
42304 T::Error: ::std::fmt::Display,
42305 {
42306 self.type_ = value
42307 .try_into()
42308 .map_err(|e| format!("error converting supplied value for type_: {}", e));
42309 self
42310 }
42311 }
42312 impl ::std::convert::TryFrom<AbiParameter> for super::AbiParameter {
42313 type Error = super::error::ConversionError;
42314 fn try_from(
42315 value: AbiParameter,
42316 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42317 Ok(Self {
42318 components: value.components?,
42319 internal_type: value.internal_type?,
42320 name: value.name?,
42321 type_: value.type_?,
42322 })
42323 }
42324 }
42325 impl ::std::convert::From<super::AbiParameter> for AbiParameter {
42326 fn from(value: super::AbiParameter) -> Self {
42327 Self {
42328 components: Ok(value.components),
42329 internal_type: Ok(value.internal_type),
42330 name: Ok(value.name),
42331 type_: Ok(value.type_),
42332 }
42333 }
42334 }
42335 #[derive(Clone, Debug)]
42336 pub struct AccountTokenAddressesResponse {
42337 account_address: ::std::result::Result<
42338 ::std::option::Option<::std::string::String>,
42339 ::std::string::String,
42340 >,
42341 token_addresses: ::std::result::Result<
42342 ::std::vec::Vec<super::AccountTokenAddressesResponseTokenAddressesItem>,
42343 ::std::string::String,
42344 >,
42345 total_count: ::std::result::Result<::std::option::Option<u64>, ::std::string::String>,
42346 }
42347 impl ::std::default::Default for AccountTokenAddressesResponse {
42348 fn default() -> Self {
42349 Self {
42350 account_address: Ok(Default::default()),
42351 token_addresses: Ok(Default::default()),
42352 total_count: Ok(Default::default()),
42353 }
42354 }
42355 }
42356 impl AccountTokenAddressesResponse {
42357 pub fn account_address<T>(mut self, value: T) -> Self
42358 where
42359 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
42360 T::Error: ::std::fmt::Display,
42361 {
42362 self.account_address = value.try_into().map_err(|e| {
42363 format!("error converting supplied value for account_address: {}", e)
42364 });
42365 self
42366 }
42367 pub fn token_addresses<T>(mut self, value: T) -> Self
42368 where
42369 T: ::std::convert::TryInto<
42370 ::std::vec::Vec<super::AccountTokenAddressesResponseTokenAddressesItem>,
42371 >,
42372 T::Error: ::std::fmt::Display,
42373 {
42374 self.token_addresses = value.try_into().map_err(|e| {
42375 format!("error converting supplied value for token_addresses: {}", e)
42376 });
42377 self
42378 }
42379 pub fn total_count<T>(mut self, value: T) -> Self
42380 where
42381 T: ::std::convert::TryInto<::std::option::Option<u64>>,
42382 T::Error: ::std::fmt::Display,
42383 {
42384 self.total_count = value
42385 .try_into()
42386 .map_err(|e| format!("error converting supplied value for total_count: {}", e));
42387 self
42388 }
42389 }
42390 impl ::std::convert::TryFrom<AccountTokenAddressesResponse>
42391 for super::AccountTokenAddressesResponse
42392 {
42393 type Error = super::error::ConversionError;
42394 fn try_from(
42395 value: AccountTokenAddressesResponse,
42396 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42397 Ok(Self {
42398 account_address: value.account_address?,
42399 token_addresses: value.token_addresses?,
42400 total_count: value.total_count?,
42401 })
42402 }
42403 }
42404 impl ::std::convert::From<super::AccountTokenAddressesResponse> for AccountTokenAddressesResponse {
42405 fn from(value: super::AccountTokenAddressesResponse) -> Self {
42406 Self {
42407 account_address: Ok(value.account_address),
42408 token_addresses: Ok(value.token_addresses),
42409 total_count: Ok(value.total_count),
42410 }
42411 }
42412 }
42413 #[derive(Clone, Debug)]
42414 pub struct CommonSwapResponse {
42415 block_number:
42416 ::std::result::Result<super::CommonSwapResponseBlockNumber, ::std::string::String>,
42417 fees: ::std::result::Result<super::CommonSwapResponseFees, ::std::string::String>,
42418 from_amount:
42419 ::std::result::Result<super::CommonSwapResponseFromAmount, ::std::string::String>,
42420 from_token:
42421 ::std::result::Result<super::CommonSwapResponseFromToken, ::std::string::String>,
42422 issues: ::std::result::Result<super::CommonSwapResponseIssues, ::std::string::String>,
42423 liquidity_available: ::std::result::Result<bool, ::std::string::String>,
42424 min_to_amount:
42425 ::std::result::Result<super::CommonSwapResponseMinToAmount, ::std::string::String>,
42426 to_amount:
42427 ::std::result::Result<super::CommonSwapResponseToAmount, ::std::string::String>,
42428 to_token:
42429 ::std::result::Result<super::CommonSwapResponseToToken, ::std::string::String>,
42430 }
42431 impl ::std::default::Default for CommonSwapResponse {
42432 fn default() -> Self {
42433 Self {
42434 block_number: Err("no value supplied for block_number".to_string()),
42435 fees: Err("no value supplied for fees".to_string()),
42436 from_amount: Err("no value supplied for from_amount".to_string()),
42437 from_token: Err("no value supplied for from_token".to_string()),
42438 issues: Err("no value supplied for issues".to_string()),
42439 liquidity_available: Err(
42440 "no value supplied for liquidity_available".to_string()
42441 ),
42442 min_to_amount: Err("no value supplied for min_to_amount".to_string()),
42443 to_amount: Err("no value supplied for to_amount".to_string()),
42444 to_token: Err("no value supplied for to_token".to_string()),
42445 }
42446 }
42447 }
42448 impl CommonSwapResponse {
42449 pub fn block_number<T>(mut self, value: T) -> Self
42450 where
42451 T: ::std::convert::TryInto<super::CommonSwapResponseBlockNumber>,
42452 T::Error: ::std::fmt::Display,
42453 {
42454 self.block_number = value.try_into().map_err(|e| {
42455 format!("error converting supplied value for block_number: {}", e)
42456 });
42457 self
42458 }
42459 pub fn fees<T>(mut self, value: T) -> Self
42460 where
42461 T: ::std::convert::TryInto<super::CommonSwapResponseFees>,
42462 T::Error: ::std::fmt::Display,
42463 {
42464 self.fees = value
42465 .try_into()
42466 .map_err(|e| format!("error converting supplied value for fees: {}", e));
42467 self
42468 }
42469 pub fn from_amount<T>(mut self, value: T) -> Self
42470 where
42471 T: ::std::convert::TryInto<super::CommonSwapResponseFromAmount>,
42472 T::Error: ::std::fmt::Display,
42473 {
42474 self.from_amount = value
42475 .try_into()
42476 .map_err(|e| format!("error converting supplied value for from_amount: {}", e));
42477 self
42478 }
42479 pub fn from_token<T>(mut self, value: T) -> Self
42480 where
42481 T: ::std::convert::TryInto<super::CommonSwapResponseFromToken>,
42482 T::Error: ::std::fmt::Display,
42483 {
42484 self.from_token = value
42485 .try_into()
42486 .map_err(|e| format!("error converting supplied value for from_token: {}", e));
42487 self
42488 }
42489 pub fn issues<T>(mut self, value: T) -> Self
42490 where
42491 T: ::std::convert::TryInto<super::CommonSwapResponseIssues>,
42492 T::Error: ::std::fmt::Display,
42493 {
42494 self.issues = value
42495 .try_into()
42496 .map_err(|e| format!("error converting supplied value for issues: {}", e));
42497 self
42498 }
42499 pub fn liquidity_available<T>(mut self, value: T) -> Self
42500 where
42501 T: ::std::convert::TryInto<bool>,
42502 T::Error: ::std::fmt::Display,
42503 {
42504 self.liquidity_available = value.try_into().map_err(|e| {
42505 format!(
42506 "error converting supplied value for liquidity_available: {}",
42507 e
42508 )
42509 });
42510 self
42511 }
42512 pub fn min_to_amount<T>(mut self, value: T) -> Self
42513 where
42514 T: ::std::convert::TryInto<super::CommonSwapResponseMinToAmount>,
42515 T::Error: ::std::fmt::Display,
42516 {
42517 self.min_to_amount = value.try_into().map_err(|e| {
42518 format!("error converting supplied value for min_to_amount: {}", e)
42519 });
42520 self
42521 }
42522 pub fn to_amount<T>(mut self, value: T) -> Self
42523 where
42524 T: ::std::convert::TryInto<super::CommonSwapResponseToAmount>,
42525 T::Error: ::std::fmt::Display,
42526 {
42527 self.to_amount = value
42528 .try_into()
42529 .map_err(|e| format!("error converting supplied value for to_amount: {}", e));
42530 self
42531 }
42532 pub fn to_token<T>(mut self, value: T) -> Self
42533 where
42534 T: ::std::convert::TryInto<super::CommonSwapResponseToToken>,
42535 T::Error: ::std::fmt::Display,
42536 {
42537 self.to_token = value
42538 .try_into()
42539 .map_err(|e| format!("error converting supplied value for to_token: {}", e));
42540 self
42541 }
42542 }
42543 impl ::std::convert::TryFrom<CommonSwapResponse> for super::CommonSwapResponse {
42544 type Error = super::error::ConversionError;
42545 fn try_from(
42546 value: CommonSwapResponse,
42547 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42548 Ok(Self {
42549 block_number: value.block_number?,
42550 fees: value.fees?,
42551 from_amount: value.from_amount?,
42552 from_token: value.from_token?,
42553 issues: value.issues?,
42554 liquidity_available: value.liquidity_available?,
42555 min_to_amount: value.min_to_amount?,
42556 to_amount: value.to_amount?,
42557 to_token: value.to_token?,
42558 })
42559 }
42560 }
42561 impl ::std::convert::From<super::CommonSwapResponse> for CommonSwapResponse {
42562 fn from(value: super::CommonSwapResponse) -> Self {
42563 Self {
42564 block_number: Ok(value.block_number),
42565 fees: Ok(value.fees),
42566 from_amount: Ok(value.from_amount),
42567 from_token: Ok(value.from_token),
42568 issues: Ok(value.issues),
42569 liquidity_available: Ok(value.liquidity_available),
42570 min_to_amount: Ok(value.min_to_amount),
42571 to_amount: Ok(value.to_amount),
42572 to_token: Ok(value.to_token),
42573 }
42574 }
42575 }
42576 #[derive(Clone, Debug)]
42577 pub struct CommonSwapResponseFees {
42578 gas_fee: ::std::result::Result<
42579 ::std::option::Option<super::TokenFee>,
42580 ::std::string::String,
42581 >,
42582 protocol_fee: ::std::result::Result<
42583 ::std::option::Option<super::TokenFee>,
42584 ::std::string::String,
42585 >,
42586 }
42587 impl ::std::default::Default for CommonSwapResponseFees {
42588 fn default() -> Self {
42589 Self {
42590 gas_fee: Err("no value supplied for gas_fee".to_string()),
42591 protocol_fee: Err("no value supplied for protocol_fee".to_string()),
42592 }
42593 }
42594 }
42595 impl CommonSwapResponseFees {
42596 pub fn gas_fee<T>(mut self, value: T) -> Self
42597 where
42598 T: ::std::convert::TryInto<::std::option::Option<super::TokenFee>>,
42599 T::Error: ::std::fmt::Display,
42600 {
42601 self.gas_fee = value
42602 .try_into()
42603 .map_err(|e| format!("error converting supplied value for gas_fee: {}", e));
42604 self
42605 }
42606 pub fn protocol_fee<T>(mut self, value: T) -> Self
42607 where
42608 T: ::std::convert::TryInto<::std::option::Option<super::TokenFee>>,
42609 T::Error: ::std::fmt::Display,
42610 {
42611 self.protocol_fee = value.try_into().map_err(|e| {
42612 format!("error converting supplied value for protocol_fee: {}", e)
42613 });
42614 self
42615 }
42616 }
42617 impl ::std::convert::TryFrom<CommonSwapResponseFees> for super::CommonSwapResponseFees {
42618 type Error = super::error::ConversionError;
42619 fn try_from(
42620 value: CommonSwapResponseFees,
42621 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42622 Ok(Self {
42623 gas_fee: value.gas_fee?,
42624 protocol_fee: value.protocol_fee?,
42625 })
42626 }
42627 }
42628 impl ::std::convert::From<super::CommonSwapResponseFees> for CommonSwapResponseFees {
42629 fn from(value: super::CommonSwapResponseFees) -> Self {
42630 Self {
42631 gas_fee: Ok(value.gas_fee),
42632 protocol_fee: Ok(value.protocol_fee),
42633 }
42634 }
42635 }
42636 #[derive(Clone, Debug)]
42637 pub struct CommonSwapResponseIssues {
42638 allowance: ::std::result::Result<
42639 ::std::option::Option<super::CommonSwapResponseIssuesAllowance>,
42640 ::std::string::String,
42641 >,
42642 balance: ::std::result::Result<
42643 ::std::option::Option<super::CommonSwapResponseIssuesBalance>,
42644 ::std::string::String,
42645 >,
42646 simulation_incomplete: ::std::result::Result<bool, ::std::string::String>,
42647 }
42648 impl ::std::default::Default for CommonSwapResponseIssues {
42649 fn default() -> Self {
42650 Self {
42651 allowance: Err("no value supplied for allowance".to_string()),
42652 balance: Err("no value supplied for balance".to_string()),
42653 simulation_incomplete: Err(
42654 "no value supplied for simulation_incomplete".to_string()
42655 ),
42656 }
42657 }
42658 }
42659 impl CommonSwapResponseIssues {
42660 pub fn allowance<T>(mut self, value: T) -> Self
42661 where
42662 T: ::std::convert::TryInto<
42663 ::std::option::Option<super::CommonSwapResponseIssuesAllowance>,
42664 >,
42665 T::Error: ::std::fmt::Display,
42666 {
42667 self.allowance = value
42668 .try_into()
42669 .map_err(|e| format!("error converting supplied value for allowance: {}", e));
42670 self
42671 }
42672 pub fn balance<T>(mut self, value: T) -> Self
42673 where
42674 T: ::std::convert::TryInto<
42675 ::std::option::Option<super::CommonSwapResponseIssuesBalance>,
42676 >,
42677 T::Error: ::std::fmt::Display,
42678 {
42679 self.balance = value
42680 .try_into()
42681 .map_err(|e| format!("error converting supplied value for balance: {}", e));
42682 self
42683 }
42684 pub fn simulation_incomplete<T>(mut self, value: T) -> Self
42685 where
42686 T: ::std::convert::TryInto<bool>,
42687 T::Error: ::std::fmt::Display,
42688 {
42689 self.simulation_incomplete = value.try_into().map_err(|e| {
42690 format!(
42691 "error converting supplied value for simulation_incomplete: {}",
42692 e
42693 )
42694 });
42695 self
42696 }
42697 }
42698 impl ::std::convert::TryFrom<CommonSwapResponseIssues> for super::CommonSwapResponseIssues {
42699 type Error = super::error::ConversionError;
42700 fn try_from(
42701 value: CommonSwapResponseIssues,
42702 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42703 Ok(Self {
42704 allowance: value.allowance?,
42705 balance: value.balance?,
42706 simulation_incomplete: value.simulation_incomplete?,
42707 })
42708 }
42709 }
42710 impl ::std::convert::From<super::CommonSwapResponseIssues> for CommonSwapResponseIssues {
42711 fn from(value: super::CommonSwapResponseIssues) -> Self {
42712 Self {
42713 allowance: Ok(value.allowance),
42714 balance: Ok(value.balance),
42715 simulation_incomplete: Ok(value.simulation_incomplete),
42716 }
42717 }
42718 }
42719 #[derive(Clone, Debug)]
42720 pub struct CommonSwapResponseIssuesAllowance {
42721 current_allowance: ::std::result::Result<
42722 super::CommonSwapResponseIssuesAllowanceCurrentAllowance,
42723 ::std::string::String,
42724 >,
42725 spender: ::std::result::Result<
42726 super::CommonSwapResponseIssuesAllowanceSpender,
42727 ::std::string::String,
42728 >,
42729 }
42730 impl ::std::default::Default for CommonSwapResponseIssuesAllowance {
42731 fn default() -> Self {
42732 Self {
42733 current_allowance: Err("no value supplied for current_allowance".to_string()),
42734 spender: Err("no value supplied for spender".to_string()),
42735 }
42736 }
42737 }
42738 impl CommonSwapResponseIssuesAllowance {
42739 pub fn current_allowance<T>(mut self, value: T) -> Self
42740 where
42741 T: ::std::convert::TryInto<
42742 super::CommonSwapResponseIssuesAllowanceCurrentAllowance,
42743 >,
42744 T::Error: ::std::fmt::Display,
42745 {
42746 self.current_allowance = value.try_into().map_err(|e| {
42747 format!(
42748 "error converting supplied value for current_allowance: {}",
42749 e
42750 )
42751 });
42752 self
42753 }
42754 pub fn spender<T>(mut self, value: T) -> Self
42755 where
42756 T: ::std::convert::TryInto<super::CommonSwapResponseIssuesAllowanceSpender>,
42757 T::Error: ::std::fmt::Display,
42758 {
42759 self.spender = value
42760 .try_into()
42761 .map_err(|e| format!("error converting supplied value for spender: {}", e));
42762 self
42763 }
42764 }
42765 impl ::std::convert::TryFrom<CommonSwapResponseIssuesAllowance>
42766 for super::CommonSwapResponseIssuesAllowance
42767 {
42768 type Error = super::error::ConversionError;
42769 fn try_from(
42770 value: CommonSwapResponseIssuesAllowance,
42771 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42772 Ok(Self {
42773 current_allowance: value.current_allowance?,
42774 spender: value.spender?,
42775 })
42776 }
42777 }
42778 impl ::std::convert::From<super::CommonSwapResponseIssuesAllowance>
42779 for CommonSwapResponseIssuesAllowance
42780 {
42781 fn from(value: super::CommonSwapResponseIssuesAllowance) -> Self {
42782 Self {
42783 current_allowance: Ok(value.current_allowance),
42784 spender: Ok(value.spender),
42785 }
42786 }
42787 }
42788 #[derive(Clone, Debug)]
42789 pub struct CommonSwapResponseIssuesBalance {
42790 current_balance: ::std::result::Result<
42791 super::CommonSwapResponseIssuesBalanceCurrentBalance,
42792 ::std::string::String,
42793 >,
42794 required_balance: ::std::result::Result<
42795 super::CommonSwapResponseIssuesBalanceRequiredBalance,
42796 ::std::string::String,
42797 >,
42798 token: ::std::result::Result<
42799 super::CommonSwapResponseIssuesBalanceToken,
42800 ::std::string::String,
42801 >,
42802 }
42803 impl ::std::default::Default for CommonSwapResponseIssuesBalance {
42804 fn default() -> Self {
42805 Self {
42806 current_balance: Err("no value supplied for current_balance".to_string()),
42807 required_balance: Err("no value supplied for required_balance".to_string()),
42808 token: Err("no value supplied for token".to_string()),
42809 }
42810 }
42811 }
42812 impl CommonSwapResponseIssuesBalance {
42813 pub fn current_balance<T>(mut self, value: T) -> Self
42814 where
42815 T: ::std::convert::TryInto<super::CommonSwapResponseIssuesBalanceCurrentBalance>,
42816 T::Error: ::std::fmt::Display,
42817 {
42818 self.current_balance = value.try_into().map_err(|e| {
42819 format!("error converting supplied value for current_balance: {}", e)
42820 });
42821 self
42822 }
42823 pub fn required_balance<T>(mut self, value: T) -> Self
42824 where
42825 T: ::std::convert::TryInto<super::CommonSwapResponseIssuesBalanceRequiredBalance>,
42826 T::Error: ::std::fmt::Display,
42827 {
42828 self.required_balance = value.try_into().map_err(|e| {
42829 format!(
42830 "error converting supplied value for required_balance: {}",
42831 e
42832 )
42833 });
42834 self
42835 }
42836 pub fn token<T>(mut self, value: T) -> Self
42837 where
42838 T: ::std::convert::TryInto<super::CommonSwapResponseIssuesBalanceToken>,
42839 T::Error: ::std::fmt::Display,
42840 {
42841 self.token = value
42842 .try_into()
42843 .map_err(|e| format!("error converting supplied value for token: {}", e));
42844 self
42845 }
42846 }
42847 impl ::std::convert::TryFrom<CommonSwapResponseIssuesBalance>
42848 for super::CommonSwapResponseIssuesBalance
42849 {
42850 type Error = super::error::ConversionError;
42851 fn try_from(
42852 value: CommonSwapResponseIssuesBalance,
42853 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42854 Ok(Self {
42855 current_balance: value.current_balance?,
42856 required_balance: value.required_balance?,
42857 token: value.token?,
42858 })
42859 }
42860 }
42861 impl ::std::convert::From<super::CommonSwapResponseIssuesBalance>
42862 for CommonSwapResponseIssuesBalance
42863 {
42864 fn from(value: super::CommonSwapResponseIssuesBalance) -> Self {
42865 Self {
42866 current_balance: Ok(value.current_balance),
42867 required_balance: Ok(value.required_balance),
42868 token: Ok(value.token),
42869 }
42870 }
42871 }
42872 #[derive(Clone, Debug)]
42873 pub struct CreateEndUserBody {
42874 authentication_methods:
42875 ::std::result::Result<super::AuthenticationMethods, ::std::string::String>,
42876 evm_account: ::std::result::Result<
42877 ::std::option::Option<super::CreateEndUserBodyEvmAccount>,
42878 ::std::string::String,
42879 >,
42880 solana_account: ::std::result::Result<
42881 ::std::option::Option<super::CreateEndUserBodySolanaAccount>,
42882 ::std::string::String,
42883 >,
42884 user_id: ::std::result::Result<
42885 ::std::option::Option<super::CreateEndUserBodyUserId>,
42886 ::std::string::String,
42887 >,
42888 }
42889 impl ::std::default::Default for CreateEndUserBody {
42890 fn default() -> Self {
42891 Self {
42892 authentication_methods: Err(
42893 "no value supplied for authentication_methods".to_string()
42894 ),
42895 evm_account: Ok(Default::default()),
42896 solana_account: Ok(Default::default()),
42897 user_id: Ok(Default::default()),
42898 }
42899 }
42900 }
42901 impl CreateEndUserBody {
42902 pub fn authentication_methods<T>(mut self, value: T) -> Self
42903 where
42904 T: ::std::convert::TryInto<super::AuthenticationMethods>,
42905 T::Error: ::std::fmt::Display,
42906 {
42907 self.authentication_methods = value.try_into().map_err(|e| {
42908 format!(
42909 "error converting supplied value for authentication_methods: {}",
42910 e
42911 )
42912 });
42913 self
42914 }
42915 pub fn evm_account<T>(mut self, value: T) -> Self
42916 where
42917 T: ::std::convert::TryInto<
42918 ::std::option::Option<super::CreateEndUserBodyEvmAccount>,
42919 >,
42920 T::Error: ::std::fmt::Display,
42921 {
42922 self.evm_account = value
42923 .try_into()
42924 .map_err(|e| format!("error converting supplied value for evm_account: {}", e));
42925 self
42926 }
42927 pub fn solana_account<T>(mut self, value: T) -> Self
42928 where
42929 T: ::std::convert::TryInto<
42930 ::std::option::Option<super::CreateEndUserBodySolanaAccount>,
42931 >,
42932 T::Error: ::std::fmt::Display,
42933 {
42934 self.solana_account = value.try_into().map_err(|e| {
42935 format!("error converting supplied value for solana_account: {}", e)
42936 });
42937 self
42938 }
42939 pub fn user_id<T>(mut self, value: T) -> Self
42940 where
42941 T: ::std::convert::TryInto<::std::option::Option<super::CreateEndUserBodyUserId>>,
42942 T::Error: ::std::fmt::Display,
42943 {
42944 self.user_id = value
42945 .try_into()
42946 .map_err(|e| format!("error converting supplied value for user_id: {}", e));
42947 self
42948 }
42949 }
42950 impl ::std::convert::TryFrom<CreateEndUserBody> for super::CreateEndUserBody {
42951 type Error = super::error::ConversionError;
42952 fn try_from(
42953 value: CreateEndUserBody,
42954 ) -> ::std::result::Result<Self, super::error::ConversionError> {
42955 Ok(Self {
42956 authentication_methods: value.authentication_methods?,
42957 evm_account: value.evm_account?,
42958 solana_account: value.solana_account?,
42959 user_id: value.user_id?,
42960 })
42961 }
42962 }
42963 impl ::std::convert::From<super::CreateEndUserBody> for CreateEndUserBody {
42964 fn from(value: super::CreateEndUserBody) -> Self {
42965 Self {
42966 authentication_methods: Ok(value.authentication_methods),
42967 evm_account: Ok(value.evm_account),
42968 solana_account: Ok(value.solana_account),
42969 user_id: Ok(value.user_id),
42970 }
42971 }
42972 }
42973 #[derive(Clone, Debug)]
42974 pub struct CreateEndUserBodyEvmAccount {
42975 create_smart_account: ::std::result::Result<bool, ::std::string::String>,
42976 }
42977 impl ::std::default::Default for CreateEndUserBodyEvmAccount {
42978 fn default() -> Self {
42979 Self {
42980 create_smart_account: Ok(Default::default()),
42981 }
42982 }
42983 }
42984 impl CreateEndUserBodyEvmAccount {
42985 pub fn create_smart_account<T>(mut self, value: T) -> Self
42986 where
42987 T: ::std::convert::TryInto<bool>,
42988 T::Error: ::std::fmt::Display,
42989 {
42990 self.create_smart_account = value.try_into().map_err(|e| {
42991 format!(
42992 "error converting supplied value for create_smart_account: {}",
42993 e
42994 )
42995 });
42996 self
42997 }
42998 }
42999 impl ::std::convert::TryFrom<CreateEndUserBodyEvmAccount> for super::CreateEndUserBodyEvmAccount {
43000 type Error = super::error::ConversionError;
43001 fn try_from(
43002 value: CreateEndUserBodyEvmAccount,
43003 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43004 Ok(Self {
43005 create_smart_account: value.create_smart_account?,
43006 })
43007 }
43008 }
43009 impl ::std::convert::From<super::CreateEndUserBodyEvmAccount> for CreateEndUserBodyEvmAccount {
43010 fn from(value: super::CreateEndUserBodyEvmAccount) -> Self {
43011 Self {
43012 create_smart_account: Ok(value.create_smart_account),
43013 }
43014 }
43015 }
43016 #[derive(Clone, Debug)]
43017 pub struct CreateEndUserBodySolanaAccount {
43018 create_smart_account: ::std::result::Result<bool, ::std::string::String>,
43019 }
43020 impl ::std::default::Default for CreateEndUserBodySolanaAccount {
43021 fn default() -> Self {
43022 Self {
43023 create_smart_account: Ok(Default::default()),
43024 }
43025 }
43026 }
43027 impl CreateEndUserBodySolanaAccount {
43028 pub fn create_smart_account<T>(mut self, value: T) -> Self
43029 where
43030 T: ::std::convert::TryInto<bool>,
43031 T::Error: ::std::fmt::Display,
43032 {
43033 self.create_smart_account = value.try_into().map_err(|e| {
43034 format!(
43035 "error converting supplied value for create_smart_account: {}",
43036 e
43037 )
43038 });
43039 self
43040 }
43041 }
43042 impl ::std::convert::TryFrom<CreateEndUserBodySolanaAccount>
43043 for super::CreateEndUserBodySolanaAccount
43044 {
43045 type Error = super::error::ConversionError;
43046 fn try_from(
43047 value: CreateEndUserBodySolanaAccount,
43048 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43049 Ok(Self {
43050 create_smart_account: value.create_smart_account?,
43051 })
43052 }
43053 }
43054 impl ::std::convert::From<super::CreateEndUserBodySolanaAccount>
43055 for CreateEndUserBodySolanaAccount
43056 {
43057 fn from(value: super::CreateEndUserBodySolanaAccount) -> Self {
43058 Self {
43059 create_smart_account: Ok(value.create_smart_account),
43060 }
43061 }
43062 }
43063 #[derive(Clone, Debug)]
43064 pub struct CreateEvmAccountBody {
43065 account_policy: ::std::result::Result<
43066 ::std::option::Option<super::CreateEvmAccountBodyAccountPolicy>,
43067 ::std::string::String,
43068 >,
43069 name: ::std::result::Result<
43070 ::std::option::Option<super::CreateEvmAccountBodyName>,
43071 ::std::string::String,
43072 >,
43073 }
43074 impl ::std::default::Default for CreateEvmAccountBody {
43075 fn default() -> Self {
43076 Self {
43077 account_policy: Ok(Default::default()),
43078 name: Ok(Default::default()),
43079 }
43080 }
43081 }
43082 impl CreateEvmAccountBody {
43083 pub fn account_policy<T>(mut self, value: T) -> Self
43084 where
43085 T: ::std::convert::TryInto<
43086 ::std::option::Option<super::CreateEvmAccountBodyAccountPolicy>,
43087 >,
43088 T::Error: ::std::fmt::Display,
43089 {
43090 self.account_policy = value.try_into().map_err(|e| {
43091 format!("error converting supplied value for account_policy: {}", e)
43092 });
43093 self
43094 }
43095 pub fn name<T>(mut self, value: T) -> Self
43096 where
43097 T: ::std::convert::TryInto<::std::option::Option<super::CreateEvmAccountBodyName>>,
43098 T::Error: ::std::fmt::Display,
43099 {
43100 self.name = value
43101 .try_into()
43102 .map_err(|e| format!("error converting supplied value for name: {}", e));
43103 self
43104 }
43105 }
43106 impl ::std::convert::TryFrom<CreateEvmAccountBody> for super::CreateEvmAccountBody {
43107 type Error = super::error::ConversionError;
43108 fn try_from(
43109 value: CreateEvmAccountBody,
43110 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43111 Ok(Self {
43112 account_policy: value.account_policy?,
43113 name: value.name?,
43114 })
43115 }
43116 }
43117 impl ::std::convert::From<super::CreateEvmAccountBody> for CreateEvmAccountBody {
43118 fn from(value: super::CreateEvmAccountBody) -> Self {
43119 Self {
43120 account_policy: Ok(value.account_policy),
43121 name: Ok(value.name),
43122 }
43123 }
43124 }
43125 #[derive(Clone, Debug)]
43126 pub struct CreateEvmSmartAccountBody {
43127 name: ::std::result::Result<
43128 ::std::option::Option<super::CreateEvmSmartAccountBodyName>,
43129 ::std::string::String,
43130 >,
43131 owners: ::std::result::Result<
43132 ::std::vec::Vec<super::CreateEvmSmartAccountBodyOwnersItem>,
43133 ::std::string::String,
43134 >,
43135 }
43136 impl ::std::default::Default for CreateEvmSmartAccountBody {
43137 fn default() -> Self {
43138 Self {
43139 name: Ok(Default::default()),
43140 owners: Err("no value supplied for owners".to_string()),
43141 }
43142 }
43143 }
43144 impl CreateEvmSmartAccountBody {
43145 pub fn name<T>(mut self, value: T) -> Self
43146 where
43147 T: ::std::convert::TryInto<
43148 ::std::option::Option<super::CreateEvmSmartAccountBodyName>,
43149 >,
43150 T::Error: ::std::fmt::Display,
43151 {
43152 self.name = value
43153 .try_into()
43154 .map_err(|e| format!("error converting supplied value for name: {}", e));
43155 self
43156 }
43157 pub fn owners<T>(mut self, value: T) -> Self
43158 where
43159 T: ::std::convert::TryInto<
43160 ::std::vec::Vec<super::CreateEvmSmartAccountBodyOwnersItem>,
43161 >,
43162 T::Error: ::std::fmt::Display,
43163 {
43164 self.owners = value
43165 .try_into()
43166 .map_err(|e| format!("error converting supplied value for owners: {}", e));
43167 self
43168 }
43169 }
43170 impl ::std::convert::TryFrom<CreateEvmSmartAccountBody> for super::CreateEvmSmartAccountBody {
43171 type Error = super::error::ConversionError;
43172 fn try_from(
43173 value: CreateEvmSmartAccountBody,
43174 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43175 Ok(Self {
43176 name: value.name?,
43177 owners: value.owners?,
43178 })
43179 }
43180 }
43181 impl ::std::convert::From<super::CreateEvmSmartAccountBody> for CreateEvmSmartAccountBody {
43182 fn from(value: super::CreateEvmSmartAccountBody) -> Self {
43183 Self {
43184 name: Ok(value.name),
43185 owners: Ok(value.owners),
43186 }
43187 }
43188 }
43189 #[derive(Clone, Debug)]
43190 pub struct CreateEvmSwapQuoteBody {
43191 from_amount: ::std::result::Result<
43192 super::CreateEvmSwapQuoteBodyFromAmount,
43193 ::std::string::String,
43194 >,
43195 from_token: ::std::result::Result<
43196 super::CreateEvmSwapQuoteBodyFromToken,
43197 ::std::string::String,
43198 >,
43199 gas_price: ::std::result::Result<
43200 ::std::option::Option<super::CreateEvmSwapQuoteBodyGasPrice>,
43201 ::std::string::String,
43202 >,
43203 network: ::std::result::Result<super::EvmSwapsNetwork, ::std::string::String>,
43204 signer_address: ::std::result::Result<
43205 ::std::option::Option<super::CreateEvmSwapQuoteBodySignerAddress>,
43206 ::std::string::String,
43207 >,
43208 slippage_bps: ::std::result::Result<i64, ::std::string::String>,
43209 taker: ::std::result::Result<super::CreateEvmSwapQuoteBodyTaker, ::std::string::String>,
43210 to_token:
43211 ::std::result::Result<super::CreateEvmSwapQuoteBodyToToken, ::std::string::String>,
43212 }
43213 impl ::std::default::Default for CreateEvmSwapQuoteBody {
43214 fn default() -> Self {
43215 Self {
43216 from_amount: Err("no value supplied for from_amount".to_string()),
43217 from_token: Err("no value supplied for from_token".to_string()),
43218 gas_price: Ok(Default::default()),
43219 network: Err("no value supplied for network".to_string()),
43220 signer_address: Ok(Default::default()),
43221 slippage_bps: Ok(super::defaults::default_u64::<i64, 100>()),
43222 taker: Err("no value supplied for taker".to_string()),
43223 to_token: Err("no value supplied for to_token".to_string()),
43224 }
43225 }
43226 }
43227 impl CreateEvmSwapQuoteBody {
43228 pub fn from_amount<T>(mut self, value: T) -> Self
43229 where
43230 T: ::std::convert::TryInto<super::CreateEvmSwapQuoteBodyFromAmount>,
43231 T::Error: ::std::fmt::Display,
43232 {
43233 self.from_amount = value
43234 .try_into()
43235 .map_err(|e| format!("error converting supplied value for from_amount: {}", e));
43236 self
43237 }
43238 pub fn from_token<T>(mut self, value: T) -> Self
43239 where
43240 T: ::std::convert::TryInto<super::CreateEvmSwapQuoteBodyFromToken>,
43241 T::Error: ::std::fmt::Display,
43242 {
43243 self.from_token = value
43244 .try_into()
43245 .map_err(|e| format!("error converting supplied value for from_token: {}", e));
43246 self
43247 }
43248 pub fn gas_price<T>(mut self, value: T) -> Self
43249 where
43250 T: ::std::convert::TryInto<
43251 ::std::option::Option<super::CreateEvmSwapQuoteBodyGasPrice>,
43252 >,
43253 T::Error: ::std::fmt::Display,
43254 {
43255 self.gas_price = value
43256 .try_into()
43257 .map_err(|e| format!("error converting supplied value for gas_price: {}", e));
43258 self
43259 }
43260 pub fn network<T>(mut self, value: T) -> Self
43261 where
43262 T: ::std::convert::TryInto<super::EvmSwapsNetwork>,
43263 T::Error: ::std::fmt::Display,
43264 {
43265 self.network = value
43266 .try_into()
43267 .map_err(|e| format!("error converting supplied value for network: {}", e));
43268 self
43269 }
43270 pub fn signer_address<T>(mut self, value: T) -> Self
43271 where
43272 T: ::std::convert::TryInto<
43273 ::std::option::Option<super::CreateEvmSwapQuoteBodySignerAddress>,
43274 >,
43275 T::Error: ::std::fmt::Display,
43276 {
43277 self.signer_address = value.try_into().map_err(|e| {
43278 format!("error converting supplied value for signer_address: {}", e)
43279 });
43280 self
43281 }
43282 pub fn slippage_bps<T>(mut self, value: T) -> Self
43283 where
43284 T: ::std::convert::TryInto<i64>,
43285 T::Error: ::std::fmt::Display,
43286 {
43287 self.slippage_bps = value.try_into().map_err(|e| {
43288 format!("error converting supplied value for slippage_bps: {}", e)
43289 });
43290 self
43291 }
43292 pub fn taker<T>(mut self, value: T) -> Self
43293 where
43294 T: ::std::convert::TryInto<super::CreateEvmSwapQuoteBodyTaker>,
43295 T::Error: ::std::fmt::Display,
43296 {
43297 self.taker = value
43298 .try_into()
43299 .map_err(|e| format!("error converting supplied value for taker: {}", e));
43300 self
43301 }
43302 pub fn to_token<T>(mut self, value: T) -> Self
43303 where
43304 T: ::std::convert::TryInto<super::CreateEvmSwapQuoteBodyToToken>,
43305 T::Error: ::std::fmt::Display,
43306 {
43307 self.to_token = value
43308 .try_into()
43309 .map_err(|e| format!("error converting supplied value for to_token: {}", e));
43310 self
43311 }
43312 }
43313 impl ::std::convert::TryFrom<CreateEvmSwapQuoteBody> for super::CreateEvmSwapQuoteBody {
43314 type Error = super::error::ConversionError;
43315 fn try_from(
43316 value: CreateEvmSwapQuoteBody,
43317 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43318 Ok(Self {
43319 from_amount: value.from_amount?,
43320 from_token: value.from_token?,
43321 gas_price: value.gas_price?,
43322 network: value.network?,
43323 signer_address: value.signer_address?,
43324 slippage_bps: value.slippage_bps?,
43325 taker: value.taker?,
43326 to_token: value.to_token?,
43327 })
43328 }
43329 }
43330 impl ::std::convert::From<super::CreateEvmSwapQuoteBody> for CreateEvmSwapQuoteBody {
43331 fn from(value: super::CreateEvmSwapQuoteBody) -> Self {
43332 Self {
43333 from_amount: Ok(value.from_amount),
43334 from_token: Ok(value.from_token),
43335 gas_price: Ok(value.gas_price),
43336 network: Ok(value.network),
43337 signer_address: Ok(value.signer_address),
43338 slippage_bps: Ok(value.slippage_bps),
43339 taker: Ok(value.taker),
43340 to_token: Ok(value.to_token),
43341 }
43342 }
43343 }
43344 #[derive(Clone, Debug)]
43345 pub struct CreateOnrampOrderBody {
43346 agreement_accepted_at: ::std::result::Result<
43347 ::chrono::DateTime<::chrono::offset::Utc>,
43348 ::std::string::String,
43349 >,
43350 client_ip: ::std::result::Result<
43351 ::std::option::Option<::std::string::String>,
43352 ::std::string::String,
43353 >,
43354 destination_address:
43355 ::std::result::Result<::std::string::String, ::std::string::String>,
43356 destination_network:
43357 ::std::result::Result<::std::string::String, ::std::string::String>,
43358 domain: ::std::result::Result<
43359 ::std::option::Option<::std::string::String>,
43360 ::std::string::String,
43361 >,
43362 email: ::std::result::Result<::std::string::String, ::std::string::String>,
43363 is_quote: ::std::result::Result<bool, ::std::string::String>,
43364 partner_order_ref: ::std::result::Result<
43365 ::std::option::Option<::std::string::String>,
43366 ::std::string::String,
43367 >,
43368 partner_user_ref: ::std::result::Result<::std::string::String, ::std::string::String>,
43369 payment_amount: ::std::result::Result<
43370 ::std::option::Option<::std::string::String>,
43371 ::std::string::String,
43372 >,
43373 payment_currency: ::std::result::Result<::std::string::String, ::std::string::String>,
43374 payment_method:
43375 ::std::result::Result<super::OnrampOrderPaymentMethodTypeId, ::std::string::String>,
43376 phone_number: ::std::result::Result<::std::string::String, ::std::string::String>,
43377 phone_number_verified_at: ::std::result::Result<
43378 ::chrono::DateTime<::chrono::offset::Utc>,
43379 ::std::string::String,
43380 >,
43381 purchase_amount: ::std::result::Result<
43382 ::std::option::Option<::std::string::String>,
43383 ::std::string::String,
43384 >,
43385 purchase_currency: ::std::result::Result<::std::string::String, ::std::string::String>,
43386 }
43387 impl ::std::default::Default for CreateOnrampOrderBody {
43388 fn default() -> Self {
43389 Self {
43390 agreement_accepted_at: Err(
43391 "no value supplied for agreement_accepted_at".to_string()
43392 ),
43393 client_ip: Ok(Default::default()),
43394 destination_address: Err(
43395 "no value supplied for destination_address".to_string()
43396 ),
43397 destination_network: Err(
43398 "no value supplied for destination_network".to_string()
43399 ),
43400 domain: Ok(Default::default()),
43401 email: Err("no value supplied for email".to_string()),
43402 is_quote: Ok(Default::default()),
43403 partner_order_ref: Ok(Default::default()),
43404 partner_user_ref: Err("no value supplied for partner_user_ref".to_string()),
43405 payment_amount: Ok(Default::default()),
43406 payment_currency: Err("no value supplied for payment_currency".to_string()),
43407 payment_method: Err("no value supplied for payment_method".to_string()),
43408 phone_number: Err("no value supplied for phone_number".to_string()),
43409 phone_number_verified_at: Err(
43410 "no value supplied for phone_number_verified_at".to_string()
43411 ),
43412 purchase_amount: Ok(Default::default()),
43413 purchase_currency: Err("no value supplied for purchase_currency".to_string()),
43414 }
43415 }
43416 }
43417 impl CreateOnrampOrderBody {
43418 pub fn agreement_accepted_at<T>(mut self, value: T) -> Self
43419 where
43420 T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
43421 T::Error: ::std::fmt::Display,
43422 {
43423 self.agreement_accepted_at = value.try_into().map_err(|e| {
43424 format!(
43425 "error converting supplied value for agreement_accepted_at: {}",
43426 e
43427 )
43428 });
43429 self
43430 }
43431 pub fn client_ip<T>(mut self, value: T) -> Self
43432 where
43433 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43434 T::Error: ::std::fmt::Display,
43435 {
43436 self.client_ip = value
43437 .try_into()
43438 .map_err(|e| format!("error converting supplied value for client_ip: {}", e));
43439 self
43440 }
43441 pub fn destination_address<T>(mut self, value: T) -> Self
43442 where
43443 T: ::std::convert::TryInto<::std::string::String>,
43444 T::Error: ::std::fmt::Display,
43445 {
43446 self.destination_address = value.try_into().map_err(|e| {
43447 format!(
43448 "error converting supplied value for destination_address: {}",
43449 e
43450 )
43451 });
43452 self
43453 }
43454 pub fn destination_network<T>(mut self, value: T) -> Self
43455 where
43456 T: ::std::convert::TryInto<::std::string::String>,
43457 T::Error: ::std::fmt::Display,
43458 {
43459 self.destination_network = value.try_into().map_err(|e| {
43460 format!(
43461 "error converting supplied value for destination_network: {}",
43462 e
43463 )
43464 });
43465 self
43466 }
43467 pub fn domain<T>(mut self, value: T) -> Self
43468 where
43469 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43470 T::Error: ::std::fmt::Display,
43471 {
43472 self.domain = value
43473 .try_into()
43474 .map_err(|e| format!("error converting supplied value for domain: {}", e));
43475 self
43476 }
43477 pub fn email<T>(mut self, value: T) -> Self
43478 where
43479 T: ::std::convert::TryInto<::std::string::String>,
43480 T::Error: ::std::fmt::Display,
43481 {
43482 self.email = value
43483 .try_into()
43484 .map_err(|e| format!("error converting supplied value for email: {}", e));
43485 self
43486 }
43487 pub fn is_quote<T>(mut self, value: T) -> Self
43488 where
43489 T: ::std::convert::TryInto<bool>,
43490 T::Error: ::std::fmt::Display,
43491 {
43492 self.is_quote = value
43493 .try_into()
43494 .map_err(|e| format!("error converting supplied value for is_quote: {}", e));
43495 self
43496 }
43497 pub fn partner_order_ref<T>(mut self, value: T) -> Self
43498 where
43499 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43500 T::Error: ::std::fmt::Display,
43501 {
43502 self.partner_order_ref = value.try_into().map_err(|e| {
43503 format!(
43504 "error converting supplied value for partner_order_ref: {}",
43505 e
43506 )
43507 });
43508 self
43509 }
43510 pub fn partner_user_ref<T>(mut self, value: T) -> Self
43511 where
43512 T: ::std::convert::TryInto<::std::string::String>,
43513 T::Error: ::std::fmt::Display,
43514 {
43515 self.partner_user_ref = value.try_into().map_err(|e| {
43516 format!(
43517 "error converting supplied value for partner_user_ref: {}",
43518 e
43519 )
43520 });
43521 self
43522 }
43523 pub fn payment_amount<T>(mut self, value: T) -> Self
43524 where
43525 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43526 T::Error: ::std::fmt::Display,
43527 {
43528 self.payment_amount = value.try_into().map_err(|e| {
43529 format!("error converting supplied value for payment_amount: {}", e)
43530 });
43531 self
43532 }
43533 pub fn payment_currency<T>(mut self, value: T) -> Self
43534 where
43535 T: ::std::convert::TryInto<::std::string::String>,
43536 T::Error: ::std::fmt::Display,
43537 {
43538 self.payment_currency = value.try_into().map_err(|e| {
43539 format!(
43540 "error converting supplied value for payment_currency: {}",
43541 e
43542 )
43543 });
43544 self
43545 }
43546 pub fn payment_method<T>(mut self, value: T) -> Self
43547 where
43548 T: ::std::convert::TryInto<super::OnrampOrderPaymentMethodTypeId>,
43549 T::Error: ::std::fmt::Display,
43550 {
43551 self.payment_method = value.try_into().map_err(|e| {
43552 format!("error converting supplied value for payment_method: {}", e)
43553 });
43554 self
43555 }
43556 pub fn phone_number<T>(mut self, value: T) -> Self
43557 where
43558 T: ::std::convert::TryInto<::std::string::String>,
43559 T::Error: ::std::fmt::Display,
43560 {
43561 self.phone_number = value.try_into().map_err(|e| {
43562 format!("error converting supplied value for phone_number: {}", e)
43563 });
43564 self
43565 }
43566 pub fn phone_number_verified_at<T>(mut self, value: T) -> Self
43567 where
43568 T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
43569 T::Error: ::std::fmt::Display,
43570 {
43571 self.phone_number_verified_at = value.try_into().map_err(|e| {
43572 format!(
43573 "error converting supplied value for phone_number_verified_at: {}",
43574 e
43575 )
43576 });
43577 self
43578 }
43579 pub fn purchase_amount<T>(mut self, value: T) -> Self
43580 where
43581 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43582 T::Error: ::std::fmt::Display,
43583 {
43584 self.purchase_amount = value.try_into().map_err(|e| {
43585 format!("error converting supplied value for purchase_amount: {}", e)
43586 });
43587 self
43588 }
43589 pub fn purchase_currency<T>(mut self, value: T) -> Self
43590 where
43591 T: ::std::convert::TryInto<::std::string::String>,
43592 T::Error: ::std::fmt::Display,
43593 {
43594 self.purchase_currency = value.try_into().map_err(|e| {
43595 format!(
43596 "error converting supplied value for purchase_currency: {}",
43597 e
43598 )
43599 });
43600 self
43601 }
43602 }
43603 impl ::std::convert::TryFrom<CreateOnrampOrderBody> for super::CreateOnrampOrderBody {
43604 type Error = super::error::ConversionError;
43605 fn try_from(
43606 value: CreateOnrampOrderBody,
43607 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43608 Ok(Self {
43609 agreement_accepted_at: value.agreement_accepted_at?,
43610 client_ip: value.client_ip?,
43611 destination_address: value.destination_address?,
43612 destination_network: value.destination_network?,
43613 domain: value.domain?,
43614 email: value.email?,
43615 is_quote: value.is_quote?,
43616 partner_order_ref: value.partner_order_ref?,
43617 partner_user_ref: value.partner_user_ref?,
43618 payment_amount: value.payment_amount?,
43619 payment_currency: value.payment_currency?,
43620 payment_method: value.payment_method?,
43621 phone_number: value.phone_number?,
43622 phone_number_verified_at: value.phone_number_verified_at?,
43623 purchase_amount: value.purchase_amount?,
43624 purchase_currency: value.purchase_currency?,
43625 })
43626 }
43627 }
43628 impl ::std::convert::From<super::CreateOnrampOrderBody> for CreateOnrampOrderBody {
43629 fn from(value: super::CreateOnrampOrderBody) -> Self {
43630 Self {
43631 agreement_accepted_at: Ok(value.agreement_accepted_at),
43632 client_ip: Ok(value.client_ip),
43633 destination_address: Ok(value.destination_address),
43634 destination_network: Ok(value.destination_network),
43635 domain: Ok(value.domain),
43636 email: Ok(value.email),
43637 is_quote: Ok(value.is_quote),
43638 partner_order_ref: Ok(value.partner_order_ref),
43639 partner_user_ref: Ok(value.partner_user_ref),
43640 payment_amount: Ok(value.payment_amount),
43641 payment_currency: Ok(value.payment_currency),
43642 payment_method: Ok(value.payment_method),
43643 phone_number: Ok(value.phone_number),
43644 phone_number_verified_at: Ok(value.phone_number_verified_at),
43645 purchase_amount: Ok(value.purchase_amount),
43646 purchase_currency: Ok(value.purchase_currency),
43647 }
43648 }
43649 }
43650 #[derive(Clone, Debug)]
43651 pub struct CreateOnrampOrderResponse {
43652 order: ::std::result::Result<super::OnrampOrder, ::std::string::String>,
43653 payment_link: ::std::result::Result<
43654 ::std::option::Option<super::OnrampPaymentLink>,
43655 ::std::string::String,
43656 >,
43657 }
43658 impl ::std::default::Default for CreateOnrampOrderResponse {
43659 fn default() -> Self {
43660 Self {
43661 order: Err("no value supplied for order".to_string()),
43662 payment_link: Ok(Default::default()),
43663 }
43664 }
43665 }
43666 impl CreateOnrampOrderResponse {
43667 pub fn order<T>(mut self, value: T) -> Self
43668 where
43669 T: ::std::convert::TryInto<super::OnrampOrder>,
43670 T::Error: ::std::fmt::Display,
43671 {
43672 self.order = value
43673 .try_into()
43674 .map_err(|e| format!("error converting supplied value for order: {}", e));
43675 self
43676 }
43677 pub fn payment_link<T>(mut self, value: T) -> Self
43678 where
43679 T: ::std::convert::TryInto<::std::option::Option<super::OnrampPaymentLink>>,
43680 T::Error: ::std::fmt::Display,
43681 {
43682 self.payment_link = value.try_into().map_err(|e| {
43683 format!("error converting supplied value for payment_link: {}", e)
43684 });
43685 self
43686 }
43687 }
43688 impl ::std::convert::TryFrom<CreateOnrampOrderResponse> for super::CreateOnrampOrderResponse {
43689 type Error = super::error::ConversionError;
43690 fn try_from(
43691 value: CreateOnrampOrderResponse,
43692 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43693 Ok(Self {
43694 order: value.order?,
43695 payment_link: value.payment_link?,
43696 })
43697 }
43698 }
43699 impl ::std::convert::From<super::CreateOnrampOrderResponse> for CreateOnrampOrderResponse {
43700 fn from(value: super::CreateOnrampOrderResponse) -> Self {
43701 Self {
43702 order: Ok(value.order),
43703 payment_link: Ok(value.payment_link),
43704 }
43705 }
43706 }
43707 #[derive(Clone, Debug)]
43708 pub struct CreateOnrampSessionBody {
43709 client_ip: ::std::result::Result<
43710 ::std::option::Option<::std::string::String>,
43711 ::std::string::String,
43712 >,
43713 country: ::std::result::Result<
43714 ::std::option::Option<::std::string::String>,
43715 ::std::string::String,
43716 >,
43717 destination_address:
43718 ::std::result::Result<::std::string::String, ::std::string::String>,
43719 destination_network:
43720 ::std::result::Result<::std::string::String, ::std::string::String>,
43721 partner_user_ref: ::std::result::Result<
43722 ::std::option::Option<::std::string::String>,
43723 ::std::string::String,
43724 >,
43725 payment_amount: ::std::result::Result<
43726 ::std::option::Option<::std::string::String>,
43727 ::std::string::String,
43728 >,
43729 payment_currency: ::std::result::Result<
43730 ::std::option::Option<::std::string::String>,
43731 ::std::string::String,
43732 >,
43733 payment_method: ::std::result::Result<
43734 ::std::option::Option<super::OnrampQuotePaymentMethodTypeId>,
43735 ::std::string::String,
43736 >,
43737 purchase_currency: ::std::result::Result<::std::string::String, ::std::string::String>,
43738 redirect_url:
43739 ::std::result::Result<::std::option::Option<super::Uri>, ::std::string::String>,
43740 subdivision: ::std::result::Result<
43741 ::std::option::Option<::std::string::String>,
43742 ::std::string::String,
43743 >,
43744 }
43745 impl ::std::default::Default for CreateOnrampSessionBody {
43746 fn default() -> Self {
43747 Self {
43748 client_ip: Ok(Default::default()),
43749 country: Ok(Default::default()),
43750 destination_address: Err(
43751 "no value supplied for destination_address".to_string()
43752 ),
43753 destination_network: Err(
43754 "no value supplied for destination_network".to_string()
43755 ),
43756 partner_user_ref: Ok(Default::default()),
43757 payment_amount: Ok(Default::default()),
43758 payment_currency: Ok(Default::default()),
43759 payment_method: Ok(Default::default()),
43760 purchase_currency: Err("no value supplied for purchase_currency".to_string()),
43761 redirect_url: Ok(Default::default()),
43762 subdivision: Ok(Default::default()),
43763 }
43764 }
43765 }
43766 impl CreateOnrampSessionBody {
43767 pub fn client_ip<T>(mut self, value: T) -> Self
43768 where
43769 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43770 T::Error: ::std::fmt::Display,
43771 {
43772 self.client_ip = value
43773 .try_into()
43774 .map_err(|e| format!("error converting supplied value for client_ip: {}", e));
43775 self
43776 }
43777 pub fn country<T>(mut self, value: T) -> Self
43778 where
43779 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43780 T::Error: ::std::fmt::Display,
43781 {
43782 self.country = value
43783 .try_into()
43784 .map_err(|e| format!("error converting supplied value for country: {}", e));
43785 self
43786 }
43787 pub fn destination_address<T>(mut self, value: T) -> Self
43788 where
43789 T: ::std::convert::TryInto<::std::string::String>,
43790 T::Error: ::std::fmt::Display,
43791 {
43792 self.destination_address = value.try_into().map_err(|e| {
43793 format!(
43794 "error converting supplied value for destination_address: {}",
43795 e
43796 )
43797 });
43798 self
43799 }
43800 pub fn destination_network<T>(mut self, value: T) -> Self
43801 where
43802 T: ::std::convert::TryInto<::std::string::String>,
43803 T::Error: ::std::fmt::Display,
43804 {
43805 self.destination_network = value.try_into().map_err(|e| {
43806 format!(
43807 "error converting supplied value for destination_network: {}",
43808 e
43809 )
43810 });
43811 self
43812 }
43813 pub fn partner_user_ref<T>(mut self, value: T) -> Self
43814 where
43815 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43816 T::Error: ::std::fmt::Display,
43817 {
43818 self.partner_user_ref = value.try_into().map_err(|e| {
43819 format!(
43820 "error converting supplied value for partner_user_ref: {}",
43821 e
43822 )
43823 });
43824 self
43825 }
43826 pub fn payment_amount<T>(mut self, value: T) -> Self
43827 where
43828 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43829 T::Error: ::std::fmt::Display,
43830 {
43831 self.payment_amount = value.try_into().map_err(|e| {
43832 format!("error converting supplied value for payment_amount: {}", e)
43833 });
43834 self
43835 }
43836 pub fn payment_currency<T>(mut self, value: T) -> Self
43837 where
43838 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43839 T::Error: ::std::fmt::Display,
43840 {
43841 self.payment_currency = value.try_into().map_err(|e| {
43842 format!(
43843 "error converting supplied value for payment_currency: {}",
43844 e
43845 )
43846 });
43847 self
43848 }
43849 pub fn payment_method<T>(mut self, value: T) -> Self
43850 where
43851 T: ::std::convert::TryInto<
43852 ::std::option::Option<super::OnrampQuotePaymentMethodTypeId>,
43853 >,
43854 T::Error: ::std::fmt::Display,
43855 {
43856 self.payment_method = value.try_into().map_err(|e| {
43857 format!("error converting supplied value for payment_method: {}", e)
43858 });
43859 self
43860 }
43861 pub fn purchase_currency<T>(mut self, value: T) -> Self
43862 where
43863 T: ::std::convert::TryInto<::std::string::String>,
43864 T::Error: ::std::fmt::Display,
43865 {
43866 self.purchase_currency = value.try_into().map_err(|e| {
43867 format!(
43868 "error converting supplied value for purchase_currency: {}",
43869 e
43870 )
43871 });
43872 self
43873 }
43874 pub fn redirect_url<T>(mut self, value: T) -> Self
43875 where
43876 T: ::std::convert::TryInto<::std::option::Option<super::Uri>>,
43877 T::Error: ::std::fmt::Display,
43878 {
43879 self.redirect_url = value.try_into().map_err(|e| {
43880 format!("error converting supplied value for redirect_url: {}", e)
43881 });
43882 self
43883 }
43884 pub fn subdivision<T>(mut self, value: T) -> Self
43885 where
43886 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
43887 T::Error: ::std::fmt::Display,
43888 {
43889 self.subdivision = value
43890 .try_into()
43891 .map_err(|e| format!("error converting supplied value for subdivision: {}", e));
43892 self
43893 }
43894 }
43895 impl ::std::convert::TryFrom<CreateOnrampSessionBody> for super::CreateOnrampSessionBody {
43896 type Error = super::error::ConversionError;
43897 fn try_from(
43898 value: CreateOnrampSessionBody,
43899 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43900 Ok(Self {
43901 client_ip: value.client_ip?,
43902 country: value.country?,
43903 destination_address: value.destination_address?,
43904 destination_network: value.destination_network?,
43905 partner_user_ref: value.partner_user_ref?,
43906 payment_amount: value.payment_amount?,
43907 payment_currency: value.payment_currency?,
43908 payment_method: value.payment_method?,
43909 purchase_currency: value.purchase_currency?,
43910 redirect_url: value.redirect_url?,
43911 subdivision: value.subdivision?,
43912 })
43913 }
43914 }
43915 impl ::std::convert::From<super::CreateOnrampSessionBody> for CreateOnrampSessionBody {
43916 fn from(value: super::CreateOnrampSessionBody) -> Self {
43917 Self {
43918 client_ip: Ok(value.client_ip),
43919 country: Ok(value.country),
43920 destination_address: Ok(value.destination_address),
43921 destination_network: Ok(value.destination_network),
43922 partner_user_ref: Ok(value.partner_user_ref),
43923 payment_amount: Ok(value.payment_amount),
43924 payment_currency: Ok(value.payment_currency),
43925 payment_method: Ok(value.payment_method),
43926 purchase_currency: Ok(value.purchase_currency),
43927 redirect_url: Ok(value.redirect_url),
43928 subdivision: Ok(value.subdivision),
43929 }
43930 }
43931 }
43932 #[derive(Clone, Debug)]
43933 pub struct CreateOnrampSessionResponse {
43934 quote: ::std::result::Result<
43935 ::std::option::Option<super::OnrampQuote>,
43936 ::std::string::String,
43937 >,
43938 session: ::std::result::Result<super::OnrampSession, ::std::string::String>,
43939 }
43940 impl ::std::default::Default for CreateOnrampSessionResponse {
43941 fn default() -> Self {
43942 Self {
43943 quote: Ok(Default::default()),
43944 session: Err("no value supplied for session".to_string()),
43945 }
43946 }
43947 }
43948 impl CreateOnrampSessionResponse {
43949 pub fn quote<T>(mut self, value: T) -> Self
43950 where
43951 T: ::std::convert::TryInto<::std::option::Option<super::OnrampQuote>>,
43952 T::Error: ::std::fmt::Display,
43953 {
43954 self.quote = value
43955 .try_into()
43956 .map_err(|e| format!("error converting supplied value for quote: {}", e));
43957 self
43958 }
43959 pub fn session<T>(mut self, value: T) -> Self
43960 where
43961 T: ::std::convert::TryInto<super::OnrampSession>,
43962 T::Error: ::std::fmt::Display,
43963 {
43964 self.session = value
43965 .try_into()
43966 .map_err(|e| format!("error converting supplied value for session: {}", e));
43967 self
43968 }
43969 }
43970 impl ::std::convert::TryFrom<CreateOnrampSessionResponse> for super::CreateOnrampSessionResponse {
43971 type Error = super::error::ConversionError;
43972 fn try_from(
43973 value: CreateOnrampSessionResponse,
43974 ) -> ::std::result::Result<Self, super::error::ConversionError> {
43975 Ok(Self {
43976 quote: value.quote?,
43977 session: value.session?,
43978 })
43979 }
43980 }
43981 impl ::std::convert::From<super::CreateOnrampSessionResponse> for CreateOnrampSessionResponse {
43982 fn from(value: super::CreateOnrampSessionResponse) -> Self {
43983 Self {
43984 quote: Ok(value.quote),
43985 session: Ok(value.session),
43986 }
43987 }
43988 }
43989 #[derive(Clone, Debug)]
43990 pub struct CreatePolicyBody {
43991 description: ::std::result::Result<
43992 ::std::option::Option<super::CreatePolicyBodyDescription>,
43993 ::std::string::String,
43994 >,
43995 rules: ::std::result::Result<::std::vec::Vec<super::Rule>, ::std::string::String>,
43996 scope: ::std::result::Result<super::CreatePolicyBodyScope, ::std::string::String>,
43997 }
43998 impl ::std::default::Default for CreatePolicyBody {
43999 fn default() -> Self {
44000 Self {
44001 description: Ok(Default::default()),
44002 rules: Err("no value supplied for rules".to_string()),
44003 scope: Err("no value supplied for scope".to_string()),
44004 }
44005 }
44006 }
44007 impl CreatePolicyBody {
44008 pub fn description<T>(mut self, value: T) -> Self
44009 where
44010 T: ::std::convert::TryInto<
44011 ::std::option::Option<super::CreatePolicyBodyDescription>,
44012 >,
44013 T::Error: ::std::fmt::Display,
44014 {
44015 self.description = value
44016 .try_into()
44017 .map_err(|e| format!("error converting supplied value for description: {}", e));
44018 self
44019 }
44020 pub fn rules<T>(mut self, value: T) -> Self
44021 where
44022 T: ::std::convert::TryInto<::std::vec::Vec<super::Rule>>,
44023 T::Error: ::std::fmt::Display,
44024 {
44025 self.rules = value
44026 .try_into()
44027 .map_err(|e| format!("error converting supplied value for rules: {}", e));
44028 self
44029 }
44030 pub fn scope<T>(mut self, value: T) -> Self
44031 where
44032 T: ::std::convert::TryInto<super::CreatePolicyBodyScope>,
44033 T::Error: ::std::fmt::Display,
44034 {
44035 self.scope = value
44036 .try_into()
44037 .map_err(|e| format!("error converting supplied value for scope: {}", e));
44038 self
44039 }
44040 }
44041 impl ::std::convert::TryFrom<CreatePolicyBody> for super::CreatePolicyBody {
44042 type Error = super::error::ConversionError;
44043 fn try_from(
44044 value: CreatePolicyBody,
44045 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44046 Ok(Self {
44047 description: value.description?,
44048 rules: value.rules?,
44049 scope: value.scope?,
44050 })
44051 }
44052 }
44053 impl ::std::convert::From<super::CreatePolicyBody> for CreatePolicyBody {
44054 fn from(value: super::CreatePolicyBody) -> Self {
44055 Self {
44056 description: Ok(value.description),
44057 rules: Ok(value.rules),
44058 scope: Ok(value.scope),
44059 }
44060 }
44061 }
44062 #[derive(Clone, Debug)]
44063 pub struct CreateSolanaAccountBody {
44064 account_policy: ::std::result::Result<
44065 ::std::option::Option<super::CreateSolanaAccountBodyAccountPolicy>,
44066 ::std::string::String,
44067 >,
44068 name: ::std::result::Result<
44069 ::std::option::Option<super::CreateSolanaAccountBodyName>,
44070 ::std::string::String,
44071 >,
44072 }
44073 impl ::std::default::Default for CreateSolanaAccountBody {
44074 fn default() -> Self {
44075 Self {
44076 account_policy: Ok(Default::default()),
44077 name: Ok(Default::default()),
44078 }
44079 }
44080 }
44081 impl CreateSolanaAccountBody {
44082 pub fn account_policy<T>(mut self, value: T) -> Self
44083 where
44084 T: ::std::convert::TryInto<
44085 ::std::option::Option<super::CreateSolanaAccountBodyAccountPolicy>,
44086 >,
44087 T::Error: ::std::fmt::Display,
44088 {
44089 self.account_policy = value.try_into().map_err(|e| {
44090 format!("error converting supplied value for account_policy: {}", e)
44091 });
44092 self
44093 }
44094 pub fn name<T>(mut self, value: T) -> Self
44095 where
44096 T: ::std::convert::TryInto<
44097 ::std::option::Option<super::CreateSolanaAccountBodyName>,
44098 >,
44099 T::Error: ::std::fmt::Display,
44100 {
44101 self.name = value
44102 .try_into()
44103 .map_err(|e| format!("error converting supplied value for name: {}", e));
44104 self
44105 }
44106 }
44107 impl ::std::convert::TryFrom<CreateSolanaAccountBody> for super::CreateSolanaAccountBody {
44108 type Error = super::error::ConversionError;
44109 fn try_from(
44110 value: CreateSolanaAccountBody,
44111 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44112 Ok(Self {
44113 account_policy: value.account_policy?,
44114 name: value.name?,
44115 })
44116 }
44117 }
44118 impl ::std::convert::From<super::CreateSolanaAccountBody> for CreateSolanaAccountBody {
44119 fn from(value: super::CreateSolanaAccountBody) -> Self {
44120 Self {
44121 account_policy: Ok(value.account_policy),
44122 name: Ok(value.name),
44123 }
44124 }
44125 }
44126 #[derive(Clone, Debug)]
44127 pub struct CreateSpendPermissionRequest {
44128 allowance: ::std::result::Result<::std::string::String, ::std::string::String>,
44129 end: ::std::result::Result<::std::string::String, ::std::string::String>,
44130 extra_data: ::std::result::Result<
44131 ::std::option::Option<::std::string::String>,
44132 ::std::string::String,
44133 >,
44134 network: ::std::result::Result<super::SpendPermissionNetwork, ::std::string::String>,
44135 paymaster_url:
44136 ::std::result::Result<::std::option::Option<super::Url>, ::std::string::String>,
44137 period: ::std::result::Result<::std::string::String, ::std::string::String>,
44138 salt: ::std::result::Result<
44139 ::std::option::Option<::std::string::String>,
44140 ::std::string::String,
44141 >,
44142 spender: ::std::result::Result<
44143 super::CreateSpendPermissionRequestSpender,
44144 ::std::string::String,
44145 >,
44146 start: ::std::result::Result<::std::string::String, ::std::string::String>,
44147 token: ::std::result::Result<
44148 super::CreateSpendPermissionRequestToken,
44149 ::std::string::String,
44150 >,
44151 }
44152 impl ::std::default::Default for CreateSpendPermissionRequest {
44153 fn default() -> Self {
44154 Self {
44155 allowance: Err("no value supplied for allowance".to_string()),
44156 end: Err("no value supplied for end".to_string()),
44157 extra_data: Ok(Default::default()),
44158 network: Err("no value supplied for network".to_string()),
44159 paymaster_url: Ok(Default::default()),
44160 period: Err("no value supplied for period".to_string()),
44161 salt: Ok(Default::default()),
44162 spender: Err("no value supplied for spender".to_string()),
44163 start: Err("no value supplied for start".to_string()),
44164 token: Err("no value supplied for token".to_string()),
44165 }
44166 }
44167 }
44168 impl CreateSpendPermissionRequest {
44169 pub fn allowance<T>(mut self, value: T) -> Self
44170 where
44171 T: ::std::convert::TryInto<::std::string::String>,
44172 T::Error: ::std::fmt::Display,
44173 {
44174 self.allowance = value
44175 .try_into()
44176 .map_err(|e| format!("error converting supplied value for allowance: {}", e));
44177 self
44178 }
44179 pub fn end<T>(mut self, value: T) -> Self
44180 where
44181 T: ::std::convert::TryInto<::std::string::String>,
44182 T::Error: ::std::fmt::Display,
44183 {
44184 self.end = value
44185 .try_into()
44186 .map_err(|e| format!("error converting supplied value for end: {}", e));
44187 self
44188 }
44189 pub fn extra_data<T>(mut self, value: T) -> Self
44190 where
44191 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
44192 T::Error: ::std::fmt::Display,
44193 {
44194 self.extra_data = value
44195 .try_into()
44196 .map_err(|e| format!("error converting supplied value for extra_data: {}", e));
44197 self
44198 }
44199 pub fn network<T>(mut self, value: T) -> Self
44200 where
44201 T: ::std::convert::TryInto<super::SpendPermissionNetwork>,
44202 T::Error: ::std::fmt::Display,
44203 {
44204 self.network = value
44205 .try_into()
44206 .map_err(|e| format!("error converting supplied value for network: {}", e));
44207 self
44208 }
44209 pub fn paymaster_url<T>(mut self, value: T) -> Self
44210 where
44211 T: ::std::convert::TryInto<::std::option::Option<super::Url>>,
44212 T::Error: ::std::fmt::Display,
44213 {
44214 self.paymaster_url = value.try_into().map_err(|e| {
44215 format!("error converting supplied value for paymaster_url: {}", e)
44216 });
44217 self
44218 }
44219 pub fn period<T>(mut self, value: T) -> Self
44220 where
44221 T: ::std::convert::TryInto<::std::string::String>,
44222 T::Error: ::std::fmt::Display,
44223 {
44224 self.period = value
44225 .try_into()
44226 .map_err(|e| format!("error converting supplied value for period: {}", e));
44227 self
44228 }
44229 pub fn salt<T>(mut self, value: T) -> Self
44230 where
44231 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
44232 T::Error: ::std::fmt::Display,
44233 {
44234 self.salt = value
44235 .try_into()
44236 .map_err(|e| format!("error converting supplied value for salt: {}", e));
44237 self
44238 }
44239 pub fn spender<T>(mut self, value: T) -> Self
44240 where
44241 T: ::std::convert::TryInto<super::CreateSpendPermissionRequestSpender>,
44242 T::Error: ::std::fmt::Display,
44243 {
44244 self.spender = value
44245 .try_into()
44246 .map_err(|e| format!("error converting supplied value for spender: {}", e));
44247 self
44248 }
44249 pub fn start<T>(mut self, value: T) -> Self
44250 where
44251 T: ::std::convert::TryInto<::std::string::String>,
44252 T::Error: ::std::fmt::Display,
44253 {
44254 self.start = value
44255 .try_into()
44256 .map_err(|e| format!("error converting supplied value for start: {}", e));
44257 self
44258 }
44259 pub fn token<T>(mut self, value: T) -> Self
44260 where
44261 T: ::std::convert::TryInto<super::CreateSpendPermissionRequestToken>,
44262 T::Error: ::std::fmt::Display,
44263 {
44264 self.token = value
44265 .try_into()
44266 .map_err(|e| format!("error converting supplied value for token: {}", e));
44267 self
44268 }
44269 }
44270 impl ::std::convert::TryFrom<CreateSpendPermissionRequest> for super::CreateSpendPermissionRequest {
44271 type Error = super::error::ConversionError;
44272 fn try_from(
44273 value: CreateSpendPermissionRequest,
44274 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44275 Ok(Self {
44276 allowance: value.allowance?,
44277 end: value.end?,
44278 extra_data: value.extra_data?,
44279 network: value.network?,
44280 paymaster_url: value.paymaster_url?,
44281 period: value.period?,
44282 salt: value.salt?,
44283 spender: value.spender?,
44284 start: value.start?,
44285 token: value.token?,
44286 })
44287 }
44288 }
44289 impl ::std::convert::From<super::CreateSpendPermissionRequest> for CreateSpendPermissionRequest {
44290 fn from(value: super::CreateSpendPermissionRequest) -> Self {
44291 Self {
44292 allowance: Ok(value.allowance),
44293 end: Ok(value.end),
44294 extra_data: Ok(value.extra_data),
44295 network: Ok(value.network),
44296 paymaster_url: Ok(value.paymaster_url),
44297 period: Ok(value.period),
44298 salt: Ok(value.salt),
44299 spender: Ok(value.spender),
44300 start: Ok(value.start),
44301 token: Ok(value.token),
44302 }
44303 }
44304 }
44305 #[derive(Clone, Debug)]
44306 pub struct CreateSwapQuoteResponse {
44307 block_number: ::std::result::Result<
44308 super::CreateSwapQuoteResponseBlockNumber,
44309 ::std::string::String,
44310 >,
44311 fees: ::std::result::Result<super::CreateSwapQuoteResponseFees, ::std::string::String>,
44312 from_amount: ::std::result::Result<
44313 super::CreateSwapQuoteResponseFromAmount,
44314 ::std::string::String,
44315 >,
44316 from_token: ::std::result::Result<
44317 super::CreateSwapQuoteResponseFromToken,
44318 ::std::string::String,
44319 >,
44320 issues:
44321 ::std::result::Result<super::CreateSwapQuoteResponseIssues, ::std::string::String>,
44322 liquidity_available: ::std::result::Result<bool, ::std::string::String>,
44323 min_to_amount: ::std::result::Result<
44324 super::CreateSwapQuoteResponseMinToAmount,
44325 ::std::string::String,
44326 >,
44327 permit2: ::std::result::Result<
44328 ::std::option::Option<super::CreateSwapQuoteResponsePermit2>,
44329 ::std::string::String,
44330 >,
44331 to_amount: ::std::result::Result<
44332 super::CreateSwapQuoteResponseToAmount,
44333 ::std::string::String,
44334 >,
44335 to_token:
44336 ::std::result::Result<super::CreateSwapQuoteResponseToToken, ::std::string::String>,
44337 transaction: ::std::result::Result<
44338 super::CreateSwapQuoteResponseTransaction,
44339 ::std::string::String,
44340 >,
44341 }
44342 impl ::std::default::Default for CreateSwapQuoteResponse {
44343 fn default() -> Self {
44344 Self {
44345 block_number: Err("no value supplied for block_number".to_string()),
44346 fees: Err("no value supplied for fees".to_string()),
44347 from_amount: Err("no value supplied for from_amount".to_string()),
44348 from_token: Err("no value supplied for from_token".to_string()),
44349 issues: Err("no value supplied for issues".to_string()),
44350 liquidity_available: Err(
44351 "no value supplied for liquidity_available".to_string()
44352 ),
44353 min_to_amount: Err("no value supplied for min_to_amount".to_string()),
44354 permit2: Err("no value supplied for permit2".to_string()),
44355 to_amount: Err("no value supplied for to_amount".to_string()),
44356 to_token: Err("no value supplied for to_token".to_string()),
44357 transaction: Err("no value supplied for transaction".to_string()),
44358 }
44359 }
44360 }
44361 impl CreateSwapQuoteResponse {
44362 pub fn block_number<T>(mut self, value: T) -> Self
44363 where
44364 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseBlockNumber>,
44365 T::Error: ::std::fmt::Display,
44366 {
44367 self.block_number = value.try_into().map_err(|e| {
44368 format!("error converting supplied value for block_number: {}", e)
44369 });
44370 self
44371 }
44372 pub fn fees<T>(mut self, value: T) -> Self
44373 where
44374 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseFees>,
44375 T::Error: ::std::fmt::Display,
44376 {
44377 self.fees = value
44378 .try_into()
44379 .map_err(|e| format!("error converting supplied value for fees: {}", e));
44380 self
44381 }
44382 pub fn from_amount<T>(mut self, value: T) -> Self
44383 where
44384 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseFromAmount>,
44385 T::Error: ::std::fmt::Display,
44386 {
44387 self.from_amount = value
44388 .try_into()
44389 .map_err(|e| format!("error converting supplied value for from_amount: {}", e));
44390 self
44391 }
44392 pub fn from_token<T>(mut self, value: T) -> Self
44393 where
44394 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseFromToken>,
44395 T::Error: ::std::fmt::Display,
44396 {
44397 self.from_token = value
44398 .try_into()
44399 .map_err(|e| format!("error converting supplied value for from_token: {}", e));
44400 self
44401 }
44402 pub fn issues<T>(mut self, value: T) -> Self
44403 where
44404 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseIssues>,
44405 T::Error: ::std::fmt::Display,
44406 {
44407 self.issues = value
44408 .try_into()
44409 .map_err(|e| format!("error converting supplied value for issues: {}", e));
44410 self
44411 }
44412 pub fn liquidity_available<T>(mut self, value: T) -> Self
44413 where
44414 T: ::std::convert::TryInto<bool>,
44415 T::Error: ::std::fmt::Display,
44416 {
44417 self.liquidity_available = value.try_into().map_err(|e| {
44418 format!(
44419 "error converting supplied value for liquidity_available: {}",
44420 e
44421 )
44422 });
44423 self
44424 }
44425 pub fn min_to_amount<T>(mut self, value: T) -> Self
44426 where
44427 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseMinToAmount>,
44428 T::Error: ::std::fmt::Display,
44429 {
44430 self.min_to_amount = value.try_into().map_err(|e| {
44431 format!("error converting supplied value for min_to_amount: {}", e)
44432 });
44433 self
44434 }
44435 pub fn permit2<T>(mut self, value: T) -> Self
44436 where
44437 T: ::std::convert::TryInto<
44438 ::std::option::Option<super::CreateSwapQuoteResponsePermit2>,
44439 >,
44440 T::Error: ::std::fmt::Display,
44441 {
44442 self.permit2 = value
44443 .try_into()
44444 .map_err(|e| format!("error converting supplied value for permit2: {}", e));
44445 self
44446 }
44447 pub fn to_amount<T>(mut self, value: T) -> Self
44448 where
44449 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseToAmount>,
44450 T::Error: ::std::fmt::Display,
44451 {
44452 self.to_amount = value
44453 .try_into()
44454 .map_err(|e| format!("error converting supplied value for to_amount: {}", e));
44455 self
44456 }
44457 pub fn to_token<T>(mut self, value: T) -> Self
44458 where
44459 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseToToken>,
44460 T::Error: ::std::fmt::Display,
44461 {
44462 self.to_token = value
44463 .try_into()
44464 .map_err(|e| format!("error converting supplied value for to_token: {}", e));
44465 self
44466 }
44467 pub fn transaction<T>(mut self, value: T) -> Self
44468 where
44469 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseTransaction>,
44470 T::Error: ::std::fmt::Display,
44471 {
44472 self.transaction = value
44473 .try_into()
44474 .map_err(|e| format!("error converting supplied value for transaction: {}", e));
44475 self
44476 }
44477 }
44478 impl ::std::convert::TryFrom<CreateSwapQuoteResponse> for super::CreateSwapQuoteResponse {
44479 type Error = super::error::ConversionError;
44480 fn try_from(
44481 value: CreateSwapQuoteResponse,
44482 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44483 Ok(Self {
44484 block_number: value.block_number?,
44485 fees: value.fees?,
44486 from_amount: value.from_amount?,
44487 from_token: value.from_token?,
44488 issues: value.issues?,
44489 liquidity_available: value.liquidity_available?,
44490 min_to_amount: value.min_to_amount?,
44491 permit2: value.permit2?,
44492 to_amount: value.to_amount?,
44493 to_token: value.to_token?,
44494 transaction: value.transaction?,
44495 })
44496 }
44497 }
44498 impl ::std::convert::From<super::CreateSwapQuoteResponse> for CreateSwapQuoteResponse {
44499 fn from(value: super::CreateSwapQuoteResponse) -> Self {
44500 Self {
44501 block_number: Ok(value.block_number),
44502 fees: Ok(value.fees),
44503 from_amount: Ok(value.from_amount),
44504 from_token: Ok(value.from_token),
44505 issues: Ok(value.issues),
44506 liquidity_available: Ok(value.liquidity_available),
44507 min_to_amount: Ok(value.min_to_amount),
44508 permit2: Ok(value.permit2),
44509 to_amount: Ok(value.to_amount),
44510 to_token: Ok(value.to_token),
44511 transaction: Ok(value.transaction),
44512 }
44513 }
44514 }
44515 #[derive(Clone, Debug)]
44516 pub struct CreateSwapQuoteResponseFees {
44517 gas_fee: ::std::result::Result<
44518 ::std::option::Option<super::TokenFee>,
44519 ::std::string::String,
44520 >,
44521 protocol_fee: ::std::result::Result<
44522 ::std::option::Option<super::TokenFee>,
44523 ::std::string::String,
44524 >,
44525 }
44526 impl ::std::default::Default for CreateSwapQuoteResponseFees {
44527 fn default() -> Self {
44528 Self {
44529 gas_fee: Err("no value supplied for gas_fee".to_string()),
44530 protocol_fee: Err("no value supplied for protocol_fee".to_string()),
44531 }
44532 }
44533 }
44534 impl CreateSwapQuoteResponseFees {
44535 pub fn gas_fee<T>(mut self, value: T) -> Self
44536 where
44537 T: ::std::convert::TryInto<::std::option::Option<super::TokenFee>>,
44538 T::Error: ::std::fmt::Display,
44539 {
44540 self.gas_fee = value
44541 .try_into()
44542 .map_err(|e| format!("error converting supplied value for gas_fee: {}", e));
44543 self
44544 }
44545 pub fn protocol_fee<T>(mut self, value: T) -> Self
44546 where
44547 T: ::std::convert::TryInto<::std::option::Option<super::TokenFee>>,
44548 T::Error: ::std::fmt::Display,
44549 {
44550 self.protocol_fee = value.try_into().map_err(|e| {
44551 format!("error converting supplied value for protocol_fee: {}", e)
44552 });
44553 self
44554 }
44555 }
44556 impl ::std::convert::TryFrom<CreateSwapQuoteResponseFees> for super::CreateSwapQuoteResponseFees {
44557 type Error = super::error::ConversionError;
44558 fn try_from(
44559 value: CreateSwapQuoteResponseFees,
44560 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44561 Ok(Self {
44562 gas_fee: value.gas_fee?,
44563 protocol_fee: value.protocol_fee?,
44564 })
44565 }
44566 }
44567 impl ::std::convert::From<super::CreateSwapQuoteResponseFees> for CreateSwapQuoteResponseFees {
44568 fn from(value: super::CreateSwapQuoteResponseFees) -> Self {
44569 Self {
44570 gas_fee: Ok(value.gas_fee),
44571 protocol_fee: Ok(value.protocol_fee),
44572 }
44573 }
44574 }
44575 #[derive(Clone, Debug)]
44576 pub struct CreateSwapQuoteResponseIssues {
44577 allowance: ::std::result::Result<
44578 ::std::option::Option<super::CreateSwapQuoteResponseIssuesAllowance>,
44579 ::std::string::String,
44580 >,
44581 balance: ::std::result::Result<
44582 ::std::option::Option<super::CreateSwapQuoteResponseIssuesBalance>,
44583 ::std::string::String,
44584 >,
44585 simulation_incomplete: ::std::result::Result<bool, ::std::string::String>,
44586 }
44587 impl ::std::default::Default for CreateSwapQuoteResponseIssues {
44588 fn default() -> Self {
44589 Self {
44590 allowance: Err("no value supplied for allowance".to_string()),
44591 balance: Err("no value supplied for balance".to_string()),
44592 simulation_incomplete: Err(
44593 "no value supplied for simulation_incomplete".to_string()
44594 ),
44595 }
44596 }
44597 }
44598 impl CreateSwapQuoteResponseIssues {
44599 pub fn allowance<T>(mut self, value: T) -> Self
44600 where
44601 T: ::std::convert::TryInto<
44602 ::std::option::Option<super::CreateSwapQuoteResponseIssuesAllowance>,
44603 >,
44604 T::Error: ::std::fmt::Display,
44605 {
44606 self.allowance = value
44607 .try_into()
44608 .map_err(|e| format!("error converting supplied value for allowance: {}", e));
44609 self
44610 }
44611 pub fn balance<T>(mut self, value: T) -> Self
44612 where
44613 T: ::std::convert::TryInto<
44614 ::std::option::Option<super::CreateSwapQuoteResponseIssuesBalance>,
44615 >,
44616 T::Error: ::std::fmt::Display,
44617 {
44618 self.balance = value
44619 .try_into()
44620 .map_err(|e| format!("error converting supplied value for balance: {}", e));
44621 self
44622 }
44623 pub fn simulation_incomplete<T>(mut self, value: T) -> Self
44624 where
44625 T: ::std::convert::TryInto<bool>,
44626 T::Error: ::std::fmt::Display,
44627 {
44628 self.simulation_incomplete = value.try_into().map_err(|e| {
44629 format!(
44630 "error converting supplied value for simulation_incomplete: {}",
44631 e
44632 )
44633 });
44634 self
44635 }
44636 }
44637 impl ::std::convert::TryFrom<CreateSwapQuoteResponseIssues>
44638 for super::CreateSwapQuoteResponseIssues
44639 {
44640 type Error = super::error::ConversionError;
44641 fn try_from(
44642 value: CreateSwapQuoteResponseIssues,
44643 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44644 Ok(Self {
44645 allowance: value.allowance?,
44646 balance: value.balance?,
44647 simulation_incomplete: value.simulation_incomplete?,
44648 })
44649 }
44650 }
44651 impl ::std::convert::From<super::CreateSwapQuoteResponseIssues> for CreateSwapQuoteResponseIssues {
44652 fn from(value: super::CreateSwapQuoteResponseIssues) -> Self {
44653 Self {
44654 allowance: Ok(value.allowance),
44655 balance: Ok(value.balance),
44656 simulation_incomplete: Ok(value.simulation_incomplete),
44657 }
44658 }
44659 }
44660 #[derive(Clone, Debug)]
44661 pub struct CreateSwapQuoteResponseIssuesAllowance {
44662 current_allowance: ::std::result::Result<
44663 super::CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance,
44664 ::std::string::String,
44665 >,
44666 spender: ::std::result::Result<
44667 super::CreateSwapQuoteResponseIssuesAllowanceSpender,
44668 ::std::string::String,
44669 >,
44670 }
44671 impl ::std::default::Default for CreateSwapQuoteResponseIssuesAllowance {
44672 fn default() -> Self {
44673 Self {
44674 current_allowance: Err("no value supplied for current_allowance".to_string()),
44675 spender: Err("no value supplied for spender".to_string()),
44676 }
44677 }
44678 }
44679 impl CreateSwapQuoteResponseIssuesAllowance {
44680 pub fn current_allowance<T>(mut self, value: T) -> Self
44681 where
44682 T: ::std::convert::TryInto<
44683 super::CreateSwapQuoteResponseIssuesAllowanceCurrentAllowance,
44684 >,
44685 T::Error: ::std::fmt::Display,
44686 {
44687 self.current_allowance = value.try_into().map_err(|e| {
44688 format!(
44689 "error converting supplied value for current_allowance: {}",
44690 e
44691 )
44692 });
44693 self
44694 }
44695 pub fn spender<T>(mut self, value: T) -> Self
44696 where
44697 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseIssuesAllowanceSpender>,
44698 T::Error: ::std::fmt::Display,
44699 {
44700 self.spender = value
44701 .try_into()
44702 .map_err(|e| format!("error converting supplied value for spender: {}", e));
44703 self
44704 }
44705 }
44706 impl ::std::convert::TryFrom<CreateSwapQuoteResponseIssuesAllowance>
44707 for super::CreateSwapQuoteResponseIssuesAllowance
44708 {
44709 type Error = super::error::ConversionError;
44710 fn try_from(
44711 value: CreateSwapQuoteResponseIssuesAllowance,
44712 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44713 Ok(Self {
44714 current_allowance: value.current_allowance?,
44715 spender: value.spender?,
44716 })
44717 }
44718 }
44719 impl ::std::convert::From<super::CreateSwapQuoteResponseIssuesAllowance>
44720 for CreateSwapQuoteResponseIssuesAllowance
44721 {
44722 fn from(value: super::CreateSwapQuoteResponseIssuesAllowance) -> Self {
44723 Self {
44724 current_allowance: Ok(value.current_allowance),
44725 spender: Ok(value.spender),
44726 }
44727 }
44728 }
44729 #[derive(Clone, Debug)]
44730 pub struct CreateSwapQuoteResponseIssuesBalance {
44731 current_balance: ::std::result::Result<
44732 super::CreateSwapQuoteResponseIssuesBalanceCurrentBalance,
44733 ::std::string::String,
44734 >,
44735 required_balance: ::std::result::Result<
44736 super::CreateSwapQuoteResponseIssuesBalanceRequiredBalance,
44737 ::std::string::String,
44738 >,
44739 token: ::std::result::Result<
44740 super::CreateSwapQuoteResponseIssuesBalanceToken,
44741 ::std::string::String,
44742 >,
44743 }
44744 impl ::std::default::Default for CreateSwapQuoteResponseIssuesBalance {
44745 fn default() -> Self {
44746 Self {
44747 current_balance: Err("no value supplied for current_balance".to_string()),
44748 required_balance: Err("no value supplied for required_balance".to_string()),
44749 token: Err("no value supplied for token".to_string()),
44750 }
44751 }
44752 }
44753 impl CreateSwapQuoteResponseIssuesBalance {
44754 pub fn current_balance<T>(mut self, value: T) -> Self
44755 where
44756 T: ::std::convert::TryInto<
44757 super::CreateSwapQuoteResponseIssuesBalanceCurrentBalance,
44758 >,
44759 T::Error: ::std::fmt::Display,
44760 {
44761 self.current_balance = value.try_into().map_err(|e| {
44762 format!("error converting supplied value for current_balance: {}", e)
44763 });
44764 self
44765 }
44766 pub fn required_balance<T>(mut self, value: T) -> Self
44767 where
44768 T: ::std::convert::TryInto<
44769 super::CreateSwapQuoteResponseIssuesBalanceRequiredBalance,
44770 >,
44771 T::Error: ::std::fmt::Display,
44772 {
44773 self.required_balance = value.try_into().map_err(|e| {
44774 format!(
44775 "error converting supplied value for required_balance: {}",
44776 e
44777 )
44778 });
44779 self
44780 }
44781 pub fn token<T>(mut self, value: T) -> Self
44782 where
44783 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseIssuesBalanceToken>,
44784 T::Error: ::std::fmt::Display,
44785 {
44786 self.token = value
44787 .try_into()
44788 .map_err(|e| format!("error converting supplied value for token: {}", e));
44789 self
44790 }
44791 }
44792 impl ::std::convert::TryFrom<CreateSwapQuoteResponseIssuesBalance>
44793 for super::CreateSwapQuoteResponseIssuesBalance
44794 {
44795 type Error = super::error::ConversionError;
44796 fn try_from(
44797 value: CreateSwapQuoteResponseIssuesBalance,
44798 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44799 Ok(Self {
44800 current_balance: value.current_balance?,
44801 required_balance: value.required_balance?,
44802 token: value.token?,
44803 })
44804 }
44805 }
44806 impl ::std::convert::From<super::CreateSwapQuoteResponseIssuesBalance>
44807 for CreateSwapQuoteResponseIssuesBalance
44808 {
44809 fn from(value: super::CreateSwapQuoteResponseIssuesBalance) -> Self {
44810 Self {
44811 current_balance: Ok(value.current_balance),
44812 required_balance: Ok(value.required_balance),
44813 token: Ok(value.token),
44814 }
44815 }
44816 }
44817 #[derive(Clone, Debug)]
44818 pub struct CreateSwapQuoteResponsePermit2 {
44819 eip712: ::std::result::Result<super::Eip712Message, ::std::string::String>,
44820 hash: ::std::result::Result<
44821 super::CreateSwapQuoteResponsePermit2Hash,
44822 ::std::string::String,
44823 >,
44824 }
44825 impl ::std::default::Default for CreateSwapQuoteResponsePermit2 {
44826 fn default() -> Self {
44827 Self {
44828 eip712: Err("no value supplied for eip712".to_string()),
44829 hash: Err("no value supplied for hash".to_string()),
44830 }
44831 }
44832 }
44833 impl CreateSwapQuoteResponsePermit2 {
44834 pub fn eip712<T>(mut self, value: T) -> Self
44835 where
44836 T: ::std::convert::TryInto<super::Eip712Message>,
44837 T::Error: ::std::fmt::Display,
44838 {
44839 self.eip712 = value
44840 .try_into()
44841 .map_err(|e| format!("error converting supplied value for eip712: {}", e));
44842 self
44843 }
44844 pub fn hash<T>(mut self, value: T) -> Self
44845 where
44846 T: ::std::convert::TryInto<super::CreateSwapQuoteResponsePermit2Hash>,
44847 T::Error: ::std::fmt::Display,
44848 {
44849 self.hash = value
44850 .try_into()
44851 .map_err(|e| format!("error converting supplied value for hash: {}", e));
44852 self
44853 }
44854 }
44855 impl ::std::convert::TryFrom<CreateSwapQuoteResponsePermit2>
44856 for super::CreateSwapQuoteResponsePermit2
44857 {
44858 type Error = super::error::ConversionError;
44859 fn try_from(
44860 value: CreateSwapQuoteResponsePermit2,
44861 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44862 Ok(Self {
44863 eip712: value.eip712?,
44864 hash: value.hash?,
44865 })
44866 }
44867 }
44868 impl ::std::convert::From<super::CreateSwapQuoteResponsePermit2>
44869 for CreateSwapQuoteResponsePermit2
44870 {
44871 fn from(value: super::CreateSwapQuoteResponsePermit2) -> Self {
44872 Self {
44873 eip712: Ok(value.eip712),
44874 hash: Ok(value.hash),
44875 }
44876 }
44877 }
44878 #[derive(Clone, Debug)]
44879 pub struct CreateSwapQuoteResponseTransaction {
44880 data: ::std::result::Result<::std::string::String, ::std::string::String>,
44881 gas: ::std::result::Result<
44882 super::CreateSwapQuoteResponseTransactionGas,
44883 ::std::string::String,
44884 >,
44885 gas_price: ::std::result::Result<
44886 super::CreateSwapQuoteResponseTransactionGasPrice,
44887 ::std::string::String,
44888 >,
44889 to: ::std::result::Result<
44890 super::CreateSwapQuoteResponseTransactionTo,
44891 ::std::string::String,
44892 >,
44893 value: ::std::result::Result<
44894 super::CreateSwapQuoteResponseTransactionValue,
44895 ::std::string::String,
44896 >,
44897 }
44898 impl ::std::default::Default for CreateSwapQuoteResponseTransaction {
44899 fn default() -> Self {
44900 Self {
44901 data: Err("no value supplied for data".to_string()),
44902 gas: Err("no value supplied for gas".to_string()),
44903 gas_price: Err("no value supplied for gas_price".to_string()),
44904 to: Err("no value supplied for to".to_string()),
44905 value: Err("no value supplied for value".to_string()),
44906 }
44907 }
44908 }
44909 impl CreateSwapQuoteResponseTransaction {
44910 pub fn data<T>(mut self, value: T) -> Self
44911 where
44912 T: ::std::convert::TryInto<::std::string::String>,
44913 T::Error: ::std::fmt::Display,
44914 {
44915 self.data = value
44916 .try_into()
44917 .map_err(|e| format!("error converting supplied value for data: {}", e));
44918 self
44919 }
44920 pub fn gas<T>(mut self, value: T) -> Self
44921 where
44922 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseTransactionGas>,
44923 T::Error: ::std::fmt::Display,
44924 {
44925 self.gas = value
44926 .try_into()
44927 .map_err(|e| format!("error converting supplied value for gas: {}", e));
44928 self
44929 }
44930 pub fn gas_price<T>(mut self, value: T) -> Self
44931 where
44932 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseTransactionGasPrice>,
44933 T::Error: ::std::fmt::Display,
44934 {
44935 self.gas_price = value
44936 .try_into()
44937 .map_err(|e| format!("error converting supplied value for gas_price: {}", e));
44938 self
44939 }
44940 pub fn to<T>(mut self, value: T) -> Self
44941 where
44942 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseTransactionTo>,
44943 T::Error: ::std::fmt::Display,
44944 {
44945 self.to = value
44946 .try_into()
44947 .map_err(|e| format!("error converting supplied value for to: {}", e));
44948 self
44949 }
44950 pub fn value<T>(mut self, value: T) -> Self
44951 where
44952 T: ::std::convert::TryInto<super::CreateSwapQuoteResponseTransactionValue>,
44953 T::Error: ::std::fmt::Display,
44954 {
44955 self.value = value
44956 .try_into()
44957 .map_err(|e| format!("error converting supplied value for value: {}", e));
44958 self
44959 }
44960 }
44961 impl ::std::convert::TryFrom<CreateSwapQuoteResponseTransaction>
44962 for super::CreateSwapQuoteResponseTransaction
44963 {
44964 type Error = super::error::ConversionError;
44965 fn try_from(
44966 value: CreateSwapQuoteResponseTransaction,
44967 ) -> ::std::result::Result<Self, super::error::ConversionError> {
44968 Ok(Self {
44969 data: value.data?,
44970 gas: value.gas?,
44971 gas_price: value.gas_price?,
44972 to: value.to?,
44973 value: value.value?,
44974 })
44975 }
44976 }
44977 impl ::std::convert::From<super::CreateSwapQuoteResponseTransaction>
44978 for CreateSwapQuoteResponseTransaction
44979 {
44980 fn from(value: super::CreateSwapQuoteResponseTransaction) -> Self {
44981 Self {
44982 data: Ok(value.data),
44983 gas: Ok(value.gas),
44984 gas_price: Ok(value.gas_price),
44985 to: Ok(value.to),
44986 value: Ok(value.value),
44987 }
44988 }
44989 }
44990 #[derive(Clone, Debug)]
44991 pub struct DeveloperJwtAuthentication {
44992 kid: ::std::result::Result<::std::string::String, ::std::string::String>,
44993 sub: ::std::result::Result<::std::string::String, ::std::string::String>,
44994 type_:
44995 ::std::result::Result<super::DeveloperJwtAuthenticationType, ::std::string::String>,
44996 }
44997 impl ::std::default::Default for DeveloperJwtAuthentication {
44998 fn default() -> Self {
44999 Self {
45000 kid: Err("no value supplied for kid".to_string()),
45001 sub: Err("no value supplied for sub".to_string()),
45002 type_: Err("no value supplied for type_".to_string()),
45003 }
45004 }
45005 }
45006 impl DeveloperJwtAuthentication {
45007 pub fn kid<T>(mut self, value: T) -> Self
45008 where
45009 T: ::std::convert::TryInto<::std::string::String>,
45010 T::Error: ::std::fmt::Display,
45011 {
45012 self.kid = value
45013 .try_into()
45014 .map_err(|e| format!("error converting supplied value for kid: {}", e));
45015 self
45016 }
45017 pub fn sub<T>(mut self, value: T) -> Self
45018 where
45019 T: ::std::convert::TryInto<::std::string::String>,
45020 T::Error: ::std::fmt::Display,
45021 {
45022 self.sub = value
45023 .try_into()
45024 .map_err(|e| format!("error converting supplied value for sub: {}", e));
45025 self
45026 }
45027 pub fn type_<T>(mut self, value: T) -> Self
45028 where
45029 T: ::std::convert::TryInto<super::DeveloperJwtAuthenticationType>,
45030 T::Error: ::std::fmt::Display,
45031 {
45032 self.type_ = value
45033 .try_into()
45034 .map_err(|e| format!("error converting supplied value for type_: {}", e));
45035 self
45036 }
45037 }
45038 impl ::std::convert::TryFrom<DeveloperJwtAuthentication> for super::DeveloperJwtAuthentication {
45039 type Error = super::error::ConversionError;
45040 fn try_from(
45041 value: DeveloperJwtAuthentication,
45042 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45043 Ok(Self {
45044 kid: value.kid?,
45045 sub: value.sub?,
45046 type_: value.type_?,
45047 })
45048 }
45049 }
45050 impl ::std::convert::From<super::DeveloperJwtAuthentication> for DeveloperJwtAuthentication {
45051 fn from(value: super::DeveloperJwtAuthentication) -> Self {
45052 Self {
45053 kid: Ok(value.kid),
45054 sub: Ok(value.sub),
45055 type_: Ok(value.type_),
45056 }
45057 }
45058 }
45059 #[derive(Clone, Debug)]
45060 pub struct Eip712Domain {
45061 chain_id: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
45062 name: ::std::result::Result<
45063 ::std::option::Option<::std::string::String>,
45064 ::std::string::String,
45065 >,
45066 salt: ::std::result::Result<
45067 ::std::option::Option<super::Eip712DomainSalt>,
45068 ::std::string::String,
45069 >,
45070 verifying_contract: ::std::result::Result<
45071 ::std::option::Option<super::Eip712DomainVerifyingContract>,
45072 ::std::string::String,
45073 >,
45074 version: ::std::result::Result<
45075 ::std::option::Option<::std::string::String>,
45076 ::std::string::String,
45077 >,
45078 }
45079 impl ::std::default::Default for Eip712Domain {
45080 fn default() -> Self {
45081 Self {
45082 chain_id: Ok(Default::default()),
45083 name: Ok(Default::default()),
45084 salt: Ok(Default::default()),
45085 verifying_contract: Ok(Default::default()),
45086 version: Ok(Default::default()),
45087 }
45088 }
45089 }
45090 impl Eip712Domain {
45091 pub fn chain_id<T>(mut self, value: T) -> Self
45092 where
45093 T: ::std::convert::TryInto<::std::option::Option<i64>>,
45094 T::Error: ::std::fmt::Display,
45095 {
45096 self.chain_id = value
45097 .try_into()
45098 .map_err(|e| format!("error converting supplied value for chain_id: {}", e));
45099 self
45100 }
45101 pub fn name<T>(mut self, value: T) -> Self
45102 where
45103 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
45104 T::Error: ::std::fmt::Display,
45105 {
45106 self.name = value
45107 .try_into()
45108 .map_err(|e| format!("error converting supplied value for name: {}", e));
45109 self
45110 }
45111 pub fn salt<T>(mut self, value: T) -> Self
45112 where
45113 T: ::std::convert::TryInto<::std::option::Option<super::Eip712DomainSalt>>,
45114 T::Error: ::std::fmt::Display,
45115 {
45116 self.salt = value
45117 .try_into()
45118 .map_err(|e| format!("error converting supplied value for salt: {}", e));
45119 self
45120 }
45121 pub fn verifying_contract<T>(mut self, value: T) -> Self
45122 where
45123 T: ::std::convert::TryInto<
45124 ::std::option::Option<super::Eip712DomainVerifyingContract>,
45125 >,
45126 T::Error: ::std::fmt::Display,
45127 {
45128 self.verifying_contract = value.try_into().map_err(|e| {
45129 format!(
45130 "error converting supplied value for verifying_contract: {}",
45131 e
45132 )
45133 });
45134 self
45135 }
45136 pub fn version<T>(mut self, value: T) -> Self
45137 where
45138 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
45139 T::Error: ::std::fmt::Display,
45140 {
45141 self.version = value
45142 .try_into()
45143 .map_err(|e| format!("error converting supplied value for version: {}", e));
45144 self
45145 }
45146 }
45147 impl ::std::convert::TryFrom<Eip712Domain> for super::Eip712Domain {
45148 type Error = super::error::ConversionError;
45149 fn try_from(
45150 value: Eip712Domain,
45151 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45152 Ok(Self {
45153 chain_id: value.chain_id?,
45154 name: value.name?,
45155 salt: value.salt?,
45156 verifying_contract: value.verifying_contract?,
45157 version: value.version?,
45158 })
45159 }
45160 }
45161 impl ::std::convert::From<super::Eip712Domain> for Eip712Domain {
45162 fn from(value: super::Eip712Domain) -> Self {
45163 Self {
45164 chain_id: Ok(value.chain_id),
45165 name: Ok(value.name),
45166 salt: Ok(value.salt),
45167 verifying_contract: Ok(value.verifying_contract),
45168 version: Ok(value.version),
45169 }
45170 }
45171 }
45172 #[derive(Clone, Debug)]
45173 pub struct Eip712Message {
45174 domain: ::std::result::Result<super::Eip712Domain, ::std::string::String>,
45175 message: ::std::result::Result<
45176 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
45177 ::std::string::String,
45178 >,
45179 primary_type: ::std::result::Result<::std::string::String, ::std::string::String>,
45180 types: ::std::result::Result<super::Eip712Types, ::std::string::String>,
45181 }
45182 impl ::std::default::Default for Eip712Message {
45183 fn default() -> Self {
45184 Self {
45185 domain: Err("no value supplied for domain".to_string()),
45186 message: Err("no value supplied for message".to_string()),
45187 primary_type: Err("no value supplied for primary_type".to_string()),
45188 types: Err("no value supplied for types".to_string()),
45189 }
45190 }
45191 }
45192 impl Eip712Message {
45193 pub fn domain<T>(mut self, value: T) -> Self
45194 where
45195 T: ::std::convert::TryInto<super::Eip712Domain>,
45196 T::Error: ::std::fmt::Display,
45197 {
45198 self.domain = value
45199 .try_into()
45200 .map_err(|e| format!("error converting supplied value for domain: {}", e));
45201 self
45202 }
45203 pub fn message<T>(mut self, value: T) -> Self
45204 where
45205 T: ::std::convert::TryInto<
45206 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
45207 >,
45208 T::Error: ::std::fmt::Display,
45209 {
45210 self.message = value
45211 .try_into()
45212 .map_err(|e| format!("error converting supplied value for message: {}", e));
45213 self
45214 }
45215 pub fn primary_type<T>(mut self, value: T) -> Self
45216 where
45217 T: ::std::convert::TryInto<::std::string::String>,
45218 T::Error: ::std::fmt::Display,
45219 {
45220 self.primary_type = value.try_into().map_err(|e| {
45221 format!("error converting supplied value for primary_type: {}", e)
45222 });
45223 self
45224 }
45225 pub fn types<T>(mut self, value: T) -> Self
45226 where
45227 T: ::std::convert::TryInto<super::Eip712Types>,
45228 T::Error: ::std::fmt::Display,
45229 {
45230 self.types = value
45231 .try_into()
45232 .map_err(|e| format!("error converting supplied value for types: {}", e));
45233 self
45234 }
45235 }
45236 impl ::std::convert::TryFrom<Eip712Message> for super::Eip712Message {
45237 type Error = super::error::ConversionError;
45238 fn try_from(
45239 value: Eip712Message,
45240 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45241 Ok(Self {
45242 domain: value.domain?,
45243 message: value.message?,
45244 primary_type: value.primary_type?,
45245 types: value.types?,
45246 })
45247 }
45248 }
45249 impl ::std::convert::From<super::Eip712Message> for Eip712Message {
45250 fn from(value: super::Eip712Message) -> Self {
45251 Self {
45252 domain: Ok(value.domain),
45253 message: Ok(value.message),
45254 primary_type: Ok(value.primary_type),
45255 types: Ok(value.types),
45256 }
45257 }
45258 }
45259 #[derive(Clone, Debug)]
45260 pub struct EmailAuthentication {
45261 email: ::std::result::Result<::std::string::String, ::std::string::String>,
45262 type_: ::std::result::Result<super::EmailAuthenticationType, ::std::string::String>,
45263 }
45264 impl ::std::default::Default for EmailAuthentication {
45265 fn default() -> Self {
45266 Self {
45267 email: Err("no value supplied for email".to_string()),
45268 type_: Err("no value supplied for type_".to_string()),
45269 }
45270 }
45271 }
45272 impl EmailAuthentication {
45273 pub fn email<T>(mut self, value: T) -> Self
45274 where
45275 T: ::std::convert::TryInto<::std::string::String>,
45276 T::Error: ::std::fmt::Display,
45277 {
45278 self.email = value
45279 .try_into()
45280 .map_err(|e| format!("error converting supplied value for email: {}", e));
45281 self
45282 }
45283 pub fn type_<T>(mut self, value: T) -> Self
45284 where
45285 T: ::std::convert::TryInto<super::EmailAuthenticationType>,
45286 T::Error: ::std::fmt::Display,
45287 {
45288 self.type_ = value
45289 .try_into()
45290 .map_err(|e| format!("error converting supplied value for type_: {}", e));
45291 self
45292 }
45293 }
45294 impl ::std::convert::TryFrom<EmailAuthentication> for super::EmailAuthentication {
45295 type Error = super::error::ConversionError;
45296 fn try_from(
45297 value: EmailAuthentication,
45298 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45299 Ok(Self {
45300 email: value.email?,
45301 type_: value.type_?,
45302 })
45303 }
45304 }
45305 impl ::std::convert::From<super::EmailAuthentication> for EmailAuthentication {
45306 fn from(value: super::EmailAuthentication) -> Self {
45307 Self {
45308 email: Ok(value.email),
45309 type_: Ok(value.type_),
45310 }
45311 }
45312 }
45313 #[derive(Clone, Debug)]
45314 pub struct EndUser {
45315 authentication_methods:
45316 ::std::result::Result<super::AuthenticationMethods, ::std::string::String>,
45317 created_at: ::std::result::Result<
45318 ::chrono::DateTime<::chrono::offset::Utc>,
45319 ::std::string::String,
45320 >,
45321 evm_account_objects: ::std::result::Result<
45322 ::std::vec::Vec<super::EndUserEvmAccount>,
45323 ::std::string::String,
45324 >,
45325 evm_accounts: ::std::result::Result<
45326 ::std::vec::Vec<super::EndUserEvmAccountsItem>,
45327 ::std::string::String,
45328 >,
45329 evm_smart_account_objects: ::std::result::Result<
45330 ::std::vec::Vec<super::EndUserEvmSmartAccount>,
45331 ::std::string::String,
45332 >,
45333 evm_smart_accounts: ::std::result::Result<
45334 ::std::vec::Vec<super::EndUserEvmSmartAccountsItem>,
45335 ::std::string::String,
45336 >,
45337 solana_account_objects: ::std::result::Result<
45338 ::std::vec::Vec<super::EndUserSolanaAccount>,
45339 ::std::string::String,
45340 >,
45341 solana_accounts: ::std::result::Result<
45342 ::std::vec::Vec<super::EndUserSolanaAccountsItem>,
45343 ::std::string::String,
45344 >,
45345 user_id: ::std::result::Result<super::EndUserUserId, ::std::string::String>,
45346 }
45347 impl ::std::default::Default for EndUser {
45348 fn default() -> Self {
45349 Self {
45350 authentication_methods: Err(
45351 "no value supplied for authentication_methods".to_string()
45352 ),
45353 created_at: Err("no value supplied for created_at".to_string()),
45354 evm_account_objects: Err(
45355 "no value supplied for evm_account_objects".to_string()
45356 ),
45357 evm_accounts: Err("no value supplied for evm_accounts".to_string()),
45358 evm_smart_account_objects: Err(
45359 "no value supplied for evm_smart_account_objects".to_string(),
45360 ),
45361 evm_smart_accounts: Err("no value supplied for evm_smart_accounts".to_string()),
45362 solana_account_objects: Err(
45363 "no value supplied for solana_account_objects".to_string()
45364 ),
45365 solana_accounts: Err("no value supplied for solana_accounts".to_string()),
45366 user_id: Err("no value supplied for user_id".to_string()),
45367 }
45368 }
45369 }
45370 impl EndUser {
45371 pub fn authentication_methods<T>(mut self, value: T) -> Self
45372 where
45373 T: ::std::convert::TryInto<super::AuthenticationMethods>,
45374 T::Error: ::std::fmt::Display,
45375 {
45376 self.authentication_methods = value.try_into().map_err(|e| {
45377 format!(
45378 "error converting supplied value for authentication_methods: {}",
45379 e
45380 )
45381 });
45382 self
45383 }
45384 pub fn created_at<T>(mut self, value: T) -> Self
45385 where
45386 T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
45387 T::Error: ::std::fmt::Display,
45388 {
45389 self.created_at = value
45390 .try_into()
45391 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
45392 self
45393 }
45394 pub fn evm_account_objects<T>(mut self, value: T) -> Self
45395 where
45396 T: ::std::convert::TryInto<::std::vec::Vec<super::EndUserEvmAccount>>,
45397 T::Error: ::std::fmt::Display,
45398 {
45399 self.evm_account_objects = value.try_into().map_err(|e| {
45400 format!(
45401 "error converting supplied value for evm_account_objects: {}",
45402 e
45403 )
45404 });
45405 self
45406 }
45407 pub fn evm_accounts<T>(mut self, value: T) -> Self
45408 where
45409 T: ::std::convert::TryInto<::std::vec::Vec<super::EndUserEvmAccountsItem>>,
45410 T::Error: ::std::fmt::Display,
45411 {
45412 self.evm_accounts = value.try_into().map_err(|e| {
45413 format!("error converting supplied value for evm_accounts: {}", e)
45414 });
45415 self
45416 }
45417 pub fn evm_smart_account_objects<T>(mut self, value: T) -> Self
45418 where
45419 T: ::std::convert::TryInto<::std::vec::Vec<super::EndUserEvmSmartAccount>>,
45420 T::Error: ::std::fmt::Display,
45421 {
45422 self.evm_smart_account_objects = value.try_into().map_err(|e| {
45423 format!(
45424 "error converting supplied value for evm_smart_account_objects: {}",
45425 e
45426 )
45427 });
45428 self
45429 }
45430 pub fn evm_smart_accounts<T>(mut self, value: T) -> Self
45431 where
45432 T: ::std::convert::TryInto<::std::vec::Vec<super::EndUserEvmSmartAccountsItem>>,
45433 T::Error: ::std::fmt::Display,
45434 {
45435 self.evm_smart_accounts = value.try_into().map_err(|e| {
45436 format!(
45437 "error converting supplied value for evm_smart_accounts: {}",
45438 e
45439 )
45440 });
45441 self
45442 }
45443 pub fn solana_account_objects<T>(mut self, value: T) -> Self
45444 where
45445 T: ::std::convert::TryInto<::std::vec::Vec<super::EndUserSolanaAccount>>,
45446 T::Error: ::std::fmt::Display,
45447 {
45448 self.solana_account_objects = value.try_into().map_err(|e| {
45449 format!(
45450 "error converting supplied value for solana_account_objects: {}",
45451 e
45452 )
45453 });
45454 self
45455 }
45456 pub fn solana_accounts<T>(mut self, value: T) -> Self
45457 where
45458 T: ::std::convert::TryInto<::std::vec::Vec<super::EndUserSolanaAccountsItem>>,
45459 T::Error: ::std::fmt::Display,
45460 {
45461 self.solana_accounts = value.try_into().map_err(|e| {
45462 format!("error converting supplied value for solana_accounts: {}", e)
45463 });
45464 self
45465 }
45466 pub fn user_id<T>(mut self, value: T) -> Self
45467 where
45468 T: ::std::convert::TryInto<super::EndUserUserId>,
45469 T::Error: ::std::fmt::Display,
45470 {
45471 self.user_id = value
45472 .try_into()
45473 .map_err(|e| format!("error converting supplied value for user_id: {}", e));
45474 self
45475 }
45476 }
45477 impl ::std::convert::TryFrom<EndUser> for super::EndUser {
45478 type Error = super::error::ConversionError;
45479 fn try_from(
45480 value: EndUser,
45481 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45482 Ok(Self {
45483 authentication_methods: value.authentication_methods?,
45484 created_at: value.created_at?,
45485 evm_account_objects: value.evm_account_objects?,
45486 evm_accounts: value.evm_accounts?,
45487 evm_smart_account_objects: value.evm_smart_account_objects?,
45488 evm_smart_accounts: value.evm_smart_accounts?,
45489 solana_account_objects: value.solana_account_objects?,
45490 solana_accounts: value.solana_accounts?,
45491 user_id: value.user_id?,
45492 })
45493 }
45494 }
45495 impl ::std::convert::From<super::EndUser> for EndUser {
45496 fn from(value: super::EndUser) -> Self {
45497 Self {
45498 authentication_methods: Ok(value.authentication_methods),
45499 created_at: Ok(value.created_at),
45500 evm_account_objects: Ok(value.evm_account_objects),
45501 evm_accounts: Ok(value.evm_accounts),
45502 evm_smart_account_objects: Ok(value.evm_smart_account_objects),
45503 evm_smart_accounts: Ok(value.evm_smart_accounts),
45504 solana_account_objects: Ok(value.solana_account_objects),
45505 solana_accounts: Ok(value.solana_accounts),
45506 user_id: Ok(value.user_id),
45507 }
45508 }
45509 }
45510 #[derive(Clone, Debug)]
45511 pub struct EndUserEvmAccount {
45512 address: ::std::result::Result<super::EndUserEvmAccountAddress, ::std::string::String>,
45513 created_at: ::std::result::Result<
45514 ::chrono::DateTime<::chrono::offset::Utc>,
45515 ::std::string::String,
45516 >,
45517 }
45518 impl ::std::default::Default for EndUserEvmAccount {
45519 fn default() -> Self {
45520 Self {
45521 address: Err("no value supplied for address".to_string()),
45522 created_at: Err("no value supplied for created_at".to_string()),
45523 }
45524 }
45525 }
45526 impl EndUserEvmAccount {
45527 pub fn address<T>(mut self, value: T) -> Self
45528 where
45529 T: ::std::convert::TryInto<super::EndUserEvmAccountAddress>,
45530 T::Error: ::std::fmt::Display,
45531 {
45532 self.address = value
45533 .try_into()
45534 .map_err(|e| format!("error converting supplied value for address: {}", e));
45535 self
45536 }
45537 pub fn created_at<T>(mut self, value: T) -> Self
45538 where
45539 T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
45540 T::Error: ::std::fmt::Display,
45541 {
45542 self.created_at = value
45543 .try_into()
45544 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
45545 self
45546 }
45547 }
45548 impl ::std::convert::TryFrom<EndUserEvmAccount> for super::EndUserEvmAccount {
45549 type Error = super::error::ConversionError;
45550 fn try_from(
45551 value: EndUserEvmAccount,
45552 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45553 Ok(Self {
45554 address: value.address?,
45555 created_at: value.created_at?,
45556 })
45557 }
45558 }
45559 impl ::std::convert::From<super::EndUserEvmAccount> for EndUserEvmAccount {
45560 fn from(value: super::EndUserEvmAccount) -> Self {
45561 Self {
45562 address: Ok(value.address),
45563 created_at: Ok(value.created_at),
45564 }
45565 }
45566 }
45567 #[derive(Clone, Debug)]
45568 pub struct EndUserEvmSmartAccount {
45569 address:
45570 ::std::result::Result<super::EndUserEvmSmartAccountAddress, ::std::string::String>,
45571 created_at: ::std::result::Result<
45572 ::chrono::DateTime<::chrono::offset::Utc>,
45573 ::std::string::String,
45574 >,
45575 owner_addresses: ::std::result::Result<
45576 ::std::vec::Vec<super::EndUserEvmSmartAccountOwnerAddressesItem>,
45577 ::std::string::String,
45578 >,
45579 }
45580 impl ::std::default::Default for EndUserEvmSmartAccount {
45581 fn default() -> Self {
45582 Self {
45583 address: Err("no value supplied for address".to_string()),
45584 created_at: Err("no value supplied for created_at".to_string()),
45585 owner_addresses: Err("no value supplied for owner_addresses".to_string()),
45586 }
45587 }
45588 }
45589 impl EndUserEvmSmartAccount {
45590 pub fn address<T>(mut self, value: T) -> Self
45591 where
45592 T: ::std::convert::TryInto<super::EndUserEvmSmartAccountAddress>,
45593 T::Error: ::std::fmt::Display,
45594 {
45595 self.address = value
45596 .try_into()
45597 .map_err(|e| format!("error converting supplied value for address: {}", e));
45598 self
45599 }
45600 pub fn created_at<T>(mut self, value: T) -> Self
45601 where
45602 T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
45603 T::Error: ::std::fmt::Display,
45604 {
45605 self.created_at = value
45606 .try_into()
45607 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
45608 self
45609 }
45610 pub fn owner_addresses<T>(mut self, value: T) -> Self
45611 where
45612 T: ::std::convert::TryInto<
45613 ::std::vec::Vec<super::EndUserEvmSmartAccountOwnerAddressesItem>,
45614 >,
45615 T::Error: ::std::fmt::Display,
45616 {
45617 self.owner_addresses = value.try_into().map_err(|e| {
45618 format!("error converting supplied value for owner_addresses: {}", e)
45619 });
45620 self
45621 }
45622 }
45623 impl ::std::convert::TryFrom<EndUserEvmSmartAccount> for super::EndUserEvmSmartAccount {
45624 type Error = super::error::ConversionError;
45625 fn try_from(
45626 value: EndUserEvmSmartAccount,
45627 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45628 Ok(Self {
45629 address: value.address?,
45630 created_at: value.created_at?,
45631 owner_addresses: value.owner_addresses?,
45632 })
45633 }
45634 }
45635 impl ::std::convert::From<super::EndUserEvmSmartAccount> for EndUserEvmSmartAccount {
45636 fn from(value: super::EndUserEvmSmartAccount) -> Self {
45637 Self {
45638 address: Ok(value.address),
45639 created_at: Ok(value.created_at),
45640 owner_addresses: Ok(value.owner_addresses),
45641 }
45642 }
45643 }
45644 #[derive(Clone, Debug)]
45645 pub struct EndUserSolanaAccount {
45646 address:
45647 ::std::result::Result<super::EndUserSolanaAccountAddress, ::std::string::String>,
45648 created_at: ::std::result::Result<
45649 ::chrono::DateTime<::chrono::offset::Utc>,
45650 ::std::string::String,
45651 >,
45652 }
45653 impl ::std::default::Default for EndUserSolanaAccount {
45654 fn default() -> Self {
45655 Self {
45656 address: Err("no value supplied for address".to_string()),
45657 created_at: Err("no value supplied for created_at".to_string()),
45658 }
45659 }
45660 }
45661 impl EndUserSolanaAccount {
45662 pub fn address<T>(mut self, value: T) -> Self
45663 where
45664 T: ::std::convert::TryInto<super::EndUserSolanaAccountAddress>,
45665 T::Error: ::std::fmt::Display,
45666 {
45667 self.address = value
45668 .try_into()
45669 .map_err(|e| format!("error converting supplied value for address: {}", e));
45670 self
45671 }
45672 pub fn created_at<T>(mut self, value: T) -> Self
45673 where
45674 T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
45675 T::Error: ::std::fmt::Display,
45676 {
45677 self.created_at = value
45678 .try_into()
45679 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
45680 self
45681 }
45682 }
45683 impl ::std::convert::TryFrom<EndUserSolanaAccount> for super::EndUserSolanaAccount {
45684 type Error = super::error::ConversionError;
45685 fn try_from(
45686 value: EndUserSolanaAccount,
45687 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45688 Ok(Self {
45689 address: value.address?,
45690 created_at: value.created_at?,
45691 })
45692 }
45693 }
45694 impl ::std::convert::From<super::EndUserSolanaAccount> for EndUserSolanaAccount {
45695 fn from(value: super::EndUserSolanaAccount) -> Self {
45696 Self {
45697 address: Ok(value.address),
45698 created_at: Ok(value.created_at),
45699 }
45700 }
45701 }
45702 #[derive(Clone, Debug)]
45703 pub struct Error {
45704 correlation_id: ::std::result::Result<
45705 ::std::option::Option<::std::string::String>,
45706 ::std::string::String,
45707 >,
45708 error_link:
45709 ::std::result::Result<::std::option::Option<super::Url>, ::std::string::String>,
45710 error_message: ::std::result::Result<::std::string::String, ::std::string::String>,
45711 error_type: ::std::result::Result<super::ErrorType, ::std::string::String>,
45712 }
45713 impl ::std::default::Default for Error {
45714 fn default() -> Self {
45715 Self {
45716 correlation_id: Ok(Default::default()),
45717 error_link: Ok(Default::default()),
45718 error_message: Err("no value supplied for error_message".to_string()),
45719 error_type: Err("no value supplied for error_type".to_string()),
45720 }
45721 }
45722 }
45723 impl Error {
45724 pub fn correlation_id<T>(mut self, value: T) -> Self
45725 where
45726 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
45727 T::Error: ::std::fmt::Display,
45728 {
45729 self.correlation_id = value.try_into().map_err(|e| {
45730 format!("error converting supplied value for correlation_id: {}", e)
45731 });
45732 self
45733 }
45734 pub fn error_link<T>(mut self, value: T) -> Self
45735 where
45736 T: ::std::convert::TryInto<::std::option::Option<super::Url>>,
45737 T::Error: ::std::fmt::Display,
45738 {
45739 self.error_link = value
45740 .try_into()
45741 .map_err(|e| format!("error converting supplied value for error_link: {}", e));
45742 self
45743 }
45744 pub fn error_message<T>(mut self, value: T) -> Self
45745 where
45746 T: ::std::convert::TryInto<::std::string::String>,
45747 T::Error: ::std::fmt::Display,
45748 {
45749 self.error_message = value.try_into().map_err(|e| {
45750 format!("error converting supplied value for error_message: {}", e)
45751 });
45752 self
45753 }
45754 pub fn error_type<T>(mut self, value: T) -> Self
45755 where
45756 T: ::std::convert::TryInto<super::ErrorType>,
45757 T::Error: ::std::fmt::Display,
45758 {
45759 self.error_type = value
45760 .try_into()
45761 .map_err(|e| format!("error converting supplied value for error_type: {}", e));
45762 self
45763 }
45764 }
45765 impl ::std::convert::TryFrom<Error> for super::Error {
45766 type Error = super::error::ConversionError;
45767 fn try_from(
45768 value: Error,
45769 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45770 Ok(Self {
45771 correlation_id: value.correlation_id?,
45772 error_link: value.error_link?,
45773 error_message: value.error_message?,
45774 error_type: value.error_type?,
45775 })
45776 }
45777 }
45778 impl ::std::convert::From<super::Error> for Error {
45779 fn from(value: super::Error) -> Self {
45780 Self {
45781 correlation_id: Ok(value.correlation_id),
45782 error_link: Ok(value.error_link),
45783 error_message: Ok(value.error_message),
45784 error_type: Ok(value.error_type),
45785 }
45786 }
45787 }
45788 #[derive(Clone, Debug)]
45789 pub struct EthValueCriterion {
45790 eth_value:
45791 ::std::result::Result<super::EthValueCriterionEthValue, ::std::string::String>,
45792 operator:
45793 ::std::result::Result<super::EthValueCriterionOperator, ::std::string::String>,
45794 type_: ::std::result::Result<super::EthValueCriterionType, ::std::string::String>,
45795 }
45796 impl ::std::default::Default for EthValueCriterion {
45797 fn default() -> Self {
45798 Self {
45799 eth_value: Err("no value supplied for eth_value".to_string()),
45800 operator: Err("no value supplied for operator".to_string()),
45801 type_: Err("no value supplied for type_".to_string()),
45802 }
45803 }
45804 }
45805 impl EthValueCriterion {
45806 pub fn eth_value<T>(mut self, value: T) -> Self
45807 where
45808 T: ::std::convert::TryInto<super::EthValueCriterionEthValue>,
45809 T::Error: ::std::fmt::Display,
45810 {
45811 self.eth_value = value
45812 .try_into()
45813 .map_err(|e| format!("error converting supplied value for eth_value: {}", e));
45814 self
45815 }
45816 pub fn operator<T>(mut self, value: T) -> Self
45817 where
45818 T: ::std::convert::TryInto<super::EthValueCriterionOperator>,
45819 T::Error: ::std::fmt::Display,
45820 {
45821 self.operator = value
45822 .try_into()
45823 .map_err(|e| format!("error converting supplied value for operator: {}", e));
45824 self
45825 }
45826 pub fn type_<T>(mut self, value: T) -> Self
45827 where
45828 T: ::std::convert::TryInto<super::EthValueCriterionType>,
45829 T::Error: ::std::fmt::Display,
45830 {
45831 self.type_ = value
45832 .try_into()
45833 .map_err(|e| format!("error converting supplied value for type_: {}", e));
45834 self
45835 }
45836 }
45837 impl ::std::convert::TryFrom<EthValueCriterion> for super::EthValueCriterion {
45838 type Error = super::error::ConversionError;
45839 fn try_from(
45840 value: EthValueCriterion,
45841 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45842 Ok(Self {
45843 eth_value: value.eth_value?,
45844 operator: value.operator?,
45845 type_: value.type_?,
45846 })
45847 }
45848 }
45849 impl ::std::convert::From<super::EthValueCriterion> for EthValueCriterion {
45850 fn from(value: super::EthValueCriterion) -> Self {
45851 Self {
45852 eth_value: Ok(value.eth_value),
45853 operator: Ok(value.operator),
45854 type_: Ok(value.type_),
45855 }
45856 }
45857 }
45858 #[derive(Clone, Debug)]
45859 pub struct EvmAccount {
45860 address: ::std::result::Result<super::EvmAccountAddress, ::std::string::String>,
45861 created_at: ::std::result::Result<
45862 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
45863 ::std::string::String,
45864 >,
45865 name: ::std::result::Result<
45866 ::std::option::Option<super::EvmAccountName>,
45867 ::std::string::String,
45868 >,
45869 policies: ::std::result::Result<
45870 ::std::vec::Vec<super::EvmAccountPoliciesItem>,
45871 ::std::string::String,
45872 >,
45873 updated_at: ::std::result::Result<
45874 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
45875 ::std::string::String,
45876 >,
45877 }
45878 impl ::std::default::Default for EvmAccount {
45879 fn default() -> Self {
45880 Self {
45881 address: Err("no value supplied for address".to_string()),
45882 created_at: Ok(Default::default()),
45883 name: Ok(Default::default()),
45884 policies: Ok(Default::default()),
45885 updated_at: Ok(Default::default()),
45886 }
45887 }
45888 }
45889 impl EvmAccount {
45890 pub fn address<T>(mut self, value: T) -> Self
45891 where
45892 T: ::std::convert::TryInto<super::EvmAccountAddress>,
45893 T::Error: ::std::fmt::Display,
45894 {
45895 self.address = value
45896 .try_into()
45897 .map_err(|e| format!("error converting supplied value for address: {}", e));
45898 self
45899 }
45900 pub fn created_at<T>(mut self, value: T) -> Self
45901 where
45902 T: ::std::convert::TryInto<
45903 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
45904 >,
45905 T::Error: ::std::fmt::Display,
45906 {
45907 self.created_at = value
45908 .try_into()
45909 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
45910 self
45911 }
45912 pub fn name<T>(mut self, value: T) -> Self
45913 where
45914 T: ::std::convert::TryInto<::std::option::Option<super::EvmAccountName>>,
45915 T::Error: ::std::fmt::Display,
45916 {
45917 self.name = value
45918 .try_into()
45919 .map_err(|e| format!("error converting supplied value for name: {}", e));
45920 self
45921 }
45922 pub fn policies<T>(mut self, value: T) -> Self
45923 where
45924 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmAccountPoliciesItem>>,
45925 T::Error: ::std::fmt::Display,
45926 {
45927 self.policies = value
45928 .try_into()
45929 .map_err(|e| format!("error converting supplied value for policies: {}", e));
45930 self
45931 }
45932 pub fn updated_at<T>(mut self, value: T) -> Self
45933 where
45934 T: ::std::convert::TryInto<
45935 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
45936 >,
45937 T::Error: ::std::fmt::Display,
45938 {
45939 self.updated_at = value
45940 .try_into()
45941 .map_err(|e| format!("error converting supplied value for updated_at: {}", e));
45942 self
45943 }
45944 }
45945 impl ::std::convert::TryFrom<EvmAccount> for super::EvmAccount {
45946 type Error = super::error::ConversionError;
45947 fn try_from(
45948 value: EvmAccount,
45949 ) -> ::std::result::Result<Self, super::error::ConversionError> {
45950 Ok(Self {
45951 address: value.address?,
45952 created_at: value.created_at?,
45953 name: value.name?,
45954 policies: value.policies?,
45955 updated_at: value.updated_at?,
45956 })
45957 }
45958 }
45959 impl ::std::convert::From<super::EvmAccount> for EvmAccount {
45960 fn from(value: super::EvmAccount) -> Self {
45961 Self {
45962 address: Ok(value.address),
45963 created_at: Ok(value.created_at),
45964 name: Ok(value.name),
45965 policies: Ok(value.policies),
45966 updated_at: Ok(value.updated_at),
45967 }
45968 }
45969 }
45970 #[derive(Clone, Debug)]
45971 pub struct EvmAddressCriterion {
45972 addresses: ::std::result::Result<
45973 ::std::vec::Vec<super::EvmAddressCriterionAddressesItem>,
45974 ::std::string::String,
45975 >,
45976 operator:
45977 ::std::result::Result<super::EvmAddressCriterionOperator, ::std::string::String>,
45978 type_: ::std::result::Result<super::EvmAddressCriterionType, ::std::string::String>,
45979 }
45980 impl ::std::default::Default for EvmAddressCriterion {
45981 fn default() -> Self {
45982 Self {
45983 addresses: Err("no value supplied for addresses".to_string()),
45984 operator: Err("no value supplied for operator".to_string()),
45985 type_: Err("no value supplied for type_".to_string()),
45986 }
45987 }
45988 }
45989 impl EvmAddressCriterion {
45990 pub fn addresses<T>(mut self, value: T) -> Self
45991 where
45992 T: ::std::convert::TryInto<
45993 ::std::vec::Vec<super::EvmAddressCriterionAddressesItem>,
45994 >,
45995 T::Error: ::std::fmt::Display,
45996 {
45997 self.addresses = value
45998 .try_into()
45999 .map_err(|e| format!("error converting supplied value for addresses: {}", e));
46000 self
46001 }
46002 pub fn operator<T>(mut self, value: T) -> Self
46003 where
46004 T: ::std::convert::TryInto<super::EvmAddressCriterionOperator>,
46005 T::Error: ::std::fmt::Display,
46006 {
46007 self.operator = value
46008 .try_into()
46009 .map_err(|e| format!("error converting supplied value for operator: {}", e));
46010 self
46011 }
46012 pub fn type_<T>(mut self, value: T) -> Self
46013 where
46014 T: ::std::convert::TryInto<super::EvmAddressCriterionType>,
46015 T::Error: ::std::fmt::Display,
46016 {
46017 self.type_ = value
46018 .try_into()
46019 .map_err(|e| format!("error converting supplied value for type_: {}", e));
46020 self
46021 }
46022 }
46023 impl ::std::convert::TryFrom<EvmAddressCriterion> for super::EvmAddressCriterion {
46024 type Error = super::error::ConversionError;
46025 fn try_from(
46026 value: EvmAddressCriterion,
46027 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46028 Ok(Self {
46029 addresses: value.addresses?,
46030 operator: value.operator?,
46031 type_: value.type_?,
46032 })
46033 }
46034 }
46035 impl ::std::convert::From<super::EvmAddressCriterion> for EvmAddressCriterion {
46036 fn from(value: super::EvmAddressCriterion) -> Self {
46037 Self {
46038 addresses: Ok(value.addresses),
46039 operator: Ok(value.operator),
46040 type_: Ok(value.type_),
46041 }
46042 }
46043 }
46044 #[derive(Clone, Debug)]
46045 pub struct EvmCall {
46046 data: ::std::result::Result<super::EvmCallData, ::std::string::String>,
46047 override_gas_limit: ::std::result::Result<
46048 ::std::option::Option<::std::string::String>,
46049 ::std::string::String,
46050 >,
46051 to: ::std::result::Result<super::EvmCallTo, ::std::string::String>,
46052 value: ::std::result::Result<::std::string::String, ::std::string::String>,
46053 }
46054 impl ::std::default::Default for EvmCall {
46055 fn default() -> Self {
46056 Self {
46057 data: Err("no value supplied for data".to_string()),
46058 override_gas_limit: Ok(Default::default()),
46059 to: Err("no value supplied for to".to_string()),
46060 value: Err("no value supplied for value".to_string()),
46061 }
46062 }
46063 }
46064 impl EvmCall {
46065 pub fn data<T>(mut self, value: T) -> Self
46066 where
46067 T: ::std::convert::TryInto<super::EvmCallData>,
46068 T::Error: ::std::fmt::Display,
46069 {
46070 self.data = value
46071 .try_into()
46072 .map_err(|e| format!("error converting supplied value for data: {}", e));
46073 self
46074 }
46075 pub fn override_gas_limit<T>(mut self, value: T) -> Self
46076 where
46077 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
46078 T::Error: ::std::fmt::Display,
46079 {
46080 self.override_gas_limit = value.try_into().map_err(|e| {
46081 format!(
46082 "error converting supplied value for override_gas_limit: {}",
46083 e
46084 )
46085 });
46086 self
46087 }
46088 pub fn to<T>(mut self, value: T) -> Self
46089 where
46090 T: ::std::convert::TryInto<super::EvmCallTo>,
46091 T::Error: ::std::fmt::Display,
46092 {
46093 self.to = value
46094 .try_into()
46095 .map_err(|e| format!("error converting supplied value for to: {}", e));
46096 self
46097 }
46098 pub fn value<T>(mut self, value: T) -> Self
46099 where
46100 T: ::std::convert::TryInto<::std::string::String>,
46101 T::Error: ::std::fmt::Display,
46102 {
46103 self.value = value
46104 .try_into()
46105 .map_err(|e| format!("error converting supplied value for value: {}", e));
46106 self
46107 }
46108 }
46109 impl ::std::convert::TryFrom<EvmCall> for super::EvmCall {
46110 type Error = super::error::ConversionError;
46111 fn try_from(
46112 value: EvmCall,
46113 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46114 Ok(Self {
46115 data: value.data?,
46116 override_gas_limit: value.override_gas_limit?,
46117 to: value.to?,
46118 value: value.value?,
46119 })
46120 }
46121 }
46122 impl ::std::convert::From<super::EvmCall> for EvmCall {
46123 fn from(value: super::EvmCall) -> Self {
46124 Self {
46125 data: Ok(value.data),
46126 override_gas_limit: Ok(value.override_gas_limit),
46127 to: Ok(value.to),
46128 value: Ok(value.value),
46129 }
46130 }
46131 }
46132 #[derive(Clone, Debug)]
46133 pub struct EvmDataCondition {
46134 function: ::std::result::Result<::std::string::String, ::std::string::String>,
46135 params: ::std::result::Result<
46136 ::std::vec::Vec<super::EvmDataConditionParamsItem>,
46137 ::std::string::String,
46138 >,
46139 }
46140 impl ::std::default::Default for EvmDataCondition {
46141 fn default() -> Self {
46142 Self {
46143 function: Err("no value supplied for function".to_string()),
46144 params: Ok(Default::default()),
46145 }
46146 }
46147 }
46148 impl EvmDataCondition {
46149 pub fn function<T>(mut self, value: T) -> Self
46150 where
46151 T: ::std::convert::TryInto<::std::string::String>,
46152 T::Error: ::std::fmt::Display,
46153 {
46154 self.function = value
46155 .try_into()
46156 .map_err(|e| format!("error converting supplied value for function: {}", e));
46157 self
46158 }
46159 pub fn params<T>(mut self, value: T) -> Self
46160 where
46161 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmDataConditionParamsItem>>,
46162 T::Error: ::std::fmt::Display,
46163 {
46164 self.params = value
46165 .try_into()
46166 .map_err(|e| format!("error converting supplied value for params: {}", e));
46167 self
46168 }
46169 }
46170 impl ::std::convert::TryFrom<EvmDataCondition> for super::EvmDataCondition {
46171 type Error = super::error::ConversionError;
46172 fn try_from(
46173 value: EvmDataCondition,
46174 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46175 Ok(Self {
46176 function: value.function?,
46177 params: value.params?,
46178 })
46179 }
46180 }
46181 impl ::std::convert::From<super::EvmDataCondition> for EvmDataCondition {
46182 fn from(value: super::EvmDataCondition) -> Self {
46183 Self {
46184 function: Ok(value.function),
46185 params: Ok(value.params),
46186 }
46187 }
46188 }
46189 #[derive(Clone, Debug)]
46190 pub struct EvmDataCriterion {
46191 abi: ::std::result::Result<super::EvmDataCriterionAbi, ::std::string::String>,
46192 conditions: ::std::result::Result<
46193 ::std::vec::Vec<super::EvmDataCondition>,
46194 ::std::string::String,
46195 >,
46196 type_: ::std::result::Result<super::EvmDataCriterionType, ::std::string::String>,
46197 }
46198 impl ::std::default::Default for EvmDataCriterion {
46199 fn default() -> Self {
46200 Self {
46201 abi: Err("no value supplied for abi".to_string()),
46202 conditions: Err("no value supplied for conditions".to_string()),
46203 type_: Err("no value supplied for type_".to_string()),
46204 }
46205 }
46206 }
46207 impl EvmDataCriterion {
46208 pub fn abi<T>(mut self, value: T) -> Self
46209 where
46210 T: ::std::convert::TryInto<super::EvmDataCriterionAbi>,
46211 T::Error: ::std::fmt::Display,
46212 {
46213 self.abi = value
46214 .try_into()
46215 .map_err(|e| format!("error converting supplied value for abi: {}", e));
46216 self
46217 }
46218 pub fn conditions<T>(mut self, value: T) -> Self
46219 where
46220 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmDataCondition>>,
46221 T::Error: ::std::fmt::Display,
46222 {
46223 self.conditions = value
46224 .try_into()
46225 .map_err(|e| format!("error converting supplied value for conditions: {}", e));
46226 self
46227 }
46228 pub fn type_<T>(mut self, value: T) -> Self
46229 where
46230 T: ::std::convert::TryInto<super::EvmDataCriterionType>,
46231 T::Error: ::std::fmt::Display,
46232 {
46233 self.type_ = value
46234 .try_into()
46235 .map_err(|e| format!("error converting supplied value for type_: {}", e));
46236 self
46237 }
46238 }
46239 impl ::std::convert::TryFrom<EvmDataCriterion> for super::EvmDataCriterion {
46240 type Error = super::error::ConversionError;
46241 fn try_from(
46242 value: EvmDataCriterion,
46243 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46244 Ok(Self {
46245 abi: value.abi?,
46246 conditions: value.conditions?,
46247 type_: value.type_?,
46248 })
46249 }
46250 }
46251 impl ::std::convert::From<super::EvmDataCriterion> for EvmDataCriterion {
46252 fn from(value: super::EvmDataCriterion) -> Self {
46253 Self {
46254 abi: Ok(value.abi),
46255 conditions: Ok(value.conditions),
46256 type_: Ok(value.type_),
46257 }
46258 }
46259 }
46260 #[derive(Clone, Debug)]
46261 pub struct EvmDataParameterCondition {
46262 name: ::std::result::Result<::std::string::String, ::std::string::String>,
46263 operator: ::std::result::Result<
46264 super::EvmDataParameterConditionOperator,
46265 ::std::string::String,
46266 >,
46267 value: ::std::result::Result<::std::string::String, ::std::string::String>,
46268 }
46269 impl ::std::default::Default for EvmDataParameterCondition {
46270 fn default() -> Self {
46271 Self {
46272 name: Err("no value supplied for name".to_string()),
46273 operator: Err("no value supplied for operator".to_string()),
46274 value: Err("no value supplied for value".to_string()),
46275 }
46276 }
46277 }
46278 impl EvmDataParameterCondition {
46279 pub fn name<T>(mut self, value: T) -> Self
46280 where
46281 T: ::std::convert::TryInto<::std::string::String>,
46282 T::Error: ::std::fmt::Display,
46283 {
46284 self.name = value
46285 .try_into()
46286 .map_err(|e| format!("error converting supplied value for name: {}", e));
46287 self
46288 }
46289 pub fn operator<T>(mut self, value: T) -> Self
46290 where
46291 T: ::std::convert::TryInto<super::EvmDataParameterConditionOperator>,
46292 T::Error: ::std::fmt::Display,
46293 {
46294 self.operator = value
46295 .try_into()
46296 .map_err(|e| format!("error converting supplied value for operator: {}", e));
46297 self
46298 }
46299 pub fn value<T>(mut self, value: T) -> Self
46300 where
46301 T: ::std::convert::TryInto<::std::string::String>,
46302 T::Error: ::std::fmt::Display,
46303 {
46304 self.value = value
46305 .try_into()
46306 .map_err(|e| format!("error converting supplied value for value: {}", e));
46307 self
46308 }
46309 }
46310 impl ::std::convert::TryFrom<EvmDataParameterCondition> for super::EvmDataParameterCondition {
46311 type Error = super::error::ConversionError;
46312 fn try_from(
46313 value: EvmDataParameterCondition,
46314 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46315 Ok(Self {
46316 name: value.name?,
46317 operator: value.operator?,
46318 value: value.value?,
46319 })
46320 }
46321 }
46322 impl ::std::convert::From<super::EvmDataParameterCondition> for EvmDataParameterCondition {
46323 fn from(value: super::EvmDataParameterCondition) -> Self {
46324 Self {
46325 name: Ok(value.name),
46326 operator: Ok(value.operator),
46327 value: Ok(value.value),
46328 }
46329 }
46330 }
46331 #[derive(Clone, Debug)]
46332 pub struct EvmDataParameterConditionList {
46333 name: ::std::result::Result<::std::string::String, ::std::string::String>,
46334 operator: ::std::result::Result<
46335 super::EvmDataParameterConditionListOperator,
46336 ::std::string::String,
46337 >,
46338 values: ::std::result::Result<
46339 ::std::vec::Vec<::std::string::String>,
46340 ::std::string::String,
46341 >,
46342 }
46343 impl ::std::default::Default for EvmDataParameterConditionList {
46344 fn default() -> Self {
46345 Self {
46346 name: Err("no value supplied for name".to_string()),
46347 operator: Err("no value supplied for operator".to_string()),
46348 values: Err("no value supplied for values".to_string()),
46349 }
46350 }
46351 }
46352 impl EvmDataParameterConditionList {
46353 pub fn name<T>(mut self, value: T) -> Self
46354 where
46355 T: ::std::convert::TryInto<::std::string::String>,
46356 T::Error: ::std::fmt::Display,
46357 {
46358 self.name = value
46359 .try_into()
46360 .map_err(|e| format!("error converting supplied value for name: {}", e));
46361 self
46362 }
46363 pub fn operator<T>(mut self, value: T) -> Self
46364 where
46365 T: ::std::convert::TryInto<super::EvmDataParameterConditionListOperator>,
46366 T::Error: ::std::fmt::Display,
46367 {
46368 self.operator = value
46369 .try_into()
46370 .map_err(|e| format!("error converting supplied value for operator: {}", e));
46371 self
46372 }
46373 pub fn values<T>(mut self, value: T) -> Self
46374 where
46375 T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
46376 T::Error: ::std::fmt::Display,
46377 {
46378 self.values = value
46379 .try_into()
46380 .map_err(|e| format!("error converting supplied value for values: {}", e));
46381 self
46382 }
46383 }
46384 impl ::std::convert::TryFrom<EvmDataParameterConditionList>
46385 for super::EvmDataParameterConditionList
46386 {
46387 type Error = super::error::ConversionError;
46388 fn try_from(
46389 value: EvmDataParameterConditionList,
46390 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46391 Ok(Self {
46392 name: value.name?,
46393 operator: value.operator?,
46394 values: value.values?,
46395 })
46396 }
46397 }
46398 impl ::std::convert::From<super::EvmDataParameterConditionList> for EvmDataParameterConditionList {
46399 fn from(value: super::EvmDataParameterConditionList) -> Self {
46400 Self {
46401 name: Ok(value.name),
46402 operator: Ok(value.operator),
46403 values: Ok(value.values),
46404 }
46405 }
46406 }
46407 #[derive(Clone, Debug)]
46408 pub struct EvmMessageCriterion {
46409 match_: ::std::result::Result<::std::string::String, ::std::string::String>,
46410 type_: ::std::result::Result<super::EvmMessageCriterionType, ::std::string::String>,
46411 }
46412 impl ::std::default::Default for EvmMessageCriterion {
46413 fn default() -> Self {
46414 Self {
46415 match_: Err("no value supplied for match_".to_string()),
46416 type_: Err("no value supplied for type_".to_string()),
46417 }
46418 }
46419 }
46420 impl EvmMessageCriterion {
46421 pub fn match_<T>(mut self, value: T) -> Self
46422 where
46423 T: ::std::convert::TryInto<::std::string::String>,
46424 T::Error: ::std::fmt::Display,
46425 {
46426 self.match_ = value
46427 .try_into()
46428 .map_err(|e| format!("error converting supplied value for match_: {}", e));
46429 self
46430 }
46431 pub fn type_<T>(mut self, value: T) -> Self
46432 where
46433 T: ::std::convert::TryInto<super::EvmMessageCriterionType>,
46434 T::Error: ::std::fmt::Display,
46435 {
46436 self.type_ = value
46437 .try_into()
46438 .map_err(|e| format!("error converting supplied value for type_: {}", e));
46439 self
46440 }
46441 }
46442 impl ::std::convert::TryFrom<EvmMessageCriterion> for super::EvmMessageCriterion {
46443 type Error = super::error::ConversionError;
46444 fn try_from(
46445 value: EvmMessageCriterion,
46446 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46447 Ok(Self {
46448 match_: value.match_?,
46449 type_: value.type_?,
46450 })
46451 }
46452 }
46453 impl ::std::convert::From<super::EvmMessageCriterion> for EvmMessageCriterion {
46454 fn from(value: super::EvmMessageCriterion) -> Self {
46455 Self {
46456 match_: Ok(value.match_),
46457 type_: Ok(value.type_),
46458 }
46459 }
46460 }
46461 #[derive(Clone, Debug)]
46462 pub struct EvmNetworkCriterion {
46463 networks: ::std::result::Result<
46464 ::std::vec::Vec<super::EvmNetworkCriterionNetworksItem>,
46465 ::std::string::String,
46466 >,
46467 operator:
46468 ::std::result::Result<super::EvmNetworkCriterionOperator, ::std::string::String>,
46469 type_: ::std::result::Result<super::EvmNetworkCriterionType, ::std::string::String>,
46470 }
46471 impl ::std::default::Default for EvmNetworkCriterion {
46472 fn default() -> Self {
46473 Self {
46474 networks: Err("no value supplied for networks".to_string()),
46475 operator: Err("no value supplied for operator".to_string()),
46476 type_: Err("no value supplied for type_".to_string()),
46477 }
46478 }
46479 }
46480 impl EvmNetworkCriterion {
46481 pub fn networks<T>(mut self, value: T) -> Self
46482 where
46483 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmNetworkCriterionNetworksItem>>,
46484 T::Error: ::std::fmt::Display,
46485 {
46486 self.networks = value
46487 .try_into()
46488 .map_err(|e| format!("error converting supplied value for networks: {}", e));
46489 self
46490 }
46491 pub fn operator<T>(mut self, value: T) -> Self
46492 where
46493 T: ::std::convert::TryInto<super::EvmNetworkCriterionOperator>,
46494 T::Error: ::std::fmt::Display,
46495 {
46496 self.operator = value
46497 .try_into()
46498 .map_err(|e| format!("error converting supplied value for operator: {}", e));
46499 self
46500 }
46501 pub fn type_<T>(mut self, value: T) -> Self
46502 where
46503 T: ::std::convert::TryInto<super::EvmNetworkCriterionType>,
46504 T::Error: ::std::fmt::Display,
46505 {
46506 self.type_ = value
46507 .try_into()
46508 .map_err(|e| format!("error converting supplied value for type_: {}", e));
46509 self
46510 }
46511 }
46512 impl ::std::convert::TryFrom<EvmNetworkCriterion> for super::EvmNetworkCriterion {
46513 type Error = super::error::ConversionError;
46514 fn try_from(
46515 value: EvmNetworkCriterion,
46516 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46517 Ok(Self {
46518 networks: value.networks?,
46519 operator: value.operator?,
46520 type_: value.type_?,
46521 })
46522 }
46523 }
46524 impl ::std::convert::From<super::EvmNetworkCriterion> for EvmNetworkCriterion {
46525 fn from(value: super::EvmNetworkCriterion) -> Self {
46526 Self {
46527 networks: Ok(value.networks),
46528 operator: Ok(value.operator),
46529 type_: Ok(value.type_),
46530 }
46531 }
46532 }
46533 #[derive(Clone, Debug)]
46534 pub struct EvmSmartAccount {
46535 address: ::std::result::Result<super::EvmSmartAccountAddress, ::std::string::String>,
46536 created_at: ::std::result::Result<
46537 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
46538 ::std::string::String,
46539 >,
46540 name: ::std::result::Result<
46541 ::std::option::Option<super::EvmSmartAccountName>,
46542 ::std::string::String,
46543 >,
46544 owners: ::std::result::Result<
46545 ::std::vec::Vec<super::EvmSmartAccountOwnersItem>,
46546 ::std::string::String,
46547 >,
46548 policies: ::std::result::Result<
46549 ::std::vec::Vec<super::EvmSmartAccountPoliciesItem>,
46550 ::std::string::String,
46551 >,
46552 updated_at: ::std::result::Result<
46553 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
46554 ::std::string::String,
46555 >,
46556 }
46557 impl ::std::default::Default for EvmSmartAccount {
46558 fn default() -> Self {
46559 Self {
46560 address: Err("no value supplied for address".to_string()),
46561 created_at: Ok(Default::default()),
46562 name: Ok(Default::default()),
46563 owners: Err("no value supplied for owners".to_string()),
46564 policies: Ok(Default::default()),
46565 updated_at: Ok(Default::default()),
46566 }
46567 }
46568 }
46569 impl EvmSmartAccount {
46570 pub fn address<T>(mut self, value: T) -> Self
46571 where
46572 T: ::std::convert::TryInto<super::EvmSmartAccountAddress>,
46573 T::Error: ::std::fmt::Display,
46574 {
46575 self.address = value
46576 .try_into()
46577 .map_err(|e| format!("error converting supplied value for address: {}", e));
46578 self
46579 }
46580 pub fn created_at<T>(mut self, value: T) -> Self
46581 where
46582 T: ::std::convert::TryInto<
46583 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
46584 >,
46585 T::Error: ::std::fmt::Display,
46586 {
46587 self.created_at = value
46588 .try_into()
46589 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
46590 self
46591 }
46592 pub fn name<T>(mut self, value: T) -> Self
46593 where
46594 T: ::std::convert::TryInto<::std::option::Option<super::EvmSmartAccountName>>,
46595 T::Error: ::std::fmt::Display,
46596 {
46597 self.name = value
46598 .try_into()
46599 .map_err(|e| format!("error converting supplied value for name: {}", e));
46600 self
46601 }
46602 pub fn owners<T>(mut self, value: T) -> Self
46603 where
46604 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmSmartAccountOwnersItem>>,
46605 T::Error: ::std::fmt::Display,
46606 {
46607 self.owners = value
46608 .try_into()
46609 .map_err(|e| format!("error converting supplied value for owners: {}", e));
46610 self
46611 }
46612 pub fn policies<T>(mut self, value: T) -> Self
46613 where
46614 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmSmartAccountPoliciesItem>>,
46615 T::Error: ::std::fmt::Display,
46616 {
46617 self.policies = value
46618 .try_into()
46619 .map_err(|e| format!("error converting supplied value for policies: {}", e));
46620 self
46621 }
46622 pub fn updated_at<T>(mut self, value: T) -> Self
46623 where
46624 T: ::std::convert::TryInto<
46625 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
46626 >,
46627 T::Error: ::std::fmt::Display,
46628 {
46629 self.updated_at = value
46630 .try_into()
46631 .map_err(|e| format!("error converting supplied value for updated_at: {}", e));
46632 self
46633 }
46634 }
46635 impl ::std::convert::TryFrom<EvmSmartAccount> for super::EvmSmartAccount {
46636 type Error = super::error::ConversionError;
46637 fn try_from(
46638 value: EvmSmartAccount,
46639 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46640 Ok(Self {
46641 address: value.address?,
46642 created_at: value.created_at?,
46643 name: value.name?,
46644 owners: value.owners?,
46645 policies: value.policies?,
46646 updated_at: value.updated_at?,
46647 })
46648 }
46649 }
46650 impl ::std::convert::From<super::EvmSmartAccount> for EvmSmartAccount {
46651 fn from(value: super::EvmSmartAccount) -> Self {
46652 Self {
46653 address: Ok(value.address),
46654 created_at: Ok(value.created_at),
46655 name: Ok(value.name),
46656 owners: Ok(value.owners),
46657 policies: Ok(value.policies),
46658 updated_at: Ok(value.updated_at),
46659 }
46660 }
46661 }
46662 #[derive(Clone, Debug)]
46663 pub struct EvmTypedAddressCondition {
46664 addresses: ::std::result::Result<
46665 ::std::vec::Vec<super::EvmTypedAddressConditionAddressesItem>,
46666 ::std::string::String,
46667 >,
46668 operator: ::std::result::Result<
46669 super::EvmTypedAddressConditionOperator,
46670 ::std::string::String,
46671 >,
46672 path: ::std::result::Result<::std::string::String, ::std::string::String>,
46673 }
46674 impl ::std::default::Default for EvmTypedAddressCondition {
46675 fn default() -> Self {
46676 Self {
46677 addresses: Err("no value supplied for addresses".to_string()),
46678 operator: Err("no value supplied for operator".to_string()),
46679 path: Err("no value supplied for path".to_string()),
46680 }
46681 }
46682 }
46683 impl EvmTypedAddressCondition {
46684 pub fn addresses<T>(mut self, value: T) -> Self
46685 where
46686 T: ::std::convert::TryInto<
46687 ::std::vec::Vec<super::EvmTypedAddressConditionAddressesItem>,
46688 >,
46689 T::Error: ::std::fmt::Display,
46690 {
46691 self.addresses = value
46692 .try_into()
46693 .map_err(|e| format!("error converting supplied value for addresses: {}", e));
46694 self
46695 }
46696 pub fn operator<T>(mut self, value: T) -> Self
46697 where
46698 T: ::std::convert::TryInto<super::EvmTypedAddressConditionOperator>,
46699 T::Error: ::std::fmt::Display,
46700 {
46701 self.operator = value
46702 .try_into()
46703 .map_err(|e| format!("error converting supplied value for operator: {}", e));
46704 self
46705 }
46706 pub fn path<T>(mut self, value: T) -> Self
46707 where
46708 T: ::std::convert::TryInto<::std::string::String>,
46709 T::Error: ::std::fmt::Display,
46710 {
46711 self.path = value
46712 .try_into()
46713 .map_err(|e| format!("error converting supplied value for path: {}", e));
46714 self
46715 }
46716 }
46717 impl ::std::convert::TryFrom<EvmTypedAddressCondition> for super::EvmTypedAddressCondition {
46718 type Error = super::error::ConversionError;
46719 fn try_from(
46720 value: EvmTypedAddressCondition,
46721 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46722 Ok(Self {
46723 addresses: value.addresses?,
46724 operator: value.operator?,
46725 path: value.path?,
46726 })
46727 }
46728 }
46729 impl ::std::convert::From<super::EvmTypedAddressCondition> for EvmTypedAddressCondition {
46730 fn from(value: super::EvmTypedAddressCondition) -> Self {
46731 Self {
46732 addresses: Ok(value.addresses),
46733 operator: Ok(value.operator),
46734 path: Ok(value.path),
46735 }
46736 }
46737 }
46738 #[derive(Clone, Debug)]
46739 pub struct EvmTypedNumericalCondition {
46740 operator: ::std::result::Result<
46741 super::EvmTypedNumericalConditionOperator,
46742 ::std::string::String,
46743 >,
46744 path: ::std::result::Result<::std::string::String, ::std::string::String>,
46745 value: ::std::result::Result<
46746 super::EvmTypedNumericalConditionValue,
46747 ::std::string::String,
46748 >,
46749 }
46750 impl ::std::default::Default for EvmTypedNumericalCondition {
46751 fn default() -> Self {
46752 Self {
46753 operator: Err("no value supplied for operator".to_string()),
46754 path: Err("no value supplied for path".to_string()),
46755 value: Err("no value supplied for value".to_string()),
46756 }
46757 }
46758 }
46759 impl EvmTypedNumericalCondition {
46760 pub fn operator<T>(mut self, value: T) -> Self
46761 where
46762 T: ::std::convert::TryInto<super::EvmTypedNumericalConditionOperator>,
46763 T::Error: ::std::fmt::Display,
46764 {
46765 self.operator = value
46766 .try_into()
46767 .map_err(|e| format!("error converting supplied value for operator: {}", e));
46768 self
46769 }
46770 pub fn path<T>(mut self, value: T) -> Self
46771 where
46772 T: ::std::convert::TryInto<::std::string::String>,
46773 T::Error: ::std::fmt::Display,
46774 {
46775 self.path = value
46776 .try_into()
46777 .map_err(|e| format!("error converting supplied value for path: {}", e));
46778 self
46779 }
46780 pub fn value<T>(mut self, value: T) -> Self
46781 where
46782 T: ::std::convert::TryInto<super::EvmTypedNumericalConditionValue>,
46783 T::Error: ::std::fmt::Display,
46784 {
46785 self.value = value
46786 .try_into()
46787 .map_err(|e| format!("error converting supplied value for value: {}", e));
46788 self
46789 }
46790 }
46791 impl ::std::convert::TryFrom<EvmTypedNumericalCondition> for super::EvmTypedNumericalCondition {
46792 type Error = super::error::ConversionError;
46793 fn try_from(
46794 value: EvmTypedNumericalCondition,
46795 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46796 Ok(Self {
46797 operator: value.operator?,
46798 path: value.path?,
46799 value: value.value?,
46800 })
46801 }
46802 }
46803 impl ::std::convert::From<super::EvmTypedNumericalCondition> for EvmTypedNumericalCondition {
46804 fn from(value: super::EvmTypedNumericalCondition) -> Self {
46805 Self {
46806 operator: Ok(value.operator),
46807 path: Ok(value.path),
46808 value: Ok(value.value),
46809 }
46810 }
46811 }
46812 #[derive(Clone, Debug)]
46813 pub struct EvmTypedStringCondition {
46814 match_: ::std::result::Result<::std::string::String, ::std::string::String>,
46815 path: ::std::result::Result<::std::string::String, ::std::string::String>,
46816 }
46817 impl ::std::default::Default for EvmTypedStringCondition {
46818 fn default() -> Self {
46819 Self {
46820 match_: Err("no value supplied for match_".to_string()),
46821 path: Err("no value supplied for path".to_string()),
46822 }
46823 }
46824 }
46825 impl EvmTypedStringCondition {
46826 pub fn match_<T>(mut self, value: T) -> Self
46827 where
46828 T: ::std::convert::TryInto<::std::string::String>,
46829 T::Error: ::std::fmt::Display,
46830 {
46831 self.match_ = value
46832 .try_into()
46833 .map_err(|e| format!("error converting supplied value for match_: {}", e));
46834 self
46835 }
46836 pub fn path<T>(mut self, value: T) -> Self
46837 where
46838 T: ::std::convert::TryInto<::std::string::String>,
46839 T::Error: ::std::fmt::Display,
46840 {
46841 self.path = value
46842 .try_into()
46843 .map_err(|e| format!("error converting supplied value for path: {}", e));
46844 self
46845 }
46846 }
46847 impl ::std::convert::TryFrom<EvmTypedStringCondition> for super::EvmTypedStringCondition {
46848 type Error = super::error::ConversionError;
46849 fn try_from(
46850 value: EvmTypedStringCondition,
46851 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46852 Ok(Self {
46853 match_: value.match_?,
46854 path: value.path?,
46855 })
46856 }
46857 }
46858 impl ::std::convert::From<super::EvmTypedStringCondition> for EvmTypedStringCondition {
46859 fn from(value: super::EvmTypedStringCondition) -> Self {
46860 Self {
46861 match_: Ok(value.match_),
46862 path: Ok(value.path),
46863 }
46864 }
46865 }
46866 #[derive(Clone, Debug)]
46867 pub struct EvmUserOperation {
46868 calls: ::std::result::Result<::std::vec::Vec<super::EvmCall>, ::std::string::String>,
46869 network: ::std::result::Result<super::EvmUserOperationNetwork, ::std::string::String>,
46870 receipts: ::std::result::Result<
46871 ::std::vec::Vec<super::UserOperationReceipt>,
46872 ::std::string::String,
46873 >,
46874 status: ::std::result::Result<super::EvmUserOperationStatus, ::std::string::String>,
46875 transaction_hash: ::std::result::Result<
46876 ::std::option::Option<super::EvmUserOperationTransactionHash>,
46877 ::std::string::String,
46878 >,
46879 user_op_hash:
46880 ::std::result::Result<super::EvmUserOperationUserOpHash, ::std::string::String>,
46881 }
46882 impl ::std::default::Default for EvmUserOperation {
46883 fn default() -> Self {
46884 Self {
46885 calls: Err("no value supplied for calls".to_string()),
46886 network: Err("no value supplied for network".to_string()),
46887 receipts: Ok(Default::default()),
46888 status: Err("no value supplied for status".to_string()),
46889 transaction_hash: Ok(Default::default()),
46890 user_op_hash: Err("no value supplied for user_op_hash".to_string()),
46891 }
46892 }
46893 }
46894 impl EvmUserOperation {
46895 pub fn calls<T>(mut self, value: T) -> Self
46896 where
46897 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmCall>>,
46898 T::Error: ::std::fmt::Display,
46899 {
46900 self.calls = value
46901 .try_into()
46902 .map_err(|e| format!("error converting supplied value for calls: {}", e));
46903 self
46904 }
46905 pub fn network<T>(mut self, value: T) -> Self
46906 where
46907 T: ::std::convert::TryInto<super::EvmUserOperationNetwork>,
46908 T::Error: ::std::fmt::Display,
46909 {
46910 self.network = value
46911 .try_into()
46912 .map_err(|e| format!("error converting supplied value for network: {}", e));
46913 self
46914 }
46915 pub fn receipts<T>(mut self, value: T) -> Self
46916 where
46917 T: ::std::convert::TryInto<::std::vec::Vec<super::UserOperationReceipt>>,
46918 T::Error: ::std::fmt::Display,
46919 {
46920 self.receipts = value
46921 .try_into()
46922 .map_err(|e| format!("error converting supplied value for receipts: {}", e));
46923 self
46924 }
46925 pub fn status<T>(mut self, value: T) -> Self
46926 where
46927 T: ::std::convert::TryInto<super::EvmUserOperationStatus>,
46928 T::Error: ::std::fmt::Display,
46929 {
46930 self.status = value
46931 .try_into()
46932 .map_err(|e| format!("error converting supplied value for status: {}", e));
46933 self
46934 }
46935 pub fn transaction_hash<T>(mut self, value: T) -> Self
46936 where
46937 T: ::std::convert::TryInto<
46938 ::std::option::Option<super::EvmUserOperationTransactionHash>,
46939 >,
46940 T::Error: ::std::fmt::Display,
46941 {
46942 self.transaction_hash = value.try_into().map_err(|e| {
46943 format!(
46944 "error converting supplied value for transaction_hash: {}",
46945 e
46946 )
46947 });
46948 self
46949 }
46950 pub fn user_op_hash<T>(mut self, value: T) -> Self
46951 where
46952 T: ::std::convert::TryInto<super::EvmUserOperationUserOpHash>,
46953 T::Error: ::std::fmt::Display,
46954 {
46955 self.user_op_hash = value.try_into().map_err(|e| {
46956 format!("error converting supplied value for user_op_hash: {}", e)
46957 });
46958 self
46959 }
46960 }
46961 impl ::std::convert::TryFrom<EvmUserOperation> for super::EvmUserOperation {
46962 type Error = super::error::ConversionError;
46963 fn try_from(
46964 value: EvmUserOperation,
46965 ) -> ::std::result::Result<Self, super::error::ConversionError> {
46966 Ok(Self {
46967 calls: value.calls?,
46968 network: value.network?,
46969 receipts: value.receipts?,
46970 status: value.status?,
46971 transaction_hash: value.transaction_hash?,
46972 user_op_hash: value.user_op_hash?,
46973 })
46974 }
46975 }
46976 impl ::std::convert::From<super::EvmUserOperation> for EvmUserOperation {
46977 fn from(value: super::EvmUserOperation) -> Self {
46978 Self {
46979 calls: Ok(value.calls),
46980 network: Ok(value.network),
46981 receipts: Ok(value.receipts),
46982 status: Ok(value.status),
46983 transaction_hash: Ok(value.transaction_hash),
46984 user_op_hash: Ok(value.user_op_hash),
46985 }
46986 }
46987 }
46988 #[derive(Clone, Debug)]
46989 pub struct ExportEvmAccountBody {
46990 export_encryption_key:
46991 ::std::result::Result<::std::string::String, ::std::string::String>,
46992 }
46993 impl ::std::default::Default for ExportEvmAccountBody {
46994 fn default() -> Self {
46995 Self {
46996 export_encryption_key: Err(
46997 "no value supplied for export_encryption_key".to_string()
46998 ),
46999 }
47000 }
47001 }
47002 impl ExportEvmAccountBody {
47003 pub fn export_encryption_key<T>(mut self, value: T) -> Self
47004 where
47005 T: ::std::convert::TryInto<::std::string::String>,
47006 T::Error: ::std::fmt::Display,
47007 {
47008 self.export_encryption_key = value.try_into().map_err(|e| {
47009 format!(
47010 "error converting supplied value for export_encryption_key: {}",
47011 e
47012 )
47013 });
47014 self
47015 }
47016 }
47017 impl ::std::convert::TryFrom<ExportEvmAccountBody> for super::ExportEvmAccountBody {
47018 type Error = super::error::ConversionError;
47019 fn try_from(
47020 value: ExportEvmAccountBody,
47021 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47022 Ok(Self {
47023 export_encryption_key: value.export_encryption_key?,
47024 })
47025 }
47026 }
47027 impl ::std::convert::From<super::ExportEvmAccountBody> for ExportEvmAccountBody {
47028 fn from(value: super::ExportEvmAccountBody) -> Self {
47029 Self {
47030 export_encryption_key: Ok(value.export_encryption_key),
47031 }
47032 }
47033 }
47034 #[derive(Clone, Debug)]
47035 pub struct ExportEvmAccountByNameBody {
47036 export_encryption_key:
47037 ::std::result::Result<::std::string::String, ::std::string::String>,
47038 }
47039 impl ::std::default::Default for ExportEvmAccountByNameBody {
47040 fn default() -> Self {
47041 Self {
47042 export_encryption_key: Err(
47043 "no value supplied for export_encryption_key".to_string()
47044 ),
47045 }
47046 }
47047 }
47048 impl ExportEvmAccountByNameBody {
47049 pub fn export_encryption_key<T>(mut self, value: T) -> Self
47050 where
47051 T: ::std::convert::TryInto<::std::string::String>,
47052 T::Error: ::std::fmt::Display,
47053 {
47054 self.export_encryption_key = value.try_into().map_err(|e| {
47055 format!(
47056 "error converting supplied value for export_encryption_key: {}",
47057 e
47058 )
47059 });
47060 self
47061 }
47062 }
47063 impl ::std::convert::TryFrom<ExportEvmAccountByNameBody> for super::ExportEvmAccountByNameBody {
47064 type Error = super::error::ConversionError;
47065 fn try_from(
47066 value: ExportEvmAccountByNameBody,
47067 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47068 Ok(Self {
47069 export_encryption_key: value.export_encryption_key?,
47070 })
47071 }
47072 }
47073 impl ::std::convert::From<super::ExportEvmAccountByNameBody> for ExportEvmAccountByNameBody {
47074 fn from(value: super::ExportEvmAccountByNameBody) -> Self {
47075 Self {
47076 export_encryption_key: Ok(value.export_encryption_key),
47077 }
47078 }
47079 }
47080 #[derive(Clone, Debug)]
47081 pub struct ExportEvmAccountByNameResponse {
47082 encrypted_private_key:
47083 ::std::result::Result<::std::string::String, ::std::string::String>,
47084 }
47085 impl ::std::default::Default for ExportEvmAccountByNameResponse {
47086 fn default() -> Self {
47087 Self {
47088 encrypted_private_key: Err(
47089 "no value supplied for encrypted_private_key".to_string()
47090 ),
47091 }
47092 }
47093 }
47094 impl ExportEvmAccountByNameResponse {
47095 pub fn encrypted_private_key<T>(mut self, value: T) -> Self
47096 where
47097 T: ::std::convert::TryInto<::std::string::String>,
47098 T::Error: ::std::fmt::Display,
47099 {
47100 self.encrypted_private_key = value.try_into().map_err(|e| {
47101 format!(
47102 "error converting supplied value for encrypted_private_key: {}",
47103 e
47104 )
47105 });
47106 self
47107 }
47108 }
47109 impl ::std::convert::TryFrom<ExportEvmAccountByNameResponse>
47110 for super::ExportEvmAccountByNameResponse
47111 {
47112 type Error = super::error::ConversionError;
47113 fn try_from(
47114 value: ExportEvmAccountByNameResponse,
47115 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47116 Ok(Self {
47117 encrypted_private_key: value.encrypted_private_key?,
47118 })
47119 }
47120 }
47121 impl ::std::convert::From<super::ExportEvmAccountByNameResponse>
47122 for ExportEvmAccountByNameResponse
47123 {
47124 fn from(value: super::ExportEvmAccountByNameResponse) -> Self {
47125 Self {
47126 encrypted_private_key: Ok(value.encrypted_private_key),
47127 }
47128 }
47129 }
47130 #[derive(Clone, Debug)]
47131 pub struct ExportEvmAccountResponse {
47132 encrypted_private_key:
47133 ::std::result::Result<::std::string::String, ::std::string::String>,
47134 }
47135 impl ::std::default::Default for ExportEvmAccountResponse {
47136 fn default() -> Self {
47137 Self {
47138 encrypted_private_key: Err(
47139 "no value supplied for encrypted_private_key".to_string()
47140 ),
47141 }
47142 }
47143 }
47144 impl ExportEvmAccountResponse {
47145 pub fn encrypted_private_key<T>(mut self, value: T) -> Self
47146 where
47147 T: ::std::convert::TryInto<::std::string::String>,
47148 T::Error: ::std::fmt::Display,
47149 {
47150 self.encrypted_private_key = value.try_into().map_err(|e| {
47151 format!(
47152 "error converting supplied value for encrypted_private_key: {}",
47153 e
47154 )
47155 });
47156 self
47157 }
47158 }
47159 impl ::std::convert::TryFrom<ExportEvmAccountResponse> for super::ExportEvmAccountResponse {
47160 type Error = super::error::ConversionError;
47161 fn try_from(
47162 value: ExportEvmAccountResponse,
47163 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47164 Ok(Self {
47165 encrypted_private_key: value.encrypted_private_key?,
47166 })
47167 }
47168 }
47169 impl ::std::convert::From<super::ExportEvmAccountResponse> for ExportEvmAccountResponse {
47170 fn from(value: super::ExportEvmAccountResponse) -> Self {
47171 Self {
47172 encrypted_private_key: Ok(value.encrypted_private_key),
47173 }
47174 }
47175 }
47176 #[derive(Clone, Debug)]
47177 pub struct ExportSolanaAccountBody {
47178 export_encryption_key:
47179 ::std::result::Result<::std::string::String, ::std::string::String>,
47180 }
47181 impl ::std::default::Default for ExportSolanaAccountBody {
47182 fn default() -> Self {
47183 Self {
47184 export_encryption_key: Err(
47185 "no value supplied for export_encryption_key".to_string()
47186 ),
47187 }
47188 }
47189 }
47190 impl ExportSolanaAccountBody {
47191 pub fn export_encryption_key<T>(mut self, value: T) -> Self
47192 where
47193 T: ::std::convert::TryInto<::std::string::String>,
47194 T::Error: ::std::fmt::Display,
47195 {
47196 self.export_encryption_key = value.try_into().map_err(|e| {
47197 format!(
47198 "error converting supplied value for export_encryption_key: {}",
47199 e
47200 )
47201 });
47202 self
47203 }
47204 }
47205 impl ::std::convert::TryFrom<ExportSolanaAccountBody> for super::ExportSolanaAccountBody {
47206 type Error = super::error::ConversionError;
47207 fn try_from(
47208 value: ExportSolanaAccountBody,
47209 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47210 Ok(Self {
47211 export_encryption_key: value.export_encryption_key?,
47212 })
47213 }
47214 }
47215 impl ::std::convert::From<super::ExportSolanaAccountBody> for ExportSolanaAccountBody {
47216 fn from(value: super::ExportSolanaAccountBody) -> Self {
47217 Self {
47218 export_encryption_key: Ok(value.export_encryption_key),
47219 }
47220 }
47221 }
47222 #[derive(Clone, Debug)]
47223 pub struct ExportSolanaAccountByNameBody {
47224 export_encryption_key:
47225 ::std::result::Result<::std::string::String, ::std::string::String>,
47226 }
47227 impl ::std::default::Default for ExportSolanaAccountByNameBody {
47228 fn default() -> Self {
47229 Self {
47230 export_encryption_key: Err(
47231 "no value supplied for export_encryption_key".to_string()
47232 ),
47233 }
47234 }
47235 }
47236 impl ExportSolanaAccountByNameBody {
47237 pub fn export_encryption_key<T>(mut self, value: T) -> Self
47238 where
47239 T: ::std::convert::TryInto<::std::string::String>,
47240 T::Error: ::std::fmt::Display,
47241 {
47242 self.export_encryption_key = value.try_into().map_err(|e| {
47243 format!(
47244 "error converting supplied value for export_encryption_key: {}",
47245 e
47246 )
47247 });
47248 self
47249 }
47250 }
47251 impl ::std::convert::TryFrom<ExportSolanaAccountByNameBody>
47252 for super::ExportSolanaAccountByNameBody
47253 {
47254 type Error = super::error::ConversionError;
47255 fn try_from(
47256 value: ExportSolanaAccountByNameBody,
47257 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47258 Ok(Self {
47259 export_encryption_key: value.export_encryption_key?,
47260 })
47261 }
47262 }
47263 impl ::std::convert::From<super::ExportSolanaAccountByNameBody> for ExportSolanaAccountByNameBody {
47264 fn from(value: super::ExportSolanaAccountByNameBody) -> Self {
47265 Self {
47266 export_encryption_key: Ok(value.export_encryption_key),
47267 }
47268 }
47269 }
47270 #[derive(Clone, Debug)]
47271 pub struct ExportSolanaAccountByNameResponse {
47272 encrypted_private_key:
47273 ::std::result::Result<::std::string::String, ::std::string::String>,
47274 }
47275 impl ::std::default::Default for ExportSolanaAccountByNameResponse {
47276 fn default() -> Self {
47277 Self {
47278 encrypted_private_key: Err(
47279 "no value supplied for encrypted_private_key".to_string()
47280 ),
47281 }
47282 }
47283 }
47284 impl ExportSolanaAccountByNameResponse {
47285 pub fn encrypted_private_key<T>(mut self, value: T) -> Self
47286 where
47287 T: ::std::convert::TryInto<::std::string::String>,
47288 T::Error: ::std::fmt::Display,
47289 {
47290 self.encrypted_private_key = value.try_into().map_err(|e| {
47291 format!(
47292 "error converting supplied value for encrypted_private_key: {}",
47293 e
47294 )
47295 });
47296 self
47297 }
47298 }
47299 impl ::std::convert::TryFrom<ExportSolanaAccountByNameResponse>
47300 for super::ExportSolanaAccountByNameResponse
47301 {
47302 type Error = super::error::ConversionError;
47303 fn try_from(
47304 value: ExportSolanaAccountByNameResponse,
47305 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47306 Ok(Self {
47307 encrypted_private_key: value.encrypted_private_key?,
47308 })
47309 }
47310 }
47311 impl ::std::convert::From<super::ExportSolanaAccountByNameResponse>
47312 for ExportSolanaAccountByNameResponse
47313 {
47314 fn from(value: super::ExportSolanaAccountByNameResponse) -> Self {
47315 Self {
47316 encrypted_private_key: Ok(value.encrypted_private_key),
47317 }
47318 }
47319 }
47320 #[derive(Clone, Debug)]
47321 pub struct ExportSolanaAccountResponse {
47322 encrypted_private_key:
47323 ::std::result::Result<::std::string::String, ::std::string::String>,
47324 }
47325 impl ::std::default::Default for ExportSolanaAccountResponse {
47326 fn default() -> Self {
47327 Self {
47328 encrypted_private_key: Err(
47329 "no value supplied for encrypted_private_key".to_string()
47330 ),
47331 }
47332 }
47333 }
47334 impl ExportSolanaAccountResponse {
47335 pub fn encrypted_private_key<T>(mut self, value: T) -> Self
47336 where
47337 T: ::std::convert::TryInto<::std::string::String>,
47338 T::Error: ::std::fmt::Display,
47339 {
47340 self.encrypted_private_key = value.try_into().map_err(|e| {
47341 format!(
47342 "error converting supplied value for encrypted_private_key: {}",
47343 e
47344 )
47345 });
47346 self
47347 }
47348 }
47349 impl ::std::convert::TryFrom<ExportSolanaAccountResponse> for super::ExportSolanaAccountResponse {
47350 type Error = super::error::ConversionError;
47351 fn try_from(
47352 value: ExportSolanaAccountResponse,
47353 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47354 Ok(Self {
47355 encrypted_private_key: value.encrypted_private_key?,
47356 })
47357 }
47358 }
47359 impl ::std::convert::From<super::ExportSolanaAccountResponse> for ExportSolanaAccountResponse {
47360 fn from(value: super::ExportSolanaAccountResponse) -> Self {
47361 Self {
47362 encrypted_private_key: Ok(value.encrypted_private_key),
47363 }
47364 }
47365 }
47366 #[derive(Clone, Debug)]
47367 pub struct GetOnrampOrderByIdResponse {
47368 order: ::std::result::Result<super::OnrampOrder, ::std::string::String>,
47369 }
47370 impl ::std::default::Default for GetOnrampOrderByIdResponse {
47371 fn default() -> Self {
47372 Self {
47373 order: Err("no value supplied for order".to_string()),
47374 }
47375 }
47376 }
47377 impl GetOnrampOrderByIdResponse {
47378 pub fn order<T>(mut self, value: T) -> Self
47379 where
47380 T: ::std::convert::TryInto<super::OnrampOrder>,
47381 T::Error: ::std::fmt::Display,
47382 {
47383 self.order = value
47384 .try_into()
47385 .map_err(|e| format!("error converting supplied value for order: {}", e));
47386 self
47387 }
47388 }
47389 impl ::std::convert::TryFrom<GetOnrampOrderByIdResponse> for super::GetOnrampOrderByIdResponse {
47390 type Error = super::error::ConversionError;
47391 fn try_from(
47392 value: GetOnrampOrderByIdResponse,
47393 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47394 Ok(Self {
47395 order: value.order?,
47396 })
47397 }
47398 }
47399 impl ::std::convert::From<super::GetOnrampOrderByIdResponse> for GetOnrampOrderByIdResponse {
47400 fn from(value: super::GetOnrampOrderByIdResponse) -> Self {
47401 Self {
47402 order: Ok(value.order),
47403 }
47404 }
47405 }
47406 #[derive(Clone, Debug)]
47407 pub struct GetSwapPriceResponse {
47408 block_number: ::std::result::Result<
47409 super::GetSwapPriceResponseBlockNumber,
47410 ::std::string::String,
47411 >,
47412 fees: ::std::result::Result<super::GetSwapPriceResponseFees, ::std::string::String>,
47413 from_amount:
47414 ::std::result::Result<super::GetSwapPriceResponseFromAmount, ::std::string::String>,
47415 from_token:
47416 ::std::result::Result<super::GetSwapPriceResponseFromToken, ::std::string::String>,
47417 gas: ::std::result::Result<
47418 ::std::option::Option<super::GetSwapPriceResponseGas>,
47419 ::std::string::String,
47420 >,
47421 gas_price:
47422 ::std::result::Result<super::GetSwapPriceResponseGasPrice, ::std::string::String>,
47423 issues: ::std::result::Result<super::GetSwapPriceResponseIssues, ::std::string::String>,
47424 liquidity_available: ::std::result::Result<bool, ::std::string::String>,
47425 min_to_amount: ::std::result::Result<
47426 super::GetSwapPriceResponseMinToAmount,
47427 ::std::string::String,
47428 >,
47429 to_amount:
47430 ::std::result::Result<super::GetSwapPriceResponseToAmount, ::std::string::String>,
47431 to_token:
47432 ::std::result::Result<super::GetSwapPriceResponseToToken, ::std::string::String>,
47433 }
47434 impl ::std::default::Default for GetSwapPriceResponse {
47435 fn default() -> Self {
47436 Self {
47437 block_number: Err("no value supplied for block_number".to_string()),
47438 fees: Err("no value supplied for fees".to_string()),
47439 from_amount: Err("no value supplied for from_amount".to_string()),
47440 from_token: Err("no value supplied for from_token".to_string()),
47441 gas: Err("no value supplied for gas".to_string()),
47442 gas_price: Err("no value supplied for gas_price".to_string()),
47443 issues: Err("no value supplied for issues".to_string()),
47444 liquidity_available: Err(
47445 "no value supplied for liquidity_available".to_string()
47446 ),
47447 min_to_amount: Err("no value supplied for min_to_amount".to_string()),
47448 to_amount: Err("no value supplied for to_amount".to_string()),
47449 to_token: Err("no value supplied for to_token".to_string()),
47450 }
47451 }
47452 }
47453 impl GetSwapPriceResponse {
47454 pub fn block_number<T>(mut self, value: T) -> Self
47455 where
47456 T: ::std::convert::TryInto<super::GetSwapPriceResponseBlockNumber>,
47457 T::Error: ::std::fmt::Display,
47458 {
47459 self.block_number = value.try_into().map_err(|e| {
47460 format!("error converting supplied value for block_number: {}", e)
47461 });
47462 self
47463 }
47464 pub fn fees<T>(mut self, value: T) -> Self
47465 where
47466 T: ::std::convert::TryInto<super::GetSwapPriceResponseFees>,
47467 T::Error: ::std::fmt::Display,
47468 {
47469 self.fees = value
47470 .try_into()
47471 .map_err(|e| format!("error converting supplied value for fees: {}", e));
47472 self
47473 }
47474 pub fn from_amount<T>(mut self, value: T) -> Self
47475 where
47476 T: ::std::convert::TryInto<super::GetSwapPriceResponseFromAmount>,
47477 T::Error: ::std::fmt::Display,
47478 {
47479 self.from_amount = value
47480 .try_into()
47481 .map_err(|e| format!("error converting supplied value for from_amount: {}", e));
47482 self
47483 }
47484 pub fn from_token<T>(mut self, value: T) -> Self
47485 where
47486 T: ::std::convert::TryInto<super::GetSwapPriceResponseFromToken>,
47487 T::Error: ::std::fmt::Display,
47488 {
47489 self.from_token = value
47490 .try_into()
47491 .map_err(|e| format!("error converting supplied value for from_token: {}", e));
47492 self
47493 }
47494 pub fn gas<T>(mut self, value: T) -> Self
47495 where
47496 T: ::std::convert::TryInto<::std::option::Option<super::GetSwapPriceResponseGas>>,
47497 T::Error: ::std::fmt::Display,
47498 {
47499 self.gas = value
47500 .try_into()
47501 .map_err(|e| format!("error converting supplied value for gas: {}", e));
47502 self
47503 }
47504 pub fn gas_price<T>(mut self, value: T) -> Self
47505 where
47506 T: ::std::convert::TryInto<super::GetSwapPriceResponseGasPrice>,
47507 T::Error: ::std::fmt::Display,
47508 {
47509 self.gas_price = value
47510 .try_into()
47511 .map_err(|e| format!("error converting supplied value for gas_price: {}", e));
47512 self
47513 }
47514 pub fn issues<T>(mut self, value: T) -> Self
47515 where
47516 T: ::std::convert::TryInto<super::GetSwapPriceResponseIssues>,
47517 T::Error: ::std::fmt::Display,
47518 {
47519 self.issues = value
47520 .try_into()
47521 .map_err(|e| format!("error converting supplied value for issues: {}", e));
47522 self
47523 }
47524 pub fn liquidity_available<T>(mut self, value: T) -> Self
47525 where
47526 T: ::std::convert::TryInto<bool>,
47527 T::Error: ::std::fmt::Display,
47528 {
47529 self.liquidity_available = value.try_into().map_err(|e| {
47530 format!(
47531 "error converting supplied value for liquidity_available: {}",
47532 e
47533 )
47534 });
47535 self
47536 }
47537 pub fn min_to_amount<T>(mut self, value: T) -> Self
47538 where
47539 T: ::std::convert::TryInto<super::GetSwapPriceResponseMinToAmount>,
47540 T::Error: ::std::fmt::Display,
47541 {
47542 self.min_to_amount = value.try_into().map_err(|e| {
47543 format!("error converting supplied value for min_to_amount: {}", e)
47544 });
47545 self
47546 }
47547 pub fn to_amount<T>(mut self, value: T) -> Self
47548 where
47549 T: ::std::convert::TryInto<super::GetSwapPriceResponseToAmount>,
47550 T::Error: ::std::fmt::Display,
47551 {
47552 self.to_amount = value
47553 .try_into()
47554 .map_err(|e| format!("error converting supplied value for to_amount: {}", e));
47555 self
47556 }
47557 pub fn to_token<T>(mut self, value: T) -> Self
47558 where
47559 T: ::std::convert::TryInto<super::GetSwapPriceResponseToToken>,
47560 T::Error: ::std::fmt::Display,
47561 {
47562 self.to_token = value
47563 .try_into()
47564 .map_err(|e| format!("error converting supplied value for to_token: {}", e));
47565 self
47566 }
47567 }
47568 impl ::std::convert::TryFrom<GetSwapPriceResponse> for super::GetSwapPriceResponse {
47569 type Error = super::error::ConversionError;
47570 fn try_from(
47571 value: GetSwapPriceResponse,
47572 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47573 Ok(Self {
47574 block_number: value.block_number?,
47575 fees: value.fees?,
47576 from_amount: value.from_amount?,
47577 from_token: value.from_token?,
47578 gas: value.gas?,
47579 gas_price: value.gas_price?,
47580 issues: value.issues?,
47581 liquidity_available: value.liquidity_available?,
47582 min_to_amount: value.min_to_amount?,
47583 to_amount: value.to_amount?,
47584 to_token: value.to_token?,
47585 })
47586 }
47587 }
47588 impl ::std::convert::From<super::GetSwapPriceResponse> for GetSwapPriceResponse {
47589 fn from(value: super::GetSwapPriceResponse) -> Self {
47590 Self {
47591 block_number: Ok(value.block_number),
47592 fees: Ok(value.fees),
47593 from_amount: Ok(value.from_amount),
47594 from_token: Ok(value.from_token),
47595 gas: Ok(value.gas),
47596 gas_price: Ok(value.gas_price),
47597 issues: Ok(value.issues),
47598 liquidity_available: Ok(value.liquidity_available),
47599 min_to_amount: Ok(value.min_to_amount),
47600 to_amount: Ok(value.to_amount),
47601 to_token: Ok(value.to_token),
47602 }
47603 }
47604 }
47605 #[derive(Clone, Debug)]
47606 pub struct GetSwapPriceResponseFees {
47607 gas_fee: ::std::result::Result<
47608 ::std::option::Option<super::TokenFee>,
47609 ::std::string::String,
47610 >,
47611 protocol_fee: ::std::result::Result<
47612 ::std::option::Option<super::TokenFee>,
47613 ::std::string::String,
47614 >,
47615 }
47616 impl ::std::default::Default for GetSwapPriceResponseFees {
47617 fn default() -> Self {
47618 Self {
47619 gas_fee: Err("no value supplied for gas_fee".to_string()),
47620 protocol_fee: Err("no value supplied for protocol_fee".to_string()),
47621 }
47622 }
47623 }
47624 impl GetSwapPriceResponseFees {
47625 pub fn gas_fee<T>(mut self, value: T) -> Self
47626 where
47627 T: ::std::convert::TryInto<::std::option::Option<super::TokenFee>>,
47628 T::Error: ::std::fmt::Display,
47629 {
47630 self.gas_fee = value
47631 .try_into()
47632 .map_err(|e| format!("error converting supplied value for gas_fee: {}", e));
47633 self
47634 }
47635 pub fn protocol_fee<T>(mut self, value: T) -> Self
47636 where
47637 T: ::std::convert::TryInto<::std::option::Option<super::TokenFee>>,
47638 T::Error: ::std::fmt::Display,
47639 {
47640 self.protocol_fee = value.try_into().map_err(|e| {
47641 format!("error converting supplied value for protocol_fee: {}", e)
47642 });
47643 self
47644 }
47645 }
47646 impl ::std::convert::TryFrom<GetSwapPriceResponseFees> for super::GetSwapPriceResponseFees {
47647 type Error = super::error::ConversionError;
47648 fn try_from(
47649 value: GetSwapPriceResponseFees,
47650 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47651 Ok(Self {
47652 gas_fee: value.gas_fee?,
47653 protocol_fee: value.protocol_fee?,
47654 })
47655 }
47656 }
47657 impl ::std::convert::From<super::GetSwapPriceResponseFees> for GetSwapPriceResponseFees {
47658 fn from(value: super::GetSwapPriceResponseFees) -> Self {
47659 Self {
47660 gas_fee: Ok(value.gas_fee),
47661 protocol_fee: Ok(value.protocol_fee),
47662 }
47663 }
47664 }
47665 #[derive(Clone, Debug)]
47666 pub struct GetSwapPriceResponseIssues {
47667 allowance: ::std::result::Result<
47668 ::std::option::Option<super::GetSwapPriceResponseIssuesAllowance>,
47669 ::std::string::String,
47670 >,
47671 balance: ::std::result::Result<
47672 ::std::option::Option<super::GetSwapPriceResponseIssuesBalance>,
47673 ::std::string::String,
47674 >,
47675 simulation_incomplete: ::std::result::Result<bool, ::std::string::String>,
47676 }
47677 impl ::std::default::Default for GetSwapPriceResponseIssues {
47678 fn default() -> Self {
47679 Self {
47680 allowance: Err("no value supplied for allowance".to_string()),
47681 balance: Err("no value supplied for balance".to_string()),
47682 simulation_incomplete: Err(
47683 "no value supplied for simulation_incomplete".to_string()
47684 ),
47685 }
47686 }
47687 }
47688 impl GetSwapPriceResponseIssues {
47689 pub fn allowance<T>(mut self, value: T) -> Self
47690 where
47691 T: ::std::convert::TryInto<
47692 ::std::option::Option<super::GetSwapPriceResponseIssuesAllowance>,
47693 >,
47694 T::Error: ::std::fmt::Display,
47695 {
47696 self.allowance = value
47697 .try_into()
47698 .map_err(|e| format!("error converting supplied value for allowance: {}", e));
47699 self
47700 }
47701 pub fn balance<T>(mut self, value: T) -> Self
47702 where
47703 T: ::std::convert::TryInto<
47704 ::std::option::Option<super::GetSwapPriceResponseIssuesBalance>,
47705 >,
47706 T::Error: ::std::fmt::Display,
47707 {
47708 self.balance = value
47709 .try_into()
47710 .map_err(|e| format!("error converting supplied value for balance: {}", e));
47711 self
47712 }
47713 pub fn simulation_incomplete<T>(mut self, value: T) -> Self
47714 where
47715 T: ::std::convert::TryInto<bool>,
47716 T::Error: ::std::fmt::Display,
47717 {
47718 self.simulation_incomplete = value.try_into().map_err(|e| {
47719 format!(
47720 "error converting supplied value for simulation_incomplete: {}",
47721 e
47722 )
47723 });
47724 self
47725 }
47726 }
47727 impl ::std::convert::TryFrom<GetSwapPriceResponseIssues> for super::GetSwapPriceResponseIssues {
47728 type Error = super::error::ConversionError;
47729 fn try_from(
47730 value: GetSwapPriceResponseIssues,
47731 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47732 Ok(Self {
47733 allowance: value.allowance?,
47734 balance: value.balance?,
47735 simulation_incomplete: value.simulation_incomplete?,
47736 })
47737 }
47738 }
47739 impl ::std::convert::From<super::GetSwapPriceResponseIssues> for GetSwapPriceResponseIssues {
47740 fn from(value: super::GetSwapPriceResponseIssues) -> Self {
47741 Self {
47742 allowance: Ok(value.allowance),
47743 balance: Ok(value.balance),
47744 simulation_incomplete: Ok(value.simulation_incomplete),
47745 }
47746 }
47747 }
47748 #[derive(Clone, Debug)]
47749 pub struct GetSwapPriceResponseIssuesAllowance {
47750 current_allowance: ::std::result::Result<
47751 super::GetSwapPriceResponseIssuesAllowanceCurrentAllowance,
47752 ::std::string::String,
47753 >,
47754 spender: ::std::result::Result<
47755 super::GetSwapPriceResponseIssuesAllowanceSpender,
47756 ::std::string::String,
47757 >,
47758 }
47759 impl ::std::default::Default for GetSwapPriceResponseIssuesAllowance {
47760 fn default() -> Self {
47761 Self {
47762 current_allowance: Err("no value supplied for current_allowance".to_string()),
47763 spender: Err("no value supplied for spender".to_string()),
47764 }
47765 }
47766 }
47767 impl GetSwapPriceResponseIssuesAllowance {
47768 pub fn current_allowance<T>(mut self, value: T) -> Self
47769 where
47770 T: ::std::convert::TryInto<
47771 super::GetSwapPriceResponseIssuesAllowanceCurrentAllowance,
47772 >,
47773 T::Error: ::std::fmt::Display,
47774 {
47775 self.current_allowance = value.try_into().map_err(|e| {
47776 format!(
47777 "error converting supplied value for current_allowance: {}",
47778 e
47779 )
47780 });
47781 self
47782 }
47783 pub fn spender<T>(mut self, value: T) -> Self
47784 where
47785 T: ::std::convert::TryInto<super::GetSwapPriceResponseIssuesAllowanceSpender>,
47786 T::Error: ::std::fmt::Display,
47787 {
47788 self.spender = value
47789 .try_into()
47790 .map_err(|e| format!("error converting supplied value for spender: {}", e));
47791 self
47792 }
47793 }
47794 impl ::std::convert::TryFrom<GetSwapPriceResponseIssuesAllowance>
47795 for super::GetSwapPriceResponseIssuesAllowance
47796 {
47797 type Error = super::error::ConversionError;
47798 fn try_from(
47799 value: GetSwapPriceResponseIssuesAllowance,
47800 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47801 Ok(Self {
47802 current_allowance: value.current_allowance?,
47803 spender: value.spender?,
47804 })
47805 }
47806 }
47807 impl ::std::convert::From<super::GetSwapPriceResponseIssuesAllowance>
47808 for GetSwapPriceResponseIssuesAllowance
47809 {
47810 fn from(value: super::GetSwapPriceResponseIssuesAllowance) -> Self {
47811 Self {
47812 current_allowance: Ok(value.current_allowance),
47813 spender: Ok(value.spender),
47814 }
47815 }
47816 }
47817 #[derive(Clone, Debug)]
47818 pub struct GetSwapPriceResponseIssuesBalance {
47819 current_balance: ::std::result::Result<
47820 super::GetSwapPriceResponseIssuesBalanceCurrentBalance,
47821 ::std::string::String,
47822 >,
47823 required_balance: ::std::result::Result<
47824 super::GetSwapPriceResponseIssuesBalanceRequiredBalance,
47825 ::std::string::String,
47826 >,
47827 token: ::std::result::Result<
47828 super::GetSwapPriceResponseIssuesBalanceToken,
47829 ::std::string::String,
47830 >,
47831 }
47832 impl ::std::default::Default for GetSwapPriceResponseIssuesBalance {
47833 fn default() -> Self {
47834 Self {
47835 current_balance: Err("no value supplied for current_balance".to_string()),
47836 required_balance: Err("no value supplied for required_balance".to_string()),
47837 token: Err("no value supplied for token".to_string()),
47838 }
47839 }
47840 }
47841 impl GetSwapPriceResponseIssuesBalance {
47842 pub fn current_balance<T>(mut self, value: T) -> Self
47843 where
47844 T: ::std::convert::TryInto<super::GetSwapPriceResponseIssuesBalanceCurrentBalance>,
47845 T::Error: ::std::fmt::Display,
47846 {
47847 self.current_balance = value.try_into().map_err(|e| {
47848 format!("error converting supplied value for current_balance: {}", e)
47849 });
47850 self
47851 }
47852 pub fn required_balance<T>(mut self, value: T) -> Self
47853 where
47854 T: ::std::convert::TryInto<super::GetSwapPriceResponseIssuesBalanceRequiredBalance>,
47855 T::Error: ::std::fmt::Display,
47856 {
47857 self.required_balance = value.try_into().map_err(|e| {
47858 format!(
47859 "error converting supplied value for required_balance: {}",
47860 e
47861 )
47862 });
47863 self
47864 }
47865 pub fn token<T>(mut self, value: T) -> Self
47866 where
47867 T: ::std::convert::TryInto<super::GetSwapPriceResponseIssuesBalanceToken>,
47868 T::Error: ::std::fmt::Display,
47869 {
47870 self.token = value
47871 .try_into()
47872 .map_err(|e| format!("error converting supplied value for token: {}", e));
47873 self
47874 }
47875 }
47876 impl ::std::convert::TryFrom<GetSwapPriceResponseIssuesBalance>
47877 for super::GetSwapPriceResponseIssuesBalance
47878 {
47879 type Error = super::error::ConversionError;
47880 fn try_from(
47881 value: GetSwapPriceResponseIssuesBalance,
47882 ) -> ::std::result::Result<Self, super::error::ConversionError> {
47883 Ok(Self {
47884 current_balance: value.current_balance?,
47885 required_balance: value.required_balance?,
47886 token: value.token?,
47887 })
47888 }
47889 }
47890 impl ::std::convert::From<super::GetSwapPriceResponseIssuesBalance>
47891 for GetSwapPriceResponseIssuesBalance
47892 {
47893 fn from(value: super::GetSwapPriceResponseIssuesBalance) -> Self {
47894 Self {
47895 current_balance: Ok(value.current_balance),
47896 required_balance: Ok(value.required_balance),
47897 token: Ok(value.token),
47898 }
47899 }
47900 }
47901 #[derive(Clone, Debug)]
47902 pub struct Idl {
47903 address: ::std::result::Result<::std::string::String, ::std::string::String>,
47904 instructions: ::std::result::Result<
47905 ::std::vec::Vec<super::IdlInstructionsItem>,
47906 ::std::string::String,
47907 >,
47908 metadata: ::std::result::Result<
47909 ::std::option::Option<super::IdlMetadata>,
47910 ::std::string::String,
47911 >,
47912 types: ::std::result::Result<
47913 ::std::vec::Vec<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
47914 ::std::string::String,
47915 >,
47916 }
47917 impl ::std::default::Default for Idl {
47918 fn default() -> Self {
47919 Self {
47920 address: Err("no value supplied for address".to_string()),
47921 instructions: Err("no value supplied for instructions".to_string()),
47922 metadata: Ok(Default::default()),
47923 types: Ok(Default::default()),
47924 }
47925 }
47926 }
47927 impl Idl {
47928 pub fn address<T>(mut self, value: T) -> Self
47929 where
47930 T: ::std::convert::TryInto<::std::string::String>,
47931 T::Error: ::std::fmt::Display,
47932 {
47933 self.address = value
47934 .try_into()
47935 .map_err(|e| format!("error converting supplied value for address: {}", e));
47936 self
47937 }
47938 pub fn instructions<T>(mut self, value: T) -> Self
47939 where
47940 T: ::std::convert::TryInto<::std::vec::Vec<super::IdlInstructionsItem>>,
47941 T::Error: ::std::fmt::Display,
47942 {
47943 self.instructions = value.try_into().map_err(|e| {
47944 format!("error converting supplied value for instructions: {}", e)
47945 });
47946 self
47947 }
47948 pub fn metadata<T>(mut self, value: T) -> Self
47949 where
47950 T: ::std::convert::TryInto<::std::option::Option<super::IdlMetadata>>,
47951 T::Error: ::std::fmt::Display,
47952 {
47953 self.metadata = value
47954 .try_into()
47955 .map_err(|e| format!("error converting supplied value for metadata: {}", e));
47956 self
47957 }
47958 pub fn types<T>(mut self, value: T) -> Self
47959 where
47960 T: ::std::convert::TryInto<
47961 ::std::vec::Vec<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
47962 >,
47963 T::Error: ::std::fmt::Display,
47964 {
47965 self.types = value
47966 .try_into()
47967 .map_err(|e| format!("error converting supplied value for types: {}", e));
47968 self
47969 }
47970 }
47971 impl ::std::convert::TryFrom<Idl> for super::Idl {
47972 type Error = super::error::ConversionError;
47973 fn try_from(value: Idl) -> ::std::result::Result<Self, super::error::ConversionError> {
47974 Ok(Self {
47975 address: value.address?,
47976 instructions: value.instructions?,
47977 metadata: value.metadata?,
47978 types: value.types?,
47979 })
47980 }
47981 }
47982 impl ::std::convert::From<super::Idl> for Idl {
47983 fn from(value: super::Idl) -> Self {
47984 Self {
47985 address: Ok(value.address),
47986 instructions: Ok(value.instructions),
47987 metadata: Ok(value.metadata),
47988 types: Ok(value.types),
47989 }
47990 }
47991 }
47992 #[derive(Clone, Debug)]
47993 pub struct IdlInstructionsItem {
47994 accounts: ::std::result::Result<
47995 ::std::vec::Vec<super::IdlInstructionsItemAccountsItem>,
47996 ::std::string::String,
47997 >,
47998 args: ::std::result::Result<
47999 ::std::vec::Vec<super::IdlInstructionsItemArgsItem>,
48000 ::std::string::String,
48001 >,
48002 discriminator: ::std::result::Result<[u8; 8usize], ::std::string::String>,
48003 name: ::std::result::Result<::std::string::String, ::std::string::String>,
48004 }
48005 impl ::std::default::Default for IdlInstructionsItem {
48006 fn default() -> Self {
48007 Self {
48008 accounts: Ok(Default::default()),
48009 args: Err("no value supplied for args".to_string()),
48010 discriminator: Err("no value supplied for discriminator".to_string()),
48011 name: Err("no value supplied for name".to_string()),
48012 }
48013 }
48014 }
48015 impl IdlInstructionsItem {
48016 pub fn accounts<T>(mut self, value: T) -> Self
48017 where
48018 T: ::std::convert::TryInto<::std::vec::Vec<super::IdlInstructionsItemAccountsItem>>,
48019 T::Error: ::std::fmt::Display,
48020 {
48021 self.accounts = value
48022 .try_into()
48023 .map_err(|e| format!("error converting supplied value for accounts: {}", e));
48024 self
48025 }
48026 pub fn args<T>(mut self, value: T) -> Self
48027 where
48028 T: ::std::convert::TryInto<::std::vec::Vec<super::IdlInstructionsItemArgsItem>>,
48029 T::Error: ::std::fmt::Display,
48030 {
48031 self.args = value
48032 .try_into()
48033 .map_err(|e| format!("error converting supplied value for args: {}", e));
48034 self
48035 }
48036 pub fn discriminator<T>(mut self, value: T) -> Self
48037 where
48038 T: ::std::convert::TryInto<[u8; 8usize]>,
48039 T::Error: ::std::fmt::Display,
48040 {
48041 self.discriminator = value.try_into().map_err(|e| {
48042 format!("error converting supplied value for discriminator: {}", e)
48043 });
48044 self
48045 }
48046 pub fn name<T>(mut self, value: T) -> Self
48047 where
48048 T: ::std::convert::TryInto<::std::string::String>,
48049 T::Error: ::std::fmt::Display,
48050 {
48051 self.name = value
48052 .try_into()
48053 .map_err(|e| format!("error converting supplied value for name: {}", e));
48054 self
48055 }
48056 }
48057 impl ::std::convert::TryFrom<IdlInstructionsItem> for super::IdlInstructionsItem {
48058 type Error = super::error::ConversionError;
48059 fn try_from(
48060 value: IdlInstructionsItem,
48061 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48062 Ok(Self {
48063 accounts: value.accounts?,
48064 args: value.args?,
48065 discriminator: value.discriminator?,
48066 name: value.name?,
48067 })
48068 }
48069 }
48070 impl ::std::convert::From<super::IdlInstructionsItem> for IdlInstructionsItem {
48071 fn from(value: super::IdlInstructionsItem) -> Self {
48072 Self {
48073 accounts: Ok(value.accounts),
48074 args: Ok(value.args),
48075 discriminator: Ok(value.discriminator),
48076 name: Ok(value.name),
48077 }
48078 }
48079 }
48080 #[derive(Clone, Debug)]
48081 pub struct IdlInstructionsItemAccountsItem {
48082 name: ::std::result::Result<::std::string::String, ::std::string::String>,
48083 signer: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
48084 writable: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
48085 }
48086 impl ::std::default::Default for IdlInstructionsItemAccountsItem {
48087 fn default() -> Self {
48088 Self {
48089 name: Err("no value supplied for name".to_string()),
48090 signer: Ok(Default::default()),
48091 writable: Ok(Default::default()),
48092 }
48093 }
48094 }
48095 impl IdlInstructionsItemAccountsItem {
48096 pub fn name<T>(mut self, value: T) -> Self
48097 where
48098 T: ::std::convert::TryInto<::std::string::String>,
48099 T::Error: ::std::fmt::Display,
48100 {
48101 self.name = value
48102 .try_into()
48103 .map_err(|e| format!("error converting supplied value for name: {}", e));
48104 self
48105 }
48106 pub fn signer<T>(mut self, value: T) -> Self
48107 where
48108 T: ::std::convert::TryInto<::std::option::Option<bool>>,
48109 T::Error: ::std::fmt::Display,
48110 {
48111 self.signer = value
48112 .try_into()
48113 .map_err(|e| format!("error converting supplied value for signer: {}", e));
48114 self
48115 }
48116 pub fn writable<T>(mut self, value: T) -> Self
48117 where
48118 T: ::std::convert::TryInto<::std::option::Option<bool>>,
48119 T::Error: ::std::fmt::Display,
48120 {
48121 self.writable = value
48122 .try_into()
48123 .map_err(|e| format!("error converting supplied value for writable: {}", e));
48124 self
48125 }
48126 }
48127 impl ::std::convert::TryFrom<IdlInstructionsItemAccountsItem>
48128 for super::IdlInstructionsItemAccountsItem
48129 {
48130 type Error = super::error::ConversionError;
48131 fn try_from(
48132 value: IdlInstructionsItemAccountsItem,
48133 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48134 Ok(Self {
48135 name: value.name?,
48136 signer: value.signer?,
48137 writable: value.writable?,
48138 })
48139 }
48140 }
48141 impl ::std::convert::From<super::IdlInstructionsItemAccountsItem>
48142 for IdlInstructionsItemAccountsItem
48143 {
48144 fn from(value: super::IdlInstructionsItemAccountsItem) -> Self {
48145 Self {
48146 name: Ok(value.name),
48147 signer: Ok(value.signer),
48148 writable: Ok(value.writable),
48149 }
48150 }
48151 }
48152 #[derive(Clone, Debug)]
48153 pub struct IdlInstructionsItemArgsItem {
48154 name: ::std::result::Result<::std::string::String, ::std::string::String>,
48155 type_: ::std::result::Result<::std::string::String, ::std::string::String>,
48156 }
48157 impl ::std::default::Default for IdlInstructionsItemArgsItem {
48158 fn default() -> Self {
48159 Self {
48160 name: Err("no value supplied for name".to_string()),
48161 type_: Err("no value supplied for type_".to_string()),
48162 }
48163 }
48164 }
48165 impl IdlInstructionsItemArgsItem {
48166 pub fn name<T>(mut self, value: T) -> Self
48167 where
48168 T: ::std::convert::TryInto<::std::string::String>,
48169 T::Error: ::std::fmt::Display,
48170 {
48171 self.name = value
48172 .try_into()
48173 .map_err(|e| format!("error converting supplied value for name: {}", e));
48174 self
48175 }
48176 pub fn type_<T>(mut self, value: T) -> Self
48177 where
48178 T: ::std::convert::TryInto<::std::string::String>,
48179 T::Error: ::std::fmt::Display,
48180 {
48181 self.type_ = value
48182 .try_into()
48183 .map_err(|e| format!("error converting supplied value for type_: {}", e));
48184 self
48185 }
48186 }
48187 impl ::std::convert::TryFrom<IdlInstructionsItemArgsItem> for super::IdlInstructionsItemArgsItem {
48188 type Error = super::error::ConversionError;
48189 fn try_from(
48190 value: IdlInstructionsItemArgsItem,
48191 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48192 Ok(Self {
48193 name: value.name?,
48194 type_: value.type_?,
48195 })
48196 }
48197 }
48198 impl ::std::convert::From<super::IdlInstructionsItemArgsItem> for IdlInstructionsItemArgsItem {
48199 fn from(value: super::IdlInstructionsItemArgsItem) -> Self {
48200 Self {
48201 name: Ok(value.name),
48202 type_: Ok(value.type_),
48203 }
48204 }
48205 }
48206 #[derive(Clone, Debug)]
48207 pub struct IdlMetadata {
48208 name: ::std::result::Result<
48209 ::std::option::Option<::std::string::String>,
48210 ::std::string::String,
48211 >,
48212 spec: ::std::result::Result<
48213 ::std::option::Option<::std::string::String>,
48214 ::std::string::String,
48215 >,
48216 version: ::std::result::Result<
48217 ::std::option::Option<::std::string::String>,
48218 ::std::string::String,
48219 >,
48220 }
48221 impl ::std::default::Default for IdlMetadata {
48222 fn default() -> Self {
48223 Self {
48224 name: Ok(Default::default()),
48225 spec: Ok(Default::default()),
48226 version: Ok(Default::default()),
48227 }
48228 }
48229 }
48230 impl IdlMetadata {
48231 pub fn name<T>(mut self, value: T) -> Self
48232 where
48233 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48234 T::Error: ::std::fmt::Display,
48235 {
48236 self.name = value
48237 .try_into()
48238 .map_err(|e| format!("error converting supplied value for name: {}", e));
48239 self
48240 }
48241 pub fn spec<T>(mut self, value: T) -> Self
48242 where
48243 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48244 T::Error: ::std::fmt::Display,
48245 {
48246 self.spec = value
48247 .try_into()
48248 .map_err(|e| format!("error converting supplied value for spec: {}", e));
48249 self
48250 }
48251 pub fn version<T>(mut self, value: T) -> Self
48252 where
48253 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48254 T::Error: ::std::fmt::Display,
48255 {
48256 self.version = value
48257 .try_into()
48258 .map_err(|e| format!("error converting supplied value for version: {}", e));
48259 self
48260 }
48261 }
48262 impl ::std::convert::TryFrom<IdlMetadata> for super::IdlMetadata {
48263 type Error = super::error::ConversionError;
48264 fn try_from(
48265 value: IdlMetadata,
48266 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48267 Ok(Self {
48268 name: value.name?,
48269 spec: value.spec?,
48270 version: value.version?,
48271 })
48272 }
48273 }
48274 impl ::std::convert::From<super::IdlMetadata> for IdlMetadata {
48275 fn from(value: super::IdlMetadata) -> Self {
48276 Self {
48277 name: Ok(value.name),
48278 spec: Ok(value.spec),
48279 version: Ok(value.version),
48280 }
48281 }
48282 }
48283 #[derive(Clone, Debug)]
48284 pub struct ImportEvmAccountBody {
48285 account_policy: ::std::result::Result<
48286 ::std::option::Option<super::ImportEvmAccountBodyAccountPolicy>,
48287 ::std::string::String,
48288 >,
48289 encrypted_private_key:
48290 ::std::result::Result<::std::string::String, ::std::string::String>,
48291 name: ::std::result::Result<
48292 ::std::option::Option<super::ImportEvmAccountBodyName>,
48293 ::std::string::String,
48294 >,
48295 }
48296 impl ::std::default::Default for ImportEvmAccountBody {
48297 fn default() -> Self {
48298 Self {
48299 account_policy: Ok(Default::default()),
48300 encrypted_private_key: Err(
48301 "no value supplied for encrypted_private_key".to_string()
48302 ),
48303 name: Ok(Default::default()),
48304 }
48305 }
48306 }
48307 impl ImportEvmAccountBody {
48308 pub fn account_policy<T>(mut self, value: T) -> Self
48309 where
48310 T: ::std::convert::TryInto<
48311 ::std::option::Option<super::ImportEvmAccountBodyAccountPolicy>,
48312 >,
48313 T::Error: ::std::fmt::Display,
48314 {
48315 self.account_policy = value.try_into().map_err(|e| {
48316 format!("error converting supplied value for account_policy: {}", e)
48317 });
48318 self
48319 }
48320 pub fn encrypted_private_key<T>(mut self, value: T) -> Self
48321 where
48322 T: ::std::convert::TryInto<::std::string::String>,
48323 T::Error: ::std::fmt::Display,
48324 {
48325 self.encrypted_private_key = value.try_into().map_err(|e| {
48326 format!(
48327 "error converting supplied value for encrypted_private_key: {}",
48328 e
48329 )
48330 });
48331 self
48332 }
48333 pub fn name<T>(mut self, value: T) -> Self
48334 where
48335 T: ::std::convert::TryInto<::std::option::Option<super::ImportEvmAccountBodyName>>,
48336 T::Error: ::std::fmt::Display,
48337 {
48338 self.name = value
48339 .try_into()
48340 .map_err(|e| format!("error converting supplied value for name: {}", e));
48341 self
48342 }
48343 }
48344 impl ::std::convert::TryFrom<ImportEvmAccountBody> for super::ImportEvmAccountBody {
48345 type Error = super::error::ConversionError;
48346 fn try_from(
48347 value: ImportEvmAccountBody,
48348 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48349 Ok(Self {
48350 account_policy: value.account_policy?,
48351 encrypted_private_key: value.encrypted_private_key?,
48352 name: value.name?,
48353 })
48354 }
48355 }
48356 impl ::std::convert::From<super::ImportEvmAccountBody> for ImportEvmAccountBody {
48357 fn from(value: super::ImportEvmAccountBody) -> Self {
48358 Self {
48359 account_policy: Ok(value.account_policy),
48360 encrypted_private_key: Ok(value.encrypted_private_key),
48361 name: Ok(value.name),
48362 }
48363 }
48364 }
48365 #[derive(Clone, Debug)]
48366 pub struct ImportSolanaAccountBody {
48367 encrypted_private_key:
48368 ::std::result::Result<::std::string::String, ::std::string::String>,
48369 name: ::std::result::Result<
48370 ::std::option::Option<super::ImportSolanaAccountBodyName>,
48371 ::std::string::String,
48372 >,
48373 }
48374 impl ::std::default::Default for ImportSolanaAccountBody {
48375 fn default() -> Self {
48376 Self {
48377 encrypted_private_key: Err(
48378 "no value supplied for encrypted_private_key".to_string()
48379 ),
48380 name: Ok(Default::default()),
48381 }
48382 }
48383 }
48384 impl ImportSolanaAccountBody {
48385 pub fn encrypted_private_key<T>(mut self, value: T) -> Self
48386 where
48387 T: ::std::convert::TryInto<::std::string::String>,
48388 T::Error: ::std::fmt::Display,
48389 {
48390 self.encrypted_private_key = value.try_into().map_err(|e| {
48391 format!(
48392 "error converting supplied value for encrypted_private_key: {}",
48393 e
48394 )
48395 });
48396 self
48397 }
48398 pub fn name<T>(mut self, value: T) -> Self
48399 where
48400 T: ::std::convert::TryInto<
48401 ::std::option::Option<super::ImportSolanaAccountBodyName>,
48402 >,
48403 T::Error: ::std::fmt::Display,
48404 {
48405 self.name = value
48406 .try_into()
48407 .map_err(|e| format!("error converting supplied value for name: {}", e));
48408 self
48409 }
48410 }
48411 impl ::std::convert::TryFrom<ImportSolanaAccountBody> for super::ImportSolanaAccountBody {
48412 type Error = super::error::ConversionError;
48413 fn try_from(
48414 value: ImportSolanaAccountBody,
48415 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48416 Ok(Self {
48417 encrypted_private_key: value.encrypted_private_key?,
48418 name: value.name?,
48419 })
48420 }
48421 }
48422 impl ::std::convert::From<super::ImportSolanaAccountBody> for ImportSolanaAccountBody {
48423 fn from(value: super::ImportSolanaAccountBody) -> Self {
48424 Self {
48425 encrypted_private_key: Ok(value.encrypted_private_key),
48426 name: Ok(value.name),
48427 }
48428 }
48429 }
48430 #[derive(Clone, Debug)]
48431 pub struct ListDataTokenBalancesResponse {
48432 balances:
48433 ::std::result::Result<::std::vec::Vec<super::TokenBalance>, ::std::string::String>,
48434 next_page_token: ::std::result::Result<
48435 ::std::option::Option<::std::string::String>,
48436 ::std::string::String,
48437 >,
48438 }
48439 impl ::std::default::Default for ListDataTokenBalancesResponse {
48440 fn default() -> Self {
48441 Self {
48442 balances: Err("no value supplied for balances".to_string()),
48443 next_page_token: Ok(Default::default()),
48444 }
48445 }
48446 }
48447 impl ListDataTokenBalancesResponse {
48448 pub fn balances<T>(mut self, value: T) -> Self
48449 where
48450 T: ::std::convert::TryInto<::std::vec::Vec<super::TokenBalance>>,
48451 T::Error: ::std::fmt::Display,
48452 {
48453 self.balances = value
48454 .try_into()
48455 .map_err(|e| format!("error converting supplied value for balances: {}", e));
48456 self
48457 }
48458 pub fn next_page_token<T>(mut self, value: T) -> Self
48459 where
48460 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48461 T::Error: ::std::fmt::Display,
48462 {
48463 self.next_page_token = value.try_into().map_err(|e| {
48464 format!("error converting supplied value for next_page_token: {}", e)
48465 });
48466 self
48467 }
48468 }
48469 impl ::std::convert::TryFrom<ListDataTokenBalancesResponse>
48470 for super::ListDataTokenBalancesResponse
48471 {
48472 type Error = super::error::ConversionError;
48473 fn try_from(
48474 value: ListDataTokenBalancesResponse,
48475 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48476 Ok(Self {
48477 balances: value.balances?,
48478 next_page_token: value.next_page_token?,
48479 })
48480 }
48481 }
48482 impl ::std::convert::From<super::ListDataTokenBalancesResponse> for ListDataTokenBalancesResponse {
48483 fn from(value: super::ListDataTokenBalancesResponse) -> Self {
48484 Self {
48485 balances: Ok(value.balances),
48486 next_page_token: Ok(value.next_page_token),
48487 }
48488 }
48489 }
48490 #[derive(Clone, Debug)]
48491 pub struct ListEndUsersResponse {
48492 end_users:
48493 ::std::result::Result<::std::vec::Vec<super::EndUser>, ::std::string::String>,
48494 next_page_token: ::std::result::Result<
48495 ::std::option::Option<::std::string::String>,
48496 ::std::string::String,
48497 >,
48498 }
48499 impl ::std::default::Default for ListEndUsersResponse {
48500 fn default() -> Self {
48501 Self {
48502 end_users: Err("no value supplied for end_users".to_string()),
48503 next_page_token: Ok(Default::default()),
48504 }
48505 }
48506 }
48507 impl ListEndUsersResponse {
48508 pub fn end_users<T>(mut self, value: T) -> Self
48509 where
48510 T: ::std::convert::TryInto<::std::vec::Vec<super::EndUser>>,
48511 T::Error: ::std::fmt::Display,
48512 {
48513 self.end_users = value
48514 .try_into()
48515 .map_err(|e| format!("error converting supplied value for end_users: {}", e));
48516 self
48517 }
48518 pub fn next_page_token<T>(mut self, value: T) -> Self
48519 where
48520 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48521 T::Error: ::std::fmt::Display,
48522 {
48523 self.next_page_token = value.try_into().map_err(|e| {
48524 format!("error converting supplied value for next_page_token: {}", e)
48525 });
48526 self
48527 }
48528 }
48529 impl ::std::convert::TryFrom<ListEndUsersResponse> for super::ListEndUsersResponse {
48530 type Error = super::error::ConversionError;
48531 fn try_from(
48532 value: ListEndUsersResponse,
48533 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48534 Ok(Self {
48535 end_users: value.end_users?,
48536 next_page_token: value.next_page_token?,
48537 })
48538 }
48539 }
48540 impl ::std::convert::From<super::ListEndUsersResponse> for ListEndUsersResponse {
48541 fn from(value: super::ListEndUsersResponse) -> Self {
48542 Self {
48543 end_users: Ok(value.end_users),
48544 next_page_token: Ok(value.next_page_token),
48545 }
48546 }
48547 }
48548 #[derive(Clone, Debug)]
48549 pub struct ListEvmAccountsResponse {
48550 accounts:
48551 ::std::result::Result<::std::vec::Vec<super::EvmAccount>, ::std::string::String>,
48552 next_page_token: ::std::result::Result<
48553 ::std::option::Option<::std::string::String>,
48554 ::std::string::String,
48555 >,
48556 }
48557 impl ::std::default::Default for ListEvmAccountsResponse {
48558 fn default() -> Self {
48559 Self {
48560 accounts: Err("no value supplied for accounts".to_string()),
48561 next_page_token: Ok(Default::default()),
48562 }
48563 }
48564 }
48565 impl ListEvmAccountsResponse {
48566 pub fn accounts<T>(mut self, value: T) -> Self
48567 where
48568 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmAccount>>,
48569 T::Error: ::std::fmt::Display,
48570 {
48571 self.accounts = value
48572 .try_into()
48573 .map_err(|e| format!("error converting supplied value for accounts: {}", e));
48574 self
48575 }
48576 pub fn next_page_token<T>(mut self, value: T) -> Self
48577 where
48578 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48579 T::Error: ::std::fmt::Display,
48580 {
48581 self.next_page_token = value.try_into().map_err(|e| {
48582 format!("error converting supplied value for next_page_token: {}", e)
48583 });
48584 self
48585 }
48586 }
48587 impl ::std::convert::TryFrom<ListEvmAccountsResponse> for super::ListEvmAccountsResponse {
48588 type Error = super::error::ConversionError;
48589 fn try_from(
48590 value: ListEvmAccountsResponse,
48591 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48592 Ok(Self {
48593 accounts: value.accounts?,
48594 next_page_token: value.next_page_token?,
48595 })
48596 }
48597 }
48598 impl ::std::convert::From<super::ListEvmAccountsResponse> for ListEvmAccountsResponse {
48599 fn from(value: super::ListEvmAccountsResponse) -> Self {
48600 Self {
48601 accounts: Ok(value.accounts),
48602 next_page_token: Ok(value.next_page_token),
48603 }
48604 }
48605 }
48606 #[derive(Clone, Debug)]
48607 pub struct ListEvmSmartAccountsResponse {
48608 accounts: ::std::result::Result<
48609 ::std::vec::Vec<super::EvmSmartAccount>,
48610 ::std::string::String,
48611 >,
48612 next_page_token: ::std::result::Result<
48613 ::std::option::Option<::std::string::String>,
48614 ::std::string::String,
48615 >,
48616 }
48617 impl ::std::default::Default for ListEvmSmartAccountsResponse {
48618 fn default() -> Self {
48619 Self {
48620 accounts: Err("no value supplied for accounts".to_string()),
48621 next_page_token: Ok(Default::default()),
48622 }
48623 }
48624 }
48625 impl ListEvmSmartAccountsResponse {
48626 pub fn accounts<T>(mut self, value: T) -> Self
48627 where
48628 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmSmartAccount>>,
48629 T::Error: ::std::fmt::Display,
48630 {
48631 self.accounts = value
48632 .try_into()
48633 .map_err(|e| format!("error converting supplied value for accounts: {}", e));
48634 self
48635 }
48636 pub fn next_page_token<T>(mut self, value: T) -> Self
48637 where
48638 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48639 T::Error: ::std::fmt::Display,
48640 {
48641 self.next_page_token = value.try_into().map_err(|e| {
48642 format!("error converting supplied value for next_page_token: {}", e)
48643 });
48644 self
48645 }
48646 }
48647 impl ::std::convert::TryFrom<ListEvmSmartAccountsResponse> for super::ListEvmSmartAccountsResponse {
48648 type Error = super::error::ConversionError;
48649 fn try_from(
48650 value: ListEvmSmartAccountsResponse,
48651 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48652 Ok(Self {
48653 accounts: value.accounts?,
48654 next_page_token: value.next_page_token?,
48655 })
48656 }
48657 }
48658 impl ::std::convert::From<super::ListEvmSmartAccountsResponse> for ListEvmSmartAccountsResponse {
48659 fn from(value: super::ListEvmSmartAccountsResponse) -> Self {
48660 Self {
48661 accounts: Ok(value.accounts),
48662 next_page_token: Ok(value.next_page_token),
48663 }
48664 }
48665 }
48666 #[derive(Clone, Debug)]
48667 pub struct ListEvmTokenBalancesResponse {
48668 balances:
48669 ::std::result::Result<::std::vec::Vec<super::TokenBalance>, ::std::string::String>,
48670 next_page_token: ::std::result::Result<
48671 ::std::option::Option<::std::string::String>,
48672 ::std::string::String,
48673 >,
48674 }
48675 impl ::std::default::Default for ListEvmTokenBalancesResponse {
48676 fn default() -> Self {
48677 Self {
48678 balances: Err("no value supplied for balances".to_string()),
48679 next_page_token: Ok(Default::default()),
48680 }
48681 }
48682 }
48683 impl ListEvmTokenBalancesResponse {
48684 pub fn balances<T>(mut self, value: T) -> Self
48685 where
48686 T: ::std::convert::TryInto<::std::vec::Vec<super::TokenBalance>>,
48687 T::Error: ::std::fmt::Display,
48688 {
48689 self.balances = value
48690 .try_into()
48691 .map_err(|e| format!("error converting supplied value for balances: {}", e));
48692 self
48693 }
48694 pub fn next_page_token<T>(mut self, value: T) -> Self
48695 where
48696 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48697 T::Error: ::std::fmt::Display,
48698 {
48699 self.next_page_token = value.try_into().map_err(|e| {
48700 format!("error converting supplied value for next_page_token: {}", e)
48701 });
48702 self
48703 }
48704 }
48705 impl ::std::convert::TryFrom<ListEvmTokenBalancesResponse> for super::ListEvmTokenBalancesResponse {
48706 type Error = super::error::ConversionError;
48707 fn try_from(
48708 value: ListEvmTokenBalancesResponse,
48709 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48710 Ok(Self {
48711 balances: value.balances?,
48712 next_page_token: value.next_page_token?,
48713 })
48714 }
48715 }
48716 impl ::std::convert::From<super::ListEvmTokenBalancesResponse> for ListEvmTokenBalancesResponse {
48717 fn from(value: super::ListEvmTokenBalancesResponse) -> Self {
48718 Self {
48719 balances: Ok(value.balances),
48720 next_page_token: Ok(value.next_page_token),
48721 }
48722 }
48723 }
48724 #[derive(Clone, Debug)]
48725 pub struct ListPoliciesResponse {
48726 next_page_token: ::std::result::Result<
48727 ::std::option::Option<::std::string::String>,
48728 ::std::string::String,
48729 >,
48730 policies: ::std::result::Result<::std::vec::Vec<super::Policy>, ::std::string::String>,
48731 }
48732 impl ::std::default::Default for ListPoliciesResponse {
48733 fn default() -> Self {
48734 Self {
48735 next_page_token: Ok(Default::default()),
48736 policies: Err("no value supplied for policies".to_string()),
48737 }
48738 }
48739 }
48740 impl ListPoliciesResponse {
48741 pub fn next_page_token<T>(mut self, value: T) -> Self
48742 where
48743 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48744 T::Error: ::std::fmt::Display,
48745 {
48746 self.next_page_token = value.try_into().map_err(|e| {
48747 format!("error converting supplied value for next_page_token: {}", e)
48748 });
48749 self
48750 }
48751 pub fn policies<T>(mut self, value: T) -> Self
48752 where
48753 T: ::std::convert::TryInto<::std::vec::Vec<super::Policy>>,
48754 T::Error: ::std::fmt::Display,
48755 {
48756 self.policies = value
48757 .try_into()
48758 .map_err(|e| format!("error converting supplied value for policies: {}", e));
48759 self
48760 }
48761 }
48762 impl ::std::convert::TryFrom<ListPoliciesResponse> for super::ListPoliciesResponse {
48763 type Error = super::error::ConversionError;
48764 fn try_from(
48765 value: ListPoliciesResponse,
48766 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48767 Ok(Self {
48768 next_page_token: value.next_page_token?,
48769 policies: value.policies?,
48770 })
48771 }
48772 }
48773 impl ::std::convert::From<super::ListPoliciesResponse> for ListPoliciesResponse {
48774 fn from(value: super::ListPoliciesResponse) -> Self {
48775 Self {
48776 next_page_token: Ok(value.next_page_token),
48777 policies: Ok(value.policies),
48778 }
48779 }
48780 }
48781 #[derive(Clone, Debug)]
48782 pub struct ListResponse {
48783 next_page_token: ::std::result::Result<
48784 ::std::option::Option<::std::string::String>,
48785 ::std::string::String,
48786 >,
48787 }
48788 impl ::std::default::Default for ListResponse {
48789 fn default() -> Self {
48790 Self {
48791 next_page_token: Ok(Default::default()),
48792 }
48793 }
48794 }
48795 impl ListResponse {
48796 pub fn next_page_token<T>(mut self, value: T) -> Self
48797 where
48798 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48799 T::Error: ::std::fmt::Display,
48800 {
48801 self.next_page_token = value.try_into().map_err(|e| {
48802 format!("error converting supplied value for next_page_token: {}", e)
48803 });
48804 self
48805 }
48806 }
48807 impl ::std::convert::TryFrom<ListResponse> for super::ListResponse {
48808 type Error = super::error::ConversionError;
48809 fn try_from(
48810 value: ListResponse,
48811 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48812 Ok(Self {
48813 next_page_token: value.next_page_token?,
48814 })
48815 }
48816 }
48817 impl ::std::convert::From<super::ListResponse> for ListResponse {
48818 fn from(value: super::ListResponse) -> Self {
48819 Self {
48820 next_page_token: Ok(value.next_page_token),
48821 }
48822 }
48823 }
48824 #[derive(Clone, Debug)]
48825 pub struct ListSolanaAccountsResponse {
48826 accounts:
48827 ::std::result::Result<::std::vec::Vec<super::SolanaAccount>, ::std::string::String>,
48828 next_page_token: ::std::result::Result<
48829 ::std::option::Option<::std::string::String>,
48830 ::std::string::String,
48831 >,
48832 }
48833 impl ::std::default::Default for ListSolanaAccountsResponse {
48834 fn default() -> Self {
48835 Self {
48836 accounts: Err("no value supplied for accounts".to_string()),
48837 next_page_token: Ok(Default::default()),
48838 }
48839 }
48840 }
48841 impl ListSolanaAccountsResponse {
48842 pub fn accounts<T>(mut self, value: T) -> Self
48843 where
48844 T: ::std::convert::TryInto<::std::vec::Vec<super::SolanaAccount>>,
48845 T::Error: ::std::fmt::Display,
48846 {
48847 self.accounts = value
48848 .try_into()
48849 .map_err(|e| format!("error converting supplied value for accounts: {}", e));
48850 self
48851 }
48852 pub fn next_page_token<T>(mut self, value: T) -> Self
48853 where
48854 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48855 T::Error: ::std::fmt::Display,
48856 {
48857 self.next_page_token = value.try_into().map_err(|e| {
48858 format!("error converting supplied value for next_page_token: {}", e)
48859 });
48860 self
48861 }
48862 }
48863 impl ::std::convert::TryFrom<ListSolanaAccountsResponse> for super::ListSolanaAccountsResponse {
48864 type Error = super::error::ConversionError;
48865 fn try_from(
48866 value: ListSolanaAccountsResponse,
48867 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48868 Ok(Self {
48869 accounts: value.accounts?,
48870 next_page_token: value.next_page_token?,
48871 })
48872 }
48873 }
48874 impl ::std::convert::From<super::ListSolanaAccountsResponse> for ListSolanaAccountsResponse {
48875 fn from(value: super::ListSolanaAccountsResponse) -> Self {
48876 Self {
48877 accounts: Ok(value.accounts),
48878 next_page_token: Ok(value.next_page_token),
48879 }
48880 }
48881 }
48882 #[derive(Clone, Debug)]
48883 pub struct ListSolanaTokenBalancesResponse {
48884 balances: ::std::result::Result<
48885 ::std::vec::Vec<super::SolanaTokenBalance>,
48886 ::std::string::String,
48887 >,
48888 next_page_token: ::std::result::Result<
48889 ::std::option::Option<::std::string::String>,
48890 ::std::string::String,
48891 >,
48892 }
48893 impl ::std::default::Default for ListSolanaTokenBalancesResponse {
48894 fn default() -> Self {
48895 Self {
48896 balances: Err("no value supplied for balances".to_string()),
48897 next_page_token: Ok(Default::default()),
48898 }
48899 }
48900 }
48901 impl ListSolanaTokenBalancesResponse {
48902 pub fn balances<T>(mut self, value: T) -> Self
48903 where
48904 T: ::std::convert::TryInto<::std::vec::Vec<super::SolanaTokenBalance>>,
48905 T::Error: ::std::fmt::Display,
48906 {
48907 self.balances = value
48908 .try_into()
48909 .map_err(|e| format!("error converting supplied value for balances: {}", e));
48910 self
48911 }
48912 pub fn next_page_token<T>(mut self, value: T) -> Self
48913 where
48914 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48915 T::Error: ::std::fmt::Display,
48916 {
48917 self.next_page_token = value.try_into().map_err(|e| {
48918 format!("error converting supplied value for next_page_token: {}", e)
48919 });
48920 self
48921 }
48922 }
48923 impl ::std::convert::TryFrom<ListSolanaTokenBalancesResponse>
48924 for super::ListSolanaTokenBalancesResponse
48925 {
48926 type Error = super::error::ConversionError;
48927 fn try_from(
48928 value: ListSolanaTokenBalancesResponse,
48929 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48930 Ok(Self {
48931 balances: value.balances?,
48932 next_page_token: value.next_page_token?,
48933 })
48934 }
48935 }
48936 impl ::std::convert::From<super::ListSolanaTokenBalancesResponse>
48937 for ListSolanaTokenBalancesResponse
48938 {
48939 fn from(value: super::ListSolanaTokenBalancesResponse) -> Self {
48940 Self {
48941 balances: Ok(value.balances),
48942 next_page_token: Ok(value.next_page_token),
48943 }
48944 }
48945 }
48946 #[derive(Clone, Debug)]
48947 pub struct ListSpendPermissionsResponse {
48948 next_page_token: ::std::result::Result<
48949 ::std::option::Option<::std::string::String>,
48950 ::std::string::String,
48951 >,
48952 spend_permissions: ::std::result::Result<
48953 ::std::vec::Vec<super::SpendPermissionResponseObject>,
48954 ::std::string::String,
48955 >,
48956 }
48957 impl ::std::default::Default for ListSpendPermissionsResponse {
48958 fn default() -> Self {
48959 Self {
48960 next_page_token: Ok(Default::default()),
48961 spend_permissions: Err("no value supplied for spend_permissions".to_string()),
48962 }
48963 }
48964 }
48965 impl ListSpendPermissionsResponse {
48966 pub fn next_page_token<T>(mut self, value: T) -> Self
48967 where
48968 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
48969 T::Error: ::std::fmt::Display,
48970 {
48971 self.next_page_token = value.try_into().map_err(|e| {
48972 format!("error converting supplied value for next_page_token: {}", e)
48973 });
48974 self
48975 }
48976 pub fn spend_permissions<T>(mut self, value: T) -> Self
48977 where
48978 T: ::std::convert::TryInto<::std::vec::Vec<super::SpendPermissionResponseObject>>,
48979 T::Error: ::std::fmt::Display,
48980 {
48981 self.spend_permissions = value.try_into().map_err(|e| {
48982 format!(
48983 "error converting supplied value for spend_permissions: {}",
48984 e
48985 )
48986 });
48987 self
48988 }
48989 }
48990 impl ::std::convert::TryFrom<ListSpendPermissionsResponse> for super::ListSpendPermissionsResponse {
48991 type Error = super::error::ConversionError;
48992 fn try_from(
48993 value: ListSpendPermissionsResponse,
48994 ) -> ::std::result::Result<Self, super::error::ConversionError> {
48995 Ok(Self {
48996 next_page_token: value.next_page_token?,
48997 spend_permissions: value.spend_permissions?,
48998 })
48999 }
49000 }
49001 impl ::std::convert::From<super::ListSpendPermissionsResponse> for ListSpendPermissionsResponse {
49002 fn from(value: super::ListSpendPermissionsResponse) -> Self {
49003 Self {
49004 next_page_token: Ok(value.next_page_token),
49005 spend_permissions: Ok(value.spend_permissions),
49006 }
49007 }
49008 }
49009 #[derive(Clone, Debug)]
49010 pub struct MintAddressCriterion {
49011 addresses: ::std::result::Result<
49012 ::std::vec::Vec<super::MintAddressCriterionAddressesItem>,
49013 ::std::string::String,
49014 >,
49015 operator:
49016 ::std::result::Result<super::MintAddressCriterionOperator, ::std::string::String>,
49017 type_: ::std::result::Result<super::MintAddressCriterionType, ::std::string::String>,
49018 }
49019 impl ::std::default::Default for MintAddressCriterion {
49020 fn default() -> Self {
49021 Self {
49022 addresses: Err("no value supplied for addresses".to_string()),
49023 operator: Err("no value supplied for operator".to_string()),
49024 type_: Err("no value supplied for type_".to_string()),
49025 }
49026 }
49027 }
49028 impl MintAddressCriterion {
49029 pub fn addresses<T>(mut self, value: T) -> Self
49030 where
49031 T: ::std::convert::TryInto<
49032 ::std::vec::Vec<super::MintAddressCriterionAddressesItem>,
49033 >,
49034 T::Error: ::std::fmt::Display,
49035 {
49036 self.addresses = value
49037 .try_into()
49038 .map_err(|e| format!("error converting supplied value for addresses: {}", e));
49039 self
49040 }
49041 pub fn operator<T>(mut self, value: T) -> Self
49042 where
49043 T: ::std::convert::TryInto<super::MintAddressCriterionOperator>,
49044 T::Error: ::std::fmt::Display,
49045 {
49046 self.operator = value
49047 .try_into()
49048 .map_err(|e| format!("error converting supplied value for operator: {}", e));
49049 self
49050 }
49051 pub fn type_<T>(mut self, value: T) -> Self
49052 where
49053 T: ::std::convert::TryInto<super::MintAddressCriterionType>,
49054 T::Error: ::std::fmt::Display,
49055 {
49056 self.type_ = value
49057 .try_into()
49058 .map_err(|e| format!("error converting supplied value for type_: {}", e));
49059 self
49060 }
49061 }
49062 impl ::std::convert::TryFrom<MintAddressCriterion> for super::MintAddressCriterion {
49063 type Error = super::error::ConversionError;
49064 fn try_from(
49065 value: MintAddressCriterion,
49066 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49067 Ok(Self {
49068 addresses: value.addresses?,
49069 operator: value.operator?,
49070 type_: value.type_?,
49071 })
49072 }
49073 }
49074 impl ::std::convert::From<super::MintAddressCriterion> for MintAddressCriterion {
49075 fn from(value: super::MintAddressCriterion) -> Self {
49076 Self {
49077 addresses: Ok(value.addresses),
49078 operator: Ok(value.operator),
49079 type_: Ok(value.type_),
49080 }
49081 }
49082 }
49083 #[derive(Clone, Debug)]
49084 pub struct NetUsdChangeCriterion {
49085 change_cents: ::std::result::Result<i64, ::std::string::String>,
49086 operator:
49087 ::std::result::Result<super::NetUsdChangeCriterionOperator, ::std::string::String>,
49088 type_: ::std::result::Result<super::NetUsdChangeCriterionType, ::std::string::String>,
49089 }
49090 impl ::std::default::Default for NetUsdChangeCriterion {
49091 fn default() -> Self {
49092 Self {
49093 change_cents: Err("no value supplied for change_cents".to_string()),
49094 operator: Err("no value supplied for operator".to_string()),
49095 type_: Err("no value supplied for type_".to_string()),
49096 }
49097 }
49098 }
49099 impl NetUsdChangeCriterion {
49100 pub fn change_cents<T>(mut self, value: T) -> Self
49101 where
49102 T: ::std::convert::TryInto<i64>,
49103 T::Error: ::std::fmt::Display,
49104 {
49105 self.change_cents = value.try_into().map_err(|e| {
49106 format!("error converting supplied value for change_cents: {}", e)
49107 });
49108 self
49109 }
49110 pub fn operator<T>(mut self, value: T) -> Self
49111 where
49112 T: ::std::convert::TryInto<super::NetUsdChangeCriterionOperator>,
49113 T::Error: ::std::fmt::Display,
49114 {
49115 self.operator = value
49116 .try_into()
49117 .map_err(|e| format!("error converting supplied value for operator: {}", e));
49118 self
49119 }
49120 pub fn type_<T>(mut self, value: T) -> Self
49121 where
49122 T: ::std::convert::TryInto<super::NetUsdChangeCriterionType>,
49123 T::Error: ::std::fmt::Display,
49124 {
49125 self.type_ = value
49126 .try_into()
49127 .map_err(|e| format!("error converting supplied value for type_: {}", e));
49128 self
49129 }
49130 }
49131 impl ::std::convert::TryFrom<NetUsdChangeCriterion> for super::NetUsdChangeCriterion {
49132 type Error = super::error::ConversionError;
49133 fn try_from(
49134 value: NetUsdChangeCriterion,
49135 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49136 Ok(Self {
49137 change_cents: value.change_cents?,
49138 operator: value.operator?,
49139 type_: value.type_?,
49140 })
49141 }
49142 }
49143 impl ::std::convert::From<super::NetUsdChangeCriterion> for NetUsdChangeCriterion {
49144 fn from(value: super::NetUsdChangeCriterion) -> Self {
49145 Self {
49146 change_cents: Ok(value.change_cents),
49147 operator: Ok(value.operator),
49148 type_: Ok(value.type_),
49149 }
49150 }
49151 }
49152 #[derive(Clone, Debug)]
49153 pub struct OAuth2Authentication {
49154 email: ::std::result::Result<
49155 ::std::option::Option<::std::string::String>,
49156 ::std::string::String,
49157 >,
49158 name: ::std::result::Result<
49159 ::std::option::Option<::std::string::String>,
49160 ::std::string::String,
49161 >,
49162 sub: ::std::result::Result<::std::string::String, ::std::string::String>,
49163 type_: ::std::result::Result<super::OAuth2ProviderType, ::std::string::String>,
49164 username: ::std::result::Result<
49165 ::std::option::Option<::std::string::String>,
49166 ::std::string::String,
49167 >,
49168 }
49169 impl ::std::default::Default for OAuth2Authentication {
49170 fn default() -> Self {
49171 Self {
49172 email: Ok(Default::default()),
49173 name: Ok(Default::default()),
49174 sub: Err("no value supplied for sub".to_string()),
49175 type_: Err("no value supplied for type_".to_string()),
49176 username: Ok(Default::default()),
49177 }
49178 }
49179 }
49180 impl OAuth2Authentication {
49181 pub fn email<T>(mut self, value: T) -> Self
49182 where
49183 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
49184 T::Error: ::std::fmt::Display,
49185 {
49186 self.email = value
49187 .try_into()
49188 .map_err(|e| format!("error converting supplied value for email: {}", e));
49189 self
49190 }
49191 pub fn name<T>(mut self, value: T) -> Self
49192 where
49193 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
49194 T::Error: ::std::fmt::Display,
49195 {
49196 self.name = value
49197 .try_into()
49198 .map_err(|e| format!("error converting supplied value for name: {}", e));
49199 self
49200 }
49201 pub fn sub<T>(mut self, value: T) -> Self
49202 where
49203 T: ::std::convert::TryInto<::std::string::String>,
49204 T::Error: ::std::fmt::Display,
49205 {
49206 self.sub = value
49207 .try_into()
49208 .map_err(|e| format!("error converting supplied value for sub: {}", e));
49209 self
49210 }
49211 pub fn type_<T>(mut self, value: T) -> Self
49212 where
49213 T: ::std::convert::TryInto<super::OAuth2ProviderType>,
49214 T::Error: ::std::fmt::Display,
49215 {
49216 self.type_ = value
49217 .try_into()
49218 .map_err(|e| format!("error converting supplied value for type_: {}", e));
49219 self
49220 }
49221 pub fn username<T>(mut self, value: T) -> Self
49222 where
49223 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
49224 T::Error: ::std::fmt::Display,
49225 {
49226 self.username = value
49227 .try_into()
49228 .map_err(|e| format!("error converting supplied value for username: {}", e));
49229 self
49230 }
49231 }
49232 impl ::std::convert::TryFrom<OAuth2Authentication> for super::OAuth2Authentication {
49233 type Error = super::error::ConversionError;
49234 fn try_from(
49235 value: OAuth2Authentication,
49236 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49237 Ok(Self {
49238 email: value.email?,
49239 name: value.name?,
49240 sub: value.sub?,
49241 type_: value.type_?,
49242 username: value.username?,
49243 })
49244 }
49245 }
49246 impl ::std::convert::From<super::OAuth2Authentication> for OAuth2Authentication {
49247 fn from(value: super::OAuth2Authentication) -> Self {
49248 Self {
49249 email: Ok(value.email),
49250 name: Ok(value.name),
49251 sub: Ok(value.sub),
49252 type_: Ok(value.type_),
49253 username: Ok(value.username),
49254 }
49255 }
49256 }
49257 #[derive(Clone, Debug)]
49258 pub struct OnchainDataQuery {
49259 cache: ::std::result::Result<
49260 ::std::option::Option<super::QueryResultCacheConfiguration>,
49261 ::std::string::String,
49262 >,
49263 sql: ::std::result::Result<super::OnchainDataQuerySql, ::std::string::String>,
49264 }
49265 impl ::std::default::Default for OnchainDataQuery {
49266 fn default() -> Self {
49267 Self {
49268 cache: Ok(Default::default()),
49269 sql: Err("no value supplied for sql".to_string()),
49270 }
49271 }
49272 }
49273 impl OnchainDataQuery {
49274 pub fn cache<T>(mut self, value: T) -> Self
49275 where
49276 T: ::std::convert::TryInto<
49277 ::std::option::Option<super::QueryResultCacheConfiguration>,
49278 >,
49279 T::Error: ::std::fmt::Display,
49280 {
49281 self.cache = value
49282 .try_into()
49283 .map_err(|e| format!("error converting supplied value for cache: {}", e));
49284 self
49285 }
49286 pub fn sql<T>(mut self, value: T) -> Self
49287 where
49288 T: ::std::convert::TryInto<super::OnchainDataQuerySql>,
49289 T::Error: ::std::fmt::Display,
49290 {
49291 self.sql = value
49292 .try_into()
49293 .map_err(|e| format!("error converting supplied value for sql: {}", e));
49294 self
49295 }
49296 }
49297 impl ::std::convert::TryFrom<OnchainDataQuery> for super::OnchainDataQuery {
49298 type Error = super::error::ConversionError;
49299 fn try_from(
49300 value: OnchainDataQuery,
49301 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49302 Ok(Self {
49303 cache: value.cache?,
49304 sql: value.sql?,
49305 })
49306 }
49307 }
49308 impl ::std::convert::From<super::OnchainDataQuery> for OnchainDataQuery {
49309 fn from(value: super::OnchainDataQuery) -> Self {
49310 Self {
49311 cache: Ok(value.cache),
49312 sql: Ok(value.sql),
49313 }
49314 }
49315 }
49316 #[derive(Clone, Debug)]
49317 pub struct OnchainDataResult {
49318 metadata: ::std::result::Result<
49319 ::std::option::Option<super::OnchainDataResultMetadata>,
49320 ::std::string::String,
49321 >,
49322 result: ::std::result::Result<
49323 ::std::vec::Vec<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
49324 ::std::string::String,
49325 >,
49326 schema: ::std::result::Result<
49327 ::std::option::Option<super::OnchainDataResultSchema>,
49328 ::std::string::String,
49329 >,
49330 }
49331 impl ::std::default::Default for OnchainDataResult {
49332 fn default() -> Self {
49333 Self {
49334 metadata: Ok(Default::default()),
49335 result: Ok(Default::default()),
49336 schema: Ok(Default::default()),
49337 }
49338 }
49339 }
49340 impl OnchainDataResult {
49341 pub fn metadata<T>(mut self, value: T) -> Self
49342 where
49343 T: ::std::convert::TryInto<::std::option::Option<super::OnchainDataResultMetadata>>,
49344 T::Error: ::std::fmt::Display,
49345 {
49346 self.metadata = value
49347 .try_into()
49348 .map_err(|e| format!("error converting supplied value for metadata: {}", e));
49349 self
49350 }
49351 pub fn result<T>(mut self, value: T) -> Self
49352 where
49353 T: ::std::convert::TryInto<
49354 ::std::vec::Vec<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
49355 >,
49356 T::Error: ::std::fmt::Display,
49357 {
49358 self.result = value
49359 .try_into()
49360 .map_err(|e| format!("error converting supplied value for result: {}", e));
49361 self
49362 }
49363 pub fn schema<T>(mut self, value: T) -> Self
49364 where
49365 T: ::std::convert::TryInto<::std::option::Option<super::OnchainDataResultSchema>>,
49366 T::Error: ::std::fmt::Display,
49367 {
49368 self.schema = value
49369 .try_into()
49370 .map_err(|e| format!("error converting supplied value for schema: {}", e));
49371 self
49372 }
49373 }
49374 impl ::std::convert::TryFrom<OnchainDataResult> for super::OnchainDataResult {
49375 type Error = super::error::ConversionError;
49376 fn try_from(
49377 value: OnchainDataResult,
49378 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49379 Ok(Self {
49380 metadata: value.metadata?,
49381 result: value.result?,
49382 schema: value.schema?,
49383 })
49384 }
49385 }
49386 impl ::std::convert::From<super::OnchainDataResult> for OnchainDataResult {
49387 fn from(value: super::OnchainDataResult) -> Self {
49388 Self {
49389 metadata: Ok(value.metadata),
49390 result: Ok(value.result),
49391 schema: Ok(value.schema),
49392 }
49393 }
49394 }
49395 #[derive(Clone, Debug)]
49396 pub struct OnchainDataResultMetadata {
49397 cached: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
49398 execution_time_ms:
49399 ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
49400 execution_timestamp: ::std::result::Result<
49401 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
49402 ::std::string::String,
49403 >,
49404 row_count: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
49405 }
49406 impl ::std::default::Default for OnchainDataResultMetadata {
49407 fn default() -> Self {
49408 Self {
49409 cached: Ok(Default::default()),
49410 execution_time_ms: Ok(Default::default()),
49411 execution_timestamp: Ok(Default::default()),
49412 row_count: Ok(Default::default()),
49413 }
49414 }
49415 }
49416 impl OnchainDataResultMetadata {
49417 pub fn cached<T>(mut self, value: T) -> Self
49418 where
49419 T: ::std::convert::TryInto<::std::option::Option<bool>>,
49420 T::Error: ::std::fmt::Display,
49421 {
49422 self.cached = value
49423 .try_into()
49424 .map_err(|e| format!("error converting supplied value for cached: {}", e));
49425 self
49426 }
49427 pub fn execution_time_ms<T>(mut self, value: T) -> Self
49428 where
49429 T: ::std::convert::TryInto<::std::option::Option<i64>>,
49430 T::Error: ::std::fmt::Display,
49431 {
49432 self.execution_time_ms = value.try_into().map_err(|e| {
49433 format!(
49434 "error converting supplied value for execution_time_ms: {}",
49435 e
49436 )
49437 });
49438 self
49439 }
49440 pub fn execution_timestamp<T>(mut self, value: T) -> Self
49441 where
49442 T: ::std::convert::TryInto<
49443 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
49444 >,
49445 T::Error: ::std::fmt::Display,
49446 {
49447 self.execution_timestamp = value.try_into().map_err(|e| {
49448 format!(
49449 "error converting supplied value for execution_timestamp: {}",
49450 e
49451 )
49452 });
49453 self
49454 }
49455 pub fn row_count<T>(mut self, value: T) -> Self
49456 where
49457 T: ::std::convert::TryInto<::std::option::Option<i64>>,
49458 T::Error: ::std::fmt::Display,
49459 {
49460 self.row_count = value
49461 .try_into()
49462 .map_err(|e| format!("error converting supplied value for row_count: {}", e));
49463 self
49464 }
49465 }
49466 impl ::std::convert::TryFrom<OnchainDataResultMetadata> for super::OnchainDataResultMetadata {
49467 type Error = super::error::ConversionError;
49468 fn try_from(
49469 value: OnchainDataResultMetadata,
49470 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49471 Ok(Self {
49472 cached: value.cached?,
49473 execution_time_ms: value.execution_time_ms?,
49474 execution_timestamp: value.execution_timestamp?,
49475 row_count: value.row_count?,
49476 })
49477 }
49478 }
49479 impl ::std::convert::From<super::OnchainDataResultMetadata> for OnchainDataResultMetadata {
49480 fn from(value: super::OnchainDataResultMetadata) -> Self {
49481 Self {
49482 cached: Ok(value.cached),
49483 execution_time_ms: Ok(value.execution_time_ms),
49484 execution_timestamp: Ok(value.execution_timestamp),
49485 row_count: Ok(value.row_count),
49486 }
49487 }
49488 }
49489 #[derive(Clone, Debug)]
49490 pub struct OnchainDataResultSchema {
49491 columns: ::std::result::Result<
49492 ::std::vec::Vec<super::OnchainDataResultSchemaColumnsItem>,
49493 ::std::string::String,
49494 >,
49495 }
49496 impl ::std::default::Default for OnchainDataResultSchema {
49497 fn default() -> Self {
49498 Self {
49499 columns: Ok(Default::default()),
49500 }
49501 }
49502 }
49503 impl OnchainDataResultSchema {
49504 pub fn columns<T>(mut self, value: T) -> Self
49505 where
49506 T: ::std::convert::TryInto<
49507 ::std::vec::Vec<super::OnchainDataResultSchemaColumnsItem>,
49508 >,
49509 T::Error: ::std::fmt::Display,
49510 {
49511 self.columns = value
49512 .try_into()
49513 .map_err(|e| format!("error converting supplied value for columns: {}", e));
49514 self
49515 }
49516 }
49517 impl ::std::convert::TryFrom<OnchainDataResultSchema> for super::OnchainDataResultSchema {
49518 type Error = super::error::ConversionError;
49519 fn try_from(
49520 value: OnchainDataResultSchema,
49521 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49522 Ok(Self {
49523 columns: value.columns?,
49524 })
49525 }
49526 }
49527 impl ::std::convert::From<super::OnchainDataResultSchema> for OnchainDataResultSchema {
49528 fn from(value: super::OnchainDataResultSchema) -> Self {
49529 Self {
49530 columns: Ok(value.columns),
49531 }
49532 }
49533 }
49534 #[derive(Clone, Debug)]
49535 pub struct OnchainDataResultSchemaColumnsItem {
49536 name: ::std::result::Result<
49537 ::std::option::Option<::std::string::String>,
49538 ::std::string::String,
49539 >,
49540 type_: ::std::result::Result<
49541 ::std::option::Option<super::OnchainDataResultSchemaColumnsItemType>,
49542 ::std::string::String,
49543 >,
49544 }
49545 impl ::std::default::Default for OnchainDataResultSchemaColumnsItem {
49546 fn default() -> Self {
49547 Self {
49548 name: Ok(Default::default()),
49549 type_: Ok(Default::default()),
49550 }
49551 }
49552 }
49553 impl OnchainDataResultSchemaColumnsItem {
49554 pub fn name<T>(mut self, value: T) -> Self
49555 where
49556 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
49557 T::Error: ::std::fmt::Display,
49558 {
49559 self.name = value
49560 .try_into()
49561 .map_err(|e| format!("error converting supplied value for name: {}", e));
49562 self
49563 }
49564 pub fn type_<T>(mut self, value: T) -> Self
49565 where
49566 T: ::std::convert::TryInto<
49567 ::std::option::Option<super::OnchainDataResultSchemaColumnsItemType>,
49568 >,
49569 T::Error: ::std::fmt::Display,
49570 {
49571 self.type_ = value
49572 .try_into()
49573 .map_err(|e| format!("error converting supplied value for type_: {}", e));
49574 self
49575 }
49576 }
49577 impl ::std::convert::TryFrom<OnchainDataResultSchemaColumnsItem>
49578 for super::OnchainDataResultSchemaColumnsItem
49579 {
49580 type Error = super::error::ConversionError;
49581 fn try_from(
49582 value: OnchainDataResultSchemaColumnsItem,
49583 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49584 Ok(Self {
49585 name: value.name?,
49586 type_: value.type_?,
49587 })
49588 }
49589 }
49590 impl ::std::convert::From<super::OnchainDataResultSchemaColumnsItem>
49591 for OnchainDataResultSchemaColumnsItem
49592 {
49593 fn from(value: super::OnchainDataResultSchemaColumnsItem) -> Self {
49594 Self {
49595 name: Ok(value.name),
49596 type_: Ok(value.type_),
49597 }
49598 }
49599 }
49600 #[derive(Clone, Debug)]
49601 pub struct OnrampOrder {
49602 created_at: ::std::result::Result<::std::string::String, ::std::string::String>,
49603 destination_address:
49604 ::std::result::Result<::std::string::String, ::std::string::String>,
49605 destination_network:
49606 ::std::result::Result<::std::string::String, ::std::string::String>,
49607 exchange_rate: ::std::result::Result<::std::string::String, ::std::string::String>,
49608 fees: ::std::result::Result<
49609 ::std::vec::Vec<super::OnrampOrderFee>,
49610 ::std::string::String,
49611 >,
49612 order_id: ::std::result::Result<::std::string::String, ::std::string::String>,
49613 partner_user_ref: ::std::result::Result<
49614 ::std::option::Option<::std::string::String>,
49615 ::std::string::String,
49616 >,
49617 payment_currency: ::std::result::Result<::std::string::String, ::std::string::String>,
49618 payment_method:
49619 ::std::result::Result<super::OnrampOrderPaymentMethodTypeId, ::std::string::String>,
49620 payment_subtotal: ::std::result::Result<::std::string::String, ::std::string::String>,
49621 payment_total: ::std::result::Result<::std::string::String, ::std::string::String>,
49622 purchase_amount: ::std::result::Result<::std::string::String, ::std::string::String>,
49623 purchase_currency: ::std::result::Result<::std::string::String, ::std::string::String>,
49624 status: ::std::result::Result<super::OnrampOrderStatus, ::std::string::String>,
49625 tx_hash: ::std::result::Result<
49626 ::std::option::Option<::std::string::String>,
49627 ::std::string::String,
49628 >,
49629 updated_at: ::std::result::Result<::std::string::String, ::std::string::String>,
49630 }
49631 impl ::std::default::Default for OnrampOrder {
49632 fn default() -> Self {
49633 Self {
49634 created_at: Err("no value supplied for created_at".to_string()),
49635 destination_address: Err(
49636 "no value supplied for destination_address".to_string()
49637 ),
49638 destination_network: Err(
49639 "no value supplied for destination_network".to_string()
49640 ),
49641 exchange_rate: Err("no value supplied for exchange_rate".to_string()),
49642 fees: Err("no value supplied for fees".to_string()),
49643 order_id: Err("no value supplied for order_id".to_string()),
49644 partner_user_ref: Ok(Default::default()),
49645 payment_currency: Err("no value supplied for payment_currency".to_string()),
49646 payment_method: Err("no value supplied for payment_method".to_string()),
49647 payment_subtotal: Err("no value supplied for payment_subtotal".to_string()),
49648 payment_total: Err("no value supplied for payment_total".to_string()),
49649 purchase_amount: Err("no value supplied for purchase_amount".to_string()),
49650 purchase_currency: Err("no value supplied for purchase_currency".to_string()),
49651 status: Err("no value supplied for status".to_string()),
49652 tx_hash: Ok(Default::default()),
49653 updated_at: Err("no value supplied for updated_at".to_string()),
49654 }
49655 }
49656 }
49657 impl OnrampOrder {
49658 pub fn created_at<T>(mut self, value: T) -> Self
49659 where
49660 T: ::std::convert::TryInto<::std::string::String>,
49661 T::Error: ::std::fmt::Display,
49662 {
49663 self.created_at = value
49664 .try_into()
49665 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
49666 self
49667 }
49668 pub fn destination_address<T>(mut self, value: T) -> Self
49669 where
49670 T: ::std::convert::TryInto<::std::string::String>,
49671 T::Error: ::std::fmt::Display,
49672 {
49673 self.destination_address = value.try_into().map_err(|e| {
49674 format!(
49675 "error converting supplied value for destination_address: {}",
49676 e
49677 )
49678 });
49679 self
49680 }
49681 pub fn destination_network<T>(mut self, value: T) -> Self
49682 where
49683 T: ::std::convert::TryInto<::std::string::String>,
49684 T::Error: ::std::fmt::Display,
49685 {
49686 self.destination_network = value.try_into().map_err(|e| {
49687 format!(
49688 "error converting supplied value for destination_network: {}",
49689 e
49690 )
49691 });
49692 self
49693 }
49694 pub fn exchange_rate<T>(mut self, value: T) -> Self
49695 where
49696 T: ::std::convert::TryInto<::std::string::String>,
49697 T::Error: ::std::fmt::Display,
49698 {
49699 self.exchange_rate = value.try_into().map_err(|e| {
49700 format!("error converting supplied value for exchange_rate: {}", e)
49701 });
49702 self
49703 }
49704 pub fn fees<T>(mut self, value: T) -> Self
49705 where
49706 T: ::std::convert::TryInto<::std::vec::Vec<super::OnrampOrderFee>>,
49707 T::Error: ::std::fmt::Display,
49708 {
49709 self.fees = value
49710 .try_into()
49711 .map_err(|e| format!("error converting supplied value for fees: {}", e));
49712 self
49713 }
49714 pub fn order_id<T>(mut self, value: T) -> Self
49715 where
49716 T: ::std::convert::TryInto<::std::string::String>,
49717 T::Error: ::std::fmt::Display,
49718 {
49719 self.order_id = value
49720 .try_into()
49721 .map_err(|e| format!("error converting supplied value for order_id: {}", e));
49722 self
49723 }
49724 pub fn partner_user_ref<T>(mut self, value: T) -> Self
49725 where
49726 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
49727 T::Error: ::std::fmt::Display,
49728 {
49729 self.partner_user_ref = value.try_into().map_err(|e| {
49730 format!(
49731 "error converting supplied value for partner_user_ref: {}",
49732 e
49733 )
49734 });
49735 self
49736 }
49737 pub fn payment_currency<T>(mut self, value: T) -> Self
49738 where
49739 T: ::std::convert::TryInto<::std::string::String>,
49740 T::Error: ::std::fmt::Display,
49741 {
49742 self.payment_currency = value.try_into().map_err(|e| {
49743 format!(
49744 "error converting supplied value for payment_currency: {}",
49745 e
49746 )
49747 });
49748 self
49749 }
49750 pub fn payment_method<T>(mut self, value: T) -> Self
49751 where
49752 T: ::std::convert::TryInto<super::OnrampOrderPaymentMethodTypeId>,
49753 T::Error: ::std::fmt::Display,
49754 {
49755 self.payment_method = value.try_into().map_err(|e| {
49756 format!("error converting supplied value for payment_method: {}", e)
49757 });
49758 self
49759 }
49760 pub fn payment_subtotal<T>(mut self, value: T) -> Self
49761 where
49762 T: ::std::convert::TryInto<::std::string::String>,
49763 T::Error: ::std::fmt::Display,
49764 {
49765 self.payment_subtotal = value.try_into().map_err(|e| {
49766 format!(
49767 "error converting supplied value for payment_subtotal: {}",
49768 e
49769 )
49770 });
49771 self
49772 }
49773 pub fn payment_total<T>(mut self, value: T) -> Self
49774 where
49775 T: ::std::convert::TryInto<::std::string::String>,
49776 T::Error: ::std::fmt::Display,
49777 {
49778 self.payment_total = value.try_into().map_err(|e| {
49779 format!("error converting supplied value for payment_total: {}", e)
49780 });
49781 self
49782 }
49783 pub fn purchase_amount<T>(mut self, value: T) -> Self
49784 where
49785 T: ::std::convert::TryInto<::std::string::String>,
49786 T::Error: ::std::fmt::Display,
49787 {
49788 self.purchase_amount = value.try_into().map_err(|e| {
49789 format!("error converting supplied value for purchase_amount: {}", e)
49790 });
49791 self
49792 }
49793 pub fn purchase_currency<T>(mut self, value: T) -> Self
49794 where
49795 T: ::std::convert::TryInto<::std::string::String>,
49796 T::Error: ::std::fmt::Display,
49797 {
49798 self.purchase_currency = value.try_into().map_err(|e| {
49799 format!(
49800 "error converting supplied value for purchase_currency: {}",
49801 e
49802 )
49803 });
49804 self
49805 }
49806 pub fn status<T>(mut self, value: T) -> Self
49807 where
49808 T: ::std::convert::TryInto<super::OnrampOrderStatus>,
49809 T::Error: ::std::fmt::Display,
49810 {
49811 self.status = value
49812 .try_into()
49813 .map_err(|e| format!("error converting supplied value for status: {}", e));
49814 self
49815 }
49816 pub fn tx_hash<T>(mut self, value: T) -> Self
49817 where
49818 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
49819 T::Error: ::std::fmt::Display,
49820 {
49821 self.tx_hash = value
49822 .try_into()
49823 .map_err(|e| format!("error converting supplied value for tx_hash: {}", e));
49824 self
49825 }
49826 pub fn updated_at<T>(mut self, value: T) -> Self
49827 where
49828 T: ::std::convert::TryInto<::std::string::String>,
49829 T::Error: ::std::fmt::Display,
49830 {
49831 self.updated_at = value
49832 .try_into()
49833 .map_err(|e| format!("error converting supplied value for updated_at: {}", e));
49834 self
49835 }
49836 }
49837 impl ::std::convert::TryFrom<OnrampOrder> for super::OnrampOrder {
49838 type Error = super::error::ConversionError;
49839 fn try_from(
49840 value: OnrampOrder,
49841 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49842 Ok(Self {
49843 created_at: value.created_at?,
49844 destination_address: value.destination_address?,
49845 destination_network: value.destination_network?,
49846 exchange_rate: value.exchange_rate?,
49847 fees: value.fees?,
49848 order_id: value.order_id?,
49849 partner_user_ref: value.partner_user_ref?,
49850 payment_currency: value.payment_currency?,
49851 payment_method: value.payment_method?,
49852 payment_subtotal: value.payment_subtotal?,
49853 payment_total: value.payment_total?,
49854 purchase_amount: value.purchase_amount?,
49855 purchase_currency: value.purchase_currency?,
49856 status: value.status?,
49857 tx_hash: value.tx_hash?,
49858 updated_at: value.updated_at?,
49859 })
49860 }
49861 }
49862 impl ::std::convert::From<super::OnrampOrder> for OnrampOrder {
49863 fn from(value: super::OnrampOrder) -> Self {
49864 Self {
49865 created_at: Ok(value.created_at),
49866 destination_address: Ok(value.destination_address),
49867 destination_network: Ok(value.destination_network),
49868 exchange_rate: Ok(value.exchange_rate),
49869 fees: Ok(value.fees),
49870 order_id: Ok(value.order_id),
49871 partner_user_ref: Ok(value.partner_user_ref),
49872 payment_currency: Ok(value.payment_currency),
49873 payment_method: Ok(value.payment_method),
49874 payment_subtotal: Ok(value.payment_subtotal),
49875 payment_total: Ok(value.payment_total),
49876 purchase_amount: Ok(value.purchase_amount),
49877 purchase_currency: Ok(value.purchase_currency),
49878 status: Ok(value.status),
49879 tx_hash: Ok(value.tx_hash),
49880 updated_at: Ok(value.updated_at),
49881 }
49882 }
49883 }
49884 #[derive(Clone, Debug)]
49885 pub struct OnrampOrderFee {
49886 amount: ::std::result::Result<::std::string::String, ::std::string::String>,
49887 currency: ::std::result::Result<::std::string::String, ::std::string::String>,
49888 type_: ::std::result::Result<super::OnrampOrderFeeType, ::std::string::String>,
49889 }
49890 impl ::std::default::Default for OnrampOrderFee {
49891 fn default() -> Self {
49892 Self {
49893 amount: Err("no value supplied for amount".to_string()),
49894 currency: Err("no value supplied for currency".to_string()),
49895 type_: Err("no value supplied for type_".to_string()),
49896 }
49897 }
49898 }
49899 impl OnrampOrderFee {
49900 pub fn amount<T>(mut self, value: T) -> Self
49901 where
49902 T: ::std::convert::TryInto<::std::string::String>,
49903 T::Error: ::std::fmt::Display,
49904 {
49905 self.amount = value
49906 .try_into()
49907 .map_err(|e| format!("error converting supplied value for amount: {}", e));
49908 self
49909 }
49910 pub fn currency<T>(mut self, value: T) -> Self
49911 where
49912 T: ::std::convert::TryInto<::std::string::String>,
49913 T::Error: ::std::fmt::Display,
49914 {
49915 self.currency = value
49916 .try_into()
49917 .map_err(|e| format!("error converting supplied value for currency: {}", e));
49918 self
49919 }
49920 pub fn type_<T>(mut self, value: T) -> Self
49921 where
49922 T: ::std::convert::TryInto<super::OnrampOrderFeeType>,
49923 T::Error: ::std::fmt::Display,
49924 {
49925 self.type_ = value
49926 .try_into()
49927 .map_err(|e| format!("error converting supplied value for type_: {}", e));
49928 self
49929 }
49930 }
49931 impl ::std::convert::TryFrom<OnrampOrderFee> for super::OnrampOrderFee {
49932 type Error = super::error::ConversionError;
49933 fn try_from(
49934 value: OnrampOrderFee,
49935 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49936 Ok(Self {
49937 amount: value.amount?,
49938 currency: value.currency?,
49939 type_: value.type_?,
49940 })
49941 }
49942 }
49943 impl ::std::convert::From<super::OnrampOrderFee> for OnrampOrderFee {
49944 fn from(value: super::OnrampOrderFee) -> Self {
49945 Self {
49946 amount: Ok(value.amount),
49947 currency: Ok(value.currency),
49948 type_: Ok(value.type_),
49949 }
49950 }
49951 }
49952 #[derive(Clone, Debug)]
49953 pub struct OnrampPaymentLink {
49954 payment_link_type:
49955 ::std::result::Result<super::OnrampPaymentLinkType, ::std::string::String>,
49956 url: ::std::result::Result<super::Url, ::std::string::String>,
49957 }
49958 impl ::std::default::Default for OnrampPaymentLink {
49959 fn default() -> Self {
49960 Self {
49961 payment_link_type: Err("no value supplied for payment_link_type".to_string()),
49962 url: Err("no value supplied for url".to_string()),
49963 }
49964 }
49965 }
49966 impl OnrampPaymentLink {
49967 pub fn payment_link_type<T>(mut self, value: T) -> Self
49968 where
49969 T: ::std::convert::TryInto<super::OnrampPaymentLinkType>,
49970 T::Error: ::std::fmt::Display,
49971 {
49972 self.payment_link_type = value.try_into().map_err(|e| {
49973 format!(
49974 "error converting supplied value for payment_link_type: {}",
49975 e
49976 )
49977 });
49978 self
49979 }
49980 pub fn url<T>(mut self, value: T) -> Self
49981 where
49982 T: ::std::convert::TryInto<super::Url>,
49983 T::Error: ::std::fmt::Display,
49984 {
49985 self.url = value
49986 .try_into()
49987 .map_err(|e| format!("error converting supplied value for url: {}", e));
49988 self
49989 }
49990 }
49991 impl ::std::convert::TryFrom<OnrampPaymentLink> for super::OnrampPaymentLink {
49992 type Error = super::error::ConversionError;
49993 fn try_from(
49994 value: OnrampPaymentLink,
49995 ) -> ::std::result::Result<Self, super::error::ConversionError> {
49996 Ok(Self {
49997 payment_link_type: value.payment_link_type?,
49998 url: value.url?,
49999 })
50000 }
50001 }
50002 impl ::std::convert::From<super::OnrampPaymentLink> for OnrampPaymentLink {
50003 fn from(value: super::OnrampPaymentLink) -> Self {
50004 Self {
50005 payment_link_type: Ok(value.payment_link_type),
50006 url: Ok(value.url),
50007 }
50008 }
50009 }
50010 #[derive(Clone, Debug)]
50011 pub struct OnrampQuote {
50012 destination_network:
50013 ::std::result::Result<::std::string::String, ::std::string::String>,
50014 exchange_rate: ::std::result::Result<::std::string::String, ::std::string::String>,
50015 fees: ::std::result::Result<
50016 ::std::vec::Vec<super::OnrampOrderFee>,
50017 ::std::string::String,
50018 >,
50019 payment_currency: ::std::result::Result<::std::string::String, ::std::string::String>,
50020 payment_subtotal: ::std::result::Result<::std::string::String, ::std::string::String>,
50021 payment_total: ::std::result::Result<::std::string::String, ::std::string::String>,
50022 purchase_amount: ::std::result::Result<::std::string::String, ::std::string::String>,
50023 purchase_currency: ::std::result::Result<::std::string::String, ::std::string::String>,
50024 }
50025 impl ::std::default::Default for OnrampQuote {
50026 fn default() -> Self {
50027 Self {
50028 destination_network: Err(
50029 "no value supplied for destination_network".to_string()
50030 ),
50031 exchange_rate: Err("no value supplied for exchange_rate".to_string()),
50032 fees: Err("no value supplied for fees".to_string()),
50033 payment_currency: Err("no value supplied for payment_currency".to_string()),
50034 payment_subtotal: Err("no value supplied for payment_subtotal".to_string()),
50035 payment_total: Err("no value supplied for payment_total".to_string()),
50036 purchase_amount: Err("no value supplied for purchase_amount".to_string()),
50037 purchase_currency: Err("no value supplied for purchase_currency".to_string()),
50038 }
50039 }
50040 }
50041 impl OnrampQuote {
50042 pub fn destination_network<T>(mut self, value: T) -> Self
50043 where
50044 T: ::std::convert::TryInto<::std::string::String>,
50045 T::Error: ::std::fmt::Display,
50046 {
50047 self.destination_network = value.try_into().map_err(|e| {
50048 format!(
50049 "error converting supplied value for destination_network: {}",
50050 e
50051 )
50052 });
50053 self
50054 }
50055 pub fn exchange_rate<T>(mut self, value: T) -> Self
50056 where
50057 T: ::std::convert::TryInto<::std::string::String>,
50058 T::Error: ::std::fmt::Display,
50059 {
50060 self.exchange_rate = value.try_into().map_err(|e| {
50061 format!("error converting supplied value for exchange_rate: {}", e)
50062 });
50063 self
50064 }
50065 pub fn fees<T>(mut self, value: T) -> Self
50066 where
50067 T: ::std::convert::TryInto<::std::vec::Vec<super::OnrampOrderFee>>,
50068 T::Error: ::std::fmt::Display,
50069 {
50070 self.fees = value
50071 .try_into()
50072 .map_err(|e| format!("error converting supplied value for fees: {}", e));
50073 self
50074 }
50075 pub fn payment_currency<T>(mut self, value: T) -> Self
50076 where
50077 T: ::std::convert::TryInto<::std::string::String>,
50078 T::Error: ::std::fmt::Display,
50079 {
50080 self.payment_currency = value.try_into().map_err(|e| {
50081 format!(
50082 "error converting supplied value for payment_currency: {}",
50083 e
50084 )
50085 });
50086 self
50087 }
50088 pub fn payment_subtotal<T>(mut self, value: T) -> Self
50089 where
50090 T: ::std::convert::TryInto<::std::string::String>,
50091 T::Error: ::std::fmt::Display,
50092 {
50093 self.payment_subtotal = value.try_into().map_err(|e| {
50094 format!(
50095 "error converting supplied value for payment_subtotal: {}",
50096 e
50097 )
50098 });
50099 self
50100 }
50101 pub fn payment_total<T>(mut self, value: T) -> Self
50102 where
50103 T: ::std::convert::TryInto<::std::string::String>,
50104 T::Error: ::std::fmt::Display,
50105 {
50106 self.payment_total = value.try_into().map_err(|e| {
50107 format!("error converting supplied value for payment_total: {}", e)
50108 });
50109 self
50110 }
50111 pub fn purchase_amount<T>(mut self, value: T) -> Self
50112 where
50113 T: ::std::convert::TryInto<::std::string::String>,
50114 T::Error: ::std::fmt::Display,
50115 {
50116 self.purchase_amount = value.try_into().map_err(|e| {
50117 format!("error converting supplied value for purchase_amount: {}", e)
50118 });
50119 self
50120 }
50121 pub fn purchase_currency<T>(mut self, value: T) -> Self
50122 where
50123 T: ::std::convert::TryInto<::std::string::String>,
50124 T::Error: ::std::fmt::Display,
50125 {
50126 self.purchase_currency = value.try_into().map_err(|e| {
50127 format!(
50128 "error converting supplied value for purchase_currency: {}",
50129 e
50130 )
50131 });
50132 self
50133 }
50134 }
50135 impl ::std::convert::TryFrom<OnrampQuote> for super::OnrampQuote {
50136 type Error = super::error::ConversionError;
50137 fn try_from(
50138 value: OnrampQuote,
50139 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50140 Ok(Self {
50141 destination_network: value.destination_network?,
50142 exchange_rate: value.exchange_rate?,
50143 fees: value.fees?,
50144 payment_currency: value.payment_currency?,
50145 payment_subtotal: value.payment_subtotal?,
50146 payment_total: value.payment_total?,
50147 purchase_amount: value.purchase_amount?,
50148 purchase_currency: value.purchase_currency?,
50149 })
50150 }
50151 }
50152 impl ::std::convert::From<super::OnrampQuote> for OnrampQuote {
50153 fn from(value: super::OnrampQuote) -> Self {
50154 Self {
50155 destination_network: Ok(value.destination_network),
50156 exchange_rate: Ok(value.exchange_rate),
50157 fees: Ok(value.fees),
50158 payment_currency: Ok(value.payment_currency),
50159 payment_subtotal: Ok(value.payment_subtotal),
50160 payment_total: Ok(value.payment_total),
50161 purchase_amount: Ok(value.purchase_amount),
50162 purchase_currency: Ok(value.purchase_currency),
50163 }
50164 }
50165 }
50166 #[derive(Clone, Debug)]
50167 pub struct OnrampSession {
50168 onramp_url: ::std::result::Result<super::Url, ::std::string::String>,
50169 }
50170 impl ::std::default::Default for OnrampSession {
50171 fn default() -> Self {
50172 Self {
50173 onramp_url: Err("no value supplied for onramp_url".to_string()),
50174 }
50175 }
50176 }
50177 impl OnrampSession {
50178 pub fn onramp_url<T>(mut self, value: T) -> Self
50179 where
50180 T: ::std::convert::TryInto<super::Url>,
50181 T::Error: ::std::fmt::Display,
50182 {
50183 self.onramp_url = value
50184 .try_into()
50185 .map_err(|e| format!("error converting supplied value for onramp_url: {}", e));
50186 self
50187 }
50188 }
50189 impl ::std::convert::TryFrom<OnrampSession> for super::OnrampSession {
50190 type Error = super::error::ConversionError;
50191 fn try_from(
50192 value: OnrampSession,
50193 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50194 Ok(Self {
50195 onramp_url: value.onramp_url?,
50196 })
50197 }
50198 }
50199 impl ::std::convert::From<super::OnrampSession> for OnrampSession {
50200 fn from(value: super::OnrampSession) -> Self {
50201 Self {
50202 onramp_url: Ok(value.onramp_url),
50203 }
50204 }
50205 }
50206 #[derive(Clone, Debug)]
50207 pub struct Policy {
50208 created_at: ::std::result::Result<::std::string::String, ::std::string::String>,
50209 description: ::std::result::Result<
50210 ::std::option::Option<super::PolicyDescription>,
50211 ::std::string::String,
50212 >,
50213 id: ::std::result::Result<super::PolicyId, ::std::string::String>,
50214 rules: ::std::result::Result<::std::vec::Vec<super::Rule>, ::std::string::String>,
50215 scope: ::std::result::Result<super::PolicyScope, ::std::string::String>,
50216 updated_at: ::std::result::Result<::std::string::String, ::std::string::String>,
50217 }
50218 impl ::std::default::Default for Policy {
50219 fn default() -> Self {
50220 Self {
50221 created_at: Err("no value supplied for created_at".to_string()),
50222 description: Ok(Default::default()),
50223 id: Err("no value supplied for id".to_string()),
50224 rules: Err("no value supplied for rules".to_string()),
50225 scope: Err("no value supplied for scope".to_string()),
50226 updated_at: Err("no value supplied for updated_at".to_string()),
50227 }
50228 }
50229 }
50230 impl Policy {
50231 pub fn created_at<T>(mut self, value: T) -> Self
50232 where
50233 T: ::std::convert::TryInto<::std::string::String>,
50234 T::Error: ::std::fmt::Display,
50235 {
50236 self.created_at = value
50237 .try_into()
50238 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
50239 self
50240 }
50241 pub fn description<T>(mut self, value: T) -> Self
50242 where
50243 T: ::std::convert::TryInto<::std::option::Option<super::PolicyDescription>>,
50244 T::Error: ::std::fmt::Display,
50245 {
50246 self.description = value
50247 .try_into()
50248 .map_err(|e| format!("error converting supplied value for description: {}", e));
50249 self
50250 }
50251 pub fn id<T>(mut self, value: T) -> Self
50252 where
50253 T: ::std::convert::TryInto<super::PolicyId>,
50254 T::Error: ::std::fmt::Display,
50255 {
50256 self.id = value
50257 .try_into()
50258 .map_err(|e| format!("error converting supplied value for id: {}", e));
50259 self
50260 }
50261 pub fn rules<T>(mut self, value: T) -> Self
50262 where
50263 T: ::std::convert::TryInto<::std::vec::Vec<super::Rule>>,
50264 T::Error: ::std::fmt::Display,
50265 {
50266 self.rules = value
50267 .try_into()
50268 .map_err(|e| format!("error converting supplied value for rules: {}", e));
50269 self
50270 }
50271 pub fn scope<T>(mut self, value: T) -> Self
50272 where
50273 T: ::std::convert::TryInto<super::PolicyScope>,
50274 T::Error: ::std::fmt::Display,
50275 {
50276 self.scope = value
50277 .try_into()
50278 .map_err(|e| format!("error converting supplied value for scope: {}", e));
50279 self
50280 }
50281 pub fn updated_at<T>(mut self, value: T) -> Self
50282 where
50283 T: ::std::convert::TryInto<::std::string::String>,
50284 T::Error: ::std::fmt::Display,
50285 {
50286 self.updated_at = value
50287 .try_into()
50288 .map_err(|e| format!("error converting supplied value for updated_at: {}", e));
50289 self
50290 }
50291 }
50292 impl ::std::convert::TryFrom<Policy> for super::Policy {
50293 type Error = super::error::ConversionError;
50294 fn try_from(
50295 value: Policy,
50296 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50297 Ok(Self {
50298 created_at: value.created_at?,
50299 description: value.description?,
50300 id: value.id?,
50301 rules: value.rules?,
50302 scope: value.scope?,
50303 updated_at: value.updated_at?,
50304 })
50305 }
50306 }
50307 impl ::std::convert::From<super::Policy> for Policy {
50308 fn from(value: super::Policy) -> Self {
50309 Self {
50310 created_at: Ok(value.created_at),
50311 description: Ok(value.description),
50312 id: Ok(value.id),
50313 rules: Ok(value.rules),
50314 scope: Ok(value.scope),
50315 updated_at: Ok(value.updated_at),
50316 }
50317 }
50318 }
50319 #[derive(Clone, Debug)]
50320 pub struct PrepareAndSendUserOperationBody {
50321 calls: ::std::result::Result<::std::vec::Vec<super::EvmCall>, ::std::string::String>,
50322 network: ::std::result::Result<super::EvmUserOperationNetwork, ::std::string::String>,
50323 paymaster_url:
50324 ::std::result::Result<::std::option::Option<super::Url>, ::std::string::String>,
50325 }
50326 impl ::std::default::Default for PrepareAndSendUserOperationBody {
50327 fn default() -> Self {
50328 Self {
50329 calls: Err("no value supplied for calls".to_string()),
50330 network: Err("no value supplied for network".to_string()),
50331 paymaster_url: Ok(Default::default()),
50332 }
50333 }
50334 }
50335 impl PrepareAndSendUserOperationBody {
50336 pub fn calls<T>(mut self, value: T) -> Self
50337 where
50338 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmCall>>,
50339 T::Error: ::std::fmt::Display,
50340 {
50341 self.calls = value
50342 .try_into()
50343 .map_err(|e| format!("error converting supplied value for calls: {}", e));
50344 self
50345 }
50346 pub fn network<T>(mut self, value: T) -> Self
50347 where
50348 T: ::std::convert::TryInto<super::EvmUserOperationNetwork>,
50349 T::Error: ::std::fmt::Display,
50350 {
50351 self.network = value
50352 .try_into()
50353 .map_err(|e| format!("error converting supplied value for network: {}", e));
50354 self
50355 }
50356 pub fn paymaster_url<T>(mut self, value: T) -> Self
50357 where
50358 T: ::std::convert::TryInto<::std::option::Option<super::Url>>,
50359 T::Error: ::std::fmt::Display,
50360 {
50361 self.paymaster_url = value.try_into().map_err(|e| {
50362 format!("error converting supplied value for paymaster_url: {}", e)
50363 });
50364 self
50365 }
50366 }
50367 impl ::std::convert::TryFrom<PrepareAndSendUserOperationBody>
50368 for super::PrepareAndSendUserOperationBody
50369 {
50370 type Error = super::error::ConversionError;
50371 fn try_from(
50372 value: PrepareAndSendUserOperationBody,
50373 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50374 Ok(Self {
50375 calls: value.calls?,
50376 network: value.network?,
50377 paymaster_url: value.paymaster_url?,
50378 })
50379 }
50380 }
50381 impl ::std::convert::From<super::PrepareAndSendUserOperationBody>
50382 for PrepareAndSendUserOperationBody
50383 {
50384 fn from(value: super::PrepareAndSendUserOperationBody) -> Self {
50385 Self {
50386 calls: Ok(value.calls),
50387 network: Ok(value.network),
50388 paymaster_url: Ok(value.paymaster_url),
50389 }
50390 }
50391 }
50392 #[derive(Clone, Debug)]
50393 pub struct PrepareUserOperationBody {
50394 calls: ::std::result::Result<::std::vec::Vec<super::EvmCall>, ::std::string::String>,
50395 data_suffix: ::std::result::Result<
50396 ::std::option::Option<super::PrepareUserOperationBodyDataSuffix>,
50397 ::std::string::String,
50398 >,
50399 network: ::std::result::Result<super::EvmUserOperationNetwork, ::std::string::String>,
50400 paymaster_url:
50401 ::std::result::Result<::std::option::Option<super::Url>, ::std::string::String>,
50402 }
50403 impl ::std::default::Default for PrepareUserOperationBody {
50404 fn default() -> Self {
50405 Self {
50406 calls: Err("no value supplied for calls".to_string()),
50407 data_suffix: Ok(Default::default()),
50408 network: Err("no value supplied for network".to_string()),
50409 paymaster_url: Ok(Default::default()),
50410 }
50411 }
50412 }
50413 impl PrepareUserOperationBody {
50414 pub fn calls<T>(mut self, value: T) -> Self
50415 where
50416 T: ::std::convert::TryInto<::std::vec::Vec<super::EvmCall>>,
50417 T::Error: ::std::fmt::Display,
50418 {
50419 self.calls = value
50420 .try_into()
50421 .map_err(|e| format!("error converting supplied value for calls: {}", e));
50422 self
50423 }
50424 pub fn data_suffix<T>(mut self, value: T) -> Self
50425 where
50426 T: ::std::convert::TryInto<
50427 ::std::option::Option<super::PrepareUserOperationBodyDataSuffix>,
50428 >,
50429 T::Error: ::std::fmt::Display,
50430 {
50431 self.data_suffix = value
50432 .try_into()
50433 .map_err(|e| format!("error converting supplied value for data_suffix: {}", e));
50434 self
50435 }
50436 pub fn network<T>(mut self, value: T) -> Self
50437 where
50438 T: ::std::convert::TryInto<super::EvmUserOperationNetwork>,
50439 T::Error: ::std::fmt::Display,
50440 {
50441 self.network = value
50442 .try_into()
50443 .map_err(|e| format!("error converting supplied value for network: {}", e));
50444 self
50445 }
50446 pub fn paymaster_url<T>(mut self, value: T) -> Self
50447 where
50448 T: ::std::convert::TryInto<::std::option::Option<super::Url>>,
50449 T::Error: ::std::fmt::Display,
50450 {
50451 self.paymaster_url = value.try_into().map_err(|e| {
50452 format!("error converting supplied value for paymaster_url: {}", e)
50453 });
50454 self
50455 }
50456 }
50457 impl ::std::convert::TryFrom<PrepareUserOperationBody> for super::PrepareUserOperationBody {
50458 type Error = super::error::ConversionError;
50459 fn try_from(
50460 value: PrepareUserOperationBody,
50461 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50462 Ok(Self {
50463 calls: value.calls?,
50464 data_suffix: value.data_suffix?,
50465 network: value.network?,
50466 paymaster_url: value.paymaster_url?,
50467 })
50468 }
50469 }
50470 impl ::std::convert::From<super::PrepareUserOperationBody> for PrepareUserOperationBody {
50471 fn from(value: super::PrepareUserOperationBody) -> Self {
50472 Self {
50473 calls: Ok(value.calls),
50474 data_suffix: Ok(value.data_suffix),
50475 network: Ok(value.network),
50476 paymaster_url: Ok(value.paymaster_url),
50477 }
50478 }
50479 }
50480 #[derive(Clone, Debug)]
50481 pub struct PrepareUserOperationRule {
50482 action:
50483 ::std::result::Result<super::PrepareUserOperationRuleAction, ::std::string::String>,
50484 criteria:
50485 ::std::result::Result<super::PrepareUserOperationCriteria, ::std::string::String>,
50486 operation: ::std::result::Result<
50487 super::PrepareUserOperationRuleOperation,
50488 ::std::string::String,
50489 >,
50490 }
50491 impl ::std::default::Default for PrepareUserOperationRule {
50492 fn default() -> Self {
50493 Self {
50494 action: Err("no value supplied for action".to_string()),
50495 criteria: Err("no value supplied for criteria".to_string()),
50496 operation: Err("no value supplied for operation".to_string()),
50497 }
50498 }
50499 }
50500 impl PrepareUserOperationRule {
50501 pub fn action<T>(mut self, value: T) -> Self
50502 where
50503 T: ::std::convert::TryInto<super::PrepareUserOperationRuleAction>,
50504 T::Error: ::std::fmt::Display,
50505 {
50506 self.action = value
50507 .try_into()
50508 .map_err(|e| format!("error converting supplied value for action: {}", e));
50509 self
50510 }
50511 pub fn criteria<T>(mut self, value: T) -> Self
50512 where
50513 T: ::std::convert::TryInto<super::PrepareUserOperationCriteria>,
50514 T::Error: ::std::fmt::Display,
50515 {
50516 self.criteria = value
50517 .try_into()
50518 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
50519 self
50520 }
50521 pub fn operation<T>(mut self, value: T) -> Self
50522 where
50523 T: ::std::convert::TryInto<super::PrepareUserOperationRuleOperation>,
50524 T::Error: ::std::fmt::Display,
50525 {
50526 self.operation = value
50527 .try_into()
50528 .map_err(|e| format!("error converting supplied value for operation: {}", e));
50529 self
50530 }
50531 }
50532 impl ::std::convert::TryFrom<PrepareUserOperationRule> for super::PrepareUserOperationRule {
50533 type Error = super::error::ConversionError;
50534 fn try_from(
50535 value: PrepareUserOperationRule,
50536 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50537 Ok(Self {
50538 action: value.action?,
50539 criteria: value.criteria?,
50540 operation: value.operation?,
50541 })
50542 }
50543 }
50544 impl ::std::convert::From<super::PrepareUserOperationRule> for PrepareUserOperationRule {
50545 fn from(value: super::PrepareUserOperationRule) -> Self {
50546 Self {
50547 action: Ok(value.action),
50548 criteria: Ok(value.criteria),
50549 operation: Ok(value.operation),
50550 }
50551 }
50552 }
50553 #[derive(Clone, Debug)]
50554 pub struct ProgramIdCriterion {
50555 operator:
50556 ::std::result::Result<super::ProgramIdCriterionOperator, ::std::string::String>,
50557 program_ids: ::std::result::Result<
50558 ::std::vec::Vec<super::ProgramIdCriterionProgramIdsItem>,
50559 ::std::string::String,
50560 >,
50561 type_: ::std::result::Result<super::ProgramIdCriterionType, ::std::string::String>,
50562 }
50563 impl ::std::default::Default for ProgramIdCriterion {
50564 fn default() -> Self {
50565 Self {
50566 operator: Err("no value supplied for operator".to_string()),
50567 program_ids: Err("no value supplied for program_ids".to_string()),
50568 type_: Err("no value supplied for type_".to_string()),
50569 }
50570 }
50571 }
50572 impl ProgramIdCriterion {
50573 pub fn operator<T>(mut self, value: T) -> Self
50574 where
50575 T: ::std::convert::TryInto<super::ProgramIdCriterionOperator>,
50576 T::Error: ::std::fmt::Display,
50577 {
50578 self.operator = value
50579 .try_into()
50580 .map_err(|e| format!("error converting supplied value for operator: {}", e));
50581 self
50582 }
50583 pub fn program_ids<T>(mut self, value: T) -> Self
50584 where
50585 T: ::std::convert::TryInto<
50586 ::std::vec::Vec<super::ProgramIdCriterionProgramIdsItem>,
50587 >,
50588 T::Error: ::std::fmt::Display,
50589 {
50590 self.program_ids = value
50591 .try_into()
50592 .map_err(|e| format!("error converting supplied value for program_ids: {}", e));
50593 self
50594 }
50595 pub fn type_<T>(mut self, value: T) -> Self
50596 where
50597 T: ::std::convert::TryInto<super::ProgramIdCriterionType>,
50598 T::Error: ::std::fmt::Display,
50599 {
50600 self.type_ = value
50601 .try_into()
50602 .map_err(|e| format!("error converting supplied value for type_: {}", e));
50603 self
50604 }
50605 }
50606 impl ::std::convert::TryFrom<ProgramIdCriterion> for super::ProgramIdCriterion {
50607 type Error = super::error::ConversionError;
50608 fn try_from(
50609 value: ProgramIdCriterion,
50610 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50611 Ok(Self {
50612 operator: value.operator?,
50613 program_ids: value.program_ids?,
50614 type_: value.type_?,
50615 })
50616 }
50617 }
50618 impl ::std::convert::From<super::ProgramIdCriterion> for ProgramIdCriterion {
50619 fn from(value: super::ProgramIdCriterion) -> Self {
50620 Self {
50621 operator: Ok(value.operator),
50622 program_ids: Ok(value.program_ids),
50623 type_: Ok(value.type_),
50624 }
50625 }
50626 }
50627 #[derive(Clone, Debug)]
50628 pub struct QueryResultCacheConfiguration {
50629 max_age_ms: ::std::result::Result<i64, ::std::string::String>,
50630 }
50631 impl ::std::default::Default for QueryResultCacheConfiguration {
50632 fn default() -> Self {
50633 Self {
50634 max_age_ms: Ok(super::defaults::default_u64::<i64, 500>()),
50635 }
50636 }
50637 }
50638 impl QueryResultCacheConfiguration {
50639 pub fn max_age_ms<T>(mut self, value: T) -> Self
50640 where
50641 T: ::std::convert::TryInto<i64>,
50642 T::Error: ::std::fmt::Display,
50643 {
50644 self.max_age_ms = value
50645 .try_into()
50646 .map_err(|e| format!("error converting supplied value for max_age_ms: {}", e));
50647 self
50648 }
50649 }
50650 impl ::std::convert::TryFrom<QueryResultCacheConfiguration>
50651 for super::QueryResultCacheConfiguration
50652 {
50653 type Error = super::error::ConversionError;
50654 fn try_from(
50655 value: QueryResultCacheConfiguration,
50656 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50657 Ok(Self {
50658 max_age_ms: value.max_age_ms?,
50659 })
50660 }
50661 }
50662 impl ::std::convert::From<super::QueryResultCacheConfiguration> for QueryResultCacheConfiguration {
50663 fn from(value: super::QueryResultCacheConfiguration) -> Self {
50664 Self {
50665 max_age_ms: Ok(value.max_age_ms),
50666 }
50667 }
50668 }
50669 #[derive(Clone, Debug)]
50670 pub struct RequestEvmFaucetBody {
50671 address:
50672 ::std::result::Result<super::RequestEvmFaucetBodyAddress, ::std::string::String>,
50673 network:
50674 ::std::result::Result<super::RequestEvmFaucetBodyNetwork, ::std::string::String>,
50675 token: ::std::result::Result<super::RequestEvmFaucetBodyToken, ::std::string::String>,
50676 }
50677 impl ::std::default::Default for RequestEvmFaucetBody {
50678 fn default() -> Self {
50679 Self {
50680 address: Err("no value supplied for address".to_string()),
50681 network: Err("no value supplied for network".to_string()),
50682 token: Err("no value supplied for token".to_string()),
50683 }
50684 }
50685 }
50686 impl RequestEvmFaucetBody {
50687 pub fn address<T>(mut self, value: T) -> Self
50688 where
50689 T: ::std::convert::TryInto<super::RequestEvmFaucetBodyAddress>,
50690 T::Error: ::std::fmt::Display,
50691 {
50692 self.address = value
50693 .try_into()
50694 .map_err(|e| format!("error converting supplied value for address: {}", e));
50695 self
50696 }
50697 pub fn network<T>(mut self, value: T) -> Self
50698 where
50699 T: ::std::convert::TryInto<super::RequestEvmFaucetBodyNetwork>,
50700 T::Error: ::std::fmt::Display,
50701 {
50702 self.network = value
50703 .try_into()
50704 .map_err(|e| format!("error converting supplied value for network: {}", e));
50705 self
50706 }
50707 pub fn token<T>(mut self, value: T) -> Self
50708 where
50709 T: ::std::convert::TryInto<super::RequestEvmFaucetBodyToken>,
50710 T::Error: ::std::fmt::Display,
50711 {
50712 self.token = value
50713 .try_into()
50714 .map_err(|e| format!("error converting supplied value for token: {}", e));
50715 self
50716 }
50717 }
50718 impl ::std::convert::TryFrom<RequestEvmFaucetBody> for super::RequestEvmFaucetBody {
50719 type Error = super::error::ConversionError;
50720 fn try_from(
50721 value: RequestEvmFaucetBody,
50722 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50723 Ok(Self {
50724 address: value.address?,
50725 network: value.network?,
50726 token: value.token?,
50727 })
50728 }
50729 }
50730 impl ::std::convert::From<super::RequestEvmFaucetBody> for RequestEvmFaucetBody {
50731 fn from(value: super::RequestEvmFaucetBody) -> Self {
50732 Self {
50733 address: Ok(value.address),
50734 network: Ok(value.network),
50735 token: Ok(value.token),
50736 }
50737 }
50738 }
50739 #[derive(Clone, Debug)]
50740 pub struct RequestEvmFaucetResponse {
50741 transaction_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
50742 }
50743 impl ::std::default::Default for RequestEvmFaucetResponse {
50744 fn default() -> Self {
50745 Self {
50746 transaction_hash: Err("no value supplied for transaction_hash".to_string()),
50747 }
50748 }
50749 }
50750 impl RequestEvmFaucetResponse {
50751 pub fn transaction_hash<T>(mut self, value: T) -> Self
50752 where
50753 T: ::std::convert::TryInto<::std::string::String>,
50754 T::Error: ::std::fmt::Display,
50755 {
50756 self.transaction_hash = value.try_into().map_err(|e| {
50757 format!(
50758 "error converting supplied value for transaction_hash: {}",
50759 e
50760 )
50761 });
50762 self
50763 }
50764 }
50765 impl ::std::convert::TryFrom<RequestEvmFaucetResponse> for super::RequestEvmFaucetResponse {
50766 type Error = super::error::ConversionError;
50767 fn try_from(
50768 value: RequestEvmFaucetResponse,
50769 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50770 Ok(Self {
50771 transaction_hash: value.transaction_hash?,
50772 })
50773 }
50774 }
50775 impl ::std::convert::From<super::RequestEvmFaucetResponse> for RequestEvmFaucetResponse {
50776 fn from(value: super::RequestEvmFaucetResponse) -> Self {
50777 Self {
50778 transaction_hash: Ok(value.transaction_hash),
50779 }
50780 }
50781 }
50782 #[derive(Clone, Debug)]
50783 pub struct RequestSolanaFaucetBody {
50784 address:
50785 ::std::result::Result<super::RequestSolanaFaucetBodyAddress, ::std::string::String>,
50786 token:
50787 ::std::result::Result<super::RequestSolanaFaucetBodyToken, ::std::string::String>,
50788 }
50789 impl ::std::default::Default for RequestSolanaFaucetBody {
50790 fn default() -> Self {
50791 Self {
50792 address: Err("no value supplied for address".to_string()),
50793 token: Err("no value supplied for token".to_string()),
50794 }
50795 }
50796 }
50797 impl RequestSolanaFaucetBody {
50798 pub fn address<T>(mut self, value: T) -> Self
50799 where
50800 T: ::std::convert::TryInto<super::RequestSolanaFaucetBodyAddress>,
50801 T::Error: ::std::fmt::Display,
50802 {
50803 self.address = value
50804 .try_into()
50805 .map_err(|e| format!("error converting supplied value for address: {}", e));
50806 self
50807 }
50808 pub fn token<T>(mut self, value: T) -> Self
50809 where
50810 T: ::std::convert::TryInto<super::RequestSolanaFaucetBodyToken>,
50811 T::Error: ::std::fmt::Display,
50812 {
50813 self.token = value
50814 .try_into()
50815 .map_err(|e| format!("error converting supplied value for token: {}", e));
50816 self
50817 }
50818 }
50819 impl ::std::convert::TryFrom<RequestSolanaFaucetBody> for super::RequestSolanaFaucetBody {
50820 type Error = super::error::ConversionError;
50821 fn try_from(
50822 value: RequestSolanaFaucetBody,
50823 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50824 Ok(Self {
50825 address: value.address?,
50826 token: value.token?,
50827 })
50828 }
50829 }
50830 impl ::std::convert::From<super::RequestSolanaFaucetBody> for RequestSolanaFaucetBody {
50831 fn from(value: super::RequestSolanaFaucetBody) -> Self {
50832 Self {
50833 address: Ok(value.address),
50834 token: Ok(value.token),
50835 }
50836 }
50837 }
50838 #[derive(Clone, Debug)]
50839 pub struct RequestSolanaFaucetResponse {
50840 transaction_signature:
50841 ::std::result::Result<::std::string::String, ::std::string::String>,
50842 }
50843 impl ::std::default::Default for RequestSolanaFaucetResponse {
50844 fn default() -> Self {
50845 Self {
50846 transaction_signature: Err(
50847 "no value supplied for transaction_signature".to_string()
50848 ),
50849 }
50850 }
50851 }
50852 impl RequestSolanaFaucetResponse {
50853 pub fn transaction_signature<T>(mut self, value: T) -> Self
50854 where
50855 T: ::std::convert::TryInto<::std::string::String>,
50856 T::Error: ::std::fmt::Display,
50857 {
50858 self.transaction_signature = value.try_into().map_err(|e| {
50859 format!(
50860 "error converting supplied value for transaction_signature: {}",
50861 e
50862 )
50863 });
50864 self
50865 }
50866 }
50867 impl ::std::convert::TryFrom<RequestSolanaFaucetResponse> for super::RequestSolanaFaucetResponse {
50868 type Error = super::error::ConversionError;
50869 fn try_from(
50870 value: RequestSolanaFaucetResponse,
50871 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50872 Ok(Self {
50873 transaction_signature: value.transaction_signature?,
50874 })
50875 }
50876 }
50877 impl ::std::convert::From<super::RequestSolanaFaucetResponse> for RequestSolanaFaucetResponse {
50878 fn from(value: super::RequestSolanaFaucetResponse) -> Self {
50879 Self {
50880 transaction_signature: Ok(value.transaction_signature),
50881 }
50882 }
50883 }
50884 #[derive(Clone, Debug)]
50885 pub struct RevokeSpendPermissionRequest {
50886 network: ::std::result::Result<super::SpendPermissionNetwork, ::std::string::String>,
50887 paymaster_url:
50888 ::std::result::Result<::std::option::Option<super::Url>, ::std::string::String>,
50889 permission_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
50890 }
50891 impl ::std::default::Default for RevokeSpendPermissionRequest {
50892 fn default() -> Self {
50893 Self {
50894 network: Err("no value supplied for network".to_string()),
50895 paymaster_url: Ok(Default::default()),
50896 permission_hash: Err("no value supplied for permission_hash".to_string()),
50897 }
50898 }
50899 }
50900 impl RevokeSpendPermissionRequest {
50901 pub fn network<T>(mut self, value: T) -> Self
50902 where
50903 T: ::std::convert::TryInto<super::SpendPermissionNetwork>,
50904 T::Error: ::std::fmt::Display,
50905 {
50906 self.network = value
50907 .try_into()
50908 .map_err(|e| format!("error converting supplied value for network: {}", e));
50909 self
50910 }
50911 pub fn paymaster_url<T>(mut self, value: T) -> Self
50912 where
50913 T: ::std::convert::TryInto<::std::option::Option<super::Url>>,
50914 T::Error: ::std::fmt::Display,
50915 {
50916 self.paymaster_url = value.try_into().map_err(|e| {
50917 format!("error converting supplied value for paymaster_url: {}", e)
50918 });
50919 self
50920 }
50921 pub fn permission_hash<T>(mut self, value: T) -> Self
50922 where
50923 T: ::std::convert::TryInto<::std::string::String>,
50924 T::Error: ::std::fmt::Display,
50925 {
50926 self.permission_hash = value.try_into().map_err(|e| {
50927 format!("error converting supplied value for permission_hash: {}", e)
50928 });
50929 self
50930 }
50931 }
50932 impl ::std::convert::TryFrom<RevokeSpendPermissionRequest> for super::RevokeSpendPermissionRequest {
50933 type Error = super::error::ConversionError;
50934 fn try_from(
50935 value: RevokeSpendPermissionRequest,
50936 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50937 Ok(Self {
50938 network: value.network?,
50939 paymaster_url: value.paymaster_url?,
50940 permission_hash: value.permission_hash?,
50941 })
50942 }
50943 }
50944 impl ::std::convert::From<super::RevokeSpendPermissionRequest> for RevokeSpendPermissionRequest {
50945 fn from(value: super::RevokeSpendPermissionRequest) -> Self {
50946 Self {
50947 network: Ok(value.network),
50948 paymaster_url: Ok(value.paymaster_url),
50949 permission_hash: Ok(value.permission_hash),
50950 }
50951 }
50952 }
50953 #[derive(Clone, Debug)]
50954 pub struct SendEvmTransactionBody {
50955 network:
50956 ::std::result::Result<super::SendEvmTransactionBodyNetwork, ::std::string::String>,
50957 transaction: ::std::result::Result<::std::string::String, ::std::string::String>,
50958 }
50959 impl ::std::default::Default for SendEvmTransactionBody {
50960 fn default() -> Self {
50961 Self {
50962 network: Err("no value supplied for network".to_string()),
50963 transaction: Err("no value supplied for transaction".to_string()),
50964 }
50965 }
50966 }
50967 impl SendEvmTransactionBody {
50968 pub fn network<T>(mut self, value: T) -> Self
50969 where
50970 T: ::std::convert::TryInto<super::SendEvmTransactionBodyNetwork>,
50971 T::Error: ::std::fmt::Display,
50972 {
50973 self.network = value
50974 .try_into()
50975 .map_err(|e| format!("error converting supplied value for network: {}", e));
50976 self
50977 }
50978 pub fn transaction<T>(mut self, value: T) -> Self
50979 where
50980 T: ::std::convert::TryInto<::std::string::String>,
50981 T::Error: ::std::fmt::Display,
50982 {
50983 self.transaction = value
50984 .try_into()
50985 .map_err(|e| format!("error converting supplied value for transaction: {}", e));
50986 self
50987 }
50988 }
50989 impl ::std::convert::TryFrom<SendEvmTransactionBody> for super::SendEvmTransactionBody {
50990 type Error = super::error::ConversionError;
50991 fn try_from(
50992 value: SendEvmTransactionBody,
50993 ) -> ::std::result::Result<Self, super::error::ConversionError> {
50994 Ok(Self {
50995 network: value.network?,
50996 transaction: value.transaction?,
50997 })
50998 }
50999 }
51000 impl ::std::convert::From<super::SendEvmTransactionBody> for SendEvmTransactionBody {
51001 fn from(value: super::SendEvmTransactionBody) -> Self {
51002 Self {
51003 network: Ok(value.network),
51004 transaction: Ok(value.transaction),
51005 }
51006 }
51007 }
51008 #[derive(Clone, Debug)]
51009 pub struct SendEvmTransactionResponse {
51010 transaction_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
51011 }
51012 impl ::std::default::Default for SendEvmTransactionResponse {
51013 fn default() -> Self {
51014 Self {
51015 transaction_hash: Err("no value supplied for transaction_hash".to_string()),
51016 }
51017 }
51018 }
51019 impl SendEvmTransactionResponse {
51020 pub fn transaction_hash<T>(mut self, value: T) -> Self
51021 where
51022 T: ::std::convert::TryInto<::std::string::String>,
51023 T::Error: ::std::fmt::Display,
51024 {
51025 self.transaction_hash = value.try_into().map_err(|e| {
51026 format!(
51027 "error converting supplied value for transaction_hash: {}",
51028 e
51029 )
51030 });
51031 self
51032 }
51033 }
51034 impl ::std::convert::TryFrom<SendEvmTransactionResponse> for super::SendEvmTransactionResponse {
51035 type Error = super::error::ConversionError;
51036 fn try_from(
51037 value: SendEvmTransactionResponse,
51038 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51039 Ok(Self {
51040 transaction_hash: value.transaction_hash?,
51041 })
51042 }
51043 }
51044 impl ::std::convert::From<super::SendEvmTransactionResponse> for SendEvmTransactionResponse {
51045 fn from(value: super::SendEvmTransactionResponse) -> Self {
51046 Self {
51047 transaction_hash: Ok(value.transaction_hash),
51048 }
51049 }
51050 }
51051 #[derive(Clone, Debug)]
51052 pub struct SendEvmTransactionRule {
51053 action:
51054 ::std::result::Result<super::SendEvmTransactionRuleAction, ::std::string::String>,
51055 criteria:
51056 ::std::result::Result<super::SendEvmTransactionCriteria, ::std::string::String>,
51057 operation: ::std::result::Result<
51058 super::SendEvmTransactionRuleOperation,
51059 ::std::string::String,
51060 >,
51061 }
51062 impl ::std::default::Default for SendEvmTransactionRule {
51063 fn default() -> Self {
51064 Self {
51065 action: Err("no value supplied for action".to_string()),
51066 criteria: Err("no value supplied for criteria".to_string()),
51067 operation: Err("no value supplied for operation".to_string()),
51068 }
51069 }
51070 }
51071 impl SendEvmTransactionRule {
51072 pub fn action<T>(mut self, value: T) -> Self
51073 where
51074 T: ::std::convert::TryInto<super::SendEvmTransactionRuleAction>,
51075 T::Error: ::std::fmt::Display,
51076 {
51077 self.action = value
51078 .try_into()
51079 .map_err(|e| format!("error converting supplied value for action: {}", e));
51080 self
51081 }
51082 pub fn criteria<T>(mut self, value: T) -> Self
51083 where
51084 T: ::std::convert::TryInto<super::SendEvmTransactionCriteria>,
51085 T::Error: ::std::fmt::Display,
51086 {
51087 self.criteria = value
51088 .try_into()
51089 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
51090 self
51091 }
51092 pub fn operation<T>(mut self, value: T) -> Self
51093 where
51094 T: ::std::convert::TryInto<super::SendEvmTransactionRuleOperation>,
51095 T::Error: ::std::fmt::Display,
51096 {
51097 self.operation = value
51098 .try_into()
51099 .map_err(|e| format!("error converting supplied value for operation: {}", e));
51100 self
51101 }
51102 }
51103 impl ::std::convert::TryFrom<SendEvmTransactionRule> for super::SendEvmTransactionRule {
51104 type Error = super::error::ConversionError;
51105 fn try_from(
51106 value: SendEvmTransactionRule,
51107 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51108 Ok(Self {
51109 action: value.action?,
51110 criteria: value.criteria?,
51111 operation: value.operation?,
51112 })
51113 }
51114 }
51115 impl ::std::convert::From<super::SendEvmTransactionRule> for SendEvmTransactionRule {
51116 fn from(value: super::SendEvmTransactionRule) -> Self {
51117 Self {
51118 action: Ok(value.action),
51119 criteria: Ok(value.criteria),
51120 operation: Ok(value.operation),
51121 }
51122 }
51123 }
51124 #[derive(Clone, Debug)]
51125 pub struct SendSolTransactionRule {
51126 action:
51127 ::std::result::Result<super::SendSolTransactionRuleAction, ::std::string::String>,
51128 criteria:
51129 ::std::result::Result<super::SendSolTransactionCriteria, ::std::string::String>,
51130 operation: ::std::result::Result<
51131 super::SendSolTransactionRuleOperation,
51132 ::std::string::String,
51133 >,
51134 }
51135 impl ::std::default::Default for SendSolTransactionRule {
51136 fn default() -> Self {
51137 Self {
51138 action: Err("no value supplied for action".to_string()),
51139 criteria: Err("no value supplied for criteria".to_string()),
51140 operation: Err("no value supplied for operation".to_string()),
51141 }
51142 }
51143 }
51144 impl SendSolTransactionRule {
51145 pub fn action<T>(mut self, value: T) -> Self
51146 where
51147 T: ::std::convert::TryInto<super::SendSolTransactionRuleAction>,
51148 T::Error: ::std::fmt::Display,
51149 {
51150 self.action = value
51151 .try_into()
51152 .map_err(|e| format!("error converting supplied value for action: {}", e));
51153 self
51154 }
51155 pub fn criteria<T>(mut self, value: T) -> Self
51156 where
51157 T: ::std::convert::TryInto<super::SendSolTransactionCriteria>,
51158 T::Error: ::std::fmt::Display,
51159 {
51160 self.criteria = value
51161 .try_into()
51162 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
51163 self
51164 }
51165 pub fn operation<T>(mut self, value: T) -> Self
51166 where
51167 T: ::std::convert::TryInto<super::SendSolTransactionRuleOperation>,
51168 T::Error: ::std::fmt::Display,
51169 {
51170 self.operation = value
51171 .try_into()
51172 .map_err(|e| format!("error converting supplied value for operation: {}", e));
51173 self
51174 }
51175 }
51176 impl ::std::convert::TryFrom<SendSolTransactionRule> for super::SendSolTransactionRule {
51177 type Error = super::error::ConversionError;
51178 fn try_from(
51179 value: SendSolTransactionRule,
51180 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51181 Ok(Self {
51182 action: value.action?,
51183 criteria: value.criteria?,
51184 operation: value.operation?,
51185 })
51186 }
51187 }
51188 impl ::std::convert::From<super::SendSolTransactionRule> for SendSolTransactionRule {
51189 fn from(value: super::SendSolTransactionRule) -> Self {
51190 Self {
51191 action: Ok(value.action),
51192 criteria: Ok(value.criteria),
51193 operation: Ok(value.operation),
51194 }
51195 }
51196 }
51197 #[derive(Clone, Debug)]
51198 pub struct SendSolanaTransactionBody {
51199 network: ::std::result::Result<
51200 super::SendSolanaTransactionBodyNetwork,
51201 ::std::string::String,
51202 >,
51203 transaction: ::std::result::Result<::std::string::String, ::std::string::String>,
51204 }
51205 impl ::std::default::Default for SendSolanaTransactionBody {
51206 fn default() -> Self {
51207 Self {
51208 network: Err("no value supplied for network".to_string()),
51209 transaction: Err("no value supplied for transaction".to_string()),
51210 }
51211 }
51212 }
51213 impl SendSolanaTransactionBody {
51214 pub fn network<T>(mut self, value: T) -> Self
51215 where
51216 T: ::std::convert::TryInto<super::SendSolanaTransactionBodyNetwork>,
51217 T::Error: ::std::fmt::Display,
51218 {
51219 self.network = value
51220 .try_into()
51221 .map_err(|e| format!("error converting supplied value for network: {}", e));
51222 self
51223 }
51224 pub fn transaction<T>(mut self, value: T) -> Self
51225 where
51226 T: ::std::convert::TryInto<::std::string::String>,
51227 T::Error: ::std::fmt::Display,
51228 {
51229 self.transaction = value
51230 .try_into()
51231 .map_err(|e| format!("error converting supplied value for transaction: {}", e));
51232 self
51233 }
51234 }
51235 impl ::std::convert::TryFrom<SendSolanaTransactionBody> for super::SendSolanaTransactionBody {
51236 type Error = super::error::ConversionError;
51237 fn try_from(
51238 value: SendSolanaTransactionBody,
51239 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51240 Ok(Self {
51241 network: value.network?,
51242 transaction: value.transaction?,
51243 })
51244 }
51245 }
51246 impl ::std::convert::From<super::SendSolanaTransactionBody> for SendSolanaTransactionBody {
51247 fn from(value: super::SendSolanaTransactionBody) -> Self {
51248 Self {
51249 network: Ok(value.network),
51250 transaction: Ok(value.transaction),
51251 }
51252 }
51253 }
51254 #[derive(Clone, Debug)]
51255 pub struct SendSolanaTransactionResponse {
51256 transaction_signature:
51257 ::std::result::Result<::std::string::String, ::std::string::String>,
51258 }
51259 impl ::std::default::Default for SendSolanaTransactionResponse {
51260 fn default() -> Self {
51261 Self {
51262 transaction_signature: Err(
51263 "no value supplied for transaction_signature".to_string()
51264 ),
51265 }
51266 }
51267 }
51268 impl SendSolanaTransactionResponse {
51269 pub fn transaction_signature<T>(mut self, value: T) -> Self
51270 where
51271 T: ::std::convert::TryInto<::std::string::String>,
51272 T::Error: ::std::fmt::Display,
51273 {
51274 self.transaction_signature = value.try_into().map_err(|e| {
51275 format!(
51276 "error converting supplied value for transaction_signature: {}",
51277 e
51278 )
51279 });
51280 self
51281 }
51282 }
51283 impl ::std::convert::TryFrom<SendSolanaTransactionResponse>
51284 for super::SendSolanaTransactionResponse
51285 {
51286 type Error = super::error::ConversionError;
51287 fn try_from(
51288 value: SendSolanaTransactionResponse,
51289 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51290 Ok(Self {
51291 transaction_signature: value.transaction_signature?,
51292 })
51293 }
51294 }
51295 impl ::std::convert::From<super::SendSolanaTransactionResponse> for SendSolanaTransactionResponse {
51296 fn from(value: super::SendSolanaTransactionResponse) -> Self {
51297 Self {
51298 transaction_signature: Ok(value.transaction_signature),
51299 }
51300 }
51301 }
51302 #[derive(Clone, Debug)]
51303 pub struct SendUserOperationBody {
51304 signature: ::std::result::Result<::std::string::String, ::std::string::String>,
51305 }
51306 impl ::std::default::Default for SendUserOperationBody {
51307 fn default() -> Self {
51308 Self {
51309 signature: Err("no value supplied for signature".to_string()),
51310 }
51311 }
51312 }
51313 impl SendUserOperationBody {
51314 pub fn signature<T>(mut self, value: T) -> Self
51315 where
51316 T: ::std::convert::TryInto<::std::string::String>,
51317 T::Error: ::std::fmt::Display,
51318 {
51319 self.signature = value
51320 .try_into()
51321 .map_err(|e| format!("error converting supplied value for signature: {}", e));
51322 self
51323 }
51324 }
51325 impl ::std::convert::TryFrom<SendUserOperationBody> for super::SendUserOperationBody {
51326 type Error = super::error::ConversionError;
51327 fn try_from(
51328 value: SendUserOperationBody,
51329 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51330 Ok(Self {
51331 signature: value.signature?,
51332 })
51333 }
51334 }
51335 impl ::std::convert::From<super::SendUserOperationBody> for SendUserOperationBody {
51336 fn from(value: super::SendUserOperationBody) -> Self {
51337 Self {
51338 signature: Ok(value.signature),
51339 }
51340 }
51341 }
51342 #[derive(Clone, Debug)]
51343 pub struct SendUserOperationRule {
51344 action:
51345 ::std::result::Result<super::SendUserOperationRuleAction, ::std::string::String>,
51346 criteria:
51347 ::std::result::Result<super::SendUserOperationCriteria, ::std::string::String>,
51348 operation:
51349 ::std::result::Result<super::SendUserOperationRuleOperation, ::std::string::String>,
51350 }
51351 impl ::std::default::Default for SendUserOperationRule {
51352 fn default() -> Self {
51353 Self {
51354 action: Err("no value supplied for action".to_string()),
51355 criteria: Err("no value supplied for criteria".to_string()),
51356 operation: Err("no value supplied for operation".to_string()),
51357 }
51358 }
51359 }
51360 impl SendUserOperationRule {
51361 pub fn action<T>(mut self, value: T) -> Self
51362 where
51363 T: ::std::convert::TryInto<super::SendUserOperationRuleAction>,
51364 T::Error: ::std::fmt::Display,
51365 {
51366 self.action = value
51367 .try_into()
51368 .map_err(|e| format!("error converting supplied value for action: {}", e));
51369 self
51370 }
51371 pub fn criteria<T>(mut self, value: T) -> Self
51372 where
51373 T: ::std::convert::TryInto<super::SendUserOperationCriteria>,
51374 T::Error: ::std::fmt::Display,
51375 {
51376 self.criteria = value
51377 .try_into()
51378 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
51379 self
51380 }
51381 pub fn operation<T>(mut self, value: T) -> Self
51382 where
51383 T: ::std::convert::TryInto<super::SendUserOperationRuleOperation>,
51384 T::Error: ::std::fmt::Display,
51385 {
51386 self.operation = value
51387 .try_into()
51388 .map_err(|e| format!("error converting supplied value for operation: {}", e));
51389 self
51390 }
51391 }
51392 impl ::std::convert::TryFrom<SendUserOperationRule> for super::SendUserOperationRule {
51393 type Error = super::error::ConversionError;
51394 fn try_from(
51395 value: SendUserOperationRule,
51396 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51397 Ok(Self {
51398 action: value.action?,
51399 criteria: value.criteria?,
51400 operation: value.operation?,
51401 })
51402 }
51403 }
51404 impl ::std::convert::From<super::SendUserOperationRule> for SendUserOperationRule {
51405 fn from(value: super::SendUserOperationRule) -> Self {
51406 Self {
51407 action: Ok(value.action),
51408 criteria: Ok(value.criteria),
51409 operation: Ok(value.operation),
51410 }
51411 }
51412 }
51413 #[derive(Clone, Debug)]
51414 pub struct SettleX402PaymentBody {
51415 payment_payload:
51416 ::std::result::Result<super::X402PaymentPayload, ::std::string::String>,
51417 payment_requirements:
51418 ::std::result::Result<super::X402PaymentRequirements, ::std::string::String>,
51419 x402_version: ::std::result::Result<super::X402Version, ::std::string::String>,
51420 }
51421 impl ::std::default::Default for SettleX402PaymentBody {
51422 fn default() -> Self {
51423 Self {
51424 payment_payload: Err("no value supplied for payment_payload".to_string()),
51425 payment_requirements: Err(
51426 "no value supplied for payment_requirements".to_string()
51427 ),
51428 x402_version: Err("no value supplied for x402_version".to_string()),
51429 }
51430 }
51431 }
51432 impl SettleX402PaymentBody {
51433 pub fn payment_payload<T>(mut self, value: T) -> Self
51434 where
51435 T: ::std::convert::TryInto<super::X402PaymentPayload>,
51436 T::Error: ::std::fmt::Display,
51437 {
51438 self.payment_payload = value.try_into().map_err(|e| {
51439 format!("error converting supplied value for payment_payload: {}", e)
51440 });
51441 self
51442 }
51443 pub fn payment_requirements<T>(mut self, value: T) -> Self
51444 where
51445 T: ::std::convert::TryInto<super::X402PaymentRequirements>,
51446 T::Error: ::std::fmt::Display,
51447 {
51448 self.payment_requirements = value.try_into().map_err(|e| {
51449 format!(
51450 "error converting supplied value for payment_requirements: {}",
51451 e
51452 )
51453 });
51454 self
51455 }
51456 pub fn x402_version<T>(mut self, value: T) -> Self
51457 where
51458 T: ::std::convert::TryInto<super::X402Version>,
51459 T::Error: ::std::fmt::Display,
51460 {
51461 self.x402_version = value.try_into().map_err(|e| {
51462 format!("error converting supplied value for x402_version: {}", e)
51463 });
51464 self
51465 }
51466 }
51467 impl ::std::convert::TryFrom<SettleX402PaymentBody> for super::SettleX402PaymentBody {
51468 type Error = super::error::ConversionError;
51469 fn try_from(
51470 value: SettleX402PaymentBody,
51471 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51472 Ok(Self {
51473 payment_payload: value.payment_payload?,
51474 payment_requirements: value.payment_requirements?,
51475 x402_version: value.x402_version?,
51476 })
51477 }
51478 }
51479 impl ::std::convert::From<super::SettleX402PaymentBody> for SettleX402PaymentBody {
51480 fn from(value: super::SettleX402PaymentBody) -> Self {
51481 Self {
51482 payment_payload: Ok(value.payment_payload),
51483 payment_requirements: Ok(value.payment_requirements),
51484 x402_version: Ok(value.x402_version),
51485 }
51486 }
51487 }
51488 #[derive(Clone, Debug)]
51489 pub struct SettleX402PaymentResponse {
51490 error_reason: ::std::result::Result<
51491 ::std::option::Option<super::X402SettleErrorReason>,
51492 ::std::string::String,
51493 >,
51494 network: ::std::result::Result<::std::string::String, ::std::string::String>,
51495 payer:
51496 ::std::result::Result<super::SettleX402PaymentResponsePayer, ::std::string::String>,
51497 success: ::std::result::Result<bool, ::std::string::String>,
51498 transaction: ::std::result::Result<
51499 super::SettleX402PaymentResponseTransaction,
51500 ::std::string::String,
51501 >,
51502 }
51503 impl ::std::default::Default for SettleX402PaymentResponse {
51504 fn default() -> Self {
51505 Self {
51506 error_reason: Ok(Default::default()),
51507 network: Err("no value supplied for network".to_string()),
51508 payer: Err("no value supplied for payer".to_string()),
51509 success: Err("no value supplied for success".to_string()),
51510 transaction: Err("no value supplied for transaction".to_string()),
51511 }
51512 }
51513 }
51514 impl SettleX402PaymentResponse {
51515 pub fn error_reason<T>(mut self, value: T) -> Self
51516 where
51517 T: ::std::convert::TryInto<::std::option::Option<super::X402SettleErrorReason>>,
51518 T::Error: ::std::fmt::Display,
51519 {
51520 self.error_reason = value.try_into().map_err(|e| {
51521 format!("error converting supplied value for error_reason: {}", e)
51522 });
51523 self
51524 }
51525 pub fn network<T>(mut self, value: T) -> Self
51526 where
51527 T: ::std::convert::TryInto<::std::string::String>,
51528 T::Error: ::std::fmt::Display,
51529 {
51530 self.network = value
51531 .try_into()
51532 .map_err(|e| format!("error converting supplied value for network: {}", e));
51533 self
51534 }
51535 pub fn payer<T>(mut self, value: T) -> Self
51536 where
51537 T: ::std::convert::TryInto<super::SettleX402PaymentResponsePayer>,
51538 T::Error: ::std::fmt::Display,
51539 {
51540 self.payer = value
51541 .try_into()
51542 .map_err(|e| format!("error converting supplied value for payer: {}", e));
51543 self
51544 }
51545 pub fn success<T>(mut self, value: T) -> Self
51546 where
51547 T: ::std::convert::TryInto<bool>,
51548 T::Error: ::std::fmt::Display,
51549 {
51550 self.success = value
51551 .try_into()
51552 .map_err(|e| format!("error converting supplied value for success: {}", e));
51553 self
51554 }
51555 pub fn transaction<T>(mut self, value: T) -> Self
51556 where
51557 T: ::std::convert::TryInto<super::SettleX402PaymentResponseTransaction>,
51558 T::Error: ::std::fmt::Display,
51559 {
51560 self.transaction = value
51561 .try_into()
51562 .map_err(|e| format!("error converting supplied value for transaction: {}", e));
51563 self
51564 }
51565 }
51566 impl ::std::convert::TryFrom<SettleX402PaymentResponse> for super::SettleX402PaymentResponse {
51567 type Error = super::error::ConversionError;
51568 fn try_from(
51569 value: SettleX402PaymentResponse,
51570 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51571 Ok(Self {
51572 error_reason: value.error_reason?,
51573 network: value.network?,
51574 payer: value.payer?,
51575 success: value.success?,
51576 transaction: value.transaction?,
51577 })
51578 }
51579 }
51580 impl ::std::convert::From<super::SettleX402PaymentResponse> for SettleX402PaymentResponse {
51581 fn from(value: super::SettleX402PaymentResponse) -> Self {
51582 Self {
51583 error_reason: Ok(value.error_reason),
51584 network: Ok(value.network),
51585 payer: Ok(value.payer),
51586 success: Ok(value.success),
51587 transaction: Ok(value.transaction),
51588 }
51589 }
51590 }
51591 #[derive(Clone, Debug)]
51592 pub struct SignEvmHashBody {
51593 hash: ::std::result::Result<::std::string::String, ::std::string::String>,
51594 }
51595 impl ::std::default::Default for SignEvmHashBody {
51596 fn default() -> Self {
51597 Self {
51598 hash: Err("no value supplied for hash".to_string()),
51599 }
51600 }
51601 }
51602 impl SignEvmHashBody {
51603 pub fn hash<T>(mut self, value: T) -> Self
51604 where
51605 T: ::std::convert::TryInto<::std::string::String>,
51606 T::Error: ::std::fmt::Display,
51607 {
51608 self.hash = value
51609 .try_into()
51610 .map_err(|e| format!("error converting supplied value for hash: {}", e));
51611 self
51612 }
51613 }
51614 impl ::std::convert::TryFrom<SignEvmHashBody> for super::SignEvmHashBody {
51615 type Error = super::error::ConversionError;
51616 fn try_from(
51617 value: SignEvmHashBody,
51618 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51619 Ok(Self { hash: value.hash? })
51620 }
51621 }
51622 impl ::std::convert::From<super::SignEvmHashBody> for SignEvmHashBody {
51623 fn from(value: super::SignEvmHashBody) -> Self {
51624 Self {
51625 hash: Ok(value.hash),
51626 }
51627 }
51628 }
51629 #[derive(Clone, Debug)]
51630 pub struct SignEvmHashResponse {
51631 signature: ::std::result::Result<::std::string::String, ::std::string::String>,
51632 }
51633 impl ::std::default::Default for SignEvmHashResponse {
51634 fn default() -> Self {
51635 Self {
51636 signature: Err("no value supplied for signature".to_string()),
51637 }
51638 }
51639 }
51640 impl SignEvmHashResponse {
51641 pub fn signature<T>(mut self, value: T) -> Self
51642 where
51643 T: ::std::convert::TryInto<::std::string::String>,
51644 T::Error: ::std::fmt::Display,
51645 {
51646 self.signature = value
51647 .try_into()
51648 .map_err(|e| format!("error converting supplied value for signature: {}", e));
51649 self
51650 }
51651 }
51652 impl ::std::convert::TryFrom<SignEvmHashResponse> for super::SignEvmHashResponse {
51653 type Error = super::error::ConversionError;
51654 fn try_from(
51655 value: SignEvmHashResponse,
51656 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51657 Ok(Self {
51658 signature: value.signature?,
51659 })
51660 }
51661 }
51662 impl ::std::convert::From<super::SignEvmHashResponse> for SignEvmHashResponse {
51663 fn from(value: super::SignEvmHashResponse) -> Self {
51664 Self {
51665 signature: Ok(value.signature),
51666 }
51667 }
51668 }
51669 #[derive(Clone, Debug)]
51670 pub struct SignEvmHashRule {
51671 action: ::std::result::Result<super::SignEvmHashRuleAction, ::std::string::String>,
51672 operation:
51673 ::std::result::Result<super::SignEvmHashRuleOperation, ::std::string::String>,
51674 }
51675 impl ::std::default::Default for SignEvmHashRule {
51676 fn default() -> Self {
51677 Self {
51678 action: Err("no value supplied for action".to_string()),
51679 operation: Err("no value supplied for operation".to_string()),
51680 }
51681 }
51682 }
51683 impl SignEvmHashRule {
51684 pub fn action<T>(mut self, value: T) -> Self
51685 where
51686 T: ::std::convert::TryInto<super::SignEvmHashRuleAction>,
51687 T::Error: ::std::fmt::Display,
51688 {
51689 self.action = value
51690 .try_into()
51691 .map_err(|e| format!("error converting supplied value for action: {}", e));
51692 self
51693 }
51694 pub fn operation<T>(mut self, value: T) -> Self
51695 where
51696 T: ::std::convert::TryInto<super::SignEvmHashRuleOperation>,
51697 T::Error: ::std::fmt::Display,
51698 {
51699 self.operation = value
51700 .try_into()
51701 .map_err(|e| format!("error converting supplied value for operation: {}", e));
51702 self
51703 }
51704 }
51705 impl ::std::convert::TryFrom<SignEvmHashRule> for super::SignEvmHashRule {
51706 type Error = super::error::ConversionError;
51707 fn try_from(
51708 value: SignEvmHashRule,
51709 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51710 Ok(Self {
51711 action: value.action?,
51712 operation: value.operation?,
51713 })
51714 }
51715 }
51716 impl ::std::convert::From<super::SignEvmHashRule> for SignEvmHashRule {
51717 fn from(value: super::SignEvmHashRule) -> Self {
51718 Self {
51719 action: Ok(value.action),
51720 operation: Ok(value.operation),
51721 }
51722 }
51723 }
51724 #[derive(Clone, Debug)]
51725 pub struct SignEvmMessageBody {
51726 message: ::std::result::Result<::std::string::String, ::std::string::String>,
51727 }
51728 impl ::std::default::Default for SignEvmMessageBody {
51729 fn default() -> Self {
51730 Self {
51731 message: Err("no value supplied for message".to_string()),
51732 }
51733 }
51734 }
51735 impl SignEvmMessageBody {
51736 pub fn message<T>(mut self, value: T) -> Self
51737 where
51738 T: ::std::convert::TryInto<::std::string::String>,
51739 T::Error: ::std::fmt::Display,
51740 {
51741 self.message = value
51742 .try_into()
51743 .map_err(|e| format!("error converting supplied value for message: {}", e));
51744 self
51745 }
51746 }
51747 impl ::std::convert::TryFrom<SignEvmMessageBody> for super::SignEvmMessageBody {
51748 type Error = super::error::ConversionError;
51749 fn try_from(
51750 value: SignEvmMessageBody,
51751 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51752 Ok(Self {
51753 message: value.message?,
51754 })
51755 }
51756 }
51757 impl ::std::convert::From<super::SignEvmMessageBody> for SignEvmMessageBody {
51758 fn from(value: super::SignEvmMessageBody) -> Self {
51759 Self {
51760 message: Ok(value.message),
51761 }
51762 }
51763 }
51764 #[derive(Clone, Debug)]
51765 pub struct SignEvmMessageResponse {
51766 signature: ::std::result::Result<::std::string::String, ::std::string::String>,
51767 }
51768 impl ::std::default::Default for SignEvmMessageResponse {
51769 fn default() -> Self {
51770 Self {
51771 signature: Err("no value supplied for signature".to_string()),
51772 }
51773 }
51774 }
51775 impl SignEvmMessageResponse {
51776 pub fn signature<T>(mut self, value: T) -> Self
51777 where
51778 T: ::std::convert::TryInto<::std::string::String>,
51779 T::Error: ::std::fmt::Display,
51780 {
51781 self.signature = value
51782 .try_into()
51783 .map_err(|e| format!("error converting supplied value for signature: {}", e));
51784 self
51785 }
51786 }
51787 impl ::std::convert::TryFrom<SignEvmMessageResponse> for super::SignEvmMessageResponse {
51788 type Error = super::error::ConversionError;
51789 fn try_from(
51790 value: SignEvmMessageResponse,
51791 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51792 Ok(Self {
51793 signature: value.signature?,
51794 })
51795 }
51796 }
51797 impl ::std::convert::From<super::SignEvmMessageResponse> for SignEvmMessageResponse {
51798 fn from(value: super::SignEvmMessageResponse) -> Self {
51799 Self {
51800 signature: Ok(value.signature),
51801 }
51802 }
51803 }
51804 #[derive(Clone, Debug)]
51805 pub struct SignEvmMessageRule {
51806 action: ::std::result::Result<super::SignEvmMessageRuleAction, ::std::string::String>,
51807 criteria: ::std::result::Result<super::SignEvmMessageCriteria, ::std::string::String>,
51808 operation:
51809 ::std::result::Result<super::SignEvmMessageRuleOperation, ::std::string::String>,
51810 }
51811 impl ::std::default::Default for SignEvmMessageRule {
51812 fn default() -> Self {
51813 Self {
51814 action: Err("no value supplied for action".to_string()),
51815 criteria: Err("no value supplied for criteria".to_string()),
51816 operation: Err("no value supplied for operation".to_string()),
51817 }
51818 }
51819 }
51820 impl SignEvmMessageRule {
51821 pub fn action<T>(mut self, value: T) -> Self
51822 where
51823 T: ::std::convert::TryInto<super::SignEvmMessageRuleAction>,
51824 T::Error: ::std::fmt::Display,
51825 {
51826 self.action = value
51827 .try_into()
51828 .map_err(|e| format!("error converting supplied value for action: {}", e));
51829 self
51830 }
51831 pub fn criteria<T>(mut self, value: T) -> Self
51832 where
51833 T: ::std::convert::TryInto<super::SignEvmMessageCriteria>,
51834 T::Error: ::std::fmt::Display,
51835 {
51836 self.criteria = value
51837 .try_into()
51838 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
51839 self
51840 }
51841 pub fn operation<T>(mut self, value: T) -> Self
51842 where
51843 T: ::std::convert::TryInto<super::SignEvmMessageRuleOperation>,
51844 T::Error: ::std::fmt::Display,
51845 {
51846 self.operation = value
51847 .try_into()
51848 .map_err(|e| format!("error converting supplied value for operation: {}", e));
51849 self
51850 }
51851 }
51852 impl ::std::convert::TryFrom<SignEvmMessageRule> for super::SignEvmMessageRule {
51853 type Error = super::error::ConversionError;
51854 fn try_from(
51855 value: SignEvmMessageRule,
51856 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51857 Ok(Self {
51858 action: value.action?,
51859 criteria: value.criteria?,
51860 operation: value.operation?,
51861 })
51862 }
51863 }
51864 impl ::std::convert::From<super::SignEvmMessageRule> for SignEvmMessageRule {
51865 fn from(value: super::SignEvmMessageRule) -> Self {
51866 Self {
51867 action: Ok(value.action),
51868 criteria: Ok(value.criteria),
51869 operation: Ok(value.operation),
51870 }
51871 }
51872 }
51873 #[derive(Clone, Debug)]
51874 pub struct SignEvmTransactionBody {
51875 transaction: ::std::result::Result<::std::string::String, ::std::string::String>,
51876 }
51877 impl ::std::default::Default for SignEvmTransactionBody {
51878 fn default() -> Self {
51879 Self {
51880 transaction: Err("no value supplied for transaction".to_string()),
51881 }
51882 }
51883 }
51884 impl SignEvmTransactionBody {
51885 pub fn transaction<T>(mut self, value: T) -> Self
51886 where
51887 T: ::std::convert::TryInto<::std::string::String>,
51888 T::Error: ::std::fmt::Display,
51889 {
51890 self.transaction = value
51891 .try_into()
51892 .map_err(|e| format!("error converting supplied value for transaction: {}", e));
51893 self
51894 }
51895 }
51896 impl ::std::convert::TryFrom<SignEvmTransactionBody> for super::SignEvmTransactionBody {
51897 type Error = super::error::ConversionError;
51898 fn try_from(
51899 value: SignEvmTransactionBody,
51900 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51901 Ok(Self {
51902 transaction: value.transaction?,
51903 })
51904 }
51905 }
51906 impl ::std::convert::From<super::SignEvmTransactionBody> for SignEvmTransactionBody {
51907 fn from(value: super::SignEvmTransactionBody) -> Self {
51908 Self {
51909 transaction: Ok(value.transaction),
51910 }
51911 }
51912 }
51913 #[derive(Clone, Debug)]
51914 pub struct SignEvmTransactionResponse {
51915 signed_transaction: ::std::result::Result<::std::string::String, ::std::string::String>,
51916 }
51917 impl ::std::default::Default for SignEvmTransactionResponse {
51918 fn default() -> Self {
51919 Self {
51920 signed_transaction: Err("no value supplied for signed_transaction".to_string()),
51921 }
51922 }
51923 }
51924 impl SignEvmTransactionResponse {
51925 pub fn signed_transaction<T>(mut self, value: T) -> Self
51926 where
51927 T: ::std::convert::TryInto<::std::string::String>,
51928 T::Error: ::std::fmt::Display,
51929 {
51930 self.signed_transaction = value.try_into().map_err(|e| {
51931 format!(
51932 "error converting supplied value for signed_transaction: {}",
51933 e
51934 )
51935 });
51936 self
51937 }
51938 }
51939 impl ::std::convert::TryFrom<SignEvmTransactionResponse> for super::SignEvmTransactionResponse {
51940 type Error = super::error::ConversionError;
51941 fn try_from(
51942 value: SignEvmTransactionResponse,
51943 ) -> ::std::result::Result<Self, super::error::ConversionError> {
51944 Ok(Self {
51945 signed_transaction: value.signed_transaction?,
51946 })
51947 }
51948 }
51949 impl ::std::convert::From<super::SignEvmTransactionResponse> for SignEvmTransactionResponse {
51950 fn from(value: super::SignEvmTransactionResponse) -> Self {
51951 Self {
51952 signed_transaction: Ok(value.signed_transaction),
51953 }
51954 }
51955 }
51956 #[derive(Clone, Debug)]
51957 pub struct SignEvmTransactionRule {
51958 action:
51959 ::std::result::Result<super::SignEvmTransactionRuleAction, ::std::string::String>,
51960 criteria:
51961 ::std::result::Result<super::SignEvmTransactionCriteria, ::std::string::String>,
51962 operation: ::std::result::Result<
51963 super::SignEvmTransactionRuleOperation,
51964 ::std::string::String,
51965 >,
51966 }
51967 impl ::std::default::Default for SignEvmTransactionRule {
51968 fn default() -> Self {
51969 Self {
51970 action: Err("no value supplied for action".to_string()),
51971 criteria: Err("no value supplied for criteria".to_string()),
51972 operation: Err("no value supplied for operation".to_string()),
51973 }
51974 }
51975 }
51976 impl SignEvmTransactionRule {
51977 pub fn action<T>(mut self, value: T) -> Self
51978 where
51979 T: ::std::convert::TryInto<super::SignEvmTransactionRuleAction>,
51980 T::Error: ::std::fmt::Display,
51981 {
51982 self.action = value
51983 .try_into()
51984 .map_err(|e| format!("error converting supplied value for action: {}", e));
51985 self
51986 }
51987 pub fn criteria<T>(mut self, value: T) -> Self
51988 where
51989 T: ::std::convert::TryInto<super::SignEvmTransactionCriteria>,
51990 T::Error: ::std::fmt::Display,
51991 {
51992 self.criteria = value
51993 .try_into()
51994 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
51995 self
51996 }
51997 pub fn operation<T>(mut self, value: T) -> Self
51998 where
51999 T: ::std::convert::TryInto<super::SignEvmTransactionRuleOperation>,
52000 T::Error: ::std::fmt::Display,
52001 {
52002 self.operation = value
52003 .try_into()
52004 .map_err(|e| format!("error converting supplied value for operation: {}", e));
52005 self
52006 }
52007 }
52008 impl ::std::convert::TryFrom<SignEvmTransactionRule> for super::SignEvmTransactionRule {
52009 type Error = super::error::ConversionError;
52010 fn try_from(
52011 value: SignEvmTransactionRule,
52012 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52013 Ok(Self {
52014 action: value.action?,
52015 criteria: value.criteria?,
52016 operation: value.operation?,
52017 })
52018 }
52019 }
52020 impl ::std::convert::From<super::SignEvmTransactionRule> for SignEvmTransactionRule {
52021 fn from(value: super::SignEvmTransactionRule) -> Self {
52022 Self {
52023 action: Ok(value.action),
52024 criteria: Ok(value.criteria),
52025 operation: Ok(value.operation),
52026 }
52027 }
52028 }
52029 #[derive(Clone, Debug)]
52030 pub struct SignEvmTypedDataFieldCriterion {
52031 conditions: ::std::result::Result<
52032 ::std::vec::Vec<super::SignEvmTypedDataFieldCriterionConditionsItem>,
52033 ::std::string::String,
52034 >,
52035 type_: ::std::result::Result<
52036 super::SignEvmTypedDataFieldCriterionType,
52037 ::std::string::String,
52038 >,
52039 types: ::std::result::Result<
52040 super::SignEvmTypedDataFieldCriterionTypes,
52041 ::std::string::String,
52042 >,
52043 }
52044 impl ::std::default::Default for SignEvmTypedDataFieldCriterion {
52045 fn default() -> Self {
52046 Self {
52047 conditions: Err("no value supplied for conditions".to_string()),
52048 type_: Err("no value supplied for type_".to_string()),
52049 types: Err("no value supplied for types".to_string()),
52050 }
52051 }
52052 }
52053 impl SignEvmTypedDataFieldCriterion {
52054 pub fn conditions<T>(mut self, value: T) -> Self
52055 where
52056 T: ::std::convert::TryInto<
52057 ::std::vec::Vec<super::SignEvmTypedDataFieldCriterionConditionsItem>,
52058 >,
52059 T::Error: ::std::fmt::Display,
52060 {
52061 self.conditions = value
52062 .try_into()
52063 .map_err(|e| format!("error converting supplied value for conditions: {}", e));
52064 self
52065 }
52066 pub fn type_<T>(mut self, value: T) -> Self
52067 where
52068 T: ::std::convert::TryInto<super::SignEvmTypedDataFieldCriterionType>,
52069 T::Error: ::std::fmt::Display,
52070 {
52071 self.type_ = value
52072 .try_into()
52073 .map_err(|e| format!("error converting supplied value for type_: {}", e));
52074 self
52075 }
52076 pub fn types<T>(mut self, value: T) -> Self
52077 where
52078 T: ::std::convert::TryInto<super::SignEvmTypedDataFieldCriterionTypes>,
52079 T::Error: ::std::fmt::Display,
52080 {
52081 self.types = value
52082 .try_into()
52083 .map_err(|e| format!("error converting supplied value for types: {}", e));
52084 self
52085 }
52086 }
52087 impl ::std::convert::TryFrom<SignEvmTypedDataFieldCriterion>
52088 for super::SignEvmTypedDataFieldCriterion
52089 {
52090 type Error = super::error::ConversionError;
52091 fn try_from(
52092 value: SignEvmTypedDataFieldCriterion,
52093 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52094 Ok(Self {
52095 conditions: value.conditions?,
52096 type_: value.type_?,
52097 types: value.types?,
52098 })
52099 }
52100 }
52101 impl ::std::convert::From<super::SignEvmTypedDataFieldCriterion>
52102 for SignEvmTypedDataFieldCriterion
52103 {
52104 fn from(value: super::SignEvmTypedDataFieldCriterion) -> Self {
52105 Self {
52106 conditions: Ok(value.conditions),
52107 type_: Ok(value.type_),
52108 types: Ok(value.types),
52109 }
52110 }
52111 }
52112 #[derive(Clone, Debug)]
52113 pub struct SignEvmTypedDataFieldCriterionTypes {
52114 primary_type: ::std::result::Result<::std::string::String, ::std::string::String>,
52115 types: ::std::result::Result<
52116 ::std::collections::HashMap<
52117 ::std::string::String,
52118 ::std::vec::Vec<super::SignEvmTypedDataFieldCriterionTypesTypesValueItem>,
52119 >,
52120 ::std::string::String,
52121 >,
52122 }
52123 impl ::std::default::Default for SignEvmTypedDataFieldCriterionTypes {
52124 fn default() -> Self {
52125 Self {
52126 primary_type: Err("no value supplied for primary_type".to_string()),
52127 types: Err("no value supplied for types".to_string()),
52128 }
52129 }
52130 }
52131 impl SignEvmTypedDataFieldCriterionTypes {
52132 pub fn primary_type<T>(mut self, value: T) -> Self
52133 where
52134 T: ::std::convert::TryInto<::std::string::String>,
52135 T::Error: ::std::fmt::Display,
52136 {
52137 self.primary_type = value.try_into().map_err(|e| {
52138 format!("error converting supplied value for primary_type: {}", e)
52139 });
52140 self
52141 }
52142 pub fn types<T>(mut self, value: T) -> Self
52143 where
52144 T: ::std::convert::TryInto<
52145 ::std::collections::HashMap<
52146 ::std::string::String,
52147 ::std::vec::Vec<super::SignEvmTypedDataFieldCriterionTypesTypesValueItem>,
52148 >,
52149 >,
52150 T::Error: ::std::fmt::Display,
52151 {
52152 self.types = value
52153 .try_into()
52154 .map_err(|e| format!("error converting supplied value for types: {}", e));
52155 self
52156 }
52157 }
52158 impl ::std::convert::TryFrom<SignEvmTypedDataFieldCriterionTypes>
52159 for super::SignEvmTypedDataFieldCriterionTypes
52160 {
52161 type Error = super::error::ConversionError;
52162 fn try_from(
52163 value: SignEvmTypedDataFieldCriterionTypes,
52164 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52165 Ok(Self {
52166 primary_type: value.primary_type?,
52167 types: value.types?,
52168 })
52169 }
52170 }
52171 impl ::std::convert::From<super::SignEvmTypedDataFieldCriterionTypes>
52172 for SignEvmTypedDataFieldCriterionTypes
52173 {
52174 fn from(value: super::SignEvmTypedDataFieldCriterionTypes) -> Self {
52175 Self {
52176 primary_type: Ok(value.primary_type),
52177 types: Ok(value.types),
52178 }
52179 }
52180 }
52181 #[derive(Clone, Debug)]
52182 pub struct SignEvmTypedDataFieldCriterionTypesTypesValueItem {
52183 name: ::std::result::Result<
52184 ::std::option::Option<::std::string::String>,
52185 ::std::string::String,
52186 >,
52187 type_: ::std::result::Result<
52188 ::std::option::Option<::std::string::String>,
52189 ::std::string::String,
52190 >,
52191 }
52192 impl ::std::default::Default for SignEvmTypedDataFieldCriterionTypesTypesValueItem {
52193 fn default() -> Self {
52194 Self {
52195 name: Ok(Default::default()),
52196 type_: Ok(Default::default()),
52197 }
52198 }
52199 }
52200 impl SignEvmTypedDataFieldCriterionTypesTypesValueItem {
52201 pub fn name<T>(mut self, value: T) -> Self
52202 where
52203 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
52204 T::Error: ::std::fmt::Display,
52205 {
52206 self.name = value
52207 .try_into()
52208 .map_err(|e| format!("error converting supplied value for name: {}", e));
52209 self
52210 }
52211 pub fn type_<T>(mut self, value: T) -> Self
52212 where
52213 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
52214 T::Error: ::std::fmt::Display,
52215 {
52216 self.type_ = value
52217 .try_into()
52218 .map_err(|e| format!("error converting supplied value for type_: {}", e));
52219 self
52220 }
52221 }
52222 impl ::std::convert::TryFrom<SignEvmTypedDataFieldCriterionTypesTypesValueItem>
52223 for super::SignEvmTypedDataFieldCriterionTypesTypesValueItem
52224 {
52225 type Error = super::error::ConversionError;
52226 fn try_from(
52227 value: SignEvmTypedDataFieldCriterionTypesTypesValueItem,
52228 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52229 Ok(Self {
52230 name: value.name?,
52231 type_: value.type_?,
52232 })
52233 }
52234 }
52235 impl ::std::convert::From<super::SignEvmTypedDataFieldCriterionTypesTypesValueItem>
52236 for SignEvmTypedDataFieldCriterionTypesTypesValueItem
52237 {
52238 fn from(value: super::SignEvmTypedDataFieldCriterionTypesTypesValueItem) -> Self {
52239 Self {
52240 name: Ok(value.name),
52241 type_: Ok(value.type_),
52242 }
52243 }
52244 }
52245 #[derive(Clone, Debug)]
52246 pub struct SignEvmTypedDataResponse {
52247 signature: ::std::result::Result<::std::string::String, ::std::string::String>,
52248 }
52249 impl ::std::default::Default for SignEvmTypedDataResponse {
52250 fn default() -> Self {
52251 Self {
52252 signature: Err("no value supplied for signature".to_string()),
52253 }
52254 }
52255 }
52256 impl SignEvmTypedDataResponse {
52257 pub fn signature<T>(mut self, value: T) -> Self
52258 where
52259 T: ::std::convert::TryInto<::std::string::String>,
52260 T::Error: ::std::fmt::Display,
52261 {
52262 self.signature = value
52263 .try_into()
52264 .map_err(|e| format!("error converting supplied value for signature: {}", e));
52265 self
52266 }
52267 }
52268 impl ::std::convert::TryFrom<SignEvmTypedDataResponse> for super::SignEvmTypedDataResponse {
52269 type Error = super::error::ConversionError;
52270 fn try_from(
52271 value: SignEvmTypedDataResponse,
52272 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52273 Ok(Self {
52274 signature: value.signature?,
52275 })
52276 }
52277 }
52278 impl ::std::convert::From<super::SignEvmTypedDataResponse> for SignEvmTypedDataResponse {
52279 fn from(value: super::SignEvmTypedDataResponse) -> Self {
52280 Self {
52281 signature: Ok(value.signature),
52282 }
52283 }
52284 }
52285 #[derive(Clone, Debug)]
52286 pub struct SignEvmTypedDataRule {
52287 action: ::std::result::Result<super::SignEvmTypedDataRuleAction, ::std::string::String>,
52288 criteria: ::std::result::Result<super::SignEvmTypedDataCriteria, ::std::string::String>,
52289 operation:
52290 ::std::result::Result<super::SignEvmTypedDataRuleOperation, ::std::string::String>,
52291 }
52292 impl ::std::default::Default for SignEvmTypedDataRule {
52293 fn default() -> Self {
52294 Self {
52295 action: Err("no value supplied for action".to_string()),
52296 criteria: Err("no value supplied for criteria".to_string()),
52297 operation: Err("no value supplied for operation".to_string()),
52298 }
52299 }
52300 }
52301 impl SignEvmTypedDataRule {
52302 pub fn action<T>(mut self, value: T) -> Self
52303 where
52304 T: ::std::convert::TryInto<super::SignEvmTypedDataRuleAction>,
52305 T::Error: ::std::fmt::Display,
52306 {
52307 self.action = value
52308 .try_into()
52309 .map_err(|e| format!("error converting supplied value for action: {}", e));
52310 self
52311 }
52312 pub fn criteria<T>(mut self, value: T) -> Self
52313 where
52314 T: ::std::convert::TryInto<super::SignEvmTypedDataCriteria>,
52315 T::Error: ::std::fmt::Display,
52316 {
52317 self.criteria = value
52318 .try_into()
52319 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
52320 self
52321 }
52322 pub fn operation<T>(mut self, value: T) -> Self
52323 where
52324 T: ::std::convert::TryInto<super::SignEvmTypedDataRuleOperation>,
52325 T::Error: ::std::fmt::Display,
52326 {
52327 self.operation = value
52328 .try_into()
52329 .map_err(|e| format!("error converting supplied value for operation: {}", e));
52330 self
52331 }
52332 }
52333 impl ::std::convert::TryFrom<SignEvmTypedDataRule> for super::SignEvmTypedDataRule {
52334 type Error = super::error::ConversionError;
52335 fn try_from(
52336 value: SignEvmTypedDataRule,
52337 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52338 Ok(Self {
52339 action: value.action?,
52340 criteria: value.criteria?,
52341 operation: value.operation?,
52342 })
52343 }
52344 }
52345 impl ::std::convert::From<super::SignEvmTypedDataRule> for SignEvmTypedDataRule {
52346 fn from(value: super::SignEvmTypedDataRule) -> Self {
52347 Self {
52348 action: Ok(value.action),
52349 criteria: Ok(value.criteria),
52350 operation: Ok(value.operation),
52351 }
52352 }
52353 }
52354 #[derive(Clone, Debug)]
52355 pub struct SignEvmTypedDataVerifyingContractCriterion {
52356 addresses: ::std::result::Result<
52357 ::std::vec::Vec<super::SignEvmTypedDataVerifyingContractCriterionAddressesItem>,
52358 ::std::string::String,
52359 >,
52360 operator: ::std::result::Result<
52361 super::SignEvmTypedDataVerifyingContractCriterionOperator,
52362 ::std::string::String,
52363 >,
52364 type_: ::std::result::Result<
52365 super::SignEvmTypedDataVerifyingContractCriterionType,
52366 ::std::string::String,
52367 >,
52368 }
52369 impl ::std::default::Default for SignEvmTypedDataVerifyingContractCriterion {
52370 fn default() -> Self {
52371 Self {
52372 addresses: Err("no value supplied for addresses".to_string()),
52373 operator: Err("no value supplied for operator".to_string()),
52374 type_: Err("no value supplied for type_".to_string()),
52375 }
52376 }
52377 }
52378 impl SignEvmTypedDataVerifyingContractCriterion {
52379 pub fn addresses<T>(mut self, value: T) -> Self
52380 where
52381 T: ::std::convert::TryInto<
52382 ::std::vec::Vec<super::SignEvmTypedDataVerifyingContractCriterionAddressesItem>,
52383 >,
52384 T::Error: ::std::fmt::Display,
52385 {
52386 self.addresses = value
52387 .try_into()
52388 .map_err(|e| format!("error converting supplied value for addresses: {}", e));
52389 self
52390 }
52391 pub fn operator<T>(mut self, value: T) -> Self
52392 where
52393 T: ::std::convert::TryInto<
52394 super::SignEvmTypedDataVerifyingContractCriterionOperator,
52395 >,
52396 T::Error: ::std::fmt::Display,
52397 {
52398 self.operator = value
52399 .try_into()
52400 .map_err(|e| format!("error converting supplied value for operator: {}", e));
52401 self
52402 }
52403 pub fn type_<T>(mut self, value: T) -> Self
52404 where
52405 T: ::std::convert::TryInto<super::SignEvmTypedDataVerifyingContractCriterionType>,
52406 T::Error: ::std::fmt::Display,
52407 {
52408 self.type_ = value
52409 .try_into()
52410 .map_err(|e| format!("error converting supplied value for type_: {}", e));
52411 self
52412 }
52413 }
52414 impl ::std::convert::TryFrom<SignEvmTypedDataVerifyingContractCriterion>
52415 for super::SignEvmTypedDataVerifyingContractCriterion
52416 {
52417 type Error = super::error::ConversionError;
52418 fn try_from(
52419 value: SignEvmTypedDataVerifyingContractCriterion,
52420 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52421 Ok(Self {
52422 addresses: value.addresses?,
52423 operator: value.operator?,
52424 type_: value.type_?,
52425 })
52426 }
52427 }
52428 impl ::std::convert::From<super::SignEvmTypedDataVerifyingContractCriterion>
52429 for SignEvmTypedDataVerifyingContractCriterion
52430 {
52431 fn from(value: super::SignEvmTypedDataVerifyingContractCriterion) -> Self {
52432 Self {
52433 addresses: Ok(value.addresses),
52434 operator: Ok(value.operator),
52435 type_: Ok(value.type_),
52436 }
52437 }
52438 }
52439 #[derive(Clone, Debug)]
52440 pub struct SignSolMessageRule {
52441 action: ::std::result::Result<super::SignSolMessageRuleAction, ::std::string::String>,
52442 criteria: ::std::result::Result<super::SignSolMessageCriteria, ::std::string::String>,
52443 operation:
52444 ::std::result::Result<super::SignSolMessageRuleOperation, ::std::string::String>,
52445 }
52446 impl ::std::default::Default for SignSolMessageRule {
52447 fn default() -> Self {
52448 Self {
52449 action: Err("no value supplied for action".to_string()),
52450 criteria: Err("no value supplied for criteria".to_string()),
52451 operation: Err("no value supplied for operation".to_string()),
52452 }
52453 }
52454 }
52455 impl SignSolMessageRule {
52456 pub fn action<T>(mut self, value: T) -> Self
52457 where
52458 T: ::std::convert::TryInto<super::SignSolMessageRuleAction>,
52459 T::Error: ::std::fmt::Display,
52460 {
52461 self.action = value
52462 .try_into()
52463 .map_err(|e| format!("error converting supplied value for action: {}", e));
52464 self
52465 }
52466 pub fn criteria<T>(mut self, value: T) -> Self
52467 where
52468 T: ::std::convert::TryInto<super::SignSolMessageCriteria>,
52469 T::Error: ::std::fmt::Display,
52470 {
52471 self.criteria = value
52472 .try_into()
52473 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
52474 self
52475 }
52476 pub fn operation<T>(mut self, value: T) -> Self
52477 where
52478 T: ::std::convert::TryInto<super::SignSolMessageRuleOperation>,
52479 T::Error: ::std::fmt::Display,
52480 {
52481 self.operation = value
52482 .try_into()
52483 .map_err(|e| format!("error converting supplied value for operation: {}", e));
52484 self
52485 }
52486 }
52487 impl ::std::convert::TryFrom<SignSolMessageRule> for super::SignSolMessageRule {
52488 type Error = super::error::ConversionError;
52489 fn try_from(
52490 value: SignSolMessageRule,
52491 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52492 Ok(Self {
52493 action: value.action?,
52494 criteria: value.criteria?,
52495 operation: value.operation?,
52496 })
52497 }
52498 }
52499 impl ::std::convert::From<super::SignSolMessageRule> for SignSolMessageRule {
52500 fn from(value: super::SignSolMessageRule) -> Self {
52501 Self {
52502 action: Ok(value.action),
52503 criteria: Ok(value.criteria),
52504 operation: Ok(value.operation),
52505 }
52506 }
52507 }
52508 #[derive(Clone, Debug)]
52509 pub struct SignSolTransactionRule {
52510 action:
52511 ::std::result::Result<super::SignSolTransactionRuleAction, ::std::string::String>,
52512 criteria:
52513 ::std::result::Result<super::SignSolTransactionCriteria, ::std::string::String>,
52514 operation: ::std::result::Result<
52515 super::SignSolTransactionRuleOperation,
52516 ::std::string::String,
52517 >,
52518 }
52519 impl ::std::default::Default for SignSolTransactionRule {
52520 fn default() -> Self {
52521 Self {
52522 action: Err("no value supplied for action".to_string()),
52523 criteria: Err("no value supplied for criteria".to_string()),
52524 operation: Err("no value supplied for operation".to_string()),
52525 }
52526 }
52527 }
52528 impl SignSolTransactionRule {
52529 pub fn action<T>(mut self, value: T) -> Self
52530 where
52531 T: ::std::convert::TryInto<super::SignSolTransactionRuleAction>,
52532 T::Error: ::std::fmt::Display,
52533 {
52534 self.action = value
52535 .try_into()
52536 .map_err(|e| format!("error converting supplied value for action: {}", e));
52537 self
52538 }
52539 pub fn criteria<T>(mut self, value: T) -> Self
52540 where
52541 T: ::std::convert::TryInto<super::SignSolTransactionCriteria>,
52542 T::Error: ::std::fmt::Display,
52543 {
52544 self.criteria = value
52545 .try_into()
52546 .map_err(|e| format!("error converting supplied value for criteria: {}", e));
52547 self
52548 }
52549 pub fn operation<T>(mut self, value: T) -> Self
52550 where
52551 T: ::std::convert::TryInto<super::SignSolTransactionRuleOperation>,
52552 T::Error: ::std::fmt::Display,
52553 {
52554 self.operation = value
52555 .try_into()
52556 .map_err(|e| format!("error converting supplied value for operation: {}", e));
52557 self
52558 }
52559 }
52560 impl ::std::convert::TryFrom<SignSolTransactionRule> for super::SignSolTransactionRule {
52561 type Error = super::error::ConversionError;
52562 fn try_from(
52563 value: SignSolTransactionRule,
52564 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52565 Ok(Self {
52566 action: value.action?,
52567 criteria: value.criteria?,
52568 operation: value.operation?,
52569 })
52570 }
52571 }
52572 impl ::std::convert::From<super::SignSolTransactionRule> for SignSolTransactionRule {
52573 fn from(value: super::SignSolTransactionRule) -> Self {
52574 Self {
52575 action: Ok(value.action),
52576 criteria: Ok(value.criteria),
52577 operation: Ok(value.operation),
52578 }
52579 }
52580 }
52581 #[derive(Clone, Debug)]
52582 pub struct SignSolanaMessageBody {
52583 message: ::std::result::Result<::std::string::String, ::std::string::String>,
52584 }
52585 impl ::std::default::Default for SignSolanaMessageBody {
52586 fn default() -> Self {
52587 Self {
52588 message: Err("no value supplied for message".to_string()),
52589 }
52590 }
52591 }
52592 impl SignSolanaMessageBody {
52593 pub fn message<T>(mut self, value: T) -> Self
52594 where
52595 T: ::std::convert::TryInto<::std::string::String>,
52596 T::Error: ::std::fmt::Display,
52597 {
52598 self.message = value
52599 .try_into()
52600 .map_err(|e| format!("error converting supplied value for message: {}", e));
52601 self
52602 }
52603 }
52604 impl ::std::convert::TryFrom<SignSolanaMessageBody> for super::SignSolanaMessageBody {
52605 type Error = super::error::ConversionError;
52606 fn try_from(
52607 value: SignSolanaMessageBody,
52608 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52609 Ok(Self {
52610 message: value.message?,
52611 })
52612 }
52613 }
52614 impl ::std::convert::From<super::SignSolanaMessageBody> for SignSolanaMessageBody {
52615 fn from(value: super::SignSolanaMessageBody) -> Self {
52616 Self {
52617 message: Ok(value.message),
52618 }
52619 }
52620 }
52621 #[derive(Clone, Debug)]
52622 pub struct SignSolanaMessageResponse {
52623 signature: ::std::result::Result<::std::string::String, ::std::string::String>,
52624 }
52625 impl ::std::default::Default for SignSolanaMessageResponse {
52626 fn default() -> Self {
52627 Self {
52628 signature: Err("no value supplied for signature".to_string()),
52629 }
52630 }
52631 }
52632 impl SignSolanaMessageResponse {
52633 pub fn signature<T>(mut self, value: T) -> Self
52634 where
52635 T: ::std::convert::TryInto<::std::string::String>,
52636 T::Error: ::std::fmt::Display,
52637 {
52638 self.signature = value
52639 .try_into()
52640 .map_err(|e| format!("error converting supplied value for signature: {}", e));
52641 self
52642 }
52643 }
52644 impl ::std::convert::TryFrom<SignSolanaMessageResponse> for super::SignSolanaMessageResponse {
52645 type Error = super::error::ConversionError;
52646 fn try_from(
52647 value: SignSolanaMessageResponse,
52648 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52649 Ok(Self {
52650 signature: value.signature?,
52651 })
52652 }
52653 }
52654 impl ::std::convert::From<super::SignSolanaMessageResponse> for SignSolanaMessageResponse {
52655 fn from(value: super::SignSolanaMessageResponse) -> Self {
52656 Self {
52657 signature: Ok(value.signature),
52658 }
52659 }
52660 }
52661 #[derive(Clone, Debug)]
52662 pub struct SignSolanaTransactionBody {
52663 transaction: ::std::result::Result<::std::string::String, ::std::string::String>,
52664 }
52665 impl ::std::default::Default for SignSolanaTransactionBody {
52666 fn default() -> Self {
52667 Self {
52668 transaction: Err("no value supplied for transaction".to_string()),
52669 }
52670 }
52671 }
52672 impl SignSolanaTransactionBody {
52673 pub fn transaction<T>(mut self, value: T) -> Self
52674 where
52675 T: ::std::convert::TryInto<::std::string::String>,
52676 T::Error: ::std::fmt::Display,
52677 {
52678 self.transaction = value
52679 .try_into()
52680 .map_err(|e| format!("error converting supplied value for transaction: {}", e));
52681 self
52682 }
52683 }
52684 impl ::std::convert::TryFrom<SignSolanaTransactionBody> for super::SignSolanaTransactionBody {
52685 type Error = super::error::ConversionError;
52686 fn try_from(
52687 value: SignSolanaTransactionBody,
52688 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52689 Ok(Self {
52690 transaction: value.transaction?,
52691 })
52692 }
52693 }
52694 impl ::std::convert::From<super::SignSolanaTransactionBody> for SignSolanaTransactionBody {
52695 fn from(value: super::SignSolanaTransactionBody) -> Self {
52696 Self {
52697 transaction: Ok(value.transaction),
52698 }
52699 }
52700 }
52701 #[derive(Clone, Debug)]
52702 pub struct SignSolanaTransactionResponse {
52703 signed_transaction: ::std::result::Result<::std::string::String, ::std::string::String>,
52704 }
52705 impl ::std::default::Default for SignSolanaTransactionResponse {
52706 fn default() -> Self {
52707 Self {
52708 signed_transaction: Err("no value supplied for signed_transaction".to_string()),
52709 }
52710 }
52711 }
52712 impl SignSolanaTransactionResponse {
52713 pub fn signed_transaction<T>(mut self, value: T) -> Self
52714 where
52715 T: ::std::convert::TryInto<::std::string::String>,
52716 T::Error: ::std::fmt::Display,
52717 {
52718 self.signed_transaction = value.try_into().map_err(|e| {
52719 format!(
52720 "error converting supplied value for signed_transaction: {}",
52721 e
52722 )
52723 });
52724 self
52725 }
52726 }
52727 impl ::std::convert::TryFrom<SignSolanaTransactionResponse>
52728 for super::SignSolanaTransactionResponse
52729 {
52730 type Error = super::error::ConversionError;
52731 fn try_from(
52732 value: SignSolanaTransactionResponse,
52733 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52734 Ok(Self {
52735 signed_transaction: value.signed_transaction?,
52736 })
52737 }
52738 }
52739 impl ::std::convert::From<super::SignSolanaTransactionResponse> for SignSolanaTransactionResponse {
52740 fn from(value: super::SignSolanaTransactionResponse) -> Self {
52741 Self {
52742 signed_transaction: Ok(value.signed_transaction),
52743 }
52744 }
52745 }
52746 #[derive(Clone, Debug)]
52747 pub struct SmsAuthentication {
52748 phone_number:
52749 ::std::result::Result<super::SmsAuthenticationPhoneNumber, ::std::string::String>,
52750 type_: ::std::result::Result<super::SmsAuthenticationType, ::std::string::String>,
52751 }
52752 impl ::std::default::Default for SmsAuthentication {
52753 fn default() -> Self {
52754 Self {
52755 phone_number: Err("no value supplied for phone_number".to_string()),
52756 type_: Err("no value supplied for type_".to_string()),
52757 }
52758 }
52759 }
52760 impl SmsAuthentication {
52761 pub fn phone_number<T>(mut self, value: T) -> Self
52762 where
52763 T: ::std::convert::TryInto<super::SmsAuthenticationPhoneNumber>,
52764 T::Error: ::std::fmt::Display,
52765 {
52766 self.phone_number = value.try_into().map_err(|e| {
52767 format!("error converting supplied value for phone_number: {}", e)
52768 });
52769 self
52770 }
52771 pub fn type_<T>(mut self, value: T) -> Self
52772 where
52773 T: ::std::convert::TryInto<super::SmsAuthenticationType>,
52774 T::Error: ::std::fmt::Display,
52775 {
52776 self.type_ = value
52777 .try_into()
52778 .map_err(|e| format!("error converting supplied value for type_: {}", e));
52779 self
52780 }
52781 }
52782 impl ::std::convert::TryFrom<SmsAuthentication> for super::SmsAuthentication {
52783 type Error = super::error::ConversionError;
52784 fn try_from(
52785 value: SmsAuthentication,
52786 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52787 Ok(Self {
52788 phone_number: value.phone_number?,
52789 type_: value.type_?,
52790 })
52791 }
52792 }
52793 impl ::std::convert::From<super::SmsAuthentication> for SmsAuthentication {
52794 fn from(value: super::SmsAuthentication) -> Self {
52795 Self {
52796 phone_number: Ok(value.phone_number),
52797 type_: Ok(value.type_),
52798 }
52799 }
52800 }
52801 #[derive(Clone, Debug)]
52802 pub struct SolAddressCriterion {
52803 addresses: ::std::result::Result<
52804 ::std::vec::Vec<super::SolAddressCriterionAddressesItem>,
52805 ::std::string::String,
52806 >,
52807 operator:
52808 ::std::result::Result<super::SolAddressCriterionOperator, ::std::string::String>,
52809 type_: ::std::result::Result<super::SolAddressCriterionType, ::std::string::String>,
52810 }
52811 impl ::std::default::Default for SolAddressCriterion {
52812 fn default() -> Self {
52813 Self {
52814 addresses: Err("no value supplied for addresses".to_string()),
52815 operator: Err("no value supplied for operator".to_string()),
52816 type_: Err("no value supplied for type_".to_string()),
52817 }
52818 }
52819 }
52820 impl SolAddressCriterion {
52821 pub fn addresses<T>(mut self, value: T) -> Self
52822 where
52823 T: ::std::convert::TryInto<
52824 ::std::vec::Vec<super::SolAddressCriterionAddressesItem>,
52825 >,
52826 T::Error: ::std::fmt::Display,
52827 {
52828 self.addresses = value
52829 .try_into()
52830 .map_err(|e| format!("error converting supplied value for addresses: {}", e));
52831 self
52832 }
52833 pub fn operator<T>(mut self, value: T) -> Self
52834 where
52835 T: ::std::convert::TryInto<super::SolAddressCriterionOperator>,
52836 T::Error: ::std::fmt::Display,
52837 {
52838 self.operator = value
52839 .try_into()
52840 .map_err(|e| format!("error converting supplied value for operator: {}", e));
52841 self
52842 }
52843 pub fn type_<T>(mut self, value: T) -> Self
52844 where
52845 T: ::std::convert::TryInto<super::SolAddressCriterionType>,
52846 T::Error: ::std::fmt::Display,
52847 {
52848 self.type_ = value
52849 .try_into()
52850 .map_err(|e| format!("error converting supplied value for type_: {}", e));
52851 self
52852 }
52853 }
52854 impl ::std::convert::TryFrom<SolAddressCriterion> for super::SolAddressCriterion {
52855 type Error = super::error::ConversionError;
52856 fn try_from(
52857 value: SolAddressCriterion,
52858 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52859 Ok(Self {
52860 addresses: value.addresses?,
52861 operator: value.operator?,
52862 type_: value.type_?,
52863 })
52864 }
52865 }
52866 impl ::std::convert::From<super::SolAddressCriterion> for SolAddressCriterion {
52867 fn from(value: super::SolAddressCriterion) -> Self {
52868 Self {
52869 addresses: Ok(value.addresses),
52870 operator: Ok(value.operator),
52871 type_: Ok(value.type_),
52872 }
52873 }
52874 }
52875 #[derive(Clone, Debug)]
52876 pub struct SolDataCondition {
52877 instruction: ::std::result::Result<::std::string::String, ::std::string::String>,
52878 params: ::std::result::Result<
52879 ::std::vec::Vec<super::SolDataConditionParamsItem>,
52880 ::std::string::String,
52881 >,
52882 }
52883 impl ::std::default::Default for SolDataCondition {
52884 fn default() -> Self {
52885 Self {
52886 instruction: Err("no value supplied for instruction".to_string()),
52887 params: Ok(Default::default()),
52888 }
52889 }
52890 }
52891 impl SolDataCondition {
52892 pub fn instruction<T>(mut self, value: T) -> Self
52893 where
52894 T: ::std::convert::TryInto<::std::string::String>,
52895 T::Error: ::std::fmt::Display,
52896 {
52897 self.instruction = value
52898 .try_into()
52899 .map_err(|e| format!("error converting supplied value for instruction: {}", e));
52900 self
52901 }
52902 pub fn params<T>(mut self, value: T) -> Self
52903 where
52904 T: ::std::convert::TryInto<::std::vec::Vec<super::SolDataConditionParamsItem>>,
52905 T::Error: ::std::fmt::Display,
52906 {
52907 self.params = value
52908 .try_into()
52909 .map_err(|e| format!("error converting supplied value for params: {}", e));
52910 self
52911 }
52912 }
52913 impl ::std::convert::TryFrom<SolDataCondition> for super::SolDataCondition {
52914 type Error = super::error::ConversionError;
52915 fn try_from(
52916 value: SolDataCondition,
52917 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52918 Ok(Self {
52919 instruction: value.instruction?,
52920 params: value.params?,
52921 })
52922 }
52923 }
52924 impl ::std::convert::From<super::SolDataCondition> for SolDataCondition {
52925 fn from(value: super::SolDataCondition) -> Self {
52926 Self {
52927 instruction: Ok(value.instruction),
52928 params: Ok(value.params),
52929 }
52930 }
52931 }
52932 #[derive(Clone, Debug)]
52933 pub struct SolDataCriterion {
52934 conditions: ::std::result::Result<
52935 ::std::vec::Vec<super::SolDataCondition>,
52936 ::std::string::String,
52937 >,
52938 idls: ::std::result::Result<
52939 ::std::vec::Vec<super::SolDataCriterionIdlsItem>,
52940 ::std::string::String,
52941 >,
52942 type_: ::std::result::Result<super::SolDataCriterionType, ::std::string::String>,
52943 }
52944 impl ::std::default::Default for SolDataCriterion {
52945 fn default() -> Self {
52946 Self {
52947 conditions: Err("no value supplied for conditions".to_string()),
52948 idls: Err("no value supplied for idls".to_string()),
52949 type_: Err("no value supplied for type_".to_string()),
52950 }
52951 }
52952 }
52953 impl SolDataCriterion {
52954 pub fn conditions<T>(mut self, value: T) -> Self
52955 where
52956 T: ::std::convert::TryInto<::std::vec::Vec<super::SolDataCondition>>,
52957 T::Error: ::std::fmt::Display,
52958 {
52959 self.conditions = value
52960 .try_into()
52961 .map_err(|e| format!("error converting supplied value for conditions: {}", e));
52962 self
52963 }
52964 pub fn idls<T>(mut self, value: T) -> Self
52965 where
52966 T: ::std::convert::TryInto<::std::vec::Vec<super::SolDataCriterionIdlsItem>>,
52967 T::Error: ::std::fmt::Display,
52968 {
52969 self.idls = value
52970 .try_into()
52971 .map_err(|e| format!("error converting supplied value for idls: {}", e));
52972 self
52973 }
52974 pub fn type_<T>(mut self, value: T) -> Self
52975 where
52976 T: ::std::convert::TryInto<super::SolDataCriterionType>,
52977 T::Error: ::std::fmt::Display,
52978 {
52979 self.type_ = value
52980 .try_into()
52981 .map_err(|e| format!("error converting supplied value for type_: {}", e));
52982 self
52983 }
52984 }
52985 impl ::std::convert::TryFrom<SolDataCriterion> for super::SolDataCriterion {
52986 type Error = super::error::ConversionError;
52987 fn try_from(
52988 value: SolDataCriterion,
52989 ) -> ::std::result::Result<Self, super::error::ConversionError> {
52990 Ok(Self {
52991 conditions: value.conditions?,
52992 idls: value.idls?,
52993 type_: value.type_?,
52994 })
52995 }
52996 }
52997 impl ::std::convert::From<super::SolDataCriterion> for SolDataCriterion {
52998 fn from(value: super::SolDataCriterion) -> Self {
52999 Self {
53000 conditions: Ok(value.conditions),
53001 idls: Ok(value.idls),
53002 type_: Ok(value.type_),
53003 }
53004 }
53005 }
53006 #[derive(Clone, Debug)]
53007 pub struct SolDataParameterCondition {
53008 name: ::std::result::Result<::std::string::String, ::std::string::String>,
53009 operator: ::std::result::Result<
53010 super::SolDataParameterConditionOperator,
53011 ::std::string::String,
53012 >,
53013 value: ::std::result::Result<::std::string::String, ::std::string::String>,
53014 }
53015 impl ::std::default::Default for SolDataParameterCondition {
53016 fn default() -> Self {
53017 Self {
53018 name: Err("no value supplied for name".to_string()),
53019 operator: Err("no value supplied for operator".to_string()),
53020 value: Err("no value supplied for value".to_string()),
53021 }
53022 }
53023 }
53024 impl SolDataParameterCondition {
53025 pub fn name<T>(mut self, value: T) -> Self
53026 where
53027 T: ::std::convert::TryInto<::std::string::String>,
53028 T::Error: ::std::fmt::Display,
53029 {
53030 self.name = value
53031 .try_into()
53032 .map_err(|e| format!("error converting supplied value for name: {}", e));
53033 self
53034 }
53035 pub fn operator<T>(mut self, value: T) -> Self
53036 where
53037 T: ::std::convert::TryInto<super::SolDataParameterConditionOperator>,
53038 T::Error: ::std::fmt::Display,
53039 {
53040 self.operator = value
53041 .try_into()
53042 .map_err(|e| format!("error converting supplied value for operator: {}", e));
53043 self
53044 }
53045 pub fn value<T>(mut self, value: T) -> Self
53046 where
53047 T: ::std::convert::TryInto<::std::string::String>,
53048 T::Error: ::std::fmt::Display,
53049 {
53050 self.value = value
53051 .try_into()
53052 .map_err(|e| format!("error converting supplied value for value: {}", e));
53053 self
53054 }
53055 }
53056 impl ::std::convert::TryFrom<SolDataParameterCondition> for super::SolDataParameterCondition {
53057 type Error = super::error::ConversionError;
53058 fn try_from(
53059 value: SolDataParameterCondition,
53060 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53061 Ok(Self {
53062 name: value.name?,
53063 operator: value.operator?,
53064 value: value.value?,
53065 })
53066 }
53067 }
53068 impl ::std::convert::From<super::SolDataParameterCondition> for SolDataParameterCondition {
53069 fn from(value: super::SolDataParameterCondition) -> Self {
53070 Self {
53071 name: Ok(value.name),
53072 operator: Ok(value.operator),
53073 value: Ok(value.value),
53074 }
53075 }
53076 }
53077 #[derive(Clone, Debug)]
53078 pub struct SolDataParameterConditionList {
53079 name: ::std::result::Result<::std::string::String, ::std::string::String>,
53080 operator: ::std::result::Result<
53081 super::SolDataParameterConditionListOperator,
53082 ::std::string::String,
53083 >,
53084 values: ::std::result::Result<
53085 ::std::vec::Vec<::std::string::String>,
53086 ::std::string::String,
53087 >,
53088 }
53089 impl ::std::default::Default for SolDataParameterConditionList {
53090 fn default() -> Self {
53091 Self {
53092 name: Err("no value supplied for name".to_string()),
53093 operator: Err("no value supplied for operator".to_string()),
53094 values: Err("no value supplied for values".to_string()),
53095 }
53096 }
53097 }
53098 impl SolDataParameterConditionList {
53099 pub fn name<T>(mut self, value: T) -> Self
53100 where
53101 T: ::std::convert::TryInto<::std::string::String>,
53102 T::Error: ::std::fmt::Display,
53103 {
53104 self.name = value
53105 .try_into()
53106 .map_err(|e| format!("error converting supplied value for name: {}", e));
53107 self
53108 }
53109 pub fn operator<T>(mut self, value: T) -> Self
53110 where
53111 T: ::std::convert::TryInto<super::SolDataParameterConditionListOperator>,
53112 T::Error: ::std::fmt::Display,
53113 {
53114 self.operator = value
53115 .try_into()
53116 .map_err(|e| format!("error converting supplied value for operator: {}", e));
53117 self
53118 }
53119 pub fn values<T>(mut self, value: T) -> Self
53120 where
53121 T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
53122 T::Error: ::std::fmt::Display,
53123 {
53124 self.values = value
53125 .try_into()
53126 .map_err(|e| format!("error converting supplied value for values: {}", e));
53127 self
53128 }
53129 }
53130 impl ::std::convert::TryFrom<SolDataParameterConditionList>
53131 for super::SolDataParameterConditionList
53132 {
53133 type Error = super::error::ConversionError;
53134 fn try_from(
53135 value: SolDataParameterConditionList,
53136 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53137 Ok(Self {
53138 name: value.name?,
53139 operator: value.operator?,
53140 values: value.values?,
53141 })
53142 }
53143 }
53144 impl ::std::convert::From<super::SolDataParameterConditionList> for SolDataParameterConditionList {
53145 fn from(value: super::SolDataParameterConditionList) -> Self {
53146 Self {
53147 name: Ok(value.name),
53148 operator: Ok(value.operator),
53149 values: Ok(value.values),
53150 }
53151 }
53152 }
53153 #[derive(Clone, Debug)]
53154 pub struct SolMessageCriterion {
53155 match_: ::std::result::Result<::std::string::String, ::std::string::String>,
53156 type_: ::std::result::Result<super::SolMessageCriterionType, ::std::string::String>,
53157 }
53158 impl ::std::default::Default for SolMessageCriterion {
53159 fn default() -> Self {
53160 Self {
53161 match_: Err("no value supplied for match_".to_string()),
53162 type_: Err("no value supplied for type_".to_string()),
53163 }
53164 }
53165 }
53166 impl SolMessageCriterion {
53167 pub fn match_<T>(mut self, value: T) -> Self
53168 where
53169 T: ::std::convert::TryInto<::std::string::String>,
53170 T::Error: ::std::fmt::Display,
53171 {
53172 self.match_ = value
53173 .try_into()
53174 .map_err(|e| format!("error converting supplied value for match_: {}", e));
53175 self
53176 }
53177 pub fn type_<T>(mut self, value: T) -> Self
53178 where
53179 T: ::std::convert::TryInto<super::SolMessageCriterionType>,
53180 T::Error: ::std::fmt::Display,
53181 {
53182 self.type_ = value
53183 .try_into()
53184 .map_err(|e| format!("error converting supplied value for type_: {}", e));
53185 self
53186 }
53187 }
53188 impl ::std::convert::TryFrom<SolMessageCriterion> for super::SolMessageCriterion {
53189 type Error = super::error::ConversionError;
53190 fn try_from(
53191 value: SolMessageCriterion,
53192 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53193 Ok(Self {
53194 match_: value.match_?,
53195 type_: value.type_?,
53196 })
53197 }
53198 }
53199 impl ::std::convert::From<super::SolMessageCriterion> for SolMessageCriterion {
53200 fn from(value: super::SolMessageCriterion) -> Self {
53201 Self {
53202 match_: Ok(value.match_),
53203 type_: Ok(value.type_),
53204 }
53205 }
53206 }
53207 #[derive(Clone, Debug)]
53208 pub struct SolNetworkCriterion {
53209 networks: ::std::result::Result<
53210 ::std::vec::Vec<super::SolNetworkCriterionNetworksItem>,
53211 ::std::string::String,
53212 >,
53213 operator:
53214 ::std::result::Result<super::SolNetworkCriterionOperator, ::std::string::String>,
53215 type_: ::std::result::Result<super::SolNetworkCriterionType, ::std::string::String>,
53216 }
53217 impl ::std::default::Default for SolNetworkCriterion {
53218 fn default() -> Self {
53219 Self {
53220 networks: Err("no value supplied for networks".to_string()),
53221 operator: Err("no value supplied for operator".to_string()),
53222 type_: Err("no value supplied for type_".to_string()),
53223 }
53224 }
53225 }
53226 impl SolNetworkCriterion {
53227 pub fn networks<T>(mut self, value: T) -> Self
53228 where
53229 T: ::std::convert::TryInto<::std::vec::Vec<super::SolNetworkCriterionNetworksItem>>,
53230 T::Error: ::std::fmt::Display,
53231 {
53232 self.networks = value
53233 .try_into()
53234 .map_err(|e| format!("error converting supplied value for networks: {}", e));
53235 self
53236 }
53237 pub fn operator<T>(mut self, value: T) -> Self
53238 where
53239 T: ::std::convert::TryInto<super::SolNetworkCriterionOperator>,
53240 T::Error: ::std::fmt::Display,
53241 {
53242 self.operator = value
53243 .try_into()
53244 .map_err(|e| format!("error converting supplied value for operator: {}", e));
53245 self
53246 }
53247 pub fn type_<T>(mut self, value: T) -> Self
53248 where
53249 T: ::std::convert::TryInto<super::SolNetworkCriterionType>,
53250 T::Error: ::std::fmt::Display,
53251 {
53252 self.type_ = value
53253 .try_into()
53254 .map_err(|e| format!("error converting supplied value for type_: {}", e));
53255 self
53256 }
53257 }
53258 impl ::std::convert::TryFrom<SolNetworkCriterion> for super::SolNetworkCriterion {
53259 type Error = super::error::ConversionError;
53260 fn try_from(
53261 value: SolNetworkCriterion,
53262 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53263 Ok(Self {
53264 networks: value.networks?,
53265 operator: value.operator?,
53266 type_: value.type_?,
53267 })
53268 }
53269 }
53270 impl ::std::convert::From<super::SolNetworkCriterion> for SolNetworkCriterion {
53271 fn from(value: super::SolNetworkCriterion) -> Self {
53272 Self {
53273 networks: Ok(value.networks),
53274 operator: Ok(value.operator),
53275 type_: Ok(value.type_),
53276 }
53277 }
53278 }
53279 #[derive(Clone, Debug)]
53280 pub struct SolValueCriterion {
53281 operator:
53282 ::std::result::Result<super::SolValueCriterionOperator, ::std::string::String>,
53283 sol_value: ::std::result::Result<::std::string::String, ::std::string::String>,
53284 type_: ::std::result::Result<super::SolValueCriterionType, ::std::string::String>,
53285 }
53286 impl ::std::default::Default for SolValueCriterion {
53287 fn default() -> Self {
53288 Self {
53289 operator: Err("no value supplied for operator".to_string()),
53290 sol_value: Err("no value supplied for sol_value".to_string()),
53291 type_: Err("no value supplied for type_".to_string()),
53292 }
53293 }
53294 }
53295 impl SolValueCriterion {
53296 pub fn operator<T>(mut self, value: T) -> Self
53297 where
53298 T: ::std::convert::TryInto<super::SolValueCriterionOperator>,
53299 T::Error: ::std::fmt::Display,
53300 {
53301 self.operator = value
53302 .try_into()
53303 .map_err(|e| format!("error converting supplied value for operator: {}", e));
53304 self
53305 }
53306 pub fn sol_value<T>(mut self, value: T) -> Self
53307 where
53308 T: ::std::convert::TryInto<::std::string::String>,
53309 T::Error: ::std::fmt::Display,
53310 {
53311 self.sol_value = value
53312 .try_into()
53313 .map_err(|e| format!("error converting supplied value for sol_value: {}", e));
53314 self
53315 }
53316 pub fn type_<T>(mut self, value: T) -> Self
53317 where
53318 T: ::std::convert::TryInto<super::SolValueCriterionType>,
53319 T::Error: ::std::fmt::Display,
53320 {
53321 self.type_ = value
53322 .try_into()
53323 .map_err(|e| format!("error converting supplied value for type_: {}", e));
53324 self
53325 }
53326 }
53327 impl ::std::convert::TryFrom<SolValueCriterion> for super::SolValueCriterion {
53328 type Error = super::error::ConversionError;
53329 fn try_from(
53330 value: SolValueCriterion,
53331 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53332 Ok(Self {
53333 operator: value.operator?,
53334 sol_value: value.sol_value?,
53335 type_: value.type_?,
53336 })
53337 }
53338 }
53339 impl ::std::convert::From<super::SolValueCriterion> for SolValueCriterion {
53340 fn from(value: super::SolValueCriterion) -> Self {
53341 Self {
53342 operator: Ok(value.operator),
53343 sol_value: Ok(value.sol_value),
53344 type_: Ok(value.type_),
53345 }
53346 }
53347 }
53348 #[derive(Clone, Debug)]
53349 pub struct SolanaAccount {
53350 address: ::std::result::Result<super::SolanaAccountAddress, ::std::string::String>,
53351 created_at: ::std::result::Result<
53352 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
53353 ::std::string::String,
53354 >,
53355 name: ::std::result::Result<
53356 ::std::option::Option<super::SolanaAccountName>,
53357 ::std::string::String,
53358 >,
53359 policies: ::std::result::Result<
53360 ::std::vec::Vec<super::SolanaAccountPoliciesItem>,
53361 ::std::string::String,
53362 >,
53363 updated_at: ::std::result::Result<
53364 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
53365 ::std::string::String,
53366 >,
53367 }
53368 impl ::std::default::Default for SolanaAccount {
53369 fn default() -> Self {
53370 Self {
53371 address: Err("no value supplied for address".to_string()),
53372 created_at: Ok(Default::default()),
53373 name: Ok(Default::default()),
53374 policies: Ok(Default::default()),
53375 updated_at: Ok(Default::default()),
53376 }
53377 }
53378 }
53379 impl SolanaAccount {
53380 pub fn address<T>(mut self, value: T) -> Self
53381 where
53382 T: ::std::convert::TryInto<super::SolanaAccountAddress>,
53383 T::Error: ::std::fmt::Display,
53384 {
53385 self.address = value
53386 .try_into()
53387 .map_err(|e| format!("error converting supplied value for address: {}", e));
53388 self
53389 }
53390 pub fn created_at<T>(mut self, value: T) -> Self
53391 where
53392 T: ::std::convert::TryInto<
53393 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
53394 >,
53395 T::Error: ::std::fmt::Display,
53396 {
53397 self.created_at = value
53398 .try_into()
53399 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
53400 self
53401 }
53402 pub fn name<T>(mut self, value: T) -> Self
53403 where
53404 T: ::std::convert::TryInto<::std::option::Option<super::SolanaAccountName>>,
53405 T::Error: ::std::fmt::Display,
53406 {
53407 self.name = value
53408 .try_into()
53409 .map_err(|e| format!("error converting supplied value for name: {}", e));
53410 self
53411 }
53412 pub fn policies<T>(mut self, value: T) -> Self
53413 where
53414 T: ::std::convert::TryInto<::std::vec::Vec<super::SolanaAccountPoliciesItem>>,
53415 T::Error: ::std::fmt::Display,
53416 {
53417 self.policies = value
53418 .try_into()
53419 .map_err(|e| format!("error converting supplied value for policies: {}", e));
53420 self
53421 }
53422 pub fn updated_at<T>(mut self, value: T) -> Self
53423 where
53424 T: ::std::convert::TryInto<
53425 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
53426 >,
53427 T::Error: ::std::fmt::Display,
53428 {
53429 self.updated_at = value
53430 .try_into()
53431 .map_err(|e| format!("error converting supplied value for updated_at: {}", e));
53432 self
53433 }
53434 }
53435 impl ::std::convert::TryFrom<SolanaAccount> for super::SolanaAccount {
53436 type Error = super::error::ConversionError;
53437 fn try_from(
53438 value: SolanaAccount,
53439 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53440 Ok(Self {
53441 address: value.address?,
53442 created_at: value.created_at?,
53443 name: value.name?,
53444 policies: value.policies?,
53445 updated_at: value.updated_at?,
53446 })
53447 }
53448 }
53449 impl ::std::convert::From<super::SolanaAccount> for SolanaAccount {
53450 fn from(value: super::SolanaAccount) -> Self {
53451 Self {
53452 address: Ok(value.address),
53453 created_at: Ok(value.created_at),
53454 name: Ok(value.name),
53455 policies: Ok(value.policies),
53456 updated_at: Ok(value.updated_at),
53457 }
53458 }
53459 }
53460 #[derive(Clone, Debug)]
53461 pub struct SolanaToken {
53462 mint_address:
53463 ::std::result::Result<super::SolanaTokenMintAddress, ::std::string::String>,
53464 name: ::std::result::Result<
53465 ::std::option::Option<::std::string::String>,
53466 ::std::string::String,
53467 >,
53468 symbol: ::std::result::Result<
53469 ::std::option::Option<::std::string::String>,
53470 ::std::string::String,
53471 >,
53472 }
53473 impl ::std::default::Default for SolanaToken {
53474 fn default() -> Self {
53475 Self {
53476 mint_address: Err("no value supplied for mint_address".to_string()),
53477 name: Ok(Default::default()),
53478 symbol: Ok(Default::default()),
53479 }
53480 }
53481 }
53482 impl SolanaToken {
53483 pub fn mint_address<T>(mut self, value: T) -> Self
53484 where
53485 T: ::std::convert::TryInto<super::SolanaTokenMintAddress>,
53486 T::Error: ::std::fmt::Display,
53487 {
53488 self.mint_address = value.try_into().map_err(|e| {
53489 format!("error converting supplied value for mint_address: {}", e)
53490 });
53491 self
53492 }
53493 pub fn name<T>(mut self, value: T) -> Self
53494 where
53495 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
53496 T::Error: ::std::fmt::Display,
53497 {
53498 self.name = value
53499 .try_into()
53500 .map_err(|e| format!("error converting supplied value for name: {}", e));
53501 self
53502 }
53503 pub fn symbol<T>(mut self, value: T) -> Self
53504 where
53505 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
53506 T::Error: ::std::fmt::Display,
53507 {
53508 self.symbol = value
53509 .try_into()
53510 .map_err(|e| format!("error converting supplied value for symbol: {}", e));
53511 self
53512 }
53513 }
53514 impl ::std::convert::TryFrom<SolanaToken> for super::SolanaToken {
53515 type Error = super::error::ConversionError;
53516 fn try_from(
53517 value: SolanaToken,
53518 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53519 Ok(Self {
53520 mint_address: value.mint_address?,
53521 name: value.name?,
53522 symbol: value.symbol?,
53523 })
53524 }
53525 }
53526 impl ::std::convert::From<super::SolanaToken> for SolanaToken {
53527 fn from(value: super::SolanaToken) -> Self {
53528 Self {
53529 mint_address: Ok(value.mint_address),
53530 name: Ok(value.name),
53531 symbol: Ok(value.symbol),
53532 }
53533 }
53534 }
53535 #[derive(Clone, Debug)]
53536 pub struct SolanaTokenAmount {
53537 amount: ::std::result::Result<super::SolanaTokenAmountAmount, ::std::string::String>,
53538 decimals: ::std::result::Result<i64, ::std::string::String>,
53539 }
53540 impl ::std::default::Default for SolanaTokenAmount {
53541 fn default() -> Self {
53542 Self {
53543 amount: Err("no value supplied for amount".to_string()),
53544 decimals: Err("no value supplied for decimals".to_string()),
53545 }
53546 }
53547 }
53548 impl SolanaTokenAmount {
53549 pub fn amount<T>(mut self, value: T) -> Self
53550 where
53551 T: ::std::convert::TryInto<super::SolanaTokenAmountAmount>,
53552 T::Error: ::std::fmt::Display,
53553 {
53554 self.amount = value
53555 .try_into()
53556 .map_err(|e| format!("error converting supplied value for amount: {}", e));
53557 self
53558 }
53559 pub fn decimals<T>(mut self, value: T) -> Self
53560 where
53561 T: ::std::convert::TryInto<i64>,
53562 T::Error: ::std::fmt::Display,
53563 {
53564 self.decimals = value
53565 .try_into()
53566 .map_err(|e| format!("error converting supplied value for decimals: {}", e));
53567 self
53568 }
53569 }
53570 impl ::std::convert::TryFrom<SolanaTokenAmount> for super::SolanaTokenAmount {
53571 type Error = super::error::ConversionError;
53572 fn try_from(
53573 value: SolanaTokenAmount,
53574 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53575 Ok(Self {
53576 amount: value.amount?,
53577 decimals: value.decimals?,
53578 })
53579 }
53580 }
53581 impl ::std::convert::From<super::SolanaTokenAmount> for SolanaTokenAmount {
53582 fn from(value: super::SolanaTokenAmount) -> Self {
53583 Self {
53584 amount: Ok(value.amount),
53585 decimals: Ok(value.decimals),
53586 }
53587 }
53588 }
53589 #[derive(Clone, Debug)]
53590 pub struct SolanaTokenBalance {
53591 amount: ::std::result::Result<super::SolanaTokenAmount, ::std::string::String>,
53592 token: ::std::result::Result<super::SolanaToken, ::std::string::String>,
53593 }
53594 impl ::std::default::Default for SolanaTokenBalance {
53595 fn default() -> Self {
53596 Self {
53597 amount: Err("no value supplied for amount".to_string()),
53598 token: Err("no value supplied for token".to_string()),
53599 }
53600 }
53601 }
53602 impl SolanaTokenBalance {
53603 pub fn amount<T>(mut self, value: T) -> Self
53604 where
53605 T: ::std::convert::TryInto<super::SolanaTokenAmount>,
53606 T::Error: ::std::fmt::Display,
53607 {
53608 self.amount = value
53609 .try_into()
53610 .map_err(|e| format!("error converting supplied value for amount: {}", e));
53611 self
53612 }
53613 pub fn token<T>(mut self, value: T) -> Self
53614 where
53615 T: ::std::convert::TryInto<super::SolanaToken>,
53616 T::Error: ::std::fmt::Display,
53617 {
53618 self.token = value
53619 .try_into()
53620 .map_err(|e| format!("error converting supplied value for token: {}", e));
53621 self
53622 }
53623 }
53624 impl ::std::convert::TryFrom<SolanaTokenBalance> for super::SolanaTokenBalance {
53625 type Error = super::error::ConversionError;
53626 fn try_from(
53627 value: SolanaTokenBalance,
53628 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53629 Ok(Self {
53630 amount: value.amount?,
53631 token: value.token?,
53632 })
53633 }
53634 }
53635 impl ::std::convert::From<super::SolanaTokenBalance> for SolanaTokenBalance {
53636 fn from(value: super::SolanaTokenBalance) -> Self {
53637 Self {
53638 amount: Ok(value.amount),
53639 token: Ok(value.token),
53640 }
53641 }
53642 }
53643 #[derive(Clone, Debug)]
53644 pub struct SpendPermission {
53645 account: ::std::result::Result<super::SpendPermissionAccount, ::std::string::String>,
53646 allowance: ::std::result::Result<::std::string::String, ::std::string::String>,
53647 end: ::std::result::Result<::std::string::String, ::std::string::String>,
53648 extra_data: ::std::result::Result<::std::string::String, ::std::string::String>,
53649 period: ::std::result::Result<::std::string::String, ::std::string::String>,
53650 salt: ::std::result::Result<::std::string::String, ::std::string::String>,
53651 spender: ::std::result::Result<super::SpendPermissionSpender, ::std::string::String>,
53652 start: ::std::result::Result<::std::string::String, ::std::string::String>,
53653 token: ::std::result::Result<super::SpendPermissionToken, ::std::string::String>,
53654 }
53655 impl ::std::default::Default for SpendPermission {
53656 fn default() -> Self {
53657 Self {
53658 account: Err("no value supplied for account".to_string()),
53659 allowance: Err("no value supplied for allowance".to_string()),
53660 end: Err("no value supplied for end".to_string()),
53661 extra_data: Err("no value supplied for extra_data".to_string()),
53662 period: Err("no value supplied for period".to_string()),
53663 salt: Err("no value supplied for salt".to_string()),
53664 spender: Err("no value supplied for spender".to_string()),
53665 start: Err("no value supplied for start".to_string()),
53666 token: Err("no value supplied for token".to_string()),
53667 }
53668 }
53669 }
53670 impl SpendPermission {
53671 pub fn account<T>(mut self, value: T) -> Self
53672 where
53673 T: ::std::convert::TryInto<super::SpendPermissionAccount>,
53674 T::Error: ::std::fmt::Display,
53675 {
53676 self.account = value
53677 .try_into()
53678 .map_err(|e| format!("error converting supplied value for account: {}", e));
53679 self
53680 }
53681 pub fn allowance<T>(mut self, value: T) -> Self
53682 where
53683 T: ::std::convert::TryInto<::std::string::String>,
53684 T::Error: ::std::fmt::Display,
53685 {
53686 self.allowance = value
53687 .try_into()
53688 .map_err(|e| format!("error converting supplied value for allowance: {}", e));
53689 self
53690 }
53691 pub fn end<T>(mut self, value: T) -> Self
53692 where
53693 T: ::std::convert::TryInto<::std::string::String>,
53694 T::Error: ::std::fmt::Display,
53695 {
53696 self.end = value
53697 .try_into()
53698 .map_err(|e| format!("error converting supplied value for end: {}", e));
53699 self
53700 }
53701 pub fn extra_data<T>(mut self, value: T) -> Self
53702 where
53703 T: ::std::convert::TryInto<::std::string::String>,
53704 T::Error: ::std::fmt::Display,
53705 {
53706 self.extra_data = value
53707 .try_into()
53708 .map_err(|e| format!("error converting supplied value for extra_data: {}", e));
53709 self
53710 }
53711 pub fn period<T>(mut self, value: T) -> Self
53712 where
53713 T: ::std::convert::TryInto<::std::string::String>,
53714 T::Error: ::std::fmt::Display,
53715 {
53716 self.period = value
53717 .try_into()
53718 .map_err(|e| format!("error converting supplied value for period: {}", e));
53719 self
53720 }
53721 pub fn salt<T>(mut self, value: T) -> Self
53722 where
53723 T: ::std::convert::TryInto<::std::string::String>,
53724 T::Error: ::std::fmt::Display,
53725 {
53726 self.salt = value
53727 .try_into()
53728 .map_err(|e| format!("error converting supplied value for salt: {}", e));
53729 self
53730 }
53731 pub fn spender<T>(mut self, value: T) -> Self
53732 where
53733 T: ::std::convert::TryInto<super::SpendPermissionSpender>,
53734 T::Error: ::std::fmt::Display,
53735 {
53736 self.spender = value
53737 .try_into()
53738 .map_err(|e| format!("error converting supplied value for spender: {}", e));
53739 self
53740 }
53741 pub fn start<T>(mut self, value: T) -> Self
53742 where
53743 T: ::std::convert::TryInto<::std::string::String>,
53744 T::Error: ::std::fmt::Display,
53745 {
53746 self.start = value
53747 .try_into()
53748 .map_err(|e| format!("error converting supplied value for start: {}", e));
53749 self
53750 }
53751 pub fn token<T>(mut self, value: T) -> Self
53752 where
53753 T: ::std::convert::TryInto<super::SpendPermissionToken>,
53754 T::Error: ::std::fmt::Display,
53755 {
53756 self.token = value
53757 .try_into()
53758 .map_err(|e| format!("error converting supplied value for token: {}", e));
53759 self
53760 }
53761 }
53762 impl ::std::convert::TryFrom<SpendPermission> for super::SpendPermission {
53763 type Error = super::error::ConversionError;
53764 fn try_from(
53765 value: SpendPermission,
53766 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53767 Ok(Self {
53768 account: value.account?,
53769 allowance: value.allowance?,
53770 end: value.end?,
53771 extra_data: value.extra_data?,
53772 period: value.period?,
53773 salt: value.salt?,
53774 spender: value.spender?,
53775 start: value.start?,
53776 token: value.token?,
53777 })
53778 }
53779 }
53780 impl ::std::convert::From<super::SpendPermission> for SpendPermission {
53781 fn from(value: super::SpendPermission) -> Self {
53782 Self {
53783 account: Ok(value.account),
53784 allowance: Ok(value.allowance),
53785 end: Ok(value.end),
53786 extra_data: Ok(value.extra_data),
53787 period: Ok(value.period),
53788 salt: Ok(value.salt),
53789 spender: Ok(value.spender),
53790 start: Ok(value.start),
53791 token: Ok(value.token),
53792 }
53793 }
53794 }
53795 #[derive(Clone, Debug)]
53796 pub struct SpendPermissionResponseObject {
53797 created_at: ::std::result::Result<
53798 ::chrono::DateTime<::chrono::offset::Utc>,
53799 ::std::string::String,
53800 >,
53801 network: ::std::result::Result<super::SpendPermissionNetwork, ::std::string::String>,
53802 permission: ::std::result::Result<super::SpendPermission, ::std::string::String>,
53803 permission_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
53804 revoked: ::std::result::Result<bool, ::std::string::String>,
53805 revoked_at: ::std::result::Result<
53806 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
53807 ::std::string::String,
53808 >,
53809 }
53810 impl ::std::default::Default for SpendPermissionResponseObject {
53811 fn default() -> Self {
53812 Self {
53813 created_at: Err("no value supplied for created_at".to_string()),
53814 network: Err("no value supplied for network".to_string()),
53815 permission: Err("no value supplied for permission".to_string()),
53816 permission_hash: Err("no value supplied for permission_hash".to_string()),
53817 revoked: Err("no value supplied for revoked".to_string()),
53818 revoked_at: Ok(Default::default()),
53819 }
53820 }
53821 }
53822 impl SpendPermissionResponseObject {
53823 pub fn created_at<T>(mut self, value: T) -> Self
53824 where
53825 T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
53826 T::Error: ::std::fmt::Display,
53827 {
53828 self.created_at = value
53829 .try_into()
53830 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
53831 self
53832 }
53833 pub fn network<T>(mut self, value: T) -> Self
53834 where
53835 T: ::std::convert::TryInto<super::SpendPermissionNetwork>,
53836 T::Error: ::std::fmt::Display,
53837 {
53838 self.network = value
53839 .try_into()
53840 .map_err(|e| format!("error converting supplied value for network: {}", e));
53841 self
53842 }
53843 pub fn permission<T>(mut self, value: T) -> Self
53844 where
53845 T: ::std::convert::TryInto<super::SpendPermission>,
53846 T::Error: ::std::fmt::Display,
53847 {
53848 self.permission = value
53849 .try_into()
53850 .map_err(|e| format!("error converting supplied value for permission: {}", e));
53851 self
53852 }
53853 pub fn permission_hash<T>(mut self, value: T) -> Self
53854 where
53855 T: ::std::convert::TryInto<::std::string::String>,
53856 T::Error: ::std::fmt::Display,
53857 {
53858 self.permission_hash = value.try_into().map_err(|e| {
53859 format!("error converting supplied value for permission_hash: {}", e)
53860 });
53861 self
53862 }
53863 pub fn revoked<T>(mut self, value: T) -> Self
53864 where
53865 T: ::std::convert::TryInto<bool>,
53866 T::Error: ::std::fmt::Display,
53867 {
53868 self.revoked = value
53869 .try_into()
53870 .map_err(|e| format!("error converting supplied value for revoked: {}", e));
53871 self
53872 }
53873 pub fn revoked_at<T>(mut self, value: T) -> Self
53874 where
53875 T: ::std::convert::TryInto<
53876 ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
53877 >,
53878 T::Error: ::std::fmt::Display,
53879 {
53880 self.revoked_at = value
53881 .try_into()
53882 .map_err(|e| format!("error converting supplied value for revoked_at: {}", e));
53883 self
53884 }
53885 }
53886 impl ::std::convert::TryFrom<SpendPermissionResponseObject>
53887 for super::SpendPermissionResponseObject
53888 {
53889 type Error = super::error::ConversionError;
53890 fn try_from(
53891 value: SpendPermissionResponseObject,
53892 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53893 Ok(Self {
53894 created_at: value.created_at?,
53895 network: value.network?,
53896 permission: value.permission?,
53897 permission_hash: value.permission_hash?,
53898 revoked: value.revoked?,
53899 revoked_at: value.revoked_at?,
53900 })
53901 }
53902 }
53903 impl ::std::convert::From<super::SpendPermissionResponseObject> for SpendPermissionResponseObject {
53904 fn from(value: super::SpendPermissionResponseObject) -> Self {
53905 Self {
53906 created_at: Ok(value.created_at),
53907 network: Ok(value.network),
53908 permission: Ok(value.permission),
53909 permission_hash: Ok(value.permission_hash),
53910 revoked: Ok(value.revoked),
53911 revoked_at: Ok(value.revoked_at),
53912 }
53913 }
53914 }
53915 #[derive(Clone, Debug)]
53916 pub struct SplAddressCriterion {
53917 addresses: ::std::result::Result<
53918 ::std::vec::Vec<super::SplAddressCriterionAddressesItem>,
53919 ::std::string::String,
53920 >,
53921 operator:
53922 ::std::result::Result<super::SplAddressCriterionOperator, ::std::string::String>,
53923 type_: ::std::result::Result<super::SplAddressCriterionType, ::std::string::String>,
53924 }
53925 impl ::std::default::Default for SplAddressCriterion {
53926 fn default() -> Self {
53927 Self {
53928 addresses: Err("no value supplied for addresses".to_string()),
53929 operator: Err("no value supplied for operator".to_string()),
53930 type_: Err("no value supplied for type_".to_string()),
53931 }
53932 }
53933 }
53934 impl SplAddressCriterion {
53935 pub fn addresses<T>(mut self, value: T) -> Self
53936 where
53937 T: ::std::convert::TryInto<
53938 ::std::vec::Vec<super::SplAddressCriterionAddressesItem>,
53939 >,
53940 T::Error: ::std::fmt::Display,
53941 {
53942 self.addresses = value
53943 .try_into()
53944 .map_err(|e| format!("error converting supplied value for addresses: {}", e));
53945 self
53946 }
53947 pub fn operator<T>(mut self, value: T) -> Self
53948 where
53949 T: ::std::convert::TryInto<super::SplAddressCriterionOperator>,
53950 T::Error: ::std::fmt::Display,
53951 {
53952 self.operator = value
53953 .try_into()
53954 .map_err(|e| format!("error converting supplied value for operator: {}", e));
53955 self
53956 }
53957 pub fn type_<T>(mut self, value: T) -> Self
53958 where
53959 T: ::std::convert::TryInto<super::SplAddressCriterionType>,
53960 T::Error: ::std::fmt::Display,
53961 {
53962 self.type_ = value
53963 .try_into()
53964 .map_err(|e| format!("error converting supplied value for type_: {}", e));
53965 self
53966 }
53967 }
53968 impl ::std::convert::TryFrom<SplAddressCriterion> for super::SplAddressCriterion {
53969 type Error = super::error::ConversionError;
53970 fn try_from(
53971 value: SplAddressCriterion,
53972 ) -> ::std::result::Result<Self, super::error::ConversionError> {
53973 Ok(Self {
53974 addresses: value.addresses?,
53975 operator: value.operator?,
53976 type_: value.type_?,
53977 })
53978 }
53979 }
53980 impl ::std::convert::From<super::SplAddressCriterion> for SplAddressCriterion {
53981 fn from(value: super::SplAddressCriterion) -> Self {
53982 Self {
53983 addresses: Ok(value.addresses),
53984 operator: Ok(value.operator),
53985 type_: Ok(value.type_),
53986 }
53987 }
53988 }
53989 #[derive(Clone, Debug)]
53990 pub struct SplValueCriterion {
53991 operator:
53992 ::std::result::Result<super::SplValueCriterionOperator, ::std::string::String>,
53993 spl_value: ::std::result::Result<::std::string::String, ::std::string::String>,
53994 type_: ::std::result::Result<super::SplValueCriterionType, ::std::string::String>,
53995 }
53996 impl ::std::default::Default for SplValueCriterion {
53997 fn default() -> Self {
53998 Self {
53999 operator: Err("no value supplied for operator".to_string()),
54000 spl_value: Err("no value supplied for spl_value".to_string()),
54001 type_: Err("no value supplied for type_".to_string()),
54002 }
54003 }
54004 }
54005 impl SplValueCriterion {
54006 pub fn operator<T>(mut self, value: T) -> Self
54007 where
54008 T: ::std::convert::TryInto<super::SplValueCriterionOperator>,
54009 T::Error: ::std::fmt::Display,
54010 {
54011 self.operator = value
54012 .try_into()
54013 .map_err(|e| format!("error converting supplied value for operator: {}", e));
54014 self
54015 }
54016 pub fn spl_value<T>(mut self, value: T) -> Self
54017 where
54018 T: ::std::convert::TryInto<::std::string::String>,
54019 T::Error: ::std::fmt::Display,
54020 {
54021 self.spl_value = value
54022 .try_into()
54023 .map_err(|e| format!("error converting supplied value for spl_value: {}", e));
54024 self
54025 }
54026 pub fn type_<T>(mut self, value: T) -> Self
54027 where
54028 T: ::std::convert::TryInto<super::SplValueCriterionType>,
54029 T::Error: ::std::fmt::Display,
54030 {
54031 self.type_ = value
54032 .try_into()
54033 .map_err(|e| format!("error converting supplied value for type_: {}", e));
54034 self
54035 }
54036 }
54037 impl ::std::convert::TryFrom<SplValueCriterion> for super::SplValueCriterion {
54038 type Error = super::error::ConversionError;
54039 fn try_from(
54040 value: SplValueCriterion,
54041 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54042 Ok(Self {
54043 operator: value.operator?,
54044 spl_value: value.spl_value?,
54045 type_: value.type_?,
54046 })
54047 }
54048 }
54049 impl ::std::convert::From<super::SplValueCriterion> for SplValueCriterion {
54050 fn from(value: super::SplValueCriterion) -> Self {
54051 Self {
54052 operator: Ok(value.operator),
54053 spl_value: Ok(value.spl_value),
54054 type_: Ok(value.type_),
54055 }
54056 }
54057 }
54058 #[derive(Clone, Debug)]
54059 pub struct SupportedX402PaymentKindsResponse {
54060 extensions: ::std::result::Result<
54061 ::std::vec::Vec<::std::string::String>,
54062 ::std::string::String,
54063 >,
54064 kinds: ::std::result::Result<
54065 ::std::vec::Vec<super::X402SupportedPaymentKind>,
54066 ::std::string::String,
54067 >,
54068 signers: ::std::result::Result<
54069 ::std::collections::HashMap<
54070 ::std::string::String,
54071 ::std::vec::Vec<::std::string::String>,
54072 >,
54073 ::std::string::String,
54074 >,
54075 }
54076 impl ::std::default::Default for SupportedX402PaymentKindsResponse {
54077 fn default() -> Self {
54078 Self {
54079 extensions: Err("no value supplied for extensions".to_string()),
54080 kinds: Err("no value supplied for kinds".to_string()),
54081 signers: Err("no value supplied for signers".to_string()),
54082 }
54083 }
54084 }
54085 impl SupportedX402PaymentKindsResponse {
54086 pub fn extensions<T>(mut self, value: T) -> Self
54087 where
54088 T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
54089 T::Error: ::std::fmt::Display,
54090 {
54091 self.extensions = value
54092 .try_into()
54093 .map_err(|e| format!("error converting supplied value for extensions: {}", e));
54094 self
54095 }
54096 pub fn kinds<T>(mut self, value: T) -> Self
54097 where
54098 T: ::std::convert::TryInto<::std::vec::Vec<super::X402SupportedPaymentKind>>,
54099 T::Error: ::std::fmt::Display,
54100 {
54101 self.kinds = value
54102 .try_into()
54103 .map_err(|e| format!("error converting supplied value for kinds: {}", e));
54104 self
54105 }
54106 pub fn signers<T>(mut self, value: T) -> Self
54107 where
54108 T: ::std::convert::TryInto<
54109 ::std::collections::HashMap<
54110 ::std::string::String,
54111 ::std::vec::Vec<::std::string::String>,
54112 >,
54113 >,
54114 T::Error: ::std::fmt::Display,
54115 {
54116 self.signers = value
54117 .try_into()
54118 .map_err(|e| format!("error converting supplied value for signers: {}", e));
54119 self
54120 }
54121 }
54122 impl ::std::convert::TryFrom<SupportedX402PaymentKindsResponse>
54123 for super::SupportedX402PaymentKindsResponse
54124 {
54125 type Error = super::error::ConversionError;
54126 fn try_from(
54127 value: SupportedX402PaymentKindsResponse,
54128 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54129 Ok(Self {
54130 extensions: value.extensions?,
54131 kinds: value.kinds?,
54132 signers: value.signers?,
54133 })
54134 }
54135 }
54136 impl ::std::convert::From<super::SupportedX402PaymentKindsResponse>
54137 for SupportedX402PaymentKindsResponse
54138 {
54139 fn from(value: super::SupportedX402PaymentKindsResponse) -> Self {
54140 Self {
54141 extensions: Ok(value.extensions),
54142 kinds: Ok(value.kinds),
54143 signers: Ok(value.signers),
54144 }
54145 }
54146 }
54147 #[derive(Clone, Debug)]
54148 pub struct SwapUnavailableResponse {
54149 liquidity_available: ::std::result::Result<bool, ::std::string::String>,
54150 }
54151 impl ::std::default::Default for SwapUnavailableResponse {
54152 fn default() -> Self {
54153 Self {
54154 liquidity_available: Err(
54155 "no value supplied for liquidity_available".to_string()
54156 ),
54157 }
54158 }
54159 }
54160 impl SwapUnavailableResponse {
54161 pub fn liquidity_available<T>(mut self, value: T) -> Self
54162 where
54163 T: ::std::convert::TryInto<bool>,
54164 T::Error: ::std::fmt::Display,
54165 {
54166 self.liquidity_available = value.try_into().map_err(|e| {
54167 format!(
54168 "error converting supplied value for liquidity_available: {}",
54169 e
54170 )
54171 });
54172 self
54173 }
54174 }
54175 impl ::std::convert::TryFrom<SwapUnavailableResponse> for super::SwapUnavailableResponse {
54176 type Error = super::error::ConversionError;
54177 fn try_from(
54178 value: SwapUnavailableResponse,
54179 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54180 Ok(Self {
54181 liquidity_available: value.liquidity_available?,
54182 })
54183 }
54184 }
54185 impl ::std::convert::From<super::SwapUnavailableResponse> for SwapUnavailableResponse {
54186 fn from(value: super::SwapUnavailableResponse) -> Self {
54187 Self {
54188 liquidity_available: Ok(value.liquidity_available),
54189 }
54190 }
54191 }
54192 #[derive(Clone, Debug)]
54193 pub struct Token {
54194 contract_address:
54195 ::std::result::Result<super::TokenContractAddress, ::std::string::String>,
54196 name: ::std::result::Result<
54197 ::std::option::Option<::std::string::String>,
54198 ::std::string::String,
54199 >,
54200 network:
54201 ::std::result::Result<super::ListEvmTokenBalancesNetwork, ::std::string::String>,
54202 symbol: ::std::result::Result<
54203 ::std::option::Option<::std::string::String>,
54204 ::std::string::String,
54205 >,
54206 }
54207 impl ::std::default::Default for Token {
54208 fn default() -> Self {
54209 Self {
54210 contract_address: Err("no value supplied for contract_address".to_string()),
54211 name: Ok(Default::default()),
54212 network: Err("no value supplied for network".to_string()),
54213 symbol: Ok(Default::default()),
54214 }
54215 }
54216 }
54217 impl Token {
54218 pub fn contract_address<T>(mut self, value: T) -> Self
54219 where
54220 T: ::std::convert::TryInto<super::TokenContractAddress>,
54221 T::Error: ::std::fmt::Display,
54222 {
54223 self.contract_address = value.try_into().map_err(|e| {
54224 format!(
54225 "error converting supplied value for contract_address: {}",
54226 e
54227 )
54228 });
54229 self
54230 }
54231 pub fn name<T>(mut self, value: T) -> Self
54232 where
54233 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
54234 T::Error: ::std::fmt::Display,
54235 {
54236 self.name = value
54237 .try_into()
54238 .map_err(|e| format!("error converting supplied value for name: {}", e));
54239 self
54240 }
54241 pub fn network<T>(mut self, value: T) -> Self
54242 where
54243 T: ::std::convert::TryInto<super::ListEvmTokenBalancesNetwork>,
54244 T::Error: ::std::fmt::Display,
54245 {
54246 self.network = value
54247 .try_into()
54248 .map_err(|e| format!("error converting supplied value for network: {}", e));
54249 self
54250 }
54251 pub fn symbol<T>(mut self, value: T) -> Self
54252 where
54253 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
54254 T::Error: ::std::fmt::Display,
54255 {
54256 self.symbol = value
54257 .try_into()
54258 .map_err(|e| format!("error converting supplied value for symbol: {}", e));
54259 self
54260 }
54261 }
54262 impl ::std::convert::TryFrom<Token> for super::Token {
54263 type Error = super::error::ConversionError;
54264 fn try_from(
54265 value: Token,
54266 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54267 Ok(Self {
54268 contract_address: value.contract_address?,
54269 name: value.name?,
54270 network: value.network?,
54271 symbol: value.symbol?,
54272 })
54273 }
54274 }
54275 impl ::std::convert::From<super::Token> for Token {
54276 fn from(value: super::Token) -> Self {
54277 Self {
54278 contract_address: Ok(value.contract_address),
54279 name: Ok(value.name),
54280 network: Ok(value.network),
54281 symbol: Ok(value.symbol),
54282 }
54283 }
54284 }
54285 #[derive(Clone, Debug)]
54286 pub struct TokenAmount {
54287 amount: ::std::result::Result<super::TokenAmountAmount, ::std::string::String>,
54288 decimals: ::std::result::Result<i64, ::std::string::String>,
54289 }
54290 impl ::std::default::Default for TokenAmount {
54291 fn default() -> Self {
54292 Self {
54293 amount: Err("no value supplied for amount".to_string()),
54294 decimals: Err("no value supplied for decimals".to_string()),
54295 }
54296 }
54297 }
54298 impl TokenAmount {
54299 pub fn amount<T>(mut self, value: T) -> Self
54300 where
54301 T: ::std::convert::TryInto<super::TokenAmountAmount>,
54302 T::Error: ::std::fmt::Display,
54303 {
54304 self.amount = value
54305 .try_into()
54306 .map_err(|e| format!("error converting supplied value for amount: {}", e));
54307 self
54308 }
54309 pub fn decimals<T>(mut self, value: T) -> Self
54310 where
54311 T: ::std::convert::TryInto<i64>,
54312 T::Error: ::std::fmt::Display,
54313 {
54314 self.decimals = value
54315 .try_into()
54316 .map_err(|e| format!("error converting supplied value for decimals: {}", e));
54317 self
54318 }
54319 }
54320 impl ::std::convert::TryFrom<TokenAmount> for super::TokenAmount {
54321 type Error = super::error::ConversionError;
54322 fn try_from(
54323 value: TokenAmount,
54324 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54325 Ok(Self {
54326 amount: value.amount?,
54327 decimals: value.decimals?,
54328 })
54329 }
54330 }
54331 impl ::std::convert::From<super::TokenAmount> for TokenAmount {
54332 fn from(value: super::TokenAmount) -> Self {
54333 Self {
54334 amount: Ok(value.amount),
54335 decimals: Ok(value.decimals),
54336 }
54337 }
54338 }
54339 #[derive(Clone, Debug)]
54340 pub struct TokenBalance {
54341 amount: ::std::result::Result<super::TokenAmount, ::std::string::String>,
54342 token: ::std::result::Result<super::Token, ::std::string::String>,
54343 }
54344 impl ::std::default::Default for TokenBalance {
54345 fn default() -> Self {
54346 Self {
54347 amount: Err("no value supplied for amount".to_string()),
54348 token: Err("no value supplied for token".to_string()),
54349 }
54350 }
54351 }
54352 impl TokenBalance {
54353 pub fn amount<T>(mut self, value: T) -> Self
54354 where
54355 T: ::std::convert::TryInto<super::TokenAmount>,
54356 T::Error: ::std::fmt::Display,
54357 {
54358 self.amount = value
54359 .try_into()
54360 .map_err(|e| format!("error converting supplied value for amount: {}", e));
54361 self
54362 }
54363 pub fn token<T>(mut self, value: T) -> Self
54364 where
54365 T: ::std::convert::TryInto<super::Token>,
54366 T::Error: ::std::fmt::Display,
54367 {
54368 self.token = value
54369 .try_into()
54370 .map_err(|e| format!("error converting supplied value for token: {}", e));
54371 self
54372 }
54373 }
54374 impl ::std::convert::TryFrom<TokenBalance> for super::TokenBalance {
54375 type Error = super::error::ConversionError;
54376 fn try_from(
54377 value: TokenBalance,
54378 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54379 Ok(Self {
54380 amount: value.amount?,
54381 token: value.token?,
54382 })
54383 }
54384 }
54385 impl ::std::convert::From<super::TokenBalance> for TokenBalance {
54386 fn from(value: super::TokenBalance) -> Self {
54387 Self {
54388 amount: Ok(value.amount),
54389 token: Ok(value.token),
54390 }
54391 }
54392 }
54393 #[derive(Clone, Debug)]
54394 pub struct TokenFee {
54395 amount: ::std::result::Result<super::TokenFeeAmount, ::std::string::String>,
54396 token: ::std::result::Result<super::TokenFeeToken, ::std::string::String>,
54397 }
54398 impl ::std::default::Default for TokenFee {
54399 fn default() -> Self {
54400 Self {
54401 amount: Err("no value supplied for amount".to_string()),
54402 token: Err("no value supplied for token".to_string()),
54403 }
54404 }
54405 }
54406 impl TokenFee {
54407 pub fn amount<T>(mut self, value: T) -> Self
54408 where
54409 T: ::std::convert::TryInto<super::TokenFeeAmount>,
54410 T::Error: ::std::fmt::Display,
54411 {
54412 self.amount = value
54413 .try_into()
54414 .map_err(|e| format!("error converting supplied value for amount: {}", e));
54415 self
54416 }
54417 pub fn token<T>(mut self, value: T) -> Self
54418 where
54419 T: ::std::convert::TryInto<super::TokenFeeToken>,
54420 T::Error: ::std::fmt::Display,
54421 {
54422 self.token = value
54423 .try_into()
54424 .map_err(|e| format!("error converting supplied value for token: {}", e));
54425 self
54426 }
54427 }
54428 impl ::std::convert::TryFrom<TokenFee> for super::TokenFee {
54429 type Error = super::error::ConversionError;
54430 fn try_from(
54431 value: TokenFee,
54432 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54433 Ok(Self {
54434 amount: value.amount?,
54435 token: value.token?,
54436 })
54437 }
54438 }
54439 impl ::std::convert::From<super::TokenFee> for TokenFee {
54440 fn from(value: super::TokenFee) -> Self {
54441 Self {
54442 amount: Ok(value.amount),
54443 token: Ok(value.token),
54444 }
54445 }
54446 }
54447 #[derive(Clone, Debug)]
54448 pub struct UpdateEvmAccountBody {
54449 account_policy: ::std::result::Result<
54450 ::std::option::Option<super::UpdateEvmAccountBodyAccountPolicy>,
54451 ::std::string::String,
54452 >,
54453 name: ::std::result::Result<
54454 ::std::option::Option<super::UpdateEvmAccountBodyName>,
54455 ::std::string::String,
54456 >,
54457 }
54458 impl ::std::default::Default for UpdateEvmAccountBody {
54459 fn default() -> Self {
54460 Self {
54461 account_policy: Ok(Default::default()),
54462 name: Ok(Default::default()),
54463 }
54464 }
54465 }
54466 impl UpdateEvmAccountBody {
54467 pub fn account_policy<T>(mut self, value: T) -> Self
54468 where
54469 T: ::std::convert::TryInto<
54470 ::std::option::Option<super::UpdateEvmAccountBodyAccountPolicy>,
54471 >,
54472 T::Error: ::std::fmt::Display,
54473 {
54474 self.account_policy = value.try_into().map_err(|e| {
54475 format!("error converting supplied value for account_policy: {}", e)
54476 });
54477 self
54478 }
54479 pub fn name<T>(mut self, value: T) -> Self
54480 where
54481 T: ::std::convert::TryInto<::std::option::Option<super::UpdateEvmAccountBodyName>>,
54482 T::Error: ::std::fmt::Display,
54483 {
54484 self.name = value
54485 .try_into()
54486 .map_err(|e| format!("error converting supplied value for name: {}", e));
54487 self
54488 }
54489 }
54490 impl ::std::convert::TryFrom<UpdateEvmAccountBody> for super::UpdateEvmAccountBody {
54491 type Error = super::error::ConversionError;
54492 fn try_from(
54493 value: UpdateEvmAccountBody,
54494 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54495 Ok(Self {
54496 account_policy: value.account_policy?,
54497 name: value.name?,
54498 })
54499 }
54500 }
54501 impl ::std::convert::From<super::UpdateEvmAccountBody> for UpdateEvmAccountBody {
54502 fn from(value: super::UpdateEvmAccountBody) -> Self {
54503 Self {
54504 account_policy: Ok(value.account_policy),
54505 name: Ok(value.name),
54506 }
54507 }
54508 }
54509 #[derive(Clone, Debug)]
54510 pub struct UpdateEvmSmartAccountBody {
54511 name: ::std::result::Result<
54512 ::std::option::Option<super::UpdateEvmSmartAccountBodyName>,
54513 ::std::string::String,
54514 >,
54515 }
54516 impl ::std::default::Default for UpdateEvmSmartAccountBody {
54517 fn default() -> Self {
54518 Self {
54519 name: Ok(Default::default()),
54520 }
54521 }
54522 }
54523 impl UpdateEvmSmartAccountBody {
54524 pub fn name<T>(mut self, value: T) -> Self
54525 where
54526 T: ::std::convert::TryInto<
54527 ::std::option::Option<super::UpdateEvmSmartAccountBodyName>,
54528 >,
54529 T::Error: ::std::fmt::Display,
54530 {
54531 self.name = value
54532 .try_into()
54533 .map_err(|e| format!("error converting supplied value for name: {}", e));
54534 self
54535 }
54536 }
54537 impl ::std::convert::TryFrom<UpdateEvmSmartAccountBody> for super::UpdateEvmSmartAccountBody {
54538 type Error = super::error::ConversionError;
54539 fn try_from(
54540 value: UpdateEvmSmartAccountBody,
54541 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54542 Ok(Self { name: value.name? })
54543 }
54544 }
54545 impl ::std::convert::From<super::UpdateEvmSmartAccountBody> for UpdateEvmSmartAccountBody {
54546 fn from(value: super::UpdateEvmSmartAccountBody) -> Self {
54547 Self {
54548 name: Ok(value.name),
54549 }
54550 }
54551 }
54552 #[derive(Clone, Debug)]
54553 pub struct UpdatePolicyBody {
54554 description: ::std::result::Result<
54555 ::std::option::Option<super::UpdatePolicyBodyDescription>,
54556 ::std::string::String,
54557 >,
54558 rules: ::std::result::Result<::std::vec::Vec<super::Rule>, ::std::string::String>,
54559 }
54560 impl ::std::default::Default for UpdatePolicyBody {
54561 fn default() -> Self {
54562 Self {
54563 description: Ok(Default::default()),
54564 rules: Err("no value supplied for rules".to_string()),
54565 }
54566 }
54567 }
54568 impl UpdatePolicyBody {
54569 pub fn description<T>(mut self, value: T) -> Self
54570 where
54571 T: ::std::convert::TryInto<
54572 ::std::option::Option<super::UpdatePolicyBodyDescription>,
54573 >,
54574 T::Error: ::std::fmt::Display,
54575 {
54576 self.description = value
54577 .try_into()
54578 .map_err(|e| format!("error converting supplied value for description: {}", e));
54579 self
54580 }
54581 pub fn rules<T>(mut self, value: T) -> Self
54582 where
54583 T: ::std::convert::TryInto<::std::vec::Vec<super::Rule>>,
54584 T::Error: ::std::fmt::Display,
54585 {
54586 self.rules = value
54587 .try_into()
54588 .map_err(|e| format!("error converting supplied value for rules: {}", e));
54589 self
54590 }
54591 }
54592 impl ::std::convert::TryFrom<UpdatePolicyBody> for super::UpdatePolicyBody {
54593 type Error = super::error::ConversionError;
54594 fn try_from(
54595 value: UpdatePolicyBody,
54596 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54597 Ok(Self {
54598 description: value.description?,
54599 rules: value.rules?,
54600 })
54601 }
54602 }
54603 impl ::std::convert::From<super::UpdatePolicyBody> for UpdatePolicyBody {
54604 fn from(value: super::UpdatePolicyBody) -> Self {
54605 Self {
54606 description: Ok(value.description),
54607 rules: Ok(value.rules),
54608 }
54609 }
54610 }
54611 #[derive(Clone, Debug)]
54612 pub struct UpdateSolanaAccountBody {
54613 account_policy: ::std::result::Result<
54614 ::std::option::Option<super::UpdateSolanaAccountBodyAccountPolicy>,
54615 ::std::string::String,
54616 >,
54617 name: ::std::result::Result<
54618 ::std::option::Option<super::UpdateSolanaAccountBodyName>,
54619 ::std::string::String,
54620 >,
54621 }
54622 impl ::std::default::Default for UpdateSolanaAccountBody {
54623 fn default() -> Self {
54624 Self {
54625 account_policy: Ok(Default::default()),
54626 name: Ok(Default::default()),
54627 }
54628 }
54629 }
54630 impl UpdateSolanaAccountBody {
54631 pub fn account_policy<T>(mut self, value: T) -> Self
54632 where
54633 T: ::std::convert::TryInto<
54634 ::std::option::Option<super::UpdateSolanaAccountBodyAccountPolicy>,
54635 >,
54636 T::Error: ::std::fmt::Display,
54637 {
54638 self.account_policy = value.try_into().map_err(|e| {
54639 format!("error converting supplied value for account_policy: {}", e)
54640 });
54641 self
54642 }
54643 pub fn name<T>(mut self, value: T) -> Self
54644 where
54645 T: ::std::convert::TryInto<
54646 ::std::option::Option<super::UpdateSolanaAccountBodyName>,
54647 >,
54648 T::Error: ::std::fmt::Display,
54649 {
54650 self.name = value
54651 .try_into()
54652 .map_err(|e| format!("error converting supplied value for name: {}", e));
54653 self
54654 }
54655 }
54656 impl ::std::convert::TryFrom<UpdateSolanaAccountBody> for super::UpdateSolanaAccountBody {
54657 type Error = super::error::ConversionError;
54658 fn try_from(
54659 value: UpdateSolanaAccountBody,
54660 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54661 Ok(Self {
54662 account_policy: value.account_policy?,
54663 name: value.name?,
54664 })
54665 }
54666 }
54667 impl ::std::convert::From<super::UpdateSolanaAccountBody> for UpdateSolanaAccountBody {
54668 fn from(value: super::UpdateSolanaAccountBody) -> Self {
54669 Self {
54670 account_policy: Ok(value.account_policy),
54671 name: Ok(value.name),
54672 }
54673 }
54674 }
54675 #[derive(Clone, Debug)]
54676 pub struct UserOperationReceipt {
54677 block_hash: ::std::result::Result<
54678 ::std::option::Option<super::UserOperationReceiptBlockHash>,
54679 ::std::string::String,
54680 >,
54681 block_number: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
54682 gas_used: ::std::result::Result<
54683 ::std::option::Option<::std::string::String>,
54684 ::std::string::String,
54685 >,
54686 revert: ::std::result::Result<
54687 ::std::option::Option<super::UserOperationReceiptRevert>,
54688 ::std::string::String,
54689 >,
54690 transaction_hash: ::std::result::Result<
54691 ::std::option::Option<super::UserOperationReceiptTransactionHash>,
54692 ::std::string::String,
54693 >,
54694 }
54695 impl ::std::default::Default for UserOperationReceipt {
54696 fn default() -> Self {
54697 Self {
54698 block_hash: Ok(Default::default()),
54699 block_number: Ok(Default::default()),
54700 gas_used: Ok(Default::default()),
54701 revert: Ok(Default::default()),
54702 transaction_hash: Ok(Default::default()),
54703 }
54704 }
54705 }
54706 impl UserOperationReceipt {
54707 pub fn block_hash<T>(mut self, value: T) -> Self
54708 where
54709 T: ::std::convert::TryInto<
54710 ::std::option::Option<super::UserOperationReceiptBlockHash>,
54711 >,
54712 T::Error: ::std::fmt::Display,
54713 {
54714 self.block_hash = value
54715 .try_into()
54716 .map_err(|e| format!("error converting supplied value for block_hash: {}", e));
54717 self
54718 }
54719 pub fn block_number<T>(mut self, value: T) -> Self
54720 where
54721 T: ::std::convert::TryInto<::std::option::Option<i64>>,
54722 T::Error: ::std::fmt::Display,
54723 {
54724 self.block_number = value.try_into().map_err(|e| {
54725 format!("error converting supplied value for block_number: {}", e)
54726 });
54727 self
54728 }
54729 pub fn gas_used<T>(mut self, value: T) -> Self
54730 where
54731 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
54732 T::Error: ::std::fmt::Display,
54733 {
54734 self.gas_used = value
54735 .try_into()
54736 .map_err(|e| format!("error converting supplied value for gas_used: {}", e));
54737 self
54738 }
54739 pub fn revert<T>(mut self, value: T) -> Self
54740 where
54741 T: ::std::convert::TryInto<
54742 ::std::option::Option<super::UserOperationReceiptRevert>,
54743 >,
54744 T::Error: ::std::fmt::Display,
54745 {
54746 self.revert = value
54747 .try_into()
54748 .map_err(|e| format!("error converting supplied value for revert: {}", e));
54749 self
54750 }
54751 pub fn transaction_hash<T>(mut self, value: T) -> Self
54752 where
54753 T: ::std::convert::TryInto<
54754 ::std::option::Option<super::UserOperationReceiptTransactionHash>,
54755 >,
54756 T::Error: ::std::fmt::Display,
54757 {
54758 self.transaction_hash = value.try_into().map_err(|e| {
54759 format!(
54760 "error converting supplied value for transaction_hash: {}",
54761 e
54762 )
54763 });
54764 self
54765 }
54766 }
54767 impl ::std::convert::TryFrom<UserOperationReceipt> for super::UserOperationReceipt {
54768 type Error = super::error::ConversionError;
54769 fn try_from(
54770 value: UserOperationReceipt,
54771 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54772 Ok(Self {
54773 block_hash: value.block_hash?,
54774 block_number: value.block_number?,
54775 gas_used: value.gas_used?,
54776 revert: value.revert?,
54777 transaction_hash: value.transaction_hash?,
54778 })
54779 }
54780 }
54781 impl ::std::convert::From<super::UserOperationReceipt> for UserOperationReceipt {
54782 fn from(value: super::UserOperationReceipt) -> Self {
54783 Self {
54784 block_hash: Ok(value.block_hash),
54785 block_number: Ok(value.block_number),
54786 gas_used: Ok(value.gas_used),
54787 revert: Ok(value.revert),
54788 transaction_hash: Ok(value.transaction_hash),
54789 }
54790 }
54791 }
54792 #[derive(Clone, Debug)]
54793 pub struct UserOperationReceiptRevert {
54794 data:
54795 ::std::result::Result<super::UserOperationReceiptRevertData, ::std::string::String>,
54796 message: ::std::result::Result<::std::string::String, ::std::string::String>,
54797 }
54798 impl ::std::default::Default for UserOperationReceiptRevert {
54799 fn default() -> Self {
54800 Self {
54801 data: Err("no value supplied for data".to_string()),
54802 message: Err("no value supplied for message".to_string()),
54803 }
54804 }
54805 }
54806 impl UserOperationReceiptRevert {
54807 pub fn data<T>(mut self, value: T) -> Self
54808 where
54809 T: ::std::convert::TryInto<super::UserOperationReceiptRevertData>,
54810 T::Error: ::std::fmt::Display,
54811 {
54812 self.data = value
54813 .try_into()
54814 .map_err(|e| format!("error converting supplied value for data: {}", e));
54815 self
54816 }
54817 pub fn message<T>(mut self, value: T) -> Self
54818 where
54819 T: ::std::convert::TryInto<::std::string::String>,
54820 T::Error: ::std::fmt::Display,
54821 {
54822 self.message = value
54823 .try_into()
54824 .map_err(|e| format!("error converting supplied value for message: {}", e));
54825 self
54826 }
54827 }
54828 impl ::std::convert::TryFrom<UserOperationReceiptRevert> for super::UserOperationReceiptRevert {
54829 type Error = super::error::ConversionError;
54830 fn try_from(
54831 value: UserOperationReceiptRevert,
54832 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54833 Ok(Self {
54834 data: value.data?,
54835 message: value.message?,
54836 })
54837 }
54838 }
54839 impl ::std::convert::From<super::UserOperationReceiptRevert> for UserOperationReceiptRevert {
54840 fn from(value: super::UserOperationReceiptRevert) -> Self {
54841 Self {
54842 data: Ok(value.data),
54843 message: Ok(value.message),
54844 }
54845 }
54846 }
54847 #[derive(Clone, Debug)]
54848 pub struct ValidateEndUserAccessTokenBody {
54849 access_token: ::std::result::Result<::std::string::String, ::std::string::String>,
54850 }
54851 impl ::std::default::Default for ValidateEndUserAccessTokenBody {
54852 fn default() -> Self {
54853 Self {
54854 access_token: Err("no value supplied for access_token".to_string()),
54855 }
54856 }
54857 }
54858 impl ValidateEndUserAccessTokenBody {
54859 pub fn access_token<T>(mut self, value: T) -> Self
54860 where
54861 T: ::std::convert::TryInto<::std::string::String>,
54862 T::Error: ::std::fmt::Display,
54863 {
54864 self.access_token = value.try_into().map_err(|e| {
54865 format!("error converting supplied value for access_token: {}", e)
54866 });
54867 self
54868 }
54869 }
54870 impl ::std::convert::TryFrom<ValidateEndUserAccessTokenBody>
54871 for super::ValidateEndUserAccessTokenBody
54872 {
54873 type Error = super::error::ConversionError;
54874 fn try_from(
54875 value: ValidateEndUserAccessTokenBody,
54876 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54877 Ok(Self {
54878 access_token: value.access_token?,
54879 })
54880 }
54881 }
54882 impl ::std::convert::From<super::ValidateEndUserAccessTokenBody>
54883 for ValidateEndUserAccessTokenBody
54884 {
54885 fn from(value: super::ValidateEndUserAccessTokenBody) -> Self {
54886 Self {
54887 access_token: Ok(value.access_token),
54888 }
54889 }
54890 }
54891 #[derive(Clone, Debug)]
54892 pub struct VerifyX402PaymentBody {
54893 payment_payload:
54894 ::std::result::Result<super::X402PaymentPayload, ::std::string::String>,
54895 payment_requirements:
54896 ::std::result::Result<super::X402PaymentRequirements, ::std::string::String>,
54897 x402_version: ::std::result::Result<super::X402Version, ::std::string::String>,
54898 }
54899 impl ::std::default::Default for VerifyX402PaymentBody {
54900 fn default() -> Self {
54901 Self {
54902 payment_payload: Err("no value supplied for payment_payload".to_string()),
54903 payment_requirements: Err(
54904 "no value supplied for payment_requirements".to_string()
54905 ),
54906 x402_version: Err("no value supplied for x402_version".to_string()),
54907 }
54908 }
54909 }
54910 impl VerifyX402PaymentBody {
54911 pub fn payment_payload<T>(mut self, value: T) -> Self
54912 where
54913 T: ::std::convert::TryInto<super::X402PaymentPayload>,
54914 T::Error: ::std::fmt::Display,
54915 {
54916 self.payment_payload = value.try_into().map_err(|e| {
54917 format!("error converting supplied value for payment_payload: {}", e)
54918 });
54919 self
54920 }
54921 pub fn payment_requirements<T>(mut self, value: T) -> Self
54922 where
54923 T: ::std::convert::TryInto<super::X402PaymentRequirements>,
54924 T::Error: ::std::fmt::Display,
54925 {
54926 self.payment_requirements = value.try_into().map_err(|e| {
54927 format!(
54928 "error converting supplied value for payment_requirements: {}",
54929 e
54930 )
54931 });
54932 self
54933 }
54934 pub fn x402_version<T>(mut self, value: T) -> Self
54935 where
54936 T: ::std::convert::TryInto<super::X402Version>,
54937 T::Error: ::std::fmt::Display,
54938 {
54939 self.x402_version = value.try_into().map_err(|e| {
54940 format!("error converting supplied value for x402_version: {}", e)
54941 });
54942 self
54943 }
54944 }
54945 impl ::std::convert::TryFrom<VerifyX402PaymentBody> for super::VerifyX402PaymentBody {
54946 type Error = super::error::ConversionError;
54947 fn try_from(
54948 value: VerifyX402PaymentBody,
54949 ) -> ::std::result::Result<Self, super::error::ConversionError> {
54950 Ok(Self {
54951 payment_payload: value.payment_payload?,
54952 payment_requirements: value.payment_requirements?,
54953 x402_version: value.x402_version?,
54954 })
54955 }
54956 }
54957 impl ::std::convert::From<super::VerifyX402PaymentBody> for VerifyX402PaymentBody {
54958 fn from(value: super::VerifyX402PaymentBody) -> Self {
54959 Self {
54960 payment_payload: Ok(value.payment_payload),
54961 payment_requirements: Ok(value.payment_requirements),
54962 x402_version: Ok(value.x402_version),
54963 }
54964 }
54965 }
54966 #[derive(Clone, Debug)]
54967 pub struct VerifyX402PaymentResponse {
54968 invalid_reason: ::std::result::Result<
54969 ::std::option::Option<super::X402VerifyInvalidReason>,
54970 ::std::string::String,
54971 >,
54972 is_valid: ::std::result::Result<bool, ::std::string::String>,
54973 payer:
54974 ::std::result::Result<super::VerifyX402PaymentResponsePayer, ::std::string::String>,
54975 }
54976 impl ::std::default::Default for VerifyX402PaymentResponse {
54977 fn default() -> Self {
54978 Self {
54979 invalid_reason: Ok(Default::default()),
54980 is_valid: Err("no value supplied for is_valid".to_string()),
54981 payer: Err("no value supplied for payer".to_string()),
54982 }
54983 }
54984 }
54985 impl VerifyX402PaymentResponse {
54986 pub fn invalid_reason<T>(mut self, value: T) -> Self
54987 where
54988 T: ::std::convert::TryInto<::std::option::Option<super::X402VerifyInvalidReason>>,
54989 T::Error: ::std::fmt::Display,
54990 {
54991 self.invalid_reason = value.try_into().map_err(|e| {
54992 format!("error converting supplied value for invalid_reason: {}", e)
54993 });
54994 self
54995 }
54996 pub fn is_valid<T>(mut self, value: T) -> Self
54997 where
54998 T: ::std::convert::TryInto<bool>,
54999 T::Error: ::std::fmt::Display,
55000 {
55001 self.is_valid = value
55002 .try_into()
55003 .map_err(|e| format!("error converting supplied value for is_valid: {}", e));
55004 self
55005 }
55006 pub fn payer<T>(mut self, value: T) -> Self
55007 where
55008 T: ::std::convert::TryInto<super::VerifyX402PaymentResponsePayer>,
55009 T::Error: ::std::fmt::Display,
55010 {
55011 self.payer = value
55012 .try_into()
55013 .map_err(|e| format!("error converting supplied value for payer: {}", e));
55014 self
55015 }
55016 }
55017 impl ::std::convert::TryFrom<VerifyX402PaymentResponse> for super::VerifyX402PaymentResponse {
55018 type Error = super::error::ConversionError;
55019 fn try_from(
55020 value: VerifyX402PaymentResponse,
55021 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55022 Ok(Self {
55023 invalid_reason: value.invalid_reason?,
55024 is_valid: value.is_valid?,
55025 payer: value.payer?,
55026 })
55027 }
55028 }
55029 impl ::std::convert::From<super::VerifyX402PaymentResponse> for VerifyX402PaymentResponse {
55030 fn from(value: super::VerifyX402PaymentResponse) -> Self {
55031 Self {
55032 invalid_reason: Ok(value.invalid_reason),
55033 is_valid: Ok(value.is_valid),
55034 payer: Ok(value.payer),
55035 }
55036 }
55037 }
55038 #[derive(Clone, Debug)]
55039 pub struct WebhookSubscriptionListResponse {
55040 next_page_token: ::std::result::Result<
55041 ::std::option::Option<::std::string::String>,
55042 ::std::string::String,
55043 >,
55044 subscriptions: ::std::result::Result<
55045 ::std::vec::Vec<super::WebhookSubscriptionResponse>,
55046 ::std::string::String,
55047 >,
55048 }
55049 impl ::std::default::Default for WebhookSubscriptionListResponse {
55050 fn default() -> Self {
55051 Self {
55052 next_page_token: Ok(Default::default()),
55053 subscriptions: Err("no value supplied for subscriptions".to_string()),
55054 }
55055 }
55056 }
55057 impl WebhookSubscriptionListResponse {
55058 pub fn next_page_token<T>(mut self, value: T) -> Self
55059 where
55060 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
55061 T::Error: ::std::fmt::Display,
55062 {
55063 self.next_page_token = value.try_into().map_err(|e| {
55064 format!("error converting supplied value for next_page_token: {}", e)
55065 });
55066 self
55067 }
55068 pub fn subscriptions<T>(mut self, value: T) -> Self
55069 where
55070 T: ::std::convert::TryInto<::std::vec::Vec<super::WebhookSubscriptionResponse>>,
55071 T::Error: ::std::fmt::Display,
55072 {
55073 self.subscriptions = value.try_into().map_err(|e| {
55074 format!("error converting supplied value for subscriptions: {}", e)
55075 });
55076 self
55077 }
55078 }
55079 impl ::std::convert::TryFrom<WebhookSubscriptionListResponse>
55080 for super::WebhookSubscriptionListResponse
55081 {
55082 type Error = super::error::ConversionError;
55083 fn try_from(
55084 value: WebhookSubscriptionListResponse,
55085 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55086 Ok(Self {
55087 next_page_token: value.next_page_token?,
55088 subscriptions: value.subscriptions?,
55089 })
55090 }
55091 }
55092 impl ::std::convert::From<super::WebhookSubscriptionListResponse>
55093 for WebhookSubscriptionListResponse
55094 {
55095 fn from(value: super::WebhookSubscriptionListResponse) -> Self {
55096 Self {
55097 next_page_token: Ok(value.next_page_token),
55098 subscriptions: Ok(value.subscriptions),
55099 }
55100 }
55101 }
55102 #[derive(Clone, Debug)]
55103 pub struct WebhookSubscriptionResponse {
55104 created_at: ::std::result::Result<
55105 ::chrono::DateTime<::chrono::offset::Utc>,
55106 ::std::string::String,
55107 >,
55108 description: ::std::result::Result<
55109 ::std::option::Option<::std::string::String>,
55110 ::std::string::String,
55111 >,
55112 event_types: ::std::result::Result<
55113 ::std::vec::Vec<::std::string::String>,
55114 ::std::string::String,
55115 >,
55116 is_enabled: ::std::result::Result<bool, ::std::string::String>,
55117 label_key: ::std::result::Result<
55118 ::std::option::Option<::std::string::String>,
55119 ::std::string::String,
55120 >,
55121 label_value: ::std::result::Result<
55122 ::std::option::Option<::std::string::String>,
55123 ::std::string::String,
55124 >,
55125 labels: ::std::result::Result<
55126 ::std::collections::HashMap<::std::string::String, ::std::string::String>,
55127 ::std::string::String,
55128 >,
55129 metadata: ::std::result::Result<
55130 ::std::option::Option<super::WebhookSubscriptionResponseMetadata>,
55131 ::std::string::String,
55132 >,
55133 secret: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
55134 subscription_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
55135 target: ::std::result::Result<super::WebhookTarget, ::std::string::String>,
55136 }
55137 impl ::std::default::Default for WebhookSubscriptionResponse {
55138 fn default() -> Self {
55139 Self {
55140 created_at: Err("no value supplied for created_at".to_string()),
55141 description: Ok(Default::default()),
55142 event_types: Err("no value supplied for event_types".to_string()),
55143 is_enabled: Err("no value supplied for is_enabled".to_string()),
55144 label_key: Ok(Default::default()),
55145 label_value: Ok(Default::default()),
55146 labels: Ok(Default::default()),
55147 metadata: Ok(Default::default()),
55148 secret: Err("no value supplied for secret".to_string()),
55149 subscription_id: Err("no value supplied for subscription_id".to_string()),
55150 target: Err("no value supplied for target".to_string()),
55151 }
55152 }
55153 }
55154 impl WebhookSubscriptionResponse {
55155 pub fn created_at<T>(mut self, value: T) -> Self
55156 where
55157 T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
55158 T::Error: ::std::fmt::Display,
55159 {
55160 self.created_at = value
55161 .try_into()
55162 .map_err(|e| format!("error converting supplied value for created_at: {}", e));
55163 self
55164 }
55165 pub fn description<T>(mut self, value: T) -> Self
55166 where
55167 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
55168 T::Error: ::std::fmt::Display,
55169 {
55170 self.description = value
55171 .try_into()
55172 .map_err(|e| format!("error converting supplied value for description: {}", e));
55173 self
55174 }
55175 pub fn event_types<T>(mut self, value: T) -> Self
55176 where
55177 T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
55178 T::Error: ::std::fmt::Display,
55179 {
55180 self.event_types = value
55181 .try_into()
55182 .map_err(|e| format!("error converting supplied value for event_types: {}", e));
55183 self
55184 }
55185 pub fn is_enabled<T>(mut self, value: T) -> Self
55186 where
55187 T: ::std::convert::TryInto<bool>,
55188 T::Error: ::std::fmt::Display,
55189 {
55190 self.is_enabled = value
55191 .try_into()
55192 .map_err(|e| format!("error converting supplied value for is_enabled: {}", e));
55193 self
55194 }
55195 pub fn label_key<T>(mut self, value: T) -> Self
55196 where
55197 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
55198 T::Error: ::std::fmt::Display,
55199 {
55200 self.label_key = value
55201 .try_into()
55202 .map_err(|e| format!("error converting supplied value for label_key: {}", e));
55203 self
55204 }
55205 pub fn label_value<T>(mut self, value: T) -> Self
55206 where
55207 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
55208 T::Error: ::std::fmt::Display,
55209 {
55210 self.label_value = value
55211 .try_into()
55212 .map_err(|e| format!("error converting supplied value for label_value: {}", e));
55213 self
55214 }
55215 pub fn labels<T>(mut self, value: T) -> Self
55216 where
55217 T: ::std::convert::TryInto<
55218 ::std::collections::HashMap<::std::string::String, ::std::string::String>,
55219 >,
55220 T::Error: ::std::fmt::Display,
55221 {
55222 self.labels = value
55223 .try_into()
55224 .map_err(|e| format!("error converting supplied value for labels: {}", e));
55225 self
55226 }
55227 pub fn metadata<T>(mut self, value: T) -> Self
55228 where
55229 T: ::std::convert::TryInto<
55230 ::std::option::Option<super::WebhookSubscriptionResponseMetadata>,
55231 >,
55232 T::Error: ::std::fmt::Display,
55233 {
55234 self.metadata = value
55235 .try_into()
55236 .map_err(|e| format!("error converting supplied value for metadata: {}", e));
55237 self
55238 }
55239 pub fn secret<T>(mut self, value: T) -> Self
55240 where
55241 T: ::std::convert::TryInto<::uuid::Uuid>,
55242 T::Error: ::std::fmt::Display,
55243 {
55244 self.secret = value
55245 .try_into()
55246 .map_err(|e| format!("error converting supplied value for secret: {}", e));
55247 self
55248 }
55249 pub fn subscription_id<T>(mut self, value: T) -> Self
55250 where
55251 T: ::std::convert::TryInto<::uuid::Uuid>,
55252 T::Error: ::std::fmt::Display,
55253 {
55254 self.subscription_id = value.try_into().map_err(|e| {
55255 format!("error converting supplied value for subscription_id: {}", e)
55256 });
55257 self
55258 }
55259 pub fn target<T>(mut self, value: T) -> Self
55260 where
55261 T: ::std::convert::TryInto<super::WebhookTarget>,
55262 T::Error: ::std::fmt::Display,
55263 {
55264 self.target = value
55265 .try_into()
55266 .map_err(|e| format!("error converting supplied value for target: {}", e));
55267 self
55268 }
55269 }
55270 impl ::std::convert::TryFrom<WebhookSubscriptionResponse> for super::WebhookSubscriptionResponse {
55271 type Error = super::error::ConversionError;
55272 fn try_from(
55273 value: WebhookSubscriptionResponse,
55274 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55275 Ok(Self {
55276 created_at: value.created_at?,
55277 description: value.description?,
55278 event_types: value.event_types?,
55279 is_enabled: value.is_enabled?,
55280 label_key: value.label_key?,
55281 label_value: value.label_value?,
55282 labels: value.labels?,
55283 metadata: value.metadata?,
55284 secret: value.secret?,
55285 subscription_id: value.subscription_id?,
55286 target: value.target?,
55287 })
55288 }
55289 }
55290 impl ::std::convert::From<super::WebhookSubscriptionResponse> for WebhookSubscriptionResponse {
55291 fn from(value: super::WebhookSubscriptionResponse) -> Self {
55292 Self {
55293 created_at: Ok(value.created_at),
55294 description: Ok(value.description),
55295 event_types: Ok(value.event_types),
55296 is_enabled: Ok(value.is_enabled),
55297 label_key: Ok(value.label_key),
55298 label_value: Ok(value.label_value),
55299 labels: Ok(value.labels),
55300 metadata: Ok(value.metadata),
55301 secret: Ok(value.secret),
55302 subscription_id: Ok(value.subscription_id),
55303 target: Ok(value.target),
55304 }
55305 }
55306 }
55307 #[derive(Clone, Debug)]
55308 pub struct WebhookSubscriptionResponseMetadata {
55309 secret:
55310 ::std::result::Result<::std::option::Option<::uuid::Uuid>, ::std::string::String>,
55311 }
55312 impl ::std::default::Default for WebhookSubscriptionResponseMetadata {
55313 fn default() -> Self {
55314 Self {
55315 secret: Ok(Default::default()),
55316 }
55317 }
55318 }
55319 impl WebhookSubscriptionResponseMetadata {
55320 pub fn secret<T>(mut self, value: T) -> Self
55321 where
55322 T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
55323 T::Error: ::std::fmt::Display,
55324 {
55325 self.secret = value
55326 .try_into()
55327 .map_err(|e| format!("error converting supplied value for secret: {}", e));
55328 self
55329 }
55330 }
55331 impl ::std::convert::TryFrom<WebhookSubscriptionResponseMetadata>
55332 for super::WebhookSubscriptionResponseMetadata
55333 {
55334 type Error = super::error::ConversionError;
55335 fn try_from(
55336 value: WebhookSubscriptionResponseMetadata,
55337 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55338 Ok(Self {
55339 secret: value.secret?,
55340 })
55341 }
55342 }
55343 impl ::std::convert::From<super::WebhookSubscriptionResponseMetadata>
55344 for WebhookSubscriptionResponseMetadata
55345 {
55346 fn from(value: super::WebhookSubscriptionResponseMetadata) -> Self {
55347 Self {
55348 secret: Ok(value.secret),
55349 }
55350 }
55351 }
55352 #[derive(Clone, Debug)]
55353 pub struct WebhookTarget {
55354 headers: ::std::result::Result<
55355 ::std::collections::HashMap<::std::string::String, ::std::string::String>,
55356 ::std::string::String,
55357 >,
55358 url: ::std::result::Result<super::Url, ::std::string::String>,
55359 }
55360 impl ::std::default::Default for WebhookTarget {
55361 fn default() -> Self {
55362 Self {
55363 headers: Ok(Default::default()),
55364 url: Err("no value supplied for url".to_string()),
55365 }
55366 }
55367 }
55368 impl WebhookTarget {
55369 pub fn headers<T>(mut self, value: T) -> Self
55370 where
55371 T: ::std::convert::TryInto<
55372 ::std::collections::HashMap<::std::string::String, ::std::string::String>,
55373 >,
55374 T::Error: ::std::fmt::Display,
55375 {
55376 self.headers = value
55377 .try_into()
55378 .map_err(|e| format!("error converting supplied value for headers: {}", e));
55379 self
55380 }
55381 pub fn url<T>(mut self, value: T) -> Self
55382 where
55383 T: ::std::convert::TryInto<super::Url>,
55384 T::Error: ::std::fmt::Display,
55385 {
55386 self.url = value
55387 .try_into()
55388 .map_err(|e| format!("error converting supplied value for url: {}", e));
55389 self
55390 }
55391 }
55392 impl ::std::convert::TryFrom<WebhookTarget> for super::WebhookTarget {
55393 type Error = super::error::ConversionError;
55394 fn try_from(
55395 value: WebhookTarget,
55396 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55397 Ok(Self {
55398 headers: value.headers?,
55399 url: value.url?,
55400 })
55401 }
55402 }
55403 impl ::std::convert::From<super::WebhookTarget> for WebhookTarget {
55404 fn from(value: super::WebhookTarget) -> Self {
55405 Self {
55406 headers: Ok(value.headers),
55407 url: Ok(value.url),
55408 }
55409 }
55410 }
55411 #[derive(Clone, Debug)]
55412 pub struct X402ExactEvmPayload {
55413 authorization: ::std::result::Result<
55414 super::X402ExactEvmPayloadAuthorization,
55415 ::std::string::String,
55416 >,
55417 signature: ::std::result::Result<::std::string::String, ::std::string::String>,
55418 }
55419 impl ::std::default::Default for X402ExactEvmPayload {
55420 fn default() -> Self {
55421 Self {
55422 authorization: Err("no value supplied for authorization".to_string()),
55423 signature: Err("no value supplied for signature".to_string()),
55424 }
55425 }
55426 }
55427 impl X402ExactEvmPayload {
55428 pub fn authorization<T>(mut self, value: T) -> Self
55429 where
55430 T: ::std::convert::TryInto<super::X402ExactEvmPayloadAuthorization>,
55431 T::Error: ::std::fmt::Display,
55432 {
55433 self.authorization = value.try_into().map_err(|e| {
55434 format!("error converting supplied value for authorization: {}", e)
55435 });
55436 self
55437 }
55438 pub fn signature<T>(mut self, value: T) -> Self
55439 where
55440 T: ::std::convert::TryInto<::std::string::String>,
55441 T::Error: ::std::fmt::Display,
55442 {
55443 self.signature = value
55444 .try_into()
55445 .map_err(|e| format!("error converting supplied value for signature: {}", e));
55446 self
55447 }
55448 }
55449 impl ::std::convert::TryFrom<X402ExactEvmPayload> for super::X402ExactEvmPayload {
55450 type Error = super::error::ConversionError;
55451 fn try_from(
55452 value: X402ExactEvmPayload,
55453 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55454 Ok(Self {
55455 authorization: value.authorization?,
55456 signature: value.signature?,
55457 })
55458 }
55459 }
55460 impl ::std::convert::From<super::X402ExactEvmPayload> for X402ExactEvmPayload {
55461 fn from(value: super::X402ExactEvmPayload) -> Self {
55462 Self {
55463 authorization: Ok(value.authorization),
55464 signature: Ok(value.signature),
55465 }
55466 }
55467 }
55468 #[derive(Clone, Debug)]
55469 pub struct X402ExactEvmPayloadAuthorization {
55470 from: ::std::result::Result<
55471 super::X402ExactEvmPayloadAuthorizationFrom,
55472 ::std::string::String,
55473 >,
55474 nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
55475 to: ::std::result::Result<
55476 super::X402ExactEvmPayloadAuthorizationTo,
55477 ::std::string::String,
55478 >,
55479 valid_after: ::std::result::Result<::std::string::String, ::std::string::String>,
55480 valid_before: ::std::result::Result<::std::string::String, ::std::string::String>,
55481 value: ::std::result::Result<::std::string::String, ::std::string::String>,
55482 }
55483 impl ::std::default::Default for X402ExactEvmPayloadAuthorization {
55484 fn default() -> Self {
55485 Self {
55486 from: Err("no value supplied for from".to_string()),
55487 nonce: Err("no value supplied for nonce".to_string()),
55488 to: Err("no value supplied for to".to_string()),
55489 valid_after: Err("no value supplied for valid_after".to_string()),
55490 valid_before: Err("no value supplied for valid_before".to_string()),
55491 value: Err("no value supplied for value".to_string()),
55492 }
55493 }
55494 }
55495 impl X402ExactEvmPayloadAuthorization {
55496 pub fn from<T>(mut self, value: T) -> Self
55497 where
55498 T: ::std::convert::TryInto<super::X402ExactEvmPayloadAuthorizationFrom>,
55499 T::Error: ::std::fmt::Display,
55500 {
55501 self.from = value
55502 .try_into()
55503 .map_err(|e| format!("error converting supplied value for from: {}", e));
55504 self
55505 }
55506 pub fn nonce<T>(mut self, value: T) -> Self
55507 where
55508 T: ::std::convert::TryInto<::std::string::String>,
55509 T::Error: ::std::fmt::Display,
55510 {
55511 self.nonce = value
55512 .try_into()
55513 .map_err(|e| format!("error converting supplied value for nonce: {}", e));
55514 self
55515 }
55516 pub fn to<T>(mut self, value: T) -> Self
55517 where
55518 T: ::std::convert::TryInto<super::X402ExactEvmPayloadAuthorizationTo>,
55519 T::Error: ::std::fmt::Display,
55520 {
55521 self.to = value
55522 .try_into()
55523 .map_err(|e| format!("error converting supplied value for to: {}", e));
55524 self
55525 }
55526 pub fn valid_after<T>(mut self, value: T) -> Self
55527 where
55528 T: ::std::convert::TryInto<::std::string::String>,
55529 T::Error: ::std::fmt::Display,
55530 {
55531 self.valid_after = value
55532 .try_into()
55533 .map_err(|e| format!("error converting supplied value for valid_after: {}", e));
55534 self
55535 }
55536 pub fn valid_before<T>(mut self, value: T) -> Self
55537 where
55538 T: ::std::convert::TryInto<::std::string::String>,
55539 T::Error: ::std::fmt::Display,
55540 {
55541 self.valid_before = value.try_into().map_err(|e| {
55542 format!("error converting supplied value for valid_before: {}", e)
55543 });
55544 self
55545 }
55546 pub fn value<T>(mut self, value: T) -> Self
55547 where
55548 T: ::std::convert::TryInto<::std::string::String>,
55549 T::Error: ::std::fmt::Display,
55550 {
55551 self.value = value
55552 .try_into()
55553 .map_err(|e| format!("error converting supplied value for value: {}", e));
55554 self
55555 }
55556 }
55557 impl ::std::convert::TryFrom<X402ExactEvmPayloadAuthorization>
55558 for super::X402ExactEvmPayloadAuthorization
55559 {
55560 type Error = super::error::ConversionError;
55561 fn try_from(
55562 value: X402ExactEvmPayloadAuthorization,
55563 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55564 Ok(Self {
55565 from: value.from?,
55566 nonce: value.nonce?,
55567 to: value.to?,
55568 valid_after: value.valid_after?,
55569 valid_before: value.valid_before?,
55570 value: value.value?,
55571 })
55572 }
55573 }
55574 impl ::std::convert::From<super::X402ExactEvmPayloadAuthorization>
55575 for X402ExactEvmPayloadAuthorization
55576 {
55577 fn from(value: super::X402ExactEvmPayloadAuthorization) -> Self {
55578 Self {
55579 from: Ok(value.from),
55580 nonce: Ok(value.nonce),
55581 to: Ok(value.to),
55582 valid_after: Ok(value.valid_after),
55583 valid_before: Ok(value.valid_before),
55584 value: Ok(value.value),
55585 }
55586 }
55587 }
55588 #[derive(Clone, Debug)]
55589 pub struct X402ExactSolanaPayload {
55590 transaction: ::std::result::Result<::std::string::String, ::std::string::String>,
55591 }
55592 impl ::std::default::Default for X402ExactSolanaPayload {
55593 fn default() -> Self {
55594 Self {
55595 transaction: Err("no value supplied for transaction".to_string()),
55596 }
55597 }
55598 }
55599 impl X402ExactSolanaPayload {
55600 pub fn transaction<T>(mut self, value: T) -> Self
55601 where
55602 T: ::std::convert::TryInto<::std::string::String>,
55603 T::Error: ::std::fmt::Display,
55604 {
55605 self.transaction = value
55606 .try_into()
55607 .map_err(|e| format!("error converting supplied value for transaction: {}", e));
55608 self
55609 }
55610 }
55611 impl ::std::convert::TryFrom<X402ExactSolanaPayload> for super::X402ExactSolanaPayload {
55612 type Error = super::error::ConversionError;
55613 fn try_from(
55614 value: X402ExactSolanaPayload,
55615 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55616 Ok(Self {
55617 transaction: value.transaction?,
55618 })
55619 }
55620 }
55621 impl ::std::convert::From<super::X402ExactSolanaPayload> for X402ExactSolanaPayload {
55622 fn from(value: super::X402ExactSolanaPayload) -> Self {
55623 Self {
55624 transaction: Ok(value.transaction),
55625 }
55626 }
55627 }
55628 #[derive(Clone, Debug)]
55629 pub struct X402ResourceInfo {
55630 description: ::std::result::Result<
55631 ::std::option::Option<::std::string::String>,
55632 ::std::string::String,
55633 >,
55634 mime_type: ::std::result::Result<
55635 ::std::option::Option<::std::string::String>,
55636 ::std::string::String,
55637 >,
55638 url: ::std::result::Result<
55639 ::std::option::Option<::std::string::String>,
55640 ::std::string::String,
55641 >,
55642 }
55643 impl ::std::default::Default for X402ResourceInfo {
55644 fn default() -> Self {
55645 Self {
55646 description: Ok(Default::default()),
55647 mime_type: Ok(Default::default()),
55648 url: Ok(Default::default()),
55649 }
55650 }
55651 }
55652 impl X402ResourceInfo {
55653 pub fn description<T>(mut self, value: T) -> Self
55654 where
55655 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
55656 T::Error: ::std::fmt::Display,
55657 {
55658 self.description = value
55659 .try_into()
55660 .map_err(|e| format!("error converting supplied value for description: {}", e));
55661 self
55662 }
55663 pub fn mime_type<T>(mut self, value: T) -> Self
55664 where
55665 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
55666 T::Error: ::std::fmt::Display,
55667 {
55668 self.mime_type = value
55669 .try_into()
55670 .map_err(|e| format!("error converting supplied value for mime_type: {}", e));
55671 self
55672 }
55673 pub fn url<T>(mut self, value: T) -> Self
55674 where
55675 T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
55676 T::Error: ::std::fmt::Display,
55677 {
55678 self.url = value
55679 .try_into()
55680 .map_err(|e| format!("error converting supplied value for url: {}", e));
55681 self
55682 }
55683 }
55684 impl ::std::convert::TryFrom<X402ResourceInfo> for super::X402ResourceInfo {
55685 type Error = super::error::ConversionError;
55686 fn try_from(
55687 value: X402ResourceInfo,
55688 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55689 Ok(Self {
55690 description: value.description?,
55691 mime_type: value.mime_type?,
55692 url: value.url?,
55693 })
55694 }
55695 }
55696 impl ::std::convert::From<super::X402ResourceInfo> for X402ResourceInfo {
55697 fn from(value: super::X402ResourceInfo) -> Self {
55698 Self {
55699 description: Ok(value.description),
55700 mime_type: Ok(value.mime_type),
55701 url: Ok(value.url),
55702 }
55703 }
55704 }
55705 #[derive(Clone, Debug)]
55706 pub struct X402SupportedPaymentKind {
55707 extra: ::std::result::Result<
55708 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
55709 ::std::string::String,
55710 >,
55711 network: ::std::result::Result<::std::string::String, ::std::string::String>,
55712 scheme:
55713 ::std::result::Result<super::X402SupportedPaymentKindScheme, ::std::string::String>,
55714 x402_version: ::std::result::Result<super::X402Version, ::std::string::String>,
55715 }
55716 impl ::std::default::Default for X402SupportedPaymentKind {
55717 fn default() -> Self {
55718 Self {
55719 extra: Ok(Default::default()),
55720 network: Err("no value supplied for network".to_string()),
55721 scheme: Err("no value supplied for scheme".to_string()),
55722 x402_version: Err("no value supplied for x402_version".to_string()),
55723 }
55724 }
55725 }
55726 impl X402SupportedPaymentKind {
55727 pub fn extra<T>(mut self, value: T) -> Self
55728 where
55729 T: ::std::convert::TryInto<
55730 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
55731 >,
55732 T::Error: ::std::fmt::Display,
55733 {
55734 self.extra = value
55735 .try_into()
55736 .map_err(|e| format!("error converting supplied value for extra: {}", e));
55737 self
55738 }
55739 pub fn network<T>(mut self, value: T) -> Self
55740 where
55741 T: ::std::convert::TryInto<::std::string::String>,
55742 T::Error: ::std::fmt::Display,
55743 {
55744 self.network = value
55745 .try_into()
55746 .map_err(|e| format!("error converting supplied value for network: {}", e));
55747 self
55748 }
55749 pub fn scheme<T>(mut self, value: T) -> Self
55750 where
55751 T: ::std::convert::TryInto<super::X402SupportedPaymentKindScheme>,
55752 T::Error: ::std::fmt::Display,
55753 {
55754 self.scheme = value
55755 .try_into()
55756 .map_err(|e| format!("error converting supplied value for scheme: {}", e));
55757 self
55758 }
55759 pub fn x402_version<T>(mut self, value: T) -> Self
55760 where
55761 T: ::std::convert::TryInto<super::X402Version>,
55762 T::Error: ::std::fmt::Display,
55763 {
55764 self.x402_version = value.try_into().map_err(|e| {
55765 format!("error converting supplied value for x402_version: {}", e)
55766 });
55767 self
55768 }
55769 }
55770 impl ::std::convert::TryFrom<X402SupportedPaymentKind> for super::X402SupportedPaymentKind {
55771 type Error = super::error::ConversionError;
55772 fn try_from(
55773 value: X402SupportedPaymentKind,
55774 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55775 Ok(Self {
55776 extra: value.extra?,
55777 network: value.network?,
55778 scheme: value.scheme?,
55779 x402_version: value.x402_version?,
55780 })
55781 }
55782 }
55783 impl ::std::convert::From<super::X402SupportedPaymentKind> for X402SupportedPaymentKind {
55784 fn from(value: super::X402SupportedPaymentKind) -> Self {
55785 Self {
55786 extra: Ok(value.extra),
55787 network: Ok(value.network),
55788 scheme: Ok(value.scheme),
55789 x402_version: Ok(value.x402_version),
55790 }
55791 }
55792 }
55793 #[derive(Clone, Debug)]
55794 pub struct X402V1PaymentPayload {
55795 network:
55796 ::std::result::Result<super::X402v1PaymentPayloadNetwork, ::std::string::String>,
55797 payload:
55798 ::std::result::Result<super::X402v1PaymentPayloadPayload, ::std::string::String>,
55799 scheme: ::std::result::Result<super::X402v1PaymentPayloadScheme, ::std::string::String>,
55800 x402_version: ::std::result::Result<super::X402Version, ::std::string::String>,
55801 }
55802 impl ::std::default::Default for X402V1PaymentPayload {
55803 fn default() -> Self {
55804 Self {
55805 network: Err("no value supplied for network".to_string()),
55806 payload: Err("no value supplied for payload".to_string()),
55807 scheme: Err("no value supplied for scheme".to_string()),
55808 x402_version: Err("no value supplied for x402_version".to_string()),
55809 }
55810 }
55811 }
55812 impl X402V1PaymentPayload {
55813 pub fn network<T>(mut self, value: T) -> Self
55814 where
55815 T: ::std::convert::TryInto<super::X402v1PaymentPayloadNetwork>,
55816 T::Error: ::std::fmt::Display,
55817 {
55818 self.network = value
55819 .try_into()
55820 .map_err(|e| format!("error converting supplied value for network: {}", e));
55821 self
55822 }
55823 pub fn payload<T>(mut self, value: T) -> Self
55824 where
55825 T: ::std::convert::TryInto<super::X402v1PaymentPayloadPayload>,
55826 T::Error: ::std::fmt::Display,
55827 {
55828 self.payload = value
55829 .try_into()
55830 .map_err(|e| format!("error converting supplied value for payload: {}", e));
55831 self
55832 }
55833 pub fn scheme<T>(mut self, value: T) -> Self
55834 where
55835 T: ::std::convert::TryInto<super::X402v1PaymentPayloadScheme>,
55836 T::Error: ::std::fmt::Display,
55837 {
55838 self.scheme = value
55839 .try_into()
55840 .map_err(|e| format!("error converting supplied value for scheme: {}", e));
55841 self
55842 }
55843 pub fn x402_version<T>(mut self, value: T) -> Self
55844 where
55845 T: ::std::convert::TryInto<super::X402Version>,
55846 T::Error: ::std::fmt::Display,
55847 {
55848 self.x402_version = value.try_into().map_err(|e| {
55849 format!("error converting supplied value for x402_version: {}", e)
55850 });
55851 self
55852 }
55853 }
55854 impl ::std::convert::TryFrom<X402V1PaymentPayload> for super::X402V1PaymentPayload {
55855 type Error = super::error::ConversionError;
55856 fn try_from(
55857 value: X402V1PaymentPayload,
55858 ) -> ::std::result::Result<Self, super::error::ConversionError> {
55859 Ok(Self {
55860 network: value.network?,
55861 payload: value.payload?,
55862 scheme: value.scheme?,
55863 x402_version: value.x402_version?,
55864 })
55865 }
55866 }
55867 impl ::std::convert::From<super::X402V1PaymentPayload> for X402V1PaymentPayload {
55868 fn from(value: super::X402V1PaymentPayload) -> Self {
55869 Self {
55870 network: Ok(value.network),
55871 payload: Ok(value.payload),
55872 scheme: Ok(value.scheme),
55873 x402_version: Ok(value.x402_version),
55874 }
55875 }
55876 }
55877 #[derive(Clone, Debug)]
55878 pub struct X402V1PaymentRequirements {
55879 asset:
55880 ::std::result::Result<super::X402v1PaymentRequirementsAsset, ::std::string::String>,
55881 description: ::std::result::Result<::std::string::String, ::std::string::String>,
55882 extra: ::std::result::Result<
55883 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
55884 ::std::string::String,
55885 >,
55886 max_amount_required:
55887 ::std::result::Result<::std::string::String, ::std::string::String>,
55888 max_timeout_seconds: ::std::result::Result<i64, ::std::string::String>,
55889 mime_type: ::std::result::Result<::std::string::String, ::std::string::String>,
55890 network: ::std::result::Result<
55891 super::X402v1PaymentRequirementsNetwork,
55892 ::std::string::String,
55893 >,
55894 output_schema: ::std::result::Result<
55895 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
55896 ::std::string::String,
55897 >,
55898 pay_to:
55899 ::std::result::Result<super::X402v1PaymentRequirementsPayTo, ::std::string::String>,
55900 resource: ::std::result::Result<::std::string::String, ::std::string::String>,
55901 scheme: ::std::result::Result<
55902 super::X402v1PaymentRequirementsScheme,
55903 ::std::string::String,
55904 >,
55905 }
55906 impl ::std::default::Default for X402V1PaymentRequirements {
55907 fn default() -> Self {
55908 Self {
55909 asset: Err("no value supplied for asset".to_string()),
55910 description: Err("no value supplied for description".to_string()),
55911 extra: Ok(Default::default()),
55912 max_amount_required: Err(
55913 "no value supplied for max_amount_required".to_string()
55914 ),
55915 max_timeout_seconds: Err(
55916 "no value supplied for max_timeout_seconds".to_string()
55917 ),
55918 mime_type: Err("no value supplied for mime_type".to_string()),
55919 network: Err("no value supplied for network".to_string()),
55920 output_schema: Ok(Default::default()),
55921 pay_to: Err("no value supplied for pay_to".to_string()),
55922 resource: Err("no value supplied for resource".to_string()),
55923 scheme: Err("no value supplied for scheme".to_string()),
55924 }
55925 }
55926 }
55927 impl X402V1PaymentRequirements {
55928 pub fn asset<T>(mut self, value: T) -> Self
55929 where
55930 T: ::std::convert::TryInto<super::X402v1PaymentRequirementsAsset>,
55931 T::Error: ::std::fmt::Display,
55932 {
55933 self.asset = value
55934 .try_into()
55935 .map_err(|e| format!("error converting supplied value for asset: {}", e));
55936 self
55937 }
55938 pub fn description<T>(mut self, value: T) -> Self
55939 where
55940 T: ::std::convert::TryInto<::std::string::String>,
55941 T::Error: ::std::fmt::Display,
55942 {
55943 self.description = value
55944 .try_into()
55945 .map_err(|e| format!("error converting supplied value for description: {}", e));
55946 self
55947 }
55948 pub fn extra<T>(mut self, value: T) -> Self
55949 where
55950 T: ::std::convert::TryInto<
55951 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
55952 >,
55953 T::Error: ::std::fmt::Display,
55954 {
55955 self.extra = value
55956 .try_into()
55957 .map_err(|e| format!("error converting supplied value for extra: {}", e));
55958 self
55959 }
55960 pub fn max_amount_required<T>(mut self, value: T) -> Self
55961 where
55962 T: ::std::convert::TryInto<::std::string::String>,
55963 T::Error: ::std::fmt::Display,
55964 {
55965 self.max_amount_required = value.try_into().map_err(|e| {
55966 format!(
55967 "error converting supplied value for max_amount_required: {}",
55968 e
55969 )
55970 });
55971 self
55972 }
55973 pub fn max_timeout_seconds<T>(mut self, value: T) -> Self
55974 where
55975 T: ::std::convert::TryInto<i64>,
55976 T::Error: ::std::fmt::Display,
55977 {
55978 self.max_timeout_seconds = value.try_into().map_err(|e| {
55979 format!(
55980 "error converting supplied value for max_timeout_seconds: {}",
55981 e
55982 )
55983 });
55984 self
55985 }
55986 pub fn mime_type<T>(mut self, value: T) -> Self
55987 where
55988 T: ::std::convert::TryInto<::std::string::String>,
55989 T::Error: ::std::fmt::Display,
55990 {
55991 self.mime_type = value
55992 .try_into()
55993 .map_err(|e| format!("error converting supplied value for mime_type: {}", e));
55994 self
55995 }
55996 pub fn network<T>(mut self, value: T) -> Self
55997 where
55998 T: ::std::convert::TryInto<super::X402v1PaymentRequirementsNetwork>,
55999 T::Error: ::std::fmt::Display,
56000 {
56001 self.network = value
56002 .try_into()
56003 .map_err(|e| format!("error converting supplied value for network: {}", e));
56004 self
56005 }
56006 pub fn output_schema<T>(mut self, value: T) -> Self
56007 where
56008 T: ::std::convert::TryInto<
56009 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
56010 >,
56011 T::Error: ::std::fmt::Display,
56012 {
56013 self.output_schema = value.try_into().map_err(|e| {
56014 format!("error converting supplied value for output_schema: {}", e)
56015 });
56016 self
56017 }
56018 pub fn pay_to<T>(mut self, value: T) -> Self
56019 where
56020 T: ::std::convert::TryInto<super::X402v1PaymentRequirementsPayTo>,
56021 T::Error: ::std::fmt::Display,
56022 {
56023 self.pay_to = value
56024 .try_into()
56025 .map_err(|e| format!("error converting supplied value for pay_to: {}", e));
56026 self
56027 }
56028 pub fn resource<T>(mut self, value: T) -> Self
56029 where
56030 T: ::std::convert::TryInto<::std::string::String>,
56031 T::Error: ::std::fmt::Display,
56032 {
56033 self.resource = value
56034 .try_into()
56035 .map_err(|e| format!("error converting supplied value for resource: {}", e));
56036 self
56037 }
56038 pub fn scheme<T>(mut self, value: T) -> Self
56039 where
56040 T: ::std::convert::TryInto<super::X402v1PaymentRequirementsScheme>,
56041 T::Error: ::std::fmt::Display,
56042 {
56043 self.scheme = value
56044 .try_into()
56045 .map_err(|e| format!("error converting supplied value for scheme: {}", e));
56046 self
56047 }
56048 }
56049 impl ::std::convert::TryFrom<X402V1PaymentRequirements> for super::X402V1PaymentRequirements {
56050 type Error = super::error::ConversionError;
56051 fn try_from(
56052 value: X402V1PaymentRequirements,
56053 ) -> ::std::result::Result<Self, super::error::ConversionError> {
56054 Ok(Self {
56055 asset: value.asset?,
56056 description: value.description?,
56057 extra: value.extra?,
56058 max_amount_required: value.max_amount_required?,
56059 max_timeout_seconds: value.max_timeout_seconds?,
56060 mime_type: value.mime_type?,
56061 network: value.network?,
56062 output_schema: value.output_schema?,
56063 pay_to: value.pay_to?,
56064 resource: value.resource?,
56065 scheme: value.scheme?,
56066 })
56067 }
56068 }
56069 impl ::std::convert::From<super::X402V1PaymentRequirements> for X402V1PaymentRequirements {
56070 fn from(value: super::X402V1PaymentRequirements) -> Self {
56071 Self {
56072 asset: Ok(value.asset),
56073 description: Ok(value.description),
56074 extra: Ok(value.extra),
56075 max_amount_required: Ok(value.max_amount_required),
56076 max_timeout_seconds: Ok(value.max_timeout_seconds),
56077 mime_type: Ok(value.mime_type),
56078 network: Ok(value.network),
56079 output_schema: Ok(value.output_schema),
56080 pay_to: Ok(value.pay_to),
56081 resource: Ok(value.resource),
56082 scheme: Ok(value.scheme),
56083 }
56084 }
56085 }
56086 #[derive(Clone, Debug)]
56087 pub struct X402V2PaymentPayload {
56088 accepted:
56089 ::std::result::Result<super::X402V2PaymentRequirements, ::std::string::String>,
56090 extensions: ::std::result::Result<
56091 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
56092 ::std::string::String,
56093 >,
56094 payload:
56095 ::std::result::Result<super::X402v2PaymentPayloadPayload, ::std::string::String>,
56096 resource: ::std::result::Result<
56097 ::std::option::Option<super::X402ResourceInfo>,
56098 ::std::string::String,
56099 >,
56100 x402_version: ::std::result::Result<super::X402Version, ::std::string::String>,
56101 }
56102 impl ::std::default::Default for X402V2PaymentPayload {
56103 fn default() -> Self {
56104 Self {
56105 accepted: Err("no value supplied for accepted".to_string()),
56106 extensions: Ok(Default::default()),
56107 payload: Err("no value supplied for payload".to_string()),
56108 resource: Ok(Default::default()),
56109 x402_version: Err("no value supplied for x402_version".to_string()),
56110 }
56111 }
56112 }
56113 impl X402V2PaymentPayload {
56114 pub fn accepted<T>(mut self, value: T) -> Self
56115 where
56116 T: ::std::convert::TryInto<super::X402V2PaymentRequirements>,
56117 T::Error: ::std::fmt::Display,
56118 {
56119 self.accepted = value
56120 .try_into()
56121 .map_err(|e| format!("error converting supplied value for accepted: {}", e));
56122 self
56123 }
56124 pub fn extensions<T>(mut self, value: T) -> Self
56125 where
56126 T: ::std::convert::TryInto<
56127 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
56128 >,
56129 T::Error: ::std::fmt::Display,
56130 {
56131 self.extensions = value
56132 .try_into()
56133 .map_err(|e| format!("error converting supplied value for extensions: {}", e));
56134 self
56135 }
56136 pub fn payload<T>(mut self, value: T) -> Self
56137 where
56138 T: ::std::convert::TryInto<super::X402v2PaymentPayloadPayload>,
56139 T::Error: ::std::fmt::Display,
56140 {
56141 self.payload = value
56142 .try_into()
56143 .map_err(|e| format!("error converting supplied value for payload: {}", e));
56144 self
56145 }
56146 pub fn resource<T>(mut self, value: T) -> Self
56147 where
56148 T: ::std::convert::TryInto<::std::option::Option<super::X402ResourceInfo>>,
56149 T::Error: ::std::fmt::Display,
56150 {
56151 self.resource = value
56152 .try_into()
56153 .map_err(|e| format!("error converting supplied value for resource: {}", e));
56154 self
56155 }
56156 pub fn x402_version<T>(mut self, value: T) -> Self
56157 where
56158 T: ::std::convert::TryInto<super::X402Version>,
56159 T::Error: ::std::fmt::Display,
56160 {
56161 self.x402_version = value.try_into().map_err(|e| {
56162 format!("error converting supplied value for x402_version: {}", e)
56163 });
56164 self
56165 }
56166 }
56167 impl ::std::convert::TryFrom<X402V2PaymentPayload> for super::X402V2PaymentPayload {
56168 type Error = super::error::ConversionError;
56169 fn try_from(
56170 value: X402V2PaymentPayload,
56171 ) -> ::std::result::Result<Self, super::error::ConversionError> {
56172 Ok(Self {
56173 accepted: value.accepted?,
56174 extensions: value.extensions?,
56175 payload: value.payload?,
56176 resource: value.resource?,
56177 x402_version: value.x402_version?,
56178 })
56179 }
56180 }
56181 impl ::std::convert::From<super::X402V2PaymentPayload> for X402V2PaymentPayload {
56182 fn from(value: super::X402V2PaymentPayload) -> Self {
56183 Self {
56184 accepted: Ok(value.accepted),
56185 extensions: Ok(value.extensions),
56186 payload: Ok(value.payload),
56187 resource: Ok(value.resource),
56188 x402_version: Ok(value.x402_version),
56189 }
56190 }
56191 }
56192 #[derive(Clone, Debug)]
56193 pub struct X402V2PaymentRequirements {
56194 amount: ::std::result::Result<::std::string::String, ::std::string::String>,
56195 asset:
56196 ::std::result::Result<super::X402v2PaymentRequirementsAsset, ::std::string::String>,
56197 extra: ::std::result::Result<
56198 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
56199 ::std::string::String,
56200 >,
56201 max_timeout_seconds: ::std::result::Result<i64, ::std::string::String>,
56202 network: ::std::result::Result<::std::string::String, ::std::string::String>,
56203 pay_to:
56204 ::std::result::Result<super::X402v2PaymentRequirementsPayTo, ::std::string::String>,
56205 scheme: ::std::result::Result<
56206 super::X402v2PaymentRequirementsScheme,
56207 ::std::string::String,
56208 >,
56209 }
56210 impl ::std::default::Default for X402V2PaymentRequirements {
56211 fn default() -> Self {
56212 Self {
56213 amount: Err("no value supplied for amount".to_string()),
56214 asset: Err("no value supplied for asset".to_string()),
56215 extra: Ok(Default::default()),
56216 max_timeout_seconds: Err(
56217 "no value supplied for max_timeout_seconds".to_string()
56218 ),
56219 network: Err("no value supplied for network".to_string()),
56220 pay_to: Err("no value supplied for pay_to".to_string()),
56221 scheme: Err("no value supplied for scheme".to_string()),
56222 }
56223 }
56224 }
56225 impl X402V2PaymentRequirements {
56226 pub fn amount<T>(mut self, value: T) -> Self
56227 where
56228 T: ::std::convert::TryInto<::std::string::String>,
56229 T::Error: ::std::fmt::Display,
56230 {
56231 self.amount = value
56232 .try_into()
56233 .map_err(|e| format!("error converting supplied value for amount: {}", e));
56234 self
56235 }
56236 pub fn asset<T>(mut self, value: T) -> Self
56237 where
56238 T: ::std::convert::TryInto<super::X402v2PaymentRequirementsAsset>,
56239 T::Error: ::std::fmt::Display,
56240 {
56241 self.asset = value
56242 .try_into()
56243 .map_err(|e| format!("error converting supplied value for asset: {}", e));
56244 self
56245 }
56246 pub fn extra<T>(mut self, value: T) -> Self
56247 where
56248 T: ::std::convert::TryInto<
56249 ::serde_json::Map<::std::string::String, ::serde_json::Value>,
56250 >,
56251 T::Error: ::std::fmt::Display,
56252 {
56253 self.extra = value
56254 .try_into()
56255 .map_err(|e| format!("error converting supplied value for extra: {}", e));
56256 self
56257 }
56258 pub fn max_timeout_seconds<T>(mut self, value: T) -> Self
56259 where
56260 T: ::std::convert::TryInto<i64>,
56261 T::Error: ::std::fmt::Display,
56262 {
56263 self.max_timeout_seconds = value.try_into().map_err(|e| {
56264 format!(
56265 "error converting supplied value for max_timeout_seconds: {}",
56266 e
56267 )
56268 });
56269 self
56270 }
56271 pub fn network<T>(mut self, value: T) -> Self
56272 where
56273 T: ::std::convert::TryInto<::std::string::String>,
56274 T::Error: ::std::fmt::Display,
56275 {
56276 self.network = value
56277 .try_into()
56278 .map_err(|e| format!("error converting supplied value for network: {}", e));
56279 self
56280 }
56281 pub fn pay_to<T>(mut self, value: T) -> Self
56282 where
56283 T: ::std::convert::TryInto<super::X402v2PaymentRequirementsPayTo>,
56284 T::Error: ::std::fmt::Display,
56285 {
56286 self.pay_to = value
56287 .try_into()
56288 .map_err(|e| format!("error converting supplied value for pay_to: {}", e));
56289 self
56290 }
56291 pub fn scheme<T>(mut self, value: T) -> Self
56292 where
56293 T: ::std::convert::TryInto<super::X402v2PaymentRequirementsScheme>,
56294 T::Error: ::std::fmt::Display,
56295 {
56296 self.scheme = value
56297 .try_into()
56298 .map_err(|e| format!("error converting supplied value for scheme: {}", e));
56299 self
56300 }
56301 }
56302 impl ::std::convert::TryFrom<X402V2PaymentRequirements> for super::X402V2PaymentRequirements {
56303 type Error = super::error::ConversionError;
56304 fn try_from(
56305 value: X402V2PaymentRequirements,
56306 ) -> ::std::result::Result<Self, super::error::ConversionError> {
56307 Ok(Self {
56308 amount: value.amount?,
56309 asset: value.asset?,
56310 extra: value.extra?,
56311 max_timeout_seconds: value.max_timeout_seconds?,
56312 network: value.network?,
56313 pay_to: value.pay_to?,
56314 scheme: value.scheme?,
56315 })
56316 }
56317 }
56318 impl ::std::convert::From<super::X402V2PaymentRequirements> for X402V2PaymentRequirements {
56319 fn from(value: super::X402V2PaymentRequirements) -> Self {
56320 Self {
56321 amount: Ok(value.amount),
56322 asset: Ok(value.asset),
56323 extra: Ok(value.extra),
56324 max_timeout_seconds: Ok(value.max_timeout_seconds),
56325 network: Ok(value.network),
56326 pay_to: Ok(value.pay_to),
56327 scheme: Ok(value.scheme),
56328 }
56329 }
56330 }
56331 }
56332 pub mod defaults {
56334 pub(super) fn default_u64<T, const V: u64>() -> T
56335 where
56336 T: ::std::convert::TryFrom<u64>,
56337 <T as ::std::convert::TryFrom<u64>>::Error: ::std::fmt::Debug,
56338 {
56339 T::try_from(V).unwrap()
56340 }
56341 }
56342}
56343#[derive(Clone, Debug)]
56344pub struct Client {
56350 pub(crate) baseurl: String,
56351 pub(crate) client: reqwest_middleware::ClientWithMiddleware,
56352}
56353impl Client {
56354 pub fn new(baseurl: &str) -> Self {
56360 #[cfg(not(target_arch = "wasm32"))]
56361 let client = {
56362 let dur = std::time::Duration::from_secs(15);
56363 let reqwest_client = reqwest::ClientBuilder::new()
56364 .connect_timeout(dur)
56365 .timeout(dur)
56366 .build()
56367 .unwrap();
56368 reqwest_middleware::ClientBuilder::new(reqwest_client).build()
56369 };
56370 #[cfg(target_arch = "wasm32")]
56371 let client = {
56372 let reqwest_client = reqwest::ClientBuilder::new().build().unwrap();
56373 reqwest_middleware::ClientBuilder::new(reqwest_client).build()
56374 };
56375 Self::new_with_client(baseurl, client)
56376 }
56377 pub fn new_with_client(
56384 baseurl: &str,
56385 client: reqwest_middleware::ClientWithMiddleware,
56386 ) -> Self {
56387 Self {
56388 baseurl: baseurl.to_string(),
56389 client,
56390 }
56391 }
56392}
56393impl ClientInfo<()> for Client {
56394 fn api_version() -> &'static str {
56395 "2.0.0"
56396 }
56397 fn baseurl(&self) -> &str {
56398 self.baseurl.as_str()
56399 }
56400 fn client(&self) -> &reqwest_middleware::ClientWithMiddleware {
56401 &self.client
56402 }
56403 fn inner(&self) -> &() {
56404 &()
56405 }
56406}
56407impl ClientHooks<()> for &Client {}
56408impl Client {
56409 pub fn list_data_token_balances(&self) -> builder::ListDataTokenBalances<'_> {
56432 builder::ListDataTokenBalances::new(self)
56433 }
56434 pub fn list_tokens_for_account(&self) -> builder::ListTokensForAccount<'_> {
56453 builder::ListTokensForAccount::new(self)
56454 }
56455 pub fn get_sql_grammar(&self) -> builder::GetSqlGrammar<'_> {
56472 builder::GetSqlGrammar::new(self)
56473 }
56474 pub fn run_sql_query(&self) -> builder::RunSqlQuery<'_> {
56511 builder::RunSqlQuery::new(self)
56512 }
56513 pub fn list_webhook_subscriptions(&self) -> builder::ListWebhookSubscriptions<'_> {
56538 builder::ListWebhookSubscriptions::new(self)
56539 }
56540 pub fn create_webhook_subscription(&self) -> builder::CreateWebhookSubscription<'_> {
56596 builder::CreateWebhookSubscription::new(self)
56597 }
56598 pub fn get_webhook_subscription(&self) -> builder::GetWebhookSubscription<'_> {
56621 builder::GetWebhookSubscription::new(self)
56622 }
56623 pub fn update_webhook_subscription(&self) -> builder::UpdateWebhookSubscription<'_> {
56649 builder::UpdateWebhookSubscription::new(self)
56650 }
56651 pub fn delete_webhook_subscription(&self) -> builder::DeleteWebhookSubscription<'_> {
56673 builder::DeleteWebhookSubscription::new(self)
56674 }
56675 pub fn list_end_users(&self) -> builder::ListEndUsers<'_> {
56695 builder::ListEndUsers::new(self)
56696 }
56697 pub fn create_end_user(&self) -> builder::CreateEndUser<'_> {
56723 builder::CreateEndUser::new(self)
56724 }
56725 pub fn validate_end_user_access_token(&self) -> builder::ValidateEndUserAccessToken<'_> {
56740 builder::ValidateEndUserAccessToken::new(self)
56741 }
56742 pub fn get_end_user(&self) -> builder::GetEndUser<'_> {
56759 builder::GetEndUser::new(self)
56760 }
56761 pub fn list_evm_accounts(&self) -> builder::ListEvmAccounts<'_> {
56779 builder::ListEvmAccounts::new(self)
56780 }
56781 pub fn create_evm_account(&self) -> builder::CreateEvmAccount<'_> {
56806 builder::CreateEvmAccount::new(self)
56807 }
56808 pub fn get_evm_account_by_name(&self) -> builder::GetEvmAccountByName<'_> {
56823 builder::GetEvmAccountByName::new(self)
56824 }
56825 pub fn export_evm_account_by_name(&self) -> builder::ExportEvmAccountByName<'_> {
56852 builder::ExportEvmAccountByName::new(self)
56853 }
56854 pub fn import_evm_account(&self) -> builder::ImportEvmAccount<'_> {
56879 builder::ImportEvmAccount::new(self)
56880 }
56881 pub fn get_evm_account(&self) -> builder::GetEvmAccount<'_> {
56896 builder::GetEvmAccount::new(self)
56897 }
56898 pub fn update_evm_account(&self) -> builder::UpdateEvmAccount<'_> {
56920 builder::UpdateEvmAccount::new(self)
56921 }
56922 pub fn export_evm_account(&self) -> builder::ExportEvmAccount<'_> {
56949 builder::ExportEvmAccount::new(self)
56950 }
56951 pub fn send_evm_transaction(&self) -> builder::SendEvmTransaction<'_> {
57003 builder::SendEvmTransaction::new(self)
57004 }
57005 pub fn sign_evm_hash(&self) -> builder::SignEvmHash<'_> {
57032 builder::SignEvmHash::new(self)
57033 }
57034 pub fn sign_evm_message(&self) -> builder::SignEvmMessage<'_> {
57063 builder::SignEvmMessage::new(self)
57064 }
57065 pub fn sign_evm_transaction(&self) -> builder::SignEvmTransaction<'_> {
57095 builder::SignEvmTransaction::new(self)
57096 }
57097 pub fn sign_evm_typed_data(&self) -> builder::SignEvmTypedData<'_> {
57124 builder::SignEvmTypedData::new(self)
57125 }
57126 pub fn request_evm_faucet(&self) -> builder::RequestEvmFaucet<'_> {
57153 builder::RequestEvmFaucet::new(self)
57154 }
57155 pub fn list_evm_smart_accounts(&self) -> builder::ListEvmSmartAccounts<'_> {
57173 builder::ListEvmSmartAccounts::new(self)
57174 }
57175 pub fn create_evm_smart_account(&self) -> builder::CreateEvmSmartAccount<'_> {
57195 builder::CreateEvmSmartAccount::new(self)
57196 }
57197 pub fn get_evm_smart_account_by_name(&self) -> builder::GetEvmSmartAccountByName<'_> {
57212 builder::GetEvmSmartAccountByName::new(self)
57213 }
57214 pub fn get_evm_smart_account(&self) -> builder::GetEvmSmartAccount<'_> {
57229 builder::GetEvmSmartAccount::new(self)
57230 }
57231 pub fn update_evm_smart_account(&self) -> builder::UpdateEvmSmartAccount<'_> {
57248 builder::UpdateEvmSmartAccount::new(self)
57249 }
57250 pub fn create_spend_permission(&self) -> builder::CreateSpendPermission<'_> {
57277 builder::CreateSpendPermission::new(self)
57278 }
57279 pub fn list_spend_permissions(&self) -> builder::ListSpendPermissions<'_> {
57298 builder::ListSpendPermissions::new(self)
57299 }
57300 pub fn revoke_spend_permission(&self) -> builder::RevokeSpendPermission<'_> {
57327 builder::RevokeSpendPermission::new(self)
57328 }
57329 pub fn prepare_user_operation(&self) -> builder::PrepareUserOperation<'_> {
57346 builder::PrepareUserOperation::new(self)
57347 }
57348 pub fn prepare_and_send_user_operation(&self) -> builder::PrepareAndSendUserOperation<'_> {
57375 builder::PrepareAndSendUserOperation::new(self)
57376 }
57377 pub fn get_user_operation(&self) -> builder::GetUserOperation<'_> {
57394 builder::GetUserOperation::new(self)
57395 }
57396 pub fn send_user_operation(&self) -> builder::SendUserOperation<'_> {
57418 builder::SendUserOperation::new(self)
57419 }
57420 pub fn create_evm_swap_quote(&self) -> builder::CreateEvmSwapQuote<'_> {
57440 builder::CreateEvmSwapQuote::new(self)
57441 }
57442 pub fn get_evm_swap_price(&self) -> builder::GetEvmSwapPrice<'_> {
57462 builder::GetEvmSwapPrice::new(self)
57463 }
57464 pub fn list_evm_token_balances(&self) -> builder::ListEvmTokenBalances<'_> {
57486 builder::ListEvmTokenBalances::new(self)
57487 }
57488 pub fn create_onramp_order(&self) -> builder::CreateOnrampOrder<'_> {
57505 builder::CreateOnrampOrder::new(self)
57506 }
57507 pub fn get_onramp_order_by_id(&self) -> builder::GetOnrampOrderById<'_> {
57522 builder::GetOnrampOrderById::new(self)
57523 }
57524 pub fn create_onramp_session(&self) -> builder::CreateOnrampSession<'_> {
57552 builder::CreateOnrampSession::new(self)
57553 }
57554 pub fn list_policies(&self) -> builder::ListPolicies<'_> {
57574 builder::ListPolicies::new(self)
57575 }
57576 pub fn create_policy(&self) -> builder::CreatePolicy<'_> {
57596 builder::CreatePolicy::new(self)
57597 }
57598 pub fn get_policy_by_id(&self) -> builder::GetPolicyById<'_> {
57613 builder::GetPolicyById::new(self)
57614 }
57615 pub fn update_policy(&self) -> builder::UpdatePolicy<'_> {
57637 builder::UpdatePolicy::new(self)
57638 }
57639 pub fn delete_policy(&self) -> builder::DeletePolicy<'_> {
57659 builder::DeletePolicy::new(self)
57660 }
57661 pub fn list_solana_accounts(&self) -> builder::ListSolanaAccounts<'_> {
57681 builder::ListSolanaAccounts::new(self)
57682 }
57683 pub fn create_solana_account(&self) -> builder::CreateSolanaAccount<'_> {
57708 builder::CreateSolanaAccount::new(self)
57709 }
57710 pub fn get_solana_account_by_name(&self) -> builder::GetSolanaAccountByName<'_> {
57725 builder::GetSolanaAccountByName::new(self)
57726 }
57727 pub fn export_solana_account_by_name(&self) -> builder::ExportSolanaAccountByName<'_> {
57754 builder::ExportSolanaAccountByName::new(self)
57755 }
57756 pub fn import_solana_account(&self) -> builder::ImportSolanaAccount<'_> {
57781 builder::ImportSolanaAccount::new(self)
57782 }
57783 pub fn send_solana_transaction(&self) -> builder::SendSolanaTransaction<'_> {
57828 builder::SendSolanaTransaction::new(self)
57829 }
57830 pub fn get_solana_account(&self) -> builder::GetSolanaAccount<'_> {
57845 builder::GetSolanaAccount::new(self)
57846 }
57847 pub fn update_solana_account(&self) -> builder::UpdateSolanaAccount<'_> {
57869 builder::UpdateSolanaAccount::new(self)
57870 }
57871 pub fn export_solana_account(&self) -> builder::ExportSolanaAccount<'_> {
57898 builder::ExportSolanaAccount::new(self)
57899 }
57900 pub fn sign_solana_message(&self) -> builder::SignSolanaMessage<'_> {
57929 builder::SignSolanaMessage::new(self)
57930 }
57931 pub fn sign_solana_transaction(&self) -> builder::SignSolanaTransaction<'_> {
57967 builder::SignSolanaTransaction::new(self)
57968 }
57969 pub fn request_solana_faucet(&self) -> builder::RequestSolanaFaucet<'_> {
57994 builder::RequestSolanaFaucet::new(self)
57995 }
57996 pub fn list_solana_token_balances(&self) -> builder::ListSolanaTokenBalances<'_> {
58019 builder::ListSolanaTokenBalances::new(self)
58020 }
58021 pub fn settle_x402_payment(&self) -> builder::SettleX402Payment<'_> {
58034 builder::SettleX402Payment::new(self)
58035 }
58036 pub fn supported_x402_payment_kinds(&self) -> builder::SupportedX402PaymentKinds<'_> {
58048 builder::SupportedX402PaymentKinds::new(self)
58049 }
58050 pub fn verify_x402_payment(&self) -> builder::VerifyX402Payment<'_> {
58063 builder::VerifyX402Payment::new(self)
58064 }
58065}
58066#[allow(clippy::all)]
58068pub mod builder {
58069 use super::types;
58070 #[allow(unused_imports)]
58071 use super::{
58072 encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt,
58073 ResponseValue,
58074 };
58075 #[derive(Debug, Clone)]
58079 pub struct ListDataTokenBalances<'a> {
58080 client: &'a super::Client,
58081 network: Result<types::ListEvmTokenBalancesNetwork, String>,
58082 address: Result<types::ListDataTokenBalancesAddress, String>,
58083 page_size: Result<Option<i64>, String>,
58084 page_token: Result<Option<::std::string::String>, String>,
58085 }
58086 impl<'a> ListDataTokenBalances<'a> {
58087 pub fn new(client: &'a super::Client) -> Self {
58088 Self {
58089 client: client,
58090 network: Err("network was not initialized".to_string()),
58091 address: Err("address was not initialized".to_string()),
58092 page_size: Ok(None),
58093 page_token: Ok(None),
58094 }
58095 }
58096 pub fn network<V>(mut self, value: V) -> Self
58097 where
58098 V: std::convert::TryInto<types::ListEvmTokenBalancesNetwork>,
58099 {
58100 self.network = value.try_into().map_err(|_| {
58101 "conversion to `ListEvmTokenBalancesNetwork` for network failed".to_string()
58102 });
58103 self
58104 }
58105 pub fn address<V>(mut self, value: V) -> Self
58106 where
58107 V: std::convert::TryInto<types::ListDataTokenBalancesAddress>,
58108 {
58109 self.address = value.try_into().map_err(|_| {
58110 "conversion to `ListDataTokenBalancesAddress` for address failed".to_string()
58111 });
58112 self
58113 }
58114 pub fn page_size<V>(mut self, value: V) -> Self
58115 where
58116 V: std::convert::TryInto<i64>,
58117 {
58118 self.page_size = value
58119 .try_into()
58120 .map(Some)
58121 .map_err(|_| "conversion to `i64` for page_size failed".to_string());
58122 self
58123 }
58124 pub fn page_token<V>(mut self, value: V) -> Self
58125 where
58126 V: std::convert::TryInto<::std::string::String>,
58127 {
58128 self.page_token = value.try_into().map(Some).map_err(|_| {
58129 "conversion to `:: std :: string :: String` for page_token failed".to_string()
58130 });
58131 self
58132 }
58133 pub async fn send(
58135 self,
58136 ) -> Result<ResponseValue<types::ListDataTokenBalancesResponse>, Error<types::Error>>
58137 {
58138 let Self {
58139 client,
58140 network,
58141 address,
58142 page_size,
58143 page_token,
58144 } = self;
58145 let network = network.map_err(Error::InvalidRequest)?;
58146 let address = address.map_err(Error::InvalidRequest)?;
58147 let page_size = page_size.map_err(Error::InvalidRequest)?;
58148 let page_token = page_token.map_err(Error::InvalidRequest)?;
58149 let url = format!(
58150 "{}/v2/data/evm/token-balances/{}/{}",
58151 client.baseurl,
58152 encode_path(&network.to_string()),
58153 encode_path(&address.to_string()),
58154 );
58155 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58156 header_map.append(
58157 ::reqwest::header::HeaderName::from_static("api-version"),
58158 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58159 );
58160 #[allow(unused_mut)]
58161 let mut request = client
58162 .client
58163 .get(url)
58164 .header(
58165 ::reqwest::header::ACCEPT,
58166 ::reqwest::header::HeaderValue::from_static("application/json"),
58167 )
58168 .query(&progenitor_middleware_client::QueryParam::new(
58169 "pageSize", &page_size,
58170 ))
58171 .query(&progenitor_middleware_client::QueryParam::new(
58172 "pageToken",
58173 &page_token,
58174 ))
58175 .headers(header_map)
58176 .build()?;
58177 let info = OperationInfo {
58178 operation_id: "list_data_token_balances",
58179 };
58180 client.pre(&mut request, &info).await?;
58181 let result = client.exec(request, &info).await;
58182 client.post(&result, &info).await?;
58183 let response = result?;
58184 match response.status().as_u16() {
58185 200u16 => ResponseValue::from_response(response).await,
58186 400u16 => Err(Error::ErrorResponse(
58187 ResponseValue::from_response(response).await?,
58188 )),
58189 404u16 => Err(Error::ErrorResponse(
58190 ResponseValue::from_response(response).await?,
58191 )),
58192 500u16 => Err(Error::ErrorResponse(
58193 ResponseValue::from_response(response).await?,
58194 )),
58195 502u16 => Err(Error::ErrorResponse(
58196 ResponseValue::from_response(response).await?,
58197 )),
58198 503u16 => Err(Error::ErrorResponse(
58199 ResponseValue::from_response(response).await?,
58200 )),
58201 _ => Err(Error::UnexpectedResponse(response)),
58202 }
58203 }
58204 }
58205 #[derive(Debug, Clone)]
58209 pub struct ListTokensForAccount<'a> {
58210 client: &'a super::Client,
58211 network: Result<types::ListTokensForAccountNetwork, String>,
58212 address: Result<types::ListTokensForAccountAddress, String>,
58213 }
58214 impl<'a> ListTokensForAccount<'a> {
58215 pub fn new(client: &'a super::Client) -> Self {
58216 Self {
58217 client: client,
58218 network: Err("network was not initialized".to_string()),
58219 address: Err("address was not initialized".to_string()),
58220 }
58221 }
58222 pub fn network<V>(mut self, value: V) -> Self
58223 where
58224 V: std::convert::TryInto<types::ListTokensForAccountNetwork>,
58225 {
58226 self.network = value.try_into().map_err(|_| {
58227 "conversion to `ListTokensForAccountNetwork` for network failed".to_string()
58228 });
58229 self
58230 }
58231 pub fn address<V>(mut self, value: V) -> Self
58232 where
58233 V: std::convert::TryInto<types::ListTokensForAccountAddress>,
58234 {
58235 self.address = value.try_into().map_err(|_| {
58236 "conversion to `ListTokensForAccountAddress` for address failed".to_string()
58237 });
58238 self
58239 }
58240 pub async fn send(
58242 self,
58243 ) -> Result<ResponseValue<types::AccountTokenAddressesResponse>, Error<types::Error>>
58244 {
58245 let Self {
58246 client,
58247 network,
58248 address,
58249 } = self;
58250 let network = network.map_err(Error::InvalidRequest)?;
58251 let address = address.map_err(Error::InvalidRequest)?;
58252 let url = format!(
58253 "{}/v2/data/evm/token-ownership/{}/{}",
58254 client.baseurl,
58255 encode_path(&network.to_string()),
58256 encode_path(&address.to_string()),
58257 );
58258 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58259 header_map.append(
58260 ::reqwest::header::HeaderName::from_static("api-version"),
58261 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58262 );
58263 #[allow(unused_mut)]
58264 let mut request = client
58265 .client
58266 .get(url)
58267 .header(
58268 ::reqwest::header::ACCEPT,
58269 ::reqwest::header::HeaderValue::from_static("application/json"),
58270 )
58271 .headers(header_map)
58272 .build()?;
58273 let info = OperationInfo {
58274 operation_id: "list_tokens_for_account",
58275 };
58276 client.pre(&mut request, &info).await?;
58277 let result = client.exec(request, &info).await;
58278 client.post(&result, &info).await?;
58279 let response = result?;
58280 match response.status().as_u16() {
58281 200u16 => ResponseValue::from_response(response).await,
58282 400u16 => Err(Error::ErrorResponse(
58283 ResponseValue::from_response(response).await?,
58284 )),
58285 401u16 => Err(Error::ErrorResponse(
58286 ResponseValue::from_response(response).await?,
58287 )),
58288 429u16 => Err(Error::ErrorResponse(
58289 ResponseValue::from_response(response).await?,
58290 )),
58291 500u16 => Err(Error::ErrorResponse(
58292 ResponseValue::from_response(response).await?,
58293 )),
58294 _ => Err(Error::UnexpectedResponse(response)),
58295 }
58296 }
58297 }
58298 #[derive(Debug, Clone)]
58302 pub struct GetSqlGrammar<'a> {
58303 client: &'a super::Client,
58304 }
58305 impl<'a> GetSqlGrammar<'a> {
58306 pub fn new(client: &'a super::Client) -> Self {
58307 Self { client: client }
58308 }
58309 pub async fn send(
58311 self,
58312 ) -> Result<ResponseValue<::std::string::String>, Error<types::Error>> {
58313 let Self { client } = self;
58314 let url = format!("{}/v2/data/query/grammar", client.baseurl,);
58315 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58316 header_map.append(
58317 ::reqwest::header::HeaderName::from_static("api-version"),
58318 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58319 );
58320 #[allow(unused_mut)]
58321 let mut request = client
58322 .client
58323 .get(url)
58324 .header(
58325 ::reqwest::header::ACCEPT,
58326 ::reqwest::header::HeaderValue::from_static("application/json"),
58327 )
58328 .headers(header_map)
58329 .build()?;
58330 let info = OperationInfo {
58331 operation_id: "get_sql_grammar",
58332 };
58333 client.pre(&mut request, &info).await?;
58334 let result = client.exec(request, &info).await;
58335 client.post(&result, &info).await?;
58336 let response = result?;
58337 match response.status().as_u16() {
58338 200u16 => ResponseValue::from_response(response).await,
58339 401u16 => Err(Error::ErrorResponse(
58340 ResponseValue::from_response(response).await?,
58341 )),
58342 429u16 => Err(Error::ErrorResponse(
58343 ResponseValue::from_response(response).await?,
58344 )),
58345 500u16 => Err(Error::ErrorResponse(
58346 ResponseValue::from_response(response).await?,
58347 )),
58348 504u16 => Err(Error::ErrorResponse(
58349 ResponseValue::from_response(response).await?,
58350 )),
58351 _ => Err(Error::UnexpectedResponse(response)),
58352 }
58353 }
58354 }
58355 #[derive(Debug, Clone)]
58359 pub struct RunSqlQuery<'a> {
58360 client: &'a super::Client,
58361 body: Result<types::builder::OnchainDataQuery, String>,
58362 }
58363 impl<'a> RunSqlQuery<'a> {
58364 pub fn new(client: &'a super::Client) -> Self {
58365 Self {
58366 client: client,
58367 body: Ok(::std::default::Default::default()),
58368 }
58369 }
58370 pub fn body<V>(mut self, value: V) -> Self
58371 where
58372 V: std::convert::TryInto<types::OnchainDataQuery>,
58373 <V as std::convert::TryInto<types::OnchainDataQuery>>::Error: std::fmt::Display,
58374 {
58375 self.body = value
58376 .try_into()
58377 .map(From::from)
58378 .map_err(|s| format!("conversion to `OnchainDataQuery` for body failed: {}", s));
58379 self
58380 }
58381 pub fn body_map<F>(mut self, f: F) -> Self
58382 where
58383 F: std::ops::FnOnce(
58384 types::builder::OnchainDataQuery,
58385 ) -> types::builder::OnchainDataQuery,
58386 {
58387 self.body = self.body.map(f);
58388 self
58389 }
58390 pub async fn send(
58392 self,
58393 ) -> Result<ResponseValue<types::OnchainDataResult>, Error<types::Error>> {
58394 let Self { client, body } = self;
58395 let body = body
58396 .and_then(|v| types::OnchainDataQuery::try_from(v).map_err(|e| e.to_string()))
58397 .map_err(Error::InvalidRequest)?;
58398 let url = format!("{}/v2/data/query/run", client.baseurl,);
58399 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58400 header_map.append(
58401 ::reqwest::header::HeaderName::from_static("api-version"),
58402 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58403 );
58404 #[allow(unused_mut)]
58405 let mut request = client
58406 .client
58407 .post(url)
58408 .header(
58409 ::reqwest::header::ACCEPT,
58410 ::reqwest::header::HeaderValue::from_static("application/json"),
58411 )
58412 .json(&body)
58413 .headers(header_map)
58414 .build()?;
58415 let info = OperationInfo {
58416 operation_id: "run_sql_query",
58417 };
58418 client.pre(&mut request, &info).await?;
58419 let result = client.exec(request, &info).await;
58420 client.post(&result, &info).await?;
58421 let response = result?;
58422 match response.status().as_u16() {
58423 200u16 => ResponseValue::from_response(response).await,
58424 400u16 => Err(Error::ErrorResponse(
58425 ResponseValue::from_response(response).await?,
58426 )),
58427 401u16 => Err(Error::ErrorResponse(
58428 ResponseValue::from_response(response).await?,
58429 )),
58430 408u16 => Err(Error::ErrorResponse(
58431 ResponseValue::from_response(response).await?,
58432 )),
58433 429u16 => Err(Error::ErrorResponse(
58434 ResponseValue::from_response(response).await?,
58435 )),
58436 500u16 => Err(Error::ErrorResponse(
58437 ResponseValue::from_response(response).await?,
58438 )),
58439 504u16 => Err(Error::ErrorResponse(
58440 ResponseValue::from_response(response).await?,
58441 )),
58442 _ => Err(Error::UnexpectedResponse(response)),
58443 }
58444 }
58445 }
58446 #[derive(Debug, Clone)]
58450 pub struct ListWebhookSubscriptions<'a> {
58451 client: &'a super::Client,
58452 page_size: Result<Option<::std::num::NonZeroU64>, String>,
58453 page_token: Result<Option<::std::string::String>, String>,
58454 }
58455 impl<'a> ListWebhookSubscriptions<'a> {
58456 pub fn new(client: &'a super::Client) -> Self {
58457 Self {
58458 client: client,
58459 page_size: Ok(None),
58460 page_token: Ok(None),
58461 }
58462 }
58463 pub fn page_size<V>(mut self, value: V) -> Self
58464 where
58465 V: std::convert::TryInto<::std::num::NonZeroU64>,
58466 {
58467 self.page_size = value.try_into().map(Some).map_err(|_| {
58468 "conversion to `:: std :: num :: NonZeroU64` for page_size failed".to_string()
58469 });
58470 self
58471 }
58472 pub fn page_token<V>(mut self, value: V) -> Self
58473 where
58474 V: std::convert::TryInto<::std::string::String>,
58475 {
58476 self.page_token = value.try_into().map(Some).map_err(|_| {
58477 "conversion to `:: std :: string :: String` for page_token failed".to_string()
58478 });
58479 self
58480 }
58481 pub async fn send(
58483 self,
58484 ) -> Result<ResponseValue<types::WebhookSubscriptionListResponse>, Error<types::Error>>
58485 {
58486 let Self {
58487 client,
58488 page_size,
58489 page_token,
58490 } = self;
58491 let page_size = page_size.map_err(Error::InvalidRequest)?;
58492 let page_token = page_token.map_err(Error::InvalidRequest)?;
58493 let url = format!("{}/v2/data/webhooks/subscriptions", client.baseurl,);
58494 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58495 header_map.append(
58496 ::reqwest::header::HeaderName::from_static("api-version"),
58497 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58498 );
58499 #[allow(unused_mut)]
58500 let mut request = client
58501 .client
58502 .get(url)
58503 .header(
58504 ::reqwest::header::ACCEPT,
58505 ::reqwest::header::HeaderValue::from_static("application/json"),
58506 )
58507 .query(&progenitor_middleware_client::QueryParam::new(
58508 "pageSize", &page_size,
58509 ))
58510 .query(&progenitor_middleware_client::QueryParam::new(
58511 "pageToken",
58512 &page_token,
58513 ))
58514 .headers(header_map)
58515 .build()?;
58516 let info = OperationInfo {
58517 operation_id: "list_webhook_subscriptions",
58518 };
58519 client.pre(&mut request, &info).await?;
58520 let result = client.exec(request, &info).await;
58521 client.post(&result, &info).await?;
58522 let response = result?;
58523 match response.status().as_u16() {
58524 200u16 => ResponseValue::from_response(response).await,
58525 400u16 => Err(Error::ErrorResponse(
58526 ResponseValue::from_response(response).await?,
58527 )),
58528 401u16 => Err(Error::ErrorResponse(
58529 ResponseValue::from_response(response).await?,
58530 )),
58531 429u16 => Err(Error::ErrorResponse(
58532 ResponseValue::from_response(response).await?,
58533 )),
58534 500u16 => Err(Error::ErrorResponse(
58535 ResponseValue::from_response(response).await?,
58536 )),
58537 _ => Err(Error::UnexpectedResponse(response)),
58538 }
58539 }
58540 }
58541 #[derive(Debug, Clone)]
58545 pub struct CreateWebhookSubscription<'a> {
58546 client: &'a super::Client,
58547 body: Result<types::WebhookSubscriptionRequest, String>,
58548 }
58549 impl<'a> CreateWebhookSubscription<'a> {
58550 pub fn new(client: &'a super::Client) -> Self {
58551 Self {
58552 client: client,
58553 body: Err("body was not initialized".to_string()),
58554 }
58555 }
58556 pub fn body<V>(mut self, value: V) -> Self
58557 where
58558 V: std::convert::TryInto<types::WebhookSubscriptionRequest>,
58559 {
58560 self.body = value.try_into().map_err(|_| {
58561 "conversion to `WebhookSubscriptionRequest` for body failed".to_string()
58562 });
58563 self
58564 }
58565 pub async fn send(
58567 self,
58568 ) -> Result<ResponseValue<types::WebhookSubscriptionResponse>, Error<types::Error>>
58569 {
58570 let Self { client, body } = self;
58571 let body = body.map_err(Error::InvalidRequest)?;
58572 let url = format!("{}/v2/data/webhooks/subscriptions", client.baseurl,);
58573 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58574 header_map.append(
58575 ::reqwest::header::HeaderName::from_static("api-version"),
58576 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58577 );
58578 #[allow(unused_mut)]
58579 let mut request = client
58580 .client
58581 .post(url)
58582 .header(
58583 ::reqwest::header::ACCEPT,
58584 ::reqwest::header::HeaderValue::from_static("application/json"),
58585 )
58586 .json(&body)
58587 .headers(header_map)
58588 .build()?;
58589 let info = OperationInfo {
58590 operation_id: "create_webhook_subscription",
58591 };
58592 client.pre(&mut request, &info).await?;
58593 let result = client.exec(request, &info).await;
58594 client.post(&result, &info).await?;
58595 let response = result?;
58596 match response.status().as_u16() {
58597 201u16 => ResponseValue::from_response(response).await,
58598 400u16 => Err(Error::ErrorResponse(
58599 ResponseValue::from_response(response).await?,
58600 )),
58601 401u16 => Err(Error::ErrorResponse(
58602 ResponseValue::from_response(response).await?,
58603 )),
58604 429u16 => Err(Error::ErrorResponse(
58605 ResponseValue::from_response(response).await?,
58606 )),
58607 500u16 => Err(Error::ErrorResponse(
58608 ResponseValue::from_response(response).await?,
58609 )),
58610 _ => Err(Error::UnexpectedResponse(response)),
58611 }
58612 }
58613 }
58614 #[derive(Debug, Clone)]
58618 pub struct GetWebhookSubscription<'a> {
58619 client: &'a super::Client,
58620 subscription_id: Result<::uuid::Uuid, String>,
58621 }
58622 impl<'a> GetWebhookSubscription<'a> {
58623 pub fn new(client: &'a super::Client) -> Self {
58624 Self {
58625 client: client,
58626 subscription_id: Err("subscription_id was not initialized".to_string()),
58627 }
58628 }
58629 pub fn subscription_id<V>(mut self, value: V) -> Self
58630 where
58631 V: std::convert::TryInto<::uuid::Uuid>,
58632 {
58633 self.subscription_id = value.try_into().map_err(|_| {
58634 "conversion to `:: uuid :: Uuid` for subscription_id failed".to_string()
58635 });
58636 self
58637 }
58638 pub async fn send(
58640 self,
58641 ) -> Result<ResponseValue<types::WebhookSubscriptionResponse>, Error<types::Error>>
58642 {
58643 let Self {
58644 client,
58645 subscription_id,
58646 } = self;
58647 let subscription_id = subscription_id.map_err(Error::InvalidRequest)?;
58648 let url = format!(
58649 "{}/v2/data/webhooks/subscriptions/{}",
58650 client.baseurl,
58651 encode_path(&subscription_id.to_string()),
58652 );
58653 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58654 header_map.append(
58655 ::reqwest::header::HeaderName::from_static("api-version"),
58656 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58657 );
58658 #[allow(unused_mut)]
58659 let mut request = client
58660 .client
58661 .get(url)
58662 .header(
58663 ::reqwest::header::ACCEPT,
58664 ::reqwest::header::HeaderValue::from_static("application/json"),
58665 )
58666 .headers(header_map)
58667 .build()?;
58668 let info = OperationInfo {
58669 operation_id: "get_webhook_subscription",
58670 };
58671 client.pre(&mut request, &info).await?;
58672 let result = client.exec(request, &info).await;
58673 client.post(&result, &info).await?;
58674 let response = result?;
58675 match response.status().as_u16() {
58676 200u16 => ResponseValue::from_response(response).await,
58677 401u16 => Err(Error::ErrorResponse(
58678 ResponseValue::from_response(response).await?,
58679 )),
58680 404u16 => Err(Error::ErrorResponse(
58681 ResponseValue::from_response(response).await?,
58682 )),
58683 429u16 => Err(Error::ErrorResponse(
58684 ResponseValue::from_response(response).await?,
58685 )),
58686 500u16 => Err(Error::ErrorResponse(
58687 ResponseValue::from_response(response).await?,
58688 )),
58689 _ => Err(Error::UnexpectedResponse(response)),
58690 }
58691 }
58692 }
58693 #[derive(Debug, Clone)]
58697 pub struct UpdateWebhookSubscription<'a> {
58698 client: &'a super::Client,
58699 subscription_id: Result<::uuid::Uuid, String>,
58700 body: Result<types::WebhookSubscriptionUpdateRequest, String>,
58701 }
58702 impl<'a> UpdateWebhookSubscription<'a> {
58703 pub fn new(client: &'a super::Client) -> Self {
58704 Self {
58705 client: client,
58706 subscription_id: Err("subscription_id was not initialized".to_string()),
58707 body: Err("body was not initialized".to_string()),
58708 }
58709 }
58710 pub fn subscription_id<V>(mut self, value: V) -> Self
58711 where
58712 V: std::convert::TryInto<::uuid::Uuid>,
58713 {
58714 self.subscription_id = value.try_into().map_err(|_| {
58715 "conversion to `:: uuid :: Uuid` for subscription_id failed".to_string()
58716 });
58717 self
58718 }
58719 pub fn body<V>(mut self, value: V) -> Self
58720 where
58721 V: std::convert::TryInto<types::WebhookSubscriptionUpdateRequest>,
58722 {
58723 self.body = value.try_into().map_err(|_| {
58724 "conversion to `WebhookSubscriptionUpdateRequest` for body failed".to_string()
58725 });
58726 self
58727 }
58728 pub async fn send(
58730 self,
58731 ) -> Result<ResponseValue<types::WebhookSubscriptionResponse>, Error<types::Error>>
58732 {
58733 let Self {
58734 client,
58735 subscription_id,
58736 body,
58737 } = self;
58738 let subscription_id = subscription_id.map_err(Error::InvalidRequest)?;
58739 let body = body.map_err(Error::InvalidRequest)?;
58740 let url = format!(
58741 "{}/v2/data/webhooks/subscriptions/{}",
58742 client.baseurl,
58743 encode_path(&subscription_id.to_string()),
58744 );
58745 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58746 header_map.append(
58747 ::reqwest::header::HeaderName::from_static("api-version"),
58748 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58749 );
58750 #[allow(unused_mut)]
58751 let mut request = client
58752 .client
58753 .put(url)
58754 .header(
58755 ::reqwest::header::ACCEPT,
58756 ::reqwest::header::HeaderValue::from_static("application/json"),
58757 )
58758 .json(&body)
58759 .headers(header_map)
58760 .build()?;
58761 let info = OperationInfo {
58762 operation_id: "update_webhook_subscription",
58763 };
58764 client.pre(&mut request, &info).await?;
58765 let result = client.exec(request, &info).await;
58766 client.post(&result, &info).await?;
58767 let response = result?;
58768 match response.status().as_u16() {
58769 200u16 => ResponseValue::from_response(response).await,
58770 400u16 => Err(Error::ErrorResponse(
58771 ResponseValue::from_response(response).await?,
58772 )),
58773 401u16 => Err(Error::ErrorResponse(
58774 ResponseValue::from_response(response).await?,
58775 )),
58776 404u16 => Err(Error::ErrorResponse(
58777 ResponseValue::from_response(response).await?,
58778 )),
58779 429u16 => Err(Error::ErrorResponse(
58780 ResponseValue::from_response(response).await?,
58781 )),
58782 500u16 => Err(Error::ErrorResponse(
58783 ResponseValue::from_response(response).await?,
58784 )),
58785 _ => Err(Error::UnexpectedResponse(response)),
58786 }
58787 }
58788 }
58789 #[derive(Debug, Clone)]
58793 pub struct DeleteWebhookSubscription<'a> {
58794 client: &'a super::Client,
58795 subscription_id: Result<::uuid::Uuid, String>,
58796 }
58797 impl<'a> DeleteWebhookSubscription<'a> {
58798 pub fn new(client: &'a super::Client) -> Self {
58799 Self {
58800 client: client,
58801 subscription_id: Err("subscription_id was not initialized".to_string()),
58802 }
58803 }
58804 pub fn subscription_id<V>(mut self, value: V) -> Self
58805 where
58806 V: std::convert::TryInto<::uuid::Uuid>,
58807 {
58808 self.subscription_id = value.try_into().map_err(|_| {
58809 "conversion to `:: uuid :: Uuid` for subscription_id failed".to_string()
58810 });
58811 self
58812 }
58813 pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
58815 let Self {
58816 client,
58817 subscription_id,
58818 } = self;
58819 let subscription_id = subscription_id.map_err(Error::InvalidRequest)?;
58820 let url = format!(
58821 "{}/v2/data/webhooks/subscriptions/{}",
58822 client.baseurl,
58823 encode_path(&subscription_id.to_string()),
58824 );
58825 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58826 header_map.append(
58827 ::reqwest::header::HeaderName::from_static("api-version"),
58828 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58829 );
58830 #[allow(unused_mut)]
58831 let mut request = client
58832 .client
58833 .delete(url)
58834 .header(
58835 ::reqwest::header::ACCEPT,
58836 ::reqwest::header::HeaderValue::from_static("application/json"),
58837 )
58838 .headers(header_map)
58839 .build()?;
58840 let info = OperationInfo {
58841 operation_id: "delete_webhook_subscription",
58842 };
58843 client.pre(&mut request, &info).await?;
58844 let result = client.exec(request, &info).await;
58845 client.post(&result, &info).await?;
58846 let response = result?;
58847 match response.status().as_u16() {
58848 204u16 => Ok(ResponseValue::empty(response)),
58849 401u16 => Err(Error::ErrorResponse(
58850 ResponseValue::from_response(response).await?,
58851 )),
58852 404u16 => Err(Error::ErrorResponse(
58853 ResponseValue::from_response(response).await?,
58854 )),
58855 429u16 => Err(Error::ErrorResponse(
58856 ResponseValue::from_response(response).await?,
58857 )),
58858 500u16 => Err(Error::ErrorResponse(
58859 ResponseValue::from_response(response).await?,
58860 )),
58861 _ => Err(Error::UnexpectedResponse(response)),
58862 }
58863 }
58864 }
58865 #[derive(Debug, Clone)]
58869 pub struct ListEndUsers<'a> {
58870 client: &'a super::Client,
58871 page_size: Result<Option<::std::num::NonZeroU64>, String>,
58872 page_token: Result<Option<::std::string::String>, String>,
58873 sort: Result<Option<::std::vec::Vec<types::ListEndUsersSortItem>>, String>,
58874 }
58875 impl<'a> ListEndUsers<'a> {
58876 pub fn new(client: &'a super::Client) -> Self {
58877 Self {
58878 client: client,
58879 page_size: Ok(None),
58880 page_token: Ok(None),
58881 sort: Ok(None),
58882 }
58883 }
58884 pub fn page_size<V>(mut self, value: V) -> Self
58885 where
58886 V: std::convert::TryInto<::std::num::NonZeroU64>,
58887 {
58888 self.page_size = value.try_into().map(Some).map_err(|_| {
58889 "conversion to `:: std :: num :: NonZeroU64` for page_size failed".to_string()
58890 });
58891 self
58892 }
58893 pub fn page_token<V>(mut self, value: V) -> Self
58894 where
58895 V: std::convert::TryInto<::std::string::String>,
58896 {
58897 self.page_token = value.try_into().map(Some).map_err(|_| {
58898 "conversion to `:: std :: string :: String` for page_token failed".to_string()
58899 });
58900 self
58901 }
58902 pub fn sort<V>(mut self, value: V) -> Self
58903 where
58904 V: std::convert::TryInto<::std::vec::Vec<types::ListEndUsersSortItem>>,
58905 {
58906 self.sort = value.try_into().map(Some).map_err(|_| {
58907 "conversion to `:: std :: vec :: Vec < ListEndUsersSortItem >` for sort failed"
58908 .to_string()
58909 });
58910 self
58911 }
58912 pub async fn send(
58914 self,
58915 ) -> Result<ResponseValue<types::ListEndUsersResponse>, Error<types::Error>> {
58916 let Self {
58917 client,
58918 page_size,
58919 page_token,
58920 sort,
58921 } = self;
58922 let page_size = page_size.map_err(Error::InvalidRequest)?;
58923 let page_token = page_token.map_err(Error::InvalidRequest)?;
58924 let sort = sort.map_err(Error::InvalidRequest)?;
58925 let url = format!("{}/v2/end-users", client.baseurl,);
58926 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
58927 header_map.append(
58928 ::reqwest::header::HeaderName::from_static("api-version"),
58929 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
58930 );
58931 #[allow(unused_mut)]
58932 let mut request = client
58933 .client
58934 .get(url)
58935 .header(
58936 ::reqwest::header::ACCEPT,
58937 ::reqwest::header::HeaderValue::from_static("application/json"),
58938 )
58939 .query(&progenitor_middleware_client::QueryParam::new(
58940 "pageSize", &page_size,
58941 ))
58942 .query(&progenitor_middleware_client::QueryParam::new(
58943 "pageToken",
58944 &page_token,
58945 ))
58946 .query(&progenitor_middleware_client::QueryParam::new(
58947 "sort", &sort,
58948 ))
58949 .headers(header_map)
58950 .build()?;
58951 let info = OperationInfo {
58952 operation_id: "list_end_users",
58953 };
58954 client.pre(&mut request, &info).await?;
58955 let result = client.exec(request, &info).await;
58956 client.post(&result, &info).await?;
58957 let response = result?;
58958 match response.status().as_u16() {
58959 200u16 => ResponseValue::from_response(response).await,
58960 400u16 => Err(Error::ErrorResponse(
58961 ResponseValue::from_response(response).await?,
58962 )),
58963 401u16 => Err(Error::ErrorResponse(
58964 ResponseValue::from_response(response).await?,
58965 )),
58966 500u16 => Err(Error::ErrorResponse(
58967 ResponseValue::from_response(response).await?,
58968 )),
58969 502u16 => Err(Error::ErrorResponse(
58970 ResponseValue::from_response(response).await?,
58971 )),
58972 503u16 => Err(Error::ErrorResponse(
58973 ResponseValue::from_response(response).await?,
58974 )),
58975 _ => Err(Error::UnexpectedResponse(response)),
58976 }
58977 }
58978 }
58979 #[derive(Debug, Clone)]
58983 pub struct CreateEndUser<'a> {
58984 client: &'a super::Client,
58985 x_idempotency_key: Result<Option<types::CreateEndUserXIdempotencyKey>, String>,
58986 x_wallet_auth: Result<::std::string::String, String>,
58987 body: Result<types::builder::CreateEndUserBody, String>,
58988 }
58989 impl<'a> CreateEndUser<'a> {
58990 pub fn new(client: &'a super::Client) -> Self {
58991 Self {
58992 client: client,
58993 x_idempotency_key: Ok(None),
58994 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
58995 body: Ok(::std::default::Default::default()),
58996 }
58997 }
58998 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
58999 where
59000 V: std::convert::TryInto<types::CreateEndUserXIdempotencyKey>,
59001 {
59002 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
59003 "conversion to `CreateEndUserXIdempotencyKey` for x_idempotency_key failed"
59004 .to_string()
59005 });
59006 self
59007 }
59008 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
59009 where
59010 V: std::convert::TryInto<::std::string::String>,
59011 {
59012 self.x_wallet_auth = value.try_into().map_err(|_| {
59013 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
59014 });
59015 self
59016 }
59017 pub fn body<V>(mut self, value: V) -> Self
59018 where
59019 V: std::convert::TryInto<types::CreateEndUserBody>,
59020 <V as std::convert::TryInto<types::CreateEndUserBody>>::Error: std::fmt::Display,
59021 {
59022 self.body = value
59023 .try_into()
59024 .map(From::from)
59025 .map_err(|s| format!("conversion to `CreateEndUserBody` for body failed: {}", s));
59026 self
59027 }
59028 pub fn body_map<F>(mut self, f: F) -> Self
59029 where
59030 F: std::ops::FnOnce(
59031 types::builder::CreateEndUserBody,
59032 ) -> types::builder::CreateEndUserBody,
59033 {
59034 self.body = self.body.map(f);
59035 self
59036 }
59037 pub async fn send(self) -> Result<ResponseValue<types::EndUser>, Error<types::Error>> {
59039 let Self {
59040 client,
59041 x_idempotency_key,
59042 x_wallet_auth,
59043 body,
59044 } = self;
59045 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
59046 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
59047 let body = body
59048 .and_then(|v| types::CreateEndUserBody::try_from(v).map_err(|e| e.to_string()))
59049 .map_err(Error::InvalidRequest)?;
59050 let url = format!("{}/v2/end-users", client.baseurl,);
59051 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
59052 header_map.append(
59053 ::reqwest::header::HeaderName::from_static("api-version"),
59054 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59055 );
59056 if let Some(value) = x_idempotency_key {
59057 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
59058 }
59059 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
59060 #[allow(unused_mut)]
59061 let mut request = client
59062 .client
59063 .post(url)
59064 .header(
59065 ::reqwest::header::ACCEPT,
59066 ::reqwest::header::HeaderValue::from_static("application/json"),
59067 )
59068 .json(&body)
59069 .headers(header_map)
59070 .build()?;
59071 let info = OperationInfo {
59072 operation_id: "create_end_user",
59073 };
59074 client.pre(&mut request, &info).await?;
59075 let result = client.exec(request, &info).await;
59076 client.post(&result, &info).await?;
59077 let response = result?;
59078 match response.status().as_u16() {
59079 201u16 => ResponseValue::from_response(response).await,
59080 400u16 => Err(Error::ErrorResponse(
59081 ResponseValue::from_response(response).await?,
59082 )),
59083 401u16 => Err(Error::ErrorResponse(
59084 ResponseValue::from_response(response).await?,
59085 )),
59086 402u16 => Err(Error::ErrorResponse(
59087 ResponseValue::from_response(response).await?,
59088 )),
59089 422u16 => Err(Error::ErrorResponse(
59090 ResponseValue::from_response(response).await?,
59091 )),
59092 500u16 => Err(Error::ErrorResponse(
59093 ResponseValue::from_response(response).await?,
59094 )),
59095 _ => Err(Error::UnexpectedResponse(response)),
59096 }
59097 }
59098 }
59099 #[derive(Debug, Clone)]
59103 pub struct ValidateEndUserAccessToken<'a> {
59104 client: &'a super::Client,
59105 body: Result<types::builder::ValidateEndUserAccessTokenBody, String>,
59106 }
59107 impl<'a> ValidateEndUserAccessToken<'a> {
59108 pub fn new(client: &'a super::Client) -> Self {
59109 Self {
59110 client: client,
59111 body: Ok(::std::default::Default::default()),
59112 }
59113 }
59114 pub fn body<V>(mut self, value: V) -> Self
59115 where
59116 V: std::convert::TryInto<types::ValidateEndUserAccessTokenBody>,
59117 <V as std::convert::TryInto<types::ValidateEndUserAccessTokenBody>>::Error:
59118 std::fmt::Display,
59119 {
59120 self.body = value.try_into().map(From::from).map_err(|s| {
59121 format!(
59122 "conversion to `ValidateEndUserAccessTokenBody` for body failed: {}",
59123 s
59124 )
59125 });
59126 self
59127 }
59128 pub fn body_map<F>(mut self, f: F) -> Self
59129 where
59130 F: std::ops::FnOnce(
59131 types::builder::ValidateEndUserAccessTokenBody,
59132 ) -> types::builder::ValidateEndUserAccessTokenBody,
59133 {
59134 self.body = self.body.map(f);
59135 self
59136 }
59137 pub async fn send(self) -> Result<ResponseValue<types::EndUser>, Error<types::Error>> {
59139 let Self { client, body } = self;
59140 let body = body
59141 .and_then(|v| {
59142 types::ValidateEndUserAccessTokenBody::try_from(v).map_err(|e| e.to_string())
59143 })
59144 .map_err(Error::InvalidRequest)?;
59145 let url = format!("{}/v2/end-users/auth/validate-token", client.baseurl,);
59146 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
59147 header_map.append(
59148 ::reqwest::header::HeaderName::from_static("api-version"),
59149 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59150 );
59151 #[allow(unused_mut)]
59152 let mut request = client
59153 .client
59154 .post(url)
59155 .header(
59156 ::reqwest::header::ACCEPT,
59157 ::reqwest::header::HeaderValue::from_static("application/json"),
59158 )
59159 .json(&body)
59160 .headers(header_map)
59161 .build()?;
59162 let info = OperationInfo {
59163 operation_id: "validate_end_user_access_token",
59164 };
59165 client.pre(&mut request, &info).await?;
59166 let result = client.exec(request, &info).await;
59167 client.post(&result, &info).await?;
59168 let response = result?;
59169 match response.status().as_u16() {
59170 200u16 => ResponseValue::from_response(response).await,
59171 400u16 => Err(Error::ErrorResponse(
59172 ResponseValue::from_response(response).await?,
59173 )),
59174 401u16 => Err(Error::ErrorResponse(
59175 ResponseValue::from_response(response).await?,
59176 )),
59177 404u16 => Err(Error::ErrorResponse(
59178 ResponseValue::from_response(response).await?,
59179 )),
59180 500u16 => Err(Error::ErrorResponse(
59181 ResponseValue::from_response(response).await?,
59182 )),
59183 _ => Err(Error::UnexpectedResponse(response)),
59184 }
59185 }
59186 }
59187 #[derive(Debug, Clone)]
59191 pub struct GetEndUser<'a> {
59192 client: &'a super::Client,
59193 user_id: Result<types::GetEndUserUserId, String>,
59194 }
59195 impl<'a> GetEndUser<'a> {
59196 pub fn new(client: &'a super::Client) -> Self {
59197 Self {
59198 client: client,
59199 user_id: Err("user_id was not initialized".to_string()),
59200 }
59201 }
59202 pub fn user_id<V>(mut self, value: V) -> Self
59203 where
59204 V: std::convert::TryInto<types::GetEndUserUserId>,
59205 {
59206 self.user_id = value
59207 .try_into()
59208 .map_err(|_| "conversion to `GetEndUserUserId` for user_id failed".to_string());
59209 self
59210 }
59211 pub async fn send(self) -> Result<ResponseValue<types::EndUser>, Error<types::Error>> {
59213 let Self { client, user_id } = self;
59214 let user_id = user_id.map_err(Error::InvalidRequest)?;
59215 let url = format!(
59216 "{}/v2/end-users/{}",
59217 client.baseurl,
59218 encode_path(&user_id.to_string()),
59219 );
59220 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
59221 header_map.append(
59222 ::reqwest::header::HeaderName::from_static("api-version"),
59223 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59224 );
59225 #[allow(unused_mut)]
59226 let mut request = client
59227 .client
59228 .get(url)
59229 .header(
59230 ::reqwest::header::ACCEPT,
59231 ::reqwest::header::HeaderValue::from_static("application/json"),
59232 )
59233 .headers(header_map)
59234 .build()?;
59235 let info = OperationInfo {
59236 operation_id: "get_end_user",
59237 };
59238 client.pre(&mut request, &info).await?;
59239 let result = client.exec(request, &info).await;
59240 client.post(&result, &info).await?;
59241 let response = result?;
59242 match response.status().as_u16() {
59243 200u16 => ResponseValue::from_response(response).await,
59244 404u16 => Err(Error::ErrorResponse(
59245 ResponseValue::from_response(response).await?,
59246 )),
59247 500u16 => Err(Error::ErrorResponse(
59248 ResponseValue::from_response(response).await?,
59249 )),
59250 _ => Err(Error::UnexpectedResponse(response)),
59251 }
59252 }
59253 }
59254 #[derive(Debug, Clone)]
59258 pub struct ListEvmAccounts<'a> {
59259 client: &'a super::Client,
59260 page_size: Result<Option<i64>, String>,
59261 page_token: Result<Option<::std::string::String>, String>,
59262 }
59263 impl<'a> ListEvmAccounts<'a> {
59264 pub fn new(client: &'a super::Client) -> Self {
59265 Self {
59266 client: client,
59267 page_size: Ok(None),
59268 page_token: Ok(None),
59269 }
59270 }
59271 pub fn page_size<V>(mut self, value: V) -> Self
59272 where
59273 V: std::convert::TryInto<i64>,
59274 {
59275 self.page_size = value
59276 .try_into()
59277 .map(Some)
59278 .map_err(|_| "conversion to `i64` for page_size failed".to_string());
59279 self
59280 }
59281 pub fn page_token<V>(mut self, value: V) -> Self
59282 where
59283 V: std::convert::TryInto<::std::string::String>,
59284 {
59285 self.page_token = value.try_into().map(Some).map_err(|_| {
59286 "conversion to `:: std :: string :: String` for page_token failed".to_string()
59287 });
59288 self
59289 }
59290 pub async fn send(
59292 self,
59293 ) -> Result<ResponseValue<types::ListEvmAccountsResponse>, Error<types::Error>> {
59294 let Self {
59295 client,
59296 page_size,
59297 page_token,
59298 } = self;
59299 let page_size = page_size.map_err(Error::InvalidRequest)?;
59300 let page_token = page_token.map_err(Error::InvalidRequest)?;
59301 let url = format!("{}/v2/evm/accounts", client.baseurl,);
59302 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
59303 header_map.append(
59304 ::reqwest::header::HeaderName::from_static("api-version"),
59305 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59306 );
59307 #[allow(unused_mut)]
59308 let mut request = client
59309 .client
59310 .get(url)
59311 .header(
59312 ::reqwest::header::ACCEPT,
59313 ::reqwest::header::HeaderValue::from_static("application/json"),
59314 )
59315 .query(&progenitor_middleware_client::QueryParam::new(
59316 "pageSize", &page_size,
59317 ))
59318 .query(&progenitor_middleware_client::QueryParam::new(
59319 "pageToken",
59320 &page_token,
59321 ))
59322 .headers(header_map)
59323 .build()?;
59324 let info = OperationInfo {
59325 operation_id: "list_evm_accounts",
59326 };
59327 client.pre(&mut request, &info).await?;
59328 let result = client.exec(request, &info).await;
59329 client.post(&result, &info).await?;
59330 let response = result?;
59331 match response.status().as_u16() {
59332 200u16 => ResponseValue::from_response(response).await,
59333 500u16 => Err(Error::ErrorResponse(
59334 ResponseValue::from_response(response).await?,
59335 )),
59336 502u16 => Err(Error::ErrorResponse(
59337 ResponseValue::from_response(response).await?,
59338 )),
59339 503u16 => Err(Error::ErrorResponse(
59340 ResponseValue::from_response(response).await?,
59341 )),
59342 _ => Err(Error::UnexpectedResponse(response)),
59343 }
59344 }
59345 }
59346 #[derive(Debug, Clone)]
59350 pub struct CreateEvmAccount<'a> {
59351 client: &'a super::Client,
59352 x_idempotency_key: Result<Option<types::CreateEvmAccountXIdempotencyKey>, String>,
59353 x_wallet_auth: Result<::std::string::String, String>,
59354 body: Result<types::builder::CreateEvmAccountBody, String>,
59355 }
59356 impl<'a> CreateEvmAccount<'a> {
59357 pub fn new(client: &'a super::Client) -> Self {
59358 Self {
59359 client: client,
59360 x_idempotency_key: Ok(None),
59361 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
59362 body: Ok(::std::default::Default::default()),
59363 }
59364 }
59365 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
59366 where
59367 V: std::convert::TryInto<types::CreateEvmAccountXIdempotencyKey>,
59368 {
59369 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
59370 "conversion to `CreateEvmAccountXIdempotencyKey` for x_idempotency_key failed"
59371 .to_string()
59372 });
59373 self
59374 }
59375 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
59376 where
59377 V: std::convert::TryInto<::std::string::String>,
59378 {
59379 self.x_wallet_auth = value.try_into().map_err(|_| {
59380 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
59381 });
59382 self
59383 }
59384 pub fn body<V>(mut self, value: V) -> Self
59385 where
59386 V: std::convert::TryInto<types::CreateEvmAccountBody>,
59387 <V as std::convert::TryInto<types::CreateEvmAccountBody>>::Error: std::fmt::Display,
59388 {
59389 self.body = value.try_into().map(From::from).map_err(|s| {
59390 format!(
59391 "conversion to `CreateEvmAccountBody` for body failed: {}",
59392 s
59393 )
59394 });
59395 self
59396 }
59397 pub fn body_map<F>(mut self, f: F) -> Self
59398 where
59399 F: std::ops::FnOnce(
59400 types::builder::CreateEvmAccountBody,
59401 ) -> types::builder::CreateEvmAccountBody,
59402 {
59403 self.body = self.body.map(f);
59404 self
59405 }
59406 pub async fn send(self) -> Result<ResponseValue<types::EvmAccount>, Error<types::Error>> {
59408 let Self {
59409 client,
59410 x_idempotency_key,
59411 x_wallet_auth,
59412 body,
59413 } = self;
59414 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
59415 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
59416 let body = body
59417 .and_then(|v| types::CreateEvmAccountBody::try_from(v).map_err(|e| e.to_string()))
59418 .map_err(Error::InvalidRequest)?;
59419 let url = format!("{}/v2/evm/accounts", client.baseurl,);
59420 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
59421 header_map.append(
59422 ::reqwest::header::HeaderName::from_static("api-version"),
59423 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59424 );
59425 if let Some(value) = x_idempotency_key {
59426 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
59427 }
59428 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
59429 #[allow(unused_mut)]
59430 let mut request = client
59431 .client
59432 .post(url)
59433 .header(
59434 ::reqwest::header::ACCEPT,
59435 ::reqwest::header::HeaderValue::from_static("application/json"),
59436 )
59437 .json(&body)
59438 .headers(header_map)
59439 .build()?;
59440 let info = OperationInfo {
59441 operation_id: "create_evm_account",
59442 };
59443 client.pre(&mut request, &info).await?;
59444 let result = client.exec(request, &info).await;
59445 client.post(&result, &info).await?;
59446 let response = result?;
59447 match response.status().as_u16() {
59448 201u16 => ResponseValue::from_response(response).await,
59449 400u16 => Err(Error::ErrorResponse(
59450 ResponseValue::from_response(response).await?,
59451 )),
59452 401u16 => Err(Error::ErrorResponse(
59453 ResponseValue::from_response(response).await?,
59454 )),
59455 402u16 => Err(Error::ErrorResponse(
59456 ResponseValue::from_response(response).await?,
59457 )),
59458 409u16 => Err(Error::ErrorResponse(
59459 ResponseValue::from_response(response).await?,
59460 )),
59461 422u16 => Err(Error::ErrorResponse(
59462 ResponseValue::from_response(response).await?,
59463 )),
59464 500u16 => Err(Error::ErrorResponse(
59465 ResponseValue::from_response(response).await?,
59466 )),
59467 502u16 => Err(Error::ErrorResponse(
59468 ResponseValue::from_response(response).await?,
59469 )),
59470 503u16 => Err(Error::ErrorResponse(
59471 ResponseValue::from_response(response).await?,
59472 )),
59473 _ => Err(Error::UnexpectedResponse(response)),
59474 }
59475 }
59476 }
59477 #[derive(Debug, Clone)]
59481 pub struct GetEvmAccountByName<'a> {
59482 client: &'a super::Client,
59483 name: Result<::std::string::String, String>,
59484 }
59485 impl<'a> GetEvmAccountByName<'a> {
59486 pub fn new(client: &'a super::Client) -> Self {
59487 Self {
59488 client: client,
59489 name: Err("name was not initialized".to_string()),
59490 }
59491 }
59492 pub fn name<V>(mut self, value: V) -> Self
59493 where
59494 V: std::convert::TryInto<::std::string::String>,
59495 {
59496 self.name = value.try_into().map_err(|_| {
59497 "conversion to `:: std :: string :: String` for name failed".to_string()
59498 });
59499 self
59500 }
59501 pub async fn send(self) -> Result<ResponseValue<types::EvmAccount>, Error<types::Error>> {
59503 let Self { client, name } = self;
59504 let name = name.map_err(Error::InvalidRequest)?;
59505 let url = format!(
59506 "{}/v2/evm/accounts/by-name/{}",
59507 client.baseurl,
59508 encode_path(&name.to_string()),
59509 );
59510 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
59511 header_map.append(
59512 ::reqwest::header::HeaderName::from_static("api-version"),
59513 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59514 );
59515 #[allow(unused_mut)]
59516 let mut request = client
59517 .client
59518 .get(url)
59519 .header(
59520 ::reqwest::header::ACCEPT,
59521 ::reqwest::header::HeaderValue::from_static("application/json"),
59522 )
59523 .headers(header_map)
59524 .build()?;
59525 let info = OperationInfo {
59526 operation_id: "get_evm_account_by_name",
59527 };
59528 client.pre(&mut request, &info).await?;
59529 let result = client.exec(request, &info).await;
59530 client.post(&result, &info).await?;
59531 let response = result?;
59532 match response.status().as_u16() {
59533 200u16 => ResponseValue::from_response(response).await,
59534 400u16 => Err(Error::ErrorResponse(
59535 ResponseValue::from_response(response).await?,
59536 )),
59537 404u16 => Err(Error::ErrorResponse(
59538 ResponseValue::from_response(response).await?,
59539 )),
59540 500u16 => Err(Error::ErrorResponse(
59541 ResponseValue::from_response(response).await?,
59542 )),
59543 502u16 => Err(Error::ErrorResponse(
59544 ResponseValue::from_response(response).await?,
59545 )),
59546 503u16 => Err(Error::ErrorResponse(
59547 ResponseValue::from_response(response).await?,
59548 )),
59549 _ => Err(Error::UnexpectedResponse(response)),
59550 }
59551 }
59552 }
59553 #[derive(Debug, Clone)]
59557 pub struct ExportEvmAccountByName<'a> {
59558 client: &'a super::Client,
59559 name: Result<::std::string::String, String>,
59560 x_idempotency_key: Result<Option<types::ExportEvmAccountByNameXIdempotencyKey>, String>,
59561 x_wallet_auth: Result<::std::string::String, String>,
59562 body: Result<types::builder::ExportEvmAccountByNameBody, String>,
59563 }
59564 impl<'a> ExportEvmAccountByName<'a> {
59565 pub fn new(client: &'a super::Client) -> Self {
59566 Self {
59567 client: client,
59568 name: Err("name was not initialized".to_string()),
59569 x_idempotency_key: Ok(None),
59570 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
59571 body: Ok(::std::default::Default::default()),
59572 }
59573 }
59574 pub fn name<V>(mut self, value: V) -> Self
59575 where
59576 V: std::convert::TryInto<::std::string::String>,
59577 {
59578 self.name = value.try_into().map_err(|_| {
59579 "conversion to `:: std :: string :: String` for name failed".to_string()
59580 });
59581 self
59582 }
59583 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
59584 where
59585 V: std::convert::TryInto<types::ExportEvmAccountByNameXIdempotencyKey>,
59586 {
59587 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
59588 "conversion to `ExportEvmAccountByNameXIdempotencyKey` for x_idempotency_key failed"
59589 .to_string()
59590 });
59591 self
59592 }
59593 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
59594 where
59595 V: std::convert::TryInto<::std::string::String>,
59596 {
59597 self.x_wallet_auth = value.try_into().map_err(|_| {
59598 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
59599 });
59600 self
59601 }
59602 pub fn body<V>(mut self, value: V) -> Self
59603 where
59604 V: std::convert::TryInto<types::ExportEvmAccountByNameBody>,
59605 <V as std::convert::TryInto<types::ExportEvmAccountByNameBody>>::Error:
59606 std::fmt::Display,
59607 {
59608 self.body = value.try_into().map(From::from).map_err(|s| {
59609 format!(
59610 "conversion to `ExportEvmAccountByNameBody` for body failed: {}",
59611 s
59612 )
59613 });
59614 self
59615 }
59616 pub fn body_map<F>(mut self, f: F) -> Self
59617 where
59618 F: std::ops::FnOnce(
59619 types::builder::ExportEvmAccountByNameBody,
59620 ) -> types::builder::ExportEvmAccountByNameBody,
59621 {
59622 self.body = self.body.map(f);
59623 self
59624 }
59625 pub async fn send(
59627 self,
59628 ) -> Result<ResponseValue<types::ExportEvmAccountByNameResponse>, Error<types::Error>>
59629 {
59630 let Self {
59631 client,
59632 name,
59633 x_idempotency_key,
59634 x_wallet_auth,
59635 body,
59636 } = self;
59637 let name = name.map_err(Error::InvalidRequest)?;
59638 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
59639 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
59640 let body = body
59641 .and_then(|v| {
59642 types::ExportEvmAccountByNameBody::try_from(v).map_err(|e| e.to_string())
59643 })
59644 .map_err(Error::InvalidRequest)?;
59645 let url = format!(
59646 "{}/v2/evm/accounts/export/by-name/{}",
59647 client.baseurl,
59648 encode_path(&name.to_string()),
59649 );
59650 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
59651 header_map.append(
59652 ::reqwest::header::HeaderName::from_static("api-version"),
59653 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59654 );
59655 if let Some(value) = x_idempotency_key {
59656 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
59657 }
59658 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
59659 #[allow(unused_mut)]
59660 let mut request = client
59661 .client
59662 .post(url)
59663 .header(
59664 ::reqwest::header::ACCEPT,
59665 ::reqwest::header::HeaderValue::from_static("application/json"),
59666 )
59667 .json(&body)
59668 .headers(header_map)
59669 .build()?;
59670 let info = OperationInfo {
59671 operation_id: "export_evm_account_by_name",
59672 };
59673 client.pre(&mut request, &info).await?;
59674 let result = client.exec(request, &info).await;
59675 client.post(&result, &info).await?;
59676 let response = result?;
59677 match response.status().as_u16() {
59678 200u16 => ResponseValue::from_response(response).await,
59679 400u16 => Err(Error::ErrorResponse(
59680 ResponseValue::from_response(response).await?,
59681 )),
59682 401u16 => Err(Error::ErrorResponse(
59683 ResponseValue::from_response(response).await?,
59684 )),
59685 402u16 => Err(Error::ErrorResponse(
59686 ResponseValue::from_response(response).await?,
59687 )),
59688 404u16 => Err(Error::ErrorResponse(
59689 ResponseValue::from_response(response).await?,
59690 )),
59691 422u16 => Err(Error::ErrorResponse(
59692 ResponseValue::from_response(response).await?,
59693 )),
59694 500u16 => Err(Error::ErrorResponse(
59695 ResponseValue::from_response(response).await?,
59696 )),
59697 502u16 => Err(Error::ErrorResponse(
59698 ResponseValue::from_response(response).await?,
59699 )),
59700 503u16 => Err(Error::ErrorResponse(
59701 ResponseValue::from_response(response).await?,
59702 )),
59703 _ => Err(Error::UnexpectedResponse(response)),
59704 }
59705 }
59706 }
59707 #[derive(Debug, Clone)]
59711 pub struct ImportEvmAccount<'a> {
59712 client: &'a super::Client,
59713 x_idempotency_key: Result<Option<types::ImportEvmAccountXIdempotencyKey>, String>,
59714 x_wallet_auth: Result<::std::string::String, String>,
59715 body: Result<types::builder::ImportEvmAccountBody, String>,
59716 }
59717 impl<'a> ImportEvmAccount<'a> {
59718 pub fn new(client: &'a super::Client) -> Self {
59719 Self {
59720 client: client,
59721 x_idempotency_key: Ok(None),
59722 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
59723 body: Ok(::std::default::Default::default()),
59724 }
59725 }
59726 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
59727 where
59728 V: std::convert::TryInto<types::ImportEvmAccountXIdempotencyKey>,
59729 {
59730 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
59731 "conversion to `ImportEvmAccountXIdempotencyKey` for x_idempotency_key failed"
59732 .to_string()
59733 });
59734 self
59735 }
59736 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
59737 where
59738 V: std::convert::TryInto<::std::string::String>,
59739 {
59740 self.x_wallet_auth = value.try_into().map_err(|_| {
59741 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
59742 });
59743 self
59744 }
59745 pub fn body<V>(mut self, value: V) -> Self
59746 where
59747 V: std::convert::TryInto<types::ImportEvmAccountBody>,
59748 <V as std::convert::TryInto<types::ImportEvmAccountBody>>::Error: std::fmt::Display,
59749 {
59750 self.body = value.try_into().map(From::from).map_err(|s| {
59751 format!(
59752 "conversion to `ImportEvmAccountBody` for body failed: {}",
59753 s
59754 )
59755 });
59756 self
59757 }
59758 pub fn body_map<F>(mut self, f: F) -> Self
59759 where
59760 F: std::ops::FnOnce(
59761 types::builder::ImportEvmAccountBody,
59762 ) -> types::builder::ImportEvmAccountBody,
59763 {
59764 self.body = self.body.map(f);
59765 self
59766 }
59767 pub async fn send(self) -> Result<ResponseValue<types::EvmAccount>, Error<types::Error>> {
59769 let Self {
59770 client,
59771 x_idempotency_key,
59772 x_wallet_auth,
59773 body,
59774 } = self;
59775 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
59776 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
59777 let body = body
59778 .and_then(|v| types::ImportEvmAccountBody::try_from(v).map_err(|e| e.to_string()))
59779 .map_err(Error::InvalidRequest)?;
59780 let url = format!("{}/v2/evm/accounts/import", client.baseurl,);
59781 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
59782 header_map.append(
59783 ::reqwest::header::HeaderName::from_static("api-version"),
59784 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59785 );
59786 if let Some(value) = x_idempotency_key {
59787 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
59788 }
59789 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
59790 #[allow(unused_mut)]
59791 let mut request = client
59792 .client
59793 .post(url)
59794 .header(
59795 ::reqwest::header::ACCEPT,
59796 ::reqwest::header::HeaderValue::from_static("application/json"),
59797 )
59798 .json(&body)
59799 .headers(header_map)
59800 .build()?;
59801 let info = OperationInfo {
59802 operation_id: "import_evm_account",
59803 };
59804 client.pre(&mut request, &info).await?;
59805 let result = client.exec(request, &info).await;
59806 client.post(&result, &info).await?;
59807 let response = result?;
59808 match response.status().as_u16() {
59809 201u16 => ResponseValue::from_response(response).await,
59810 400u16 => Err(Error::ErrorResponse(
59811 ResponseValue::from_response(response).await?,
59812 )),
59813 401u16 => Err(Error::ErrorResponse(
59814 ResponseValue::from_response(response).await?,
59815 )),
59816 402u16 => Err(Error::ErrorResponse(
59817 ResponseValue::from_response(response).await?,
59818 )),
59819 409u16 => Err(Error::ErrorResponse(
59820 ResponseValue::from_response(response).await?,
59821 )),
59822 422u16 => Err(Error::ErrorResponse(
59823 ResponseValue::from_response(response).await?,
59824 )),
59825 500u16 => Err(Error::ErrorResponse(
59826 ResponseValue::from_response(response).await?,
59827 )),
59828 502u16 => Err(Error::ErrorResponse(
59829 ResponseValue::from_response(response).await?,
59830 )),
59831 503u16 => Err(Error::ErrorResponse(
59832 ResponseValue::from_response(response).await?,
59833 )),
59834 _ => Err(Error::UnexpectedResponse(response)),
59835 }
59836 }
59837 }
59838 #[derive(Debug, Clone)]
59842 pub struct GetEvmAccount<'a> {
59843 client: &'a super::Client,
59844 address: Result<types::GetEvmAccountAddress, String>,
59845 }
59846 impl<'a> GetEvmAccount<'a> {
59847 pub fn new(client: &'a super::Client) -> Self {
59848 Self {
59849 client: client,
59850 address: Err("address was not initialized".to_string()),
59851 }
59852 }
59853 pub fn address<V>(mut self, value: V) -> Self
59854 where
59855 V: std::convert::TryInto<types::GetEvmAccountAddress>,
59856 {
59857 self.address = value
59858 .try_into()
59859 .map_err(|_| "conversion to `GetEvmAccountAddress` for address failed".to_string());
59860 self
59861 }
59862 pub async fn send(self) -> Result<ResponseValue<types::EvmAccount>, Error<types::Error>> {
59864 let Self { client, address } = self;
59865 let address = address.map_err(Error::InvalidRequest)?;
59866 let url = format!(
59867 "{}/v2/evm/accounts/{}",
59868 client.baseurl,
59869 encode_path(&address.to_string()),
59870 );
59871 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
59872 header_map.append(
59873 ::reqwest::header::HeaderName::from_static("api-version"),
59874 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59875 );
59876 #[allow(unused_mut)]
59877 let mut request = client
59878 .client
59879 .get(url)
59880 .header(
59881 ::reqwest::header::ACCEPT,
59882 ::reqwest::header::HeaderValue::from_static("application/json"),
59883 )
59884 .headers(header_map)
59885 .build()?;
59886 let info = OperationInfo {
59887 operation_id: "get_evm_account",
59888 };
59889 client.pre(&mut request, &info).await?;
59890 let result = client.exec(request, &info).await;
59891 client.post(&result, &info).await?;
59892 let response = result?;
59893 match response.status().as_u16() {
59894 200u16 => ResponseValue::from_response(response).await,
59895 400u16 => Err(Error::ErrorResponse(
59896 ResponseValue::from_response(response).await?,
59897 )),
59898 404u16 => Err(Error::ErrorResponse(
59899 ResponseValue::from_response(response).await?,
59900 )),
59901 500u16 => Err(Error::ErrorResponse(
59902 ResponseValue::from_response(response).await?,
59903 )),
59904 502u16 => Err(Error::ErrorResponse(
59905 ResponseValue::from_response(response).await?,
59906 )),
59907 503u16 => Err(Error::ErrorResponse(
59908 ResponseValue::from_response(response).await?,
59909 )),
59910 _ => Err(Error::UnexpectedResponse(response)),
59911 }
59912 }
59913 }
59914 #[derive(Debug, Clone)]
59918 pub struct UpdateEvmAccount<'a> {
59919 client: &'a super::Client,
59920 address: Result<types::UpdateEvmAccountAddress, String>,
59921 x_idempotency_key: Result<Option<types::UpdateEvmAccountXIdempotencyKey>, String>,
59922 body: Result<types::builder::UpdateEvmAccountBody, String>,
59923 }
59924 impl<'a> UpdateEvmAccount<'a> {
59925 pub fn new(client: &'a super::Client) -> Self {
59926 Self {
59927 client: client,
59928 address: Err("address was not initialized".to_string()),
59929 x_idempotency_key: Ok(None),
59930 body: Ok(::std::default::Default::default()),
59931 }
59932 }
59933 pub fn address<V>(mut self, value: V) -> Self
59934 where
59935 V: std::convert::TryInto<types::UpdateEvmAccountAddress>,
59936 {
59937 self.address = value.try_into().map_err(|_| {
59938 "conversion to `UpdateEvmAccountAddress` for address failed".to_string()
59939 });
59940 self
59941 }
59942 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
59943 where
59944 V: std::convert::TryInto<types::UpdateEvmAccountXIdempotencyKey>,
59945 {
59946 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
59947 "conversion to `UpdateEvmAccountXIdempotencyKey` for x_idempotency_key failed"
59948 .to_string()
59949 });
59950 self
59951 }
59952 pub fn body<V>(mut self, value: V) -> Self
59953 where
59954 V: std::convert::TryInto<types::UpdateEvmAccountBody>,
59955 <V as std::convert::TryInto<types::UpdateEvmAccountBody>>::Error: std::fmt::Display,
59956 {
59957 self.body = value.try_into().map(From::from).map_err(|s| {
59958 format!(
59959 "conversion to `UpdateEvmAccountBody` for body failed: {}",
59960 s
59961 )
59962 });
59963 self
59964 }
59965 pub fn body_map<F>(mut self, f: F) -> Self
59966 where
59967 F: std::ops::FnOnce(
59968 types::builder::UpdateEvmAccountBody,
59969 ) -> types::builder::UpdateEvmAccountBody,
59970 {
59971 self.body = self.body.map(f);
59972 self
59973 }
59974 pub async fn send(self) -> Result<ResponseValue<types::EvmAccount>, Error<types::Error>> {
59976 let Self {
59977 client,
59978 address,
59979 x_idempotency_key,
59980 body,
59981 } = self;
59982 let address = address.map_err(Error::InvalidRequest)?;
59983 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
59984 let body = body
59985 .and_then(|v| types::UpdateEvmAccountBody::try_from(v).map_err(|e| e.to_string()))
59986 .map_err(Error::InvalidRequest)?;
59987 let url = format!(
59988 "{}/v2/evm/accounts/{}",
59989 client.baseurl,
59990 encode_path(&address.to_string()),
59991 );
59992 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
59993 header_map.append(
59994 ::reqwest::header::HeaderName::from_static("api-version"),
59995 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
59996 );
59997 if let Some(value) = x_idempotency_key {
59998 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
59999 }
60000 #[allow(unused_mut)]
60001 let mut request = client
60002 .client
60003 .put(url)
60004 .header(
60005 ::reqwest::header::ACCEPT,
60006 ::reqwest::header::HeaderValue::from_static("application/json"),
60007 )
60008 .json(&body)
60009 .headers(header_map)
60010 .build()?;
60011 let info = OperationInfo {
60012 operation_id: "update_evm_account",
60013 };
60014 client.pre(&mut request, &info).await?;
60015 let result = client.exec(request, &info).await;
60016 client.post(&result, &info).await?;
60017 let response = result?;
60018 match response.status().as_u16() {
60019 200u16 => ResponseValue::from_response(response).await,
60020 400u16 => Err(Error::ErrorResponse(
60021 ResponseValue::from_response(response).await?,
60022 )),
60023 404u16 => Err(Error::ErrorResponse(
60024 ResponseValue::from_response(response).await?,
60025 )),
60026 409u16 => Err(Error::ErrorResponse(
60027 ResponseValue::from_response(response).await?,
60028 )),
60029 422u16 => Err(Error::ErrorResponse(
60030 ResponseValue::from_response(response).await?,
60031 )),
60032 500u16 => Err(Error::ErrorResponse(
60033 ResponseValue::from_response(response).await?,
60034 )),
60035 502u16 => Err(Error::ErrorResponse(
60036 ResponseValue::from_response(response).await?,
60037 )),
60038 503u16 => Err(Error::ErrorResponse(
60039 ResponseValue::from_response(response).await?,
60040 )),
60041 _ => Err(Error::UnexpectedResponse(response)),
60042 }
60043 }
60044 }
60045 #[derive(Debug, Clone)]
60049 pub struct ExportEvmAccount<'a> {
60050 client: &'a super::Client,
60051 address: Result<types::ExportEvmAccountAddress, String>,
60052 x_idempotency_key: Result<Option<types::ExportEvmAccountXIdempotencyKey>, String>,
60053 x_wallet_auth: Result<::std::string::String, String>,
60054 body: Result<types::builder::ExportEvmAccountBody, String>,
60055 }
60056 impl<'a> ExportEvmAccount<'a> {
60057 pub fn new(client: &'a super::Client) -> Self {
60058 Self {
60059 client: client,
60060 address: Err("address was not initialized".to_string()),
60061 x_idempotency_key: Ok(None),
60062 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
60063 body: Ok(::std::default::Default::default()),
60064 }
60065 }
60066 pub fn address<V>(mut self, value: V) -> Self
60067 where
60068 V: std::convert::TryInto<types::ExportEvmAccountAddress>,
60069 {
60070 self.address = value.try_into().map_err(|_| {
60071 "conversion to `ExportEvmAccountAddress` for address failed".to_string()
60072 });
60073 self
60074 }
60075 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
60076 where
60077 V: std::convert::TryInto<types::ExportEvmAccountXIdempotencyKey>,
60078 {
60079 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
60080 "conversion to `ExportEvmAccountXIdempotencyKey` for x_idempotency_key failed"
60081 .to_string()
60082 });
60083 self
60084 }
60085 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
60086 where
60087 V: std::convert::TryInto<::std::string::String>,
60088 {
60089 self.x_wallet_auth = value.try_into().map_err(|_| {
60090 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
60091 });
60092 self
60093 }
60094 pub fn body<V>(mut self, value: V) -> Self
60095 where
60096 V: std::convert::TryInto<types::ExportEvmAccountBody>,
60097 <V as std::convert::TryInto<types::ExportEvmAccountBody>>::Error: std::fmt::Display,
60098 {
60099 self.body = value.try_into().map(From::from).map_err(|s| {
60100 format!(
60101 "conversion to `ExportEvmAccountBody` for body failed: {}",
60102 s
60103 )
60104 });
60105 self
60106 }
60107 pub fn body_map<F>(mut self, f: F) -> Self
60108 where
60109 F: std::ops::FnOnce(
60110 types::builder::ExportEvmAccountBody,
60111 ) -> types::builder::ExportEvmAccountBody,
60112 {
60113 self.body = self.body.map(f);
60114 self
60115 }
60116 pub async fn send(
60118 self,
60119 ) -> Result<ResponseValue<types::ExportEvmAccountResponse>, Error<types::Error>> {
60120 let Self {
60121 client,
60122 address,
60123 x_idempotency_key,
60124 x_wallet_auth,
60125 body,
60126 } = self;
60127 let address = address.map_err(Error::InvalidRequest)?;
60128 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
60129 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
60130 let body = body
60131 .and_then(|v| types::ExportEvmAccountBody::try_from(v).map_err(|e| e.to_string()))
60132 .map_err(Error::InvalidRequest)?;
60133 let url = format!(
60134 "{}/v2/evm/accounts/{}/export",
60135 client.baseurl,
60136 encode_path(&address.to_string()),
60137 );
60138 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
60139 header_map.append(
60140 ::reqwest::header::HeaderName::from_static("api-version"),
60141 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
60142 );
60143 if let Some(value) = x_idempotency_key {
60144 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
60145 }
60146 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
60147 #[allow(unused_mut)]
60148 let mut request = client
60149 .client
60150 .post(url)
60151 .header(
60152 ::reqwest::header::ACCEPT,
60153 ::reqwest::header::HeaderValue::from_static("application/json"),
60154 )
60155 .json(&body)
60156 .headers(header_map)
60157 .build()?;
60158 let info = OperationInfo {
60159 operation_id: "export_evm_account",
60160 };
60161 client.pre(&mut request, &info).await?;
60162 let result = client.exec(request, &info).await;
60163 client.post(&result, &info).await?;
60164 let response = result?;
60165 match response.status().as_u16() {
60166 200u16 => ResponseValue::from_response(response).await,
60167 400u16 => Err(Error::ErrorResponse(
60168 ResponseValue::from_response(response).await?,
60169 )),
60170 401u16 => Err(Error::ErrorResponse(
60171 ResponseValue::from_response(response).await?,
60172 )),
60173 402u16 => Err(Error::ErrorResponse(
60174 ResponseValue::from_response(response).await?,
60175 )),
60176 404u16 => Err(Error::ErrorResponse(
60177 ResponseValue::from_response(response).await?,
60178 )),
60179 422u16 => Err(Error::ErrorResponse(
60180 ResponseValue::from_response(response).await?,
60181 )),
60182 500u16 => Err(Error::ErrorResponse(
60183 ResponseValue::from_response(response).await?,
60184 )),
60185 502u16 => Err(Error::ErrorResponse(
60186 ResponseValue::from_response(response).await?,
60187 )),
60188 503u16 => Err(Error::ErrorResponse(
60189 ResponseValue::from_response(response).await?,
60190 )),
60191 _ => Err(Error::UnexpectedResponse(response)),
60192 }
60193 }
60194 }
60195 #[derive(Debug, Clone)]
60199 pub struct SendEvmTransaction<'a> {
60200 client: &'a super::Client,
60201 address: Result<types::SendEvmTransactionAddress, String>,
60202 x_idempotency_key: Result<Option<types::SendEvmTransactionXIdempotencyKey>, String>,
60203 x_wallet_auth: Result<::std::string::String, String>,
60204 body: Result<types::builder::SendEvmTransactionBody, String>,
60205 }
60206 impl<'a> SendEvmTransaction<'a> {
60207 pub fn new(client: &'a super::Client) -> Self {
60208 Self {
60209 client: client,
60210 address: Err("address was not initialized".to_string()),
60211 x_idempotency_key: Ok(None),
60212 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
60213 body: Ok(::std::default::Default::default()),
60214 }
60215 }
60216 pub fn address<V>(mut self, value: V) -> Self
60217 where
60218 V: std::convert::TryInto<types::SendEvmTransactionAddress>,
60219 {
60220 self.address = value.try_into().map_err(|_| {
60221 "conversion to `SendEvmTransactionAddress` for address failed".to_string()
60222 });
60223 self
60224 }
60225 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
60226 where
60227 V: std::convert::TryInto<types::SendEvmTransactionXIdempotencyKey>,
60228 {
60229 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
60230 "conversion to `SendEvmTransactionXIdempotencyKey` for x_idempotency_key failed"
60231 .to_string()
60232 });
60233 self
60234 }
60235 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
60236 where
60237 V: std::convert::TryInto<::std::string::String>,
60238 {
60239 self.x_wallet_auth = value.try_into().map_err(|_| {
60240 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
60241 });
60242 self
60243 }
60244 pub fn body<V>(mut self, value: V) -> Self
60245 where
60246 V: std::convert::TryInto<types::SendEvmTransactionBody>,
60247 <V as std::convert::TryInto<types::SendEvmTransactionBody>>::Error: std::fmt::Display,
60248 {
60249 self.body = value.try_into().map(From::from).map_err(|s| {
60250 format!(
60251 "conversion to `SendEvmTransactionBody` for body failed: {}",
60252 s
60253 )
60254 });
60255 self
60256 }
60257 pub fn body_map<F>(mut self, f: F) -> Self
60258 where
60259 F: std::ops::FnOnce(
60260 types::builder::SendEvmTransactionBody,
60261 ) -> types::builder::SendEvmTransactionBody,
60262 {
60263 self.body = self.body.map(f);
60264 self
60265 }
60266 pub async fn send(
60268 self,
60269 ) -> Result<ResponseValue<types::SendEvmTransactionResponse>, Error<types::Error>> {
60270 let Self {
60271 client,
60272 address,
60273 x_idempotency_key,
60274 x_wallet_auth,
60275 body,
60276 } = self;
60277 let address = address.map_err(Error::InvalidRequest)?;
60278 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
60279 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
60280 let body = body
60281 .and_then(|v| types::SendEvmTransactionBody::try_from(v).map_err(|e| e.to_string()))
60282 .map_err(Error::InvalidRequest)?;
60283 let url = format!(
60284 "{}/v2/evm/accounts/{}/send/transaction",
60285 client.baseurl,
60286 encode_path(&address.to_string()),
60287 );
60288 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
60289 header_map.append(
60290 ::reqwest::header::HeaderName::from_static("api-version"),
60291 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
60292 );
60293 if let Some(value) = x_idempotency_key {
60294 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
60295 }
60296 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
60297 #[allow(unused_mut)]
60298 let mut request = client
60299 .client
60300 .post(url)
60301 .header(
60302 ::reqwest::header::ACCEPT,
60303 ::reqwest::header::HeaderValue::from_static("application/json"),
60304 )
60305 .json(&body)
60306 .headers(header_map)
60307 .build()?;
60308 let info = OperationInfo {
60309 operation_id: "send_evm_transaction",
60310 };
60311 client.pre(&mut request, &info).await?;
60312 let result = client.exec(request, &info).await;
60313 client.post(&result, &info).await?;
60314 let response = result?;
60315 match response.status().as_u16() {
60316 200u16 => ResponseValue::from_response(response).await,
60317 400u16 => Err(Error::ErrorResponse(
60318 ResponseValue::from_response(response).await?,
60319 )),
60320 401u16 => Err(Error::ErrorResponse(
60321 ResponseValue::from_response(response).await?,
60322 )),
60323 402u16 => Err(Error::ErrorResponse(
60324 ResponseValue::from_response(response).await?,
60325 )),
60326 403u16 => Err(Error::ErrorResponse(
60327 ResponseValue::from_response(response).await?,
60328 )),
60329 404u16 => Err(Error::ErrorResponse(
60330 ResponseValue::from_response(response).await?,
60331 )),
60332 409u16 => Err(Error::ErrorResponse(
60333 ResponseValue::from_response(response).await?,
60334 )),
60335 422u16 => Err(Error::ErrorResponse(
60336 ResponseValue::from_response(response).await?,
60337 )),
60338 500u16 => Err(Error::ErrorResponse(
60339 ResponseValue::from_response(response).await?,
60340 )),
60341 502u16 => Err(Error::ErrorResponse(
60342 ResponseValue::from_response(response).await?,
60343 )),
60344 503u16 => Err(Error::ErrorResponse(
60345 ResponseValue::from_response(response).await?,
60346 )),
60347 _ => Err(Error::UnexpectedResponse(response)),
60348 }
60349 }
60350 }
60351 #[derive(Debug, Clone)]
60355 pub struct SignEvmHash<'a> {
60356 client: &'a super::Client,
60357 address: Result<types::SignEvmHashAddress, String>,
60358 x_idempotency_key: Result<Option<types::SignEvmHashXIdempotencyKey>, String>,
60359 x_wallet_auth: Result<::std::string::String, String>,
60360 body: Result<types::builder::SignEvmHashBody, String>,
60361 }
60362 impl<'a> SignEvmHash<'a> {
60363 pub fn new(client: &'a super::Client) -> Self {
60364 Self {
60365 client: client,
60366 address: Err("address was not initialized".to_string()),
60367 x_idempotency_key: Ok(None),
60368 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
60369 body: Ok(::std::default::Default::default()),
60370 }
60371 }
60372 pub fn address<V>(mut self, value: V) -> Self
60373 where
60374 V: std::convert::TryInto<types::SignEvmHashAddress>,
60375 {
60376 self.address = value
60377 .try_into()
60378 .map_err(|_| "conversion to `SignEvmHashAddress` for address failed".to_string());
60379 self
60380 }
60381 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
60382 where
60383 V: std::convert::TryInto<types::SignEvmHashXIdempotencyKey>,
60384 {
60385 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
60386 "conversion to `SignEvmHashXIdempotencyKey` for x_idempotency_key failed"
60387 .to_string()
60388 });
60389 self
60390 }
60391 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
60392 where
60393 V: std::convert::TryInto<::std::string::String>,
60394 {
60395 self.x_wallet_auth = value.try_into().map_err(|_| {
60396 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
60397 });
60398 self
60399 }
60400 pub fn body<V>(mut self, value: V) -> Self
60401 where
60402 V: std::convert::TryInto<types::SignEvmHashBody>,
60403 <V as std::convert::TryInto<types::SignEvmHashBody>>::Error: std::fmt::Display,
60404 {
60405 self.body = value
60406 .try_into()
60407 .map(From::from)
60408 .map_err(|s| format!("conversion to `SignEvmHashBody` for body failed: {}", s));
60409 self
60410 }
60411 pub fn body_map<F>(mut self, f: F) -> Self
60412 where
60413 F: std::ops::FnOnce(types::builder::SignEvmHashBody) -> types::builder::SignEvmHashBody,
60414 {
60415 self.body = self.body.map(f);
60416 self
60417 }
60418 pub async fn send(
60420 self,
60421 ) -> Result<ResponseValue<types::SignEvmHashResponse>, Error<types::Error>> {
60422 let Self {
60423 client,
60424 address,
60425 x_idempotency_key,
60426 x_wallet_auth,
60427 body,
60428 } = self;
60429 let address = address.map_err(Error::InvalidRequest)?;
60430 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
60431 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
60432 let body = body
60433 .and_then(|v| types::SignEvmHashBody::try_from(v).map_err(|e| e.to_string()))
60434 .map_err(Error::InvalidRequest)?;
60435 let url = format!(
60436 "{}/v2/evm/accounts/{}/sign",
60437 client.baseurl,
60438 encode_path(&address.to_string()),
60439 );
60440 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
60441 header_map.append(
60442 ::reqwest::header::HeaderName::from_static("api-version"),
60443 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
60444 );
60445 if let Some(value) = x_idempotency_key {
60446 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
60447 }
60448 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
60449 #[allow(unused_mut)]
60450 let mut request = client
60451 .client
60452 .post(url)
60453 .header(
60454 ::reqwest::header::ACCEPT,
60455 ::reqwest::header::HeaderValue::from_static("application/json"),
60456 )
60457 .json(&body)
60458 .headers(header_map)
60459 .build()?;
60460 let info = OperationInfo {
60461 operation_id: "sign_evm_hash",
60462 };
60463 client.pre(&mut request, &info).await?;
60464 let result = client.exec(request, &info).await;
60465 client.post(&result, &info).await?;
60466 let response = result?;
60467 match response.status().as_u16() {
60468 200u16 => ResponseValue::from_response(response).await,
60469 400u16 => Err(Error::ErrorResponse(
60470 ResponseValue::from_response(response).await?,
60471 )),
60472 402u16 => Err(Error::ErrorResponse(
60473 ResponseValue::from_response(response).await?,
60474 )),
60475 404u16 => Err(Error::ErrorResponse(
60476 ResponseValue::from_response(response).await?,
60477 )),
60478 409u16 => Err(Error::ErrorResponse(
60479 ResponseValue::from_response(response).await?,
60480 )),
60481 422u16 => Err(Error::ErrorResponse(
60482 ResponseValue::from_response(response).await?,
60483 )),
60484 500u16 => Err(Error::ErrorResponse(
60485 ResponseValue::from_response(response).await?,
60486 )),
60487 502u16 => Err(Error::ErrorResponse(
60488 ResponseValue::from_response(response).await?,
60489 )),
60490 503u16 => Err(Error::ErrorResponse(
60491 ResponseValue::from_response(response).await?,
60492 )),
60493 _ => Err(Error::UnexpectedResponse(response)),
60494 }
60495 }
60496 }
60497 #[derive(Debug, Clone)]
60501 pub struct SignEvmMessage<'a> {
60502 client: &'a super::Client,
60503 address: Result<types::SignEvmMessageAddress, String>,
60504 x_idempotency_key: Result<Option<types::SignEvmMessageXIdempotencyKey>, String>,
60505 x_wallet_auth: Result<::std::string::String, String>,
60506 body: Result<types::builder::SignEvmMessageBody, String>,
60507 }
60508 impl<'a> SignEvmMessage<'a> {
60509 pub fn new(client: &'a super::Client) -> Self {
60510 Self {
60511 client: client,
60512 address: Err("address was not initialized".to_string()),
60513 x_idempotency_key: Ok(None),
60514 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
60515 body: Ok(::std::default::Default::default()),
60516 }
60517 }
60518 pub fn address<V>(mut self, value: V) -> Self
60519 where
60520 V: std::convert::TryInto<types::SignEvmMessageAddress>,
60521 {
60522 self.address = value.try_into().map_err(|_| {
60523 "conversion to `SignEvmMessageAddress` for address failed".to_string()
60524 });
60525 self
60526 }
60527 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
60528 where
60529 V: std::convert::TryInto<types::SignEvmMessageXIdempotencyKey>,
60530 {
60531 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
60532 "conversion to `SignEvmMessageXIdempotencyKey` for x_idempotency_key failed"
60533 .to_string()
60534 });
60535 self
60536 }
60537 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
60538 where
60539 V: std::convert::TryInto<::std::string::String>,
60540 {
60541 self.x_wallet_auth = value.try_into().map_err(|_| {
60542 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
60543 });
60544 self
60545 }
60546 pub fn body<V>(mut self, value: V) -> Self
60547 where
60548 V: std::convert::TryInto<types::SignEvmMessageBody>,
60549 <V as std::convert::TryInto<types::SignEvmMessageBody>>::Error: std::fmt::Display,
60550 {
60551 self.body = value
60552 .try_into()
60553 .map(From::from)
60554 .map_err(|s| format!("conversion to `SignEvmMessageBody` for body failed: {}", s));
60555 self
60556 }
60557 pub fn body_map<F>(mut self, f: F) -> Self
60558 where
60559 F: std::ops::FnOnce(
60560 types::builder::SignEvmMessageBody,
60561 ) -> types::builder::SignEvmMessageBody,
60562 {
60563 self.body = self.body.map(f);
60564 self
60565 }
60566 pub async fn send(
60568 self,
60569 ) -> Result<ResponseValue<types::SignEvmMessageResponse>, Error<types::Error>> {
60570 let Self {
60571 client,
60572 address,
60573 x_idempotency_key,
60574 x_wallet_auth,
60575 body,
60576 } = self;
60577 let address = address.map_err(Error::InvalidRequest)?;
60578 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
60579 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
60580 let body = body
60581 .and_then(|v| types::SignEvmMessageBody::try_from(v).map_err(|e| e.to_string()))
60582 .map_err(Error::InvalidRequest)?;
60583 let url = format!(
60584 "{}/v2/evm/accounts/{}/sign/message",
60585 client.baseurl,
60586 encode_path(&address.to_string()),
60587 );
60588 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
60589 header_map.append(
60590 ::reqwest::header::HeaderName::from_static("api-version"),
60591 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
60592 );
60593 if let Some(value) = x_idempotency_key {
60594 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
60595 }
60596 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
60597 #[allow(unused_mut)]
60598 let mut request = client
60599 .client
60600 .post(url)
60601 .header(
60602 ::reqwest::header::ACCEPT,
60603 ::reqwest::header::HeaderValue::from_static("application/json"),
60604 )
60605 .json(&body)
60606 .headers(header_map)
60607 .build()?;
60608 let info = OperationInfo {
60609 operation_id: "sign_evm_message",
60610 };
60611 client.pre(&mut request, &info).await?;
60612 let result = client.exec(request, &info).await;
60613 client.post(&result, &info).await?;
60614 let response = result?;
60615 match response.status().as_u16() {
60616 200u16 => ResponseValue::from_response(response).await,
60617 401u16 => Err(Error::ErrorResponse(
60618 ResponseValue::from_response(response).await?,
60619 )),
60620 402u16 => Err(Error::ErrorResponse(
60621 ResponseValue::from_response(response).await?,
60622 )),
60623 404u16 => Err(Error::ErrorResponse(
60624 ResponseValue::from_response(response).await?,
60625 )),
60626 409u16 => Err(Error::ErrorResponse(
60627 ResponseValue::from_response(response).await?,
60628 )),
60629 422u16 => Err(Error::ErrorResponse(
60630 ResponseValue::from_response(response).await?,
60631 )),
60632 500u16 => Err(Error::ErrorResponse(
60633 ResponseValue::from_response(response).await?,
60634 )),
60635 502u16 => Err(Error::ErrorResponse(
60636 ResponseValue::from_response(response).await?,
60637 )),
60638 503u16 => Err(Error::ErrorResponse(
60639 ResponseValue::from_response(response).await?,
60640 )),
60641 _ => Err(Error::UnexpectedResponse(response)),
60642 }
60643 }
60644 }
60645 #[derive(Debug, Clone)]
60649 pub struct SignEvmTransaction<'a> {
60650 client: &'a super::Client,
60651 address: Result<types::SignEvmTransactionAddress, String>,
60652 x_idempotency_key: Result<Option<types::SignEvmTransactionXIdempotencyKey>, String>,
60653 x_wallet_auth: Result<::std::string::String, String>,
60654 body: Result<types::builder::SignEvmTransactionBody, String>,
60655 }
60656 impl<'a> SignEvmTransaction<'a> {
60657 pub fn new(client: &'a super::Client) -> Self {
60658 Self {
60659 client: client,
60660 address: Err("address was not initialized".to_string()),
60661 x_idempotency_key: Ok(None),
60662 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
60663 body: Ok(::std::default::Default::default()),
60664 }
60665 }
60666 pub fn address<V>(mut self, value: V) -> Self
60667 where
60668 V: std::convert::TryInto<types::SignEvmTransactionAddress>,
60669 {
60670 self.address = value.try_into().map_err(|_| {
60671 "conversion to `SignEvmTransactionAddress` for address failed".to_string()
60672 });
60673 self
60674 }
60675 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
60676 where
60677 V: std::convert::TryInto<types::SignEvmTransactionXIdempotencyKey>,
60678 {
60679 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
60680 "conversion to `SignEvmTransactionXIdempotencyKey` for x_idempotency_key failed"
60681 .to_string()
60682 });
60683 self
60684 }
60685 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
60686 where
60687 V: std::convert::TryInto<::std::string::String>,
60688 {
60689 self.x_wallet_auth = value.try_into().map_err(|_| {
60690 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
60691 });
60692 self
60693 }
60694 pub fn body<V>(mut self, value: V) -> Self
60695 where
60696 V: std::convert::TryInto<types::SignEvmTransactionBody>,
60697 <V as std::convert::TryInto<types::SignEvmTransactionBody>>::Error: std::fmt::Display,
60698 {
60699 self.body = value.try_into().map(From::from).map_err(|s| {
60700 format!(
60701 "conversion to `SignEvmTransactionBody` for body failed: {}",
60702 s
60703 )
60704 });
60705 self
60706 }
60707 pub fn body_map<F>(mut self, f: F) -> Self
60708 where
60709 F: std::ops::FnOnce(
60710 types::builder::SignEvmTransactionBody,
60711 ) -> types::builder::SignEvmTransactionBody,
60712 {
60713 self.body = self.body.map(f);
60714 self
60715 }
60716 pub async fn send(
60718 self,
60719 ) -> Result<ResponseValue<types::SignEvmTransactionResponse>, Error<types::Error>> {
60720 let Self {
60721 client,
60722 address,
60723 x_idempotency_key,
60724 x_wallet_auth,
60725 body,
60726 } = self;
60727 let address = address.map_err(Error::InvalidRequest)?;
60728 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
60729 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
60730 let body = body
60731 .and_then(|v| types::SignEvmTransactionBody::try_from(v).map_err(|e| e.to_string()))
60732 .map_err(Error::InvalidRequest)?;
60733 let url = format!(
60734 "{}/v2/evm/accounts/{}/sign/transaction",
60735 client.baseurl,
60736 encode_path(&address.to_string()),
60737 );
60738 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
60739 header_map.append(
60740 ::reqwest::header::HeaderName::from_static("api-version"),
60741 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
60742 );
60743 if let Some(value) = x_idempotency_key {
60744 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
60745 }
60746 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
60747 #[allow(unused_mut)]
60748 let mut request = client
60749 .client
60750 .post(url)
60751 .header(
60752 ::reqwest::header::ACCEPT,
60753 ::reqwest::header::HeaderValue::from_static("application/json"),
60754 )
60755 .json(&body)
60756 .headers(header_map)
60757 .build()?;
60758 let info = OperationInfo {
60759 operation_id: "sign_evm_transaction",
60760 };
60761 client.pre(&mut request, &info).await?;
60762 let result = client.exec(request, &info).await;
60763 client.post(&result, &info).await?;
60764 let response = result?;
60765 match response.status().as_u16() {
60766 200u16 => ResponseValue::from_response(response).await,
60767 400u16 => Err(Error::ErrorResponse(
60768 ResponseValue::from_response(response).await?,
60769 )),
60770 401u16 => Err(Error::ErrorResponse(
60771 ResponseValue::from_response(response).await?,
60772 )),
60773 402u16 => Err(Error::ErrorResponse(
60774 ResponseValue::from_response(response).await?,
60775 )),
60776 403u16 => Err(Error::ErrorResponse(
60777 ResponseValue::from_response(response).await?,
60778 )),
60779 404u16 => Err(Error::ErrorResponse(
60780 ResponseValue::from_response(response).await?,
60781 )),
60782 409u16 => Err(Error::ErrorResponse(
60783 ResponseValue::from_response(response).await?,
60784 )),
60785 422u16 => Err(Error::ErrorResponse(
60786 ResponseValue::from_response(response).await?,
60787 )),
60788 500u16 => Err(Error::ErrorResponse(
60789 ResponseValue::from_response(response).await?,
60790 )),
60791 502u16 => Err(Error::ErrorResponse(
60792 ResponseValue::from_response(response).await?,
60793 )),
60794 503u16 => Err(Error::ErrorResponse(
60795 ResponseValue::from_response(response).await?,
60796 )),
60797 _ => Err(Error::UnexpectedResponse(response)),
60798 }
60799 }
60800 }
60801 #[derive(Debug, Clone)]
60805 pub struct SignEvmTypedData<'a> {
60806 client: &'a super::Client,
60807 address: Result<types::SignEvmTypedDataAddress, String>,
60808 x_idempotency_key: Result<Option<types::SignEvmTypedDataXIdempotencyKey>, String>,
60809 x_wallet_auth: Result<::std::string::String, String>,
60810 body: Result<types::builder::Eip712Message, String>,
60811 }
60812 impl<'a> SignEvmTypedData<'a> {
60813 pub fn new(client: &'a super::Client) -> Self {
60814 Self {
60815 client: client,
60816 address: Err("address was not initialized".to_string()),
60817 x_idempotency_key: Ok(None),
60818 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
60819 body: Ok(::std::default::Default::default()),
60820 }
60821 }
60822 pub fn address<V>(mut self, value: V) -> Self
60823 where
60824 V: std::convert::TryInto<types::SignEvmTypedDataAddress>,
60825 {
60826 self.address = value.try_into().map_err(|_| {
60827 "conversion to `SignEvmTypedDataAddress` for address failed".to_string()
60828 });
60829 self
60830 }
60831 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
60832 where
60833 V: std::convert::TryInto<types::SignEvmTypedDataXIdempotencyKey>,
60834 {
60835 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
60836 "conversion to `SignEvmTypedDataXIdempotencyKey` for x_idempotency_key failed"
60837 .to_string()
60838 });
60839 self
60840 }
60841 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
60842 where
60843 V: std::convert::TryInto<::std::string::String>,
60844 {
60845 self.x_wallet_auth = value.try_into().map_err(|_| {
60846 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
60847 });
60848 self
60849 }
60850 pub fn body<V>(mut self, value: V) -> Self
60851 where
60852 V: std::convert::TryInto<types::Eip712Message>,
60853 <V as std::convert::TryInto<types::Eip712Message>>::Error: std::fmt::Display,
60854 {
60855 self.body = value
60856 .try_into()
60857 .map(From::from)
60858 .map_err(|s| format!("conversion to `Eip712Message` for body failed: {}", s));
60859 self
60860 }
60861 pub fn body_map<F>(mut self, f: F) -> Self
60862 where
60863 F: std::ops::FnOnce(types::builder::Eip712Message) -> types::builder::Eip712Message,
60864 {
60865 self.body = self.body.map(f);
60866 self
60867 }
60868 pub async fn send(
60870 self,
60871 ) -> Result<ResponseValue<types::SignEvmTypedDataResponse>, Error<types::Error>> {
60872 let Self {
60873 client,
60874 address,
60875 x_idempotency_key,
60876 x_wallet_auth,
60877 body,
60878 } = self;
60879 let address = address.map_err(Error::InvalidRequest)?;
60880 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
60881 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
60882 let body = body
60883 .and_then(|v| types::Eip712Message::try_from(v).map_err(|e| e.to_string()))
60884 .map_err(Error::InvalidRequest)?;
60885 let url = format!(
60886 "{}/v2/evm/accounts/{}/sign/typed-data",
60887 client.baseurl,
60888 encode_path(&address.to_string()),
60889 );
60890 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
60891 header_map.append(
60892 ::reqwest::header::HeaderName::from_static("api-version"),
60893 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
60894 );
60895 if let Some(value) = x_idempotency_key {
60896 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
60897 }
60898 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
60899 #[allow(unused_mut)]
60900 let mut request = client
60901 .client
60902 .post(url)
60903 .header(
60904 ::reqwest::header::ACCEPT,
60905 ::reqwest::header::HeaderValue::from_static("application/json"),
60906 )
60907 .json(&body)
60908 .headers(header_map)
60909 .build()?;
60910 let info = OperationInfo {
60911 operation_id: "sign_evm_typed_data",
60912 };
60913 client.pre(&mut request, &info).await?;
60914 let result = client.exec(request, &info).await;
60915 client.post(&result, &info).await?;
60916 let response = result?;
60917 match response.status().as_u16() {
60918 200u16 => ResponseValue::from_response(response).await,
60919 400u16 => Err(Error::ErrorResponse(
60920 ResponseValue::from_response(response).await?,
60921 )),
60922 401u16 => Err(Error::ErrorResponse(
60923 ResponseValue::from_response(response).await?,
60924 )),
60925 402u16 => Err(Error::ErrorResponse(
60926 ResponseValue::from_response(response).await?,
60927 )),
60928 404u16 => Err(Error::ErrorResponse(
60929 ResponseValue::from_response(response).await?,
60930 )),
60931 422u16 => Err(Error::ErrorResponse(
60932 ResponseValue::from_response(response).await?,
60933 )),
60934 500u16 => Err(Error::ErrorResponse(
60935 ResponseValue::from_response(response).await?,
60936 )),
60937 502u16 => Err(Error::ErrorResponse(
60938 ResponseValue::from_response(response).await?,
60939 )),
60940 503u16 => Err(Error::ErrorResponse(
60941 ResponseValue::from_response(response).await?,
60942 )),
60943 _ => Err(Error::UnexpectedResponse(response)),
60944 }
60945 }
60946 }
60947 #[derive(Debug, Clone)]
60951 pub struct RequestEvmFaucet<'a> {
60952 client: &'a super::Client,
60953 body: Result<types::builder::RequestEvmFaucetBody, String>,
60954 }
60955 impl<'a> RequestEvmFaucet<'a> {
60956 pub fn new(client: &'a super::Client) -> Self {
60957 Self {
60958 client: client,
60959 body: Ok(::std::default::Default::default()),
60960 }
60961 }
60962 pub fn body<V>(mut self, value: V) -> Self
60963 where
60964 V: std::convert::TryInto<types::RequestEvmFaucetBody>,
60965 <V as std::convert::TryInto<types::RequestEvmFaucetBody>>::Error: std::fmt::Display,
60966 {
60967 self.body = value.try_into().map(From::from).map_err(|s| {
60968 format!(
60969 "conversion to `RequestEvmFaucetBody` for body failed: {}",
60970 s
60971 )
60972 });
60973 self
60974 }
60975 pub fn body_map<F>(mut self, f: F) -> Self
60976 where
60977 F: std::ops::FnOnce(
60978 types::builder::RequestEvmFaucetBody,
60979 ) -> types::builder::RequestEvmFaucetBody,
60980 {
60981 self.body = self.body.map(f);
60982 self
60983 }
60984 pub async fn send(
60986 self,
60987 ) -> Result<ResponseValue<types::RequestEvmFaucetResponse>, Error<types::Error>> {
60988 let Self { client, body } = self;
60989 let body = body
60990 .and_then(|v| types::RequestEvmFaucetBody::try_from(v).map_err(|e| e.to_string()))
60991 .map_err(Error::InvalidRequest)?;
60992 let url = format!("{}/v2/evm/faucet", client.baseurl,);
60993 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
60994 header_map.append(
60995 ::reqwest::header::HeaderName::from_static("api-version"),
60996 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
60997 );
60998 #[allow(unused_mut)]
60999 let mut request = client
61000 .client
61001 .post(url)
61002 .header(
61003 ::reqwest::header::ACCEPT,
61004 ::reqwest::header::HeaderValue::from_static("application/json"),
61005 )
61006 .json(&body)
61007 .headers(header_map)
61008 .build()?;
61009 let info = OperationInfo {
61010 operation_id: "request_evm_faucet",
61011 };
61012 client.pre(&mut request, &info).await?;
61013 let result = client.exec(request, &info).await;
61014 client.post(&result, &info).await?;
61015 let response = result?;
61016 match response.status().as_u16() {
61017 200u16 => ResponseValue::from_response(response).await,
61018 400u16 => Err(Error::ErrorResponse(
61019 ResponseValue::from_response(response).await?,
61020 )),
61021 403u16 => Err(Error::ErrorResponse(
61022 ResponseValue::from_response(response).await?,
61023 )),
61024 429u16 => Err(Error::ErrorResponse(
61025 ResponseValue::from_response(response).await?,
61026 )),
61027 500u16 => Err(Error::ErrorResponse(
61028 ResponseValue::from_response(response).await?,
61029 )),
61030 502u16 => Err(Error::ErrorResponse(
61031 ResponseValue::from_response(response).await?,
61032 )),
61033 503u16 => Err(Error::ErrorResponse(
61034 ResponseValue::from_response(response).await?,
61035 )),
61036 _ => Err(Error::UnexpectedResponse(response)),
61037 }
61038 }
61039 }
61040 #[derive(Debug, Clone)]
61044 pub struct ListEvmSmartAccounts<'a> {
61045 client: &'a super::Client,
61046 page_size: Result<Option<i64>, String>,
61047 page_token: Result<Option<::std::string::String>, String>,
61048 }
61049 impl<'a> ListEvmSmartAccounts<'a> {
61050 pub fn new(client: &'a super::Client) -> Self {
61051 Self {
61052 client: client,
61053 page_size: Ok(None),
61054 page_token: Ok(None),
61055 }
61056 }
61057 pub fn page_size<V>(mut self, value: V) -> Self
61058 where
61059 V: std::convert::TryInto<i64>,
61060 {
61061 self.page_size = value
61062 .try_into()
61063 .map(Some)
61064 .map_err(|_| "conversion to `i64` for page_size failed".to_string());
61065 self
61066 }
61067 pub fn page_token<V>(mut self, value: V) -> Self
61068 where
61069 V: std::convert::TryInto<::std::string::String>,
61070 {
61071 self.page_token = value.try_into().map(Some).map_err(|_| {
61072 "conversion to `:: std :: string :: String` for page_token failed".to_string()
61073 });
61074 self
61075 }
61076 pub async fn send(
61078 self,
61079 ) -> Result<ResponseValue<types::ListEvmSmartAccountsResponse>, Error<types::Error>>
61080 {
61081 let Self {
61082 client,
61083 page_size,
61084 page_token,
61085 } = self;
61086 let page_size = page_size.map_err(Error::InvalidRequest)?;
61087 let page_token = page_token.map_err(Error::InvalidRequest)?;
61088 let url = format!("{}/v2/evm/smart-accounts", client.baseurl,);
61089 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
61090 header_map.append(
61091 ::reqwest::header::HeaderName::from_static("api-version"),
61092 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
61093 );
61094 #[allow(unused_mut)]
61095 let mut request = client
61096 .client
61097 .get(url)
61098 .header(
61099 ::reqwest::header::ACCEPT,
61100 ::reqwest::header::HeaderValue::from_static("application/json"),
61101 )
61102 .query(&progenitor_middleware_client::QueryParam::new(
61103 "pageSize", &page_size,
61104 ))
61105 .query(&progenitor_middleware_client::QueryParam::new(
61106 "pageToken",
61107 &page_token,
61108 ))
61109 .headers(header_map)
61110 .build()?;
61111 let info = OperationInfo {
61112 operation_id: "list_evm_smart_accounts",
61113 };
61114 client.pre(&mut request, &info).await?;
61115 let result = client.exec(request, &info).await;
61116 client.post(&result, &info).await?;
61117 let response = result?;
61118 match response.status().as_u16() {
61119 200u16 => ResponseValue::from_response(response).await,
61120 400u16 => Err(Error::ErrorResponse(
61121 ResponseValue::from_response(response).await?,
61122 )),
61123 500u16 => Err(Error::ErrorResponse(
61124 ResponseValue::from_response(response).await?,
61125 )),
61126 502u16 => Err(Error::ErrorResponse(
61127 ResponseValue::from_response(response).await?,
61128 )),
61129 503u16 => Err(Error::ErrorResponse(
61130 ResponseValue::from_response(response).await?,
61131 )),
61132 _ => Err(Error::UnexpectedResponse(response)),
61133 }
61134 }
61135 }
61136 #[derive(Debug, Clone)]
61140 pub struct CreateEvmSmartAccount<'a> {
61141 client: &'a super::Client,
61142 x_idempotency_key: Result<Option<types::CreateEvmSmartAccountXIdempotencyKey>, String>,
61143 body: Result<types::builder::CreateEvmSmartAccountBody, String>,
61144 }
61145 impl<'a> CreateEvmSmartAccount<'a> {
61146 pub fn new(client: &'a super::Client) -> Self {
61147 Self {
61148 client: client,
61149 x_idempotency_key: Ok(None),
61150 body: Ok(::std::default::Default::default()),
61151 }
61152 }
61153 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
61154 where
61155 V: std::convert::TryInto<types::CreateEvmSmartAccountXIdempotencyKey>,
61156 {
61157 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
61158 "conversion to `CreateEvmSmartAccountXIdempotencyKey` for x_idempotency_key failed"
61159 .to_string()
61160 });
61161 self
61162 }
61163 pub fn body<V>(mut self, value: V) -> Self
61164 where
61165 V: std::convert::TryInto<types::CreateEvmSmartAccountBody>,
61166 <V as std::convert::TryInto<types::CreateEvmSmartAccountBody>>::Error:
61167 std::fmt::Display,
61168 {
61169 self.body = value.try_into().map(From::from).map_err(|s| {
61170 format!(
61171 "conversion to `CreateEvmSmartAccountBody` for body failed: {}",
61172 s
61173 )
61174 });
61175 self
61176 }
61177 pub fn body_map<F>(mut self, f: F) -> Self
61178 where
61179 F: std::ops::FnOnce(
61180 types::builder::CreateEvmSmartAccountBody,
61181 ) -> types::builder::CreateEvmSmartAccountBody,
61182 {
61183 self.body = self.body.map(f);
61184 self
61185 }
61186 pub async fn send(
61188 self,
61189 ) -> Result<ResponseValue<types::EvmSmartAccount>, Error<types::Error>> {
61190 let Self {
61191 client,
61192 x_idempotency_key,
61193 body,
61194 } = self;
61195 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
61196 let body = body
61197 .and_then(|v| {
61198 types::CreateEvmSmartAccountBody::try_from(v).map_err(|e| e.to_string())
61199 })
61200 .map_err(Error::InvalidRequest)?;
61201 let url = format!("{}/v2/evm/smart-accounts", client.baseurl,);
61202 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
61203 header_map.append(
61204 ::reqwest::header::HeaderName::from_static("api-version"),
61205 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
61206 );
61207 if let Some(value) = x_idempotency_key {
61208 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
61209 }
61210 #[allow(unused_mut)]
61211 let mut request = client
61212 .client
61213 .post(url)
61214 .header(
61215 ::reqwest::header::ACCEPT,
61216 ::reqwest::header::HeaderValue::from_static("application/json"),
61217 )
61218 .json(&body)
61219 .headers(header_map)
61220 .build()?;
61221 let info = OperationInfo {
61222 operation_id: "create_evm_smart_account",
61223 };
61224 client.pre(&mut request, &info).await?;
61225 let result = client.exec(request, &info).await;
61226 client.post(&result, &info).await?;
61227 let response = result?;
61228 match response.status().as_u16() {
61229 201u16 => ResponseValue::from_response(response).await,
61230 400u16 => Err(Error::ErrorResponse(
61231 ResponseValue::from_response(response).await?,
61232 )),
61233 402u16 => Err(Error::ErrorResponse(
61234 ResponseValue::from_response(response).await?,
61235 )),
61236 500u16 => Err(Error::ErrorResponse(
61237 ResponseValue::from_response(response).await?,
61238 )),
61239 502u16 => Err(Error::ErrorResponse(
61240 ResponseValue::from_response(response).await?,
61241 )),
61242 503u16 => Err(Error::ErrorResponse(
61243 ResponseValue::from_response(response).await?,
61244 )),
61245 _ => Err(Error::UnexpectedResponse(response)),
61246 }
61247 }
61248 }
61249 #[derive(Debug, Clone)]
61253 pub struct GetEvmSmartAccountByName<'a> {
61254 client: &'a super::Client,
61255 name: Result<::std::string::String, String>,
61256 }
61257 impl<'a> GetEvmSmartAccountByName<'a> {
61258 pub fn new(client: &'a super::Client) -> Self {
61259 Self {
61260 client: client,
61261 name: Err("name was not initialized".to_string()),
61262 }
61263 }
61264 pub fn name<V>(mut self, value: V) -> Self
61265 where
61266 V: std::convert::TryInto<::std::string::String>,
61267 {
61268 self.name = value.try_into().map_err(|_| {
61269 "conversion to `:: std :: string :: String` for name failed".to_string()
61270 });
61271 self
61272 }
61273 pub async fn send(
61275 self,
61276 ) -> Result<ResponseValue<types::EvmSmartAccount>, Error<types::Error>> {
61277 let Self { client, name } = self;
61278 let name = name.map_err(Error::InvalidRequest)?;
61279 let url = format!(
61280 "{}/v2/evm/smart-accounts/by-name/{}",
61281 client.baseurl,
61282 encode_path(&name.to_string()),
61283 );
61284 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
61285 header_map.append(
61286 ::reqwest::header::HeaderName::from_static("api-version"),
61287 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
61288 );
61289 #[allow(unused_mut)]
61290 let mut request = client
61291 .client
61292 .get(url)
61293 .header(
61294 ::reqwest::header::ACCEPT,
61295 ::reqwest::header::HeaderValue::from_static("application/json"),
61296 )
61297 .headers(header_map)
61298 .build()?;
61299 let info = OperationInfo {
61300 operation_id: "get_evm_smart_account_by_name",
61301 };
61302 client.pre(&mut request, &info).await?;
61303 let result = client.exec(request, &info).await;
61304 client.post(&result, &info).await?;
61305 let response = result?;
61306 match response.status().as_u16() {
61307 200u16 => ResponseValue::from_response(response).await,
61308 400u16 => Err(Error::ErrorResponse(
61309 ResponseValue::from_response(response).await?,
61310 )),
61311 404u16 => Err(Error::ErrorResponse(
61312 ResponseValue::from_response(response).await?,
61313 )),
61314 500u16 => Err(Error::ErrorResponse(
61315 ResponseValue::from_response(response).await?,
61316 )),
61317 502u16 => Err(Error::ErrorResponse(
61318 ResponseValue::from_response(response).await?,
61319 )),
61320 503u16 => Err(Error::ErrorResponse(
61321 ResponseValue::from_response(response).await?,
61322 )),
61323 _ => Err(Error::UnexpectedResponse(response)),
61324 }
61325 }
61326 }
61327 #[derive(Debug, Clone)]
61331 pub struct GetEvmSmartAccount<'a> {
61332 client: &'a super::Client,
61333 address: Result<types::GetEvmSmartAccountAddress, String>,
61334 }
61335 impl<'a> GetEvmSmartAccount<'a> {
61336 pub fn new(client: &'a super::Client) -> Self {
61337 Self {
61338 client: client,
61339 address: Err("address was not initialized".to_string()),
61340 }
61341 }
61342 pub fn address<V>(mut self, value: V) -> Self
61343 where
61344 V: std::convert::TryInto<types::GetEvmSmartAccountAddress>,
61345 {
61346 self.address = value.try_into().map_err(|_| {
61347 "conversion to `GetEvmSmartAccountAddress` for address failed".to_string()
61348 });
61349 self
61350 }
61351 pub async fn send(
61353 self,
61354 ) -> Result<ResponseValue<types::EvmSmartAccount>, Error<types::Error>> {
61355 let Self { client, address } = self;
61356 let address = address.map_err(Error::InvalidRequest)?;
61357 let url = format!(
61358 "{}/v2/evm/smart-accounts/{}",
61359 client.baseurl,
61360 encode_path(&address.to_string()),
61361 );
61362 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
61363 header_map.append(
61364 ::reqwest::header::HeaderName::from_static("api-version"),
61365 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
61366 );
61367 #[allow(unused_mut)]
61368 let mut request = client
61369 .client
61370 .get(url)
61371 .header(
61372 ::reqwest::header::ACCEPT,
61373 ::reqwest::header::HeaderValue::from_static("application/json"),
61374 )
61375 .headers(header_map)
61376 .build()?;
61377 let info = OperationInfo {
61378 operation_id: "get_evm_smart_account",
61379 };
61380 client.pre(&mut request, &info).await?;
61381 let result = client.exec(request, &info).await;
61382 client.post(&result, &info).await?;
61383 let response = result?;
61384 match response.status().as_u16() {
61385 200u16 => ResponseValue::from_response(response).await,
61386 400u16 => Err(Error::ErrorResponse(
61387 ResponseValue::from_response(response).await?,
61388 )),
61389 404u16 => Err(Error::ErrorResponse(
61390 ResponseValue::from_response(response).await?,
61391 )),
61392 500u16 => Err(Error::ErrorResponse(
61393 ResponseValue::from_response(response).await?,
61394 )),
61395 502u16 => Err(Error::ErrorResponse(
61396 ResponseValue::from_response(response).await?,
61397 )),
61398 503u16 => Err(Error::ErrorResponse(
61399 ResponseValue::from_response(response).await?,
61400 )),
61401 _ => Err(Error::UnexpectedResponse(response)),
61402 }
61403 }
61404 }
61405 #[derive(Debug, Clone)]
61409 pub struct UpdateEvmSmartAccount<'a> {
61410 client: &'a super::Client,
61411 address: Result<types::UpdateEvmSmartAccountAddress, String>,
61412 body: Result<types::builder::UpdateEvmSmartAccountBody, String>,
61413 }
61414 impl<'a> UpdateEvmSmartAccount<'a> {
61415 pub fn new(client: &'a super::Client) -> Self {
61416 Self {
61417 client: client,
61418 address: Err("address was not initialized".to_string()),
61419 body: Ok(::std::default::Default::default()),
61420 }
61421 }
61422 pub fn address<V>(mut self, value: V) -> Self
61423 where
61424 V: std::convert::TryInto<types::UpdateEvmSmartAccountAddress>,
61425 {
61426 self.address = value.try_into().map_err(|_| {
61427 "conversion to `UpdateEvmSmartAccountAddress` for address failed".to_string()
61428 });
61429 self
61430 }
61431 pub fn body<V>(mut self, value: V) -> Self
61432 where
61433 V: std::convert::TryInto<types::UpdateEvmSmartAccountBody>,
61434 <V as std::convert::TryInto<types::UpdateEvmSmartAccountBody>>::Error:
61435 std::fmt::Display,
61436 {
61437 self.body = value.try_into().map(From::from).map_err(|s| {
61438 format!(
61439 "conversion to `UpdateEvmSmartAccountBody` for body failed: {}",
61440 s
61441 )
61442 });
61443 self
61444 }
61445 pub fn body_map<F>(mut self, f: F) -> Self
61446 where
61447 F: std::ops::FnOnce(
61448 types::builder::UpdateEvmSmartAccountBody,
61449 ) -> types::builder::UpdateEvmSmartAccountBody,
61450 {
61451 self.body = self.body.map(f);
61452 self
61453 }
61454 pub async fn send(
61456 self,
61457 ) -> Result<ResponseValue<types::EvmSmartAccount>, Error<types::Error>> {
61458 let Self {
61459 client,
61460 address,
61461 body,
61462 } = self;
61463 let address = address.map_err(Error::InvalidRequest)?;
61464 let body = body
61465 .and_then(|v| {
61466 types::UpdateEvmSmartAccountBody::try_from(v).map_err(|e| e.to_string())
61467 })
61468 .map_err(Error::InvalidRequest)?;
61469 let url = format!(
61470 "{}/v2/evm/smart-accounts/{}",
61471 client.baseurl,
61472 encode_path(&address.to_string()),
61473 );
61474 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
61475 header_map.append(
61476 ::reqwest::header::HeaderName::from_static("api-version"),
61477 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
61478 );
61479 #[allow(unused_mut)]
61480 let mut request = client
61481 .client
61482 .put(url)
61483 .header(
61484 ::reqwest::header::ACCEPT,
61485 ::reqwest::header::HeaderValue::from_static("application/json"),
61486 )
61487 .json(&body)
61488 .headers(header_map)
61489 .build()?;
61490 let info = OperationInfo {
61491 operation_id: "update_evm_smart_account",
61492 };
61493 client.pre(&mut request, &info).await?;
61494 let result = client.exec(request, &info).await;
61495 client.post(&result, &info).await?;
61496 let response = result?;
61497 match response.status().as_u16() {
61498 200u16 => ResponseValue::from_response(response).await,
61499 400u16 => Err(Error::ErrorResponse(
61500 ResponseValue::from_response(response).await?,
61501 )),
61502 404u16 => Err(Error::ErrorResponse(
61503 ResponseValue::from_response(response).await?,
61504 )),
61505 409u16 => Err(Error::ErrorResponse(
61506 ResponseValue::from_response(response).await?,
61507 )),
61508 422u16 => Err(Error::ErrorResponse(
61509 ResponseValue::from_response(response).await?,
61510 )),
61511 500u16 => Err(Error::ErrorResponse(
61512 ResponseValue::from_response(response).await?,
61513 )),
61514 502u16 => Err(Error::ErrorResponse(
61515 ResponseValue::from_response(response).await?,
61516 )),
61517 503u16 => Err(Error::ErrorResponse(
61518 ResponseValue::from_response(response).await?,
61519 )),
61520 _ => Err(Error::UnexpectedResponse(response)),
61521 }
61522 }
61523 }
61524 #[derive(Debug, Clone)]
61528 pub struct CreateSpendPermission<'a> {
61529 client: &'a super::Client,
61530 address: Result<types::CreateSpendPermissionAddress, String>,
61531 x_idempotency_key: Result<Option<types::CreateSpendPermissionXIdempotencyKey>, String>,
61532 x_wallet_auth: Result<::std::string::String, String>,
61533 body: Result<types::builder::CreateSpendPermissionRequest, String>,
61534 }
61535 impl<'a> CreateSpendPermission<'a> {
61536 pub fn new(client: &'a super::Client) -> Self {
61537 Self {
61538 client: client,
61539 address: Err("address was not initialized".to_string()),
61540 x_idempotency_key: Ok(None),
61541 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
61542 body: Ok(::std::default::Default::default()),
61543 }
61544 }
61545 pub fn address<V>(mut self, value: V) -> Self
61546 where
61547 V: std::convert::TryInto<types::CreateSpendPermissionAddress>,
61548 {
61549 self.address = value.try_into().map_err(|_| {
61550 "conversion to `CreateSpendPermissionAddress` for address failed".to_string()
61551 });
61552 self
61553 }
61554 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
61555 where
61556 V: std::convert::TryInto<types::CreateSpendPermissionXIdempotencyKey>,
61557 {
61558 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
61559 "conversion to `CreateSpendPermissionXIdempotencyKey` for x_idempotency_key failed"
61560 .to_string()
61561 });
61562 self
61563 }
61564 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
61565 where
61566 V: std::convert::TryInto<::std::string::String>,
61567 {
61568 self.x_wallet_auth = value.try_into().map_err(|_| {
61569 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
61570 });
61571 self
61572 }
61573 pub fn body<V>(mut self, value: V) -> Self
61574 where
61575 V: std::convert::TryInto<types::CreateSpendPermissionRequest>,
61576 <V as std::convert::TryInto<types::CreateSpendPermissionRequest>>::Error:
61577 std::fmt::Display,
61578 {
61579 self.body = value.try_into().map(From::from).map_err(|s| {
61580 format!(
61581 "conversion to `CreateSpendPermissionRequest` for body failed: {}",
61582 s
61583 )
61584 });
61585 self
61586 }
61587 pub fn body_map<F>(mut self, f: F) -> Self
61588 where
61589 F: std::ops::FnOnce(
61590 types::builder::CreateSpendPermissionRequest,
61591 ) -> types::builder::CreateSpendPermissionRequest,
61592 {
61593 self.body = self.body.map(f);
61594 self
61595 }
61596 pub async fn send(
61598 self,
61599 ) -> Result<ResponseValue<types::EvmUserOperation>, Error<types::Error>> {
61600 let Self {
61601 client,
61602 address,
61603 x_idempotency_key,
61604 x_wallet_auth,
61605 body,
61606 } = self;
61607 let address = address.map_err(Error::InvalidRequest)?;
61608 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
61609 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
61610 let body = body
61611 .and_then(|v| {
61612 types::CreateSpendPermissionRequest::try_from(v).map_err(|e| e.to_string())
61613 })
61614 .map_err(Error::InvalidRequest)?;
61615 let url = format!(
61616 "{}/v2/evm/smart-accounts/{}/spend-permissions",
61617 client.baseurl,
61618 encode_path(&address.to_string()),
61619 );
61620 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
61621 header_map.append(
61622 ::reqwest::header::HeaderName::from_static("api-version"),
61623 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
61624 );
61625 if let Some(value) = x_idempotency_key {
61626 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
61627 }
61628 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
61629 #[allow(unused_mut)]
61630 let mut request = client
61631 .client
61632 .post(url)
61633 .header(
61634 ::reqwest::header::ACCEPT,
61635 ::reqwest::header::HeaderValue::from_static("application/json"),
61636 )
61637 .json(&body)
61638 .headers(header_map)
61639 .build()?;
61640 let info = OperationInfo {
61641 operation_id: "create_spend_permission",
61642 };
61643 client.pre(&mut request, &info).await?;
61644 let result = client.exec(request, &info).await;
61645 client.post(&result, &info).await?;
61646 let response = result?;
61647 match response.status().as_u16() {
61648 200u16 => ResponseValue::from_response(response).await,
61649 400u16 => Err(Error::ErrorResponse(
61650 ResponseValue::from_response(response).await?,
61651 )),
61652 404u16 => Err(Error::ErrorResponse(
61653 ResponseValue::from_response(response).await?,
61654 )),
61655 500u16 => Err(Error::ErrorResponse(
61656 ResponseValue::from_response(response).await?,
61657 )),
61658 502u16 => Err(Error::ErrorResponse(
61659 ResponseValue::from_response(response).await?,
61660 )),
61661 503u16 => Err(Error::ErrorResponse(
61662 ResponseValue::from_response(response).await?,
61663 )),
61664 _ => Err(Error::UnexpectedResponse(response)),
61665 }
61666 }
61667 }
61668 #[derive(Debug, Clone)]
61672 pub struct ListSpendPermissions<'a> {
61673 client: &'a super::Client,
61674 address: Result<types::ListSpendPermissionsAddress, String>,
61675 page_size: Result<Option<i64>, String>,
61676 page_token: Result<Option<::std::string::String>, String>,
61677 }
61678 impl<'a> ListSpendPermissions<'a> {
61679 pub fn new(client: &'a super::Client) -> Self {
61680 Self {
61681 client: client,
61682 address: Err("address was not initialized".to_string()),
61683 page_size: Ok(None),
61684 page_token: Ok(None),
61685 }
61686 }
61687 pub fn address<V>(mut self, value: V) -> Self
61688 where
61689 V: std::convert::TryInto<types::ListSpendPermissionsAddress>,
61690 {
61691 self.address = value.try_into().map_err(|_| {
61692 "conversion to `ListSpendPermissionsAddress` for address failed".to_string()
61693 });
61694 self
61695 }
61696 pub fn page_size<V>(mut self, value: V) -> Self
61697 where
61698 V: std::convert::TryInto<i64>,
61699 {
61700 self.page_size = value
61701 .try_into()
61702 .map(Some)
61703 .map_err(|_| "conversion to `i64` for page_size failed".to_string());
61704 self
61705 }
61706 pub fn page_token<V>(mut self, value: V) -> Self
61707 where
61708 V: std::convert::TryInto<::std::string::String>,
61709 {
61710 self.page_token = value.try_into().map(Some).map_err(|_| {
61711 "conversion to `:: std :: string :: String` for page_token failed".to_string()
61712 });
61713 self
61714 }
61715 pub async fn send(
61717 self,
61718 ) -> Result<ResponseValue<types::ListSpendPermissionsResponse>, Error<types::Error>>
61719 {
61720 let Self {
61721 client,
61722 address,
61723 page_size,
61724 page_token,
61725 } = self;
61726 let address = address.map_err(Error::InvalidRequest)?;
61727 let page_size = page_size.map_err(Error::InvalidRequest)?;
61728 let page_token = page_token.map_err(Error::InvalidRequest)?;
61729 let url = format!(
61730 "{}/v2/evm/smart-accounts/{}/spend-permissions/list",
61731 client.baseurl,
61732 encode_path(&address.to_string()),
61733 );
61734 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
61735 header_map.append(
61736 ::reqwest::header::HeaderName::from_static("api-version"),
61737 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
61738 );
61739 #[allow(unused_mut)]
61740 let mut request = client
61741 .client
61742 .get(url)
61743 .header(
61744 ::reqwest::header::ACCEPT,
61745 ::reqwest::header::HeaderValue::from_static("application/json"),
61746 )
61747 .query(&progenitor_middleware_client::QueryParam::new(
61748 "pageSize", &page_size,
61749 ))
61750 .query(&progenitor_middleware_client::QueryParam::new(
61751 "pageToken",
61752 &page_token,
61753 ))
61754 .headers(header_map)
61755 .build()?;
61756 let info = OperationInfo {
61757 operation_id: "list_spend_permissions",
61758 };
61759 client.pre(&mut request, &info).await?;
61760 let result = client.exec(request, &info).await;
61761 client.post(&result, &info).await?;
61762 let response = result?;
61763 match response.status().as_u16() {
61764 200u16 => ResponseValue::from_response(response).await,
61765 400u16 => Err(Error::ErrorResponse(
61766 ResponseValue::from_response(response).await?,
61767 )),
61768 404u16 => Err(Error::ErrorResponse(
61769 ResponseValue::from_response(response).await?,
61770 )),
61771 500u16 => Err(Error::ErrorResponse(
61772 ResponseValue::from_response(response).await?,
61773 )),
61774 502u16 => Err(Error::ErrorResponse(
61775 ResponseValue::from_response(response).await?,
61776 )),
61777 503u16 => Err(Error::ErrorResponse(
61778 ResponseValue::from_response(response).await?,
61779 )),
61780 _ => Err(Error::UnexpectedResponse(response)),
61781 }
61782 }
61783 }
61784 #[derive(Debug, Clone)]
61788 pub struct RevokeSpendPermission<'a> {
61789 client: &'a super::Client,
61790 address: Result<types::RevokeSpendPermissionAddress, String>,
61791 x_idempotency_key: Result<Option<types::RevokeSpendPermissionXIdempotencyKey>, String>,
61792 x_wallet_auth: Result<::std::string::String, String>,
61793 body: Result<types::builder::RevokeSpendPermissionRequest, String>,
61794 }
61795 impl<'a> RevokeSpendPermission<'a> {
61796 pub fn new(client: &'a super::Client) -> Self {
61797 Self {
61798 client: client,
61799 address: Err("address was not initialized".to_string()),
61800 x_idempotency_key: Ok(None),
61801 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
61802 body: Ok(::std::default::Default::default()),
61803 }
61804 }
61805 pub fn address<V>(mut self, value: V) -> Self
61806 where
61807 V: std::convert::TryInto<types::RevokeSpendPermissionAddress>,
61808 {
61809 self.address = value.try_into().map_err(|_| {
61810 "conversion to `RevokeSpendPermissionAddress` for address failed".to_string()
61811 });
61812 self
61813 }
61814 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
61815 where
61816 V: std::convert::TryInto<types::RevokeSpendPermissionXIdempotencyKey>,
61817 {
61818 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
61819 "conversion to `RevokeSpendPermissionXIdempotencyKey` for x_idempotency_key failed"
61820 .to_string()
61821 });
61822 self
61823 }
61824 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
61825 where
61826 V: std::convert::TryInto<::std::string::String>,
61827 {
61828 self.x_wallet_auth = value.try_into().map_err(|_| {
61829 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
61830 });
61831 self
61832 }
61833 pub fn body<V>(mut self, value: V) -> Self
61834 where
61835 V: std::convert::TryInto<types::RevokeSpendPermissionRequest>,
61836 <V as std::convert::TryInto<types::RevokeSpendPermissionRequest>>::Error:
61837 std::fmt::Display,
61838 {
61839 self.body = value.try_into().map(From::from).map_err(|s| {
61840 format!(
61841 "conversion to `RevokeSpendPermissionRequest` for body failed: {}",
61842 s
61843 )
61844 });
61845 self
61846 }
61847 pub fn body_map<F>(mut self, f: F) -> Self
61848 where
61849 F: std::ops::FnOnce(
61850 types::builder::RevokeSpendPermissionRequest,
61851 ) -> types::builder::RevokeSpendPermissionRequest,
61852 {
61853 self.body = self.body.map(f);
61854 self
61855 }
61856 pub async fn send(
61858 self,
61859 ) -> Result<ResponseValue<types::EvmUserOperation>, Error<types::Error>> {
61860 let Self {
61861 client,
61862 address,
61863 x_idempotency_key,
61864 x_wallet_auth,
61865 body,
61866 } = self;
61867 let address = address.map_err(Error::InvalidRequest)?;
61868 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
61869 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
61870 let body = body
61871 .and_then(|v| {
61872 types::RevokeSpendPermissionRequest::try_from(v).map_err(|e| e.to_string())
61873 })
61874 .map_err(Error::InvalidRequest)?;
61875 let url = format!(
61876 "{}/v2/evm/smart-accounts/{}/spend-permissions/revoke",
61877 client.baseurl,
61878 encode_path(&address.to_string()),
61879 );
61880 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
61881 header_map.append(
61882 ::reqwest::header::HeaderName::from_static("api-version"),
61883 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
61884 );
61885 if let Some(value) = x_idempotency_key {
61886 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
61887 }
61888 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
61889 #[allow(unused_mut)]
61890 let mut request = client
61891 .client
61892 .post(url)
61893 .header(
61894 ::reqwest::header::ACCEPT,
61895 ::reqwest::header::HeaderValue::from_static("application/json"),
61896 )
61897 .json(&body)
61898 .headers(header_map)
61899 .build()?;
61900 let info = OperationInfo {
61901 operation_id: "revoke_spend_permission",
61902 };
61903 client.pre(&mut request, &info).await?;
61904 let result = client.exec(request, &info).await;
61905 client.post(&result, &info).await?;
61906 let response = result?;
61907 match response.status().as_u16() {
61908 200u16 => ResponseValue::from_response(response).await,
61909 400u16 => Err(Error::ErrorResponse(
61910 ResponseValue::from_response(response).await?,
61911 )),
61912 404u16 => Err(Error::ErrorResponse(
61913 ResponseValue::from_response(response).await?,
61914 )),
61915 500u16 => Err(Error::ErrorResponse(
61916 ResponseValue::from_response(response).await?,
61917 )),
61918 502u16 => Err(Error::ErrorResponse(
61919 ResponseValue::from_response(response).await?,
61920 )),
61921 503u16 => Err(Error::ErrorResponse(
61922 ResponseValue::from_response(response).await?,
61923 )),
61924 _ => Err(Error::UnexpectedResponse(response)),
61925 }
61926 }
61927 }
61928 #[derive(Debug, Clone)]
61932 pub struct PrepareUserOperation<'a> {
61933 client: &'a super::Client,
61934 address: Result<types::PrepareUserOperationAddress, String>,
61935 body: Result<types::builder::PrepareUserOperationBody, String>,
61936 }
61937 impl<'a> PrepareUserOperation<'a> {
61938 pub fn new(client: &'a super::Client) -> Self {
61939 Self {
61940 client: client,
61941 address: Err("address was not initialized".to_string()),
61942 body: Ok(::std::default::Default::default()),
61943 }
61944 }
61945 pub fn address<V>(mut self, value: V) -> Self
61946 where
61947 V: std::convert::TryInto<types::PrepareUserOperationAddress>,
61948 {
61949 self.address = value.try_into().map_err(|_| {
61950 "conversion to `PrepareUserOperationAddress` for address failed".to_string()
61951 });
61952 self
61953 }
61954 pub fn body<V>(mut self, value: V) -> Self
61955 where
61956 V: std::convert::TryInto<types::PrepareUserOperationBody>,
61957 <V as std::convert::TryInto<types::PrepareUserOperationBody>>::Error: std::fmt::Display,
61958 {
61959 self.body = value.try_into().map(From::from).map_err(|s| {
61960 format!(
61961 "conversion to `PrepareUserOperationBody` for body failed: {}",
61962 s
61963 )
61964 });
61965 self
61966 }
61967 pub fn body_map<F>(mut self, f: F) -> Self
61968 where
61969 F: std::ops::FnOnce(
61970 types::builder::PrepareUserOperationBody,
61971 ) -> types::builder::PrepareUserOperationBody,
61972 {
61973 self.body = self.body.map(f);
61974 self
61975 }
61976 pub async fn send(
61978 self,
61979 ) -> Result<ResponseValue<types::EvmUserOperation>, Error<types::Error>> {
61980 let Self {
61981 client,
61982 address,
61983 body,
61984 } = self;
61985 let address = address.map_err(Error::InvalidRequest)?;
61986 let body = body
61987 .and_then(|v| {
61988 types::PrepareUserOperationBody::try_from(v).map_err(|e| e.to_string())
61989 })
61990 .map_err(Error::InvalidRequest)?;
61991 let url = format!(
61992 "{}/v2/evm/smart-accounts/{}/user-operations",
61993 client.baseurl,
61994 encode_path(&address.to_string()),
61995 );
61996 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
61997 header_map.append(
61998 ::reqwest::header::HeaderName::from_static("api-version"),
61999 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62000 );
62001 #[allow(unused_mut)]
62002 let mut request = client
62003 .client
62004 .post(url)
62005 .header(
62006 ::reqwest::header::ACCEPT,
62007 ::reqwest::header::HeaderValue::from_static("application/json"),
62008 )
62009 .json(&body)
62010 .headers(header_map)
62011 .build()?;
62012 let info = OperationInfo {
62013 operation_id: "prepare_user_operation",
62014 };
62015 client.pre(&mut request, &info).await?;
62016 let result = client.exec(request, &info).await;
62017 client.post(&result, &info).await?;
62018 let response = result?;
62019 match response.status().as_u16() {
62020 201u16 => ResponseValue::from_response(response).await,
62021 400u16 => Err(Error::ErrorResponse(
62022 ResponseValue::from_response(response).await?,
62023 )),
62024 403u16 => Err(Error::ErrorResponse(
62025 ResponseValue::from_response(response).await?,
62026 )),
62027 404u16 => Err(Error::ErrorResponse(
62028 ResponseValue::from_response(response).await?,
62029 )),
62030 500u16 => Err(Error::ErrorResponse(
62031 ResponseValue::from_response(response).await?,
62032 )),
62033 502u16 => Err(Error::ErrorResponse(
62034 ResponseValue::from_response(response).await?,
62035 )),
62036 503u16 => Err(Error::ErrorResponse(
62037 ResponseValue::from_response(response).await?,
62038 )),
62039 _ => Err(Error::UnexpectedResponse(response)),
62040 }
62041 }
62042 }
62043 #[derive(Debug, Clone)]
62047 pub struct PrepareAndSendUserOperation<'a> {
62048 client: &'a super::Client,
62049 address: Result<types::PrepareAndSendUserOperationAddress, String>,
62050 x_idempotency_key:
62051 Result<Option<types::PrepareAndSendUserOperationXIdempotencyKey>, String>,
62052 x_wallet_auth: Result<::std::string::String, String>,
62053 body: Result<types::builder::PrepareAndSendUserOperationBody, String>,
62054 }
62055 impl<'a> PrepareAndSendUserOperation<'a> {
62056 pub fn new(client: &'a super::Client) -> Self {
62057 Self {
62058 client: client,
62059 address: Err("address was not initialized".to_string()),
62060 x_idempotency_key: Ok(None),
62061 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
62062 body: Ok(::std::default::Default::default()),
62063 }
62064 }
62065 pub fn address<V>(mut self, value: V) -> Self
62066 where
62067 V: std::convert::TryInto<types::PrepareAndSendUserOperationAddress>,
62068 {
62069 self.address = value.try_into().map_err(|_| {
62070 "conversion to `PrepareAndSendUserOperationAddress` for address failed".to_string()
62071 });
62072 self
62073 }
62074 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
62075 where
62076 V: std::convert::TryInto<types::PrepareAndSendUserOperationXIdempotencyKey>,
62077 {
62078 self.x_idempotency_key = value
62079 .try_into()
62080 .map(Some)
62081 .map_err(|_| {
62082 "conversion to `PrepareAndSendUserOperationXIdempotencyKey` for x_idempotency_key failed"
62083 .to_string()
62084 });
62085 self
62086 }
62087 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
62088 where
62089 V: std::convert::TryInto<::std::string::String>,
62090 {
62091 self.x_wallet_auth = value.try_into().map_err(|_| {
62092 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
62093 });
62094 self
62095 }
62096 pub fn body<V>(mut self, value: V) -> Self
62097 where
62098 V: std::convert::TryInto<types::PrepareAndSendUserOperationBody>,
62099 <V as std::convert::TryInto<types::PrepareAndSendUserOperationBody>>::Error:
62100 std::fmt::Display,
62101 {
62102 self.body = value.try_into().map(From::from).map_err(|s| {
62103 format!(
62104 "conversion to `PrepareAndSendUserOperationBody` for body failed: {}",
62105 s
62106 )
62107 });
62108 self
62109 }
62110 pub fn body_map<F>(mut self, f: F) -> Self
62111 where
62112 F: std::ops::FnOnce(
62113 types::builder::PrepareAndSendUserOperationBody,
62114 ) -> types::builder::PrepareAndSendUserOperationBody,
62115 {
62116 self.body = self.body.map(f);
62117 self
62118 }
62119 pub async fn send(
62121 self,
62122 ) -> Result<ResponseValue<types::EvmUserOperation>, Error<types::Error>> {
62123 let Self {
62124 client,
62125 address,
62126 x_idempotency_key,
62127 x_wallet_auth,
62128 body,
62129 } = self;
62130 let address = address.map_err(Error::InvalidRequest)?;
62131 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
62132 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
62133 let body = body
62134 .and_then(|v| {
62135 types::PrepareAndSendUserOperationBody::try_from(v).map_err(|e| e.to_string())
62136 })
62137 .map_err(Error::InvalidRequest)?;
62138 let url = format!(
62139 "{}/v2/evm/smart-accounts/{}/user-operations/prepare-and-send",
62140 client.baseurl,
62141 encode_path(&address.to_string()),
62142 );
62143 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
62144 header_map.append(
62145 ::reqwest::header::HeaderName::from_static("api-version"),
62146 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62147 );
62148 if let Some(value) = x_idempotency_key {
62149 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
62150 }
62151 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
62152 #[allow(unused_mut)]
62153 let mut request = client
62154 .client
62155 .post(url)
62156 .header(
62157 ::reqwest::header::ACCEPT,
62158 ::reqwest::header::HeaderValue::from_static("application/json"),
62159 )
62160 .json(&body)
62161 .headers(header_map)
62162 .build()?;
62163 let info = OperationInfo {
62164 operation_id: "prepare_and_send_user_operation",
62165 };
62166 client.pre(&mut request, &info).await?;
62167 let result = client.exec(request, &info).await;
62168 client.post(&result, &info).await?;
62169 let response = result?;
62170 match response.status().as_u16() {
62171 200u16 => ResponseValue::from_response(response).await,
62172 400u16 => Err(Error::ErrorResponse(
62173 ResponseValue::from_response(response).await?,
62174 )),
62175 401u16 => Err(Error::ErrorResponse(
62176 ResponseValue::from_response(response).await?,
62177 )),
62178 402u16 => Err(Error::ErrorResponse(
62179 ResponseValue::from_response(response).await?,
62180 )),
62181 403u16 => Err(Error::ErrorResponse(
62182 ResponseValue::from_response(response).await?,
62183 )),
62184 404u16 => Err(Error::ErrorResponse(
62185 ResponseValue::from_response(response).await?,
62186 )),
62187 429u16 => Err(Error::ErrorResponse(
62188 ResponseValue::from_response(response).await?,
62189 )),
62190 500u16 => Err(Error::ErrorResponse(
62191 ResponseValue::from_response(response).await?,
62192 )),
62193 502u16 => Err(Error::ErrorResponse(
62194 ResponseValue::from_response(response).await?,
62195 )),
62196 503u16 => Err(Error::ErrorResponse(
62197 ResponseValue::from_response(response).await?,
62198 )),
62199 _ => Err(Error::UnexpectedResponse(response)),
62200 }
62201 }
62202 }
62203 #[derive(Debug, Clone)]
62207 pub struct GetUserOperation<'a> {
62208 client: &'a super::Client,
62209 address: Result<types::GetUserOperationAddress, String>,
62210 user_op_hash: Result<types::GetUserOperationUserOpHash, String>,
62211 }
62212 impl<'a> GetUserOperation<'a> {
62213 pub fn new(client: &'a super::Client) -> Self {
62214 Self {
62215 client: client,
62216 address: Err("address was not initialized".to_string()),
62217 user_op_hash: Err("user_op_hash was not initialized".to_string()),
62218 }
62219 }
62220 pub fn address<V>(mut self, value: V) -> Self
62221 where
62222 V: std::convert::TryInto<types::GetUserOperationAddress>,
62223 {
62224 self.address = value.try_into().map_err(|_| {
62225 "conversion to `GetUserOperationAddress` for address failed".to_string()
62226 });
62227 self
62228 }
62229 pub fn user_op_hash<V>(mut self, value: V) -> Self
62230 where
62231 V: std::convert::TryInto<types::GetUserOperationUserOpHash>,
62232 {
62233 self.user_op_hash = value.try_into().map_err(|_| {
62234 "conversion to `GetUserOperationUserOpHash` for user_op_hash failed".to_string()
62235 });
62236 self
62237 }
62238 pub async fn send(
62240 self,
62241 ) -> Result<ResponseValue<types::EvmUserOperation>, Error<types::Error>> {
62242 let Self {
62243 client,
62244 address,
62245 user_op_hash,
62246 } = self;
62247 let address = address.map_err(Error::InvalidRequest)?;
62248 let user_op_hash = user_op_hash.map_err(Error::InvalidRequest)?;
62249 let url = format!(
62250 "{}/v2/evm/smart-accounts/{}/user-operations/{}",
62251 client.baseurl,
62252 encode_path(&address.to_string()),
62253 encode_path(&user_op_hash.to_string()),
62254 );
62255 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
62256 header_map.append(
62257 ::reqwest::header::HeaderName::from_static("api-version"),
62258 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62259 );
62260 #[allow(unused_mut)]
62261 let mut request = client
62262 .client
62263 .get(url)
62264 .header(
62265 ::reqwest::header::ACCEPT,
62266 ::reqwest::header::HeaderValue::from_static("application/json"),
62267 )
62268 .headers(header_map)
62269 .build()?;
62270 let info = OperationInfo {
62271 operation_id: "get_user_operation",
62272 };
62273 client.pre(&mut request, &info).await?;
62274 let result = client.exec(request, &info).await;
62275 client.post(&result, &info).await?;
62276 let response = result?;
62277 match response.status().as_u16() {
62278 200u16 => ResponseValue::from_response(response).await,
62279 400u16 => Err(Error::ErrorResponse(
62280 ResponseValue::from_response(response).await?,
62281 )),
62282 404u16 => Err(Error::ErrorResponse(
62283 ResponseValue::from_response(response).await?,
62284 )),
62285 500u16 => Err(Error::ErrorResponse(
62286 ResponseValue::from_response(response).await?,
62287 )),
62288 502u16 => Err(Error::ErrorResponse(
62289 ResponseValue::from_response(response).await?,
62290 )),
62291 503u16 => Err(Error::ErrorResponse(
62292 ResponseValue::from_response(response).await?,
62293 )),
62294 _ => Err(Error::UnexpectedResponse(response)),
62295 }
62296 }
62297 }
62298 #[derive(Debug, Clone)]
62302 pub struct SendUserOperation<'a> {
62303 client: &'a super::Client,
62304 address: Result<types::SendUserOperationAddress, String>,
62305 user_op_hash: Result<types::SendUserOperationUserOpHash, String>,
62306 body: Result<types::builder::SendUserOperationBody, String>,
62307 }
62308 impl<'a> SendUserOperation<'a> {
62309 pub fn new(client: &'a super::Client) -> Self {
62310 Self {
62311 client: client,
62312 address: Err("address was not initialized".to_string()),
62313 user_op_hash: Err("user_op_hash was not initialized".to_string()),
62314 body: Ok(::std::default::Default::default()),
62315 }
62316 }
62317 pub fn address<V>(mut self, value: V) -> Self
62318 where
62319 V: std::convert::TryInto<types::SendUserOperationAddress>,
62320 {
62321 self.address = value.try_into().map_err(|_| {
62322 "conversion to `SendUserOperationAddress` for address failed".to_string()
62323 });
62324 self
62325 }
62326 pub fn user_op_hash<V>(mut self, value: V) -> Self
62327 where
62328 V: std::convert::TryInto<types::SendUserOperationUserOpHash>,
62329 {
62330 self.user_op_hash = value.try_into().map_err(|_| {
62331 "conversion to `SendUserOperationUserOpHash` for user_op_hash failed".to_string()
62332 });
62333 self
62334 }
62335 pub fn body<V>(mut self, value: V) -> Self
62336 where
62337 V: std::convert::TryInto<types::SendUserOperationBody>,
62338 <V as std::convert::TryInto<types::SendUserOperationBody>>::Error: std::fmt::Display,
62339 {
62340 self.body = value.try_into().map(From::from).map_err(|s| {
62341 format!(
62342 "conversion to `SendUserOperationBody` for body failed: {}",
62343 s
62344 )
62345 });
62346 self
62347 }
62348 pub fn body_map<F>(mut self, f: F) -> Self
62349 where
62350 F: std::ops::FnOnce(
62351 types::builder::SendUserOperationBody,
62352 ) -> types::builder::SendUserOperationBody,
62353 {
62354 self.body = self.body.map(f);
62355 self
62356 }
62357 pub async fn send(
62359 self,
62360 ) -> Result<ResponseValue<types::EvmUserOperation>, Error<types::Error>> {
62361 let Self {
62362 client,
62363 address,
62364 user_op_hash,
62365 body,
62366 } = self;
62367 let address = address.map_err(Error::InvalidRequest)?;
62368 let user_op_hash = user_op_hash.map_err(Error::InvalidRequest)?;
62369 let body = body
62370 .and_then(|v| types::SendUserOperationBody::try_from(v).map_err(|e| e.to_string()))
62371 .map_err(Error::InvalidRequest)?;
62372 let url = format!(
62373 "{}/v2/evm/smart-accounts/{}/user-operations/{}/send",
62374 client.baseurl,
62375 encode_path(&address.to_string()),
62376 encode_path(&user_op_hash.to_string()),
62377 );
62378 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
62379 header_map.append(
62380 ::reqwest::header::HeaderName::from_static("api-version"),
62381 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62382 );
62383 #[allow(unused_mut)]
62384 let mut request = client
62385 .client
62386 .post(url)
62387 .header(
62388 ::reqwest::header::ACCEPT,
62389 ::reqwest::header::HeaderValue::from_static("application/json"),
62390 )
62391 .json(&body)
62392 .headers(header_map)
62393 .build()?;
62394 let info = OperationInfo {
62395 operation_id: "send_user_operation",
62396 };
62397 client.pre(&mut request, &info).await?;
62398 let result = client.exec(request, &info).await;
62399 client.post(&result, &info).await?;
62400 let response = result?;
62401 match response.status().as_u16() {
62402 200u16 => ResponseValue::from_response(response).await,
62403 400u16 => Err(Error::ErrorResponse(
62404 ResponseValue::from_response(response).await?,
62405 )),
62406 402u16 => Err(Error::ErrorResponse(
62407 ResponseValue::from_response(response).await?,
62408 )),
62409 403u16 => Err(Error::ErrorResponse(
62410 ResponseValue::from_response(response).await?,
62411 )),
62412 404u16 => Err(Error::ErrorResponse(
62413 ResponseValue::from_response(response).await?,
62414 )),
62415 429u16 => Err(Error::ErrorResponse(
62416 ResponseValue::from_response(response).await?,
62417 )),
62418 500u16 => Err(Error::ErrorResponse(
62419 ResponseValue::from_response(response).await?,
62420 )),
62421 502u16 => Err(Error::ErrorResponse(
62422 ResponseValue::from_response(response).await?,
62423 )),
62424 503u16 => Err(Error::ErrorResponse(
62425 ResponseValue::from_response(response).await?,
62426 )),
62427 _ => Err(Error::UnexpectedResponse(response)),
62428 }
62429 }
62430 }
62431 #[derive(Debug, Clone)]
62435 pub struct CreateEvmSwapQuote<'a> {
62436 client: &'a super::Client,
62437 x_idempotency_key: Result<Option<types::CreateEvmSwapQuoteXIdempotencyKey>, String>,
62438 body: Result<types::builder::CreateEvmSwapQuoteBody, String>,
62439 }
62440 impl<'a> CreateEvmSwapQuote<'a> {
62441 pub fn new(client: &'a super::Client) -> Self {
62442 Self {
62443 client: client,
62444 x_idempotency_key: Ok(None),
62445 body: Ok(::std::default::Default::default()),
62446 }
62447 }
62448 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
62449 where
62450 V: std::convert::TryInto<types::CreateEvmSwapQuoteXIdempotencyKey>,
62451 {
62452 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
62453 "conversion to `CreateEvmSwapQuoteXIdempotencyKey` for x_idempotency_key failed"
62454 .to_string()
62455 });
62456 self
62457 }
62458 pub fn body<V>(mut self, value: V) -> Self
62459 where
62460 V: std::convert::TryInto<types::CreateEvmSwapQuoteBody>,
62461 <V as std::convert::TryInto<types::CreateEvmSwapQuoteBody>>::Error: std::fmt::Display,
62462 {
62463 self.body = value.try_into().map(From::from).map_err(|s| {
62464 format!(
62465 "conversion to `CreateEvmSwapQuoteBody` for body failed: {}",
62466 s
62467 )
62468 });
62469 self
62470 }
62471 pub fn body_map<F>(mut self, f: F) -> Self
62472 where
62473 F: std::ops::FnOnce(
62474 types::builder::CreateEvmSwapQuoteBody,
62475 ) -> types::builder::CreateEvmSwapQuoteBody,
62476 {
62477 self.body = self.body.map(f);
62478 self
62479 }
62480 pub async fn send(
62482 self,
62483 ) -> Result<ResponseValue<types::CreateSwapQuoteResponseWrapper>, Error<types::Error>>
62484 {
62485 let Self {
62486 client,
62487 x_idempotency_key,
62488 body,
62489 } = self;
62490 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
62491 let body = body
62492 .and_then(|v| types::CreateEvmSwapQuoteBody::try_from(v).map_err(|e| e.to_string()))
62493 .map_err(Error::InvalidRequest)?;
62494 let url = format!("{}/v2/evm/swaps", client.baseurl,);
62495 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
62496 header_map.append(
62497 ::reqwest::header::HeaderName::from_static("api-version"),
62498 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62499 );
62500 if let Some(value) = x_idempotency_key {
62501 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
62502 }
62503 #[allow(unused_mut)]
62504 let mut request = client
62505 .client
62506 .post(url)
62507 .header(
62508 ::reqwest::header::ACCEPT,
62509 ::reqwest::header::HeaderValue::from_static("application/json"),
62510 )
62511 .json(&body)
62512 .headers(header_map)
62513 .build()?;
62514 let info = OperationInfo {
62515 operation_id: "create_evm_swap_quote",
62516 };
62517 client.pre(&mut request, &info).await?;
62518 let result = client.exec(request, &info).await;
62519 client.post(&result, &info).await?;
62520 let response = result?;
62521 match response.status().as_u16() {
62522 201u16 => ResponseValue::from_response(response).await,
62523 400u16 => Err(Error::ErrorResponse(
62524 ResponseValue::from_response(response).await?,
62525 )),
62526 403u16 => Err(Error::ErrorResponse(
62527 ResponseValue::from_response(response).await?,
62528 )),
62529 500u16 => Err(Error::ErrorResponse(
62530 ResponseValue::from_response(response).await?,
62531 )),
62532 502u16 => Err(Error::ErrorResponse(
62533 ResponseValue::from_response(response).await?,
62534 )),
62535 503u16 => Err(Error::ErrorResponse(
62536 ResponseValue::from_response(response).await?,
62537 )),
62538 _ => Err(Error::UnexpectedResponse(response)),
62539 }
62540 }
62541 }
62542 #[derive(Debug, Clone)]
62546 pub struct GetEvmSwapPrice<'a> {
62547 client: &'a super::Client,
62548 from_amount: Result<types::FromAmount, String>,
62549 from_token: Result<types::FromToken, String>,
62550 gas_price: Result<Option<types::GasPrice>, String>,
62551 network: Result<types::EvmSwapsNetwork, String>,
62552 signer_address: Result<Option<types::SignerAddress>, String>,
62553 slippage_bps: Result<Option<types::SlippageBps>, String>,
62554 taker: Result<types::Taker, String>,
62555 to_token: Result<types::ToToken, String>,
62556 }
62557 impl<'a> GetEvmSwapPrice<'a> {
62558 pub fn new(client: &'a super::Client) -> Self {
62559 Self {
62560 client: client,
62561 from_amount: Err("from_amount was not initialized".to_string()),
62562 from_token: Err("from_token was not initialized".to_string()),
62563 gas_price: Ok(None),
62564 network: Err("network was not initialized".to_string()),
62565 signer_address: Ok(None),
62566 slippage_bps: Ok(None),
62567 taker: Err("taker was not initialized".to_string()),
62568 to_token: Err("to_token was not initialized".to_string()),
62569 }
62570 }
62571 pub fn from_amount<V>(mut self, value: V) -> Self
62572 where
62573 V: std::convert::TryInto<types::FromAmount>,
62574 {
62575 self.from_amount = value
62576 .try_into()
62577 .map_err(|_| "conversion to `FromAmount` for from_amount failed".to_string());
62578 self
62579 }
62580 pub fn from_token<V>(mut self, value: V) -> Self
62581 where
62582 V: std::convert::TryInto<types::FromToken>,
62583 {
62584 self.from_token = value
62585 .try_into()
62586 .map_err(|_| "conversion to `FromToken` for from_token failed".to_string());
62587 self
62588 }
62589 pub fn gas_price<V>(mut self, value: V) -> Self
62590 where
62591 V: std::convert::TryInto<types::GasPrice>,
62592 {
62593 self.gas_price = value
62594 .try_into()
62595 .map(Some)
62596 .map_err(|_| "conversion to `GasPrice` for gas_price failed".to_string());
62597 self
62598 }
62599 pub fn network<V>(mut self, value: V) -> Self
62600 where
62601 V: std::convert::TryInto<types::EvmSwapsNetwork>,
62602 {
62603 self.network = value
62604 .try_into()
62605 .map_err(|_| "conversion to `EvmSwapsNetwork` for network failed".to_string());
62606 self
62607 }
62608 pub fn signer_address<V>(mut self, value: V) -> Self
62609 where
62610 V: std::convert::TryInto<types::SignerAddress>,
62611 {
62612 self.signer_address = value
62613 .try_into()
62614 .map(Some)
62615 .map_err(|_| "conversion to `SignerAddress` for signer_address failed".to_string());
62616 self
62617 }
62618 pub fn slippage_bps<V>(mut self, value: V) -> Self
62619 where
62620 V: std::convert::TryInto<types::SlippageBps>,
62621 {
62622 self.slippage_bps = value
62623 .try_into()
62624 .map(Some)
62625 .map_err(|_| "conversion to `SlippageBps` for slippage_bps failed".to_string());
62626 self
62627 }
62628 pub fn taker<V>(mut self, value: V) -> Self
62629 where
62630 V: std::convert::TryInto<types::Taker>,
62631 {
62632 self.taker = value
62633 .try_into()
62634 .map_err(|_| "conversion to `Taker` for taker failed".to_string());
62635 self
62636 }
62637 pub fn to_token<V>(mut self, value: V) -> Self
62638 where
62639 V: std::convert::TryInto<types::ToToken>,
62640 {
62641 self.to_token = value
62642 .try_into()
62643 .map_err(|_| "conversion to `ToToken` for to_token failed".to_string());
62644 self
62645 }
62646 pub async fn send(
62648 self,
62649 ) -> Result<ResponseValue<types::GetSwapPriceResponseWrapper>, Error<types::Error>>
62650 {
62651 let Self {
62652 client,
62653 from_amount,
62654 from_token,
62655 gas_price,
62656 network,
62657 signer_address,
62658 slippage_bps,
62659 taker,
62660 to_token,
62661 } = self;
62662 let from_amount = from_amount.map_err(Error::InvalidRequest)?;
62663 let from_token = from_token.map_err(Error::InvalidRequest)?;
62664 let gas_price = gas_price.map_err(Error::InvalidRequest)?;
62665 let network = network.map_err(Error::InvalidRequest)?;
62666 let signer_address = signer_address.map_err(Error::InvalidRequest)?;
62667 let slippage_bps = slippage_bps.map_err(Error::InvalidRequest)?;
62668 let taker = taker.map_err(Error::InvalidRequest)?;
62669 let to_token = to_token.map_err(Error::InvalidRequest)?;
62670 let url = format!("{}/v2/evm/swaps/quote", client.baseurl,);
62671 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
62672 header_map.append(
62673 ::reqwest::header::HeaderName::from_static("api-version"),
62674 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62675 );
62676 #[allow(unused_mut)]
62677 let mut request = client
62678 .client
62679 .get(url)
62680 .header(
62681 ::reqwest::header::ACCEPT,
62682 ::reqwest::header::HeaderValue::from_static("application/json"),
62683 )
62684 .query(&progenitor_middleware_client::QueryParam::new(
62685 "fromAmount",
62686 &from_amount,
62687 ))
62688 .query(&progenitor_middleware_client::QueryParam::new(
62689 "fromToken",
62690 &from_token,
62691 ))
62692 .query(&progenitor_middleware_client::QueryParam::new(
62693 "gasPrice", &gas_price,
62694 ))
62695 .query(&progenitor_middleware_client::QueryParam::new(
62696 "network", &network,
62697 ))
62698 .query(&progenitor_middleware_client::QueryParam::new(
62699 "signerAddress",
62700 &signer_address,
62701 ))
62702 .query(&progenitor_middleware_client::QueryParam::new(
62703 "slippageBps",
62704 &slippage_bps,
62705 ))
62706 .query(&progenitor_middleware_client::QueryParam::new(
62707 "taker", &taker,
62708 ))
62709 .query(&progenitor_middleware_client::QueryParam::new(
62710 "toToken", &to_token,
62711 ))
62712 .headers(header_map)
62713 .build()?;
62714 let info = OperationInfo {
62715 operation_id: "get_evm_swap_price",
62716 };
62717 client.pre(&mut request, &info).await?;
62718 let result = client.exec(request, &info).await;
62719 client.post(&result, &info).await?;
62720 let response = result?;
62721 match response.status().as_u16() {
62722 200u16 => ResponseValue::from_response(response).await,
62723 400u16 => Err(Error::ErrorResponse(
62724 ResponseValue::from_response(response).await?,
62725 )),
62726 403u16 => Err(Error::ErrorResponse(
62727 ResponseValue::from_response(response).await?,
62728 )),
62729 500u16 => Err(Error::ErrorResponse(
62730 ResponseValue::from_response(response).await?,
62731 )),
62732 502u16 => Err(Error::ErrorResponse(
62733 ResponseValue::from_response(response).await?,
62734 )),
62735 503u16 => Err(Error::ErrorResponse(
62736 ResponseValue::from_response(response).await?,
62737 )),
62738 _ => Err(Error::UnexpectedResponse(response)),
62739 }
62740 }
62741 }
62742 #[derive(Debug, Clone)]
62746 pub struct ListEvmTokenBalances<'a> {
62747 client: &'a super::Client,
62748 network: Result<types::ListEvmTokenBalancesNetwork, String>,
62749 address: Result<types::ListEvmTokenBalancesAddress, String>,
62750 page_size: Result<Option<i64>, String>,
62751 page_token: Result<Option<::std::string::String>, String>,
62752 }
62753 impl<'a> ListEvmTokenBalances<'a> {
62754 pub fn new(client: &'a super::Client) -> Self {
62755 Self {
62756 client: client,
62757 network: Err("network was not initialized".to_string()),
62758 address: Err("address was not initialized".to_string()),
62759 page_size: Ok(None),
62760 page_token: Ok(None),
62761 }
62762 }
62763 pub fn network<V>(mut self, value: V) -> Self
62764 where
62765 V: std::convert::TryInto<types::ListEvmTokenBalancesNetwork>,
62766 {
62767 self.network = value.try_into().map_err(|_| {
62768 "conversion to `ListEvmTokenBalancesNetwork` for network failed".to_string()
62769 });
62770 self
62771 }
62772 pub fn address<V>(mut self, value: V) -> Self
62773 where
62774 V: std::convert::TryInto<types::ListEvmTokenBalancesAddress>,
62775 {
62776 self.address = value.try_into().map_err(|_| {
62777 "conversion to `ListEvmTokenBalancesAddress` for address failed".to_string()
62778 });
62779 self
62780 }
62781 pub fn page_size<V>(mut self, value: V) -> Self
62782 where
62783 V: std::convert::TryInto<i64>,
62784 {
62785 self.page_size = value
62786 .try_into()
62787 .map(Some)
62788 .map_err(|_| "conversion to `i64` for page_size failed".to_string());
62789 self
62790 }
62791 pub fn page_token<V>(mut self, value: V) -> Self
62792 where
62793 V: std::convert::TryInto<::std::string::String>,
62794 {
62795 self.page_token = value.try_into().map(Some).map_err(|_| {
62796 "conversion to `:: std :: string :: String` for page_token failed".to_string()
62797 });
62798 self
62799 }
62800 pub async fn send(
62802 self,
62803 ) -> Result<ResponseValue<types::ListEvmTokenBalancesResponse>, Error<types::Error>>
62804 {
62805 let Self {
62806 client,
62807 network,
62808 address,
62809 page_size,
62810 page_token,
62811 } = self;
62812 let network = network.map_err(Error::InvalidRequest)?;
62813 let address = address.map_err(Error::InvalidRequest)?;
62814 let page_size = page_size.map_err(Error::InvalidRequest)?;
62815 let page_token = page_token.map_err(Error::InvalidRequest)?;
62816 let url = format!(
62817 "{}/v2/evm/token-balances/{}/{}",
62818 client.baseurl,
62819 encode_path(&network.to_string()),
62820 encode_path(&address.to_string()),
62821 );
62822 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
62823 header_map.append(
62824 ::reqwest::header::HeaderName::from_static("api-version"),
62825 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62826 );
62827 #[allow(unused_mut)]
62828 let mut request = client
62829 .client
62830 .get(url)
62831 .header(
62832 ::reqwest::header::ACCEPT,
62833 ::reqwest::header::HeaderValue::from_static("application/json"),
62834 )
62835 .query(&progenitor_middleware_client::QueryParam::new(
62836 "pageSize", &page_size,
62837 ))
62838 .query(&progenitor_middleware_client::QueryParam::new(
62839 "pageToken",
62840 &page_token,
62841 ))
62842 .headers(header_map)
62843 .build()?;
62844 let info = OperationInfo {
62845 operation_id: "list_evm_token_balances",
62846 };
62847 client.pre(&mut request, &info).await?;
62848 let result = client.exec(request, &info).await;
62849 client.post(&result, &info).await?;
62850 let response = result?;
62851 match response.status().as_u16() {
62852 200u16 => ResponseValue::from_response(response).await,
62853 400u16 => Err(Error::ErrorResponse(
62854 ResponseValue::from_response(response).await?,
62855 )),
62856 404u16 => Err(Error::ErrorResponse(
62857 ResponseValue::from_response(response).await?,
62858 )),
62859 500u16 => Err(Error::ErrorResponse(
62860 ResponseValue::from_response(response).await?,
62861 )),
62862 502u16 => Err(Error::ErrorResponse(
62863 ResponseValue::from_response(response).await?,
62864 )),
62865 503u16 => Err(Error::ErrorResponse(
62866 ResponseValue::from_response(response).await?,
62867 )),
62868 _ => Err(Error::UnexpectedResponse(response)),
62869 }
62870 }
62871 }
62872 #[derive(Debug, Clone)]
62876 pub struct CreateOnrampOrder<'a> {
62877 client: &'a super::Client,
62878 body: Result<types::builder::CreateOnrampOrderBody, String>,
62879 }
62880 impl<'a> CreateOnrampOrder<'a> {
62881 pub fn new(client: &'a super::Client) -> Self {
62882 Self {
62883 client: client,
62884 body: Ok(::std::default::Default::default()),
62885 }
62886 }
62887 pub fn body<V>(mut self, value: V) -> Self
62888 where
62889 V: std::convert::TryInto<types::CreateOnrampOrderBody>,
62890 <V as std::convert::TryInto<types::CreateOnrampOrderBody>>::Error: std::fmt::Display,
62891 {
62892 self.body = value.try_into().map(From::from).map_err(|s| {
62893 format!(
62894 "conversion to `CreateOnrampOrderBody` for body failed: {}",
62895 s
62896 )
62897 });
62898 self
62899 }
62900 pub fn body_map<F>(mut self, f: F) -> Self
62901 where
62902 F: std::ops::FnOnce(
62903 types::builder::CreateOnrampOrderBody,
62904 ) -> types::builder::CreateOnrampOrderBody,
62905 {
62906 self.body = self.body.map(f);
62907 self
62908 }
62909 pub async fn send(
62911 self,
62912 ) -> Result<ResponseValue<types::CreateOnrampOrderResponse>, Error<types::Error>> {
62913 let Self { client, body } = self;
62914 let body = body
62915 .and_then(|v| types::CreateOnrampOrderBody::try_from(v).map_err(|e| e.to_string()))
62916 .map_err(Error::InvalidRequest)?;
62917 let url = format!("{}/v2/onramp/orders", client.baseurl,);
62918 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
62919 header_map.append(
62920 ::reqwest::header::HeaderName::from_static("api-version"),
62921 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62922 );
62923 #[allow(unused_mut)]
62924 let mut request = client
62925 .client
62926 .post(url)
62927 .header(
62928 ::reqwest::header::ACCEPT,
62929 ::reqwest::header::HeaderValue::from_static("application/json"),
62930 )
62931 .json(&body)
62932 .headers(header_map)
62933 .build()?;
62934 let info = OperationInfo {
62935 operation_id: "create_onramp_order",
62936 };
62937 client.pre(&mut request, &info).await?;
62938 let result = client.exec(request, &info).await;
62939 client.post(&result, &info).await?;
62940 let response = result?;
62941 match response.status().as_u16() {
62942 201u16 => ResponseValue::from_response(response).await,
62943 400u16 => Err(Error::ErrorResponse(
62944 ResponseValue::from_response(response).await?,
62945 )),
62946 401u16 => Err(Error::ErrorResponse(
62947 ResponseValue::from_response(response).await?,
62948 )),
62949 429u16 => Err(Error::ErrorResponse(
62950 ResponseValue::from_response(response).await?,
62951 )),
62952 500u16 => Err(Error::ErrorResponse(
62953 ResponseValue::from_response(response).await?,
62954 )),
62955 _ => Err(Error::UnexpectedResponse(response)),
62956 }
62957 }
62958 }
62959 #[derive(Debug, Clone)]
62963 pub struct GetOnrampOrderById<'a> {
62964 client: &'a super::Client,
62965 order_id: Result<::std::string::String, String>,
62966 }
62967 impl<'a> GetOnrampOrderById<'a> {
62968 pub fn new(client: &'a super::Client) -> Self {
62969 Self {
62970 client: client,
62971 order_id: Err("order_id was not initialized".to_string()),
62972 }
62973 }
62974 pub fn order_id<V>(mut self, value: V) -> Self
62975 where
62976 V: std::convert::TryInto<::std::string::String>,
62977 {
62978 self.order_id = value.try_into().map_err(|_| {
62979 "conversion to `:: std :: string :: String` for order_id failed".to_string()
62980 });
62981 self
62982 }
62983 pub async fn send(
62985 self,
62986 ) -> Result<ResponseValue<types::GetOnrampOrderByIdResponse>, Error<types::Error>> {
62987 let Self { client, order_id } = self;
62988 let order_id = order_id.map_err(Error::InvalidRequest)?;
62989 let url = format!(
62990 "{}/v2/onramp/orders/{}",
62991 client.baseurl,
62992 encode_path(&order_id.to_string()),
62993 );
62994 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
62995 header_map.append(
62996 ::reqwest::header::HeaderName::from_static("api-version"),
62997 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
62998 );
62999 #[allow(unused_mut)]
63000 let mut request = client
63001 .client
63002 .get(url)
63003 .header(
63004 ::reqwest::header::ACCEPT,
63005 ::reqwest::header::HeaderValue::from_static("application/json"),
63006 )
63007 .headers(header_map)
63008 .build()?;
63009 let info = OperationInfo {
63010 operation_id: "get_onramp_order_by_id",
63011 };
63012 client.pre(&mut request, &info).await?;
63013 let result = client.exec(request, &info).await;
63014 client.post(&result, &info).await?;
63015 let response = result?;
63016 match response.status().as_u16() {
63017 200u16 => ResponseValue::from_response(response).await,
63018 401u16 => Err(Error::ErrorResponse(
63019 ResponseValue::from_response(response).await?,
63020 )),
63021 404u16 => Err(Error::ErrorResponse(
63022 ResponseValue::from_response(response).await?,
63023 )),
63024 429u16 => Err(Error::ErrorResponse(
63025 ResponseValue::from_response(response).await?,
63026 )),
63027 _ => Err(Error::UnexpectedResponse(response)),
63028 }
63029 }
63030 }
63031 #[derive(Debug, Clone)]
63035 pub struct CreateOnrampSession<'a> {
63036 client: &'a super::Client,
63037 body: Result<types::builder::CreateOnrampSessionBody, String>,
63038 }
63039 impl<'a> CreateOnrampSession<'a> {
63040 pub fn new(client: &'a super::Client) -> Self {
63041 Self {
63042 client: client,
63043 body: Ok(::std::default::Default::default()),
63044 }
63045 }
63046 pub fn body<V>(mut self, value: V) -> Self
63047 where
63048 V: std::convert::TryInto<types::CreateOnrampSessionBody>,
63049 <V as std::convert::TryInto<types::CreateOnrampSessionBody>>::Error: std::fmt::Display,
63050 {
63051 self.body = value.try_into().map(From::from).map_err(|s| {
63052 format!(
63053 "conversion to `CreateOnrampSessionBody` for body failed: {}",
63054 s
63055 )
63056 });
63057 self
63058 }
63059 pub fn body_map<F>(mut self, f: F) -> Self
63060 where
63061 F: std::ops::FnOnce(
63062 types::builder::CreateOnrampSessionBody,
63063 ) -> types::builder::CreateOnrampSessionBody,
63064 {
63065 self.body = self.body.map(f);
63066 self
63067 }
63068 pub async fn send(
63070 self,
63071 ) -> Result<ResponseValue<types::CreateOnrampSessionResponse>, Error<types::Error>>
63072 {
63073 let Self { client, body } = self;
63074 let body = body
63075 .and_then(|v| {
63076 types::CreateOnrampSessionBody::try_from(v).map_err(|e| e.to_string())
63077 })
63078 .map_err(Error::InvalidRequest)?;
63079 let url = format!("{}/v2/onramp/sessions", client.baseurl,);
63080 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
63081 header_map.append(
63082 ::reqwest::header::HeaderName::from_static("api-version"),
63083 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63084 );
63085 #[allow(unused_mut)]
63086 let mut request = client
63087 .client
63088 .post(url)
63089 .header(
63090 ::reqwest::header::ACCEPT,
63091 ::reqwest::header::HeaderValue::from_static("application/json"),
63092 )
63093 .json(&body)
63094 .headers(header_map)
63095 .build()?;
63096 let info = OperationInfo {
63097 operation_id: "create_onramp_session",
63098 };
63099 client.pre(&mut request, &info).await?;
63100 let result = client.exec(request, &info).await;
63101 client.post(&result, &info).await?;
63102 let response = result?;
63103 match response.status().as_u16() {
63104 201u16 => ResponseValue::from_response(response).await,
63105 400u16 => Err(Error::ErrorResponse(
63106 ResponseValue::from_response(response).await?,
63107 )),
63108 401u16 => Err(Error::ErrorResponse(
63109 ResponseValue::from_response(response).await?,
63110 )),
63111 429u16 => Err(Error::ErrorResponse(
63112 ResponseValue::from_response(response).await?,
63113 )),
63114 500u16 => Err(Error::ErrorResponse(
63115 ResponseValue::from_response(response).await?,
63116 )),
63117 _ => Err(Error::UnexpectedResponse(response)),
63118 }
63119 }
63120 }
63121 #[derive(Debug, Clone)]
63125 pub struct ListPolicies<'a> {
63126 client: &'a super::Client,
63127 page_size: Result<Option<i64>, String>,
63128 page_token: Result<Option<::std::string::String>, String>,
63129 scope: Result<Option<types::ListPoliciesScope>, String>,
63130 }
63131 impl<'a> ListPolicies<'a> {
63132 pub fn new(client: &'a super::Client) -> Self {
63133 Self {
63134 client: client,
63135 page_size: Ok(None),
63136 page_token: Ok(None),
63137 scope: Ok(None),
63138 }
63139 }
63140 pub fn page_size<V>(mut self, value: V) -> Self
63141 where
63142 V: std::convert::TryInto<i64>,
63143 {
63144 self.page_size = value
63145 .try_into()
63146 .map(Some)
63147 .map_err(|_| "conversion to `i64` for page_size failed".to_string());
63148 self
63149 }
63150 pub fn page_token<V>(mut self, value: V) -> Self
63151 where
63152 V: std::convert::TryInto<::std::string::String>,
63153 {
63154 self.page_token = value.try_into().map(Some).map_err(|_| {
63155 "conversion to `:: std :: string :: String` for page_token failed".to_string()
63156 });
63157 self
63158 }
63159 pub fn scope<V>(mut self, value: V) -> Self
63160 where
63161 V: std::convert::TryInto<types::ListPoliciesScope>,
63162 {
63163 self.scope = value
63164 .try_into()
63165 .map(Some)
63166 .map_err(|_| "conversion to `ListPoliciesScope` for scope failed".to_string());
63167 self
63168 }
63169 pub async fn send(
63171 self,
63172 ) -> Result<ResponseValue<types::ListPoliciesResponse>, Error<types::Error>> {
63173 let Self {
63174 client,
63175 page_size,
63176 page_token,
63177 scope,
63178 } = self;
63179 let page_size = page_size.map_err(Error::InvalidRequest)?;
63180 let page_token = page_token.map_err(Error::InvalidRequest)?;
63181 let scope = scope.map_err(Error::InvalidRequest)?;
63182 let url = format!("{}/v2/policy-engine/policies", client.baseurl,);
63183 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
63184 header_map.append(
63185 ::reqwest::header::HeaderName::from_static("api-version"),
63186 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63187 );
63188 #[allow(unused_mut)]
63189 let mut request = client
63190 .client
63191 .get(url)
63192 .header(
63193 ::reqwest::header::ACCEPT,
63194 ::reqwest::header::HeaderValue::from_static("application/json"),
63195 )
63196 .query(&progenitor_middleware_client::QueryParam::new(
63197 "pageSize", &page_size,
63198 ))
63199 .query(&progenitor_middleware_client::QueryParam::new(
63200 "pageToken",
63201 &page_token,
63202 ))
63203 .query(&progenitor_middleware_client::QueryParam::new(
63204 "scope", &scope,
63205 ))
63206 .headers(header_map)
63207 .build()?;
63208 let info = OperationInfo {
63209 operation_id: "list_policies",
63210 };
63211 client.pre(&mut request, &info).await?;
63212 let result = client.exec(request, &info).await;
63213 client.post(&result, &info).await?;
63214 let response = result?;
63215 match response.status().as_u16() {
63216 200u16 => ResponseValue::from_response(response).await,
63217 500u16 => Err(Error::ErrorResponse(
63218 ResponseValue::from_response(response).await?,
63219 )),
63220 502u16 => Err(Error::ErrorResponse(
63221 ResponseValue::from_response(response).await?,
63222 )),
63223 503u16 => Err(Error::ErrorResponse(
63224 ResponseValue::from_response(response).await?,
63225 )),
63226 _ => Err(Error::UnexpectedResponse(response)),
63227 }
63228 }
63229 }
63230 #[derive(Debug, Clone)]
63234 pub struct CreatePolicy<'a> {
63235 client: &'a super::Client,
63236 x_idempotency_key: Result<Option<types::CreatePolicyXIdempotencyKey>, String>,
63237 body: Result<types::builder::CreatePolicyBody, String>,
63238 }
63239 impl<'a> CreatePolicy<'a> {
63240 pub fn new(client: &'a super::Client) -> Self {
63241 Self {
63242 client: client,
63243 x_idempotency_key: Ok(None),
63244 body: Ok(::std::default::Default::default()),
63245 }
63246 }
63247 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
63248 where
63249 V: std::convert::TryInto<types::CreatePolicyXIdempotencyKey>,
63250 {
63251 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
63252 "conversion to `CreatePolicyXIdempotencyKey` for x_idempotency_key failed"
63253 .to_string()
63254 });
63255 self
63256 }
63257 pub fn body<V>(mut self, value: V) -> Self
63258 where
63259 V: std::convert::TryInto<types::CreatePolicyBody>,
63260 <V as std::convert::TryInto<types::CreatePolicyBody>>::Error: std::fmt::Display,
63261 {
63262 self.body = value
63263 .try_into()
63264 .map(From::from)
63265 .map_err(|s| format!("conversion to `CreatePolicyBody` for body failed: {}", s));
63266 self
63267 }
63268 pub fn body_map<F>(mut self, f: F) -> Self
63269 where
63270 F: std::ops::FnOnce(
63271 types::builder::CreatePolicyBody,
63272 ) -> types::builder::CreatePolicyBody,
63273 {
63274 self.body = self.body.map(f);
63275 self
63276 }
63277 pub async fn send(self) -> Result<ResponseValue<types::Policy>, Error<types::Error>> {
63279 let Self {
63280 client,
63281 x_idempotency_key,
63282 body,
63283 } = self;
63284 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
63285 let body = body
63286 .and_then(|v| types::CreatePolicyBody::try_from(v).map_err(|e| e.to_string()))
63287 .map_err(Error::InvalidRequest)?;
63288 let url = format!("{}/v2/policy-engine/policies", client.baseurl,);
63289 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
63290 header_map.append(
63291 ::reqwest::header::HeaderName::from_static("api-version"),
63292 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63293 );
63294 if let Some(value) = x_idempotency_key {
63295 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
63296 }
63297 #[allow(unused_mut)]
63298 let mut request = client
63299 .client
63300 .post(url)
63301 .header(
63302 ::reqwest::header::ACCEPT,
63303 ::reqwest::header::HeaderValue::from_static("application/json"),
63304 )
63305 .json(&body)
63306 .headers(header_map)
63307 .build()?;
63308 let info = OperationInfo {
63309 operation_id: "create_policy",
63310 };
63311 client.pre(&mut request, &info).await?;
63312 let result = client.exec(request, &info).await;
63313 client.post(&result, &info).await?;
63314 let response = result?;
63315 match response.status().as_u16() {
63316 201u16 => ResponseValue::from_response(response).await,
63317 400u16 => Err(Error::ErrorResponse(
63318 ResponseValue::from_response(response).await?,
63319 )),
63320 409u16 => Err(Error::ErrorResponse(
63321 ResponseValue::from_response(response).await?,
63322 )),
63323 422u16 => Err(Error::ErrorResponse(
63324 ResponseValue::from_response(response).await?,
63325 )),
63326 500u16 => Err(Error::ErrorResponse(
63327 ResponseValue::from_response(response).await?,
63328 )),
63329 502u16 => Err(Error::ErrorResponse(
63330 ResponseValue::from_response(response).await?,
63331 )),
63332 503u16 => Err(Error::ErrorResponse(
63333 ResponseValue::from_response(response).await?,
63334 )),
63335 _ => Err(Error::UnexpectedResponse(response)),
63336 }
63337 }
63338 }
63339 #[derive(Debug, Clone)]
63343 pub struct GetPolicyById<'a> {
63344 client: &'a super::Client,
63345 policy_id: Result<types::GetPolicyByIdPolicyId, String>,
63346 }
63347 impl<'a> GetPolicyById<'a> {
63348 pub fn new(client: &'a super::Client) -> Self {
63349 Self {
63350 client: client,
63351 policy_id: Err("policy_id was not initialized".to_string()),
63352 }
63353 }
63354 pub fn policy_id<V>(mut self, value: V) -> Self
63355 where
63356 V: std::convert::TryInto<types::GetPolicyByIdPolicyId>,
63357 {
63358 self.policy_id = value.try_into().map_err(|_| {
63359 "conversion to `GetPolicyByIdPolicyId` for policy_id failed".to_string()
63360 });
63361 self
63362 }
63363 pub async fn send(self) -> Result<ResponseValue<types::Policy>, Error<types::Error>> {
63365 let Self { client, policy_id } = self;
63366 let policy_id = policy_id.map_err(Error::InvalidRequest)?;
63367 let url = format!(
63368 "{}/v2/policy-engine/policies/{}",
63369 client.baseurl,
63370 encode_path(&policy_id.to_string()),
63371 );
63372 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
63373 header_map.append(
63374 ::reqwest::header::HeaderName::from_static("api-version"),
63375 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63376 );
63377 #[allow(unused_mut)]
63378 let mut request = client
63379 .client
63380 .get(url)
63381 .header(
63382 ::reqwest::header::ACCEPT,
63383 ::reqwest::header::HeaderValue::from_static("application/json"),
63384 )
63385 .headers(header_map)
63386 .build()?;
63387 let info = OperationInfo {
63388 operation_id: "get_policy_by_id",
63389 };
63390 client.pre(&mut request, &info).await?;
63391 let result = client.exec(request, &info).await;
63392 client.post(&result, &info).await?;
63393 let response = result?;
63394 match response.status().as_u16() {
63395 200u16 => ResponseValue::from_response(response).await,
63396 404u16 => Err(Error::ErrorResponse(
63397 ResponseValue::from_response(response).await?,
63398 )),
63399 500u16 => Err(Error::ErrorResponse(
63400 ResponseValue::from_response(response).await?,
63401 )),
63402 502u16 => Err(Error::ErrorResponse(
63403 ResponseValue::from_response(response).await?,
63404 )),
63405 503u16 => Err(Error::ErrorResponse(
63406 ResponseValue::from_response(response).await?,
63407 )),
63408 _ => Err(Error::UnexpectedResponse(response)),
63409 }
63410 }
63411 }
63412 #[derive(Debug, Clone)]
63416 pub struct UpdatePolicy<'a> {
63417 client: &'a super::Client,
63418 policy_id: Result<types::UpdatePolicyPolicyId, String>,
63419 x_idempotency_key: Result<Option<types::UpdatePolicyXIdempotencyKey>, String>,
63420 body: Result<types::builder::UpdatePolicyBody, String>,
63421 }
63422 impl<'a> UpdatePolicy<'a> {
63423 pub fn new(client: &'a super::Client) -> Self {
63424 Self {
63425 client: client,
63426 policy_id: Err("policy_id was not initialized".to_string()),
63427 x_idempotency_key: Ok(None),
63428 body: Ok(::std::default::Default::default()),
63429 }
63430 }
63431 pub fn policy_id<V>(mut self, value: V) -> Self
63432 where
63433 V: std::convert::TryInto<types::UpdatePolicyPolicyId>,
63434 {
63435 self.policy_id = value.try_into().map_err(|_| {
63436 "conversion to `UpdatePolicyPolicyId` for policy_id failed".to_string()
63437 });
63438 self
63439 }
63440 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
63441 where
63442 V: std::convert::TryInto<types::UpdatePolicyXIdempotencyKey>,
63443 {
63444 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
63445 "conversion to `UpdatePolicyXIdempotencyKey` for x_idempotency_key failed"
63446 .to_string()
63447 });
63448 self
63449 }
63450 pub fn body<V>(mut self, value: V) -> Self
63451 where
63452 V: std::convert::TryInto<types::UpdatePolicyBody>,
63453 <V as std::convert::TryInto<types::UpdatePolicyBody>>::Error: std::fmt::Display,
63454 {
63455 self.body = value
63456 .try_into()
63457 .map(From::from)
63458 .map_err(|s| format!("conversion to `UpdatePolicyBody` for body failed: {}", s));
63459 self
63460 }
63461 pub fn body_map<F>(mut self, f: F) -> Self
63462 where
63463 F: std::ops::FnOnce(
63464 types::builder::UpdatePolicyBody,
63465 ) -> types::builder::UpdatePolicyBody,
63466 {
63467 self.body = self.body.map(f);
63468 self
63469 }
63470 pub async fn send(self) -> Result<ResponseValue<types::Policy>, Error<types::Error>> {
63472 let Self {
63473 client,
63474 policy_id,
63475 x_idempotency_key,
63476 body,
63477 } = self;
63478 let policy_id = policy_id.map_err(Error::InvalidRequest)?;
63479 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
63480 let body = body
63481 .and_then(|v| types::UpdatePolicyBody::try_from(v).map_err(|e| e.to_string()))
63482 .map_err(Error::InvalidRequest)?;
63483 let url = format!(
63484 "{}/v2/policy-engine/policies/{}",
63485 client.baseurl,
63486 encode_path(&policy_id.to_string()),
63487 );
63488 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
63489 header_map.append(
63490 ::reqwest::header::HeaderName::from_static("api-version"),
63491 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63492 );
63493 if let Some(value) = x_idempotency_key {
63494 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
63495 }
63496 #[allow(unused_mut)]
63497 let mut request = client
63498 .client
63499 .put(url)
63500 .header(
63501 ::reqwest::header::ACCEPT,
63502 ::reqwest::header::HeaderValue::from_static("application/json"),
63503 )
63504 .json(&body)
63505 .headers(header_map)
63506 .build()?;
63507 let info = OperationInfo {
63508 operation_id: "update_policy",
63509 };
63510 client.pre(&mut request, &info).await?;
63511 let result = client.exec(request, &info).await;
63512 client.post(&result, &info).await?;
63513 let response = result?;
63514 match response.status().as_u16() {
63515 200u16 => ResponseValue::from_response(response).await,
63516 400u16 => Err(Error::ErrorResponse(
63517 ResponseValue::from_response(response).await?,
63518 )),
63519 404u16 => Err(Error::ErrorResponse(
63520 ResponseValue::from_response(response).await?,
63521 )),
63522 409u16 => Err(Error::ErrorResponse(
63523 ResponseValue::from_response(response).await?,
63524 )),
63525 422u16 => Err(Error::ErrorResponse(
63526 ResponseValue::from_response(response).await?,
63527 )),
63528 500u16 => Err(Error::ErrorResponse(
63529 ResponseValue::from_response(response).await?,
63530 )),
63531 502u16 => Err(Error::ErrorResponse(
63532 ResponseValue::from_response(response).await?,
63533 )),
63534 503u16 => Err(Error::ErrorResponse(
63535 ResponseValue::from_response(response).await?,
63536 )),
63537 _ => Err(Error::UnexpectedResponse(response)),
63538 }
63539 }
63540 }
63541 #[derive(Debug, Clone)]
63545 pub struct DeletePolicy<'a> {
63546 client: &'a super::Client,
63547 policy_id: Result<types::DeletePolicyPolicyId, String>,
63548 x_idempotency_key: Result<Option<types::DeletePolicyXIdempotencyKey>, String>,
63549 }
63550 impl<'a> DeletePolicy<'a> {
63551 pub fn new(client: &'a super::Client) -> Self {
63552 Self {
63553 client: client,
63554 policy_id: Err("policy_id was not initialized".to_string()),
63555 x_idempotency_key: Ok(None),
63556 }
63557 }
63558 pub fn policy_id<V>(mut self, value: V) -> Self
63559 where
63560 V: std::convert::TryInto<types::DeletePolicyPolicyId>,
63561 {
63562 self.policy_id = value.try_into().map_err(|_| {
63563 "conversion to `DeletePolicyPolicyId` for policy_id failed".to_string()
63564 });
63565 self
63566 }
63567 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
63568 where
63569 V: std::convert::TryInto<types::DeletePolicyXIdempotencyKey>,
63570 {
63571 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
63572 "conversion to `DeletePolicyXIdempotencyKey` for x_idempotency_key failed"
63573 .to_string()
63574 });
63575 self
63576 }
63577 pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
63579 let Self {
63580 client,
63581 policy_id,
63582 x_idempotency_key,
63583 } = self;
63584 let policy_id = policy_id.map_err(Error::InvalidRequest)?;
63585 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
63586 let url = format!(
63587 "{}/v2/policy-engine/policies/{}",
63588 client.baseurl,
63589 encode_path(&policy_id.to_string()),
63590 );
63591 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
63592 header_map.append(
63593 ::reqwest::header::HeaderName::from_static("api-version"),
63594 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63595 );
63596 if let Some(value) = x_idempotency_key {
63597 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
63598 }
63599 #[allow(unused_mut)]
63600 let mut request = client
63601 .client
63602 .delete(url)
63603 .header(
63604 ::reqwest::header::ACCEPT,
63605 ::reqwest::header::HeaderValue::from_static("application/json"),
63606 )
63607 .headers(header_map)
63608 .build()?;
63609 let info = OperationInfo {
63610 operation_id: "delete_policy",
63611 };
63612 client.pre(&mut request, &info).await?;
63613 let result = client.exec(request, &info).await;
63614 client.post(&result, &info).await?;
63615 let response = result?;
63616 match response.status().as_u16() {
63617 204u16 => Ok(ResponseValue::empty(response)),
63618 400u16 => Err(Error::ErrorResponse(
63619 ResponseValue::from_response(response).await?,
63620 )),
63621 404u16 => Err(Error::ErrorResponse(
63622 ResponseValue::from_response(response).await?,
63623 )),
63624 409u16 => Err(Error::ErrorResponse(
63625 ResponseValue::from_response(response).await?,
63626 )),
63627 422u16 => Err(Error::ErrorResponse(
63628 ResponseValue::from_response(response).await?,
63629 )),
63630 500u16 => Err(Error::ErrorResponse(
63631 ResponseValue::from_response(response).await?,
63632 )),
63633 502u16 => Err(Error::ErrorResponse(
63634 ResponseValue::from_response(response).await?,
63635 )),
63636 503u16 => Err(Error::ErrorResponse(
63637 ResponseValue::from_response(response).await?,
63638 )),
63639 _ => Err(Error::UnexpectedResponse(response)),
63640 }
63641 }
63642 }
63643 #[derive(Debug, Clone)]
63647 pub struct ListSolanaAccounts<'a> {
63648 client: &'a super::Client,
63649 page_size: Result<Option<i64>, String>,
63650 page_token: Result<Option<::std::string::String>, String>,
63651 }
63652 impl<'a> ListSolanaAccounts<'a> {
63653 pub fn new(client: &'a super::Client) -> Self {
63654 Self {
63655 client: client,
63656 page_size: Ok(None),
63657 page_token: Ok(None),
63658 }
63659 }
63660 pub fn page_size<V>(mut self, value: V) -> Self
63661 where
63662 V: std::convert::TryInto<i64>,
63663 {
63664 self.page_size = value
63665 .try_into()
63666 .map(Some)
63667 .map_err(|_| "conversion to `i64` for page_size failed".to_string());
63668 self
63669 }
63670 pub fn page_token<V>(mut self, value: V) -> Self
63671 where
63672 V: std::convert::TryInto<::std::string::String>,
63673 {
63674 self.page_token = value.try_into().map(Some).map_err(|_| {
63675 "conversion to `:: std :: string :: String` for page_token failed".to_string()
63676 });
63677 self
63678 }
63679 pub async fn send(
63681 self,
63682 ) -> Result<ResponseValue<types::ListSolanaAccountsResponse>, Error<types::Error>> {
63683 let Self {
63684 client,
63685 page_size,
63686 page_token,
63687 } = self;
63688 let page_size = page_size.map_err(Error::InvalidRequest)?;
63689 let page_token = page_token.map_err(Error::InvalidRequest)?;
63690 let url = format!("{}/v2/solana/accounts", client.baseurl,);
63691 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
63692 header_map.append(
63693 ::reqwest::header::HeaderName::from_static("api-version"),
63694 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63695 );
63696 #[allow(unused_mut)]
63697 let mut request = client
63698 .client
63699 .get(url)
63700 .header(
63701 ::reqwest::header::ACCEPT,
63702 ::reqwest::header::HeaderValue::from_static("application/json"),
63703 )
63704 .query(&progenitor_middleware_client::QueryParam::new(
63705 "pageSize", &page_size,
63706 ))
63707 .query(&progenitor_middleware_client::QueryParam::new(
63708 "pageToken",
63709 &page_token,
63710 ))
63711 .headers(header_map)
63712 .build()?;
63713 let info = OperationInfo {
63714 operation_id: "list_solana_accounts",
63715 };
63716 client.pre(&mut request, &info).await?;
63717 let result = client.exec(request, &info).await;
63718 client.post(&result, &info).await?;
63719 let response = result?;
63720 match response.status().as_u16() {
63721 200u16 => ResponseValue::from_response(response).await,
63722 500u16 => Err(Error::ErrorResponse(
63723 ResponseValue::from_response(response).await?,
63724 )),
63725 502u16 => Err(Error::ErrorResponse(
63726 ResponseValue::from_response(response).await?,
63727 )),
63728 503u16 => Err(Error::ErrorResponse(
63729 ResponseValue::from_response(response).await?,
63730 )),
63731 _ => Err(Error::UnexpectedResponse(response)),
63732 }
63733 }
63734 }
63735 #[derive(Debug, Clone)]
63739 pub struct CreateSolanaAccount<'a> {
63740 client: &'a super::Client,
63741 x_idempotency_key: Result<Option<types::CreateSolanaAccountXIdempotencyKey>, String>,
63742 x_wallet_auth: Result<::std::string::String, String>,
63743 body: Result<types::builder::CreateSolanaAccountBody, String>,
63744 }
63745 impl<'a> CreateSolanaAccount<'a> {
63746 pub fn new(client: &'a super::Client) -> Self {
63747 Self {
63748 client: client,
63749 x_idempotency_key: Ok(None),
63750 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
63751 body: Ok(::std::default::Default::default()),
63752 }
63753 }
63754 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
63755 where
63756 V: std::convert::TryInto<types::CreateSolanaAccountXIdempotencyKey>,
63757 {
63758 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
63759 "conversion to `CreateSolanaAccountXIdempotencyKey` for x_idempotency_key failed"
63760 .to_string()
63761 });
63762 self
63763 }
63764 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
63765 where
63766 V: std::convert::TryInto<::std::string::String>,
63767 {
63768 self.x_wallet_auth = value.try_into().map_err(|_| {
63769 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
63770 });
63771 self
63772 }
63773 pub fn body<V>(mut self, value: V) -> Self
63774 where
63775 V: std::convert::TryInto<types::CreateSolanaAccountBody>,
63776 <V as std::convert::TryInto<types::CreateSolanaAccountBody>>::Error: std::fmt::Display,
63777 {
63778 self.body = value.try_into().map(From::from).map_err(|s| {
63779 format!(
63780 "conversion to `CreateSolanaAccountBody` for body failed: {}",
63781 s
63782 )
63783 });
63784 self
63785 }
63786 pub fn body_map<F>(mut self, f: F) -> Self
63787 where
63788 F: std::ops::FnOnce(
63789 types::builder::CreateSolanaAccountBody,
63790 ) -> types::builder::CreateSolanaAccountBody,
63791 {
63792 self.body = self.body.map(f);
63793 self
63794 }
63795 pub async fn send(
63797 self,
63798 ) -> Result<ResponseValue<types::SolanaAccount>, Error<types::Error>> {
63799 let Self {
63800 client,
63801 x_idempotency_key,
63802 x_wallet_auth,
63803 body,
63804 } = self;
63805 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
63806 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
63807 let body = body
63808 .and_then(|v| {
63809 types::CreateSolanaAccountBody::try_from(v).map_err(|e| e.to_string())
63810 })
63811 .map_err(Error::InvalidRequest)?;
63812 let url = format!("{}/v2/solana/accounts", client.baseurl,);
63813 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
63814 header_map.append(
63815 ::reqwest::header::HeaderName::from_static("api-version"),
63816 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63817 );
63818 if let Some(value) = x_idempotency_key {
63819 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
63820 }
63821 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
63822 #[allow(unused_mut)]
63823 let mut request = client
63824 .client
63825 .post(url)
63826 .header(
63827 ::reqwest::header::ACCEPT,
63828 ::reqwest::header::HeaderValue::from_static("application/json"),
63829 )
63830 .json(&body)
63831 .headers(header_map)
63832 .build()?;
63833 let info = OperationInfo {
63834 operation_id: "create_solana_account",
63835 };
63836 client.pre(&mut request, &info).await?;
63837 let result = client.exec(request, &info).await;
63838 client.post(&result, &info).await?;
63839 let response = result?;
63840 match response.status().as_u16() {
63841 201u16 => ResponseValue::from_response(response).await,
63842 400u16 => Err(Error::ErrorResponse(
63843 ResponseValue::from_response(response).await?,
63844 )),
63845 401u16 => Err(Error::ErrorResponse(
63846 ResponseValue::from_response(response).await?,
63847 )),
63848 402u16 => Err(Error::ErrorResponse(
63849 ResponseValue::from_response(response).await?,
63850 )),
63851 409u16 => Err(Error::ErrorResponse(
63852 ResponseValue::from_response(response).await?,
63853 )),
63854 422u16 => Err(Error::ErrorResponse(
63855 ResponseValue::from_response(response).await?,
63856 )),
63857 500u16 => Err(Error::ErrorResponse(
63858 ResponseValue::from_response(response).await?,
63859 )),
63860 502u16 => Err(Error::ErrorResponse(
63861 ResponseValue::from_response(response).await?,
63862 )),
63863 503u16 => Err(Error::ErrorResponse(
63864 ResponseValue::from_response(response).await?,
63865 )),
63866 _ => Err(Error::UnexpectedResponse(response)),
63867 }
63868 }
63869 }
63870 #[derive(Debug, Clone)]
63874 pub struct GetSolanaAccountByName<'a> {
63875 client: &'a super::Client,
63876 name: Result<::std::string::String, String>,
63877 }
63878 impl<'a> GetSolanaAccountByName<'a> {
63879 pub fn new(client: &'a super::Client) -> Self {
63880 Self {
63881 client: client,
63882 name: Err("name was not initialized".to_string()),
63883 }
63884 }
63885 pub fn name<V>(mut self, value: V) -> Self
63886 where
63887 V: std::convert::TryInto<::std::string::String>,
63888 {
63889 self.name = value.try_into().map_err(|_| {
63890 "conversion to `:: std :: string :: String` for name failed".to_string()
63891 });
63892 self
63893 }
63894 pub async fn send(
63896 self,
63897 ) -> Result<ResponseValue<types::SolanaAccount>, Error<types::Error>> {
63898 let Self { client, name } = self;
63899 let name = name.map_err(Error::InvalidRequest)?;
63900 let url = format!(
63901 "{}/v2/solana/accounts/by-name/{}",
63902 client.baseurl,
63903 encode_path(&name.to_string()),
63904 );
63905 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
63906 header_map.append(
63907 ::reqwest::header::HeaderName::from_static("api-version"),
63908 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
63909 );
63910 #[allow(unused_mut)]
63911 let mut request = client
63912 .client
63913 .get(url)
63914 .header(
63915 ::reqwest::header::ACCEPT,
63916 ::reqwest::header::HeaderValue::from_static("application/json"),
63917 )
63918 .headers(header_map)
63919 .build()?;
63920 let info = OperationInfo {
63921 operation_id: "get_solana_account_by_name",
63922 };
63923 client.pre(&mut request, &info).await?;
63924 let result = client.exec(request, &info).await;
63925 client.post(&result, &info).await?;
63926 let response = result?;
63927 match response.status().as_u16() {
63928 200u16 => ResponseValue::from_response(response).await,
63929 400u16 => Err(Error::ErrorResponse(
63930 ResponseValue::from_response(response).await?,
63931 )),
63932 404u16 => Err(Error::ErrorResponse(
63933 ResponseValue::from_response(response).await?,
63934 )),
63935 500u16 => Err(Error::ErrorResponse(
63936 ResponseValue::from_response(response).await?,
63937 )),
63938 502u16 => Err(Error::ErrorResponse(
63939 ResponseValue::from_response(response).await?,
63940 )),
63941 503u16 => Err(Error::ErrorResponse(
63942 ResponseValue::from_response(response).await?,
63943 )),
63944 _ => Err(Error::UnexpectedResponse(response)),
63945 }
63946 }
63947 }
63948 #[derive(Debug, Clone)]
63952 pub struct ExportSolanaAccountByName<'a> {
63953 client: &'a super::Client,
63954 name: Result<::std::string::String, String>,
63955 x_idempotency_key: Result<Option<types::ExportSolanaAccountByNameXIdempotencyKey>, String>,
63956 x_wallet_auth: Result<::std::string::String, String>,
63957 body: Result<types::builder::ExportSolanaAccountByNameBody, String>,
63958 }
63959 impl<'a> ExportSolanaAccountByName<'a> {
63960 pub fn new(client: &'a super::Client) -> Self {
63961 Self {
63962 client: client,
63963 name: Err("name was not initialized".to_string()),
63964 x_idempotency_key: Ok(None),
63965 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
63966 body: Ok(::std::default::Default::default()),
63967 }
63968 }
63969 pub fn name<V>(mut self, value: V) -> Self
63970 where
63971 V: std::convert::TryInto<::std::string::String>,
63972 {
63973 self.name = value.try_into().map_err(|_| {
63974 "conversion to `:: std :: string :: String` for name failed".to_string()
63975 });
63976 self
63977 }
63978 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
63979 where
63980 V: std::convert::TryInto<types::ExportSolanaAccountByNameXIdempotencyKey>,
63981 {
63982 self.x_idempotency_key = value
63983 .try_into()
63984 .map(Some)
63985 .map_err(|_| {
63986 "conversion to `ExportSolanaAccountByNameXIdempotencyKey` for x_idempotency_key failed"
63987 .to_string()
63988 });
63989 self
63990 }
63991 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
63992 where
63993 V: std::convert::TryInto<::std::string::String>,
63994 {
63995 self.x_wallet_auth = value.try_into().map_err(|_| {
63996 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
63997 });
63998 self
63999 }
64000 pub fn body<V>(mut self, value: V) -> Self
64001 where
64002 V: std::convert::TryInto<types::ExportSolanaAccountByNameBody>,
64003 <V as std::convert::TryInto<types::ExportSolanaAccountByNameBody>>::Error:
64004 std::fmt::Display,
64005 {
64006 self.body = value.try_into().map(From::from).map_err(|s| {
64007 format!(
64008 "conversion to `ExportSolanaAccountByNameBody` for body failed: {}",
64009 s
64010 )
64011 });
64012 self
64013 }
64014 pub fn body_map<F>(mut self, f: F) -> Self
64015 where
64016 F: std::ops::FnOnce(
64017 types::builder::ExportSolanaAccountByNameBody,
64018 ) -> types::builder::ExportSolanaAccountByNameBody,
64019 {
64020 self.body = self.body.map(f);
64021 self
64022 }
64023 pub async fn send(
64025 self,
64026 ) -> Result<ResponseValue<types::ExportSolanaAccountByNameResponse>, Error<types::Error>>
64027 {
64028 let Self {
64029 client,
64030 name,
64031 x_idempotency_key,
64032 x_wallet_auth,
64033 body,
64034 } = self;
64035 let name = name.map_err(Error::InvalidRequest)?;
64036 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
64037 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
64038 let body = body
64039 .and_then(|v| {
64040 types::ExportSolanaAccountByNameBody::try_from(v).map_err(|e| e.to_string())
64041 })
64042 .map_err(Error::InvalidRequest)?;
64043 let url = format!(
64044 "{}/v2/solana/accounts/export/by-name/{}",
64045 client.baseurl,
64046 encode_path(&name.to_string()),
64047 );
64048 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
64049 header_map.append(
64050 ::reqwest::header::HeaderName::from_static("api-version"),
64051 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
64052 );
64053 if let Some(value) = x_idempotency_key {
64054 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
64055 }
64056 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
64057 #[allow(unused_mut)]
64058 let mut request = client
64059 .client
64060 .post(url)
64061 .header(
64062 ::reqwest::header::ACCEPT,
64063 ::reqwest::header::HeaderValue::from_static("application/json"),
64064 )
64065 .json(&body)
64066 .headers(header_map)
64067 .build()?;
64068 let info = OperationInfo {
64069 operation_id: "export_solana_account_by_name",
64070 };
64071 client.pre(&mut request, &info).await?;
64072 let result = client.exec(request, &info).await;
64073 client.post(&result, &info).await?;
64074 let response = result?;
64075 match response.status().as_u16() {
64076 200u16 => ResponseValue::from_response(response).await,
64077 400u16 => Err(Error::ErrorResponse(
64078 ResponseValue::from_response(response).await?,
64079 )),
64080 401u16 => Err(Error::ErrorResponse(
64081 ResponseValue::from_response(response).await?,
64082 )),
64083 402u16 => Err(Error::ErrorResponse(
64084 ResponseValue::from_response(response).await?,
64085 )),
64086 404u16 => Err(Error::ErrorResponse(
64087 ResponseValue::from_response(response).await?,
64088 )),
64089 422u16 => Err(Error::ErrorResponse(
64090 ResponseValue::from_response(response).await?,
64091 )),
64092 500u16 => Err(Error::ErrorResponse(
64093 ResponseValue::from_response(response).await?,
64094 )),
64095 502u16 => Err(Error::ErrorResponse(
64096 ResponseValue::from_response(response).await?,
64097 )),
64098 503u16 => Err(Error::ErrorResponse(
64099 ResponseValue::from_response(response).await?,
64100 )),
64101 _ => Err(Error::UnexpectedResponse(response)),
64102 }
64103 }
64104 }
64105 #[derive(Debug, Clone)]
64109 pub struct ImportSolanaAccount<'a> {
64110 client: &'a super::Client,
64111 x_idempotency_key: Result<Option<types::ImportSolanaAccountXIdempotencyKey>, String>,
64112 x_wallet_auth: Result<::std::string::String, String>,
64113 body: Result<types::builder::ImportSolanaAccountBody, String>,
64114 }
64115 impl<'a> ImportSolanaAccount<'a> {
64116 pub fn new(client: &'a super::Client) -> Self {
64117 Self {
64118 client: client,
64119 x_idempotency_key: Ok(None),
64120 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
64121 body: Ok(::std::default::Default::default()),
64122 }
64123 }
64124 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
64125 where
64126 V: std::convert::TryInto<types::ImportSolanaAccountXIdempotencyKey>,
64127 {
64128 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
64129 "conversion to `ImportSolanaAccountXIdempotencyKey` for x_idempotency_key failed"
64130 .to_string()
64131 });
64132 self
64133 }
64134 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
64135 where
64136 V: std::convert::TryInto<::std::string::String>,
64137 {
64138 self.x_wallet_auth = value.try_into().map_err(|_| {
64139 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
64140 });
64141 self
64142 }
64143 pub fn body<V>(mut self, value: V) -> Self
64144 where
64145 V: std::convert::TryInto<types::ImportSolanaAccountBody>,
64146 <V as std::convert::TryInto<types::ImportSolanaAccountBody>>::Error: std::fmt::Display,
64147 {
64148 self.body = value.try_into().map(From::from).map_err(|s| {
64149 format!(
64150 "conversion to `ImportSolanaAccountBody` for body failed: {}",
64151 s
64152 )
64153 });
64154 self
64155 }
64156 pub fn body_map<F>(mut self, f: F) -> Self
64157 where
64158 F: std::ops::FnOnce(
64159 types::builder::ImportSolanaAccountBody,
64160 ) -> types::builder::ImportSolanaAccountBody,
64161 {
64162 self.body = self.body.map(f);
64163 self
64164 }
64165 pub async fn send(
64167 self,
64168 ) -> Result<ResponseValue<types::SolanaAccount>, Error<types::Error>> {
64169 let Self {
64170 client,
64171 x_idempotency_key,
64172 x_wallet_auth,
64173 body,
64174 } = self;
64175 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
64176 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
64177 let body = body
64178 .and_then(|v| {
64179 types::ImportSolanaAccountBody::try_from(v).map_err(|e| e.to_string())
64180 })
64181 .map_err(Error::InvalidRequest)?;
64182 let url = format!("{}/v2/solana/accounts/import", client.baseurl,);
64183 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
64184 header_map.append(
64185 ::reqwest::header::HeaderName::from_static("api-version"),
64186 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
64187 );
64188 if let Some(value) = x_idempotency_key {
64189 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
64190 }
64191 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
64192 #[allow(unused_mut)]
64193 let mut request = client
64194 .client
64195 .post(url)
64196 .header(
64197 ::reqwest::header::ACCEPT,
64198 ::reqwest::header::HeaderValue::from_static("application/json"),
64199 )
64200 .json(&body)
64201 .headers(header_map)
64202 .build()?;
64203 let info = OperationInfo {
64204 operation_id: "import_solana_account",
64205 };
64206 client.pre(&mut request, &info).await?;
64207 let result = client.exec(request, &info).await;
64208 client.post(&result, &info).await?;
64209 let response = result?;
64210 match response.status().as_u16() {
64211 201u16 => ResponseValue::from_response(response).await,
64212 400u16 => Err(Error::ErrorResponse(
64213 ResponseValue::from_response(response).await?,
64214 )),
64215 401u16 => Err(Error::ErrorResponse(
64216 ResponseValue::from_response(response).await?,
64217 )),
64218 402u16 => Err(Error::ErrorResponse(
64219 ResponseValue::from_response(response).await?,
64220 )),
64221 409u16 => Err(Error::ErrorResponse(
64222 ResponseValue::from_response(response).await?,
64223 )),
64224 422u16 => Err(Error::ErrorResponse(
64225 ResponseValue::from_response(response).await?,
64226 )),
64227 500u16 => Err(Error::ErrorResponse(
64228 ResponseValue::from_response(response).await?,
64229 )),
64230 502u16 => Err(Error::ErrorResponse(
64231 ResponseValue::from_response(response).await?,
64232 )),
64233 503u16 => Err(Error::ErrorResponse(
64234 ResponseValue::from_response(response).await?,
64235 )),
64236 _ => Err(Error::UnexpectedResponse(response)),
64237 }
64238 }
64239 }
64240 #[derive(Debug, Clone)]
64244 pub struct SendSolanaTransaction<'a> {
64245 client: &'a super::Client,
64246 x_idempotency_key: Result<Option<types::SendSolanaTransactionXIdempotencyKey>, String>,
64247 x_wallet_auth: Result<::std::string::String, String>,
64248 body: Result<types::builder::SendSolanaTransactionBody, String>,
64249 }
64250 impl<'a> SendSolanaTransaction<'a> {
64251 pub fn new(client: &'a super::Client) -> Self {
64252 Self {
64253 client: client,
64254 x_idempotency_key: Ok(None),
64255 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
64256 body: Ok(::std::default::Default::default()),
64257 }
64258 }
64259 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
64260 where
64261 V: std::convert::TryInto<types::SendSolanaTransactionXIdempotencyKey>,
64262 {
64263 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
64264 "conversion to `SendSolanaTransactionXIdempotencyKey` for x_idempotency_key failed"
64265 .to_string()
64266 });
64267 self
64268 }
64269 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
64270 where
64271 V: std::convert::TryInto<::std::string::String>,
64272 {
64273 self.x_wallet_auth = value.try_into().map_err(|_| {
64274 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
64275 });
64276 self
64277 }
64278 pub fn body<V>(mut self, value: V) -> Self
64279 where
64280 V: std::convert::TryInto<types::SendSolanaTransactionBody>,
64281 <V as std::convert::TryInto<types::SendSolanaTransactionBody>>::Error:
64282 std::fmt::Display,
64283 {
64284 self.body = value.try_into().map(From::from).map_err(|s| {
64285 format!(
64286 "conversion to `SendSolanaTransactionBody` for body failed: {}",
64287 s
64288 )
64289 });
64290 self
64291 }
64292 pub fn body_map<F>(mut self, f: F) -> Self
64293 where
64294 F: std::ops::FnOnce(
64295 types::builder::SendSolanaTransactionBody,
64296 ) -> types::builder::SendSolanaTransactionBody,
64297 {
64298 self.body = self.body.map(f);
64299 self
64300 }
64301 pub async fn send(
64303 self,
64304 ) -> Result<ResponseValue<types::SendSolanaTransactionResponse>, Error<types::Error>>
64305 {
64306 let Self {
64307 client,
64308 x_idempotency_key,
64309 x_wallet_auth,
64310 body,
64311 } = self;
64312 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
64313 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
64314 let body = body
64315 .and_then(|v| {
64316 types::SendSolanaTransactionBody::try_from(v).map_err(|e| e.to_string())
64317 })
64318 .map_err(Error::InvalidRequest)?;
64319 let url = format!("{}/v2/solana/accounts/send/transaction", client.baseurl,);
64320 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
64321 header_map.append(
64322 ::reqwest::header::HeaderName::from_static("api-version"),
64323 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
64324 );
64325 if let Some(value) = x_idempotency_key {
64326 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
64327 }
64328 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
64329 #[allow(unused_mut)]
64330 let mut request = client
64331 .client
64332 .post(url)
64333 .header(
64334 ::reqwest::header::ACCEPT,
64335 ::reqwest::header::HeaderValue::from_static("application/json"),
64336 )
64337 .json(&body)
64338 .headers(header_map)
64339 .build()?;
64340 let info = OperationInfo {
64341 operation_id: "send_solana_transaction",
64342 };
64343 client.pre(&mut request, &info).await?;
64344 let result = client.exec(request, &info).await;
64345 client.post(&result, &info).await?;
64346 let response = result?;
64347 match response.status().as_u16() {
64348 200u16 => ResponseValue::from_response(response).await,
64349 400u16 => Err(Error::ErrorResponse(
64350 ResponseValue::from_response(response).await?,
64351 )),
64352 401u16 => Err(Error::ErrorResponse(
64353 ResponseValue::from_response(response).await?,
64354 )),
64355 402u16 => Err(Error::ErrorResponse(
64356 ResponseValue::from_response(response).await?,
64357 )),
64358 403u16 => Err(Error::ErrorResponse(
64359 ResponseValue::from_response(response).await?,
64360 )),
64361 404u16 => Err(Error::ErrorResponse(
64362 ResponseValue::from_response(response).await?,
64363 )),
64364 422u16 => Err(Error::ErrorResponse(
64365 ResponseValue::from_response(response).await?,
64366 )),
64367 500u16 => Err(Error::ErrorResponse(
64368 ResponseValue::from_response(response).await?,
64369 )),
64370 502u16 => Err(Error::ErrorResponse(
64371 ResponseValue::from_response(response).await?,
64372 )),
64373 503u16 => Err(Error::ErrorResponse(
64374 ResponseValue::from_response(response).await?,
64375 )),
64376 _ => Err(Error::UnexpectedResponse(response)),
64377 }
64378 }
64379 }
64380 #[derive(Debug, Clone)]
64384 pub struct GetSolanaAccount<'a> {
64385 client: &'a super::Client,
64386 address: Result<types::GetSolanaAccountAddress, String>,
64387 }
64388 impl<'a> GetSolanaAccount<'a> {
64389 pub fn new(client: &'a super::Client) -> Self {
64390 Self {
64391 client: client,
64392 address: Err("address was not initialized".to_string()),
64393 }
64394 }
64395 pub fn address<V>(mut self, value: V) -> Self
64396 where
64397 V: std::convert::TryInto<types::GetSolanaAccountAddress>,
64398 {
64399 self.address = value.try_into().map_err(|_| {
64400 "conversion to `GetSolanaAccountAddress` for address failed".to_string()
64401 });
64402 self
64403 }
64404 pub async fn send(
64406 self,
64407 ) -> Result<ResponseValue<types::SolanaAccount>, Error<types::Error>> {
64408 let Self { client, address } = self;
64409 let address = address.map_err(Error::InvalidRequest)?;
64410 let url = format!(
64411 "{}/v2/solana/accounts/{}",
64412 client.baseurl,
64413 encode_path(&address.to_string()),
64414 );
64415 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
64416 header_map.append(
64417 ::reqwest::header::HeaderName::from_static("api-version"),
64418 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
64419 );
64420 #[allow(unused_mut)]
64421 let mut request = client
64422 .client
64423 .get(url)
64424 .header(
64425 ::reqwest::header::ACCEPT,
64426 ::reqwest::header::HeaderValue::from_static("application/json"),
64427 )
64428 .headers(header_map)
64429 .build()?;
64430 let info = OperationInfo {
64431 operation_id: "get_solana_account",
64432 };
64433 client.pre(&mut request, &info).await?;
64434 let result = client.exec(request, &info).await;
64435 client.post(&result, &info).await?;
64436 let response = result?;
64437 match response.status().as_u16() {
64438 200u16 => ResponseValue::from_response(response).await,
64439 400u16 => Err(Error::ErrorResponse(
64440 ResponseValue::from_response(response).await?,
64441 )),
64442 404u16 => Err(Error::ErrorResponse(
64443 ResponseValue::from_response(response).await?,
64444 )),
64445 500u16 => Err(Error::ErrorResponse(
64446 ResponseValue::from_response(response).await?,
64447 )),
64448 502u16 => Err(Error::ErrorResponse(
64449 ResponseValue::from_response(response).await?,
64450 )),
64451 503u16 => Err(Error::ErrorResponse(
64452 ResponseValue::from_response(response).await?,
64453 )),
64454 _ => Err(Error::UnexpectedResponse(response)),
64455 }
64456 }
64457 }
64458 #[derive(Debug, Clone)]
64462 pub struct UpdateSolanaAccount<'a> {
64463 client: &'a super::Client,
64464 address: Result<types::UpdateSolanaAccountAddress, String>,
64465 x_idempotency_key: Result<Option<types::UpdateSolanaAccountXIdempotencyKey>, String>,
64466 body: Result<types::builder::UpdateSolanaAccountBody, String>,
64467 }
64468 impl<'a> UpdateSolanaAccount<'a> {
64469 pub fn new(client: &'a super::Client) -> Self {
64470 Self {
64471 client: client,
64472 address: Err("address was not initialized".to_string()),
64473 x_idempotency_key: Ok(None),
64474 body: Ok(::std::default::Default::default()),
64475 }
64476 }
64477 pub fn address<V>(mut self, value: V) -> Self
64478 where
64479 V: std::convert::TryInto<types::UpdateSolanaAccountAddress>,
64480 {
64481 self.address = value.try_into().map_err(|_| {
64482 "conversion to `UpdateSolanaAccountAddress` for address failed".to_string()
64483 });
64484 self
64485 }
64486 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
64487 where
64488 V: std::convert::TryInto<types::UpdateSolanaAccountXIdempotencyKey>,
64489 {
64490 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
64491 "conversion to `UpdateSolanaAccountXIdempotencyKey` for x_idempotency_key failed"
64492 .to_string()
64493 });
64494 self
64495 }
64496 pub fn body<V>(mut self, value: V) -> Self
64497 where
64498 V: std::convert::TryInto<types::UpdateSolanaAccountBody>,
64499 <V as std::convert::TryInto<types::UpdateSolanaAccountBody>>::Error: std::fmt::Display,
64500 {
64501 self.body = value.try_into().map(From::from).map_err(|s| {
64502 format!(
64503 "conversion to `UpdateSolanaAccountBody` for body failed: {}",
64504 s
64505 )
64506 });
64507 self
64508 }
64509 pub fn body_map<F>(mut self, f: F) -> Self
64510 where
64511 F: std::ops::FnOnce(
64512 types::builder::UpdateSolanaAccountBody,
64513 ) -> types::builder::UpdateSolanaAccountBody,
64514 {
64515 self.body = self.body.map(f);
64516 self
64517 }
64518 pub async fn send(
64520 self,
64521 ) -> Result<ResponseValue<types::SolanaAccount>, Error<types::Error>> {
64522 let Self {
64523 client,
64524 address,
64525 x_idempotency_key,
64526 body,
64527 } = self;
64528 let address = address.map_err(Error::InvalidRequest)?;
64529 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
64530 let body = body
64531 .and_then(|v| {
64532 types::UpdateSolanaAccountBody::try_from(v).map_err(|e| e.to_string())
64533 })
64534 .map_err(Error::InvalidRequest)?;
64535 let url = format!(
64536 "{}/v2/solana/accounts/{}",
64537 client.baseurl,
64538 encode_path(&address.to_string()),
64539 );
64540 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
64541 header_map.append(
64542 ::reqwest::header::HeaderName::from_static("api-version"),
64543 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
64544 );
64545 if let Some(value) = x_idempotency_key {
64546 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
64547 }
64548 #[allow(unused_mut)]
64549 let mut request = client
64550 .client
64551 .put(url)
64552 .header(
64553 ::reqwest::header::ACCEPT,
64554 ::reqwest::header::HeaderValue::from_static("application/json"),
64555 )
64556 .json(&body)
64557 .headers(header_map)
64558 .build()?;
64559 let info = OperationInfo {
64560 operation_id: "update_solana_account",
64561 };
64562 client.pre(&mut request, &info).await?;
64563 let result = client.exec(request, &info).await;
64564 client.post(&result, &info).await?;
64565 let response = result?;
64566 match response.status().as_u16() {
64567 200u16 => ResponseValue::from_response(response).await,
64568 400u16 => Err(Error::ErrorResponse(
64569 ResponseValue::from_response(response).await?,
64570 )),
64571 404u16 => Err(Error::ErrorResponse(
64572 ResponseValue::from_response(response).await?,
64573 )),
64574 409u16 => Err(Error::ErrorResponse(
64575 ResponseValue::from_response(response).await?,
64576 )),
64577 422u16 => Err(Error::ErrorResponse(
64578 ResponseValue::from_response(response).await?,
64579 )),
64580 500u16 => Err(Error::ErrorResponse(
64581 ResponseValue::from_response(response).await?,
64582 )),
64583 502u16 => Err(Error::ErrorResponse(
64584 ResponseValue::from_response(response).await?,
64585 )),
64586 503u16 => Err(Error::ErrorResponse(
64587 ResponseValue::from_response(response).await?,
64588 )),
64589 _ => Err(Error::UnexpectedResponse(response)),
64590 }
64591 }
64592 }
64593 #[derive(Debug, Clone)]
64597 pub struct ExportSolanaAccount<'a> {
64598 client: &'a super::Client,
64599 address: Result<types::ExportSolanaAccountAddress, String>,
64600 x_idempotency_key: Result<Option<types::ExportSolanaAccountXIdempotencyKey>, String>,
64601 x_wallet_auth: Result<::std::string::String, String>,
64602 body: Result<types::builder::ExportSolanaAccountBody, String>,
64603 }
64604 impl<'a> ExportSolanaAccount<'a> {
64605 pub fn new(client: &'a super::Client) -> Self {
64606 Self {
64607 client: client,
64608 address: Err("address was not initialized".to_string()),
64609 x_idempotency_key: Ok(None),
64610 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
64611 body: Ok(::std::default::Default::default()),
64612 }
64613 }
64614 pub fn address<V>(mut self, value: V) -> Self
64615 where
64616 V: std::convert::TryInto<types::ExportSolanaAccountAddress>,
64617 {
64618 self.address = value.try_into().map_err(|_| {
64619 "conversion to `ExportSolanaAccountAddress` for address failed".to_string()
64620 });
64621 self
64622 }
64623 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
64624 where
64625 V: std::convert::TryInto<types::ExportSolanaAccountXIdempotencyKey>,
64626 {
64627 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
64628 "conversion to `ExportSolanaAccountXIdempotencyKey` for x_idempotency_key failed"
64629 .to_string()
64630 });
64631 self
64632 }
64633 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
64634 where
64635 V: std::convert::TryInto<::std::string::String>,
64636 {
64637 self.x_wallet_auth = value.try_into().map_err(|_| {
64638 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
64639 });
64640 self
64641 }
64642 pub fn body<V>(mut self, value: V) -> Self
64643 where
64644 V: std::convert::TryInto<types::ExportSolanaAccountBody>,
64645 <V as std::convert::TryInto<types::ExportSolanaAccountBody>>::Error: std::fmt::Display,
64646 {
64647 self.body = value.try_into().map(From::from).map_err(|s| {
64648 format!(
64649 "conversion to `ExportSolanaAccountBody` for body failed: {}",
64650 s
64651 )
64652 });
64653 self
64654 }
64655 pub fn body_map<F>(mut self, f: F) -> Self
64656 where
64657 F: std::ops::FnOnce(
64658 types::builder::ExportSolanaAccountBody,
64659 ) -> types::builder::ExportSolanaAccountBody,
64660 {
64661 self.body = self.body.map(f);
64662 self
64663 }
64664 pub async fn send(
64666 self,
64667 ) -> Result<ResponseValue<types::ExportSolanaAccountResponse>, Error<types::Error>>
64668 {
64669 let Self {
64670 client,
64671 address,
64672 x_idempotency_key,
64673 x_wallet_auth,
64674 body,
64675 } = self;
64676 let address = address.map_err(Error::InvalidRequest)?;
64677 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
64678 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
64679 let body = body
64680 .and_then(|v| {
64681 types::ExportSolanaAccountBody::try_from(v).map_err(|e| e.to_string())
64682 })
64683 .map_err(Error::InvalidRequest)?;
64684 let url = format!(
64685 "{}/v2/solana/accounts/{}/export",
64686 client.baseurl,
64687 encode_path(&address.to_string()),
64688 );
64689 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
64690 header_map.append(
64691 ::reqwest::header::HeaderName::from_static("api-version"),
64692 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
64693 );
64694 if let Some(value) = x_idempotency_key {
64695 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
64696 }
64697 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
64698 #[allow(unused_mut)]
64699 let mut request = client
64700 .client
64701 .post(url)
64702 .header(
64703 ::reqwest::header::ACCEPT,
64704 ::reqwest::header::HeaderValue::from_static("application/json"),
64705 )
64706 .json(&body)
64707 .headers(header_map)
64708 .build()?;
64709 let info = OperationInfo {
64710 operation_id: "export_solana_account",
64711 };
64712 client.pre(&mut request, &info).await?;
64713 let result = client.exec(request, &info).await;
64714 client.post(&result, &info).await?;
64715 let response = result?;
64716 match response.status().as_u16() {
64717 200u16 => ResponseValue::from_response(response).await,
64718 400u16 => Err(Error::ErrorResponse(
64719 ResponseValue::from_response(response).await?,
64720 )),
64721 401u16 => Err(Error::ErrorResponse(
64722 ResponseValue::from_response(response).await?,
64723 )),
64724 402u16 => Err(Error::ErrorResponse(
64725 ResponseValue::from_response(response).await?,
64726 )),
64727 404u16 => Err(Error::ErrorResponse(
64728 ResponseValue::from_response(response).await?,
64729 )),
64730 422u16 => Err(Error::ErrorResponse(
64731 ResponseValue::from_response(response).await?,
64732 )),
64733 500u16 => Err(Error::ErrorResponse(
64734 ResponseValue::from_response(response).await?,
64735 )),
64736 502u16 => Err(Error::ErrorResponse(
64737 ResponseValue::from_response(response).await?,
64738 )),
64739 503u16 => Err(Error::ErrorResponse(
64740 ResponseValue::from_response(response).await?,
64741 )),
64742 _ => Err(Error::UnexpectedResponse(response)),
64743 }
64744 }
64745 }
64746 #[derive(Debug, Clone)]
64750 pub struct SignSolanaMessage<'a> {
64751 client: &'a super::Client,
64752 address: Result<types::SignSolanaMessageAddress, String>,
64753 x_idempotency_key: Result<Option<types::SignSolanaMessageXIdempotencyKey>, String>,
64754 x_wallet_auth: Result<::std::string::String, String>,
64755 body: Result<types::builder::SignSolanaMessageBody, String>,
64756 }
64757 impl<'a> SignSolanaMessage<'a> {
64758 pub fn new(client: &'a super::Client) -> Self {
64759 Self {
64760 client: client,
64761 address: Err("address was not initialized".to_string()),
64762 x_idempotency_key: Ok(None),
64763 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
64764 body: Ok(::std::default::Default::default()),
64765 }
64766 }
64767 pub fn address<V>(mut self, value: V) -> Self
64768 where
64769 V: std::convert::TryInto<types::SignSolanaMessageAddress>,
64770 {
64771 self.address = value.try_into().map_err(|_| {
64772 "conversion to `SignSolanaMessageAddress` for address failed".to_string()
64773 });
64774 self
64775 }
64776 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
64777 where
64778 V: std::convert::TryInto<types::SignSolanaMessageXIdempotencyKey>,
64779 {
64780 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
64781 "conversion to `SignSolanaMessageXIdempotencyKey` for x_idempotency_key failed"
64782 .to_string()
64783 });
64784 self
64785 }
64786 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
64787 where
64788 V: std::convert::TryInto<::std::string::String>,
64789 {
64790 self.x_wallet_auth = value.try_into().map_err(|_| {
64791 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
64792 });
64793 self
64794 }
64795 pub fn body<V>(mut self, value: V) -> Self
64796 where
64797 V: std::convert::TryInto<types::SignSolanaMessageBody>,
64798 <V as std::convert::TryInto<types::SignSolanaMessageBody>>::Error: std::fmt::Display,
64799 {
64800 self.body = value.try_into().map(From::from).map_err(|s| {
64801 format!(
64802 "conversion to `SignSolanaMessageBody` for body failed: {}",
64803 s
64804 )
64805 });
64806 self
64807 }
64808 pub fn body_map<F>(mut self, f: F) -> Self
64809 where
64810 F: std::ops::FnOnce(
64811 types::builder::SignSolanaMessageBody,
64812 ) -> types::builder::SignSolanaMessageBody,
64813 {
64814 self.body = self.body.map(f);
64815 self
64816 }
64817 pub async fn send(
64819 self,
64820 ) -> Result<ResponseValue<types::SignSolanaMessageResponse>, Error<types::Error>> {
64821 let Self {
64822 client,
64823 address,
64824 x_idempotency_key,
64825 x_wallet_auth,
64826 body,
64827 } = self;
64828 let address = address.map_err(Error::InvalidRequest)?;
64829 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
64830 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
64831 let body = body
64832 .and_then(|v| types::SignSolanaMessageBody::try_from(v).map_err(|e| e.to_string()))
64833 .map_err(Error::InvalidRequest)?;
64834 let url = format!(
64835 "{}/v2/solana/accounts/{}/sign/message",
64836 client.baseurl,
64837 encode_path(&address.to_string()),
64838 );
64839 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
64840 header_map.append(
64841 ::reqwest::header::HeaderName::from_static("api-version"),
64842 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
64843 );
64844 if let Some(value) = x_idempotency_key {
64845 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
64846 }
64847 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
64848 #[allow(unused_mut)]
64849 let mut request = client
64850 .client
64851 .post(url)
64852 .header(
64853 ::reqwest::header::ACCEPT,
64854 ::reqwest::header::HeaderValue::from_static("application/json"),
64855 )
64856 .json(&body)
64857 .headers(header_map)
64858 .build()?;
64859 let info = OperationInfo {
64860 operation_id: "sign_solana_message",
64861 };
64862 client.pre(&mut request, &info).await?;
64863 let result = client.exec(request, &info).await;
64864 client.post(&result, &info).await?;
64865 let response = result?;
64866 match response.status().as_u16() {
64867 200u16 => ResponseValue::from_response(response).await,
64868 400u16 => Err(Error::ErrorResponse(
64869 ResponseValue::from_response(response).await?,
64870 )),
64871 401u16 => Err(Error::ErrorResponse(
64872 ResponseValue::from_response(response).await?,
64873 )),
64874 402u16 => Err(Error::ErrorResponse(
64875 ResponseValue::from_response(response).await?,
64876 )),
64877 404u16 => Err(Error::ErrorResponse(
64878 ResponseValue::from_response(response).await?,
64879 )),
64880 409u16 => Err(Error::ErrorResponse(
64881 ResponseValue::from_response(response).await?,
64882 )),
64883 422u16 => Err(Error::ErrorResponse(
64884 ResponseValue::from_response(response).await?,
64885 )),
64886 500u16 => Err(Error::ErrorResponse(
64887 ResponseValue::from_response(response).await?,
64888 )),
64889 502u16 => Err(Error::ErrorResponse(
64890 ResponseValue::from_response(response).await?,
64891 )),
64892 503u16 => Err(Error::ErrorResponse(
64893 ResponseValue::from_response(response).await?,
64894 )),
64895 _ => Err(Error::UnexpectedResponse(response)),
64896 }
64897 }
64898 }
64899 #[derive(Debug, Clone)]
64903 pub struct SignSolanaTransaction<'a> {
64904 client: &'a super::Client,
64905 address: Result<types::SignSolanaTransactionAddress, String>,
64906 x_idempotency_key: Result<Option<types::SignSolanaTransactionXIdempotencyKey>, String>,
64907 x_wallet_auth: Result<::std::string::String, String>,
64908 body: Result<types::builder::SignSolanaTransactionBody, String>,
64909 }
64910 impl<'a> SignSolanaTransaction<'a> {
64911 pub fn new(client: &'a super::Client) -> Self {
64912 Self {
64913 client: client,
64914 address: Err("address was not initialized".to_string()),
64915 x_idempotency_key: Ok(None),
64916 x_wallet_auth: Err("x_wallet_auth was not initialized".to_string()),
64917 body: Ok(::std::default::Default::default()),
64918 }
64919 }
64920 pub fn address<V>(mut self, value: V) -> Self
64921 where
64922 V: std::convert::TryInto<types::SignSolanaTransactionAddress>,
64923 {
64924 self.address = value.try_into().map_err(|_| {
64925 "conversion to `SignSolanaTransactionAddress` for address failed".to_string()
64926 });
64927 self
64928 }
64929 pub fn x_idempotency_key<V>(mut self, value: V) -> Self
64930 where
64931 V: std::convert::TryInto<types::SignSolanaTransactionXIdempotencyKey>,
64932 {
64933 self.x_idempotency_key = value.try_into().map(Some).map_err(|_| {
64934 "conversion to `SignSolanaTransactionXIdempotencyKey` for x_idempotency_key failed"
64935 .to_string()
64936 });
64937 self
64938 }
64939 pub fn x_wallet_auth<V>(mut self, value: V) -> Self
64940 where
64941 V: std::convert::TryInto<::std::string::String>,
64942 {
64943 self.x_wallet_auth = value.try_into().map_err(|_| {
64944 "conversion to `:: std :: string :: String` for x_wallet_auth failed".to_string()
64945 });
64946 self
64947 }
64948 pub fn body<V>(mut self, value: V) -> Self
64949 where
64950 V: std::convert::TryInto<types::SignSolanaTransactionBody>,
64951 <V as std::convert::TryInto<types::SignSolanaTransactionBody>>::Error:
64952 std::fmt::Display,
64953 {
64954 self.body = value.try_into().map(From::from).map_err(|s| {
64955 format!(
64956 "conversion to `SignSolanaTransactionBody` for body failed: {}",
64957 s
64958 )
64959 });
64960 self
64961 }
64962 pub fn body_map<F>(mut self, f: F) -> Self
64963 where
64964 F: std::ops::FnOnce(
64965 types::builder::SignSolanaTransactionBody,
64966 ) -> types::builder::SignSolanaTransactionBody,
64967 {
64968 self.body = self.body.map(f);
64969 self
64970 }
64971 pub async fn send(
64973 self,
64974 ) -> Result<ResponseValue<types::SignSolanaTransactionResponse>, Error<types::Error>>
64975 {
64976 let Self {
64977 client,
64978 address,
64979 x_idempotency_key,
64980 x_wallet_auth,
64981 body,
64982 } = self;
64983 let address = address.map_err(Error::InvalidRequest)?;
64984 let x_idempotency_key = x_idempotency_key.map_err(Error::InvalidRequest)?;
64985 let x_wallet_auth = x_wallet_auth.map_err(Error::InvalidRequest)?;
64986 let body = body
64987 .and_then(|v| {
64988 types::SignSolanaTransactionBody::try_from(v).map_err(|e| e.to_string())
64989 })
64990 .map_err(Error::InvalidRequest)?;
64991 let url = format!(
64992 "{}/v2/solana/accounts/{}/sign/transaction",
64993 client.baseurl,
64994 encode_path(&address.to_string()),
64995 );
64996 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
64997 header_map.append(
64998 ::reqwest::header::HeaderName::from_static("api-version"),
64999 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
65000 );
65001 if let Some(value) = x_idempotency_key {
65002 header_map.append("X-Idempotency-Key", value.to_string().try_into()?);
65003 }
65004 header_map.append("X-Wallet-Auth", x_wallet_auth.to_string().try_into()?);
65005 #[allow(unused_mut)]
65006 let mut request = client
65007 .client
65008 .post(url)
65009 .header(
65010 ::reqwest::header::ACCEPT,
65011 ::reqwest::header::HeaderValue::from_static("application/json"),
65012 )
65013 .json(&body)
65014 .headers(header_map)
65015 .build()?;
65016 let info = OperationInfo {
65017 operation_id: "sign_solana_transaction",
65018 };
65019 client.pre(&mut request, &info).await?;
65020 let result = client.exec(request, &info).await;
65021 client.post(&result, &info).await?;
65022 let response = result?;
65023 match response.status().as_u16() {
65024 200u16 => ResponseValue::from_response(response).await,
65025 400u16 => Err(Error::ErrorResponse(
65026 ResponseValue::from_response(response).await?,
65027 )),
65028 401u16 => Err(Error::ErrorResponse(
65029 ResponseValue::from_response(response).await?,
65030 )),
65031 402u16 => Err(Error::ErrorResponse(
65032 ResponseValue::from_response(response).await?,
65033 )),
65034 403u16 => Err(Error::ErrorResponse(
65035 ResponseValue::from_response(response).await?,
65036 )),
65037 404u16 => Err(Error::ErrorResponse(
65038 ResponseValue::from_response(response).await?,
65039 )),
65040 409u16 => Err(Error::ErrorResponse(
65041 ResponseValue::from_response(response).await?,
65042 )),
65043 422u16 => Err(Error::ErrorResponse(
65044 ResponseValue::from_response(response).await?,
65045 )),
65046 500u16 => Err(Error::ErrorResponse(
65047 ResponseValue::from_response(response).await?,
65048 )),
65049 502u16 => Err(Error::ErrorResponse(
65050 ResponseValue::from_response(response).await?,
65051 )),
65052 503u16 => Err(Error::ErrorResponse(
65053 ResponseValue::from_response(response).await?,
65054 )),
65055 _ => Err(Error::UnexpectedResponse(response)),
65056 }
65057 }
65058 }
65059 #[derive(Debug, Clone)]
65063 pub struct RequestSolanaFaucet<'a> {
65064 client: &'a super::Client,
65065 body: Result<types::builder::RequestSolanaFaucetBody, String>,
65066 }
65067 impl<'a> RequestSolanaFaucet<'a> {
65068 pub fn new(client: &'a super::Client) -> Self {
65069 Self {
65070 client: client,
65071 body: Ok(::std::default::Default::default()),
65072 }
65073 }
65074 pub fn body<V>(mut self, value: V) -> Self
65075 where
65076 V: std::convert::TryInto<types::RequestSolanaFaucetBody>,
65077 <V as std::convert::TryInto<types::RequestSolanaFaucetBody>>::Error: std::fmt::Display,
65078 {
65079 self.body = value.try_into().map(From::from).map_err(|s| {
65080 format!(
65081 "conversion to `RequestSolanaFaucetBody` for body failed: {}",
65082 s
65083 )
65084 });
65085 self
65086 }
65087 pub fn body_map<F>(mut self, f: F) -> Self
65088 where
65089 F: std::ops::FnOnce(
65090 types::builder::RequestSolanaFaucetBody,
65091 ) -> types::builder::RequestSolanaFaucetBody,
65092 {
65093 self.body = self.body.map(f);
65094 self
65095 }
65096 pub async fn send(
65098 self,
65099 ) -> Result<ResponseValue<types::RequestSolanaFaucetResponse>, Error<types::Error>>
65100 {
65101 let Self { client, body } = self;
65102 let body = body
65103 .and_then(|v| {
65104 types::RequestSolanaFaucetBody::try_from(v).map_err(|e| e.to_string())
65105 })
65106 .map_err(Error::InvalidRequest)?;
65107 let url = format!("{}/v2/solana/faucet", client.baseurl,);
65108 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
65109 header_map.append(
65110 ::reqwest::header::HeaderName::from_static("api-version"),
65111 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
65112 );
65113 #[allow(unused_mut)]
65114 let mut request = client
65115 .client
65116 .post(url)
65117 .header(
65118 ::reqwest::header::ACCEPT,
65119 ::reqwest::header::HeaderValue::from_static("application/json"),
65120 )
65121 .json(&body)
65122 .headers(header_map)
65123 .build()?;
65124 let info = OperationInfo {
65125 operation_id: "request_solana_faucet",
65126 };
65127 client.pre(&mut request, &info).await?;
65128 let result = client.exec(request, &info).await;
65129 client.post(&result, &info).await?;
65130 let response = result?;
65131 match response.status().as_u16() {
65132 200u16 => ResponseValue::from_response(response).await,
65133 400u16 => Err(Error::ErrorResponse(
65134 ResponseValue::from_response(response).await?,
65135 )),
65136 403u16 => Err(Error::ErrorResponse(
65137 ResponseValue::from_response(response).await?,
65138 )),
65139 429u16 => Err(Error::ErrorResponse(
65140 ResponseValue::from_response(response).await?,
65141 )),
65142 500u16 => Err(Error::ErrorResponse(
65143 ResponseValue::from_response(response).await?,
65144 )),
65145 502u16 => Err(Error::ErrorResponse(
65146 ResponseValue::from_response(response).await?,
65147 )),
65148 503u16 => Err(Error::ErrorResponse(
65149 ResponseValue::from_response(response).await?,
65150 )),
65151 _ => Err(Error::UnexpectedResponse(response)),
65152 }
65153 }
65154 }
65155 #[derive(Debug, Clone)]
65159 pub struct ListSolanaTokenBalances<'a> {
65160 client: &'a super::Client,
65161 network: Result<types::ListSolanaTokenBalancesNetwork, String>,
65162 address: Result<types::ListSolanaTokenBalancesAddress, String>,
65163 page_size: Result<Option<i64>, String>,
65164 page_token: Result<Option<::std::string::String>, String>,
65165 }
65166 impl<'a> ListSolanaTokenBalances<'a> {
65167 pub fn new(client: &'a super::Client) -> Self {
65168 Self {
65169 client: client,
65170 network: Err("network was not initialized".to_string()),
65171 address: Err("address was not initialized".to_string()),
65172 page_size: Ok(None),
65173 page_token: Ok(None),
65174 }
65175 }
65176 pub fn network<V>(mut self, value: V) -> Self
65177 where
65178 V: std::convert::TryInto<types::ListSolanaTokenBalancesNetwork>,
65179 {
65180 self.network = value.try_into().map_err(|_| {
65181 "conversion to `ListSolanaTokenBalancesNetwork` for network failed".to_string()
65182 });
65183 self
65184 }
65185 pub fn address<V>(mut self, value: V) -> Self
65186 where
65187 V: std::convert::TryInto<types::ListSolanaTokenBalancesAddress>,
65188 {
65189 self.address = value.try_into().map_err(|_| {
65190 "conversion to `ListSolanaTokenBalancesAddress` for address failed".to_string()
65191 });
65192 self
65193 }
65194 pub fn page_size<V>(mut self, value: V) -> Self
65195 where
65196 V: std::convert::TryInto<i64>,
65197 {
65198 self.page_size = value
65199 .try_into()
65200 .map(Some)
65201 .map_err(|_| "conversion to `i64` for page_size failed".to_string());
65202 self
65203 }
65204 pub fn page_token<V>(mut self, value: V) -> Self
65205 where
65206 V: std::convert::TryInto<::std::string::String>,
65207 {
65208 self.page_token = value.try_into().map(Some).map_err(|_| {
65209 "conversion to `:: std :: string :: String` for page_token failed".to_string()
65210 });
65211 self
65212 }
65213 pub async fn send(
65215 self,
65216 ) -> Result<ResponseValue<types::ListSolanaTokenBalancesResponse>, Error<types::Error>>
65217 {
65218 let Self {
65219 client,
65220 network,
65221 address,
65222 page_size,
65223 page_token,
65224 } = self;
65225 let network = network.map_err(Error::InvalidRequest)?;
65226 let address = address.map_err(Error::InvalidRequest)?;
65227 let page_size = page_size.map_err(Error::InvalidRequest)?;
65228 let page_token = page_token.map_err(Error::InvalidRequest)?;
65229 let url = format!(
65230 "{}/v2/solana/token-balances/{}/{}",
65231 client.baseurl,
65232 encode_path(&network.to_string()),
65233 encode_path(&address.to_string()),
65234 );
65235 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
65236 header_map.append(
65237 ::reqwest::header::HeaderName::from_static("api-version"),
65238 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
65239 );
65240 #[allow(unused_mut)]
65241 let mut request = client
65242 .client
65243 .get(url)
65244 .header(
65245 ::reqwest::header::ACCEPT,
65246 ::reqwest::header::HeaderValue::from_static("application/json"),
65247 )
65248 .query(&progenitor_middleware_client::QueryParam::new(
65249 "pageSize", &page_size,
65250 ))
65251 .query(&progenitor_middleware_client::QueryParam::new(
65252 "pageToken",
65253 &page_token,
65254 ))
65255 .headers(header_map)
65256 .build()?;
65257 let info = OperationInfo {
65258 operation_id: "list_solana_token_balances",
65259 };
65260 client.pre(&mut request, &info).await?;
65261 let result = client.exec(request, &info).await;
65262 client.post(&result, &info).await?;
65263 let response = result?;
65264 match response.status().as_u16() {
65265 200u16 => ResponseValue::from_response(response).await,
65266 400u16 => Err(Error::ErrorResponse(
65267 ResponseValue::from_response(response).await?,
65268 )),
65269 404u16 => Err(Error::ErrorResponse(
65270 ResponseValue::from_response(response).await?,
65271 )),
65272 500u16 => Err(Error::ErrorResponse(
65273 ResponseValue::from_response(response).await?,
65274 )),
65275 502u16 => Err(Error::ErrorResponse(
65276 ResponseValue::from_response(response).await?,
65277 )),
65278 503u16 => Err(Error::ErrorResponse(
65279 ResponseValue::from_response(response).await?,
65280 )),
65281 _ => Err(Error::UnexpectedResponse(response)),
65282 }
65283 }
65284 }
65285 #[derive(Debug, Clone)]
65289 pub struct SettleX402Payment<'a> {
65290 client: &'a super::Client,
65291 body: Result<types::builder::SettleX402PaymentBody, String>,
65292 }
65293 impl<'a> SettleX402Payment<'a> {
65294 pub fn new(client: &'a super::Client) -> Self {
65295 Self {
65296 client: client,
65297 body: Ok(::std::default::Default::default()),
65298 }
65299 }
65300 pub fn body<V>(mut self, value: V) -> Self
65301 where
65302 V: std::convert::TryInto<types::SettleX402PaymentBody>,
65303 <V as std::convert::TryInto<types::SettleX402PaymentBody>>::Error: std::fmt::Display,
65304 {
65305 self.body = value.try_into().map(From::from).map_err(|s| {
65306 format!(
65307 "conversion to `SettleX402PaymentBody` for body failed: {}",
65308 s
65309 )
65310 });
65311 self
65312 }
65313 pub fn body_map<F>(mut self, f: F) -> Self
65314 where
65315 F: std::ops::FnOnce(
65316 types::builder::SettleX402PaymentBody,
65317 ) -> types::builder::SettleX402PaymentBody,
65318 {
65319 self.body = self.body.map(f);
65320 self
65321 }
65322 pub async fn send(
65324 self,
65325 ) -> Result<ResponseValue<types::SettleX402PaymentResponse>, Error<types::Error>> {
65326 let Self { client, body } = self;
65327 let body = body
65328 .and_then(|v| types::SettleX402PaymentBody::try_from(v).map_err(|e| e.to_string()))
65329 .map_err(Error::InvalidRequest)?;
65330 let url = format!("{}/v2/x402/settle", client.baseurl,);
65331 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
65332 header_map.append(
65333 ::reqwest::header::HeaderName::from_static("api-version"),
65334 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
65335 );
65336 #[allow(unused_mut)]
65337 let mut request = client
65338 .client
65339 .post(url)
65340 .header(
65341 ::reqwest::header::ACCEPT,
65342 ::reqwest::header::HeaderValue::from_static("application/json"),
65343 )
65344 .json(&body)
65345 .headers(header_map)
65346 .build()?;
65347 let info = OperationInfo {
65348 operation_id: "settle_x402_payment",
65349 };
65350 client.pre(&mut request, &info).await?;
65351 let result = client.exec(request, &info).await;
65352 client.post(&result, &info).await?;
65353 let response = result?;
65354 match response.status().as_u16() {
65355 200u16 => ResponseValue::from_response(response).await,
65356 400u16 => Err(Error::ErrorResponse(
65357 ResponseValue::from_response(response).await?,
65358 )),
65359 500u16 => Err(Error::ErrorResponse(
65360 ResponseValue::from_response(response).await?,
65361 )),
65362 502u16 => Err(Error::ErrorResponse(
65363 ResponseValue::from_response(response).await?,
65364 )),
65365 503u16 => Err(Error::ErrorResponse(
65366 ResponseValue::from_response(response).await?,
65367 )),
65368 _ => Err(Error::UnexpectedResponse(response)),
65369 }
65370 }
65371 }
65372 #[derive(Debug, Clone)]
65376 pub struct SupportedX402PaymentKinds<'a> {
65377 client: &'a super::Client,
65378 }
65379 impl<'a> SupportedX402PaymentKinds<'a> {
65380 pub fn new(client: &'a super::Client) -> Self {
65381 Self { client: client }
65382 }
65383 pub async fn send(
65385 self,
65386 ) -> Result<ResponseValue<types::SupportedX402PaymentKindsResponse>, Error<types::Error>>
65387 {
65388 let Self { client } = self;
65389 let url = format!("{}/v2/x402/supported", client.baseurl,);
65390 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
65391 header_map.append(
65392 ::reqwest::header::HeaderName::from_static("api-version"),
65393 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
65394 );
65395 #[allow(unused_mut)]
65396 let mut request = client
65397 .client
65398 .get(url)
65399 .header(
65400 ::reqwest::header::ACCEPT,
65401 ::reqwest::header::HeaderValue::from_static("application/json"),
65402 )
65403 .headers(header_map)
65404 .build()?;
65405 let info = OperationInfo {
65406 operation_id: "supported_x402_payment_kinds",
65407 };
65408 client.pre(&mut request, &info).await?;
65409 let result = client.exec(request, &info).await;
65410 client.post(&result, &info).await?;
65411 let response = result?;
65412 match response.status().as_u16() {
65413 200u16 => ResponseValue::from_response(response).await,
65414 500u16 => Err(Error::ErrorResponse(
65415 ResponseValue::from_response(response).await?,
65416 )),
65417 502u16 => Err(Error::ErrorResponse(
65418 ResponseValue::from_response(response).await?,
65419 )),
65420 503u16 => Err(Error::ErrorResponse(
65421 ResponseValue::from_response(response).await?,
65422 )),
65423 _ => Err(Error::UnexpectedResponse(response)),
65424 }
65425 }
65426 }
65427 #[derive(Debug, Clone)]
65431 pub struct VerifyX402Payment<'a> {
65432 client: &'a super::Client,
65433 body: Result<types::builder::VerifyX402PaymentBody, String>,
65434 }
65435 impl<'a> VerifyX402Payment<'a> {
65436 pub fn new(client: &'a super::Client) -> Self {
65437 Self {
65438 client: client,
65439 body: Ok(::std::default::Default::default()),
65440 }
65441 }
65442 pub fn body<V>(mut self, value: V) -> Self
65443 where
65444 V: std::convert::TryInto<types::VerifyX402PaymentBody>,
65445 <V as std::convert::TryInto<types::VerifyX402PaymentBody>>::Error: std::fmt::Display,
65446 {
65447 self.body = value.try_into().map(From::from).map_err(|s| {
65448 format!(
65449 "conversion to `VerifyX402PaymentBody` for body failed: {}",
65450 s
65451 )
65452 });
65453 self
65454 }
65455 pub fn body_map<F>(mut self, f: F) -> Self
65456 where
65457 F: std::ops::FnOnce(
65458 types::builder::VerifyX402PaymentBody,
65459 ) -> types::builder::VerifyX402PaymentBody,
65460 {
65461 self.body = self.body.map(f);
65462 self
65463 }
65464 pub async fn send(
65466 self,
65467 ) -> Result<ResponseValue<types::VerifyX402PaymentResponse>, Error<types::Error>> {
65468 let Self { client, body } = self;
65469 let body = body
65470 .and_then(|v| types::VerifyX402PaymentBody::try_from(v).map_err(|e| e.to_string()))
65471 .map_err(Error::InvalidRequest)?;
65472 let url = format!("{}/v2/x402/verify", client.baseurl,);
65473 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
65474 header_map.append(
65475 ::reqwest::header::HeaderName::from_static("api-version"),
65476 ::reqwest::header::HeaderValue::from_static(super::Client::api_version()),
65477 );
65478 #[allow(unused_mut)]
65479 let mut request = client
65480 .client
65481 .post(url)
65482 .header(
65483 ::reqwest::header::ACCEPT,
65484 ::reqwest::header::HeaderValue::from_static("application/json"),
65485 )
65486 .json(&body)
65487 .headers(header_map)
65488 .build()?;
65489 let info = OperationInfo {
65490 operation_id: "verify_x402_payment",
65491 };
65492 client.pre(&mut request, &info).await?;
65493 let result = client.exec(request, &info).await;
65494 client.post(&result, &info).await?;
65495 let response = result?;
65496 match response.status().as_u16() {
65497 200u16 => ResponseValue::from_response(response).await,
65498 400u16 => Err(Error::ErrorResponse(
65499 ResponseValue::from_response(response).await?,
65500 )),
65501 500u16 => Err(Error::ErrorResponse(
65502 ResponseValue::from_response(response).await?,
65503 )),
65504 502u16 => Err(Error::ErrorResponse(
65505 ResponseValue::from_response(response).await?,
65506 )),
65507 503u16 => Err(Error::ErrorResponse(
65508 ResponseValue::from_response(response).await?,
65509 )),
65510 _ => Err(Error::UnexpectedResponse(response)),
65511 }
65512 }
65513 }
65514}
65515pub mod prelude {
65517 pub use self::super::Client;
65518}