Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dvlkv committed May 16, 2023
1 parent 6100f86 commit 93619ac
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 371 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-ton-x",
"version": "1.0.3",
"version": "1.1.0",
"main": "dist/index.js",
"license": "MIT",
"repository": "https://github.com/tonwhales/react-ton-x.git",
Expand All @@ -15,12 +15,11 @@
},
"devDependencies": {
"@types/react": "^18.0.15",
"ton-x": "^2.1.0-preview",
"typescript": "^4.7.4"
},
"peerDependencies": {
"react": "^18.2.0"
},
"dependencies": {
"ton-x": "^2.0.0"
"react": ">=18.2.0",
"ton-x": ">=2.0.0"
}
}
5 changes: 2 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Address } from 'ton';
import { TonhubLocalTransactionResponse, TonhubSignResponse, TonhubTransactionResponse, TonhubWalletConfig } from 'ton-x';
import { TonhubLocalConfig, TonhubLocalConnector, TonhubLocalSignResponse } from 'ton-x/dist/connector/TonhubLocalConnector';

Expand Down Expand Up @@ -35,12 +34,12 @@ export type RemoteConnectState = {
session: string,
seed: string,
walletConfig: TonhubWalletConfig,
address: Address
address: string
};
export type LocalConnectState = {
type: 'online',
walletConfig: TonhubLocalConfig,
address: Address
address: string
};

export type ConnectState = RemoteConnectState | LocalConnectState;
Expand Down
3 changes: 1 addition & 2 deletions src/useLocalConnector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useCallback, useMemo } from 'react'
import { Address } from 'ton';
import { TonhubLocalConnector } from 'ton-x';
import { LocalConnectState, TonhubApi } from './types';

Expand Down Expand Up @@ -47,6 +46,6 @@ export function useLocalConnector(network: TonhubLocalConnector['network'], acti
requestTransaction,
revoke
},
state: { type: 'online', address: Address.parse(connector!.config.address), walletConfig: connector!.config }
state: { type: 'online', address: connector!.config.address, walletConfig: connector!.config }
}
}
5 changes: 2 additions & 3 deletions src/useRemoteConnector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import axios from 'axios';
import { useCallback, useEffect, useMemo, useState } from 'react'
import { Address } from 'ton';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { TonhubConnector, TonhubSessionState, TonhubWalletConfig } from 'ton-x';
import { RemoteConnectState, TonhubApi } from './types';
import { backoff } from './utils/time';
Expand Down Expand Up @@ -193,7 +192,7 @@ export function useRemoteConnector(config: {
const state = useMemo(() => {
return connectionState.type === 'online' ? {
...connectionState,
address: Address.parse(connectionState.walletConfig.address),
address: connectionState.walletConfig.address,
} : connectionState;
}, [connectionState]);

Expand Down
Loading

0 comments on commit 93619ac

Please sign in to comment.