From e8f3e0e4b59e6dd6421fafbbfe6a380b49919c41 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 8 Nov 2023 17:27:26 +0300 Subject: [PATCH] Include USK & USDC among OE mint price denom options --- .env.example | 5 +++++ .../openEdition/OpenEditionMinterCreator.tsx | 10 ++++++++-- config/minter.ts | 18 ++++++++++++++++++ config/token.ts | 4 +++- env.d.ts | 2 ++ utils/constants.ts | 3 +++ 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 7d2556a..b3e3279 100644 --- a/.env.example +++ b/.env.example @@ -48,6 +48,11 @@ NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_FACTORY_ADDRESS="stars1fk5dkzcylam8mcpqrn8y9s NEXT_PUBLIC_OPEN_EDITION_IBC_FRNZ_FACTORY_ADDRESS="stars1vzffawsjhvspstu5lvtzz2x5n7zh07hnw09c9dfxcj78un05rcms5n3q3e" NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_IBC_FRNZ_FACTORY_ADDRESS="stars1tc09vlgdg8rqyapcxwm9qdq8naj4gym9px4ntue9cs0kse5rvess0nee3a" +NEXT_PUBLIC_OPEN_EDITION_IBC_USK_FACTORY_ADDRESS="stars1vxf9u6a4d5ty00k59zthv7mnpzlrfhqnf4ds0y0eake7lepuamnqymyf3t" +NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_IBC_USK_FACTORY_ADDRESS="stars1njhkyyv0l8dmq528w67t8dxyg5a3h0hvusk6pfvpm52pspd9gq9s3zmdez" + +NEXT_PUBLIC_OPEN_EDITION_IBC_USDC_FACTORY_ADDRESS="stars1tjzlz2e8pkucgytkjct5drt7x0dysnepqv3nmvxn0fzk2hfv73zsneevyt" + NEXT_PUBLIC_OPEN_EDITION_IBC_NBTC_FACTORY_ADDRESS="stars1cd4gykxfq4nc4yx8uzn8yr3ggu86r57chhxme4y7q2jag53cw75qgs96u8" NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_IBC_NBTC_FACTORY_ADDRESS="stars1d57xe77mvcg5q337umf4qz49vumfn6w3wss0t7u8ra6s3cyvezsqyaeejn" diff --git a/components/openEdition/OpenEditionMinterCreator.tsx b/components/openEdition/OpenEditionMinterCreator.tsx index bf417e7..533157d 100644 --- a/components/openEdition/OpenEditionMinterCreator.tsx +++ b/components/openEdition/OpenEditionMinterCreator.tsx @@ -13,7 +13,7 @@ import { Conditional } from 'components/Conditional' import { ConfirmationModal } from 'components/ConfirmationModal' import { LoadingModal } from 'components/LoadingModal' import { openEditionMinterList } from 'config/minter' -import type { TokenInfo } from 'config/token' +import { type TokenInfo } from 'config/token' import { useContracts } from 'contexts/contracts' import { addLogItem } from 'contexts/log' import type { DispatchExecuteArgs as OpenEditionFactoryDispatchExecuteArgs } from 'contracts/openEditionFactory/messages/execute' @@ -26,6 +26,7 @@ import { OPEN_EDITION_UPDATABLE_FACTORY_ADDRESS, SG721_OPEN_EDITION_CODE_ID, SG721_OPEN_EDITION_UPDATABLE_CODE_ID, + STRDST_SG721_CODE_ID, } from 'utils/constants' import type { AssetType } from 'utils/getAssetType' import { isValidAddress } from 'utils/isValidAddress' @@ -608,7 +609,12 @@ export const OpenEditionMinterCreator = ({ payment_address: mintingDetails?.paymentAddress || null, }, collection_params: { - code_id: collectionDetails?.updatable ? SG721_OPEN_EDITION_UPDATABLE_CODE_ID : SG721_OPEN_EDITION_CODE_ID, + code_id: collectionDetails?.updatable + ? SG721_OPEN_EDITION_UPDATABLE_CODE_ID + : mintingDetails?.selectedMintToken?.displayName === 'USK' || + mintingDetails?.selectedMintToken?.displayName === 'USDC' + ? STRDST_SG721_CODE_ID + : SG721_OPEN_EDITION_CODE_ID, name: collectionDetails?.name, symbol: collectionDetails?.symbol, info: { diff --git a/config/minter.ts b/config/minter.ts index 37330b4..f3733ab 100644 --- a/config/minter.ts +++ b/config/minter.ts @@ -4,11 +4,13 @@ import { OPEN_EDITION_IBC_FRNZ_FACTORY_ADDRESS, OPEN_EDITION_IBC_NBTC_FACTORY_ADDRESS, OPEN_EDITION_IBC_USDC_FACTORY_ADDRESS, + OPEN_EDITION_IBC_USK_FACTORY_ADDRESS, OPEN_EDITION_UPDATABLE_FACTORY_ADDRESS, OPEN_EDITION_UPDATABLE_IBC_ATOM_FACTORY_ADDRESS, OPEN_EDITION_UPDATABLE_IBC_FRNZ_FACTORY_ADDRESS, OPEN_EDITION_UPDATABLE_IBC_NBTC_FACTORY_ADDRESS, OPEN_EDITION_UPDATABLE_IBC_USDC_FACTORY_ADDRESS, + OPEN_EDITION_UPDATABLE_IBC_USK_FACTORY_ADDRESS, VENDING_FACTORY_ADDRESS, VENDING_FACTORY_FLEX_ADDRESS, VENDING_FACTORY_UPDATABLE_ADDRESS, @@ -115,6 +117,20 @@ export const openEditionUpdatableIbcFrnzMinter: MinterInfo = { updatable: true, } +export const openEditionIbcUskMinter: MinterInfo = { + id: 'open-edition-ibc-usk-minter', + factoryAddress: OPEN_EDITION_IBC_USK_FACTORY_ADDRESS, + supportedToken: ibcUsk, + updatable: false, +} + +export const openEditionUpdatableIbcUskMinter: MinterInfo = { + id: 'open-edition-updatable-ibc-usk-minter', + factoryAddress: OPEN_EDITION_UPDATABLE_IBC_USK_FACTORY_ADDRESS, + supportedToken: ibcUsk, + updatable: true, +} + export const openEditionMinterList = [ openEditionStarsMinter, openEditionUpdatableStarsMinter, @@ -126,6 +142,8 @@ export const openEditionMinterList = [ openEditionUpdatableIbcUsdcMinter, openEditionIbcNbtcMinter, openEditionUpdatableIbcNbtcMinter, + openEditionIbcUskMinter, + openEditionUpdatableIbcUskMinter, ] export const vendingStarsMinter: MinterInfo = { diff --git a/config/token.ts b/config/token.ts index 184f911..71afd29 100644 --- a/config/token.ts +++ b/config/token.ts @@ -35,7 +35,9 @@ export const ibcUsdc: TokenInfo = { export const ibcUsk: TokenInfo = { id: 'ibc-usk', denom: - NETWORK === 'mainnet' ? 'ibc/938CEB62ABCBA6366AA369A8362E310B2A0B1A54835E4F3FF01D69D860959128' : 'Not available', + NETWORK === 'mainnet' + ? 'ibc/938CEB62ABCBA6366AA369A8362E310B2A0B1A54835E4F3FF01D69D860959128' + : 'factory/stars153w5xhuqu3et29lgqk4dsynj6gjn96lr33wx4e/uusk', displayName: 'USK', decimalPlaces: 6, } diff --git a/env.d.ts b/env.d.ts index dfae968..e9aa04e 100644 --- a/env.d.ts +++ b/env.d.ts @@ -56,6 +56,8 @@ declare namespace NodeJS { readonly NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_IBC_NBTC_FACTORY_ADDRESS: string readonly NEXT_PUBLIC_OPEN_EDITION_IBC_FRNZ_FACTORY_ADDRESS: string readonly NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_IBC_FRNZ_FACTORY_ADDRESS: string + readonly NEXT_PUBLIC_OPEN_EDITION_IBC_USK_FACTORY_ADDRESS: string + readonly NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_IBC_USK_FACTORY_ADDRESS: string readonly NEXT_PUBLIC_OPEN_EDITION_MINTER_CODE_ID: string readonly NEXT_PUBLIC_BASE_FACTORY_ADDRESS: string readonly NEXT_PUBLIC_BASE_FACTORY_UPDATABLE_ADDRESS: string diff --git a/utils/constants.ts b/utils/constants.ts index ed8f354..31402ce 100644 --- a/utils/constants.ts +++ b/utils/constants.ts @@ -59,6 +59,9 @@ export const OPEN_EDITION_UPDATABLE_IBC_NBTC_FACTORY_ADDRESS = export const OPEN_EDITION_IBC_FRNZ_FACTORY_ADDRESS = process.env.NEXT_PUBLIC_OPEN_EDITION_IBC_FRNZ_FACTORY_ADDRESS export const OPEN_EDITION_UPDATABLE_IBC_FRNZ_FACTORY_ADDRESS = process.env.NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_IBC_FRNZ_FACTORY_ADDRESS +export const OPEN_EDITION_IBC_USK_FACTORY_ADDRESS = process.env.NEXT_PUBLIC_OPEN_EDITION_IBC_USK_FACTORY_ADDRESS +export const OPEN_EDITION_UPDATABLE_IBC_USK_FACTORY_ADDRESS = + process.env.NEXT_PUBLIC_OPEN_EDITION_UPDATABLE_IBC_USK_FACTORY_ADDRESS export const OPEN_EDITION_MINTER_CODE_ID = parseInt(process.env.NEXT_PUBLIC_OPEN_EDITION_MINTER_CODE_ID, 10) export const SG721_NAME_ADDRESS = process.env.NEXT_PUBLIC_SG721_NAME_ADDRESS export const ROYALTY_REGISTRY_ADDRESS = process.env.NEXT_PUBLIC_ROYALTY_REGISTRY_ADDRESS