@ton/appkit 0.0.5-alpha.1 → 0.0.5-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +18 -0
- package/CLAUDE.md +10 -0
- package/README.md +1 -1
- package/dist/cjs/actions/balances/watch-balance-by-address.d.ts +21 -0
- package/dist/cjs/actions/balances/watch-balance-by-address.d.ts.map +1 -0
- package/dist/cjs/actions/balances/watch-balance-by-address.js +22 -0
- package/dist/cjs/actions/balances/watch-balance.d.ts +19 -0
- package/dist/cjs/actions/balances/watch-balance.d.ts.map +1 -0
- package/dist/cjs/actions/balances/watch-balance.js +44 -0
- package/dist/cjs/actions/connectors/add-connector.d.ts +3 -3
- package/dist/cjs/actions/connectors/add-connector.d.ts.map +1 -1
- package/dist/cjs/actions/connectors/add-connector.js +2 -2
- package/dist/cjs/actions/index.d.ts +14 -0
- package/dist/cjs/actions/index.d.ts.map +1 -1
- package/dist/cjs/actions/index.js +31 -1
- package/dist/cjs/actions/jettons/watch-jettons-by-address.d.ts +21 -0
- package/dist/cjs/actions/jettons/watch-jettons-by-address.d.ts.map +1 -0
- package/dist/cjs/actions/jettons/watch-jettons-by-address.js +22 -0
- package/dist/cjs/actions/jettons/watch-jettons.d.ts +19 -0
- package/dist/cjs/actions/jettons/watch-jettons.d.ts.map +1 -0
- package/dist/cjs/actions/jettons/watch-jettons.js +44 -0
- package/dist/cjs/actions/network/get-api-client.d.ts +19 -0
- package/dist/cjs/actions/network/get-api-client.d.ts.map +1 -0
- package/dist/cjs/actions/network/get-api-client.js +17 -0
- package/dist/cjs/actions/network/has-streaming-provider.d.ts +15 -0
- package/dist/cjs/actions/network/has-streaming-provider.d.ts.map +1 -0
- package/dist/cjs/actions/network/has-streaming-provider.js +17 -0
- package/dist/cjs/actions/providers/register-provider.d.ts +2 -2
- package/dist/cjs/actions/providers/register-provider.d.ts.map +1 -1
- package/dist/cjs/actions/staking/build-stake-transaction.d.ts +19 -0
- package/dist/cjs/actions/staking/build-stake-transaction.d.ts.map +1 -0
- package/dist/cjs/actions/staking/build-stake-transaction.js +17 -0
- package/dist/cjs/actions/staking/get-staked-balance.d.ts +20 -0
- package/dist/cjs/actions/staking/get-staked-balance.d.ts.map +1 -0
- package/dist/cjs/actions/staking/get-staked-balance.js +18 -0
- package/dist/cjs/actions/staking/get-staking-manager.d.ts +15 -0
- package/dist/cjs/actions/staking/get-staking-manager.d.ts.map +1 -0
- package/dist/cjs/actions/staking/get-staking-manager.js +17 -0
- package/dist/cjs/actions/staking/get-staking-provider-info.d.ts +19 -0
- package/dist/cjs/actions/staking/get-staking-provider-info.d.ts.map +1 -0
- package/dist/cjs/actions/staking/get-staking-provider-info.js +18 -0
- package/dist/cjs/actions/staking/get-staking-providers.d.ts +14 -0
- package/dist/cjs/actions/staking/get-staking-providers.d.ts.map +1 -0
- package/dist/cjs/actions/staking/get-staking-providers.js +17 -0
- package/dist/cjs/actions/staking/get-staking-quote.d.ts +18 -0
- package/dist/cjs/actions/staking/get-staking-quote.d.ts.map +1 -0
- package/dist/cjs/actions/staking/get-staking-quote.js +22 -0
- package/dist/cjs/actions/transaction/watch-transactions-by-address.d.ts +21 -0
- package/dist/cjs/actions/transaction/watch-transactions-by-address.d.ts.map +1 -0
- package/dist/cjs/actions/transaction/watch-transactions-by-address.js +22 -0
- package/dist/cjs/actions/transaction/watch-transactions.d.ts +19 -0
- package/dist/cjs/actions/transaction/watch-transactions.d.ts.map +1 -0
- package/dist/cjs/actions/transaction/watch-transactions.js +44 -0
- package/dist/cjs/connectors/tonconnect/connectors/ton-connect-connector.d.ts +5 -18
- package/dist/cjs/connectors/tonconnect/connectors/ton-connect-connector.d.ts.map +1 -1
- package/dist/cjs/connectors/tonconnect/connectors/ton-connect-connector.js +90 -59
- package/dist/cjs/connectors/tonconnect/index.d.ts +1 -2
- package/dist/cjs/connectors/tonconnect/index.d.ts.map +1 -1
- package/dist/cjs/connectors/tonconnect/index.js +2 -2
- package/dist/cjs/core/app-kit/services/app-kit.d.ts +10 -6
- package/dist/cjs/core/app-kit/services/app-kit.d.ts.map +1 -1
- package/dist/cjs/core/app-kit/services/app-kit.js +19 -9
- package/dist/cjs/core/app-kit/types/config.d.ts +11 -5
- package/dist/cjs/core/app-kit/types/config.d.ts.map +1 -1
- package/dist/cjs/core/app-kit/types/events.d.ts +6 -5
- package/dist/cjs/core/app-kit/types/events.d.ts.map +1 -1
- package/dist/cjs/core/emitter/index.d.ts +2 -2
- package/dist/cjs/core/emitter/index.d.ts.map +1 -1
- package/dist/cjs/core/emitter/index.js +3 -3
- package/dist/cjs/core/streaming/index.d.ts +10 -0
- package/dist/cjs/core/streaming/index.d.ts.map +1 -0
- package/dist/cjs/core/streaming/index.js +16 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/queries/balances/get-balance-by-address.d.ts +11 -1
- package/dist/cjs/queries/balances/get-balance-by-address.d.ts.map +1 -1
- package/dist/cjs/queries/balances/get-balance-by-address.js +19 -2
- package/dist/cjs/queries/index.d.ts +8 -3
- package/dist/cjs/queries/index.d.ts.map +1 -1
- package/dist/cjs/queries/index.js +15 -1
- package/dist/cjs/queries/jettons/get-jetton-balance-by-address.d.ts +12 -1
- package/dist/cjs/queries/jettons/get-jetton-balance-by-address.d.ts.map +1 -1
- package/dist/cjs/queries/jettons/get-jetton-balance-by-address.js +27 -2
- package/dist/cjs/queries/jettons/get-jetton-info.d.ts +1 -1
- package/dist/cjs/queries/jettons/get-jetton-info.d.ts.map +1 -1
- package/dist/cjs/queries/jettons/get-jetton-info.js +3 -1
- package/dist/cjs/queries/jettons/get-jetton-wallet-address.d.ts +1 -1
- package/dist/cjs/queries/jettons/get-jetton-wallet-address.d.ts.map +1 -1
- package/dist/cjs/queries/jettons/get-jetton-wallet-address.js +3 -1
- package/dist/cjs/queries/jettons/get-jettons-by-address.d.ts +11 -1
- package/dist/cjs/queries/jettons/get-jettons-by-address.d.ts.map +1 -1
- package/dist/cjs/queries/jettons/get-jettons-by-address.js +34 -2
- package/dist/cjs/queries/network/get-block-number.d.ts +1 -1
- package/dist/cjs/queries/network/get-block-number.d.ts.map +1 -1
- package/dist/cjs/queries/network/get-block-number.js +3 -1
- package/dist/cjs/queries/nft/get-nft.d.ts +1 -1
- package/dist/cjs/queries/nft/get-nft.d.ts.map +1 -1
- package/dist/cjs/queries/nft/get-nft.js +3 -1
- package/dist/cjs/queries/nft/get-nfts-by-address.d.ts +1 -1
- package/dist/cjs/queries/nft/get-nfts-by-address.d.ts.map +1 -1
- package/dist/cjs/queries/nft/get-nfts-by-address.js +3 -1
- package/dist/cjs/queries/staking/build-stake-transaction.d.ts +21 -0
- package/dist/cjs/queries/staking/build-stake-transaction.d.ts.map +1 -0
- package/dist/cjs/queries/staking/build-stake-transaction.js +21 -0
- package/dist/cjs/queries/staking/get-staked-balance.d.ts +21 -0
- package/dist/cjs/queries/staking/get-staked-balance.d.ts.map +1 -0
- package/dist/cjs/queries/staking/get-staked-balance.js +31 -0
- package/dist/cjs/queries/staking/get-staking-provider-info.d.ts +24 -0
- package/dist/cjs/queries/staking/get-staking-provider-info.d.ts.map +1 -0
- package/dist/cjs/queries/staking/get-staking-provider-info.js +27 -0
- package/dist/cjs/queries/staking/get-staking-providers.d.ts +20 -0
- package/dist/cjs/queries/staking/get-staking-providers.d.ts.map +1 -0
- package/dist/cjs/queries/staking/get-staking-providers.js +25 -0
- package/dist/cjs/queries/staking/get-staking-quote.d.ts +21 -0
- package/dist/cjs/queries/staking/get-staking-quote.d.ts.map +1 -0
- package/dist/cjs/queries/staking/get-staking-quote.js +31 -0
- package/dist/{esm/core/emitter/types/events.js → cjs/queries/streaming-updates.test.d.ts} +1 -0
- package/dist/cjs/queries/streaming-updates.test.d.ts.map +1 -0
- package/dist/cjs/queries/streaming-updates.test.js +87 -0
- package/dist/cjs/queries/swap/get-swap-quote.d.ts +1 -1
- package/dist/cjs/queries/swap/get-swap-quote.d.ts.map +1 -1
- package/dist/cjs/queries/swap/get-swap-quote.js +3 -1
- package/dist/cjs/queries/transaction/get-transaction-status.d.ts +1 -1
- package/dist/cjs/queries/transaction/get-transaction-status.d.ts.map +1 -1
- package/dist/cjs/queries/transaction/get-transaction-status.js +4 -1
- package/dist/cjs/staking/index.d.ts +10 -0
- package/dist/cjs/staking/index.d.ts.map +1 -0
- package/dist/cjs/staking/index.js +15 -0
- package/dist/cjs/staking/tonstakers/index.d.ts +9 -0
- package/dist/cjs/staking/tonstakers/index.d.ts.map +1 -0
- package/dist/cjs/staking/tonstakers/index.js +24 -0
- package/dist/cjs/types/connector.d.ts +15 -3
- package/dist/cjs/types/connector.d.ts.map +1 -1
- package/dist/cjs/types/connector.js +5 -0
- package/dist/cjs/types/provider.d.ts +2 -2
- package/dist/cjs/types/provider.d.ts.map +1 -1
- package/dist/cjs/utils/index.d.ts +1 -1
- package/dist/cjs/utils/index.d.ts.map +1 -1
- package/dist/cjs/utils/index.js +2 -1
- package/dist/esm/actions/balances/watch-balance-by-address.d.ts +21 -0
- package/dist/esm/actions/balances/watch-balance-by-address.d.ts.map +1 -0
- package/dist/esm/actions/balances/watch-balance-by-address.js +18 -0
- package/dist/esm/actions/balances/watch-balance.d.ts +19 -0
- package/dist/esm/actions/balances/watch-balance.d.ts.map +1 -0
- package/dist/esm/actions/balances/watch-balance.js +40 -0
- package/dist/esm/actions/connectors/add-connector.d.ts +3 -3
- package/dist/esm/actions/connectors/add-connector.d.ts.map +1 -1
- package/dist/esm/actions/connectors/add-connector.js +2 -2
- package/dist/esm/actions/index.d.ts +14 -0
- package/dist/esm/actions/index.d.ts.map +1 -1
- package/dist/esm/actions/index.js +15 -0
- package/dist/esm/actions/jettons/watch-jettons-by-address.d.ts +21 -0
- package/dist/esm/actions/jettons/watch-jettons-by-address.d.ts.map +1 -0
- package/dist/esm/actions/jettons/watch-jettons-by-address.js +18 -0
- package/dist/esm/actions/jettons/watch-jettons.d.ts +19 -0
- package/dist/esm/actions/jettons/watch-jettons.d.ts.map +1 -0
- package/dist/esm/actions/jettons/watch-jettons.js +40 -0
- package/dist/esm/actions/network/get-api-client.d.ts +19 -0
- package/dist/esm/actions/network/get-api-client.d.ts.map +1 -0
- package/dist/esm/actions/network/get-api-client.js +13 -0
- package/dist/esm/actions/network/has-streaming-provider.d.ts +15 -0
- package/dist/esm/actions/network/has-streaming-provider.d.ts.map +1 -0
- package/dist/esm/actions/network/has-streaming-provider.js +13 -0
- package/dist/esm/actions/providers/register-provider.d.ts +2 -2
- package/dist/esm/actions/providers/register-provider.d.ts.map +1 -1
- package/dist/esm/actions/staking/build-stake-transaction.d.ts +19 -0
- package/dist/esm/actions/staking/build-stake-transaction.d.ts.map +1 -0
- package/dist/esm/actions/staking/build-stake-transaction.js +13 -0
- package/dist/esm/actions/staking/get-staked-balance.d.ts +20 -0
- package/dist/esm/actions/staking/get-staked-balance.d.ts.map +1 -0
- package/dist/esm/actions/staking/get-staked-balance.js +14 -0
- package/dist/esm/actions/staking/get-staking-manager.d.ts +15 -0
- package/dist/esm/actions/staking/get-staking-manager.d.ts.map +1 -0
- package/dist/esm/actions/staking/get-staking-manager.js +13 -0
- package/dist/esm/actions/staking/get-staking-provider-info.d.ts +19 -0
- package/dist/esm/actions/staking/get-staking-provider-info.d.ts.map +1 -0
- package/dist/esm/actions/staking/get-staking-provider-info.js +14 -0
- package/dist/esm/actions/staking/get-staking-providers.d.ts +14 -0
- package/dist/esm/actions/staking/get-staking-providers.d.ts.map +1 -0
- package/dist/esm/actions/staking/get-staking-providers.js +13 -0
- package/dist/esm/actions/staking/get-staking-quote.d.ts +18 -0
- package/dist/esm/actions/staking/get-staking-quote.d.ts.map +1 -0
- package/dist/esm/actions/staking/get-staking-quote.js +18 -0
- package/dist/esm/actions/transaction/watch-transactions-by-address.d.ts +21 -0
- package/dist/esm/actions/transaction/watch-transactions-by-address.d.ts.map +1 -0
- package/dist/esm/actions/transaction/watch-transactions-by-address.js +18 -0
- package/dist/esm/actions/transaction/watch-transactions.d.ts +19 -0
- package/dist/esm/actions/transaction/watch-transactions.d.ts.map +1 -0
- package/dist/esm/actions/transaction/watch-transactions.js +40 -0
- package/dist/esm/connectors/tonconnect/connectors/ton-connect-connector.d.ts +5 -18
- package/dist/esm/connectors/tonconnect/connectors/ton-connect-connector.d.ts.map +1 -1
- package/dist/esm/connectors/tonconnect/connectors/ton-connect-connector.js +88 -57
- package/dist/esm/connectors/tonconnect/index.d.ts +1 -2
- package/dist/esm/connectors/tonconnect/index.d.ts.map +1 -1
- package/dist/esm/connectors/tonconnect/index.js +1 -1
- package/dist/esm/core/app-kit/services/app-kit.d.ts +10 -6
- package/dist/esm/core/app-kit/services/app-kit.d.ts.map +1 -1
- package/dist/esm/core/app-kit/services/app-kit.js +21 -11
- package/dist/esm/core/app-kit/types/config.d.ts +11 -5
- package/dist/esm/core/app-kit/types/config.d.ts.map +1 -1
- package/dist/esm/core/app-kit/types/events.d.ts +6 -5
- package/dist/esm/core/app-kit/types/events.d.ts.map +1 -1
- package/dist/esm/core/emitter/index.d.ts +2 -2
- package/dist/esm/core/emitter/index.d.ts.map +1 -1
- package/dist/esm/core/emitter/index.js +1 -1
- package/dist/esm/core/streaming/index.d.ts +10 -0
- package/dist/esm/core/streaming/index.d.ts.map +1 -0
- package/dist/esm/core/streaming/index.js +8 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/queries/balances/get-balance-by-address.d.ts +11 -1
- package/dist/esm/queries/balances/get-balance-by-address.d.ts.map +1 -1
- package/dist/esm/queries/balances/get-balance-by-address.js +18 -2
- package/dist/esm/queries/index.d.ts +8 -3
- package/dist/esm/queries/index.d.ts.map +1 -1
- package/dist/esm/queries/index.js +9 -3
- package/dist/esm/queries/jettons/get-jetton-balance-by-address.d.ts +12 -1
- package/dist/esm/queries/jettons/get-jetton-balance-by-address.d.ts.map +1 -1
- package/dist/esm/queries/jettons/get-jetton-balance-by-address.js +26 -2
- package/dist/esm/queries/jettons/get-jetton-info.d.ts +1 -1
- package/dist/esm/queries/jettons/get-jetton-info.d.ts.map +1 -1
- package/dist/esm/queries/jettons/get-jetton-info.js +4 -2
- package/dist/esm/queries/jettons/get-jetton-wallet-address.d.ts +1 -1
- package/dist/esm/queries/jettons/get-jetton-wallet-address.d.ts.map +1 -1
- package/dist/esm/queries/jettons/get-jetton-wallet-address.js +4 -2
- package/dist/esm/queries/jettons/get-jettons-by-address.d.ts +11 -1
- package/dist/esm/queries/jettons/get-jettons-by-address.d.ts.map +1 -1
- package/dist/esm/queries/jettons/get-jettons-by-address.js +33 -2
- package/dist/esm/queries/network/get-block-number.d.ts +1 -1
- package/dist/esm/queries/network/get-block-number.d.ts.map +1 -1
- package/dist/esm/queries/network/get-block-number.js +4 -2
- package/dist/esm/queries/nft/get-nft.d.ts +1 -1
- package/dist/esm/queries/nft/get-nft.d.ts.map +1 -1
- package/dist/esm/queries/nft/get-nft.js +4 -2
- package/dist/esm/queries/nft/get-nfts-by-address.d.ts +1 -1
- package/dist/esm/queries/nft/get-nfts-by-address.d.ts.map +1 -1
- package/dist/esm/queries/nft/get-nfts-by-address.js +4 -2
- package/dist/esm/queries/staking/build-stake-transaction.d.ts +21 -0
- package/dist/esm/queries/staking/build-stake-transaction.d.ts.map +1 -0
- package/dist/esm/queries/staking/build-stake-transaction.js +17 -0
- package/dist/esm/queries/staking/get-staked-balance.d.ts +21 -0
- package/dist/esm/queries/staking/get-staked-balance.d.ts.map +1 -0
- package/dist/esm/queries/staking/get-staked-balance.js +26 -0
- package/dist/esm/queries/staking/get-staking-provider-info.d.ts +24 -0
- package/dist/esm/queries/staking/get-staking-provider-info.d.ts.map +1 -0
- package/dist/esm/queries/staking/get-staking-provider-info.js +22 -0
- package/dist/esm/queries/staking/get-staking-providers.d.ts +20 -0
- package/dist/esm/queries/staking/get-staking-providers.d.ts.map +1 -0
- package/dist/esm/queries/staking/get-staking-providers.js +20 -0
- package/dist/esm/queries/staking/get-staking-quote.d.ts +21 -0
- package/dist/esm/queries/staking/get-staking-quote.d.ts.map +1 -0
- package/dist/esm/queries/staking/get-staking-quote.js +26 -0
- package/dist/{cjs/core/emitter/types/events.js → esm/queries/streaming-updates.test.d.ts} +2 -2
- package/dist/esm/queries/streaming-updates.test.d.ts.map +1 -0
- package/dist/esm/queries/streaming-updates.test.js +85 -0
- package/dist/esm/queries/swap/get-swap-quote.d.ts +1 -1
- package/dist/esm/queries/swap/get-swap-quote.d.ts.map +1 -1
- package/dist/esm/queries/swap/get-swap-quote.js +4 -2
- package/dist/esm/queries/transaction/get-transaction-status.d.ts +1 -1
- package/dist/esm/queries/transaction/get-transaction-status.d.ts.map +1 -1
- package/dist/esm/queries/transaction/get-transaction-status.js +4 -1
- package/dist/esm/staking/index.d.ts +10 -0
- package/dist/esm/staking/index.d.ts.map +1 -0
- package/dist/esm/staking/index.js +8 -0
- package/dist/esm/staking/tonstakers/index.d.ts +9 -0
- package/dist/esm/staking/tonstakers/index.d.ts.map +1 -0
- package/dist/esm/staking/tonstakers/index.js +8 -0
- package/dist/esm/types/connector.d.ts +15 -3
- package/dist/esm/types/connector.d.ts.map +1 -1
- package/dist/esm/types/connector.js +4 -1
- package/dist/esm/types/provider.d.ts +2 -2
- package/dist/esm/types/provider.d.ts.map +1 -1
- package/dist/esm/utils/index.d.ts +1 -1
- package/dist/esm/utils/index.d.ts.map +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/docs/actions.md +112 -5
- package/docs/connectors.md +4 -4
- package/docs/staking.md +58 -0
- package/package.json +23 -10
- package/src/actions/balances/watch-balance-by-address.ts +35 -0
- package/src/actions/balances/watch-balance.ts +56 -0
- package/src/actions/connectors/add-connector.ts +4 -4
- package/src/actions/index.ts +48 -0
- package/src/actions/jettons/watch-jettons-by-address.ts +35 -0
- package/src/actions/jettons/watch-jettons.ts +56 -0
- package/src/actions/network/get-api-client.ts +22 -0
- package/src/actions/network/has-streaming-provider.ts +19 -0
- package/src/actions/providers/register-provider.ts +3 -2
- package/src/actions/staking/build-stake-transaction.ts +28 -0
- package/src/actions/staking/get-staked-balance.ts +34 -0
- package/src/actions/staking/get-staking-manager.ts +20 -0
- package/src/actions/staking/get-staking-provider-info.ts +29 -0
- package/src/actions/staking/get-staking-providers.ts +18 -0
- package/src/actions/staking/get-staking-quote.ts +30 -0
- package/src/actions/transaction/watch-transactions-by-address.ts +35 -0
- package/src/actions/transaction/watch-transactions.ts +56 -0
- package/src/connectors/tonconnect/connectors/ton-connect-connector.ts +109 -74
- package/src/connectors/tonconnect/index.ts +5 -2
- package/src/core/app-kit/services/app-kit.ts +29 -15
- package/src/core/app-kit/types/config.ts +13 -5
- package/src/core/app-kit/types/events.ts +6 -5
- package/src/core/emitter/index.ts +2 -2
- package/src/core/streaming/index.ts +30 -0
- package/src/index.ts +2 -0
- package/src/queries/balances/get-balance-by-address.ts +29 -2
- package/src/queries/index.ts +39 -0
- package/src/queries/jettons/get-jetton-balance-by-address.ts +36 -2
- package/src/queries/jettons/get-jetton-info.ts +5 -2
- package/src/queries/jettons/get-jetton-wallet-address.ts +5 -2
- package/src/queries/jettons/get-jettons-by-address.ts +48 -2
- package/src/queries/network/get-block-number.ts +5 -2
- package/src/queries/nft/get-nft.ts +5 -2
- package/src/queries/nft/get-nfts-by-address.ts +5 -2
- package/src/queries/staking/build-stake-transaction.ts +79 -0
- package/src/queries/staking/get-staked-balance.ts +60 -0
- package/src/queries/staking/get-staking-provider-info.ts +63 -0
- package/src/queries/staking/get-staking-providers.ts +52 -0
- package/src/queries/staking/get-staking-quote.ts +60 -0
- package/src/queries/streaming-updates.test.ts +104 -0
- package/src/queries/swap/get-swap-quote.ts +5 -2
- package/src/queries/transaction/get-transaction-status.ts +5 -1
- package/src/staking/index.ts +21 -0
- package/src/staking/tonstakers/index.ts +9 -0
- package/src/types/connector.ts +21 -4
- package/src/types/provider.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/dist/cjs/core/emitter/services/emitter.d.ts +0 -18
- package/dist/cjs/core/emitter/services/emitter.d.ts.map +0 -1
- package/dist/cjs/core/emitter/services/emitter.js +0 -47
- package/dist/cjs/core/emitter/types/events.d.ts +0 -16
- package/dist/cjs/core/emitter/types/events.d.ts.map +0 -1
- package/dist/esm/core/emitter/services/emitter.d.ts +0 -18
- package/dist/esm/core/emitter/services/emitter.d.ts.map +0 -1
- package/dist/esm/core/emitter/services/emitter.js +0 -43
- package/dist/esm/core/emitter/types/events.d.ts +0 -16
- package/dist/esm/core/emitter/types/events.d.ts.map +0 -1
- package/src/core/emitter/services/emitter.ts +0 -53
- package/src/core/emitter/types/events.ts +0 -18
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,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"}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { getJettonWalletAddress } from '../../actions/jettons/get-jetton-wallet-address';
|
|
9
|
-
import { filterQueryOptions } from '../../utils';
|
|
10
|
-
export const getJettonWalletAddressQueryOptions = (appKit,
|
|
9
|
+
import { filterQueryOptions, resolveNetwork } from '../../utils';
|
|
10
|
+
export const getJettonWalletAddressQueryOptions = (appKit, initialOptions = {}) => {
|
|
11
|
+
const network = resolveNetwork(appKit, initialOptions.network);
|
|
12
|
+
const options = { ...initialOptions, network };
|
|
11
13
|
return {
|
|
12
14
|
...options.query,
|
|
13
15
|
enabled: Boolean(options.jettonAddress && options.ownerAddress && (options.query?.enabled ?? true)),
|
|
@@ -5,17 +5,27 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
+
import type { QueryClient } from '@tanstack/query-core';
|
|
8
9
|
import type { AppKit } from '../../core/app-kit';
|
|
9
10
|
import type { GetJettonsByAddressOptions } from '../../actions/jettons/get-jettons-by-address';
|
|
10
11
|
import type { QueryOptions, QueryParameter } from '../../types/query';
|
|
11
12
|
import type { Compute, ExactPartial } from '../../types/utils';
|
|
12
13
|
import type { GetJettonsByAddressReturnType } from '../../actions/jettons/get-jettons-by-address';
|
|
14
|
+
import type { JettonUpdate } from '../../core/streaming';
|
|
15
|
+
import type { Network } from '../../types/network';
|
|
13
16
|
export type GetJettonsErrorType = Error;
|
|
14
17
|
export type GetJettonsByAddressData = GetJettonsQueryFnData;
|
|
15
18
|
export type GetJettonsByAddressQueryConfig<selectData = GetJettonsByAddressData> = Compute<ExactPartial<GetJettonsByAddressOptions>> & QueryParameter<GetJettonsQueryFnData, GetJettonsErrorType, selectData, GetJettonsByAddressQueryKey>;
|
|
16
|
-
export declare const getJettonsByAddressQueryOptions: <selectData = GetJettonsByAddressData>(appKit: AppKit,
|
|
19
|
+
export declare const getJettonsByAddressQueryOptions: <selectData = GetJettonsByAddressData>(appKit: AppKit, initialOptions?: GetJettonsByAddressQueryConfig<selectData>) => GetJettonsByAddressQueryOptions<selectData>;
|
|
17
20
|
export type GetJettonsQueryFnData = Compute<Awaited<GetJettonsByAddressReturnType>>;
|
|
18
21
|
export declare const getJettonsByAddressQueryKey: (options?: Compute<ExactPartial<GetJettonsByAddressOptions>>) => GetJettonsByAddressQueryKey;
|
|
19
22
|
export type GetJettonsByAddressQueryKey = readonly ['jettons', Compute<ExactPartial<GetJettonsByAddressOptions>>];
|
|
20
23
|
export type GetJettonsByAddressQueryOptions<selectData = GetJettonsByAddressData> = QueryOptions<GetJettonsQueryFnData, GetJettonsErrorType, selectData, GetJettonsByAddressQueryKey>;
|
|
24
|
+
/**
|
|
25
|
+
* Update the TanStack Query cache for an address jettons list.
|
|
26
|
+
*/
|
|
27
|
+
export declare const handleJettonsUpdate: (queryClient: QueryClient, { address, network }: {
|
|
28
|
+
address: string;
|
|
29
|
+
network: Network;
|
|
30
|
+
}, update: JettonUpdate) => void;
|
|
21
31
|
//# sourceMappingURL=get-jettons-by-address.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,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;AAClG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,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,CAgB5C,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,YAAY,SA+BvB,CAAC"}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { getJettonsByAddress } from '../../actions/jettons/get-jettons-by-address';
|
|
9
|
-
import { filterQueryOptions } from '../../utils';
|
|
10
|
-
export const getJettonsByAddressQueryOptions = (appKit,
|
|
9
|
+
import { filterQueryOptions, resolveNetwork, compareAddress, formatUnits, sleep } from '../../utils';
|
|
10
|
+
export const getJettonsByAddressQueryOptions = (appKit, initialOptions = {}) => {
|
|
11
|
+
const network = resolveNetwork(appKit, initialOptions.network);
|
|
12
|
+
const options = { ...initialOptions, network };
|
|
11
13
|
return {
|
|
12
14
|
...options.query,
|
|
13
15
|
enabled: Boolean(options.address && (options.query?.enabled ?? true)),
|
|
@@ -24,3 +26,32 @@ export const getJettonsByAddressQueryOptions = (appKit, options = {}) => {
|
|
|
24
26
|
export const getJettonsByAddressQueryKey = (options = {}) => {
|
|
25
27
|
return ['jettons', filterQueryOptions(options)];
|
|
26
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Update the TanStack Query cache for an address jettons list.
|
|
31
|
+
*/
|
|
32
|
+
export const handleJettonsUpdate = (queryClient, { address, network }, update) => {
|
|
33
|
+
if (update.status === 'finalized') {
|
|
34
|
+
const queryKey = getJettonsByAddressQueryKey({ address, network });
|
|
35
|
+
const currentData = queryClient.getQueryData(queryKey);
|
|
36
|
+
if (currentData?.jettons) {
|
|
37
|
+
const jetton = currentData.jettons.find((j) => compareAddress(j.address, update.masterAddress));
|
|
38
|
+
const decimals = jetton?.decimalsNumber ?? update.decimals;
|
|
39
|
+
if (jetton && decimals) {
|
|
40
|
+
const updatedJetton = {
|
|
41
|
+
...jetton,
|
|
42
|
+
balance: formatUnits(update.rawBalance, decimals),
|
|
43
|
+
};
|
|
44
|
+
const newJettons = currentData.jettons.map((j) => compareAddress(j.address, update.masterAddress) ? updatedJetton : j);
|
|
45
|
+
queryClient.setQueryData(queryKey, {
|
|
46
|
+
...currentData,
|
|
47
|
+
jettons: newJettons,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
sleep(5000).then(() => queryClient.invalidateQueries({ queryKey }));
|
|
52
|
+
}
|
|
53
|
+
if (update.status === 'invalidated') {
|
|
54
|
+
const queryKey = getJettonsByAddressQueryKey({ address, network });
|
|
55
|
+
queryClient.invalidateQueries({ queryKey });
|
|
56
|
+
}
|
|
57
|
+
};
|
|
@@ -13,7 +13,7 @@ import type { GetBlockNumberReturnType } from '../../actions/network/get-block-n
|
|
|
13
13
|
export type GetBlockNumberErrorType = Error;
|
|
14
14
|
export type GetBlockNumberData = GetBlockNumberQueryFnData;
|
|
15
15
|
export type GetBlockNumberQueryConfig<selectData = GetBlockNumberData> = Compute<ExactPartial<GetBlockNumberOptions>> & QueryParameter<GetBlockNumberQueryFnData, GetBlockNumberErrorType, selectData, GetBlockNumberQueryKey>;
|
|
16
|
-
export declare const getBlockNumberQueryOptions: <selectData = GetBlockNumberData>(appKit: AppKit,
|
|
16
|
+
export declare const getBlockNumberQueryOptions: <selectData = GetBlockNumberData>(appKit: AppKit, initialOptions?: GetBlockNumberQueryConfig<selectData>) => GetBlockNumberQueryOptions<selectData>;
|
|
17
17
|
export type GetBlockNumberQueryFnData = Compute<Awaited<GetBlockNumberReturnType>>;
|
|
18
18
|
export declare const getBlockNumberQueryKey: (options?: Compute<ExactPartial<GetBlockNumberOptions>>) => GetBlockNumberQueryKey;
|
|
19
19
|
export type GetBlockNumberQueryKey = readonly ['blockNumber', Compute<ExactPartial<GetBlockNumberOptions>>];
|
|
@@ -1 +1 @@
|
|
|
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,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,
|
|
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,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"}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { getBlockNumber } from '../../actions/network/get-block-number';
|
|
9
|
-
import { filterQueryOptions } from '../../utils';
|
|
10
|
-
export const getBlockNumberQueryOptions = (appKit,
|
|
9
|
+
import { filterQueryOptions, resolveNetwork } from '../../utils';
|
|
10
|
+
export const getBlockNumberQueryOptions = (appKit, initialOptions = {}) => {
|
|
11
|
+
const network = resolveNetwork(appKit, initialOptions.network);
|
|
12
|
+
const options = { ...initialOptions, network };
|
|
11
13
|
return {
|
|
12
14
|
...options.query,
|
|
13
15
|
gcTime: 0,
|
|
@@ -12,7 +12,7 @@ import type { QueryOptions, QueryParameter } from '../../types/query';
|
|
|
12
12
|
import type { Compute, ExactPartial } from '../../types/utils';
|
|
13
13
|
export type GetNftErrorType = Error;
|
|
14
14
|
export type GetNftQueryConfig<selectData = GetNftData> = Compute<ExactPartial<GetNftParameters>> & QueryParameter<GetNftQueryFnData, GetNftErrorType, selectData, GetNftQueryKey>;
|
|
15
|
-
export declare const getNftQueryOptions: <selectData = GetNftData>(appKit: AppKit,
|
|
15
|
+
export declare const getNftQueryOptions: <selectData = GetNftData>(appKit: AppKit, initialOptions?: GetNftQueryConfig<selectData>) => GetNftQueryOptions<selectData>;
|
|
16
16
|
export type GetNftQueryFnData = Compute<NFT | null>;
|
|
17
17
|
export type GetNftData = GetNftQueryFnData;
|
|
18
18
|
export declare const getNftQueryKey: (options?: Compute<ExactPartial<GetNftParameters>>) => GetNftQueryKey;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iBAAgB,iBAAiB,CAAC,UAAU,CAAM,KACnD,kBAAkB,CAAC,UAAU,CAgB/B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;AAEpD,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"}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { getNft } from '../../actions/nft/get-nft';
|
|
9
|
-
import { filterQueryOptions } from '../../utils';
|
|
10
|
-
export const getNftQueryOptions = (appKit,
|
|
9
|
+
import { filterQueryOptions, resolveNetwork } from '../../utils';
|
|
10
|
+
export const getNftQueryOptions = (appKit, initialOptions = {}) => {
|
|
11
|
+
const network = resolveNetwork(appKit, initialOptions.network);
|
|
12
|
+
const options = { ...initialOptions, network };
|
|
11
13
|
return {
|
|
12
14
|
...options.query,
|
|
13
15
|
enabled: Boolean(options.address && (options.query?.enabled ?? true)),
|
|
@@ -13,7 +13,7 @@ import type { GetNftsByAddressReturnType } from '../../actions/nft/get-nfts-by-a
|
|
|
13
13
|
export type GetNFTsErrorType = Error;
|
|
14
14
|
export type GetNFTsByAddressData = GetNFTsQueryFnData;
|
|
15
15
|
export type GetNFTsByAddressQueryConfig<selectData = GetNFTsByAddressData> = Compute<ExactPartial<GetNftsByAddressOptions>> & QueryParameter<GetNFTsQueryFnData, GetNFTsErrorType, selectData, GetNFTsByAddressQueryKey>;
|
|
16
|
-
export declare const getNFTsByAddressQueryOptions: <selectData = GetNFTsByAddressData>(appKit: AppKit,
|
|
16
|
+
export declare const getNFTsByAddressQueryOptions: <selectData = GetNFTsByAddressData>(appKit: AppKit, initialOptions?: GetNFTsByAddressQueryConfig<selectData>) => GetNFTsByAddressQueryOptions<selectData>;
|
|
17
17
|
export type GetNFTsQueryFnData = Compute<Awaited<GetNftsByAddressReturnType>>;
|
|
18
18
|
export declare const getNFTsByAddressQueryKey: (options?: Compute<ExactPartial<GetNftsByAddressOptions>>) => GetNFTsByAddressQueryKey;
|
|
19
19
|
export type GetNFTsByAddressQueryKey = readonly ['nfts', Compute<ExactPartial<GetNftsByAddressOptions>>];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-nfts-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/nft/get-nfts-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,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;AAE/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAExF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAErC,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,MAAM,MAAM,2BAA2B,CAAC,UAAU,GAAG,oBAAoB,IAAI,OAAO,CAChF,YAAY,CAAC,uBAAuB,CAAC,CACxC,GACG,cAAc,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC;AAE/F,eAAO,MAAM,4BAA4B,GAAI,UAAU,GAAG,oBAAoB,EAC1E,QAAQ,MAAM,EACd,
|
|
1
|
+
{"version":3,"file":"get-nfts-by-address.d.ts","sourceRoot":"","sources":["../../../../src/queries/nft/get-nfts-by-address.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,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;AAE/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAExF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAErC,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,MAAM,MAAM,2BAA2B,CAAC,UAAU,GAAG,oBAAoB,IAAI,OAAO,CAChF,YAAY,CAAC,uBAAuB,CAAC,CACxC,GACG,cAAc,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC;AAE/F,eAAO,MAAM,4BAA4B,GAAI,UAAU,GAAG,oBAAoB,EAC1E,QAAQ,MAAM,EACd,iBAAgB,2BAA2B,CAAC,UAAU,CAAM,KAC7D,4BAA4B,CAAC,UAAU,CAgBzC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAE9E,eAAO,MAAM,wBAAwB,GACjC,UAAS,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAM,KAC7D,wBAEF,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAEzG,MAAM,MAAM,4BAA4B,CAAC,UAAU,GAAG,oBAAoB,IAAI,YAAY,CACtF,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,wBAAwB,CAC3B,CAAC"}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { getNftsByAddress } from '../../actions/nft/get-nfts-by-address';
|
|
9
|
-
import { filterQueryOptions } from '../../utils';
|
|
10
|
-
export const getNFTsByAddressQueryOptions = (appKit,
|
|
9
|
+
import { filterQueryOptions, resolveNetwork } from '../../utils';
|
|
10
|
+
export const getNFTsByAddressQueryOptions = (appKit, initialOptions = {}) => {
|
|
11
|
+
const network = resolveNetwork(appKit, initialOptions.network);
|
|
12
|
+
const options = { ...initialOptions, network };
|
|
11
13
|
return {
|
|
12
14
|
...options.query,
|
|
13
15
|
enabled: Boolean(options.address && (options.query?.enabled ?? true)),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { MutateOptions, MutationOptions } from '@tanstack/query-core';
|
|
9
|
+
import type { AppKit } from '../../core/app-kit';
|
|
10
|
+
import type { MutationParameter } from '../../types/query';
|
|
11
|
+
import type { Compute } from '../../types/utils';
|
|
12
|
+
import type { BuildStakeTransactionOptions, BuildStakeTransactionReturnType } from '../../actions/staking/build-stake-transaction';
|
|
13
|
+
export type BuildStakeTransactionMutationOptions<context = unknown> = MutationParameter<BuildStakeTransactionData, BuildStakeTransactionErrorType, BuildStakeTransactionVariables, context>;
|
|
14
|
+
export declare const buildStakeTransactionMutationOptions: <context = unknown>(appKit: AppKit, options?: BuildStakeTransactionMutationOptions<context>) => BuildStakeTransactionMutationConfig<context>;
|
|
15
|
+
export type BuildStakeTransactionMutationConfig<context = unknown> = MutationOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, BuildStakeTransactionVariables, context>;
|
|
16
|
+
export type BuildStakeTransactionData = Compute<Awaited<BuildStakeTransactionReturnType>>;
|
|
17
|
+
export type BuildStakeTransactionErrorType = Error;
|
|
18
|
+
export type BuildStakeTransactionVariables = BuildStakeTransactionOptions;
|
|
19
|
+
export type BuildStakeTransactionMutate<context = unknown> = (variables: BuildStakeTransactionVariables, options?: Compute<MutateOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, Compute<BuildStakeTransactionVariables>, context>> | undefined) => void;
|
|
20
|
+
export type BuildStakeTransactionMutateAsync<context = unknown> = (variables: BuildStakeTransactionVariables, options?: Compute<MutateOptions<BuildStakeTransactionData, BuildStakeTransactionErrorType, Compute<BuildStakeTransactionVariables>, context>> | undefined) => Promise<BuildStakeTransactionData>;
|
|
21
|
+
//# sourceMappingURL=build-stake-transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { buildStakeTransaction } from '../../actions/staking/build-stake-transaction';
|
|
9
|
+
export const buildStakeTransactionMutationOptions = (appKit, options = {}) => {
|
|
10
|
+
return {
|
|
11
|
+
...options.mutation,
|
|
12
|
+
mutationFn(variables) {
|
|
13
|
+
return buildStakeTransaction(appKit, variables);
|
|
14
|
+
},
|
|
15
|
+
mutationKey: ['buildStakeTransaction'],
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { GetStakedBalanceOptions } from '../../actions/staking/get-staked-balance';
|
|
9
|
+
import type { GetStakedBalanceReturnType } from '../../actions/staking/get-staked-balance';
|
|
10
|
+
import type { AppKit } from '../../core/app-kit';
|
|
11
|
+
import type { QueryOptions, QueryParameter } from '../../types/query';
|
|
12
|
+
import type { Compute, ExactPartial } from '../../types/utils';
|
|
13
|
+
export type GetStakedBalanceErrorType = Error;
|
|
14
|
+
export type GetStakedBalanceQueryConfig<selectData = GetStakedBalanceData> = Compute<ExactPartial<GetStakedBalanceOptions>> & QueryParameter<GetStakedBalanceQueryFnData, GetStakedBalanceErrorType, selectData, GetStakedBalanceQueryKey>;
|
|
15
|
+
export declare const getStakedBalanceQueryOptions: <selectData = GetStakedBalanceData>(appKit: AppKit, options?: GetStakedBalanceQueryConfig<selectData>) => GetStakedBalanceQueryOptions<selectData>;
|
|
16
|
+
export type GetStakedBalanceQueryFnData = Compute<Awaited<GetStakedBalanceReturnType>>;
|
|
17
|
+
export type GetStakedBalanceData = GetStakedBalanceQueryFnData;
|
|
18
|
+
export declare const getStakedBalanceQueryKey: (options?: Compute<ExactPartial<GetStakedBalanceOptions>>) => GetStakedBalanceQueryKey;
|
|
19
|
+
export type GetStakedBalanceQueryKey = readonly ['stakedBalance', Compute<ExactPartial<GetStakedBalanceOptions>>];
|
|
20
|
+
export type GetStakedBalanceQueryOptions<selectData = GetStakedBalanceData> = QueryOptions<GetStakedBalanceQueryFnData, GetStakedBalanceErrorType, selectData, GetStakedBalanceQueryKey>;
|
|
21
|
+
//# sourceMappingURL=get-staked-balance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { getStakedBalance } from '../../actions/staking/get-staked-balance';
|
|
9
|
+
import { filterQueryOptions } from '../../utils';
|
|
10
|
+
export const getStakedBalanceQueryOptions = (appKit, options = {}) => {
|
|
11
|
+
return {
|
|
12
|
+
...options.query,
|
|
13
|
+
enabled: Boolean(options.userAddress && (options.query?.enabled ?? true)),
|
|
14
|
+
queryFn: async (context) => {
|
|
15
|
+
const [, parameters] = context.queryKey;
|
|
16
|
+
if (!parameters.userAddress) {
|
|
17
|
+
throw new Error('userAddress is required');
|
|
18
|
+
}
|
|
19
|
+
return getStakedBalance(appKit, parameters);
|
|
20
|
+
},
|
|
21
|
+
queryKey: getStakedBalanceQueryKey(options),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export const getStakedBalanceQueryKey = (options = {}) => {
|
|
25
|
+
return ['stakedBalance', filterQueryOptions(options)];
|
|
26
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { GetStakingProviderInfoOptions } from '../../actions/staking/get-staking-provider-info';
|
|
9
|
+
import type { GetStakingProviderInfoReturnType } from '../../actions/staking/get-staking-provider-info';
|
|
10
|
+
import type { AppKit } from '../../core/app-kit';
|
|
11
|
+
import type { QueryOptions, QueryParameter } from '../../types/query';
|
|
12
|
+
import type { Compute, ExactPartial } from '../../types/utils';
|
|
13
|
+
export type GetStakingProviderInfoErrorType = Error;
|
|
14
|
+
export type GetStakingProviderInfoQueryConfig<selectData = GetStakingProviderInfoData> = Compute<ExactPartial<GetStakingProviderInfoOptions>> & QueryParameter<GetStakingProviderInfoQueryFnData, GetStakingProviderInfoErrorType, selectData, GetStakingProviderInfoQueryKey>;
|
|
15
|
+
export declare const getStakingProviderInfoQueryOptions: <selectData = GetStakingProviderInfoData>(appKit: AppKit, options?: GetStakingProviderInfoQueryConfig<selectData>) => GetStakingProviderInfoQueryOptions<selectData>;
|
|
16
|
+
export type GetStakingProviderInfoQueryFnData = Compute<Awaited<GetStakingProviderInfoReturnType>>;
|
|
17
|
+
export type GetStakingProviderInfoData = GetStakingProviderInfoQueryFnData;
|
|
18
|
+
export declare const getStakingProviderInfoQueryKey: (options?: Compute<ExactPartial<GetStakingProviderInfoOptions>>) => GetStakingProviderInfoQueryKey;
|
|
19
|
+
export type GetStakingProviderInfoQueryKey = readonly [
|
|
20
|
+
'stakingProviderInfo',
|
|
21
|
+
Compute<ExactPartial<GetStakingProviderInfoOptions>>
|
|
22
|
+
];
|
|
23
|
+
export type GetStakingProviderInfoQueryOptions<selectData = GetStakingProviderInfoData> = QueryOptions<GetStakingProviderInfoQueryFnData, GetStakingProviderInfoErrorType, selectData, GetStakingProviderInfoQueryKey>;
|
|
24
|
+
//# sourceMappingURL=get-staking-provider-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { getStakingProviderInfo } from '../../actions/staking/get-staking-provider-info';
|
|
9
|
+
import { filterQueryOptions } from '../../utils';
|
|
10
|
+
export const getStakingProviderInfoQueryOptions = (appKit, options = {}) => {
|
|
11
|
+
return {
|
|
12
|
+
...options.query,
|
|
13
|
+
queryFn: async (context) => {
|
|
14
|
+
const [, parameters] = context.queryKey;
|
|
15
|
+
return getStakingProviderInfo(appKit, parameters);
|
|
16
|
+
},
|
|
17
|
+
queryKey: getStakingProviderInfoQueryKey(options),
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export const getStakingProviderInfoQueryKey = (options = {}) => {
|
|
21
|
+
return ['stakingProviderInfo', filterQueryOptions(options)];
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { GetStakingProvidersReturnType } from '../../actions/staking/get-staking-providers';
|
|
9
|
+
import type { AppKit } from '../../core/app-kit';
|
|
10
|
+
import type { QueryOptions, QueryParameter } from '../../types/query';
|
|
11
|
+
import type { Compute } from '../../types/utils';
|
|
12
|
+
export type GetStakingProvidersErrorType = Error;
|
|
13
|
+
export type GetStakingProvidersQueryConfig<selectData = GetStakingProvidersData> = QueryParameter<GetStakingProvidersQueryFnData, GetStakingProvidersErrorType, selectData, GetStakingProvidersQueryKey>;
|
|
14
|
+
export declare const getStakingProvidersQueryOptions: <selectData = GetStakingProvidersData>(appKit: AppKit, options?: GetStakingProvidersQueryConfig<selectData>) => GetStakingProvidersQueryOptions<selectData>;
|
|
15
|
+
export type GetStakingProvidersQueryFnData = Compute<Awaited<GetStakingProvidersReturnType>>;
|
|
16
|
+
export type GetStakingProvidersData = GetStakingProvidersQueryFnData;
|
|
17
|
+
export declare const getStakingProvidersQueryKey: () => GetStakingProvidersQueryKey;
|
|
18
|
+
export type GetStakingProvidersQueryKey = readonly ['stakingProviders'];
|
|
19
|
+
export type GetStakingProvidersQueryOptions<selectData = GetStakingProvidersData> = QueryOptions<GetStakingProvidersQueryFnData, GetStakingProvidersErrorType, selectData, GetStakingProvidersQueryKey>;
|
|
20
|
+
//# sourceMappingURL=get-staking-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { getStakingProviders } from '../../actions/staking/get-staking-providers';
|
|
9
|
+
export const getStakingProvidersQueryOptions = (appKit, options = {}) => {
|
|
10
|
+
return {
|
|
11
|
+
...options.query,
|
|
12
|
+
queryFn: async () => {
|
|
13
|
+
return getStakingProviders(appKit);
|
|
14
|
+
},
|
|
15
|
+
queryKey: getStakingProvidersQueryKey(),
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const getStakingProvidersQueryKey = () => {
|
|
19
|
+
return ['stakingProviders'];
|
|
20
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { GetStakingQuoteOptions } from '../../actions/staking/get-staking-quote';
|
|
9
|
+
import type { GetStakingQuoteReturnType } from '../../actions/staking/get-staking-quote';
|
|
10
|
+
import type { AppKit } from '../../core/app-kit';
|
|
11
|
+
import type { QueryOptions, QueryParameter } from '../../types/query';
|
|
12
|
+
import type { Compute, ExactPartial } from '../../types/utils';
|
|
13
|
+
export type GetStakingQuoteErrorType = Error;
|
|
14
|
+
export type GetStakingQuoteQueryConfig<selectData = GetStakingQuoteData> = Compute<ExactPartial<GetStakingQuoteOptions>> & QueryParameter<GetStakingQuoteQueryFnData, GetStakingQuoteErrorType, selectData, GetStakingQuoteQueryKey>;
|
|
15
|
+
export declare const getStakingQuoteQueryOptions: <selectData = GetStakingQuoteData>(appKit: AppKit, options?: GetStakingQuoteQueryConfig<selectData>) => GetStakingQuoteQueryOptions<selectData>;
|
|
16
|
+
export type GetStakingQuoteQueryFnData = Compute<Awaited<GetStakingQuoteReturnType>>;
|
|
17
|
+
export type GetStakingQuoteData = GetStakingQuoteQueryFnData;
|
|
18
|
+
export declare const getStakingQuoteQueryKey: (options?: Compute<ExactPartial<GetStakingQuoteOptions>>) => GetStakingQuoteQueryKey;
|
|
19
|
+
export type GetStakingQuoteQueryKey = readonly ['stakingQuote', Compute<ExactPartial<GetStakingQuoteOptions>>];
|
|
20
|
+
export type GetStakingQuoteQueryOptions<selectData = GetStakingQuoteData> = QueryOptions<GetStakingQuoteQueryFnData, GetStakingQuoteErrorType, selectData, GetStakingQuoteQueryKey>;
|
|
21
|
+
//# sourceMappingURL=get-staking-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { getStakingQuote } from '../../actions/staking/get-staking-quote';
|
|
9
|
+
import { filterQueryOptions } from '../../utils';
|
|
10
|
+
export const getStakingQuoteQueryOptions = (appKit, options = {}) => {
|
|
11
|
+
return {
|
|
12
|
+
...options.query,
|
|
13
|
+
enabled: Boolean(options.amount && options.direction && (options.query?.enabled ?? true)),
|
|
14
|
+
queryFn: async (context) => {
|
|
15
|
+
const [, parameters] = context.queryKey;
|
|
16
|
+
if (!parameters.amount || !parameters.direction) {
|
|
17
|
+
throw new Error('amount and direction are required');
|
|
18
|
+
}
|
|
19
|
+
return getStakingQuote(appKit, parameters);
|
|
20
|
+
},
|
|
21
|
+
queryKey: getStakingQuoteQueryKey(options),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export const getStakingQuoteQueryKey = (options = {}) => {
|
|
25
|
+
return ['stakingQuote', filterQueryOptions(options)];
|
|
26
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) TonTech.
|
|
4
3
|
*
|
|
@@ -6,4 +5,5 @@
|
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*
|
|
8
7
|
*/
|
|
9
|
-
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=streaming-updates.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming-updates.test.d.ts","sourceRoot":"","sources":["../../../src/queries/streaming-updates.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
9
|
+
import { handleBalanceUpdate } from './balances/get-balance-by-address';
|
|
10
|
+
import { handleJettonBalanceUpdate } from './jettons/get-jetton-balance-by-address';
|
|
11
|
+
import { handleJettonsUpdate } from './jettons/get-jettons-by-address';
|
|
12
|
+
import { Network } from '../types/network';
|
|
13
|
+
describe('Streaming Updates Handlers', () => {
|
|
14
|
+
let queryClient;
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
queryClient = {
|
|
17
|
+
setQueryData: vi.fn(),
|
|
18
|
+
invalidateQueries: vi.fn(),
|
|
19
|
+
getQueryData: vi.fn(),
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
const network = Network.mainnet();
|
|
23
|
+
describe('handleBalanceUpdate', () => {
|
|
24
|
+
it('should invalidate query immediately on invalidated status', () => {
|
|
25
|
+
const address = 'EQD...';
|
|
26
|
+
const update = {
|
|
27
|
+
type: 'balance',
|
|
28
|
+
address,
|
|
29
|
+
balance: '100',
|
|
30
|
+
rawBalance: '100000000',
|
|
31
|
+
status: 'invalidated',
|
|
32
|
+
};
|
|
33
|
+
handleBalanceUpdate(queryClient, { address, network }, update);
|
|
34
|
+
expect(queryClient.invalidateQueries).toHaveBeenCalledWith({
|
|
35
|
+
queryKey: expect.arrayContaining(['balance']),
|
|
36
|
+
});
|
|
37
|
+
expect(queryClient.setQueryData).not.toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
it('should update data on finalized status', () => {
|
|
40
|
+
const address = 'EQD...';
|
|
41
|
+
const update = {
|
|
42
|
+
type: 'balance',
|
|
43
|
+
address,
|
|
44
|
+
balance: '100',
|
|
45
|
+
rawBalance: '100000000',
|
|
46
|
+
status: 'finalized',
|
|
47
|
+
};
|
|
48
|
+
handleBalanceUpdate(queryClient, { address, network }, update);
|
|
49
|
+
expect(queryClient.setQueryData).toHaveBeenCalled();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('handleJettonBalanceUpdate', () => {
|
|
53
|
+
it('should invalidate query immediately on invalidated status', () => {
|
|
54
|
+
const ownerAddress = 'EQO...';
|
|
55
|
+
const jettonAddress = 'EQJ...';
|
|
56
|
+
const update = {
|
|
57
|
+
type: 'jettons',
|
|
58
|
+
ownerAddress,
|
|
59
|
+
masterAddress: jettonAddress,
|
|
60
|
+
walletAddress: jettonAddress,
|
|
61
|
+
rawBalance: '50',
|
|
62
|
+
status: 'invalidated',
|
|
63
|
+
};
|
|
64
|
+
handleJettonBalanceUpdate(queryClient, { ownerAddress, jettonAddress, network }, update);
|
|
65
|
+
expect(queryClient.invalidateQueries).toHaveBeenCalled();
|
|
66
|
+
expect(queryClient.setQueryData).not.toHaveBeenCalled();
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
describe('handleJettonsUpdate', () => {
|
|
70
|
+
it('should invalidate query immediately on invalidated status', () => {
|
|
71
|
+
const address = 'EQA...';
|
|
72
|
+
const update = {
|
|
73
|
+
type: 'jettons',
|
|
74
|
+
ownerAddress: address,
|
|
75
|
+
masterAddress: address,
|
|
76
|
+
walletAddress: address,
|
|
77
|
+
rawBalance: '0',
|
|
78
|
+
status: 'invalidated',
|
|
79
|
+
};
|
|
80
|
+
handleJettonsUpdate(queryClient, { address, network }, update);
|
|
81
|
+
expect(queryClient.invalidateQueries).toHaveBeenCalled();
|
|
82
|
+
expect(queryClient.setQueryData).not.toHaveBeenCalled();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -12,7 +12,7 @@ import type { QueryOptions, QueryParameter } from '../../types/query';
|
|
|
12
12
|
import type { Compute, ExactPartial } from '../../types/utils';
|
|
13
13
|
export type GetSwapQuoteErrorType = Error;
|
|
14
14
|
export type GetSwapQuoteQueryConfig<selectData = GetSwapQuoteData> = Compute<ExactPartial<GetSwapQuoteOptions>> & QueryParameter<GetSwapQuoteQueryFnData, GetSwapQuoteErrorType, selectData, GetSwapQuoteQueryKey>;
|
|
15
|
-
export declare const getSwapQuoteQueryOptions: <selectData = GetSwapQuoteData>(appKit: AppKit,
|
|
15
|
+
export declare const getSwapQuoteQueryOptions: <selectData = GetSwapQuoteData>(appKit: AppKit, initialOptions?: GetSwapQuoteQueryConfig<selectData>) => GetSwapQuoteQueryOptions<selectData>;
|
|
16
16
|
export type GetSwapQuoteQueryFnData = Compute<Awaited<GetSwapQuoteReturnType>>;
|
|
17
17
|
export type GetSwapQuoteData = GetSwapQuoteQueryFnData;
|
|
18
18
|
export declare const getSwapQuoteQueryKey: (options?: Compute<ExactPartial<GetSwapQuoteOptions>>) => GetSwapQuoteQueryKey;
|
|
@@ -1 +1 @@
|
|
|
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,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,
|
|
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,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"}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import { getSwapQuote } from '../../actions/swap/get-swap-quote';
|
|
9
|
-
import { filterQueryOptions } from '../../utils';
|
|
10
|
-
export const getSwapQuoteQueryOptions = (appKit,
|
|
9
|
+
import { filterQueryOptions, resolveNetwork } from '../../utils';
|
|
10
|
+
export const getSwapQuoteQueryOptions = (appKit, initialOptions = {}) => {
|
|
11
|
+
const network = resolveNetwork(appKit, initialOptions.network);
|
|
12
|
+
const options = { ...initialOptions, network };
|
|
11
13
|
return {
|
|
12
14
|
...options.query,
|
|
13
15
|
enabled: Boolean(options.amount && options.from && options.to && (options.query?.enabled ?? true)),
|