'; } // ----------------------------------------------------------------------------- // LANDING PAGE // ----------------------------------------------------------------------------- function g1wallet_render_landing($access) { $channel_id = local_channel(); $stored_addr = $channel_id ? get_pconfig($channel_id, 'g1wallet', 'g1_address') : ''; $balance = ''; // If address is stored, fetch balance via cry01 chain query. if ($stored_addr) { $balance = g1wallet_fetch_balance($stored_addr); } $out = '
'; $out .= '

Ğ1 Wallet

'; $out .= '

Register your Ğ1 address to display your balance and participate in cost-bearing civic actions.

'; // Optional notice $out .= '
'; $out .= 'Optional. The Ğ1 Wallet is not required for browsing or submitting diagnostic records. '; $out .= 'However, future actions such as Scenario submission will require a small Ğ1 payment. '; $out .= 'The transaction record serves as proof of participation and is included in the attestation record.'; $out .= '
'; // Current address + balance if ($stored_addr) { $out .= '
'; $out .= '
Registered Address
'; $out .= '

' . g1wallet_h($stored_addr) . '

'; if ($balance !== '') { $out .= '

Balance: ' . g1wallet_h($balance) . ' Ğ1

'; } else { $out .= '

Balance unavailable.

'; } $out .= '
'; } // Address registration form $out .= '
'; $out .= '
' . ($stored_addr ? 'Update Address' : 'Register Your Ğ1 Address') . '
'; $out .= '

Paste your Ğ1 address (starts with g1, 46–47 characters). '; $out .= 'You can find it in the Ğecko app or any Ğ1 wallet application.

'; $out .= '
'; $out .= g1wallet_csrf_token(); $out .= '
'; $out .= ''; $out .= '
' . g1wallet_h($message) . '
'; }