Skip to content

Commit

Permalink
v6.5.1: depay.com
Browse files Browse the repository at this point in the history
  • Loading branch information
10xSebastian committed Aug 7, 2022
1 parent 2837bd2 commit 58ab772
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="https://depay.fi/favicon.png"/>
<link rel="icon" type="image/png" href="https://depay.com/favicon.png"/>
<title>Development</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://cdn.ethers.io/lib/ethers-5.4.umd.min.js" type="application/javascript"></script>
Expand Down Expand Up @@ -33,8 +33,8 @@
<div class="container py-4">

<div class="py-2 pb-3 text-center">
<a href="https://depay.fi" target="_blank">
<img alt="DePay Logo" class="navbar-logo shadow-sm" src="https://depay.fi/logo.svg" style="height: 50px; width: 50px; border-radius: 999px;"/>
<a href="https://depay.com" target="_blank">
<img alt="DePay" class="navbar-logo shadow-sm" src="https://depay.com/logo.svg" style="height: 50px; width: 50px; border-radius: 999px;"/>
</a>
</div>

Expand Down
2 changes: 1 addition & 1 deletion dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var getAssets = async (options) => {
const address = options.accounts[blockchain];
const controller = new AbortController();
setTimeout(()=>controller.abort(), 10000);
fetch(`https://public.depay.fi/accounts/${blockchain}/${address}/assets`, { signal: controller.signal })
fetch(`https://public.depay.com/accounts/${blockchain}/${address}/assets`, { signal: controller.signal })
.catch((error) => { console.log(error); resolve([]); })
.then((response) => {
if(response && response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion dist/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
const address = options.accounts[blockchain];
const controller = new AbortController();
setTimeout(()=>controller.abort(), 10000);
fetch(`https://public.depay.fi/accounts/${blockchain}/${address}/assets`, { signal: controller.signal })
fetch(`https://public.depay.com/accounts/${blockchain}/${address}/assets`, { signal: controller.signal })
.catch((error) => { console.log(error); resolve([]); })
.then((response) => {
if(response && response.ok) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-assets",
"moduleName": "Web3Assets",
"version": "6.5.0",
"version": "6.5.1",
"description": "",
"main": "dist/umd/index.js",
"module": "dist/esm/index.js",
Expand All @@ -26,7 +26,7 @@
"crypto",
"blockchain"
],
"author": "depay.fi",
"author": "depay.com",
"license": "MIT",
"bugs": {
"url": "https://github.com/DePayFi/web3-assets/issues"
Expand Down
2 changes: 1 addition & 1 deletion src/getAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default async (options) => {
const address = options.accounts[blockchain]
const controller = new AbortController()
setTimeout(()=>controller.abort(), 10000)
fetch(`https://public.depay.fi/accounts/${blockchain}/${address}/assets`, { signal: controller.signal })
fetch(`https://public.depay.com/accounts/${blockchain}/${address}/assets`, { signal: controller.signal })
.catch((error) => { console.log(error); resolve([]) })
.then((response) => {
if(response && response.ok) {
Expand Down
8 changes: 4 additions & 4 deletions tests/units/dripAssets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('dripAssets', ()=>{
mock({ call: { return: '56789', to: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb', api: Token[blockchain].DEFAULT, method: 'balanceOf', params: accounts[0] }, provider, blockchain })
})

fetchMock.get({ url: `https://public.depay.fi/accounts/ethereum/${accounts[0]}/assets` },
fetchMock.get({ url: `https://public.depay.com/accounts/ethereum/${accounts[0]}/assets` },
[{
"name": "Ether",
"symbol": "ETH",
Expand All @@ -45,7 +45,7 @@ describe('dripAssets', ()=>{
}]
)

fetchMock.get({ url: `https://public.depay.fi/accounts/bsc/${accounts[0]}/assets` },
fetchMock.get({ url: `https://public.depay.com/accounts/bsc/${accounts[0]}/assets` },
[{
"name": "BNB Coin",
"symbol": "BNB",
Expand All @@ -62,7 +62,7 @@ describe('dripAssets', ()=>{
}]
)

fetchMock.get({ url: `https://public.depay.fi/accounts/polygon/${accounts[0]}/assets` },
fetchMock.get({ url: `https://public.depay.com/accounts/polygon/${accounts[0]}/assets` },
[{
"name": "Matic",
"symbol": "MATIC",
Expand Down Expand Up @@ -805,7 +805,7 @@ describe('dripAssets', ()=>{

it('completes drip', async ()=>{

fetchMock.get({ url: `https://public.depay.fi/accounts/ethereum/${accounts[0]}/assets`, overwriteRoutes: true }, 502)
fetchMock.get({ url: `https://public.depay.com/accounts/ethereum/${accounts[0]}/assets`, overwriteRoutes: true }, 502)

let drippedAssets = []
let dripsCount = 0
Expand Down
32 changes: 16 additions & 16 deletions tests/units/getAssets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('getAssets', ()=>{
it('fetches the assets for a given account without any connected wallet', async()=> {
let address = '0xEcA533Ef096f191A35DE76aa4580FA3A722724bE'
fetchMock.get({
url: `https://public.depay.fi/accounts/ethereum/${address}/assets`,
url: `https://public.depay.com/accounts/ethereum/${address}/assets`,
}, [{
"name": "Ether",
"symbol": "ETH",
Expand All @@ -31,7 +31,7 @@ describe('getAssets', ()=>{
}]
)
fetchMock.get({
url: `https://public.depay.fi/accounts/bsc/${address}/assets`,
url: `https://public.depay.com/accounts/bsc/${address}/assets`,
}, [{
"name": "BNB",
"symbol": "BNB",
Expand All @@ -47,7 +47,7 @@ describe('getAssets', ()=>{
}]
)
fetchMock.get({
url: `https://public.depay.fi/accounts/polygon/${address}/assets`,
url: `https://public.depay.com/accounts/polygon/${address}/assets`,
}, [{
"name": "Matic",
"symbol": "Matic",
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('getAssets', ()=>{
it('only fetches the requested assets (Type 20 Tokens)', async()=> {
let address = '0xEcA533Ef096f191A35DE76aa4580FA3A722724bE'
fetchMock.get({
url: `https://public.depay.fi/accounts/ethereum/${address}/assets`,
url: `https://public.depay.com/accounts/ethereum/${address}/assets`,
}, [{
"name": "Ether",
"symbol": "ETH",
Expand All @@ -136,7 +136,7 @@ describe('getAssets', ()=>{
}]
)
fetchMock.get({
url: `https://public.depay.fi/accounts/bsc/${address}/assets`,
url: `https://public.depay.com/accounts/bsc/${address}/assets`,
}, [{
"name": "BNB",
"symbol": "BNB",
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('getAssets', ()=>{
it('only fetches the requested assets (NATIVE Tokens)', async()=> {
let address = '0xEcA533Ef096f191A35DE76aa4580FA3A722724bE'
fetchMock.get({
url: `https://public.depay.fi/accounts/ethereum/${address}/assets`,
url: `https://public.depay.com/accounts/ethereum/${address}/assets`,
}, [{
"name": "Ether",
"symbol": "ETH",
Expand All @@ -190,7 +190,7 @@ describe('getAssets', ()=>{
}]
)
fetchMock.get({
url: `https://public.depay.fi/accounts/bsc/${address}/assets`,
url: `https://public.depay.com/accounts/bsc/${address}/assets`,
}, [{
"name": "BNB",
"symbol": "BNB",
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('getAssets', ()=>{
it('excludes assets (Type 20 Tokens)', async()=> {
let address = '0xEcA533Ef096f191A35DE76aa4580FA3A722724bE'
fetchMock.get({
url: `https://public.depay.fi/accounts/ethereum/${address}/assets`,
url: `https://public.depay.com/accounts/ethereum/${address}/assets`,
}, [{
"name": "Ether",
"symbol": "ETH",
Expand All @@ -247,7 +247,7 @@ describe('getAssets', ()=>{
}]
)
fetchMock.get({
url: `https://public.depay.fi/accounts/bsc/${address}/assets`,
url: `https://public.depay.com/accounts/bsc/${address}/assets`,
}, [{
"name": "BNB",
"symbol": "BNB",
Expand Down Expand Up @@ -285,7 +285,7 @@ describe('getAssets', ()=>{
it('excludes assets (NATIVE Tokens)', async()=> {
let address = '0xEcA533Ef096f191A35DE76aa4580FA3A722724bE'
fetchMock.get({
url: `https://public.depay.fi/accounts/ethereum/${address}/assets`,
url: `https://public.depay.com/accounts/ethereum/${address}/assets`,
}, [{
"name": "Ether",
"symbol": "ETH",
Expand All @@ -301,7 +301,7 @@ describe('getAssets', ()=>{
}]
)
fetchMock.get({
url: `https://public.depay.fi/accounts/bsc/${address}/assets`,
url: `https://public.depay.com/accounts/bsc/${address}/assets`,
}, [{
"name": "BNB",
"symbol": "BNB",
Expand Down Expand Up @@ -342,7 +342,7 @@ describe('getAssets', ()=>{
beforeEach(()=>{
mock({ blockchain: 'ethereum', wallet: 'metamask' })
fetchMock.get({
url: 'https://public.depay.fi/accounts/ethereum/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
url: 'https://public.depay.com/accounts/ethereum/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
}, [{
"name": "Dai Stablecoin",
"symbol": "DAI",
Expand All @@ -351,7 +351,7 @@ describe('getAssets', ()=>{
}]
)
fetchMock.get({
url: 'https://public.depay.fi/accounts/bsc/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
url: 'https://public.depay.com/accounts/bsc/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
}, [{
"name": "PancakeSwap",
"symbol": "CAKE",
Expand Down Expand Up @@ -394,11 +394,11 @@ describe('getAssets', ()=>{
it('still resolves with nothing', async()=> {
let address = '0xEcA533Ef096f191A35DE76aa4580FA3A722724bE'
fetchMock.get({
url: `https://public.depay.fi/accounts/ethereum/${address}/assets`,
url: `https://public.depay.com/accounts/ethereum/${address}/assets`,
}, 502
)
fetchMock.get({
url: `https://public.depay.fi/accounts/bsc/${address}/assets`,
url: `https://public.depay.com/accounts/bsc/${address}/assets`,
}, [{
"name": "BNB",
"symbol": "BNB",
Expand Down Expand Up @@ -435,7 +435,7 @@ describe('getAssets', ()=>{
])

fetchMock.get({
url: `https://public.depay.fi/accounts/bsc/${address}/assets`,
url: `https://public.depay.com/accounts/bsc/${address}/assets`,
overwriteRoutes: true
}, 502
)
Expand Down

0 comments on commit 58ab772

Please sign in to comment.