diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2025-03-15 15:50:27 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2025-03-15 15:50:27 +0200 |
commit | b0c56d16dbe7de30a16a0715148ecfe739c665da (patch) | |
tree | f9c5de1d2d113907c183f2fb9208e572f87b5e5f | |
parent | f2ffe6a836d55123d2458e4d868d192e49e02a12 (diff) | |
download | arching-kaos-web-ui-b0c56d16dbe7de30a16a0715148ecfe739c665da.tar.gz arching-kaos-web-ui-b0c56d16dbe7de30a16a0715148ecfe739c665da.tar.bz2 arching-kaos-web-ui-b0c56d16dbe7de30a16a0715148ecfe739c665da.zip |
stellar freighter api update
29 files changed, 50063 insertions, 85 deletions
diff --git a/src/external/2023.11.07-stellar-freighter-api.tar.gz b/src/external/2023.11.07-stellar-freighter-api.tar.gz Binary files differnew file mode 100644 index 0000000..a6aaade --- /dev/null +++ b/src/external/2023.11.07-stellar-freighter-api.tar.gz diff --git a/src/external/stellar-freighter-api/@shared/api/external.d.ts b/src/external/stellar-freighter-api/@shared/api/external.d.ts index 9755ca4..8505603 100644 --- a/src/external/stellar-freighter-api/@shared/api/external.d.ts +++ b/src/external/stellar-freighter-api/@shared/api/external.d.ts @@ -1,24 +1,63 @@ -import { UserInfo } from "./types"; -export declare const requestPublicKey: () => Promise<string>; +import { FreighterApiError } from "./types"; +export declare const requestAccess: () => Promise<{ + publicKey: string; + error?: FreighterApiError; +}>; +export declare const requestPublicKey: () => Promise<{ + publicKey: string; + error?: FreighterApiError; +}>; +export declare const submitToken: (args: { + contractId: string; + networkPassphrase?: string; +}) => Promise<{ + contractId?: string; + error?: FreighterApiError; +}>; export declare const submitTransaction: (transactionXdr: string, opts?: string | { - network?: string | undefined; - accountToSign?: string | undefined; - networkPassphrase?: string | undefined; -} | undefined, accountToSign?: string | undefined) => Promise<string>; -export declare const submitBlob: (blob: string, opts?: { - accountToSign?: string | undefined; -} | undefined) => Promise<string>; + accountToSign?: string; + networkPassphrase?: string; +}, accountToSign?: string) => Promise<{ + signedTransaction: string; + signerAddress: string; + error?: FreighterApiError; +}>; +export declare const submitMessage: (blob: string, version: string, opts?: { + address?: string; + networkPassphrase?: string; +}) => Promise<{ + signedMessage: Buffer | null; + signerAddress: string; + error?: FreighterApiError; +}>; export declare const submitAuthEntry: (entryXdr: string, opts?: { - accountToSign?: string | undefined; -} | undefined) => Promise<string>; -export declare const requestNetwork: () => Promise<string>; + address?: string; + networkPassphrase?: string; +}) => Promise<{ + signedAuthEntry: Buffer | null; + signerAddress: string; + error?: FreighterApiError; +}>; +export declare const requestNetwork: () => Promise<{ + network: string; + networkPassphrase: string; + error?: FreighterApiError; +}>; export declare const requestNetworkDetails: () => Promise<{ network: string; networkUrl: string; networkPassphrase: string; - sorobanRpcUrl?: string | undefined; + sorobanRpcUrl?: string; + error?: FreighterApiError; +}>; +export declare const requestConnectionStatus: () => Promise<{ + isConnected: boolean; +}>; +export declare const requestAllowedStatus: () => Promise<{ + isAllowed: boolean; + error?: FreighterApiError; +}>; +export declare const setAllowedStatus: () => Promise<{ + isAllowed: boolean; + error?: FreighterApiError; }>; -export declare const requestConnectionStatus: () => Promise<boolean>; -export declare const requestAllowedStatus: () => Promise<boolean>; -export declare const setAllowedStatus: () => Promise<boolean>; -export declare const requestUserInfo: () => Promise<UserInfo>; diff --git a/src/external/stellar-freighter-api/@shared/api/helpers/extensionMessaging.d.ts b/src/external/stellar-freighter-api/@shared/api/helpers/extensionMessaging.d.ts index 1aed2d8..3dfd5c9 100644 --- a/src/external/stellar-freighter-api/@shared/api/helpers/extensionMessaging.d.ts +++ b/src/external/stellar-freighter-api/@shared/api/helpers/extensionMessaging.d.ts @@ -6,4 +6,16 @@ interface Msg { } export declare const sendMessageToContentScript: (msg: Msg) => Promise<Response>; export declare const sendMessageToBackground: (msg: Msg) => Promise<Response>; +export declare const FreighterApiNodeError: { + code: number; + message: string; +}; +export declare const FreighterApiInternalError: { + code: number; + message: string; +}; +export declare const FreighterApiDeclinedError: { + code: number; + message: string; +}; export {}; diff --git a/src/external/stellar-freighter-api/@shared/api/types.d.ts b/src/external/stellar-freighter-api/@shared/api/types.d.ts index be44b6a..9bb7dc1 100644 --- a/src/external/stellar-freighter-api/@shared/api/types.d.ts +++ b/src/external/stellar-freighter-api/@shared/api/types.d.ts @@ -1,10 +1,11 @@ import BigNumber from "bignumber.js"; -import { Horizon } from "stellar-sdk"; -import { Types } from "@stellar/wallet-sdk"; +import { AssetType as SdkAssetType, Horizon } from "stellar-sdk"; +import Blockaid from "@blockaid/client"; import { SERVICE_TYPES, EXTERNAL_SERVICE_TYPES } from "../constants/services"; import { APPLICATION_STATE } from "../constants/applicationState"; import { WalletType } from "../constants/hardwareWallet"; import { NetworkDetails } from "../constants/stellar"; +import { AssetsLists, AssetsListItem } from "../constants/soroban/token"; export declare enum ActionStatus { IDLE = "IDLE", PENDING = "PENDING", @@ -14,8 +15,12 @@ export declare enum ActionStatus { export interface UserInfo { publicKey: string; } +export type MigratableAccount = Account & { + keyIdIndex: number; +}; export interface Response { error: string; + apiError: FreighterApiError; messagedId: number; applicationState: APPLICATION_STATE; publicKey: string; @@ -31,9 +36,11 @@ export interface Response { sign: (sourceKeys: {}) => void; }; transactionXDR: string; + signerAddress: string; signedTransaction: string; - signedBlob: string; - signedAuthEntry: string; + signedPayload: string | Buffer; + signedBlob: Buffer | null; + signedAuthEntry: Buffer | null; source: string; type: SERVICE_TYPES; url: string; @@ -43,10 +50,20 @@ export interface Response { isSafetyValidationEnabled: boolean; isValidatingSafeAssetsEnabled: boolean; isExperimentalModeEnabled: boolean; + isHashSigningEnabled: boolean; + isSorobanPublicEnabled: boolean; + isRpcHealthy: boolean; + userNotification: UserNotification; + assetsLists: AssetsLists; + assetsList: AssetsListItem; + isDeleteAssetsList: boolean; + settingsState: SettingsState; + experimentalFeaturesState: SettingsState; networkDetails: NetworkDetails; sorobanRpcUrl: string; networksList: NetworkDetails[]; - allAccounts: Array<Account>; + allAccounts: Account[]; + migratedAccounts: MigratedAccount[]; accountName: string; assetCode: string; assetCanonical: string; @@ -54,11 +71,11 @@ export interface Response { network: string; networkIndex: number; networkName: string; - recentAddresses: Array<string>; + recentAddresses: string[]; + lastUsedAccount: string; hardwareWalletType: WalletType; bipPath: string; - blockedDomains: BlockedDomains; - blockedAccounts: BlockedAccount[]; + memoRequiredAccounts: MemoRequiredAccount[]; assetDomain: string; contractId: string; tokenId: string; @@ -67,32 +84,40 @@ export interface Response { isAllowed: boolean; userInfo: UserInfo; allowList: string[]; + migratableAccounts: MigratableAccount[]; + balancesToMigrate: BalanceToMigrate[]; + isMergeSelected: boolean; + recommendedFee: string; + isNonSSLEnabled: boolean; + isHideDustEnabled: boolean; } -export interface BlockedDomains { - [key: string]: boolean; -} -export interface BlockedAccount { +export interface MemoRequiredAccount { address: string; name: string; domain: string | null; tags: string[]; } export interface ExternalRequestBase { - network: string; - networkPassphrase: string; - accountToSign: string; + accountToSign?: string; + address?: string; + networkPassphrase?: string; type: EXTERNAL_SERVICE_TYPES; } +export interface ExternalRequestToken extends ExternalRequestBase { + contractId: string; +} export interface ExternalRequestTx extends ExternalRequestBase { transactionXdr: string; + network?: string; } export interface ExternalRequestBlob extends ExternalRequestBase { + apiVersion: string; blob: string; } export interface ExternalRequestAuthEntry extends ExternalRequestBase { entryXdr: string; } -export declare type ExternalRequest = ExternalRequestTx | ExternalRequestBlob | ExternalRequestAuthEntry; +export type ExternalRequest = ExternalRequestToken | ExternalRequestTx | ExternalRequestBlob | ExternalRequestAuthEntry; export interface Account { publicKey: string; name: string; @@ -107,13 +132,35 @@ export declare enum AccountType { export interface Preferences { isDataSharingAllowed: boolean; isMemoValidationEnabled: boolean; - isSafetyValidationEnabled: boolean; - isValidatingSafeAssetsEnabled: boolean; networksList: NetworkDetails[]; + isHideDustEnabled: boolean; error: string; +} +export interface ExperimentalFeatures { isExperimentalModeEnabled: boolean; + isHashSigningEnabled: boolean; + isNonSSLEnabled: boolean; + networkDetails: NetworkDetails; + networksList: NetworkDetails[]; + experimentalFeaturesState: SettingsState; } -export declare type Settings = { +export declare enum SettingsState { + IDLE = "IDLE", + LOADING = "LOADING", + ERROR = "ERROR", + SUCCESS = "SUCCESS" +} +export interface UserNotification { + enabled: boolean; + message: string; +} +export interface IndexerSettings { + settingsState: SettingsState; + isSorobanPublicEnabled: boolean; + isRpcHealthy: boolean; + userNotification: UserNotification; +} +export type Settings = { allowList: string[]; networkDetails: NetworkDetails; networksList: NetworkDetails[]; @@ -125,29 +172,116 @@ export interface AssetIcons { export interface AssetDomains { [code: string]: string; } -export declare type Balances = Types.BalanceMap | null; +export interface SoroswapToken { + code: string; + contract: string; + decimals: number; + icon: string; + name: string; +} +export interface NativeToken { + type: SdkAssetType; + code: string; +} +export interface Issuer { + key: string; + name?: string; + url?: string; + hostName?: string; +} +export interface AssetToken { + type: SdkAssetType; + code: string; + issuer: Issuer; + anchorAsset?: string; + numAccounts?: BigNumber; + amount?: BigNumber; + bidCount?: BigNumber; + askCount?: BigNumber; + spread?: BigNumber; +} +export type Token = NativeToken | AssetToken; +export interface Balance { + token: Token; + available: BigNumber; + total: BigNumber; + buyingLiabilities: string; + sellingLiabilities: string; + liquidityPoolId?: string; + reserves?: Horizon.HorizonApi.Reserve[]; + contractId?: string; + blockaidData: BlockAidScanAssetResult; +} +export type BlockAidScanAssetResult = Blockaid.TokenScanResponse; +export type BlockAidScanSiteResult = Blockaid.SiteScanResponse; +export type BlockAidScanTxResult = Blockaid.StellarTransactionScanResponse & { + request_id: string; +}; +export type BlockAidBulkScanAssetResult = Blockaid.TokenBulkScanResponse; +export interface AssetBalance extends Balance { + limit: BigNumber; + token: AssetToken; + sponsor?: string; +} +export interface NativeBalance extends Balance { + token: NativeToken; + minimumBalance: BigNumber; +} +export interface TokenBalance extends AssetBalance { + name: string; + symbol: string; + decimals: number; + total: BigNumber; +} +export interface BalanceMap { + [key: string]: AssetBalance | NativeBalance | TokenBalance; + native: NativeBalance; +} +export type Balances = BalanceMap | null; export interface SorobanBalance { contractId: string; total: BigNumber; name: string; symbol: string; decimals: number; + token?: { + code: string; + issuer: { + key: string; + }; + }; } -export declare type AssetType = Types.AssetBalance | Types.NativeBalance | SorobanBalance; -export declare type TokenBalances = SorobanBalance[]; -export declare type HorizonOperation = any; +export type AssetType = AssetBalance | NativeBalance | TokenBalance; +export type TokenBalances = SorobanBalance[]; +export type HorizonOperation = Horizon.ServerApi.OperationRecord; export interface AccountBalancesInterface { balances: Balances; isFunded: boolean | null; subentryCount: number; + error?: { + horizon: any; + soroban: any; + }; } export interface AccountHistoryInterface { operations: Array<HorizonOperation> | []; } export interface ErrorMessage { errorMessage: string; - response?: Horizon.ErrorResponseData.TransactionFailed; + response?: Horizon.HorizonApi.ErrorResponseData.TransactionFailed; } +export interface BalanceToMigrate { + publicKey: string; + name: string; + minBalance: string; + xlmBalance: string; + trustlineBalances: Horizon.HorizonApi.BalanceLine[]; + keyIdIndex: number; +} +export type MigratedAccount = BalanceToMigrate & { + newPublicKey: string; + isMigrated: boolean; +}; declare global { interface Window { freighter: boolean; @@ -156,3 +290,8 @@ declare global { }; } } +export interface FreighterApiError { + code: number; + message: string; + ext?: string[]; +} diff --git a/src/external/stellar-freighter-api/@shared/constants/hardwareWallet.d.ts b/src/external/stellar-freighter-api/@shared/constants/hardwareWallet.d.ts index 54b6088..1236577 100644 --- a/src/external/stellar-freighter-api/@shared/constants/hardwareWallet.d.ts +++ b/src/external/stellar-freighter-api/@shared/constants/hardwareWallet.d.ts @@ -2,3 +2,4 @@ export declare enum WalletType { LEDGER = "Ledger", NONE = "" } +export type ConfigurableWalletType = Exclude<WalletType, WalletType.NONE>; diff --git a/src/external/stellar-freighter-api/@shared/constants/services.d.ts b/src/external/stellar-freighter-api/@shared/constants/services.d.ts index 7c4738b..47dd853 100644 --- a/src/external/stellar-freighter-api/@shared/constants/services.d.ts +++ b/src/external/stellar-freighter-api/@shared/constants/services.d.ts @@ -9,30 +9,33 @@ export declare enum SERVICE_TYPES { UPDATE_ACCOUNT_NAME = "UPDATE_ACCOUNT_NAME", GET_MNEMONIC_PHRASE = "GET_MNEMONIC_PHRASE", CONFIRM_MNEMONIC_PHRASE = "CONFIRM_MNEMONIC_PHRASE", + CONFIRM_MIGRATED_MNEMONIC_PHRASE = "CONFIRM_MIGRATED_MNEMONIC_PHRASE", RECOVER_ACCOUNT = "RECOVER_ACCOUNT", CONFIRM_PASSWORD = "CONFIRM_PASSWORD", REJECT_ACCESS = "REJECT_ACCESS", GRANT_ACCESS = "GRANT_ACCESS", + ADD_TOKEN = "ADD_TOKEN", SIGN_TRANSACTION = "SIGN_TRANSACTION", SIGN_BLOB = "SIGN_BLOB", SIGN_AUTH_ENTRY = "SIGN_AUTH_ENTRY", - HANDLE_SIGNED_HW_TRANSACTION = "HANDLE_SIGNED_HW_TRANSACTION", + HANDLE_SIGNED_HW_PAYLOAD = "HANDLE_SIGNED_HW_PAYLOAD", REJECT_TRANSACTION = "REJECT_TRANSACTION", SIGN_FREIGHTER_TRANSACTION = "SIGN_FREIGHTER_TRANSACTION", SIGN_FREIGHTER_SOROBAN_TRANSACTION = "SIGN_FREIGHTER_SOROBAN_TRANSACTION", ADD_RECENT_ADDRESS = "ADD_RECENT_ADDRESS", LOAD_RECENT_ADDRESSES = "LOAD_RECENT_ADDRESSES", + LOAD_LAST_USED_ACCOUNT = "LOAD_LAST_USED_ACCOUNT", SIGN_OUT = "SIGN_OUT", SHOW_BACKUP_PHRASE = "SHOW_BACKUP_PHRASE", SAVE_ALLOWLIST = "SAVE_ALLOWLIST", SAVE_SETTINGS = "SAVE_SETTINGS", + SAVE_EXPERIMENTAL_FEATURES = "SAVE_EXPERIMENTAL_FEATURES", LOAD_SETTINGS = "LOAD_SETTINGS", GET_CACHED_ASSET_ICON = "GET_CACHED_ASSET_ICON", CACHE_ASSET_ICON = "CACHE_ASSET_ICON", GET_CACHED_ASSET_DOMAIN = "GET_CACHED_ASSET_DOMAIN", CACHE_ASSET_DOMAIN = "CACHE_ASSET_DOMAIN", - GET_BLOCKED_ACCOUNTS = "GET_BLOCKED_ACCOUNTS", - GET_BLOCKED_DOMAINS = "GET_BLOCKED_DOMAINS", + GET_MEMO_REQUIRED_ACCOUNTS = "GET_MEMO_REQUIRED_ACCOUNTS", ADD_CUSTOM_NETWORK = "ADD_CUSTOM_NETWORK", CHANGE_NETWORK = "CHANGE_NETWORK", REMOVE_CUSTOM_NETWORK = "REMOVE_CUSTOM_NETWORK", @@ -40,10 +43,17 @@ export declare enum SERVICE_TYPES { RESET_EXP_DATA = "RESET_EXP_DATA", ADD_TOKEN_ID = "ADD_TOKEN_ID", GET_TOKEN_IDS = "GET_TOKEN_IDS", - REMOVE_TOKEN_ID = "REMOVE_TOKEN_ID" + REMOVE_TOKEN_ID = "REMOVE_TOKEN_ID", + GET_MIGRATABLE_ACCOUNTS = "GET_MIGRATABLE_ACCOUNTS", + GET_MIGRATED_MNEMONIC_PHRASE = "GET_MIGRATED_MNEMONIC_PHRASE", + MIGRATE_ACCOUNTS = "MIGRATE_ACCOUNTS", + ADD_ASSETS_LIST = "ADD_ASSETS_LIST", + MODIFY_ASSETS_LIST = "MODIFY_ASSETS_LIST" } export declare enum EXTERNAL_SERVICE_TYPES { REQUEST_ACCESS = "REQUEST_ACCESS", + REQUEST_PUBLIC_KEY = "REQUEST_PUBLIC_KEY", + SUBMIT_TOKEN = "SUBMIT_TOKEN", SUBMIT_TRANSACTION = "SUBMIT_TRANSACTION", SUBMIT_BLOB = "SUBMIT_BLOB", SUBMIT_AUTH_ENTRY = "SUBMIT_AUTH_ENTRY", diff --git a/src/external/stellar-freighter-api/@shared/constants/soroban/token.d.ts b/src/external/stellar-freighter-api/@shared/constants/soroban/token.d.ts new file mode 100644 index 0000000..9c5ee8b --- /dev/null +++ b/src/external/stellar-freighter-api/@shared/constants/soroban/token.d.ts @@ -0,0 +1,31 @@ +import { NETWORKS } from "@shared/constants/stellar"; +export declare enum SorobanTokenInterface { + transfer = "transfer", + mint = "mint" +} +export type ArgsForTokenInvocation = { + from: string; + to: string; + amount: bigint | number; +}; +export type TokenInvocationArgs = ArgsForTokenInvocation & { + fnName: SorobanTokenInterface; + contractId: string; +}; +export interface SorobanToken { + transfer: (from: string, to: string, amount: number) => void; + mint: (to: string, amount: number) => void; + name: string; + balance: number; + symbol: string; + decimals: number; +} +export type AssetsListKey = NETWORKS.PUBLIC | NETWORKS.TESTNET; +export type AssetsLists = { + [K in AssetsListKey]: AssetsListItem[]; +}; +export interface AssetsListItem { + url: string; + isEnabled: boolean; +} +export declare const DEFAULT_ASSETS_LISTS: AssetsLists; diff --git a/src/external/stellar-freighter-api/@shared/constants/stellar.d.ts b/src/external/stellar-freighter-api/@shared/constants/stellar.d.ts index 7f54032..15bf3a5 100644 --- a/src/external/stellar-freighter-api/@shared/constants/stellar.d.ts +++ b/src/external/stellar-freighter-api/@shared/constants/stellar.d.ts @@ -18,7 +18,7 @@ export declare enum FRIENDBOT_URLS { FUTURENET = "https://friendbot-futurenet.stellar.org" } export declare const SOROBAN_RPC_URLS: { - [key in NETWORKS]?: string; + [key in NETWORKS]: string; }; export interface NetworkDetails { network: string; @@ -32,3 +32,5 @@ export declare const MAINNET_NETWORK_DETAILS: NetworkDetails; export declare const TESTNET_NETWORK_DETAILS: NetworkDetails; export declare const FUTURENET_NETWORK_DETAILS: NetworkDetails; export declare const DEFAULT_NETWORKS: Array<NetworkDetails>; +export declare const BASE_RESERVE: 0.5; +export declare const BASE_RESERVE_MIN_COUNT: 2; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/addToken.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/addToken.d.ts new file mode 100644 index 0000000..ae96592 --- /dev/null +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/addToken.d.ts @@ -0,0 +1,9 @@ +import { FreighterApiError } from "@shared/api/types"; +export declare const addToken: (args: { + contractId: string; + networkPassphrase?: string; +}) => Promise<{ + contractId: string; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getAddress.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/getAddress.d.ts new file mode 100644 index 0000000..c79ba8c --- /dev/null +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/getAddress.d.ts @@ -0,0 +1,6 @@ +import { FreighterApiError } from "@shared/api/types"; +export declare const getAddress: () => Promise<{ + address: string; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getNetwork.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/getNetwork.d.ts index 6352aa0..ccd6ac3 100644 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getNetwork.d.ts +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/getNetwork.d.ts @@ -1 +1,7 @@ -export declare const getNetwork: () => Promise<string>; +import { FreighterApiError } from "@shared/api/types"; +export declare const getNetwork: () => Promise<{ + network: string; + networkPassphrase: string; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getNetworkDetails.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/getNetworkDetails.d.ts index b161629..886d9ec 100644 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getNetworkDetails.d.ts +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/getNetworkDetails.d.ts @@ -1,6 +1,9 @@ +import { FreighterApiError } from "@shared/api/types"; export declare const getNetworkDetails: () => Promise<{ network: string; networkUrl: string; networkPassphrase: string; sorobanRpcUrl?: string; +} & { + error?: FreighterApiError; }>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getPublicKey.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/getPublicKey.d.ts deleted file mode 100644 index 80cf670..0000000 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getPublicKey.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const getPublicKey: () => Promise<string>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getUserInfo.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/getUserInfo.d.ts deleted file mode 100644 index 0a464a2..0000000 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/getUserInfo.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const getUserInfo: () => Promise<{ - publicKey: string; -}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/index.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/index.d.ts index 8c3e29a..88f234a 100644 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/index.d.ts +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/index.d.ts @@ -1,40 +1,97 @@ -import { getPublicKey } from "./getPublicKey"; +import { getAddress } from "./getAddress"; +import { addToken } from "./addToken"; import { signTransaction } from "./signTransaction"; -import { signBlob } from "./signBlob"; +import { signMessage } from "./signMessage"; import { signAuthEntry } from "./signAuthEntry"; import { isConnected } from "./isConnected"; import { getNetwork } from "./getNetwork"; import { getNetworkDetails } from "./getNetworkDetails"; import { isAllowed } from "./isAllowed"; import { setAllowed } from "./setAllowed"; -import { getUserInfo } from "./getUserInfo"; +import { requestAccess } from "./requestAccess"; +import { WatchWalletChanges } from "./watchWalletChanges"; export declare const isBrowser: boolean; -export { getPublicKey, signTransaction, signBlob, signAuthEntry, isConnected, getNetwork, getNetworkDetails, isAllowed, setAllowed, getUserInfo, }; +export { getAddress, addToken, signTransaction, signMessage, signAuthEntry, isConnected, getNetwork, getNetworkDetails, isAllowed, setAllowed, requestAccess, WatchWalletChanges, }; declare const _default: { - getPublicKey: () => Promise<string>; + getAddress: () => Promise<{ + address: string; + } & { + error?: import("@shared/api/types").FreighterApiError; + }>; + addToken: (args: { + contractId: string; + networkPassphrase?: string; + }) => Promise<{ + contractId: string; + } & { + error?: import("@shared/api/types").FreighterApiError; + }>; signTransaction: (transactionXdr: string, opts?: { - network?: string | undefined; - networkPassphrase?: string | undefined; - accountToSign?: string | undefined; - } | undefined) => Promise<string>; - signBlob: (blob: string, opts?: { - accountToSign?: string | undefined; - } | undefined) => Promise<string>; + networkPassphrase?: string; + address?: string; + }) => Promise<{ + signedTxXdr: string; + signerAddress: string; + } & { + error?: import("@shared/api/types").FreighterApiError; + }>; + signMessage: (message: string, opts?: { + networkPassphrase?: string; + address?: string; + }) => Promise<({ + signedMessage: Buffer | null; + signerAddress: string; + } & { + error?: import("@shared/api/types").FreighterApiError; + }) | ({ + signedMessage: string; + signerAddress: string; + } & { + error?: import("@shared/api/types").FreighterApiError; + })>; signAuthEntry: (entryXdr: string, opts?: { - accountToSign?: string | undefined; - } | undefined) => Promise<string>; - isConnected: () => Promise<boolean>; - getNetwork: () => Promise<string>; + networkPassphrase?: string; + address?: string; + }) => Promise<{ + signedAuthEntry: Buffer | null; + signerAddress: string; + } & { + error?: import("@shared/api/types").FreighterApiError; + }>; + isConnected: () => Promise<{ + isConnected: boolean; + } & { + error?: import("@shared/api/types").FreighterApiError; |