-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from xiangnuans/xianguans/eslint
add eslint/prettier
- Loading branch information
Showing
22 changed files
with
2,923 additions
and
2,332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
|
||
## 2.1.0 (2024-11-04) | ||
|
||
|
||
### Features | ||
|
||
* add TonConnectUIPlugin ([af7c4d2](https://github.com/TownSquareXYZ/tonconnect-ui-vue/commit/af7c4d24f825d36c453ccb694ba0dbddacb755f1)) | ||
* add TypeScript type definitions ([4cd5796](https://github.com/TownSquareXYZ/tonconnect-ui-vue/commit/4cd5796829a1e44d5266f0161c4853d792de1ecb)) | ||
* use Symble key in provide / inject ([e3f5115](https://github.com/TownSquareXYZ/tonconnect-ui-vue/commit/e3f51155999d2699170a416909ed01db6c7b0dc2)) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* add vue-demi to external dependencies ([e83b1bd](https://github.com/TownSquareXYZ/tonconnect-ui-vue/commit/e83b1bd91e1f9aa404098de90d394548f6821bdf)) | ||
* resolve issues with Vue 2.7 integration ([263dd91](https://github.com/TownSquareXYZ/tonconnect-ui-vue/commit/263dd917c77c3007c878eaef4882ea159b501619)) | ||
* update injections components & watch options change ([e1f8be8](https://github.com/TownSquareXYZ/tonconnect-ui-vue/commit/e1f8be88dffabaa7c0a81ffe961b3c56ce66cc96)) | ||
* useTonConnectUI().tonConnectUI is not typed ([2449bd8](https://github.com/TownSquareXYZ/tonconnect-ui-vue/commit/2449bd8027c235818f085bdce608edc9ba5ee3d6)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default as TonConnectButton } from "./TonConnectButton.vue"; | ||
export { default as TonConnectButton } from './TonConnectButton.vue'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { ref, onMounted } from 'vue-demi'; | ||
import { ref, onMounted, Ref } from 'vue-demi'; | ||
import { useTonConnectUI } from './useTonConnectUI'; | ||
|
||
export function useIsConnectionRestored() { | ||
const restored = ref(false); | ||
const { tonConnectUI } = useTonConnectUI(); | ||
export function useIsConnectionRestored(): Ref<boolean> { | ||
const restored = ref(false); | ||
const { tonConnectUI } = useTonConnectUI(); | ||
|
||
onMounted(() => { | ||
if (tonConnectUI) { | ||
tonConnectUI.connectionRestored.then(() => { | ||
restored.value = true; | ||
}); | ||
} | ||
}); | ||
onMounted(() => { | ||
if (tonConnectUI?.closeModal) { | ||
tonConnectUI.connectionRestored.then(() => { | ||
restored.value = true; | ||
}); | ||
} | ||
}); | ||
|
||
return restored; | ||
return restored; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { computed } from 'vue-demi'; | ||
import { computed, ComputedRef } from 'vue-demi'; | ||
import { CHAIN, toUserFriendlyAddress } from '@tonconnect/ui'; | ||
import { useTonWallet } from './useTonWallet'; | ||
|
||
export function useTonAddress(userFriendly = true) { | ||
const wallet = useTonWallet(); | ||
export function useTonAddress(userFriendly = true): ComputedRef<string> { | ||
const wallet = useTonWallet(); | ||
|
||
const tonAddress = computed(() => { | ||
if (wallet.value) { | ||
return userFriendly | ||
? toUserFriendlyAddress( | ||
wallet.value.account.address, | ||
wallet.value.account.chain === CHAIN.TESTNET | ||
) | ||
: wallet.value.account.address; | ||
} else { | ||
return ''; | ||
} | ||
}); | ||
const tonAddress = computed(() => { | ||
if (wallet.value) { | ||
return userFriendly | ||
? toUserFriendlyAddress( | ||
wallet.value.account.address, | ||
wallet.value.account.chain === CHAIN.TESTNET, | ||
) | ||
: wallet.value.account.address; | ||
} else { | ||
return ''; | ||
} | ||
}); | ||
|
||
return tonAddress; | ||
} | ||
return tonAddress; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
import { ref, onMounted } from 'vue-demi'; | ||
import { ref, onMounted, Ref } from 'vue-demi'; | ||
import { useTonConnectUI } from './useTonConnectUI'; | ||
import { WalletsModalState } from '@tonconnect/ui'; | ||
|
||
export function useTonConnectModal() { | ||
const { tonConnectUI } = useTonConnectUI(); | ||
const state = ref<WalletsModalState | null>(tonConnectUI?.modal.state || null); | ||
export function useTonConnectModal(): { | ||
state: Ref<WalletsModalState | null>; | ||
open: () => void; | ||
close: () => void; | ||
} { | ||
const { tonConnectUI } = useTonConnectUI(); | ||
const state = ref<WalletsModalState | null>( | ||
tonConnectUI?.modal.state || null, | ||
); | ||
|
||
onMounted(() => { | ||
if (tonConnectUI) { | ||
state.value = tonConnectUI.modal.state; | ||
tonConnectUI.onModalStateChange((value: WalletsModalState) => { | ||
state.value = value; | ||
}); | ||
} | ||
}); | ||
onMounted(() => { | ||
if (tonConnectUI) { | ||
state.value = tonConnectUI.modal.state; | ||
|
||
return { | ||
state: state, | ||
open: () => tonConnectUI?.modal.open(), | ||
close: () => tonConnectUI?.modal.close() | ||
}; | ||
tonConnectUI.onModalStateChange((value: WalletsModalState) => { | ||
state.value = value; | ||
}); | ||
} | ||
}); | ||
|
||
return { | ||
state: state, | ||
open: () => tonConnectUI?.modal.open(), | ||
close: () => tonConnectUI?.modal.close(), | ||
}; | ||
} |
Oops, something went wrong.