diff --git a/bots/api/TYPES.md b/bots/api/TYPES.md index f1122979a9..82db41b533 100644 --- a/bots/api/TYPES.md +++ b/bots/api/TYPES.md @@ -219,6 +219,7 @@ This file is generated automatically. - [UserProfileUpdateSummary](#userprofileupdatesummary) - [UserPwdHash](#userpwdhash) - [VersionRange](#versionrange) +- [WalletError](#walleterror) - [XFTPErrorType](#xftperrortype) - [XFTPRcvFile](#xftprcvfile) - [XFTPSndFile](#xftpsndfile) @@ -1231,6 +1232,10 @@ SimplexDomainNotReady: - simplexDomain: [SimplexDomain](#simplexdomain) - simplexDomainError: [SimplexDomainError](#simplexdomainerror) +Wallet: +- type: "wallet" +- walletError: [WalletError](#walleterror) + NotResolvedLocally: - type: "notResolvedLocally" @@ -4633,6 +4638,38 @@ Handshake: - maxVersion: int +--- + +## WalletError + +**Discriminated union type**: + +NoMaster: +- type: "noMaster" + +MasterExists: +- type: "masterExists" + +BadMnemonic: +- type: "badMnemonic" + +HiddenProfile: +- type: "hiddenProfile" + +AccountBound: +- type: "accountBound" + +CounterUnknown: +- type: "counterUnknown" + +IndexTooLarge: +- type: "indexTooLarge" + +Derivation: +- type: "derivation" +- derivationError: string + + --- ## XFTPErrorType diff --git a/packages/simplex-chat-client/types/typescript/src/types.ts b/packages/simplex-chat-client/types/typescript/src/types.ts index d7db7f259f..5ec1b205b0 100644 --- a/packages/simplex-chat-client/types/typescript/src/types.ts +++ b/packages/simplex-chat-client/types/typescript/src/types.ts @@ -1180,6 +1180,7 @@ export type ChatErrorType = | ChatErrorType.ChatStoreChanged | ChatErrorType.InvalidConnReq | ChatErrorType.SimplexDomainNotReady + | ChatErrorType.Wallet | ChatErrorType.NotResolvedLocally | ChatErrorType.UnsupportedConnReq | ChatErrorType.ConnReqMessageProhibited @@ -1260,6 +1261,7 @@ export namespace ChatErrorType { | "chatStoreChanged" | "invalidConnReq" | "simplexDomainNotReady" + | "wallet" | "notResolvedLocally" | "unsupportedConnReq" | "connReqMessageProhibited" @@ -1422,6 +1424,11 @@ export namespace ChatErrorType { simplexDomainError: SimplexDomainError } + export interface Wallet extends Interface { + type: "wallet" + walletError: WalletError + } + export interface NotResolvedLocally extends Interface { type: "notResolvedLocally" } @@ -5300,6 +5307,65 @@ export interface VersionRange { maxVersion: number // int } +export type WalletError = + | WalletError.NoMaster + | WalletError.MasterExists + | WalletError.BadMnemonic + | WalletError.HiddenProfile + | WalletError.AccountBound + | WalletError.CounterUnknown + | WalletError.IndexTooLarge + | WalletError.Derivation + +export namespace WalletError { + export type Tag = + | "noMaster" + | "masterExists" + | "badMnemonic" + | "hiddenProfile" + | "accountBound" + | "counterUnknown" + | "indexTooLarge" + | "derivation" + + interface Interface { + type: Tag + } + + export interface NoMaster extends Interface { + type: "noMaster" + } + + export interface MasterExists extends Interface { + type: "masterExists" + } + + export interface BadMnemonic extends Interface { + type: "badMnemonic" + } + + export interface HiddenProfile extends Interface { + type: "hiddenProfile" + } + + export interface AccountBound extends Interface { + type: "accountBound" + } + + export interface CounterUnknown extends Interface { + type: "counterUnknown" + } + + export interface IndexTooLarge extends Interface { + type: "indexTooLarge" + } + + export interface Derivation extends Interface { + type: "derivation" + derivationError: string + } +} + export type XFTPErrorType = | XFTPErrorType.BLOCK | XFTPErrorType.SESSION diff --git a/packages/simplex-chat-python/src/simplex_chat/types/_types.py b/packages/simplex-chat-python/src/simplex_chat/types/_types.py index ab06a24f53..b853ae196e 100644 --- a/packages/simplex-chat-python/src/simplex_chat/types/_types.py +++ b/packages/simplex-chat-python/src/simplex_chat/types/_types.py @@ -883,6 +883,10 @@ class ChatErrorType_simplexDomainNotReady(TypedDict): simplexDomain: "SimplexDomain" simplexDomainError: "SimplexDomainError" +class ChatErrorType_wallet(TypedDict): + type: Literal["wallet"] + walletError: "WalletError" + class ChatErrorType_notResolvedLocally(TypedDict): type: Literal["notResolvedLocally"] @@ -1121,6 +1125,7 @@ ChatErrorType = ( | ChatErrorType_chatStoreChanged | ChatErrorType_invalidConnReq | ChatErrorType_simplexDomainNotReady + | ChatErrorType_wallet | ChatErrorType_notResolvedLocally | ChatErrorType_unsupportedConnReq | ChatErrorType_connReqMessageProhibited @@ -1179,7 +1184,7 @@ ChatErrorType = ( | ChatErrorType_exception ) -ChatErrorType_Tag = Literal["noActiveUser", "noConnectionUser", "noSndFileUser", "noRcvFileUser", "userUnknown", "userExists", "chatRelayExists", "differentActiveUser", "cantDeleteActiveUser", "cantDeleteLastUser", "cantHideLastUser", "hiddenUserAlwaysMuted", "emptyUserPassword", "userAlreadyHidden", "userNotHidden", "invalidDisplayName", "chatNotStarted", "chatNotStopped", "chatStoreChanged", "invalidConnReq", "simplexDomainNotReady", "notResolvedLocally", "unsupportedConnReq", "connReqMessageProhibited", "contactNotReady", "contactNotActive", "contactDisabled", "connectionDisabled", "groupUserRole", "groupMemberInitialRole", "contactIncognitoCantInvite", "groupIncognitoCantInvite", "groupContactRole", "groupDuplicateMember", "groupDuplicateMemberId", "groupNotJoined", "groupMemberNotActive", "cantBlockMemberForSelf", "groupMemberUserRemoved", "groupMemberNotFound", "groupCantResendInvitation", "groupInternal", "fileNotFound", "fileSize", "fileAlreadyReceiving", "fileCancelled", "fileCancel", "fileAlreadyExists", "fileWrite", "fileSend", "fileRcvChunk", "fileInternal", "fileImageType", "fileImageSize", "fileNotReceived", "fileNotApproved", "fallbackToSMPProhibited", "inlineFileProhibited", "invalidForward", "invalidChatItemUpdate", "invalidChatItemDelete", "hasCurrentCall", "noCurrentCall", "callContact", "directMessagesProhibited", "agentVersion", "agentNoSubResult", "commandError", "badgeRedeemError", "agentCommandError", "invalidFileDescription", "connectionIncognitoChangeProhibited", "connectionUserChangeProhibited", "peerChatVRangeIncompatible", "relayTestError", "internalError", "exception"] +ChatErrorType_Tag = Literal["noActiveUser", "noConnectionUser", "noSndFileUser", "noRcvFileUser", "userUnknown", "userExists", "chatRelayExists", "differentActiveUser", "cantDeleteActiveUser", "cantDeleteLastUser", "cantHideLastUser", "hiddenUserAlwaysMuted", "emptyUserPassword", "userAlreadyHidden", "userNotHidden", "invalidDisplayName", "chatNotStarted", "chatNotStopped", "chatStoreChanged", "invalidConnReq", "simplexDomainNotReady", "wallet", "notResolvedLocally", "unsupportedConnReq", "connReqMessageProhibited", "contactNotReady", "contactNotActive", "contactDisabled", "connectionDisabled", "groupUserRole", "groupMemberInitialRole", "contactIncognitoCantInvite", "groupIncognitoCantInvite", "groupContactRole", "groupDuplicateMember", "groupDuplicateMemberId", "groupNotJoined", "groupMemberNotActive", "cantBlockMemberForSelf", "groupMemberUserRemoved", "groupMemberNotFound", "groupCantResendInvitation", "groupInternal", "fileNotFound", "fileSize", "fileAlreadyReceiving", "fileCancelled", "fileCancel", "fileAlreadyExists", "fileWrite", "fileSend", "fileRcvChunk", "fileInternal", "fileImageType", "fileImageSize", "fileNotReceived", "fileNotApproved", "fallbackToSMPProhibited", "inlineFileProhibited", "invalidForward", "invalidChatItemUpdate", "invalidChatItemDelete", "hasCurrentCall", "noCurrentCall", "callContact", "directMessagesProhibited", "agentVersion", "agentNoSubResult", "commandError", "badgeRedeemError", "agentCommandError", "invalidFileDescription", "connectionIncognitoChangeProhibited", "connectionUserChangeProhibited", "peerChatVRangeIncompatible", "relayTestError", "internalError", "exception"] ChatFeature = Literal["timedMessages", "fullDelete", "reactions", "voice", "files", "calls", "sessions"] @@ -3717,6 +3722,44 @@ class VersionRange(TypedDict): minVersion: int # int maxVersion: int # int +class WalletError_noMaster(TypedDict): + type: Literal["noMaster"] + +class WalletError_masterExists(TypedDict): + type: Literal["masterExists"] + +class WalletError_badMnemonic(TypedDict): + type: Literal["badMnemonic"] + +class WalletError_hiddenProfile(TypedDict): + type: Literal["hiddenProfile"] + +class WalletError_accountBound(TypedDict): + type: Literal["accountBound"] + +class WalletError_counterUnknown(TypedDict): + type: Literal["counterUnknown"] + +class WalletError_indexTooLarge(TypedDict): + type: Literal["indexTooLarge"] + +class WalletError_derivation(TypedDict): + type: Literal["derivation"] + derivationError: str + +WalletError = ( + WalletError_noMaster + | WalletError_masterExists + | WalletError_badMnemonic + | WalletError_hiddenProfile + | WalletError_accountBound + | WalletError_counterUnknown + | WalletError_indexTooLarge + | WalletError_derivation +) + +WalletError_Tag = Literal["noMaster", "masterExists", "badMnemonic", "hiddenProfile", "accountBound", "counterUnknown", "indexTooLarge", "derivation"] + class XFTPErrorType_BLOCK(TypedDict): type: Literal["BLOCK"]