Skip to content

Commit 93fb605

Browse files
Merge branch 'staging' of https://github.com/SmartTokenLabs/tokenscript-engine into staging
2 parents 8f45b23 + 7471a3e commit 93fb605

File tree

12 files changed

+264
-20389
lines changed

12 files changed

+264
-20389
lines changed

javascript/engine-js/src/repo/Repo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class Repo {
2222
/**
2323
* Repo cache TTL in seconds
2424
*/
25-
static REPO_TTL = 3600;
25+
static REPO_TTL = 300;
2626

2727
constructor(protected context: TokenScriptEngine) {
2828

javascript/engine-js/src/wallet/EthersAdapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,13 @@ export class EthersAdapter implements IWalletAdapter {
331331
rpcUrls.map((url, index) => {
332332
return {
333333
provider: new ethers.JsonRpcProvider(url, chain, { staticNetwork: new Network(chain.toString(), chain) }),
334-
stallTimeout: 1500,
334+
stallTimeout: 3000,
335335
priority: index + 1,
336336
}
337337
}),
338338
chain,
339339
{
340-
quorum: 2
340+
quorum: 1
341341
}
342342
);
343343
} else {

javascript/tokenscript-viewer/src/assets/tokenscripts/smart-cat-loot-prod.tsml

Lines changed: 9 additions & 20245 deletions
Large diffs are not rendered by default.

javascript/tokenscript-viewer/src/assets/tokenscripts/smart-cat-prod-2024-01.tsml

Lines changed: 229 additions & 125 deletions
Large diffs are not rendered by default.

javascript/tokenscript-viewer/src/components/common/card-view/card-popover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class CardPopover implements IViewBinding {
191191
history.replaceState(undefined, undefined, "#" + currentParams.toString());
192192
}
193193

194-
await this.dialog.openDialog(() => this.unloadTokenView());
194+
await this.dialog.openDialog(() => this.tokenScript.getViewController().unloadTokenCard());
195195
}
196196

197197
async unloadTokenView() {

javascript/tokenscript-viewer/src/components/common/card-view/card-view.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
max-height: 700px;
88
display: flex;
99
flex-direction: column;
10-
height: calc(100% - 60px);;
10+
height: calc(100% - 60px);
1111
}
1212

1313
.view-loader {
@@ -27,7 +27,6 @@
2727
position: relative;
2828
flex-grow: 1;
2929
display: flex;
30-
background: #fff;
3130
}
3231

3332
.tokenscript-frame {

javascript/tokenscript-viewer/src/components/viewers/alphawallet/alphawallet-viewer.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {AppRoot, ShowToastEventArgs} from "../../app/app";
33
import {ITransactionStatus, TokenScript} from "@tokenscript/engine-js/src/TokenScript";
44
import {ITokenCollection} from "@tokenscript/engine-js/src/tokens/ITokenCollection";
55
import {getSingleTokenMetadata} from "../util/getSingleTokenMetadata";
6-
import {Card} from "@tokenscript/engine-js/src/tokenScript/Card";
6+
import {Card, CardType} from "@tokenscript/engine-js/src/tokenScript/Card";
77
import {handleTransactionError, showTransactionNotification} from "../util/showTransactionNotification";
88
import {getCardButtonClass} from "../util/getCardButtonClass";
99
import {ViewBinding} from "../tabbed/viewBinding";
@@ -111,7 +111,6 @@ export class SmartTokenStoreViewer {
111111
this.tokenScript.on("TOKENS_UPDATED", (data) => {
112112
this.cardButtons = null;
113113
this.overflowCardButtons = null;
114-
this.infoCard = null;
115114
this.loadCards();
116115
}, "grid");
117116

@@ -124,15 +123,18 @@ export class SmartTokenStoreViewer {
124123

125124
const cardButtons: JSX.Element[] = [];
126125
const overflowCardButtons: JSX.Element[] = [];
127-
this.infoCard = null;
128126

129127
const cards = this.tokenScript.getCards().filterCards();
130128

131129
for (let [index, card] of cards.entries()){
132130

133131
let label = card.label;
134132

135-
if (card.type === "token" && !this.infoCard){
133+
if (card.type === "token"){
134+
// The card is already loaded, we only need to update other card buttons
135+
if (this.infoCard)
136+
continue;
137+
136138
// Show first info card
137139
this.infoCard = card;
138140
if (!this.infoViewController) {
@@ -145,7 +147,7 @@ export class SmartTokenStoreViewer {
145147
}
146148

147149
if (label === "Unnamed Card")
148-
label = card.type === "token" ? "Token Info" : card.type + " Card";
150+
label = (card.type as CardType) ? "Token Info" : card.type + " Card";
149151

150152
try {
151153
const enabled = await card.isEnabledOrReason();

javascript/tokenscript-viewer/src/components/viewers/mooar/mooar-viewer.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ header {
44
}
55

66
body, action-overflow-modal .popover-container {
7-
background-color: rgb(33, 33, 33) !important;
7+
background-color: #292929 !important;
88
}
99

1010
* {

javascript/tokenscript-viewer/src/components/viewers/mooar/mooar-viewer.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {AppRoot, ShowToastEventArgs} from "../../app/app";
33
import {ITransactionStatus, TokenScript} from "@tokenscript/engine-js/src/TokenScript";
44
import {ITokenCollection} from "@tokenscript/engine-js/src/tokens/ITokenCollection";
55
import {getSingleTokenMetadata} from "../util/getSingleTokenMetadata";
6-
import {Card} from "@tokenscript/engine-js/src/tokenScript/Card";
6+
import {Card, CardType} from "@tokenscript/engine-js/src/tokenScript/Card";
77
import {handleTransactionError, showTransactionNotification} from "../util/showTransactionNotification";
88
import {getCardButtonClass} from "../util/getCardButtonClass";
99
import {ViewBinding} from "../tabbed/viewBinding";
@@ -111,7 +111,6 @@ export class SmartTokenStoreViewer {
111111
this.tokenScript.on("TOKENS_UPDATED", (data) => {
112112
this.cardButtons = null;
113113
this.overflowCardButtons = null;
114-
this.infoCard = null;
115114
this.loadCards();
116115
}, "grid");
117116

@@ -124,15 +123,18 @@ export class SmartTokenStoreViewer {
124123

125124
const cardButtons: JSX.Element[] = [];
126125
const overflowCardButtons: JSX.Element[] = [];
127-
this.infoCard = null;
128126

129127
const cards = this.tokenScript.getCards().filterCards();
130128

131129
for (let [index, card] of cards.entries()){
132130

133131
let label = card.label;
134132

135-
if (card.type === "token" && !this.infoCard){
133+
if (card.type === "token"){
134+
// The card is already loaded, we only need to update other card buttons
135+
if (this.infoCard)
136+
continue;
137+
136138
// Show first info card
137139
this.infoCard = card;
138140
if (!this.infoViewController) {
@@ -145,7 +147,7 @@ export class SmartTokenStoreViewer {
145147
}
146148

147149
if (label === "Unnamed Card")
148-
label = card.type === "token" ? "Token Info" : card.type + " Card";
150+
label = (card.type as CardType) === "token" ? "Token Info" : card.type + " Card";
149151

150152
try {
151153
const enabled = await card.isEnabledOrReason();

javascript/tokenscript-viewer/src/components/viewers/opensea/opensea-viewer.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ opensea-viewer, .opensea-viewer, card-view, .card-container {
117117
margin: 0 auto !important;
118118
max-height: unset !important;
119119
width: 100%;
120+
background: #fff;
120121
}
121122

122123
.tokenscript-frame {
123124
border: none !important;
125+
border-radius: 0 !important;
124126
}

0 commit comments

Comments
 (0)