-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(station)!: multi chain support (#374)
design doc: https://docs.google.com/document/d/1l8u2-m2lH-FeN6tLJv80pqUnHpWIy3ROkz7jxTz0HtM/edit?tab=t.0#heading=h.lic4oqo4af1m Jira ticket: https://dfinity.atlassian.net/browse/PEN-142?atlOrigin=eyJpIjoiNTExMDU0ODUzODFjNDRjNDhlMDEzNTI1OTdjOWRlMDAiLCJwIjoiaiJ9 --------- Co-authored-by: Kepler Vital <[email protected]> Co-authored-by: mraszyk <[email protected]>
- Loading branch information
1 parent
dbef4bd
commit 6dce3f7
Showing
233 changed files
with
15,564 additions
and
2,021 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<TextOverflow | ||
v-if="format === AddressFormat.ICRC1" | ||
:text="address" | ||
:overflow-position="shortenIcrc1Address" | ||
></TextOverflow> | ||
|
||
<TextOverflow v-else :text="address" :max-length="32"></TextOverflow> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { AddressFormat } from '~/types/chain.types'; | ||
import TextOverflow from './TextOverflow.vue'; | ||
import { shortenIcrc1Address } from '~/utils/asset.utils'; | ||
defineProps<{ | ||
address: string; | ||
format: AddressFormat | string | undefined; | ||
}>(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
{{ assetNames.join(', ') }} | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { useStationStore } from '~/stores/station.store'; | ||
const props = defineProps<{ | ||
assetIds: string[]; | ||
}>(); | ||
const station = useStationStore(); | ||
const assetNames = computed(() => { | ||
return props.assetIds.map( | ||
id => | ||
station.configuration.details.supported_assets.find(token => token.id === id)?.symbol || id, | ||
); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
apps/wallet/src/components/accounts/AddAccountAssetBtn.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<template> | ||
<VBtn | ||
v-bind="$attrs" | ||
:size="props.size.value" | ||
:variant="props.variant.value" | ||
:icon="props.icon.value && !props.text.value" | ||
:color="props.color.value" | ||
@click="open = true" | ||
> | ||
<VIcon v-if="props.icon.value" :icon="props.icon.value" /> | ||
<slot name="default"> | ||
<span v-if="props.text">{{ props.text.value }}</span> | ||
</slot> | ||
<VIcon v-if="props.appendIcon.value" :icon="props.appendIcon.value" /> | ||
</VBtn> | ||
|
||
<AddAccountAssetDialog | ||
:account="props.account.value" | ||
:open="open" | ||
:readonly="props.readonly.value" | ||
@update:open=" | ||
openEvent => { | ||
open = openEvent; | ||
emit('opened', openEvent); | ||
} | ||
" | ||
/> | ||
</template> | ||
<script lang="ts" setup> | ||
import { ref, toRefs } from 'vue'; | ||
import { VBtn } from 'vuetify/components'; | ||
import { Account } from '~/generated/station/station.did'; | ||
import AddAccountAssetDialog from './AddAccountAssetDialog.vue'; | ||
const input = withDefaults( | ||
defineProps<{ | ||
account: Account; | ||
icon?: string; | ||
text?: string; | ||
size?: 'x-small' | 'small' | 'default' | 'medium' | 'large' | 'x-large'; | ||
variant?: 'flat' | 'text' | 'outlined' | 'elevated'; | ||
color?: string; | ||
readonly?: boolean; | ||
appendIcon?: string; | ||
}>(), | ||
{ | ||
icon: undefined, | ||
text: undefined, | ||
size: 'default', | ||
variant: 'elevated', | ||
color: 'primary', | ||
readonly: false, | ||
appendIcon: undefined, | ||
}, | ||
); | ||
const open = ref(false); | ||
const emit = defineEmits<{ | ||
(event: 'opened', payload: boolean): void; | ||
}>(); | ||
const props = toRefs(input); | ||
</script> |
Oops, something went wrong.