diff --git a/src/Contracts.svelte b/src/Contracts.svelte index 65217e7..2526db2 100644 --- a/src/Contracts.svelte +++ b/src/Contracts.svelte @@ -332,6 +332,23 @@ } gasCalculation = gasCalculation; // trigger recheck } + + const checkSlug = async() => { + if (!contractAddress.startsWith('0x')) { + try { + await fetch(`https://api.opensea.io/api/v1/collection/${contractAddress}`) + .then((response) => response.json()) + .then((data) => { + let a = data['collection']['primary_asset_contracts'][0]['address']; + if (a) { + contractAddress = a; + } + }); + } catch(e) { + console.log(`failed to convert collection slug to contract address: ${e}`); + } + } + } @@ -340,8 +357,8 @@
- - + +
{#if contractAddress}