From b0c56d16dbe7de30a16a0715148ecfe739c665da Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 15 Mar 2025 15:50:27 +0200 Subject: stellar freighter api update --- .../2023.11.07-stellar-freighter-api.tar.gz | Bin 0 -> 5564 bytes .../@shared/api/external.d.ts | 73 +- .../@shared/api/helpers/extensionMessaging.d.ts | 12 + .../stellar-freighter-api/@shared/api/types.d.ts | 187 +- .../@shared/constants/hardwareWallet.d.ts | 1 + .../@shared/constants/services.d.ts | 18 +- .../@shared/constants/soroban/token.d.ts | 31 + .../@shared/constants/stellar.d.ts | 4 +- .../@stellar/freighter-api/src/addToken.d.ts | 9 + .../@stellar/freighter-api/src/getAddress.d.ts | 6 + .../@stellar/freighter-api/src/getNetwork.d.ts | 8 +- .../freighter-api/src/getNetworkDetails.d.ts | 3 + .../@stellar/freighter-api/src/getPublicKey.d.ts | 1 - .../@stellar/freighter-api/src/getUserInfo.d.ts | 3 - .../@stellar/freighter-api/src/index.d.ts | 99 +- .../@stellar/freighter-api/src/isAllowed.d.ts | 7 +- .../@stellar/freighter-api/src/isConnected.d.ts | 7 +- .../@stellar/freighter-api/src/requestAccess.d.ts | 6 + .../@stellar/freighter-api/src/setAllowed.d.ts | 7 +- .../@stellar/freighter-api/src/signAuthEntry.d.ts | 11 +- .../@stellar/freighter-api/src/signBlob.d.ts | 3 - .../@stellar/freighter-api/src/signMessage.d.ts | 19 + .../freighter-api/src/signTransaction.d.ts | 13 +- .../freighter-api/src/watchWalletChanges.d.ts | 21 + src/external/stellar-freighter-api/index.min.js | 3 +- .../stellar-freighter-api/index.min.js.map | 1 + src/external/stellar-sdk-minimal.js | 48541 +++++++++++++++++++ src/external/stellar-sdk-minimal.min.js | 3 + .../stellar-sdk-minimal.min.js.LICENSE.txt | 1051 + 29 files changed, 50063 insertions(+), 85 deletions(-) create mode 100644 src/external/2023.11.07-stellar-freighter-api.tar.gz create mode 100644 src/external/stellar-freighter-api/@shared/constants/soroban/token.d.ts create mode 100644 src/external/stellar-freighter-api/@stellar/freighter-api/src/addToken.d.ts create mode 100644 src/external/stellar-freighter-api/@stellar/freighter-api/src/getAddress.d.ts delete mode 100644 src/external/stellar-freighter-api/@stellar/freighter-api/src/getPublicKey.d.ts delete mode 100644 src/external/stellar-freighter-api/@stellar/freighter-api/src/getUserInfo.d.ts create mode 100644 src/external/stellar-freighter-api/@stellar/freighter-api/src/requestAccess.d.ts delete mode 100644 src/external/stellar-freighter-api/@stellar/freighter-api/src/signBlob.d.ts create mode 100644 src/external/stellar-freighter-api/@stellar/freighter-api/src/signMessage.d.ts create mode 100644 src/external/stellar-freighter-api/@stellar/freighter-api/src/watchWalletChanges.d.ts create mode 100644 src/external/stellar-freighter-api/index.min.js.map create mode 100644 src/external/stellar-sdk-minimal.js create mode 100644 src/external/stellar-sdk-minimal.min.js create mode 100644 src/external/stellar-sdk-minimal.min.js.LICENSE.txt diff --git a/src/external/2023.11.07-stellar-freighter-api.tar.gz b/src/external/2023.11.07-stellar-freighter-api.tar.gz new file mode 100644 index 0000000..a6aaade Binary files /dev/null and b/src/external/2023.11.07-stellar-freighter-api.tar.gz differ 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; +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; -export declare const submitBlob: (blob: string, opts?: { - accountToSign?: string | undefined; -} | undefined) => Promise; + 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; -export declare const requestNetwork: () => Promise; + 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; -export declare const requestAllowedStatus: () => Promise; -export declare const setAllowedStatus: () => Promise; -export declare const requestUserInfo: () => Promise; 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; export declare const sendMessageToBackground: (msg: Msg) => Promise; +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; + 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; + 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 | []; } 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; 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; +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; +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; 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; + 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; - signBlob: (blob: string, opts?: { - accountToSign?: string | undefined; - } | undefined) => Promise; + 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; - isConnected: () => Promise; - getNetwork: () => Promise; + 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; + }>; + getNetwork: () => Promise<{ + network: string; + networkPassphrase: string; + } & { + error?: import("@shared/api/types").FreighterApiError; + }>; getNetworkDetails: () => Promise<{ network: string; networkUrl: string; networkPassphrase: string; - sorobanRpcUrl?: string | undefined; + sorobanRpcUrl?: string; + } & { + error?: import("@shared/api/types").FreighterApiError; + }>; + isAllowed: () => Promise<{ + isAllowed: boolean; + } & { + error?: import("@shared/api/types").FreighterApiError; + }>; + setAllowed: () => Promise<{ + isAllowed: boolean; + } & { + error?: import("@shared/api/types").FreighterApiError; }>; - isAllowed: () => Promise; - setAllowed: () => Promise; - getUserInfo: () => Promise<{ - publicKey: string; + requestAccess: () => Promise<{ + address: string; + } & { + error?: import("@shared/api/types").FreighterApiError; }>; + WatchWalletChanges: typeof WatchWalletChanges; }; export default _default; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/isAllowed.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/isAllowed.d.ts index 39eed0a..77f4c54 100644 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/isAllowed.d.ts +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/isAllowed.d.ts @@ -1 +1,6 @@ -export declare const isAllowed: () => Promise; +import { FreighterApiError } from "@shared/api/types"; +export declare const isAllowed: () => Promise<{ + isAllowed: boolean; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/isConnected.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/isConnected.d.ts index 8e4b262..c0357e1 100644 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/isConnected.d.ts +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/isConnected.d.ts @@ -1 +1,6 @@ -export declare const isConnected: () => Promise; +import { FreighterApiError } from "@shared/api/types"; +export declare const isConnected: () => Promise<{ + isConnected: boolean; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/requestAccess.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/requestAccess.d.ts new file mode 100644 index 0000000..11ca962 --- /dev/null +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/requestAccess.d.ts @@ -0,0 +1,6 @@ +import { FreighterApiError } from "@shared/api/types"; +export declare const requestAccess: () => Promise<{ + address: string; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/setAllowed.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/setAllowed.d.ts index 989cab6..296c8a7 100644 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/setAllowed.d.ts +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/setAllowed.d.ts @@ -1 +1,6 @@ -export declare const setAllowed: () => Promise; +import { FreighterApiError } from "@shared/api/types"; +export declare const setAllowed: () => Promise<{ + isAllowed: boolean; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/signAuthEntry.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/signAuthEntry.d.ts index ca8cc91..598d76d 100644 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/signAuthEntry.d.ts +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/signAuthEntry.d.ts @@ -1,3 +1,10 @@ +import { FreighterApiError } from "@shared/api/types"; export declare const signAuthEntry: (entryXdr: string, opts?: { - accountToSign?: string | undefined; -} | undefined) => Promise; + networkPassphrase?: string; + address?: string; +}) => Promise<{ + signedAuthEntry: Buffer | null; + signerAddress: string; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/signBlob.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/signBlob.d.ts deleted file mode 100644 index eab6a5a..0000000 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/signBlob.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const signBlob: (blob: string, opts?: { - accountToSign?: string | undefined; -} | undefined) => Promise; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/signMessage.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/signMessage.d.ts new file mode 100644 index 0000000..e86ac7f --- /dev/null +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/signMessage.d.ts @@ -0,0 +1,19 @@ +import { Buffer } from "buffer"; +import { FreighterApiError } from "@shared/api/types"; +type SignMessageV3Response = { + signedMessage: Buffer | null; + signerAddress: string; +} & { + error?: FreighterApiError; +}; +type SignMessageV4Response = { + signedMessage: string; + signerAddress: string; +} & { + error?: FreighterApiError; +}; +export declare const signMessage: (message: string, opts?: { + networkPassphrase?: string; + address?: string; +}) => Promise; +export {}; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/signTransaction.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/signTransaction.d.ts index 2605f0f..1c38f36 100644 --- a/src/external/stellar-freighter-api/@stellar/freighter-api/src/signTransaction.d.ts +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/signTransaction.d.ts @@ -1,5 +1,10 @@ +import { FreighterApiError } from "@shared/api/types"; export declare const signTransaction: (transactionXdr: string, opts?: { - network?: string | undefined; - networkPassphrase?: string | undefined; - accountToSign?: string | undefined; -} | undefined) => Promise; + networkPassphrase?: string; + address?: string; +}) => Promise<{ + signedTxXdr: string; + signerAddress: string; +} & { + error?: FreighterApiError; +}>; diff --git a/src/external/stellar-freighter-api/@stellar/freighter-api/src/watchWalletChanges.d.ts b/src/external/stellar-freighter-api/@stellar/freighter-api/src/watchWalletChanges.d.ts new file mode 100644 index 0000000..79ff95e --- /dev/null +++ b/src/external/stellar-freighter-api/@stellar/freighter-api/src/watchWalletChanges.d.ts @@ -0,0 +1,21 @@ +import { FreighterApiError } from "@shared/api/types"; +interface CallbackParams { + address: string; + network: string; + networkPassphrase: string; + error?: FreighterApiError; +} +export declare class WatchWalletChanges { + timeout: number; + currentAddress: string; + currentNetwork: string; + currentNetworkPassphrase: string; + isRunning: boolean; + constructor(timeout?: number); + watch(cb: (params: CallbackParams) => void): { + error?: FreighterApiError; + }; + fetchInfo: (cb: (params: CallbackParams) => void) => Promise; + stop(): void; +} +export {}; diff --git a/src/external/stellar-freighter-api/index.min.js b/src/external/stellar-freighter-api/index.min.js index bcd8fc3..dfb704e 100644 --- a/src/external/stellar-freighter-api/index.min.js +++ b/src/external/stellar-freighter-api/index.min.js @@ -1 +1,2 @@ -!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.freighterApi=r():e.freighterApi=r()}(this,()=>(()=>{"use strict";var e,r,o={d:(e,r)=>{for(var E in r)o.o(r,E)&&!o.o(e,E)&&Object.defineProperty(e,E,{enumerable:!0,get:r[E]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},E={};o.r(E),o.d(E,{default:()=>a,getNetwork:()=>N,getNetworkDetails:()=>s,getPublicKey:()=>t,getUserInfo:()=>i,isAllowed:()=>O,isBrowser:()=>R,isConnected:()=>n,setAllowed:()=>C,signAuthEntry:()=>A,signBlob:()=>S,signTransaction:()=>_}),function(e){e.CREATE_ACCOUNT="CREATE_ACCOUNT",e.FUND_ACCOUNT="FUND_ACCOUNT",e.ADD_ACCOUNT="ADD_ACCOUNT",e.IMPORT_ACCOUNT="IMPORT_ACCOUNT",e.IMPORT_HARDWARE_WALLET="IMPORT_HARDWARE_WALLET",e.LOAD_ACCOUNT="LOAD_ACCOUNT",e.MAKE_ACCOUNT_ACTIVE="MAKE_ACCOUNT_ACTIVE",e.UPDATE_ACCOUNT_NAME="UPDATE_ACCOUNT_NAME",e.GET_MNEMONIC_PHRASE="GET_MNEMONIC_PHRASE",e.CONFIRM_MNEMONIC_PHRASE="CONFIRM_MNEMONIC_PHRASE",e.RECOVER_ACCOUNT="RECOVER_ACCOUNT",e.CONFIRM_PASSWORD="CONFIRM_PASSWORD",e.REJECT_ACCESS="REJECT_ACCESS",e.GRANT_ACCESS="GRANT_ACCESS",e.SIGN_TRANSACTION="SIGN_TRANSACTION",e.SIGN_BLOB="SIGN_BLOB",e.SIGN_AUTH_ENTRY="SIGN_AUTH_ENTRY",e.HANDLE_SIGNED_HW_TRANSACTION="HANDLE_SIGNED_HW_TRANSACTION",e.REJECT_TRANSACTION="REJECT_TRANSACTION",e.SIGN_FREIGHTER_TRANSACTION="SIGN_FREIGHTER_TRANSACTION",e.SIGN_FREIGHTER_SOROBAN_TRANSACTION="SIGN_FREIGHTER_SOROBAN_TRANSACTION",e.ADD_RECENT_ADDRESS="ADD_RECENT_ADDRESS",e.LOAD_RECENT_ADDRESSES="LOAD_RECENT_ADDRESSES",e.SIGN_OUT="SIGN_OUT",e.SHOW_BACKUP_PHRASE="SHOW_BACKUP_PHRASE",e.SAVE_ALLOWLIST="SAVE_ALLOWLIST",e.SAVE_SETTINGS="SAVE_SETTINGS",e.LOAD_SETTINGS="LOAD_SETTINGS",e.GET_CACHED_ASSET_ICON="GET_CACHED_ASSET_ICON",e.CACHE_ASSET_ICON="CACHE_ASSET_ICON",e.GET_CACHED_ASSET_DOMAIN="GET_CACHED_ASSET_DOMAIN",e.CACHE_ASSET_DOMAIN="CACHE_ASSET_DOMAIN",e.GET_BLOCKED_ACCOUNTS="GET_BLOCKED_ACCOUNTS",e.GET_BLOCKED_DOMAINS="GET_BLOCKED_DOMAINS",e.ADD_CUSTOM_NETWORK="ADD_CUSTOM_NETWORK",e.CHANGE_NETWORK="CHANGE_NETWORK",e.REMOVE_CUSTOM_NETWORK="REMOVE_CUSTOM_NETWORK",e.EDIT_CUSTOM_NETWORK="EDIT_CUSTOM_NETWORK",e.RESET_EXP_DATA="RESET_EXP_DATA",e.ADD_TOKEN_ID="ADD_TOKEN_ID",e.GET_TOKEN_IDS="GET_TOKEN_IDS",e.REMOVE_TOKEN_ID="REMOVE_TOKEN_ID"}(e||(e={})),function(e){e.REQUEST_ACCESS="REQUEST_ACCESS",e.SUBMIT_TRANSACTION="SUBMIT_TRANSACTION",e.SUBMIT_BLOB="SUBMIT_BLOB",e.SUBMIT_AUTH_ENTRY="SUBMIT_AUTH_ENTRY",e.REQUEST_NETWORK="REQUEST_NETWORK",e.REQUEST_NETWORK_DETAILS="REQUEST_NETWORK_DETAILS",e.REQUEST_CONNECTION_STATUS="REQUEST_CONNECTION_STATUS",e.REQUEST_ALLOWED_STATUS="REQUEST_ALLOWED_STATUS",e.SET_ALLOWED_STATUS="SET_ALLOWED_STATUS",e.REQUEST_USER_INFO="REQUEST_USER_INFO"}(r||(r={}));const T=e=>{const o=Date.now()+Math.random();return window.postMessage({source:"FREIGHTER_EXTERNAL_MSG_REQUEST",messageId:o,...e},window.location.origin),new Promise(E=>{let T=0;e.type===r.REQUEST_CONNECTION_STATUS&&(T=setTimeout(()=>{E({isConnected:!1}),window.removeEventListener("message",t)},2e3));const t=e=>{var r,_;e.source===window&&"FREIGHTER_EXTERNAL_MSG_RESPONSE"===(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.source)&&(null===(_=null==e?void 0:e.data)||void 0===_?void 0:_.messagedId)===o&&(E(e.data),window.removeEventListener("message",t),clearTimeout(T))};window.addEventListener("message",t,!1)})},t=()=>R?(async()=>{let e={publicKey:"",error:""};try{e=await T({type:r.REQUEST_ACCESS})}catch(e){console.error(e)}const{publicKey:o,error:E}=e;if(E)throw E;return o})():Promise.resolve(""),_=(e,o)=>R?(async(e,o,E)=>{let t="",_="",S="";"object"==typeof o?(t=o.network||"",_=o.accountToSign||"",S=o.networkPassphrase||""):(t=o||"",_="");let A={signedTransaction:"",error:""};try{A=await T({transactionXdr:e,network:t,networkPassphrase:S,accountToSign:_,type:r.SUBMIT_TRANSACTION})}catch(e){throw console.error(e),e}const{signedTransaction:n,error:N}=A;if(N)throw N;return n})(e,o):Promise.resolve(""),S=(e,o)=>R?(async(e,o)=>{let E={signedBlob:"",error:""};const t=(o||{}).accountToSign||"";try{E=await T({blob:e,accountToSign:t,type:r.SUBMIT_BLOB})}catch(e){throw console.error(e),e}const{signedBlob:_,error:S}=E;if(S)throw S;return _})(e,o):Promise.resolve(""),A=(e,o)=>R?(async(e,o)=>{let E={signedAuthEntry:"",error:""};const t=(o||{}).accountToSign||"";try{E=await T({entryXdr:e,accountToSign:t,type:r.SUBMIT_AUTH_ENTRY})}catch(e){console.error(e)}const{signedAuthEntry:_,error:S}=E;if(S)throw S;return _})(e,o):Promise.resolve(""),n=()=>R?window.freighter?Promise.resolve(window.freighter):(async()=>{let e={isConnected:!1};try{e=await T({type:r.REQUEST_CONNECTION_STATUS})}catch(e){console.error(e)}return e.isConnected})():Promise.resolve(!1),N=()=>R?(async()=>{let e={network:"",error:""};try{e=await T({type:r.REQUEST_NETWORK})}catch(e){console.error(e)}const{network:o,error:E}=e;if(E)throw E;return o})():Promise.resolve(""),s=()=>R?(async()=>{let e={networkDetails:{network:"",networkName:"",networkUrl:"",networkPassphrase:"",sorobanRpcUrl:void 0},error:""};try{e=await T({type:r.REQUEST_NETWORK_DETAILS})}catch(e){console.error(e)}const{networkDetails:o,error:E}=e,{network:t,networkUrl:_,networkPassphrase:S,sorobanRpcUrl:A}=o;if(E)throw E;return{network:t,networkUrl:_,networkPassphrase:S,sorobanRpcUrl:A}})():Promise.resolve({network:"",networkUrl:"",networkPassphrase:"",sorobanRpcUrl:""}),O=()=>R?(async()=>{let e={isAllowed:!1};try{e=await T({type:r.REQUEST_ALLOWED_STATUS})}catch(e){console.error(e)}return e.isAllowed})():Promise.resolve(!1),C=()=>R?(async()=>{let e={isAllowed:!1,error:""};try{e=await T({type:r.SET_ALLOWED_STATUS})}catch(e){console.error(e)}const{isAllowed:o,error:E}=e;if(E)throw E;return o})():Promise.resolve(!1),i=()=>R?(async()=>{let e={userInfo:{publicKey:""},error:""};try{e=await T({type:r.REQUEST_USER_INFO})}catch(e){console.error(e)}const{userInfo:o,error:E}=e;if(E)throw E;return o})():Promise.resolve({publicKey:""}),R="undefined"!=typeof window,a={getPublicKey:t,signTransaction:_,signBlob:S,signAuthEntry:A,isConnected:n,getNetwork:N,getNetworkDetails:s,isAllowed:O,setAllowed:C,getUserInfo:i};return E})()); \ No newline at end of file +!function(r,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.freighterApi=e():r.freighterApi=e()}(this,(()=>(()=>{"use strict";var r,e,s={d:(r,e)=>{for(var t in e)s.o(e,t)&&!s.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},t={};s.r(t),s.d(t,{WatchWalletChanges:()=>w,addToken:()=>i,default:()=>u,getAddress:()=>a,getNetwork:()=>N,getNetworkDetails:()=>l,isAllowed:()=>C,isBrowser:()=>I,isConnected:()=>c,requestAccess:()=>R,setAllowed:()=>O,signAuthEntry:()=>d,signMessage:()=>S,signTransaction:()=>_}),function(r){r.CREATE_ACCOUNT="CREATE_ACCOUNT",r.FUND_ACCOUNT="FUND_ACCOUNT",r.ADD_ACCOUNT="ADD_ACCOUNT",r.IMPORT_ACCOUNT="IMPORT_ACCOUNT",r.IMPORT_HARDWARE_WALLET="IMPORT_HARDWARE_WALLET",r.LOAD_ACCOUNT="LOAD_ACCOUNT",r.MAKE_ACCOUNT_ACTIVE="MAKE_ACCOUNT_ACTIVE",r.UPDATE_ACCOUNT_NAME="UPDATE_ACCOUNT_NAME",r.GET_MNEMONIC_PHRASE="GET_MNEMONIC_PHRASE",r.CONFIRM_MNEMONIC_PHRASE="CONFIRM_MNEMONIC_PHRASE",r.CONFIRM_MIGRATED_MNEMONIC_PHRASE="CONFIRM_MIGRATED_MNEMONIC_PHRASE",r.RECOVER_ACCOUNT="RECOVER_ACCOUNT",r.CONFIRM_PASSWORD="CONFIRM_PASSWORD",r.REJECT_ACCESS="REJECT_ACCESS",r.GRANT_ACCESS="GRANT_ACCESS",r.ADD_TOKEN="ADD_TOKEN",r.SIGN_TRANSACTION="SIGN_TRANSACTION",r.SIGN_BLOB="SIGN_BLOB",r.SIGN_AUTH_ENTRY="SIGN_AUTH_ENTRY",r.HANDLE_SIGNED_HW_PAYLOAD="HANDLE_SIGNED_HW_PAYLOAD",r.REJECT_TRANSACTION="REJECT_TRANSACTION",r.SIGN_FREIGHTER_TRANSACTION="SIGN_FREIGHTER_TRANSACTION",r.SIGN_FREIGHTER_SOROBAN_TRANSACTION="SIGN_FREIGHTER_SOROBAN_TRANSACTION",r.ADD_RECENT_ADDRESS="ADD_RECENT_ADDRESS",r.LOAD_RECENT_ADDRESSES="LOAD_RECENT_ADDRESSES",r.LOAD_LAST_USED_ACCOUNT="LOAD_LAST_USED_ACCOUNT",r.SIGN_OUT="SIGN_OUT",r.SHOW_BACKUP_PHRASE="SHOW_BACKUP_PHRASE",r.SAVE_ALLOWLIST="SAVE_ALLOWLIST",r.SAVE_SETTINGS="SAVE_SETTINGS",r.SAVE_EXPERIMENTAL_FEATURES="SAVE_EXPERIMENTAL_FEATURES",r.LOAD_SETTINGS="LOAD_SETTINGS",r.GET_CACHED_ASSET_ICON="GET_CACHED_ASSET_ICON",r.CACHE_ASSET_ICON="CACHE_ASSET_ICON",r.GET_CACHED_ASSET_DOMAIN="GET_CACHED_ASSET_DOMAIN",r.CACHE_ASSET_DOMAIN="CACHE_ASSET_DOMAIN",r.GET_MEMO_REQUIRED_ACCOUNTS="GET_MEMO_REQUIRED_ACCOUNTS",r.ADD_CUSTOM_NETWORK="ADD_CUSTOM_NETWORK",r.CHANGE_NETWORK="CHANGE_NETWORK",r.REMOVE_CUSTOM_NETWORK="REMOVE_CUSTOM_NETWORK",r.EDIT_CUSTOM_NETWORK="EDIT_CUSTOM_NETWORK",r.RESET_EXP_DATA="RESET_EXP_DATA",r.ADD_TOKEN_ID="ADD_TOKEN_ID",r.GET_TOKEN_IDS="GET_TOKEN_IDS",r.REMOVE_TOKEN_ID="REMOVE_TOKEN_ID",r.GET_MIGRATABLE_ACCOUNTS="GET_MIGRATABLE_ACCOUNTS",r.GET_MIGRATED_MNEMONIC_PHRASE="GET_MIGRATED_MNEMONIC_PHRASE",r.MIGRATE_ACCOUNTS="MIGRATE_ACCOUNTS",r.ADD_ASSETS_LIST="ADD_ASSETS_LIST",r.MODIFY_ASSETS_LIST="MODIFY_ASSETS_LIST"}(r||(r={})),function(r){r.REQUEST_ACCESS="REQUEST_ACCESS",r.REQUEST_PUBLIC_KEY="REQUEST_PUBLIC_KEY",r.SUBMIT_TOKEN="SUBMIT_TOKEN",r.SUBMIT_TRANSACTION="SUBMIT_TRANSACTION",r.SUBMIT_BLOB="SUBMIT_BLOB",r.SUBMIT_AUTH_ENTRY="SUBMIT_AUTH_ENTRY",r.REQUEST_NETWORK="REQUEST_NETWORK",r.REQUEST_NETWORK_DETAILS="REQUEST_NETWORK_DETAILS",r.REQUEST_CONNECTION_STATUS="REQUEST_CONNECTION_STATUS",r.REQUEST_ALLOWED_STATUS="REQUEST_ALLOWED_STATUS",r.SET_ALLOWED_STATUS="SET_ALLOWED_STATUS",r.REQUEST_USER_INFO="REQUEST_USER_INFO"}(e||(e={}));const n=r=>{const s=Date.now()+Math.random();return window.postMessage({source:"FREIGHTER_EXTERNAL_MSG_REQUEST",messageId:s,...r},window.location.origin),new Promise((t=>{let n=0;r.type!==e.REQUEST_CONNECTION_STATUS&&r.type!==e.REQUEST_PUBLIC_KEY||(n=setTimeout((()=>{t({isConnected:!1,publicKey:""}),window.removeEventListener("message",o)}),2e3));const o=r=>{var e,E;r.source===window&&"FREIGHTER_EXTERNAL_MSG_RESPONSE"===(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.source)&&(null===(E=null==r?void 0:r.data)||void 0===E?void 0:E.messagedId)===s&&(t(r.data),window.removeEventListener("message",o),clearTimeout(n))};window.addEventListener("message",o,!1)}))},o={code:-1,message:"Node environment is not supported"},E={code:-1,message:"The wallet encountered an internal error. Please try again or contact the wallet if the problem persists."},T=async()=>{let r;try{r=await n({type:e.REQUEST_PUBLIC_KEY})}catch(r){console.error(r)}return{publicKey:(null==r?void 0:r.publicKey)||"",error:null==r?void 0:r.apiError}},A=async()=>{let r;try{r=await n({type:e.REQUEST_NETWORK_DETAILS})}catch(r){console.error(r)}const{networkDetails:s,apiError:t}=r||{networkDetails:{network:"",networkName:"",networkUrl:"",networkPassphrase:"",sorobanRpcUrl:void 0,apiError:""}},{network:o,networkUrl:E,networkPassphrase:T,sorobanRpcUrl:A}=s;return{network:o,networkUrl:E,networkPassphrase:T,sorobanRpcUrl:A,error:t}},a=async()=>{let r="";if(I){const e=await T();return r=e.publicKey,e.error?{address:r,error:e.error}:{address:r}}return{address:r,error:o}},i=async r=>{if(I){const s=await(async r=>{let s;try{s=await n({contractId:r.contractId,networkPassphrase:r.networkPassphrase,type:e.SUBMIT_TOKEN})}catch(r){return{error:E}}return{contractId:s.contractId,error:null==s?void 0:s.apiError}})(r);return s.error?{contractId:"",error:s.error}:{contractId:s.contractId||""}}return{contractId:"",error:o}},_=async(r,s)=>{if(I){const t=await(async(r,s)=>{let t,o,T,A;"object"==typeof s?(o=s.accountToSign,T=s.networkPassphrase):(t=s,o=void 0);try{A=await n({transactionXdr:r,network:t,networkPassphrase:T,accountToSign:o,type:e.SUBMIT_TRANSACTION})}catch(r){return{signedTransaction:"",signerAddress:"",error:E}}const{signedTransaction:a,signerAddress:i}=A;return{signedTransaction:a,signerAddress:i,error:null==A?void 0:A.apiError}})(r,s);return t.error?{signedTxXdr:"",signerAddress:"",error:t.error}:{signedTxXdr:t.signedTransaction,signerAddress:t.signerAddress}}return{signedTxXdr:"",signerAddress:"",error:o}},S=async(r,s)=>{if(I){const t=await(async(r,s,t)=>{let o;const T=(t||{}).address;try{o=await n({blob:r,accountToSign:T,apiVersion:s,type:e.SUBMIT_BLOB})}catch(r){return{signedMessage:null,signerAddress:"",error:E}}const{signedBlob:A,signerAddress:a}=o;return{signedMessage:A||null,signerAddress:a,error:null==o?void 0:o.apiError}})(r,"3.1.0",s);return t.error?{signedMessage:null,signerAddress:"",error:t.error}:{signedMessage:t.signedMessage,signerAddress:t.signerAddress}}return{signedMessage:null,signerAddress:"",error:o}},d=async(r,s)=>{if(I){const t=await(async(r,s)=>{const t=(s||{}).address;let o;try{o=await n({entryXdr:r,accountToSign:t,networkPassphrase:null==s?void 0:s.networkPassphrase,type:e.SUBMIT_AUTH_ENTRY})}catch(r){return console.error(r),{signedAuthEntry:null,signerAddress:"",error:E}}const{signedAuthEntry:T,signerAddress:A}=o;return{signedAuthEntry:T||null,signerAddress:A,error:null==o?void 0:o.apiError}})(r,s);return t.error?{signedAuthEntry:null,signerAddress:"",error:t.error}:{signedAuthEntry:t.signedAuthEntry,signerAddress:t.signerAddress}}return{signedAuthEntry:null,signerAddress:"",error:o}},c=async()=>I?window.freighter?Promise.resolve({isConnected:window.freighter}):(async()=>{let r={isConnected:!1};try{r=await n({type:e.REQUEST_CONNECTION_STATUS})}catch(r){console.error(r)}return{isConnected:r.isConnected}})():{isConnected:!1,error:o},N=async()=>{if(I){const r=await(async()=>{let r;try{r=await n({type:e.REQUEST_NETWORK_DETAILS})}catch(r){console.error(r)}const{networkDetails:s}=r||{networkDetails:{network:"",networkPassphrase:""}};return{network:null==s?void 0:s.network,networkPassphrase:null==s?void 0:s.networkPassphrase,error:null==r?void 0:r.apiError}})();return r.error?{network:"",networkPassphrase:"",error:r.error}:{network:r.network,networkPassphrase:r.networkPassphrase}}return{network:"",networkPassphrase:"",error:o}},l=async()=>{if(I){const r=await A();return r.error?{network:"",networkUrl:"",networkPassphrase:"",error:r.error}:{network:r.network,networkUrl:r.networkUrl,networkPassphrase:r.networkPassphrase,sorobanRpcUrl:r.sorobanRpcUrl}}return{network:"",networkUrl:"",networkPassphrase:"",error:o}},C=async()=>{let r=!1;if(I){const s=await(async()=>{let r;try{r=await n({type:e.REQUEST_ALLOWED_STATUS})}catch(r){console.error(r)}const{isAllowed:s}=r||{isAllowed:!1};return{isAllowed:s,error:null==r?void 0:r.apiError}})();return r=s.isAllowed,s.error?{isAllowed:r,error:s.error}:{isAllowed:r}}return{isAllowed:r,error:o}},O=async()=>{let r=!1;if(I){const s=await(async()=>{let r;try{r=await n({type:e.SET_ALLOWED_STATUS})}catch(r){console.error(r)}const{isAllowed:s}=r||{isAllowed:!1};return{isAllowed:s,error:null==r?void 0:r.apiError}})();return r=s.isAllowed,s.error?{isAllowed:r,error:s.error}:{isAllowed:r}}return{isAllowed:r,error:o}},R=async()=>{let r="";if(I){const s=await(async()=>{let r;try{r=await n({type:e.REQUEST_ACCESS})}catch(r){console.error(r)}const{publicKey:s}=r||{publicKey:""};return{publicKey:s,error:null==r?void 0:r.apiError}})();return r=s.publicKey,s.error?{address:r,error:s.error}:{address:r}}return{address:r,error:o}};class w{constructor(r=3e3){this.fetchInfo=async r=>{if(!this.isRunning)return;const e=await T(),s=await A();(e.error||s.error)&&r({address:"",network:"",networkPassphrase:"",error:e.error||s.error}),this.currentAddress===e.publicKey&&this.currentNetwork===s.network&&this.currentNetworkPassphrase===s.networkPassphrase||(this.currentAddress=e.publicKey,this.currentNetwork=s.network,this.currentNetworkPassphrase=s.networkPassphrase,r({address:e.publicKey,network:s.network,networkPassphrase:s.networkPassphrase})),setTimeout((()=>this.fetchInfo(r)),this.timeout)},this.timeout=r,this.currentAddress="",this.currentNetwork="",this.currentNetworkPassphrase="",this.isRunning=!1}watch(r){return I?(this.isRunning=!0,this.fetchInfo(r),{}):{error:o}}stop(){this.isRunning=!1}}const I="undefined"!=typeof window,u={getAddress:a,addToken:i,signTransaction:_,signMessage:S,signAuthEntry:d,isConnected:c,getNetwork:N,getNetworkDetails:l,isAllowed:C,setAllowed:O,requestAccess:R,WatchWalletChanges:w};return t})())); +//# sourceMappingURL=index.min.js.map \ No newline at end of file diff --git a/src/external/stellar-freighter-api/index.min.js.map b/src/external/stellar-freighter-api/index.min.js.map new file mode 100644 index 0000000..8b512ab --- /dev/null +++ b/src/external/stellar-freighter-api/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAsB,aAAID,IAE1BD,EAAmB,aAAIC,GACxB,CATD,CASGK,MAAM,I,mBCRT,ICDYC,EAqDAC,EDpDRC,EAAsB,CEA1BA,EAAwB,CAACP,EAASQ,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAEV,EAASS,IAC5EE,OAAOC,eAAeZ,EAASS,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,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ModuleDefinition","webpack://freighterApi/webpack/bootstrap","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@shared/constants/services.ts","webpack://freighterApi/webpack/runtime/define property getters","webpack://freighterApi/webpack/runtime/hasOwnProperty shorthand","webpack://freighterApi/webpack/runtime/make namespace object","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@shared/api/helpers/extensionMessaging.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@shared/api/external.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/getAddress.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/addToken.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/signTransaction.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/signMessage.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/signAuthEntry.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/isConnected.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/getNetwork.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/getNetworkDetails.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/isAllowed.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/setAllowed.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/requestAccess.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/watchWalletChanges.ts","webpack://freighterApi/./src/home/kaotisk/src/stellar/freighter/@stellar/freighter-api/src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"freighterApi\"] = factory();\n\telse\n\t\troot[\"freighterApi\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","export enum SERVICE_TYPES {\n CREATE_ACCOUNT = \"CREATE_ACCOUNT\",\n FUND_ACCOUNT = \"FUND_ACCOUNT\",\n ADD_ACCOUNT = \"ADD_ACCOUNT\",\n IMPORT_ACCOUNT = \"IMPORT_ACCOUNT\",\n IMPORT_HARDWARE_WALLET = \"IMPORT_HARDWARE_WALLET\",\n LOAD_ACCOUNT = \"LOAD_ACCOUNT\",\n MAKE_ACCOUNT_ACTIVE = \"MAKE_ACCOUNT_ACTIVE\",\n UPDATE_ACCOUNT_NAME = \"UPDATE_ACCOUNT_NAME\",\n GET_MNEMONIC_PHRASE = \"GET_MNEMONIC_PHRASE\",\n CONFIRM_MNEMONIC_PHRASE = \"CONFIRM_MNEMONIC_PHRASE\",\n CONFIRM_MIGRATED_MNEMONIC_PHRASE = \"CONFIRM_MIGRATED_MNEMONIC_PHRASE\",\n RECOVER_ACCOUNT = \"RECOVER_ACCOUNT\",\n CONFIRM_PASSWORD = \"CONFIRM_PASSWORD\",\n REJECT_ACCESS = \"REJECT_ACCESS\",\n GRANT_ACCESS = \"GRANT_ACCESS\",\n ADD_TOKEN = \"ADD_TOKEN\",\n SIGN_TRANSACTION = \"SIGN_TRANSACTION\",\n SIGN_BLOB = \"SIGN_BLOB\",\n SIGN_AUTH_ENTRY = \"SIGN_AUTH_ENTRY\",\n HANDLE_SIGNED_HW_PAYLOAD = \"HANDLE_SIGNED_HW_PAYLOAD\",\n REJECT_TRANSACTION = \"REJECT_TRANSACTI