Browse Source

add accountAddress filter

main
ghost 10 months ago
parent
commit
f36d22393a
  1. 25
      src/Twig/AppExtension.php

25
src/Twig/AppExtension.php

@ -59,6 +59,13 @@ class AppExtension extends AbstractExtension @@ -59,6 +59,13 @@ class AppExtension extends AbstractExtension
'accountBalance'
]
),
new TwigFilter(
'account_address',
[
$this,
'accountAddress'
]
),
new TwigFilter(
'message_to_markdown',
[
@ -297,6 +304,24 @@ class AppExtension extends AbstractExtension @@ -297,6 +304,24 @@ class AppExtension extends AbstractExtension
);
}
public function accountAddress(
string $account
): ?string
{
// Connect kevacoin
$client = new \Kevachat\Kevacoin\Client(
$this->container->getParameter('app.kevacoin.protocol'),
$this->container->getParameter('app.kevacoin.host'),
$this->container->getParameter('app.kevacoin.port'),
$this->container->getParameter('app.kevacoin.username'),
$this->container->getParameter('app.kevacoin.password')
);
return $client->getAccountAddress(
$account
);
}
public function messageToMarkdown(
string $text
): string

Loading…
Cancel
Save