Skip to content

Commit

Permalink
Merge pull request #223 from huanxiangspace/feat/ton
Browse files Browse the repository at this point in the history
Feat: support ton
  • Loading branch information
originalix authored Aug 23, 2024
2 parents 7408523 + 604d320 commit 18c5992
Show file tree
Hide file tree
Showing 15 changed files with 605 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/versionInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

const version = '2.1.1';
const version = '2.1.2';
const versionBuild = '2020-0101-1';

export default {
Expand Down
1 change: 1 addition & 0 deletions packages/providers/inpage-providers-hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@onekeyfe/onekey-btc-provider": "2.1.2",
"@onekeyfe/onekey-cardano-provider": "2.1.2",
"@onekeyfe/onekey-conflux-provider": "2.1.2",
"@onekeyfe/onekey-ton-provider": "2.1.2",
"@onekeyfe/onekey-cosmos-provider": "2.1.2",
"@onekeyfe/onekey-eth-provider": "2.1.2",
"@onekeyfe/onekey-nostr-provider": "2.1.2",
Expand Down
10 changes: 10 additions & 0 deletions packages/providers/inpage-providers-hub/src/injectWeb3Provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import { ProviderSui, registerSuiWallet } from '@onekeyfe/onekey-sui-provider';
import { ProviderWebln } from '@onekeyfe/onekey-webln-provider';
import { ProviderScdo } from '@onekeyfe/onekey-scdo-provider';
import { ProviderTon } from '@onekeyfe/onekey-ton-provider';
import { ProviderNostr } from '@onekeyfe/onekey-nostr-provider';
import { ProviderBtc, ProviderBtcWallet } from '@onekeyfe/onekey-btc-provider';
import { ProviderAlgo } from '@onekeyfe/onekey-algo-provider';
Expand All @@ -42,6 +43,7 @@ export type IWindowOneKeyHub = {
keplr?: ProviderCosmos;
webln?: ProviderWebln;
nostr?: ProviderNostr;
ton?: ProviderTon;
unisat?: ProviderBtc;
btcwallet?: ProviderBtcWallet;
scdo?: ProviderScdo;
Expand Down Expand Up @@ -103,6 +105,10 @@ function injectWeb3Provider(): unknown {
bridge,
});

const tonconnect = new ProviderTon({
bridge,
});

const cosmos = new ProviderCosmos({
bridge,
});
Expand Down Expand Up @@ -142,6 +148,7 @@ function injectWeb3Provider(): unknown {
tron,
sollet: null,
sui,
tonconnect,
cardano,
cosmos,
scdo,
Expand Down Expand Up @@ -189,6 +196,9 @@ function injectWeb3Provider(): unknown {
defineWindowProperty('conflux', conflux);
defineWindowProperty('tronLink', tron);
defineWindowProperty('suiWallet', sui);
defineWindowProperty('tonkeeper', {
tonconnect,
});
defineWindowProperty('unisat', btc);
defineWindowProperty('scdo', scdo);
defineWindowProperty('algorand', algorand);
Expand Down
2 changes: 2 additions & 0 deletions packages/providers/onekey-ton-provider/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
1 change: 1 addition & 0 deletions packages/providers/onekey-ton-provider/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# cross-inpage-provider
37 changes: 37 additions & 0 deletions packages/providers/onekey-ton-provider/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@onekeyfe/onekey-ton-provider",
"version": "2.1.2",
"keywords": [
"cross-inpage-provider"
],
"author": "dev-fe@onekey.so",
"repository": "https://github.com/OneKeyHQ/cross-inpage-provider",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"type": "module",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"start": "tsc --watch"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.2",
"@onekeyfe/cross-inpage-provider-errors": "2.1.2",
"@onekeyfe/cross-inpage-provider-types": "2.1.2",
"@onekeyfe/extension-bridge-injected": "2.1.2",
"@tonconnect/protocol": "^2.2.6"
}
}
Loading

0 comments on commit 18c5992

Please sign in to comment.