-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* strk rewards new design implemented * hardcode bug resolved * button state handling and some iterations * added allocation dependencies to numbers * apr updated * reward pair name fixes * api url update for rewards * added loader * double currency logo handled
- Loading branch information
1 parent
0b92a7d
commit b2b6ddb
Showing
21 changed files
with
1,518 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { ApolloClient } from 'apollo-client' | ||
import { InMemoryCache } from 'apollo-cache-inmemory' | ||
import { HttpLink } from 'apollo-link-http' | ||
import { getApiUrl } from '../constants' | ||
|
||
export const jediSwapClient = new ApolloClient({ | ||
link: new HttpLink({ | ||
uri: getApiUrl(), | ||
headers: { | ||
// 'm-color': 'blue', | ||
} | ||
}), | ||
cache: new InMemoryCache({ | ||
dataIdFromObject: object => { | ||
switch (object.__typename) { | ||
case 'TokenDayData': { | ||
return `${object.tokenAddress}${object.datetime}` | ||
} | ||
case 'FactoryDayData': { | ||
return `${object.id}${object.dayId}` | ||
} | ||
case 'Token': { | ||
return `${object.tokenAddress}${object.name}` | ||
} | ||
case 'Pool': { | ||
return `${object.poolAddress}${object.datetime}` | ||
} | ||
default: { | ||
return object.id || object._id | ||
} | ||
} | ||
} | ||
}), | ||
shouldBatch: true | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import gql from 'graphql-tag' | ||
|
||
export const PAIRS_DATA_FOR_REWARDS = ({ pairIds = [] }) => { | ||
const poolsString = `[${pairIds.map(pool => `"${pool}"`).join(',')}]` | ||
let queryString = ` | ||
query pairDayDatas { | ||
pairDayDatas( | ||
where: { | ||
pairIn: ${poolsString}, | ||
} | ||
orderBy: "date" | ||
orderByDirection: "desc" | ||
first: ${10 * pairIds.length} | ||
) { | ||
pairId | ||
date | ||
dailyVolumeUSD | ||
reserveUSD | ||
} | ||
} | ||
` | ||
return gql(queryString) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
[ | ||
{ | ||
"name": "Distributor", | ||
"type": "impl", | ||
"interface_name": "distributor::contract::IDistributor" | ||
}, | ||
{ | ||
"name": "core::array::Span::<core::felt252>", | ||
"type": "struct", | ||
"members": [ | ||
{ | ||
"name": "snapshot", | ||
"type": "@core::array::Array::<core::felt252>" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "distributor::contract::IDistributor", | ||
"type": "interface", | ||
"items": [ | ||
{ | ||
"name": "claim", | ||
"type": "function", | ||
"inputs": [ | ||
{ | ||
"name": "amount", | ||
"type": "core::integer::u128" | ||
}, | ||
{ | ||
"name": "proof", | ||
"type": "core::array::Span::<core::felt252>" | ||
} | ||
], | ||
"outputs": [], | ||
"state_mutability": "external" | ||
}, | ||
{ | ||
"name": "add_root", | ||
"type": "function", | ||
"inputs": [ | ||
{ | ||
"name": "new_root", | ||
"type": "core::felt252" | ||
} | ||
], | ||
"outputs": [], | ||
"state_mutability": "external" | ||
}, | ||
{ | ||
"name": "get_root_for", | ||
"type": "function", | ||
"inputs": [ | ||
{ | ||
"name": "claimee", | ||
"type": "core::starknet::contract_address::ContractAddress" | ||
}, | ||
{ | ||
"name": "amount", | ||
"type": "core::integer::u128" | ||
}, | ||
{ | ||
"name": "proof", | ||
"type": "core::array::Span::<core::felt252>" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"type": "core::felt252" | ||
} | ||
], | ||
"state_mutability": "view" | ||
}, | ||
{ | ||
"name": "amount_already_claimed", | ||
"type": "function", | ||
"inputs": [ | ||
{ | ||
"name": "claimee", | ||
"type": "core::starknet::contract_address::ContractAddress" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"type": "core::integer::u128" | ||
} | ||
], | ||
"state_mutability": "view" | ||
}, | ||
{ | ||
"name": "roots", | ||
"type": "function", | ||
"inputs": [], | ||
"outputs": [ | ||
{ | ||
"type": "core::array::Span::<core::felt252>" | ||
} | ||
], | ||
"state_mutability": "view" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "constructor", | ||
"type": "constructor", | ||
"inputs": [ | ||
{ | ||
"name": "owner", | ||
"type": "core::starknet::contract_address::ContractAddress" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "struct", | ||
"name": "distributor::contract::Distributor::Claimed", | ||
"type": "event", | ||
"members": [ | ||
{ | ||
"kind": "data", | ||
"name": "claimee", | ||
"type": "core::starknet::contract_address::ContractAddress" | ||
}, | ||
{ | ||
"kind": "data", | ||
"name": "amount", | ||
"type": "core::integer::u128" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "struct", | ||
"name": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferred", | ||
"type": "event", | ||
"members": [ | ||
{ | ||
"kind": "key", | ||
"name": "previous_owner", | ||
"type": "core::starknet::contract_address::ContractAddress" | ||
}, | ||
{ | ||
"kind": "key", | ||
"name": "new_owner", | ||
"type": "core::starknet::contract_address::ContractAddress" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "struct", | ||
"name": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferStarted", | ||
"type": "event", | ||
"members": [ | ||
{ | ||
"kind": "key", | ||
"name": "previous_owner", | ||
"type": "core::starknet::contract_address::ContractAddress" | ||
}, | ||
{ | ||
"kind": "key", | ||
"name": "new_owner", | ||
"type": "core::starknet::contract_address::ContractAddress" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "enum", | ||
"name": "openzeppelin::access::ownable::ownable::OwnableComponent::Event", | ||
"type": "event", | ||
"variants": [ | ||
{ | ||
"kind": "nested", | ||
"name": "OwnershipTransferred", | ||
"type": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferred" | ||
}, | ||
{ | ||
"kind": "nested", | ||
"name": "OwnershipTransferStarted", | ||
"type": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferStarted" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "enum", | ||
"name": "distributor::contract::Distributor::Event", | ||
"type": "event", | ||
"variants": [ | ||
{ | ||
"kind": "nested", | ||
"name": "Claimed", | ||
"type": "distributor::contract::Distributor::Claimed" | ||
}, | ||
{ | ||
"kind": "nested", | ||
"name": "OwnableEvent", | ||
"type": "openzeppelin::access::ownable::ownable::OwnableComponent::Event" | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.