From f55de14837f4d8cc7b5ad0249d185ff2b1c16353 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Fri, 22 Nov 2024 13:00:44 +0700 Subject: [PATCH] add skip widget --- components/Deposit.tsx | 59 +- components/Staking.tsx | 5 +- package.json | 1 + pnpm-lock.yaml | 17161 ++++++++++++++++++++++++++++++++------- 4 files changed, 14438 insertions(+), 2788 deletions(-) diff --git a/components/Deposit.tsx b/components/Deposit.tsx index 8853926..bb943d9 100644 --- a/components/Deposit.tsx +++ b/components/Deposit.tsx @@ -1,29 +1,26 @@ +import React, { useState } from 'react'; +import { Widget } from '@skip-go/widget'; import { client } from '@/components/penumbra'; import { useQuestStore } from '@/components/store'; -import { - getAmountFromRecord, - getAssetIdFromRecord, -} from '@penumbra-zone/getters/spendable-note-record'; import { ViewService } from '@penumbra-zone/protobuf'; import { ValueView } from '@penumbra-zone/protobuf/penumbra/core/asset/v1/asset_pb'; import type { CommitmentSource_Ics20Transfer } from '@penumbra-zone/protobuf/penumbra/core/component/sct/v1/sct_pb'; -import { AddressView } from '@penumbra-zone/protobuf/penumbra/core/keys/v1/keys_pb'; import type { NotesResponse } from '@penumbra-zone/protobuf/penumbra/view/v1/view_pb'; -import { AddressViewComponent } from '@penumbra-zone/ui/AddressViewComponent'; import { ValueViewComponent } from '@penumbra-zone/ui/ValueViewComponent'; import { useQuery } from '@tanstack/react-query'; import { capitalize } from 'es-toolkit'; import { ChevronRightIcon } from 'lucide-react'; -import type React from 'react'; -import { useState } from 'react'; import { useConnect, useCurrentChainStatus, - useEphemeralAddress, useNotes, useSetScanSinceBlock, useWalletManifests, } from './hooks'; +import { + getAmountFromRecord, + getAssetIdFromRecord, +} from '@penumbra-zone/getters/spendable-note-record'; const Deposit: React.FC = () => { useSetScanSinceBlock(); @@ -81,9 +78,12 @@ const Deposit: React.FC = () => { }, }); - const { data: ibcInAddress } = useEphemeralAddress({ - index: 0, - }); + const defaultRoute = { + srcChainId: 'noble-1', + srcAssetDenom: 'uusdc', + destChainId: 'penumbra-1', + destAssetDenom: 'ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349' + }; return (
@@ -91,27 +91,34 @@ const Deposit: React.FC = () => { The  Skip App -   is an easy way to deposit funds into Penumbra. +  makes it easy to deposit funds into Penumbra. Select a source asset and chain (e.g., USDC) and set Penumbra as the destination chain. - Then initiate the deposit and come back to this page. + Or use the widget below to start your deposit: +
+ +
+
{!isLoading && wallets && !connected && Object.entries(wallets).map(([origin, manifest]) => ( - // biome-ignore lint: no need for a type here