Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/create-typink-template-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
APPDIR="${WORKDIR}/test-app-${T}"

# Pick one network based on template family
NETWORK="Aleph Zero Testnet"
if [[ "$T" == v6-* ]]; then
NETWORK="Passet Hub"
NETWORK="Passet Hub"
if [[ "$T" == inkv5-* ]]; then
NETWORK="Pop Testnet"
fi

echo "=== Creating ${T} (Node 20 + Bun) ==="
Expand Down
2 changes: 2 additions & 0 deletions packages/create-typink/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const CONTRACT_TYPES_CHOICES = [
] as const;

export const PALLET_CONTRACTS_NETWORKS = [
{ name: 'Pop Testnet', value: 'popTestnet', address: '12L4yRvLh5qWSgS5ty5X7gPoL5UjUTpQvM81jioo1L48gkS5' },
{
name: 'Aleph Zero Testnet',
value: 'alephZeroTestnet',
Expand All @@ -66,6 +67,7 @@ export const PALLET_CONTRACTS_NETWORKS = [
] as const;

export const PALLET_REVIVE_NETWORKS = [
{ name: 'Pop Testnet', value: 'popTestnet', address: '0x73d678d38cd4b404223c4Ff8F0e7A5AF4beBA352' },
{ name: 'Passet Hub', value: 'passetHub', address: '0x87396fA7d7FcE9B3e4b11a733C98700968426c50' },
{ name: 'Kusama Asset Hub', value: 'kusamaAssetHub', address: '0xFf6A8342Ae4440D95BB5b9204a72f328c671b751' },
{ name: 'Westend Asset Hub', value: 'westendAssetHub', address: '0xA8237FBAC4387CBcc595757d9bA6DEA296332449' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ const WalletButton = ({ walletInfo, afterSelectWallet }: WalletButtonProps) => {
afterSelectWallet && afterSelectWallet();
};

const getStatusText = () => {
if (!installed) return 'Not Installed';
};

const getActionText = () => {
if (!installed) return 'Install';
return 'Connect';
};

return (
<div
className='flex items-center justify-between p-4 border border-gray-200 dark:border-gray-800 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors cursor-pointer group'
Expand All @@ -54,7 +45,7 @@ const WalletButton = ({ walletInfo, afterSelectWallet }: WalletButtonProps) => {
<img className='rounded-sm' src={logo} alt={`${name}`} width={32} height={32} />
<div className='flex flex-col'>
<span className='font-medium text-sm'>{name}</span>
<span className='text-xs text-red-500'>{getStatusText()}</span>
{!installed && <span className='text-xs text-red-500'>Not Installed</span>}
</div>
</div>
<Button
Expand Down Expand Up @@ -89,35 +80,9 @@ interface WalletSelectionProps {
buttonClassName?: string;
}

// Categorize wallets based on their name and type
const categorizeWallets = (wallets: Wallet[]) => {
const categories = {
Hardware: [] as Wallet[],
Remote: [] as Wallet[],
'Web Signer': [] as Wallet[],
Extensions: [] as Wallet[],
};

wallets.forEach((wallet) => {
const name = wallet.name.toLowerCase();
if (name.includes('ledger')) {
categories.Hardware.push(wallet);
} else if (name.includes('walletconnect')) {
categories.Remote.push(wallet);
} else if (name.includes('signer') || name.includes('dedot')) {
categories['Web Signer'].push(wallet);
} else {
categories.Extensions.push(wallet);
}
});

return categories;
};

export function WalletSelection({ buttonLabel = 'Connect Wallet', buttonClassName = '' }: WalletSelectionProps) {
const [isOpen, setIsOpen] = useState(false);
const { wallets } = useTypink();
const categorizedWallets = categorizeWallets(wallets);

return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ const WalletButton = ({ walletInfo, afterSelectWallet }: WalletButtonProps) => {
afterSelectWallet && afterSelectWallet();
};

const getStatusText = () => {
if (!installed) return 'Not Installed';
};

const getActionText = () => {
if (!installed) return 'Install';
return 'Connect';
};

return (
<div
className='flex items-center justify-between p-4 border border-gray-200 dark:border-gray-800 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors cursor-pointer group'
Expand All @@ -54,7 +45,7 @@ const WalletButton = ({ walletInfo, afterSelectWallet }: WalletButtonProps) => {
<img className='rounded-sm' src={logo} alt={`${name}`} width={32} height={32} />
<div className='flex flex-col'>
<span className='font-medium text-sm'>{name}</span>
<span className='text-xs text-red-500'>{getStatusText()}</span>
{!installed && <span className='text-xs text-red-500'>Not Installed</span>}
</div>
</div>
<Button
Expand Down Expand Up @@ -89,35 +80,9 @@ interface WalletSelectionProps {
buttonClassName?: string;
}

// Categorize wallets based on their name and type
const categorizeWallets = (wallets: Wallet[]) => {
const categories = {
Hardware: [] as Wallet[],
Remote: [] as Wallet[],
'Web Signer': [] as Wallet[],
Extensions: [] as Wallet[],
};

wallets.forEach((wallet) => {
const name = wallet.name.toLowerCase();
if (name.includes('ledger')) {
categories.Hardware.push(wallet);
} else if (name.includes('walletconnect')) {
categories.Remote.push(wallet);
} else if (name.includes('signer') || name.includes('dedot')) {
categories['Web Signer'].push(wallet);
} else {
categories.Extensions.push(wallet);
}
});

return categories;
};

export function WalletSelection({ buttonLabel = 'Connect Wallet', buttonClassName = '' }: WalletSelectionProps) {
const [isOpen, setIsOpen] = useState(false);
const { wallets } = useTypink();
const categorizedWallets = categorizeWallets(wallets);

return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ const WalletButton = ({ walletInfo, afterSelectWallet }: WalletButtonProps) => {
afterSelectWallet && afterSelectWallet();
};

const getStatusText = () => {
if (!installed) return 'Not Installed';
};

const getActionText = () => {
if (!installed) return 'Install';
return 'Connect';
};

return (
<div
className='flex items-center justify-between p-4 border border-gray-200 dark:border-gray-800 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors cursor-pointer group'
Expand All @@ -54,7 +45,7 @@ const WalletButton = ({ walletInfo, afterSelectWallet }: WalletButtonProps) => {
<img className='rounded-sm' src={logo} alt={`${name}`} width={32} height={32} />
<div className='flex flex-col'>
<span className='font-medium text-sm'>{name}</span>
<span className='text-xs text-red-500'>{getStatusText()}</span>
{!installed && <span className='text-xs text-red-500'>Not Installed</span>}
</div>
</div>
<Button
Expand Down Expand Up @@ -89,35 +80,9 @@ interface WalletSelectionProps {
buttonClassName?: string;
}

// Categorize wallets based on their name and type
const categorizeWallets = (wallets: Wallet[]) => {
const categories = {
Hardware: [] as Wallet[],
Remote: [] as Wallet[],
'Web Signer': [] as Wallet[],
Extensions: [] as Wallet[],
};

wallets.forEach((wallet) => {
const name = wallet.name.toLowerCase();
if (name.includes('ledger')) {
categories.Hardware.push(wallet);
} else if (name.includes('walletconnect')) {
categories.Remote.push(wallet);
} else if (name.includes('signer') || name.includes('dedot')) {
categories['Web Signer'].push(wallet);
} else {
categories.Extensions.push(wallet);
}
});

return categories;
};

export function WalletSelection({ buttonLabel = 'Connect Wallet', buttonClassName = '' }: WalletSelectionProps) {
const [isOpen, setIsOpen] = useState(false);
const { wallets } = useTypink();
const categorizedWallets = categorizeWallets(wallets);

return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ const WalletButton = ({ walletInfo, afterSelectWallet }: WalletButtonProps) => {
afterSelectWallet && afterSelectWallet();
};

const getStatusText = () => {
if (!installed) return 'Not Installed';
};

const getActionText = () => {
if (!installed) return 'Install';
return 'Connect';
};

return (
<div
className='flex items-center justify-between p-4 border border-gray-200 dark:border-gray-800 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors cursor-pointer group'
Expand All @@ -54,7 +45,7 @@ const WalletButton = ({ walletInfo, afterSelectWallet }: WalletButtonProps) => {
<img className='rounded-sm' src={logo} alt={`${name}`} width={32} height={32} />
<div className='flex flex-col'>
<span className='font-medium text-sm'>{name}</span>
<span className='text-xs text-red-500'>{getStatusText()}</span>
{!installed && <span className='text-xs text-red-500'>Not Installed</span>}
</div>
</div>
<Button
Expand Down Expand Up @@ -89,35 +80,9 @@ interface WalletSelectionProps {
buttonClassName?: string;
}

// Categorize wallets based on their name and type
const categorizeWallets = (wallets: Wallet[]) => {
const categories = {
Hardware: [] as Wallet[],
Remote: [] as Wallet[],
'Web Signer': [] as Wallet[],
Extensions: [] as Wallet[],
};

wallets.forEach((wallet) => {
const name = wallet.name.toLowerCase();
if (name.includes('ledger')) {
categories.Hardware.push(wallet);
} else if (name.includes('walletconnect')) {
categories.Remote.push(wallet);
} else if (name.includes('signer') || name.includes('dedot')) {
categories['Web Signer'].push(wallet);
} else {
categories.Extensions.push(wallet);
}
});

return categories;
};

export function WalletSelection({ buttonLabel = 'Connect Wallet', buttonClassName = '' }: WalletSelectionProps) {
const [isOpen, setIsOpen] = useState(false);
const { wallets } = useTypink();
const categorizedWallets = categorizeWallets(wallets);

return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
Expand Down