@ton/appkit
Advanced tools
+10
| # CLAUDE.md — appkit | ||
| ## Code conventions | ||
| - All file names must be in kebab-case. | ||
| - For creating new actions and hooks, use the `add-action-and-hook` skill. | ||
| ## Imports from walletkit | ||
| Never import from `@ton/walletkit` directly in appkit code. Instead, create re-export files under `src/<module>/index.ts` that re-export the needed types and functions from `@ton/walletkit`. All other appkit code should import from these local re-exports. This keeps the walletkit dependency isolated so it can later be replaced with a shared package for kit libraries. |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { BalanceUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchBalanceByAddressOptions { | ||
| address: string | Address; | ||
| network?: Network; | ||
| onChange: (update: BalanceUpdate) => void; | ||
| } | ||
| export type WatchBalanceByAddressReturnType = () => void; | ||
| /** | ||
| * Watch account balance changes by address. | ||
| */ | ||
| export declare const watchBalanceByAddress: (appKit: AppKit, options: WatchBalanceByAddressOptions) => WatchBalanceByAddressReturnType; | ||
| //# sourceMappingURL=watch-balance-by-address.d.ts.map |
| {"version":3,"file":"watch-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/actions/balances/watch-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAC9B,QAAQ,MAAM,EACd,SAAS,4BAA4B,KACtC,+BAMF,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.watchBalanceByAddress = void 0; | ||
| const core_1 = require("@ton/core"); | ||
| const resolve_network_1 = require("../../utils/network/resolve-network"); | ||
| /** | ||
| * Watch account balance changes by address. | ||
| */ | ||
| const watchBalanceByAddress = (appKit, options) => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = core_1.Address.isAddress(address) ? address.toString() : core_1.Address.parse(address).toString(); | ||
| const resolvedNetwork = (0, resolve_network_1.resolveNetwork)(appKit, network); | ||
| return appKit.streamingManager.watchBalance(resolvedNetwork, addressString, onChange); | ||
| }; | ||
| exports.watchBalanceByAddress = watchBalanceByAddress; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { BalanceUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchBalanceOptions { | ||
| network?: Network; | ||
| onChange: (update: BalanceUpdate) => void; | ||
| } | ||
| export type WatchBalanceReturnType = () => void; | ||
| /** | ||
| * Watch account balance changes for the selected wallet. | ||
| */ | ||
| export declare const watchBalance: (appKit: AppKit, options: WatchBalanceOptions) => WatchBalanceReturnType; | ||
| //# sourceMappingURL=watch-balance.d.ts.map |
| {"version":3,"file":"watch-balance.d.ts","sourceRoot":"","sources":["../../../../src/actions/balances/watch-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,SAAS,mBAAmB,KAAG,sBA8B3E,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.watchBalance = void 0; | ||
| const app_kit_1 = require("../../core/app-kit"); | ||
| const get_selected_wallet_1 = require("../wallets/get-selected-wallet"); | ||
| const watch_balance_by_address_1 = require("./watch-balance-by-address"); | ||
| /** | ||
| * Watch account balance changes for the selected wallet. | ||
| */ | ||
| const watchBalance = (appKit, options) => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = (0, get_selected_wallet_1.getSelectedWallet)(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = (0, watch_balance_by_address_1.watchBalanceByAddress)(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const off = appKit.emitter.on(app_kit_1.WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(app_kit_1.WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) | ||
| unsubscribe(); | ||
| off(); | ||
| offUpdate(); | ||
| }; | ||
| }; | ||
| exports.watchBalance = watchBalance; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { JettonUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchJettonsByAddressOptions { | ||
| address: string | Address; | ||
| onChange: (update: JettonUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchJettonsByAddressReturnType = () => void; | ||
| /** | ||
| * Watch jetton updates by owner address. | ||
| */ | ||
| export declare const watchJettonsByAddress: (appKit: AppKit, options: WatchJettonsByAddressOptions) => WatchJettonsByAddressReturnType; | ||
| //# sourceMappingURL=watch-jettons-by-address.d.ts.map |
| {"version":3,"file":"watch-jettons-by-address.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/watch-jettons-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAC9B,QAAQ,MAAM,EACd,SAAS,4BAA4B,KACtC,+BAMF,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.watchJettonsByAddress = void 0; | ||
| const core_1 = require("@ton/core"); | ||
| const resolve_network_1 = require("../../utils/network/resolve-network"); | ||
| /** | ||
| * Watch jetton updates by owner address. | ||
| */ | ||
| const watchJettonsByAddress = (appKit, options) => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = core_1.Address.isAddress(address) ? address.toString() : core_1.Address.parse(address).toString(); | ||
| const resolvedNetwork = (0, resolve_network_1.resolveNetwork)(appKit, network); | ||
| return appKit.streamingManager.watchJettons(resolvedNetwork, addressString, onChange); | ||
| }; | ||
| exports.watchJettonsByAddress = watchJettonsByAddress; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { JettonUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchJettonsOptions { | ||
| onChange: (update: JettonUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchJettonsReturnType = () => void; | ||
| /** | ||
| * Watch jetton updates for the selected wallet. | ||
| */ | ||
| export declare const watchJettons: (appKit: AppKit, options: WatchJettonsOptions) => WatchJettonsReturnType; | ||
| //# sourceMappingURL=watch-jettons.d.ts.map |
| {"version":3,"file":"watch-jettons.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/watch-jettons.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,SAAS,mBAAmB,KAAG,sBA8B3E,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.watchJettons = void 0; | ||
| const app_kit_1 = require("../../core/app-kit"); | ||
| const get_selected_wallet_1 = require("../wallets/get-selected-wallet"); | ||
| const watch_jettons_by_address_1 = require("./watch-jettons-by-address"); | ||
| /** | ||
| * Watch jetton updates for the selected wallet. | ||
| */ | ||
| const watchJettons = (appKit, options) => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = (0, get_selected_wallet_1.getSelectedWallet)(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = (0, watch_jettons_by_address_1.watchJettonsByAddress)(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const offSelection = appKit.emitter.on(app_kit_1.WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(app_kit_1.WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) | ||
| unsubscribe(); | ||
| offSelection(); | ||
| offUpdate(); | ||
| }; | ||
| }; | ||
| exports.watchJettons = watchJettons; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { Network } from '../../types/network'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { ApiClient } from '../../core/network'; | ||
| export type GetApiClientReturnType = ApiClient; | ||
| export type GetApiClientOptions = { | ||
| network: Network; | ||
| }; | ||
| /** | ||
| * Get API client for a network | ||
| */ | ||
| export declare const getApiClient: (appKit: AppKit, options: GetApiClientOptions) => GetApiClientReturnType; | ||
| //# sourceMappingURL=get-api-client.d.ts.map |
| {"version":3,"file":"get-api-client.d.ts","sourceRoot":"","sources":["../../../../src/actions/network/get-api-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,mBAAmB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,SAAS,mBAAmB,KAAG,sBAE3E,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getApiClient = void 0; | ||
| /** | ||
| * Get API client for a network | ||
| */ | ||
| const getApiClient = (appKit, options) => { | ||
| return appKit.networkManager.getClient(options.network); | ||
| }; | ||
| exports.getApiClient = getApiClient; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { AppKit } from '../../core/app-kit/services/app-kit'; | ||
| import type { Network } from '../../types/network'; | ||
| export type HasStreamingProviderReturnType = boolean; | ||
| /** | ||
| * Check if a streaming provider is registered for a specific network. | ||
| */ | ||
| export declare const hasStreamingProvider: (appKit: AppKit, network: Network) => HasStreamingProviderReturnType; | ||
| //# sourceMappingURL=has-streaming-provider.d.ts.map |
| {"version":3,"file":"has-streaming-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/network/has-streaming-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,EAAE,SAAS,OAAO,KAAG,8BAEvE,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.hasStreamingProvider = void 0; | ||
| /** | ||
| * Check if a streaming provider is registered for a specific network. | ||
| */ | ||
| const hasStreamingProvider = (appKit, network) => { | ||
| return appKit.streamingManager.hasProvider(network); | ||
| }; | ||
| exports.hasStreamingProvider = hasStreamingProvider; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakeParams } from '@ton/walletkit'; | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type BuildStakeTransactionOptions = StakeParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type BuildStakeTransactionReturnType = Promise<TransactionRequest>; | ||
| /** | ||
| * Build stake transaction | ||
| */ | ||
| export declare const buildStakeTransaction: (appKit: AppKit, options: BuildStakeTransactionOptions) => BuildStakeTransactionReturnType; | ||
| //# sourceMappingURL=build-stake-transaction.d.ts.map |
| {"version":3,"file":"build-stake-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/build-stake-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,4BAA4B,GAAG,WAAW,GAAG;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAC9B,QAAQ,MAAM,EACd,SAAS,4BAA4B,KACtC,+BAEF,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.buildStakeTransaction = void 0; | ||
| /** | ||
| * Build stake transaction | ||
| */ | ||
| const buildStakeTransaction = async (appKit, options) => { | ||
| return appKit.stakingManager.buildStakeTransaction(options, options.providerId); | ||
| }; | ||
| exports.buildStakeTransaction = buildStakeTransaction; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingBalance, UserFriendlyAddress, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakedBalanceOptions = { | ||
| userAddress: UserFriendlyAddress; | ||
| network?: Network; | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakedBalanceReturnType = Promise<StakingBalance>; | ||
| /** | ||
| * Get staked balance | ||
| */ | ||
| export declare const getStakedBalance: (appKit: AppKit, options: GetStakedBalanceOptions) => GetStakedBalanceReturnType; | ||
| //# sourceMappingURL=get-staked-balance.d.ts.map |
| {"version":3,"file":"get-staked-balance.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staked-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,MAAM,uBAAuB,GAAG;IAClC,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,gBAAgB,GACzB,QAAQ,MAAM,EACd,SAAS,uBAAuB,KACjC,0BAMF,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakedBalance = void 0; | ||
| const utils_1 = require("../../utils"); | ||
| /** | ||
| * Get staked balance | ||
| */ | ||
| const getStakedBalance = async (appKit, options) => { | ||
| return appKit.stakingManager.getStakedBalance(options.userAddress, (0, utils_1.resolveNetwork)(appKit, options.network), options.providerId); | ||
| }; | ||
| exports.getStakedBalance = getStakedBalance; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingManager } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingManagerReturnType = StakingManager; | ||
| /** | ||
| * Get staking manager instance | ||
| */ | ||
| export declare const getStakingManager: (appKit: AppKit) => GetStakingManagerReturnType; | ||
| //# sourceMappingURL=get-staking-manager.d.ts.map |
| {"version":3,"file":"get-staking-manager.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staking-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,2BAElD,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakingManager = void 0; | ||
| /** | ||
| * Get staking manager instance | ||
| */ | ||
| const getStakingManager = (appKit) => { | ||
| return appKit.stakingManager; | ||
| }; | ||
| exports.getStakingManager = getStakingManager; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingProviderInfo, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingProviderInfoOptions = { | ||
| network?: Network; | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakingProviderInfoReturnType = Promise<StakingProviderInfo>; | ||
| /** | ||
| * Get staking provider info | ||
| */ | ||
| export declare const getStakingProviderInfo: (appKit: AppKit, options?: GetStakingProviderInfoOptions) => GetStakingProviderInfoReturnType; | ||
| //# sourceMappingURL=get-staking-provider-info.d.ts.map |
| {"version":3,"file":"get-staking-provider-info.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staking-provider-info.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,6BAA6B,GAAG;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAC/B,QAAQ,MAAM,EACd,UAAS,6BAAkC,KAC5C,gCAEF,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakingProviderInfo = void 0; | ||
| const utils_1 = require("../../utils"); | ||
| /** | ||
| * Get staking provider info | ||
| */ | ||
| const getStakingProviderInfo = async (appKit, options = {}) => { | ||
| return appKit.stakingManager.getStakingProviderInfo((0, utils_1.resolveNetwork)(appKit, options.network), options.providerId); | ||
| }; | ||
| exports.getStakingProviderInfo = getStakingProviderInfo; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingProvidersReturnType = string[]; | ||
| /** | ||
| * Get available staking provider IDs | ||
| */ | ||
| export declare const getStakingProviders: (appKit: AppKit) => GetStakingProvidersReturnType; | ||
| //# sourceMappingURL=get-staking-providers.d.ts.map |
| {"version":3,"file":"get-staking-providers.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staking-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,6BAA6B,GAAG,MAAM,EAAE,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,6BAEpD,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakingProviders = void 0; | ||
| /** | ||
| * Get available staking provider IDs | ||
| */ | ||
| const getStakingProviders = (appKit) => { | ||
| return appKit.stakingManager.getRegisteredProviders(); | ||
| }; | ||
| exports.getStakingProviders = getStakingProviders; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingQuote, StakingQuoteParams } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingQuoteOptions = StakingQuoteParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakingQuoteReturnType = Promise<StakingQuote>; | ||
| /** | ||
| * Get staking quote | ||
| */ | ||
| export declare const getStakingQuote: (appKit: AppKit, options: GetStakingQuoteOptions) => GetStakingQuoteReturnType; | ||
| //# sourceMappingURL=get-staking-quote.d.ts.map |
| {"version":3,"file":"get-staking-quote.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staking-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,QAAQ,MAAM,EAAE,SAAS,sBAAsB,KAAG,yBAOvF,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakingQuote = void 0; | ||
| const utils_1 = require("../../utils"); | ||
| /** | ||
| * Get staking quote | ||
| */ | ||
| const getStakingQuote = async (appKit, options) => { | ||
| const optionsWithNetwork = { | ||
| ...options, | ||
| network: (0, utils_1.resolveNetwork)(appKit, options.network), | ||
| }; | ||
| return appKit.stakingManager.getQuote(optionsWithNetwork, options.providerId); | ||
| }; | ||
| exports.getStakingQuote = getStakingQuote; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { TransactionsUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchTransactionsByAddressOptions { | ||
| address: string | Address; | ||
| onChange: (update: TransactionsUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchTransactionsByAddressReturnType = () => void; | ||
| /** | ||
| * Watch transactions by address. | ||
| */ | ||
| export declare const watchTransactionsByAddress: (appKit: AppKit, options: WatchTransactionsByAddressOptions) => WatchTransactionsByAddressReturnType; | ||
| //# sourceMappingURL=watch-transactions-by-address.d.ts.map |
| {"version":3,"file":"watch-transactions-by-address.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/watch-transactions-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,iCAAiC;IAC9C,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,oCAAoC,GAAG,MAAM,IAAI,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACnC,QAAQ,MAAM,EACd,SAAS,iCAAiC,KAC3C,oCAMF,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.watchTransactionsByAddress = void 0; | ||
| const core_1 = require("@ton/core"); | ||
| const resolve_network_1 = require("../../utils/network/resolve-network"); | ||
| /** | ||
| * Watch transactions by address. | ||
| */ | ||
| const watchTransactionsByAddress = (appKit, options) => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = core_1.Address.isAddress(address) ? address.toString() : core_1.Address.parse(address).toString(); | ||
| const resolvedNetwork = (0, resolve_network_1.resolveNetwork)(appKit, network); | ||
| return appKit.streamingManager.watchTransactions(resolvedNetwork, addressString, onChange); | ||
| }; | ||
| exports.watchTransactionsByAddress = watchTransactionsByAddress; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { TransactionsUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchTransactionsOptions { | ||
| onChange: (update: TransactionsUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchTransactionsReturnType = () => void; | ||
| /** | ||
| * Watch transactions for the selected wallet. | ||
| */ | ||
| export declare const watchTransactions: (appKit: AppKit, options: WatchTransactionsOptions) => WatchTransactionsReturnType; | ||
| //# sourceMappingURL=watch-transactions.d.ts.map |
| {"version":3,"file":"watch-transactions.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/watch-transactions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,wBAAwB;IACrC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,2BAA2B,GAAG,MAAM,IAAI,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,SAAS,wBAAwB,KAAG,2BA8BrF,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.watchTransactions = void 0; | ||
| const app_kit_1 = require("../../core/app-kit"); | ||
| const get_selected_wallet_1 = require("../wallets/get-selected-wallet"); | ||
| const watch_transactions_by_address_1 = require("./watch-transactions-by-address"); | ||
| /** | ||
| * Watch transactions for the selected wallet. | ||
| */ | ||
| const watchTransactions = (appKit, options) => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = (0, get_selected_wallet_1.getSelectedWallet)(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = (0, watch_transactions_by_address_1.watchTransactionsByAddress)(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const offSelection = appKit.emitter.on(app_kit_1.WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(app_kit_1.WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) | ||
| unsubscribe(); | ||
| offSelection(); | ||
| offUpdate(); | ||
| }; | ||
| }; | ||
| exports.watchTransactions = watchTransactions; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export { StreamingManager, TonCenterStreamingProvider, createTonCenterStreamingProvider, TonApiStreamingProvider, createTonApiStreamingProvider, } from '@ton/walletkit'; | ||
| export type { StreamingProvider, StreamingProviderFactory, StreamingAPI, TonCenterStreamingProviderConfig, TonApiStreamingProviderConfig, BalanceUpdate, TransactionsUpdate, Transaction, JettonUpdate, StreamingUpdate, StreamingWatchType, StreamingEvents, } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/streaming/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACH,gBAAgB,EAChB,0BAA0B,EAC1B,gCAAgC,EAChC,uBAAuB,EACvB,6BAA6B,GAChC,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACR,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,gCAAgC,EAChC,6BAA6B,EAC7B,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,eAAe,GAClB,MAAM,gBAAgB,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.createTonApiStreamingProvider = exports.TonApiStreamingProvider = exports.createTonCenterStreamingProvider = exports.TonCenterStreamingProvider = exports.StreamingManager = void 0; | ||
| var walletkit_1 = require("@ton/walletkit"); | ||
| Object.defineProperty(exports, "StreamingManager", { enumerable: true, get: function () { return walletkit_1.StreamingManager; } }); | ||
| Object.defineProperty(exports, "TonCenterStreamingProvider", { enumerable: true, get: function () { return walletkit_1.TonCenterStreamingProvider; } }); | ||
| Object.defineProperty(exports, "createTonCenterStreamingProvider", { enumerable: true, get: function () { return walletkit_1.createTonCenterStreamingProvider; } }); | ||
| Object.defineProperty(exports, "TonApiStreamingProvider", { enumerable: true, get: function () { return walletkit_1.TonApiStreamingProvider; } }); | ||
| Object.defineProperty(exports, "createTonApiStreamingProvider", { enumerable: true, get: function () { return walletkit_1.createTonApiStreamingProvider; } }); |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { MutateOptions, MutationOptions } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { MutationParameter } from '../../types/query'; | ||
| import type { Compute } from '../../types/utils'; | ||
| import type { BuildStakeTransactionOptions, BuildStakeTransactionReturnType } from '../../actions/staking/build-stake-transaction'; | ||
| export type BuildStakeTransactionMutationOptions<context = unknown> = MutationParameter<BuildStakeTransactionData, BuildStakeTransactionErrorType, BuildStakeTransactionVariables, context>; | ||
| export declare const buildStakeTransactionMutationOptions: <context = unknown>(appKit: AppKit, options?: BuildStakeTransactionMutationOptions<context>) => BuildStakeTransactionMutationConfig<context>; | ||
| export type BuildStakeTransactionMutationConfig<context = unknown> = MutationOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, BuildStakeTransactionVariables, context>; | ||
| export type BuildStakeTransactionData = Compute<Awaited<BuildStakeTransactionReturnType>>; | ||
| export type BuildStakeTransactionErrorType = Error; | ||
| export type BuildStakeTransactionVariables = BuildStakeTransactionOptions; | ||
| export type BuildStakeTransactionMutate<context = unknown> = (variables: BuildStakeTransactionVariables, options?: Compute<MutateOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, Compute<BuildStakeTransactionVariables>, context>> | undefined) => void; | ||
| export type BuildStakeTransactionMutateAsync<context = unknown> = (variables: BuildStakeTransactionVariables, options?: Compute<MutateOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, Compute<BuildStakeTransactionVariables>, context>> | undefined) => Promise<BuildStakeTransactionData>; | ||
| //# sourceMappingURL=build-stake-transaction.d.ts.map |
| {"version":3,"file":"build-stake-transaction.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/build-stake-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EACR,4BAA4B,EAC5B,+BAA+B,EAClC,MAAM,+CAA+C,CAAC;AAEvD,MAAM,MAAM,oCAAoC,CAAC,OAAO,GAAG,OAAO,IAAI,iBAAiB,CACnF,yBAAyB,EACzB,8BAA8B,EAC9B,8BAA8B,EAC9B,OAAO,CACV,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAAI,OAAO,GAAG,OAAO,EAClE,QAAQ,MAAM,EACd,UAAS,oCAAoC,CAAC,OAAO,CAAM,KAC5D,mCAAmC,CAAC,OAAO,CAQ7C,CAAC;AAEF,MAAM,MAAM,mCAAmC,CAAC,OAAO,GAAG,OAAO,IAAI,eAAe,CAChF,yBAAyB,EACzB,8BAA8B,EAC9B,8BAA8B,EAC9B,OAAO,CACV,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC;AAE1F,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAAC;AAEnD,MAAM,MAAM,8BAA8B,GAAG,4BAA4B,CAAC;AAE1E,MAAM,MAAM,2BAA2B,CAAC,OAAO,GAAG,OAAO,IAAI,CACzD,SAAS,EAAE,8BAA8B,EACzC,OAAO,CAAC,EACF,OAAO,CACH,aAAa,CACT,yBAAyB,EACzB,8BAA8B,EAC9B,OAAO,CAAC,8BAA8B,CAAC,EACvC,OAAO,CACV,CACJ,GACD,SAAS,KACd,IAAI,CAAC;AAEV,MAAM,MAAM,gCAAgC,CAAC,OAAO,GAAG,OAAO,IAAI,CAC9D,SAAS,EAAE,8BAA8B,EACzC,OAAO,CAAC,EACF,OAAO,CACH,aAAa,CACT,yBAAyB,EACzB,8BAA8B,EAC9B,OAAO,CAAC,8BAA8B,CAAC,EACvC,OAAO,CACV,CACJ,GACD,SAAS,KACd,OAAO,CAAC,yBAAyB,CAAC,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.buildStakeTransactionMutationOptions = void 0; | ||
| const build_stake_transaction_1 = require("../../actions/staking/build-stake-transaction"); | ||
| const buildStakeTransactionMutationOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.mutation, | ||
| mutationFn(variables) { | ||
| return (0, build_stake_transaction_1.buildStakeTransaction)(appKit, variables); | ||
| }, | ||
| mutationKey: ['buildStakeTransaction'], | ||
| }; | ||
| }; | ||
| exports.buildStakeTransactionMutationOptions = buildStakeTransactionMutationOptions; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { GetStakedBalanceOptions } from '../../actions/staking/get-staked-balance'; | ||
| import type { GetStakedBalanceReturnType } from '../../actions/staking/get-staked-balance'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetStakedBalanceErrorType = Error; | ||
| export type GetStakedBalanceQueryConfig<selectData = GetStakedBalanceData> = Compute<ExactPartial<GetStakedBalanceOptions>> & QueryParameter<GetStakedBalanceQueryFnData, GetStakedBalanceErrorType, selectData, GetStakedBalanceQueryKey>; | ||
| export declare const getStakedBalanceQueryOptions: <selectData = GetStakedBalanceData>(appKit: AppKit, options?: GetStakedBalanceQueryConfig<selectData>) => GetStakedBalanceQueryOptions<selectData>; | ||
| export type GetStakedBalanceQueryFnData = Compute<Awaited<GetStakedBalanceReturnType>>; | ||
| export type GetStakedBalanceData = GetStakedBalanceQueryFnData; | ||
| export declare const getStakedBalanceQueryKey: (options?: Compute<ExactPartial<GetStakedBalanceOptions>>) => GetStakedBalanceQueryKey; | ||
| export type GetStakedBalanceQueryKey = readonly ['stakedBalance', Compute<ExactPartial<GetStakedBalanceOptions>>]; | ||
| export type GetStakedBalanceQueryOptions<selectData = GetStakedBalanceData> = QueryOptions<GetStakedBalanceQueryFnData, GetStakedBalanceErrorType, selectData, GetStakedBalanceQueryKey>; | ||
| //# sourceMappingURL=get-staked-balance.d.ts.map |
| {"version":3,"file":"get-staked-balance.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/get-staked-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE9C,MAAM,MAAM,2BAA2B,CAAC,UAAU,GAAG,oBAAoB,IAAI,OAAO,CAChF,YAAY,CAAC,uBAAuB,CAAC,CACxC,GACG,cAAc,CAAC,2BAA2B,EAAE,yBAAyB,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC;AAEjH,eAAO,MAAM,4BAA4B,GAAI,UAAU,GAAG,oBAAoB,EAC1E,QAAQ,MAAM,EACd,UAAS,2BAA2B,CAAC,UAAU,CAAM,KACtD,4BAA4B,CAAC,UAAU,CAczC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAEvF,MAAM,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAE/D,eAAO,MAAM,wBAAwB,GACjC,UAAS,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAM,KAC7D,wBAEF,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAAC,eAAe,EAAE,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,4BAA4B,CAAC,UAAU,GAAG,oBAAoB,IAAI,YAAY,CACtF,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,wBAAwB,CAC3B,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakedBalanceQueryKey = exports.getStakedBalanceQueryOptions = void 0; | ||
| const get_staked_balance_1 = require("../../actions/staking/get-staked-balance"); | ||
| const utils_1 = require("../../utils"); | ||
| const getStakedBalanceQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| enabled: Boolean(options.userAddress && (options.query?.enabled ?? true)), | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| if (!parameters.userAddress) { | ||
| throw new Error('userAddress is required'); | ||
| } | ||
| return (0, get_staked_balance_1.getStakedBalance)(appKit, parameters); | ||
| }, | ||
| queryKey: (0, exports.getStakedBalanceQueryKey)(options), | ||
| }; | ||
| }; | ||
| exports.getStakedBalanceQueryOptions = getStakedBalanceQueryOptions; | ||
| const getStakedBalanceQueryKey = (options = {}) => { | ||
| return ['stakedBalance', (0, utils_1.filterQueryOptions)(options)]; | ||
| }; | ||
| exports.getStakedBalanceQueryKey = getStakedBalanceQueryKey; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { GetStakingProviderInfoOptions } from '../../actions/staking/get-staking-provider-info'; | ||
| import type { GetStakingProviderInfoReturnType } from '../../actions/staking/get-staking-provider-info'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetStakingProviderInfoErrorType = Error; | ||
| export type GetStakingProviderInfoQueryConfig<selectData = GetStakingProviderInfoData> = Compute<ExactPartial<GetStakingProviderInfoOptions>> & QueryParameter<GetStakingProviderInfoQueryFnData, GetStakingProviderInfoErrorType, selectData, GetStakingProviderInfoQueryKey>; | ||
| export declare const getStakingProviderInfoQueryOptions: <selectData = GetStakingProviderInfoData>(appKit: AppKit, options?: GetStakingProviderInfoQueryConfig<selectData>) => GetStakingProviderInfoQueryOptions<selectData>; | ||
| export type GetStakingProviderInfoQueryFnData = Compute<Awaited<GetStakingProviderInfoReturnType>>; | ||
| export type GetStakingProviderInfoData = GetStakingProviderInfoQueryFnData; | ||
| export declare const getStakingProviderInfoQueryKey: (options?: Compute<ExactPartial<GetStakingProviderInfoOptions>>) => GetStakingProviderInfoQueryKey; | ||
| export type GetStakingProviderInfoQueryKey = readonly [ | ||
| 'stakingProviderInfo', | ||
| Compute<ExactPartial<GetStakingProviderInfoOptions>> | ||
| ]; | ||
| export type GetStakingProviderInfoQueryOptions<selectData = GetStakingProviderInfoData> = QueryOptions<GetStakingProviderInfoQueryFnData, GetStakingProviderInfoErrorType, selectData, GetStakingProviderInfoQueryKey>; | ||
| //# sourceMappingURL=get-staking-provider-info.d.ts.map |
| {"version":3,"file":"get-staking-provider-info.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/get-staking-provider-info.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AACrG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACxG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAEpD,MAAM,MAAM,iCAAiC,CAAC,UAAU,GAAG,0BAA0B,IAAI,OAAO,CAC5F,YAAY,CAAC,6BAA6B,CAAC,CAC9C,GACG,cAAc,CACV,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC;AAEN,eAAO,MAAM,kCAAkC,GAAI,UAAU,GAAG,0BAA0B,EACtF,QAAQ,MAAM,EACd,UAAS,iCAAiC,CAAC,UAAU,CAAM,KAC5D,kCAAkC,CAAC,UAAU,CAS/C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAC;AAEnG,MAAM,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE3E,eAAO,MAAM,8BAA8B,GACvC,UAAS,OAAO,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAM,KACnE,8BAEF,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,SAAS;IAClD,qBAAqB;IACrB,OAAO,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAAC,UAAU,GAAG,0BAA0B,IAAI,YAAY,CAClG,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakingProviderInfoQueryKey = exports.getStakingProviderInfoQueryOptions = void 0; | ||
| const get_staking_provider_info_1 = require("../../actions/staking/get-staking-provider-info"); | ||
| const utils_1 = require("../../utils"); | ||
| const getStakingProviderInfoQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| return (0, get_staking_provider_info_1.getStakingProviderInfo)(appKit, parameters); | ||
| }, | ||
| queryKey: (0, exports.getStakingProviderInfoQueryKey)(options), | ||
| }; | ||
| }; | ||
| exports.getStakingProviderInfoQueryOptions = getStakingProviderInfoQueryOptions; | ||
| const getStakingProviderInfoQueryKey = (options = {}) => { | ||
| return ['stakingProviderInfo', (0, utils_1.filterQueryOptions)(options)]; | ||
| }; | ||
| exports.getStakingProviderInfoQueryKey = getStakingProviderInfoQueryKey; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { GetStakingProvidersReturnType } from '../../actions/staking/get-staking-providers'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute } from '../../types/utils'; | ||
| export type GetStakingProvidersErrorType = Error; | ||
| export type GetStakingProvidersQueryConfig<selectData = GetStakingProvidersData> = QueryParameter<GetStakingProvidersQueryFnData, GetStakingProvidersErrorType, selectData, GetStakingProvidersQueryKey>; | ||
| export declare const getStakingProvidersQueryOptions: <selectData = GetStakingProvidersData>(appKit: AppKit, options?: GetStakingProvidersQueryConfig<selectData>) => GetStakingProvidersQueryOptions<selectData>; | ||
| export type GetStakingProvidersQueryFnData = Compute<Awaited<GetStakingProvidersReturnType>>; | ||
| export type GetStakingProvidersData = GetStakingProvidersQueryFnData; | ||
| export declare const getStakingProvidersQueryKey: () => GetStakingProvidersQueryKey; | ||
| export type GetStakingProvidersQueryKey = readonly ['stakingProviders']; | ||
| export type GetStakingProvidersQueryOptions<selectData = GetStakingProvidersData> = QueryOptions<GetStakingProvidersQueryFnData, GetStakingProvidersErrorType, selectData, GetStakingProvidersQueryKey>; | ||
| //# sourceMappingURL=get-staking-providers.d.ts.map |
| {"version":3,"file":"get-staking-providers.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/get-staking-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAEjD,MAAM,MAAM,8BAA8B,CAAC,UAAU,GAAG,uBAAuB,IAAI,cAAc,CAC7F,8BAA8B,EAC9B,4BAA4B,EAC5B,UAAU,EACV,2BAA2B,CAC9B,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,UAAU,GAAG,uBAAuB,EAChF,QAAQ,MAAM,EACd,UAAS,8BAA8B,CAAC,UAAU,CAAM,KACzD,+BAA+B,CAAC,UAAU,CAQ5C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC;AAE7F,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAErE,eAAO,MAAM,2BAA2B,QAAO,2BAE9C,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAExE,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,uBAAuB,IAAI,YAAY,CAC5F,8BAA8B,EAC9B,4BAA4B,EAC5B,UAAU,EACV,2BAA2B,CAC9B,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakingProvidersQueryKey = exports.getStakingProvidersQueryOptions = void 0; | ||
| const get_staking_providers_1 = require("../../actions/staking/get-staking-providers"); | ||
| const getStakingProvidersQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async () => { | ||
| return (0, get_staking_providers_1.getStakingProviders)(appKit); | ||
| }, | ||
| queryKey: (0, exports.getStakingProvidersQueryKey)(), | ||
| }; | ||
| }; | ||
| exports.getStakingProvidersQueryOptions = getStakingProvidersQueryOptions; | ||
| const getStakingProvidersQueryKey = () => { | ||
| return ['stakingProviders']; | ||
| }; | ||
| exports.getStakingProvidersQueryKey = getStakingProvidersQueryKey; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { GetStakingQuoteOptions } from '../../actions/staking/get-staking-quote'; | ||
| import type { GetStakingQuoteReturnType } from '../../actions/staking/get-staking-quote'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetStakingQuoteErrorType = Error; | ||
| export type GetStakingQuoteQueryConfig<selectData = GetStakingQuoteData> = Compute<ExactPartial<GetStakingQuoteOptions>> & QueryParameter<GetStakingQuoteQueryFnData, GetStakingQuoteErrorType, selectData, GetStakingQuoteQueryKey>; | ||
| export declare const getStakingQuoteQueryOptions: <selectData = GetStakingQuoteData>(appKit: AppKit, options?: GetStakingQuoteQueryConfig<selectData>) => GetStakingQuoteQueryOptions<selectData>; | ||
| export type GetStakingQuoteQueryFnData = Compute<Awaited<GetStakingQuoteReturnType>>; | ||
| export type GetStakingQuoteData = GetStakingQuoteQueryFnData; | ||
| export declare const getStakingQuoteQueryKey: (options?: Compute<ExactPartial<GetStakingQuoteOptions>>) => GetStakingQuoteQueryKey; | ||
| export type GetStakingQuoteQueryKey = readonly ['stakingQuote', Compute<ExactPartial<GetStakingQuoteOptions>>]; | ||
| export type GetStakingQuoteQueryOptions<selectData = GetStakingQuoteData> = QueryOptions<GetStakingQuoteQueryFnData, GetStakingQuoteErrorType, selectData, GetStakingQuoteQueryKey>; | ||
| //# sourceMappingURL=get-staking-quote.d.ts.map |
| {"version":3,"file":"get-staking-quote.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/get-staking-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAE7C,MAAM,MAAM,0BAA0B,CAAC,UAAU,GAAG,mBAAmB,IAAI,OAAO,CAC9E,YAAY,CAAC,sBAAsB,CAAC,CACvC,GACG,cAAc,CAAC,0BAA0B,EAAE,wBAAwB,EAAE,UAAU,EAAE,uBAAuB,CAAC,CAAC;AAE9G,eAAO,MAAM,2BAA2B,GAAI,UAAU,GAAG,mBAAmB,EACxE,QAAQ,MAAM,EACd,UAAS,0BAA0B,CAAC,UAAU,CAAM,KACrD,2BAA2B,CAAC,UAAU,CAcxC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAErF,MAAM,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE7D,eAAO,MAAM,uBAAuB,GAChC,UAAS,OAAO,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAM,KAC5D,uBAEF,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE/G,MAAM,MAAM,2BAA2B,CAAC,UAAU,GAAG,mBAAmB,IAAI,YAAY,CACpF,0BAA0B,EAC1B,wBAAwB,EACxB,UAAU,EACV,uBAAuB,CAC1B,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getStakingQuoteQueryKey = exports.getStakingQuoteQueryOptions = void 0; | ||
| const get_staking_quote_1 = require("../../actions/staking/get-staking-quote"); | ||
| const utils_1 = require("../../utils"); | ||
| const getStakingQuoteQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| enabled: Boolean(options.amount && options.direction && (options.query?.enabled ?? true)), | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| if (!parameters.amount || !parameters.direction) { | ||
| throw new Error('amount and direction are required'); | ||
| } | ||
| return (0, get_staking_quote_1.getStakingQuote)(appKit, parameters); | ||
| }, | ||
| queryKey: (0, exports.getStakingQuoteQueryKey)(options), | ||
| }; | ||
| }; | ||
| exports.getStakingQuoteQueryOptions = getStakingQuoteQueryOptions; | ||
| const getStakingQuoteQueryKey = (options = {}) => { | ||
| return ['stakingQuote', (0, utils_1.filterQueryOptions)(options)]; | ||
| }; | ||
| exports.getStakingQuoteQueryKey = getStakingQuoteQueryKey; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=streaming-updates.test.d.ts.map |
| {"version":3,"file":"streaming-updates.test.d.ts","sourceRoot":"","sources":["../../../src/queries/streaming-updates.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const vitest_1 = require("vitest"); | ||
| const get_balance_by_address_1 = require("./balances/get-balance-by-address"); | ||
| const get_jetton_balance_by_address_1 = require("./jettons/get-jetton-balance-by-address"); | ||
| const get_jettons_by_address_1 = require("./jettons/get-jettons-by-address"); | ||
| const network_1 = require("../types/network"); | ||
| (0, vitest_1.describe)('Streaming Updates Handlers', () => { | ||
| let queryClient; | ||
| (0, vitest_1.beforeEach)(() => { | ||
| queryClient = { | ||
| setQueryData: vitest_1.vi.fn(), | ||
| invalidateQueries: vitest_1.vi.fn(), | ||
| getQueryData: vitest_1.vi.fn(), | ||
| }; | ||
| }); | ||
| const network = network_1.Network.mainnet(); | ||
| (0, vitest_1.describe)('handleBalanceUpdate', () => { | ||
| (0, vitest_1.it)('should invalidate query immediately on invalidated status', () => { | ||
| const address = 'EQD...'; | ||
| const update = { | ||
| type: 'balance', | ||
| address, | ||
| balance: '100', | ||
| rawBalance: '100000000', | ||
| status: 'invalidated', | ||
| }; | ||
| (0, get_balance_by_address_1.handleBalanceUpdate)(queryClient, { address, network }, update); | ||
| (0, vitest_1.expect)(queryClient.invalidateQueries).toHaveBeenCalledWith({ | ||
| queryKey: vitest_1.expect.arrayContaining(['balance']), | ||
| }); | ||
| (0, vitest_1.expect)(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| (0, vitest_1.it)('should update data on finalized status', () => { | ||
| const address = 'EQD...'; | ||
| const update = { | ||
| type: 'balance', | ||
| address, | ||
| balance: '100', | ||
| rawBalance: '100000000', | ||
| status: 'finalized', | ||
| }; | ||
| (0, get_balance_by_address_1.handleBalanceUpdate)(queryClient, { address, network }, update); | ||
| (0, vitest_1.expect)(queryClient.setQueryData).toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| (0, vitest_1.describe)('handleJettonBalanceUpdate', () => { | ||
| (0, vitest_1.it)('should invalidate query immediately on invalidated status', () => { | ||
| const ownerAddress = 'EQO...'; | ||
| const jettonAddress = 'EQJ...'; | ||
| const update = { | ||
| type: 'jettons', | ||
| ownerAddress, | ||
| masterAddress: jettonAddress, | ||
| walletAddress: jettonAddress, | ||
| rawBalance: '50', | ||
| status: 'invalidated', | ||
| }; | ||
| (0, get_jetton_balance_by_address_1.handleJettonBalanceUpdate)(queryClient, { ownerAddress, jettonAddress, network }, update); | ||
| (0, vitest_1.expect)(queryClient.invalidateQueries).toHaveBeenCalled(); | ||
| (0, vitest_1.expect)(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| (0, vitest_1.describe)('handleJettonsUpdate', () => { | ||
| (0, vitest_1.it)('should invalidate query immediately on invalidated status', () => { | ||
| const address = 'EQA...'; | ||
| const update = { | ||
| type: 'jettons', | ||
| ownerAddress: address, | ||
| masterAddress: address, | ||
| walletAddress: address, | ||
| rawBalance: '0', | ||
| status: 'invalidated', | ||
| }; | ||
| (0, get_jettons_by_address_1.handleJettonsUpdate)(queryClient, { address, network }, update); | ||
| (0, vitest_1.expect)(queryClient.invalidateQueries).toHaveBeenCalled(); | ||
| (0, vitest_1.expect)(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| }); |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export { StakingProvider, UnstakeMode, StakingError, StakingManager } from '@ton/walletkit'; | ||
| export type { UnstakeModes, StakeParams, StakingAPI, StakingQuote, StakingQuoteParams, StakingBalance, StakingProviderInfo, StakingProviderInterface, StakingQuoteDirection, } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/staking/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE5F,YAAY,EACR,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,GACxB,MAAM,gBAAgB,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.StakingManager = exports.StakingError = exports.UnstakeMode = exports.StakingProvider = void 0; | ||
| var walletkit_1 = require("@ton/walletkit"); | ||
| Object.defineProperty(exports, "StakingProvider", { enumerable: true, get: function () { return walletkit_1.StakingProvider; } }); | ||
| Object.defineProperty(exports, "UnstakeMode", { enumerable: true, get: function () { return walletkit_1.UnstakeMode; } }); | ||
| Object.defineProperty(exports, "StakingError", { enumerable: true, get: function () { return walletkit_1.StakingError; } }); | ||
| Object.defineProperty(exports, "StakingManager", { enumerable: true, get: function () { return walletkit_1.StakingManager; } }); |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export * from '@ton/walletkit/staking/tonstakers'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/staking/tonstakers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mCAAmC,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| __exportStar(require("@ton/walletkit/staking/tonstakers"), exports); |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { BalanceUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchBalanceByAddressOptions { | ||
| address: string | Address; | ||
| network?: Network; | ||
| onChange: (update: BalanceUpdate) => void; | ||
| } | ||
| export type WatchBalanceByAddressReturnType = () => void; | ||
| /** | ||
| * Watch account balance changes by address. | ||
| */ | ||
| export declare const watchBalanceByAddress: (appKit: AppKit, options: WatchBalanceByAddressOptions) => WatchBalanceByAddressReturnType; | ||
| //# sourceMappingURL=watch-balance-by-address.d.ts.map |
| {"version":3,"file":"watch-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/actions/balances/watch-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAC9B,QAAQ,MAAM,EACd,SAAS,4BAA4B,KACtC,+BAMF,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import { resolveNetwork } from '../../utils/network/resolve-network'; | ||
| /** | ||
| * Watch account balance changes by address. | ||
| */ | ||
| export const watchBalanceByAddress = (appKit, options) => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = Address.isAddress(address) ? address.toString() : Address.parse(address).toString(); | ||
| const resolvedNetwork = resolveNetwork(appKit, network); | ||
| return appKit.streamingManager.watchBalance(resolvedNetwork, addressString, onChange); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { BalanceUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchBalanceOptions { | ||
| network?: Network; | ||
| onChange: (update: BalanceUpdate) => void; | ||
| } | ||
| export type WatchBalanceReturnType = () => void; | ||
| /** | ||
| * Watch account balance changes for the selected wallet. | ||
| */ | ||
| export declare const watchBalance: (appKit: AppKit, options: WatchBalanceOptions) => WatchBalanceReturnType; | ||
| //# sourceMappingURL=watch-balance.d.ts.map |
| {"version":3,"file":"watch-balance.d.ts","sourceRoot":"","sources":["../../../../src/actions/balances/watch-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,SAAS,mBAAmB,KAAG,sBA8B3E,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { WALLETS_EVENTS } from '../../core/app-kit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { watchBalanceByAddress } from './watch-balance-by-address'; | ||
| /** | ||
| * Watch account balance changes for the selected wallet. | ||
| */ | ||
| export const watchBalance = (appKit, options) => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = getSelectedWallet(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = watchBalanceByAddress(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const off = appKit.emitter.on(WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) | ||
| unsubscribe(); | ||
| off(); | ||
| offUpdate(); | ||
| }; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { JettonUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchJettonsByAddressOptions { | ||
| address: string | Address; | ||
| onChange: (update: JettonUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchJettonsByAddressReturnType = () => void; | ||
| /** | ||
| * Watch jetton updates by owner address. | ||
| */ | ||
| export declare const watchJettonsByAddress: (appKit: AppKit, options: WatchJettonsByAddressOptions) => WatchJettonsByAddressReturnType; | ||
| //# sourceMappingURL=watch-jettons-by-address.d.ts.map |
| {"version":3,"file":"watch-jettons-by-address.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/watch-jettons-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAC9B,QAAQ,MAAM,EACd,SAAS,4BAA4B,KACtC,+BAMF,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import { resolveNetwork } from '../../utils/network/resolve-network'; | ||
| /** | ||
| * Watch jetton updates by owner address. | ||
| */ | ||
| export const watchJettonsByAddress = (appKit, options) => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = Address.isAddress(address) ? address.toString() : Address.parse(address).toString(); | ||
| const resolvedNetwork = resolveNetwork(appKit, network); | ||
| return appKit.streamingManager.watchJettons(resolvedNetwork, addressString, onChange); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { JettonUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchJettonsOptions { | ||
| onChange: (update: JettonUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchJettonsReturnType = () => void; | ||
| /** | ||
| * Watch jetton updates for the selected wallet. | ||
| */ | ||
| export declare const watchJettons: (appKit: AppKit, options: WatchJettonsOptions) => WatchJettonsReturnType; | ||
| //# sourceMappingURL=watch-jettons.d.ts.map |
| {"version":3,"file":"watch-jettons.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/watch-jettons.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,SAAS,mBAAmB,KAAG,sBA8B3E,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { WALLETS_EVENTS } from '../../core/app-kit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { watchJettonsByAddress } from './watch-jettons-by-address'; | ||
| /** | ||
| * Watch jetton updates for the selected wallet. | ||
| */ | ||
| export const watchJettons = (appKit, options) => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = getSelectedWallet(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = watchJettonsByAddress(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const offSelection = appKit.emitter.on(WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) | ||
| unsubscribe(); | ||
| offSelection(); | ||
| offUpdate(); | ||
| }; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { Network } from '../../types/network'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { ApiClient } from '../../core/network'; | ||
| export type GetApiClientReturnType = ApiClient; | ||
| export type GetApiClientOptions = { | ||
| network: Network; | ||
| }; | ||
| /** | ||
| * Get API client for a network | ||
| */ | ||
| export declare const getApiClient: (appKit: AppKit, options: GetApiClientOptions) => GetApiClientReturnType; | ||
| //# sourceMappingURL=get-api-client.d.ts.map |
| {"version":3,"file":"get-api-client.d.ts","sourceRoot":"","sources":["../../../../src/actions/network/get-api-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,mBAAmB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,SAAS,mBAAmB,KAAG,sBAE3E,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| /** | ||
| * Get API client for a network | ||
| */ | ||
| export const getApiClient = (appKit, options) => { | ||
| return appKit.networkManager.getClient(options.network); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { AppKit } from '../../core/app-kit/services/app-kit'; | ||
| import type { Network } from '../../types/network'; | ||
| export type HasStreamingProviderReturnType = boolean; | ||
| /** | ||
| * Check if a streaming provider is registered for a specific network. | ||
| */ | ||
| export declare const hasStreamingProvider: (appKit: AppKit, network: Network) => HasStreamingProviderReturnType; | ||
| //# sourceMappingURL=has-streaming-provider.d.ts.map |
| {"version":3,"file":"has-streaming-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/network/has-streaming-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,EAAE,SAAS,OAAO,KAAG,8BAEvE,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| /** | ||
| * Check if a streaming provider is registered for a specific network. | ||
| */ | ||
| export const hasStreamingProvider = (appKit, network) => { | ||
| return appKit.streamingManager.hasProvider(network); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakeParams } from '@ton/walletkit'; | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type BuildStakeTransactionOptions = StakeParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type BuildStakeTransactionReturnType = Promise<TransactionRequest>; | ||
| /** | ||
| * Build stake transaction | ||
| */ | ||
| export declare const buildStakeTransaction: (appKit: AppKit, options: BuildStakeTransactionOptions) => BuildStakeTransactionReturnType; | ||
| //# sourceMappingURL=build-stake-transaction.d.ts.map |
| {"version":3,"file":"build-stake-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/build-stake-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,4BAA4B,GAAG,WAAW,GAAG;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAC9B,QAAQ,MAAM,EACd,SAAS,4BAA4B,KACtC,+BAEF,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| /** | ||
| * Build stake transaction | ||
| */ | ||
| export const buildStakeTransaction = async (appKit, options) => { | ||
| return appKit.stakingManager.buildStakeTransaction(options, options.providerId); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingBalance, UserFriendlyAddress, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakedBalanceOptions = { | ||
| userAddress: UserFriendlyAddress; | ||
| network?: Network; | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakedBalanceReturnType = Promise<StakingBalance>; | ||
| /** | ||
| * Get staked balance | ||
| */ | ||
| export declare const getStakedBalance: (appKit: AppKit, options: GetStakedBalanceOptions) => GetStakedBalanceReturnType; | ||
| //# sourceMappingURL=get-staked-balance.d.ts.map |
| {"version":3,"file":"get-staked-balance.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staked-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,MAAM,uBAAuB,GAAG;IAClC,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,gBAAgB,GACzB,QAAQ,MAAM,EACd,SAAS,uBAAuB,KACjC,0BAMF,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { resolveNetwork } from '../../utils'; | ||
| /** | ||
| * Get staked balance | ||
| */ | ||
| export const getStakedBalance = async (appKit, options) => { | ||
| return appKit.stakingManager.getStakedBalance(options.userAddress, resolveNetwork(appKit, options.network), options.providerId); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingManager } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingManagerReturnType = StakingManager; | ||
| /** | ||
| * Get staking manager instance | ||
| */ | ||
| export declare const getStakingManager: (appKit: AppKit) => GetStakingManagerReturnType; | ||
| //# sourceMappingURL=get-staking-manager.d.ts.map |
| {"version":3,"file":"get-staking-manager.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staking-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,2BAElD,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| /** | ||
| * Get staking manager instance | ||
| */ | ||
| export const getStakingManager = (appKit) => { | ||
| return appKit.stakingManager; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingProviderInfo, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingProviderInfoOptions = { | ||
| network?: Network; | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakingProviderInfoReturnType = Promise<StakingProviderInfo>; | ||
| /** | ||
| * Get staking provider info | ||
| */ | ||
| export declare const getStakingProviderInfo: (appKit: AppKit, options?: GetStakingProviderInfoOptions) => GetStakingProviderInfoReturnType; | ||
| //# sourceMappingURL=get-staking-provider-info.d.ts.map |
| {"version":3,"file":"get-staking-provider-info.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staking-provider-info.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,6BAA6B,GAAG;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAC/B,QAAQ,MAAM,EACd,UAAS,6BAAkC,KAC5C,gCAEF,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { resolveNetwork } from '../../utils'; | ||
| /** | ||
| * Get staking provider info | ||
| */ | ||
| export const getStakingProviderInfo = async (appKit, options = {}) => { | ||
| return appKit.stakingManager.getStakingProviderInfo(resolveNetwork(appKit, options.network), options.providerId); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingProvidersReturnType = string[]; | ||
| /** | ||
| * Get available staking provider IDs | ||
| */ | ||
| export declare const getStakingProviders: (appKit: AppKit) => GetStakingProvidersReturnType; | ||
| //# sourceMappingURL=get-staking-providers.d.ts.map |
| {"version":3,"file":"get-staking-providers.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staking-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,6BAA6B,GAAG,MAAM,EAAE,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,6BAEpD,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| /** | ||
| * Get available staking provider IDs | ||
| */ | ||
| export const getStakingProviders = (appKit) => { | ||
| return appKit.stakingManager.getRegisteredProviders(); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingQuote, StakingQuoteParams } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingQuoteOptions = StakingQuoteParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakingQuoteReturnType = Promise<StakingQuote>; | ||
| /** | ||
| * Get staking quote | ||
| */ | ||
| export declare const getStakingQuote: (appKit: AppKit, options: GetStakingQuoteOptions) => GetStakingQuoteReturnType; | ||
| //# sourceMappingURL=get-staking-quote.d.ts.map |
| {"version":3,"file":"get-staking-quote.d.ts","sourceRoot":"","sources":["../../../../src/actions/staking/get-staking-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,QAAQ,MAAM,EAAE,SAAS,sBAAsB,KAAG,yBAOvF,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { resolveNetwork } from '../../utils'; | ||
| /** | ||
| * Get staking quote | ||
| */ | ||
| export const getStakingQuote = async (appKit, options) => { | ||
| const optionsWithNetwork = { | ||
| ...options, | ||
| network: resolveNetwork(appKit, options.network), | ||
| }; | ||
| return appKit.stakingManager.getQuote(optionsWithNetwork, options.providerId); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { TransactionsUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchTransactionsByAddressOptions { | ||
| address: string | Address; | ||
| onChange: (update: TransactionsUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchTransactionsByAddressReturnType = () => void; | ||
| /** | ||
| * Watch transactions by address. | ||
| */ | ||
| export declare const watchTransactionsByAddress: (appKit: AppKit, options: WatchTransactionsByAddressOptions) => WatchTransactionsByAddressReturnType; | ||
| //# sourceMappingURL=watch-transactions-by-address.d.ts.map |
| {"version":3,"file":"watch-transactions-by-address.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/watch-transactions-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,iCAAiC;IAC9C,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,oCAAoC,GAAG,MAAM,IAAI,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACnC,QAAQ,MAAM,EACd,SAAS,iCAAiC,KAC3C,oCAMF,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import { resolveNetwork } from '../../utils/network/resolve-network'; | ||
| /** | ||
| * Watch transactions by address. | ||
| */ | ||
| export const watchTransactionsByAddress = (appKit, options) => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = Address.isAddress(address) ? address.toString() : Address.parse(address).toString(); | ||
| const resolvedNetwork = resolveNetwork(appKit, network); | ||
| return appKit.streamingManager.watchTransactions(resolvedNetwork, addressString, onChange); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { TransactionsUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface WatchTransactionsOptions { | ||
| onChange: (update: TransactionsUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchTransactionsReturnType = () => void; | ||
| /** | ||
| * Watch transactions for the selected wallet. | ||
| */ | ||
| export declare const watchTransactions: (appKit: AppKit, options: WatchTransactionsOptions) => WatchTransactionsReturnType; | ||
| //# sourceMappingURL=watch-transactions.d.ts.map |
| {"version":3,"file":"watch-transactions.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/watch-transactions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,wBAAwB;IACrC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,2BAA2B,GAAG,MAAM,IAAI,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,SAAS,wBAAwB,KAAG,2BA8BrF,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { WALLETS_EVENTS } from '../../core/app-kit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { watchTransactionsByAddress } from './watch-transactions-by-address'; | ||
| /** | ||
| * Watch transactions for the selected wallet. | ||
| */ | ||
| export const watchTransactions = (appKit, options) => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = getSelectedWallet(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = watchTransactionsByAddress(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const offSelection = appKit.emitter.on(WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) | ||
| unsubscribe(); | ||
| offSelection(); | ||
| offUpdate(); | ||
| }; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export { StreamingManager, TonCenterStreamingProvider, createTonCenterStreamingProvider, TonApiStreamingProvider, createTonApiStreamingProvider, } from '@ton/walletkit'; | ||
| export type { StreamingProvider, StreamingProviderFactory, StreamingAPI, TonCenterStreamingProviderConfig, TonApiStreamingProviderConfig, BalanceUpdate, TransactionsUpdate, Transaction, JettonUpdate, StreamingUpdate, StreamingWatchType, StreamingEvents, } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/streaming/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACH,gBAAgB,EAChB,0BAA0B,EAC1B,gCAAgC,EAChC,uBAAuB,EACvB,6BAA6B,GAChC,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACR,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,gCAAgC,EAChC,6BAA6B,EAC7B,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,eAAe,GAClB,MAAM,gBAAgB,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export { StreamingManager, TonCenterStreamingProvider, createTonCenterStreamingProvider, TonApiStreamingProvider, createTonApiStreamingProvider, } from '@ton/walletkit'; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { MutateOptions, MutationOptions } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { MutationParameter } from '../../types/query'; | ||
| import type { Compute } from '../../types/utils'; | ||
| import type { BuildStakeTransactionOptions, BuildStakeTransactionReturnType } from '../../actions/staking/build-stake-transaction'; | ||
| export type BuildStakeTransactionMutationOptions<context = unknown> = MutationParameter<BuildStakeTransactionData, BuildStakeTransactionErrorType, BuildStakeTransactionVariables, context>; | ||
| export declare const buildStakeTransactionMutationOptions: <context = unknown>(appKit: AppKit, options?: BuildStakeTransactionMutationOptions<context>) => BuildStakeTransactionMutationConfig<context>; | ||
| export type BuildStakeTransactionMutationConfig<context = unknown> = MutationOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, BuildStakeTransactionVariables, context>; | ||
| export type BuildStakeTransactionData = Compute<Awaited<BuildStakeTransactionReturnType>>; | ||
| export type BuildStakeTransactionErrorType = Error; | ||
| export type BuildStakeTransactionVariables = BuildStakeTransactionOptions; | ||
| export type BuildStakeTransactionMutate<context = unknown> = (variables: BuildStakeTransactionVariables, options?: Compute<MutateOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, Compute<BuildStakeTransactionVariables>, context>> | undefined) => void; | ||
| export type BuildStakeTransactionMutateAsync<context = unknown> = (variables: BuildStakeTransactionVariables, options?: Compute<MutateOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, Compute<BuildStakeTransactionVariables>, context>> | undefined) => Promise<BuildStakeTransactionData>; | ||
| //# sourceMappingURL=build-stake-transaction.d.ts.map |
| {"version":3,"file":"build-stake-transaction.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/build-stake-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EACR,4BAA4B,EAC5B,+BAA+B,EAClC,MAAM,+CAA+C,CAAC;AAEvD,MAAM,MAAM,oCAAoC,CAAC,OAAO,GAAG,OAAO,IAAI,iBAAiB,CACnF,yBAAyB,EACzB,8BAA8B,EAC9B,8BAA8B,EAC9B,OAAO,CACV,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAAI,OAAO,GAAG,OAAO,EAClE,QAAQ,MAAM,EACd,UAAS,oCAAoC,CAAC,OAAO,CAAM,KAC5D,mCAAmC,CAAC,OAAO,CAQ7C,CAAC;AAEF,MAAM,MAAM,mCAAmC,CAAC,OAAO,GAAG,OAAO,IAAI,eAAe,CAChF,yBAAyB,EACzB,8BAA8B,EAC9B,8BAA8B,EAC9B,OAAO,CACV,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC;AAE1F,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAAC;AAEnD,MAAM,MAAM,8BAA8B,GAAG,4BAA4B,CAAC;AAE1E,MAAM,MAAM,2BAA2B,CAAC,OAAO,GAAG,OAAO,IAAI,CACzD,SAAS,EAAE,8BAA8B,EACzC,OAAO,CAAC,EACF,OAAO,CACH,aAAa,CACT,yBAAyB,EACzB,8BAA8B,EAC9B,OAAO,CAAC,8BAA8B,CAAC,EACvC,OAAO,CACV,CACJ,GACD,SAAS,KACd,IAAI,CAAC;AAEV,MAAM,MAAM,gCAAgC,CAAC,OAAO,GAAG,OAAO,IAAI,CAC9D,SAAS,EAAE,8BAA8B,EACzC,OAAO,CAAC,EACF,OAAO,CACH,aAAa,CACT,yBAAyB,EACzB,8BAA8B,EAC9B,OAAO,CAAC,8BAA8B,CAAC,EACvC,OAAO,CACV,CACJ,GACD,SAAS,KACd,OAAO,CAAC,yBAAyB,CAAC,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { buildStakeTransaction } from '../../actions/staking/build-stake-transaction'; | ||
| export const buildStakeTransactionMutationOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.mutation, | ||
| mutationFn(variables) { | ||
| return buildStakeTransaction(appKit, variables); | ||
| }, | ||
| mutationKey: ['buildStakeTransaction'], | ||
| }; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { GetStakedBalanceOptions } from '../../actions/staking/get-staked-balance'; | ||
| import type { GetStakedBalanceReturnType } from '../../actions/staking/get-staked-balance'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetStakedBalanceErrorType = Error; | ||
| export type GetStakedBalanceQueryConfig<selectData = GetStakedBalanceData> = Compute<ExactPartial<GetStakedBalanceOptions>> & QueryParameter<GetStakedBalanceQueryFnData, GetStakedBalanceErrorType, selectData, GetStakedBalanceQueryKey>; | ||
| export declare const getStakedBalanceQueryOptions: <selectData = GetStakedBalanceData>(appKit: AppKit, options?: GetStakedBalanceQueryConfig<selectData>) => GetStakedBalanceQueryOptions<selectData>; | ||
| export type GetStakedBalanceQueryFnData = Compute<Awaited<GetStakedBalanceReturnType>>; | ||
| export type GetStakedBalanceData = GetStakedBalanceQueryFnData; | ||
| export declare const getStakedBalanceQueryKey: (options?: Compute<ExactPartial<GetStakedBalanceOptions>>) => GetStakedBalanceQueryKey; | ||
| export type GetStakedBalanceQueryKey = readonly ['stakedBalance', Compute<ExactPartial<GetStakedBalanceOptions>>]; | ||
| export type GetStakedBalanceQueryOptions<selectData = GetStakedBalanceData> = QueryOptions<GetStakedBalanceQueryFnData, GetStakedBalanceErrorType, selectData, GetStakedBalanceQueryKey>; | ||
| //# sourceMappingURL=get-staked-balance.d.ts.map |
| {"version":3,"file":"get-staked-balance.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/get-staked-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE9C,MAAM,MAAM,2BAA2B,CAAC,UAAU,GAAG,oBAAoB,IAAI,OAAO,CAChF,YAAY,CAAC,uBAAuB,CAAC,CACxC,GACG,cAAc,CAAC,2BAA2B,EAAE,yBAAyB,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC;AAEjH,eAAO,MAAM,4BAA4B,GAAI,UAAU,GAAG,oBAAoB,EAC1E,QAAQ,MAAM,EACd,UAAS,2BAA2B,CAAC,UAAU,CAAM,KACtD,4BAA4B,CAAC,UAAU,CAczC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAEvF,MAAM,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAE/D,eAAO,MAAM,wBAAwB,GACjC,UAAS,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAM,KAC7D,wBAEF,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAAC,eAAe,EAAE,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,4BAA4B,CAAC,UAAU,GAAG,oBAAoB,IAAI,YAAY,CACtF,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,wBAAwB,CAC3B,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { getStakedBalance } from '../../actions/staking/get-staked-balance'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getStakedBalanceQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| enabled: Boolean(options.userAddress && (options.query?.enabled ?? true)), | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| if (!parameters.userAddress) { | ||
| throw new Error('userAddress is required'); | ||
| } | ||
| return getStakedBalance(appKit, parameters); | ||
| }, | ||
| queryKey: getStakedBalanceQueryKey(options), | ||
| }; | ||
| }; | ||
| export const getStakedBalanceQueryKey = (options = {}) => { | ||
| return ['stakedBalance', filterQueryOptions(options)]; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { GetStakingProviderInfoOptions } from '../../actions/staking/get-staking-provider-info'; | ||
| import type { GetStakingProviderInfoReturnType } from '../../actions/staking/get-staking-provider-info'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetStakingProviderInfoErrorType = Error; | ||
| export type GetStakingProviderInfoQueryConfig<selectData = GetStakingProviderInfoData> = Compute<ExactPartial<GetStakingProviderInfoOptions>> & QueryParameter<GetStakingProviderInfoQueryFnData, GetStakingProviderInfoErrorType, selectData, GetStakingProviderInfoQueryKey>; | ||
| export declare const getStakingProviderInfoQueryOptions: <selectData = GetStakingProviderInfoData>(appKit: AppKit, options?: GetStakingProviderInfoQueryConfig<selectData>) => GetStakingProviderInfoQueryOptions<selectData>; | ||
| export type GetStakingProviderInfoQueryFnData = Compute<Awaited<GetStakingProviderInfoReturnType>>; | ||
| export type GetStakingProviderInfoData = GetStakingProviderInfoQueryFnData; | ||
| export declare const getStakingProviderInfoQueryKey: (options?: Compute<ExactPartial<GetStakingProviderInfoOptions>>) => GetStakingProviderInfoQueryKey; | ||
| export type GetStakingProviderInfoQueryKey = readonly [ | ||
| 'stakingProviderInfo', | ||
| Compute<ExactPartial<GetStakingProviderInfoOptions>> | ||
| ]; | ||
| export type GetStakingProviderInfoQueryOptions<selectData = GetStakingProviderInfoData> = QueryOptions<GetStakingProviderInfoQueryFnData, GetStakingProviderInfoErrorType, selectData, GetStakingProviderInfoQueryKey>; | ||
| //# sourceMappingURL=get-staking-provider-info.d.ts.map |
| {"version":3,"file":"get-staking-provider-info.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/get-staking-provider-info.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AACrG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACxG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAEpD,MAAM,MAAM,iCAAiC,CAAC,UAAU,GAAG,0BAA0B,IAAI,OAAO,CAC5F,YAAY,CAAC,6BAA6B,CAAC,CAC9C,GACG,cAAc,CACV,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC;AAEN,eAAO,MAAM,kCAAkC,GAAI,UAAU,GAAG,0BAA0B,EACtF,QAAQ,MAAM,EACd,UAAS,iCAAiC,CAAC,UAAU,CAAM,KAC5D,kCAAkC,CAAC,UAAU,CAS/C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAC;AAEnG,MAAM,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE3E,eAAO,MAAM,8BAA8B,GACvC,UAAS,OAAO,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAM,KACnE,8BAEF,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,SAAS;IAClD,qBAAqB;IACrB,OAAO,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAAC,UAAU,GAAG,0BAA0B,IAAI,YAAY,CAClG,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { getStakingProviderInfo } from '../../actions/staking/get-staking-provider-info'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getStakingProviderInfoQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| return getStakingProviderInfo(appKit, parameters); | ||
| }, | ||
| queryKey: getStakingProviderInfoQueryKey(options), | ||
| }; | ||
| }; | ||
| export const getStakingProviderInfoQueryKey = (options = {}) => { | ||
| return ['stakingProviderInfo', filterQueryOptions(options)]; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { GetStakingProvidersReturnType } from '../../actions/staking/get-staking-providers'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute } from '../../types/utils'; | ||
| export type GetStakingProvidersErrorType = Error; | ||
| export type GetStakingProvidersQueryConfig<selectData = GetStakingProvidersData> = QueryParameter<GetStakingProvidersQueryFnData, GetStakingProvidersErrorType, selectData, GetStakingProvidersQueryKey>; | ||
| export declare const getStakingProvidersQueryOptions: <selectData = GetStakingProvidersData>(appKit: AppKit, options?: GetStakingProvidersQueryConfig<selectData>) => GetStakingProvidersQueryOptions<selectData>; | ||
| export type GetStakingProvidersQueryFnData = Compute<Awaited<GetStakingProvidersReturnType>>; | ||
| export type GetStakingProvidersData = GetStakingProvidersQueryFnData; | ||
| export declare const getStakingProvidersQueryKey: () => GetStakingProvidersQueryKey; | ||
| export type GetStakingProvidersQueryKey = readonly ['stakingProviders']; | ||
| export type GetStakingProvidersQueryOptions<selectData = GetStakingProvidersData> = QueryOptions<GetStakingProvidersQueryFnData, GetStakingProvidersErrorType, selectData, GetStakingProvidersQueryKey>; | ||
| //# sourceMappingURL=get-staking-providers.d.ts.map |
| {"version":3,"file":"get-staking-providers.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/get-staking-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAEjD,MAAM,MAAM,8BAA8B,CAAC,UAAU,GAAG,uBAAuB,IAAI,cAAc,CAC7F,8BAA8B,EAC9B,4BAA4B,EAC5B,UAAU,EACV,2BAA2B,CAC9B,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,UAAU,GAAG,uBAAuB,EAChF,QAAQ,MAAM,EACd,UAAS,8BAA8B,CAAC,UAAU,CAAM,KACzD,+BAA+B,CAAC,UAAU,CAQ5C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC;AAE7F,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAErE,eAAO,MAAM,2BAA2B,QAAO,2BAE9C,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAExE,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,uBAAuB,IAAI,YAAY,CAC5F,8BAA8B,EAC9B,4BAA4B,EAC5B,UAAU,EACV,2BAA2B,CAC9B,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { getStakingProviders } from '../../actions/staking/get-staking-providers'; | ||
| export const getStakingProvidersQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async () => { | ||
| return getStakingProviders(appKit); | ||
| }, | ||
| queryKey: getStakingProvidersQueryKey(), | ||
| }; | ||
| }; | ||
| export const getStakingProvidersQueryKey = () => { | ||
| return ['stakingProviders']; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { GetStakingQuoteOptions } from '../../actions/staking/get-staking-quote'; | ||
| import type { GetStakingQuoteReturnType } from '../../actions/staking/get-staking-quote'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetStakingQuoteErrorType = Error; | ||
| export type GetStakingQuoteQueryConfig<selectData = GetStakingQuoteData> = Compute<ExactPartial<GetStakingQuoteOptions>> & QueryParameter<GetStakingQuoteQueryFnData, GetStakingQuoteErrorType, selectData, GetStakingQuoteQueryKey>; | ||
| export declare const getStakingQuoteQueryOptions: <selectData = GetStakingQuoteData>(appKit: AppKit, options?: GetStakingQuoteQueryConfig<selectData>) => GetStakingQuoteQueryOptions<selectData>; | ||
| export type GetStakingQuoteQueryFnData = Compute<Awaited<GetStakingQuoteReturnType>>; | ||
| export type GetStakingQuoteData = GetStakingQuoteQueryFnData; | ||
| export declare const getStakingQuoteQueryKey: (options?: Compute<ExactPartial<GetStakingQuoteOptions>>) => GetStakingQuoteQueryKey; | ||
| export type GetStakingQuoteQueryKey = readonly ['stakingQuote', Compute<ExactPartial<GetStakingQuoteOptions>>]; | ||
| export type GetStakingQuoteQueryOptions<selectData = GetStakingQuoteData> = QueryOptions<GetStakingQuoteQueryFnData, GetStakingQuoteErrorType, selectData, GetStakingQuoteQueryKey>; | ||
| //# sourceMappingURL=get-staking-quote.d.ts.map |
| {"version":3,"file":"get-staking-quote.d.ts","sourceRoot":"","sources":["../../../../src/queries/staking/get-staking-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAE7C,MAAM,MAAM,0BAA0B,CAAC,UAAU,GAAG,mBAAmB,IAAI,OAAO,CAC9E,YAAY,CAAC,sBAAsB,CAAC,CACvC,GACG,cAAc,CAAC,0BAA0B,EAAE,wBAAwB,EAAE,UAAU,EAAE,uBAAuB,CAAC,CAAC;AAE9G,eAAO,MAAM,2BAA2B,GAAI,UAAU,GAAG,mBAAmB,EACxE,QAAQ,MAAM,EACd,UAAS,0BAA0B,CAAC,UAAU,CAAM,KACrD,2BAA2B,CAAC,UAAU,CAcxC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAErF,MAAM,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE7D,eAAO,MAAM,uBAAuB,GAChC,UAAS,OAAO,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAM,KAC5D,uBAEF,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE/G,MAAM,MAAM,2BAA2B,CAAC,UAAU,GAAG,mBAAmB,IAAI,YAAY,CACpF,0BAA0B,EAC1B,wBAAwB,EACxB,UAAU,EACV,uBAAuB,CAC1B,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { getStakingQuote } from '../../actions/staking/get-staking-quote'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getStakingQuoteQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| enabled: Boolean(options.amount && options.direction && (options.query?.enabled ?? true)), | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| if (!parameters.amount || !parameters.direction) { | ||
| throw new Error('amount and direction are required'); | ||
| } | ||
| return getStakingQuote(appKit, parameters); | ||
| }, | ||
| queryKey: getStakingQuoteQueryKey(options), | ||
| }; | ||
| }; | ||
| export const getStakingQuoteQueryKey = (options = {}) => { | ||
| return ['stakingQuote', filterQueryOptions(options)]; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=streaming-updates.test.d.ts.map |
| {"version":3,"file":"streaming-updates.test.d.ts","sourceRoot":"","sources":["../../../src/queries/streaming-updates.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { describe, it, expect, vi, beforeEach } from 'vitest'; | ||
| import { handleBalanceUpdate } from './balances/get-balance-by-address'; | ||
| import { handleJettonBalanceUpdate } from './jettons/get-jetton-balance-by-address'; | ||
| import { handleJettonsUpdate } from './jettons/get-jettons-by-address'; | ||
| import { Network } from '../types/network'; | ||
| describe('Streaming Updates Handlers', () => { | ||
| let queryClient; | ||
| beforeEach(() => { | ||
| queryClient = { | ||
| setQueryData: vi.fn(), | ||
| invalidateQueries: vi.fn(), | ||
| getQueryData: vi.fn(), | ||
| }; | ||
| }); | ||
| const network = Network.mainnet(); | ||
| describe('handleBalanceUpdate', () => { | ||
| it('should invalidate query immediately on invalidated status', () => { | ||
| const address = 'EQD...'; | ||
| const update = { | ||
| type: 'balance', | ||
| address, | ||
| balance: '100', | ||
| rawBalance: '100000000', | ||
| status: 'invalidated', | ||
| }; | ||
| handleBalanceUpdate(queryClient, { address, network }, update); | ||
| expect(queryClient.invalidateQueries).toHaveBeenCalledWith({ | ||
| queryKey: expect.arrayContaining(['balance']), | ||
| }); | ||
| expect(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| it('should update data on finalized status', () => { | ||
| const address = 'EQD...'; | ||
| const update = { | ||
| type: 'balance', | ||
| address, | ||
| balance: '100', | ||
| rawBalance: '100000000', | ||
| status: 'finalized', | ||
| }; | ||
| handleBalanceUpdate(queryClient, { address, network }, update); | ||
| expect(queryClient.setQueryData).toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| describe('handleJettonBalanceUpdate', () => { | ||
| it('should invalidate query immediately on invalidated status', () => { | ||
| const ownerAddress = 'EQO...'; | ||
| const jettonAddress = 'EQJ...'; | ||
| const update = { | ||
| type: 'jettons', | ||
| ownerAddress, | ||
| masterAddress: jettonAddress, | ||
| walletAddress: jettonAddress, | ||
| rawBalance: '50', | ||
| status: 'invalidated', | ||
| }; | ||
| handleJettonBalanceUpdate(queryClient, { ownerAddress, jettonAddress, network }, update); | ||
| expect(queryClient.invalidateQueries).toHaveBeenCalled(); | ||
| expect(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| describe('handleJettonsUpdate', () => { | ||
| it('should invalidate query immediately on invalidated status', () => { | ||
| const address = 'EQA...'; | ||
| const update = { | ||
| type: 'jettons', | ||
| ownerAddress: address, | ||
| masterAddress: address, | ||
| walletAddress: address, | ||
| rawBalance: '0', | ||
| status: 'invalidated', | ||
| }; | ||
| handleJettonsUpdate(queryClient, { address, network }, update); | ||
| expect(queryClient.invalidateQueries).toHaveBeenCalled(); | ||
| expect(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| }); |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export { StakingProvider, UnstakeMode, StakingError, StakingManager } from '@ton/walletkit'; | ||
| export type { UnstakeModes, StakeParams, StakingAPI, StakingQuote, StakingQuoteParams, StakingBalance, StakingProviderInfo, StakingProviderInterface, StakingQuoteDirection, } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/staking/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE5F,YAAY,EACR,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,GACxB,MAAM,gBAAgB,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export { StakingProvider, UnstakeMode, StakingError, StakingManager } from '@ton/walletkit'; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export * from '@ton/walletkit/staking/tonstakers'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/staking/tonstakers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mCAAmC,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export * from '@ton/walletkit/staking/tonstakers'; |
| <!-- | ||
| This file is auto-generated. Do not edit manually. | ||
| Changes will be overwritten when running the docs update script. | ||
| Source template: template/packages/appkit/docs/staking.md | ||
| --> | ||
| # Staking | ||
| AppKit supports staking through various providers. Available providers: | ||
| - **createTonstakersProvider** – [Tonstakers](https://tonstakers.com) liquid staking (`TonStakersStakingProvider` instance type) | ||
| ## Installation | ||
| Staking providers are included in the `@ton/appkit` package. No extra dependencies are required. | ||
| ## Setup | ||
| You can set up staking providers by passing them to the `AppKit` constructor. | ||
| ```ts | ||
| // Initialize AppKit with staking providers | ||
| const network = Network.mainnet(); | ||
| const toncenterApiClient = new ApiClientToncenter({ network }); | ||
| const appKit = new AppKit({ | ||
| networks: { | ||
| [network.chainId]: { | ||
| apiClient: toncenterApiClient, | ||
| }, | ||
| }, | ||
| providers: [createTonstakersProvider()], | ||
| }); | ||
| ``` | ||
| ### Register Dynamically | ||
| Alternatively, you can register providers dynamically using `registerProvider`: | ||
| ```ts | ||
| // 1. Initialize AppKit | ||
| const appKit = new AppKit({ | ||
| networks: { | ||
| [Network.mainnet().chainId]: { | ||
| apiClient: { | ||
| url: 'https://toncenter.com', | ||
| key: 'your-key', | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| // 2. Register staking providers | ||
| registerProvider(appKit, createTonstakersProvider()); | ||
| ``` | ||
| ## Configuration | ||
| - **Tonstakers**: [Tonstakers documentation](https://docs.tonstakers.com) and [provider README](https://github.com/ton-connect/kit/blob/main/packages/walletkit/src/defi/staking/tonstakers/README.md) |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { BalanceUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { resolveNetwork } from '../../utils/network/resolve-network'; | ||
| export interface WatchBalanceByAddressOptions { | ||
| address: string | Address; | ||
| network?: Network; | ||
| onChange: (update: BalanceUpdate) => void; | ||
| } | ||
| export type WatchBalanceByAddressReturnType = () => void; | ||
| /** | ||
| * Watch account balance changes by address. | ||
| */ | ||
| export const watchBalanceByAddress = ( | ||
| appKit: AppKit, | ||
| options: WatchBalanceByAddressOptions, | ||
| ): WatchBalanceByAddressReturnType => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = Address.isAddress(address) ? address.toString() : Address.parse(address).toString(); | ||
| const resolvedNetwork = resolveNetwork(appKit, network); | ||
| return appKit.streamingManager.watchBalance(resolvedNetwork, addressString, onChange); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { BalanceUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { WALLETS_EVENTS } from '../../core/app-kit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { watchBalanceByAddress } from './watch-balance-by-address'; | ||
| export interface WatchBalanceOptions { | ||
| network?: Network; | ||
| onChange: (update: BalanceUpdate) => void; | ||
| } | ||
| export type WatchBalanceReturnType = () => void; | ||
| /** | ||
| * Watch account balance changes for the selected wallet. | ||
| */ | ||
| export const watchBalance = (appKit: AppKit, options: WatchBalanceOptions): WatchBalanceReturnType => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe: (() => void) | null = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = getSelectedWallet(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = watchBalanceByAddress(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const off = appKit.emitter.on(WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) unsubscribe(); | ||
| off(); | ||
| offUpdate(); | ||
| }; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { JettonUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { resolveNetwork } from '../../utils/network/resolve-network'; | ||
| export interface WatchJettonsByAddressOptions { | ||
| address: string | Address; | ||
| onChange: (update: JettonUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchJettonsByAddressReturnType = () => void; | ||
| /** | ||
| * Watch jetton updates by owner address. | ||
| */ | ||
| export const watchJettonsByAddress = ( | ||
| appKit: AppKit, | ||
| options: WatchJettonsByAddressOptions, | ||
| ): WatchJettonsByAddressReturnType => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = Address.isAddress(address) ? address.toString() : Address.parse(address).toString(); | ||
| const resolvedNetwork = resolveNetwork(appKit, network); | ||
| return appKit.streamingManager.watchJettons(resolvedNetwork, addressString, onChange); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { JettonUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { WALLETS_EVENTS } from '../../core/app-kit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { watchJettonsByAddress } from './watch-jettons-by-address'; | ||
| export interface WatchJettonsOptions { | ||
| onChange: (update: JettonUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchJettonsReturnType = () => void; | ||
| /** | ||
| * Watch jetton updates for the selected wallet. | ||
| */ | ||
| export const watchJettons = (appKit: AppKit, options: WatchJettonsOptions): WatchJettonsReturnType => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe: (() => void) | null = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = getSelectedWallet(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = watchJettonsByAddress(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const offSelection = appKit.emitter.on(WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) unsubscribe(); | ||
| offSelection(); | ||
| offUpdate(); | ||
| }; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { Network } from '../../types/network'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { ApiClient } from '../../core/network'; | ||
| export type GetApiClientReturnType = ApiClient; | ||
| export type GetApiClientOptions = { network: Network }; | ||
| /** | ||
| * Get API client for a network | ||
| */ | ||
| export const getApiClient = (appKit: AppKit, options: GetApiClientOptions): GetApiClientReturnType => { | ||
| return appKit.networkManager.getClient(options.network); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { AppKit } from '../../core/app-kit/services/app-kit'; | ||
| import type { Network } from '../../types/network'; | ||
| export type HasStreamingProviderReturnType = boolean; | ||
| /** | ||
| * Check if a streaming provider is registered for a specific network. | ||
| */ | ||
| export const hasStreamingProvider = (appKit: AppKit, network: Network): HasStreamingProviderReturnType => { | ||
| return appKit.streamingManager.hasProvider(network); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakeParams } from '@ton/walletkit'; | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type BuildStakeTransactionOptions = StakeParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type BuildStakeTransactionReturnType = Promise<TransactionRequest>; | ||
| /** | ||
| * Build stake transaction | ||
| */ | ||
| export const buildStakeTransaction = async ( | ||
| appKit: AppKit, | ||
| options: BuildStakeTransactionOptions, | ||
| ): BuildStakeTransactionReturnType => { | ||
| return appKit.stakingManager.buildStakeTransaction(options, options.providerId); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingBalance, UserFriendlyAddress, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { resolveNetwork } from '../../utils'; | ||
| export type GetStakedBalanceOptions = { | ||
| userAddress: UserFriendlyAddress; | ||
| network?: Network; | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakedBalanceReturnType = Promise<StakingBalance>; | ||
| /** | ||
| * Get staked balance | ||
| */ | ||
| export const getStakedBalance = async ( | ||
| appKit: AppKit, | ||
| options: GetStakedBalanceOptions, | ||
| ): GetStakedBalanceReturnType => { | ||
| return appKit.stakingManager.getStakedBalance( | ||
| options.userAddress, | ||
| resolveNetwork(appKit, options.network), | ||
| options.providerId, | ||
| ); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingManager } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingManagerReturnType = StakingManager; | ||
| /** | ||
| * Get staking manager instance | ||
| */ | ||
| export const getStakingManager = (appKit: AppKit): GetStakingManagerReturnType => { | ||
| return appKit.stakingManager; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingProviderInfo, Network } from '@ton/walletkit'; | ||
| import { resolveNetwork } from '../../utils'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingProviderInfoOptions = { | ||
| network?: Network; | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakingProviderInfoReturnType = Promise<StakingProviderInfo>; | ||
| /** | ||
| * Get staking provider info | ||
| */ | ||
| export const getStakingProviderInfo = async ( | ||
| appKit: AppKit, | ||
| options: GetStakingProviderInfoOptions = {}, | ||
| ): GetStakingProviderInfoReturnType => { | ||
| return appKit.stakingManager.getStakingProviderInfo(resolveNetwork(appKit, options.network), options.providerId); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetStakingProvidersReturnType = string[]; | ||
| /** | ||
| * Get available staking provider IDs | ||
| */ | ||
| export const getStakingProviders = (appKit: AppKit): GetStakingProvidersReturnType => { | ||
| return appKit.stakingManager.getRegisteredProviders(); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { StakingQuote, StakingQuoteParams } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { resolveNetwork } from '../../utils'; | ||
| export type GetStakingQuoteOptions = StakingQuoteParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetStakingQuoteReturnType = Promise<StakingQuote>; | ||
| /** | ||
| * Get staking quote | ||
| */ | ||
| export const getStakingQuote = async (appKit: AppKit, options: GetStakingQuoteOptions): GetStakingQuoteReturnType => { | ||
| const optionsWithNetwork = { | ||
| ...options, | ||
| network: resolveNetwork(appKit, options.network), | ||
| }; | ||
| return appKit.stakingManager.getQuote(optionsWithNetwork, options.providerId); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { Address } from '@ton/core'; | ||
| import type { TransactionsUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { resolveNetwork } from '../../utils/network/resolve-network'; | ||
| export interface WatchTransactionsByAddressOptions { | ||
| address: string | Address; | ||
| onChange: (update: TransactionsUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchTransactionsByAddressReturnType = () => void; | ||
| /** | ||
| * Watch transactions by address. | ||
| */ | ||
| export const watchTransactionsByAddress = ( | ||
| appKit: AppKit, | ||
| options: WatchTransactionsByAddressOptions, | ||
| ): WatchTransactionsByAddressReturnType => { | ||
| const { address, network, onChange } = options; | ||
| const addressString = Address.isAddress(address) ? address.toString() : Address.parse(address).toString(); | ||
| const resolvedNetwork = resolveNetwork(appKit, network); | ||
| return appKit.streamingManager.watchTransactions(resolvedNetwork, addressString, onChange); | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { TransactionsUpdate, Network } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { WALLETS_EVENTS } from '../../core/app-kit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { watchTransactionsByAddress } from './watch-transactions-by-address'; | ||
| export interface WatchTransactionsOptions { | ||
| onChange: (update: TransactionsUpdate) => void; | ||
| network?: Network; | ||
| } | ||
| export type WatchTransactionsReturnType = () => void; | ||
| /** | ||
| * Watch transactions for the selected wallet. | ||
| */ | ||
| export const watchTransactions = (appKit: AppKit, options: WatchTransactionsOptions): WatchTransactionsReturnType => { | ||
| const { network, onChange } = options; | ||
| let unsubscribe: (() => void) | null = null; | ||
| const updateSubscription = () => { | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| unsubscribe = null; | ||
| } | ||
| const selectedWallet = getSelectedWallet(appKit); | ||
| if (selectedWallet) { | ||
| unsubscribe = watchTransactionsByAddress(appKit, { | ||
| address: selectedWallet.getAddress(), | ||
| network: network ?? selectedWallet.getNetwork(), | ||
| onChange, | ||
| }); | ||
| } | ||
| }; | ||
| const offSelection = appKit.emitter.on(WALLETS_EVENTS.SELECTION_CHANGED, updateSubscription); | ||
| const offUpdate = appKit.emitter.on(WALLETS_EVENTS.UPDATED, updateSubscription); | ||
| updateSubscription(); | ||
| return () => { | ||
| if (unsubscribe) unsubscribe(); | ||
| offSelection(); | ||
| offUpdate(); | ||
| }; | ||
| }; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export { | ||
| StreamingManager, | ||
| TonCenterStreamingProvider, | ||
| createTonCenterStreamingProvider, | ||
| TonApiStreamingProvider, | ||
| createTonApiStreamingProvider, | ||
| } from '@ton/walletkit'; | ||
| export type { | ||
| StreamingProvider, | ||
| StreamingProviderFactory, | ||
| StreamingAPI, | ||
| TonCenterStreamingProviderConfig, | ||
| TonApiStreamingProviderConfig, | ||
| BalanceUpdate, | ||
| TransactionsUpdate, | ||
| Transaction, | ||
| JettonUpdate, | ||
| StreamingUpdate, | ||
| StreamingWatchType, | ||
| StreamingEvents, | ||
| } from '@ton/walletkit'; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { MutateOptions, MutationOptions } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { MutationParameter } from '../../types/query'; | ||
| import type { Compute } from '../../types/utils'; | ||
| import { buildStakeTransaction } from '../../actions/staking/build-stake-transaction'; | ||
| import type { | ||
| BuildStakeTransactionOptions, | ||
| BuildStakeTransactionReturnType, | ||
| } from '../../actions/staking/build-stake-transaction'; | ||
| export type BuildStakeTransactionMutationOptions<context = unknown> = MutationParameter< | ||
| BuildStakeTransactionData, | ||
| BuildStakeTransactionErrorType, | ||
| BuildStakeTransactionVariables, | ||
| context | ||
| >; | ||
| export const buildStakeTransactionMutationOptions = <context = unknown>( | ||
| appKit: AppKit, | ||
| options: BuildStakeTransactionMutationOptions<context> = {}, | ||
| ): BuildStakeTransactionMutationConfig<context> => { | ||
| return { | ||
| ...options.mutation, | ||
| mutationFn(variables) { | ||
| return buildStakeTransaction(appKit, variables); | ||
| }, | ||
| mutationKey: ['buildStakeTransaction'], | ||
| }; | ||
| }; | ||
| export type BuildStakeTransactionMutationConfig<context = unknown> = MutationOptions< | ||
| BuildStakeTransactionData, | ||
| BuildStakeTransactionErrorType, | ||
| BuildStakeTransactionVariables, | ||
| context | ||
| >; | ||
| export type BuildStakeTransactionData = Compute<Awaited<BuildStakeTransactionReturnType>>; | ||
| export type BuildStakeTransactionErrorType = Error; | ||
| export type BuildStakeTransactionVariables = BuildStakeTransactionOptions; | ||
| export type BuildStakeTransactionMutate<context = unknown> = ( | ||
| variables: BuildStakeTransactionVariables, | ||
| options?: | ||
| | Compute< | ||
| MutateOptions< | ||
| BuildStakeTransactionData, | ||
| BuildStakeTransactionErrorType, | ||
| Compute<BuildStakeTransactionVariables>, | ||
| context | ||
| > | ||
| > | ||
| | undefined, | ||
| ) => void; | ||
| export type BuildStakeTransactionMutateAsync<context = unknown> = ( | ||
| variables: BuildStakeTransactionVariables, | ||
| options?: | ||
| | Compute< | ||
| MutateOptions< | ||
| BuildStakeTransactionData, | ||
| BuildStakeTransactionErrorType, | ||
| Compute<BuildStakeTransactionVariables>, | ||
| context | ||
| > | ||
| > | ||
| | undefined, | ||
| ) => Promise<BuildStakeTransactionData>; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { getStakedBalance } from '../../actions/staking/get-staked-balance'; | ||
| import type { GetStakedBalanceOptions } from '../../actions/staking/get-staked-balance'; | ||
| import type { GetStakedBalanceReturnType } from '../../actions/staking/get-staked-balance'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export type GetStakedBalanceErrorType = Error; | ||
| export type GetStakedBalanceQueryConfig<selectData = GetStakedBalanceData> = Compute< | ||
| ExactPartial<GetStakedBalanceOptions> | ||
| > & | ||
| QueryParameter<GetStakedBalanceQueryFnData, GetStakedBalanceErrorType, selectData, GetStakedBalanceQueryKey>; | ||
| export const getStakedBalanceQueryOptions = <selectData = GetStakedBalanceData>( | ||
| appKit: AppKit, | ||
| options: GetStakedBalanceQueryConfig<selectData> = {}, | ||
| ): GetStakedBalanceQueryOptions<selectData> => { | ||
| return { | ||
| ...options.query, | ||
| enabled: Boolean(options.userAddress && (options.query?.enabled ?? true)), | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey as [string, GetStakedBalanceOptions]; | ||
| if (!parameters.userAddress) { | ||
| throw new Error('userAddress is required'); | ||
| } | ||
| return getStakedBalance(appKit, parameters); | ||
| }, | ||
| queryKey: getStakedBalanceQueryKey(options), | ||
| }; | ||
| }; | ||
| export type GetStakedBalanceQueryFnData = Compute<Awaited<GetStakedBalanceReturnType>>; | ||
| export type GetStakedBalanceData = GetStakedBalanceQueryFnData; | ||
| export const getStakedBalanceQueryKey = ( | ||
| options: Compute<ExactPartial<GetStakedBalanceOptions>> = {}, | ||
| ): GetStakedBalanceQueryKey => { | ||
| return ['stakedBalance', filterQueryOptions(options as unknown as Record<string, unknown>)] as const; | ||
| }; | ||
| export type GetStakedBalanceQueryKey = readonly ['stakedBalance', Compute<ExactPartial<GetStakedBalanceOptions>>]; | ||
| export type GetStakedBalanceQueryOptions<selectData = GetStakedBalanceData> = QueryOptions< | ||
| GetStakedBalanceQueryFnData, | ||
| GetStakedBalanceErrorType, | ||
| selectData, | ||
| GetStakedBalanceQueryKey | ||
| >; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { getStakingProviderInfo } from '../../actions/staking/get-staking-provider-info'; | ||
| import type { GetStakingProviderInfoOptions } from '../../actions/staking/get-staking-provider-info'; | ||
| import type { GetStakingProviderInfoReturnType } from '../../actions/staking/get-staking-provider-info'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export type GetStakingProviderInfoErrorType = Error; | ||
| export type GetStakingProviderInfoQueryConfig<selectData = GetStakingProviderInfoData> = Compute< | ||
| ExactPartial<GetStakingProviderInfoOptions> | ||
| > & | ||
| QueryParameter< | ||
| GetStakingProviderInfoQueryFnData, | ||
| GetStakingProviderInfoErrorType, | ||
| selectData, | ||
| GetStakingProviderInfoQueryKey | ||
| >; | ||
| export const getStakingProviderInfoQueryOptions = <selectData = GetStakingProviderInfoData>( | ||
| appKit: AppKit, | ||
| options: GetStakingProviderInfoQueryConfig<selectData> = {}, | ||
| ): GetStakingProviderInfoQueryOptions<selectData> => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey as [string, GetStakingProviderInfoOptions]; | ||
| return getStakingProviderInfo(appKit, parameters); | ||
| }, | ||
| queryKey: getStakingProviderInfoQueryKey(options), | ||
| }; | ||
| }; | ||
| export type GetStakingProviderInfoQueryFnData = Compute<Awaited<GetStakingProviderInfoReturnType>>; | ||
| export type GetStakingProviderInfoData = GetStakingProviderInfoQueryFnData; | ||
| export const getStakingProviderInfoQueryKey = ( | ||
| options: Compute<ExactPartial<GetStakingProviderInfoOptions>> = {}, | ||
| ): GetStakingProviderInfoQueryKey => { | ||
| return ['stakingProviderInfo', filterQueryOptions(options as unknown as Record<string, unknown>)] as const; | ||
| }; | ||
| export type GetStakingProviderInfoQueryKey = readonly [ | ||
| 'stakingProviderInfo', | ||
| Compute<ExactPartial<GetStakingProviderInfoOptions>>, | ||
| ]; | ||
| export type GetStakingProviderInfoQueryOptions<selectData = GetStakingProviderInfoData> = QueryOptions< | ||
| GetStakingProviderInfoQueryFnData, | ||
| GetStakingProviderInfoErrorType, | ||
| selectData, | ||
| GetStakingProviderInfoQueryKey | ||
| >; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { getStakingProviders } from '../../actions/staking/get-staking-providers'; | ||
| import type { GetStakingProvidersReturnType } from '../../actions/staking/get-staking-providers'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute } from '../../types/utils'; | ||
| export type GetStakingProvidersErrorType = Error; | ||
| export type GetStakingProvidersQueryConfig<selectData = GetStakingProvidersData> = QueryParameter< | ||
| GetStakingProvidersQueryFnData, | ||
| GetStakingProvidersErrorType, | ||
| selectData, | ||
| GetStakingProvidersQueryKey | ||
| >; | ||
| export const getStakingProvidersQueryOptions = <selectData = GetStakingProvidersData>( | ||
| appKit: AppKit, | ||
| options: GetStakingProvidersQueryConfig<selectData> = {}, | ||
| ): GetStakingProvidersQueryOptions<selectData> => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async () => { | ||
| return getStakingProviders(appKit); | ||
| }, | ||
| queryKey: getStakingProvidersQueryKey(), | ||
| }; | ||
| }; | ||
| export type GetStakingProvidersQueryFnData = Compute<Awaited<GetStakingProvidersReturnType>>; | ||
| export type GetStakingProvidersData = GetStakingProvidersQueryFnData; | ||
| export const getStakingProvidersQueryKey = (): GetStakingProvidersQueryKey => { | ||
| return ['stakingProviders'] as const; | ||
| }; | ||
| export type GetStakingProvidersQueryKey = readonly ['stakingProviders']; | ||
| export type GetStakingProvidersQueryOptions<selectData = GetStakingProvidersData> = QueryOptions< | ||
| GetStakingProvidersQueryFnData, | ||
| GetStakingProvidersErrorType, | ||
| selectData, | ||
| GetStakingProvidersQueryKey | ||
| >; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { getStakingQuote } from '../../actions/staking/get-staking-quote'; | ||
| import type { GetStakingQuoteOptions } from '../../actions/staking/get-staking-quote'; | ||
| import type { GetStakingQuoteReturnType } from '../../actions/staking/get-staking-quote'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export type GetStakingQuoteErrorType = Error; | ||
| export type GetStakingQuoteQueryConfig<selectData = GetStakingQuoteData> = Compute< | ||
| ExactPartial<GetStakingQuoteOptions> | ||
| > & | ||
| QueryParameter<GetStakingQuoteQueryFnData, GetStakingQuoteErrorType, selectData, GetStakingQuoteQueryKey>; | ||
| export const getStakingQuoteQueryOptions = <selectData = GetStakingQuoteData>( | ||
| appKit: AppKit, | ||
| options: GetStakingQuoteQueryConfig<selectData> = {}, | ||
| ): GetStakingQuoteQueryOptions<selectData> => { | ||
| return { | ||
| ...options.query, | ||
| enabled: Boolean(options.amount && options.direction && (options.query?.enabled ?? true)), | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey as [string, GetStakingQuoteOptions]; | ||
| if (!parameters.amount || !parameters.direction) { | ||
| throw new Error('amount and direction are required'); | ||
| } | ||
| return getStakingQuote(appKit, parameters); | ||
| }, | ||
| queryKey: getStakingQuoteQueryKey(options), | ||
| }; | ||
| }; | ||
| export type GetStakingQuoteQueryFnData = Compute<Awaited<GetStakingQuoteReturnType>>; | ||
| export type GetStakingQuoteData = GetStakingQuoteQueryFnData; | ||
| export const getStakingQuoteQueryKey = ( | ||
| options: Compute<ExactPartial<GetStakingQuoteOptions>> = {}, | ||
| ): GetStakingQuoteQueryKey => { | ||
| return ['stakingQuote', filterQueryOptions(options as unknown as Record<string, unknown>)] as const; | ||
| }; | ||
| export type GetStakingQuoteQueryKey = readonly ['stakingQuote', Compute<ExactPartial<GetStakingQuoteOptions>>]; | ||
| export type GetStakingQuoteQueryOptions<selectData = GetStakingQuoteData> = QueryOptions< | ||
| GetStakingQuoteQueryFnData, | ||
| GetStakingQuoteErrorType, | ||
| selectData, | ||
| GetStakingQuoteQueryKey | ||
| >; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import { describe, it, expect, vi, beforeEach } from 'vitest'; | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import { handleBalanceUpdate } from './balances/get-balance-by-address'; | ||
| import { handleJettonBalanceUpdate } from './jettons/get-jetton-balance-by-address'; | ||
| import { handleJettonsUpdate } from './jettons/get-jettons-by-address'; | ||
| import { Network } from '../types/network'; | ||
| import type { BalanceUpdate, JettonUpdate } from '../core/streaming'; | ||
| describe('Streaming Updates Handlers', () => { | ||
| let queryClient: QueryClient; | ||
| beforeEach(() => { | ||
| queryClient = { | ||
| setQueryData: vi.fn(), | ||
| invalidateQueries: vi.fn(), | ||
| getQueryData: vi.fn(), | ||
| } as unknown as QueryClient; | ||
| }); | ||
| const network = Network.mainnet(); | ||
| describe('handleBalanceUpdate', () => { | ||
| it('should invalidate query immediately on invalidated status', () => { | ||
| const address = 'EQD...'; | ||
| const update: BalanceUpdate = { | ||
| type: 'balance', | ||
| address, | ||
| balance: '100', | ||
| rawBalance: '100000000', | ||
| status: 'invalidated', | ||
| }; | ||
| handleBalanceUpdate(queryClient, { address, network }, update); | ||
| expect(queryClient.invalidateQueries).toHaveBeenCalledWith({ | ||
| queryKey: expect.arrayContaining(['balance']), | ||
| }); | ||
| expect(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| it('should update data on finalized status', () => { | ||
| const address = 'EQD...'; | ||
| const update: BalanceUpdate = { | ||
| type: 'balance', | ||
| address, | ||
| balance: '100', | ||
| rawBalance: '100000000', | ||
| status: 'finalized', | ||
| }; | ||
| handleBalanceUpdate(queryClient, { address, network }, update); | ||
| expect(queryClient.setQueryData).toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| describe('handleJettonBalanceUpdate', () => { | ||
| it('should invalidate query immediately on invalidated status', () => { | ||
| const ownerAddress = 'EQO...'; | ||
| const jettonAddress = 'EQJ...'; | ||
| const update: JettonUpdate = { | ||
| type: 'jettons', | ||
| ownerAddress, | ||
| masterAddress: jettonAddress, | ||
| walletAddress: jettonAddress, | ||
| rawBalance: '50', | ||
| status: 'invalidated', | ||
| }; | ||
| handleJettonBalanceUpdate(queryClient, { ownerAddress, jettonAddress, network }, update); | ||
| expect(queryClient.invalidateQueries).toHaveBeenCalled(); | ||
| expect(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| describe('handleJettonsUpdate', () => { | ||
| it('should invalidate query immediately on invalidated status', () => { | ||
| const address = 'EQA...'; | ||
| const update: JettonUpdate = { | ||
| type: 'jettons', | ||
| ownerAddress: address, | ||
| masterAddress: address, | ||
| walletAddress: address, | ||
| rawBalance: '0', | ||
| status: 'invalidated', | ||
| }; | ||
| handleJettonsUpdate(queryClient, { address, network }, update); | ||
| expect(queryClient.invalidateQueries).toHaveBeenCalled(); | ||
| expect(queryClient.setQueryData).not.toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
| }); |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export { StakingProvider, UnstakeMode, StakingError, StakingManager } from '@ton/walletkit'; | ||
| export type { | ||
| UnstakeModes, | ||
| StakeParams, | ||
| StakingAPI, | ||
| StakingQuote, | ||
| StakingQuoteParams, | ||
| StakingBalance, | ||
| StakingProviderInfo, | ||
| StakingProviderInterface, | ||
| StakingQuoteDirection, | ||
| } from '@ton/walletkit'; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export * from '@ton/walletkit/staking/tonstakers'; |
| > @ton/appkit@0.0.5-alpha.1 build /home/runner/work/kit/kit/packages/appkit | ||
| > @ton/appkit@0.0.5-alpha.2 build /home/runner/work/kit/kit/packages/appkit | ||
| > pnpm build:clean && pnpm build:cjs && pnpm build:esm | ||
| > @ton/appkit@0.0.5-alpha.1 build:clean /home/runner/work/kit/kit/packages/appkit | ||
| > @ton/appkit@0.0.5-alpha.2 build:clean /home/runner/work/kit/kit/packages/appkit | ||
| > git clean -xdf dist | ||
| > @ton/appkit@0.0.5-alpha.1 build:cjs /home/runner/work/kit/kit/packages/appkit | ||
| > @ton/appkit@0.0.5-alpha.2 build:cjs /home/runner/work/kit/kit/packages/appkit | ||
| > tsc -p tsconfig.cjs.json | ||
| > @ton/appkit@0.0.5-alpha.1 build:esm /home/runner/work/kit/kit/packages/appkit | ||
| > @ton/appkit@0.0.5-alpha.2 build:esm /home/runner/work/kit/kit/packages/appkit | ||
| > tsc -p tsconfig.json | ||
+11
-0
| # @ton/appkit | ||
| ## 0.0.5-alpha.2 | ||
| ### Patch Changes | ||
| - 1f552f7: Added new connector and provider factory options | ||
| - 4a060fb: Implemented staking infrastructure including \`StakingManager\` and \`TonStakersStakingProvider\` with support for multiple unstake modes (delayed, instant, best rate). Added core type updates and exported staking features from the package root. | ||
| - Updated dependencies [74e0b78] | ||
| - Updated dependencies [1f552f7] | ||
| - Updated dependencies [4a060fb] | ||
| - @ton/walletkit@0.0.12-alpha.2 | ||
| ## 0.0.5-alpha.1 | ||
@@ -4,0 +15,0 @@ |
@@ -9,4 +9,4 @@ /** | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { Connector } from '../../types/connector'; | ||
| export type AddConnectorParameters = Connector; | ||
| import type { ConnectorInput } from '../../types/connector'; | ||
| export type AddConnectorParameters = ConnectorInput; | ||
| export type AddConnectorReturnType = () => void; | ||
@@ -16,3 +16,3 @@ /** | ||
| */ | ||
| export declare const addConnector: (appKit: AppKit, connector: AddConnectorParameters) => AddConnectorReturnType; | ||
| export declare const addConnector: (appKit: AppKit, connectorFn: AddConnectorParameters) => AddConnectorReturnType; | ||
| //# sourceMappingURL=add-connector.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"add-connector.d.ts","sourceRoot":"","sources":["../../../../src/actions/connectors/add-connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,WAAW,sBAAsB,KAAG,sBAEhF,CAAC"} | ||
| {"version":3,"file":"add-connector.d.ts","sourceRoot":"","sources":["../../../../src/actions/connectors/add-connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,aAAa,sBAAsB,KAAG,sBAElF,CAAC"} |
@@ -14,5 +14,5 @@ "use strict"; | ||
| */ | ||
| const addConnector = (appKit, connector) => { | ||
| return appKit.addConnector(connector); | ||
| const addConnector = (appKit, connectorFn) => { | ||
| return appKit.addConnector(connectorFn); | ||
| }; | ||
| exports.addConnector = addConnector; |
@@ -9,3 +9,5 @@ /** | ||
| export { getBalanceByAddress, type GetBalanceByAddressOptions, type GetBalanceByAddressReturnType, } from './balances/get-balance-by-address'; | ||
| export { watchBalanceByAddress, type WatchBalanceByAddressOptions, type WatchBalanceByAddressReturnType, } from './balances/watch-balance-by-address'; | ||
| export { getBalance, type GetBalanceOptions, type GetBalanceReturnType } from './balances/get-balance'; | ||
| export { watchBalance, type WatchBalanceOptions, type WatchBalanceReturnType } from './balances/watch-balance'; | ||
| export { addConnector, type AddConnectorParameters, type AddConnectorReturnType } from './connectors/add-connector'; | ||
@@ -22,3 +24,5 @@ export { connect, type ConnectParameters, type ConnectReturnType } from './connectors/connect'; | ||
| export { getJettonsByAddress, type GetJettonsByAddressOptions, type GetJettonsByAddressReturnType, } from './jettons/get-jettons-by-address'; | ||
| export { watchJettonsByAddress, type WatchJettonsByAddressOptions, type WatchJettonsByAddressReturnType, } from './jettons/watch-jettons-by-address'; | ||
| export { getJettons, type GetJettonsOptions, type GetJettonsReturnType } from './jettons/get-jettons'; | ||
| export { watchJettons, type WatchJettonsOptions, type WatchJettonsReturnType } from './jettons/watch-jettons'; | ||
| export { createTransferJettonTransaction, type CreateTransferJettonTransactionParameters, type CreateTransferJettonTransactionReturnType, } from './jettons/create-transfer-jetton-transaction'; | ||
@@ -28,2 +32,3 @@ export { transferJetton, type TransferJettonParameters, type TransferJettonReturnType, } from './jettons/transfer-jetton'; | ||
| export { getNetwork, type GetNetworkReturnType } from './network/get-network'; | ||
| export { getApiClient, type GetApiClientOptions, type GetApiClientReturnType } from './network/get-api-client'; | ||
| export { watchNetworks, type WatchNetworksParameters, type WatchNetworksReturnType } from './network/watch-networks'; | ||
@@ -34,2 +39,3 @@ export { getBlockNumber, type GetBlockNumberOptions, type GetBlockNumberReturnType } from './network/get-block-number'; | ||
| export { watchDefaultNetwork, type WatchDefaultNetworkParameters, type WatchDefaultNetworkReturnType, } from './network/watch-default-network'; | ||
| export { hasStreamingProvider, type HasStreamingProviderReturnType } from './network/has-streaming-provider'; | ||
| export { getNftsByAddress, type GetNftsByAddressOptions, type GetNftsByAddressReturnType, } from './nft/get-nfts-by-address'; | ||
@@ -46,5 +52,13 @@ export { getNfts, type GetNftsOptions, type GetNftsReturnType } from './nft/get-nfts'; | ||
| export { buildSwapTransaction, type BuildSwapTransactionOptions, type BuildSwapTransactionReturnType, } from './swap/build-swap-transaction'; | ||
| export { getStakingManager, type GetStakingManagerReturnType } from './staking/get-staking-manager'; | ||
| export { getStakingProviders, type GetStakingProvidersReturnType } from './staking/get-staking-providers'; | ||
| export { getStakingQuote, type GetStakingQuoteOptions, type GetStakingQuoteReturnType, } from './staking/get-staking-quote'; | ||
| export { buildStakeTransaction, type BuildStakeTransactionOptions, type BuildStakeTransactionReturnType, } from './staking/build-stake-transaction'; | ||
| export { getStakedBalance, type GetStakedBalanceOptions, type GetStakedBalanceReturnType, } from './staking/get-staked-balance'; | ||
| export { getStakingProviderInfo, type GetStakingProviderInfoOptions, type GetStakingProviderInfoReturnType, } from './staking/get-staking-provider-info'; | ||
| export { sendTransaction, type SendTransactionParameters, type SendTransactionReturnType, } from './transaction/send-transaction'; | ||
| export { transferTon, type TransferTonParameters, type TransferTonReturnType } from './transaction/transfer-ton'; | ||
| export { getTransactionStatus, type GetTransactionStatusParameters, type GetTransactionStatusReturnType, type GetTransactionStatusErrorType, } from './transaction/get-transaction-status'; | ||
| export { watchTransactionsByAddress, type WatchTransactionsByAddressOptions, type WatchTransactionsByAddressReturnType, } from './transaction/watch-transactions-by-address'; | ||
| export { watchTransactions, type WatchTransactionsOptions, type WatchTransactionsReturnType, } from './transaction/watch-transactions'; | ||
| export { createTransferNftTransaction, type CreateTransferNftTransactionParameters, type CreateTransferNftTransactionReturnType, } from './nft/create-transfer-nft-transaction'; | ||
@@ -51,0 +65,0 @@ export { createTransferTonTransaction, type CreateTransferTonTransactionParameters, type CreateTransferTonTransactionReturnType, } from './transaction/create-transfer-ton-transaction'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,GACrC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGvG,OAAO,EAAE,YAAY,EAAE,KAAK,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpH,OAAO,EAAE,OAA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E,MAAM,+BAA+B,CAAC;AACpG,OAAO,EACH,mBAAmB,EACnB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,mBAAmB,EACnB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,GACrC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,qBAAqB,EACrB,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,GACvC,MAAM,mCAAmC,CAAC"} |
@@ -10,8 +10,13 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.watchConnectedWallets = exports.watchSelectedWallet = exports.setSelectedWalletId = exports.getSelectedWallet = exports.getConnectedWallets = exports.createTransferTonTransaction = exports.createTransferNftTransaction = exports.getTransactionStatus = exports.transferTon = exports.sendTransaction = exports.buildSwapTransaction = exports.getSwapQuote = exports.getSwapManager = exports.signCell = exports.signBinary = exports.signText = exports.registerProvider = exports.transferNft = exports.getNft = exports.getNfts = exports.getNftsByAddress = exports.watchDefaultNetwork = exports.setDefaultNetwork = exports.getDefaultNetwork = exports.getBlockNumber = exports.watchNetworks = exports.getNetwork = exports.getNetworks = exports.transferJetton = exports.createTransferJettonTransaction = exports.getJettons = exports.getJettonsByAddress = exports.getJettonBalance = exports.getJettonWalletAddress = exports.getJettonInfo = exports.watchConnectorById = exports.getConnectorById = exports.watchConnectors = exports.getConnectors = exports.disconnect = exports.connect = exports.addConnector = exports.getBalance = exports.getBalanceByAddress = void 0; | ||
| exports.watchTransactionsByAddress = exports.getTransactionStatus = exports.transferTon = exports.sendTransaction = exports.getStakingProviderInfo = exports.getStakedBalance = exports.buildStakeTransaction = exports.getStakingQuote = exports.getStakingProviders = exports.getStakingManager = exports.buildSwapTransaction = exports.getSwapQuote = exports.getSwapManager = exports.signCell = exports.signBinary = exports.signText = exports.registerProvider = exports.transferNft = exports.getNft = exports.getNfts = exports.getNftsByAddress = exports.hasStreamingProvider = exports.watchDefaultNetwork = exports.setDefaultNetwork = exports.getDefaultNetwork = exports.getBlockNumber = exports.watchNetworks = exports.getApiClient = exports.getNetwork = exports.getNetworks = exports.transferJetton = exports.createTransferJettonTransaction = exports.watchJettons = exports.getJettons = exports.watchJettonsByAddress = exports.getJettonsByAddress = exports.getJettonBalance = exports.getJettonWalletAddress = exports.getJettonInfo = exports.watchConnectorById = exports.getConnectorById = exports.watchConnectors = exports.getConnectors = exports.disconnect = exports.connect = exports.addConnector = exports.watchBalance = exports.getBalance = exports.watchBalanceByAddress = exports.getBalanceByAddress = void 0; | ||
| exports.watchConnectedWallets = exports.watchSelectedWallet = exports.setSelectedWalletId = exports.getSelectedWallet = exports.getConnectedWallets = exports.createTransferTonTransaction = exports.createTransferNftTransaction = exports.watchTransactions = void 0; | ||
| // Balances | ||
| var get_balance_by_address_1 = require("./balances/get-balance-by-address"); | ||
| Object.defineProperty(exports, "getBalanceByAddress", { enumerable: true, get: function () { return get_balance_by_address_1.getBalanceByAddress; } }); | ||
| var watch_balance_by_address_1 = require("./balances/watch-balance-by-address"); | ||
| Object.defineProperty(exports, "watchBalanceByAddress", { enumerable: true, get: function () { return watch_balance_by_address_1.watchBalanceByAddress; } }); | ||
| var get_balance_1 = require("./balances/get-balance"); | ||
| Object.defineProperty(exports, "getBalance", { enumerable: true, get: function () { return get_balance_1.getBalance; } }); | ||
| var watch_balance_1 = require("./balances/watch-balance"); | ||
| Object.defineProperty(exports, "watchBalance", { enumerable: true, get: function () { return watch_balance_1.watchBalance; } }); | ||
| // Connectors | ||
@@ -41,4 +46,8 @@ var add_connector_1 = require("./connectors/add-connector"); | ||
| Object.defineProperty(exports, "getJettonsByAddress", { enumerable: true, get: function () { return get_jettons_by_address_1.getJettonsByAddress; } }); | ||
| var watch_jettons_by_address_1 = require("./jettons/watch-jettons-by-address"); | ||
| Object.defineProperty(exports, "watchJettonsByAddress", { enumerable: true, get: function () { return watch_jettons_by_address_1.watchJettonsByAddress; } }); | ||
| var get_jettons_1 = require("./jettons/get-jettons"); | ||
| Object.defineProperty(exports, "getJettons", { enumerable: true, get: function () { return get_jettons_1.getJettons; } }); | ||
| var watch_jettons_1 = require("./jettons/watch-jettons"); | ||
| Object.defineProperty(exports, "watchJettons", { enumerable: true, get: function () { return watch_jettons_1.watchJettons; } }); | ||
| var create_transfer_jetton_transaction_1 = require("./jettons/create-transfer-jetton-transaction"); | ||
@@ -53,2 +62,4 @@ Object.defineProperty(exports, "createTransferJettonTransaction", { enumerable: true, get: function () { return create_transfer_jetton_transaction_1.createTransferJettonTransaction; } }); | ||
| Object.defineProperty(exports, "getNetwork", { enumerable: true, get: function () { return get_network_1.getNetwork; } }); | ||
| var get_api_client_1 = require("./network/get-api-client"); | ||
| Object.defineProperty(exports, "getApiClient", { enumerable: true, get: function () { return get_api_client_1.getApiClient; } }); | ||
| var watch_networks_1 = require("./network/watch-networks"); | ||
@@ -64,2 +75,4 @@ Object.defineProperty(exports, "watchNetworks", { enumerable: true, get: function () { return watch_networks_1.watchNetworks; } }); | ||
| Object.defineProperty(exports, "watchDefaultNetwork", { enumerable: true, get: function () { return watch_default_network_1.watchDefaultNetwork; } }); | ||
| var has_streaming_provider_1 = require("./network/has-streaming-provider"); | ||
| Object.defineProperty(exports, "hasStreamingProvider", { enumerable: true, get: function () { return has_streaming_provider_1.hasStreamingProvider; } }); | ||
| // NFT | ||
@@ -91,2 +104,15 @@ var get_nfts_by_address_1 = require("./nft/get-nfts-by-address"); | ||
| Object.defineProperty(exports, "buildSwapTransaction", { enumerable: true, get: function () { return build_swap_transaction_1.buildSwapTransaction; } }); | ||
| // Staking | ||
| var get_staking_manager_1 = require("./staking/get-staking-manager"); | ||
| Object.defineProperty(exports, "getStakingManager", { enumerable: true, get: function () { return get_staking_manager_1.getStakingManager; } }); | ||
| var get_staking_providers_1 = require("./staking/get-staking-providers"); | ||
| Object.defineProperty(exports, "getStakingProviders", { enumerable: true, get: function () { return get_staking_providers_1.getStakingProviders; } }); | ||
| var get_staking_quote_1 = require("./staking/get-staking-quote"); | ||
| Object.defineProperty(exports, "getStakingQuote", { enumerable: true, get: function () { return get_staking_quote_1.getStakingQuote; } }); | ||
| var build_stake_transaction_1 = require("./staking/build-stake-transaction"); | ||
| Object.defineProperty(exports, "buildStakeTransaction", { enumerable: true, get: function () { return build_stake_transaction_1.buildStakeTransaction; } }); | ||
| var get_staked_balance_1 = require("./staking/get-staked-balance"); | ||
| Object.defineProperty(exports, "getStakedBalance", { enumerable: true, get: function () { return get_staked_balance_1.getStakedBalance; } }); | ||
| var get_staking_provider_info_1 = require("./staking/get-staking-provider-info"); | ||
| Object.defineProperty(exports, "getStakingProviderInfo", { enumerable: true, get: function () { return get_staking_provider_info_1.getStakingProviderInfo; } }); | ||
| // Transactions | ||
@@ -99,2 +125,6 @@ var send_transaction_1 = require("./transaction/send-transaction"); | ||
| Object.defineProperty(exports, "getTransactionStatus", { enumerable: true, get: function () { return get_transaction_status_1.getTransactionStatus; } }); | ||
| var watch_transactions_by_address_1 = require("./transaction/watch-transactions-by-address"); | ||
| Object.defineProperty(exports, "watchTransactionsByAddress", { enumerable: true, get: function () { return watch_transactions_by_address_1.watchTransactionsByAddress; } }); | ||
| var watch_transactions_1 = require("./transaction/watch-transactions"); | ||
| Object.defineProperty(exports, "watchTransactions", { enumerable: true, get: function () { return watch_transactions_1.watchTransactions; } }); | ||
| var create_transfer_nft_transaction_1 = require("./nft/create-transfer-nft-transaction"); | ||
@@ -101,0 +131,0 @@ Object.defineProperty(exports, "createTransferNftTransaction", { enumerable: true, get: function () { return create_transfer_nft_transaction_1.createTransferNftTransaction; } }); |
@@ -8,5 +8,5 @@ /** | ||
| */ | ||
| import type { Provider } from '../../types/provider'; | ||
| import type { ProviderInput } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type RegisterProviderOptions = Provider; | ||
| export type RegisterProviderOptions = ProviderInput; | ||
| /** | ||
@@ -13,0 +13,0 @@ * Register provider |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"register-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/providers/register-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,UAAU,uBAAuB,KAAG,IAEpF,CAAC"} | ||
| {"version":3,"file":"register-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/providers/register-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,UAAU,uBAAuB,KAAG,IAEpF,CAAC"} |
@@ -10,7 +10,3 @@ /** | ||
| import type { TonConnectUiCreateOptions } from '@tonconnect/ui'; | ||
| import type { Network } from '../../../types/network'; | ||
| import type { Connector, ConnectorMetadata } from '../../../types/connector'; | ||
| import type { WalletInterface } from '../../../types/wallet'; | ||
| import type { AppKitEmitter } from '../../../core/app-kit'; | ||
| import type { AppKitNetworkManager } from '../../../core/network'; | ||
| export interface TonConnectConnectorConfig { | ||
@@ -22,16 +18,7 @@ id?: string; | ||
| } | ||
| export declare class TonConnectConnector implements Connector { | ||
| readonly id: string; | ||
| readonly type = "tonconnect"; | ||
| readonly metadata: ConnectorMetadata; | ||
| readonly tonConnectUI: TonConnectUI; | ||
| private emitter; | ||
| private unsubscribeTonConnect; | ||
| constructor(config: TonConnectConnectorConfig); | ||
| initialize(emitter: AppKitEmitter, networkManager: AppKitNetworkManager): Promise<void>; | ||
| destroy(): void; | ||
| connectWallet(network?: Network): Promise<void>; | ||
| disconnectWallet(): Promise<void>; | ||
| getConnectedWallets(): WalletInterface[]; | ||
| } | ||
| export type TonConnectConnector = Connector & { | ||
| type: 'tonconnect'; | ||
| tonConnectUI: TonConnectUI | null; | ||
| }; | ||
| export declare const createTonConnectConnector: (config: TonConnectConnectorConfig) => import("../../../types/connector").ConnectorFactory; | ||
| //# sourceMappingURL=ton-connect-connector.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ton-connect-connector.d.ts","sourceRoot":"","sources":["../../../../../src/connectors/tonconnect/connectors/ton-connect-connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,MAAM,WAAW,yBAAyB;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,qBAAa,mBAAoB,YAAW,SAAS;IACjD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpC,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,qBAAqB,CAA6B;gBAE9C,MAAM,EAAE,yBAAyB;IAiBvC,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB7F,OAAO,IAAI,IAAI;IAMT,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/C,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvC,mBAAmB,IAAI,eAAe,EAAE;CAe3C"} | ||
| {"version":3,"file":"ton-connect-connector.d.ts","sourceRoot":"","sources":["../../../../../src/connectors/tonconnect/connectors/ton-connect-connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAIhE,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAK7E,MAAM,WAAW,yBAAyB;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC1C,IAAI,EAAE,YAAY,CAAC;IACnB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,QAAQ,yBAAyB,wDAgH1E,CAAC"} |
@@ -10,3 +10,3 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.TonConnectConnector = void 0; | ||
| exports.createTonConnectConnector = void 0; | ||
| const ui_1 = require("@tonconnect/ui"); | ||
@@ -16,64 +16,95 @@ const ton_connect_wallet_adapter_1 = require("../adapters/ton-connect-wallet-adapter"); | ||
| const id_1 = require("../constants/id"); | ||
| class TonConnectConnector { | ||
| constructor(config) { | ||
| this.type = 'tonconnect'; | ||
| this.emitter = null; | ||
| this.unsubscribeTonConnect = null; | ||
| if (config.tonConnectOptions && config.tonConnectUI) { | ||
| // eslint-disable-next-line no-console | ||
| console.warn('TonConnectConnector: both tonConnectOptions and tonConnectUI are provided, using tonConnectUI'); | ||
| } | ||
| this.id = config.id ?? id_1.TONCONNECT_DEFAULT_CONNECTOR_ID; | ||
| this.tonConnectUI = config?.tonConnectUI ?? new ui_1.TonConnectUI(config.tonConnectOptions); | ||
| this.metadata = { | ||
| name: 'TonConnect', | ||
| iconUrl: 'https://avatars.githubusercontent.com/u/113980577', | ||
| ...config.metadata, | ||
| }; | ||
| } | ||
| async initialize(emitter, networkManager) { | ||
| this.emitter = emitter; | ||
| // Subscribe to TonConnect status changes | ||
| this.unsubscribeTonConnect = this.tonConnectUI.onStatusChange((wallet) => { | ||
| const wallets = this.getConnectedWallets(); | ||
| if (wallet) { | ||
| this.emitter?.emit(app_kit_1.CONNECTOR_EVENTS.CONNECTED, { wallets, connectorId: this.id }, this.id); | ||
| const connector_1 = require("../../../types/connector"); | ||
| const createTonConnectConnector = (config) => { | ||
| return (0, connector_1.createConnector)(({ eventEmitter, networkManager, ssr }) => { | ||
| let originalTonConnectUI = null; | ||
| let unsubscribeTonConnect = null; | ||
| const id = config.id ?? id_1.TONCONNECT_DEFAULT_CONNECTOR_ID; | ||
| function getTonConnectUI() { | ||
| if (originalTonConnectUI) { | ||
| return originalTonConnectUI; | ||
| } | ||
| if (ssr && typeof window === 'undefined') { | ||
| return null; | ||
| } | ||
| // check if we have pre-defined UI | ||
| if (config.tonConnectUI) { | ||
| originalTonConnectUI = config.tonConnectUI; | ||
| } | ||
| else { | ||
| this.emitter?.emit(app_kit_1.CONNECTOR_EVENTS.DISCONNECTED, { connectorId: this.id }, this.id); | ||
| originalTonConnectUI = new ui_1.TonConnectUI(config.tonConnectOptions); | ||
| } | ||
| }); | ||
| // Set default network and subscribe to changes | ||
| this.tonConnectUI.setConnectionNetwork(networkManager.getDefaultNetwork()?.chainId); | ||
| this.emitter?.on(app_kit_1.NETWORKS_EVENTS.DEFAULT_CHANGED, ({ payload }) => { | ||
| this.tonConnectUI.setConnectionNetwork(payload.network?.chainId); | ||
| }); | ||
| // Restore existing connection | ||
| await this.tonConnectUI.connector.restoreConnection(); | ||
| } | ||
| destroy() { | ||
| this.unsubscribeTonConnect?.(); | ||
| this.unsubscribeTonConnect = null; | ||
| this.emitter = null; | ||
| } | ||
| async connectWallet(network) { | ||
| this.tonConnectUI.setConnectionNetwork(network?.chainId); | ||
| await this.tonConnectUI.openModal(); | ||
| } | ||
| async disconnectWallet() { | ||
| await this.tonConnectUI.disconnect(); | ||
| } | ||
| getConnectedWallets() { | ||
| if (this.tonConnectUI.connected && this.tonConnectUI.wallet) { | ||
| const wallet = this.tonConnectUI.wallet; | ||
| const walletAdapter = new ton_connect_wallet_adapter_1.TonConnectWalletAdapter({ | ||
| connectorId: this.id, | ||
| tonConnectWallet: wallet, | ||
| tonConnectUI: this.tonConnectUI, | ||
| setupListeners(); | ||
| // restore connection | ||
| if (originalTonConnectUI) { | ||
| originalTonConnectUI.connector.restoreConnection(); | ||
| } | ||
| return originalTonConnectUI; | ||
| } | ||
| function getConnectedWallets() { | ||
| const ui = getTonConnectUI(); | ||
| if (ui && ui.connected && ui.wallet) { | ||
| const wallet = ui.wallet; | ||
| return [ | ||
| new ton_connect_wallet_adapter_1.TonConnectWalletAdapter({ | ||
| connectorId: id, | ||
| tonConnectWallet: wallet, | ||
| tonConnectUI: ui, | ||
| }), | ||
| ]; | ||
| } | ||
| return []; | ||
| } | ||
| function setupListeners() { | ||
| if (!originalTonConnectUI || unsubscribeTonConnect) { | ||
| return; | ||
| } | ||
| unsubscribeTonConnect = originalTonConnectUI.onStatusChange((wallet) => { | ||
| const wallets = getConnectedWallets(); | ||
| if (wallet) { | ||
| eventEmitter.emit(app_kit_1.CONNECTOR_EVENTS.CONNECTED, { wallets, connectorId: id }, id); | ||
| } | ||
| else { | ||
| eventEmitter.emit(app_kit_1.CONNECTOR_EVENTS.DISCONNECTED, { connectorId: id }, id); | ||
| } | ||
| }); | ||
| return [walletAdapter]; | ||
| // Set default network and subscribe to changes | ||
| originalTonConnectUI.setConnectionNetwork(networkManager.getDefaultNetwork()?.chainId); | ||
| eventEmitter.on(app_kit_1.NETWORKS_EVENTS.DEFAULT_CHANGED, ({ payload }) => { | ||
| if (originalTonConnectUI) { | ||
| originalTonConnectUI.setConnectionNetwork(payload.network?.chainId); | ||
| } | ||
| }); | ||
| } | ||
| return []; | ||
| } | ||
| } | ||
| exports.TonConnectConnector = TonConnectConnector; | ||
| return { | ||
| id, | ||
| type: 'tonconnect', | ||
| metadata: { | ||
| name: 'TonConnect', | ||
| iconUrl: 'https://avatars.githubusercontent.com/u/113980577', | ||
| ...config.metadata, | ||
| }, | ||
| get tonConnectUI() { | ||
| return getTonConnectUI(); | ||
| }, | ||
| getConnectedWallets, | ||
| async connectWallet() { | ||
| const ui = getTonConnectUI(); | ||
| if (ui) { | ||
| await ui.openModal(); | ||
| } | ||
| }, | ||
| async disconnectWallet() { | ||
| const ui = getTonConnectUI(); | ||
| if (ui) { | ||
| await ui.disconnect(); | ||
| } | ||
| }, | ||
| destroy() { | ||
| unsubscribeTonConnect?.(); | ||
| originalTonConnectUI = null; | ||
| }, | ||
| }; | ||
| }); | ||
| }; | ||
| exports.createTonConnectConnector = createTonConnectConnector; |
@@ -24,5 +24,4 @@ /** | ||
| export type { TonConnectWalletAdapterConfig } from './adapters/ton-connect-wallet-adapter'; | ||
| export { TonConnectConnector } from './connectors/ton-connect-connector'; | ||
| export { createTonConnectConnector, type TonConnectConnectorConfig, type TonConnectConnector, } from './connectors/ton-connect-connector'; | ||
| export { TONCONNECT_DEFAULT_CONNECTOR_ID } from './constants/id'; | ||
| export type { TonConnectConnectorConfig } from './connectors/ton-connect-connector'; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/connectors/tonconnect/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,YAAY,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAG3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/connectors/tonconnect/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,YAAY,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAG3F,OAAO,EACH,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,GAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC"} |
@@ -10,3 +10,3 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.TONCONNECT_DEFAULT_CONNECTOR_ID = exports.TonConnectConnector = exports.TonConnectWalletAdapter = void 0; | ||
| exports.TONCONNECT_DEFAULT_CONNECTOR_ID = exports.createTonConnectConnector = exports.TonConnectWalletAdapter = void 0; | ||
| /** | ||
@@ -31,4 +31,4 @@ * TonConnect Feature Entry Point | ||
| var ton_connect_connector_1 = require("./connectors/ton-connect-connector"); | ||
| Object.defineProperty(exports, "TonConnectConnector", { enumerable: true, get: function () { return ton_connect_connector_1.TonConnectConnector; } }); | ||
| Object.defineProperty(exports, "createTonConnectConnector", { enumerable: true, get: function () { return ton_connect_connector_1.createTonConnectConnector; } }); | ||
| var id_1 = require("./constants/id"); | ||
| Object.defineProperty(exports, "TONCONNECT_DEFAULT_CONNECTOR_ID", { enumerable: true, get: function () { return id_1.TONCONNECT_DEFAULT_CONNECTOR_ID; } }); |
@@ -8,9 +8,10 @@ /** | ||
| */ | ||
| import { SwapManager } from '@ton/walletkit'; | ||
| import type { Provider } from 'src/types/provider'; | ||
| import type { AppKitConfig } from '../types/config'; | ||
| import type { Connector } from '../../../types/connector'; | ||
| import { SwapManager, StreamingManager } from '@ton/walletkit'; | ||
| import type { ProviderInput } from '@ton/walletkit'; | ||
| import { StakingManager } from '../../../staking'; | ||
| import type { Connector, ConnectorFactoryContext, ConnectorInput } from '../../../types/connector'; | ||
| import type { AppKitEmitter } from '../types/events'; | ||
| import { WalletsManager } from '../../wallets-manager'; | ||
| import { AppKitNetworkManager } from '../../network'; | ||
| import type { AppKitConfig } from '../types/config'; | ||
| /** | ||
@@ -25,9 +26,12 @@ * Central hub for wallet management. | ||
| readonly swapManager: SwapManager; | ||
| readonly stakingManager: StakingManager; | ||
| readonly networkManager: AppKitNetworkManager; | ||
| readonly streamingManager: StreamingManager; | ||
| readonly config: AppKitConfig; | ||
| constructor(config: AppKitConfig); | ||
| createFactoryContext(): ConnectorFactoryContext; | ||
| /** | ||
| * Add a wallet connector | ||
| */ | ||
| addConnector(connector: Connector): () => void; | ||
| addConnector(input: ConnectorInput): () => void; | ||
| /** | ||
@@ -40,3 +44,3 @@ * Remove a wallet connector | ||
| */ | ||
| registerProvider(provider: Provider): void; | ||
| registerProvider(input: ProviderInput): void; | ||
| /** | ||
@@ -43,0 +47,0 @@ * Get all connected wallets from all connectors |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"app-kit.d.ts","sourceRoot":"","sources":["../../../../../src/core/app-kit/services/app-kit.ts"],"names":[],"m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Ac,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAGnG,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;GAGG;AACH,qBAAa,MAAM;IACf,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,EAAE,CAAM;IACtC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAExC,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;gBAElB,MAAM,EAAE,YAAY;IAgChC,oBAAoB,IAAI,uBAAuB;IAI/C;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,IAAI;IAgB/C;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAU3C;;OAEG;IACH,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAc5C;;OAEG;IACH,OAAO,CAAC,2BAA2B;CAWtC"} |
@@ -12,2 +12,3 @@ "use strict"; | ||
| const walletkit_1 = require("@ton/walletkit"); | ||
| const staking_1 = require("../../../staking"); | ||
| const emitter_1 = require("../../emitter"); | ||
@@ -26,3 +27,3 @@ const events_1 = require("../constants/events"); | ||
| this.config = config; | ||
| this.emitter = new emitter_1.Emitter(); | ||
| this.emitter = new emitter_1.EventEmitter(); | ||
| this.emitter.on(events_1.CONNECTOR_EVENTS.CONNECTED, this.updateWalletsFromConnectors.bind(this)); | ||
@@ -36,18 +37,24 @@ this.emitter.on(events_1.CONNECTOR_EVENTS.DISCONNECTED, this.updateWalletsFromConnectors.bind(this)); | ||
| this.walletsManager = new wallets_manager_1.WalletsManager(this.emitter); | ||
| this.swapManager = new walletkit_1.SwapManager(); | ||
| this.swapManager = new walletkit_1.SwapManager(() => this.createFactoryContext()); | ||
| this.stakingManager = new staking_1.StakingManager(() => this.createFactoryContext()); | ||
| this.streamingManager = new walletkit_1.StreamingManager(() => this.createFactoryContext()); | ||
| if (config.connectors) { | ||
| config.connectors.forEach((connector) => { | ||
| this.addConnector(connector); | ||
| config.connectors.forEach((input) => { | ||
| this.addConnector(input); | ||
| }); | ||
| } | ||
| if (config.providers) { | ||
| config.providers.forEach((provider) => { | ||
| this.registerProvider(provider); | ||
| config.providers.forEach((input) => { | ||
| this.registerProvider(input); | ||
| }); | ||
| } | ||
| } | ||
| createFactoryContext() { | ||
| return { eventEmitter: this.emitter, networkManager: this.networkManager, ssr: this.config?.ssr }; | ||
| } | ||
| /** | ||
| * Add a wallet connector | ||
| */ | ||
| addConnector(connector) { | ||
| addConnector(input) { | ||
| const connector = typeof input === 'function' ? input(this.createFactoryContext()) : input; | ||
| const id = connector.id; | ||
@@ -59,3 +66,2 @@ const oldConnector = this.connectors.find((c) => c.id === id); | ||
| this.connectors.push(connector); | ||
| connector.initialize(this.emitter, this.networkManager); | ||
| return () => { | ||
@@ -79,3 +85,4 @@ this.removeConnector(connector); | ||
| */ | ||
| registerProvider(provider) { | ||
| registerProvider(input) { | ||
| const provider = typeof input === 'function' ? input(this.createFactoryContext()) : input; | ||
| switch (provider.type) { | ||
@@ -85,2 +92,5 @@ case 'swap': | ||
| break; | ||
| case 'staking': | ||
| this.stakingManager.registerProvider(provider); | ||
| break; | ||
| default: | ||
@@ -87,0 +97,0 @@ throw new Error('Unknown provider type'); |
@@ -8,5 +8,4 @@ /** | ||
| */ | ||
| import type { NetworkAdapters } from '@ton/walletkit'; | ||
| import type { Connector } from '../../../types/connector'; | ||
| import type { Provider } from '../../../types/provider'; | ||
| import type { NetworkAdapters, ProviderInput } from '@ton/walletkit'; | ||
| import type { ConnectorInput } from '../../../types/connector'; | ||
| import type { Network } from '../../../types/network'; | ||
@@ -26,2 +25,6 @@ /** | ||
| /** | ||
| * Wallet connectors | ||
| */ | ||
| connectors?: ConnectorInput[]; | ||
| /** | ||
| * Default network for wallet connections. | ||
@@ -32,5 +35,8 @@ * If set, connectors (e.g. TonConnect) will enforce this network when connecting. | ||
| defaultNetwork?: Network; | ||
| connectors?: Connector[]; | ||
| providers?: Provider[]; | ||
| providers?: ProviderInput[]; | ||
| /** | ||
| * Enable server-side rendering support | ||
| */ | ||
| ssr?: boolean; | ||
| } | ||
| //# sourceMappingURL=config.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/core/app-kit/types/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CAC1B"} | ||
| {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/core/app-kit/types/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAE9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAE5B;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACjB"} |
@@ -8,5 +8,6 @@ /** | ||
| */ | ||
| import type { SharedKitEvents } from '../../emitter'; | ||
| import type { CONNECTOR_EVENTS, WALLETS_EVENTS, PLUGIN_EVENTS, NETWORKS_EVENTS } from '../constants/events'; | ||
| import type { Network } from '../../../types/network'; | ||
| import type { Emitter } from '../../emitter'; | ||
| import type { CONNECTOR_EVENTS, WALLETS_EVENTS, PLUGIN_EVENTS, NETWORKS_EVENTS } from '../constants/events'; | ||
| import type { EventEmitter } from '../../emitter'; | ||
| import type { WalletInterface } from '../../../types/wallet'; | ||
@@ -27,3 +28,3 @@ export interface WalletConnectedPayload { | ||
| } | ||
| export interface AppKitEvents { | ||
| export type AppKitEvents = { | ||
| [CONNECTOR_EVENTS.CONNECTED]: WalletConnectedPayload; | ||
@@ -40,4 +41,4 @@ [CONNECTOR_EVENTS.DISCONNECTED]: WalletDisconnectedPayload; | ||
| [PLUGIN_EVENTS.REGISTERED]: PluginRegisteredPayload; | ||
| } | ||
| export type AppKitEmitter = Emitter<AppKitEvents>; | ||
| } & SharedKitEvents; | ||
| export type AppKitEmitter = EventEmitter<AppKitEvents>; | ||
| //# sourceMappingURL=events.d.ts.map |
@@ -1,1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AC,CAAC;IACjD,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,4BAA4B,CAAC;IAGhE,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACvD,GAAG,eAAe,CAAC;AAEpB,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC"} |
@@ -12,4 +12,4 @@ /** | ||
| */ | ||
| export { Emitter } from './services/emitter'; | ||
| export type { EventPayload, AppKitEvent, EventListener } from './types/events'; | ||
| export { EventEmitter } from '@ton/walletkit'; | ||
| export type { EventPayload, KitEvent, EventListener, SharedKitEvents } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/emitter/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/emitter/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"} |
@@ -10,3 +10,3 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Emitter = void 0; | ||
| exports.EventEmitter = void 0; | ||
| /** | ||
@@ -16,3 +16,3 @@ * Events Feature | ||
| */ | ||
| var emitter_1 = require("./services/emitter"); | ||
| Object.defineProperty(exports, "Emitter", { enumerable: true, get: function () { return emitter_1.Emitter; } }); | ||
| var walletkit_1 = require("@ton/walletkit"); | ||
| Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function () { return walletkit_1.EventEmitter; } }); |
@@ -29,4 +29,6 @@ /** | ||
| export * from './core/network'; | ||
| export * from './core/streaming'; | ||
| export * from './connectors/tonconnect'; | ||
| export * from './swap'; | ||
| export * from './staking'; | ||
| export * from './actions'; | ||
@@ -33,0 +35,0 @@ export * from './types/connector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAGH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AAExC,cAAc,QAAQ,CAAC;AAGvB,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,SAAS,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAGH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AAExC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,SAAS,CAAC"} |
@@ -46,4 +46,6 @@ "use strict"; | ||
| __exportStar(require("./core/network"), exports); | ||
| __exportStar(require("./core/streaming"), exports); | ||
| __exportStar(require("./connectors/tonconnect"), exports); | ||
| __exportStar(require("./swap"), exports); | ||
| __exportStar(require("./staking"), exports); | ||
| // Actions | ||
@@ -50,0 +52,0 @@ __exportStar(require("./actions"), exports); |
@@ -8,2 +8,3 @@ /** | ||
| */ | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -14,6 +15,8 @@ import type { GetBalanceByAddressOptions } from '../../actions/balances/get-balance-by-address'; | ||
| import type { GetBalanceByAddressReturnType } from '../../actions/balances/get-balance-by-address'; | ||
| import type { BalanceUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
| export type GetBalanceErrorType = Error; | ||
| export type GetBalanceByAddressData = GetBalanceQueryFnData; | ||
| export type GetBalanceByAddressQueryConfig<selectData = GetBalanceByAddressData> = Compute<ExactPartial<GetBalanceByAddressOptions>> & QueryParameter<GetBalanceQueryFnData, GetBalanceErrorType, selectData, GetBalanceByAddressQueryKey>; | ||
| export declare const getBalanceByAddressQueryOptions: <selectData = GetBalanceByAddressData>(appKit: AppKit, options?: GetBalanceByAddressQueryConfig<selectData>) => GetBalanceByAddressQueryOptions<selectData>; | ||
| export declare const getBalanceByAddressQueryOptions: <selectData = GetBalanceByAddressData>(appKit: AppKit, initialOptions?: GetBalanceByAddressQueryConfig<selectData>) => GetBalanceByAddressQueryOptions<selectData>; | ||
| export type GetBalanceQueryFnData = Compute<Awaited<GetBalanceByAddressReturnType>>; | ||
@@ -23,2 +26,9 @@ export declare const getBalanceByAddressQueryKey: (options?: Compute<ExactPartial<GetBalanceByAddressOptions>>) => GetBalanceByAddressQueryKey; | ||
| export type GetBalanceByAddressQueryOptions<selectData = GetBalanceByAddressData> = QueryOptions<GetBalanceQueryFnData, GetBalanceErrorType, selectData, GetBalanceByAddressQueryKey>; | ||
| /** | ||
| * Update the TanStack Query cache for an address balance. | ||
| */ | ||
| export declare const handleBalanceUpdate: (queryClient: QueryClient, { address, network }: { | ||
| address: string; | ||
| network: Network; | ||
| }, update: BalanceUpdate) => void; | ||
| //# sourceMappingURL=get-balance-by-address.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/balances/get-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAEnG,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D,MAAM,MAAM,8BAA8B,CAAC,UAAU,GAAG,uBAAuB,IAAI,OAAO,CACtF,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;AAExG,eAAO,MAAM,+BAA+B,GAAI,UAAU,GAAG,uBAAuB,EAChF,QAAQ,MAAM,EACd,UAAS,8BAA8B,CAAC,UAAU,CAAM,KACzD,+BAA+B,CAAC,UAAU,CAY5C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,2BAA2B,GACpC,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,2BAEF,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,uBAAuB,IAAI,YAAY,CAC5F,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,2BAA2B,CAC9B,CAAC"} | ||
| {"version":3,"file":"get-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/balances/get-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AACnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D,MAAM,MAAM,8BAA8B,CAAC,UAAU,GAAG,uBAAuB,IAAI,OAAO,CACtF,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;AAExG,eAAO,MAAM,+BAA+B,GAAI,UAAU,GAAG,uBAAuB,EAChF,QAAQ,MAAM,EACd,iBAAgB,8BAA8B,CAAC,UAAU,CAAM,KAChE,+BAA+B,CAAC,UAAU,CAe5C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,2BAA2B,GACpC,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,2BAEF,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,uBAAuB,IAAI,YAAY,CAC5F,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,2BAA2B,CAC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC5B,aAAa,WAAW,EACxB,sBAAsB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC3D,QAAQ,aAAa,SAYxB,CAAC"} |
@@ -10,6 +10,8 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getBalanceByAddressQueryKey = exports.getBalanceByAddressQueryOptions = void 0; | ||
| exports.handleBalanceUpdate = exports.getBalanceByAddressQueryKey = exports.getBalanceByAddressQueryOptions = void 0; | ||
| const get_balance_by_address_1 = require("../../actions/balances/get-balance-by-address"); | ||
| const utils_1 = require("../../utils"); | ||
| const getBalanceByAddressQueryOptions = (appKit, options = {}) => { | ||
| const getBalanceByAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -33,1 +35,16 @@ ...options.query, | ||
| exports.getBalanceByAddressQueryKey = getBalanceByAddressQueryKey; | ||
| /** | ||
| * Update the TanStack Query cache for an address balance. | ||
| */ | ||
| const handleBalanceUpdate = (queryClient, { address, network }, update) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = (0, exports.getBalanceByAddressQueryKey)({ address, network }); | ||
| queryClient.setQueryData(queryKey, update.balance); | ||
| (0, utils_1.sleep)(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = (0, exports.getBalanceByAddressQueryKey)({ address, network }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; | ||
| exports.handleBalanceUpdate = handleBalanceUpdate; |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export { getBalanceByAddressQueryOptions, type GetBalanceByAddressData, type GetBalanceErrorType, type GetBalanceByAddressQueryConfig, } from './balances/get-balance-by-address'; | ||
| export { getBalanceByAddressQueryOptions, handleBalanceUpdate, type GetBalanceByAddressData, type GetBalanceErrorType, type GetBalanceByAddressQueryConfig, } from './balances/get-balance-by-address'; | ||
| export { connectMutationOptions, type ConnectMutationOptions, type ConnectParameters, type ConnectReturnType, type ConnectData, type ConnectErrorType, type ConnectOptions, type ConnectVariables, } from './connectors/connect'; | ||
@@ -14,4 +14,4 @@ export { disconnectMutationOptions, type DisconnectMutationOptions, type DisconnectParameters, type DisconnectReturnType, type DisconnectData, type DisconnectErrorType, type DisconnectOptions, type DisconnectVariables, } from './connectors/disconnect'; | ||
| export { getJettonWalletAddressQueryOptions, type GetJettonWalletAddressQueryConfig, type GetJettonWalletAddressData, type GetJettonWalletAddressErrorType, } from './jettons/get-jetton-wallet-address'; | ||
| export { getJettonBalanceByAddressQueryOptions, type GetJettonBalanceByAddressQueryConfig, type GetJettonBalanceByAddressData, type GetJettonBalanceErrorType, } from './jettons/get-jetton-balance-by-address'; | ||
| export { getJettonsByAddressQueryOptions, type GetJettonsByAddressData, type GetJettonsErrorType, type GetJettonsByAddressQueryConfig, } from './jettons/get-jettons-by-address'; | ||
| export { getJettonBalanceByAddressQueryOptions, handleJettonBalanceUpdate, type GetJettonBalanceByAddressQueryConfig, type GetJettonBalanceByAddressData, type GetJettonBalanceErrorType, } from './jettons/get-jetton-balance-by-address'; | ||
| export { getJettonsByAddressQueryOptions, handleJettonsUpdate, type GetJettonsByAddressData, type GetJettonsErrorType, type GetJettonsByAddressQueryConfig, } from './jettons/get-jettons-by-address'; | ||
| export { transferJettonMutationOptions, type TransferJettonData, type TransferJettonErrorType, type TransferJettonMutate, type TransferJettonMutateAsync, type TransferJettonMutationOptions, type TransferJettonOptions, type TransferJettonVariables, type TransferJettonParameters, type TransferJettonReturnType, } from './jettons/transfer-jetton'; | ||
@@ -27,2 +27,7 @@ export { getBlockNumberQueryOptions, type GetBlockNumberData, type GetBlockNumberErrorType, type GetBlockNumberQueryConfig, } from './network/get-block-number'; | ||
| export { buildSwapTransactionMutationOptions, type BuildSwapTransactionMutationConfig, type BuildSwapTransactionMutationOptions, type BuildSwapTransactionData, type BuildSwapTransactionErrorType, type BuildSwapTransactionMutate, type BuildSwapTransactionMutateAsync, type BuildSwapTransactionVariables, } from './swap/build-swap-transaction'; | ||
| export { getStakingProvidersQueryOptions, type GetStakingProvidersData, type GetStakingProvidersErrorType, type GetStakingProvidersQueryConfig, } from './staking/get-staking-providers'; | ||
| export { getStakingQuoteQueryOptions, type GetStakingQuoteQueryConfig, type GetStakingQuoteQueryOptions, type GetStakingQuoteData, type GetStakingQuoteErrorType, type GetStakingQuoteQueryFnData, type GetStakingQuoteQueryKey, } from './staking/get-staking-quote'; | ||
| export { getStakedBalanceQueryOptions, type GetStakedBalanceQueryConfig, type GetStakedBalanceData, type GetStakedBalanceErrorType, } from './staking/get-staked-balance'; | ||
| export { getStakingProviderInfoQueryOptions, type GetStakingProviderInfoQueryConfig, type GetStakingProviderInfoData, type GetStakingProviderInfoErrorType, } from './staking/get-staking-provider-info'; | ||
| export { buildStakeTransactionMutationOptions, type BuildStakeTransactionData, type BuildStakeTransactionErrorType, type BuildStakeTransactionMutationOptions, type BuildStakeTransactionVariables, } from './staking/build-stake-transaction'; | ||
| export { transferTonMutationOptions, type TransferTonData, type TransferTonErrorType, type TransferTonMutate, type TransferTonMutateAsync, type TransferTonMutationOptions, type TransferTonOptions, type TransferTonVariables, type TransferTonParameters, type TransferTonReturnType, } from './transaction/transfer-ton'; | ||
@@ -29,0 +34,0 @@ export { sendTransactionMutationOptions, type SendTransactionData, type SendTransactionErrorType, type SendTransactionMutate, type SendTransactionMutateAsync, type SendTransactionMutationOptions, type SendTransactionOptions, type SendTransactionVariables, type SendTransactionParameters, type SendTransactionReturnType, } from './transaction/send-transaction'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,+BAA+B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACtC,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACH,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GAC3B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACH,yBAAyB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB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4B,CAAC;AACpC,OAAO,EACH,8BAA8B,EAC9B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,GACxC,MAAM,sCAAsC,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,+BAA+B,EAC/B,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACtC,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACH,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GAC3B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACH,yBAAyB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,kCAAkC,EAClC,KAAK,iCAAiC,EACtC,KAAK,0BAA0B,EAC/B,KA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B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,kCAAkC,EAClC,KAAK,iCAAiC,EACtC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,GACvC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACH,oCAAoC,EACpC,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,oCAAoC,EACzC,KAAK,8BAA8B,GACtC,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACH,0BAA0B,EAC1B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,8BAA8B,EAC9B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,GACxC,MAAM,sCAAsC,CAAC"} |
@@ -10,6 +10,7 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getTransactionStatusQueryOptions = exports.sendTransactionMutationOptions = exports.transferTonMutationOptions = exports.buildSwapTransactionMutationOptions = exports.getSwapQuoteQueryOptions = exports.signCellMutationOptions = exports.signBinaryMutationOptions = exports.signTextMutationOptions = exports.transferNftMutationOptions = exports.getNftQueryOptions = exports.getNFTsQueryOptions = exports.getBlockNumberQueryOptions = exports.transferJettonMutationOptions = exports.getJettonsByAddressQueryOptions = exports.getJettonBalanceByAddressQueryOptions = exports.getJettonWalletAddressQueryOptions = exports.getJettonInfoQueryOptions = exports.disconnectMutationOptions = exports.connectMutationOptions = exports.getBalanceByAddressQueryOptions = void 0; | ||
| exports.getTransactionStatusQueryOptions = exports.sendTransactionMutationOptions = exports.transferTonMutationOptions = exports.buildStakeTransactionMutationOptions = exports.getStakingProviderInfoQueryOptions = exports.getStakedBalanceQueryOptions = exports.getStakingQuoteQueryOptions = exports.getStakingProvidersQueryOptions = exports.buildSwapTransactionMutationOptions = exports.getSwapQuoteQueryOptions = exports.signCellMutationOptions = exports.signBinaryMutationOptions = exports.signTextMutationOptions = exports.transferNftMutationOptions = exports.getNftQueryOptions = exports.getNFTsQueryOptions = exports.getBlockNumberQueryOptions = exports.transferJettonMutationOptions = exports.handleJettonsUpdate = exports.getJettonsByAddressQueryOptions = exports.handleJettonBalanceUpdate = exports.getJettonBalanceByAddressQueryOptions = exports.getJettonWalletAddressQueryOptions = exports.getJettonInfoQueryOptions = exports.disconnectMutationOptions = exports.connectMutationOptions = exports.handleBalanceUpdate = exports.getBalanceByAddressQueryOptions = void 0; | ||
| // Balances | ||
| var get_balance_by_address_1 = require("./balances/get-balance-by-address"); | ||
| Object.defineProperty(exports, "getBalanceByAddressQueryOptions", { enumerable: true, get: function () { return get_balance_by_address_1.getBalanceByAddressQueryOptions; } }); | ||
| Object.defineProperty(exports, "handleBalanceUpdate", { enumerable: true, get: function () { return get_balance_by_address_1.handleBalanceUpdate; } }); | ||
| // Connectors | ||
@@ -27,4 +28,6 @@ var connect_1 = require("./connectors/connect"); | ||
| Object.defineProperty(exports, "getJettonBalanceByAddressQueryOptions", { enumerable: true, get: function () { return get_jetton_balance_by_address_1.getJettonBalanceByAddressQueryOptions; } }); | ||
| Object.defineProperty(exports, "handleJettonBalanceUpdate", { enumerable: true, get: function () { return get_jetton_balance_by_address_1.handleJettonBalanceUpdate; } }); | ||
| var get_jettons_by_address_1 = require("./jettons/get-jettons-by-address"); | ||
| Object.defineProperty(exports, "getJettonsByAddressQueryOptions", { enumerable: true, get: function () { return get_jettons_by_address_1.getJettonsByAddressQueryOptions; } }); | ||
| Object.defineProperty(exports, "handleJettonsUpdate", { enumerable: true, get: function () { return get_jettons_by_address_1.handleJettonsUpdate; } }); | ||
| var transfer_jetton_1 = require("./jettons/transfer-jetton"); | ||
@@ -54,2 +57,13 @@ Object.defineProperty(exports, "transferJettonMutationOptions", { enumerable: true, get: function () { return transfer_jetton_1.transferJettonMutationOptions; } }); | ||
| Object.defineProperty(exports, "buildSwapTransactionMutationOptions", { enumerable: true, get: function () { return build_swap_transaction_1.buildSwapTransactionMutationOptions; } }); | ||
| // Staking | ||
| var get_staking_providers_1 = require("./staking/get-staking-providers"); | ||
| Object.defineProperty(exports, "getStakingProvidersQueryOptions", { enumerable: true, get: function () { return get_staking_providers_1.getStakingProvidersQueryOptions; } }); | ||
| var get_staking_quote_1 = require("./staking/get-staking-quote"); | ||
| Object.defineProperty(exports, "getStakingQuoteQueryOptions", { enumerable: true, get: function () { return get_staking_quote_1.getStakingQuoteQueryOptions; } }); | ||
| var get_staked_balance_1 = require("./staking/get-staked-balance"); | ||
| Object.defineProperty(exports, "getStakedBalanceQueryOptions", { enumerable: true, get: function () { return get_staked_balance_1.getStakedBalanceQueryOptions; } }); | ||
| var get_staking_provider_info_1 = require("./staking/get-staking-provider-info"); | ||
| Object.defineProperty(exports, "getStakingProviderInfoQueryOptions", { enumerable: true, get: function () { return get_staking_provider_info_1.getStakingProviderInfoQueryOptions; } }); | ||
| var build_stake_transaction_1 = require("./staking/build-stake-transaction"); | ||
| Object.defineProperty(exports, "buildStakeTransactionMutationOptions", { enumerable: true, get: function () { return build_stake_transaction_1.buildStakeTransactionMutationOptions; } }); | ||
| // Transaction | ||
@@ -56,0 +70,0 @@ var transfer_ton_1 = require("./transaction/transfer-ton"); |
@@ -8,2 +8,3 @@ /** | ||
| */ | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { TokenAmount } from '@ton/walletkit'; | ||
@@ -14,6 +15,8 @@ import type { AppKit } from '../../core/app-kit'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import type { JettonUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
| export type GetJettonBalanceErrorType = Error; | ||
| export type GetJettonBalanceByAddressData = GetJettonBalanceQueryFnData; | ||
| export type GetJettonBalanceByAddressQueryConfig<selectData = GetJettonBalanceByAddressData> = Compute<ExactPartial<GetJettonBalanceParameters>> & QueryParameter<GetJettonBalanceQueryFnData, GetJettonBalanceErrorType, selectData, GetJettonBalanceByAddressQueryKey>; | ||
| export declare const getJettonBalanceByAddressQueryOptions: <selectData = GetJettonBalanceByAddressData>(appKit: AppKit, options?: GetJettonBalanceByAddressQueryConfig<selectData>) => GetJettonBalanceByAddressQueryOptions<selectData>; | ||
| export declare const getJettonBalanceByAddressQueryOptions: <selectData = GetJettonBalanceByAddressData>(appKit: AppKit, initialOptions?: GetJettonBalanceByAddressQueryConfig<selectData>) => GetJettonBalanceByAddressQueryOptions<selectData>; | ||
| export type GetJettonBalanceQueryFnData = Compute<TokenAmount>; | ||
@@ -26,2 +29,10 @@ export declare const getJettonBalanceByAddressQueryKey: (options?: Compute<ExactPartial<GetJettonBalanceParameters>>) => GetJettonBalanceByAddressQueryKey; | ||
| export type GetJettonBalanceByAddressQueryOptions<selectData = GetJettonBalanceByAddressData> = QueryOptions<GetJettonBalanceQueryFnData, GetJettonBalanceErrorType, selectData, GetJettonBalanceByAddressQueryKey>; | ||
| /** | ||
| * Update the TanStack Query cache for an owner jetton balance. | ||
| */ | ||
| export declare const handleJettonBalanceUpdate: (queryClient: QueryClient, { ownerAddress, jettonAddress, network }: { | ||
| ownerAddress: string; | ||
| jettonAddress: string; | ||
| network: Network; | ||
| }, update: JettonUpdate) => void; | ||
| //# sourceMappingURL=get-jetton-balance-by-address.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-jetton-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,uBAAuB,IAAI,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE9C,MAAM,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAExE,MAAM,MAAM,oCAAoC,CAAC,UAAU,GAAG,6BAA6B,IAAI,OAAO,CAClG,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CACV,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC,CAAC;AAEN,eAAO,MAAM,qCAAqC,GAAI,UAAU,GAAG,6BAA6B,EAC5F,QAAQ,MAAM,EACd,UAAS,oCAAoC,CAAC,UAAU,CAAM,KAC/D,qCAAqC,CAAC,UAAU,CAclD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE/D,eAAO,MAAM,iCAAiC,GAC1C,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,iCAEF,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,SAAS;IACrD,gBAAgB;IAChB,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,qCAAqC,CAAC,UAAU,GAAG,6BAA6B,IAAI,YAAY,CACxG,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC,CAAC"} | ||
| {"version":3,"file":"get-jetton-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,uBAAuB,IAAI,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE9C,MAAM,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAExE,MAAM,MAAM,oCAAoC,CAAC,UAAU,GAAG,6BAA6B,IAAI,OAAO,CAClG,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CACV,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC,CAAC;AAEN,eAAO,MAAM,qCAAqC,GAAI,UAAU,GAAG,6BAA6B,EAC5F,QAAQ,MAAM,EACd,iBAAgB,oCAAoC,CAAC,UAAU,CAAM,KACtE,qCAAqC,CAAC,UAAU,CAiBlD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE/D,eAAO,MAAM,iCAAiC,GAC1C,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,iCAEF,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,SAAS;IACrD,gBAAgB;IAChB,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,qCAAqC,CAAC,UAAU,GAAG,6BAA6B,IAAI,YAAY,CACxG,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAClC,aAAa,WAAW,EACxB,0CAA0C;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC3G,QAAQ,YAAY,SAoBvB,CAAC"} |
@@ -10,6 +10,8 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getJettonBalanceByAddressQueryKey = exports.getJettonBalanceByAddressQueryOptions = void 0; | ||
| exports.handleJettonBalanceUpdate = exports.getJettonBalanceByAddressQueryKey = exports.getJettonBalanceByAddressQueryOptions = void 0; | ||
| const get_jetton_balance_1 = require("../../actions/jettons/get-jetton-balance"); | ||
| const utils_1 = require("../../utils"); | ||
| const getJettonBalanceByAddressQueryOptions = (appKit, options = {}) => { | ||
| const getJettonBalanceByAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -35,1 +37,24 @@ ...options.query, | ||
| exports.getJettonBalanceByAddressQueryKey = getJettonBalanceByAddressQueryKey; | ||
| /** | ||
| * Update the TanStack Query cache for an owner jetton balance. | ||
| */ | ||
| const handleJettonBalanceUpdate = (queryClient, { ownerAddress, jettonAddress, network }, update) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = (0, exports.getJettonBalanceByAddressQueryKey)({ | ||
| ownerAddress, | ||
| jettonAddress, | ||
| network, | ||
| }); | ||
| queryClient.setQueryData(queryKey, update.balance); | ||
| (0, utils_1.sleep)(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = (0, exports.getJettonBalanceByAddressQueryKey)({ | ||
| ownerAddress, | ||
| jettonAddress, | ||
| network, | ||
| }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; | ||
| exports.handleJettonBalanceUpdate = handleJettonBalanceUpdate; |
@@ -15,3 +15,3 @@ /** | ||
| export type GetJettonInfoQueryConfig<selectData = GetJettonInfoData> = Compute<ExactPartial<GetJettonInfoOptions>> & QueryParameter<GetJettonInfoQueryFnData, GetJettonInfoErrorType, selectData, GetJettonInfoQueryKey>; | ||
| export declare const getJettonInfoQueryOptions: <selectData = GetJettonInfoData>(appKit: AppKit, options?: GetJettonInfoQueryConfig<selectData>) => GetJettonInfoQueryOptions<selectData>; | ||
| export declare const getJettonInfoQueryOptions: <selectData = GetJettonInfoData>(appKit: AppKit, initialOptions?: GetJettonInfoQueryConfig<selectData>) => GetJettonInfoQueryOptions<selectData>; | ||
| export type GetJettonInfoQueryFnData = Compute<Awaited<GetJettonInfoReturnType>>; | ||
@@ -18,0 +18,0 @@ export type GetJettonInfoData = GetJettonInfoQueryFnData; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-jetton-info.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-info.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mB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rF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAE3C,MAAM,MAAM,wBAAwB,CAAC,UAAU,GAAG,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,GAC9G,cAAc,CAAC,wBAAwB,EAAE,sBAAsB,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC;AAExG,eAAO,MAAM,yBAAyB,GAAI,UAAU,GAAG,iBAAiB,EACpE,QAAQ,MAAM,EACd,iBAAgB,wBAAwB,CAAC,UAAU,CAAM,KAC1D,yBAAyB,CAAC,UAAU,CAgBtC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAEjF,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEzD,eAAO,MAAM,qBAAqB,GAC9B,UAAS,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAM,KAC1D,qBAEF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAE1G,MAAM,MAAM,yBAAyB,CAAC,UAAU,GAAG,iBAAiB,IAAI,YAAY,CAChF,wBAAwB,EACxB,sBAAsB,EACtB,UAAU,EACV,qBAAqB,CACxB,CAAC"} |
@@ -13,3 +13,5 @@ "use strict"; | ||
| const utils_1 = require("../../utils"); | ||
| const getJettonInfoQueryOptions = (appKit, options = {}) => { | ||
| const getJettonInfoQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -16,0 +18,0 @@ ...options.query, |
@@ -15,3 +15,3 @@ /** | ||
| export type GetJettonWalletAddressQueryConfig<selectData = GetJettonWalletAddressData> = Compute<ExactPartial<GetJettonWalletAddressParameters>> & QueryParameter<GetJettonWalletAddressQueryFnData, GetJettonWalletAddressErrorType, selectData, GetJettonWalletAddressQueryKey>; | ||
| export declare const getJettonWalletAddressQueryOptions: <selectData = GetJettonWalletAddressData>(appKit: AppKit, options?: GetJettonWalletAddressQueryConfig<selectData>) => GetJettonWalletAddressQueryOptions<selectData>; | ||
| export declare const getJettonWalletAddressQueryOptions: <selectData = GetJettonWalletAddressData>(appKit: AppKit, initialOptions?: GetJettonWalletAddressQueryConfig<selectData>) => GetJettonWalletAddressQueryOptions<selectData>; | ||
| export type GetJettonWalletAddressQueryFnData = Compute<UserFriendlyAddress>; | ||
@@ -18,0 +18,0 @@ export type GetJettonWalletAddressData = GetJettonWalletAddressQueryFnData; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-jetton-wallet-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-wallet-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,6BAA6B,IAAI,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACzI,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAEpD,MAAM,MAAM,iCAAiC,CAAC,UAAU,GAAG,0BAA0B,IAAI,OAAO,CAC5F,YAAY,CAAC,gCAAgC,CAAC,CACjD,GACG,cAAc,CACV,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC;AAEN,eAAO,MAAM,kCAAkC,GAAI,UAAU,GAAG,0BAA0B,EACtF,QAAQ,MAAM,EACd,UAAS,iCAAiC,CAAC,UAAU,CAAM,KAC5D,kCAAkC,CAAC,UAAU,CAc/C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE7E,MAAM,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE3E,eAAO,MAAM,8BAA8B,GACvC,UAAS,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAM,KACtE,8BAEF,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,SAAS;IAClD,uBAAuB;IACvB,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAAC,UAAU,GAAG,0BAA0B,IAAI,YAAY,CAClG,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC"} | ||
| {"version":3,"file":"get-jetton-wallet-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-wallet-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,6BAA6B,IAAI,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACzI,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAEpD,MAAM,MAAM,iCAAiC,CAAC,UAAU,GAAG,0BAA0B,IAAI,OAAO,CAC5F,YAAY,CAAC,gCAAgC,CAAC,CACjD,GACG,cAAc,CACV,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC;AAEN,eAAO,MAAM,kCAAkC,GAAI,UAAU,GAAG,0BAA0B,EACtF,QAAQ,MAAM,EACd,iBAAgB,iCAAiC,CAAC,UAAU,CAAM,KACnE,kCAAkC,CAAC,UAAU,CAiB/C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE7E,MAAM,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE3E,eAAO,MAAM,8BAA8B,GACvC,UAAS,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAM,KACtE,8BAEF,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,SAAS;IAClD,uBAAuB;IACvB,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAAC,UAAU,GAAG,0BAA0B,IAAI,YAAY,CAClG,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC"} |
@@ -13,3 +13,5 @@ "use strict"; | ||
| const utils_1 = require("../../utils"); | ||
| const getJettonWalletAddressQueryOptions = (appKit, options = {}) => { | ||
| const getJettonWalletAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -16,0 +18,0 @@ ...options.query, |
@@ -8,2 +8,3 @@ /** | ||
| */ | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -14,6 +15,8 @@ import type { GetJettonsByAddressOptions } from '../../actions/jettons/get-jettons-by-address'; | ||
| import type { GetJettonsByAddressReturnType } from '../../actions/jettons/get-jettons-by-address'; | ||
| import type { JettonUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
| export type GetJettonsErrorType = Error; | ||
| export type GetJettonsByAddressData = GetJettonsQueryFnData; | ||
| export type GetJettonsByAddressQueryConfig<selectData = GetJettonsByAddressData> = Compute<ExactPartial<GetJettonsByAddressOptions>> & QueryParameter<GetJettonsQueryFnData, GetJettonsErrorType, selectData, GetJettonsByAddressQueryKey>; | ||
| export declare const getJettonsByAddressQueryOptions: <selectData = GetJettonsByAddressData>(appKit: AppKit, options?: GetJettonsByAddressQueryConfig<selectData>) => GetJettonsByAddressQueryOptions<selectData>; | ||
| export declare const getJettonsByAddressQueryOptions: <selectData = GetJettonsByAddressData>(appKit: AppKit, initialOptions?: GetJettonsByAddressQueryConfig<selectData>) => GetJettonsByAddressQueryOptions<selectData>; | ||
| export type GetJettonsQueryFnData = Compute<Awaited<GetJettonsByAddressReturnType>>; | ||
@@ -23,2 +26,9 @@ export declare const getJettonsByAddressQueryKey: (options?: Compute<ExactPartial<GetJettonsByAddressOptions>>) => GetJettonsByAddressQueryKey; | ||
| export type GetJettonsByAddressQueryOptions<selectData = GetJettonsByAddressData> = QueryOptions<GetJettonsQueryFnData, GetJettonsErrorType, selectData, GetJettonsByAddressQueryKey>; | ||
| /** | ||
| * Update the TanStack Query cache for an address jettons list. | ||
| */ | ||
| export declare const handleJettonsUpdate: (queryClient: QueryClient, { address, network }: { | ||
| address: string; | ||
| network: Network; | ||
| }, update: JettonUpdate) => void; | ||
| //# sourceMappingURL=get-jettons-by-address.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-jettons-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jettons-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAElG,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D,MAAM,MAAM,8BAA8B,CAAC,UAAU,GAAG,uBAAuB,IAAI,OAAO,CACtF,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;AAExG,eAAO,MAAM,+BAA+B,GAAI,UAAU,GAAG,uBAAuB,EAChF,QAAQ,MAAM,EACd,UAAS,8BAA8B,CAAC,UAAU,CAAM,KACzD,+BAA+B,CAAC,UAAU,CAa5C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,2BAA2B,GACpC,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,2BAEF,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,uBAAuB,IAAI,YAAY,CAC5F,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,2BAA2B,CAC9B,CAAC"} | ||
| {"version":3,"file":"get-jettons-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jettons-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,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;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC5B,aAAa,WAAW,EACxB,sBAAsB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC3D,QAAQ,YAAY,SA+BvB,CAAC"} |
@@ -10,6 +10,8 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getJettonsByAddressQueryKey = exports.getJettonsByAddressQueryOptions = void 0; | ||
| exports.handleJettonsUpdate = exports.getJettonsByAddressQueryKey = exports.getJettonsByAddressQueryOptions = void 0; | ||
| const get_jettons_by_address_1 = require("../../actions/jettons/get-jettons-by-address"); | ||
| const utils_1 = require("../../utils"); | ||
| const getJettonsByAddressQueryOptions = (appKit, options = {}) => { | ||
| const getJettonsByAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -33,1 +35,31 @@ ...options.query, | ||
| exports.getJettonsByAddressQueryKey = getJettonsByAddressQueryKey; | ||
| /** | ||
| * Update the TanStack Query cache for an address jettons list. | ||
| */ | ||
| const handleJettonsUpdate = (queryClient, { address, network }, update) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = (0, exports.getJettonsByAddressQueryKey)({ address, network }); | ||
| const currentData = queryClient.getQueryData(queryKey); | ||
| if (currentData?.jettons) { | ||
| const jetton = currentData.jettons.find((j) => (0, utils_1.compareAddress)(j.address, update.masterAddress)); | ||
| const decimals = jetton?.decimalsNumber ?? update.decimals; | ||
| if (jetton && decimals) { | ||
| const updatedJetton = { | ||
| ...jetton, | ||
| balance: (0, utils_1.formatUnits)(update.rawBalance, decimals), | ||
| }; | ||
| const newJettons = currentData.jettons.map((j) => (0, utils_1.compareAddress)(j.address, update.masterAddress) ? updatedJetton : j); | ||
| queryClient.setQueryData(queryKey, { | ||
| ...currentData, | ||
| jettons: newJettons, | ||
| }); | ||
| } | ||
| } | ||
| (0, utils_1.sleep)(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = (0, exports.getJettonsByAddressQueryKey)({ address, network }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; | ||
| exports.handleJettonsUpdate = handleJettonsUpdate; |
@@ -16,3 +16,3 @@ /** | ||
| export type GetBlockNumberQueryConfig<selectData = GetBlockNumberData> = Compute<ExactPartial<GetBlockNumberOptions>> & QueryParameter<GetBlockNumberQueryFnData, GetBlockNumberErrorType, selectData, GetBlockNumberQueryKey>; | ||
| export declare const getBlockNumberQueryOptions: <selectData = GetBlockNumberData>(appKit: AppKit, options?: GetBlockNumberQueryConfig<selectData>) => GetBlockNumberQueryOptions<selectData>; | ||
| export declare const getBlockNumberQueryOptions: <selectData = GetBlockNumberData>(appKit: AppKit, initialOptions?: GetBlockNumberQueryConfig<selectData>) => GetBlockNumberQueryOptions<selectData>; | ||
| export type GetBlockNumberQueryFnData = Compute<Awaited<GetBlockNumberReturnType>>; | ||
@@ -19,0 +19,0 @@ export declare const getBlockNumberQueryKey: (options?: Compute<ExactPartial<GetBlockNumberOptions>>) => GetBlockNumberQueryKey; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-block-number.d.ts","sourceRoot":"","sources":["../../../../src/queries/network/get-block-number.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAEvF,MAAM,MAAM,uBAAuB,GAAG,K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wCAAwC,CAAC;AAEvF,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAE3D,MAAM,MAAM,yBAAyB,CAAC,UAAU,GAAG,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,GACjH,cAAc,CAAC,yBAAyB,EAAE,uBAAuB,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC;AAE3G,eAAO,MAAM,0BAA0B,GAAI,UAAU,GAAG,kBAAkB,EACtE,QAAQ,MAAM,EACd,iBAAgB,yBAAyB,CAAC,UAAU,CAAM,KAC3D,0BAA0B,CAAC,UAAU,CAcvC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAEnF,eAAO,MAAM,sBAAsB,GAC/B,UAAS,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAM,KAC3D,sBAEF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAE5G,MAAM,MAAM,0BAA0B,CAAC,UAAU,GAAG,kBAAkB,IAAI,YAAY,CAClF,yBAAyB,EACzB,uBAAuB,EACvB,UAAU,EACV,sBAAsB,CACzB,CAAC"} |
@@ -13,3 +13,5 @@ "use strict"; | ||
| const utils_1 = require("../../utils"); | ||
| const getBlockNumberQueryOptions = (appKit, options = {}) => { | ||
| const getBlockNumberQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -16,0 +18,0 @@ ...options.query, |
@@ -15,3 +15,3 @@ /** | ||
| export type GetNftQueryConfig<selectData = GetNftData> = Compute<ExactPartial<GetNftParameters>> & QueryParameter<GetNftQueryFnData, GetNftErrorType, selectData, GetNftQueryKey>; | ||
| export declare const getNftQueryOptions: <selectData = GetNftData>(appKit: AppKit, options?: GetNftQueryConfig<selectData>) => GetNftQueryOptions<selectData>; | ||
| export declare const getNftQueryOptions: <selectData = GetNftData>(appKit: AppKit, initialOptions?: GetNftQueryConfig<selectData>) => GetNftQueryOptions<selectData>; | ||
| export type GetNftQueryFnData = Compute<NFT | null>; | ||
@@ -18,0 +18,0 @@ export type GetNftData = GetNftQueryFnData; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-nft.d.ts","sourceRoot":"","sources":["../../../../src/queries/nft/get-nft.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC;AAEpC,MAAM,MAAM,iBAAiB,CAAC,UAAU,GAAG,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,GAC5F,cAAc,CAAC,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;AAEnF,eAAO,MAAM,kBAAkB,GAAI,UAAU,GAAG,UAAU,EACtD,QAAQ,MAAM,EACd,UAAS,iBAAiB,CAAC,UAAU,CAAM,KAC5C,kBAAkB,CAAC,UAAU,CAa/B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;AAEpD,MAAM,MAAM,UAAU,GAAG,iBAAiB,CA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,UAAU,GAAG,iBAAiB,CAAC;AAE3C,eAAO,MAAM,cAAc,GAAI,UAAS,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAM,KAAG,cAEtF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEvF,MAAM,MAAM,kBAAkB,CAAC,UAAU,GAAG,UAAU,IAAI,YAAY,CAClE,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,cAAc,CACjB,CAAC"} |
@@ -13,3 +13,5 @@ "use strict"; | ||
| const utils_1 = require("../../utils"); | ||
| const getNftQueryOptions = (appKit, options = {}) => { | ||
| const getNftQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -16,0 +18,0 @@ ...options.query, |
@@ -16,3 +16,3 @@ /** | ||
| export type GetNFTsByAddressQueryConfig<selectData = GetNFTsByAddressData> = Compute<ExactPartial<GetNftsByAddressOptions>> & QueryParameter<GetNFTsQueryFnData, GetNFTsErrorType, selectData, GetNFTsByAddressQueryKey>; | ||
| export declare const getNFTsByAddressQueryOptions: <selectData = GetNFTsByAddressData>(appKit: AppKit, options?: GetNFTsByAddressQueryConfig<selectData>) => GetNFTsByAddressQueryOptions<selectData>; | ||
| export declare const getNFTsByAddressQueryOptions: <selectData = GetNFTsByAddressData>(appKit: AppKit, initialOptions?: GetNFTsByAddressQueryConfig<selectData>) => GetNFTsByAddressQueryOptions<selectData>; | ||
| export type GetNFTsQueryFnData = Compute<Awaited<GetNftsByAddressReturnType>>; | ||
@@ -19,0 +19,0 @@ export declare const getNFTsByAddressQueryKey: (options?: Compute<ExactPartial<GetNftsByAddressOptions>>) => GetNFTsByAddressQueryKey; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-nfts-by-address.d.ts","sourceRo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I,YAAY,CACtF,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,wBAAwB,CAC3B,CAAC"} |
@@ -13,3 +13,5 @@ "use strict"; | ||
| const utils_1 = require("../../utils"); | ||
| const getNFTsByAddressQueryOptions = (appKit, options = {}) => { | ||
| const getNFTsByAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -16,0 +18,0 @@ ...options.query, |
@@ -15,3 +15,3 @@ /** | ||
| export type GetSwapQuoteQueryConfig<selectData = GetSwapQuoteData> = Compute<ExactPartial<GetSwapQuoteOptions>> & QueryParameter<GetSwapQuoteQueryFnData, GetSwapQuoteErrorType, selectData, GetSwapQuoteQueryKey>; | ||
| export declare const getSwapQuoteQueryOptions: <selectData = GetSwapQuoteData>(appKit: AppKit, options?: GetSwapQuoteQueryConfig<selectData>) => GetSwapQuoteQueryOptions<selectData>; | ||
| export declare const getSwapQuoteQueryOptions: <selectData = GetSwapQuoteData>(appKit: AppKit, initialOptions?: GetSwapQuoteQueryConfig<selectData>) => GetSwapQuoteQueryOptions<selectData>; | ||
| export type GetSwapQuoteQueryFnData = Compute<Awaited<GetSwapQuoteReturnType>>; | ||
@@ -18,0 +18,0 @@ export type GetSwapQuoteData = GetSwapQuoteQueryFnData; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-swap-quote.d.ts","sourceRoot":"","sources":["../../../../src/queries/swap/get-swap-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OA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E,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE1C,MAAM,MAAM,uBAAuB,CAAC,UAAU,GAAG,gBAAgB,IAAI,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,GAC3G,cAAc,CAAC,uBAAuB,EAAE,qBAAqB,EAAE,UAAU,EAAE,oBAAoB,CAAC,CAAC;AAErG,eAAO,MAAM,wBAAwB,GAAI,UAAU,GAAG,gBAAgB,EAClE,QAAQ,MAAM,EACd,iBAAgB,uBAAuB,CAAC,UAAU,CAAM,KACzD,wBAAwB,CAAC,UAAU,CA6BrC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC;AAE/E,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEvD,eAAO,MAAM,oBAAoB,GAC7B,UAAS,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAM,KACzD,oBAEF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAEtG,MAAM,MAAM,wBAAwB,CAAC,UAAU,GAAG,gBAAgB,IAAI,YAAY,CAC9E,uBAAuB,EACvB,qBAAqB,EACrB,UAAU,EACV,oBAAoB,CACvB,CAAC"} |
@@ -13,3 +13,5 @@ "use strict"; | ||
| const utils_1 = require("../../utils"); | ||
| const getSwapQuoteQueryOptions = (appKit, options = {}) => { | ||
| const getSwapQuoteQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -16,0 +18,0 @@ ...options.query, |
@@ -17,3 +17,3 @@ /** | ||
| export type GetTransactionStatusQueryOptions<selectData = GetTransactionStatusData> = QueryOptions<GetTransactionStatusData, GetTransactionStatusErrorType, selectData, GetTransactionStatusQueryKey>; | ||
| export declare const getTransactionStatusQueryOptions: <selectData = GetTransactionStatusData>(appKit: AppKit, options: GetTransactionStatusParameters & GetTransactionStatusQueryConfig<selectData>) => GetTransactionStatusQueryOptions<selectData>; | ||
| export declare const getTransactionStatusQueryOptions: <selectData = GetTransactionStatusData>(appKit: AppKit, initialOptions: GetTransactionStatusParameters & GetTransactionStatusQueryConfig<selectData>) => GetTransactionStatusQueryOptions<selectData>; | ||
| //# sourceMappingURL=get-transaction-status.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-transaction-status.d.ts","sourceRoot":"","sources":["../../../../src/queries/transaction/get-transaction-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACR,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,CAAC;AAE9G,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAE/E,MAAM,MAAM,4BAA4B,GAAG,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAElF,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,wBAAwB,IAAI,cAAc,CAC/F,wBAAwB,EACxB,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEF,MAAM,MAAM,gCAAgC,CAAC,UAAU,GAAG,wBAAwB,IAAI,YAAY,CAC9F,wBAAwB,EACxB,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,UAAU,GAAG,wBAAwB,EAClF,QAAQ,MAAM,EACd,SAAS,8BAA8B,GAAG,+BAA+B,CAAC,UAAU,CAAC,KACtF,gCAAgC,CAAC,UAAU,CAQ7C,CAAC"} | ||
| {"version":3,"file":"get-transaction-status.d.ts","sourceRoot":"","sources":["../../../../src/queries/transaction/get-transaction-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACR,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,YAAY,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,CAAC;AAE9G,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAE/E,MAAM,MAAM,4BAA4B,GAAG,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAElF,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,wBAAwB,IAAI,cAAc,CAC/F,wBAAwB,EACxB,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEF,MAAM,MAAM,gCAAgC,CAAC,UAAU,GAAG,wBAAwB,IAAI,YAAY,CAC9F,wBAAwB,EACxB,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,UAAU,GAAG,wBAAwB,EAClF,QAAQ,MAAM,EACd,gBAAgB,8BAA8B,GAAG,+BAA+B,CAAC,UAAU,CAAC,KAC7F,gCAAgC,CAAC,UAAU,CAW7C,CAAC"} |
@@ -12,3 +12,6 @@ "use strict"; | ||
| const get_transaction_status_1 = require("../../actions/transaction/get-transaction-status"); | ||
| const getTransactionStatusQueryOptions = (appKit, options) => { | ||
| const utils_1 = require("../../utils"); | ||
| const getTransactionStatusQueryOptions = (appKit, initialOptions) => { | ||
| const network = (0, utils_1.resolveNetwork)(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -15,0 +18,0 @@ ...options.query, |
@@ -18,7 +18,5 @@ /** | ||
| readonly id: string; | ||
| /** Protocol type (e.g. 'tonconnect', 'ledger', 'mnemonic') */ | ||
| /** Protocol type (e.g. 'tonconnect') */ | ||
| readonly type: string; | ||
| readonly metadata: ConnectorMetadata; | ||
| /** Initialize connector (restore connections, setup event listeners) */ | ||
| initialize(emitter: AppKitEmitter, networkManager: AppKitNetworkManager): Promise<void>; | ||
| /** Cleanup connector resources */ | ||
@@ -37,2 +35,16 @@ destroy(): void; | ||
| } | ||
| /** | ||
| * Context passed to connector factory functions. | ||
| */ | ||
| export interface ConnectorFactoryContext { | ||
| networkManager: AppKitNetworkManager; | ||
| eventEmitter: AppKitEmitter; | ||
| ssr?: boolean; | ||
| } | ||
| /** Factory function that creates a connector from context */ | ||
| export type ConnectorFactory = (ctx: ConnectorFactoryContext) => Connector; | ||
| /** A connector instance or a factory that creates one */ | ||
| export type ConnectorInput = Connector | ConnectorFactory; | ||
| /** Helper for creating typed connector factories */ | ||
| export declare function createConnector(factory: ConnectorFactory): ConnectorFactory; | ||
| //# sourceMappingURL=connector.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/types/connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CA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,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC,kCAAkC;IAClC,OAAO,IAAI,IAAI,CAAC;IAEhB,uBAAuB;IACvB,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD,0BAA0B;IAC1B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC,4BAA4B;IAC5B,mBAAmB,IAAI,eAAe,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,cAAc,EAAE,oBAAoB,CAAC;IACrC,YAAY,EAAE,aAAa,CAAC;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,uBAAuB,KAAK,SAAS,CAAC;AAE3E,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAE1D,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAE3E"} |
@@ -10,1 +10,6 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.createConnector = createConnector; | ||
| /** Helper for creating typed connector factories */ | ||
| function createConnector(factory) { | ||
| return factory; | ||
| } |
@@ -8,7 +8,7 @@ /** | ||
| */ | ||
| import type { SwapProviderInterface } from '@ton/walletkit'; | ||
| import type { SwapProviderInterface, StakingProviderInterface } from '@ton/walletkit'; | ||
| /** | ||
| * Provider configuration | ||
| */ | ||
| export type Provider = SwapProviderInterface; | ||
| export type Provider = SwapProviderInterface | StakingProviderInterface; | ||
| //# sourceMappingURL=provider.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,qBAAqB,CAAC"} | ||
| {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,qBAAqB,GAAG,wBAAwB,CAAC"} |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export { formatUnits, parseUnits } from '@ton/walletkit'; | ||
| export { formatUnits, parseUnits, compareAddress } from '@ton/walletkit'; | ||
| export * from './amount/validate-numeric-string'; | ||
@@ -11,0 +11,0 @@ export * from './arrays/key-by'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEzD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEzE,cAAc,kCAAkC,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC"} |
@@ -24,6 +24,7 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.parseUnits = exports.formatUnits = void 0; | ||
| exports.compareAddress = exports.parseUnits = exports.formatUnits = void 0; | ||
| var walletkit_1 = require("@ton/walletkit"); | ||
| Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return walletkit_1.formatUnits; } }); | ||
| Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return walletkit_1.parseUnits; } }); | ||
| Object.defineProperty(exports, "compareAddress", { enumerable: true, get: function () { return walletkit_1.compareAddress; } }); | ||
| __exportStar(require("./amount/validate-numeric-string"), exports); | ||
@@ -30,0 +31,0 @@ __exportStar(require("./arrays/key-by"), exports); |
@@ -9,4 +9,4 @@ /** | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { Connector } from '../../types/connector'; | ||
| export type AddConnectorParameters = Connector; | ||
| import type { ConnectorInput } from '../../types/connector'; | ||
| export type AddConnectorParameters = ConnectorInput; | ||
| export type AddConnectorReturnType = () => void; | ||
@@ -16,3 +16,3 @@ /** | ||
| */ | ||
| export declare const addConnector: (appKit: AppKit, connector: AddConnectorParameters) => AddConnectorReturnType; | ||
| export declare const addConnector: (appKit: AppKit, connectorFn: AddConnectorParameters) => AddConnectorReturnType; | ||
| //# sourceMappingURL=add-connector.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"add-connector.d.ts","sourceRoot":"","sources":["../../../../src/actions/connectors/add-connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,WAAW,sBAAsB,KAAG,sBAEhF,CAAC"} | ||
| {"version":3,"file":"add-connector.d.ts","sourceRoot":"","sources":["../../../../src/actions/connectors/add-connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,aAAa,sBAAsB,KAAG,sBAElF,CAAC"} |
@@ -11,4 +11,4 @@ /** | ||
| */ | ||
| export const addConnector = (appKit, connector) => { | ||
| return appKit.addConnector(connector); | ||
| export const addConnector = (appKit, connectorFn) => { | ||
| return appKit.addConnector(connectorFn); | ||
| }; |
@@ -9,3 +9,5 @@ /** | ||
| export { getBalanceByAddress, type GetBalanceByAddressOptions, type GetBalanceByAddressReturnType, } from './balances/get-balance-by-address'; | ||
| export { watchBalanceByAddress, type WatchBalanceByAddressOptions, type WatchBalanceByAddressReturnType, } from './balances/watch-balance-by-address'; | ||
| export { getBalance, type GetBalanceOptions, type GetBalanceReturnType } from './balances/get-balance'; | ||
| export { watchBalance, type WatchBalanceOptions, type WatchBalanceReturnType } from './balances/watch-balance'; | ||
| export { addConnector, type AddConnectorParameters, type AddConnectorReturnType } from './connectors/add-connector'; | ||
@@ -22,3 +24,5 @@ export { connect, type ConnectParameters, type ConnectReturnType } from './connectors/connect'; | ||
| export { getJettonsByAddress, type GetJettonsByAddressOptions, type GetJettonsByAddressReturnType, } from './jettons/get-jettons-by-address'; | ||
| export { watchJettonsByAddress, type WatchJettonsByAddressOptions, type WatchJettonsByAddressReturnType, } from './jettons/watch-jettons-by-address'; | ||
| export { getJettons, type GetJettonsOptions, type GetJettonsReturnType } from './jettons/get-jettons'; | ||
| export { watchJettons, type WatchJettonsOptions, type WatchJettonsReturnType } from './jettons/watch-jettons'; | ||
| export { createTransferJettonTransaction, type CreateTransferJettonTransactionParameters, type CreateTransferJettonTransactionReturnType, } from './jettons/create-transfer-jetton-transaction'; | ||
@@ -28,2 +32,3 @@ export { transferJetton, type TransferJettonParameters, type TransferJettonReturnType, } from './jettons/transfer-jetton'; | ||
| export { getNetwork, type GetNetworkReturnType } from './network/get-network'; | ||
| export { getApiClient, type GetApiClientOptions, type GetApiClientReturnType } from './network/get-api-client'; | ||
| export { watchNetworks, type WatchNetworksParameters, type WatchNetworksReturnType } from './network/watch-networks'; | ||
@@ -34,2 +39,3 @@ export { getBlockNumber, type GetBlockNumberOptions, type GetBlockNumberReturnType } from './network/get-block-number'; | ||
| export { watchDefaultNetwork, type WatchDefaultNetworkParameters, type WatchDefaultNetworkReturnType, } from './network/watch-default-network'; | ||
| export { hasStreamingProvider, type HasStreamingProviderReturnType } from './network/has-streaming-provider'; | ||
| export { getNftsByAddress, type GetNftsByAddressOptions, type GetNftsByAddressReturnType, } from './nft/get-nfts-by-address'; | ||
@@ -46,5 +52,13 @@ export { getNfts, type GetNftsOptions, type GetNftsReturnType } from './nft/get-nfts'; | ||
| export { buildSwapTransaction, type BuildSwapTransactionOptions, type BuildSwapTransactionReturnType, } from './swap/build-swap-transaction'; | ||
| export { getStakingManager, type GetStakingManagerReturnType } from './staking/get-staking-manager'; | ||
| export { getStakingProviders, type GetStakingProvidersReturnType } from './staking/get-staking-providers'; | ||
| export { getStakingQuote, type GetStakingQuoteOptions, type GetStakingQuoteReturnType, } from './staking/get-staking-quote'; | ||
| export { buildStakeTransaction, type BuildStakeTransactionOptions, type BuildStakeTransactionReturnType, } from './staking/build-stake-transaction'; | ||
| export { getStakedBalance, type GetStakedBalanceOptions, type GetStakedBalanceReturnType, } from './staking/get-staked-balance'; | ||
| export { getStakingProviderInfo, type GetStakingProviderInfoOptions, type GetStakingProviderInfoReturnType, } from './staking/get-staking-provider-info'; | ||
| export { sendTransaction, type SendTransactionParameters, type SendTransactionReturnType, } from './transaction/send-transaction'; | ||
| export { transferTon, type TransferTonParameters, type TransferTonReturnType } from './transaction/transfer-ton'; | ||
| export { getTransactionStatus, type GetTransactionStatusParameters, type GetTransactionStatusReturnType, type GetTransactionStatusErrorType, } from './transaction/get-transaction-status'; | ||
| export { watchTransactionsByAddress, type WatchTransactionsByAddressOptions, type WatchTransactionsByAddressReturnType, } from './transaction/watch-transactions-by-address'; | ||
| export { watchTransactions, type WatchTransactionsOptions, type WatchTransactionsReturnType, } from './transaction/watch-transactions'; | ||
| export { createTransferNftTransaction, type CreateTransferNftTransactionParameters, type CreateTransferNftTransactionReturnType, } from './nft/create-transfer-nft-transaction'; | ||
@@ -51,0 +65,0 @@ export { createTransferTonTransaction, type CreateTransferTonTransactionParameters, type CreateTransferTonTransactionReturnType, } from './transaction/create-transfer-ton-transaction'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,mBAAmB,EACnB,KAAK,0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K,sCAAsC,GAC9C,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,4BAA4B,EAC5B,KAAK,sCAAsC,EAC3C,KAAK,sCAAsC,GAC9C,MAAM,+CAA+C,CAAC;AAGvD,OAAO,EAAE,mBAAmB,EAAE,KAAK,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EACH,mBAAmB,EACnB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,mBAAmB,EACnB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,GACrC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,qBAAqB,EACrB,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,GACvC,MAAM,mCAAmC,CAAC"} |
@@ -10,3 +10,5 @@ /** | ||
| export { getBalanceByAddress, } from './balances/get-balance-by-address'; | ||
| export { watchBalanceByAddress, } from './balances/watch-balance-by-address'; | ||
| export { getBalance } from './balances/get-balance'; | ||
| export { watchBalance } from './balances/watch-balance'; | ||
| // Connectors | ||
@@ -25,3 +27,5 @@ export { addConnector } from './connectors/add-connector'; | ||
| export { getJettonsByAddress, } from './jettons/get-jettons-by-address'; | ||
| export { watchJettonsByAddress, } from './jettons/watch-jettons-by-address'; | ||
| export { getJettons } from './jettons/get-jettons'; | ||
| export { watchJettons } from './jettons/watch-jettons'; | ||
| export { createTransferJettonTransaction, } from './jettons/create-transfer-jetton-transaction'; | ||
@@ -32,2 +36,3 @@ export { transferJetton, } from './jettons/transfer-jetton'; | ||
| export { getNetwork } from './network/get-network'; | ||
| export { getApiClient } from './network/get-api-client'; | ||
| export { watchNetworks } from './network/watch-networks'; | ||
@@ -38,2 +43,3 @@ export { getBlockNumber } from './network/get-block-number'; | ||
| export { watchDefaultNetwork, } from './network/watch-default-network'; | ||
| export { hasStreamingProvider } from './network/has-streaming-provider'; | ||
| // NFT | ||
@@ -54,2 +60,9 @@ export { getNftsByAddress, } from './nft/get-nfts-by-address'; | ||
| export { buildSwapTransaction, } from './swap/build-swap-transaction'; | ||
| // Staking | ||
| export { getStakingManager } from './staking/get-staking-manager'; | ||
| export { getStakingProviders } from './staking/get-staking-providers'; | ||
| export { getStakingQuote, } from './staking/get-staking-quote'; | ||
| export { buildStakeTransaction, } from './staking/build-stake-transaction'; | ||
| export { getStakedBalance, } from './staking/get-staked-balance'; | ||
| export { getStakingProviderInfo, } from './staking/get-staking-provider-info'; | ||
| // Transactions | ||
@@ -59,2 +72,4 @@ export { sendTransaction, } from './transaction/send-transaction'; | ||
| export { getTransactionStatus, } from './transaction/get-transaction-status'; | ||
| export { watchTransactionsByAddress, } from './transaction/watch-transactions-by-address'; | ||
| export { watchTransactions, } from './transaction/watch-transactions'; | ||
| export { createTransferNftTransaction, } from './nft/create-transfer-nft-transaction'; | ||
@@ -61,0 +76,0 @@ export { createTransferTonTransaction, } from './transaction/create-transfer-ton-transaction'; |
@@ -8,5 +8,5 @@ /** | ||
| */ | ||
| import type { Provider } from '../../types/provider'; | ||
| import type { ProviderInput } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type RegisterProviderOptions = Provider; | ||
| export type RegisterProviderOptions = ProviderInput; | ||
| /** | ||
@@ -13,0 +13,0 @@ * Register provider |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"register-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/providers/register-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,UAAU,uBAAuB,KAAG,IAEpF,CAAC"} | ||
| {"version":3,"file":"register-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/providers/register-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,UAAU,uBAAuB,KAAG,IAEpF,CAAC"} |
@@ -10,7 +10,3 @@ /** | ||
| import type { TonConnectUiCreateOptions } from '@tonconnect/ui'; | ||
| import type { Network } from '../../../types/network'; | ||
| import type { Connector, ConnectorMetadata } from '../../../types/connector'; | ||
| import type { WalletInterface } from '../../../types/wallet'; | ||
| import type { AppKitEmitter } from '../../../core/app-kit'; | ||
| import type { AppKitNetworkManager } from '../../../core/network'; | ||
| export interface TonConnectConnectorConfig { | ||
@@ -22,16 +18,7 @@ id?: string; | ||
| } | ||
| export declare class TonConnectConnector implements Connector { | ||
| readonly id: string; | ||
| readonly type = "tonconnect"; | ||
| readonly metadata: ConnectorMetadata; | ||
| readonly tonConnectUI: TonConnectUI; | ||
| private emitter; | ||
| private unsubscribeTonConnect; | ||
| constructor(config: TonConnectConnectorConfig); | ||
| initialize(emitter: AppKitEmitter, networkManager: AppKitNetworkManager): Promise<void>; | ||
| destroy(): void; | ||
| connectWallet(network?: Network): Promise<void>; | ||
| disconnectWallet(): Promise<void>; | ||
| getConnectedWallets(): WalletInterface[]; | ||
| } | ||
| export type TonConnectConnector = Connector & { | ||
| type: 'tonconnect'; | ||
| tonConnectUI: TonConnectUI | null; | ||
| }; | ||
| export declare const createTonConnectConnector: (config: TonConnectConnectorConfig) => import("../../..").ConnectorFactory; | ||
| //# sourceMappingURL=ton-connect-connector.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version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AAO,CAAC,IAAI,CAAC;IAIvC,mBAAmB,IAAI,eAAe,EAAE;CAe3C"} | ||
| {"version":3,"file":"ton-connect-connector.d.ts","sourceRoot":"","sources":["../../../../../src/connectors/tonconnect/connectors/ton-connect-connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAIhE,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAK7E,MAAM,WAAW,yBAAyB;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC1C,IAAI,EAAE,YAAY,CAAC;IACnB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,QAAQ,yBAAyB,wCAgH1E,CAAC"} |
@@ -12,63 +12,94 @@ /** | ||
| import { TONCONNECT_DEFAULT_CONNECTOR_ID } from '../constants/id'; | ||
| export class TonConnectConnector { | ||
| constructor(config) { | ||
| this.type = 'tonconnect'; | ||
| this.emitter = null; | ||
| this.unsubscribeTonConnect = null; | ||
| if (config.tonConnectOptions && config.tonConnectUI) { | ||
| // eslint-disable-next-line no-console | ||
| console.warn('TonConnectConnector: both tonConnectOptions and tonConnectUI are provided, using tonConnectUI'); | ||
| } | ||
| this.id = config.id ?? TONCONNECT_DEFAULT_CONNECTOR_ID; | ||
| this.tonConnectUI = config?.tonConnectUI ?? new TonConnectUI(config.tonConnectOptions); | ||
| this.metadata = { | ||
| name: 'TonConnect', | ||
| iconUrl: 'https://avatars.githubusercontent.com/u/113980577', | ||
| ...config.metadata, | ||
| }; | ||
| } | ||
| async initialize(emitter, networkManager) { | ||
| this.emitter = emitter; | ||
| // Subscribe to TonConnect status changes | ||
| this.unsubscribeTonConnect = this.tonConnectUI.onStatusChange((wallet) => { | ||
| const wallets = this.getConnectedWallets(); | ||
| if (wallet) { | ||
| this.emitter?.emit(CONNECTOR_EVENTS.CONNECTED, { wallets, connectorId: this.id }, this.id); | ||
| import { createConnector } from '../../../types/connector'; | ||
| export const createTonConnectConnector = (config) => { | ||
| return createConnector(({ eventEmitter, networkManager, ssr }) => { | ||
| let originalTonConnectUI = null; | ||
| let unsubscribeTonConnect = null; | ||
| const id = config.id ?? TONCONNECT_DEFAULT_CONNECTOR_ID; | ||
| function getTonConnectUI() { | ||
| if (originalTonConnectUI) { | ||
| return originalTonConnectUI; | ||
| } | ||
| if (ssr && typeof window === 'undefined') { | ||
| return null; | ||
| } | ||
| // check if we have pre-defined UI | ||
| if (config.tonConnectUI) { | ||
| originalTonConnectUI = config.tonConnectUI; | ||
| } | ||
| else { | ||
| this.emitter?.emit(CONNECTOR_EVENTS.DISCONNECTED, { connectorId: this.id }, this.id); | ||
| originalTonConnectUI = new TonConnectUI(config.tonConnectOptions); | ||
| } | ||
| }); | ||
| // Set default network and subscribe to changes | ||
| this.tonConnectUI.setConnectionNetwork(networkManager.getDefaultNetwork()?.chainId); | ||
| this.emitter?.on(NETWORKS_EVENTS.DEFAULT_CHANGED, ({ payload }) => { | ||
| this.tonConnectUI.setConnectionNetwork(payload.network?.chainId); | ||
| }); | ||
| // Restore existing connection | ||
| await this.tonConnectUI.connector.restoreConnection(); | ||
| } | ||
| destroy() { | ||
| this.unsubscribeTonConnect?.(); | ||
| this.unsubscribeTonConnect = null; | ||
| this.emitter = null; | ||
| } | ||
| async connectWallet(network) { | ||
| this.tonConnectUI.setConnectionNetwork(network?.chainId); | ||
| await this.tonConnectUI.openModal(); | ||
| } | ||
| async disconnectWallet() { | ||
| await this.tonConnectUI.disconnect(); | ||
| } | ||
| getConnectedWallets() { | ||
| if (this.tonConnectUI.connected && this.tonConnectUI.wallet) { | ||
| const wallet = this.tonConnectUI.wallet; | ||
| const walletAdapter = new TonConnectWalletAdapter({ | ||
| connectorId: this.id, | ||
| tonConnectWallet: wallet, | ||
| tonConnectUI: this.tonConnectUI, | ||
| setupListeners(); | ||
| // restore connection | ||
| if (originalTonConnectUI) { | ||
| originalTonConnectUI.connector.restoreConnection(); | ||
| } | ||
| return originalTonConnectUI; | ||
| } | ||
| function getConnectedWallets() { | ||
| const ui = getTonConnectUI(); | ||
| if (ui && ui.connected && ui.wallet) { | ||
| const wallet = ui.wallet; | ||
| return [ | ||
| new TonConnectWalletAdapter({ | ||
| connectorId: id, | ||
| tonConnectWallet: wallet, | ||
| tonConnectUI: ui, | ||
| }), | ||
| ]; | ||
| } | ||
| return []; | ||
| } | ||
| function setupListeners() { | ||
| if (!originalTonConnectUI || unsubscribeTonConnect) { | ||
| return; | ||
| } | ||
| unsubscribeTonConnect = originalTonConnectUI.onStatusChange((wallet) => { | ||
| const wallets = getConnectedWallets(); | ||
| if (wallet) { | ||
| eventEmitter.emit(CONNECTOR_EVENTS.CONNECTED, { wallets, connectorId: id }, id); | ||
| } | ||
| else { | ||
| eventEmitter.emit(CONNECTOR_EVENTS.DISCONNECTED, { connectorId: id }, id); | ||
| } | ||
| }); | ||
| return [walletAdapter]; | ||
| // Set default network and subscribe to changes | ||
| originalTonConnectUI.setConnectionNetwork(networkManager.getDefaultNetwork()?.chainId); | ||
| eventEmitter.on(NETWORKS_EVENTS.DEFAULT_CHANGED, ({ payload }) => { | ||
| if (originalTonConnectUI) { | ||
| originalTonConnectUI.setConnectionNetwork(payload.network?.chainId); | ||
| } | ||
| }); | ||
| } | ||
| return []; | ||
| } | ||
| } | ||
| return { | ||
| id, | ||
| type: 'tonconnect', | ||
| metadata: { | ||
| name: 'TonConnect', | ||
| iconUrl: 'https://avatars.githubusercontent.com/u/113980577', | ||
| ...config.metadata, | ||
| }, | ||
| get tonConnectUI() { | ||
| return getTonConnectUI(); | ||
| }, | ||
| getConnectedWallets, | ||
| async connectWallet() { | ||
| const ui = getTonConnectUI(); | ||
| if (ui) { | ||
| await ui.openModal(); | ||
| } | ||
| }, | ||
| async disconnectWallet() { | ||
| const ui = getTonConnectUI(); | ||
| if (ui) { | ||
| await ui.disconnect(); | ||
| } | ||
| }, | ||
| destroy() { | ||
| unsubscribeTonConnect?.(); | ||
| originalTonConnectUI = null; | ||
| }, | ||
| }; | ||
| }); | ||
| }; |
@@ -24,5 +24,4 @@ /** | ||
| export type { TonConnectWalletAdapterConfig } from './adapters/ton-connect-wallet-adapter'; | ||
| export { TonConnectConnector } from './connectors/ton-connect-connector'; | ||
| export { createTonConnectConnector, type TonConnectConnectorConfig, type TonConnectConnector, } from './connectors/ton-connect-connector'; | ||
| export { TONCONNECT_DEFAULT_CONNECTOR_ID } from './constants/id'; | ||
| export type { TonConnectConnectorConfig } from './connectors/ton-connect-connector'; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/connectors/tonconnect/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,YAAY,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAG3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/connectors/tonconnect/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,YAAY,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAG3F,OAAO,EACH,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,GAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC"} |
@@ -25,3 +25,3 @@ /** | ||
| // Connector exports | ||
| export { TonConnectConnector } from './connectors/ton-connect-connector'; | ||
| export { createTonConnectConnector, } from './connectors/ton-connect-connector'; | ||
| export { TONCONNECT_DEFAULT_CONNECTOR_ID } from './constants/id'; |
@@ -8,9 +8,10 @@ /** | ||
| */ | ||
| import { SwapManager } from '@ton/walletkit'; | ||
| import type { Provider } from 'src/types/provider'; | ||
| import type { AppKitConfig } from '../types/config'; | ||
| import type { Connector } from '../../../types/connector'; | ||
| import { SwapManager, StreamingManager } from '@ton/walletkit'; | ||
| import type { ProviderInput } from '@ton/walletkit'; | ||
| import { StakingManager } from '../../../staking'; | ||
| import type { Connector, ConnectorFactoryContext, ConnectorInput } from '../../../types/connector'; | ||
| import type { AppKitEmitter } from '../types/events'; | ||
| import { WalletsManager } from '../../wallets-manager'; | ||
| import { AppKitNetworkManager } from '../../network'; | ||
| import type { AppKitConfig } from '../types/config'; | ||
| /** | ||
@@ -25,9 +26,12 @@ * Central hub for wallet management. | ||
| readonly swapManager: SwapManager; | ||
| readonly stakingManager: StakingManager; | ||
| readonly networkManager: AppKitNetworkManager; | ||
| readonly streamingManager: StreamingManager; | ||
| readonly config: AppKitConfig; | ||
| constructor(config: AppKitConfig); | ||
| createFactoryContext(): ConnectorFactoryContext; | ||
| /** | ||
| * Add a wallet connector | ||
| */ | ||
| addConnector(connector: Connector): () => void; | ||
| addConnector(input: ConnectorInput): () => void; | ||
| /** | ||
@@ -40,3 +44,3 @@ * Remove a wallet connector | ||
| */ | ||
| registerProvider(provider: Provider): void; | ||
| registerProvider(input: ProviderInput): void; | ||
| /** | ||
@@ -43,0 +47,0 @@ * Get all connected wallets from all connectors |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"app-kit.d.ts","sourceRoot":"","sources":["../../../../../src/core/app-kit/services/app-kit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD;;;GAGG;AACH,qBAAa,MAAM;IACf,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,EAAE,CAAM;IACtC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;gBAElB,MAAM,EAAE,YAAY;IA6BhC;;OAEG;IACH,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,IAAI;IAgB9C;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAU3C;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAU1C;;OAEG;IACH,OAAO,CAAC,2BAA2B;CAWtC"} | ||
| {"version":3,"file":"app-kit.d.ts","sourceRoot":"","sources":["../../../../../src/core/app-kit/services/app-kit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,g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SwapManager, StreamingManager } from '@ton/walletkit'; | ||
| import { StakingManager } from '../../../staking'; | ||
| import { EventEmitter } from '../../emitter'; | ||
| import { CONNECTOR_EVENTS, WALLETS_EVENTS } from '../constants/events'; | ||
@@ -23,3 +24,3 @@ import { WalletsManager } from '../../wallets-manager'; | ||
| this.config = config; | ||
| this.emitter = new Emitter(); | ||
| this.emitter = new EventEmitter(); | ||
| this.emitter.on(CONNECTOR_EVENTS.CONNECTED, this.updateWalletsFromConnectors.bind(this)); | ||
@@ -33,18 +34,24 @@ this.emitter.on(CONNECTOR_EVENTS.DISCONNECTED, this.updateWalletsFromConnectors.bind(this)); | ||
| this.walletsManager = new WalletsManager(this.emitter); | ||
| this.swapManager = new SwapManager(); | ||
| this.swapManager = new SwapManager(() => this.createFactoryContext()); | ||
| this.stakingManager = new StakingManager(() => this.createFactoryContext()); | ||
| this.streamingManager = new StreamingManager(() => this.createFactoryContext()); | ||
| if (config.connectors) { | ||
| config.connectors.forEach((connector) => { | ||
| this.addConnector(connector); | ||
| config.connectors.forEach((input) => { | ||
| this.addConnector(input); | ||
| }); | ||
| } | ||
| if (config.providers) { | ||
| config.providers.forEach((provider) => { | ||
| this.registerProvider(provider); | ||
| config.providers.forEach((input) => { | ||
| this.registerProvider(input); | ||
| }); | ||
| } | ||
| } | ||
| createFactoryContext() { | ||
| return { eventEmitter: this.emitter, networkManager: this.networkManager, ssr: this.config?.ssr }; | ||
| } | ||
| /** | ||
| * Add a wallet connector | ||
| */ | ||
| addConnector(connector) { | ||
| addConnector(input) { | ||
| const connector = typeof input === 'function' ? input(this.createFactoryContext()) : input; | ||
| const id = connector.id; | ||
@@ -56,3 +63,2 @@ const oldConnector = this.connectors.find((c) => c.id === id); | ||
| this.connectors.push(connector); | ||
| connector.initialize(this.emitter, this.networkManager); | ||
| return () => { | ||
@@ -76,3 +82,4 @@ this.removeConnector(connector); | ||
| */ | ||
| registerProvider(provider) { | ||
| registerProvider(input) { | ||
| const provider = typeof input === 'function' ? input(this.createFactoryContext()) : input; | ||
| switch (provider.type) { | ||
@@ -82,2 +89,5 @@ case 'swap': | ||
| break; | ||
| case 'staking': | ||
| this.stakingManager.registerProvider(provider); | ||
| break; | ||
| default: | ||
@@ -84,0 +94,0 @@ throw new Error('Unknown provider type'); |
@@ -8,5 +8,4 @@ /** | ||
| */ | ||
| import type { NetworkAdapters } from '@ton/walletkit'; | ||
| import type { Connector } from '../../../types/connector'; | ||
| import type { Provider } from '../../../types/provider'; | ||
| import type { NetworkAdapters, ProviderInput } from '@ton/walletkit'; | ||
| import type { ConnectorInput } from '../../../types/connector'; | ||
| import type { Network } from '../../../types/network'; | ||
@@ -26,2 +25,6 @@ /** | ||
| /** | ||
| * Wallet connectors | ||
| */ | ||
| connectors?: ConnectorInput[]; | ||
| /** | ||
| * Default network for wallet connections. | ||
@@ -32,5 +35,8 @@ * If set, connectors (e.g. TonConnect) will enforce this network when connecting. | ||
| defaultNetwork?: Network; | ||
| connectors?: Connector[]; | ||
| providers?: Provider[]; | ||
| providers?: ProviderInput[]; | ||
| /** | ||
| * Enable server-side rendering support | ||
| */ | ||
| ssr?: boolean; | ||
| } | ||
| //# sourceMappingURL=config.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/core/app-kit/types/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CAC1B"} | ||
| {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/core/app-kit/types/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAE9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAE5B;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACjB"} |
@@ -8,5 +8,6 @@ /** | ||
| */ | ||
| import type { SharedKitEvents } from '../../emitter'; | ||
| import type { CONNECTOR_EVENTS, WALLETS_EVENTS, PLUGIN_EVENTS, NETWORKS_EVENTS } from '../constants/events'; | ||
| import type { Network } from '../../../types/network'; | ||
| import type { Emitter } from '../../emitter'; | ||
| import type { CONNECTOR_EVENTS, WALLETS_EVENTS, PLUGIN_EVENTS, NETWORKS_EVENTS } from '../constants/events'; | ||
| import type { EventEmitter } from '../../emitter'; | ||
| import type { WalletInterface } from '../../../types/wallet'; | ||
@@ -27,3 +28,3 @@ export interface WalletConnectedPayload { | ||
| } | ||
| export interface AppKitEvents { | ||
| export type AppKitEvents = { | ||
| [CONNECTOR_EVENTS.CONNECTED]: WalletConnectedPayload; | ||
@@ -40,4 +41,4 @@ [CONNECTOR_EVENTS.DISCONNECTED]: WalletDisconnectedPayload; | ||
| [PLUGIN_EVENTS.REGISTERED]: PluginRegisteredPayload; | ||
| } | ||
| export type AppKitEmitter = Emitter<AppKitEvents>; | ||
| } & SharedKitEvents; | ||
| export type AppKitEmitter = EventEmitter<AppKitEvents>; | ||
| //# sourceMappingURL=events.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../src/core/app-kit/types/events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACnC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACtC,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAEzB,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACrD,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,yBAAyB,CAAC;IAG3D,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC;IACzD,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAGhE,CAAC,eAAe,CA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zD,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAGhE,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,4BAA4B,CAAC;IAGhE,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACvD,GAAG,eAAe,CAAC;AAEpB,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC"} |
@@ -12,4 +12,4 @@ /** | ||
| */ | ||
| export { Emitter } from './services/emitter'; | ||
| export type { EventPayload, AppKitEvent, EventListener } from './types/events'; | ||
| export { EventEmitter } from '@ton/walletkit'; | ||
| export type { EventPayload, KitEvent, EventListener, SharedKitEvents } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/emitter/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/emitter/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"} |
@@ -12,2 +12,2 @@ /** | ||
| */ | ||
| export { Emitter } from './services/emitter'; | ||
| export { EventEmitter } from '@ton/walletkit'; |
@@ -29,4 +29,6 @@ /** | ||
| export * from './core/network'; | ||
| export * from './core/streaming'; | ||
| export * from './connectors/tonconnect'; | ||
| export * from './swap'; | ||
| export * from './staking'; | ||
| export * from './actions'; | ||
@@ -33,0 +35,0 @@ export * from './types/connector'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAGH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AAExC,cAAc,QAAQ,CAAC;AAGvB,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,SAAS,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAGH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AAExC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,SAAS,CAAC"} |
@@ -30,4 +30,6 @@ /** | ||
| export * from './core/network'; | ||
| export * from './core/streaming'; | ||
| export * from './connectors/tonconnect'; | ||
| export * from './swap'; | ||
| export * from './staking'; | ||
| // Actions | ||
@@ -34,0 +36,0 @@ export * from './actions'; |
@@ -8,2 +8,3 @@ /** | ||
| */ | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -14,6 +15,8 @@ import type { GetBalanceByAddressOptions } from '../../actions/balances/get-balance-by-address'; | ||
| import type { GetBalanceByAddressReturnType } from '../../actions/balances/get-balance-by-address'; | ||
| import type { BalanceUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
| export type GetBalanceErrorType = Error; | ||
| export type GetBalanceByAddressData = GetBalanceQueryFnData; | ||
| export type GetBalanceByAddressQueryConfig<selectData = GetBalanceByAddressData> = Compute<ExactPartial<GetBalanceByAddressOptions>> & QueryParameter<GetBalanceQueryFnData, GetBalanceErrorType, selectData, GetBalanceByAddressQueryKey>; | ||
| export declare const getBalanceByAddressQueryOptions: <selectData = GetBalanceByAddressData>(appKit: AppKit, options?: GetBalanceByAddressQueryConfig<selectData>) => GetBalanceByAddressQueryOptions<selectData>; | ||
| export declare const getBalanceByAddressQueryOptions: <selectData = GetBalanceByAddressData>(appKit: AppKit, initialOptions?: GetBalanceByAddressQueryConfig<selectData>) => GetBalanceByAddressQueryOptions<selectData>; | ||
| export type GetBalanceQueryFnData = Compute<Awaited<GetBalanceByAddressReturnType>>; | ||
@@ -23,2 +26,9 @@ export declare const getBalanceByAddressQueryKey: (options?: Compute<ExactPartial<GetBalanceByAddressOptions>>) => GetBalanceByAddressQueryKey; | ||
| export type GetBalanceByAddressQueryOptions<selectData = GetBalanceByAddressData> = QueryOptions<GetBalanceQueryFnData, GetBalanceErrorType, selectData, GetBalanceByAddressQueryKey>; | ||
| /** | ||
| * Update the TanStack Query cache for an address balance. | ||
| */ | ||
| export declare const handleBalanceUpdate: (queryClient: QueryClient, { address, network }: { | ||
| address: string; | ||
| network: Network; | ||
| }, update: BalanceUpdate) => void; | ||
| //# sourceMappingURL=get-balance-by-address.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/balances/get-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAEnG,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D,MAAM,MAAM,8BAA8B,CAAC,UAAU,GAAG,uBAAuB,IAAI,OAAO,CACtF,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;AAExG,eAAO,MAAM,+BAA+B,GAAI,UAAU,GAAG,uBAAuB,EAChF,QAAQ,MAAM,EACd,UAAS,8BAA8B,CAAC,UAAU,CAAM,KACzD,+BAA+B,CAAC,UAAU,CAY5C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,2BAA2B,GACpC,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,2BAEF,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,uBAAuB,IAAI,YAAY,CAC5F,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,2BAA2B,CAC9B,CAAC"} | ||
| {"version":3,"file":"get-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/balances/get-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AACnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D,MAAM,MAAM,8BAA8B,CAAC,UAAU,GAAG,uBAAuB,IAAI,OAAO,CACtF,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;AAExG,eAAO,MAAM,+BAA+B,GAAI,UAAU,GAAG,uBAAuB,EAChF,QAAQ,MAAM,EACd,iBAAgB,8BAA8B,CAAC,UAAU,CAAM,KAChE,+BAA+B,CAAC,UAAU,CAe5C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,2BAA2B,GACpC,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,2BAEF,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,uBAAuB,IAAI,YAAY,CAC5F,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,2BAA2B,CAC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC5B,aAAa,WAAW,EACxB,sBAAsB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC3D,QAAQ,aAAa,SAYxB,CAAC"} |
@@ -9,4 +9,6 @@ /** | ||
| import { getBalanceByAddress } from '../../actions/balances/get-balance-by-address'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getBalanceByAddressQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork, sleep } from '../../utils'; | ||
| export const getBalanceByAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -28,1 +30,15 @@ ...options.query, | ||
| }; | ||
| /** | ||
| * Update the TanStack Query cache for an address balance. | ||
| */ | ||
| export const handleBalanceUpdate = (queryClient, { address, network }, update) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = getBalanceByAddressQueryKey({ address, network }); | ||
| queryClient.setQueryData(queryKey, update.balance); | ||
| sleep(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = getBalanceByAddressQueryKey({ address, network }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export { getBalanceByAddressQueryOptions, type GetBalanceByAddressData, type GetBalanceErrorType, type GetBalanceByAddressQueryConfig, } from './balances/get-balance-by-address'; | ||
| export { getBalanceByAddressQueryOptions, handleBalanceUpdate, type GetBalanceByAddressData, type GetBalanceErrorType, type GetBalanceByAddressQueryConfig, } from './balances/get-balance-by-address'; | ||
| export { connectMutationOptions, type ConnectMutationOptions, type ConnectParameters, type ConnectReturnType, type ConnectData, type ConnectErrorType, type ConnectOptions, type ConnectVariables, } from './connectors/connect'; | ||
@@ -14,4 +14,4 @@ export { disconnectMutationOptions, type DisconnectMutationOptions, type DisconnectParameters, type DisconnectReturnType, type DisconnectData, type DisconnectErrorType, type DisconnectOptions, type DisconnectVariables, } from './connectors/disconnect'; | ||
| export { getJettonWalletAddressQueryOptions, type GetJettonWalletAddressQueryConfig, type GetJettonWalletAddressData, type GetJettonWalletAddressErrorType, } from './jettons/get-jetton-wallet-address'; | ||
| export { getJettonBalanceByAddressQueryOptions, type GetJettonBalanceByAddressQueryConfig, type GetJettonBalanceByAddressData, type GetJettonBalanceErrorType, } from './jettons/get-jetton-balance-by-address'; | ||
| export { getJettonsByAddressQueryOptions, type GetJettonsByAddressData, type GetJettonsErrorType, type GetJettonsByAddressQueryConfig, } from './jettons/get-jettons-by-address'; | ||
| export { getJettonBalanceByAddressQueryOptions, handleJettonBalanceUpdate, type GetJettonBalanceByAddressQueryConfig, type GetJettonBalanceByAddressData, type GetJettonBalanceErrorType, } from './jettons/get-jetton-balance-by-address'; | ||
| export { getJettonsByAddressQueryOptions, handleJettonsUpdate, type GetJettonsByAddressData, type GetJettonsErrorType, type GetJettonsByAddressQueryConfig, } from './jettons/get-jettons-by-address'; | ||
| export { transferJettonMutationOptions, type TransferJettonData, type TransferJettonErrorType, type TransferJettonMutate, type TransferJettonMutateAsync, type TransferJettonMutationOptions, type TransferJettonOptions, type TransferJettonVariables, type TransferJettonParameters, type TransferJettonReturnType, } from './jettons/transfer-jetton'; | ||
@@ -27,2 +27,7 @@ export { getBlockNumberQueryOptions, type GetBlockNumberData, type GetBlockNumberErrorType, type GetBlockNumberQueryConfig, } from './network/get-block-number'; | ||
| export { buildSwapTransactionMutationOptions, type BuildSwapTransactionMutationConfig, type BuildSwapTransactionMutationOptions, type BuildSwapTransactionData, type BuildSwapTransactionErrorType, type BuildSwapTransactionMutate, type BuildSwapTransactionMutateAsync, type BuildSwapTransactionVariables, } from './swap/build-swap-transaction'; | ||
| export { getStakingProvidersQueryOptions, type GetStakingProvidersData, type GetStakingProvidersErrorType, type GetStakingProvidersQueryConfig, } from './staking/get-staking-providers'; | ||
| export { getStakingQuoteQueryOptions, type GetStakingQuoteQueryConfig, type GetStakingQuoteQueryOptions, type GetStakingQuoteData, type GetStakingQuoteErrorType, type GetStakingQuoteQueryFnData, type GetStakingQuoteQueryKey, } from './staking/get-staking-quote'; | ||
| export { getStakedBalanceQueryOptions, type GetStakedBalanceQueryConfig, type GetStakedBalanceData, type GetStakedBalanceErrorType, } from './staking/get-staked-balance'; | ||
| export { getStakingProviderInfoQueryOptions, type GetStakingProviderInfoQueryConfig, type GetStakingProviderInfoData, type GetStakingProviderInfoErrorType, } from './staking/get-staking-provider-info'; | ||
| export { buildStakeTransactionMutationOptions, type BuildStakeTransactionData, type BuildStakeTransactionErrorType, type BuildStakeTransactionMutationOptions, type BuildStakeTransactionVariables, } from './staking/build-stake-transaction'; | ||
| export { transferTonMutationOptions, type TransferTonData, type TransferTonErrorType, type TransferTonMutate, type TransferTonMutateAsync, type TransferTonMutationOptions, type TransferTonOptions, type TransferTonVariables, type TransferTonParameters, type TransferTonReturnType, } from './transaction/transfer-ton'; | ||
@@ -29,0 +34,0 @@ export { sendTransactionMutationOptions, type SendTransactionData, type SendTransactionErrorType, type SendTransactionMutate, type SendTransactionMutateAsync, type SendTransactionMutationOptions, type SendTransactionOptions, type SendTransactionVariables, type SendTransactionParameters, type SendTransactionReturnType, } from './transaction/send-transaction'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,+BAA+B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACtC,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACH,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GAC3B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACH,yBAAyB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,kCAAkC,EAClC,KAAK,iCAAiC,EACtC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,GACvC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACH,qCAAqC,EACrC,KAAK,oCAAoC,EACzC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,GACjC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACH,+BAA+B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACtC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K,+BAA+B,EACpC,KAAK,gCAAgC,GACxC,MAAM,sCAAsC,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,+BAA+B,EAC/B,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACtC,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACH,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GAC3B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACH,yBAAyB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,kCAAkC,EAClC,KAAK,iCAAiC,EACtC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,GACvC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACH,qCAAqC,EACrC,yBAAyB,EACzB,KAAK,oCAAoC,EACzC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,GACjC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACH,+BAA+B,EAC/B,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACtC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,6BAA6B,EAC7B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B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K,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,8BAA8B,EAC9B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,GACxC,MAAM,sCAAsC,CAAC"} |
@@ -9,3 +9,3 @@ /** | ||
| // Balances | ||
| export { getBalanceByAddressQueryOptions, } from './balances/get-balance-by-address'; | ||
| export { getBalanceByAddressQueryOptions, handleBalanceUpdate, } from './balances/get-balance-by-address'; | ||
| // Connectors | ||
@@ -17,4 +17,4 @@ export { connectMutationOptions, } from './connectors/connect'; | ||
| export { getJettonWalletAddressQueryOptions, } from './jettons/get-jetton-wallet-address'; | ||
| export { getJettonBalanceByAddressQueryOptions, } from './jettons/get-jetton-balance-by-address'; | ||
| export { getJettonsByAddressQueryOptions, } from './jettons/get-jettons-by-address'; | ||
| export { getJettonBalanceByAddressQueryOptions, handleJettonBalanceUpdate, } from './jettons/get-jetton-balance-by-address'; | ||
| export { getJettonsByAddressQueryOptions, handleJettonsUpdate, } from './jettons/get-jettons-by-address'; | ||
| export { transferJettonMutationOptions, } from './jettons/transfer-jetton'; | ||
@@ -34,2 +34,8 @@ // Network | ||
| export { buildSwapTransactionMutationOptions, } from './swap/build-swap-transaction'; | ||
| // Staking | ||
| export { getStakingProvidersQueryOptions, } from './staking/get-staking-providers'; | ||
| export { getStakingQuoteQueryOptions, } from './staking/get-staking-quote'; | ||
| export { getStakedBalanceQueryOptions, } from './staking/get-staked-balance'; | ||
| export { getStakingProviderInfoQueryOptions, } from './staking/get-staking-provider-info'; | ||
| export { buildStakeTransactionMutationOptions, } from './staking/build-stake-transaction'; | ||
| // Transaction | ||
@@ -36,0 +42,0 @@ export { transferTonMutationOptions, } from './transaction/transfer-ton'; |
@@ -8,2 +8,3 @@ /** | ||
| */ | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { TokenAmount } from '@ton/walletkit'; | ||
@@ -14,6 +15,8 @@ import type { AppKit } from '../../core/app-kit'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import type { JettonUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
| export type GetJettonBalanceErrorType = Error; | ||
| export type GetJettonBalanceByAddressData = GetJettonBalanceQueryFnData; | ||
| export type GetJettonBalanceByAddressQueryConfig<selectData = GetJettonBalanceByAddressData> = Compute<ExactPartial<GetJettonBalanceParameters>> & QueryParameter<GetJettonBalanceQueryFnData, GetJettonBalanceErrorType, selectData, GetJettonBalanceByAddressQueryKey>; | ||
| export declare const getJettonBalanceByAddressQueryOptions: <selectData = GetJettonBalanceByAddressData>(appKit: AppKit, options?: GetJettonBalanceByAddressQueryConfig<selectData>) => GetJettonBalanceByAddressQueryOptions<selectData>; | ||
| export declare const getJettonBalanceByAddressQueryOptions: <selectData = GetJettonBalanceByAddressData>(appKit: AppKit, initialOptions?: GetJettonBalanceByAddressQueryConfig<selectData>) => GetJettonBalanceByAddressQueryOptions<selectData>; | ||
| export type GetJettonBalanceQueryFnData = Compute<TokenAmount>; | ||
@@ -26,2 +29,10 @@ export declare const getJettonBalanceByAddressQueryKey: (options?: Compute<ExactPartial<GetJettonBalanceParameters>>) => GetJettonBalanceByAddressQueryKey; | ||
| export type GetJettonBalanceByAddressQueryOptions<selectData = GetJettonBalanceByAddressData> = QueryOptions<GetJettonBalanceQueryFnData, GetJettonBalanceErrorType, selectData, GetJettonBalanceByAddressQueryKey>; | ||
| /** | ||
| * Update the TanStack Query cache for an owner jetton balance. | ||
| */ | ||
| export declare const handleJettonBalanceUpdate: (queryClient: QueryClient, { ownerAddress, jettonAddress, network }: { | ||
| ownerAddress: string; | ||
| jettonAddress: string; | ||
| network: Network; | ||
| }, update: JettonUpdate) => void; | ||
| //# sourceMappingURL=get-jetton-balance-by-address.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-jetton-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,uBAAuB,IAAI,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE9C,MAAM,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAExE,MAAM,MAAM,oCAAoC,CAAC,UAAU,GAAG,6BAA6B,IAAI,OAAO,CAClG,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CACV,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC,CAAC;AAEN,eAAO,MAAM,qCAAqC,GAAI,UAAU,GAAG,6BAA6B,EAC5F,QAAQ,MAAM,EACd,UAAS,oCAAoC,CAAC,UAAU,CAAM,KAC/D,qCAAqC,CAAC,UAAU,CAclD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE/D,eAAO,MAAM,iCAAiC,GAC1C,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,iCAEF,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,SAAS;IACrD,gBAAgB;IAChB,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,qCAAqC,CAAC,UAAU,GAAG,6BAA6B,IAAI,YAAY,CACxG,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC,CAAC"} | ||
| {"version":3,"file":"get-jetton-balance-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-balance-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,uBAAuB,IAAI,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE9C,MAAM,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAExE,MAAM,MAAM,oCAAoC,CAAC,UAAU,GAAG,6BAA6B,IAAI,OAAO,CAClG,YAAY,CAAC,0BAA0B,CAAC,CAC3C,GACG,cAAc,CACV,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC,CAAC;AAEN,eAAO,MAAM,qCAAqC,GAAI,UAAU,GAAG,6BAA6B,EAC5F,QAAQ,MAAM,EACd,iBAAgB,oCAAoC,CAAC,UAAU,CAAM,KACtE,qCAAqC,CAAC,UAAU,CAiBlD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE/D,eAAO,MAAM,iCAAiC,GAC1C,UAAS,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAM,KAChE,iCAEF,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,SAAS;IACrD,gBAAgB;IAChB,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,qCAAqC,CAAC,UAAU,GAAG,6BAA6B,IAAI,YAAY,CACxG,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,iCAAiC,CACpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAClC,aAAa,WAAW,EACxB,0CAA0C;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC3G,QAAQ,YAAY,SAoBvB,CAAC"} |
@@ -9,4 +9,6 @@ /** | ||
| import { getJettonBalance } from '../../actions/jettons/get-jetton-balance'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getJettonBalanceByAddressQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork, sleep } from '../../utils'; | ||
| export const getJettonBalanceByAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -30,1 +32,23 @@ ...options.query, | ||
| }; | ||
| /** | ||
| * Update the TanStack Query cache for an owner jetton balance. | ||
| */ | ||
| export const handleJettonBalanceUpdate = (queryClient, { ownerAddress, jettonAddress, network }, update) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = getJettonBalanceByAddressQueryKey({ | ||
| ownerAddress, | ||
| jettonAddress, | ||
| network, | ||
| }); | ||
| queryClient.setQueryData(queryKey, update.balance); | ||
| sleep(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = getJettonBalanceByAddressQueryKey({ | ||
| ownerAddress, | ||
| jettonAddress, | ||
| network, | ||
| }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; |
@@ -15,3 +15,3 @@ /** | ||
| export type GetJettonInfoQueryConfig<selectData = GetJettonInfoData> = Compute<ExactPartial<GetJettonInfoOptions>> & QueryParameter<GetJettonInfoQueryFnData, GetJettonInfoErrorType, selectData, GetJettonInfoQueryKey>; | ||
| export declare const getJettonInfoQueryOptions: <selectData = GetJettonInfoData>(appKit: AppKit, options?: GetJettonInfoQueryConfig<selectData>) => GetJettonInfoQueryOptions<selectData>; | ||
| export declare const getJettonInfoQueryOptions: <selectData = GetJettonInfoData>(appKit: AppKit, initialOptions?: GetJettonInfoQueryConfig<selectData>) => GetJettonInfoQueryOptions<selectData>; | ||
| export type GetJettonInfoQueryFnData = Compute<Awaited<GetJettonInfoReturnType>>; | ||
@@ -18,0 +18,0 @@ export type GetJettonInfoData = GetJettonInfoQueryFnData; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-jetton-info.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-info.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,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,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAE3C,MAAM,MAAM,wBAAwB,CAAC,UAAU,GAAG,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,GAC9G,cAAc,CAAC,wBAAwB,EAAE,sBAAsB,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC;AAExG,eAAO,MAAM,yBAAyB,GAAI,UAAU,GAAG,iBAAiB,EACpE,QAAQ,MAAM,EACd,iBAAgB,wBAAwB,CAAC,UAAU,CAAM,KAC1D,yBAAyB,CAAC,UAAU,CAgBtC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAEjF,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEzD,eAAO,MAAM,qBAAqB,GAC9B,UAAS,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAM,KAC1D,qBAEF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAE1G,MAAM,MAAM,yBAAyB,CAAC,UAAU,GAAG,iBAAiB,IAAI,YAAY,CAChF,wBAAwB,EACxB,sBAAsB,EACtB,UAAU,EACV,qBAAqB,CACxB,CAAC"} |
@@ -9,4 +9,6 @@ /** | ||
| import { getJettonInfo } from '../../actions/jettons/get-jetton-info'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getJettonInfoQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
| export const getJettonInfoQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -13,0 +15,0 @@ ...options.query, |
@@ -15,3 +15,3 @@ /** | ||
| export type GetJettonWalletAddressQueryConfig<selectData = GetJettonWalletAddressData> = Compute<ExactPartial<GetJettonWalletAddressParameters>> & QueryParameter<GetJettonWalletAddressQueryFnData, GetJettonWalletAddressErrorType, selectData, GetJettonWalletAddressQueryKey>; | ||
| export declare const getJettonWalletAddressQueryOptions: <selectData = GetJettonWalletAddressData>(appKit: AppKit, options?: GetJettonWalletAddressQueryConfig<selectData>) => GetJettonWalletAddressQueryOptions<selectData>; | ||
| export declare const getJettonWalletAddressQueryOptions: <selectData = GetJettonWalletAddressData>(appKit: AppKit, initialOptions?: GetJettonWalletAddressQueryConfig<selectData>) => GetJettonWalletAddressQueryOptions<selectData>; | ||
| export type GetJettonWalletAddressQueryFnData = Compute<UserFriendlyAddress>; | ||
@@ -18,0 +18,0 @@ export type GetJettonWalletAddressData = GetJettonWalletAddressQueryFnData; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-jetton-wallet-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-wallet-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,6BAA6B,IAAI,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACzI,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAEpD,MAAM,MAAM,iCAAiC,CAAC,UAAU,GAAG,0BAA0B,IAAI,OAAO,CAC5F,YAAY,CAAC,gCAAgC,CAAC,CACjD,GACG,cAAc,CACV,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC;AAEN,eAAO,MAAM,kCAAkC,GAAI,UAAU,GAAG,0BAA0B,EACtF,QAAQ,MAAM,EACd,UAAS,iCAAiC,CAAC,UAAU,CAAM,KAC5D,kCAAkC,CAAC,UAAU,CAc/C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE7E,MAAM,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE3E,eAAO,MAAM,8BAA8B,GACvC,UAAS,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAM,KACtE,8BAEF,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,SAAS;IAClD,uBAAuB;IACvB,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAAC,UAAU,GAAG,0BAA0B,IAAI,YAAY,CAClG,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC"} | ||
| {"version":3,"file":"get-jetton-wallet-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jetton-wallet-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,6BAA6B,IAAI,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACzI,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAEpD,MAAM,MAAM,iCAAiC,CAAC,UAAU,GAAG,0BAA0B,IAAI,OAAO,CAC5F,YAAY,CAAC,gCAAgC,CAAC,CACjD,GACG,cAAc,CACV,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC;AAEN,eAAO,MAAM,kCAAkC,GAAI,UAAU,GAAG,0BAA0B,EACtF,QAAQ,MAAM,EACd,iBAAgB,iCAAiC,CAAC,UAAU,CAAM,KACnE,kCAAkC,CAAC,UAAU,CAiB/C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE7E,MAAM,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE3E,eAAO,MAAM,8BAA8B,GACvC,UAAS,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAM,KACtE,8BAEF,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,SAAS;IAClD,uBAAuB;IACvB,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAAC,UAAU,GAAG,0BAA0B,IAAI,YAAY,CAClG,iCAAiC,EACjC,+BAA+B,EAC/B,UAAU,EACV,8BAA8B,CACjC,CAAC"} |
@@ -9,4 +9,6 @@ /** | ||
| import { getJettonWalletAddress } from '../../actions/jettons/get-jetton-wallet-address'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getJettonWalletAddressQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
| export const getJettonWalletAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -13,0 +15,0 @@ ...options.query, |
@@ -8,2 +8,3 @@ /** | ||
| */ | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -14,6 +15,8 @@ import type { GetJettonsByAddressOptions } from '../../actions/jettons/get-jettons-by-address'; | ||
| import type { GetJettonsByAddressReturnType } from '../../actions/jettons/get-jettons-by-address'; | ||
| import type { JettonUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
| export type GetJettonsErrorType = Error; | ||
| export type GetJettonsByAddressData = GetJettonsQueryFnData; | ||
| export type GetJettonsByAddressQueryConfig<selectData = GetJettonsByAddressData> = Compute<ExactPartial<GetJettonsByAddressOptions>> & QueryParameter<GetJettonsQueryFnData, GetJettonsErrorType, selectData, GetJettonsByAddressQueryKey>; | ||
| export declare const getJettonsByAddressQueryOptions: <selectData = GetJettonsByAddressData>(appKit: AppKit, options?: GetJettonsByAddressQueryConfig<selectData>) => GetJettonsByAddressQueryOptions<selectData>; | ||
| export declare const getJettonsByAddressQueryOptions: <selectData = GetJettonsByAddressData>(appKit: AppKit, initialOptions?: GetJettonsByAddressQueryConfig<selectData>) => GetJettonsByAddressQueryOptions<selectData>; | ||
| export type GetJettonsQueryFnData = Compute<Awaited<GetJettonsByAddressReturnType>>; | ||
@@ -23,2 +26,9 @@ export declare const getJettonsByAddressQueryKey: (options?: Compute<ExactPartial<GetJettonsByAddressOptions>>) => GetJettonsByAddressQueryKey; | ||
| export type GetJettonsByAddressQueryOptions<selectData = GetJettonsByAddressData> = QueryOptions<GetJettonsQueryFnData, GetJettonsErrorType, selectData, GetJettonsByAddressQueryKey>; | ||
| /** | ||
| * Update the TanStack Query cache for an address jettons list. | ||
| */ | ||
| export declare const handleJettonsUpdate: (queryClient: QueryClient, { address, network }: { | ||
| address: string; | ||
| network: Network; | ||
| }, update: JettonUpdate) => void; | ||
| //# sourceMappingURL=get-jettons-by-address.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-jettons-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/jettons/get-jettons-by-address.ts"],"names":[],"mappings":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E,OAAO,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,uBAAuB,IAAI,YAAY,CAC5F,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,2BAA2B,CAC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC5B,aAAa,WAAW,EACxB,sBAAsB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC3D,QAAQ,YAAY,SA+BvB,CAAC"} |
@@ -9,4 +9,6 @@ /** | ||
| import { getJettonsByAddress } from '../../actions/jettons/get-jettons-by-address'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getJettonsByAddressQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork, compareAddress, formatUnits, sleep } from '../../utils'; | ||
| export const getJettonsByAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -28,1 +30,30 @@ ...options.query, | ||
| }; | ||
| /** | ||
| * Update the TanStack Query cache for an address jettons list. | ||
| */ | ||
| export const handleJettonsUpdate = (queryClient, { address, network }, update) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = getJettonsByAddressQueryKey({ address, network }); | ||
| const currentData = queryClient.getQueryData(queryKey); | ||
| if (currentData?.jettons) { | ||
| const jetton = currentData.jettons.find((j) => compareAddress(j.address, update.masterAddress)); | ||
| const decimals = jetton?.decimalsNumber ?? update.decimals; | ||
| if (jetton && decimals) { | ||
| const updatedJetton = { | ||
| ...jetton, | ||
| balance: formatUnits(update.rawBalance, decimals), | ||
| }; | ||
| const newJettons = currentData.jettons.map((j) => compareAddress(j.address, update.masterAddress) ? updatedJetton : j); | ||
| queryClient.setQueryData(queryKey, { | ||
| ...currentData, | ||
| jettons: newJettons, | ||
| }); | ||
| } | ||
| } | ||
| sleep(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = getJettonsByAddressQueryKey({ address, network }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; |
@@ -16,3 +16,3 @@ /** | ||
| export type GetBlockNumberQueryConfig<selectData = GetBlockNumberData> = Compute<ExactPartial<GetBlockNumberOptions>> & QueryParameter<GetBlockNumberQueryFnData, GetBlockNumberErrorType, selectData, GetBlockNumberQueryKey>; | ||
| export declare const getBlockNumberQueryOptions: <selectData = GetBlockNumberData>(appKit: AppKit, options?: GetBlockNumberQueryConfig<selectData>) => GetBlockNumberQueryOptions<selectData>; | ||
| export declare const getBlockNumberQueryOptions: <selectData = GetBlockNumberData>(appKit: AppKit, initialOptions?: GetBlockNumberQueryConfig<selectData>) => GetBlockNumberQueryOptions<selectData>; | ||
| export type GetBlockNumberQueryFnData = Compute<Awaited<GetBlockNumberReturnType>>; | ||
@@ -19,0 +19,0 @@ export declare const getBlockNumberQueryKey: (options?: Compute<ExactPartial<GetBlockNumberOptions>>) => GetBlockNumberQueryKey; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-block-number.d.ts","sourceRoot":"","sources":["../../../../src/queries/network/get-block-number.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAEvF,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,yBAAy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AK,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAE3D,MAAM,MAAM,yBAAyB,CAAC,UAAU,GAAG,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,GACjH,cAAc,CAAC,yBAAyB,EAAE,uBAAuB,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC;AAE3G,eAAO,MAAM,0BAA0B,GAAI,UAAU,GAAG,kBAAkB,EACtE,QAAQ,MAAM,EACd,iBAAgB,yBAAyB,CAAC,UAAU,CAAM,KAC3D,0BAA0B,CAAC,UAAU,CAcvC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAEnF,eAAO,MAAM,sBAAsB,GAC/B,UAAS,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAM,KAC3D,sBAEF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAE5G,MAAM,MAAM,0BAA0B,CAAC,UAAU,GAAG,kBAAkB,IAAI,YAAY,CAClF,yBAAyB,EACzB,uBAAuB,EACvB,UAAU,EACV,sBAAsB,CACzB,CAAC"} |
@@ -9,4 +9,6 @@ /** | ||
| import { getBlockNumber } from '../../actions/network/get-block-number'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getBlockNumberQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
| export const getBlockNumberQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -13,0 +15,0 @@ ...options.query, |
@@ -15,3 +15,3 @@ /** | ||
| export type GetNftQueryConfig<selectData = GetNftData> = Compute<ExactPartial<GetNftParameters>> & QueryParameter<GetNftQueryFnData, GetNftErrorType, selectData, GetNftQueryKey>; | ||
| export declare const getNftQueryOptions: <selectData = GetNftData>(appKit: AppKit, options?: GetNftQueryConfig<selectData>) => GetNftQueryOptions<selectData>; | ||
| export declare const getNftQueryOptions: <selectData = GetNftData>(appKit: AppKit, initialOptions?: GetNftQueryConfig<selectData>) => GetNftQueryOptions<selectData>; | ||
| export type GetNftQueryFnData = Compute<NFT | null>; | ||
@@ -18,0 +18,0 @@ export type GetNftData = GetNftQueryFnData; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-nft.d.ts","sourceRoot":"","sources":["../../../../src/queries/nft/get-nft.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC;AAEpC,MAAM,MAAM,iBAAiB,CAAC,UAAU,GAAG,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,GAC5F,cAAc,CAAC,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;AAEnF,eAAO,MAAM,kBAAkB,GAAI,UAAU,GAAG,UAAU,EACtD,QAAQ,MAAM,EACd,UAAS,iBAAiB,CAAC,UAAU,CAAM,KAC5C,kBAAkB,CAAC,UAAU,CAa/B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;AAEpD,MAAM,MAAM,UAAU,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AEpD,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAE3C,eAAO,MAAM,cAAc,GAAI,UAAS,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAM,KAAG,cAEtF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEvF,MAAM,MAAM,kBAAkB,CAAC,UAAU,GAAG,UAAU,IAAI,YAAY,CAClE,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,cAAc,CACjB,CAAC"} |
@@ -9,4 +9,6 @@ /** | ||
| import { getNft } from '../../actions/nft/get-nft'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getNftQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
| export const getNftQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -13,0 +15,0 @@ ...options.query, |
@@ -16,3 +16,3 @@ /** | ||
| export type GetNFTsByAddressQueryConfig<selectData = GetNFTsByAddressData> = Compute<ExactPartial<GetNftsByAddressOptions>> & QueryParameter<GetNFTsQueryFnData, GetNFTsErrorType, selectData, GetNFTsByAddressQueryKey>; | ||
| export declare const getNFTsByAddressQueryOptions: <selectData = GetNFTsByAddressData>(appKit: AppKit, options?: GetNFTsByAddressQueryConfig<selectData>) => GetNFTsByAddressQueryOptions<selectData>; | ||
| export declare const getNFTsByAddressQueryOptions: <selectData = GetNFTsByAddressData>(appKit: AppKit, initialOptions?: GetNFTsByAddressQueryConfig<selectData>) => GetNFTsByAddressQueryOptions<selectData>; | ||
| export type GetNFTsQueryFnData = Compute<Awaited<GetNftsByAddressReturnType>>; | ||
@@ -19,0 +19,0 @@ export declare const getNFTsByAddressQueryKey: (options?: Compute<ExactPartial<GetNftsByAddressOptions>>) => GetN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AC,CAAC,CAAC,CAAC;AAEzG,MAAM,MAAM,4BAA4B,CAAC,UAAU,GAAG,oBAAoB,IAAI,YAAY,CACtF,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,wBAAwB,CAC3B,CAAC"} |
@@ -9,4 +9,6 @@ /** | ||
| import { getNftsByAddress } from '../../actions/nft/get-nfts-by-address'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getNFTsByAddressQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
| export const getNFTsByAddressQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -13,0 +15,0 @@ ...options.query, |
@@ -15,3 +15,3 @@ /** | ||
| export type GetSwapQuoteQueryConfig<selectData = GetSwapQuoteData> = Compute<ExactPartial<GetSwapQuoteOptions>> & QueryParameter<GetSwapQuoteQueryFnData, GetSwapQuoteErrorType, selectData, GetSwapQuoteQueryKey>; | ||
| export declare const getSwapQuoteQueryOptions: <selectData = GetSwapQuoteData>(appKit: AppKit, options?: GetSwapQuoteQueryConfig<selectData>) => GetSwapQuoteQueryOptions<selectData>; | ||
| export declare const getSwapQuoteQueryOptions: <selectData = GetSwapQuoteData>(appKit: AppKit, initialOptions?: GetSwapQuoteQueryConfig<selectData>) => GetSwapQuoteQueryOptions<selectData>; | ||
| export type GetSwapQuoteQueryFnData = Compute<Awaited<GetSwapQuoteReturnType>>; | ||
@@ -18,0 +18,0 @@ export type GetSwapQuoteData = GetSwapQuoteQueryFnData; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-swap-quote.d.ts","sourceRoot":"","sources":["../../../../src/queries/swap/get-swap-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,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||
| export const getSwapQuoteQueryOptions = (appKit, options = {}) => { | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
| export const getSwapQuoteQueryOptions = (appKit, initialOptions = {}) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -13,0 +15,0 @@ ...options.query, |
@@ -17,3 +17,3 @@ /** | ||
| export type GetTransactionStatusQueryOptions<selectData = GetTransactionStatusData> = QueryOptions<GetTransactionStatusData, GetTransactionStatusErrorType, selectData, GetTransactionStatusQueryKey>; | ||
| export declare const getTransactionStatusQueryOptions: <selectData = GetTransactionStatusData>(appKit: AppKit, options: GetTransactionStatusParameters & GetTransactionStatusQueryConfig<selectData>) => GetTransactionStatusQueryOptions<selectData>; | ||
| export declare const getTransactionStatusQueryOptions: <selectData = GetTransactionStatusData>(appKit: AppKit, initialOptions: GetTransactionStatusParameters & GetTransactionStatusQueryConfig<selectData>) => GetTransactionStatusQueryOptions<selectData>; | ||
| //# sourceMappingURL=get-transaction-status.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"get-transaction-status.d.ts","sourceRoot":"","sources":["../../../../src/queries/transaction/get-transaction-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACR,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,CAAC;AAE9G,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAE/E,MAAM,MAAM,4BAA4B,GAAG,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAElF,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,wBAAwB,IAAI,cAAc,CAC/F,wBAAwB,EACxB,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEF,MAAM,MAAM,gCAAgC,CAAC,UAAU,GAAG,wBAAwB,IAAI,YAAY,CAC9F,wBAAwB,EACxB,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,UAAU,GAAG,wBAAwB,EAClF,QAAQ,MAAM,EACd,SAAS,8BAA8B,GAAG,+BAA+B,CAAC,UAAU,CAAC,KACtF,gCAAgC,CAAC,UAAU,CAQ7C,CAAC"} | ||
| {"version":3,"file":"get-transaction-status.d.ts","sourceRoot":"","sources":["../../../../src/queries/transaction/get-transaction-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACR,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,YAAY,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,CAAC;AAE9G,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAE/E,MAAM,MAAM,4BAA4B,GAAG,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAElF,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,wBAAwB,IAAI,cAAc,CAC/F,wBAAwB,EACxB,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEF,MAAM,MAAM,gCAAgC,CAAC,UAAU,GAAG,wBAAwB,IAAI,YAAY,CAC9F,wBAAwB,EACxB,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,UAAU,GAAG,wBAAwB,EAClF,QAAQ,MAAM,EACd,gBAAgB,8BAA8B,GAAG,+BAA+B,CAAC,UAAU,CAAC,KAC7F,gCAAgC,CAAC,UAAU,CAW7C,CAAC"} |
@@ -9,3 +9,6 @@ /** | ||
| import { getTransactionStatus } from '../../actions/transaction/get-transaction-status'; | ||
| export const getTransactionStatusQueryOptions = (appKit, options) => { | ||
| import { resolveNetwork } from '../../utils'; | ||
| export const getTransactionStatusQueryOptions = (appKit, initialOptions) => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -12,0 +15,0 @@ ...options.query, |
@@ -18,7 +18,5 @@ /** | ||
| readonly id: string; | ||
| /** Protocol type (e.g. 'tonconnect', 'ledger', 'mnemonic') */ | ||
| /** Protocol type (e.g. 'tonconnect') */ | ||
| readonly type: string; | ||
| readonly metadata: ConnectorMetadata; | ||
| /** Initialize connector (restore connections, setup event listeners) */ | ||
| initialize(emitter: AppKitEmitter, networkManager: AppKitNetworkManager): Promise<void>; | ||
| /** Cleanup connector resources */ | ||
@@ -37,2 +35,16 @@ destroy(): void; | ||
| } | ||
| /** | ||
| * Context passed to connector factory functions. | ||
| */ | ||
| export interface ConnectorFactoryContext { | ||
| networkManager: AppKitNetworkManager; | ||
| eventEmitter: AppKitEmitter; | ||
| ssr?: boolean; | ||
| } | ||
| /** Factory function that creates a connector from context */ | ||
| export type ConnectorFactory = (ctx: ConnectorFactoryContext) => Connector; | ||
| /** A connector instance or a factory that creates one */ | ||
| export type ConnectorInput = Connector | ConnectorFactory; | ||
| /** Helper for creating typed connector factories */ | ||
| export declare function createConnector(factory: ConnectorFactory): ConnectorFactory; | ||
| //# sourceMappingURL=connector.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/types/connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC,wEAAwE;IACxE,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExF,kCAAkC;IAClC,OAAO,IAAI,IAAI,CAAC;IAEhB,uBAAuB;IACvB,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD,0BAA0B;IAC1B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC,4BAA4B;IAC5B,mBAAmB,IAAI,eAAe,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"} | ||
| {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/types/connector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC,kCAAkC;IAClC,OAAO,IAAI,IAAI,CAAC;IAEhB,uBAAuB;IACvB,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD,0BAA0B;IAC1B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC,4BAA4B;IAC5B,mBAAmB,IAAI,eAAe,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,cAAc,EAAE,oBAAoB,CAAC;IACrC,YAAY,EAAE,aAAa,CAAC;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,uBAAuB,KAAK,SAAS,CAAC;AAE3E,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAE1D,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAE3E"} |
@@ -8,2 +8,5 @@ /** | ||
| */ | ||
| export {}; | ||
| /** Helper for creating typed connector factories */ | ||
| export function createConnector(factory) { | ||
| return factory; | ||
| } |
@@ -8,7 +8,7 @@ /** | ||
| */ | ||
| import type { SwapProviderInterface } from '@ton/walletkit'; | ||
| import type { SwapProviderInterface, StakingProviderInterface } from '@ton/walletkit'; | ||
| /** | ||
| * Provider configuration | ||
| */ | ||
| export type Provider = SwapProviderInterface; | ||
| export type Provider = SwapProviderInterface | StakingProviderInterface; | ||
| //# sourceMappingURL=provider.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,qBAAqB,CAAC"} | ||
| {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,qBAAqB,GAAG,wBAAwB,CAAC"} |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export { formatUnits, parseUnits } from '@ton/walletkit'; | ||
| export { formatUnits, parseUnits, compareAddress } from '@ton/walletkit'; | ||
| export * from './amount/validate-numeric-string'; | ||
@@ -11,0 +11,0 @@ export * from './arrays/key-by'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEzD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEzE,cAAc,kCAAkC,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC"} |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export { formatUnits, parseUnits } from '@ton/walletkit'; | ||
| export { formatUnits, parseUnits, compareAddress } from '@ton/walletkit'; | ||
| export * from './amount/validate-numeric-string'; | ||
@@ -11,0 +11,0 @@ export * from './arrays/key-by'; |
+112
-5
@@ -35,2 +35,31 @@ <!-- | ||
| ### `watchBalance` | ||
| Watch the TON balance of the currently selected wallet in real-time. | ||
| ```ts | ||
| const unsubscribe = watchBalance(appKit, { | ||
| onChange: (update) => { | ||
| console.log('Balance updated:', update.balance); | ||
| }, | ||
| }); | ||
| // Later: unsubscribe(); | ||
| ``` | ||
| ### `watchBalanceByAddress` | ||
| Watch the TON balance of a specific address in real-time. | ||
| ```ts | ||
| const unsubscribe = watchBalanceByAddress(appKit, { | ||
| address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c', | ||
| onChange: (update) => { | ||
| console.log('Balance by address updated:', update.balance); | ||
| }, | ||
| }); | ||
| // Later: unsubscribe(); | ||
| ``` | ||
| ## Connectors | ||
@@ -55,3 +84,3 @@ | ||
| appKit, | ||
| new TonConnectConnector({ | ||
| createTonConnectConnector({ | ||
| tonConnectOptions: { | ||
@@ -265,2 +294,14 @@ manifestUrl: 'https://tonconnect-sdk-demo-dapp.vercel.app/tonconnect-manifest.json', | ||
| ### `getApiClient` | ||
| Get the API client for a specific network. | ||
| ```ts | ||
| const apiClient = getApiClient(appKit, { | ||
| network: Network.mainnet(), | ||
| }); | ||
| console.log('API Client:', apiClient); | ||
| ``` | ||
| ### `watchNetworks` | ||
@@ -280,2 +321,11 @@ | ||
| ### `hasStreamingProvider` | ||
| Check if a real-time streaming provider is registered for a specific network. | ||
| ```ts | ||
| const isSupported = hasStreamingProvider(appKit, Network.mainnet()); | ||
| console.log('Mainnet streaming support:', isSupported); | ||
| ``` | ||
| ### `getBlockNumber` | ||
@@ -359,3 +409,3 @@ | ||
| const nft = await getNft(appKit, { | ||
| address: 'EQCA14o1-VWhS29szfbpmbu_m7A_9S4m_Ba6sAyALH_mU68j', | ||
| address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c', | ||
| }); | ||
@@ -375,3 +425,3 @@ | ||
| const tx = await createTransferNftTransaction(appKit, { | ||
| nftAddress: 'EQCA14o1-VWhS29szfbpmbu_m7A_9S4m_Ba6sAyALH_mU68j', | ||
| nftAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c', | ||
| recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c', | ||
@@ -390,3 +440,3 @@ comment: 'Gift NFT', | ||
| const result = await transferNft(appKit, { | ||
| nftAddress: 'EQCA14o1-VWhS29szfbpmbu_m7A_9S4m_Ba6sAyALH_mU68j', | ||
| nftAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c', | ||
| recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c', | ||
@@ -402,3 +452,3 @@ }); | ||
| Register a custom token swap provider in AppKit (e.g., Omniston). | ||
| Register a custom provider in AppKit (e.g., Swap or Streaming). | ||
@@ -494,2 +544,59 @@ ```ts | ||
| ## Staking | ||
| ### `getStakingProviders` | ||
| Get all available staking provider IDs. | ||
| ```ts | ||
| const providers = await getStakingProviders(appKit); | ||
| console.log('Available Staking Providers:', providers); | ||
| ``` | ||
| ### `getStakingProviderInfo` | ||
| Get information about a specific staking provider. | ||
| ```ts | ||
| const providerInfo = await getStakingProviderInfo(appKit, { | ||
| providerId: 'tonstakers', | ||
| }); | ||
| console.log('Provider Info:', providerInfo); | ||
| ``` | ||
| ### `getStakingQuote` | ||
| Get a staking or unstaking quote. | ||
| ```ts | ||
| const quote = await getStakingQuote(appKit, { | ||
| amount: '1000000000', | ||
| direction: 'stake', | ||
| }); | ||
| console.log('Staking Quote:', quote); | ||
| ``` | ||
| ### `buildStakeTransaction` | ||
| Build a stake transaction based on a quote. | ||
| ```ts | ||
| const txRequest = await buildStakeTransaction(appKit, { | ||
| quote, | ||
| userAddress, | ||
| }); | ||
| console.log('Stake Transaction:', txRequest); | ||
| ``` | ||
| ### `getStakedBalance` | ||
| Get the user's staked balance. | ||
| ```ts | ||
| const balance = await getStakedBalance(appKit, { | ||
| userAddress, | ||
| }); | ||
| console.log('Staked Balance:', balance); | ||
| ``` | ||
| ## Transaction | ||
@@ -496,0 +603,0 @@ |
@@ -44,3 +44,3 @@ <!-- | ||
| connectors: [ | ||
| new TonConnectConnector({ | ||
| createTonConnectConnector({ | ||
| tonConnectOptions: { | ||
@@ -72,3 +72,3 @@ manifestUrl: 'https://my-app.com/tonconnect-manifest.json', | ||
| }, | ||
| connectors: [new TonConnectConnector({ tonConnectUI })], | ||
| connectors: [createTonConnectConnector({ tonConnectUI })], | ||
| }); | ||
@@ -94,4 +94,4 @@ ``` | ||
| // 2. Initialize TonConnect connector | ||
| const connector = new TonConnectConnector({ | ||
| // 2. Initialize TonConnect connector function | ||
| const connector = createTonConnectConnector({ | ||
| tonConnectOptions: { | ||
@@ -98,0 +98,0 @@ manifestUrl: 'https://my-app.com/tonconnect-manifest.json', |
+23
-10
| { | ||
| "name": "@ton/appkit", | ||
| "version": "0.0.5-alpha.1", | ||
| "version": "0.0.5-alpha.2", | ||
| "description": "", | ||
@@ -53,2 +53,12 @@ "repository": { | ||
| } | ||
| }, | ||
| "./staking/tonstakers": { | ||
| "import": { | ||
| "types": "./dist/esm/staking/tonstakers/index.d.ts", | ||
| "default": "./dist/esm/staking/tonstakers/index.js" | ||
| }, | ||
| "require": { | ||
| "types": "./dist/cjs/staking/tonstakers/index.d.ts", | ||
| "default": "./dist/cjs/staking/tonstakers/index.js" | ||
| } | ||
| } | ||
@@ -59,9 +69,12 @@ }, | ||
| "queries": [ | ||
| "./dist/cjs/queries/index.d.ts" | ||
| "./dist/esm/queries/index.d.ts" | ||
| ], | ||
| "swap/omniston": [ | ||
| "./dist/cjs/swap/omniston/index.d.ts" | ||
| "./dist/esm/swap/omniston/index.d.ts" | ||
| ], | ||
| "swap/dedust": [ | ||
| "./dist/cjs/swap/dedust/index.d.ts" | ||
| "./dist/esm/swap/dedust/index.d.ts" | ||
| ], | ||
| "staking/tonstakers": [ | ||
| "./dist/esm/staking/tonstakers/index.d.ts" | ||
| ] | ||
@@ -71,3 +84,3 @@ } | ||
| "dependencies": { | ||
| "@ton/walletkit": "0.0.12-alpha.1" | ||
| "@ton/walletkit": "0.0.12-alpha.2" | ||
| }, | ||
@@ -95,7 +108,7 @@ "peerDependencies": { | ||
| "devDependencies": { | ||
| "@tanstack/query-core": "5.90.20", | ||
| "@ton/core": "^0.63.0", | ||
| "@tonconnect/ui": "2.4.1", | ||
| "typescript": "~5.8.3", | ||
| "vitest": "^4.0.17" | ||
| "@tanstack/query-core": "5.99.0", | ||
| "@ton/core": "0.63.1", | ||
| "@tonconnect/ui": "2.4.4", | ||
| "typescript": "~5.9.3", | ||
| "vitest": "^4.1.4" | ||
| }, | ||
@@ -102,0 +115,0 @@ "scripts": { |
+1
-1
@@ -59,3 +59,3 @@ <!-- | ||
| connectors: [ | ||
| new TonConnectConnector({ | ||
| createTonConnectConnector({ | ||
| tonConnectOptions: { | ||
@@ -62,0 +62,0 @@ manifestUrl: 'https://tonconnect-sdk-demo-dapp.vercel.app/tonconnect-manifest.json', |
@@ -10,5 +10,5 @@ /** | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { Connector } from '../../types/connector'; | ||
| import type { ConnectorInput } from '../../types/connector'; | ||
| export type AddConnectorParameters = Connector; | ||
| export type AddConnectorParameters = ConnectorInput; | ||
@@ -20,4 +20,4 @@ export type AddConnectorReturnType = () => void; | ||
| */ | ||
| export const addConnector = (appKit: AppKit, connector: AddConnectorParameters): AddConnectorReturnType => { | ||
| return appKit.addConnector(connector); | ||
| export const addConnector = (appKit: AppKit, connectorFn: AddConnectorParameters): AddConnectorReturnType => { | ||
| return appKit.addConnector(connectorFn); | ||
| }; |
+48
-0
@@ -15,3 +15,9 @@ /** | ||
| } from './balances/get-balance-by-address'; | ||
| export { | ||
| watchBalanceByAddress, | ||
| type WatchBalanceByAddressOptions, | ||
| type WatchBalanceByAddressReturnType, | ||
| } from './balances/watch-balance-by-address'; | ||
| export { getBalance, type GetBalanceOptions, type GetBalanceReturnType } from './balances/get-balance'; | ||
| export { watchBalance, type WatchBalanceOptions, type WatchBalanceReturnType } from './balances/watch-balance'; | ||
@@ -56,3 +62,9 @@ // Connectors | ||
| } from './jettons/get-jettons-by-address'; | ||
| export { | ||
| watchJettonsByAddress, | ||
| type WatchJettonsByAddressOptions, | ||
| type WatchJettonsByAddressReturnType, | ||
| } from './jettons/watch-jettons-by-address'; | ||
| export { getJettons, type GetJettonsOptions, type GetJettonsReturnType } from './jettons/get-jettons'; | ||
| export { watchJettons, type WatchJettonsOptions, type WatchJettonsReturnType } from './jettons/watch-jettons'; | ||
| export { | ||
@@ -72,2 +84,3 @@ createTransferJettonTransaction, | ||
| export { getNetwork, type GetNetworkReturnType } from './network/get-network'; | ||
| export { getApiClient, type GetApiClientOptions, type GetApiClientReturnType } from './network/get-api-client'; | ||
| export { watchNetworks, type WatchNetworksParameters, type WatchNetworksReturnType } from './network/watch-networks'; | ||
@@ -86,2 +99,3 @@ export { getBlockNumber, type GetBlockNumberOptions, type GetBlockNumberReturnType } from './network/get-block-number'; | ||
| } from './network/watch-default-network'; | ||
| export { hasStreamingProvider, type HasStreamingProviderReturnType } from './network/has-streaming-provider'; | ||
@@ -115,2 +129,26 @@ // NFT | ||
| // Staking | ||
| export { getStakingManager, type GetStakingManagerReturnType } from './staking/get-staking-manager'; | ||
| export { getStakingProviders, type GetStakingProvidersReturnType } from './staking/get-staking-providers'; | ||
| export { | ||
| getStakingQuote, | ||
| type GetStakingQuoteOptions, | ||
| type GetStakingQuoteReturnType, | ||
| } from './staking/get-staking-quote'; | ||
| export { | ||
| buildStakeTransaction, | ||
| type BuildStakeTransactionOptions, | ||
| type BuildStakeTransactionReturnType, | ||
| } from './staking/build-stake-transaction'; | ||
| export { | ||
| getStakedBalance, | ||
| type GetStakedBalanceOptions, | ||
| type GetStakedBalanceReturnType, | ||
| } from './staking/get-staked-balance'; | ||
| export { | ||
| getStakingProviderInfo, | ||
| type GetStakingProviderInfoOptions, | ||
| type GetStakingProviderInfoReturnType, | ||
| } from './staking/get-staking-provider-info'; | ||
| // Transactions | ||
@@ -130,2 +168,12 @@ export { | ||
| export { | ||
| watchTransactionsByAddress, | ||
| type WatchTransactionsByAddressOptions, | ||
| type WatchTransactionsByAddressReturnType, | ||
| } from './transaction/watch-transactions-by-address'; | ||
| export { | ||
| watchTransactions, | ||
| type WatchTransactionsOptions, | ||
| type WatchTransactionsReturnType, | ||
| } from './transaction/watch-transactions'; | ||
| export { | ||
| createTransferNftTransaction, | ||
@@ -132,0 +180,0 @@ type CreateTransferNftTransactionParameters, |
@@ -9,6 +9,7 @@ /** | ||
| import type { Provider } from '../../types/provider'; | ||
| import type { ProviderInput } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type RegisterProviderOptions = Provider; | ||
| export type RegisterProviderOptions = ProviderInput; | ||
@@ -15,0 +16,0 @@ /** |
@@ -12,3 +12,2 @@ /** | ||
| import type { Network } from '../../../types/network'; | ||
| import { TonConnectWalletAdapter } from '../adapters/ton-connect-wallet-adapter'; | ||
@@ -18,5 +17,4 @@ import { CONNECTOR_EVENTS, NETWORKS_EVENTS } from '../../../core/app-kit'; | ||
| import type { WalletInterface } from '../../../types/wallet'; | ||
| import type { AppKitEmitter } from '../../../core/app-kit'; | ||
| import { TONCONNECT_DEFAULT_CONNECTOR_ID } from '../constants/id'; | ||
| import type { AppKitNetworkManager } from '../../../core/network'; | ||
| import { createConnector } from '../../../types/connector'; | ||
@@ -30,82 +28,119 @@ export interface TonConnectConnectorConfig { | ||
| export class TonConnectConnector implements Connector { | ||
| readonly id: string; | ||
| readonly type = 'tonconnect'; | ||
| readonly metadata: ConnectorMetadata; | ||
| readonly tonConnectUI: TonConnectUI; | ||
| export type TonConnectConnector = Connector & { | ||
| type: 'tonconnect'; | ||
| tonConnectUI: TonConnectUI | null; | ||
| }; | ||
| private emitter: AppKitEmitter | null = null; | ||
| private unsubscribeTonConnect: (() => void) | null = null; | ||
| export const createTonConnectConnector = (config: TonConnectConnectorConfig) => { | ||
| return createConnector(({ eventEmitter, networkManager, ssr }): TonConnectConnector => { | ||
| let originalTonConnectUI: TonConnectUI | null = null; | ||
| let unsubscribeTonConnect: (() => void) | null = null; | ||
| constructor(config: TonConnectConnectorConfig) { | ||
| if (config.tonConnectOptions && config.tonConnectUI) { | ||
| // eslint-disable-next-line no-console | ||
| console.warn( | ||
| 'TonConnectConnector: both tonConnectOptions and tonConnectUI are provided, using tonConnectUI', | ||
| ); | ||
| } | ||
| const id = config.id ?? TONCONNECT_DEFAULT_CONNECTOR_ID; | ||
| this.id = config.id ?? TONCONNECT_DEFAULT_CONNECTOR_ID; | ||
| this.tonConnectUI = config?.tonConnectUI ?? new TonConnectUI(config.tonConnectOptions); | ||
| this.metadata = { | ||
| name: 'TonConnect', | ||
| iconUrl: 'https://avatars.githubusercontent.com/u/113980577', | ||
| ...config.metadata, | ||
| }; | ||
| } | ||
| function getTonConnectUI() { | ||
| if (originalTonConnectUI) { | ||
| return originalTonConnectUI; | ||
| } | ||
| async initialize(emitter: AppKitEmitter, networkManager: AppKitNetworkManager): Promise<void> { | ||
| this.emitter = emitter; | ||
| if (ssr && typeof window === 'undefined') { | ||
| return null; | ||
| } | ||
| // Subscribe to TonConnect status changes | ||
| this.unsubscribeTonConnect = this.tonConnectUI.onStatusChange((wallet) => { | ||
| const wallets = this.getConnectedWallets(); | ||
| if (wallet) { | ||
| this.emitter?.emit(CONNECTOR_EVENTS.CONNECTED, { wallets, connectorId: this.id }, this.id); | ||
| // check if we have pre-defined UI | ||
| if (config.tonConnectUI) { | ||
| originalTonConnectUI = config.tonConnectUI; | ||
| } else { | ||
| this.emitter?.emit(CONNECTOR_EVENTS.DISCONNECTED, { connectorId: this.id }, this.id); | ||
| originalTonConnectUI = new TonConnectUI(config.tonConnectOptions); | ||
| } | ||
| }); | ||
| // Set default network and subscribe to changes | ||
| this.tonConnectUI.setConnectionNetwork(networkManager.getDefaultNetwork()?.chainId); | ||
| this.emitter?.on(NETWORKS_EVENTS.DEFAULT_CHANGED, ({ payload }) => { | ||
| this.tonConnectUI.setConnectionNetwork(payload.network?.chainId); | ||
| }); | ||
| setupListeners(); | ||
| // Restore existing connection | ||
| await this.tonConnectUI.connector.restoreConnection(); | ||
| } | ||
| // restore connection | ||
| if (originalTonConnectUI) { | ||
| originalTonConnectUI.connector.restoreConnection(); | ||
| } | ||
| destroy(): void { | ||
| this.unsubscribeTonConnect?.(); | ||
| this.unsubscribeTonConnect = null; | ||
| this.emitter = null; | ||
| } | ||
| return originalTonConnectUI; | ||
| } | ||
| async connectWallet(network?: Network): Promise<void> { | ||
| this.tonConnectUI.setConnectionNetwork(network?.chainId); | ||
| await this.tonConnectUI.openModal(); | ||
| } | ||
| function getConnectedWallets(): WalletInterface[] { | ||
| const ui = getTonConnectUI(); | ||
| async disconnectWallet(): Promise<void> { | ||
| await this.tonConnectUI.disconnect(); | ||
| } | ||
| if (ui && ui.connected && ui.wallet) { | ||
| const wallet = ui.wallet; | ||
| getConnectedWallets(): WalletInterface[] { | ||
| if (this.tonConnectUI.connected && this.tonConnectUI.wallet) { | ||
| const wallet = this.tonConnectUI.wallet; | ||
| return [ | ||
| new TonConnectWalletAdapter({ | ||
| connectorId: id, | ||
| tonConnectWallet: wallet, | ||
| tonConnectUI: ui, | ||
| }), | ||
| ]; | ||
| } | ||
| const walletAdapter = new TonConnectWalletAdapter({ | ||
| connectorId: this.id, | ||
| tonConnectWallet: wallet, | ||
| tonConnectUI: this.tonConnectUI, | ||
| return []; | ||
| } | ||
| function setupListeners() { | ||
| if (!originalTonConnectUI || unsubscribeTonConnect) { | ||
| return; | ||
| } | ||
| unsubscribeTonConnect = originalTonConnectUI.onStatusChange((wallet) => { | ||
| const wallets = getConnectedWallets(); | ||
| if (wallet) { | ||
| eventEmitter.emit(CONNECTOR_EVENTS.CONNECTED, { wallets, connectorId: id }, id); | ||
| } else { | ||
| eventEmitter.emit(CONNECTOR_EVENTS.DISCONNECTED, { connectorId: id }, id); | ||
| } | ||
| }); | ||
| return [walletAdapter]; | ||
| // Set default network and subscribe to changes | ||
| originalTonConnectUI.setConnectionNetwork(networkManager.getDefaultNetwork()?.chainId); | ||
| eventEmitter.on(NETWORKS_EVENTS.DEFAULT_CHANGED, ({ payload }) => { | ||
| if (originalTonConnectUI) { | ||
| originalTonConnectUI.setConnectionNetwork(payload.network?.chainId); | ||
| } | ||
| }); | ||
| } | ||
| return []; | ||
| } | ||
| } | ||
| return { | ||
| id, | ||
| type: 'tonconnect', | ||
| metadata: { | ||
| name: 'TonConnect', | ||
| iconUrl: 'https://avatars.githubusercontent.com/u/113980577', | ||
| ...config.metadata, | ||
| }, | ||
| get tonConnectUI() { | ||
| return getTonConnectUI(); | ||
| }, | ||
| getConnectedWallets, | ||
| async connectWallet(): Promise<void> { | ||
| const ui = getTonConnectUI(); | ||
| if (ui) { | ||
| await ui.openModal(); | ||
| } | ||
| }, | ||
| async disconnectWallet(): Promise<void> { | ||
| const ui = getTonConnectUI(); | ||
| if (ui) { | ||
| await ui.disconnect(); | ||
| } | ||
| }, | ||
| destroy() { | ||
| unsubscribeTonConnect?.(); | ||
| originalTonConnectUI = null; | ||
| }, | ||
| }; | ||
| }); | ||
| }; |
@@ -29,4 +29,7 @@ /** | ||
| // Connector exports | ||
| export { TonConnectConnector } from './connectors/ton-connect-connector'; | ||
| export { | ||
| createTonConnectConnector, | ||
| type TonConnectConnectorConfig, | ||
| type TonConnectConnector, | ||
| } from './connectors/ton-connect-connector'; | ||
| export { TONCONNECT_DEFAULT_CONNECTOR_ID } from './constants/id'; | ||
| export type { TonConnectConnectorConfig } from './connectors/ton-connect-connector'; |
@@ -9,8 +9,8 @@ /** | ||
| import { SwapManager } from '@ton/walletkit'; | ||
| import type { Provider } from 'src/types/provider'; | ||
| import { SwapManager, StreamingManager } from '@ton/walletkit'; | ||
| import type { ProviderInput, SwapProviderInterface, StakingProviderInterface } from '@ton/walletkit'; | ||
| import type { AppKitConfig } from '../types/config'; | ||
| import type { Connector } from '../../../types/connector'; | ||
| import { Emitter } from '../../emitter'; | ||
| import { StakingManager } from '../../../staking'; | ||
| import type { Connector, ConnectorFactoryContext, ConnectorInput } from '../../../types/connector'; | ||
| import { EventEmitter } from '../../emitter'; | ||
| import { CONNECTOR_EVENTS, WALLETS_EVENTS } from '../constants/events'; | ||
@@ -22,2 +22,3 @@ import type { AppKitEmitter, AppKitEvents } from '../types/events'; | ||
| import { Network } from '../../../types/network'; | ||
| import type { AppKitConfig } from '../types/config'; | ||
@@ -33,4 +34,6 @@ /** | ||
| readonly swapManager: SwapManager; | ||
| readonly stakingManager: StakingManager; | ||
| readonly networkManager: AppKitNetworkManager; | ||
| readonly streamingManager: StreamingManager; | ||
| readonly config: AppKitConfig; | ||
@@ -41,3 +44,3 @@ | ||
| this.emitter = new Emitter<AppKitEvents>(); | ||
| this.emitter = new EventEmitter<AppKitEvents>(); | ||
| this.emitter.on(CONNECTOR_EVENTS.CONNECTED, this.updateWalletsFromConnectors.bind(this)); | ||
@@ -53,7 +56,10 @@ this.emitter.on(CONNECTOR_EVENTS.DISCONNECTED, this.updateWalletsFromConnectors.bind(this)); | ||
| this.walletsManager = new WalletsManager(this.emitter); | ||
| this.swapManager = new SwapManager(); | ||
| this.swapManager = new SwapManager(() => this.createFactoryContext()); | ||
| this.stakingManager = new StakingManager(() => this.createFactoryContext()); | ||
| this.streamingManager = new StreamingManager(() => this.createFactoryContext()); | ||
| if (config.connectors) { | ||
| config.connectors.forEach((connector) => { | ||
| this.addConnector(connector); | ||
| config.connectors.forEach((input) => { | ||
| this.addConnector(input); | ||
| }); | ||
@@ -63,4 +69,4 @@ } | ||
| if (config.providers) { | ||
| config.providers.forEach((provider) => { | ||
| this.registerProvider(provider); | ||
| config.providers.forEach((input) => { | ||
| this.registerProvider(input); | ||
| }); | ||
@@ -70,6 +76,11 @@ } | ||
| createFactoryContext(): ConnectorFactoryContext { | ||
| return { eventEmitter: this.emitter, networkManager: this.networkManager, ssr: this.config?.ssr }; | ||
| } | ||
| /** | ||
| * Add a wallet connector | ||
| */ | ||
| addConnector(connector: Connector): () => void { | ||
| addConnector(input: ConnectorInput): () => void { | ||
| const connector = typeof input === 'function' ? input(this.createFactoryContext()) : input; | ||
| const id = connector.id; | ||
@@ -83,3 +94,2 @@ const oldConnector = this.connectors.find((c) => c.id === id); | ||
| this.connectors.push(connector); | ||
| connector.initialize(this.emitter, this.networkManager); | ||
@@ -107,7 +117,11 @@ return () => { | ||
| */ | ||
| registerProvider(provider: Provider): void { | ||
| registerProvider(input: ProviderInput): void { | ||
| const provider = typeof input === 'function' ? input(this.createFactoryContext()) : input; | ||
| switch (provider.type) { | ||
| case 'swap': | ||
| this.swapManager.registerProvider(provider); | ||
| this.swapManager.registerProvider(provider as SwapProviderInterface); | ||
| break; | ||
| case 'staking': | ||
| this.stakingManager.registerProvider(provider as StakingProviderInterface); | ||
| break; | ||
| default: | ||
@@ -114,0 +128,0 @@ throw new Error('Unknown provider type'); |
@@ -9,6 +9,5 @@ /** | ||
| import type { NetworkAdapters } from '@ton/walletkit'; | ||
| import type { NetworkAdapters, ProviderInput } from '@ton/walletkit'; | ||
| import type { Connector } from '../../../types/connector'; | ||
| import type { Provider } from '../../../types/provider'; | ||
| import type { ConnectorInput } from '../../../types/connector'; | ||
| import type { Network } from '../../../types/network'; | ||
@@ -30,2 +29,7 @@ | ||
| /** | ||
| * Wallet connectors | ||
| */ | ||
| connectors?: ConnectorInput[]; | ||
| /** | ||
| * Default network for wallet connections. | ||
@@ -37,4 +41,8 @@ * If set, connectors (e.g. TonConnect) will enforce this network when connecting. | ||
| connectors?: Connector[]; | ||
| providers?: Provider[]; | ||
| providers?: ProviderInput[]; | ||
| /** | ||
| * Enable server-side rendering support | ||
| */ | ||
| ssr?: boolean; | ||
| } |
@@ -9,5 +9,6 @@ /** | ||
| import type { SharedKitEvents } from '../../emitter'; | ||
| import type { CONNECTOR_EVENTS, WALLETS_EVENTS, PLUGIN_EVENTS, NETWORKS_EVENTS } from '../constants/events'; | ||
| import type { Network } from '../../../types/network'; | ||
| import type { Emitter } from '../../emitter'; | ||
| import type { CONNECTOR_EVENTS, WALLETS_EVENTS, PLUGIN_EVENTS, NETWORKS_EVENTS } from '../constants/events'; | ||
| import type { EventEmitter } from '../../emitter'; | ||
| import type { WalletInterface } from '../../../types/wallet'; | ||
@@ -33,3 +34,3 @@ | ||
| export interface AppKitEvents { | ||
| export type AppKitEvents = { | ||
| // Connector events | ||
@@ -49,4 +50,4 @@ [CONNECTOR_EVENTS.CONNECTED]: WalletConnectedPayload; | ||
| [PLUGIN_EVENTS.REGISTERED]: PluginRegisteredPayload; | ||
| } | ||
| } & SharedKitEvents; | ||
| export type AppKitEmitter = Emitter<AppKitEvents>; | ||
| export type AppKitEmitter = EventEmitter<AppKitEvents>; |
@@ -13,4 +13,4 @@ /** | ||
| */ | ||
| export { Emitter } from './services/emitter'; | ||
| export { EventEmitter } from '@ton/walletkit'; | ||
| export type { EventPayload, AppKitEvent, EventListener } from './types/events'; | ||
| export type { EventPayload, KitEvent, EventListener, SharedKitEvents } from '@ton/walletkit'; |
+2
-0
@@ -32,5 +32,7 @@ /** | ||
| export * from './core/network'; | ||
| export * from './core/streaming'; | ||
| export * from './connectors/tonconnect'; | ||
| export * from './swap'; | ||
| export * from './staking'; | ||
@@ -37,0 +39,0 @@ // Actions |
@@ -9,2 +9,4 @@ /** | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -15,4 +17,6 @@ import { getBalanceByAddress } from '../../actions/balances/get-balance-by-address'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork, sleep } from '../../utils'; | ||
| import type { GetBalanceByAddressReturnType } from '../../actions/balances/get-balance-by-address'; | ||
| import type { BalanceUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
@@ -30,4 +34,7 @@ export type GetBalanceErrorType = Error; | ||
| appKit: AppKit, | ||
| options: GetBalanceByAddressQueryConfig<selectData> = {}, | ||
| initialOptions: GetBalanceByAddressQueryConfig<selectData> = {}, | ||
| ): GetBalanceByAddressQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -62,1 +69,21 @@ ...options.query, | ||
| >; | ||
| /** | ||
| * Update the TanStack Query cache for an address balance. | ||
| */ | ||
| export const handleBalanceUpdate = ( | ||
| queryClient: QueryClient, | ||
| { address, network }: { address: string; network: Network }, | ||
| update: BalanceUpdate, | ||
| ) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = getBalanceByAddressQueryKey({ address, network }); | ||
| queryClient.setQueryData(queryKey, update.balance); | ||
| sleep(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = getBalanceByAddressQueryKey({ address, network }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; |
+39
-0
@@ -12,2 +12,3 @@ /** | ||
| getBalanceByAddressQueryOptions, | ||
| handleBalanceUpdate, | ||
| type GetBalanceByAddressData, | ||
@@ -55,2 +56,3 @@ type GetBalanceErrorType, | ||
| getJettonBalanceByAddressQueryOptions, | ||
| handleJettonBalanceUpdate, | ||
| type GetJettonBalanceByAddressQueryConfig, | ||
@@ -62,2 +64,3 @@ type GetJettonBalanceByAddressData, | ||
| getJettonsByAddressQueryOptions, | ||
| handleJettonsUpdate, | ||
| type GetJettonsByAddressData, | ||
@@ -168,2 +171,38 @@ type GetJettonsErrorType, | ||
| // Staking | ||
| export { | ||
| getStakingProvidersQueryOptions, | ||
| type GetStakingProvidersData, | ||
| type GetStakingProvidersErrorType, | ||
| type GetStakingProvidersQueryConfig, | ||
| } from './staking/get-staking-providers'; | ||
| export { | ||
| getStakingQuoteQueryOptions, | ||
| type GetStakingQuoteQueryConfig, | ||
| type GetStakingQuoteQueryOptions, | ||
| type GetStakingQuoteData, | ||
| type GetStakingQuoteErrorType, | ||
| type GetStakingQuoteQueryFnData, | ||
| type GetStakingQuoteQueryKey, | ||
| } from './staking/get-staking-quote'; | ||
| export { | ||
| getStakedBalanceQueryOptions, | ||
| type GetStakedBalanceQueryConfig, | ||
| type GetStakedBalanceData, | ||
| type GetStakedBalanceErrorType, | ||
| } from './staking/get-staked-balance'; | ||
| export { | ||
| getStakingProviderInfoQueryOptions, | ||
| type GetStakingProviderInfoQueryConfig, | ||
| type GetStakingProviderInfoData, | ||
| type GetStakingProviderInfoErrorType, | ||
| } from './staking/get-staking-provider-info'; | ||
| export { | ||
| buildStakeTransactionMutationOptions, | ||
| type BuildStakeTransactionData, | ||
| type BuildStakeTransactionErrorType, | ||
| type BuildStakeTransactionMutationOptions, | ||
| type BuildStakeTransactionVariables, | ||
| } from './staking/build-stake-transaction'; | ||
| // Transaction | ||
@@ -170,0 +209,0 @@ export { |
@@ -9,2 +9,3 @@ /** | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { TokenAmount } from '@ton/walletkit'; | ||
@@ -17,3 +18,5 @@ | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork, sleep } from '../../utils'; | ||
| import type { JettonUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
@@ -36,4 +39,7 @@ export type GetJettonBalanceErrorType = Error; | ||
| appKit: AppKit, | ||
| options: GetJettonBalanceByAddressQueryConfig<selectData> = {}, | ||
| initialOptions: GetJettonBalanceByAddressQueryConfig<selectData> = {}, | ||
| ): GetJettonBalanceByAddressQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -73,1 +79,29 @@ ...options.query, | ||
| >; | ||
| /** | ||
| * Update the TanStack Query cache for an owner jetton balance. | ||
| */ | ||
| export const handleJettonBalanceUpdate = ( | ||
| queryClient: QueryClient, | ||
| { ownerAddress, jettonAddress, network }: { ownerAddress: string; jettonAddress: string; network: Network }, | ||
| update: JettonUpdate, | ||
| ) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = getJettonBalanceByAddressQueryKey({ | ||
| ownerAddress, | ||
| jettonAddress, | ||
| network, | ||
| }); | ||
| queryClient.setQueryData(queryKey, update.balance); | ||
| sleep(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = getJettonBalanceByAddressQueryKey({ | ||
| ownerAddress, | ||
| jettonAddress, | ||
| network, | ||
| }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; |
@@ -15,3 +15,3 @@ /** | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
@@ -25,4 +25,7 @@ export type GetJettonInfoErrorType = Error; | ||
| appKit: AppKit, | ||
| options: GetJettonInfoQueryConfig<selectData> = {}, | ||
| initialOptions: GetJettonInfoQueryConfig<selectData> = {}, | ||
| ): GetJettonInfoQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -29,0 +32,0 @@ ...options.query, |
@@ -16,3 +16,3 @@ /** | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
@@ -33,4 +33,7 @@ export type GetJettonWalletAddressErrorType = Error; | ||
| appKit: AppKit, | ||
| options: GetJettonWalletAddressQueryConfig<selectData> = {}, | ||
| initialOptions: GetJettonWalletAddressQueryConfig<selectData> = {}, | ||
| ): GetJettonWalletAddressQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -37,0 +40,0 @@ ...options.query, |
@@ -9,2 +9,4 @@ /** | ||
| import type { QueryClient } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -15,4 +17,6 @@ import { getJettonsByAddress } from '../../actions/jettons/get-jettons-by-address'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork, compareAddress, formatUnits, sleep } from '../../utils'; | ||
| import type { GetJettonsByAddressReturnType } from '../../actions/jettons/get-jettons-by-address'; | ||
| import type { JettonUpdate } from '../../core/streaming'; | ||
| import type { Network } from '../../types/network'; | ||
@@ -30,4 +34,7 @@ export type GetJettonsErrorType = Error; | ||
| appKit: AppKit, | ||
| options: GetJettonsByAddressQueryConfig<selectData> = {}, | ||
| initialOptions: GetJettonsByAddressQueryConfig<selectData> = {}, | ||
| ): GetJettonsByAddressQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -63,1 +70,40 @@ ...options.query, | ||
| >; | ||
| /** | ||
| * Update the TanStack Query cache for an address jettons list. | ||
| */ | ||
| export const handleJettonsUpdate = ( | ||
| queryClient: QueryClient, | ||
| { address, network }: { address: string; network: Network }, | ||
| update: JettonUpdate, | ||
| ) => { | ||
| if (update.status === 'finalized') { | ||
| const queryKey = getJettonsByAddressQueryKey({ address, network }); | ||
| const currentData = queryClient.getQueryData(queryKey) as GetJettonsByAddressData | undefined; | ||
| if (currentData?.jettons) { | ||
| const jetton = currentData.jettons.find((j) => compareAddress(j.address, update.masterAddress)); | ||
| const decimals = jetton?.decimalsNumber ?? update.decimals; | ||
| if (jetton && decimals) { | ||
| const updatedJetton = { | ||
| ...jetton, | ||
| balance: formatUnits(update.rawBalance, decimals), | ||
| }; | ||
| const newJettons = currentData.jettons.map((j) => | ||
| compareAddress(j.address, update.masterAddress) ? updatedJetton : j, | ||
| ); | ||
| queryClient.setQueryData(queryKey, { | ||
| ...currentData, | ||
| jettons: newJettons, | ||
| }); | ||
| } | ||
| } | ||
| sleep(5000).then(() => queryClient.invalidateQueries({ queryKey })); | ||
| } | ||
| if (update.status === 'invalidated') { | ||
| const queryKey = getJettonsByAddressQueryKey({ address, network }); | ||
| queryClient.invalidateQueries({ queryKey }); | ||
| } | ||
| }; |
@@ -14,3 +14,3 @@ /** | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
| import type { GetBlockNumberReturnType } from '../../actions/network/get-block-number'; | ||
@@ -27,4 +27,7 @@ | ||
| appKit: AppKit, | ||
| options: GetBlockNumberQueryConfig<selectData> = {}, | ||
| initialOptions: GetBlockNumberQueryConfig<selectData> = {}, | ||
| ): GetBlockNumberQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -31,0 +34,0 @@ ...options.query, |
@@ -16,3 +16,3 @@ /** | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
@@ -26,4 +26,7 @@ export type GetNftErrorType = Error; | ||
| appKit: AppKit, | ||
| options: GetNftQueryConfig<selectData> = {}, | ||
| initialOptions: GetNftQueryConfig<selectData> = {}, | ||
| ): GetNftQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -30,0 +33,0 @@ ...options.query, |
@@ -14,3 +14,3 @@ /** | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
| import type { GetNftsByAddressReturnType } from '../../actions/nft/get-nfts-by-address'; | ||
@@ -29,4 +29,7 @@ | ||
| appKit: AppKit, | ||
| options: GetNFTsByAddressQueryConfig<selectData> = {}, | ||
| initialOptions: GetNFTsByAddressQueryConfig<selectData> = {}, | ||
| ): GetNFTsByAddressQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -33,0 +36,0 @@ ...options.query, |
@@ -15,3 +15,3 @@ /** | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| import { filterQueryOptions, resolveNetwork } from '../../utils'; | ||
@@ -25,4 +25,7 @@ export type GetSwapQuoteErrorType = Error; | ||
| appKit: AppKit, | ||
| options: GetSwapQuoteQueryConfig<selectData> = {}, | ||
| initialOptions: GetSwapQuoteQueryConfig<selectData> = {}, | ||
| ): GetSwapQuoteQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -29,0 +32,0 @@ ...options.query, |
@@ -18,2 +18,3 @@ /** | ||
| import type { Compute } from '../../types/utils'; | ||
| import { resolveNetwork } from '../../utils'; | ||
@@ -42,4 +43,7 @@ export type { GetTransactionStatusErrorType, GetTransactionStatusParameters, GetTransactionStatusReturnType }; | ||
| appKit: AppKit, | ||
| options: GetTransactionStatusParameters & GetTransactionStatusQueryConfig<selectData>, | ||
| initialOptions: GetTransactionStatusParameters & GetTransactionStatusQueryConfig<selectData>, | ||
| ): GetTransactionStatusQueryOptions<selectData> => { | ||
| const network = resolveNetwork(appKit, initialOptions.network); | ||
| const options = { ...initialOptions, network }; | ||
| return { | ||
@@ -46,0 +50,0 @@ ...options.query, |
@@ -21,3 +21,3 @@ /** | ||
| /** Protocol type (e.g. 'tonconnect', 'ledger', 'mnemonic') */ | ||
| /** Protocol type (e.g. 'tonconnect') */ | ||
| readonly type: string; | ||
@@ -27,5 +27,2 @@ | ||
| /** Initialize connector (restore connections, setup event listeners) */ | ||
| initialize(emitter: AppKitEmitter, networkManager: AppKitNetworkManager): Promise<void>; | ||
| /** Cleanup connector resources */ | ||
@@ -48,1 +45,21 @@ destroy(): void; | ||
| } | ||
| /** | ||
| * Context passed to connector factory functions. | ||
| */ | ||
| export interface ConnectorFactoryContext { | ||
| networkManager: AppKitNetworkManager; | ||
| eventEmitter: AppKitEmitter; | ||
| ssr?: boolean; | ||
| } | ||
| /** Factory function that creates a connector from context */ | ||
| export type ConnectorFactory = (ctx: ConnectorFactoryContext) => Connector; | ||
| /** A connector instance or a factory that creates one */ | ||
| export type ConnectorInput = Connector | ConnectorFactory; | ||
| /** Helper for creating typed connector factories */ | ||
| export function createConnector(factory: ConnectorFactory): ConnectorFactory { | ||
| return factory; | ||
| } |
@@ -9,3 +9,3 @@ /** | ||
| import type { SwapProviderInterface } from '@ton/walletkit'; | ||
| import type { SwapProviderInterface, StakingProviderInterface } from '@ton/walletkit'; | ||
@@ -15,2 +15,2 @@ /** | ||
| */ | ||
| export type Provider = SwapProviderInterface; | ||
| export type Provider = SwapProviderInterface | StakingProviderInterface; |
@@ -9,3 +9,3 @@ /** | ||
| export { formatUnits, parseUnits } from '@ton/walletkit'; | ||
| export { formatUnits, parseUnits, compareAddress } from '@ton/walletkit'; | ||
@@ -12,0 +12,0 @@ export * from './amount/validate-numeric-string'; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { EventListener, EventPayload } from '../types/events'; | ||
| export declare class Emitter<Events extends { | ||
| [K in keyof Events]: EventPayload; | ||
| }> { | ||
| private listeners; | ||
| emit<K extends keyof Events>(type: K, payload: Events[K], source: string): void; | ||
| on<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): () => void; | ||
| off<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): void; | ||
| once<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): () => void; | ||
| } | ||
| //# sourceMappingURL=emitter.d.ts.map |
| {"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../../../../src/core/emitter/services/emitter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAe,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEhF,qBAAa,OAAO,CAAC,MAAM,SAAS;KAAG,CAAC,IAAI,MAAM,MAAM,GAAG,YAAY;CAAE;IACrE,OAAO,CAAC,SAAS,CAAyC;IAE1D,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAiB/E,EAAE,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;IAUnF,GAAG,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAI9E,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;CAQxF"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Emitter = void 0; | ||
| class Emitter { | ||
| constructor() { | ||
| this.listeners = new Map(); | ||
| } | ||
| emit(type, payload, source) { | ||
| const event = { | ||
| type: type, | ||
| payload, | ||
| source, | ||
| timestamp: Date.now(), | ||
| }; | ||
| const listeners = this.listeners.get(type); | ||
| if (listeners) { | ||
| listeners.forEach((listener) => { | ||
| listener(event); | ||
| }); | ||
| } | ||
| } | ||
| on(type, listener) { | ||
| if (!this.listeners.has(type)) { | ||
| this.listeners.set(type, new Set()); | ||
| } | ||
| this.listeners.get(type).add(listener); | ||
| return () => this.off(type, listener); | ||
| } | ||
| off(type, listener) { | ||
| this.listeners.get(type)?.delete(listener); | ||
| } | ||
| once(type, listener) { | ||
| const wrapper = (event) => { | ||
| this.off(type, wrapper); | ||
| listener(event); | ||
| }; | ||
| return this.on(type, wrapper); | ||
| } | ||
| } | ||
| exports.Emitter = Emitter; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export type EventPayload = object; | ||
| export interface AppKitEvent<T extends EventPayload = EventPayload> { | ||
| type: string; | ||
| payload: T; | ||
| source: string; | ||
| timestamp: number; | ||
| } | ||
| export type EventListener<T extends EventPayload = EventPayload> = (event: AppKitEvent<T>) => void; | ||
| //# sourceMappingURL=events.d.ts.map |
| {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../src/core/emitter/types/events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { EventListener, EventPayload } from '../types/events'; | ||
| export declare class Emitter<Events extends { | ||
| [K in keyof Events]: EventPayload; | ||
| }> { | ||
| private listeners; | ||
| emit<K extends keyof Events>(type: K, payload: Events[K], source: string): void; | ||
| on<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): () => void; | ||
| off<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): void; | ||
| once<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): () => void; | ||
| } | ||
| //# sourceMappingURL=emitter.d.ts.map |
| {"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../../../../src/core/emitter/services/emitter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAe,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEhF,qBAAa,OAAO,CAAC,MAAM,SAAS;KAAG,CAAC,IAAI,MAAM,MAAM,GAAG,YAAY;CAAE;IACrE,OAAO,CAAC,SAAS,CAAyC;IAE1D,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAiB/E,EAAE,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;IAUnF,GAAG,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAI9E,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;CAQxF"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export class Emitter { | ||
| constructor() { | ||
| this.listeners = new Map(); | ||
| } | ||
| emit(type, payload, source) { | ||
| const event = { | ||
| type: type, | ||
| payload, | ||
| source, | ||
| timestamp: Date.now(), | ||
| }; | ||
| const listeners = this.listeners.get(type); | ||
| if (listeners) { | ||
| listeners.forEach((listener) => { | ||
| listener(event); | ||
| }); | ||
| } | ||
| } | ||
| on(type, listener) { | ||
| if (!this.listeners.has(type)) { | ||
| this.listeners.set(type, new Set()); | ||
| } | ||
| this.listeners.get(type).add(listener); | ||
| return () => this.off(type, listener); | ||
| } | ||
| off(type, listener) { | ||
| this.listeners.get(type)?.delete(listener); | ||
| } | ||
| once(type, listener) { | ||
| const wrapper = (event) => { | ||
| this.off(type, wrapper); | ||
| listener(event); | ||
| }; | ||
| return this.on(type, wrapper); | ||
| } | ||
| } |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export type EventPayload = object; | ||
| export interface AppKitEvent<T extends EventPayload = EventPayload> { | ||
| type: string; | ||
| payload: T; | ||
| source: string; | ||
| timestamp: number; | ||
| } | ||
| export type EventListener<T extends EventPayload = EventPayload> = (event: AppKitEvent<T>) => void; | ||
| //# sourceMappingURL=events.d.ts.map |
| {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../src/core/emitter/types/events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC"} |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export {}; |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| import type { EventListener, AppKitEvent, EventPayload } from '../types/events'; | ||
| export class Emitter<Events extends { [K in keyof Events]: EventPayload }> { | ||
| private listeners = new Map<keyof Events, Set<unknown>>(); | ||
| emit<K extends keyof Events>(type: K, payload: Events[K], source: string): void { | ||
| const event: AppKitEvent<Events[K]> = { | ||
| type: type as string, | ||
| payload, | ||
| source, | ||
| timestamp: Date.now(), | ||
| }; | ||
| const listeners = this.listeners.get(type); | ||
| if (listeners) { | ||
| listeners.forEach((listener) => { | ||
| (listener as EventListener<Events[K]>)(event); | ||
| }); | ||
| } | ||
| } | ||
| on<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): () => void { | ||
| if (!this.listeners.has(type)) { | ||
| this.listeners.set(type, new Set()); | ||
| } | ||
| this.listeners.get(type)!.add(listener as unknown); | ||
| return () => this.off(type, listener); | ||
| } | ||
| off<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): void { | ||
| this.listeners.get(type)?.delete(listener as unknown); | ||
| } | ||
| once<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): () => void { | ||
| const wrapper = (event: AppKitEvent<Events[K]>) => { | ||
| this.off(type, wrapper); | ||
| listener(event); | ||
| }; | ||
| return this.on(type, wrapper); | ||
| } | ||
| } |
| /** | ||
| * Copyright (c) TonTech. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| */ | ||
| export type EventPayload = object; | ||
| export interface AppKitEvent<T extends EventPayload = EventPayload> { | ||
| type: string; | ||
| payload: T; | ||
| source: string; | ||
| timestamp: number; | ||
| } | ||
| export type EventListener<T extends EventPayload = EventPayload> = (event: AppKitEvent<T>) => void; |
970611
22.57%1015
17.21%18437
20.82%+ Added
- Removed