Skip to content

Commit

Permalink
v5.3.1: use public endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
10xSebastian committed Mar 4, 2022
1 parent 3a1bb40 commit 65cb023
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getAssets = async (options) => {
let assets = Promise.all(
(options.blockchain ? [options.blockchain] : wallet.blockchains).map((blockchain) =>{

return fetch(`https://api.depay.fi/v2/accounts/${blockchain}/${account}/assets`)
return fetch(`https://public.depay.fi/accounts/${blockchain}/${account}/assets`)
.then((response) => response.json())
.then(async (assets) => {
return await ensureNativeTokenAsset({
Expand Down
2 changes: 1 addition & 1 deletion dist/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
let assets = Promise.all(
(options.blockchain ? [options.blockchain] : wallet.blockchains).map((blockchain) =>{

return fetch(`https://api.depay.fi/v2/accounts/${blockchain}/${account}/assets`)
return fetch(`https://public.depay.fi/accounts/${blockchain}/${account}/assets`)
.then((response) => response.json())
.then(async (assets) => {
return await ensureNativeTokenAsset({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-assets",
"moduleName": "Web3Assets",
"version": "5.3.0",
"version": "5.3.1",
"description": "",
"main": "dist/umd/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getAssets = async (options) => {
let assets = Promise.all(
(options.blockchain ? [options.blockchain] : undefined || wallet.blockchains).map((blockchain) =>{

return fetch(`https://api.depay.fi/v2/accounts/${blockchain}/${account}/assets`)
return fetch(`https://public.depay.fi/accounts/${blockchain}/${account}/assets`)
.then((response) => response.json())
.then(async (assets) => {
return await ensureNativeTokenAsset({
Expand Down
10 changes: 5 additions & 5 deletions tests/units/getAssets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('assets', ()=>{
beforeEach(()=>{
mock({ blockchain: 'ethereum', wallet: 'metamask' })
fetchMock.get({
url: 'https://api.depay.fi/v2/accounts/ethereum/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
url: 'https://public.depay.fi/v2/accounts/ethereum/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
}, [{
"name": "Ether",
"symbol": "ETH",
Expand All @@ -34,7 +34,7 @@ describe('assets', ()=>{
}]
)
fetchMock.get({
url: 'https://api.depay.fi/v2/accounts/bsc/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
url: 'https://public.depay.fi/v2/accounts/bsc/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
}, [{
"name": "Binance Coin",
"symbol": "BNB",
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('assets', ()=>{
it('fetches the assets for a given account without any connected wallet', async()=> {
let account = '0xEcA533Ef096f191A35DE76aa4580FA3A722724bE'
fetchMock.get({
url: `https://api.depay.fi/v2/accounts/ethereum/${account}/assets`,
url: `https://public.depay.fi/v2/accounts/ethereum/${account}/assets`,
}, [{
"name": "Ether",
"symbol": "ETH",
Expand Down Expand Up @@ -164,7 +164,7 @@ describe('assets', ()=>{
beforeEach(()=>{
mock({ blockchain: 'ethereum', wallet: 'metamask' })
fetchMock.get({
url: 'https://api.depay.fi/v2/accounts/ethereum/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
url: 'https://public.depay.fi/v2/accounts/ethereum/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
}, [{
"name": "Dai Stablecoin",
"symbol": "DAI",
Expand All @@ -173,7 +173,7 @@ describe('assets', ()=>{
}]
)
fetchMock.get({
url: 'https://api.depay.fi/v2/accounts/bsc/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
url: 'https://public.depay.fi/v2/accounts/bsc/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/assets',
}, [{
"name": "PancakeSwap",
"symbol": "CAKE",
Expand Down

0 comments on commit 65cb023

Please sign in to comment.