Skip to content

Commit

Permalink
fix: Multiple minor fixes (dm) (#3806)
Browse files Browse the repository at this point in the history
* fix: Exact out handler (#3793)

* fix: Don't use swap exit if 1st level pool token

* fix: buildExitExactTokensOut needs to have the bpt removed from tokenslist

* 1.115.1

* Feat: Avalanche Support (#3487)

* Feat: Avalanche Support

* Add Initial contract addresses and settings for Avalanche

* Add subgraphs and token addresses

* Use a different public RPC. Add multicall address

* Fix websocket URL, wallet enum and allowlist pools I created

* Add trust wallet network for gauges and icons

* Add avalanche network icon

* Use new BAL token

* Hide Avalanche in UI

* whitelist initial boosted pools

* Add pool factories. Remove pool with old BAL token from allowlist

* Load ComposableStable and FX pool types

* Add gyro to included pool types

* Fix pools protocol features after refactor

---------

Co-authored-by: ZeKraken <[email protected]>
Co-authored-by: Alberto Gualis <[email protected]>

* 1.115.2

* fix: Catch metadata error setting (#3794)

* 1.115.3

* Update SDK

* 1.115.4

* fix: Selected token in add liquidity form (#3788)

* 1.115.5

* update weekly gauges and whitelist for migration (#3796)

* 1.115.6

* Update `pools.ts` (#3786)

Co-authored-by: Gareth Fuller <[email protected]>

* 1.115.7

* fix: Wait for approvals in lock actions (#3802)

* 1.115.8

* fix: Prevent any kind of negative input in TokenInput

* chore: Minor style fix in TokenSelectInput

* fix: Prevent pool creation before approval actions have loaded

* fix: Prevent pool creation if wallet on wrong network

---------

Co-authored-by: Alberto Gualis <[email protected]>
Co-authored-by: Automated Version Bump <[email protected]>
Co-authored-by: Tim Robinson <[email protected]>
Co-authored-by: ZeKraken <[email protected]>
Co-authored-by: Tim Robinson <[email protected]>
Co-authored-by: Max Korolev <[email protected]>
  • Loading branch information
7 people authored Jul 26, 2023
1 parent 1e2cc39 commit c66205a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/components/cards/CreatePool/CreateActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const createState = reactive<CreateState>({
isRestoredTxConfirmed: false,
isLoadingRestoredTx: false,
});
const isLoading = ref(true);
/*
* COMPOSABLES
Expand Down Expand Up @@ -125,6 +126,8 @@ onBeforeMount(async () => {
actionType: ApprovalAction.AddLiquidity,
});
actions.value = [...approvalActions, ...actions.value];
isLoading.value = false;
});
/**
Expand All @@ -144,7 +147,7 @@ function handleSuccess(details: any): void {
:actions="requiredActions"
primaryActionType="createPool"
:disabled="props.createDisabled"
:isLoading="createState.isLoadingRestoredTx"
:isLoading="isLoading"
:loadingLabel="$t('restoring')"
@success="handleSuccess"
/>
Expand Down
8 changes: 6 additions & 2 deletions src/components/cards/CreatePool/PreviewPool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const { getToken, priceFor, nativeAsset, wrappedNativeAsset, balanceFor } =
useTokens();
const { fNum } = useNumbers();
const { t } = useI18n();
const { account } = useWeb3();
const { account, isMismatchedNetwork } = useWeb3();
const { networkConfig } = useNetwork();
/**
Expand Down Expand Up @@ -96,6 +96,10 @@ const hasMissingPoolNameOrSymbol = computed(() => {
return poolSymbol.value === '' || poolName.value === '';
});
const actionsDisabled = computed((): boolean => {
return hasMissingPoolNameOrSymbol.value || isMismatchedNetwork.value;
});
const initialWeights = computed(() => {
const _initialWeights: Record<string, BigNumber> = {};
for (const seedToken of seedTokens.value) {
Expand Down Expand Up @@ -345,7 +349,7 @@ function getInitialWeightHighlightClass(tokenAddress: string) {
</AnimatePresence>

<CreateActions
:createDisabled="hasMissingPoolNameOrSymbol"
:createDisabled="actionsDisabled"
:tokenAddresses="tokenAddresses"
:amounts="tokenAmounts"
@success="handleSuccess"
Expand Down
4 changes: 3 additions & 1 deletion src/components/inputs/TokenInput/TokenInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ const decimalLimit = computed<number>(() => token.value?.decimals || 18);
* METHODS
*/
function handleAmountChange(amount: InputValue) {
const safeAmount = overflowProtected(amount, decimalLimit.value);
let safeAmount = overflowProtected(amount, decimalLimit.value);
safeAmount = bnum(safeAmount).abs().toString(); // Prevent any negative values
emit('update:amount', safeAmount);
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/inputs/TokenSelectInput/TokenSelectInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ function toggleModal(): void {
:class="['token-select-input selected group', { selectable: !fixed }]"
@click="toggleModal"
>
<div class="w-8">
<div class="flex items-center w-8">
<BalAsset :address="token?.address" class="shadow" />
</div>
<span class="text-base font-medium">
<div class="flex items-center -mb-px text-base font-medium leading-none">
{{ token?.symbol }}
</span>
<span v-if="Number(weight) > 0" class="ml-2 text-secondary">
</div>
<div v-if="Number(weight) > 0" class="ml-2 text-secondary">
{{
fNum(weight, {
style: 'percent',
maximumFractionDigits: 0,
})
}}
</span>
</div>
<BalIcon
v-if="!fixed"
name="chevron-down"
Expand Down

1 comment on commit c66205a

@vercel
Copy link

@vercel vercel bot commented on c66205a Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.