Skip to content

Commit

Permalink
Added support for IOTA Stardust on Mainnet
Browse files Browse the repository at this point in the history
adam_unchained committed Oct 4, 2023
1 parent 73f1d70 commit 20b243d
Showing 22 changed files with 76 additions and 144 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -32,8 +32,8 @@
"@metamask/detect-provider": "2.0.0",
"@ngneat/until-destroy": "9.2.3",
"@nguniversal/express-engine": "15.1.0",
"@build-5/interfaces": "latest",
"@build-5/lib": "latest",
"@build-5/interfaces": "*",
"@build-5/lib": "*",
"@tailwindcss/line-clamp": "0.4.2",
"algoliasearch": "4.14.3",
"angular-instantsearch": "4.4.0",
Original file line number Diff line number Diff line change
@@ -6,6 +6,16 @@
</div>

<div class="flex flex-wrap items-center w-full">
<div
class="py-2 network"
[ngClass]="{
network__selected: selectedNetwork === networkTypes.IOTA,
network__disabled: !isNetworkEnabled(networkTypes.IOTA)
}"
(click)="selectNetwork.next(networkTypes.IOTA)"
>
<div class="text-lg font-semibold" i18n>IOTA</div>
</div>
<div
class="py-2 network"
[ngClass]="{
@@ -34,32 +44,4 @@
Testnet
</div>
</div>
<div
class="py-2 network"
[ngClass]="{
network__selected: selectedNetwork === networkTypes.IOTA,
network__disabled: !isNetworkEnabled(networkTypes.IOTA)
}"
(click)="selectNetwork.next(networkTypes.IOTA)"
>
<div class="text-lg font-semibold" i18n>IOTA</div>
</div>
<div
*ngIf="!environment.production"
class="py-2 network"
[ngClass]="{
network__selected: selectedNetwork === networkTypes.ATOI,
network__disabled: !isNetworkEnabled(networkTypes.ATOI)
}"
(click)="selectNetwork.next(networkTypes.ATOI)"
>
<div class="text-lg font-semibold" i18n>IOTA</div>
<div class="w-px h-5 bg-[#66DDCA] ml-1.5 mr-1"></div>
<div
class="font-medium -translate-y-1 text-xxs text-foregrounds-secondary dark:text-foregrounds-secondary-dark"
i18n
>
Devnet
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
</nz-avatar>
<div class="flex items-center ml-3 lg:block">
<div class="text-sm font-bold lg:text-base">
{{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }}
{{ token?.symbol }}
</div>
<div class="wen-card-highlight-title lg:text-sm lg:ml-0">{{ token?.name }}</div>
</div>
@@ -152,9 +152,7 @@
<div
class="text-xs text-foregrounds-secondary dark:text-foregrounds-secondary-dark lg:w-full whitespace-nowrap"
>
<ng-container i18n>24h Volume</ng-container> ({{
(token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol
}})
<ng-container i18n>24h Volume</ng-container> ({{ token?.symbol }})
</div>
<div class="mt-0.5 lg:w-full whitespace-nowrap">
{{
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
</nz-avatar>
<div class="ml-4 text-lg font-bold">{{ token?.name }}</div>
<div class="ml-2 font-medium">
{{ '(' + (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol + ')' }}
{{ '(' + token?.symbol + ')' }}
</div>
</div>

@@ -39,7 +39,7 @@
| formatToken : token?.uid : true : false
| async
}}
{{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }}
{{ token?.symbol }}
</div>
</div>

Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@
/ {{ getPublicSaleSupply() | formatToken : token?.uid : false : false | async }}
</span>
<span class="text-foregrounds-primary dark:text-foregroundss-primary-dark">{{
(token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol
token?.symbol
}}</span>
</div>
</div>
@@ -161,7 +161,7 @@
/ {{ getPublicSaleSupply() | formatToken : token?.uid : false : false | async }}
</span>
<span class="text-foregrounds-primary dark:text-foregroundss-primary-dark">{{
(token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol
token?.symbol
}}</span>
</div>
</div>
@@ -223,7 +223,7 @@
/ {{ getPublicSaleSupply() | formatToken : token?.uid : false : false | async }}
</span>
<span class="text-foregrounds-primary dark:text-foregroundss-primary-dark">{{
(token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol
token?.symbol
}}</span>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
>
</nz-avatar>
<div class="ml-2 text-sm font-bold">
{{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }}
{{ token?.symbol }}
</div>
<div
class="ml-2 text-sm font-medium text-foregrounds-secondary dark:text-foregrounds-secondary-dark"
Original file line number Diff line number Diff line change
@@ -7,13 +7,7 @@
? {
title: tokenInfoLabels[4],
type: descriptionItemTypes.DEFAULT_NO_TRUNCATE,
value:
'1 ' +
((token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol) +
' = ' +
token?.pricePerToken +
' ' +
unitsService.label()
value: '1 ' + token?.symbol + ' = ' + token?.pricePerToken + ' ' + unitsService.label()
}
: null,
!helper.isMinted(token)
Original file line number Diff line number Diff line change
@@ -17,9 +17,7 @@
>
</nz-avatar>
<div class="ml-4 text-lg font-bold">{{ token?.name }}</div>
<div class="ml-2 font-medium">
({{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }})
</div>
<div class="ml-2 font-medium">({{ token?.symbol }})</div>
</div>

<ng-container *ngIf="!helper.isBase(token || undefined)">
@@ -121,7 +119,7 @@
| formatToken : token?.uid : true : false
| async
}}
{{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }}
{{ token?.symbol }}
</div>
</div>

@@ -222,7 +220,6 @@
| formatToken : token?.uid : true : false
| async) +
' ' +
(token?.symbol === 'IOTA' ? 'M' : '') +
token?.symbol
"
>
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@
Offered price per token
</div>
<div class="text-right">
<div class="font-bold whitespace-nowrap">{{ price }} MIOTA</div>
<div class="font-bold whitespace-nowrap">{{ price }} IOTA</div>
<span
class="ml-1 text-xs font-medium text-foregrounds-secondary dark:text-foregrounds-secondary-dark"
>~{{ unitsService.getUsd(price) | async | currency : 'USD' | UsdBelowTwoDecimals }}</span
Original file line number Diff line number Diff line change
@@ -145,9 +145,7 @@
<div
class="text-xs text-foregrounds-secondary dark:text-foregrounds-secondary-dark lg:w-full lg:text-right whitespace-nowrap"
>
<ng-container i18n>Volume 24h</ng-container> ({{
(token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol
}})
<ng-container i18n>Volume 24h</ng-container> ({{ token?.symbol }})
</div>
<div class="mt-0.5 lg:w-full lg:text-rights whitespace-nowrap">
{{ listenVolume24h$ | async | formatToken : undefined : true : false | async }}
Original file line number Diff line number Diff line change
@@ -17,9 +17,7 @@
>
</nz-avatar>
<div class="ml-4 text-lg font-bold">{{ token?.name }}</div>
<div class="ml-2 font-medium">
({{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }})
</div>
<div class="ml-2 font-medium">({{ token?.symbol }})</div>
</div>

<div
@@ -35,7 +33,7 @@
| formatToken : token?.uid : true : false
| async
}}
{{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }}
{{ token?.symbol }}
</div>
</div>
<div
@@ -130,7 +128,7 @@
| formatToken : (billPaymentTransactions$[i] | async)?.payload?.token : true : false
| async
}}
{{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }}
{{ token?.symbol }}

<span
class="text-xs"
@@ -217,7 +215,7 @@
: false
| async
}}
{{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }}
{{ token?.symbol }}
</td>
<td
class="text-sm font-medium"
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
}"
></wen-icon-favourites>
<div class="mt-1 ml-1.5">
<span class="font-bold">{{ (token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol }}</span
<span class="font-bold">{{ token?.symbol }}</span
><span class="font-medium text-foregrounds-secondary dark:text-foregrounds-secondary-dark"
>/{{ helper.getPairFrom(token) }}</span
>
@@ -141,9 +141,7 @@
<div
class="text-xs text-foregrounds-secondary dark:text-foregrounds-secondary-dark lg:w-full lg:text-right whitespace-nowrap"
>
<ng-container i18n>24h Volume</ng-container> ({{
(token?.symbol === 'IOTA' ? 'M' : '') + token?.symbol
}})
<ng-container i18n>24h Volume</ng-container> ({{ token?.symbol }})
</div>
<div class="mt-0.5 lg:w-full lg:text-rights whitespace-nowrap">
{{
Original file line number Diff line number Diff line change
@@ -91,7 +91,6 @@
{{
(this.amountControl.value | formatToken : token?.uid : true : false | async) +
' ' +
(token?.symbol === 'IOTA' ? 'M' : '') +
token?.symbol
}}
</div>
@@ -105,12 +104,7 @@
Total staked tokens
</div>
<div class="font-bold whitespace-nowrap">
{{
(totalStaked | formatToken : token?.uid : true : false | async) +
' ' +
(token?.symbol === 'IOTA' ? 'M' : '') +
token?.symbol
}}
{{ (totalStaked | formatToken : token?.uid : true : false | async) + ' ' + token?.symbol }}
</div>
</div>

@@ -131,12 +125,7 @@
Your total voting weight
</div>
<div class="font-bold whitespace-nowrap">
{{
(getWeight() | formatToken : token?.uid : true : false | async) +
' ' +
(token?.symbol === 'IOTA' ? 'M' : '') +
token?.symbol
}}
{{ (getWeight() | formatToken : token?.uid : true : false | async) + ' ' + token?.symbol }}
</div>
</div>

53 changes: 21 additions & 32 deletions src/app/components/wallet-deeplink/wallet-deeplink.component.ts
Original file line number Diff line number Diff line change
@@ -93,41 +93,30 @@ export class WalletDeeplinkComponent {
}

// We want to round to maximum 6 digits.
if (this.network === Network.RMS || this.network === Network.SMR) {
const walletType = this.network === Network.SMR ? 'firefly' : 'firefly-alpha';
if (this.tokenId && this.tokenAmount) {
return this.sanitizer.bypassSecurityTrustUrl(
walletType +
'://wallet/sendConfirmation?address=' +
this.targetAddress +
'&assetId=' +
this.tokenId +
'&disableToggleGift=true&disableChangeExpiration=true' +
'&amount=' +
Number(this.tokenAmount).toFixed(0) +
'&tag=soonaverse&giftStorageDeposit=true' +
(this.surplus ? '&surplus=' + Number(this.targetAmount).toFixed(0) : ''),
);
} else {
return this.sanitizer.bypassSecurityTrustUrl(
walletType +
'://wallet/sendConfirmation?address=' +
this.targetAddress +
'&disableToggleGift=true&disableChangeExpiration=true' +
'&amount=' +
Number(this.targetAmount).toFixed(0) +
'&tag=soonaverse&giftStorageDeposit=true',
);
}
const walletType =
this.network === Network.SMR || this.network === Network.IOTA ? 'firefly' : 'firefly-alpha';
if (this.tokenId && this.tokenAmount) {
return this.sanitizer.bypassSecurityTrustUrl(
walletType +
'://wallet/sendConfirmation?address=' +
this.targetAddress +
'&assetId=' +
this.tokenId +
'&disableToggleGift=true&disableChangeExpiration=true' +
'&amount=' +
Number(this.tokenAmount).toFixed(0) +
'&tag=soonaverse&giftStorageDeposit=true' +
(this.surplus ? '&surplus=' + Number(this.targetAmount).toFixed(0) : ''),
);
} else {
return this.sanitizer.bypassSecurityTrustUrl(
'iota://wallet/send/' +
walletType +
'://wallet/sendConfirmation?address=' +
this.targetAddress +
'?amount=' +
+(Number(this.targetAmount) / NETWORK_DETAIL[this.network || DEFAULT_NETWORK].divideBy)
.toFixed(6)
.replace(/,/g, '.') +
'&unit=Mi',
'&disableToggleGift=true&disableChangeExpiration=true' +
'&amount=' +
Number(this.targetAmount).toFixed(0) +
'&tag=soonaverse&giftStorageDeposit=true',
);
}
}
2 changes: 1 addition & 1 deletion src/app/pages/award/pages/award/award.page.ts
Original file line number Diff line number Diff line change
@@ -219,7 +219,7 @@ export class AwardPage implements OnInit, OnDestroy {
if (award?.network === Network.RMS) {
return 'https://explorer.shimmer.network/testnet/block/' + award.collectionBlockId;
} else if (award?.network === Network.IOTA) {
return 'https://thetangle.org/search/' + award.collectionBlockId;
return 'https://explorer.iota.org/mainnet/block/' + award.collectionBlockId;
} else if (award?.network === Network.SMR) {
return 'https://explorer.shimmer.network/shimmer/block/' + award.collectionBlockId;
} else if (award?.network === Network.ATOI) {
2 changes: 1 addition & 1 deletion src/app/pages/collection/services/helper.service.ts
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ export class HelperService {
if (collection?.mintingData?.network === Network.RMS) {
return 'https://explorer.shimmer.network/testnet/block/' + collection.mintingData.blockId;
} else if (collection?.mintingData?.network === Network.IOTA) {
return 'https://thetangle.org/search/' + collection.mintingData.blockId;
return 'https://explorer.iota.org/mainnet/block/' + collection.mintingData.blockId;
} else if (collection?.mintingData?.network === Network.SMR) {
return 'https://explorer.shimmer.network/shimmer/block/' + collection.mintingData.blockId;
} else if (collection?.mintingData?.network === Network.ATOI) {
Loading

0 comments on commit 20b243d

Please sign in to comment.