Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions dist/api/account.api.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { AxiosInstance } from 'axios';
import { TonProofItemReply } from '@tonconnect/sdk';
type TAccountType = 'email' | 'block_chain';
export type TAccountRole = 'B' | 'C';
export type TDeviceType = 'WEB' | 'TG' | 'PLUG';
export interface ILoginResponse {
token: string;
old_token: string;
old_token?: string;
user_id: string;
new_user: boolean;
}
Expand All @@ -23,12 +24,23 @@ interface ILoginParamsBase {
[key: string]: any;
};
}
interface IConnectParamsBase {
account_type: string;
connector: 'codatta_email' | 'codatta_wallet' | 'codatta_ton';
account_enum: TAccountRole;
}
interface IEmailLoginParams extends ILoginParamsBase {
connector: 'codatta_email';
account_type: 'email';
email: string;
email_code: string;
}
interface IEmailConnectParams extends IConnectParamsBase {
connector: 'codatta_email';
account_type: 'email';
email: string;
email_code: string;
}
interface IWalletLoginParams extends ILoginParamsBase {
connector: 'codatta_wallet';
account_type: 'block_chain';
Expand All @@ -39,13 +51,35 @@ interface IWalletLoginParams extends ILoginParamsBase {
signature: string;
message: string;
}
interface IWalletConnectParams extends IConnectParamsBase {
connector: 'codatta_wallet';
account_type: 'block_chain';
address: string;
wallet_name: string;
chain: string;
nonce: string;
signature: string;
message: string;
}
interface ITonLoginParams extends ILoginParamsBase {
connector: 'codatta_ton';
account_type: 'block_chain';
wallet_name: string;
address: string;
chain: string;
connect_info: object[];
connect_info: [{
[key: string]: string;
}, TonProofItemReply];
}
interface ITonConnectParams extends IConnectParamsBase {
connector: 'codatta_ton';
account_type: 'block_chain';
wallet_name: string;
address: string;
chain: string;
connect_info: [{
[key: string]: string;
}, TonProofItemReply];
}
declare class AccountApi {
private request;
Expand All @@ -58,7 +92,7 @@ declare class AccountApi {
getEmailCode(props: {
account_type: TAccountType;
email: string;
}): Promise<string>;
}, captcha: string): Promise<string>;
emailLogin(props: IEmailLoginParams): Promise<{
data: ILoginResponse;
}>;
Expand All @@ -68,6 +102,9 @@ declare class AccountApi {
tonLogin(props: ITonLoginParams): Promise<{
data: ILoginResponse;
}>;
bindEmail(props: IEmailConnectParams): Promise<any>;
bindTonWallet(props: ITonConnectParams): Promise<any>;
bindEvmWallet(props: IWalletConnectParams): Promise<any>;
}
declare const _default: AccountApi;
export default _default;
4 changes: 4 additions & 0 deletions dist/codatta-connect-context-provider.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { WalletItem } from './types/wallet-item.class';
import { Chain } from 'viem';
export declare const coinbaseWallet: {
getProvider: () => import('@coinbase/wallet-sdk').ProviderInterface;
};
Expand All @@ -8,11 +9,14 @@ interface CodattaConnectContext {
featuredWallets: WalletItem[];
lastUsedWallet: WalletItem | null;
saveLastUsedWallet: (wallet: WalletItem) => void;
chains: Chain[];
}
export declare function useCodattaConnectContext(): CodattaConnectContext;
interface CodattaConnectContextProviderProps {
children: React.ReactNode;
apiBaseUrl?: string;
singleWalletName?: string;
chains?: Chain[];
}
export declare function CodattaConnectContextProvider(props: CodattaConnectContextProviderProps): import("react/jsx-runtime").JSX.Element;
export {};
1 change: 1 addition & 0 deletions dist/codatta-connect.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 26 additions & 4 deletions dist/codatta-connect.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
import { WalletItem } from './types/wallet-item.class';
export default function CodattaConnect(props: {
onSelectMoreWallets: () => void;
onSelectTonConnect?: () => void;
onConnect: (wallet: WalletItem) => Promise<void>;
import { default as TonConnect, Wallet } from '@tonconnect/sdk';
import { WalletSignInfo } from './components/wallet-connect';
import { WalletClient } from 'viem';
export interface EmvWalletConnectInfo {
chain_type: 'eip155';
client: WalletClient;
connect_info: WalletSignInfo;
wallet: WalletItem;
}
export interface TonWalletConnectInfo {
chain_type: 'ton';
client: TonConnect;
connect_info: Wallet;
wallet: Wallet;
}
export declare function CodattaConnect(props: {
onEvmWalletConnect?: (connectInfo: EmvWalletConnectInfo) => Promise<void>;
onTonWalletConnect?: (connectInfo: TonWalletConnectInfo) => Promise<void>;
onEmailConnect?: (email: string, code: string) => Promise<void>;
header?: React.ReactNode;
config?: {
showEmailSignIn?: boolean;
showFeaturedWallets?: boolean;
showMoreWallets?: boolean;
showTonConnect?: boolean;
};
}): import("react/jsx-runtime").JSX.Element;
4 changes: 4 additions & 0 deletions dist/components/email-captcha.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default function EmailCaptcha(props: {
email: string;
onCodeSend: () => void;
}): import("react/jsx-runtime").JSX.Element;
5 changes: 5 additions & 0 deletions dist/components/email-connect-widget.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function EmailConnectWidget(props: {
email: string;
onInputCode: (email: string, code: string) => Promise<void>;
onBack: () => void;
}): import("react/jsx-runtime").JSX.Element;
5 changes: 5 additions & 0 deletions dist/components/email-connect.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function EmailConnect(props: {
email: string;
onInputCode: (email: string, code: string) => Promise<void>;
onResendCode: () => void;
}): import("react/jsx-runtime").JSX.Element;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ILoginResponse } from '../api/account.api';
export default function EmailLoginWidget(props: {
email: string;
onLogin: (res: ILoginResponse) => void;
onLogin: (res: ILoginResponse) => Promise<void>;
onBack: () => void;
}): import("react/jsx-runtime").JSX.Element;
2 changes: 1 addition & 1 deletion dist/components/evm-wallet-login-widget.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { WalletItem } from '../types/wallet-item.class';
import { ILoginResponse } from '../api/account.api';
export default function WalletLogin(props: {
export default function EvmWalletLoginWidget(props: {
wallet: WalletItem;
onLogin: (res: ILoginResponse) => void;
onBack: () => void;
Expand Down
1 change: 1 addition & 0 deletions dist/components/signin-index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function SingInIndex(props: {
onSelectWallet: (walletOption: WalletItem) => void;
onSelectMoreWallets: () => void;
onSelectTonConnect: () => void;
useSingleWallet: boolean;
config: {
showEmailSignIn?: boolean;
showTonConnect?: boolean;
Expand Down
5 changes: 5 additions & 0 deletions dist/components/single-wallet-option.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WalletItem } from '../types/wallet-item.class';
export default function SingleWalletOption(props: {
wallet: WalletItem;
onClick: (wallet: WalletItem) => void;
}): import("react/jsx-runtime").JSX.Element;
2 changes: 1 addition & 1 deletion dist/components/ton-wallet-connect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export default function TonWalletConnect(props: {
connector: TonConnect;
wallet: WalletInfoRemote | WalletInfoInjectable;
onBack: () => void;
loading: boolean;
loading?: boolean;
}): import("react/jsx-runtime").JSX.Element;
4 changes: 2 additions & 2 deletions dist/components/ton-wallet-select.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default as TonConnect, WalletInfo } from '@tonconnect/sdk';
import { default as TonConnect, WalletInfoInjectable, WalletInfoRemote } from '@tonconnect/sdk';
export default function TonWalletSelect(props: {
connector: TonConnect;
onSelect: (wallet: WalletInfo) => void;
onSelect: (wallet: WalletInfoRemote | WalletInfoInjectable) => void;
onBack: () => void;
}): import("react/jsx-runtime").JSX.Element;
3 changes: 2 additions & 1 deletion dist/components/wallet-connect-widget.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { WalletSignInfo } from './wallet-connect';
import { WalletItem } from '../types/wallet-item.class';
export default function WalletConnectWidget(props: {
wallet: WalletItem;
onConnect: (wallet: WalletItem) => void;
onConnect: (wallet: WalletItem, signInfo: WalletSignInfo) => void;
onBack: () => void;
}): import("react/jsx-runtime").JSX.Element;
15 changes: 8 additions & 7 deletions dist/components/wallet-connect.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { WalletItem } from '../types/wallet-item.class';
export interface WalletSignInfo {
message: string;
nonce: string;
signature: string;
address: string;
wallet_name: string;
}
export default function WalletConnect(props: {
wallet: WalletItem;
onSignFinish: (wallet: WalletItem, params: {
message: string;
nonce: string;
signature: string;
address: string;
wallet_name: string;
}) => Promise<void>;
onSignFinish: (wallet: WalletItem, params: WalletSignInfo) => Promise<void>;
onShowQrCode: () => void;
}): import("react/jsx-runtime").JSX.Element;
12 changes: 7 additions & 5 deletions dist/index.es.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { C as o, d as e, a as n, u as C } from "./main-7Oj8aJZz.js";
import { l as o, C as e, k as n, W as C, j as s, u as d } from "./main-CtRNJ0s5.js";
export {
o as CodattaConnectContextProvider,
e as CodattaSignin,
n as coinbaseWallet,
C as useCodattaConnectContext
o as CodattaConnect,
e as CodattaConnectContextProvider,
n as CodattaSignin,
C as WalletItem,
s as coinbaseWallet,
d as useCodattaConnectContext
};
Loading