Skip to content

Commit

Permalink
Remove Covalent integration (#1751)
Browse files Browse the repository at this point in the history
  • Loading branch information
nya-elimu authored Jul 18, 2024
2 parents 256d006 + 6f80725 commit 19831a3
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
<Arg>github_api_secret</Arg>
<Arg>**********</Arg>
</Call>
<Call name="setAttribute">
<Arg>covalent_api_key</Arg>
<Arg>**********</Arg>
</Call>
<Call name="setAttribute">
<Arg>discord_webhook_url</Arg>
<Arg>**********</Arg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
<Arg>github_api_secret</Arg>
<Arg>**********</Arg>
</Call>
<Call name="setAttribute">
<Arg>covalent_api_key</Arg>
<Arg>**********</Arg>
</Call>
<Call name="setAttribute">
<Arg>discord_webhook_url</Arg>
<Arg>**********</Arg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ This file is placed on the prod server under $JETTY_HOME/webapps/
<Arg>github_api_secret</Arg>
<Arg>************</Arg>
</Call>
<Call name="setAttribute">
<Arg>covalent_api_key</Arg>
<Arg>************</Arg>
</Call>
<Call name="setAttribute">
<Arg>discord_webhook_url</Arg>
<Arg>************</Arg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ This file is placed on the prod server under $JETTY_HOME/webapps/
<Arg>github_api_secret</Arg>
<Arg>************</Arg>
</Call>
<Call name="setAttribute">
<Arg>covalent_api_key</Arg>
<Arg>************</Arg>
</Call>
<Call name="setAttribute">
<Arg>discord_webhook_url</Arg>
<Arg>************</Arg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ This file is placed on the test server under $JETTY_HOME/webapps/
<Arg>github_api_secret</Arg>
<Arg>************</Arg>
</Call>
<Call name="setAttribute">
<Arg>covalent_api_key</Arg>
<Arg>************</Arg>
</Call>
<Set name="virtualHosts">
<Array type="java.lang.String">
<Item>eng.test.elimu.ai</Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ This file is placed on the test server under $JETTY_HOME/webapps/
<Arg>github_api_secret</Arg>
<Arg>************</Arg>
</Call>
<Call name="setAttribute">
<Arg>covalent_api_key</Arg>
<Arg>************</Arg>
</Call>
<Set name="virtualHosts">
<Array type="java.lang.String">
<Item>fil.test.elimu.ai</Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ protected void customizeContext(ServletContext servletContext, ConfigurableWebAp
String gitHubApiSecret = (String) servletContext.getAttribute("github_api_secret");
PROPERTIES.put("github.api.secret", gitHubApiSecret);

String covalentApiKey = (String) servletContext.getAttribute("covalent_api_key");
PROPERTIES.put("covalent.api.key", covalentApiKey);

if (env == Environment.PROD) {
String discordWebhookUrl = (String) servletContext.getAttribute("discord_webhook_url");
PROPERTIES.put("discord.webhook.url", discordWebhookUrl);
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,5 @@ pom.version=${project.version}
# See https://github.com/elimu-ai/model/blob/main/src/main/java/ai/elimu/model/v2/enums/Language.java
content.language=ENG

# Create free API key using https://www.covalenthq.com/platform/#/auth/register/
# It will be used to get ETH transaction data from https://www.covalenthq.com/docs/api/#get-/v1/{chain_id}/address/{address}/transactions_v2/
covalent.api.key=USE_YOUR_API_KEY

# Used to fetch latest transactions
donationAddress=0x883753Beab357A2c29f3766C6ad158e72A78ce51
47 changes: 0 additions & 47 deletions src/main/webapp/WEB-INF/jsp/contributions/donate.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -50,53 +50,6 @@
</p>
</div>

<h4>Most Recent Donations</h4>
<div class="card-panel">
<div id="eth-donations-container">
<div class="progress">
<div class="indeterminate"></div>
</div>
<p>
Loading...
</p>
</div>
<script>
var url = 'https://api.covalenthq.com/v1/1/address/${applicationScope.configProperties['donationAddress']}/transactions_v2/?key=${applicationScope.configProperties['covalent.api.key']}';
fetch(new Request(url)).then(function(response) {
if (!response.ok) {
throw new Error('response.status: ${response.status}');
}
response.json().then(function(responseJson) {
var $table = $('<table class="donation-list"><tr><th>Donation date</th><th>Donor address</th><th>Donated amount</th></tr></table>')
responseJson.data.items.forEach((item) => {
if ((item.from_address != ${applicationScope.configProperties['donationAddress']})
&& (item.value > 0)) {
var dateTime = new Date(item.block_signed_at);
var cell1 = '<td><code>' + dateTime.toISOString().split('T')[0] + '</code></td>';
var cell2 = '<td><code>' + item.from_address.substring(0, 6) + '...' + item.from_address.substring(38, 42) + '</code></td>';
var cell3 = '<td><code><a href="https://etherscan.io/tx/' + item.tx_hash + '" target="_blank">' + (item.value / 1000000000000000000).toFixed(4) + ' ETH</a></code></td>';
$('<tr>' + cell1 + cell2 + cell3 + '</tr>').appendTo($table);
}
});
$('#eth-donations-container').html($table);
});
});
</script>

<c:choose>
<c:when test="${applicationScope.configProperties['env'] != 'PROD'}">
<a href="https://rinkeby.etherscan.io/address/0x883753Beab357A2c29f3766C6ad158e72A78ce51" target="_blank">
View all transactions <i class="material-icons">launch</i>
</a>
</c:when>
<c:otherwise>
<a href="https://etherscan.io/address/0x883753Beab357A2c29f3766C6ad158e72A78ce51" target="_blank">
View all transactions <i class="material-icons">launch</i>
</a>
</c:otherwise>
</c:choose>
</div>

<div class="divider" style="margin: 1.5em 0;"></div>

<h3>Allocation of Donated Funds</h3>
Expand Down

0 comments on commit 19831a3

Please sign in to comment.