diff --git a/index.html b/index.html
index 21972878..d1e9358f 100644
--- a/index.html
+++ b/index.html
@@ -20,90 +20,90 @@
window.negotiator = new negotiator.Client({
type: "active",
issuers: [
- {
- onChain: true,
- fungible: true,
- chain: "eth",
- blockchain: "evm",
- collectionID: "socios",
- contract: "0x3506424F91fD33084466F402d5D97f05F8e3b4AF",
- oAuth2options: {
- consumerKey: "YOUR_CONSUMER_KEY",
- partnerTag: "YOUR_PARTNER_TAG",
- endpoints: {
- redirectURI: {
- path: "http://localhost:5000/user-login-callback",
- params: {}
- },
- userBalance: {
- path: 'http://localhost:5000/user-balance',
- params: {}
- },
- userNfts: {
- path: 'http://localhost:5000/user-nfts',
- params: {}
- },
- userLogout: {
- path: 'http://localhost:5000/user-logout',
- params: {}
- },
- },
- },
- },
- {
- hideToggle: true,
- noTokenMsg:
- "
If you hold a Devcon ticket, please visit your magicLink email again and open the link in this browser.
You may reload this page after and try again.
",
- onChain: false,
- tokenName: "devcon6",
- collectionID: "devcon6",
- title: "Devcon VI Ticket Attestation",
- image: "https://devcon-vi.attest.tickets/img/nft_bg.png",
- tokenOrigin: "https://devcon-vi.attest.tickets/outlet.html",
- attestationOrigin: "https://test.attestation.id/",
- tokenUrlName: "ticket",
- cryptoVerify: "https://form.smarttokenlabs.com",
- tokenSecretName: "secret",
- tokenIdName: "mail",
- unsignedTokenDataName: "ticket",
- whitelistDialogRenderer: (permissionTxt, acceptBtn, denyBtn) => {
- return `
-
-
-
-
-
-
${permissionTxt}
- ${acceptBtn}
- ${denyBtn}
-
-
- `;
- },
- signedTokenWhitelist: [
- "https://devcon-vi.attest.tickets/",
- "https://dev.loc",
- "https://devconnect.loc/",
- "https://devconnect.antopolbus.rv.ua/",
- "https://perks.antopolbus.rv.ua/",
- "https://stage-perks.smarttokenlabs.com/",
- "http://localhost:5000/",
+ // {
+ // onChain: true,
+ // fungible: true,
+ // chain: "eth",
+ // blockchain: "evm",
+ // collectionID: "socios",
+ // contract: "0x3506424F91fD33084466F402d5D97f05F8e3b4AF",
+ // oAuth2options: {
+ // consumerKey: "YOUR_CONSUMER_KEY",
+ // partnerTag: "YOUR_PARTNER_TAG",
+ // endpoints: {
+ // redirectURI: {
+ // path: "http://localhost:5000/user-login-callback",
+ // params: {}
+ // },
+ // userBalance: {
+ // path: 'http://localhost:5000/user-balance',
+ // params: {}
+ // },
+ // userNfts: {
+ // path: 'http://localhost:5000/user-nfts',
+ // params: {}
+ // },
+ // userLogout: {
+ // path: 'http://localhost:5000/user-logout',
+ // params: {}
+ // },
+ // },
+ // },
+ // },
+ // {
+ // hideToggle: true,
+ // noTokenMsg:
+ // "If you hold a Devcon ticket, please visit your magicLink email again and open the link in this browser.
You may reload this page after and try again.
",
+ // onChain: false,
+ // tokenName: "devcon6",
+ // collectionID: "devcon6",
+ // title: "Devcon VI Ticket Attestation",
+ // image: "https://devcon-vi.attest.tickets/img/nft_bg.png",
+ // tokenOrigin: "https://devcon-vi.attest.tickets/outlet.html",
+ // attestationOrigin: "https://test.attestation.id/",
+ // tokenUrlName: "ticket",
+ // cryptoVerify: "https://form.smarttokenlabs.com",
+ // tokenSecretName: "secret",
+ // tokenIdName: "mail",
+ // unsignedTokenDataName: "ticket",
+ // whitelistDialogRenderer: (permissionTxt, acceptBtn, denyBtn) => {
+ // return `
+ //
+ //
+ //
+ //
+ //
+ //
${permissionTxt}
+ // ${acceptBtn}
+ // ${denyBtn}
+ //
+ //
+ // `;
+ // },
+ // signedTokenWhitelist: [
+ // "https://devcon-vi.attest.tickets/",
+ // "https://dev.loc",
+ // "https://devconnect.loc/",
+ // "https://devconnect.antopolbus.rv.ua/",
+ // "https://perks.antopolbus.rv.ua/",
+ // "https://stage-perks.smarttokenlabs.com/",
+ // "http://localhost:5000/",
- "https://hashkey.smarttokenlabs.com/",
- "https://fayre-devcon.webflow.io/",
- "https://fenbushi-devcon.webflow.io/",
- "https://metasearch-devcon.webflow.io/",
- "https://conspicuis-devcon.webflow.io/",
- "https://devcon-vi.brandextender.io/",
- "https://www.edcon.io/",
- ],
- itemStorageKey: "devconnectTokens",
- base64senderPublicKeys: {
- 4: "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAGJAHCiHbrCNAY9fAMdom4dGD6v/KkTIgRCkwLCjXFTkXWGrCEXHaZ8kWwdqlu0oYCrNQ2vdlqOl0s26/LzO8A==|MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE-N-jGYo1OuO77XItd3zT-oIhZEVC44uqOhtJkmBsBNDTp3Seu_vmuLB-b4whNeFNBuJTsT7AHUiUe3JOwCcegA==",
- },
- base64attestorPubKey:
- "MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABL+y43T1OJFScEep69/yTqpqnV/jzONz9Sp4TEHyAJ7IPN9+GHweCX1hT4OFxt152sBN3jJc1s0Ymzd8pNGZNoQ=",
- },
+ // "https://hashkey.smarttokenlabs.com/",
+ // "https://fayre-devcon.webflow.io/",
+ // "https://fenbushi-devcon.webflow.io/",
+ // "https://metasearch-devcon.webflow.io/",
+ // "https://conspicuis-devcon.webflow.io/",
+ // "https://devcon-vi.brandextender.io/",
+ // "https://www.edcon.io/",
+ // ],
+ // itemStorageKey: "devconnectTokens",
+ // base64senderPublicKeys: {
+ // 4: "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAGJAHCiHbrCNAY9fAMdom4dGD6v/KkTIgRCkwLCjXFTkXWGrCEXHaZ8kWwdqlu0oYCrNQ2vdlqOl0s26/LzO8A==|MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE-N-jGYo1OuO77XItd3zT-oIhZEVC44uqOhtJkmBsBNDTp3Seu_vmuLB-b4whNeFNBuJTsT7AHUiUe3JOwCcegA==",
+ // },
+ // base64attestorPubKey:
+ // "MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABL+y43T1OJFScEep69/yTqpqnV/jzONz9Sp4TEHyAJ7IPN9+GHweCX1hT4OFxt152sBN3jJc1s0Ymzd8pNGZNoQ=",
+ // },
{
collectionID: "devcon",
onChain: false,
@@ -111,7 +111,7 @@
tokenIdName: "id",
image:
"https://raw.githubusercontent.com/TokenScript/token-negotiator/main/mock-images/devcon.svg",
- tokenOrigin: "http://localhost:3000/",
+ tokenOrigin: "http://localhost:3002/",
attestationOrigin: "https://test.attestation.id/",
base64senderPublicKeys: {
6: "MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABGMxHraqggr2keTXszIcchTjYjH5WXpDaBOYgXva82mKcGnKgGRORXSmcjWN2suUCMkLQj3UNlZCFWF10wIrrlw=",
@@ -166,52 +166,52 @@
// base64attestorPubKey:
// "MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABL+y43T1OJFScEep69/yTqpqnV/jzONz9Sp4TEHyAJ7IPN9+GHweCX1hT4OFxt152sBN3jJc1s0Ymzd8pNGZNoQ=",
// },
- // {
- // hideToggle : false,
- // noTokenMsg: "If you have a token please:
1. Open your magic link inside this browser.
2. Refresh this page.
",
- // collectionID: 'devcon',
- // title: "Devcon",
- // onChain: false,
- // tokenOrigin: "http://localhost:3002/",
- // attestationOrigin: "https://attestation.id/",
- // unEndPoint: "https://crypto-verify.herokuapp.com/use-devcon-ticket",
- // image: "https://raw.githubusercontent.com/TokenScript/token-negotiator/main/mock-images/devcon.svg",
- // base64senderPublicKeys:
- // {
- // "AttestationDAO" : 'MFYwEAYHKoZIzj0CAQYFK...'
- // },
- // base64attestorPubKey: "MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABL+y43T1OJFScEep69/yTqpqnV/jzONz9Sp4TEHyAJ7IPN9+GHweCX1hT4OFxt152sBN3jJc1s0Ymzd8pNGZNoQ="
- // },
- // {
- // collectionID: "crypto-cowboy-country",
- // tokenProgram: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
- // collectionAddress:
- // "bf0aae3dd0078a9feb975f1e3242ddcb7774d551c7fd2a3f07a89c827ed606b2",
- // updateAuthority: "CCCUzWanUNegjGby11DjujDvPaNN68jd9Rimwk2MZzqZ",
- // onChain: true,
- // symbol: "CCC",
- // chain: "mainnet",
- // blockchain: "solana",
- // },
- // {
- // collectionID: "penthouse-panther-club",
- // collectionAddress: "ff846ef2eed57e5367cf8826e63f4d53fe28d28aa67417accb6e4b48cbd19136",
- // updateAuthority: "92oYPmrr1BHznizuZmpKZ3MFRadMFYRTCxo9Pf34mZKX",
- // tokenProgram: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
- // onChain: true,
- // symbol: "PPC",
- // chain: "mainnet",
- // blockchain: "solana",
- // },
- // {
- // hideToggle : false,
- // collectionID: "pixel",
- // collectionAddress: "166424b16c4c7f40eb852f9eb2d0d6869a9ed7ac54a8e6afbd516676bfbbeb19",
- // onChain: true,
- // symbol: "PIXEL",
- // chain: "mainnet",
- // blockchain: "solana",
- // },
+ {
+ hideToggle: false,
+ noTokenMsg: "If you have a token please:
1. Open your magic link inside this browser.
2. Refresh this page.
",
+ collectionID: 'devcon',
+ title: "Devcon",
+ onChain: false,
+ tokenOrigin: "http://localhost:3002/",
+ attestationOrigin: "https://attestation.id/",
+ unEndPoint: "https://crypto-verify.herokuapp.com/use-devcon-ticket",
+ image: "https://raw.githubusercontent.com/TokenScript/token-negotiator/main/mock-images/devcon.svg",
+ base64senderPublicKeys:
+ {
+ "AttestationDAO": 'MFYwEAYHKoZIzj0CAQYFK...'
+ },
+ base64attestorPubKey: "MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABL+y43T1OJFScEep69/yTqpqnV/jzONz9Sp4TEHyAJ7IPN9+GHweCX1hT4OFxt152sBN3jJc1s0Ymzd8pNGZNoQ="
+ },
+ {
+ collectionID: "crypto-cowboy-country",
+ tokenProgram: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
+ collectionAddress:
+ "bf0aae3dd0078a9feb975f1e3242ddcb7774d551c7fd2a3f07a89c827ed606b2",
+ updateAuthority: "CCCUzWanUNegjGby11DjujDvPaNN68jd9Rimwk2MZzqZ",
+ onChain: true,
+ symbol: "CCC",
+ chain: "mainnet",
+ blockchain: "solana",
+ },
+ {
+ collectionID: "penthouse-panther-club",
+ collectionAddress: "ff846ef2eed57e5367cf8826e63f4d53fe28d28aa67417accb6e4b48cbd19136",
+ updateAuthority: "92oYPmrr1BHznizuZmpKZ3MFRadMFYRTCxo9Pf34mZKX",
+ tokenProgram: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
+ onChain: true,
+ symbol: "PPC",
+ chain: "mainnet",
+ blockchain: "solana",
+ },
+ {
+ hideToggle: false,
+ collectionID: "pixel",
+ collectionAddress: "166424b16c4c7f40eb852f9eb2d0d6869a9ed7ac54a8e6afbd516676bfbbeb19",
+ onChain: true,
+ symbol: "PIXEL",
+ chain: "mainnet",
+ blockchain: "solana",
+ },
{
onChain: true,
collectionID: "expansion-punks",
@@ -236,73 +236,79 @@
chain: "bsc",
blockchain: "evm",
},
- // {
- // onChain: true,
- // collectionID: "tt",
- // contract: '0x76be3b62873462d2142405439777e971754e8e77',
- // chain: 'eth',
- // blockchain: "evm",
- // },
- // { onChain: true, collectionID: "Perion", contract: '0x96af92ae2d822a0f191455ceca4d4e7ee227668e', chain: 'mumbai', blockchain: "evm" },
- // { collectionID: 'COOLCATS-#2426-14', onChain: true, contract: '0x3C7e352481F4b2fdEc1e642a3f0018661c77513D', chain: 'eth', openSeaSlug: 'devcon-vi-suit-up-collection' },
- // { collectionID: 'Town-Hall', onChain: true, contract: '0x81b30ff521D1fEB67EDE32db726D95714eb00637', chain: 'Optimism' },
- // {
- // collectionID: "Blusteak Kangaroo #64",
- // onChain: true,
- // contract: "0xa996F7F3BC647EebC98C684aB0A302c9b85d2FA1",
- // chain: "Avalanche",
- // },
- // {
- // collectionID: "Alone Pirate",
- // onChain: true,
- // contract: "0x36535ec384B94342558e37282527b5052587af6A",
- // chain: "Arbitrum",
- // },
- // {
- // collectionID: "NBA",
- // onChain: true,
- // contract: "A.0b2a3299cc857e29.TopShot",
- // chain: "mainnet",
- // blockchain: "flow",
- // },
- // {
- // onChain: true,
- // erc: 20,
- // fungible: true,
- // collectionID: "polygon",
- // contract: '0x52459834ca561cb55411699e9c2143683bcf865f',
- // chain: 'matic',
- // blockchain: "evm",
- // // Add fungible as a boolean
- // // symbol: 'USX'
- // },
- // {
- // contract: "0x107065a122f92636a1358a70a0efe0f1a080a7e5",
- // onChain: true,
- // fungible: true,
- // collectionID: "USX",
- // chain: "matic",
- // },
- // {
- // contract: "0x429f49faec3d568ef83ec803e02df78e25d5ee7d",
- // onChain: true,
- // fungible: true,
- // collectionID: "Ella",
- // chain: "matic",
- // },
- // {
- // contract: "0xaaa5b9e6c589642f98a1cda99b9d024b8407285a",
- // onChain: true,
- // fungible: true,
- // collectionID: "TITAN",
- // chain: "matic",
- // },
+ {
+ onChain: true,
+ collectionID: "tt",
+ contract: '0x76be3b62873462d2142405439777e971754e8e77',
+ chain: 'eth',
+ blockchain: "evm",
+ },
+ { onChain: true, collectionID: "Perion", contract: '0x96af92ae2d822a0f191455ceca4d4e7ee227668e', chain: 'mumbai', blockchain: "evm" },
+ { collectionID: 'COOLCATS-#2426-14', onChain: true, contract: '0x3C7e352481F4b2fdEc1e642a3f0018661c77513D', chain: 'eth', openSeaSlug: 'devcon-vi-suit-up-collection' },
+ { collectionID: 'Town-Hall', onChain: true, contract: '0x81b30ff521D1fEB67EDE32db726D95714eb00637', chain: 'Optimism' },
+ {
+ collectionID: "Blusteak Kangaroo #64",
+ onChain: true,
+ contract: "0xa996F7F3BC647EebC98C684aB0A302c9b85d2FA1",
+ chain: "Avalanche",
+ },
+ {
+ collectionID: "Alone Pirate",
+ onChain: true,
+ contract: "0x36535ec384B94342558e37282527b5052587af6A",
+ chain: "Arbitrum",
+ },
+ {
+ collectionID: "NBA",
+ onChain: true,
+ contract: "A.0b2a3299cc857e29.TopShot",
+ chain: "mainnet",
+ blockchain: "flow",
+ },
+ {
+ onChain: true,
+ erc: 20,
+ fungible: true,
+ collectionID: "polygon",
+ contract: '0x52459834ca561cb55411699e9c2143683bcf865f',
+ chain: 'matic',
+ blockchain: "evm",
+ // Add fungible as a boolean
+ // symbol: 'USX'
+ },
+ {
+ contract: "0x107065a122f92636a1358a70a0efe0f1a080a7e5",
+ onChain: true,
+ fungible: true,
+ collectionID: "USX",
+ chain: "matic",
+ },
+ {
+ contract: "0x429f49faec3d568ef83ec803e02df78e25d5ee7d",
+ onChain: true,
+ fungible: true,
+ collectionID: "Ella",
+ chain: "matic",
+ },
+ {
+ contract: "0xaaa5b9e6c589642f98a1cda99b9d024b8407285a",
+ onChain: true,
+ fungible: true,
+ collectionID: "TITAN",
+ chain: "matic",
+ },
],
uiOptions: {
openingHeading:
"Open a new world of perks, benefits and opportunities with your attestation, collectible or token.",
issuerHeading: "Get discount with Ticket",
- repeatAction: "try again",
+ repeatAction: "Retry",
+ dismissAction: 'Dismiss',
+ loadAction: 'Load Collection',
+ noTokensFoundEvent: 'No Tokens Found',
+ balancesFoundEvent: 'Balance Found',
+ nftsFoundEvent: 'Token(s) Found',
+ openingAction: "Let's Go!",
theme: theme,
position: "top-right",
},
diff --git a/src/client/tokenStore.ts b/src/client/tokenStore.ts
index 42796a24..df2ff0fd 100644
--- a/src/client/tokenStore.ts
+++ b/src/client/tokenStore.ts
@@ -4,11 +4,11 @@ import { logger } from '../utils'
import { DecodedToken } from '../outlet/ticketStorage'
interface IssuerLookup {
- [collectionID: string]: TokenConfig & { timestamp: number }
+ [collectionID: string]: TokenConfig & { timestamp: number; status?: string }
}
interface TokenLookup {
- [issuer: string]: { timestamp: number; tokens: TokenData[] | null }
+ [issuer: string]: { loadAttempts: number; timestamp: number; tokens: TokenData[] | null }
}
export interface TokenData {
@@ -59,7 +59,7 @@ export class TokenStore {
}
for (let collectionId in tokenStoreData.tokenData) {
- const tokenData = tokenStoreData.tokenData[collectionId] as { timestamp: number; tokens: [] }
+ const tokenData = tokenStoreData.tokenData[collectionId] as { timestamp: number; tokens: []; loadAttempts: number }
if (tokenData.timestamp + this.tokenPersistenceTTL * 1000 > Date.now()) {
this.tokenData[collectionId] = tokenData
@@ -182,11 +182,18 @@ export class TokenStore {
}
public setTokens(issuer: string, tokens: TokenData[] | DecodedToken[]) {
- this.tokenData[issuer] = { timestamp: Date.now(), tokens }
+ this.tokenData[issuer] = { timestamp: Date.now(), tokens, loadAttempts: this.getCollectionLoadAttempts(issuer) }
+ this.saveTokenStore()
+ if (this.autoEnableTokens) this.selectedTokens[issuer] = { tokens: tokens }
+ }
+ public setIncrementCollectionLoadAttempts(issuer: string) {
+ this.tokenData[issuer].loadAttempts = this.tokenData[issuer]?.loadAttempts >= 0 ? (this.tokenData[issuer].loadAttempts += 1) : 0
this.saveTokenStore()
+ }
- if (this.autoEnableTokens) this.selectedTokens[issuer] = { tokens: tokens }
+ public getCollectionLoadAttempts(issuer: string) {
+ return this.tokenData[issuer]?.loadAttempts ?? 0
}
public getSelectedTokens() {
diff --git a/src/client/views/select-issuers.ts b/src/client/views/select-issuers.ts
index 68e4cf29..1364c5a6 100644
--- a/src/client/views/select-issuers.ts
+++ b/src/client/views/select-issuers.ts
@@ -161,6 +161,7 @@ export class SelectIssuers extends AbstractView {
this.issuerListContainer.addEventListener('click', (e: any) => {
if (e.target.classList.contains('connect-btn-tn')) {
this.connectTokenIssuer(e)
+ this.client.getTokenStore().setIncrementCollectionLoadAttempts(e.target.dataset.issuer);
} else if (e.target.classList.contains('tokens-btn-tn')) {
const issuer = e.target.parentNode.dataset.issuer
this.navigateToTokensView(issuer)
@@ -170,10 +171,11 @@ export class SelectIssuers extends AbstractView {
issuerConnectMarkup(title: string, image: string | undefined, issuer: string, tokens: any[], data: Issuer) {
let buttonText = ''
-
+ const collectLoadAttempts = this.client.getTokenStore().getCollectionLoadAttempts(issuer);
+ let issuerButtonText = this.params.options.loadAction ?? "Load Collection";
+ if (collectLoadAttempts >= 1) issuerButtonText = this.params.options.repeatAction ?? 'Retry';
// @ts-ignore
if (tokens?.length) buttonText = data?.fungible ? this.params.options.balanceFoundEvent ?? 'Balance found' : `${tokens.length} ${this.params.options?.nftsFoundEvent ?? 'Token(s) Available'}`
-
return `
@@ -187,7 +189,7 @@ export class SelectIssuers extends AbstractView {
${this.client.issuersLoaded === true ? '' : 'disabled'}
>
${this.client.issuersLoaded === true
- ? this.params.options.loadAction ?? 'Load'
+ ? issuerButtonText
: '
'
}
@@ -215,14 +217,8 @@ export class SelectIssuers extends AbstractView {
this.issuerLoading.bind(this),
(issuer: string, tokens: any[]) => {
if (!tokens?.length) {
- applyHTMLElementsInnerText(
- this.issuerListContainer,
- `[data-issuer="${issuer}"] .connect-btn-tn`,
- this.params.options.loadAction ?? 'Load',
- )
return
}
-
this.issuerConnected(issuer, tokens, false)
},
refresh,
@@ -240,17 +236,11 @@ export class SelectIssuers extends AbstractView {
try {
tokens = await this.client.connectTokenIssuer(issuer)
-
if (!tokens) return // Site is redirecting
} catch (err) {
logger(2, err)
this.ui.showError(err)
this.client.eventSender('error', { issuer, error: err })
- applyHTMLElementsInnerText(
- this.issuerListContainer,
- `[data-issuer="${issuer}"] .connect-btn-tn`,
- this.params.options.repeatAction ?? 'Try Again',
- )
return
}
@@ -260,11 +250,6 @@ export class SelectIssuers extends AbstractView {
this.ui.showError(`
${this.params.options.noTokensFoundEvent ?? 'No tokens found! '}
${this.client.getNoTokenMsg(issuer)}`)
- applyHTMLElementsInnerText(
- this.issuerListContainer,
- `[data-issuer="${issuer}"] .connect-btn-tn`,
- this.params.options.repeatAction ?? 'Try Again',
- )
return
}
diff --git a/src/theme/theme_dark.scss b/src/theme/theme_dark.scss
index 782160dd..f39db144 100644
--- a/src/theme/theme_dark.scss
+++ b/src/theme/theme_dark.scss
@@ -58,7 +58,7 @@
.overlay-tn.dark-tn .overlay-content-tn {
box-shadow: 0 2px 4px 0 rgba(103, 103, 103, 0.5);
background-color: black;
- border-top: 4px solid white;
+ border-top: 4px solid #011aff;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 4px;
border-top-left-radius: 3px;
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 22308411..19cff888 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -4,6 +4,8 @@ import { sha256 } from 'ethers/lib/utils'
import { OffChainTokenConfig } from '../client/interface'
import { OutletIssuerInterface } from '../outlet/interfaces'
import { DEFAULT_SCHEMA_UIDS } from '../outlet/ticketStorage'
+import { DecodedToken } from '../outlet/ticketStorage'
+import { TokenData } from '../client/tokenStore'
export interface IssuerHashMap {
[collectionId: string]: string[]