Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
10xSebastian committed Apr 19, 2022
1 parent 8960ac6 commit cab20dc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
16 changes: 9 additions & 7 deletions dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,21 @@ var getAssets = async (options) => {
fetch(`https://public.depay.fi/accounts/${blockchain}/${address}/assets`, { signal: controller.signal })
.catch((error) => { console.log(error); resolve([]); })
.then((response) => {
if(response.success) {
if(response && response.success) {
return response.json()
} else {
resolve([]);
}
})
.then(async (assets) => {
return await ensureNativeTokenAsset({
address,
options,
assets: filterAssets({ assets, blockchain, options }).map((asset) => Object.assign(asset, { blockchain })),
blockchain
})
if(assets && assets.length) {
return await ensureNativeTokenAsset({
address,
options,
assets: filterAssets({ assets, blockchain, options }).map((asset) => Object.assign(asset, { blockchain })),
blockchain
})
}
})
.then(resolve)
.catch((error) => { console.log(error); resolve([]); });
Expand Down
16 changes: 9 additions & 7 deletions dist/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,21 @@
fetch(`https://public.depay.fi/accounts/${blockchain}/${address}/assets`, { signal: controller.signal })
.catch((error) => { console.log(error); resolve([]); })
.then((response) => {
if(response.success) {
if(response && response.success) {
return response.json()
} else {
resolve([]);
}
})
.then(async (assets) => {
return await ensureNativeTokenAsset({
address,
options,
assets: filterAssets({ assets, blockchain, options }).map((asset) => Object.assign(asset, { blockchain })),
blockchain
})
if(assets && assets.length) {
return await ensureNativeTokenAsset({
address,
options,
assets: filterAssets({ assets, blockchain, options }).map((asset) => Object.assign(asset, { blockchain })),
blockchain
})
}
})
.then(resolve)
.catch((error) => { console.log(error); resolve([]); });
Expand Down

0 comments on commit cab20dc

Please sign in to comment.