|
1 | 1 | <script lang="ts">
|
2 |
| - import { isNullish, nonNullish } from '@dfinity/utils'; |
3 |
| - import { address as solAddress } from '@solana/web3.js'; |
4 |
| - import { findAssociatedTokenPda } from '@solana-program/token'; |
| 2 | + import { isNullish } from '@dfinity/utils'; |
5 | 3 | import ReceiveButtonWithModal from '$lib/components/receive/ReceiveButtonWithModal.svelte';
|
6 | 4 | import ReceiveModal from '$lib/components/receive/ReceiveModal.svelte';
|
7 | 5 | import { modalSolReceive } from '$lib/derived/modal.derived';
|
|
23 | 21 | isNetworkIdSOLLocal,
|
24 | 22 | isNetworkIdSOLTestnet
|
25 | 23 | } from '$lib/utils/network.utils';
|
26 |
| - import { isTokenSpl } from '$sol/utils/spl.utils'; |
27 | 24 |
|
28 | 25 | export let token: Token;
|
29 | 26 |
|
|
39 | 36 |
|
40 | 37 | const isDisabled = (): boolean => isNullish(addressData) || !addressData.certified;
|
41 | 38 |
|
42 |
| - let ataAddress: SolAddress | undefined; |
43 |
| -
|
44 |
| - const updateAtaAddress = async () => { |
45 |
| - [ataAddress] = |
46 |
| - nonNullish(addressData) && isTokenSpl(token) |
47 |
| - ? await findAssociatedTokenPda({ |
48 |
| - owner: solAddress(addressData.data), |
49 |
| - tokenProgram: solAddress(token.owner), |
50 |
| - mint: solAddress(token.address) |
51 |
| - }) |
52 |
| - : [undefined]; |
53 |
| - }; |
54 |
| -
|
55 |
| - $: token, updateAtaAddress(); |
56 |
| -
|
| 39 | + // TODO: PRODSEC: provide the ATA address too in the receive modal for SPL tokens |
57 | 40 | let address: SolAddress | undefined;
|
58 |
| - $: address = nonNullish(ataAddress) ? ataAddress : addressData?.data; |
| 41 | + $: address = addressData?.data; |
59 | 42 |
|
60 | 43 | const openReceive = async (modalId: symbol) => {
|
61 | 44 | if (isDisabled()) {
|
|
0 commit comments