@ton/appkit
Advanced tools
| /** | ||
| * 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 { CryptoOnrampDeposit, CryptoOnrampDepositParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type CreateCryptoOnrampDepositOptions<T = unknown> = CryptoOnrampDepositParams<T> & { | ||
| providerId?: string; | ||
| }; | ||
| export type CreateCryptoOnrampDepositReturnType = Promise<CryptoOnrampDeposit>; | ||
| /** | ||
| * Create a crypto onramp deposit from a previously obtained quote | ||
| */ | ||
| export declare const createCryptoOnrampDeposit: <T = unknown>(appKit: AppKit, options: CreateCryptoOnrampDepositOptions<T>) => CreateCryptoOnrampDepositReturnType; | ||
| //# sourceMappingURL=create-crypto-onramp-deposit.d.ts.map |
| {"version":3,"file":"create-crypto-onramp-deposit.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/create-crypto-onramp-deposit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,gCAAgC,CAAC,CAAC,GAAG,OAAO,IAAI,yBAAyB,CAAC,CAAC,CAAC,GAAG;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAU,CAAC,GAAG,OAAO,EACvD,QAAQ,MAAM,EACd,SAAS,gCAAgC,CAAC,CAAC,CAAC,KAC7C,mCAEF,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.createCryptoOnrampDeposit = void 0; | ||
| /** | ||
| * Create a crypto onramp deposit from a previously obtained quote | ||
| */ | ||
| const createCryptoOnrampDeposit = async (appKit, options) => { | ||
| return appKit.cryptoOnrampManager.createDeposit(options, options.providerId); | ||
| }; | ||
| exports.createCryptoOnrampDeposit = createCryptoOnrampDeposit; |
| /** | ||
| * 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 { CryptoOnrampProviderMetadata } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampProviderMetadataOptions { | ||
| providerId?: string; | ||
| } | ||
| export type GetCryptoOnrampProviderMetadataReturnType = CryptoOnrampProviderMetadata; | ||
| /** | ||
| * Get static metadata for a crypto-onramp provider (display name, logo, url). | ||
| */ | ||
| export declare const getCryptoOnrampProviderMetadata: (appKit: AppKit, options?: GetCryptoOnrampProviderMetadataOptions) => GetCryptoOnrampProviderMetadataReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-provider-metadata.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-provider-metadata.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-provider-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,sCAAsC;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,yCAAyC,GAAG,4BAA4B,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,+BAA+B,GACxC,QAAQ,MAAM,EACd,UAAS,sCAA2C,KACrD,yCAEF,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.getCryptoOnrampProviderMetadata = void 0; | ||
| /** | ||
| * Get static metadata for a crypto-onramp provider (display name, logo, url). | ||
| */ | ||
| const getCryptoOnrampProviderMetadata = (appKit, options = {}) => { | ||
| return appKit.cryptoOnrampManager.getMetadata(options.providerId); | ||
| }; | ||
| exports.getCryptoOnrampProviderMetadata = getCryptoOnrampProviderMetadata; |
| /** | ||
| * 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 { CryptoOnrampProviderInterface } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampProviderOptions { | ||
| id?: string; | ||
| } | ||
| export type GetCryptoOnrampProviderReturnType = CryptoOnrampProviderInterface; | ||
| /** | ||
| * Get a registered crypto-onramp provider by id, or the default one when no id is given. | ||
| */ | ||
| export declare const getCryptoOnrampProvider: (appKit: AppKit, options?: GetCryptoOnrampProviderOptions) => GetCryptoOnrampProviderReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-provider.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,8BAA8B;IAC3C,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAChC,QAAQ,MAAM,EACd,UAAS,8BAAmC,KAC7C,iCAEF,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.getCryptoOnrampProvider = void 0; | ||
| /** | ||
| * Get a registered crypto-onramp provider by id, or the default one when no id is given. | ||
| */ | ||
| const getCryptoOnrampProvider = (appKit, options = {}) => { | ||
| return appKit.cryptoOnrampManager.getProvider(options.id); | ||
| }; | ||
| exports.getCryptoOnrampProvider = getCryptoOnrampProvider; |
| /** | ||
| * 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 { CryptoOnrampProviderInterface } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampProvidersReturnType = CryptoOnrampProviderInterface[]; | ||
| /** | ||
| * Get all registered crypto-onramp providers. | ||
| */ | ||
| export declare const getCryptoOnrampProviders: (appKit: AppKit) => GetCryptoOnrampProvidersReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-providers.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-providers.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,kCAAkC,GAAG,6BAA6B,EAAE,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,KAAG,kCAEzD,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.getCryptoOnrampProviders = void 0; | ||
| /** | ||
| * Get all registered crypto-onramp providers. | ||
| */ | ||
| const getCryptoOnrampProviders = (appKit) => { | ||
| return appKit.cryptoOnrampManager.getProviders(); | ||
| }; | ||
| exports.getCryptoOnrampProviders = getCryptoOnrampProviders; |
| /** | ||
| * 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 { CryptoOnrampQuote, CryptoOnrampQuoteParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampQuoteOptions<T = unknown> = CryptoOnrampQuoteParams<T> & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetCryptoOnrampQuoteReturnType = Promise<CryptoOnrampQuote>; | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| export declare const getCryptoOnrampQuote: <T = unknown>(appKit: AppKit, options: GetCryptoOnrampQuoteOptions<T>) => GetCryptoOnrampQuoteReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-quote.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-quote.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,2BAA2B,CAAC,CAAC,GAAG,OAAO,IAAI,uBAAuB,CAAC,CAAC,CAAC,GAAG;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAU,CAAC,GAAG,OAAO,EAClD,QAAQ,MAAM,EACd,SAAS,2BAA2B,CAAC,CAAC,CAAC,KACxC,8BAEF,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.getCryptoOnrampQuote = void 0; | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| const getCryptoOnrampQuote = async (appKit, options) => { | ||
| return appKit.cryptoOnrampManager.getQuote(options, options.providerId); | ||
| }; | ||
| exports.getCryptoOnrampQuote = getCryptoOnrampQuote; |
| /** | ||
| * 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 { CryptoOnrampStatus, CryptoOnrampStatusParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampStatusOptions = CryptoOnrampStatusParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetCryptoOnrampStatusReturnType = Promise<CryptoOnrampStatus>; | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| export declare const getCryptoOnrampStatus: (appKit: AppKit, options: GetCryptoOnrampStatusOptions) => GetCryptoOnrampStatusReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-status.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-status.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,GAAG;IAClE,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.getCryptoOnrampStatus = void 0; | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| const getCryptoOnrampStatus = async (appKit, options) => { | ||
| return appKit.cryptoOnrampManager.getStatus(options, options.providerId); | ||
| }; | ||
| exports.getCryptoOnrampStatus = getCryptoOnrampStatus; |
| /** | ||
| * 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 { CryptoOnrampSupportedCurrencies } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampSupportedCurrenciesOptions { | ||
| providerId?: string; | ||
| } | ||
| export type GetCryptoOnrampSupportedCurrenciesReturnType = Promise<CryptoOnrampSupportedCurrencies>; | ||
| /** | ||
| * Discover supported source/destination currencies for a crypto-onramp provider. | ||
| */ | ||
| export declare const getCryptoOnrampSupportedCurrencies: (appKit: AppKit, options?: GetCryptoOnrampSupportedCurrenciesOptions) => GetCryptoOnrampSupportedCurrenciesReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-supported-currencies.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-supported-currencies.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-supported-currencies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,yCAAyC;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,4CAA4C,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,kCAAkC,GAC3C,QAAQ,MAAM,EACd,UAAS,yCAA8C,KACxD,4CAEF,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.getCryptoOnrampSupportedCurrencies = void 0; | ||
| /** | ||
| * Discover supported source/destination currencies for a crypto-onramp provider. | ||
| */ | ||
| const getCryptoOnrampSupportedCurrencies = async (appKit, options = {}) => { | ||
| return appKit.cryptoOnrampManager.getSupportedCurrencies(options.providerId); | ||
| }; | ||
| exports.getCryptoOnrampSupportedCurrencies = getCryptoOnrampSupportedCurrencies; |
| /** | ||
| * 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 interface SetDefaultCryptoOnrampProviderParameters { | ||
| providerId: string; | ||
| } | ||
| export type SetDefaultCryptoOnrampProviderReturnType = void; | ||
| /** | ||
| * Set the default crypto-onramp provider. | ||
| * Subsequent quote, deposit and status calls will use this provider when none is specified. | ||
| */ | ||
| export declare const setDefaultCryptoOnrampProvider: (appKit: AppKit, parameters: SetDefaultCryptoOnrampProviderParameters) => SetDefaultCryptoOnrampProviderReturnType; | ||
| //# sourceMappingURL=set-default-crypto-onramp-provider.d.ts.map |
| {"version":3,"file":"set-default-crypto-onramp-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/set-default-crypto-onramp-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,wCAAwC;IACrD,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,wCAAwC,GAAG,IAAI,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,8BAA8B,GACvC,QAAQ,MAAM,EACd,YAAY,wCAAwC,KACrD,wCAEF,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.setDefaultCryptoOnrampProvider = void 0; | ||
| /** | ||
| * Set the default crypto-onramp provider. | ||
| * Subsequent quote, deposit and status calls will use this provider when none is specified. | ||
| */ | ||
| const setDefaultCryptoOnrampProvider = (appKit, parameters) => { | ||
| appKit.cryptoOnrampManager.setDefaultProvider(parameters.providerId); | ||
| }; | ||
| exports.setDefaultCryptoOnrampProvider = setDefaultCryptoOnrampProvider; |
| /** | ||
| * 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 interface WatchCryptoOnrampProvidersParameters { | ||
| onChange: () => void; | ||
| } | ||
| export type WatchCryptoOnrampProvidersReturnType = () => void; | ||
| /** | ||
| * Watch for new crypto-onramp providers registration and default-provider changes. | ||
| */ | ||
| export declare const watchCryptoOnrampProviders: (appKit: AppKit, parameters: WatchCryptoOnrampProvidersParameters) => WatchCryptoOnrampProvidersReturnType; | ||
| //# sourceMappingURL=watch-crypto-onramp-providers.d.ts.map |
| {"version":3,"file":"watch-crypto-onramp-providers.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/watch-crypto-onramp-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,oCAAoC;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,oCAAoC,GAAG,MAAM,IAAI,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACnC,QAAQ,MAAM,EACd,YAAY,oCAAoC,KACjD,oCAeF,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.watchCryptoOnrampProviders = void 0; | ||
| /** | ||
| * Watch for new crypto-onramp providers registration and default-provider changes. | ||
| */ | ||
| const watchCryptoOnrampProviders = (appKit, parameters) => { | ||
| const { onChange } = parameters; | ||
| const unsubscribeRegistered = appKit.emitter.on('provider:registered', (event) => { | ||
| if (event.payload.type === 'crypto-onramp') | ||
| onChange(); | ||
| }); | ||
| const unsubscribeDefaultChanged = appKit.emitter.on('provider:default-changed', (event) => { | ||
| if (event.payload.type === 'crypto-onramp') | ||
| onChange(); | ||
| }); | ||
| return () => { | ||
| unsubscribeRegistered(); | ||
| unsubscribeDefaultChanged(); | ||
| }; | ||
| }; | ||
| exports.watchCryptoOnrampProviders = watchCryptoOnrampProviders; |
| /** | ||
| * 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=create-transfer-jetton-transaction.test.d.ts.map |
| {"version":3,"file":"create-transfer-jetton-transaction.test.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/create-transfer-jetton-transaction.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. | ||
| * | ||
| */ | ||
| 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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
| Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
| }) : function(o, v) { | ||
| o["default"] = v; | ||
| }); | ||
| var __importStar = (this && this.__importStar) || (function () { | ||
| var ownKeys = function(o) { | ||
| ownKeys = Object.getOwnPropertyNames || function (o) { | ||
| var ar = []; | ||
| for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
| return ar; | ||
| }; | ||
| return ownKeys(o); | ||
| }; | ||
| return function (mod) { | ||
| if (mod && mod.__esModule) return mod; | ||
| var result = {}; | ||
| if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
| __setModuleDefault(result, mod); | ||
| return result; | ||
| }; | ||
| })(); | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const vitest_1 = require("vitest"); | ||
| const core_1 = require("@ton/core"); | ||
| const walletkit = __importStar(require("@ton/walletkit")); | ||
| const network_1 = require("../../types/network"); | ||
| const utils_1 = require("../../utils"); | ||
| const create_transfer_jetton_transaction_1 = require("./create-transfer-jetton-transaction"); | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const RECIPIENT = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const JETTON = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| const JETTON_WALLET = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| vitest_1.vi.mock('@ton/walletkit', async (importOriginal) => { | ||
| const actual = await importOriginal(); | ||
| return { | ||
| ...actual, | ||
| getJettonWalletAddressFromClient: vitest_1.vi.fn(), | ||
| }; | ||
| }); | ||
| const makeWallet = () => ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => network_1.Network.mainnet(), | ||
| }); | ||
| const makeAppKit = (wallet) => ({ | ||
| walletsManager: { selectedWallet: wallet }, | ||
| networkManager: { getClient: vitest_1.vi.fn().mockReturnValue({}) }, | ||
| }); | ||
| const decodeJettonBody = (payload) => { | ||
| if (!payload) | ||
| throw new Error('expected payload'); | ||
| const slice = core_1.Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // jetton transfer op | ||
| return { | ||
| queryId: slice.loadUintBig(64), | ||
| amount: slice.loadCoins(), | ||
| destination: slice.loadAddress(), | ||
| responseDestination: slice.loadAddress(), | ||
| customPayload: slice.loadMaybeRef(), | ||
| forwardAmount: slice.loadCoins(), | ||
| forwardPayload: slice.loadMaybeRef(), | ||
| }; | ||
| }; | ||
| const readComment = (cell) => { | ||
| if (!cell) | ||
| throw new Error('expected comment payload'); | ||
| const slice = cell.beginParse(); | ||
| slice.loadUint(32); | ||
| return slice.loadStringTail(); | ||
| }; | ||
| const sameCell = (a, b) => a !== null && a.toBoc().toString('base64') === b.toBoc().toString('base64'); | ||
| (0, vitest_1.describe)('createTransferJettonTransaction', () => { | ||
| (0, vitest_1.beforeEach)(() => { | ||
| vitest_1.vi.mocked(walletkit.getJettonWalletAddressFromClient).mockResolvedValue(JETTON_WALLET); | ||
| }); | ||
| (0, vitest_1.it)('targets the resolved jetton wallet and converts the amount by decimals', async () => { | ||
| const tx = await (0, create_transfer_jetton_transaction_1.createTransferJettonTransaction)(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '2', | ||
| jettonDecimals: 6, | ||
| }); | ||
| (0, vitest_1.expect)(tx.messages[0].address).toBe(JETTON_WALLET); | ||
| (0, vitest_1.expect)(tx.messages[0].amount).toBe(walletkit.DEFAULT_JETTON_GAS_FEE); | ||
| (0, vitest_1.expect)(tx.fromAddress).toBe(SENDER); | ||
| const body = decodeJettonBody(tx.messages[0].payload); | ||
| (0, vitest_1.expect)(body.amount).toBe(2000000n); | ||
| (0, vitest_1.expect)(body.destination.equals(core_1.Address.parse(RECIPIENT))).toBe(true); | ||
| (0, vitest_1.expect)(body.responseDestination.equals(core_1.Address.parse(SENDER))).toBe(true); | ||
| (0, vitest_1.expect)(body.queryId).toBe(0n); | ||
| (0, vitest_1.expect)(body.forwardAmount).toBe(walletkit.DEFAULT_FORWARD_AMOUNT); | ||
| (0, vitest_1.expect)(body.customPayload).toBeNull(); | ||
| (0, vitest_1.expect)(body.forwardPayload).toBeNull(); | ||
| }); | ||
| (0, vitest_1.it)('encodes a comment into the forward payload', async () => { | ||
| const tx = await (0, create_transfer_jetton_transaction_1.createTransferJettonTransaction)(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| comment: 'thanks', | ||
| }); | ||
| (0, vitest_1.expect)(readComment(decodeJettonBody(tx.messages[0].payload).forwardPayload)).toBe('thanks'); | ||
| }); | ||
| (0, vitest_1.it)('prefers a raw forwardPayload over a comment', async () => { | ||
| const forward = (0, core_1.beginCell)().storeUint(0xdeadbeef, 32).endCell(); | ||
| const tx = await (0, create_transfer_jetton_transaction_1.createTransferJettonTransaction)(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| comment: 'ignored', | ||
| forwardPayload: (0, utils_1.asBase64)(forward.toBoc().toString('base64')), | ||
| }); | ||
| (0, vitest_1.expect)(sameCell(decodeJettonBody(tx.messages[0].payload).forwardPayload, forward)).toBe(true); | ||
| }); | ||
| (0, vitest_1.it)('forwards queryId, forwardAmount, customPayload, responseDestination and gasAmount', async () => { | ||
| const customPayload = (0, core_1.beginCell)().storeUint(0xaa, 8).endCell(); | ||
| const tx = await (0, create_transfer_jetton_transaction_1.createTransferJettonTransaction)(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| responseDestination: RECIPIENT, | ||
| queryId: '7', | ||
| forwardAmount: '300000000', | ||
| customPayload: (0, utils_1.asBase64)(customPayload.toBoc().toString('base64')), | ||
| gasAmount: '150000000', | ||
| }); | ||
| (0, vitest_1.expect)(tx.messages[0].amount).toBe('150000000'); | ||
| const body = decodeJettonBody(tx.messages[0].payload); | ||
| (0, vitest_1.expect)(body.queryId).toBe(7n); | ||
| (0, vitest_1.expect)(body.forwardAmount).toBe(300000000n); | ||
| (0, vitest_1.expect)(body.responseDestination.equals(core_1.Address.parse(RECIPIENT))).toBe(true); | ||
| (0, vitest_1.expect)(sameCell(body.customPayload, customPayload)).toBe(true); | ||
| }); | ||
| (0, vitest_1.it)('throws when no wallet is connected', async () => { | ||
| await (0, vitest_1.expect)((0, create_transfer_jetton_transaction_1.createTransferJettonTransaction)(makeAppKit(null), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| })).rejects.toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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=create-transfer-nft-transaction.test.d.ts.map |
| {"version":3,"file":"create-transfer-nft-transaction.test.d.ts","sourceRoot":"","sources":["../../../../src/actions/nft/create-transfer-nft-transaction.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 core_1 = require("@ton/core"); | ||
| const walletkit_1 = require("@ton/walletkit"); | ||
| const network_1 = require("../../types/network"); | ||
| const utils_1 = require("../../utils"); | ||
| const create_transfer_nft_transaction_1 = require("./create-transfer-nft-transaction"); | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const NEW_OWNER = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const NFT = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| const makeWallet = () => ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => network_1.Network.mainnet(), | ||
| }); | ||
| const makeAppKit = (wallet) => ({ walletsManager: { selectedWallet: wallet } }); | ||
| const decodeNftBody = (payload) => { | ||
| if (!payload) | ||
| throw new Error('expected payload'); | ||
| const slice = core_1.Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // nft transfer op | ||
| return { | ||
| queryId: slice.loadUintBig(64), | ||
| newOwner: slice.loadAddress(), | ||
| responseDestination: slice.loadAddress(), | ||
| customPayload: slice.loadMaybeRef(), | ||
| forwardAmount: slice.loadCoins(), | ||
| forwardPayload: slice.loadMaybeRef(), | ||
| }; | ||
| }; | ||
| const readComment = (cell) => { | ||
| if (!cell) | ||
| throw new Error('expected comment payload'); | ||
| const slice = cell.beginParse(); | ||
| slice.loadUint(32); | ||
| return slice.loadStringTail(); | ||
| }; | ||
| const sameCell = (a, b) => a !== null && a.toBoc().toString('base64') === b.toBoc().toString('base64'); | ||
| (0, vitest_1.describe)('createTransferNftTransaction', () => { | ||
| (0, vitest_1.it)('builds a transfer with sensible defaults', async () => { | ||
| const tx = await (0, create_transfer_nft_transaction_1.createTransferNftTransaction)(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| }); | ||
| (0, vitest_1.expect)(tx.messages[0].address).toBe(NFT); | ||
| (0, vitest_1.expect)(tx.messages[0].amount).toBe(walletkit_1.DEFAULT_NFT_GAS_FEE); | ||
| (0, vitest_1.expect)(tx.fromAddress).toBe(SENDER); | ||
| const body = decodeNftBody(tx.messages[0].payload); | ||
| (0, vitest_1.expect)(body.queryId).toBe(0n); | ||
| (0, vitest_1.expect)(body.newOwner.equals(core_1.Address.parse(NEW_OWNER))).toBe(true); | ||
| (0, vitest_1.expect)(body.responseDestination.equals(core_1.Address.parse(SENDER))).toBe(true); | ||
| (0, vitest_1.expect)(body.customPayload).toBeNull(); | ||
| (0, vitest_1.expect)(body.forwardAmount).toBe(walletkit_1.DEFAULT_FORWARD_AMOUNT); | ||
| (0, vitest_1.expect)(body.forwardPayload).toBeNull(); | ||
| }); | ||
| (0, vitest_1.it)('encodes a comment into the forward payload', async () => { | ||
| const tx = await (0, create_transfer_nft_transaction_1.createTransferNftTransaction)(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| comment: 'enjoy', | ||
| }); | ||
| (0, vitest_1.expect)(readComment(decodeNftBody(tx.messages[0].payload).forwardPayload)).toBe('enjoy'); | ||
| }); | ||
| (0, vitest_1.it)('prefers a raw forwardPayload over a comment', async () => { | ||
| const forward = (0, core_1.beginCell)().storeUint(0xdeadbeef, 32).endCell(); | ||
| const tx = await (0, create_transfer_nft_transaction_1.createTransferNftTransaction)(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| comment: 'ignored', | ||
| forwardPayload: (0, utils_1.asBase64)(forward.toBoc().toString('base64')), | ||
| }); | ||
| (0, vitest_1.expect)(sameCell(decodeNftBody(tx.messages[0].payload).forwardPayload, forward)).toBe(true); | ||
| }); | ||
| (0, vitest_1.it)('forwards queryId, forwardAmount, customPayload, responseDestination and gas amount', async () => { | ||
| const customPayload = (0, core_1.beginCell)().storeUint(0xaa, 8).endCell(); | ||
| const tx = await (0, create_transfer_nft_transaction_1.createTransferNftTransaction)(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| gasAmount: '250000000', | ||
| responseDestination: NEW_OWNER, | ||
| queryId: '42', | ||
| forwardAmount: '5000000', | ||
| customPayload: (0, utils_1.asBase64)(customPayload.toBoc().toString('base64')), | ||
| }); | ||
| (0, vitest_1.expect)(tx.messages[0].amount).toBe('250000000'); | ||
| const body = decodeNftBody(tx.messages[0].payload); | ||
| (0, vitest_1.expect)(body.queryId).toBe(42n); | ||
| (0, vitest_1.expect)(body.forwardAmount).toBe(5000000n); | ||
| (0, vitest_1.expect)(body.responseDestination.equals(core_1.Address.parse(NEW_OWNER))).toBe(true); | ||
| (0, vitest_1.expect)(sameCell(body.customPayload, customPayload)).toBe(true); | ||
| }); | ||
| (0, vitest_1.it)('throws when no wallet is connected', async () => { | ||
| await (0, vitest_1.expect)((0, create_transfer_nft_transaction_1.createTransferNftTransaction)(makeAppKit(null), { nftAddress: NFT, recipientAddress: NEW_OWNER })).rejects.toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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'; | ||
| import type { CustomProvider } from '../../providers'; | ||
| export interface GetCustomProviderOptions { | ||
| id: string; | ||
| } | ||
| export type GetCustomProviderReturnType<T extends CustomProvider = CustomProvider> = T | undefined; | ||
| /** | ||
| * Get a registered custom provider by id. Pass the expected type as a generic | ||
| * argument to narrow the returned provider. | ||
| */ | ||
| export declare const getCustomProvider: <T extends CustomProvider = CustomProvider>(appKit: AppKit, options: GetCustomProviderOptions) => GetCustomProviderReturnType<T>; | ||
| //# sourceMappingURL=get-custom-provider.d.ts.map |
| {"version":3,"file":"get-custom-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/providers/get-custom-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACrC,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI,CAAC,GAAG,SAAS,CAAC;AAEnG;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EACvE,QAAQ,MAAM,EACd,SAAS,wBAAwB,KAClC,2BAA2B,CAAC,CAAC,CAE/B,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.getCustomProvider = void 0; | ||
| /** | ||
| * Get a registered custom provider by id. Pass the expected type as a generic | ||
| * argument to narrow the returned provider. | ||
| */ | ||
| const getCustomProvider = (appKit, options) => { | ||
| return appKit.customProvidersManager.getProvider(options.id); | ||
| }; | ||
| exports.getCustomProvider = getCustomProvider; |
| /** | ||
| * 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 interface WatchCustomProvidersParameters { | ||
| onChange: () => void; | ||
| } | ||
| export type WatchCustomProvidersReturnType = () => void; | ||
| /** | ||
| * Watch for custom provider registrations | ||
| */ | ||
| export declare const watchCustomProviders: (appKit: AppKit, parameters: WatchCustomProvidersParameters) => WatchCustomProvidersReturnType; | ||
| //# sourceMappingURL=watch-custom-providers.d.ts.map |
| {"version":3,"file":"watch-custom-providers.d.ts","sourceRoot":"","sources":["../../../../src/actions/providers/watch-custom-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,8BAA8B,GAAG,MAAM,IAAI,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC7B,QAAQ,MAAM,EACd,YAAY,8BAA8B,KAC3C,8BAMF,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.watchCustomProviders = void 0; | ||
| /** | ||
| * Watch for custom provider registrations | ||
| */ | ||
| const watchCustomProviders = (appKit, parameters) => { | ||
| const { onChange } = parameters; | ||
| return appKit.emitter.on('provider:registered', (event) => { | ||
| if (event.payload.type === 'custom') | ||
| onChange(); | ||
| }); | ||
| }; | ||
| exports.watchCustomProviders = watchCustomProviders; |
| /** | ||
| * 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=create-transfer-ton-transaction.test.d.ts.map |
| {"version":3,"file":"create-transfer-ton-transaction.test.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/create-transfer-ton-transaction.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 core_1 = require("@ton/core"); | ||
| const network_1 = require("../../types/network"); | ||
| const utils_1 = require("../../utils"); | ||
| const create_transfer_ton_transaction_1 = require("./create-transfer-ton-transaction"); | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const RECIPIENT = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const makeWallet = () => ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => network_1.Network.mainnet(), | ||
| }); | ||
| const makeAppKit = (wallet) => ({ walletsManager: { selectedWallet: wallet } }); | ||
| const readComment = (payload) => { | ||
| if (!payload) | ||
| throw new Error('expected payload'); | ||
| const slice = core_1.Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // text comment op = 0 | ||
| return slice.loadStringTail(); | ||
| }; | ||
| (0, vitest_1.describe)('createTransferTonTransaction', () => { | ||
| (0, vitest_1.it)('builds a single message with the amount converted to nanotons', () => { | ||
| const tx = (0, create_transfer_ton_transaction_1.createTransferTonTransaction)(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1.5', | ||
| }); | ||
| (0, vitest_1.expect)(tx.messages).toHaveLength(1); | ||
| (0, vitest_1.expect)(tx.messages[0].address).toBe(RECIPIENT); | ||
| (0, vitest_1.expect)(tx.messages[0].amount).toBe('1500000000'); | ||
| (0, vitest_1.expect)(tx.fromAddress).toBe(SENDER); | ||
| }); | ||
| (0, vitest_1.it)('encodes a comment into the payload when no raw payload is given', () => { | ||
| const tx = (0, create_transfer_ton_transaction_1.createTransferTonTransaction)(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| comment: 'gm', | ||
| }); | ||
| (0, vitest_1.expect)(readComment(tx.messages[0].payload)).toBe('gm'); | ||
| }); | ||
| (0, vitest_1.it)('prefers a raw payload over a comment', () => { | ||
| const rawPayload = (0, utils_1.asBase64)((0, core_1.beginCell)().storeUint(0x1234, 32).endCell().toBoc().toString('base64')); | ||
| const tx = (0, create_transfer_ton_transaction_1.createTransferTonTransaction)(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| comment: 'ignored', | ||
| payload: rawPayload, | ||
| }); | ||
| (0, vitest_1.expect)(tx.messages[0].payload).toBe(rawPayload); | ||
| }); | ||
| (0, vitest_1.it)('forwards stateInit and extraCurrency onto the message', () => { | ||
| const stateInit = (0, utils_1.asBase64)((0, core_1.beginCell)().storeUint(1, 8).endCell().toBoc().toString('base64')); | ||
| const extraCurrency = { '100': '5' }; | ||
| const tx = (0, create_transfer_ton_transaction_1.createTransferTonTransaction)(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| stateInit, | ||
| extraCurrency, | ||
| }); | ||
| (0, vitest_1.expect)(tx.messages[0].stateInit).toBe(stateInit); | ||
| (0, vitest_1.expect)(tx.messages[0].extraCurrency).toEqual(extraCurrency); | ||
| }); | ||
| (0, vitest_1.it)('throws when no wallet is connected', () => { | ||
| (0, vitest_1.expect)(() => (0, create_transfer_ton_transaction_1.createTransferTonTransaction)(makeAppKit(null), { recipientAddress: RECIPIENT, amount: '1' })).toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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/crypto-onramp/decent'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/crypto-onramp/decent/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,qCAAqC,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/crypto-onramp/decent"), 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. | ||
| * | ||
| */ | ||
| export { CryptoOnrampProvider, CryptoOnrampManager, CryptoOnrampError, CryptoOnrampErrorCode, Caip2ByNetwork, } from '@ton/walletkit'; | ||
| export type { CryptoOnrampAPI, CryptoOnrampProviderInterface, CryptoOnrampProviderMetadata, CryptoOnrampProviderMetadataOverride, CryptoOnrampQuote, CryptoOnrampQuoteParams, CryptoOnrampDeposit, CryptoOnrampDepositParams, CryptoOnrampStatus, CryptoOnrampStatusParams, CryptoOnrampSourceCurrency, CryptoOnrampDestinationCurrency, CryptoOnrampSupportedCurrencies, } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto-onramp/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACH,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACR,eAAe,EACf,6BAA6B,EAC7B,4BAA4B,EAC5B,oCAAoC,EACpC,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,GAClC,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.Caip2ByNetwork = exports.CryptoOnrampErrorCode = exports.CryptoOnrampError = exports.CryptoOnrampManager = exports.CryptoOnrampProvider = void 0; | ||
| var walletkit_1 = require("@ton/walletkit"); | ||
| Object.defineProperty(exports, "CryptoOnrampProvider", { enumerable: true, get: function () { return walletkit_1.CryptoOnrampProvider; } }); | ||
| Object.defineProperty(exports, "CryptoOnrampManager", { enumerable: true, get: function () { return walletkit_1.CryptoOnrampManager; } }); | ||
| Object.defineProperty(exports, "CryptoOnrampError", { enumerable: true, get: function () { return walletkit_1.CryptoOnrampError; } }); | ||
| Object.defineProperty(exports, "CryptoOnrampErrorCode", { enumerable: true, get: function () { return walletkit_1.CryptoOnrampErrorCode; } }); | ||
| Object.defineProperty(exports, "Caip2ByNetwork", { enumerable: true, get: function () { return walletkit_1.Caip2ByNetwork; } }); |
| /** | ||
| * 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/crypto-onramp/layerswap'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/crypto-onramp/layerswap/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,wCAAwC,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/crypto-onramp/layerswap"), 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. | ||
| * | ||
| */ | ||
| export { CustomProvidersManager } from '@ton/walletkit'; | ||
| export type { CustomProvider } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,YAAY,EAAE,cAAc,EAAE,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.CustomProvidersManager = void 0; | ||
| var walletkit_1 = require("@ton/walletkit"); | ||
| Object.defineProperty(exports, "CustomProvidersManager", { enumerable: true, get: function () { return walletkit_1.CustomProvidersManager; } }); |
| /** | ||
| * 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 { MutationOptions } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { CreateCryptoOnrampDepositOptions, CreateCryptoOnrampDepositReturnType } from '../../actions/crypto-onramp/create-crypto-onramp-deposit'; | ||
| import type { MutationParameter } from '../../types/query'; | ||
| export type CreateCryptoOnrampDepositErrorType = Error; | ||
| export type CreateCryptoOnrampDepositData = Awaited<CreateCryptoOnrampDepositReturnType>; | ||
| export type CreateCryptoOnrampDepositVariables = CreateCryptoOnrampDepositOptions; | ||
| export type CreateCryptoOnrampDepositMutationOptions<context = unknown> = MutationParameter<CreateCryptoOnrampDepositData, CreateCryptoOnrampDepositErrorType, CreateCryptoOnrampDepositVariables, context>; | ||
| export type CreateCryptoOnrampDepositMutationConfig<context = unknown> = MutationOptions<CreateCryptoOnrampDepositData, CreateCryptoOnrampDepositErrorType, CreateCryptoOnrampDepositVariables, context>; | ||
| export declare const createCryptoOnrampDepositMutationOptions: <context = unknown>(appKit: AppKit) => CreateCryptoOnrampDepositMutationConfig<context>; | ||
| //# sourceMappingURL=create-crypto-onramp-deposit.d.ts.map |
| {"version":3,"file":"create-crypto-onramp-deposit.d.ts","sourceRoot":"","sources":["../../../../src/queries/crypto-onramp/create-crypto-onramp-deposit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EACR,gCAAgC,EAChC,mCAAmC,EACtC,MAAM,0DAA0D,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,MAAM,kCAAkC,GAAG,KAAK,CAAC;AACvD,MAAM,MAAM,6BAA6B,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AACzF,MAAM,MAAM,kCAAkC,GAAG,gCAAgC,CAAC;AAClF,MAAM,MAAM,wCAAwC,CAAC,OAAO,GAAG,OAAO,IAAI,iBAAiB,CACvF,6BAA6B,EAC7B,kCAAkC,EAClC,kCAAkC,EAClC,OAAO,CACV,CAAC;AAEF,MAAM,MAAM,uCAAuC,CAAC,OAAO,GAAG,OAAO,IAAI,eAAe,CACpF,6BAA6B,EAC7B,kCAAkC,EAClC,kCAAkC,EAClC,OAAO,CACV,CAAC;AAEF,eAAO,MAAM,wCAAwC,GAAI,OAAO,GAAG,OAAO,EACtE,QAAQ,MAAM,KACf,uCAAuC,CAAC,OAAO,CAEhD,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.createCryptoOnrampDepositMutationOptions = void 0; | ||
| const create_crypto_onramp_deposit_1 = require("../../actions/crypto-onramp/create-crypto-onramp-deposit"); | ||
| const createCryptoOnrampDepositMutationOptions = (appKit) => ({ | ||
| mutationFn: (variables) => (0, create_crypto_onramp_deposit_1.createCryptoOnrampDeposit)(appKit, variables), | ||
| }); | ||
| exports.createCryptoOnrampDepositMutationOptions = createCryptoOnrampDepositMutationOptions; |
| /** | ||
| * 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'; | ||
| import type { GetCryptoOnrampQuoteOptions, GetCryptoOnrampQuoteReturnType } from '../../actions/crypto-onramp/get-crypto-onramp-quote'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetCryptoOnrampQuoteErrorType = Error; | ||
| export type GetCryptoOnrampQuoteData = GetCryptoOnrampQuoteQueryFnData; | ||
| export type GetCryptoOnrampQuoteQueryConfig<selectData = GetCryptoOnrampQuoteData> = Compute<ExactPartial<GetCryptoOnrampQuoteOptions>> & QueryParameter<GetCryptoOnrampQuoteQueryFnData, GetCryptoOnrampQuoteErrorType, selectData, GetCryptoOnrampQuoteQueryKey>; | ||
| export declare const getCryptoOnrampQuoteQueryOptions: <selectData = GetCryptoOnrampQuoteData>(appKit: AppKit, options?: GetCryptoOnrampQuoteQueryConfig<selectData>) => GetCryptoOnrampQuoteQueryOptions<selectData>; | ||
| export type GetCryptoOnrampQuoteQueryFnData = Compute<Awaited<GetCryptoOnrampQuoteReturnType>>; | ||
| export declare const getCryptoOnrampQuoteQueryKey: (options?: Compute<ExactPartial<GetCryptoOnrampQuoteOptions>>) => GetCryptoOnrampQuoteQueryKey; | ||
| export type GetCryptoOnrampQuoteQueryKey = readonly [ | ||
| 'crypto-onramp-quote', | ||
| Compute<ExactPartial<GetCryptoOnrampQuoteOptions>> | ||
| ]; | ||
| export type GetCryptoOnrampQuoteQueryOptions<selectData = GetCryptoOnrampQuoteData> = QueryOptions<GetCryptoOnrampQuoteQueryFnData, GetCryptoOnrampQuoteErrorType, selectData, GetCryptoOnrampQuoteQueryKey>; | ||
| //# sourceMappingURL=get-crypto-onramp-quote.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-quote.d.ts","sourceRoot":"","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| ||
| * 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.getCryptoOnrampQuoteQueryKey = exports.getCryptoOnrampQuoteQueryOptions = void 0; | ||
| const get_crypto_onramp_quote_1 = require("../../actions/crypto-onramp/get-crypto-onramp-quote"); | ||
| const utils_1 = require("../../utils"); | ||
| const getCryptoOnrampQuoteQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| return (0, get_crypto_onramp_quote_1.getCryptoOnrampQuote)(appKit, parameters); | ||
| }, | ||
| queryKey: (0, exports.getCryptoOnrampQuoteQueryKey)(options), | ||
| }; | ||
| }; | ||
| exports.getCryptoOnrampQuoteQueryOptions = getCryptoOnrampQuoteQueryOptions; | ||
| const getCryptoOnrampQuoteQueryKey = (options = {}) => ['crypto-onramp-quote', (0, utils_1.filterQueryOptions)(options)]; | ||
| exports.getCryptoOnrampQuoteQueryKey = getCryptoOnrampQuoteQueryKey; |
| /** | ||
| * 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'; | ||
| import type { GetCryptoOnrampStatusOptions, GetCryptoOnrampStatusReturnType } from '../../actions/crypto-onramp/get-crypto-onramp-status'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetCryptoOnrampStatusErrorType = Error; | ||
| export type GetCryptoOnrampStatusData = GetCryptoOnrampStatusQueryFnData; | ||
| export type GetCryptoOnrampStatusQueryConfig<selectData = GetCryptoOnrampStatusData> = Compute<ExactPartial<GetCryptoOnrampStatusOptions>> & QueryParameter<GetCryptoOnrampStatusQueryFnData, GetCryptoOnrampStatusErrorType, selectData, GetCryptoOnrampStatusQueryKey>; | ||
| export declare const getCryptoOnrampStatusQueryOptions: <selectData = GetCryptoOnrampStatusData>(appKit: AppKit, options?: GetCryptoOnrampStatusQueryConfig<selectData>) => GetCryptoOnrampStatusQueryOptions<selectData>; | ||
| export type GetCryptoOnrampStatusQueryFnData = Compute<Awaited<GetCryptoOnrampStatusReturnType>>; | ||
| export declare const getCryptoOnrampStatusQueryKey: (options?: Compute<ExactPartial<GetCryptoOnrampStatusOptions>>) => GetCryptoOnrampStatusQueryKey; | ||
| export type GetCryptoOnrampStatusQueryKey = readonly [ | ||
| 'crypto-onramp-status', | ||
| Compute<ExactPartial<GetCryptoOnrampStatusOptions>> | ||
| ]; | ||
| export type GetCryptoOnrampStatusQueryOptions<selectData = GetCryptoOnrampStatusData> = QueryOptions<GetCryptoOnrampStatusQueryFnData, GetCryptoOnrampStatusErrorType, selectData, GetCryptoOnrampStatusQueryKey>; | ||
| //# sourceMappingURL=get-crypto-onramp-status.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-status.d.ts","sourceRoot":"","sources":["../../../../src/queries/crypto-onramp/get-crypto-onramp-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EACR,4BAA4B,EAC5B,+BAA+B,EAClC,MAAM,sDAAsD,CAAC;AAC9D,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,8BAA8B,GAAG,KAAK,CAAC;AACnD,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,CAAC;AACzE,MAAM,MAAM,gCAAgC,CAAC,UAAU,GAAG,yBAAyB,IAAI,OAAO,CAC1F,YAAY,CAAC,4BAA4B,CAAC,CAC7C,GACG,cAAc,CACV,gCAAgC,EAChC,8BAA8B,EAC9B,UAAU,EACV,6BAA6B,CAChC,CAAC;AAEN,eAAO,MAAM,iCAAiC,GAAI,UAAU,GAAG,yBAAyB,EACpF,QAAQ,MAAM,EACd,UAAS,gCAAgC,CAAC,UAAU,CAAM,KAC3D,iCAAiC,CAAC,UAAU,CAU9C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,OAAO,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC;AACjG,eAAO,MAAM,6BAA6B,GACtC,UAAS,OAAO,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAM,KAClE,6BAA+F,CAAC;AACnG,MAAM,MAAM,6BAA6B,GAAG,SAAS;IACjD,sBAAsB;IACtB,OAAO,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;CACtD,CAAC;AACF,MAAM,MAAM,iCAAiC,CAAC,UAAU,GAAG,yBAAyB,IAAI,YAAY,CAChG,gCAAgC,EAChC,8BAA8B,EAC9B,UAAU,EACV,6BAA6B,CAChC,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.getCryptoOnrampStatusQueryKey = exports.getCryptoOnrampStatusQueryOptions = void 0; | ||
| const get_crypto_onramp_status_1 = require("../../actions/crypto-onramp/get-crypto-onramp-status"); | ||
| const utils_1 = require("../../utils"); | ||
| const getCryptoOnrampStatusQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| return (0, get_crypto_onramp_status_1.getCryptoOnrampStatus)(appKit, parameters); | ||
| }, | ||
| queryKey: (0, exports.getCryptoOnrampStatusQueryKey)(options), | ||
| enabled: options.depositId !== undefined, | ||
| }; | ||
| }; | ||
| exports.getCryptoOnrampStatusQueryOptions = getCryptoOnrampStatusQueryOptions; | ||
| const getCryptoOnrampStatusQueryKey = (options = {}) => ['crypto-onramp-status', (0, utils_1.filterQueryOptions)(options)]; | ||
| exports.getCryptoOnrampStatusQueryKey = getCryptoOnrampStatusQueryKey; |
| /** | ||
| * 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'; | ||
| import type { GetCryptoOnrampSupportedCurrenciesOptions, GetCryptoOnrampSupportedCurrenciesReturnType } from '../../actions/crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetCryptoOnrampSupportedCurrenciesErrorType = Error; | ||
| export type GetCryptoOnrampSupportedCurrenciesData = GetCryptoOnrampSupportedCurrenciesQueryFnData; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryConfig<selectData = GetCryptoOnrampSupportedCurrenciesData> = Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>> & QueryParameter<GetCryptoOnrampSupportedCurrenciesQueryFnData, GetCryptoOnrampSupportedCurrenciesErrorType, selectData, GetCryptoOnrampSupportedCurrenciesQueryKey>; | ||
| export declare const getCryptoOnrampSupportedCurrenciesQueryOptions: <selectData = GetCryptoOnrampSupportedCurrenciesData>(appKit: AppKit, options?: GetCryptoOnrampSupportedCurrenciesQueryConfig<selectData>) => GetCryptoOnrampSupportedCurrenciesQueryOptions<selectData>; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryFnData = Compute<Awaited<GetCryptoOnrampSupportedCurrenciesReturnType>>; | ||
| export declare const getCryptoOnrampSupportedCurrenciesQueryKey: (options?: Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>>) => GetCryptoOnrampSupportedCurrenciesQueryKey; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryKey = readonly [ | ||
| 'crypto-onramp-supported-currencies', | ||
| Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>> | ||
| ]; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryOptions<selectData = GetCryptoOnrampSupportedCurrenciesData> = QueryOptions<GetCryptoOnrampSupportedCurrenciesQueryFnData, GetCryptoOnrampSupportedCurrenciesErrorType, selectData, GetCryptoOnrampSupportedCurrenciesQueryKey>; | ||
| //# sourceMappingURL=get-crypto-onramp-supported-currencies.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-supported-currencies.d.ts","sourceRoot":"","sources":["../../../../src/queries/crypto-onramp/get-crypto-onramp-supported-currencies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EACR,yCAAyC,EACzC,4CAA4C,EAC/C,MAAM,oEAAoE,CAAC;AAC5E,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,2CAA2C,GAAG,KAAK,CAAC;AAChE,MAAM,MAAM,sCAAsC,GAAG,6CAA6C,CAAC;AACnG,MAAM,MAAM,6CAA6C,CAAC,UAAU,GAAG,sCAAsC,IACzG,OAAO,CAAC,YAAY,CAAC,yCAAyC,CAAC,CAAC,GAC5D,cAAc,CACV,6CAA6C,EAC7C,2CAA2C,EAC3C,UAAU,EACV,0CAA0C,CAC7C,CAAC;AAKV,eAAO,MAAM,8CAA8C,GAAI,UAAU,GAAG,sCAAsC,EAC9G,QAAQ,MAAM,EACd,UAAS,6CAA6C,CAAC,UAAU,CAAM,KACxE,8CAA8C,CAAC,UAAU,CAgB3D,CAAC;AAEF,MAAM,MAAM,6CAA6C,GAAG,OAAO,CAC/D,OAAO,CAAC,4CAA4C,CAAC,CACxD,CAAC;AACF,eAAO,MAAM,0CAA0C,GACnD,UAAS,OAAO,CAAC,YAAY,CAAC,yCAAyC,CAAC,CAAM,KAC/E,0CAC6E,CAAC;AACjF,MAAM,MAAM,0CAA0C,GAAG,SAAS;IAC9D,oCAAoC;IACpC,OAAO,CAAC,YAAY,CAAC,yCAAyC,CAAC,CAAC;CACnE,CAAC;AACF,MAAM,MAAM,8CAA8C,CAAC,UAAU,GAAG,sCAAsC,IAC1G,YAAY,CACR,6CAA6C,EAC7C,2CAA2C,EAC3C,UAAU,EACV,0CAA0C,CAC7C,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.getCryptoOnrampSupportedCurrenciesQueryKey = exports.getCryptoOnrampSupportedCurrenciesQueryOptions = void 0; | ||
| const get_crypto_onramp_supported_currencies_1 = require("../../actions/crypto-onramp/get-crypto-onramp-supported-currencies"); | ||
| const utils_1 = require("../../utils"); | ||
| const ONE_HOUR_MS = 60 * 60 * 1000; | ||
| const ONE_DAY_MS = 24 * ONE_HOUR_MS; | ||
| const getCryptoOnrampSupportedCurrenciesQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| // The supported-currencies list for a provider rarely changes. Keep the fetched data | ||
| // in-cache long enough that the widget never refetches it within a normal session. | ||
| // Consumers can override via `options.query` if they need different behavior. | ||
| staleTime: ONE_HOUR_MS, | ||
| gcTime: ONE_DAY_MS, | ||
| refetchOnWindowFocus: false, | ||
| refetchOnReconnect: false, | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| return (0, get_crypto_onramp_supported_currencies_1.getCryptoOnrampSupportedCurrencies)(appKit, parameters); | ||
| }, | ||
| queryKey: (0, exports.getCryptoOnrampSupportedCurrenciesQueryKey)(options), | ||
| }; | ||
| }; | ||
| exports.getCryptoOnrampSupportedCurrenciesQueryOptions = getCryptoOnrampSupportedCurrenciesQueryOptions; | ||
| const getCryptoOnrampSupportedCurrenciesQueryKey = (options = {}) => ['crypto-onramp-supported-currencies', (0, utils_1.filterQueryOptions)(options)]; | ||
| exports.getCryptoOnrampSupportedCurrenciesQueryKey = getCryptoOnrampSupportedCurrenciesQueryKey; |
| /** | ||
| * 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 { CryptoOnrampDeposit, CryptoOnrampDepositParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type CreateCryptoOnrampDepositOptions<T = unknown> = CryptoOnrampDepositParams<T> & { | ||
| providerId?: string; | ||
| }; | ||
| export type CreateCryptoOnrampDepositReturnType = Promise<CryptoOnrampDeposit>; | ||
| /** | ||
| * Create a crypto onramp deposit from a previously obtained quote | ||
| */ | ||
| export declare const createCryptoOnrampDeposit: <T = unknown>(appKit: AppKit, options: CreateCryptoOnrampDepositOptions<T>) => CreateCryptoOnrampDepositReturnType; | ||
| //# sourceMappingURL=create-crypto-onramp-deposit.d.ts.map |
| {"version":3,"file":"create-crypto-onramp-deposit.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/create-crypto-onramp-deposit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,gCAAgC,CAAC,CAAC,GAAG,OAAO,IAAI,yBAAyB,CAAC,CAAC,CAAC,GAAG;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAU,CAAC,GAAG,OAAO,EACvD,QAAQ,MAAM,EACd,SAAS,gCAAgC,CAAC,CAAC,CAAC,KAC7C,mCAEF,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. | ||
| * | ||
| */ | ||
| /** | ||
| * Create a crypto onramp deposit from a previously obtained quote | ||
| */ | ||
| export const createCryptoOnrampDeposit = async (appKit, options) => { | ||
| return appKit.cryptoOnrampManager.createDeposit(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 { CryptoOnrampProviderMetadata } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampProviderMetadataOptions { | ||
| providerId?: string; | ||
| } | ||
| export type GetCryptoOnrampProviderMetadataReturnType = CryptoOnrampProviderMetadata; | ||
| /** | ||
| * Get static metadata for a crypto-onramp provider (display name, logo, url). | ||
| */ | ||
| export declare const getCryptoOnrampProviderMetadata: (appKit: AppKit, options?: GetCryptoOnrampProviderMetadataOptions) => GetCryptoOnrampProviderMetadataReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-provider-metadata.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-provider-metadata.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-provider-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,sCAAsC;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,yCAAyC,GAAG,4BAA4B,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,+BAA+B,GACxC,QAAQ,MAAM,EACd,UAAS,sCAA2C,KACrD,yCAEF,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 static metadata for a crypto-onramp provider (display name, logo, url). | ||
| */ | ||
| export const getCryptoOnrampProviderMetadata = (appKit, options = {}) => { | ||
| return appKit.cryptoOnrampManager.getMetadata(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 { CryptoOnrampProviderInterface } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampProviderOptions { | ||
| id?: string; | ||
| } | ||
| export type GetCryptoOnrampProviderReturnType = CryptoOnrampProviderInterface; | ||
| /** | ||
| * Get a registered crypto-onramp provider by id, or the default one when no id is given. | ||
| */ | ||
| export declare const getCryptoOnrampProvider: (appKit: AppKit, options?: GetCryptoOnrampProviderOptions) => GetCryptoOnrampProviderReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-provider.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,8BAA8B;IAC3C,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAChC,QAAQ,MAAM,EACd,UAAS,8BAAmC,KAC7C,iCAEF,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 a registered crypto-onramp provider by id, or the default one when no id is given. | ||
| */ | ||
| export const getCryptoOnrampProvider = (appKit, options = {}) => { | ||
| return appKit.cryptoOnrampManager.getProvider(options.id); | ||
| }; |
| /** | ||
| * 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 { CryptoOnrampProviderInterface } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampProvidersReturnType = CryptoOnrampProviderInterface[]; | ||
| /** | ||
| * Get all registered crypto-onramp providers. | ||
| */ | ||
| export declare const getCryptoOnrampProviders: (appKit: AppKit) => GetCryptoOnrampProvidersReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-providers.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-providers.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,kCAAkC,GAAG,6BAA6B,EAAE,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,KAAG,kCAEzD,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 all registered crypto-onramp providers. | ||
| */ | ||
| export const getCryptoOnrampProviders = (appKit) => { | ||
| return appKit.cryptoOnrampManager.getProviders(); | ||
| }; |
| /** | ||
| * 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 { CryptoOnrampQuote, CryptoOnrampQuoteParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampQuoteOptions<T = unknown> = CryptoOnrampQuoteParams<T> & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetCryptoOnrampQuoteReturnType = Promise<CryptoOnrampQuote>; | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| export declare const getCryptoOnrampQuote: <T = unknown>(appKit: AppKit, options: GetCryptoOnrampQuoteOptions<T>) => GetCryptoOnrampQuoteReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-quote.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-quote.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,2BAA2B,CAAC,CAAC,GAAG,OAAO,IAAI,uBAAuB,CAAC,CAAC,CAAC,GAAG;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAU,CAAC,GAAG,OAAO,EAClD,QAAQ,MAAM,EACd,SAAS,2BAA2B,CAAC,CAAC,CAAC,KACxC,8BAEF,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 a crypto onramp quote | ||
| */ | ||
| export const getCryptoOnrampQuote = async (appKit, options) => { | ||
| return appKit.cryptoOnrampManager.getQuote(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 { CryptoOnrampStatus, CryptoOnrampStatusParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampStatusOptions = CryptoOnrampStatusParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetCryptoOnrampStatusReturnType = Promise<CryptoOnrampStatus>; | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| export declare const getCryptoOnrampStatus: (appKit: AppKit, options: GetCryptoOnrampStatusOptions) => GetCryptoOnrampStatusReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-status.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-status.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,GAAG;IAClE,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. | ||
| * | ||
| */ | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| export const getCryptoOnrampStatus = async (appKit, options) => { | ||
| return appKit.cryptoOnrampManager.getStatus(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 { CryptoOnrampSupportedCurrencies } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampSupportedCurrenciesOptions { | ||
| providerId?: string; | ||
| } | ||
| export type GetCryptoOnrampSupportedCurrenciesReturnType = Promise<CryptoOnrampSupportedCurrencies>; | ||
| /** | ||
| * Discover supported source/destination currencies for a crypto-onramp provider. | ||
| */ | ||
| export declare const getCryptoOnrampSupportedCurrencies: (appKit: AppKit, options?: GetCryptoOnrampSupportedCurrenciesOptions) => GetCryptoOnrampSupportedCurrenciesReturnType; | ||
| //# sourceMappingURL=get-crypto-onramp-supported-currencies.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-supported-currencies.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/get-crypto-onramp-supported-currencies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,yCAAyC;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,4CAA4C,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,kCAAkC,GAC3C,QAAQ,MAAM,EACd,UAAS,yCAA8C,KACxD,4CAEF,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. | ||
| * | ||
| */ | ||
| /** | ||
| * Discover supported source/destination currencies for a crypto-onramp provider. | ||
| */ | ||
| export const getCryptoOnrampSupportedCurrencies = async (appKit, options = {}) => { | ||
| return appKit.cryptoOnrampManager.getSupportedCurrencies(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 interface SetDefaultCryptoOnrampProviderParameters { | ||
| providerId: string; | ||
| } | ||
| export type SetDefaultCryptoOnrampProviderReturnType = void; | ||
| /** | ||
| * Set the default crypto-onramp provider. | ||
| * Subsequent quote, deposit and status calls will use this provider when none is specified. | ||
| */ | ||
| export declare const setDefaultCryptoOnrampProvider: (appKit: AppKit, parameters: SetDefaultCryptoOnrampProviderParameters) => SetDefaultCryptoOnrampProviderReturnType; | ||
| //# sourceMappingURL=set-default-crypto-onramp-provider.d.ts.map |
| {"version":3,"file":"set-default-crypto-onramp-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/set-default-crypto-onramp-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,wCAAwC;IACrD,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,wCAAwC,GAAG,IAAI,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,8BAA8B,GACvC,QAAQ,MAAM,EACd,YAAY,wCAAwC,KACrD,wCAEF,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. | ||
| * | ||
| */ | ||
| /** | ||
| * Set the default crypto-onramp provider. | ||
| * Subsequent quote, deposit and status calls will use this provider when none is specified. | ||
| */ | ||
| export const setDefaultCryptoOnrampProvider = (appKit, parameters) => { | ||
| appKit.cryptoOnrampManager.setDefaultProvider(parameters.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 interface WatchCryptoOnrampProvidersParameters { | ||
| onChange: () => void; | ||
| } | ||
| export type WatchCryptoOnrampProvidersReturnType = () => void; | ||
| /** | ||
| * Watch for new crypto-onramp providers registration and default-provider changes. | ||
| */ | ||
| export declare const watchCryptoOnrampProviders: (appKit: AppKit, parameters: WatchCryptoOnrampProvidersParameters) => WatchCryptoOnrampProvidersReturnType; | ||
| //# sourceMappingURL=watch-crypto-onramp-providers.d.ts.map |
| {"version":3,"file":"watch-crypto-onramp-providers.d.ts","sourceRoot":"","sources":["../../../../src/actions/crypto-onramp/watch-crypto-onramp-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,oCAAoC;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,oCAAoC,GAAG,MAAM,IAAI,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACnC,QAAQ,MAAM,EACd,YAAY,oCAAoC,KACjD,oCAeF,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. | ||
| * | ||
| */ | ||
| /** | ||
| * Watch for new crypto-onramp providers registration and default-provider changes. | ||
| */ | ||
| export const watchCryptoOnrampProviders = (appKit, parameters) => { | ||
| const { onChange } = parameters; | ||
| const unsubscribeRegistered = appKit.emitter.on('provider:registered', (event) => { | ||
| if (event.payload.type === 'crypto-onramp') | ||
| onChange(); | ||
| }); | ||
| const unsubscribeDefaultChanged = appKit.emitter.on('provider:default-changed', (event) => { | ||
| if (event.payload.type === 'crypto-onramp') | ||
| onChange(); | ||
| }); | ||
| return () => { | ||
| unsubscribeRegistered(); | ||
| unsubscribeDefaultChanged(); | ||
| }; | ||
| }; |
| /** | ||
| * 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=create-transfer-jetton-transaction.test.d.ts.map |
| {"version":3,"file":"create-transfer-jetton-transaction.test.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/create-transfer-jetton-transaction.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 { Address, beginCell, Cell } from '@ton/core'; | ||
| import * as walletkit from '@ton/walletkit'; | ||
| import { Network } from '../../types/network'; | ||
| import { asBase64 } from '../../utils'; | ||
| import { createTransferJettonTransaction } from './create-transfer-jetton-transaction'; | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const RECIPIENT = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const JETTON = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| const JETTON_WALLET = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| vi.mock('@ton/walletkit', async (importOriginal) => { | ||
| const actual = await importOriginal(); | ||
| return { | ||
| ...actual, | ||
| getJettonWalletAddressFromClient: vi.fn(), | ||
| }; | ||
| }); | ||
| const makeWallet = () => ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => Network.mainnet(), | ||
| }); | ||
| const makeAppKit = (wallet) => ({ | ||
| walletsManager: { selectedWallet: wallet }, | ||
| networkManager: { getClient: vi.fn().mockReturnValue({}) }, | ||
| }); | ||
| const decodeJettonBody = (payload) => { | ||
| if (!payload) | ||
| throw new Error('expected payload'); | ||
| const slice = Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // jetton transfer op | ||
| return { | ||
| queryId: slice.loadUintBig(64), | ||
| amount: slice.loadCoins(), | ||
| destination: slice.loadAddress(), | ||
| responseDestination: slice.loadAddress(), | ||
| customPayload: slice.loadMaybeRef(), | ||
| forwardAmount: slice.loadCoins(), | ||
| forwardPayload: slice.loadMaybeRef(), | ||
| }; | ||
| }; | ||
| const readComment = (cell) => { | ||
| if (!cell) | ||
| throw new Error('expected comment payload'); | ||
| const slice = cell.beginParse(); | ||
| slice.loadUint(32); | ||
| return slice.loadStringTail(); | ||
| }; | ||
| const sameCell = (a, b) => a !== null && a.toBoc().toString('base64') === b.toBoc().toString('base64'); | ||
| describe('createTransferJettonTransaction', () => { | ||
| beforeEach(() => { | ||
| vi.mocked(walletkit.getJettonWalletAddressFromClient).mockResolvedValue(JETTON_WALLET); | ||
| }); | ||
| it('targets the resolved jetton wallet and converts the amount by decimals', async () => { | ||
| const tx = await createTransferJettonTransaction(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '2', | ||
| jettonDecimals: 6, | ||
| }); | ||
| expect(tx.messages[0].address).toBe(JETTON_WALLET); | ||
| expect(tx.messages[0].amount).toBe(walletkit.DEFAULT_JETTON_GAS_FEE); | ||
| expect(tx.fromAddress).toBe(SENDER); | ||
| const body = decodeJettonBody(tx.messages[0].payload); | ||
| expect(body.amount).toBe(2000000n); | ||
| expect(body.destination.equals(Address.parse(RECIPIENT))).toBe(true); | ||
| expect(body.responseDestination.equals(Address.parse(SENDER))).toBe(true); | ||
| expect(body.queryId).toBe(0n); | ||
| expect(body.forwardAmount).toBe(walletkit.DEFAULT_FORWARD_AMOUNT); | ||
| expect(body.customPayload).toBeNull(); | ||
| expect(body.forwardPayload).toBeNull(); | ||
| }); | ||
| it('encodes a comment into the forward payload', async () => { | ||
| const tx = await createTransferJettonTransaction(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| comment: 'thanks', | ||
| }); | ||
| expect(readComment(decodeJettonBody(tx.messages[0].payload).forwardPayload)).toBe('thanks'); | ||
| }); | ||
| it('prefers a raw forwardPayload over a comment', async () => { | ||
| const forward = beginCell().storeUint(0xdeadbeef, 32).endCell(); | ||
| const tx = await createTransferJettonTransaction(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| comment: 'ignored', | ||
| forwardPayload: asBase64(forward.toBoc().toString('base64')), | ||
| }); | ||
| expect(sameCell(decodeJettonBody(tx.messages[0].payload).forwardPayload, forward)).toBe(true); | ||
| }); | ||
| it('forwards queryId, forwardAmount, customPayload, responseDestination and gasAmount', async () => { | ||
| const customPayload = beginCell().storeUint(0xaa, 8).endCell(); | ||
| const tx = await createTransferJettonTransaction(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| responseDestination: RECIPIENT, | ||
| queryId: '7', | ||
| forwardAmount: '300000000', | ||
| customPayload: asBase64(customPayload.toBoc().toString('base64')), | ||
| gasAmount: '150000000', | ||
| }); | ||
| expect(tx.messages[0].amount).toBe('150000000'); | ||
| const body = decodeJettonBody(tx.messages[0].payload); | ||
| expect(body.queryId).toBe(7n); | ||
| expect(body.forwardAmount).toBe(300000000n); | ||
| expect(body.responseDestination.equals(Address.parse(RECIPIENT))).toBe(true); | ||
| expect(sameCell(body.customPayload, customPayload)).toBe(true); | ||
| }); | ||
| it('throws when no wallet is connected', async () => { | ||
| await expect(createTransferJettonTransaction(makeAppKit(null), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| })).rejects.toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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=create-transfer-nft-transaction.test.d.ts.map |
| {"version":3,"file":"create-transfer-nft-transaction.test.d.ts","sourceRoot":"","sources":["../../../../src/actions/nft/create-transfer-nft-transaction.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 } from 'vitest'; | ||
| import { Address, beginCell, Cell } from '@ton/core'; | ||
| import { DEFAULT_FORWARD_AMOUNT, DEFAULT_NFT_GAS_FEE } from '@ton/walletkit'; | ||
| import { Network } from '../../types/network'; | ||
| import { asBase64 } from '../../utils'; | ||
| import { createTransferNftTransaction } from './create-transfer-nft-transaction'; | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const NEW_OWNER = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const NFT = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| const makeWallet = () => ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => Network.mainnet(), | ||
| }); | ||
| const makeAppKit = (wallet) => ({ walletsManager: { selectedWallet: wallet } }); | ||
| const decodeNftBody = (payload) => { | ||
| if (!payload) | ||
| throw new Error('expected payload'); | ||
| const slice = Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // nft transfer op | ||
| return { | ||
| queryId: slice.loadUintBig(64), | ||
| newOwner: slice.loadAddress(), | ||
| responseDestination: slice.loadAddress(), | ||
| customPayload: slice.loadMaybeRef(), | ||
| forwardAmount: slice.loadCoins(), | ||
| forwardPayload: slice.loadMaybeRef(), | ||
| }; | ||
| }; | ||
| const readComment = (cell) => { | ||
| if (!cell) | ||
| throw new Error('expected comment payload'); | ||
| const slice = cell.beginParse(); | ||
| slice.loadUint(32); | ||
| return slice.loadStringTail(); | ||
| }; | ||
| const sameCell = (a, b) => a !== null && a.toBoc().toString('base64') === b.toBoc().toString('base64'); | ||
| describe('createTransferNftTransaction', () => { | ||
| it('builds a transfer with sensible defaults', async () => { | ||
| const tx = await createTransferNftTransaction(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| }); | ||
| expect(tx.messages[0].address).toBe(NFT); | ||
| expect(tx.messages[0].amount).toBe(DEFAULT_NFT_GAS_FEE); | ||
| expect(tx.fromAddress).toBe(SENDER); | ||
| const body = decodeNftBody(tx.messages[0].payload); | ||
| expect(body.queryId).toBe(0n); | ||
| expect(body.newOwner.equals(Address.parse(NEW_OWNER))).toBe(true); | ||
| expect(body.responseDestination.equals(Address.parse(SENDER))).toBe(true); | ||
| expect(body.customPayload).toBeNull(); | ||
| expect(body.forwardAmount).toBe(DEFAULT_FORWARD_AMOUNT); | ||
| expect(body.forwardPayload).toBeNull(); | ||
| }); | ||
| it('encodes a comment into the forward payload', async () => { | ||
| const tx = await createTransferNftTransaction(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| comment: 'enjoy', | ||
| }); | ||
| expect(readComment(decodeNftBody(tx.messages[0].payload).forwardPayload)).toBe('enjoy'); | ||
| }); | ||
| it('prefers a raw forwardPayload over a comment', async () => { | ||
| const forward = beginCell().storeUint(0xdeadbeef, 32).endCell(); | ||
| const tx = await createTransferNftTransaction(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| comment: 'ignored', | ||
| forwardPayload: asBase64(forward.toBoc().toString('base64')), | ||
| }); | ||
| expect(sameCell(decodeNftBody(tx.messages[0].payload).forwardPayload, forward)).toBe(true); | ||
| }); | ||
| it('forwards queryId, forwardAmount, customPayload, responseDestination and gas amount', async () => { | ||
| const customPayload = beginCell().storeUint(0xaa, 8).endCell(); | ||
| const tx = await createTransferNftTransaction(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| gasAmount: '250000000', | ||
| responseDestination: NEW_OWNER, | ||
| queryId: '42', | ||
| forwardAmount: '5000000', | ||
| customPayload: asBase64(customPayload.toBoc().toString('base64')), | ||
| }); | ||
| expect(tx.messages[0].amount).toBe('250000000'); | ||
| const body = decodeNftBody(tx.messages[0].payload); | ||
| expect(body.queryId).toBe(42n); | ||
| expect(body.forwardAmount).toBe(5000000n); | ||
| expect(body.responseDestination.equals(Address.parse(NEW_OWNER))).toBe(true); | ||
| expect(sameCell(body.customPayload, customPayload)).toBe(true); | ||
| }); | ||
| it('throws when no wallet is connected', async () => { | ||
| await expect(createTransferNftTransaction(makeAppKit(null), { nftAddress: NFT, recipientAddress: NEW_OWNER })).rejects.toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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'; | ||
| import type { CustomProvider } from '../../providers'; | ||
| export interface GetCustomProviderOptions { | ||
| id: string; | ||
| } | ||
| export type GetCustomProviderReturnType<T extends CustomProvider = CustomProvider> = T | undefined; | ||
| /** | ||
| * Get a registered custom provider by id. Pass the expected type as a generic | ||
| * argument to narrow the returned provider. | ||
| */ | ||
| export declare const getCustomProvider: <T extends CustomProvider = CustomProvider>(appKit: AppKit, options: GetCustomProviderOptions) => GetCustomProviderReturnType<T>; | ||
| //# sourceMappingURL=get-custom-provider.d.ts.map |
| {"version":3,"file":"get-custom-provider.d.ts","sourceRoot":"","sources":["../../../../src/actions/providers/get-custom-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACrC,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI,CAAC,GAAG,SAAS,CAAC;AAEnG;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EACvE,QAAQ,MAAM,EACd,SAAS,wBAAwB,KAClC,2BAA2B,CAAC,CAAC,CAE/B,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 a registered custom provider by id. Pass the expected type as a generic | ||
| * argument to narrow the returned provider. | ||
| */ | ||
| export const getCustomProvider = (appKit, options) => { | ||
| return appKit.customProvidersManager.getProvider(options.id); | ||
| }; |
| /** | ||
| * 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 interface WatchCustomProvidersParameters { | ||
| onChange: () => void; | ||
| } | ||
| export type WatchCustomProvidersReturnType = () => void; | ||
| /** | ||
| * Watch for custom provider registrations | ||
| */ | ||
| export declare const watchCustomProviders: (appKit: AppKit, parameters: WatchCustomProvidersParameters) => WatchCustomProvidersReturnType; | ||
| //# sourceMappingURL=watch-custom-providers.d.ts.map |
| {"version":3,"file":"watch-custom-providers.d.ts","sourceRoot":"","sources":["../../../../src/actions/providers/watch-custom-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,8BAA8B,GAAG,MAAM,IAAI,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC7B,QAAQ,MAAM,EACd,YAAY,8BAA8B,KAC3C,8BAMF,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. | ||
| * | ||
| */ | ||
| /** | ||
| * Watch for custom provider registrations | ||
| */ | ||
| export const watchCustomProviders = (appKit, parameters) => { | ||
| const { onChange } = parameters; | ||
| return appKit.emitter.on('provider:registered', (event) => { | ||
| if (event.payload.type === 'custom') | ||
| 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. | ||
| * | ||
| */ | ||
| export {}; | ||
| //# sourceMappingURL=create-transfer-ton-transaction.test.d.ts.map |
| {"version":3,"file":"create-transfer-ton-transaction.test.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/create-transfer-ton-transaction.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 } from 'vitest'; | ||
| import { beginCell, Cell } from '@ton/core'; | ||
| import { Network } from '../../types/network'; | ||
| import { asBase64 } from '../../utils'; | ||
| import { createTransferTonTransaction } from './create-transfer-ton-transaction'; | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const RECIPIENT = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const makeWallet = () => ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => Network.mainnet(), | ||
| }); | ||
| const makeAppKit = (wallet) => ({ walletsManager: { selectedWallet: wallet } }); | ||
| const readComment = (payload) => { | ||
| if (!payload) | ||
| throw new Error('expected payload'); | ||
| const slice = Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // text comment op = 0 | ||
| return slice.loadStringTail(); | ||
| }; | ||
| describe('createTransferTonTransaction', () => { | ||
| it('builds a single message with the amount converted to nanotons', () => { | ||
| const tx = createTransferTonTransaction(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1.5', | ||
| }); | ||
| expect(tx.messages).toHaveLength(1); | ||
| expect(tx.messages[0].address).toBe(RECIPIENT); | ||
| expect(tx.messages[0].amount).toBe('1500000000'); | ||
| expect(tx.fromAddress).toBe(SENDER); | ||
| }); | ||
| it('encodes a comment into the payload when no raw payload is given', () => { | ||
| const tx = createTransferTonTransaction(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| comment: 'gm', | ||
| }); | ||
| expect(readComment(tx.messages[0].payload)).toBe('gm'); | ||
| }); | ||
| it('prefers a raw payload over a comment', () => { | ||
| const rawPayload = asBase64(beginCell().storeUint(0x1234, 32).endCell().toBoc().toString('base64')); | ||
| const tx = createTransferTonTransaction(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| comment: 'ignored', | ||
| payload: rawPayload, | ||
| }); | ||
| expect(tx.messages[0].payload).toBe(rawPayload); | ||
| }); | ||
| it('forwards stateInit and extraCurrency onto the message', () => { | ||
| const stateInit = asBase64(beginCell().storeUint(1, 8).endCell().toBoc().toString('base64')); | ||
| const extraCurrency = { '100': '5' }; | ||
| const tx = createTransferTonTransaction(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| stateInit, | ||
| extraCurrency, | ||
| }); | ||
| expect(tx.messages[0].stateInit).toBe(stateInit); | ||
| expect(tx.messages[0].extraCurrency).toEqual(extraCurrency); | ||
| }); | ||
| it('throws when no wallet is connected', () => { | ||
| expect(() => createTransferTonTransaction(makeAppKit(null), { recipientAddress: RECIPIENT, amount: '1' })).toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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/crypto-onramp/decent'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/crypto-onramp/decent/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,qCAAqC,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/crypto-onramp/decent'; |
| /** | ||
| * 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 { CryptoOnrampProvider, CryptoOnrampManager, CryptoOnrampError, CryptoOnrampErrorCode, Caip2ByNetwork, } from '@ton/walletkit'; | ||
| export type { CryptoOnrampAPI, CryptoOnrampProviderInterface, CryptoOnrampProviderMetadata, CryptoOnrampProviderMetadataOverride, CryptoOnrampQuote, CryptoOnrampQuoteParams, CryptoOnrampDeposit, CryptoOnrampDepositParams, CryptoOnrampStatus, CryptoOnrampStatusParams, CryptoOnrampSourceCurrency, CryptoOnrampDestinationCurrency, CryptoOnrampSupportedCurrencies, } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto-onramp/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACH,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACR,eAAe,EACf,6BAA6B,EAC7B,4BAA4B,EAC5B,oCAAoC,EACpC,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,GAClC,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 { CryptoOnrampProvider, CryptoOnrampManager, CryptoOnrampError, CryptoOnrampErrorCode, Caip2ByNetwork, } 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/crypto-onramp/layerswap'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/crypto-onramp/layerswap/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,wCAAwC,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/crypto-onramp/layerswap'; |
| /** | ||
| * 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 { CustomProvidersManager } from '@ton/walletkit'; | ||
| export type { CustomProvider } from '@ton/walletkit'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,YAAY,EAAE,cAAc,EAAE,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 { CustomProvidersManager } 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 { MutationOptions } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { CreateCryptoOnrampDepositOptions, CreateCryptoOnrampDepositReturnType } from '../../actions/crypto-onramp/create-crypto-onramp-deposit'; | ||
| import type { MutationParameter } from '../../types/query'; | ||
| export type CreateCryptoOnrampDepositErrorType = Error; | ||
| export type CreateCryptoOnrampDepositData = Awaited<CreateCryptoOnrampDepositReturnType>; | ||
| export type CreateCryptoOnrampDepositVariables = CreateCryptoOnrampDepositOptions; | ||
| export type CreateCryptoOnrampDepositMutationOptions<context = unknown> = MutationParameter<CreateCryptoOnrampDepositData, CreateCryptoOnrampDepositErrorType, CreateCryptoOnrampDepositVariables, context>; | ||
| export type CreateCryptoOnrampDepositMutationConfig<context = unknown> = MutationOptions<CreateCryptoOnrampDepositData, CreateCryptoOnrampDepositErrorType, CreateCryptoOnrampDepositVariables, context>; | ||
| export declare const createCryptoOnrampDepositMutationOptions: <context = unknown>(appKit: AppKit) => CreateCryptoOnrampDepositMutationConfig<context>; | ||
| //# sourceMappingURL=create-crypto-onramp-deposit.d.ts.map |
| {"version":3,"file":"create-crypto-onramp-deposit.d.ts","sourceRoot":"","sources":["../../../../src/queries/crypto-onramp/create-crypto-onramp-deposit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EACR,gCAAgC,EAChC,mCAAmC,EACtC,MAAM,0DAA0D,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,MAAM,kCAAkC,GAAG,KAAK,CAAC;AACvD,MAAM,MAAM,6BAA6B,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AACzF,MAAM,MAAM,kCAAkC,GAAG,gCAAgC,CAAC;AAClF,MAAM,MAAM,wCAAwC,CAAC,OAAO,GAAG,OAAO,IAAI,iBAAiB,CACvF,6BAA6B,EAC7B,kCAAkC,EAClC,kCAAkC,EAClC,OAAO,CACV,CAAC;AAEF,MAAM,MAAM,uCAAuC,CAAC,OAAO,GAAG,OAAO,IAAI,eAAe,CACpF,6BAA6B,EAC7B,kCAAkC,EAClC,kCAAkC,EAClC,OAAO,CACV,CAAC;AAEF,eAAO,MAAM,wCAAwC,GAAI,OAAO,GAAG,OAAO,EACtE,QAAQ,MAAM,KACf,uCAAuC,CAAC,OAAO,CAEhD,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 { createCryptoOnrampDeposit } from '../../actions/crypto-onramp/create-crypto-onramp-deposit'; | ||
| export const createCryptoOnrampDepositMutationOptions = (appKit) => ({ | ||
| mutationFn: (variables) => createCryptoOnrampDeposit(appKit, variables), | ||
| }); |
| /** | ||
| * 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'; | ||
| import type { GetCryptoOnrampQuoteOptions, GetCryptoOnrampQuoteReturnType } from '../../actions/crypto-onramp/get-crypto-onramp-quote'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetCryptoOnrampQuoteErrorType = Error; | ||
| export type GetCryptoOnrampQuoteData = GetCryptoOnrampQuoteQueryFnData; | ||
| export type GetCryptoOnrampQuoteQueryConfig<selectData = GetCryptoOnrampQuoteData> = Compute<ExactPartial<GetCryptoOnrampQuoteOptions>> & QueryParameter<GetCryptoOnrampQuoteQueryFnData, GetCryptoOnrampQuoteErrorType, selectData, GetCryptoOnrampQuoteQueryKey>; | ||
| export declare const getCryptoOnrampQuoteQueryOptions: <selectData = GetCryptoOnrampQuoteData>(appKit: AppKit, options?: GetCryptoOnrampQuoteQueryConfig<selectData>) => GetCryptoOnrampQuoteQueryOptions<selectData>; | ||
| export type GetCryptoOnrampQuoteQueryFnData = Compute<Awaited<GetCryptoOnrampQuoteReturnType>>; | ||
| export declare const getCryptoOnrampQuoteQueryKey: (options?: Compute<ExactPartial<GetCryptoOnrampQuoteOptions>>) => GetCryptoOnrampQuoteQueryKey; | ||
| export type GetCryptoOnrampQuoteQueryKey = readonly [ | ||
| 'crypto-onramp-quote', | ||
| Compute<ExactPartial<GetCryptoOnrampQuoteOptions>> | ||
| ]; | ||
| export type GetCryptoOnrampQuoteQueryOptions<selectData = GetCryptoOnrampQuoteData> = QueryOptions<GetCryptoOnrampQuoteQueryFnData, GetCryptoOnrampQuoteErrorType, selectData, GetCryptoOnrampQuoteQueryKey>; | ||
| //# sourceMappingURL=get-crypto-onramp-quote.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-quote.d.ts","sourceRoot":"","sources":["../../../../src/queries/crypto-onramp/get-crypto-onramp-quote.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EACR,2BAA2B,EAC3B,8BAA8B,EACjC,MAAM,qDAAqD,CAAC;AAC7D,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,6BAA6B,GAAG,KAAK,CAAC;AAClD,MAAM,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AACvE,MAAM,MAAM,+BAA+B,CAAC,UAAU,GAAG,wBAAwB,IAAI,OAAO,CACxF,YAAY,CAAC,2BAA2B,CAAC,CAC5C,GACG,cAAc,CACV,+BAA+B,EAC/B,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,CAAC;AAEN,eAAO,MAAM,gCAAgC,GAAI,UAAU,GAAG,wBAAwB,EAClF,QAAQ,MAAM,EACd,UAAS,+BAA+B,CAAC,UAAU,CAAM,KAC1D,gCAAgC,CAAC,UAAU,CAS7C,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,OAAO,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC/F,eAAO,MAAM,4BAA4B,GACrC,UAAS,OAAO,CAAC,YAAY,CAAC,2BAA2B,CAAC,CAAM,KACjE,4BAA6F,CAAC;AACjG,MAAM,MAAM,4BAA4B,GAAG,SAAS;IAChD,qBAAqB;IACrB,OAAO,CAAC,YAAY,CAAC,2BAA2B,CAAC,CAAC;CACrD,CAAC;AACF,MAAM,MAAM,gCAAgC,CAAC,UAAU,GAAG,wBAAwB,IAAI,YAAY,CAC9F,+BAA+B,EAC/B,6BAA6B,EAC7B,UAAU,EACV,4BAA4B,CAC/B,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 { getCryptoOnrampQuote } from '../../actions/crypto-onramp/get-crypto-onramp-quote'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getCryptoOnrampQuoteQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| return getCryptoOnrampQuote(appKit, parameters); | ||
| }, | ||
| queryKey: getCryptoOnrampQuoteQueryKey(options), | ||
| }; | ||
| }; | ||
| export const getCryptoOnrampQuoteQueryKey = (options = {}) => ['crypto-onramp-quote', 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 { AppKit } from '../../core/app-kit'; | ||
| import type { GetCryptoOnrampStatusOptions, GetCryptoOnrampStatusReturnType } from '../../actions/crypto-onramp/get-crypto-onramp-status'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetCryptoOnrampStatusErrorType = Error; | ||
| export type GetCryptoOnrampStatusData = GetCryptoOnrampStatusQueryFnData; | ||
| export type GetCryptoOnrampStatusQueryConfig<selectData = GetCryptoOnrampStatusData> = Compute<ExactPartial<GetCryptoOnrampStatusOptions>> & QueryParameter<GetCryptoOnrampStatusQueryFnData, GetCryptoOnrampStatusErrorType, selectData, GetCryptoOnrampStatusQueryKey>; | ||
| export declare const getCryptoOnrampStatusQueryOptions: <selectData = GetCryptoOnrampStatusData>(appKit: AppKit, options?: GetCryptoOnrampStatusQueryConfig<selectData>) => GetCryptoOnrampStatusQueryOptions<selectData>; | ||
| export type GetCryptoOnrampStatusQueryFnData = Compute<Awaited<GetCryptoOnrampStatusReturnType>>; | ||
| export declare const getCryptoOnrampStatusQueryKey: (options?: Compute<ExactPartial<GetCryptoOnrampStatusOptions>>) => GetCryptoOnrampStatusQueryKey; | ||
| export type GetCryptoOnrampStatusQueryKey = readonly [ | ||
| 'crypto-onramp-status', | ||
| Compute<ExactPartial<GetCryptoOnrampStatusOptions>> | ||
| ]; | ||
| export type GetCryptoOnrampStatusQueryOptions<selectData = GetCryptoOnrampStatusData> = QueryOptions<GetCryptoOnrampStatusQueryFnData, GetCryptoOnrampStatusErrorType, selectData, GetCryptoOnrampStatusQueryKey>; | ||
| //# sourceMappingURL=get-crypto-onramp-status.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-status.d.ts","sourceRoot":"","sources":["../../../../src/queries/crypto-onramp/get-crypto-onramp-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EACR,4BAA4B,EAC5B,+BAA+B,EAClC,MAAM,sDAAsD,CAAC;AAC9D,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,8BAA8B,GAAG,KAAK,CAAC;AACnD,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,CAAC;AACzE,MAAM,MAAM,gCAAgC,CAAC,UAAU,GAAG,yBAAyB,IAAI,OAAO,CAC1F,YAAY,CAAC,4BAA4B,CAAC,CAC7C,GACG,cAAc,CACV,gCAAgC,EAChC,8BAA8B,EAC9B,UAAU,EACV,6BAA6B,CAChC,CAAC;AAEN,eAAO,MAAM,iCAAiC,GAAI,UAAU,GAAG,yBAAyB,EACpF,QAAQ,MAAM,EACd,UAAS,gCAAgC,CAAC,UAAU,CAAM,KAC3D,iCAAiC,CAAC,UAAU,CAU9C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,OAAO,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC;AACjG,eAAO,MAAM,6BAA6B,GACtC,UAAS,OAAO,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAM,KAClE,6BAA+F,CAAC;AACnG,MAAM,MAAM,6BAA6B,GAAG,SAAS;IACjD,sBAAsB;IACtB,OAAO,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;CACtD,CAAC;AACF,MAAM,MAAM,iCAAiC,CAAC,UAAU,GAAG,yBAAyB,IAAI,YAAY,CAChG,gCAAgC,EAChC,8BAA8B,EAC9B,UAAU,EACV,6BAA6B,CAChC,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 { getCryptoOnrampStatus } from '../../actions/crypto-onramp/get-crypto-onramp-status'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export const getCryptoOnrampStatusQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| return getCryptoOnrampStatus(appKit, parameters); | ||
| }, | ||
| queryKey: getCryptoOnrampStatusQueryKey(options), | ||
| enabled: options.depositId !== undefined, | ||
| }; | ||
| }; | ||
| export const getCryptoOnrampStatusQueryKey = (options = {}) => ['crypto-onramp-status', 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 { AppKit } from '../../core/app-kit'; | ||
| import type { GetCryptoOnrampSupportedCurrenciesOptions, GetCryptoOnrampSupportedCurrenciesReturnType } from '../../actions/crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| export type GetCryptoOnrampSupportedCurrenciesErrorType = Error; | ||
| export type GetCryptoOnrampSupportedCurrenciesData = GetCryptoOnrampSupportedCurrenciesQueryFnData; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryConfig<selectData = GetCryptoOnrampSupportedCurrenciesData> = Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>> & QueryParameter<GetCryptoOnrampSupportedCurrenciesQueryFnData, GetCryptoOnrampSupportedCurrenciesErrorType, selectData, GetCryptoOnrampSupportedCurrenciesQueryKey>; | ||
| export declare const getCryptoOnrampSupportedCurrenciesQueryOptions: <selectData = GetCryptoOnrampSupportedCurrenciesData>(appKit: AppKit, options?: GetCryptoOnrampSupportedCurrenciesQueryConfig<selectData>) => GetCryptoOnrampSupportedCurrenciesQueryOptions<selectData>; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryFnData = Compute<Awaited<GetCryptoOnrampSupportedCurrenciesReturnType>>; | ||
| export declare const getCryptoOnrampSupportedCurrenciesQueryKey: (options?: Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>>) => GetCryptoOnrampSupportedCurrenciesQueryKey; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryKey = readonly [ | ||
| 'crypto-onramp-supported-currencies', | ||
| Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>> | ||
| ]; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryOptions<selectData = GetCryptoOnrampSupportedCurrenciesData> = QueryOptions<GetCryptoOnrampSupportedCurrenciesQueryFnData, GetCryptoOnrampSupportedCurrenciesErrorType, selectData, GetCryptoOnrampSupportedCurrenciesQueryKey>; | ||
| //# sourceMappingURL=get-crypto-onramp-supported-currencies.d.ts.map |
| {"version":3,"file":"get-crypto-onramp-supported-currencies.d.ts","sourceRoot":"","sources":["../../../../src/queries/crypto-onramp/get-crypto-onramp-supported-currencies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EACR,yCAAyC,EACzC,4CAA4C,EAC/C,MAAM,oEAAoE,CAAC;AAC5E,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,2CAA2C,GAAG,KAAK,CAAC;AAChE,MAAM,MAAM,sCAAsC,GAAG,6CAA6C,CAAC;AACnG,MAAM,MAAM,6CAA6C,CAAC,UAAU,GAAG,sCAAsC,IACzG,OAAO,CAAC,YAAY,CAAC,yCAAyC,CAAC,CAAC,GAC5D,cAAc,CACV,6CAA6C,EAC7C,2CAA2C,EAC3C,UAAU,EACV,0CAA0C,CAC7C,CAAC;AAKV,eAAO,MAAM,8CAA8C,GAAI,UAAU,GAAG,sCAAsC,EAC9G,QAAQ,MAAM,EACd,UAAS,6CAA6C,CAAC,UAAU,CAAM,KACxE,8CAA8C,CAAC,UAAU,CAgB3D,CAAC;AAEF,MAAM,MAAM,6CAA6C,GAAG,OAAO,CAC/D,OAAO,CAAC,4CAA4C,CAAC,CACxD,CAAC;AACF,eAAO,MAAM,0CAA0C,GACnD,UAAS,OAAO,CAAC,YAAY,CAAC,yCAAyC,CAAC,CAAM,KAC/E,0CAC6E,CAAC;AACjF,MAAM,MAAM,0CAA0C,GAAG,SAAS;IAC9D,oCAAoC;IACpC,OAAO,CAAC,YAAY,CAAC,yCAAyC,CAAC,CAAC;CACnE,CAAC;AACF,MAAM,MAAM,8CAA8C,CAAC,UAAU,GAAG,sCAAsC,IAC1G,YAAY,CACR,6CAA6C,EAC7C,2CAA2C,EAC3C,UAAU,EACV,0CAA0C,CAC7C,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 { getCryptoOnrampSupportedCurrencies } from '../../actions/crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| const ONE_HOUR_MS = 60 * 60 * 1000; | ||
| const ONE_DAY_MS = 24 * ONE_HOUR_MS; | ||
| export const getCryptoOnrampSupportedCurrenciesQueryOptions = (appKit, options = {}) => { | ||
| return { | ||
| // The supported-currencies list for a provider rarely changes. Keep the fetched data | ||
| // in-cache long enough that the widget never refetches it within a normal session. | ||
| // Consumers can override via `options.query` if they need different behavior. | ||
| staleTime: ONE_HOUR_MS, | ||
| gcTime: ONE_DAY_MS, | ||
| refetchOnWindowFocus: false, | ||
| refetchOnReconnect: false, | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey; | ||
| return getCryptoOnrampSupportedCurrencies(appKit, parameters); | ||
| }, | ||
| queryKey: getCryptoOnrampSupportedCurrenciesQueryKey(options), | ||
| }; | ||
| }; | ||
| export const getCryptoOnrampSupportedCurrenciesQueryKey = (options = {}) => ['crypto-onramp-supported-currencies', filterQueryOptions(options)]; |
| { | ||
| "skill_name": "ton-appkit", | ||
| "evals": [ | ||
| { | ||
| "id": 1, | ||
| "name": "setup", | ||
| "prompt": "I'm starting a new React app with Vite. I want to integrate @ton/appkit so users can connect their TON wallet, see their balance, and send TON to another address. Show me the complete setup.", | ||
| "assertions": [ | ||
| {"text": "installs_required_packages", "description": "Mentions installing @ton/appkit, @ton/appkit-react, and @tanstack/react-query"}, | ||
| {"text": "imports_styles_css", "description": "Imports '@ton/appkit-react/styles.css' once near the app root"}, | ||
| {"text": "provider_order_correct", "description": "QueryClientProvider wraps AppKitProvider, not the other way around"}, | ||
| {"text": "appkit_singleton_outside_component", "description": "AppKit instance created at module level, not inside a component"}, | ||
| {"text": "uses_createTonConnectConnector", "description": "Sets up wallet connection via createTonConnectConnector with manifestUrl"}, | ||
| {"text": "useBalance_used", "description": "Uses useBalance hook for displaying balance"}, | ||
| {"text": "useTransferTon_used", "description": "Uses useTransferTon (directly or via <SendTonButton/>) for sending TON"}, | ||
| {"text": "amount_as_string", "description": "Passes amount as human-readable string (e.g., '0.5'), not bigint"}, | ||
| {"text": "vite_buffer_polyfill", "description": "Mentions polyfilling Node Buffer (and ideally process) for the browser — either vite-plugin-node-polyfills in vite.config.ts, or a manual import of buffer/process in main.tsx — because @ton/core needs Buffer at runtime"}, | ||
| {"text": "configures_both_networks_or_testnet_note", "description": "Either configures both mainnet and testnet in AppKit `networks`, or explicitly tells the user to add testnet if their wallet is on testnet (otherwise the tx gets silently rejected)"}, | ||
| {"text": "safe_test_recipient_pattern", "description": "Either uses `useAddress()` (or the connected wallet's address) as recipient for the first-touch send, or explicitly warns that the recipient must be a valid TON address (UQ.../EQ...) — not a made-up placeholder string"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 2, | ||
| "name": "streaming", | ||
| "prompt": "My app shows the balance using useBalance() but it doesn't update in real-time. How do I get WebSocket-based balance updates?", | ||
| "assertions": [ | ||
| {"text": "explains_streaming_optin", "description": "Explains streaming is opt-in, useBalance alone is one-shot"}, | ||
| {"text": "registers_streaming_provider", "description": "Shows registering a streaming provider (createTonCenterStreamingProvider or createTonApiStreamingProvider)"}, | ||
| {"text": "uses_useWatchBalance", "description": "Shows useWatchBalance must be mounted alongside useBalance"}, | ||
| {"text": "complete_setup_code", "description": "Provides complete working code from AppKit config to React component"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 3, | ||
| "name": "jetton-send", | ||
| "prompt": "How do I send 10 USDT (jetton) to another address in my app?", | ||
| "assertions": [ | ||
| {"text": "uses_useTransferJetton", "description": "Uses useTransferJetton hook"}, | ||
| {"text": "cache_invalidation", "description": "Mentions invalidateQueries for jetton cache after success"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 4, | ||
| "name": "disconnect-cleanup", | ||
| "prompt": "When a user disconnects their wallet and connects a different one, I see the old wallet's balance flash before the new one loads. How do I fix this?", | ||
| "assertions": [ | ||
| {"text": "uses_useDisconnect_onSuccess", "description": "Uses useDisconnect with onSuccess callback"}, | ||
| {"text": "explains_remove_vs_invalidate", "description": "Explains why removeQueries is correct (no wallet to refetch for)"}, | ||
| {"text": "covers_multiple_keys", "description": "Removes multiple keys: ['balance'], ['nfts'], ['jettons'], ['jetton-balance'], ['stakedBalance'] (jetton keys are kebab-case)"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 5, | ||
| "name": "swap-flow", | ||
| "prompt": "I want to add a token swap feature using AppKit. User selects two tokens, sees a quote, and confirms the swap. How?", | ||
| "assertions": [ | ||
| {"text": "uses_useSwapQuote", "description": "Uses useSwapQuote for getting quotes"}, | ||
| {"text": "uses_useBuildSwapTransaction", "description": "Uses useBuildSwapTransaction to build the tx"}, | ||
| {"text": "uses_useSendTransaction", "description": "Uses useSendTransaction to send the built tx"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 6, | ||
| "name": "ssr-nextjs", | ||
| "prompt": "I'm using Next.js 15 App Router. I keep getting hydration errors when I add AppKit. What do I do?", | ||
| "assertions": [ | ||
| {"text": "use_client_directive", "description": "Recommends adding 'use client' to the providers (wallet-using) file."}, | ||
| {"text": "mount_gate_or_dynamic_import", "description": "Recommends gating wallet-dependent UI on a useEffect-based mounted flag, or using next/dynamic(() => import(...), { ssr: false })."}, | ||
| {"text": "does_not_recommend_ssr_true", "description": "Does NOT recommend `ssr: true` on the AppKit constructor — there is no such field on `AppKitConfig`. The fix is purely a React/Next concern."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 7, | ||
| "name": "error-handling", | ||
| "prompt": "My users complain that sometimes the send button stays disabled forever after a failed transaction. The error doesn't show either. How should I handle transaction errors properly?", | ||
| "assertions": [ | ||
| {"text": "uses_error_isError", "description": "Uses error and isError from mutation result"}, | ||
| {"text": "user_rejection_detection", "description": "Distinguishes user rejection (reject/cancel/abort regex or similar) from other errors"}, | ||
| {"text": "uses_reset", "description": "Uses reset() function for retry flows"}, | ||
| {"text": "isPending_only_for_disable", "description": "isPending is used only for disabling during pending, not for error state"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 9, | ||
| "name": "orientation", | ||
| "prompt": "I just installed @ton/appkit and @ton/appkit-react in my project. Give me an overview of what these packages provide and how the parts fit together.", | ||
| "assertions": [ | ||
| {"text": "tanstack_query_peer_dep", "description": "Mentions @tanstack/react-query as required peer dependency"}, | ||
| {"text": "describes_dropin_vs_hooks", "description": "Distinguishes drop-in components (e.g., SwapWidget) from hooks (custom UX) as the two main paths"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 10, | ||
| "name": "wallet-picker", | ||
| "prompt": "My users have both Tonkeeper and MyTonWallet installed. How do I show a wallet picker so they can choose which one to connect?", | ||
| "assertions": [ | ||
| {"text": "uses_useConnectors", "description": "Uses useConnectors to list available connectors"}, | ||
| {"text": "uses_useConnect_with_id", "description": "Uses useConnect with connectorId parameter (not the connector object)"}, | ||
| {"text": "disabled_during_pending", "description": "Disables button with isPending during connection"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 11, | ||
| "name": "staking-flow", | ||
| "prompt": "I want to add a staking feature so users can stake TON and earn rewards. Show me how to fetch providers, get a quote, and execute the stake.", | ||
| "assertions": [ | ||
| {"text": "uses_useStakingProviders", "description": "Uses useStakingProviders to list options"}, | ||
| {"text": "uses_useStakingQuote", "description": "Uses useStakingQuote with amount and direction: 'stake'"}, | ||
| {"text": "uses_useBuildStakeTransaction", "description": "Uses useBuildStakeTransaction to build tx"}, | ||
| {"text": "mentions_unstake", "description": "Mentions direction: 'unstake' variant or unstaking flow"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 12, | ||
| "name": "watch-transactions", | ||
| "prompt": "I want to show a live feed of incoming transactions for the connected wallet — like a real-time transaction log. How?", | ||
| "assertions": [ | ||
| {"text": "uses_useWatchTransactions", "description": "Uses useWatchTransactions or useWatchTransactionsByAddress"}, | ||
| {"text": "streaming_provider_required", "description": "Mentions that a streaming provider must be registered"}, | ||
| {"text": "onchange_callback", "description": "Shows onChange callback to receive new transactions"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 13, | ||
| "name": "testnet-mainnet-switch", | ||
| "prompt": "My app needs to support both mainnet and testnet — users should be able to switch between them. How do I configure AppKit and handle the switch?", | ||
| "assertions": [ | ||
| {"text": "both_networks_in_config", "description": "Configures both mainnet and testnet in networks object"}, | ||
| {"text": "default_network_or_useDefaultNetwork", "description": "Sets defaultNetwork or uses useDefaultNetwork/useNetwork"}, | ||
| {"text": "chain_ids_correct", "description": "Mentions mainnet -239 and testnet -3 chain IDs"}, | ||
| {"text": "network_aware_hooks", "description": "Shows network parameter on hooks (e.g., useBalanceByAddress({ address, network }))"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 14, | ||
| "name": "consumer-vs-monorepo-routing", | ||
| "prompt": "I'm using @ton/appkit-react in my own Next.js app and want to fix stale NFT and balance data after switching wallets. Please don't talk about changing the AppKit repo internals; I just need app code.", | ||
| "assertions": [ | ||
| {"text": "consumer_app_focus", "description": "Keeps the answer focused on application integration code, not monorepo source changes"}, | ||
| {"text": "uses_removeQueries", "description": "Uses queryClient.removeQueries for wallet-scoped cache cleanup"}, | ||
| {"text": "covers_balance_and_nft_keys", "description": "Removes at least balance and NFT-related query keys"}, | ||
| {"text": "explains_no_wallet_refetch", "description": "Explains removeQueries is appropriate because there is no disconnected wallet to refetch for"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 15, | ||
| "name": "custom-vs-dropin-decision", | ||
| "prompt": "We need swaps in our Telegram Mini App. The default UI might be enough, but product may later want a custom quote screen. What should I use first, and what should I watch out for?", | ||
| "assertions": [ | ||
| {"text": "hook_path_for_custom_ux", "description": "Names useSwapQuote, useBuildSwapTransaction, and useSendTransaction as the custom UX path"}, | ||
| {"text": "loading_error_states", "description": "Calls out loading/error/pending state handling for the hook-based path"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 16, | ||
| "name": "ios-wallet-connect-click", | ||
| "prompt": "On iPhone, tapping my custom Connect Wallet button sometimes doesn't open Tonkeeper. I'm calling connect after an async analytics call. How should I wire this?", | ||
| "assertions": [ | ||
| {"text": "uses_useConnect", "description": "Uses useConnect or recommends TonConnectButton for simpler integration"}, | ||
| {"text": "pending_state", "description": "Disables the button only while the connection mutation is pending"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 17, | ||
| "name": "signing-flows", | ||
| "prompt": "I need users to prove they own their wallet by signing a plain message before they can join my app's leaderboard. How do I do this with AppKit?", | ||
| "assertions": [ | ||
| {"text": "uses_useSignText", "description": "Uses useSignText hook (not useSignCell or useSignBinary — plain message)"}, | ||
| {"text": "mutate_with_message", "description": "Calls mutate with the text/message to sign"}, | ||
| {"text": "handles_pending_error", "description": "Handles isPending and error states like other AppKit mutations"}, | ||
| {"text": "proof_or_signature_to_backend", "description": "Extracts signature/proof from the result for backend verification"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 18, | ||
| "name": "jetton-custom-decimals", | ||
| "prompt": "I need to send a jetton that has 18 decimals (not the standard 9). The user enters '1.5' tokens. Do I need to do anything special with the amount?", | ||
| "assertions": [ | ||
| {"text": "amount_stays_string", "description": "Passes '1.5' directly as a string, no manual decimal conversion"}, | ||
| {"text": "decimals_from_metadata", "description": "Explains AppKit reads decimals from jetton metadata (token info) automatically"}, | ||
| {"text": "no_manual_parseUnits", "description": "Explicitly says don't do parseUnits/toUnits/multiply-by-10^decimals yourself"}, | ||
| {"text": "uses_useTransferJetton", "description": "Uses useTransferJetton hook"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 19, | ||
| "name": "pending-tx-during-address-change", | ||
| "prompt": "A user starts a send TON transaction, then disconnects their wallet and connects a different one before the first tx confirms. My UI shows the first tx's spinner forever and then a confusing error from the new wallet. How do I handle this cleanly?", | ||
| "assertions": [ | ||
| {"text": "reset_or_cancel_on_disconnect", "description": "Calls mutation reset() or guards against state mismatch when wallet changes"}, | ||
| {"text": "watches_useAddress_for_change", "description": "Watches useAddress() to detect wallet/address change"}, | ||
| {"text": "removes_wallet_scoped_queries", "description": "Removes wallet-scoped TanStack caches (balance, nfts, etc.) on disconnect"}, | ||
| {"text": "key_by_address_or_remount", "description": "Suggests keying the wallet-scoped subtree by address (key={address}) or remounting"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 20, | ||
| "name": "manifest-troubleshoot", | ||
| "prompt": "When users tap Connect, Tonkeeper opens but shows 'Unknown app' instead of my app name and icon. What did I do wrong?", | ||
| "assertions": [ | ||
| {"text": "manifest_url_publicly_reachable", "description": "Says manifestUrl must be publicly reachable (not localhost in prod, no auth wall)"}, | ||
| {"text": "manifest_json_format", "description": "Shows the JSON shape: url, name, iconUrl (the required fields)"}, | ||
| {"text": "https_required", "description": "HTTPS required for the manifest URL"}, | ||
| {"text": "cors_or_content_type", "description": "Mentions correct content-type (application/json) or CORS so wallets can fetch it"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 21, | ||
| "name": "multi-step-orchestration", | ||
| "prompt": "I want a flow: when user clicks Send, send 1 TON, then once confirmed refresh the balance display and show a success toast. How do I wire this in AppKit?", | ||
| "assertions": [ | ||
| {"text": "uses_onSuccess_callback", "description": "Uses mutation onSuccess (or mutation: { onSuccess }) to chain after send"}, | ||
| {"text": "invalidates_balance_key", "description": "Calls queryClient.invalidateQueries({ queryKey: ['balance'] }) on success"}, | ||
| {"text": "tx_not_immediately_onchain", "description": "Explains tx isn't on-chain instantly — uses <TransactionProgress /> OR mentions wait/poll for confirmation"}, | ||
| {"text": "disables_during_isPending", "description": "Disables the send button while isPending"}, | ||
| {"text": "handles_error_branch", "description": "Covers onError or error state in the UI"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 22, | ||
| "name": "vite-buffer-polyfill", | ||
| "prompt": "I just integrated @ton/appkit into my Vite + React app following the docs. The page loads but shows a white screen, and the console says 'ReferenceError: Buffer is not defined'. What did I miss?", | ||
| "assertions": [ | ||
| {"text": "identifies_node_globals_in_browser", "description": "Explains the cause: @ton/core (transitive dep) uses Node's Buffer in the browser; Vite doesn't include Node polyfills by default"}, | ||
| {"text": "recommends_polyfill_solution", "description": "Recommends either vite-plugin-node-polyfills in vite.config.ts OR a manual `import 'buffer'; globalThis.Buffer = Buffer` at the top of main.tsx"}, | ||
| {"text": "mentions_process_too_or_full_polyfill", "description": "Mentions that `process` may also need polyfilling (covered by full nodePolyfills() or by adding `process` to the manual fallback)"}, | ||
| {"text": "polyfill_imported_first", "description": "If using the manual approach, says the polyfill import must come BEFORE any AppKit/TON code (first line of main.tsx)"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 23, | ||
| "name": "send-ton-recipient-test-pattern", | ||
| "prompt": "I integrated SendTonButton with a hardcoded recipient address. When I click Send, Tonkeeper opens but says 'Transaction canceled. There will be no changes to your account' before I even confirm. What's wrong with my setup?", | ||
| "assertions": [ | ||
| {"text": "identifies_invalid_address", "description": "Identifies that 'no changes to your account' indicates the simulator failed — most likely an invalid recipient TON address (bad checksum or made-up string)"}, | ||
| {"text": "explains_address_format", "description": "Mentions valid TON addresses are EQ.../UQ... base64 with checksums, not arbitrary strings"}, | ||
| {"text": "suggests_self_transfer_test", "description": "Suggests using `useAddress()` (the connected user's own address) as the recipient for a safe end-to-end test — sending to yourself avoids invalid-address bugs and risk"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 24, | ||
| "name": "nft-transfer", | ||
| "prompt": "How do I transfer one of the connected user's NFTs to another wallet address using AppKit? Show me the hook and a basic UI.", | ||
| "assertions": [ | ||
| {"text": "uses_useTransferNft", "description": "Uses the useTransferNft hook from @ton/appkit-react"}, | ||
| {"text": "passes_correct_nftAddress_param", "description": "Calls mutate with `nftAddress` (the actual API param — NOT `tokenAddress`, `nft`, `address`, or similar) AND `recipientAddress`. Hallucinating `tokenAddress` is the most common mistake and must FAIL this assertion."}, | ||
| {"text": "uses_useNfts_to_list", "description": "Uses useNfts() (or useNftsByAddress) to let the user pick which NFT to transfer"}, | ||
| {"text": "handles_pending_and_error", "description": "Disables submit during isPending and renders error state (same pattern as other mutations)"}, | ||
| {"text": "cache_invalidation_after_transfer", "description": "Invalidates the ['nfts'] (and optionally ['nft']) cache prefix after successful transfer so the list updates"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 25, | ||
| "name": "eq-vs-uq-address-format", | ||
| "prompt": "I have addresses in two formats: `EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c` and `UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ`. They look almost identical. When I send TON to a fresh user wallet using the EQ form, Tonkeeper sometimes warns about an uninitialized contract. Which form should I use for what, and are they interchangeable?", | ||
| "assertions": [ | ||
| {"text": "explains_bounceable_vs_non_bounceable", "description": "Explains EQ-prefix is the bounceable form, UQ-prefix is the non-bounceable form"}, | ||
| {"text": "same_underlying_account", "description": "Notes both forms refer to the same on-chain account/hash — only the bounce-flag and checksum differ"}, | ||
| {"text": "uq_for_user_wallets", "description": "Recommends UQ (non-bounceable) when sending to a user's wallet address — avoids the 'uninitialized contract' bounce-back when the wallet hasn't been deployed yet"}, | ||
| {"text": "eq_for_known_contracts", "description": "Recommends EQ (bounceable) for known-initialized smart contracts where you want refund-on-failure semantics"}, | ||
| {"text": "appkit_accepts_either", "description": "Notes that AppKit's transfer hooks accept either format — but the form you pick controls bounce behavior, so it still matters which one you save/display"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 26, | ||
| "name": "telegram-mini-app-return", | ||
| "prompt": "I'm building a Telegram Mini App with @ton/appkit-react. When the user taps Connect, Tonkeeper opens correctly, but after the user signs the connection in Tonkeeper they have to manually switch back to my Mini App in Telegram — it doesn't auto-return. Same problem after signing transactions. How do I fix this so the Mini App is brought back to focus automatically?", | ||
| "assertions": [ | ||
| {"text": "configures_returnStrategy", "description": "Sets `tonConnectOptions.actionsConfiguration.returnStrategy` (typically `'back'` or a `tg://...` URL) on createTonConnectConnector"}, | ||
| {"text": "mentions_twaReturnUrl_or_telegram_url", "description": "Mentions `twaReturnUrl` (preferred for Mini Apps) or a `https://t.me/<botname>/<appname>` deep link as the place to return to"}, | ||
| {"text": "config_at_appkit_setup", "description": "Configures the option on the connector at AppKit construction (not at every call site)"}, | ||
| {"text": "explains_why_it_works", "description": "Briefly explains that wallets read this config when handing control back, so without it they default to staying open"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 27, | ||
| "name": "no-wallets-installed-fallback", | ||
| "prompt": "What happens to my Connect button if a user opens my app with no TON wallet installed (no Tonkeeper, no MyTonWallet)? I want to show a fallback like 'Install Tonkeeper to continue' instead of an empty/broken state. How do I detect this and what's the right UX with AppKit?", | ||
| "assertions": [ | ||
| {"text": "checks_connectors_or_wallets_list", "description": "Checks the available connectors (or the TonConnect wallets list) for emptiness/availability"}, | ||
| {"text": "recommends_fallback_ui", "description": "Recommends rendering a fallback CTA when no wallets are detected — e.g., 'Install Tonkeeper'"}, | ||
| {"text": "deep_link_or_store_link", "description": "Mentions linking to wallet install (App Store / Google Play / browser extension / tonkeeper.com) as part of the fallback"}, | ||
| {"text": "mentions_TonConnect_handles_universal", "description": "Notes that TonConnect's universal/QR flow can also work for desktop users without a local wallet — useful nuance"} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 28, | ||
| "name": "balance-return-type-no-double-format", | ||
| "prompt": "I want to render the connected wallet's TON balance with two decimals — e.g. '1.50 TON'. Here's my code: ```const { data: balance } = useBalance(); return <p>{formatUnits(balance, 9)} TON</p>;``` Is this right? What is `balance` actually?", | ||
| "assertions": [ | ||
| {"text": "useBalance_is_string_not_bigint", "description": "States that `useBalance().data` is a STRING (not a `bigint`, not raw nano). MUST FAIL if the answer says bigint or nano."}, | ||
| {"text": "already_formatted_as_ton", "description": "Explains the string is already in human-readable TON units (e.g. \"0.500000000\"), having been pre-formatted by `formatUnits(_, 9)` inside `getBalanceByAddress`."}, | ||
| {"text": "warns_against_double_formatUnits", "description": "Explicitly warns that calling `formatUnits(balance, 9)` again re-slices the string on the decimal point and produces garbage like \"0..500000000\" (two dots)."}, | ||
| {"text": "correct_render_pattern", "description": "Shows a correct render: either bare `{balance}` or `parseFloat(balance).toFixed(2)` / `Intl.NumberFormat(...).format(Number(balance))` — NOT a second formatUnits call."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 29, | ||
| "name": "jettons-hook-return-shape", | ||
| "prompt": "I'm rendering a list of the user's jettons: `const { data: jettons } = useJettons(); return jettons?.map(j => <Row symbol={j.symbol} balance={j.balance} />);` But `jettons.map is not a function` at runtime, and the symbol shows undefined. What's wrong?", | ||
| "assertions": [ | ||
| {"text": "data_is_object_not_array", "description": "Says `useJettons().data` is `{ jettons, addressBook }`, NOT an array. You need `data?.jettons.map(...)`."}, | ||
| {"text": "symbol_nested_under_info", "description": "Says jetton fields like symbol/name live under `j.info.symbol`/`j.info.name`, not on `j` directly."}, | ||
| {"text": "balance_already_formatted", "description": "Notes `j.balance` is already a formatted decimal string in the jetton's own units (via internal `formatUnits` using `j.decimalsNumber`) — don't reformat."}, | ||
| {"text": "image_url_field_names", "description": "Mentions image URLs live under `j.info.image.smallUrl` / `j.info.image.url` (with the `Url` suffix), not `j.info.image.small`/`medium`."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 30, | ||
| "name": "nfts-hook-return-shape", | ||
| "prompt": "Same idea but for NFTs: `const { data: nfts } = useNfts(); nfts?.map(n => <Card nft={n} />);` — `nfts.map is not a function`. How do I read the list?", | ||
| "assertions": [ | ||
| {"text": "data_is_object_with_nfts", "description": "Says `useNfts().data` is `{ nfts, addressBook? }`, NOT an array. The list is at `data?.nfts`."}, | ||
| {"text": "uses_NftItem_or_destructures", "description": "Either uses `<NftItem nft={n} />` drop-in or shows correct destructuring; doesn't pass the whole `data` object as if it were an array."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 31, | ||
| "name": "tonconnect-connector-factory", | ||
| "prompt": "I'm setting up AppKit and I see two ways to wire TonConnect online: `new TonConnectConnector(...)` (constructor) and `createTonConnectConnector(...)` (factory). Which is the current/correct one?", | ||
| "assertions": [ | ||
| {"text": "uses_factory_function", "description": "Recommends `createTonConnectConnector(...)` — the factory."}, | ||
| {"text": "rejects_constructor", "description": "Notes that `TonConnectConnector` is type-only in the current API and the `new TonConnectConnector(...)` form is no longer valid. MUST FAIL if the answer recommends `new TonConnectConnector`."}, | ||
| {"text": "options_shape_correct", "description": "Shows the factory takes `{ tonConnectOptions: { manifestUrl, ... } }`."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 32, | ||
| "name": "swap-widget-silent-continue", | ||
| "prompt": "I'm using `<SwapWidget />` and when the user clicks Continue, nothing happens — no modal, no Tonkeeper prompt, no error in the UI. The button is enabled and labeled 'Continue'. What's going on and how do I see what failed?", | ||
| "assertions": [ | ||
| {"text": "build_or_send_error_swallowed", "description": "Explains that `useBuildSwapTransaction` / `useSendTransaction` errors inside `SwapWidget` are NOT surfaced into `ctx.error` (which is validation-only) and become unhandled promise rejections."}, | ||
| {"text": "check_devtools_console", "description": "Tells the user to look at DevTools Console for `Unhandled rejection: SwapError: ...` or similar — this is the first diagnostic step."}, | ||
| {"text": "wrap_in_try_catch_or_hooks", "description": "Recommends either wrapping `ctx.sendSwapTransaction()` in try/catch via the render-prop, or composing the flow directly from `useSwapQuote` + `useBuildSwapTransaction` + `useSendTransaction` to get proper `error` fields per step."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 33, | ||
| "name": "tonstakers-rate-limit-cascade", | ||
| "prompt": "I added `createTonstakersProvider()` to my AppKit config alongside a keyless TonCenter API (`apiClient: { url: 'https://toncenter.com' }` with no key). Now `useBalance`, `useJettons`, and `useNfts` are all painfully slow or returning HTTP 429 errors. The staking widget itself shows nothing. What's happening?", | ||
| "assertions": [ | ||
| {"text": "explains_staking_widget_polling", "description": "Explains the traffic source: while `<StakingWidget />` is mounted, its internal queries poll with `refetchInterval: 5000` (several queries, each refresh hitting TonCenter endpoints like getPoolBalance/getPoolData/APY). MUST FAIL if the answer claims the Tonstakers provider polls on its own internal timer merely by being registered — the provider has no timer, only a 30s-TTL cache around on-demand reads."}, | ||
| {"text": "burns_keyless_quota", "description": "Says this quickly exhausts the IP's keyless TonCenter quota and cascades HTTP 429s into unrelated reads (useBalance, useJettons, useNfts)."}, | ||
| {"text": "fix_with_api_key_or_remove_provider", "description": "Recommends either adding a real TonCenter API key OR not mounting `<StakingWidget />` (or removing `createTonstakersProvider()` from `providers`) when no key is available."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 34, | ||
| "name": "tonapi-streaming-requires-key", | ||
| "prompt": "I'm using `createTonApiStreamingProvider({ network: Network.mainnet() })` (no apiKey) and I'm seeing repeated WebSocket errors in the console — the WS to `wss://tonapi.io/streaming/v2/ws` keeps closing. Why?", | ||
| "assertions": [ | ||
| {"text": "tonapi_ws_requires_token", "description": "Explains the TonAPI streaming WebSocket endpoint requires authentication — keyless connections are rejected with HTTP 401 during the WebSocket upgrade."}, | ||
| {"text": "pass_apiKey", "description": "Says to pass `apiKey` to `createTonApiStreamingProvider({ network, apiKey })` — get a token from tonconsole.com."}, | ||
| {"text": "alternative_toncenter_streaming", "description": "Notes that `createTonCenterStreamingProvider` is the alternative (TonCenter streaming also rate-limits but doesn't hard-fail without a key)."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 35, | ||
| "name": "next-js-no-ssr-flag", | ||
| "prompt": "How do I configure AppKit for Next.js App Router so server-rendered pages don't crash on wallet hooks? Does `new AppKit({ ssr: true, ... })` work?", | ||
| "assertions": [ | ||
| {"text": "no_ssr_field_on_AppKitConfig", "description": "Explicitly says there is NO `ssr` property on `AppKitConfig` — passing it does nothing. MUST FAIL if the answer recommends adding `ssr: true` to the AppKit constructor."}, | ||
| {"text": "use_client_directive", "description": "Recommends adding `'use client'` to the providers file."}, | ||
| {"text": "mount_gate_or_dynamic_import", "description": "Recommends either gating wallet-dependent UI behind a `useEffect`-based mount flag or using `dynamic(() => import(...), { ssr: false })`."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 36, | ||
| "name": "omniston-build-error-handling", | ||
| "prompt": "My SwapWidget gets a valid quote, but when the user clicks Continue I see in the console: `Unhandled rejection: SwapError: Failed to build Omniston transaction: Internal server error: 5: [hash]`. The UI says nothing. What's happening, what should I do, and is this my code's bug?", | ||
| "assertions": [ | ||
| {"text": "identifies_upstream_omniston", "description": "Identifies that this is an upstream STON.fi / Omniston server error (gRPC status 5 = NOT_FOUND on the build step), not a bug in the user's code or AppKit."}, | ||
| {"text": "suggests_retry_or_different_route", "description": "Suggests retrying after a short wait, using a larger amount (close to a resolver's minimum quotes fail more often), or trying a different pair / a different swap provider."}, | ||
| {"text": "fallback_provider", "description": "Mentions registering `createDeDustProvider()` as a fallback (it builds via the DeDust Router API, independent of Omniston's RFQ/resolver system — though the router itself aggregates several protocols including STON.fi pools) and notes the user can switch providers from the SwapWidget settings gear."}, | ||
| {"text": "widget_swallows_error", "description": "Notes that `<SwapWidget />` itself swallows this error (doesn't propagate it into `ctx.error`) — this is a kit-side UX bug, not the user's fault, and the diagnostic path is DevTools Console for unhandled rejections."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 37, | ||
| "name": "send-jetton-button-shape", | ||
| "prompt": "I want to drop in `<SendJettonButton />` for sending 5 USDT to an address. What props does it need? Is `jetton` just the jetton address?", | ||
| "assertions": [ | ||
| {"text": "jetton_is_object_not_string", "description": "Says the `jetton` prop is an OBJECT, not a string. Required shape is `{ address, symbol, decimals }`. MUST FAIL if the answer passes a bare address string."}, | ||
| {"text": "amount_human_readable", "description": "Shows `amount` as a human-readable string (e.g. `'5'` for 5 USDT), and notes the button uses `jetton.decimals` to scale internally — don't pass raw units."}, | ||
| {"text": "recipient_address_prop", "description": "Includes the `recipientAddress` string prop."} | ||
| ] | ||
| }, | ||
| { | ||
| "id": 38, | ||
| "name": "html-balance-render", | ||
| "prompt": "Write a React component file BalanceDisplay.tsx (named export `BalanceDisplay`) that renders the connected wallet TON balance with 2 decimal places, e.g. '0.50 TON'. Use useBalance() from @ton/appkit-react. Component takes no props.", | ||
| "assertions": [ | ||
| {"text": "compiles_cleanly", "description": "tsc + vite build succeeds on the file"}, | ||
| {"text": "no_runtime_errors", "description": "page loads without console/runtime errors (favicon 404 ignored)"}, | ||
| {"text": "renders_balance_with_decimal", "description": "rendered DOM contains a number with at most 4 decimal places"}, | ||
| {"text": "no_double_dot_in_rendered_dom", "description": "CRITICAL: rendered text does NOT contain '..' sequence (double-formatUnits bug — would render '0..500000000')"}, | ||
| {"text": "no_NaN", "description": "rendered text does NOT contain NaN (signs of wrong type assumptions)"}, | ||
| {"text": "no_full_precision_leak", "description": "rendered text does NOT contain raw 9-decimal value '0.500000000' (formatter was bypassed entirely)"}, | ||
| {"text": "reasonable_magnitude", "description": "rendered text contains '0.5' — balance not over-divided. If executor assumes balance is nano-bigint and writes Number(balance)/1e9, the result becomes 5e-10 and toFixed(2) renders '0.00' — this assertion catches it."} | ||
| ] | ||
| } | ||
| ] | ||
| } |
| # Extended AppKit Recipes | ||
| Code recipes for DeFi flows (swap, staking), jetton/NFT transfers, live transactions, and multi-network apps. Read this when a basic hook reference isn't enough. | ||
| **Before building from hooks, try the drop-in component first** (see SKILL.md "Drop-in Components"). E.g., for swap: `<SwapWidget tokens={...} />`. The hook-based recipes below are for cases where you need a fully custom UX. | ||
| When adapting these recipes, preserve AppKit's consumer-facing invariants: transfer amounts are human-readable strings, wallet-scoped caches need explicit cleanup, streaming recipes need a registered streaming provider, and multi-network reads should pass `network` explicitly. | ||
| ## Swap Flow | ||
| ### Drop-in (recommended) | ||
| ```tsx | ||
| import { SwapWidget, Network } from '@ton/appkit-react'; | ||
| import type { AppkitUIToken } from '@ton/appkit-react'; | ||
| const tokens: AppkitUIToken[] = [ | ||
| { address: 'ton', symbol: 'TON', name: 'Toncoin', decimals: 9, network: Network.mainnet() }, | ||
| { address: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs', symbol: 'USDT', name: 'Tether USD', decimals: 6, network: Network.mainnet() }, | ||
| ]; | ||
| function SwapPage() { | ||
| return <SwapWidget tokens={tokens} />; | ||
| } | ||
| ``` | ||
| For custom UI within the widget's state: pass render-prop children. Register DEX providers in AppKit config — imported from sub-path entries, NOT from the main `@ton/appkit` package: | ||
| ```ts | ||
| import { createDeDustProvider } from '@ton/appkit/swap/dedust'; | ||
| import { createOmnistonProvider } from '@ton/appkit/swap/omniston'; | ||
| const providers = [createDeDustProvider(), createOmnistonProvider()]; | ||
| ``` | ||
| ### From hooks (custom UX) | ||
| ```tsx | ||
| import { useState } from 'react'; | ||
| import { useSwapQuote, useBuildSwapTransaction, useSendTransaction, useAddress } from '@ton/appkit-react'; | ||
| import type { SwapToken } from '@ton/appkit-react'; | ||
| function SwapForm({ fromToken, toToken }: { fromToken: SwapToken; toToken: SwapToken }) { | ||
| const userAddress = useAddress(); | ||
| const [amount, setAmount] = useState('1'); | ||
| // 1. Get a quote | ||
| const { data: quote, isLoading: quoteLoading } = useSwapQuote({ | ||
| from: fromToken, | ||
| to: toToken, | ||
| amount, | ||
| slippageBps: 100, // 1% | ||
| }); | ||
| // 2. Build and send transaction | ||
| const { mutateAsync: buildSwap } = useBuildSwapTransaction(); | ||
| const { mutate: sendTx, isPending: sending } = useSendTransaction(); | ||
| const handleSwap = async () => { | ||
| if (!quote || !userAddress) return; | ||
| const tx = await buildSwap({ quote, userAddress }); | ||
| sendTx(tx); | ||
| }; | ||
| return ( | ||
| <> | ||
| <input value={amount} onChange={(e) => setAmount(e.target.value)} /> | ||
| {quoteLoading && <p>Getting quote...</p>} | ||
| {quote && ( | ||
| <p>You'll receive: {quote.toAmount} {toToken.symbol} (price impact: {quote.priceImpact}%)</p> | ||
| )} | ||
| <button disabled={!quote || sending} onClick={handleSwap}>Swap</button> | ||
| </> | ||
| ); | ||
| } | ||
| ``` | ||
| ## Staking Flow | ||
| ```tsx | ||
| import { useState } from 'react'; | ||
| import { | ||
| useStakingProviders, | ||
| useStakingQuote, | ||
| useBuildStakeTransaction, | ||
| useStakedBalance, | ||
| useSendTransaction, | ||
| } from '@ton/appkit-react'; | ||
| function StakeForm({ userAddress }: { userAddress: string }) { | ||
| const providers = useStakingProviders(); | ||
| const [providerId, setProviderId] = useState<string | undefined>(providers[0]?.providerId); | ||
| const [amount, setAmount] = useState('10'); | ||
| const { data: quote } = useStakingQuote({ | ||
| amount, | ||
| direction: 'stake', | ||
| providerId, | ||
| }); | ||
| const { data: stakedBalance } = useStakedBalance({ userAddress, providerId }); | ||
| const { mutateAsync: buildStake } = useBuildStakeTransaction(); | ||
| const { mutate: sendTx } = useSendTransaction(); | ||
| return ( | ||
| <> | ||
| <select value={providerId ?? ''} onChange={(e) => setProviderId(e.target.value)}> | ||
| {providers.map((p) => ( | ||
| <option key={p.providerId} value={p.providerId}>{p.providerId}</option> | ||
| ))} | ||
| </select> | ||
| <input value={amount} onChange={(e) => setAmount(e.target.value)} /> | ||
| {quote && <p>You'll stake {quote.amountIn} → receive {quote.amountOut}</p>} | ||
| <p>Currently staked: {stakedBalance?.stakedBalance}</p> | ||
| <button onClick={async () => { | ||
| if (!quote) return; | ||
| const tx = await buildStake({ quote, userAddress }); | ||
| sendTx(tx); | ||
| }}>Stake</button> | ||
| </> | ||
| ); | ||
| } | ||
| ``` | ||
| For unstake, pass `direction: 'unstake'` to `useStakingQuote`. The returned quote may include an `unstakeMode` that differs by protocol — read it from the quote and forward via `providerOptions` if your protocol needs it. | ||
| ## Jetton Transfer | ||
| ```tsx | ||
| import { useState } from 'react'; | ||
| import { useJettons, useTransferJetton } from '@ton/appkit-react'; | ||
| import { useQueryClient } from '@tanstack/react-query'; | ||
| function SendJetton() { | ||
| const { data } = useJettons(); // { jettons: Jetton[], addressBook } | ||
| const jettons = data?.jettons ?? []; | ||
| const [selectedJetton, setSelectedJetton] = useState<string>(); | ||
| const [amount, setAmount] = useState(''); | ||
| const [recipient, setRecipient] = useState(''); | ||
| const { mutate: transfer, isPending, error } = useTransferJetton(); | ||
| const queryClient = useQueryClient(); | ||
| const handleSend = () => { | ||
| if (!selectedJetton) return; | ||
| transfer( | ||
| { jettonAddress: selectedJetton, recipientAddress: recipient, amount }, | ||
| { | ||
| onSuccess: () => { | ||
| // Refresh jetton balances | ||
| queryClient.invalidateQueries({ queryKey: ['jettons'] }); | ||
| queryClient.invalidateQueries({ queryKey: ['jetton-balance'] }); | ||
| }, | ||
| }, | ||
| ); | ||
| }; | ||
| return ( | ||
| <> | ||
| <select onChange={(e) => setSelectedJetton(e.target.value)}> | ||
| {jettons.map((j) => ( | ||
| <option key={j.address} value={j.address}> | ||
| {j.info.symbol} ({j.balance /* already formatted */}) | ||
| </option> | ||
| ))} | ||
| </select> | ||
| <input placeholder="Recipient" value={recipient} onChange={(e) => setRecipient(e.target.value)} /> | ||
| <input placeholder="Amount" value={amount} onChange={(e) => setAmount(e.target.value)} /> | ||
| <button disabled={isPending} onClick={handleSend}> | ||
| {isPending ? 'Sending...' : 'Send Jetton'} | ||
| </button> | ||
| {error && <p>Error: {error.message}</p>} | ||
| </> | ||
| ); | ||
| } | ||
| ``` | ||
| Notes: | ||
| - `amount` is a human-readable string with respect to jetton decimals. AppKit handles `parseUnits` internally. | ||
| - Jetton transfers are contract message flows — gas matters. AppKit's helper sets correct `forward_amount` and `response_destination`. | ||
| ## NFT Transfer | ||
| ```tsx | ||
| import { useState } from 'react'; | ||
| import { useNfts, useTransferNft } from '@ton/appkit-react'; | ||
| function SendNft() { | ||
| const { data } = useNfts(); // { nfts: NFT[], addressBook? } | ||
| const nfts = data?.nfts ?? []; | ||
| const [selected, setSelected] = useState<string>(); | ||
| const [recipient, setRecipient] = useState(''); | ||
| const { mutate: transfer, isPending } = useTransferNft(); | ||
| return ( | ||
| <> | ||
| <div> | ||
| {nfts.map((nft) => ( | ||
| <button key={nft.address} onClick={() => setSelected(nft.address)}> | ||
| {nft.info?.name ?? nft.address} | ||
| </button> | ||
| ))} | ||
| </div> | ||
| <input value={recipient} onChange={(e) => setRecipient(e.target.value)} /> | ||
| <button | ||
| disabled={!selected || isPending} | ||
| // ⚠ The param is `nftAddress` (the NFT item's contract address) — NOT `tokenAddress`. | ||
| onClick={() => transfer({ nftAddress: selected!, recipientAddress: recipient })} | ||
| > | ||
| Send NFT | ||
| </button> | ||
| </> | ||
| ); | ||
| } | ||
| ``` | ||
| ## Watching Transactions | ||
| ```tsx | ||
| import { useState } from 'react'; | ||
| import { useWatchTransactions } from '@ton/appkit-react'; | ||
| import type { TransactionsUpdate } from '@ton/appkit-react'; | ||
| function TransactionFeed() { | ||
| const [updates, setUpdates] = useState<TransactionsUpdate[]>([]); | ||
| useWatchTransactions({ | ||
| // onChange fires with a TransactionsUpdate that wraps one or more on-chain transactions. | ||
| onChange: (update) => setUpdates((prev) => [update, ...prev]), | ||
| }); | ||
| return ( | ||
| <ul> | ||
| {updates.flatMap((u) => u.transactions).map((tx) => ( | ||
| <li key={tx.hash}>{tx.hash}: {tx.endStatus ?? '—'}</li> | ||
| ))} | ||
| </ul> | ||
| ); | ||
| } | ||
| ``` | ||
| Requires a streaming provider registered (see SKILL.md "Real-time balance updates"). | ||
| ## Multi-Network App | ||
| ```ts | ||
| import { AppKit, Network, createTonCenterStreamingProvider, createTonConnectConnector } from '@ton/appkit'; | ||
| const appKit = new AppKit({ | ||
| defaultNetwork: Network.mainnet(), | ||
| networks: { | ||
| [Network.mainnet().chainId]: { | ||
| apiClient: { url: 'https://toncenter.com', key: 'MAINNET_KEY' }, | ||
| }, | ||
| [Network.testnet().chainId]: { | ||
| apiClient: { url: 'https://testnet.toncenter.com', key: 'TESTNET_KEY' }, | ||
| }, | ||
| }, | ||
| providers: [ | ||
| createTonCenterStreamingProvider({ network: Network.mainnet(), apiKey: 'MAINNET_KEY' }), | ||
| createTonCenterStreamingProvider({ network: Network.testnet(), apiKey: 'TESTNET_KEY' }), | ||
| ], | ||
| connectors: [createTonConnectConnector({ tonConnectOptions: { manifestUrl: '/manifest.json' } })], | ||
| }); | ||
| ``` | ||
| Hooks accept a `network` parameter to override: | ||
| ```tsx | ||
| import { useBalanceByAddress } from '@ton/appkit-react'; | ||
| import { Network } from '@ton/appkit'; | ||
| function TestnetBalance({ address }: { address: string }) { | ||
| const { data: balance } = useBalanceByAddress({ address, network: Network.testnet() }); | ||
| return <span>{balance ?? '—'}</span>; | ||
| } | ||
| ``` | ||
| ## Custom Mutation Cleanup | ||
| If you have your own mutations that change wallet state, use the same cache patterns: | ||
| ```tsx | ||
| import { useMutation, useQueryClient } from '@tanstack/react-query'; | ||
| function useMyCustomTransfer() { | ||
| const queryClient = useQueryClient(); | ||
| return useMutation({ | ||
| mutationFn: async (params: { recipientAddress: string; amount: string }) => { | ||
| // ... your custom transfer implementation | ||
| return params; | ||
| }, | ||
| onSuccess: () => { | ||
| // Invalidate everything that might be affected | ||
| queryClient.invalidateQueries({ queryKey: ['balance'] }); | ||
| queryClient.invalidateQueries({ queryKey: ['jettons'] }); | ||
| queryClient.invalidateQueries({ queryKey: ['transactionStatus'] }); | ||
| }, | ||
| }); | ||
| } | ||
| ``` |
| --- | ||
| name: ton-appkit | ||
| description: Use this skill whenever the user is building an app with @ton/appkit or @ton/appkit-react as a library consumer: setup, TonConnect wallet connection, balances, sending TON/jettons/NFTs, swaps, staking, signing, real-time WebSocket updates, cache invalidation, mainnet/testnet switching, SSR/Next.js hydration, Telegram Mini App returns, iOS deep links, or debugging stale wallet/network/transaction behavior. Do not use for contributing code to the @ton/kit monorepo itself; use kit-dev for repo-internal development tasks. | ||
| --- | ||
| # AppKit Guide | ||
| Guide developers consuming `@ton/appkit` + `@ton/appkit-react` in their TON apps. Assume React, TypeScript, and TanStack Query basics, but explain TON/AppKit-specific decisions clearly. | ||
| For contributing to the @ton/kit monorepo, use `kit-dev` instead. This skill is for library-consumer answers: code the user's app would write, not package internals. | ||
| ## Response workflow | ||
| 1. **Classify the task first.** If the user wants a complete feature quickly, prefer drop-in components. If they describe custom UX, use hooks. If they report stale data, real-time, network, or SSR symptoms, start with the relevant gotcha before writing code. | ||
| 2. **Give runnable integration shape.** Include provider setup when the bug could come from missing `QueryClientProvider`, `AppKitProvider`, connector config, CSS import, or streaming providers. Avoid isolated hook snippets that omit required context. | ||
| 3. **Use AppKit semantics exactly.** Balances are already-formatted decimal strings (TON or jetton units — never raw nano), transfer amounts are human-readable strings, mutations do not automatically invalidate caches, streaming is opt-in, and wallet state is client-only for SSR. | ||
| 4. **Name the tradeoff.** Drop-in components are fastest and safest; hooks are for custom UX and require explicit loading/error/cache handling. | ||
| ## What do you want to do? | ||
| | Task | Path | | ||
| |---|---| | ||
| | Set up a new app | `pnpm create ton-appkit` (scaffolds React+Vite project) or Quick Setup below | | ||
| | Wallet connect/disconnect | `<TonConnectButton />` or `useConnect`/`useDisconnect` | | ||
| | Show TON balance | `useBalance()` + optionally `useWatchBalance()` for live updates | | ||
| | Send TON | `<SendTonButton />` or `useTransferTon()` | | ||
| | Send jettons (USDT, etc.) | `<SendJettonButton />` or `useTransferJetton()` | | ||
| | Show NFTs | `useNfts()` + `<NftItem />` | | ||
| | Swap tokens | `<SwapWidget />` or `useSwapQuote` + `useBuildSwapTransaction` + `useSendTransaction` | | ||
| | Stake TON | `<StakingWidget />` or staking hooks | | ||
| | Sign message | `useSignText` / `useSignBinary` / `useSignCell` | | ||
| | Mainnet/testnet support | Configure both networks + `useDefaultNetwork()` + explicit `network` params | | ||
| | Real-time updates | Register streaming provider + mount `useWatchBalance` / `useWatchTransactions` | | ||
| | Fix Next.js hydration | `'use client'` providers + mount gate or dynamic import | | ||
| | Refresh balance after send | `queryClient.invalidateQueries({ queryKey: ['balance'] })` | | ||
| | Clear stale data on disconnect | `queryClient.removeQueries` for wallet-scoped keys | | ||
| Drop-in components (`<TonConnectButton />`, `<SendTonButton />`, `<SwapWidget />`, etc.) are the fastest path. Use hooks only for custom UX. | ||
| For extended swap/staking/jetton recipes, see [skill-reference/recipes.md](skill-reference/recipes.md). | ||
| ## Packages | ||
| - **`@ton/appkit`** — core SDK: `AppKit` class, actions, connectors (TonConnect), DeFi managers. | ||
| - **`@ton/appkit-react`** — React hooks, `AppKitProvider`, UI components. | ||
| - **`@tanstack/react-query`** — required peer dependency. | ||
| ## Quick Setup | ||
| ```tsx | ||
| import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
| import { AppKit, Network, createTonConnectConnector } from '@ton/appkit'; | ||
| import { AppKitProvider } from '@ton/appkit-react'; | ||
| import '@ton/appkit-react/styles.css'; | ||
| const queryClient = new QueryClient({ | ||
| defaultOptions: { queries: { refetchOnWindowFocus: false } }, | ||
| }); | ||
| const appKit = new AppKit({ | ||
| networks: { | ||
| [Network.mainnet().chainId]: { | ||
| apiClient: { url: 'https://toncenter.com', key: 'YOUR_API_KEY' }, | ||
| }, | ||
| // Keep testnet too so users on testnet wallets aren't silently rejected. | ||
| // Drop it once you're production-only. | ||
| [Network.testnet().chainId]: { | ||
| apiClient: { url: 'https://testnet.toncenter.com', key: 'YOUR_API_KEY' }, | ||
| }, | ||
| }, | ||
| connectors: [ | ||
| createTonConnectConnector({ | ||
| tonConnectOptions: { manifestUrl: 'https://your-app.com/tonconnect-manifest.json' }, | ||
| }), | ||
| ], | ||
| }); | ||
| // QueryClientProvider MUST wrap AppKitProvider | ||
| function App() { | ||
| return ( | ||
| <QueryClientProvider client={queryClient}> | ||
| <AppKitProvider appKit={appKit}>{/* your app */}</AppKitProvider> | ||
| </QueryClientProvider> | ||
| ); | ||
| } | ||
| ``` | ||
| For Next.js: add `'use client'` to the providers file and gate wallet-dependent UI until mount, or use `dynamic(() => import(...), { ssr: false })`. **There is no `ssr` flag on `AppKitConfig`** — the SSR boundary is purely a React/Next concern, not an AppKit option. Wallet state (`useAddress`, balances, etc.) is client-only by construction; render a stable placeholder on the server and swap in wallet-dependent UI after `useEffect`/mount. | ||
| ### Browser polyfills (Vite / Webpack / Rspack) | ||
| `@ton/core` (transitive dep) uses Node's `Buffer` and `process`. Browser bundlers don't include these by default — without polyfills you get a **white screen and `ReferenceError: Buffer is not defined`** at runtime. | ||
| For Vite, install `vite-plugin-node-polyfills` and add it to `vite.config.ts`: | ||
| ```ts | ||
| import { defineConfig } from 'vite'; | ||
| import react from '@vitejs/plugin-react'; | ||
| import { nodePolyfills } from 'vite-plugin-node-polyfills'; | ||
| export default defineConfig({ plugins: [react(), nodePolyfills()] }); | ||
| ``` | ||
| If the plugin clashes with your project (e.g. nested workspace, alias resolution warnings), use a manual polyfill instead — `pnpm add buffer process`, then create `src/polyfills.ts`: | ||
| ```ts | ||
| import { Buffer } from 'buffer'; | ||
| import process from 'process'; | ||
| (globalThis as { Buffer?: typeof Buffer }).Buffer = Buffer; | ||
| (globalThis as { process?: typeof process }).process = process; | ||
| ``` | ||
| Import `./polyfills` as the **first line of `main.tsx`** (before any AppKit code). | ||
| Next.js: no polyfill needed — Next's Webpack config handles Node globals automatically. | ||
| ### First-touch send: self-transfer | ||
| For a safe end-to-end test of the send flow, use `useAddress()` as the recipient — the user sends 0.01 TON to themselves. Validates wallet, network, signing, and on-chain confirmation without risk: | ||
| ```tsx | ||
| const address = useAddress(); | ||
| {address && <SendTonButton recipientAddress={address} amount="0.01" />} | ||
| ``` | ||
| For real recipients, paste a TON address from Tonkeeper (UQ… non-bounceable for wallets, EQ… bounceable for contracts). Random/made-up strings without valid checksums make Tonkeeper's simulator say "no changes to your account" and refuse to sign. | ||
| ## Hooks Reference | ||
| Hooks come from `@ton/appkit-react`. Queries return TanStack `{ data, isLoading, isError, error }`. Mutations return `{ mutate, mutateAsync, isPending, error, data, reset }`. | ||
| ### Wallet | ||
| `useConnectors()` · `useConnect()` · `useDisconnect()` · `useSelectedWallet()` · `useAddress()` · `useConnectedWallets()` | ||
| `useConnect()` returns a mutation; call it with `mutate({ connectorId })`, passing the connector's `id` from `useConnectors()` (not the connector object itself). On iOS, the deep link that opens the wallet only fires if `connect()` runs in the **same synchronous tick as the user's click** — any `await` before it kills the user-activation token and the wallet won't open. | ||
| ```tsx | ||
| const connectors = useConnectors(); | ||
| const { mutate: connect, isPending } = useConnect(); | ||
| // ✅ Good: synchronous in click handler | ||
| <button onClick={() => connect({ connectorId: connector.id })}>Connect</button> | ||
| // ❌ Bad on iOS: awaiting before connect() loses the user gesture | ||
| <button onClick={async () => { | ||
| await analytics.track('connect_clicked'); // <-- breaks deep link on iOS | ||
| connect({ connectorId: connector.id }); | ||
| }}>Connect</button> | ||
| ``` | ||
| If you need side effects, fire-and-forget them (no `await`) or run them in `mutation: { onSuccess }`. | ||
| ### Balance & assets | ||
| - `useBalance()` / `useBalanceByAddress({ address, network? })` — returns a **decimal TON string already formatted with 9 decimals** (e.g. `"0.500000000"` for a wallet holding 0.5 TON). It is NOT raw nano and NOT a `bigint`. Render directly or format with `Intl.NumberFormat`; do **not** pass it through `formatUnits(_, 9)` again — that re-slices on the decimal point and yields garbage like `"0..500000000"`. Pass `network` explicitly for cross-network reads: `useBalanceByAddress({ address, network: Network.testnet() })`. | ||
| - `useWatchBalance()` / `useWatchBalanceByAddress(...)` — real-time updates (requires streaming provider) | ||
| - `useJettons()` — returns `{ jettons: Jetton[], addressBook }`. Use `data?.jettons`, not `data` directly. Each `Jetton.balance` is already formatted via the jetton's own `decimalsNumber` (e.g. `"1.5"` for 1.5 USDT) — same rule: don't re-format with `formatUnits`. Image URLs live under `info.image.smallUrl` / `info.image.url` (note the `Url` suffix). | ||
| - `useJettonBalanceByAddress({ jettonAddress, ownerAddress, jettonDecimals?, network? })` — note the param is `ownerAddress`, not `address`. Returns a **pre-formatted** decimal string in the jetton's own units (e.g. `"1.5"` for 1.5 USDT). If `jettonDecimals` isn't passed, AppKit looks it up from jetton metadata (one extra read). Same rule as `useBalance`: don't pass the result through `formatUnits` again. | ||
| - `useJettonInfo({ address, network? })` — `address` is the **jetton master** contract address. Returns `{ name, symbol, decimals?, image, … } | null`. | ||
| - `useJettonWalletAddress({ jettonAddress, ownerAddress, network? })` — resolves the owner's individual jetton-wallet contract address for a given jetton. | ||
| - `useWatchJettons()` / `useWatchJettonsByAddress(...)` — real-time jetton list updates (requires streaming provider). | ||
| - `useWatchBalanceByAddress({ address, network? })` — real-time balance for an arbitrary address. | ||
| - `useNfts()` — returns `{ nfts: NFT[], addressBook? }`. Use `data?.nfts`, not `data` directly. | ||
| - `useNft({ address })` (`address` is the NFT item's own contract address — NOT `tokenAddress`) | ||
| ### Sending | ||
| `useTransferTon()` · `useTransferJetton()` · `useTransferNft()` · `useSendTransaction()` | ||
| Call with `mutate({ recipientAddress, amount: '0.5', comment? })`. Amount is a **human-readable string** — AppKit converts using token decimals. The mutation's `data` resolves to `SendTransactionResponse = { boc, normalizedBoc, normalizedHash }` (object, not a bare string). | ||
| Param names differ per asset — easy to get wrong from intuition: | ||
| - **TON**: `mutate({ recipientAddress, amount, comment? })` | ||
| - **Jetton**: `mutate({ jettonAddress, recipientAddress, amount, comment? })` — `jettonAddress` is the jetton master contract. | ||
| - **NFT**: `mutate({ nftAddress, recipientAddress, amount?, comment? })` — **`nftAddress`** (NOT `tokenAddress`!) is the individual NFT item's contract address (`nft.address` from `useNfts()`). Optional `amount` is the forward TON (gas/notification), defaults are sensible. There is no `<SendNftButton />` drop-in — compose from the hook. | ||
| ### Signing | ||
| `useSignText()` · `useSignBinary()` · `useSignCell()` | ||
| ### Network | ||
| `useNetwork()` (selected wallet's network, `undefined` if not connected) · `useDefaultNetwork()` returns `[defaultNetwork, setDefaultNetwork]` · `useNetworks()` · `useBlockNumber()` | ||
| For mainnet/testnet apps, configure both networks and make reads explicit when the UI lets users choose a network: | ||
| ```tsx | ||
| const [network, setNetwork] = useDefaultNetwork(); | ||
| const { data: balance } = useBalanceByAddress({ address, network }); | ||
| <button onClick={() => setNetwork(Network.mainnet())}>Mainnet</button> | ||
| <button onClick={() => setNetwork(Network.testnet())}>Testnet</button> | ||
| ``` | ||
| ### DeFi | ||
| - Swap: `useSwapQuote({ from, to, amount, slippageBps? })` · `useBuildSwapTransaction()` · `useSwapProviders()` · `useSwapProvider()` | ||
| - Staking: `useStakingProviders()` · `useStakingQuote({ amount, direction })` · `useBuildStakeTransaction()` · `useStakedBalance({ userAddress })` | ||
| When you compose these into a custom UI (instead of `<SwapWidget />` / `<StakingWidget />`), you own loading and error state for every step: `useSwapQuote().isLoading` for the quote, `useBuildSwapTransaction().isPending` for the build, `useSendTransaction().isPending` for the send. Disable the submit button on the active step's pending flag, render the active step's `error.message`, and call `reset()` for retry. The widgets handle this for you; the hooks deliberately don't. | ||
| ## Drop-in Components | ||
| Full-featured React components from `@ton/appkit-react`. They handle their own state, loading, and errors: | ||
| | Component | Use for | | ||
| |---|---| | ||
| | `<TonConnectButton />` | Wallet connect/disconnect UI | | ||
| | `<SendTonButton recipientAddress amount comment? onSuccess? onError? />` | Send TON | | ||
| | `<SendJettonButton jetton={{address, symbol, decimals}} recipientAddress amount comment? onSuccess? onError? />` | Send jettons. ⚠ `jetton` is an **object** with `{ address, symbol, decimals }` — NOT a bare address string. `address` is the jetton master. `amount` is human-readable (e.g. `"5"` for 5 USDT); decimals come from the prop, not metadata. NFT transfers go via `useTransferNft` hook — no drop-in button. | | ||
| | `<SwapWidget tokens={...} />` | Full swap UI | | ||
| | `<StakingWidget />` | Full staking UI | | ||
| | `<NftItem nft={...} />` | NFT card (image, name, collection, badge) | | ||
| | `<TransactionProgress boc={...} />` | Tracks tx until on-chain finalized | | ||
| Render-prop pattern for custom UI with built-in state: | ||
| ```tsx | ||
| <SwapWidget tokens={tokens}>{(ctx) => <YourUI {...ctx} />}</SwapWidget> | ||
| ``` | ||
| ## Query Key Prefixes | ||
| For `invalidateQueries` / `removeQueries`. TanStack prefix-matches on the **first array element** — passing `queryKey: ['balance']` invalidates every `['balance', { address: A, network: M }]`, `['balance', { address: B, network: T }]`, etc. You rarely need to enumerate addresses; matching by the bare prefix is enough. | ||
| | Prefix | Full key shape | Caches | | ||
| |---|---|---| | ||
| | `['balance']` | `['balance', { address, network }]` | TON balance | | ||
| | `['nfts']` | `['nfts', { address, network }]` | NFT list | | ||
| | `['nft']` | `['nft', { address, network? }]` | Single NFT (`address` = NFT item's contract address) | | ||
| | `['jettons']` | `['jettons', { address, network }]` | Jetton list | | ||
| | `['jetton-balance']` / `['jetton-info']` / `['jetton-wallet-address']` | kebab-case keys with `{ jettonAddress, ownerAddress }` | Jetton state (kebab-case — camelCase will silently match nothing) | | ||
| | `['stakedBalance']` / `['stakingProviderInfo']` / `['stakingQuote']` | camelCase keys | Staking | | ||
| | `['swapQuote']` | `['swapQuote', { amount, from, to }]` | Swap quotes | | ||
| ## Four Critical Patterns | ||
| ### 1. Real-time updates (streaming) | ||
| Streaming is opt-in. Two requirements: register a provider + mount the watch hook. | ||
| ```ts | ||
| import { createTonCenterStreamingProvider } from '@ton/appkit'; | ||
| const appKit = new AppKit({ | ||
| networks: { /* ... */ }, | ||
| providers: [ | ||
| createTonCenterStreamingProvider({ network: Network.mainnet(), apiKey: 'KEY' }), | ||
| ], | ||
| }); | ||
| ``` | ||
| ```tsx | ||
| function BalanceDisplay() { | ||
| const { data: balance } = useBalance(); // already-formatted decimal string like "0.5" | ||
| useWatchBalance(); // writes WS updates into useBalance cache | ||
| return <p>{balance ?? '—'} TON</p>; | ||
| } | ||
| ``` | ||
| Without **both**, `useBalance` is one-shot. | ||
| **Streaming-provider auth quirks (keyless != work):** | ||
| - `createTonCenterStreamingProvider({ network, apiKey })` — `apiKey` is optional; keyless works but is heavily rate-limited. | ||
| - `createTonApiStreamingProvider({ network, apiKey })` — `apiKey` is **effectively required**. Keyless WebSocket connections to `wss://tonapi.io/streaming/v2/ws` are closed by the gateway with HTTP 401; the provider then reconnects in a loop and floods the console with `WebSocket error` lines. Get a token from <https://tonconsole.com> or fall back to `createTonCenterStreamingProvider` if you want a keyless option. | ||
| ### 2. Cache after mutations | ||
| Mutations don't auto-invalidate. Use `invalidateQueries` after transfers and `removeQueries` after disconnect: | ||
| ```tsx | ||
| const queryClient = useQueryClient(); | ||
| // After transfer: invalidate so the next render refetches | ||
| useTransferTon({ | ||
| mutation: { onSuccess: () => queryClient.invalidateQueries({ queryKey: ['balance'] }) }, | ||
| }); | ||
| // After disconnect: remove entirely so old wallet's data can't flash | ||
| useDisconnect({ | ||
| mutation: { | ||
| onSuccess: () => { | ||
| ['balance', 'nfts', 'nft', 'jettons', 'jetton-balance', 'jetton-info', 'jetton-wallet-address', 'stakedBalance'].forEach(key => | ||
| queryClient.removeQueries({ queryKey: [key] }), | ||
| ); | ||
| }, | ||
| }, | ||
| }); | ||
| ``` | ||
| `removeQueries` is correct on disconnect because there's no wallet to refetch for — leaving stale entries would flash the old wallet's data before the new wallet loads. | ||
| For a stronger guarantee when wallet switches happen mid-flight (pending tx, hooks holding stale data), wrap wallet-scoped UI with `key={address}` so React remounts the whole subtree on address change: | ||
| ```tsx | ||
| const address = useAddress(); | ||
| return <WalletScopedUI key={address ?? 'disconnected'} />; | ||
| ``` | ||
| This kills any in-flight mutation state, useState, and refs tied to the previous wallet — cleanest fix for "spinner stuck forever after switching wallets". Combine with `removeQueries` on disconnect for the cache layer. | ||
| ### 3. Transaction confirmation is not instant | ||
| `useTransferTon` / `useSendTransaction` resolve when the wallet **accepts** the tx — not when it's confirmed on-chain. Balances won't reflect the change immediately even after `onSuccess`. `data` is `SendTransactionResponse = { boc, normalizedBoc, normalizedHash }` — an **object**, not a bare BOC string. Two patterns: | ||
| ```tsx | ||
| // (a) Drop-in: <TransactionProgress /> tracks the tx until finalized | ||
| const { mutate, data } = useTransferTon(); | ||
| {data && <TransactionProgress boc={data.boc} onSuccess={() => /* now confirmed */} />} | ||
| // (b) Hooks: invalidate on accept; the next refetch picks up the new state once on-chain | ||
| useTransferTon({ | ||
| mutation: { onSuccess: () => queryClient.invalidateQueries({ queryKey: ['balance'] }) }, | ||
| }); | ||
| ``` | ||
| To track a tx by hash (e.g. backend webhook lookup), use `data.normalizedHash`. | ||
| Pair with `useWatchBalance()` + streaming if you want the balance to refresh the instant confirmation lands without a manual refetch. | ||
| ### 4. Transaction error handling | ||
| ```tsx | ||
| const { mutate, isPending, error, reset } = useTransferTon(); | ||
| const isUserRejection = (err: Error) => /reject|cancel|abort/i.test(err.message); | ||
| <button disabled={isPending} onClick={() => mutate(params)}>Send</button> | ||
| {error && ( | ||
| <> | ||
| <p>{isUserRejection(error) ? 'Cancelled' : `Error: ${error.message}`}</p> | ||
| <button onClick={reset}>Try again</button> | ||
| </> | ||
| )} | ||
| ``` | ||
| Disable only on `isPending`, not `isError` (button must re-enable so user can retry). Use `reset()` for retry. For swap/staking, `@ton/appkit` exports `DefiError` (with `DefiErrorCode`) for typed handling. | ||
| ## No-wallet fallback | ||
| When the user has no TON wallet installed (no browser extension, no Tonkeeper on the device), `<TonConnectButton />` still works — but the experience changes: | ||
| - **On mobile** without Tonkeeper installed, the universal link opens the App Store / Google Play install flow. | ||
| - **On desktop** without a browser-extension wallet, TonConnect opens a modal with QR codes — the user scans from their mobile wallet to connect. This is intentional and works without any code from you. | ||
| For a custom Connect button, you can detect emptiness via `useConnectors()` and render a fallback CTA: | ||
| ```tsx | ||
| const connectors = useConnectors(); | ||
| if (connectors.length === 0) { | ||
| return ( | ||
| <a href="https://tonkeeper.com/download" target="_blank" rel="noreferrer"> | ||
| Install Tonkeeper to continue | ||
| </a> | ||
| ); | ||
| } | ||
| ``` | ||
| But for most apps the right answer is **just use `<TonConnectButton />`** and rely on TonConnect's built-in universal/QR/install-redirect flow — it covers all three cases (extension, mobile-installed, mobile-not-installed → install link, desktop → QR) without you wiring it. | ||
| ## Common Gotchas | ||
| 1. **`QueryClientProvider` wraps `AppKitProvider`** — not the other way around. `AppKitProvider` doesn't create its own QueryClient. | ||
| 2. **`useBalance` returns a pre-formatted TON decimal string** (e.g. `"0.500000000"`), not raw nano and not `bigint`. Same for `useJettons().data.jettons[i].balance` (formatted using the jetton's own decimals). Render directly or format with `Intl.NumberFormat`; calling `formatUnits(balance, 9)` again will re-slice the string on the decimal point and produce `"0..500000000"`. | ||
| 3. **Amounts are strings** (`'0.5'`, not `500000000n`). AppKit applies token decimals internally. | ||
| 4. **Streaming is opt-in** — needs both a provider in config and `useWatchBalance` mounted. | ||
| 5. **Network mismatch breaks transactions** — if the connected wallet is on testnet but your `defaultNetwork` is mainnet (or vice versa), TonConnect rejects the tx and your `useTransferTon` mutation lands in `error` with a network-mismatch message. Set `defaultNetwork`, expose switching with `useDefaultNetwork()`, and pass `network` into address-based reads. Check before sending: | ||
| ```tsx | ||
| const walletNetwork = useNetwork(); | ||
| const [defaultNetwork] = useDefaultNetwork(); | ||
| const networkMismatch = walletNetwork && walletNetwork.chainId !== defaultNetwork.chainId; | ||
| ``` | ||
| Mainnet chainId `-239`, testnet `-3`. | ||
| 6. **iOS deep links need synchronous click** — call `connect()` directly in the handler, no `await` before it (see Wallet section above for the anti-pattern). | ||
| 7. **Telegram Mini App return** — configure `tonConnectOptions.actionsConfiguration.returnStrategy`. | ||
| 8. **React 19 / Next 15 hook errors** — check `@tonconnect/ui-react` version + run `pnpm why react` for duplicates. | ||
| 9. **`<StakingWidget />` + keyless TonCenter = HTTP 429 cascade** — while the widget is mounted, its internal queries poll with `refetchInterval: 5000` (three queries: provider info, staked/token balances, quote), and each refresh can hit several TonCenter endpoints (`getPoolBalance` / `getPoolData` / APY). The Tonstakers provider itself has NO internal timer — registering `createTonstakersProvider()` alone causes no traffic; it only adds a 30s-TTL cache around on-demand reads. With a **keyless** `apiClient: { url: 'https://toncenter.com' }`, the widget's polling quickly exhausts the IP's anonymous TonCenter quota and cascades HTTP 429s into otherwise-unrelated reads (`useBalance`, `useJettons`, `useNfts`). Symptom: balance/jettons/nfts hang or fail, staking widget itself stays empty. Fix: set a real TonCenter `apiKey` on the apiClient, or don't mount `<StakingWidget />` until you have one. | ||
| 10. **`<SwapWidget />` swallows build/send errors silently** — its `ctx.error` carries only client-side validation messages. Failures from `useBuildSwapTransaction` (e.g. Omniston returning `Internal server error: 5: [hash]`, an expired quote, no liquidity at execution time) and from `useSendTransaction` become **unhandled promise rejections**: the Continue button appears to do nothing, no toast, no in-widget error. Diagnose in DevTools Console (look for `Unhandled rejection: SwapError: …`). If you're composing your own UI via the render-prop, wrap `ctx.sendSwapTransaction()` in `try/catch` and surface the error yourself, or attach a `window.addEventListener('unhandledrejection', ...)` handler. For custom flows, the hooks (`useSwapQuote` → `useBuildSwapTransaction` → `useSendTransaction`) each expose their own `error` field — use them directly instead. |
| /** | ||
| * 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 { CryptoOnrampDeposit, CryptoOnrampDepositParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type CreateCryptoOnrampDepositOptions<T = unknown> = CryptoOnrampDepositParams<T> & { | ||
| providerId?: string; | ||
| }; | ||
| export type CreateCryptoOnrampDepositReturnType = Promise<CryptoOnrampDeposit>; | ||
| /** | ||
| * Create a crypto onramp deposit from a previously obtained quote | ||
| */ | ||
| export const createCryptoOnrampDeposit = async <T = unknown>( | ||
| appKit: AppKit, | ||
| options: CreateCryptoOnrampDepositOptions<T>, | ||
| ): CreateCryptoOnrampDepositReturnType => { | ||
| return appKit.cryptoOnrampManager.createDeposit(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 { CryptoOnrampProviderMetadata } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampProviderMetadataOptions { | ||
| providerId?: string; | ||
| } | ||
| export type GetCryptoOnrampProviderMetadataReturnType = CryptoOnrampProviderMetadata; | ||
| /** | ||
| * Get static metadata for a crypto-onramp provider (display name, logo, url). | ||
| */ | ||
| export const getCryptoOnrampProviderMetadata = ( | ||
| appKit: AppKit, | ||
| options: GetCryptoOnrampProviderMetadataOptions = {}, | ||
| ): GetCryptoOnrampProviderMetadataReturnType => { | ||
| return appKit.cryptoOnrampManager.getMetadata(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 { CryptoOnrampProviderInterface } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampProviderOptions { | ||
| id?: string; | ||
| } | ||
| export type GetCryptoOnrampProviderReturnType = CryptoOnrampProviderInterface; | ||
| /** | ||
| * Get a registered crypto-onramp provider by id, or the default one when no id is given. | ||
| */ | ||
| export const getCryptoOnrampProvider = ( | ||
| appKit: AppKit, | ||
| options: GetCryptoOnrampProviderOptions = {}, | ||
| ): GetCryptoOnrampProviderReturnType => { | ||
| return appKit.cryptoOnrampManager.getProvider(options.id); | ||
| }; |
| /** | ||
| * 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 { CryptoOnrampProviderInterface } from '@ton/walletkit'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampProvidersReturnType = CryptoOnrampProviderInterface[]; | ||
| /** | ||
| * Get all registered crypto-onramp providers. | ||
| */ | ||
| export const getCryptoOnrampProviders = (appKit: AppKit): GetCryptoOnrampProvidersReturnType => { | ||
| return appKit.cryptoOnrampManager.getProviders(); | ||
| }; |
| /** | ||
| * 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 { CryptoOnrampQuote, CryptoOnrampQuoteParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampQuoteOptions<T = unknown> = CryptoOnrampQuoteParams<T> & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetCryptoOnrampQuoteReturnType = Promise<CryptoOnrampQuote>; | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| export const getCryptoOnrampQuote = async <T = unknown>( | ||
| appKit: AppKit, | ||
| options: GetCryptoOnrampQuoteOptions<T>, | ||
| ): GetCryptoOnrampQuoteReturnType => { | ||
| return appKit.cryptoOnrampManager.getQuote(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 { CryptoOnrampStatus, CryptoOnrampStatusParams } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export type GetCryptoOnrampStatusOptions = CryptoOnrampStatusParams & { | ||
| providerId?: string; | ||
| }; | ||
| export type GetCryptoOnrampStatusReturnType = Promise<CryptoOnrampStatus>; | ||
| /** | ||
| * Get a crypto onramp quote | ||
| */ | ||
| export const getCryptoOnrampStatus = async ( | ||
| appKit: AppKit, | ||
| options: GetCryptoOnrampStatusOptions, | ||
| ): GetCryptoOnrampStatusReturnType => { | ||
| return appKit.cryptoOnrampManager.getStatus(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 { CryptoOnrampSupportedCurrencies } from '../../crypto-onramp'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| export interface GetCryptoOnrampSupportedCurrenciesOptions { | ||
| providerId?: string; | ||
| } | ||
| export type GetCryptoOnrampSupportedCurrenciesReturnType = Promise<CryptoOnrampSupportedCurrencies>; | ||
| /** | ||
| * Discover supported source/destination currencies for a crypto-onramp provider. | ||
| */ | ||
| export const getCryptoOnrampSupportedCurrencies = async ( | ||
| appKit: AppKit, | ||
| options: GetCryptoOnrampSupportedCurrenciesOptions = {}, | ||
| ): GetCryptoOnrampSupportedCurrenciesReturnType => { | ||
| return appKit.cryptoOnrampManager.getSupportedCurrencies(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 interface SetDefaultCryptoOnrampProviderParameters { | ||
| providerId: string; | ||
| } | ||
| export type SetDefaultCryptoOnrampProviderReturnType = void; | ||
| /** | ||
| * Set the default crypto-onramp provider. | ||
| * Subsequent quote, deposit and status calls will use this provider when none is specified. | ||
| */ | ||
| export const setDefaultCryptoOnrampProvider = ( | ||
| appKit: AppKit, | ||
| parameters: SetDefaultCryptoOnrampProviderParameters, | ||
| ): SetDefaultCryptoOnrampProviderReturnType => { | ||
| appKit.cryptoOnrampManager.setDefaultProvider(parameters.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 interface WatchCryptoOnrampProvidersParameters { | ||
| onChange: () => void; | ||
| } | ||
| export type WatchCryptoOnrampProvidersReturnType = () => void; | ||
| /** | ||
| * Watch for new crypto-onramp providers registration and default-provider changes. | ||
| */ | ||
| export const watchCryptoOnrampProviders = ( | ||
| appKit: AppKit, | ||
| parameters: WatchCryptoOnrampProvidersParameters, | ||
| ): WatchCryptoOnrampProvidersReturnType => { | ||
| const { onChange } = parameters; | ||
| const unsubscribeRegistered = appKit.emitter.on('provider:registered', (event) => { | ||
| if (event.payload.type === 'crypto-onramp') onChange(); | ||
| }); | ||
| const unsubscribeDefaultChanged = appKit.emitter.on('provider:default-changed', (event) => { | ||
| if (event.payload.type === 'crypto-onramp') onChange(); | ||
| }); | ||
| return () => { | ||
| unsubscribeRegistered(); | ||
| unsubscribeDefaultChanged(); | ||
| }; | ||
| }; |
| /** | ||
| * 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 { Address, beginCell, Cell } from '@ton/core'; | ||
| import * as walletkit from '@ton/walletkit'; | ||
| import { Network } from '../../types/network'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { WalletInterface } from '../../types/wallet'; | ||
| import { asBase64 } from '../../utils'; | ||
| import { createTransferJettonTransaction } from './create-transfer-jetton-transaction'; | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const RECIPIENT = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const JETTON = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| const JETTON_WALLET = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| vi.mock('@ton/walletkit', async (importOriginal) => { | ||
| const actual = await importOriginal<typeof walletkit>(); | ||
| return { | ||
| ...actual, | ||
| getJettonWalletAddressFromClient: vi.fn(), | ||
| }; | ||
| }); | ||
| const makeWallet = (): WalletInterface => | ||
| ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => Network.mainnet(), | ||
| }) as unknown as WalletInterface; | ||
| const makeAppKit = (wallet: WalletInterface | null): AppKit => | ||
| ({ | ||
| walletsManager: { selectedWallet: wallet }, | ||
| networkManager: { getClient: vi.fn().mockReturnValue({}) }, | ||
| }) as unknown as AppKit; | ||
| interface DecodedJettonBody { | ||
| queryId: bigint; | ||
| amount: bigint; | ||
| destination: Address; | ||
| responseDestination: Address; | ||
| customPayload: Cell | null; | ||
| forwardAmount: bigint; | ||
| forwardPayload: Cell | null; | ||
| } | ||
| const decodeJettonBody = (payload: string | undefined): DecodedJettonBody => { | ||
| if (!payload) throw new Error('expected payload'); | ||
| const slice = Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // jetton transfer op | ||
| return { | ||
| queryId: slice.loadUintBig(64), | ||
| amount: slice.loadCoins(), | ||
| destination: slice.loadAddress(), | ||
| responseDestination: slice.loadAddress(), | ||
| customPayload: slice.loadMaybeRef(), | ||
| forwardAmount: slice.loadCoins(), | ||
| forwardPayload: slice.loadMaybeRef(), | ||
| }; | ||
| }; | ||
| const readComment = (cell: Cell | null): string => { | ||
| if (!cell) throw new Error('expected comment payload'); | ||
| const slice = cell.beginParse(); | ||
| slice.loadUint(32); | ||
| return slice.loadStringTail(); | ||
| }; | ||
| const sameCell = (a: Cell | null, b: Cell): boolean => | ||
| a !== null && a.toBoc().toString('base64') === b.toBoc().toString('base64'); | ||
| describe('createTransferJettonTransaction', () => { | ||
| beforeEach(() => { | ||
| vi.mocked(walletkit.getJettonWalletAddressFromClient).mockResolvedValue(JETTON_WALLET); | ||
| }); | ||
| it('targets the resolved jetton wallet and converts the amount by decimals', async () => { | ||
| const tx = await createTransferJettonTransaction(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '2', | ||
| jettonDecimals: 6, | ||
| }); | ||
| expect(tx.messages[0].address).toBe(JETTON_WALLET); | ||
| expect(tx.messages[0].amount).toBe(walletkit.DEFAULT_JETTON_GAS_FEE); | ||
| expect(tx.fromAddress).toBe(SENDER); | ||
| const body = decodeJettonBody(tx.messages[0].payload); | ||
| expect(body.amount).toBe(2_000_000n); | ||
| expect(body.destination.equals(Address.parse(RECIPIENT))).toBe(true); | ||
| expect(body.responseDestination.equals(Address.parse(SENDER))).toBe(true); | ||
| expect(body.queryId).toBe(0n); | ||
| expect(body.forwardAmount).toBe(walletkit.DEFAULT_FORWARD_AMOUNT); | ||
| expect(body.customPayload).toBeNull(); | ||
| expect(body.forwardPayload).toBeNull(); | ||
| }); | ||
| it('encodes a comment into the forward payload', async () => { | ||
| const tx = await createTransferJettonTransaction(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| comment: 'thanks', | ||
| }); | ||
| expect(readComment(decodeJettonBody(tx.messages[0].payload).forwardPayload)).toBe('thanks'); | ||
| }); | ||
| it('prefers a raw forwardPayload over a comment', async () => { | ||
| const forward = beginCell().storeUint(0xdeadbeef, 32).endCell(); | ||
| const tx = await createTransferJettonTransaction(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| comment: 'ignored', | ||
| forwardPayload: asBase64(forward.toBoc().toString('base64')), | ||
| }); | ||
| expect(sameCell(decodeJettonBody(tx.messages[0].payload).forwardPayload, forward)).toBe(true); | ||
| }); | ||
| it('forwards queryId, forwardAmount, customPayload, responseDestination and gasAmount', async () => { | ||
| const customPayload = beginCell().storeUint(0xaa, 8).endCell(); | ||
| const tx = await createTransferJettonTransaction(makeAppKit(makeWallet()), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| responseDestination: RECIPIENT, | ||
| queryId: '7', | ||
| forwardAmount: '300000000', | ||
| customPayload: asBase64(customPayload.toBoc().toString('base64')), | ||
| gasAmount: '150000000', | ||
| }); | ||
| expect(tx.messages[0].amount).toBe('150000000'); | ||
| const body = decodeJettonBody(tx.messages[0].payload); | ||
| expect(body.queryId).toBe(7n); | ||
| expect(body.forwardAmount).toBe(300000000n); | ||
| expect(body.responseDestination.equals(Address.parse(RECIPIENT))).toBe(true); | ||
| expect(sameCell(body.customPayload, customPayload)).toBe(true); | ||
| }); | ||
| it('throws when no wallet is connected', async () => { | ||
| await expect( | ||
| createTransferJettonTransaction(makeAppKit(null), { | ||
| jettonAddress: JETTON, | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| jettonDecimals: 9, | ||
| }), | ||
| ).rejects.toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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 } from 'vitest'; | ||
| import { Address, beginCell, Cell } from '@ton/core'; | ||
| import { DEFAULT_FORWARD_AMOUNT, DEFAULT_NFT_GAS_FEE } from '@ton/walletkit'; | ||
| import { Network } from '../../types/network'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { WalletInterface } from '../../types/wallet'; | ||
| import { asBase64 } from '../../utils'; | ||
| import { createTransferNftTransaction } from './create-transfer-nft-transaction'; | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const NEW_OWNER = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const NFT = 'EQDrjaLahLkMB-hMCmkzOyBuHJ139ZJpDQrN6JleegN-Y3X'; | ||
| const makeWallet = (): WalletInterface => | ||
| ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => Network.mainnet(), | ||
| }) as unknown as WalletInterface; | ||
| const makeAppKit = (wallet: WalletInterface | null): AppKit => | ||
| ({ walletsManager: { selectedWallet: wallet } }) as unknown as AppKit; | ||
| interface DecodedNftBody { | ||
| queryId: bigint; | ||
| newOwner: Address; | ||
| responseDestination: Address; | ||
| customPayload: Cell | null; | ||
| forwardAmount: bigint; | ||
| forwardPayload: Cell | null; | ||
| } | ||
| const decodeNftBody = (payload: string | undefined): DecodedNftBody => { | ||
| if (!payload) throw new Error('expected payload'); | ||
| const slice = Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // nft transfer op | ||
| return { | ||
| queryId: slice.loadUintBig(64), | ||
| newOwner: slice.loadAddress(), | ||
| responseDestination: slice.loadAddress(), | ||
| customPayload: slice.loadMaybeRef(), | ||
| forwardAmount: slice.loadCoins(), | ||
| forwardPayload: slice.loadMaybeRef(), | ||
| }; | ||
| }; | ||
| const readComment = (cell: Cell | null): string => { | ||
| if (!cell) throw new Error('expected comment payload'); | ||
| const slice = cell.beginParse(); | ||
| slice.loadUint(32); | ||
| return slice.loadStringTail(); | ||
| }; | ||
| const sameCell = (a: Cell | null, b: Cell): boolean => | ||
| a !== null && a.toBoc().toString('base64') === b.toBoc().toString('base64'); | ||
| describe('createTransferNftTransaction', () => { | ||
| it('builds a transfer with sensible defaults', async () => { | ||
| const tx = await createTransferNftTransaction(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| }); | ||
| expect(tx.messages[0].address).toBe(NFT); | ||
| expect(tx.messages[0].amount).toBe(DEFAULT_NFT_GAS_FEE); | ||
| expect(tx.fromAddress).toBe(SENDER); | ||
| const body = decodeNftBody(tx.messages[0].payload); | ||
| expect(body.queryId).toBe(0n); | ||
| expect(body.newOwner.equals(Address.parse(NEW_OWNER))).toBe(true); | ||
| expect(body.responseDestination.equals(Address.parse(SENDER))).toBe(true); | ||
| expect(body.customPayload).toBeNull(); | ||
| expect(body.forwardAmount).toBe(DEFAULT_FORWARD_AMOUNT); | ||
| expect(body.forwardPayload).toBeNull(); | ||
| }); | ||
| it('encodes a comment into the forward payload', async () => { | ||
| const tx = await createTransferNftTransaction(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| comment: 'enjoy', | ||
| }); | ||
| expect(readComment(decodeNftBody(tx.messages[0].payload).forwardPayload)).toBe('enjoy'); | ||
| }); | ||
| it('prefers a raw forwardPayload over a comment', async () => { | ||
| const forward = beginCell().storeUint(0xdeadbeef, 32).endCell(); | ||
| const tx = await createTransferNftTransaction(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| comment: 'ignored', | ||
| forwardPayload: asBase64(forward.toBoc().toString('base64')), | ||
| }); | ||
| expect(sameCell(decodeNftBody(tx.messages[0].payload).forwardPayload, forward)).toBe(true); | ||
| }); | ||
| it('forwards queryId, forwardAmount, customPayload, responseDestination and gas amount', async () => { | ||
| const customPayload = beginCell().storeUint(0xaa, 8).endCell(); | ||
| const tx = await createTransferNftTransaction(makeAppKit(makeWallet()), { | ||
| nftAddress: NFT, | ||
| recipientAddress: NEW_OWNER, | ||
| gasAmount: '250000000', | ||
| responseDestination: NEW_OWNER, | ||
| queryId: '42', | ||
| forwardAmount: '5000000', | ||
| customPayload: asBase64(customPayload.toBoc().toString('base64')), | ||
| }); | ||
| expect(tx.messages[0].amount).toBe('250000000'); | ||
| const body = decodeNftBody(tx.messages[0].payload); | ||
| expect(body.queryId).toBe(42n); | ||
| expect(body.forwardAmount).toBe(5000000n); | ||
| expect(body.responseDestination.equals(Address.parse(NEW_OWNER))).toBe(true); | ||
| expect(sameCell(body.customPayload, customPayload)).toBe(true); | ||
| }); | ||
| it('throws when no wallet is connected', async () => { | ||
| await expect( | ||
| createTransferNftTransaction(makeAppKit(null), { nftAddress: NFT, recipientAddress: NEW_OWNER }), | ||
| ).rejects.toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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'; | ||
| import type { CustomProvider } from '../../providers'; | ||
| export interface GetCustomProviderOptions { | ||
| id: string; | ||
| } | ||
| export type GetCustomProviderReturnType<T extends CustomProvider = CustomProvider> = T | undefined; | ||
| /** | ||
| * Get a registered custom provider by id. Pass the expected type as a generic | ||
| * argument to narrow the returned provider. | ||
| */ | ||
| export const getCustomProvider = <T extends CustomProvider = CustomProvider>( | ||
| appKit: AppKit, | ||
| options: GetCustomProviderOptions, | ||
| ): GetCustomProviderReturnType<T> => { | ||
| return appKit.customProvidersManager.getProvider<T>(options.id); | ||
| }; |
| /** | ||
| * 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 interface WatchCustomProvidersParameters { | ||
| onChange: () => void; | ||
| } | ||
| export type WatchCustomProvidersReturnType = () => void; | ||
| /** | ||
| * Watch for custom provider registrations | ||
| */ | ||
| export const watchCustomProviders = ( | ||
| appKit: AppKit, | ||
| parameters: WatchCustomProvidersParameters, | ||
| ): WatchCustomProvidersReturnType => { | ||
| const { onChange } = parameters; | ||
| return appKit.emitter.on('provider:registered', (event) => { | ||
| if (event.payload.type === 'custom') 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 { describe, it, expect } from 'vitest'; | ||
| import { beginCell, Cell } from '@ton/core'; | ||
| import { Network } from '../../types/network'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import type { WalletInterface } from '../../types/wallet'; | ||
| import { asBase64 } from '../../utils'; | ||
| import { createTransferTonTransaction } from './create-transfer-ton-transaction'; | ||
| const SENDER = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'; | ||
| const RECIPIENT = 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c'; | ||
| const makeWallet = (): WalletInterface => | ||
| ({ | ||
| getAddress: () => SENDER, | ||
| getNetwork: () => Network.mainnet(), | ||
| }) as unknown as WalletInterface; | ||
| const makeAppKit = (wallet: WalletInterface | null): AppKit => | ||
| ({ walletsManager: { selectedWallet: wallet } }) as unknown as AppKit; | ||
| const readComment = (payload: string | undefined): string => { | ||
| if (!payload) throw new Error('expected payload'); | ||
| const slice = Cell.fromBase64(payload).beginParse(); | ||
| slice.loadUint(32); // text comment op = 0 | ||
| return slice.loadStringTail(); | ||
| }; | ||
| describe('createTransferTonTransaction', () => { | ||
| it('builds a single message with the amount converted to nanotons', () => { | ||
| const tx = createTransferTonTransaction(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1.5', | ||
| }); | ||
| expect(tx.messages).toHaveLength(1); | ||
| expect(tx.messages[0].address).toBe(RECIPIENT); | ||
| expect(tx.messages[0].amount).toBe('1500000000'); | ||
| expect(tx.fromAddress).toBe(SENDER); | ||
| }); | ||
| it('encodes a comment into the payload when no raw payload is given', () => { | ||
| const tx = createTransferTonTransaction(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| comment: 'gm', | ||
| }); | ||
| expect(readComment(tx.messages[0].payload)).toBe('gm'); | ||
| }); | ||
| it('prefers a raw payload over a comment', () => { | ||
| const rawPayload = asBase64(beginCell().storeUint(0x1234, 32).endCell().toBoc().toString('base64')); | ||
| const tx = createTransferTonTransaction(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| comment: 'ignored', | ||
| payload: rawPayload, | ||
| }); | ||
| expect(tx.messages[0].payload).toBe(rawPayload); | ||
| }); | ||
| it('forwards stateInit and extraCurrency onto the message', () => { | ||
| const stateInit = asBase64(beginCell().storeUint(1, 8).endCell().toBoc().toString('base64')); | ||
| const extraCurrency = { '100': '5' }; | ||
| const tx = createTransferTonTransaction(makeAppKit(makeWallet()), { | ||
| recipientAddress: RECIPIENT, | ||
| amount: '1', | ||
| stateInit, | ||
| extraCurrency, | ||
| }); | ||
| expect(tx.messages[0].stateInit).toBe(stateInit); | ||
| expect(tx.messages[0].extraCurrency).toEqual(extraCurrency); | ||
| }); | ||
| it('throws when no wallet is connected', () => { | ||
| expect(() => | ||
| createTransferTonTransaction(makeAppKit(null), { recipientAddress: RECIPIENT, amount: '1' }), | ||
| ).toThrow('Wallet not connected'); | ||
| }); | ||
| }); |
| /** | ||
| * 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/crypto-onramp/decent'; |
| /** | ||
| * 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 { | ||
| CryptoOnrampProvider, | ||
| CryptoOnrampManager, | ||
| CryptoOnrampError, | ||
| CryptoOnrampErrorCode, | ||
| Caip2ByNetwork, | ||
| } from '@ton/walletkit'; | ||
| export type { | ||
| CryptoOnrampAPI, | ||
| CryptoOnrampProviderInterface, | ||
| CryptoOnrampProviderMetadata, | ||
| CryptoOnrampProviderMetadataOverride, | ||
| CryptoOnrampQuote, | ||
| CryptoOnrampQuoteParams, | ||
| CryptoOnrampDeposit, | ||
| CryptoOnrampDepositParams, | ||
| CryptoOnrampStatus, | ||
| CryptoOnrampStatusParams, | ||
| CryptoOnrampSourceCurrency, | ||
| CryptoOnrampDestinationCurrency, | ||
| CryptoOnrampSupportedCurrencies, | ||
| } 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/crypto-onramp/layerswap'; |
| /** | ||
| * 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 { CustomProvidersManager } from '@ton/walletkit'; | ||
| export type { CustomProvider } 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 { MutationOptions } from '@tanstack/query-core'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { createCryptoOnrampDeposit } from '../../actions/crypto-onramp/create-crypto-onramp-deposit'; | ||
| import type { | ||
| CreateCryptoOnrampDepositOptions, | ||
| CreateCryptoOnrampDepositReturnType, | ||
| } from '../../actions/crypto-onramp/create-crypto-onramp-deposit'; | ||
| import type { MutationParameter } from '../../types/query'; | ||
| export type CreateCryptoOnrampDepositErrorType = Error; | ||
| export type CreateCryptoOnrampDepositData = Awaited<CreateCryptoOnrampDepositReturnType>; | ||
| export type CreateCryptoOnrampDepositVariables = CreateCryptoOnrampDepositOptions; | ||
| export type CreateCryptoOnrampDepositMutationOptions<context = unknown> = MutationParameter< | ||
| CreateCryptoOnrampDepositData, | ||
| CreateCryptoOnrampDepositErrorType, | ||
| CreateCryptoOnrampDepositVariables, | ||
| context | ||
| >; | ||
| export type CreateCryptoOnrampDepositMutationConfig<context = unknown> = MutationOptions< | ||
| CreateCryptoOnrampDepositData, | ||
| CreateCryptoOnrampDepositErrorType, | ||
| CreateCryptoOnrampDepositVariables, | ||
| context | ||
| >; | ||
| export const createCryptoOnrampDepositMutationOptions = <context = unknown>( | ||
| appKit: AppKit, | ||
| ): CreateCryptoOnrampDepositMutationConfig<context> => ({ | ||
| mutationFn: (variables: CreateCryptoOnrampDepositVariables) => createCryptoOnrampDeposit(appKit, variables), | ||
| }); |
| /** | ||
| * 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'; | ||
| import { getCryptoOnrampQuote } from '../../actions/crypto-onramp/get-crypto-onramp-quote'; | ||
| import type { | ||
| GetCryptoOnrampQuoteOptions, | ||
| GetCryptoOnrampQuoteReturnType, | ||
| } from '../../actions/crypto-onramp/get-crypto-onramp-quote'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export type GetCryptoOnrampQuoteErrorType = Error; | ||
| export type GetCryptoOnrampQuoteData = GetCryptoOnrampQuoteQueryFnData; | ||
| export type GetCryptoOnrampQuoteQueryConfig<selectData = GetCryptoOnrampQuoteData> = Compute< | ||
| ExactPartial<GetCryptoOnrampQuoteOptions> | ||
| > & | ||
| QueryParameter< | ||
| GetCryptoOnrampQuoteQueryFnData, | ||
| GetCryptoOnrampQuoteErrorType, | ||
| selectData, | ||
| GetCryptoOnrampQuoteQueryKey | ||
| >; | ||
| export const getCryptoOnrampQuoteQueryOptions = <selectData = GetCryptoOnrampQuoteData>( | ||
| appKit: AppKit, | ||
| options: GetCryptoOnrampQuoteQueryConfig<selectData> = {}, | ||
| ): GetCryptoOnrampQuoteQueryOptions<selectData> => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey as [string, GetCryptoOnrampQuoteOptions]; | ||
| return getCryptoOnrampQuote(appKit, parameters); | ||
| }, | ||
| queryKey: getCryptoOnrampQuoteQueryKey(options), | ||
| }; | ||
| }; | ||
| export type GetCryptoOnrampQuoteQueryFnData = Compute<Awaited<GetCryptoOnrampQuoteReturnType>>; | ||
| export const getCryptoOnrampQuoteQueryKey = ( | ||
| options: Compute<ExactPartial<GetCryptoOnrampQuoteOptions>> = {}, | ||
| ): GetCryptoOnrampQuoteQueryKey => ['crypto-onramp-quote', filterQueryOptions(options)] as const; | ||
| export type GetCryptoOnrampQuoteQueryKey = readonly [ | ||
| 'crypto-onramp-quote', | ||
| Compute<ExactPartial<GetCryptoOnrampQuoteOptions>>, | ||
| ]; | ||
| export type GetCryptoOnrampQuoteQueryOptions<selectData = GetCryptoOnrampQuoteData> = QueryOptions< | ||
| GetCryptoOnrampQuoteQueryFnData, | ||
| GetCryptoOnrampQuoteErrorType, | ||
| selectData, | ||
| GetCryptoOnrampQuoteQueryKey | ||
| >; |
| /** | ||
| * 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'; | ||
| import { getCryptoOnrampStatus } from '../../actions/crypto-onramp/get-crypto-onramp-status'; | ||
| import type { | ||
| GetCryptoOnrampStatusOptions, | ||
| GetCryptoOnrampStatusReturnType, | ||
| } from '../../actions/crypto-onramp/get-crypto-onramp-status'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export type GetCryptoOnrampStatusErrorType = Error; | ||
| export type GetCryptoOnrampStatusData = GetCryptoOnrampStatusQueryFnData; | ||
| export type GetCryptoOnrampStatusQueryConfig<selectData = GetCryptoOnrampStatusData> = Compute< | ||
| ExactPartial<GetCryptoOnrampStatusOptions> | ||
| > & | ||
| QueryParameter< | ||
| GetCryptoOnrampStatusQueryFnData, | ||
| GetCryptoOnrampStatusErrorType, | ||
| selectData, | ||
| GetCryptoOnrampStatusQueryKey | ||
| >; | ||
| export const getCryptoOnrampStatusQueryOptions = <selectData = GetCryptoOnrampStatusData>( | ||
| appKit: AppKit, | ||
| options: GetCryptoOnrampStatusQueryConfig<selectData> = {}, | ||
| ): GetCryptoOnrampStatusQueryOptions<selectData> => { | ||
| return { | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey as [string, GetCryptoOnrampStatusOptions]; | ||
| return getCryptoOnrampStatus(appKit, parameters); | ||
| }, | ||
| queryKey: getCryptoOnrampStatusQueryKey(options), | ||
| enabled: options.depositId !== undefined, | ||
| }; | ||
| }; | ||
| export type GetCryptoOnrampStatusQueryFnData = Compute<Awaited<GetCryptoOnrampStatusReturnType>>; | ||
| export const getCryptoOnrampStatusQueryKey = ( | ||
| options: Compute<ExactPartial<GetCryptoOnrampStatusOptions>> = {}, | ||
| ): GetCryptoOnrampStatusQueryKey => ['crypto-onramp-status', filterQueryOptions(options)] as const; | ||
| export type GetCryptoOnrampStatusQueryKey = readonly [ | ||
| 'crypto-onramp-status', | ||
| Compute<ExactPartial<GetCryptoOnrampStatusOptions>>, | ||
| ]; | ||
| export type GetCryptoOnrampStatusQueryOptions<selectData = GetCryptoOnrampStatusData> = QueryOptions< | ||
| GetCryptoOnrampStatusQueryFnData, | ||
| GetCryptoOnrampStatusErrorType, | ||
| selectData, | ||
| GetCryptoOnrampStatusQueryKey | ||
| >; |
| /** | ||
| * 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'; | ||
| import { getCryptoOnrampSupportedCurrencies } from '../../actions/crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| import type { | ||
| GetCryptoOnrampSupportedCurrenciesOptions, | ||
| GetCryptoOnrampSupportedCurrenciesReturnType, | ||
| } from '../../actions/crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| import type { QueryOptions, QueryParameter } from '../../types/query'; | ||
| import type { Compute, ExactPartial } from '../../types/utils'; | ||
| import { filterQueryOptions } from '../../utils'; | ||
| export type GetCryptoOnrampSupportedCurrenciesErrorType = Error; | ||
| export type GetCryptoOnrampSupportedCurrenciesData = GetCryptoOnrampSupportedCurrenciesQueryFnData; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryConfig<selectData = GetCryptoOnrampSupportedCurrenciesData> = | ||
| Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>> & | ||
| QueryParameter< | ||
| GetCryptoOnrampSupportedCurrenciesQueryFnData, | ||
| GetCryptoOnrampSupportedCurrenciesErrorType, | ||
| selectData, | ||
| GetCryptoOnrampSupportedCurrenciesQueryKey | ||
| >; | ||
| const ONE_HOUR_MS = 60 * 60 * 1000; | ||
| const ONE_DAY_MS = 24 * ONE_HOUR_MS; | ||
| export const getCryptoOnrampSupportedCurrenciesQueryOptions = <selectData = GetCryptoOnrampSupportedCurrenciesData>( | ||
| appKit: AppKit, | ||
| options: GetCryptoOnrampSupportedCurrenciesQueryConfig<selectData> = {}, | ||
| ): GetCryptoOnrampSupportedCurrenciesQueryOptions<selectData> => { | ||
| return { | ||
| // The supported-currencies list for a provider rarely changes. Keep the fetched data | ||
| // in-cache long enough that the widget never refetches it within a normal session. | ||
| // Consumers can override via `options.query` if they need different behavior. | ||
| staleTime: ONE_HOUR_MS, | ||
| gcTime: ONE_DAY_MS, | ||
| refetchOnWindowFocus: false, | ||
| refetchOnReconnect: false, | ||
| ...options.query, | ||
| queryFn: async (context) => { | ||
| const [, parameters] = context.queryKey as [string, GetCryptoOnrampSupportedCurrenciesOptions]; | ||
| return getCryptoOnrampSupportedCurrencies(appKit, parameters); | ||
| }, | ||
| queryKey: getCryptoOnrampSupportedCurrenciesQueryKey(options), | ||
| }; | ||
| }; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryFnData = Compute< | ||
| Awaited<GetCryptoOnrampSupportedCurrenciesReturnType> | ||
| >; | ||
| export const getCryptoOnrampSupportedCurrenciesQueryKey = ( | ||
| options: Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>> = {}, | ||
| ): GetCryptoOnrampSupportedCurrenciesQueryKey => | ||
| ['crypto-onramp-supported-currencies', filterQueryOptions(options)] as const; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryKey = readonly [ | ||
| 'crypto-onramp-supported-currencies', | ||
| Compute<ExactPartial<GetCryptoOnrampSupportedCurrenciesOptions>>, | ||
| ]; | ||
| export type GetCryptoOnrampSupportedCurrenciesQueryOptions<selectData = GetCryptoOnrampSupportedCurrenciesData> = | ||
| QueryOptions< | ||
| GetCryptoOnrampSupportedCurrenciesQueryFnData, | ||
| GetCryptoOnrampSupportedCurrenciesErrorType, | ||
| selectData, | ||
| GetCryptoOnrampSupportedCurrenciesQueryKey | ||
| >; |
+60
-0
| # @ton/appkit | ||
| ## 1.1.0-beta.0 | ||
| ### Minor Changes | ||
| - 68f4abb: Add crypto-onramp support — bridging another chain's crypto into a TON-side asset (e.g. ETH on Arbitrum → USDT on TON) through pluggable providers. | ||
| **@ton/walletkit** | ||
| - `CryptoOnrampManager` — registers, switches and delegates to crypto-onramp providers with a unified API: `getQuote`, `createDeposit`, `getStatus`, `getSupportedCurrencies`, and synchronous `getMetadata`. | ||
| - `CryptoOnrampProvider` abstract base + `CryptoOnrampProviderInterface` for custom providers. | ||
| - Two built-in providers: **Layerswap** and **Decent** (formerly Swaps.xyz), each with configurable supported chains and currencies. | ||
| - Models: `CryptoOnrampQuote`, `CryptoOnrampDeposit`, `CryptoOnrampStatus`, `CryptoOnrampSourceCurrency` / `CryptoOnrampDestinationCurrency`, `CryptoOnrampSupportedCurrencies`, and `CryptoOnrampProviderMetadata` (carries `refundAddressMode` — `off` / `optional` / `required` — and `isReversedAmountSupported`). CAIP-2 chain identifiers via `Caip2ByNetwork`. | ||
| - Currency addresses are normalized to canonical sentinels — `'native'` for a source chain's native coin and `'ton'` for native Toncoin (surfaced as GRAM); each provider translates them to its own API form internally. | ||
| - Errors surface as `CryptoOnrampError` / `CryptoOnrampErrorCode`. | ||
| **@ton/appkit** | ||
| - Actions: `getCryptoOnrampProvider`, `getCryptoOnrampProviders`, `watchCryptoOnrampProviders`, `setDefaultCryptoOnrampProvider`, `getCryptoOnrampQuote`, `createCryptoOnrampDeposit`, `getCryptoOnrampStatus`, `getCryptoOnrampSupportedCurrencies`, `getCryptoOnrampProviderMetadata`. | ||
| - Matching TanStack Query helpers for quote, status and supported currencies, plus a deposit mutation. | ||
| - Built-in providers ship as tree-shakeable subpath imports: `@ton/appkit/crypto-onramp/layerswap` (`createLayerswapProvider`) and `@ton/appkit/crypto-onramp/decent` (`createDecentProvider`). | ||
| **@ton/appkit-react** | ||
| - `CryptoOnrampWidget` — a drop-in buy flow, with the headless `CryptoOnrampWidgetProvider` / context for fully custom UIs. Covers token + payment-method selection with network filters, amount input (with reversed/target-amount entry where the provider supports it), live quote, deposit address + status polling, a refund-address modal driven by the provider's `refundAddressMode`, a provider settings modal, and empty/loading states. | ||
| - Hooks: `useCryptoOnrampProviders`, `useCryptoOnrampProvider`, `useCryptoOnrampProviderById`, `useCryptoOnrampQuote`, `useCreateCryptoOnrampDeposit`, `useCryptoOnrampStatus`, `useCryptoOnrampSupportedCurrencies`, `useCryptoOnrampProviderMetadata`. | ||
| - 438588e: Add support for custom providers — third-party providers (`type: 'custom'`) that expose their own methods rather than an SDK-defined API. Register one with `registerProvider`, then retrieve it by id; pass the expected type as a generic argument to narrow the result. | ||
| **@ton/walletkit** | ||
| - New `CustomProvidersManager` (keyed by `providerId`) and the `CustomProvider` interface, both exported from the package root. | ||
| - Custom providers are registered through the existing `registerProvider` flow and reachable via the `customProviders` getter on the kit. | ||
| - `getProvider<T extends CustomProvider>(id)` returns the registered provider (or `undefined`), narrowed to `T`. | ||
| **@ton/appkit** | ||
| - New `getCustomProvider(appKit, { id })` action, returning the provider narrowed to the generic type argument, and `watchCustomProviders(appKit, { onChange })` to react to registrations. | ||
| - Re-exports the `CustomProvider` type and exposes `customProvidersManager` on `AppKit`. | ||
| **@ton/appkit-react** | ||
| - New `useCustomProvider<T>(id)` hook — reads a custom provider by id and re-renders when custom providers are registered. | ||
| - f04e34f: Expose advanced transfer parameters on the jetton, NFT and TON transfer actions (and their hooks `useTransferJetton` / `useTransferNft`). | ||
| - **Jetton transfer** (`transferJetton` / `createTransferJettonTransaction`): added `queryId`, `forwardAmount`, `forwardPayload`, `customPayload` and `gasAmount`. A raw `forwardPayload` takes priority over `comment`. | ||
| - **NFT transfer** (`transferNft` / `createTransferNftTransaction`): added `queryId`, `forwardAmount`, `forwardPayload`, `customPayload` and `responseDestination`, with the same `forwardPayload` / `comment` precedence. | ||
| - **TON transfer** (`createTransferTonTransaction`): added `extraCurrency`. | ||
| All new fields are optional — omitting them preserves the previous behaviour. Payload fields (`forwardPayload`, `customPayload`) are Base64-encoded cells; `queryId`, `forwardAmount` and `gasAmount` are nanoton / uint strings. `mode` is intentionally not exposed (it is not carried over TonConnect). | ||
| **BREAKING:** the NFT transfer `amount` field is renamed to `gasAmount` — the TON (in nanotons) attached for gas — to remove the ambiguity with a token quantity and to match the jetton transfer. Replace `{ amount }` with `{ gasAmount }` in `createTransferNftTransaction` / `transferNft` / `useTransferNft` calls. | ||
| ### Patch Changes | ||
| - Updated dependencies [68f4abb] | ||
| - Updated dependencies [438588e] | ||
| - Updated dependencies [82fa071] | ||
| - @ton/walletkit@1.1.0-beta.0 | ||
| ## 1.0.0 | ||
@@ -4,0 +64,0 @@ |
+1
-1
@@ -6,3 +6,3 @@ # CLAUDE.md — appkit | ||
| - All file names must be in kebab-case. | ||
| - For creating new actions and hooks, use the `add-action-and-hook` skill. | ||
| - For creating new actions and hooks, use the `kit-dev` skill. | ||
@@ -9,0 +9,0 @@ ## Imports from walletkit |
@@ -42,3 +42,3 @@ /** | ||
| * The jetton `responseDestination` (excess receiver) is set to the relayer's | ||
| * address — the relayer paid the gas, so the unspent TON goes back to it rather | ||
| * address — the relayer paid the gas, so the unspent GRAM goes back to it rather | ||
| * than to the user's wallet. | ||
@@ -45,0 +45,0 @@ * |
@@ -24,3 +24,3 @@ "use strict"; | ||
| * The jetton `responseDestination` (excess receiver) is set to the relayer's | ||
| * address — the relayer paid the gas, so the unspent TON goes back to it rather | ||
| * address — the relayer paid the gas, so the unspent GRAM goes back to it rather | ||
| * than to the user's wallet. | ||
@@ -27,0 +27,0 @@ * |
@@ -19,2 +19,11 @@ /** | ||
| export { watchConnectorById, type WatchConnectorByIdParameters, type WatchConnectorByIdReturnType, } from './connectors/watch-connector-by-id'; | ||
| export { getCryptoOnrampProvider, type GetCryptoOnrampProviderOptions, type GetCryptoOnrampProviderReturnType, } from './crypto-onramp/get-crypto-onramp-provider'; | ||
| export { getCryptoOnrampProviders, type GetCryptoOnrampProvidersReturnType, } from './crypto-onramp/get-crypto-onramp-providers'; | ||
| export { watchCryptoOnrampProviders, type WatchCryptoOnrampProvidersParameters, type WatchCryptoOnrampProvidersReturnType, } from './crypto-onramp/watch-crypto-onramp-providers'; | ||
| export { getCryptoOnrampQuote, type GetCryptoOnrampQuoteOptions, type GetCryptoOnrampQuoteReturnType, } from './crypto-onramp/get-crypto-onramp-quote'; | ||
| export { createCryptoOnrampDeposit, type CreateCryptoOnrampDepositOptions, type CreateCryptoOnrampDepositReturnType, } from './crypto-onramp/create-crypto-onramp-deposit'; | ||
| export { getCryptoOnrampStatus, type GetCryptoOnrampStatusOptions, type GetCryptoOnrampStatusReturnType, } from './crypto-onramp/get-crypto-onramp-status'; | ||
| export { setDefaultCryptoOnrampProvider, type SetDefaultCryptoOnrampProviderParameters, type SetDefaultCryptoOnrampProviderReturnType, } from './crypto-onramp/set-default-crypto-onramp-provider'; | ||
| export { getCryptoOnrampSupportedCurrencies, type GetCryptoOnrampSupportedCurrenciesOptions, type GetCryptoOnrampSupportedCurrenciesReturnType, } from './crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| export { getCryptoOnrampProviderMetadata, type GetCryptoOnrampProviderMetadataOptions, type GetCryptoOnrampProviderMetadataReturnType, } from './crypto-onramp/get-crypto-onramp-provider-metadata'; | ||
| export { getJettonInfo, type GetJettonInfoOptions, type GetJettonInfoReturnType } from './jettons/get-jetton-info'; | ||
@@ -43,2 +52,4 @@ export { getJettonWalletAddress, type GetJettonWalletAddressOptions, type GetJettonWalletAddressReturnType, } from './jettons/get-jetton-wallet-address'; | ||
| export { registerProvider, type RegisterProviderOptions } from './providers/register-provider'; | ||
| export { getCustomProvider, type GetCustomProviderOptions, type GetCustomProviderReturnType, } from './providers/get-custom-provider'; | ||
| export { watchCustomProviders, type WatchCustomProvidersParameters, type WatchCustomProvidersReturnType, } from './providers/watch-custom-providers'; | ||
| export { getGaslessManager, type GetGaslessManagerReturnType } from './gasless/get-gasless-manager'; | ||
@@ -45,0 +56,0 @@ export { getGaslessProvider, type GetGaslessProviderOptions, type GetGaslessProviderReturnType, } from './gasless/get-gasless-provider'; |
@@ -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,EACH,qBAAqB,EACrB,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,GACvC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAG/G,OAAO,EAAE,YAAY,EAAE,KAAK,sBAAs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K,6BAA6B,EAClC,KAAK,6BAA6B,GACrC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,KAAK,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACjH,OAAO,EACH,uBAAuB,EACvB,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,GACzC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,qBAAqB,EACrB,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,GACvC,MAAM,mCAAmC,CAAC"} |
@@ -10,4 +10,4 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getSwapProviders = exports.getSwapProvider = exports.getSwapManager = exports.signCell = exports.signBinary = exports.signText = exports.sendGaslessTransaction = exports.getGaslessJettonTransferQuote = exports.getGaslessQuote = exports.getGaslessProviderMetadata = exports.getGaslessConfig = exports.watchGaslessProviders = exports.setDefaultGaslessProvider = exports.getGaslessProviders = exports.getGaslessProvider = exports.getGaslessManager = 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.watchSignMessageSupport = exports.getSignMessageSupport = exports.watchSelectedWallet = exports.setSelectedWalletId = exports.getSelectedWallet = exports.getConnectedWallets = exports.createTransferTonTransaction = exports.createTransferNftTransaction = exports.watchTransactions = exports.watchTransactionsByAddress = exports.getTransactionStatus = exports.transferTon = exports.signMessage = exports.sendTransaction = exports.getStakingProviderMetadata = exports.getStakingProviderInfo = exports.getStakedBalance = exports.buildStakeTransaction = exports.getStakingQuote = exports.watchStakingProviders = exports.setDefaultStakingProvider = exports.getStakingProvider = exports.getStakingProviders = exports.getStakingManager = exports.buildSwapTransaction = exports.watchSwapProviders = exports.getSwapQuote = exports.setDefaultSwapProvider = void 0; | ||
| exports.watchGaslessProviders = exports.setDefaultGaslessProvider = exports.getGaslessProviders = exports.getGaslessProvider = exports.getGaslessManager = exports.watchCustomProviders = exports.getCustomProvider = 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.getCryptoOnrampProviderMetadata = exports.getCryptoOnrampSupportedCurrencies = exports.setDefaultCryptoOnrampProvider = exports.getCryptoOnrampStatus = exports.createCryptoOnrampDeposit = exports.getCryptoOnrampQuote = exports.watchCryptoOnrampProviders = exports.getCryptoOnrampProviders = exports.getCryptoOnrampProvider = 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.watchSignMessageSupport = exports.getSignMessageSupport = exports.watchSelectedWallet = exports.setSelectedWalletId = exports.getSelectedWallet = exports.getConnectedWallets = exports.createTransferTonTransaction = exports.createTransferNftTransaction = exports.watchTransactions = exports.watchTransactionsByAddress = exports.getTransactionStatus = exports.transferTon = exports.signMessage = exports.sendTransaction = exports.getStakingProviderMetadata = exports.getStakingProviderInfo = exports.getStakedBalance = exports.buildStakeTransaction = exports.getStakingQuote = exports.watchStakingProviders = exports.setDefaultStakingProvider = exports.getStakingProvider = exports.getStakingProviders = exports.getStakingManager = exports.buildSwapTransaction = exports.watchSwapProviders = exports.getSwapQuote = exports.setDefaultSwapProvider = exports.getSwapProviders = exports.getSwapProvider = exports.getSwapManager = exports.signCell = exports.signBinary = exports.signText = exports.sendGaslessTransaction = exports.getGaslessJettonTransferQuote = exports.getGaslessQuote = exports.getGaslessProviderMetadata = exports.getGaslessConfig = void 0; | ||
| // Balances | ||
@@ -37,2 +37,21 @@ var get_balance_by_address_1 = require("./balances/get-balance-by-address"); | ||
| Object.defineProperty(exports, "watchConnectorById", { enumerable: true, get: function () { return watch_connector_by_id_1.watchConnectorById; } }); | ||
| // Crypto onramp | ||
| var get_crypto_onramp_provider_1 = require("./crypto-onramp/get-crypto-onramp-provider"); | ||
| Object.defineProperty(exports, "getCryptoOnrampProvider", { enumerable: true, get: function () { return get_crypto_onramp_provider_1.getCryptoOnrampProvider; } }); | ||
| var get_crypto_onramp_providers_1 = require("./crypto-onramp/get-crypto-onramp-providers"); | ||
| Object.defineProperty(exports, "getCryptoOnrampProviders", { enumerable: true, get: function () { return get_crypto_onramp_providers_1.getCryptoOnrampProviders; } }); | ||
| var watch_crypto_onramp_providers_1 = require("./crypto-onramp/watch-crypto-onramp-providers"); | ||
| Object.defineProperty(exports, "watchCryptoOnrampProviders", { enumerable: true, get: function () { return watch_crypto_onramp_providers_1.watchCryptoOnrampProviders; } }); | ||
| var get_crypto_onramp_quote_1 = require("./crypto-onramp/get-crypto-onramp-quote"); | ||
| Object.defineProperty(exports, "getCryptoOnrampQuote", { enumerable: true, get: function () { return get_crypto_onramp_quote_1.getCryptoOnrampQuote; } }); | ||
| var create_crypto_onramp_deposit_1 = require("./crypto-onramp/create-crypto-onramp-deposit"); | ||
| Object.defineProperty(exports, "createCryptoOnrampDeposit", { enumerable: true, get: function () { return create_crypto_onramp_deposit_1.createCryptoOnrampDeposit; } }); | ||
| var get_crypto_onramp_status_1 = require("./crypto-onramp/get-crypto-onramp-status"); | ||
| Object.defineProperty(exports, "getCryptoOnrampStatus", { enumerable: true, get: function () { return get_crypto_onramp_status_1.getCryptoOnrampStatus; } }); | ||
| var set_default_crypto_onramp_provider_1 = require("./crypto-onramp/set-default-crypto-onramp-provider"); | ||
| Object.defineProperty(exports, "setDefaultCryptoOnrampProvider", { enumerable: true, get: function () { return set_default_crypto_onramp_provider_1.setDefaultCryptoOnrampProvider; } }); | ||
| var get_crypto_onramp_supported_currencies_1 = require("./crypto-onramp/get-crypto-onramp-supported-currencies"); | ||
| Object.defineProperty(exports, "getCryptoOnrampSupportedCurrencies", { enumerable: true, get: function () { return get_crypto_onramp_supported_currencies_1.getCryptoOnrampSupportedCurrencies; } }); | ||
| var get_crypto_onramp_provider_metadata_1 = require("./crypto-onramp/get-crypto-onramp-provider-metadata"); | ||
| Object.defineProperty(exports, "getCryptoOnrampProviderMetadata", { enumerable: true, get: function () { return get_crypto_onramp_provider_metadata_1.getCryptoOnrampProviderMetadata; } }); | ||
| // Jettons | ||
@@ -88,2 +107,6 @@ var get_jetton_info_1 = require("./jettons/get-jetton-info"); | ||
| Object.defineProperty(exports, "registerProvider", { enumerable: true, get: function () { return register_provider_1.registerProvider; } }); | ||
| var get_custom_provider_1 = require("./providers/get-custom-provider"); | ||
| Object.defineProperty(exports, "getCustomProvider", { enumerable: true, get: function () { return get_custom_provider_1.getCustomProvider; } }); | ||
| var watch_custom_providers_1 = require("./providers/watch-custom-providers"); | ||
| Object.defineProperty(exports, "watchCustomProviders", { enumerable: true, get: function () { return watch_custom_providers_1.watchCustomProviders; } }); | ||
| // Gasless | ||
@@ -90,0 +113,0 @@ var get_gasless_manager_1 = require("./gasless/get-gasless-manager"); |
@@ -9,2 +9,3 @@ /** | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { Base64String } from '../../types/primitives'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -18,2 +19,7 @@ export interface CreateTransferJettonTransactionParameters { | ||
| responseDestination?: string; | ||
| queryId?: string; | ||
| forwardAmount?: string; | ||
| forwardPayload?: Base64String; | ||
| customPayload?: Base64String; | ||
| gasAmount?: string; | ||
| } | ||
@@ -20,0 +26,0 @@ export type CreateTransferJettonTransactionReturnType = TransactionRequest; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-transfer-jetton-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/create-transfer-jetton-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,yCAAyC;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,yCAAyC,GAAG,kBAAkB,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,+BAA+B,GACxC,QAAQ,MAAM,EACd,YAAY,yCAAyC,KACtD,OAAO,CAAC,yCAAyC,CA4CnD,CAAC"} | ||
| {"version":3,"file":"create-transfer-jetton-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/create-transfer-jetton-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,KAAK,EAAE,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,yCAAyC;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,yCAAyC,GAAG,kBAAkB,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,+BAA+B,GACxC,QAAQ,MAAM,EACd,YAAY,yCAAyC,KACtD,OAAO,CAAC,yCAAyC,CA2EnD,CAAC"} |
@@ -11,2 +11,3 @@ "use strict"; | ||
| exports.createTransferJettonTransaction = void 0; | ||
| const core_1 = require("@ton/core"); | ||
| const walletkit_1 = require("@ton/walletkit"); | ||
@@ -20,3 +21,3 @@ const get_selected_wallet_1 = require("../wallets/get-selected-wallet"); | ||
| const createTransferJettonTransaction = async (appKit, parameters) => { | ||
| const { jettonAddress, recipientAddress, amount, jettonDecimals, comment, responseDestination } = parameters; | ||
| const { jettonAddress, recipientAddress, amount, jettonDecimals, comment, responseDestination, queryId, forwardAmount, forwardPayload, customPayload, gasAmount, } = parameters; | ||
| const wallet = (0, get_selected_wallet_1.getSelectedWallet)(appKit); | ||
@@ -40,17 +41,33 @@ if (!wallet) { | ||
| } | ||
| // forwardPayload takes priority, otherwise fall back to a comment payload | ||
| let forwardPayloadCell = null; | ||
| if (forwardPayload) { | ||
| forwardPayloadCell = core_1.Cell.fromBase64(forwardPayload); | ||
| } | ||
| else if (comment) { | ||
| forwardPayloadCell = (0, walletkit_1.createCommentPayload)(comment); | ||
| } | ||
| // Create jetton transfer payload | ||
| const jettonPayload = (0, walletkit_1.createJettonTransferPayload)({ | ||
| const jettonPayload = (0, core_1.beginCell)() | ||
| .store((0, walletkit_1.storeJettonTransferMessage)({ | ||
| queryId: queryId ? BigInt(queryId) : 0n, | ||
| amount: (0, walletkit_1.parseUnits)(amount, decimals), | ||
| destination: recipientAddress, | ||
| responseDestination: responseDestination ?? ownerAddress, | ||
| comment, | ||
| }); | ||
| // Build transaction | ||
| return (0, walletkit_1.createTransferTransaction)({ | ||
| targetAddress: jettonWalletAddress, | ||
| amount: walletkit_1.DEFAULT_JETTON_GAS_FEE, | ||
| payload: jettonPayload, | ||
| destination: core_1.Address.parse(recipientAddress), | ||
| responseDestination: core_1.Address.parse(responseDestination ?? ownerAddress), | ||
| customPayload: customPayload ? core_1.Cell.fromBase64(customPayload) : null, | ||
| forwardAmount: forwardAmount ? BigInt(forwardAmount) : walletkit_1.DEFAULT_FORWARD_AMOUNT, | ||
| forwardPayload: forwardPayloadCell, | ||
| })) | ||
| .endCell(); | ||
| // Build transaction message | ||
| const message = { | ||
| address: jettonWalletAddress, | ||
| amount: gasAmount ?? walletkit_1.DEFAULT_JETTON_GAS_FEE, | ||
| payload: (0, utils_1.asBase64)(jettonPayload.toBoc().toString('base64')), | ||
| }; | ||
| return { | ||
| messages: [message], | ||
| fromAddress: ownerAddress, | ||
| }); | ||
| }; | ||
| }; | ||
| exports.createTransferJettonTransaction = createTransferJettonTransaction; |
@@ -9,2 +9,3 @@ /** | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { Base64String } from '../../types/primitives'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -14,4 +15,9 @@ export interface CreateTransferNftTransactionParameters { | ||
| recipientAddress: string; | ||
| amount?: string; | ||
| comment?: string; | ||
| responseDestination?: string; | ||
| queryId?: string; | ||
| forwardAmount?: string; | ||
| forwardPayload?: Base64String; | ||
| customPayload?: Base64String; | ||
| gasAmount?: string; | ||
| } | ||
@@ -18,0 +24,0 @@ export type CreateTransferNftTransactionReturnType = TransactionRequest; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-transfer-nft-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/nft/create-transfer-nft-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,sCAAsC;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,sCAAsC,GAAG,kBAAkB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACrC,QAAQ,MAAM,EACd,YAAY,sCAAsC,KACnD,OAAO,CAAC,sCAAsC,CAqBhD,CAAC"} | ||
| {"version":3,"file":"create-transfer-nft-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/nft/create-transfer-nft-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,OAAO,KAAK,EAAE,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MAAM,WAAW,sCAAsC;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,sCAAsC,GAAG,kBAAkB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACrC,QAAQ,MAAM,EACd,YAAY,sCAAsC,KACnD,OAAO,CAAC,sCAAsC,CAsDhD,CAAC"} |
@@ -11,4 +11,6 @@ "use strict"; | ||
| exports.createTransferNftTransaction = void 0; | ||
| const core_1 = require("@ton/core"); | ||
| const walletkit_1 = require("@ton/walletkit"); | ||
| const get_selected_wallet_1 = require("../wallets/get-selected-wallet"); | ||
| const utils_1 = require("../../utils"); | ||
| /** | ||
@@ -18,3 +20,3 @@ * Create a NFT transfer transaction request | ||
| const createTransferNftTransaction = async (appKit, parameters) => { | ||
| const { nftAddress, recipientAddress, amount, comment } = parameters; | ||
| const { nftAddress, recipientAddress, comment, responseDestination, queryId, forwardAmount, forwardPayload, customPayload, gasAmount, } = parameters; | ||
| const wallet = (0, get_selected_wallet_1.getSelectedWallet)(appKit); | ||
@@ -24,14 +26,33 @@ if (!wallet) { | ||
| } | ||
| const payload = (0, walletkit_1.createNftTransferPayload)({ | ||
| newOwner: recipientAddress, | ||
| responseDestination: wallet.getAddress(), | ||
| comment, | ||
| }); | ||
| return (0, walletkit_1.createTransferTransaction)({ | ||
| targetAddress: nftAddress, | ||
| amount: amount ?? walletkit_1.DEFAULT_NFT_GAS_FEE, | ||
| payload, | ||
| fromAddress: wallet.getAddress(), | ||
| }); | ||
| const ownerAddress = wallet.getAddress(); | ||
| // forwardPayload takes priority, otherwise fall back to a comment payload | ||
| let forwardPayloadCell = null; | ||
| if (forwardPayload) { | ||
| forwardPayloadCell = core_1.Cell.fromBase64(forwardPayload); | ||
| } | ||
| else if (comment) { | ||
| forwardPayloadCell = (0, walletkit_1.createCommentPayload)(comment); | ||
| } | ||
| // Create NFT transfer payload | ||
| const nftPayload = (0, core_1.beginCell)() | ||
| .store((0, walletkit_1.storeNftTransferMessage)({ | ||
| queryId: queryId ? BigInt(queryId) : 0n, | ||
| newOwner: core_1.Address.parse(recipientAddress), | ||
| responseDestination: core_1.Address.parse(responseDestination ?? ownerAddress), | ||
| customPayload: customPayload ? core_1.Cell.fromBase64(customPayload) : null, | ||
| forwardAmount: forwardAmount ? BigInt(forwardAmount) : walletkit_1.DEFAULT_FORWARD_AMOUNT, | ||
| forwardPayload: forwardPayloadCell, | ||
| })) | ||
| .endCell(); | ||
| // Build transaction message | ||
| const message = { | ||
| address: nftAddress, | ||
| amount: gasAmount ?? walletkit_1.DEFAULT_NFT_GAS_FEE, | ||
| payload: (0, utils_1.asBase64)(nftPayload.toBoc().toString('base64')), | ||
| }; | ||
| return { | ||
| messages: [message], | ||
| fromAddress: ownerAddress, | ||
| }; | ||
| }; | ||
| exports.createTransferNftTransaction = createTransferNftTransaction; |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { TransactionRequest, ExtraCurrencies } from '../../types/transaction'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -22,8 +22,10 @@ export interface CreateTransferTonTransactionParameters { | ||
| stateInit?: string; | ||
| /** Additional currencies to include in the transfer */ | ||
| extraCurrency?: ExtraCurrencies; | ||
| } | ||
| export type CreateTransferTonTransactionReturnType = TransactionRequest; | ||
| /** | ||
| * Create a TON transfer transaction request | ||
| * Create a GRAM transfer transaction request | ||
| */ | ||
| export declare const createTransferTonTransaction: (appKit: AppKit, parameters: CreateTransferTonTransactionParameters) => CreateTransferTonTransactionReturnType; | ||
| //# sourceMappingURL=create-transfer-ton-transaction.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-transfer-ton-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/create-transfer-ton-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AAE7F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,sCAAsC;IACnD,wBAAwB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,sCAAsC,GAAG,kBAAkB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACrC,QAAQ,MAAM,EACd,YAAY,sCAAsC,KACnD,sCA2BF,CAAC"} | ||
| {"version":3,"file":"create-transfer-ton-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/create-transfer-ton-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAA6B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE9G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,sCAAsC;IACnD,wBAAwB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,aAAa,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,MAAM,sCAAsC,GAAG,kBAAkB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACrC,QAAQ,MAAM,EACd,YAAY,sCAAsC,KACnD,sCA4BF,CAAC"} |
@@ -15,6 +15,6 @@ "use strict"; | ||
| /** | ||
| * Create a TON transfer transaction request | ||
| * Create a GRAM transfer transaction request | ||
| */ | ||
| const createTransferTonTransaction = (appKit, parameters) => { | ||
| const { recipientAddress, amount, comment, payload, stateInit } = parameters; | ||
| const { recipientAddress, amount, comment, payload, stateInit, extraCurrency } = parameters; | ||
| const wallet = (0, get_selected_wallet_1.getSelectedWallet)(appKit); | ||
@@ -28,2 +28,3 @@ if (!wallet) { | ||
| stateInit: stateInit ? (0, utils_1.asBase64)(stateInit) : undefined, | ||
| extraCurrency, | ||
| }; | ||
@@ -30,0 +31,0 @@ // Payload takes priority, otherwise use comment |
@@ -15,5 +15,5 @@ /** | ||
| /** | ||
| * Transfer TON - creates and sends a TON transfer transaction | ||
| * Transfer GRAM - creates and sends a GRAM transfer transaction | ||
| */ | ||
| export declare const transferTon: (appKit: AppKit, parameters: TransferTonParameters) => Promise<TransferTonReturnType>; | ||
| //# sourceMappingURL=transfer-ton.d.ts.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
| /** | ||
| * Transfer TON - creates and sends a TON transfer transaction | ||
| * Transfer GRAM - creates and sends a GRAM transfer transaction | ||
| */ | ||
@@ -17,0 +17,0 @@ const transferTon = async (appKit, parameters) => { |
@@ -47,3 +47,3 @@ "use strict"; | ||
| }; | ||
| function getConnectedWallets() { | ||
| const getConnectedWallets = () => { | ||
| const ui = getTonConnectUI(); | ||
@@ -61,4 +61,4 @@ if (ui && ui.connected && ui.wallet) { | ||
| return []; | ||
| } | ||
| function setupListeners() { | ||
| }; | ||
| const setupListeners = () => { | ||
| if (!originalTonConnectUI || unsubscribeTonConnect) { | ||
@@ -77,3 +77,3 @@ return; | ||
| }); | ||
| } | ||
| }; | ||
| return { | ||
@@ -80,0 +80,0 @@ id, |
@@ -17,7 +17,7 @@ /** | ||
| */ | ||
| export declare function toTonConnectTransaction(request: TransactionRequest): SendTransactionRequest; | ||
| export declare const toTonConnectTransaction: (request: TransactionRequest) => SendTransactionRequest; | ||
| /** | ||
| * Convert a single TransactionRequestMessage to TonConnect message format | ||
| */ | ||
| export declare function toTonConnectMessage(msg: TransactionRequestMessage): { | ||
| export declare const toTonConnectMessage: (msg: TransactionRequestMessage) => { | ||
| address: string; | ||
@@ -31,3 +31,3 @@ amount: string; | ||
| */ | ||
| export declare function getValidUntil(validitySeconds?: number): number; | ||
| export declare const getValidUntil: (validitySeconds?: number) => number; | ||
| //# sourceMappingURL=transaction.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../../src/connectors/tonconnect/utils/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAExD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,GAAG,sBAAsB,CAK3F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,yBAAyB,GAAG;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAOA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,eAAe,SAAuC,GAAG,MAAM,CAE5F"} | ||
| {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../../src/connectors/tonconnect/utils/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,kBAAkB,KAAG,sBAKrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC5B,KAAK,yBAAyB,KAC/B;IACC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CAQtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,wBAAsD,KAAG,MAEtF,CAAC"} |
@@ -10,6 +10,3 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.DEFAULT_TRANSACTION_VALIDITY_SECONDS = void 0; | ||
| exports.toTonConnectTransaction = toTonConnectTransaction; | ||
| exports.toTonConnectMessage = toTonConnectMessage; | ||
| exports.getValidUntil = getValidUntil; | ||
| exports.getValidUntil = exports.toTonConnectMessage = exports.toTonConnectTransaction = exports.DEFAULT_TRANSACTION_VALIDITY_SECONDS = void 0; | ||
| /** | ||
@@ -22,12 +19,13 @@ * Default transaction validity duration in seconds (5 minutes) | ||
| */ | ||
| function toTonConnectTransaction(request) { | ||
| const toTonConnectTransaction = (request) => { | ||
| return { | ||
| validUntil: request.validUntil ?? Math.floor(Date.now() / 1000) + exports.DEFAULT_TRANSACTION_VALIDITY_SECONDS, | ||
| messages: request.messages.map(toTonConnectMessage), | ||
| messages: request.messages.map(exports.toTonConnectMessage), | ||
| }; | ||
| } | ||
| }; | ||
| exports.toTonConnectTransaction = toTonConnectTransaction; | ||
| /** | ||
| * Convert a single TransactionRequestMessage to TonConnect message format | ||
| */ | ||
| function toTonConnectMessage(msg) { | ||
| const toTonConnectMessage = (msg) => { | ||
| return { | ||
@@ -39,8 +37,10 @@ address: msg.address, | ||
| }; | ||
| } | ||
| }; | ||
| exports.toTonConnectMessage = toTonConnectMessage; | ||
| /** | ||
| * Get current timestamp plus validity duration | ||
| */ | ||
| function getValidUntil(validitySeconds = exports.DEFAULT_TRANSACTION_VALIDITY_SECONDS) { | ||
| const getValidUntil = (validitySeconds = exports.DEFAULT_TRANSACTION_VALIDITY_SECONDS) => { | ||
| return Math.floor(Date.now() / 1000) + validitySeconds; | ||
| } | ||
| }; | ||
| exports.getValidUntil = getValidUntil; |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| import { SwapManager, StreamingManager } from '@ton/walletkit'; | ||
| import { SwapManager, StreamingManager, CryptoOnrampManager } from '@ton/walletkit'; | ||
| import type { ProviderInput } from '@ton/walletkit'; | ||
@@ -20,2 +20,3 @@ import type { AppKitConfig } from '../types/config'; | ||
| import type { AppKitProvider } from '../../../types/provider'; | ||
| import { CustomProvidersManager } from '../../../providers'; | ||
| /** | ||
@@ -31,3 +32,5 @@ * Central hub for wallet management. | ||
| readonly stakingManager: StakingManager; | ||
| readonly cryptoOnrampManager: CryptoOnrampManager; | ||
| readonly gaslessManager: GaslessManager; | ||
| readonly customProvidersManager: CustomProvidersManager; | ||
| readonly networkManager: AppKitNetworkManager; | ||
@@ -34,0 +37,0 @@ readonly streamingManager: StreamingManager; |
@@ -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,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAsE,MAAM,gBAAgB,CAAC;AAExH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEnG,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,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AK,EAAE,cAAc,GAAG,MAAM,IAAI;IAkB/C;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAY3C;;OAEG;IACH,gBAAgB,CAAC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,IAAI;IA0B5D;;OAEG;IACH,OAAO,CAAC,2BAA2B;CAWtC"} |
@@ -20,2 +20,3 @@ "use strict"; | ||
| const cache_1 = require("../../cache"); | ||
| const providers_1 = require("../../../providers"); | ||
| /** | ||
@@ -40,3 +41,5 @@ * Central hub for wallet management. | ||
| this.stakingManager = new staking_1.StakingManager(() => this.createFactoryContext()); | ||
| this.cryptoOnrampManager = new walletkit_1.CryptoOnrampManager(() => this.createFactoryContext()); | ||
| this.gaslessManager = new gasless_1.GaslessManager(() => this.createFactoryContext()); | ||
| this.customProvidersManager = new providers_1.CustomProvidersManager(() => this.createFactoryContext()); | ||
| this.streamingManager = new walletkit_1.StreamingManager(() => this.createFactoryContext()); | ||
@@ -99,2 +102,5 @@ if (config.connectors) { | ||
| break; | ||
| case 'crypto-onramp': | ||
| this.cryptoOnrampManager.registerProvider(provider); | ||
| break; | ||
| case 'streaming': | ||
@@ -106,2 +112,5 @@ this.streamingManager.registerProvider(provider); | ||
| break; | ||
| case 'custom': | ||
| this.customProvidersManager.registerProvider(provider); | ||
| break; | ||
| default: | ||
@@ -108,0 +117,0 @@ throw new Error('Unknown provider type'); |
@@ -34,3 +34,5 @@ /** | ||
| export * from './staking'; | ||
| export * from './crypto-onramp'; | ||
| export * from './gasless'; | ||
| export * from './providers'; | ||
| export * from './actions'; | ||
@@ -37,0 +39,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,cAAc,CAAC;AAC7B,cAAc,g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C;AAGhC,cAAc,SAAS,CAAC"} |
@@ -51,3 +51,5 @@ "use strict"; | ||
| __exportStar(require("./staking"), exports); | ||
| __exportStar(require("./crypto-onramp"), exports); | ||
| __exportStar(require("./gasless"), exports); | ||
| __exportStar(require("./providers"), exports); | ||
| // Actions | ||
@@ -54,0 +56,0 @@ __exportStar(require("./actions"), exports); |
@@ -11,2 +11,6 @@ /** | ||
| export { disconnectMutationOptions, type DisconnectMutationOptions, type DisconnectParameters, type DisconnectReturnType, type DisconnectData, type DisconnectErrorType, type DisconnectOptions, type DisconnectVariables, } from './connectors/disconnect'; | ||
| export { getCryptoOnrampQuoteQueryOptions, type GetCryptoOnrampQuoteQueryConfig, type GetCryptoOnrampQuoteQueryOptions, type GetCryptoOnrampQuoteData, type GetCryptoOnrampQuoteErrorType, type GetCryptoOnrampQuoteQueryFnData, type GetCryptoOnrampQuoteQueryKey, } from './crypto-onramp/get-crypto-onramp-quote'; | ||
| export { getCryptoOnrampStatusQueryOptions, type GetCryptoOnrampStatusQueryConfig, type GetCryptoOnrampStatusQueryOptions, type GetCryptoOnrampStatusData, type GetCryptoOnrampStatusErrorType, type GetCryptoOnrampStatusQueryFnData, type GetCryptoOnrampStatusQueryKey, } from './crypto-onramp/get-crypto-onramp-status'; | ||
| export { createCryptoOnrampDepositMutationOptions, type CreateCryptoOnrampDepositMutationOptions, type CreateCryptoOnrampDepositData, type CreateCryptoOnrampDepositErrorType, type CreateCryptoOnrampDepositVariables, } from './crypto-onramp/create-crypto-onramp-deposit'; | ||
| export { getCryptoOnrampSupportedCurrenciesQueryOptions, type GetCryptoOnrampSupportedCurrenciesQueryConfig, type GetCryptoOnrampSupportedCurrenciesQueryOptions, type GetCryptoOnrampSupportedCurrenciesData, type GetCryptoOnrampSupportedCurrenciesErrorType, type GetCryptoOnrampSupportedCurrenciesQueryFnData, type GetCryptoOnrampSupportedCurrenciesQueryKey, } from './crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| export { getJettonInfoQueryOptions, type GetJettonInfoQueryConfig, type GetJettonInfoData, type GetJettonInfoErrorType, } from './jettons/get-jetton-info'; | ||
@@ -13,0 +17,0 @@ export { getJettonWalletAddressQueryOptions, type GetJettonWalletAddressQueryConfig, type GetJettonWalletAddressData, type GetJettonWalletAddressErrorType, } from './jettons/get-jetton-wallet-address'; |
@@ -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,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,E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,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GACjC,MAAM,gCAAgC,CAAC;AACxC,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,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,gCAAgC,EAChC,KAAK,+BAA+B,EACpC,KAAK,gCAA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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,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,3 +10,3 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getTransactionStatusQueryOptions = exports.signMessageMutationOptions = exports.sendTransactionMutationOptions = exports.transferTonMutationOptions = exports.buildStakeTransactionMutationOptions = exports.getStakingProviderInfoQueryOptions = exports.getStakedBalanceQueryOptions = exports.getStakingQuoteQueryOptions = exports.sendGaslessTransactionMutationOptions = exports.getGaslessJettonTransferQuoteQueryKey = exports.getGaslessJettonTransferQuoteQueryOptions = exports.GASLESS_QUOTE_STALE_TIME_MS = exports.getGaslessQuoteQueryKey = exports.getGaslessQuoteQueryOptions = exports.getGaslessProviderMetadataQueryKey = exports.getGaslessProviderMetadataQueryOptions = exports.getGaslessConfigQueryKey = exports.getGaslessConfigQueryOptions = 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; | ||
| exports.getTransactionStatusQueryOptions = exports.signMessageMutationOptions = exports.sendTransactionMutationOptions = exports.transferTonMutationOptions = exports.buildStakeTransactionMutationOptions = exports.getStakingProviderInfoQueryOptions = exports.getStakedBalanceQueryOptions = exports.getStakingQuoteQueryOptions = exports.sendGaslessTransactionMutationOptions = exports.getGaslessJettonTransferQuoteQueryKey = exports.getGaslessJettonTransferQuoteQueryOptions = exports.GASLESS_QUOTE_STALE_TIME_MS = exports.getGaslessQuoteQueryKey = exports.getGaslessQuoteQueryOptions = exports.getGaslessProviderMetadataQueryKey = exports.getGaslessProviderMetadataQueryOptions = exports.getGaslessConfigQueryKey = exports.getGaslessConfigQueryOptions = 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.getCryptoOnrampSupportedCurrenciesQueryOptions = exports.createCryptoOnrampDepositMutationOptions = exports.getCryptoOnrampStatusQueryOptions = exports.getCryptoOnrampQuoteQueryOptions = exports.disconnectMutationOptions = exports.connectMutationOptions = exports.handleBalanceUpdate = exports.getBalanceByAddressQueryOptions = void 0; | ||
| // Balances | ||
@@ -21,2 +21,11 @@ var get_balance_by_address_1 = require("./balances/get-balance-by-address"); | ||
| Object.defineProperty(exports, "disconnectMutationOptions", { enumerable: true, get: function () { return disconnect_1.disconnectMutationOptions; } }); | ||
| // Crypto onramp | ||
| var get_crypto_onramp_quote_1 = require("./crypto-onramp/get-crypto-onramp-quote"); | ||
| Object.defineProperty(exports, "getCryptoOnrampQuoteQueryOptions", { enumerable: true, get: function () { return get_crypto_onramp_quote_1.getCryptoOnrampQuoteQueryOptions; } }); | ||
| var get_crypto_onramp_status_1 = require("./crypto-onramp/get-crypto-onramp-status"); | ||
| Object.defineProperty(exports, "getCryptoOnrampStatusQueryOptions", { enumerable: true, get: function () { return get_crypto_onramp_status_1.getCryptoOnrampStatusQueryOptions; } }); | ||
| var create_crypto_onramp_deposit_1 = require("./crypto-onramp/create-crypto-onramp-deposit"); | ||
| Object.defineProperty(exports, "createCryptoOnrampDepositMutationOptions", { enumerable: true, get: function () { return create_crypto_onramp_deposit_1.createCryptoOnrampDepositMutationOptions; } }); | ||
| var get_crypto_onramp_supported_currencies_1 = require("./crypto-onramp/get-crypto-onramp-supported-currencies"); | ||
| Object.defineProperty(exports, "getCryptoOnrampSupportedCurrenciesQueryOptions", { enumerable: true, get: function () { return get_crypto_onramp_supported_currencies_1.getCryptoOnrampSupportedCurrenciesQueryOptions; } }); | ||
| // Jettons | ||
@@ -23,0 +32,0 @@ var get_jetton_info_1 = require("./jettons/get-jetton-info"); |
@@ -41,3 +41,3 @@ /** | ||
| /** Helper for creating typed connector factories */ | ||
| export declare function createConnector(factory: ConnectorFactory): ConnectorFactory; | ||
| export declare const 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,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAA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AAI,CAAC,CAAC;IAEhD,0BAA0B;IAC1B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC,4BAA4B;IAC5B,mBAAmB,IAAI,eAAe,EAAE,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,cAAc,EAAE,oBAAoB,CAAC;IACrC,YAAY,EAAE,aAAa,CAAC;CAC/B;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,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,gBAE3D,CAAC"} |
@@ -10,6 +10,7 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.createConnector = createConnector; | ||
| exports.createConnector = void 0; | ||
| /** Helper for creating typed connector factories */ | ||
| function createConnector(factory) { | ||
| const createConnector = (factory) => { | ||
| return factory; | ||
| } | ||
| }; | ||
| exports.createConnector = createConnector; |
@@ -8,7 +8,7 @@ /** | ||
| */ | ||
| import type { SwapProviderInterface, StakingProviderInterface, StreamingProvider, GaslessProviderInterface } from '@ton/walletkit'; | ||
| import type { SwapProviderInterface, StakingProviderInterface, StreamingProvider, CryptoOnrampProviderInterface, GaslessProviderInterface, CustomProvider } from '@ton/walletkit'; | ||
| /** | ||
| * Available provider types in AppKit. | ||
| */ | ||
| export type AppKitProvider = SwapProviderInterface | StakingProviderInterface | StreamingProvider | GaslessProviderInterface; | ||
| export type AppKitProvider = SwapProviderInterface | StakingProviderInterface | StreamingProvider | CryptoOnrampProviderInterface | GaslessProviderInterface | CustomProvider; | ||
| //# 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,EACR,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EAC3B,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,cAAc,GACpB,qBAAqB,GACrB,wBAAwB,GACxB,iBAAiB,GACjB,wBAAwB,CAAC"} | ||
| {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,EACjB,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,cAAc,GACpB,qBAAqB,GACrB,wBAAwB,GACxB,iBAAiB,GACjB,6BAA6B,GAC7B,wBAAwB,GACxB,cAAc,CAAC"} |
@@ -12,2 +12,3 @@ /** | ||
| export type { TransactionStatus } from '@ton/walletkit'; | ||
| export type { ExtraCurrencies } from '@ton/walletkit'; | ||
| export interface TransactionRequest { | ||
@@ -14,0 +15,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/types/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,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@@ -12,3 +12,3 @@ /** | ||
| */ | ||
| export declare function calcFiatValue(amount: string, rate: string | undefined): string; | ||
| export declare const calcFiatValue: (amount: string, rate: string | undefined) => string; | ||
| //# sourceMappingURL=calc-fiat-value.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"calc-fiat-value.d.ts","sourceRoot":"","sources":["../../../../src/utils/amount/calc-fiat-value.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAK9E"} | ||
| {"version":3,"file":"calc-fiat-value.d.ts","sourceRoot":"","sources":["../../../../src/utils/amount/calc-fiat-value.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,MAAM,MAAM,GAAG,SAAS,KAAG,MAKxE,CAAC"} |
@@ -10,3 +10,3 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.calcFiatValue = calcFiatValue; | ||
| exports.calcFiatValue = void 0; | ||
| /** | ||
@@ -16,3 +16,3 @@ * Calculates the fiat value of a token amount. | ||
| */ | ||
| function calcFiatValue(amount, rate) { | ||
| const calcFiatValue = (amount, rate) => { | ||
| if (!rate) | ||
@@ -23,3 +23,4 @@ return '0'; | ||
| return '0'; | ||
| return Number((num * parseFloat(rate)).toFixed(10)).toString(); | ||
| } | ||
| return Number((num * parseFloat(rate)).toFixed(2)).toString(); | ||
| }; | ||
| exports.calcFiatValue = calcFiatValue; |
@@ -29,12 +29,12 @@ "use strict"; | ||
| }); | ||
| (0, vitest_1.it)('should calculate fiat value without rounding', () => { | ||
| (0, vitest_1.it)('should calculate fiat value rounded to 2 decimal places', () => { | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('100', '1.5')).toBe('150'); | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('1', '0.001')).toBe('0.001'); | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('3', '1.005')).toBe('3.015'); | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('1', '0.001')).toBe('0'); | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('10', '1.005')).toBe('10.05'); | ||
| }); | ||
| (0, vitest_1.it)('should handle decimal amounts without rounding', () => { | ||
| (0, vitest_1.it)('should handle decimal amounts rounded to 2 decimal places', () => { | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('0.5', '2')).toBe('1'); | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('1.23456', '100')).toBe('123.456'); | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('2.996876', '1')).toBe('2.996876'); | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('1.23456', '100')).toBe('123.46'); | ||
| (0, vitest_1.expect)((0, calc_fiat_value_1.calcFiatValue)('2.994', '1')).toBe('2.99'); | ||
| }); | ||
| }); |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export declare function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T>; | ||
| export declare const keyBy: <T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K) => Record<K, T>; | ||
| //# sourceMappingURL=key-by.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"key-by.d.ts","sourceRoot":"","sources":["../../../../src/utils/arrays/key-by.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAS/G"} | ||
| {"version":3,"file":"key-by.d.ts","sourceRoot":"","sources":["../../../../src/utils/arrays/key-by.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,CAAC,SAAS,WAAW,EAAE,KAAK,SAAS,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAS9G,CAAC"} |
@@ -10,4 +10,4 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.keyBy = keyBy; | ||
| function keyBy(arr, getKeyFromItem) { | ||
| exports.keyBy = void 0; | ||
| const keyBy = (arr, getKeyFromItem) => { | ||
| const result = {}; | ||
@@ -19,2 +19,3 @@ arr.forEach((item) => { | ||
| return result; | ||
| } | ||
| }; | ||
| exports.keyBy = keyBy; |
@@ -9,4 +9,4 @@ /** | ||
| /** | ||
| * Default TON reserve subtracted from balance when computing the max spendable amount | ||
| * for a native TON operation — leaves room for network fees. 0.1 TON. | ||
| * Default GRAM reserve subtracted from balance when computing the max spendable amount | ||
| * for a native GRAM operation — leaves room for network fees. 0.1 GRAM. | ||
| */ | ||
@@ -23,3 +23,3 @@ export declare const DEFAULT_TON_FEE_RESERVE_NANOS = 100000000n; | ||
| /** | ||
| * TON reserve (in nanos) subtracted from balance when the token is native TON. | ||
| * GRAM reserve (in nanos) subtracted from balance when the token is native GRAM. | ||
| * Ignored for jettons. Defaults to {@link DEFAULT_TON_FEE_RESERVE_NANOS}. | ||
@@ -31,6 +31,6 @@ */ | ||
| * Compute the max spendable amount a user can place into an input when they click MAX. | ||
| * For native TON — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from TON separately). | ||
| * For native GRAM — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from GRAM separately). | ||
| */ | ||
| export declare const calcMaxSpendable: ({ balance, token, feeReserveNanos, }: CalcMaxSpendableParams) => string; | ||
| //# sourceMappingURL=calc-max-spendable.d.ts.map |
@@ -13,4 +13,4 @@ "use strict"; | ||
| /** | ||
| * Default TON reserve subtracted from balance when computing the max spendable amount | ||
| * for a native TON operation — leaves room for network fees. 0.1 TON. | ||
| * Default GRAM reserve subtracted from balance when computing the max spendable amount | ||
| * for a native GRAM operation — leaves room for network fees. 0.1 GRAM. | ||
| */ | ||
@@ -20,4 +20,4 @@ exports.DEFAULT_TON_FEE_RESERVE_NANOS = 100000000n; | ||
| * Compute the max spendable amount a user can place into an input when they click MAX. | ||
| * For native TON — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from TON separately). | ||
| * For native GRAM — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from GRAM separately). | ||
| */ | ||
@@ -24,0 +24,0 @@ const calcMaxSpendable = ({ balance, token, feeReserveNanos = exports.DEFAULT_TON_FEE_RESERVE_NANOS, }) => { |
@@ -9,3 +9,3 @@ /** | ||
| export interface CheckTonBalanceParams { | ||
| /** Outgoing messages of the built transaction — each `amount` is the TON value in nanos. */ | ||
| /** Outgoing messages of the built transaction — each `amount` is the GRAM value in nanos. */ | ||
| messages: Array<{ | ||
@@ -15,15 +15,15 @@ amount: string; | ||
| /** | ||
| * User's TON balance as a decimal string (`formatUnits(balance, 9)` format). | ||
| * User's GRAM balance as a decimal string (`formatUnits(balance, 9)` format). | ||
| * `undefined` means "not loaded yet" — function returns `undefined` (no judgement). | ||
| */ | ||
| tonBalance: string | undefined; | ||
| /** Extra TON headroom on top of total outflow. Caller-supplied — no opinion on default. */ | ||
| /** Extra GRAM headroom on top of total outflow. Caller-supplied — no opinion on default. */ | ||
| gasBufferNanos: bigint; | ||
| } | ||
| export interface TonBalanceShortfall { | ||
| /** Total TON the user wallet must hold for the transaction to land. */ | ||
| /** Total GRAM the user wallet must hold for the transaction to land. */ | ||
| requiredNanos: bigint; | ||
| } | ||
| /** | ||
| * Pure balance check: does the user have enough TON for the built transaction? | ||
| * Pure balance check: does the user have enough GRAM for the built transaction? | ||
| * | ||
@@ -30,0 +30,0 @@ * Returns `undefined` when the balance is sufficient OR when it hasn't loaded |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"check-ton-balance.d.ts","sourceRoot":"","sources":["../../../../src/utils/balance/check-ton-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,qBAAqB;IAClC,4FAA4F;IAC5F,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,2FAA2F;IAC3F,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAChC,uEAAuE;IACvE,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,2CAI7B,qBAAqB,KAAG,mBAAmB,GAAG,SAShD,CAAC"} | ||
| {"version":3,"file":"check-ton-balance.d.ts","sourceRoot":"","sources":["../../../../src/utils/balance/check-ton-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,qBAAqB;IAClC,6FAA6F;IAC7F,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,4FAA4F;IAC5F,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAChC,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,2CAI7B,qBAAqB,KAAG,mBAAmB,GAAG,SAShD,CAAC"} |
@@ -13,3 +13,3 @@ "use strict"; | ||
| /** | ||
| * Pure balance check: does the user have enough TON for the built transaction? | ||
| * Pure balance check: does the user have enough GRAM for the built transaction? | ||
| * | ||
@@ -16,0 +16,0 @@ * Returns `undefined` when the balance is sufficient OR when it hasn't loaded |
@@ -12,7 +12,7 @@ /** | ||
| * Covers quote/gas drift between the current built tx and the one sent after the | ||
| * amount changes. 0.02 TON. | ||
| * amount changes. 0.02 GRAM. | ||
| */ | ||
| export declare const DEFAULT_SAFETY_MARGIN_NANOS = 20000000n; | ||
| export interface CheckTransferBalanceParams extends CheckTonBalanceParams { | ||
| /** The asset being transferred / swapped. TON-from enables the `'reduce'` outcome. */ | ||
| /** The asset being transferred / swapped. GRAM-from enables the `'reduce'` outcome. */ | ||
| fromToken: { | ||
@@ -38,3 +38,3 @@ address: string; | ||
| /** | ||
| * Balance check for user-initiated transfers (send TON / jetton / NFT) and swaps — | ||
| * Balance check for user-initiated transfers (send GRAM / jetton / NFT) and swaps — | ||
| * where the user controls a `fromAmount` and might be able to fix a shortfall by | ||
@@ -45,5 +45,5 @@ * sending less. | ||
| * - `undefined` when balance is sufficient (or unloaded — see {@link checkTonBalance}). | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is TON and the | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is GRAM and the | ||
| * remaining balance can still cover gas — the user can keep going by spending less. | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up TON gas). | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up GRAM gas). | ||
| * | ||
@@ -50,0 +50,0 @@ * Gasless availability is intentionally **not** modelled here — that's a UI policy. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"check-transfer-balance.d.ts","sourceRoot":"","sources":["../../../../src/utils/balance/check-transfer-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,YAAc,CAAC;AAEvD,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACrE,sFAAsF;IACtF,SAAS,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,iBAAiB,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GACtE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAAI,qFAOlC,0BAA0B,KAAG,iBAAiB,GAAG,SA0BnD,CAAC"} | ||
| {"version":3,"file":"check-transfer-balance.d.ts","sourceRoot":"","sources":["../../../../src/utils/balance/check-transfer-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,YAAc,CAAC;AAEvD,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACrE,uFAAuF;IACvF,SAAS,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,iBAAiB,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GACtE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAAI,qFAOlC,0BAA0B,KAAG,iBAAiB,GAAG,SA0BnD,CAAC"} |
@@ -16,7 +16,7 @@ "use strict"; | ||
| * Covers quote/gas drift between the current built tx and the one sent after the | ||
| * amount changes. 0.02 TON. | ||
| * amount changes. 0.02 GRAM. | ||
| */ | ||
| exports.DEFAULT_SAFETY_MARGIN_NANOS = 20000000n; | ||
| /** | ||
| * Balance check for user-initiated transfers (send TON / jetton / NFT) and swaps — | ||
| * Balance check for user-initiated transfers (send GRAM / jetton / NFT) and swaps — | ||
| * where the user controls a `fromAmount` and might be able to fix a shortfall by | ||
@@ -27,5 +27,5 @@ * sending less. | ||
| * - `undefined` when balance is sufficient (or unloaded — see {@link checkTonBalance}). | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is TON and the | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is GRAM and the | ||
| * remaining balance can still cover gas — the user can keep going by spending less. | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up TON gas). | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up GRAM gas). | ||
| * | ||
@@ -39,5 +39,5 @@ * Gasless availability is intentionally **not** modelled here — that's a UI policy. | ||
| return undefined; | ||
| // Reducing the user's own amount only helps when the outflow is in TON. | ||
| // For jetton / NFT outflow, gas is denominated in TON regardless — reducing | ||
| // the jetton-side input doesn't free up any TON. | ||
| // Reducing the user's own amount only helps when the outflow is in GRAM. | ||
| // For jetton / NFT outflow, gas is denominated in GRAM regardless — reducing | ||
| // the jetton-side input doesn't free up any GRAM. | ||
| if (fromToken.address !== 'ton') { | ||
@@ -44,0 +44,0 @@ return { mode: 'topup', requiredNanos: shortfall.requiredNanos }; |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export declare function mapValues<T extends object, K extends keyof T, V>(object: T, getNewValue: (value: T[K], key: K, obj: T) => V): Record<K, V>; | ||
| export declare const mapValues: <T extends object, K extends keyof T, V>(object: T, getNewValue: (value: T[K], key: K, obj: T) => V) => Record<K, V>; | ||
| //# sourceMappingURL=map-values.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"map-values.d.ts","sourceRoot":"","sources":["../../../../src/utils/object/map-values.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAC5D,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAChD,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAWd"} | ||
| {"version":3,"file":"map-values.d.ts","sourceRoot":"","sources":["../../../../src/utils/object/map-values.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAC5D,QAAQ,CAAC,EACT,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAChD,MAAM,CAAC,CAAC,EAAE,CAAC,CAWb,CAAC"} |
@@ -10,4 +10,4 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.mapValues = mapValues; | ||
| function mapValues(object, getNewValue) { | ||
| exports.mapValues = void 0; | ||
| const mapValues = (object, getNewValue) => { | ||
| const result = {}; | ||
@@ -20,2 +20,3 @@ const keys = Object.keys(object); | ||
| return result; | ||
| } | ||
| }; | ||
| exports.mapValues = mapValues; |
@@ -9,3 +9,3 @@ /** | ||
| import type { Compute } from '../../types/utils'; | ||
| export declare function filterQueryOptions<type extends object>(options: type): Compute<Omit<type, 'query'>>; | ||
| export declare const filterQueryOptions: <type extends object>(options: type) => Compute<Omit<type, "query">>; | ||
| //# sourceMappingURL=filter-query-options.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"filter-query-options.d.ts","sourceRoot":"","sources":["../../../../src/utils/query/filter-query-options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,wBAAgB,kBAAkB,CAAC,IAAI,SAAS,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAInG"} | ||
| {"version":3,"file":"filter-query-options.d.ts","sourceRoot":"","sources":["../../../../src/utils/query/filter-query-options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,kBAAkB,GAAI,IAAI,SAAS,MAAM,EAAE,SAAS,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAIlG,CAAC"} |
@@ -10,6 +10,7 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.filterQueryOptions = filterQueryOptions; | ||
| function filterQueryOptions(options) { | ||
| exports.filterQueryOptions = void 0; | ||
| const filterQueryOptions = (options) => { | ||
| const { query, ...rest } = options; | ||
| return rest; | ||
| } | ||
| }; | ||
| exports.filterQueryOptions = filterQueryOptions; |
@@ -42,3 +42,3 @@ /** | ||
| * The jetton `responseDestination` (excess receiver) is set to the relayer's | ||
| * address — the relayer paid the gas, so the unspent TON goes back to it rather | ||
| * address — the relayer paid the gas, so the unspent GRAM goes back to it rather | ||
| * than to the user's wallet. | ||
@@ -45,0 +45,0 @@ * |
@@ -21,3 +21,3 @@ /** | ||
| * The jetton `responseDestination` (excess receiver) is set to the relayer's | ||
| * address — the relayer paid the gas, so the unspent TON goes back to it rather | ||
| * address — the relayer paid the gas, so the unspent GRAM goes back to it rather | ||
| * than to the user's wallet. | ||
@@ -24,0 +24,0 @@ * |
@@ -19,2 +19,11 @@ /** | ||
| export { watchConnectorById, type WatchConnectorByIdParameters, type WatchConnectorByIdReturnType, } from './connectors/watch-connector-by-id'; | ||
| export { getCryptoOnrampProvider, type GetCryptoOnrampProviderOptions, type GetCryptoOnrampProviderReturnType, } from './crypto-onramp/get-crypto-onramp-provider'; | ||
| export { getCryptoOnrampProviders, type GetCryptoOnrampProvidersReturnType, } from './crypto-onramp/get-crypto-onramp-providers'; | ||
| export { watchCryptoOnrampProviders, type WatchCryptoOnrampProvidersParameters, type WatchCryptoOnrampProvidersReturnType, } from './crypto-onramp/watch-crypto-onramp-providers'; | ||
| export { getCryptoOnrampQuote, type GetCryptoOnrampQuoteOptions, type GetCryptoOnrampQuoteReturnType, } from './crypto-onramp/get-crypto-onramp-quote'; | ||
| export { createCryptoOnrampDeposit, type CreateCryptoOnrampDepositOptions, type CreateCryptoOnrampDepositReturnType, } from './crypto-onramp/create-crypto-onramp-deposit'; | ||
| export { getCryptoOnrampStatus, type GetCryptoOnrampStatusOptions, type GetCryptoOnrampStatusReturnType, } from './crypto-onramp/get-crypto-onramp-status'; | ||
| export { setDefaultCryptoOnrampProvider, type SetDefaultCryptoOnrampProviderParameters, type SetDefaultCryptoOnrampProviderReturnType, } from './crypto-onramp/set-default-crypto-onramp-provider'; | ||
| export { getCryptoOnrampSupportedCurrencies, type GetCryptoOnrampSupportedCurrenciesOptions, type GetCryptoOnrampSupportedCurrenciesReturnType, } from './crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| export { getCryptoOnrampProviderMetadata, type GetCryptoOnrampProviderMetadataOptions, type GetCryptoOnrampProviderMetadataReturnType, } from './crypto-onramp/get-crypto-onramp-provider-metadata'; | ||
| export { getJettonInfo, type GetJettonInfoOptions, type GetJettonInfoReturnType } from './jettons/get-jetton-info'; | ||
@@ -43,2 +52,4 @@ export { getJettonWalletAddress, type GetJettonWalletAddressOptions, type GetJettonWalletAddressReturnType, } from './jettons/get-jetton-wallet-address'; | ||
| export { registerProvider, type RegisterProviderOptions } from './providers/register-provider'; | ||
| export { getCustomProvider, type GetCustomProviderOptions, type GetCustomProviderReturnType, } from './providers/get-custom-provider'; | ||
| export { watchCustomProviders, type WatchCustomProvidersParameters, type WatchCustomProvidersReturnType, } from './providers/watch-custom-providers'; | ||
| export { getGaslessManager, type GetGaslessManagerReturnType } from './gasless/get-gasless-manager'; | ||
@@ -45,0 +56,0 @@ export { getGaslessProvider, type GetGaslessProviderOptions, type GetGaslessProviderReturnType, } from './gasless/get-gasless-provider'; |
@@ -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,EACH,qBAAqB,EACrB,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,GACvC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAG/G,OAAO,EAAE,YAAY,EAAE,KAAK,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpH,OAAO,EAAE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,KAAK,uBAAuB,E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K,+BAA+B,GACvC,MAAM,mCAAmC,CAAC"} |
@@ -21,2 +21,12 @@ /** | ||
| export { watchConnectorById, } from './connectors/watch-connector-by-id'; | ||
| // Crypto onramp | ||
| export { getCryptoOnrampProvider, } from './crypto-onramp/get-crypto-onramp-provider'; | ||
| export { getCryptoOnrampProviders, } from './crypto-onramp/get-crypto-onramp-providers'; | ||
| export { watchCryptoOnrampProviders, } from './crypto-onramp/watch-crypto-onramp-providers'; | ||
| export { getCryptoOnrampQuote, } from './crypto-onramp/get-crypto-onramp-quote'; | ||
| export { createCryptoOnrampDeposit, } from './crypto-onramp/create-crypto-onramp-deposit'; | ||
| export { getCryptoOnrampStatus, } from './crypto-onramp/get-crypto-onramp-status'; | ||
| export { setDefaultCryptoOnrampProvider, } from './crypto-onramp/set-default-crypto-onramp-provider'; | ||
| export { getCryptoOnrampSupportedCurrencies, } from './crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| export { getCryptoOnrampProviderMetadata, } from './crypto-onramp/get-crypto-onramp-provider-metadata'; | ||
| // Jettons | ||
@@ -49,2 +59,4 @@ export { getJettonInfo } from './jettons/get-jetton-info'; | ||
| export { registerProvider } from './providers/register-provider'; | ||
| export { getCustomProvider, } from './providers/get-custom-provider'; | ||
| export { watchCustomProviders, } from './providers/watch-custom-providers'; | ||
| // Gasless | ||
@@ -51,0 +63,0 @@ export { getGaslessManager } from './gasless/get-gasless-manager'; |
@@ -9,2 +9,3 @@ /** | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { Base64String } from '../../types/primitives'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -18,2 +19,7 @@ export interface CreateTransferJettonTransactionParameters { | ||
| responseDestination?: string; | ||
| queryId?: string; | ||
| forwardAmount?: string; | ||
| forwardPayload?: Base64String; | ||
| customPayload?: Base64String; | ||
| gasAmount?: string; | ||
| } | ||
@@ -20,0 +26,0 @@ export type CreateTransferJettonTransactionReturnType = TransactionRequest; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-transfer-jetton-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/create-transfer-jetton-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,yCAAyC;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,yCAAyC,GAAG,kBAAkB,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,+BAA+B,GACxC,QAAQ,MAAM,EACd,YAAY,yCAAyC,KACtD,OAAO,CAAC,yCAAyC,CA4CnD,CAAC"} | ||
| {"version":3,"file":"create-transfer-jetton-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/jettons/create-transfer-jetton-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,KAAK,EAAE,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,WAAW,yCAAyC;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,yCAAyC,GAAG,kBAAkB,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,+BAA+B,GACxC,QAAQ,MAAM,EACd,YAAY,yCAAyC,KACtD,OAAO,CAAC,yCAAyC,CA2EnD,CAAC"} |
@@ -8,6 +8,7 @@ /** | ||
| */ | ||
| import { createJettonTransferPayload, createTransferTransaction, getJettonWalletAddressFromClient, DEFAULT_JETTON_GAS_FEE, parseUnits, } from '@ton/walletkit'; | ||
| import { Address, beginCell, Cell } from '@ton/core'; | ||
| import { storeJettonTransferMessage, createCommentPayload, getJettonWalletAddressFromClient, DEFAULT_JETTON_GAS_FEE, DEFAULT_FORWARD_AMOUNT, parseUnits, } from '@ton/walletkit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { getJettonInfo } from './get-jetton-info'; | ||
| import { isNumber } from '../../utils'; | ||
| import { asBase64, isNumber } from '../../utils'; | ||
| /** | ||
@@ -17,3 +18,3 @@ * Create a Jetton transfer transaction request | ||
| export const createTransferJettonTransaction = async (appKit, parameters) => { | ||
| const { jettonAddress, recipientAddress, amount, jettonDecimals, comment, responseDestination } = parameters; | ||
| const { jettonAddress, recipientAddress, amount, jettonDecimals, comment, responseDestination, queryId, forwardAmount, forwardPayload, customPayload, gasAmount, } = parameters; | ||
| const wallet = getSelectedWallet(appKit); | ||
@@ -37,16 +38,32 @@ if (!wallet) { | ||
| } | ||
| // forwardPayload takes priority, otherwise fall back to a comment payload | ||
| let forwardPayloadCell = null; | ||
| if (forwardPayload) { | ||
| forwardPayloadCell = Cell.fromBase64(forwardPayload); | ||
| } | ||
| else if (comment) { | ||
| forwardPayloadCell = createCommentPayload(comment); | ||
| } | ||
| // Create jetton transfer payload | ||
| const jettonPayload = createJettonTransferPayload({ | ||
| const jettonPayload = beginCell() | ||
| .store(storeJettonTransferMessage({ | ||
| queryId: queryId ? BigInt(queryId) : 0n, | ||
| amount: parseUnits(amount, decimals), | ||
| destination: recipientAddress, | ||
| responseDestination: responseDestination ?? ownerAddress, | ||
| comment, | ||
| }); | ||
| // Build transaction | ||
| return createTransferTransaction({ | ||
| targetAddress: jettonWalletAddress, | ||
| amount: DEFAULT_JETTON_GAS_FEE, | ||
| payload: jettonPayload, | ||
| destination: Address.parse(recipientAddress), | ||
| responseDestination: Address.parse(responseDestination ?? ownerAddress), | ||
| customPayload: customPayload ? Cell.fromBase64(customPayload) : null, | ||
| forwardAmount: forwardAmount ? BigInt(forwardAmount) : DEFAULT_FORWARD_AMOUNT, | ||
| forwardPayload: forwardPayloadCell, | ||
| })) | ||
| .endCell(); | ||
| // Build transaction message | ||
| const message = { | ||
| address: jettonWalletAddress, | ||
| amount: gasAmount ?? DEFAULT_JETTON_GAS_FEE, | ||
| payload: asBase64(jettonPayload.toBoc().toString('base64')), | ||
| }; | ||
| return { | ||
| messages: [message], | ||
| fromAddress: ownerAddress, | ||
| }); | ||
| }; | ||
| }; |
@@ -9,2 +9,3 @@ /** | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { Base64String } from '../../types/primitives'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -14,4 +15,9 @@ export interface CreateTransferNftTransactionParameters { | ||
| recipientAddress: string; | ||
| amount?: string; | ||
| comment?: string; | ||
| responseDestination?: string; | ||
| queryId?: string; | ||
| forwardAmount?: string; | ||
| forwardPayload?: Base64String; | ||
| customPayload?: Base64String; | ||
| gasAmount?: string; | ||
| } | ||
@@ -18,0 +24,0 @@ export type CreateTransferNftTransactionReturnType = TransactionRequest; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-transfer-nft-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/nft/create-transfer-nft-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,sCAAsC;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,sCAAsC,GAAG,kBAAkB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACrC,QAAQ,MAAM,EACd,YAAY,sCAAsC,KACnD,OAAO,CAAC,sCAAsC,CAqBhD,CAAC"} | ||
| {"version":3,"file":"create-transfer-nft-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/nft/create-transfer-nft-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,OAAO,KAAK,EAAE,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MAAM,WAAW,sCAAsC;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,sCAAsC,GAAG,kBAAkB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACrC,QAAQ,MAAM,EACd,YAAY,sCAAsC,KACnD,OAAO,CAAC,sCAAsC,CAsDhD,CAAC"} |
@@ -8,4 +8,6 @@ /** | ||
| */ | ||
| import { createNftTransferPayload, createTransferTransaction, DEFAULT_NFT_GAS_FEE } from '@ton/walletkit'; | ||
| import { Address, beginCell, Cell } from '@ton/core'; | ||
| import { storeNftTransferMessage, createCommentPayload, DEFAULT_NFT_GAS_FEE, DEFAULT_FORWARD_AMOUNT, } from '@ton/walletkit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { asBase64 } from '../../utils'; | ||
| /** | ||
@@ -15,3 +17,3 @@ * Create a NFT transfer transaction request | ||
| export const createTransferNftTransaction = async (appKit, parameters) => { | ||
| const { nftAddress, recipientAddress, amount, comment } = parameters; | ||
| const { nftAddress, recipientAddress, comment, responseDestination, queryId, forwardAmount, forwardPayload, customPayload, gasAmount, } = parameters; | ||
| const wallet = getSelectedWallet(appKit); | ||
@@ -21,13 +23,32 @@ if (!wallet) { | ||
| } | ||
| const payload = createNftTransferPayload({ | ||
| newOwner: recipientAddress, | ||
| responseDestination: wallet.getAddress(), | ||
| comment, | ||
| }); | ||
| return createTransferTransaction({ | ||
| targetAddress: nftAddress, | ||
| amount: amount ?? DEFAULT_NFT_GAS_FEE, | ||
| payload, | ||
| fromAddress: wallet.getAddress(), | ||
| }); | ||
| const ownerAddress = wallet.getAddress(); | ||
| // forwardPayload takes priority, otherwise fall back to a comment payload | ||
| let forwardPayloadCell = null; | ||
| if (forwardPayload) { | ||
| forwardPayloadCell = Cell.fromBase64(forwardPayload); | ||
| } | ||
| else if (comment) { | ||
| forwardPayloadCell = createCommentPayload(comment); | ||
| } | ||
| // Create NFT transfer payload | ||
| const nftPayload = beginCell() | ||
| .store(storeNftTransferMessage({ | ||
| queryId: queryId ? BigInt(queryId) : 0n, | ||
| newOwner: Address.parse(recipientAddress), | ||
| responseDestination: Address.parse(responseDestination ?? ownerAddress), | ||
| customPayload: customPayload ? Cell.fromBase64(customPayload) : null, | ||
| forwardAmount: forwardAmount ? BigInt(forwardAmount) : DEFAULT_FORWARD_AMOUNT, | ||
| forwardPayload: forwardPayloadCell, | ||
| })) | ||
| .endCell(); | ||
| // Build transaction message | ||
| const message = { | ||
| address: nftAddress, | ||
| amount: gasAmount ?? DEFAULT_NFT_GAS_FEE, | ||
| payload: asBase64(nftPayload.toBoc().toString('base64')), | ||
| }; | ||
| return { | ||
| messages: [message], | ||
| fromAddress: ownerAddress, | ||
| }; | ||
| }; |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { TransactionRequest, ExtraCurrencies } from '../../types/transaction'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
@@ -22,8 +22,10 @@ export interface CreateTransferTonTransactionParameters { | ||
| stateInit?: string; | ||
| /** Additional currencies to include in the transfer */ | ||
| extraCurrency?: ExtraCurrencies; | ||
| } | ||
| export type CreateTransferTonTransactionReturnType = TransactionRequest; | ||
| /** | ||
| * Create a TON transfer transaction request | ||
| * Create a GRAM transfer transaction request | ||
| */ | ||
| export declare const createTransferTonTransaction: (appKit: AppKit, parameters: CreateTransferTonTransactionParameters) => CreateTransferTonTransactionReturnType; | ||
| //# sourceMappingURL=create-transfer-ton-transaction.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-transfer-ton-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/create-transfer-ton-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AAE7F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,sCAAsC;IACnD,wBAAwB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,sCAAsC,GAAG,kBAAkB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACrC,QAAQ,MAAM,EACd,YAAY,sCAAsC,KACnD,sCA2BF,CAAC"} | ||
| {"version":3,"file":"create-transfer-ton-transaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/transaction/create-transfer-ton-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAA6B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE9G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,sCAAsC;IACnD,wBAAwB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,aAAa,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,MAAM,sCAAsC,GAAG,kBAAkB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACrC,QAAQ,MAAM,EACd,YAAY,sCAAsC,KACnD,sCA4BF,CAAC"} |
@@ -12,6 +12,6 @@ /** | ||
| /** | ||
| * Create a TON transfer transaction request | ||
| * Create a GRAM transfer transaction request | ||
| */ | ||
| export const createTransferTonTransaction = (appKit, parameters) => { | ||
| const { recipientAddress, amount, comment, payload, stateInit } = parameters; | ||
| const { recipientAddress, amount, comment, payload, stateInit, extraCurrency } = parameters; | ||
| const wallet = getSelectedWallet(appKit); | ||
@@ -25,2 +25,3 @@ if (!wallet) { | ||
| stateInit: stateInit ? asBase64(stateInit) : undefined, | ||
| extraCurrency, | ||
| }; | ||
@@ -27,0 +28,0 @@ // Payload takes priority, otherwise use comment |
@@ -15,5 +15,5 @@ /** | ||
| /** | ||
| * Transfer TON - creates and sends a TON transfer transaction | ||
| * Transfer GRAM - creates and sends a GRAM transfer transaction | ||
| */ | ||
| export declare const transferTon: (appKit: AppKit, parameters: TransferTonParameters) => Promise<TransferTonReturnType>; | ||
| //# sourceMappingURL=transfer-ton.d.ts.map |
@@ -11,3 +11,3 @@ /** | ||
| /** | ||
| * Transfer TON - creates and sends a TON transfer transaction | ||
| * Transfer GRAM - creates and sends a GRAM transfer transaction | ||
| */ | ||
@@ -14,0 +14,0 @@ export const transferTon = async (appKit, parameters) => { |
@@ -44,3 +44,3 @@ /** | ||
| }; | ||
| function getConnectedWallets() { | ||
| const getConnectedWallets = () => { | ||
| const ui = getTonConnectUI(); | ||
@@ -58,4 +58,4 @@ if (ui && ui.connected && ui.wallet) { | ||
| return []; | ||
| } | ||
| function setupListeners() { | ||
| }; | ||
| const setupListeners = () => { | ||
| if (!originalTonConnectUI || unsubscribeTonConnect) { | ||
@@ -74,3 +74,3 @@ return; | ||
| }); | ||
| } | ||
| }; | ||
| return { | ||
@@ -77,0 +77,0 @@ id, |
@@ -17,7 +17,7 @@ /** | ||
| */ | ||
| export declare function toTonConnectTransaction(request: TransactionRequest): SendTransactionRequest; | ||
| export declare const toTonConnectTransaction: (request: TransactionRequest) => SendTransactionRequest; | ||
| /** | ||
| * Convert a single TransactionRequestMessage to TonConnect message format | ||
| */ | ||
| export declare function toTonConnectMessage(msg: TransactionRequestMessage): { | ||
| export declare const toTonConnectMessage: (msg: TransactionRequestMessage) => { | ||
| address: string; | ||
@@ -31,3 +31,3 @@ amount: string; | ||
| */ | ||
| export declare function getValidUntil(validitySeconds?: number): number; | ||
| export declare const getValidUntil: (validitySeconds?: number) => number; | ||
| //# sourceMappingURL=transaction.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../../src/connectors/tonconnect/utils/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAExD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,GAAG,sBAAsB,CAK3F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,yBAAyB,GAAG;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAOA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,eAAe,SAAuC,GAAG,MAAM,CAE5F"} | ||
| {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../../src/connectors/tonconnect/utils/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,kBAAkB,KAAG,sBAKrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC5B,KAAK,yBAAyB,KAC/B;IACC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CAQtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,wBAAsD,KAAG,MAEtF,CAAC"} |
@@ -15,3 +15,3 @@ /** | ||
| */ | ||
| export function toTonConnectTransaction(request) { | ||
| export const toTonConnectTransaction = (request) => { | ||
| return { | ||
@@ -21,7 +21,7 @@ validUntil: request.validUntil ?? Math.floor(Date.now() / 1000) + DEFAULT_TRANSACTION_VALIDITY_SECONDS, | ||
| }; | ||
| } | ||
| }; | ||
| /** | ||
| * Convert a single TransactionRequestMessage to TonConnect message format | ||
| */ | ||
| export function toTonConnectMessage(msg) { | ||
| export const toTonConnectMessage = (msg) => { | ||
| return { | ||
@@ -33,8 +33,8 @@ address: msg.address, | ||
| }; | ||
| } | ||
| }; | ||
| /** | ||
| * Get current timestamp plus validity duration | ||
| */ | ||
| export function getValidUntil(validitySeconds = DEFAULT_TRANSACTION_VALIDITY_SECONDS) { | ||
| export const getValidUntil = (validitySeconds = DEFAULT_TRANSACTION_VALIDITY_SECONDS) => { | ||
| return Math.floor(Date.now() / 1000) + validitySeconds; | ||
| } | ||
| }; |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| import { SwapManager, StreamingManager } from '@ton/walletkit'; | ||
| import { SwapManager, StreamingManager, CryptoOnrampManager } from '@ton/walletkit'; | ||
| import type { ProviderInput } from '@ton/walletkit'; | ||
@@ -20,2 +20,3 @@ import type { AppKitConfig } from '../types/config'; | ||
| import type { AppKitProvider } from '../../../types/provider'; | ||
| import { CustomProvidersManager } from '../../../providers'; | ||
| /** | ||
@@ -31,3 +32,5 @@ * Central hub for wallet management. | ||
| readonly stakingManager: StakingManager; | ||
| readonly cryptoOnrampManager: CryptoOnrampManager; | ||
| readonly gaslessManager: GaslessManager; | ||
| readonly customProvidersManager: CustomProvidersManager; | ||
| readonly networkManager: AppKitNetworkManager; | ||
@@ -34,0 +37,0 @@ readonly streamingManager: StreamingManager; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"app-kit.d.ts","sourceRoot":"","sources":["../../../../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cAAc,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAExD,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;gBAEhB,MAAM,EAAE,YAAY;IAmChC,oBAAoB,IAAI,uBAAuB;IAI/C;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,IAAI;IAkB/C;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAY3C;;OAEG;IACH,gBAAgB,CAAC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,IAAI;IA0B5D;;OAEG;IACH,OAAO,CAAC,2BAA2B;CAWtC"} |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| import { SwapManager, StreamingManager } from '@ton/walletkit'; | ||
| import { SwapManager, StreamingManager, CryptoOnrampManager } from '@ton/walletkit'; | ||
| import { CONNECTOR_EVENTS, WALLETS_EVENTS } from '../constants/events'; | ||
@@ -18,2 +18,3 @@ import { StakingManager } from '../../../staking'; | ||
| import { LruAppKitCache } from '../../cache'; | ||
| import { CustomProvidersManager } from '../../../providers'; | ||
| /** | ||
@@ -38,3 +39,5 @@ * Central hub for wallet management. | ||
| this.stakingManager = new StakingManager(() => this.createFactoryContext()); | ||
| this.cryptoOnrampManager = new CryptoOnrampManager(() => this.createFactoryContext()); | ||
| this.gaslessManager = new GaslessManager(() => this.createFactoryContext()); | ||
| this.customProvidersManager = new CustomProvidersManager(() => this.createFactoryContext()); | ||
| this.streamingManager = new StreamingManager(() => this.createFactoryContext()); | ||
@@ -97,2 +100,5 @@ if (config.connectors) { | ||
| break; | ||
| case 'crypto-onramp': | ||
| this.cryptoOnrampManager.registerProvider(provider); | ||
| break; | ||
| case 'streaming': | ||
@@ -104,2 +110,5 @@ this.streamingManager.registerProvider(provider); | ||
| break; | ||
| case 'custom': | ||
| this.customProvidersManager.registerProvider(provider); | ||
| break; | ||
| default: | ||
@@ -106,0 +115,0 @@ throw new Error('Unknown provider type'); |
@@ -34,3 +34,5 @@ /** | ||
| export * from './staking'; | ||
| export * from './crypto-onramp'; | ||
| export * from './gasless'; | ||
| export * from './providers'; | ||
| export * from './actions'; | ||
@@ -37,0 +39,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,cAAc,CAAC;AAC7B,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;AAC1B,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"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAGH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,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;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAG5B,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"} |
@@ -35,3 +35,5 @@ /** | ||
| export * from './staking'; | ||
| export * from './crypto-onramp'; | ||
| export * from './gasless'; | ||
| export * from './providers'; | ||
| // Actions | ||
@@ -38,0 +40,0 @@ export * from './actions'; |
@@ -11,2 +11,6 @@ /** | ||
| export { disconnectMutationOptions, type DisconnectMutationOptions, type DisconnectParameters, type DisconnectReturnType, type DisconnectData, type DisconnectErrorType, type DisconnectOptions, type DisconnectVariables, } from './connectors/disconnect'; | ||
| export { getCryptoOnrampQuoteQueryOptions, type GetCryptoOnrampQuoteQueryConfig, type GetCryptoOnrampQuoteQueryOptions, type GetCryptoOnrampQuoteData, type GetCryptoOnrampQuoteErrorType, type GetCryptoOnrampQuoteQueryFnData, type GetCryptoOnrampQuoteQueryKey, } from './crypto-onramp/get-crypto-onramp-quote'; | ||
| export { getCryptoOnrampStatusQueryOptions, type GetCryptoOnrampStatusQueryConfig, type GetCryptoOnrampStatusQueryOptions, type GetCryptoOnrampStatusData, type GetCryptoOnrampStatusErrorType, type GetCryptoOnrampStatusQueryFnData, type GetCryptoOnrampStatusQueryKey, } from './crypto-onramp/get-crypto-onramp-status'; | ||
| export { createCryptoOnrampDepositMutationOptions, type CreateCryptoOnrampDepositMutationOptions, type CreateCryptoOnrampDepositData, type CreateCryptoOnrampDepositErrorType, type CreateCryptoOnrampDepositVariables, } from './crypto-onramp/create-crypto-onramp-deposit'; | ||
| export { getCryptoOnrampSupportedCurrenciesQueryOptions, type GetCryptoOnrampSupportedCurrenciesQueryConfig, type GetCryptoOnrampSupportedCurrenciesQueryOptions, type GetCryptoOnrampSupportedCurrenciesData, type GetCryptoOnrampSupportedCurrenciesErrorType, type GetCryptoOnrampSupportedCurrenciesQueryFnData, type GetCryptoOnrampSupportedCurrenciesQueryKey, } from './crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| export { getJettonInfoQueryOptions, type GetJettonInfoQueryConfig, type GetJettonInfoData, type GetJettonInfoErrorType, } from './jettons/get-jetton-info'; | ||
@@ -13,0 +17,0 @@ export { getJettonWalletAddressQueryOptions, type GetJettonWalletAddressQueryConfig, type GetJettonWalletAddressData, type GetJettonWalletAddressErrorType, } from './jettons/get-jetton-wallet-address'; |
@@ -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,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,G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AAoC,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,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,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,GACxC,MAAM,sCAAsC,CAAC"} |
@@ -13,2 +13,7 @@ /** | ||
| export { disconnectMutationOptions, } from './connectors/disconnect'; | ||
| // Crypto onramp | ||
| export { getCryptoOnrampQuoteQueryOptions, } from './crypto-onramp/get-crypto-onramp-quote'; | ||
| export { getCryptoOnrampStatusQueryOptions, } from './crypto-onramp/get-crypto-onramp-status'; | ||
| export { createCryptoOnrampDepositMutationOptions, } from './crypto-onramp/create-crypto-onramp-deposit'; | ||
| export { getCryptoOnrampSupportedCurrenciesQueryOptions, } from './crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| // Jettons | ||
@@ -15,0 +20,0 @@ export { getJettonInfoQueryOptions, } from './jettons/get-jetton-info'; |
@@ -41,3 +41,3 @@ /** | ||
| /** Helper for creating typed connector factories */ | ||
| export declare function createConnector(factory: ConnectorFactory): ConnectorFactory; | ||
| export declare const 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,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,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;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,cAAc,EAAE,oBAAoB,CAAC;IACrC,YAAY,EAAE,aAAa,CAAC;CAC/B;AAED,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,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,GAAI,SAAS,gBAAgB,KAAG,gBAE3D,CAAC"} |
@@ -9,4 +9,4 @@ /** | ||
| /** Helper for creating typed connector factories */ | ||
| export function createConnector(factory) { | ||
| export const createConnector = (factory) => { | ||
| return factory; | ||
| } | ||
| }; |
@@ -8,7 +8,7 @@ /** | ||
| */ | ||
| import type { SwapProviderInterface, StakingProviderInterface, StreamingProvider, GaslessProviderInterface } from '@ton/walletkit'; | ||
| import type { SwapProviderInterface, StakingProviderInterface, StreamingProvider, CryptoOnrampProviderInterface, GaslessProviderInterface, CustomProvider } from '@ton/walletkit'; | ||
| /** | ||
| * Available provider types in AppKit. | ||
| */ | ||
| export type AppKitProvider = SwapProviderInterface | StakingProviderInterface | StreamingProvider | GaslessProviderInterface; | ||
| export type AppKitProvider = SwapProviderInterface | StakingProviderInterface | StreamingProvider | CryptoOnrampProviderInterface | GaslessProviderInterface | CustomProvider; | ||
| //# 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,EACR,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EAC3B,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,cAAc,GACpB,qBAAqB,GACrB,wBAAwB,GACxB,iBAAiB,GACjB,wBAAwB,CAAC"} | ||
| {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,EACjB,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,cAAc,GACpB,qBAAqB,GACrB,wBAAwB,GACxB,iBAAiB,GACjB,6BAA6B,GAC7B,wBAAwB,GACxB,cAAc,CAAC"} |
@@ -12,2 +12,3 @@ /** | ||
| export type { TransactionStatus } from '@ton/walletkit'; | ||
| export type { ExtraCurrencies } from '@ton/walletkit'; | ||
| export interface TransactionRequest { | ||
@@ -14,0 +15,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/types/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CAC1B"} | ||
| {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/types/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CAC1B"} |
@@ -12,3 +12,3 @@ /** | ||
| */ | ||
| export declare function calcFiatValue(amount: string, rate: string | undefined): string; | ||
| export declare const calcFiatValue: (amount: string, rate: string | undefined) => string; | ||
| //# sourceMappingURL=calc-fiat-value.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"calc-fiat-value.d.ts","sourceRoot":"","sources":["../../../../src/utils/amount/calc-fiat-value.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAK9E"} | ||
| {"version":3,"file":"calc-fiat-value.d.ts","sourceRoot":"","sources":["../../../../src/utils/amount/calc-fiat-value.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,MAAM,MAAM,GAAG,SAAS,KAAG,MAKxE,CAAC"} |
@@ -12,3 +12,3 @@ /** | ||
| */ | ||
| export function calcFiatValue(amount, rate) { | ||
| export const calcFiatValue = (amount, rate) => { | ||
| if (!rate) | ||
@@ -19,3 +19,3 @@ return '0'; | ||
| return '0'; | ||
| return Number((num * parseFloat(rate)).toFixed(10)).toString(); | ||
| } | ||
| return Number((num * parseFloat(rate)).toFixed(2)).toString(); | ||
| }; |
@@ -27,12 +27,12 @@ /** | ||
| }); | ||
| it('should calculate fiat value without rounding', () => { | ||
| it('should calculate fiat value rounded to 2 decimal places', () => { | ||
| expect(calcFiatValue('100', '1.5')).toBe('150'); | ||
| expect(calcFiatValue('1', '0.001')).toBe('0.001'); | ||
| expect(calcFiatValue('3', '1.005')).toBe('3.015'); | ||
| expect(calcFiatValue('1', '0.001')).toBe('0'); | ||
| expect(calcFiatValue('10', '1.005')).toBe('10.05'); | ||
| }); | ||
| it('should handle decimal amounts without rounding', () => { | ||
| it('should handle decimal amounts rounded to 2 decimal places', () => { | ||
| expect(calcFiatValue('0.5', '2')).toBe('1'); | ||
| expect(calcFiatValue('1.23456', '100')).toBe('123.456'); | ||
| expect(calcFiatValue('2.996876', '1')).toBe('2.996876'); | ||
| expect(calcFiatValue('1.23456', '100')).toBe('123.46'); | ||
| expect(calcFiatValue('2.994', '1')).toBe('2.99'); | ||
| }); | ||
| }); |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export declare function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T>; | ||
| export declare const keyBy: <T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K) => Record<K, T>; | ||
| //# sourceMappingURL=key-by.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"key-by.d.ts","sourceRoot":"","sources":["../../../../src/utils/arrays/key-by.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAS/G"} | ||
| {"version":3,"file":"key-by.d.ts","sourceRoot":"","sources":["../../../../src/utils/arrays/key-by.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,CAAC,SAAS,WAAW,EAAE,KAAK,SAAS,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAS9G,CAAC"} |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export function keyBy(arr, getKeyFromItem) { | ||
| export const keyBy = (arr, getKeyFromItem) => { | ||
| const result = {}; | ||
@@ -16,2 +16,2 @@ arr.forEach((item) => { | ||
| return result; | ||
| } | ||
| }; |
@@ -9,4 +9,4 @@ /** | ||
| /** | ||
| * Default TON reserve subtracted from balance when computing the max spendable amount | ||
| * for a native TON operation — leaves room for network fees. 0.1 TON. | ||
| * Default GRAM reserve subtracted from balance when computing the max spendable amount | ||
| * for a native GRAM operation — leaves room for network fees. 0.1 GRAM. | ||
| */ | ||
@@ -23,3 +23,3 @@ export declare const DEFAULT_TON_FEE_RESERVE_NANOS = 100000000n; | ||
| /** | ||
| * TON reserve (in nanos) subtracted from balance when the token is native TON. | ||
| * GRAM reserve (in nanos) subtracted from balance when the token is native GRAM. | ||
| * Ignored for jettons. Defaults to {@link DEFAULT_TON_FEE_RESERVE_NANOS}. | ||
@@ -31,6 +31,6 @@ */ | ||
| * Compute the max spendable amount a user can place into an input when they click MAX. | ||
| * For native TON — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from TON separately). | ||
| * For native GRAM — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from GRAM separately). | ||
| */ | ||
| export declare const calcMaxSpendable: ({ balance, token, feeReserveNanos, }: CalcMaxSpendableParams) => string; | ||
| //# sourceMappingURL=calc-max-spendable.d.ts.map |
@@ -10,4 +10,4 @@ /** | ||
| /** | ||
| * Default TON reserve subtracted from balance when computing the max spendable amount | ||
| * for a native TON operation — leaves room for network fees. 0.1 TON. | ||
| * Default GRAM reserve subtracted from balance when computing the max spendable amount | ||
| * for a native GRAM operation — leaves room for network fees. 0.1 GRAM. | ||
| */ | ||
@@ -17,4 +17,4 @@ export const DEFAULT_TON_FEE_RESERVE_NANOS = 100000000n; | ||
| * Compute the max spendable amount a user can place into an input when they click MAX. | ||
| * For native TON — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from TON separately). | ||
| * For native GRAM — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from GRAM separately). | ||
| */ | ||
@@ -21,0 +21,0 @@ export const calcMaxSpendable = ({ balance, token, feeReserveNanos = DEFAULT_TON_FEE_RESERVE_NANOS, }) => { |
@@ -9,3 +9,3 @@ /** | ||
| export interface CheckTonBalanceParams { | ||
| /** Outgoing messages of the built transaction — each `amount` is the TON value in nanos. */ | ||
| /** Outgoing messages of the built transaction — each `amount` is the GRAM value in nanos. */ | ||
| messages: Array<{ | ||
@@ -15,15 +15,15 @@ amount: string; | ||
| /** | ||
| * User's TON balance as a decimal string (`formatUnits(balance, 9)` format). | ||
| * User's GRAM balance as a decimal string (`formatUnits(balance, 9)` format). | ||
| * `undefined` means "not loaded yet" — function returns `undefined` (no judgement). | ||
| */ | ||
| tonBalance: string | undefined; | ||
| /** Extra TON headroom on top of total outflow. Caller-supplied — no opinion on default. */ | ||
| /** Extra GRAM headroom on top of total outflow. Caller-supplied — no opinion on default. */ | ||
| gasBufferNanos: bigint; | ||
| } | ||
| export interface TonBalanceShortfall { | ||
| /** Total TON the user wallet must hold for the transaction to land. */ | ||
| /** Total GRAM the user wallet must hold for the transaction to land. */ | ||
| requiredNanos: bigint; | ||
| } | ||
| /** | ||
| * Pure balance check: does the user have enough TON for the built transaction? | ||
| * Pure balance check: does the user have enough GRAM for the built transaction? | ||
| * | ||
@@ -30,0 +30,0 @@ * Returns `undefined` when the balance is sufficient OR when it hasn't loaded |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"check-ton-balance.d.ts","sourceRoot":"","sources":["../../../../src/utils/balance/check-ton-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,qBAAqB;IAClC,4FAA4F;IAC5F,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,2FAA2F;IAC3F,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAChC,uEAAuE;IACvE,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,2CAI7B,qBAAqB,KAAG,mBAAmB,GAAG,SAShD,CAAC"} | ||
| {"version":3,"file":"check-ton-balance.d.ts","sourceRoot":"","sources":["../../../../src/utils/balance/check-ton-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,qBAAqB;IAClC,6FAA6F;IAC7F,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,4FAA4F;IAC5F,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAChC,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,2CAI7B,qBAAqB,KAAG,mBAAmB,GAAG,SAShD,CAAC"} |
@@ -10,3 +10,3 @@ /** | ||
| /** | ||
| * Pure balance check: does the user have enough TON for the built transaction? | ||
| * Pure balance check: does the user have enough GRAM for the built transaction? | ||
| * | ||
@@ -13,0 +13,0 @@ * Returns `undefined` when the balance is sufficient OR when it hasn't loaded |
@@ -12,7 +12,7 @@ /** | ||
| * Covers quote/gas drift between the current built tx and the one sent after the | ||
| * amount changes. 0.02 TON. | ||
| * amount changes. 0.02 GRAM. | ||
| */ | ||
| export declare const DEFAULT_SAFETY_MARGIN_NANOS = 20000000n; | ||
| export interface CheckTransferBalanceParams extends CheckTonBalanceParams { | ||
| /** The asset being transferred / swapped. TON-from enables the `'reduce'` outcome. */ | ||
| /** The asset being transferred / swapped. GRAM-from enables the `'reduce'` outcome. */ | ||
| fromToken: { | ||
@@ -38,3 +38,3 @@ address: string; | ||
| /** | ||
| * Balance check for user-initiated transfers (send TON / jetton / NFT) and swaps — | ||
| * Balance check for user-initiated transfers (send GRAM / jetton / NFT) and swaps — | ||
| * where the user controls a `fromAmount` and might be able to fix a shortfall by | ||
@@ -45,5 +45,5 @@ * sending less. | ||
| * - `undefined` when balance is sufficient (or unloaded — see {@link checkTonBalance}). | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is TON and the | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is GRAM and the | ||
| * remaining balance can still cover gas — the user can keep going by spending less. | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up TON gas). | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up GRAM gas). | ||
| * | ||
@@ -50,0 +50,0 @@ * Gasless availability is intentionally **not** modelled here — that's a UI policy. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"check-transfer-balance.d.ts","sourceRoot":"","sources":["../../../../src/utils/balance/check-transfer-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,YAAc,CAAC;AAEvD,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACrE,sFAAsF;IACtF,SAAS,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,iBAAiB,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GACtE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAAI,qFAOlC,0BAA0B,KAAG,iBAAiB,GAAG,SA0BnD,CAAC"} | ||
| {"version":3,"file":"check-transfer-balance.d.ts","sourceRoot":"","sources":["../../../../src/utils/balance/check-transfer-balance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,YAAc,CAAC;AAEvD,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACrE,uFAAuF;IACvF,SAAS,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,iBAAiB,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GACtE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAAI,qFAOlC,0BAA0B,KAAG,iBAAiB,GAAG,SA0BnD,CAAC"} |
@@ -13,7 +13,7 @@ /** | ||
| * Covers quote/gas drift between the current built tx and the one sent after the | ||
| * amount changes. 0.02 TON. | ||
| * amount changes. 0.02 GRAM. | ||
| */ | ||
| export const DEFAULT_SAFETY_MARGIN_NANOS = 20000000n; | ||
| /** | ||
| * Balance check for user-initiated transfers (send TON / jetton / NFT) and swaps — | ||
| * Balance check for user-initiated transfers (send GRAM / jetton / NFT) and swaps — | ||
| * where the user controls a `fromAmount` and might be able to fix a shortfall by | ||
@@ -24,5 +24,5 @@ * sending less. | ||
| * - `undefined` when balance is sufficient (or unloaded — see {@link checkTonBalance}). | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is TON and the | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is GRAM and the | ||
| * remaining balance can still cover gas — the user can keep going by spending less. | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up TON gas). | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up GRAM gas). | ||
| * | ||
@@ -36,5 +36,5 @@ * Gasless availability is intentionally **not** modelled here — that's a UI policy. | ||
| return undefined; | ||
| // Reducing the user's own amount only helps when the outflow is in TON. | ||
| // For jetton / NFT outflow, gas is denominated in TON regardless — reducing | ||
| // the jetton-side input doesn't free up any TON. | ||
| // Reducing the user's own amount only helps when the outflow is in GRAM. | ||
| // For jetton / NFT outflow, gas is denominated in GRAM regardless — reducing | ||
| // the jetton-side input doesn't free up any GRAM. | ||
| if (fromToken.address !== 'ton') { | ||
@@ -41,0 +41,0 @@ return { mode: 'topup', requiredNanos: shortfall.requiredNanos }; |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export declare function mapValues<T extends object, K extends keyof T, V>(object: T, getNewValue: (value: T[K], key: K, obj: T) => V): Record<K, V>; | ||
| export declare const mapValues: <T extends object, K extends keyof T, V>(object: T, getNewValue: (value: T[K], key: K, obj: T) => V) => Record<K, V>; | ||
| //# sourceMappingURL=map-values.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"map-values.d.ts","sourceRoot":"","sources":["../../../../src/utils/object/map-values.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAC5D,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAChD,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAWd"} | ||
| {"version":3,"file":"map-values.d.ts","sourceRoot":"","sources":["../../../../src/utils/object/map-values.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAC5D,QAAQ,CAAC,EACT,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAChD,MAAM,CAAC,CAAC,EAAE,CAAC,CAWb,CAAC"} |
@@ -8,3 +8,3 @@ /** | ||
| */ | ||
| export function mapValues(object, getNewValue) { | ||
| export const mapValues = (object, getNewValue) => { | ||
| const result = {}; | ||
@@ -17,2 +17,2 @@ const keys = Object.keys(object); | ||
| return result; | ||
| } | ||
| }; |
@@ -9,3 +9,3 @@ /** | ||
| import type { Compute } from '../../types/utils'; | ||
| export declare function filterQueryOptions<type extends object>(options: type): Compute<Omit<type, 'query'>>; | ||
| export declare const filterQueryOptions: <type extends object>(options: type) => Compute<Omit<type, "query">>; | ||
| //# sourceMappingURL=filter-query-options.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"filter-query-options.d.ts","sourceRoot":"","sources":["../../../../src/utils/query/filter-query-options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,wBAAgB,kBAAkB,CAAC,IAAI,SAAS,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAInG"} | ||
| {"version":3,"file":"filter-query-options.d.ts","sourceRoot":"","sources":["../../../../src/utils/query/filter-query-options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,kBAAkB,GAAI,IAAI,SAAS,MAAM,EAAE,SAAS,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAIlG,CAAC"} |
@@ -8,5 +8,5 @@ /** | ||
| */ | ||
| export function filterQueryOptions(options) { | ||
| export const filterQueryOptions = (options) => { | ||
| const { query, ...rest } = options; | ||
| return rest; | ||
| } | ||
| }; |
+53
-1
@@ -432,2 +432,40 @@ # Actions | ||
| ## Crypto Onramp | ||
| ### `getCryptoOnrampProvider` | ||
| Get a registered crypto-onramp provider by id, or the default one when no id is given. | ||
| ```ts | ||
| const provider = getCryptoOnrampProvider(appKit, { id: 'layerswap' }); | ||
| console.log('Crypto onramp provider:', provider.providerId); | ||
| ``` | ||
| ### `getCryptoOnrampProviders` | ||
| Get all registered crypto-onramp providers. | ||
| ```ts | ||
| const providers = getCryptoOnrampProviders(appKit); | ||
| console.log( | ||
| 'Registered crypto onramp providers:', | ||
| providers.map((p) => p.providerId), | ||
| ); | ||
| ``` | ||
| ### `getCryptoOnrampProviderMetadata` | ||
| Get static metadata for a crypto-onramp provider (display name, logo, url). | ||
| ```ts | ||
| const metadata = getCryptoOnrampProviderMetadata(appKit, { | ||
| providerId: 'layerswap', | ||
| }); | ||
| console.log('Crypto onramp provider metadata:', metadata); | ||
| ``` | ||
| ### `watchCryptoOnrampProviders` | ||
| Watch for new crypto-onramp providers registration and default-provider changes. | ||
| ## Providers | ||
@@ -722,3 +760,3 @@ | ||
| amount: '60000000', // 0.06 TON gas budget | ||
| payload: 'te6cckEBAQEAAgAAAA==' as never, | ||
| payload: asBase64('te6cckEBAQEAAgAAAA=='), | ||
| }, | ||
@@ -917,2 +955,16 @@ ], | ||
| ### `getCustomProvider` | ||
| Get a registered custom provider by id. | ||
| ```tsx | ||
| const provider = getCustomProvider<MyCustomProvider>(appKit, { | ||
| id: 'my-provider', | ||
| }); | ||
| if (provider) { | ||
| console.log('Custom provider is available'); | ||
| } | ||
| ``` | ||
| <!-- | ||
@@ -919,0 +971,0 @@ This file is auto-generated. Do not edit manually. |
+33
-7
| { | ||
| "name": "@ton/appkit", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0-beta.0", | ||
| "description": "", | ||
@@ -64,2 +64,22 @@ "repository": { | ||
| }, | ||
| "./crypto-onramp/decent": { | ||
| "import": { | ||
| "types": "./dist/esm/crypto-onramp/decent/index.d.ts", | ||
| "default": "./dist/esm/crypto-onramp/decent/index.js" | ||
| }, | ||
| "require": { | ||
| "types": "./dist/cjs/crypto-onramp/decent/index.d.ts", | ||
| "default": "./dist/cjs/crypto-onramp/decent/index.js" | ||
| } | ||
| }, | ||
| "./crypto-onramp/layerswap": { | ||
| "import": { | ||
| "types": "./dist/esm/crypto-onramp/layerswap/index.d.ts", | ||
| "default": "./dist/esm/crypto-onramp/layerswap/index.js" | ||
| }, | ||
| "require": { | ||
| "types": "./dist/cjs/crypto-onramp/layerswap/index.d.ts", | ||
| "default": "./dist/cjs/crypto-onramp/layerswap/index.js" | ||
| } | ||
| }, | ||
| "./gasless/tonapi": { | ||
@@ -90,2 +110,8 @@ "import": { | ||
| ], | ||
| "crypto-onramp/decent": [ | ||
| "./dist/esm/crypto-onramp/decent/index.d.ts" | ||
| ], | ||
| "crypto-onramp/layerswap": [ | ||
| "./dist/esm/crypto-onramp/layerswap/index.d.ts" | ||
| ], | ||
| "gasless/tonapi": [ | ||
@@ -97,4 +123,4 @@ "./dist/esm/gasless/tonapi/index.d.ts" | ||
| "dependencies": { | ||
| "lru-cache": "^11.5.0", | ||
| "@ton/walletkit": "1.0.0" | ||
| "lru-cache": "^11.5.1", | ||
| "@ton/walletkit": "1.1.0-beta.0" | ||
| }, | ||
@@ -105,4 +131,4 @@ "peerDependencies": { | ||
| "@ton/crypto": "^3.3.0", | ||
| "@tonconnect/ui": ">=3.0.0", | ||
| "@tonconnect/sdk": ">=4.0.0" | ||
| "@tonconnect/sdk": ">=4.0.0", | ||
| "@tonconnect/ui": ">=3.0.0" | ||
| }, | ||
@@ -124,7 +150,7 @@ "peerDependenciesMeta": { | ||
| "devDependencies": { | ||
| "@tanstack/query-core": "^5.100.14", | ||
| "@tanstack/query-core": "^5.101.0", | ||
| "@ton/core": "^0.63.1", | ||
| "@tonconnect/ui": "^3.0.0", | ||
| "typescript": "5.9.3", | ||
| "vitest": "^4.1.4" | ||
| "vitest": "^4.1.8" | ||
| }, | ||
@@ -131,0 +157,0 @@ "scripts": { |
@@ -50,3 +50,3 @@ /** | ||
| * The jetton `responseDestination` (excess receiver) is set to the relayer's | ||
| * address — the relayer paid the gas, so the unspent TON goes back to it rather | ||
| * address — the relayer paid the gas, so the unspent GRAM goes back to it rather | ||
| * than to the user's wallet. | ||
@@ -53,0 +53,0 @@ * |
+56
-0
@@ -44,2 +44,48 @@ /** | ||
| // Crypto onramp | ||
| export { | ||
| getCryptoOnrampProvider, | ||
| type GetCryptoOnrampProviderOptions, | ||
| type GetCryptoOnrampProviderReturnType, | ||
| } from './crypto-onramp/get-crypto-onramp-provider'; | ||
| export { | ||
| getCryptoOnrampProviders, | ||
| type GetCryptoOnrampProvidersReturnType, | ||
| } from './crypto-onramp/get-crypto-onramp-providers'; | ||
| export { | ||
| watchCryptoOnrampProviders, | ||
| type WatchCryptoOnrampProvidersParameters, | ||
| type WatchCryptoOnrampProvidersReturnType, | ||
| } from './crypto-onramp/watch-crypto-onramp-providers'; | ||
| export { | ||
| getCryptoOnrampQuote, | ||
| type GetCryptoOnrampQuoteOptions, | ||
| type GetCryptoOnrampQuoteReturnType, | ||
| } from './crypto-onramp/get-crypto-onramp-quote'; | ||
| export { | ||
| createCryptoOnrampDeposit, | ||
| type CreateCryptoOnrampDepositOptions, | ||
| type CreateCryptoOnrampDepositReturnType, | ||
| } from './crypto-onramp/create-crypto-onramp-deposit'; | ||
| export { | ||
| getCryptoOnrampStatus, | ||
| type GetCryptoOnrampStatusOptions, | ||
| type GetCryptoOnrampStatusReturnType, | ||
| } from './crypto-onramp/get-crypto-onramp-status'; | ||
| export { | ||
| setDefaultCryptoOnrampProvider, | ||
| type SetDefaultCryptoOnrampProviderParameters, | ||
| type SetDefaultCryptoOnrampProviderReturnType, | ||
| } from './crypto-onramp/set-default-crypto-onramp-provider'; | ||
| export { | ||
| getCryptoOnrampSupportedCurrencies, | ||
| type GetCryptoOnrampSupportedCurrenciesOptions, | ||
| type GetCryptoOnrampSupportedCurrenciesReturnType, | ||
| } from './crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| export { | ||
| getCryptoOnrampProviderMetadata, | ||
| type GetCryptoOnrampProviderMetadataOptions, | ||
| type GetCryptoOnrampProviderMetadataReturnType, | ||
| } from './crypto-onramp/get-crypto-onramp-provider-metadata'; | ||
| // Jettons | ||
@@ -111,2 +157,12 @@ export { getJettonInfo, type GetJettonInfoOptions, type GetJettonInfoReturnType } from './jettons/get-jetton-info'; | ||
| export { registerProvider, type RegisterProviderOptions } from './providers/register-provider'; | ||
| export { | ||
| getCustomProvider, | ||
| type GetCustomProviderOptions, | ||
| type GetCustomProviderReturnType, | ||
| } from './providers/get-custom-provider'; | ||
| export { | ||
| watchCustomProviders, | ||
| type WatchCustomProvidersParameters, | ||
| type WatchCustomProvidersReturnType, | ||
| } from './providers/watch-custom-providers'; | ||
@@ -113,0 +169,0 @@ // Gasless |
@@ -9,15 +9,18 @@ /** | ||
| import { Address, beginCell, Cell } from '@ton/core'; | ||
| import { | ||
| createJettonTransferPayload, | ||
| createTransferTransaction, | ||
| storeJettonTransferMessage, | ||
| createCommentPayload, | ||
| getJettonWalletAddressFromClient, | ||
| DEFAULT_JETTON_GAS_FEE, | ||
| DEFAULT_FORWARD_AMOUNT, | ||
| parseUnits, | ||
| } from '@ton/walletkit'; | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { TransactionRequest, TransactionRequestMessage } from '../../types/transaction'; | ||
| import type { Base64String } from '../../types/primitives'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { getJettonInfo } from './get-jetton-info'; | ||
| import { isNumber } from '../../utils'; | ||
| import { asBase64, isNumber } from '../../utils'; | ||
@@ -31,2 +34,7 @@ export interface CreateTransferJettonTransactionParameters { | ||
| responseDestination?: string; | ||
| queryId?: string; | ||
| forwardAmount?: string; | ||
| forwardPayload?: Base64String; | ||
| customPayload?: Base64String; | ||
| gasAmount?: string; | ||
| } | ||
@@ -43,3 +51,15 @@ | ||
| ): Promise<CreateTransferJettonTransactionReturnType> => { | ||
| const { jettonAddress, recipientAddress, amount, jettonDecimals, comment, responseDestination } = parameters; | ||
| const { | ||
| jettonAddress, | ||
| recipientAddress, | ||
| amount, | ||
| jettonDecimals, | ||
| comment, | ||
| responseDestination, | ||
| queryId, | ||
| forwardAmount, | ||
| forwardPayload, | ||
| customPayload, | ||
| gasAmount, | ||
| } = parameters; | ||
@@ -72,17 +92,36 @@ const wallet = getSelectedWallet(appKit); | ||
| // forwardPayload takes priority, otherwise fall back to a comment payload | ||
| let forwardPayloadCell: Cell | null = null; | ||
| if (forwardPayload) { | ||
| forwardPayloadCell = Cell.fromBase64(forwardPayload); | ||
| } else if (comment) { | ||
| forwardPayloadCell = createCommentPayload(comment); | ||
| } | ||
| // Create jetton transfer payload | ||
| const jettonPayload = createJettonTransferPayload({ | ||
| amount: parseUnits(amount, decimals), | ||
| destination: recipientAddress, | ||
| responseDestination: responseDestination ?? ownerAddress, | ||
| comment, | ||
| }); | ||
| const jettonPayload = beginCell() | ||
| .store( | ||
| storeJettonTransferMessage({ | ||
| queryId: queryId ? BigInt(queryId) : 0n, | ||
| amount: parseUnits(amount, decimals), | ||
| destination: Address.parse(recipientAddress), | ||
| responseDestination: Address.parse(responseDestination ?? ownerAddress), | ||
| customPayload: customPayload ? Cell.fromBase64(customPayload) : null, | ||
| forwardAmount: forwardAmount ? BigInt(forwardAmount) : DEFAULT_FORWARD_AMOUNT, | ||
| forwardPayload: forwardPayloadCell, | ||
| }), | ||
| ) | ||
| .endCell(); | ||
| // Build transaction | ||
| return createTransferTransaction({ | ||
| targetAddress: jettonWalletAddress, | ||
| amount: DEFAULT_JETTON_GAS_FEE, | ||
| payload: jettonPayload, | ||
| // Build transaction message | ||
| const message: TransactionRequestMessage = { | ||
| address: jettonWalletAddress, | ||
| amount: gasAmount ?? DEFAULT_JETTON_GAS_FEE, | ||
| payload: asBase64(jettonPayload.toBoc().toString('base64')), | ||
| }; | ||
| return { | ||
| messages: [message], | ||
| fromAddress: ownerAddress, | ||
| }); | ||
| }; | ||
| }; |
@@ -9,7 +9,15 @@ /** | ||
| import { createNftTransferPayload, createTransferTransaction, DEFAULT_NFT_GAS_FEE } from '@ton/walletkit'; | ||
| import { Address, beginCell, Cell } from '@ton/core'; | ||
| import { | ||
| storeNftTransferMessage, | ||
| createCommentPayload, | ||
| DEFAULT_NFT_GAS_FEE, | ||
| DEFAULT_FORWARD_AMOUNT, | ||
| } from '@ton/walletkit'; | ||
| import type { TransactionRequest } from '../../types/transaction'; | ||
| import type { TransactionRequest, TransactionRequestMessage } from '../../types/transaction'; | ||
| import type { Base64String } from '../../types/primitives'; | ||
| import type { AppKit } from '../../core/app-kit'; | ||
| import { getSelectedWallet } from '../wallets/get-selected-wallet'; | ||
| import { asBase64 } from '../../utils'; | ||
@@ -19,4 +27,9 @@ export interface CreateTransferNftTransactionParameters { | ||
| recipientAddress: string; | ||
| amount?: string; | ||
| comment?: string; | ||
| responseDestination?: string; | ||
| queryId?: string; | ||
| forwardAmount?: string; | ||
| forwardPayload?: Base64String; | ||
| customPayload?: Base64String; | ||
| gasAmount?: string; | ||
| } | ||
@@ -33,3 +46,13 @@ | ||
| ): Promise<CreateTransferNftTransactionReturnType> => { | ||
| const { nftAddress, recipientAddress, amount, comment } = parameters; | ||
| const { | ||
| nftAddress, | ||
| recipientAddress, | ||
| comment, | ||
| responseDestination, | ||
| queryId, | ||
| forwardAmount, | ||
| forwardPayload, | ||
| customPayload, | ||
| gasAmount, | ||
| } = parameters; | ||
@@ -42,14 +65,37 @@ const wallet = getSelectedWallet(appKit); | ||
| const payload = createNftTransferPayload({ | ||
| newOwner: recipientAddress, | ||
| responseDestination: wallet.getAddress(), | ||
| comment, | ||
| }); | ||
| const ownerAddress = wallet.getAddress(); | ||
| return createTransferTransaction({ | ||
| targetAddress: nftAddress, | ||
| amount: amount ?? DEFAULT_NFT_GAS_FEE, | ||
| payload, | ||
| fromAddress: wallet.getAddress(), | ||
| }); | ||
| // forwardPayload takes priority, otherwise fall back to a comment payload | ||
| let forwardPayloadCell: Cell | null = null; | ||
| if (forwardPayload) { | ||
| forwardPayloadCell = Cell.fromBase64(forwardPayload); | ||
| } else if (comment) { | ||
| forwardPayloadCell = createCommentPayload(comment); | ||
| } | ||
| // Create NFT transfer payload | ||
| const nftPayload = beginCell() | ||
| .store( | ||
| storeNftTransferMessage({ | ||
| queryId: queryId ? BigInt(queryId) : 0n, | ||
| newOwner: Address.parse(recipientAddress), | ||
| responseDestination: Address.parse(responseDestination ?? ownerAddress), | ||
| customPayload: customPayload ? Cell.fromBase64(customPayload) : null, | ||
| forwardAmount: forwardAmount ? BigInt(forwardAmount) : DEFAULT_FORWARD_AMOUNT, | ||
| forwardPayload: forwardPayloadCell, | ||
| }), | ||
| ) | ||
| .endCell(); | ||
| // Build transaction message | ||
| const message: TransactionRequestMessage = { | ||
| address: nftAddress, | ||
| amount: gasAmount ?? DEFAULT_NFT_GAS_FEE, | ||
| payload: asBase64(nftPayload.toBoc().toString('base64')), | ||
| }; | ||
| return { | ||
| messages: [message], | ||
| fromAddress: ownerAddress, | ||
| }; | ||
| }; |
@@ -11,3 +11,3 @@ /** | ||
| import type { TransactionRequest, TransactionRequestMessage } from '../../types/transaction'; | ||
| import type { TransactionRequest, TransactionRequestMessage, ExtraCurrencies } from '../../types/transaction'; | ||
| import { asBase64 } from '../../utils'; | ||
@@ -28,2 +28,4 @@ import type { AppKit } from '../../core/app-kit'; | ||
| stateInit?: string; | ||
| /** Additional currencies to include in the transfer */ | ||
| extraCurrency?: ExtraCurrencies; | ||
| } | ||
@@ -34,3 +36,3 @@ | ||
| /** | ||
| * Create a TON transfer transaction request | ||
| * Create a GRAM transfer transaction request | ||
| */ | ||
@@ -41,3 +43,3 @@ export const createTransferTonTransaction = ( | ||
| ): CreateTransferTonTransactionReturnType => { | ||
| const { recipientAddress, amount, comment, payload, stateInit } = parameters; | ||
| const { recipientAddress, amount, comment, payload, stateInit, extraCurrency } = parameters; | ||
@@ -54,2 +56,3 @@ const wallet = getSelectedWallet(appKit); | ||
| stateInit: stateInit ? asBase64(stateInit) : undefined, | ||
| extraCurrency, | ||
| }; | ||
@@ -56,0 +59,0 @@ |
@@ -23,3 +23,3 @@ /** | ||
| /** | ||
| * Transfer TON - creates and sends a TON transfer transaction | ||
| * Transfer GRAM - creates and sends a GRAM transfer transaction | ||
| */ | ||
@@ -26,0 +26,0 @@ export const transferTon = async ( |
@@ -69,3 +69,3 @@ /** | ||
| function getConnectedWallets(): WalletInterface[] { | ||
| const getConnectedWallets = (): WalletInterface[] => { | ||
| const ui = getTonConnectUI(); | ||
@@ -86,5 +86,5 @@ | ||
| return []; | ||
| } | ||
| }; | ||
| function setupListeners() { | ||
| const setupListeners = (): void => { | ||
| if (!originalTonConnectUI || unsubscribeTonConnect) { | ||
@@ -109,3 +109,3 @@ return; | ||
| }); | ||
| } | ||
| }; | ||
@@ -112,0 +112,0 @@ return { |
@@ -21,3 +21,3 @@ /** | ||
| */ | ||
| export function toTonConnectTransaction(request: TransactionRequest): SendTransactionRequest { | ||
| export const toTonConnectTransaction = (request: TransactionRequest): SendTransactionRequest => { | ||
| return { | ||
@@ -27,3 +27,3 @@ validUntil: request.validUntil ?? Math.floor(Date.now() / 1000) + DEFAULT_TRANSACTION_VALIDITY_SECONDS, | ||
| }; | ||
| } | ||
| }; | ||
@@ -33,3 +33,5 @@ /** | ||
| */ | ||
| export function toTonConnectMessage(msg: TransactionRequestMessage): { | ||
| export const toTonConnectMessage = ( | ||
| msg: TransactionRequestMessage, | ||
| ): { | ||
| address: string; | ||
@@ -39,3 +41,3 @@ amount: string; | ||
| stateInit?: string; | ||
| } { | ||
| } => { | ||
| return { | ||
@@ -47,3 +49,3 @@ address: msg.address, | ||
| }; | ||
| } | ||
| }; | ||
@@ -53,4 +55,4 @@ /** | ||
| */ | ||
| export function getValidUntil(validitySeconds = DEFAULT_TRANSACTION_VALIDITY_SECONDS): number { | ||
| export const getValidUntil = (validitySeconds = DEFAULT_TRANSACTION_VALIDITY_SECONDS): number => { | ||
| return Math.floor(Date.now() / 1000) + validitySeconds; | ||
| } | ||
| }; |
@@ -9,4 +9,10 @@ /** | ||
| import { SwapManager, StreamingManager } from '@ton/walletkit'; | ||
| import type { ProviderInput, SwapProviderInterface, StakingProviderInterface, StreamingProvider } from '@ton/walletkit'; | ||
| import { SwapManager, StreamingManager, CryptoOnrampManager } from '@ton/walletkit'; | ||
| import type { | ||
| ProviderInput, | ||
| SwapProviderInterface, | ||
| StakingProviderInterface, | ||
| CryptoOnrampProviderInterface, | ||
| StreamingProvider, | ||
| } from '@ton/walletkit'; | ||
@@ -28,2 +34,4 @@ import type { AppKitConfig } from '../types/config'; | ||
| import type { AppKitProvider } from '../../../types/provider'; | ||
| import { CustomProvidersManager } from '../../../providers'; | ||
| import type { CustomProvider } from '../../../providers'; | ||
@@ -40,3 +48,5 @@ /** | ||
| readonly stakingManager: StakingManager; | ||
| readonly cryptoOnrampManager: CryptoOnrampManager; | ||
| readonly gaslessManager: GaslessManager; | ||
| readonly customProvidersManager: CustomProvidersManager; | ||
@@ -65,3 +75,5 @@ readonly networkManager: AppKitNetworkManager; | ||
| this.stakingManager = new StakingManager(() => this.createFactoryContext()); | ||
| this.cryptoOnrampManager = new CryptoOnrampManager(() => this.createFactoryContext()); | ||
| this.gaslessManager = new GaslessManager(() => this.createFactoryContext()); | ||
| this.customProvidersManager = new CustomProvidersManager(() => this.createFactoryContext()); | ||
| this.streamingManager = new StreamingManager(() => this.createFactoryContext()); | ||
@@ -134,2 +146,5 @@ | ||
| break; | ||
| case 'crypto-onramp': | ||
| this.cryptoOnrampManager.registerProvider(provider as CryptoOnrampProviderInterface); | ||
| break; | ||
| case 'streaming': | ||
@@ -141,2 +156,5 @@ this.streamingManager.registerProvider(provider as StreamingProvider); | ||
| break; | ||
| case 'custom': | ||
| this.customProvidersManager.registerProvider(provider as CustomProvider); | ||
| break; | ||
| default: | ||
@@ -143,0 +161,0 @@ throw new Error('Unknown provider type'); |
+2
-0
@@ -38,3 +38,5 @@ /** | ||
| export * from './staking'; | ||
| export * from './crypto-onramp'; | ||
| export * from './gasless'; | ||
| export * from './providers'; | ||
@@ -41,0 +43,0 @@ // Actions |
+36
-0
@@ -40,2 +40,38 @@ /** | ||
| // Crypto onramp | ||
| export { | ||
| getCryptoOnrampQuoteQueryOptions, | ||
| type GetCryptoOnrampQuoteQueryConfig, | ||
| type GetCryptoOnrampQuoteQueryOptions, | ||
| type GetCryptoOnrampQuoteData, | ||
| type GetCryptoOnrampQuoteErrorType, | ||
| type GetCryptoOnrampQuoteQueryFnData, | ||
| type GetCryptoOnrampQuoteQueryKey, | ||
| } from './crypto-onramp/get-crypto-onramp-quote'; | ||
| export { | ||
| getCryptoOnrampStatusQueryOptions, | ||
| type GetCryptoOnrampStatusQueryConfig, | ||
| type GetCryptoOnrampStatusQueryOptions, | ||
| type GetCryptoOnrampStatusData, | ||
| type GetCryptoOnrampStatusErrorType, | ||
| type GetCryptoOnrampStatusQueryFnData, | ||
| type GetCryptoOnrampStatusQueryKey, | ||
| } from './crypto-onramp/get-crypto-onramp-status'; | ||
| export { | ||
| createCryptoOnrampDepositMutationOptions, | ||
| type CreateCryptoOnrampDepositMutationOptions, | ||
| type CreateCryptoOnrampDepositData, | ||
| type CreateCryptoOnrampDepositErrorType, | ||
| type CreateCryptoOnrampDepositVariables, | ||
| } from './crypto-onramp/create-crypto-onramp-deposit'; | ||
| export { | ||
| getCryptoOnrampSupportedCurrenciesQueryOptions, | ||
| type GetCryptoOnrampSupportedCurrenciesQueryConfig, | ||
| type GetCryptoOnrampSupportedCurrenciesQueryOptions, | ||
| type GetCryptoOnrampSupportedCurrenciesData, | ||
| type GetCryptoOnrampSupportedCurrenciesErrorType, | ||
| type GetCryptoOnrampSupportedCurrenciesQueryFnData, | ||
| type GetCryptoOnrampSupportedCurrenciesQueryKey, | ||
| } from './crypto-onramp/get-crypto-onramp-supported-currencies'; | ||
| // Jettons | ||
@@ -42,0 +78,0 @@ export { |
@@ -52,4 +52,4 @@ /** | ||
| /** Helper for creating typed connector factories */ | ||
| export function createConnector(factory: ConnectorFactory): ConnectorFactory { | ||
| export const createConnector = (factory: ConnectorFactory): ConnectorFactory => { | ||
| return factory; | ||
| } | ||
| }; |
@@ -13,3 +13,5 @@ /** | ||
| StreamingProvider, | ||
| CryptoOnrampProviderInterface, | ||
| GaslessProviderInterface, | ||
| CustomProvider, | ||
| } from '@ton/walletkit'; | ||
@@ -24,2 +26,4 @@ | ||
| | StreamingProvider | ||
| | GaslessProviderInterface; | ||
| | CryptoOnrampProviderInterface | ||
| | GaslessProviderInterface | ||
| | CustomProvider; |
@@ -15,2 +15,3 @@ /** | ||
| export type { TransactionStatus } from '@ton/walletkit'; | ||
| export type { ExtraCurrencies } from '@ton/walletkit'; | ||
@@ -17,0 +18,0 @@ export interface TransactionRequest { |
@@ -35,13 +35,13 @@ /** | ||
| it('should calculate fiat value without rounding', () => { | ||
| it('should calculate fiat value rounded to 2 decimal places', () => { | ||
| expect(calcFiatValue('100', '1.5')).toBe('150'); | ||
| expect(calcFiatValue('1', '0.001')).toBe('0.001'); | ||
| expect(calcFiatValue('3', '1.005')).toBe('3.015'); | ||
| expect(calcFiatValue('1', '0.001')).toBe('0'); | ||
| expect(calcFiatValue('10', '1.005')).toBe('10.05'); | ||
| }); | ||
| it('should handle decimal amounts without rounding', () => { | ||
| it('should handle decimal amounts rounded to 2 decimal places', () => { | ||
| expect(calcFiatValue('0.5', '2')).toBe('1'); | ||
| expect(calcFiatValue('1.23456', '100')).toBe('123.456'); | ||
| expect(calcFiatValue('2.996876', '1')).toBe('2.996876'); | ||
| expect(calcFiatValue('1.23456', '100')).toBe('123.46'); | ||
| expect(calcFiatValue('2.994', '1')).toBe('2.99'); | ||
| }); | ||
| }); |
@@ -13,7 +13,7 @@ /** | ||
| */ | ||
| export function calcFiatValue(amount: string, rate: string | undefined): string { | ||
| export const calcFiatValue = (amount: string, rate: string | undefined): string => { | ||
| if (!rate) return '0'; | ||
| const num = parseFloat(amount); | ||
| if (!num || num <= 0) return '0'; | ||
| return Number((num * parseFloat(rate)).toFixed(10)).toString(); | ||
| } | ||
| return Number((num * parseFloat(rate)).toFixed(2)).toString(); | ||
| }; |
@@ -9,3 +9,3 @@ /** | ||
| export function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T> { | ||
| export const keyBy = <T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T> => { | ||
| const result = {} as Record<K, T>; | ||
@@ -19,2 +19,2 @@ | ||
| return result; | ||
| } | ||
| }; |
@@ -12,4 +12,4 @@ /** | ||
| /** | ||
| * Default TON reserve subtracted from balance when computing the max spendable amount | ||
| * for a native TON operation — leaves room for network fees. 0.1 TON. | ||
| * Default GRAM reserve subtracted from balance when computing the max spendable amount | ||
| * for a native GRAM operation — leaves room for network fees. 0.1 GRAM. | ||
| */ | ||
@@ -24,3 +24,3 @@ export const DEFAULT_TON_FEE_RESERVE_NANOS = 100_000_000n; | ||
| /** | ||
| * TON reserve (in nanos) subtracted from balance when the token is native TON. | ||
| * GRAM reserve (in nanos) subtracted from balance when the token is native GRAM. | ||
| * Ignored for jettons. Defaults to {@link DEFAULT_TON_FEE_RESERVE_NANOS}. | ||
@@ -33,4 +33,4 @@ */ | ||
| * Compute the max spendable amount a user can place into an input when they click MAX. | ||
| * For native TON — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from TON separately). | ||
| * For native GRAM — subtracts a fixed reserve so the user still has room for network fees. | ||
| * For jettons — returns the full balance (gas is paid from GRAM separately). | ||
| */ | ||
@@ -37,0 +37,0 @@ export const calcMaxSpendable = ({ |
@@ -12,10 +12,10 @@ /** | ||
| export interface CheckTonBalanceParams { | ||
| /** Outgoing messages of the built transaction — each `amount` is the TON value in nanos. */ | ||
| /** Outgoing messages of the built transaction — each `amount` is the GRAM value in nanos. */ | ||
| messages: Array<{ amount: string }>; | ||
| /** | ||
| * User's TON balance as a decimal string (`formatUnits(balance, 9)` format). | ||
| * User's GRAM balance as a decimal string (`formatUnits(balance, 9)` format). | ||
| * `undefined` means "not loaded yet" — function returns `undefined` (no judgement). | ||
| */ | ||
| tonBalance: string | undefined; | ||
| /** Extra TON headroom on top of total outflow. Caller-supplied — no opinion on default. */ | ||
| /** Extra GRAM headroom on top of total outflow. Caller-supplied — no opinion on default. */ | ||
| gasBufferNanos: bigint; | ||
@@ -25,3 +25,3 @@ } | ||
| export interface TonBalanceShortfall { | ||
| /** Total TON the user wallet must hold for the transaction to land. */ | ||
| /** Total GRAM the user wallet must hold for the transaction to land. */ | ||
| requiredNanos: bigint; | ||
@@ -31,3 +31,3 @@ } | ||
| /** | ||
| * Pure balance check: does the user have enough TON for the built transaction? | ||
| * Pure balance check: does the user have enough GRAM for the built transaction? | ||
| * | ||
@@ -34,0 +34,0 @@ * Returns `undefined` when the balance is sufficient OR when it hasn't loaded |
@@ -17,3 +17,3 @@ /** | ||
| * Covers quote/gas drift between the current built tx and the one sent after the | ||
| * amount changes. 0.02 TON. | ||
| * amount changes. 0.02 GRAM. | ||
| */ | ||
@@ -23,3 +23,3 @@ export const DEFAULT_SAFETY_MARGIN_NANOS = 20_000_000n; | ||
| export interface CheckTransferBalanceParams extends CheckTonBalanceParams { | ||
| /** The asset being transferred / swapped. TON-from enables the `'reduce'` outcome. */ | ||
| /** The asset being transferred / swapped. GRAM-from enables the `'reduce'` outcome. */ | ||
| fromToken: { address: string }; | ||
@@ -40,3 +40,3 @@ /** Amount of `fromToken` being sent, as a decimal string in `fromToken` units. */ | ||
| /** | ||
| * Balance check for user-initiated transfers (send TON / jetton / NFT) and swaps — | ||
| * Balance check for user-initiated transfers (send GRAM / jetton / NFT) and swaps — | ||
| * where the user controls a `fromAmount` and might be able to fix a shortfall by | ||
@@ -47,5 +47,5 @@ * sending less. | ||
| * - `undefined` when balance is sufficient (or unloaded — see {@link checkTonBalance}). | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is TON and the | ||
| * - `{ mode: 'reduce', suggestedFromAmount }` only when `fromToken` is GRAM and the | ||
| * remaining balance can still cover gas — the user can keep going by spending less. | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up TON gas). | ||
| * - `{ mode: 'topup' }` otherwise (reducing wouldn't free up GRAM gas). | ||
| * | ||
@@ -66,5 +66,5 @@ * Gasless availability is intentionally **not** modelled here — that's a UI policy. | ||
| // Reducing the user's own amount only helps when the outflow is in TON. | ||
| // For jetton / NFT outflow, gas is denominated in TON regardless — reducing | ||
| // the jetton-side input doesn't free up any TON. | ||
| // Reducing the user's own amount only helps when the outflow is in GRAM. | ||
| // For jetton / NFT outflow, gas is denominated in GRAM regardless — reducing | ||
| // the jetton-side input doesn't free up any GRAM. | ||
| if (fromToken.address !== 'ton') { | ||
@@ -71,0 +71,0 @@ return { mode: 'topup', requiredNanos: shortfall.requiredNanos }; |
@@ -9,6 +9,6 @@ /** | ||
| export function mapValues<T extends object, K extends keyof T, V>( | ||
| export const mapValues = <T extends object, K extends keyof T, V>( | ||
| object: T, | ||
| getNewValue: (value: T[K], key: K, obj: T) => V, | ||
| ): Record<K, V> { | ||
| ): Record<K, V> => { | ||
| const result = {} as Record<K, V>; | ||
@@ -24,2 +24,2 @@ const keys = Object.keys(object) as K[]; | ||
| return result; | ||
| } | ||
| }; |
@@ -11,6 +11,6 @@ /** | ||
| export function filterQueryOptions<type extends object>(options: type): Compute<Omit<type, 'query'>> { | ||
| export const filterQueryOptions = <type extends object>(options: type): Compute<Omit<type, 'query'>> => { | ||
| const { query, ...rest } = options as unknown as { query: unknown }; | ||
| return rest as Compute<Omit<type, 'query'>>; | ||
| } | ||
| }; |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1735568
17.08%1537
11.38%31300
13.15%2
100%+ Added
- Removed
Updated
Updated