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: 4 additions & 2 deletions src/ui/config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ module.exports = function override(config) {
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify'),
path: require.resolve('path-browserify'),
url: require.resolve('url')
url: require.resolve('url'),
fs: false,
vm: require.resolve('vm-browserify'),
});
config.resolve.fallback = fallback;
config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
process: 'process/browser',
process: 'process/browser.js',
Buffer: ['buffer', 'Buffer']
})
]);
Expand Down
5,440 changes: 3,149 additions & 2,291 deletions src/ui/package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.2.0",
"private": true,
"dependencies": {
"@airgap/beacon-sdk": "^4.2.1",
"@airgap/beacon-sdk": "^4.6.4",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
Expand Down Expand Up @@ -39,9 +39,9 @@
"@types/node": "^16.11.10",
"@types/node-fetch": "^3.0.3",
"@typescript-eslint/parser": "^5.4.0",
"assert": "^2.0.0",
"assert": "^2.1.0",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"crypto-browserify": "^3.12.1",
"eslint": "^7.18.0",
"eslint-config-airbnb-base": "^15.0.0",
"https-browserify": "^1.0.0",
Expand All @@ -54,7 +54,8 @@
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"typescript": "^4.5.2",
"url": "^0.11.0"
"url": "^0.11.4",
"vm-browserify": "^1.1.2"
},
"scripts": {
"start": "DISABLE_ESLINT_PLUGIN=true REACT_APP_ENV=dev npm run patch && react-app-rewired start",
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/components/Dashboard/BorrowMarketTokenTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const BorrowMarketTokenTable = (props) => {
process.env.REACT_APP_ENV == 'dev' ? testnetAddresses.fTokens[asset] : mainnetAddresses.fTokens[asset];
const tzktUrl =
process.env.REACT_APP_ENV == "dev"
? `https://ghostnet.tzkt.io/${fTokenAddress}/operations`
? `https://shadownet.tzkt.io/${fTokenAddress}/operations`
: `https://tzkt.io/${fTokenAddress}/operations`;
window.open(tzktUrl, '_blank');
};
Expand Down
4 changes: 2 additions & 2 deletions src/ui/src/library/dev-network-config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"infra": {
"tezosNode": "https://ghostnet.ecadinfra.com",
"tezosNode": "https://rpc.shadownet.teztnets.com",
"conseilServer": {
"url": "https://conseil-ithaca.cryptonomic-infra.tech:443",
"apiKey": "",
"network": "ghostnet"
"network": "shadownet"
}
},
"dappName": "Lending Platform"
Expand Down
7 changes: 2 additions & 5 deletions src/ui/src/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TezosLendingPlatform } from 'tezoslendingplatformjs';
// eslint-disable-next-line import/no-dynamic-require
const config = require(`../library/${process.env.REACT_APP_ENV || 'prod'}-network-config.json`);

const client = new DAppClient({ name: config.dappName, preferredNetwork: config.infra.conseilServer.network });
const client = new DAppClient({ name: config.dappName, network: { type: config.infra.conseilServer.network } });

/**
* This function is used to truncate a blockchain address for presentation by replacing the middle digits with an ellipsis.
Expand All @@ -26,10 +26,7 @@ export const shorten = (first, last, str) => `${str.substring(0, first)}...${str
* @returns clients
*/
export const getWallet = async () => {
const { network } = config.infra.conseilServer;
const response = await client.requestPermissions({
network: { type: network },
});
const response = await client.requestPermissions();
const { address } = response;
return { address };
};
Expand Down
54 changes: 27 additions & 27 deletions src/util/src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@ export const decimals = {

export const testnetAddresses: ProtocolAddresses = {
fTokens: {
USDT: "KT1P51AJbS1iBvAXstqsPv4UJeQ8fGCZbS7P",
USD: "KT1QtSBzy61AmUcsjqQbMSdnr1ifP9RQ2Zug",
XTZ: "KT1CC4E5zmbJm94VwLf7ZEoJvC2tEqzE8Pqp",
TZBTC: "KT1JrHK7S9zZ5bA1xTBxNnkieM9YL7iq1KdB",
STXTZ: "KT1CqeRyoTMo7zpPbLgXSbGDzPyUK5ZwwNdD"
USDT: "KT1ASpbBxR9iPofuyk2E1PEd3UELYwBC5oMA",
USD: "KT1KgEk7HvkVVsD29tkot6V1EE1NWRgFgteT",
XTZ: "KT1Wi7C2Ytr39euYaMj3V7Qx3FZsQKDqHFr3",
TZBTC: "KT1BcaacbEMUG5P3ZNV2CqDa5G8NYEwgVad6",
STXTZ: "KT1KjA8kJ7Egj83j9gyrxcXjisUoDPGsxqAA"
},
fTokensReverse: {
KT1CC4E5zmbJm94VwLf7ZEoJvC2tEqzE8Pqp: AssetType.XTZ,
KT1QtSBzy61AmUcsjqQbMSdnr1ifP9RQ2Zug: AssetType.USD,
KT1P51AJbS1iBvAXstqsPv4UJeQ8fGCZbS7P: AssetType.USDT,
KT1JrHK7S9zZ5bA1xTBxNnkieM9YL7iq1KdB: AssetType.TZBTC,
KT1CqeRyoTMo7zpPbLgXSbGDzPyUK5ZwwNdD: AssetType.STXTZ
KT1Wi7C2Ytr39euYaMj3V7Qx3FZsQKDqHFr3: AssetType.XTZ,
KT1KgEk7HvkVVsD29tkot6V1EE1NWRgFgteT: AssetType.USD,
KT1ASpbBxR9iPofuyk2E1PEd3UELYwBC5oMA: AssetType.USDT,
KT1BcaacbEMUG5P3ZNV2CqDa5G8NYEwgVad6: AssetType.TZBTC,
KT1KjA8kJ7Egj83j9gyrxcXjisUoDPGsxqAA: AssetType.STXTZ
},
underlying: {
USD: {
assetType: AssetType.USD,
address: "KT1WatnVAD7GSdZZrQVm1oMgEnqPCnKNuqrn",
balancesMapId: 468865,
address: "KT1RBgHqPFPQX2TWzRAkQDqW5Fvnu3hC2FJb",
balancesMapId: 1356,
tokenStandard: TokenStandard.FA12,
decimals: 6,
balancesPath: "$.args[1].int",
balancesPath: "$.args[0].int",
},
TZBTC: {
assetType: AssetType.TZBTC,
address: "KT1DSBWogEEkLyk9UysA9p91v7xPvzV18Vu7",
balancesMapId: 468862,
address: "KT1VqarPDicMFn1ejmQqqshUkUXTCTXwmkCN",
balancesMapId: 0,
tokenStandard: TokenStandard.FA12,
decimals: 8,
balancesPath: "$.args[1].int",
Expand All @@ -57,9 +57,9 @@ export const testnetAddresses: ProtocolAddresses = {
assetType: AssetType.USDT,
tokenStandard: TokenStandard.FA2,
decimals: 6,
address: "KT1Rr8vMLzQ4BQghUjGZerB5WrV1hTtVjtUb",
address: "KT1UhW3RdZ6qDMhkCbztVxFFY4eZ8uzfT5aN",
tokenId: 0,
balancesMapId: 468868,
balancesMapId: 1460,
balancesPath: "$.int",
},
XTZ: {
Expand All @@ -72,21 +72,21 @@ export const testnetAddresses: ProtocolAddresses = {
tokenStandard: TokenStandard.FA2,
decimals: 6,
tokenId: 0,
address: "KT1Rh7wPQ8tmSGFHtXaYe1khGPPoL73pLB4w",
balancesMapId: 472857,
address: "KT1WGp1JQvT3roE9YDhHw1Aq1NpY68Fvps1f",
balancesMapId: 1488,
balancesPath: "$.int",
}
},
comptroller: "KT1R2sHBKvaja5ZVZzLv5VcoAUNfSYoYFDrX",
comptroller: "KT1WDtRBjC5whoGQw9CTf4nu5tNAVYvATp7D",
interestRateModel: {
XTZ: "KT1XNBkP1irKJgC1DGWFqD8Je1tdcoyuDoha",
USDT: "KT1XNBkP1irKJgC1DGWFqD8Je1tdcoyuDoha",
USD: "KT1XNBkP1irKJgC1DGWFqD8Je1tdcoyuDoha",
TZBTC: "KT1XNBkP1irKJgC1DGWFqD8Je1tdcoyuDoha",
STXTZ: "KT1XNBkP1irKJgC1DGWFqD8Je1tdcoyuDoha"
XTZ: "KT1K9aH2jWKvNUDRs5GziCtLpb7eZrJeqZVy",
USDT: "KT1K9aH2jWKvNUDRs5GziCtLpb7eZrJeqZVy",
USD: "KT1K9aH2jWKvNUDRs5GziCtLpb7eZrJeqZVy",
TZBTC: "KT1K9aH2jWKvNUDRs5GziCtLpb7eZrJeqZVy",
STXTZ: "KT1K9aH2jWKvNUDRs5GziCtLpb7eZrJeqZVy"
},
governance: "KT1ELnYzaxQBULdfJXBc7iAVfudd4ktqvdhA",
oracle: "KT1CMqReAqNznZf5CYQQM5HDe5cnVPM3SwyL",
governance: "KT1Dv2zRviAzW4NeGdfbVWmt5jZ8vvJpRFsq",
oracle: "KT1NwzLYM8G8rzAuUutYzZgx1TgUXCFJhxyw",
};

export const mainnetAddresses: ProtocolAddresses = {
Expand Down