UNPKG

@uxuycom/web3-tg-sdk

Version:

web3 sdk for tg

65 lines (64 loc) 1.8 kB
import { ChainKey } from '../types'; export type OpenLinkOptions = { connect_direct_link?: string; }; export declare const enum tgLinkType { Invite = "A", ReceivePayment = "B", Internal = "D" } export declare class OpenLink { constructor(); /** * @description Generate a Universal DApp Link * @param url * @param params * @example * OpenLink.getUniversalDappLink('https://www.example.com', { * param1: 'value1', * param2: 'value2' * }) * * OpenLink.getUniversalDappLink('https://www.example.com?param1=value1&param2=value2') * @returns */ static getUniversalDappLink(url: string, params?: any, options?: OpenLinkOptions): string; /** * @description Use getUniversalDappLink instead * @param inviteTgId * @param inviteTgChannel * @example * OpenLink.getUniversalInviteLink({ * inviteTgId: '123456789', * inviteTgChannel: 'test_channel' * }) * @returns */ static getUniversalInviteLink({ inviteTgId, inviteTgChannel }: { inviteTgId: string; inviteTgChannel: string; }, options?: OpenLinkOptions): string; /** * * @param param0 * @param ln_email * @param chain_key * @param address * @param token_addr * @example * OpenLink.getUniversalReceivePaymentLink("bnbchain", { * address: '0x.....12' | 'test@uxuy.com', * token_addr: '0x0' * }) * @example * OpenLink.getUniversalReceivePaymentLink({ * @returns */ static getUniversalReceivePaymentLink(chainKey: ChainKey, { address, tokenAddr }: { address: string; } & { address: string; tokenAddr?: string; }, options?: OpenLinkOptions): string; } export default OpenLink;