Skip to content

Commit

Permalink
more generics for PAS/TEER and fee constants
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Oct 26, 2024
1 parent c14f81a commit f6767ec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
7 changes: 7 additions & 0 deletions configs/incognitee.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// some hard-coded values in incognitee worker
// update manually if necessary
export const INCOGNITEE_TX_FEE = 0.01; // TEER or PAS, decimals are respected
export const INCOGNITEE_GTN_GUESS_FEE = 0.1; // TEER or PAS, decimals are respected

export const INCOGNITEE_UNSHIELDING_FEE = 3 * INCOGNITEE_TX_FEE; // TEER or PAS, decimals are respected
export const INCOGNITEE_SHIELDING_FEE_FRACTION = 0.00175; // 0.175% of the shielding amount
19 changes: 13 additions & 6 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
/>
<div class="text-right">
<span class="text-xs text-gray-400"
>Fee: 16 m{{ accountStore.getSymbol }} for L1, 0.175% for
>Fee: ~16 m{{ accountStore.getSymbol }} for L1, {{ formatDecimalBalance(INCOGNITEE_SHIELDING_FEE_FRACTION * 100) }}% for
Incognitee</span
>
</div>
Expand Down Expand Up @@ -563,7 +563,7 @@
<!-- Fee description -->
<div class="text-right">
<span class="text-xs text-gray-400"
>Fee: 30m {{ accountStore.getSymbol }} for Incognitee</span
>Fee: {{ formatDecimalBalance(INCOGNITEE_UNSHIELDING_FEE)}} {{ accountStore.getSymbol }} for Incognitee</span
>
</div>

Expand Down Expand Up @@ -723,7 +723,7 @@
<!-- Fee description -->
<div class="text-right">
<span class="text-xs text-gray-400"
>Fee: 10m {{ accountStore.getSymbol }} for Incognitee</span
>Fee: {{ formatDecimalBalance(INCOGNITEE_TX_FEE) }} {{ accountStore.getSymbol }} for Incognitee</span
>
</div>
</div>
Expand Down Expand Up @@ -767,8 +767,8 @@
<dd
class="mt-1 text-left text-base font-semibold leading-6 text-white"
>
{{ guessTheNumberInfo?.winnings / Math.pow(10, 10) }}
PAS
{{ formatDecimalBalance(guessTheNumberInfo?.winnings / Math.pow(10, accountStore.decimals)) }}
{{ accountStore.getSymbol }}
</dd>
</div>

Expand Down Expand Up @@ -885,7 +885,7 @@
<!-- Fee description below input, right-aligned -->
<div class="absolute right-0 -bottom-5">
<span class="text-xs text-gray-400"
>Fee: 1 PAS for Incognitee</span
>Fee: {{ formatDecimalBalance(INCOGNITEE_GTN_GUESS_FEE) }} {{ accountStore.getSymbol }} for Incognitee</span
>
</div>
</div>
Expand Down Expand Up @@ -1045,6 +1045,13 @@ import {
isLive,
} from "@/lib/environmentConfig";
import ObtainTokenOverlay from "~/components/ui/ObtainTokenOverlay.vue";
import { formatDecimalBalance } from "@/store/account";
import {
INCOGNITEE_GTN_GUESS_FEE,
INCOGNITEE_SHIELDING_FEE_FRACTION,
INCOGNITEE_TX_FEE,
INCOGNITEE_UNSHIELDING_FEE
} from "../configs/incognitee";

const router = useRouter();
const accountStore = useAccount();
Expand Down

0 comments on commit f6767ec

Please sign in to comment.