Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐕 woof woof #7

Open
wants to merge 13 commits into
base: main-nuxt
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: lint
on:
pull_request:
branches: [ main-nuxt ]
jobs:
eslint:
name: runner / eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run eslint with reviewdog
uses: reviewdog/action-eslint@v1.0.0
with:
level: error
reporter: github-pr-review
fail_on_error: true
github_token: ${{ secrets.GITHUB_TOKEN }}
# eslint_flags: 'src'
78 changes: 39 additions & 39 deletions .github/workflows/snyk-infrastructure-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
# A sample workflow which checks out your Infrastructure as Code Configuration files,
# such as Kubernetes, Helm & Terraform and scans them for any security issues.
# The results are then uploaded to GitHub Security Code Scanning
#
# For more examples, including how to limit scans to only high-severity issues
# and fail PR checks, see https://github.com/snyk/actions/
# # A sample workflow which checks out your Infrastructure as Code Configuration files,
# # such as Kubernetes, Helm & Terraform and scans them for any security issues.
# # The results are then uploaded to GitHub Security Code Scanning
# #
# # For more examples, including how to limit scans to only high-severity issues
# # and fail PR checks, see https://github.com/snyk/actions/

name: Snyk Infrastructure as Code
# name: Snyk Infrastructure as Code

on:
push:
branches: [ main-nuxt, main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main-nuxt ]
schedule:
- cron: '19 22 * * 1'
# on:
# push:
# branches: [ main-nuxt, main ]
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ main-nuxt ]
# schedule:
# - cron: '19 22 * * 1'

jobs:
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Snyk to check configuration files for security issues
# Snyk can be used to break the build when it detects security issues.
# In this case we want to upload the issues to GitHub Code Scanning
continue-on-error: true
uses: snyk/actions/iac@master
env:
# In order to use the Snyk Action you will need to have a Snyk API token.
# More details in https://github.com/snyk/actions#getting-your-snyk-token
# or you can signup for free at https://snyk.io/login
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
# Add the path to the configuration file that you would like to test.
# For example `deployment.yaml` for a Kubernetes deployment manifest
# or `main.tf` for a Terraform configuration file
file: your-file-to-test.yaml
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: snyk.sarif
# jobs:
# snyk:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Run Snyk to check configuration files for security issues
# # Snyk can be used to break the build when it detects security issues.
# # In this case we want to upload the issues to GitHub Code Scanning
# continue-on-error: true
# uses: snyk/actions/iac@master
# env:
# # In order to use the Snyk Action you will need to have a Snyk API token.
# # More details in https://github.com/snyk/actions#getting-your-snyk-token
# # or you can signup for free at https://snyk.io/login
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
# with:
# # Add the path to the configuration file that you would like to test.
# # For example `deployment.yaml` for a Kubernetes deployment manifest
# # or `main.tf` for a Terraform configuration file
# file: your-file-to-test.yaml
# - name: Upload result to GitHub Code Scanning
# uses: github/codeql-action/upload-sarif@v1
# with:
# sarif_file: snyk.sarif
18 changes: 9 additions & 9 deletions coingecko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ import Axios from 'axios'
export const BASE_URL = 'https://api.coingecko.com/api/v3'

const api = Axios.create({
baseURL: BASE_URL,
headers: {
'Content-Type': 'application/json'
},
withCredentials: false
})
baseURL: BASE_URL,
headers: {
'Content-Type': 'application/json'
},
withCredentials: false
})

export const getKSMUSD = async (): Promise<number> => {
const coinId: string = 'kusama'
const coinId = 'kusama'
try {
const { data } = await api.get(`/simple/price`, {
const { data } = await api.get('/simple/price', {
params: {
ids: coinId,
vs_currencies: 'usd'
}
})

return data[coinId]['usd'];
return data[coinId]['usd']
} catch (error) {
console.log(error)
return 1
Expand Down
130 changes: 65 additions & 65 deletions colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,71 +3,71 @@

// The mapping here is done on the actual chain name (system.chain RPC) or
// the actual RPC node it is corrected to (system.name RPC)
import Connector from '@vue-polkadot/vue-api';
import Connector from '@vue-polkadot/vue-api'

// defaults
const emptyColor = '#99999';
const emptyColor = '#99999'

// based on chain name
// alphabetical
const chainBitCountry = '#191a2e';
const chainCrab = '#7C30DD';
const chainCrust = '#ff8812';
const chainClover = 'linear-gradient(to right, #52ad75, #7cc773)';
const chainChainx = '#F6C94A';
const chainDarwinia = 'linear-gradient(-45deg, #FE3876 0%, #7C30DD 71%, #3A30DD 100%)';
const chainHanonycash = '#0099CC';
const chainHydrate = '#000000';
const chainIntegritee = '#080808';
const chainKulupu = '#003366';
const chainPhala = '#a7e300';
const chainPlasm = '#2096F3';
const chainPolkabtc = '#510101';
const chainPolkadex = '#7C30DD';
const chainPolkadot = '#e6007a';
const chainKilt = '#8c175b';
const chainKusama = '#000000';
const chainRocco = '#6f36dc';
const chainRoccoAcala = '#173DC9';
const chainRoccoAres = '#70FF8B';
const chainRoccoBifrost = '#002cc3';
const chainRoccoDarwinia = 'linear-gradient(-45deg, #FE3876 0%, #7C30DD 71%, #3A30DD 100%)';
const chainRoccoDataHighway = '#000000';
const chainRococoLaminar = '#004FFF';
const chainRoccoTick = '#22bb22';
const chainRoccoTrack = '#bb2222';
const chainRoccoTrick = '#2222bb';
const chainWestend = '#da68a7';
const chainGalois = '#000000';
const chainZero = '#000000';
const chainZenlink = 'linear-gradient(45deg, #F20082 0%, #FF4D4D 100%)';
const chainJupiter = '#7143ff';
const chainUniarts = '#b39ef7';
const chainIdavoll = '#ff43ff';
const chainSubDAO = 'linear-gradient(50deg, #F20092 0%, #FF4D5D 100%)';
const chainBitCountry = '#191a2e'
const chainCrab = '#7C30DD'
const chainCrust = '#ff8812'
const chainClover = 'linear-gradient(to right, #52ad75, #7cc773)'
const chainChainx = '#F6C94A'
const chainDarwinia = 'linear-gradient(-45deg, #FE3876 0%, #7C30DD 71%, #3A30DD 100%)'
const chainHanonycash = '#0099CC'
const chainHydrate = '#000000'
const chainIntegritee = '#080808'
const chainKulupu = '#003366'
const chainPhala = '#a7e300'
const chainPlasm = '#2096F3'
const chainPolkabtc = '#510101'
const chainPolkadex = '#7C30DD'
const chainPolkadot = '#e6007a'
const chainKilt = '#8c175b'
const chainKusama = '#000000'
const chainRocco = '#6f36dc'
const chainRoccoAcala = '#173DC9'
const chainRoccoAres = '#70FF8B'
const chainRoccoBifrost = '#002cc3'
const chainRoccoDarwinia = 'linear-gradient(-45deg, #FE3876 0%, #7C30DD 71%, #3A30DD 100%)'
const chainRoccoDataHighway = '#000000'
const chainRococoLaminar = '#004FFF'
const chainRoccoTick = '#22bb22'
const chainRoccoTrack = '#bb2222'
const chainRoccoTrick = '#2222bb'
const chainWestend = '#da68a7'
const chainGalois = '#000000'
const chainZero = '#000000'
const chainZenlink = 'linear-gradient(45deg, #F20082 0%, #FF4D4D 100%)'
const chainJupiter = '#7143ff'
const chainUniarts = '#b39ef7'
const chainIdavoll = '#ff43ff'
const chainSubDAO = 'linear-gradient(50deg, #F20092 0%, #FF4D5D 100%)'

// based on node name
// alphabetical
const nodeBitCountry = '#191a2e';
const nodeBifrost = '#002cc3';
const nodeCanvas = '#c77cff';
const nodeCentrifuge = '#fcc367';
const nodeEdgeware = '#0a95df';
const nodeEncointerNotee = '#cc0000';
const nodeEncointerTeeproxy = '#0000cc';
const nodeEquilibrium = '#1792ff';
const nodeJupiter = '#7143ff';
const nodeMoonbeam = '#53cbc9';
const nodeNodle = '#1ab394';
const nodePolkadex = '#7C30DD';
const nodeSora = '#2D2926';
const nodeStafi = '#00F3AB';
const nodeSubDAO = 'linear-gradient(50deg, #F20092 0%, #FF4D5D 100%)';
const nodeTernoa = '#d622ff';
const nodeZero = '#0099cc';
const nodeZenlink = 'linear-gradient(45deg, #F20082 0%, #FF4D4D 100%)';
const nodeBitCountry = '#191a2e'
const nodeBifrost = '#002cc3'
const nodeCanvas = '#c77cff'
const nodeCentrifuge = '#fcc367'
const nodeEdgeware = '#0a95df'
const nodeEncointerNotee = '#cc0000'
const nodeEncointerTeeproxy = '#0000cc'
const nodeEquilibrium = '#1792ff'
const nodeJupiter = '#7143ff'
const nodeMoonbeam = '#53cbc9'
const nodeNodle = '#1ab394'
const nodePolkadex = '#7C30DD'
const nodeSora = '#2D2926'
const nodeStafi = '#00F3AB'
const nodeSubDAO = 'linear-gradient(50deg, #F20092 0%, #FF4D5D 100%)'
const nodeTernoa = '#d622ff'
const nodeZero = '#0099cc'
const nodeZenlink = 'linear-gradient(45deg, #F20082 0%, #FF4D4D 100%)'

export { emptyColor };
export { emptyColor }

// Alphabetical overrides based on the actual matched chain name
// NOTE: This is as retrieved via the system.chain RPC
Expand Down Expand Up @@ -122,7 +122,7 @@ export const chainColors: Record<string, any> = [
].reduce((colors, [chain, color]): Record<string, any> => ({
...colors,
[chain.toLowerCase()]: color
}), {});
}), {})

// Alphabetical overrides based on the actual software node type
// NOTE: This is as retrieved via the system.name RPC
Expand Down Expand Up @@ -152,31 +152,31 @@ export const nodeColors: Record<string, any> = [
].reduce((colors, [node, color]): Record<string, any> => ({
...colors,
[node.toLowerCase().replace(/-/g, ' ')]: color
}), {});
}), {})


function sanitize (value?: string): string {
return value?.toLowerCase().replace('-', ' ') || '';
return value?.toLowerCase().replace('-', ' ') || ''
}

export function getSystemChainColor (systemChain: string, systemName: string): string | undefined {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return chainColors[sanitize(systemChain)] || nodeColors[sanitize(systemName)];
return chainColors[sanitize(systemChain)] || nodeColors[sanitize(systemName)]
}

const kodaDotGreen = '#41b883'

let currentColor = kodaDotGreen;
let currentColor = kodaDotGreen

export const getCurrentColor = () => currentColor

export const changeCurrentColor = async () => {
const { api } = Connector.getInstance()
try {
const chain = await api.rpc.system.chain();
const node = await api.rpc.system.name();
currentColor = getSystemChainColor(chain.toHuman(), node.toHuman()) || kodaDotGreen;
return currentColor;
const chain = await api.rpc.system.chain()
const node = await api.rpc.system.name()
currentColor = getSystemChainColor(chain.toHuman(), node.toHuman()) || kodaDotGreen
return currentColor
} catch (e) {
console.warn('[COLORS] NO collor for this chain')
}
Expand Down
2 changes: 1 addition & 1 deletion components/landing/Spotlight.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class Leaderboard extends Vue {
'DFxLeonhy3wNSDPVh5uqyai31vsMp2rY7SSJiM7dK6WQSgn'
// 'HtRTwHSP6fYC5PtCsJ7pG4H1hwyPhzXbtVTTVRJ6kvfPFe1', did not set identity
// 'Cu7QaEnRGPE91WvLduzUii2ZNa3jhMWtmB8SYwumycNRmoN' did not set identity
];
]

get defaultSpotlightMetaImage(): string {
const url = new URL(window.location.href)
Expand Down
4 changes: 2 additions & 2 deletions components/metadata/Metadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default class Summary extends Vue {
genesisHash: '',
tokenSymbol:''
}
public chainProperties: any = this.emptyChainProperties;
public loading = false;
public chainProperties: any = this.emptyChainProperties
public loading = false

@Watch('$store.state.chainProperties')
public mapProp(): void {
Expand Down
2 changes: 1 addition & 1 deletion components/rmrk/Create/Admin/ActionSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
import { Component, VModel, Vue } from 'nuxt-property-decorator'
@Component({})
export default class ActionSelector extends Vue {
@VModel({ type: String, default: 'CONSUME' }) selectedAction!: string;
@VModel({ type: String, default: 'CONSUME' }) selectedAction!: string
}
</script>
14 changes: 7 additions & 7 deletions components/rmrk/Create/Admin/AdminPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ export default class AdminPanel extends mixins(
TransactionMixin,
ChainMixin
) {
protected commands = '';
private password = '';
private action: 'SEND' | 'CONSUME' | 'LIST' = 'CONSUME';
protected collections: MintedCollection[] = [];
private selectedCollection: MintedCollection | null = null;
protected listed = true;
protected metaFunction: ProcessFunction | undefined = undefined;
protected commands = ''
private password = ''
private action: 'SEND' | 'CONSUME' | 'LIST' = 'CONSUME'
protected collections: MintedCollection[] = []
private selectedCollection: MintedCollection | null = null
protected listed = true
protected metaFunction: ProcessFunction | undefined = undefined

public async fetchCollections(): EmptyPromise {
const collections = await this.$apollo.query({
Expand Down
6 changes: 3 additions & 3 deletions components/rmrk/Create/Admin/SendHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const components = {

@Component({ components })
export default class SendHandler extends Vue {
protected parsedAddresses: string[] = [];
protected random = false;
protected distribution = 100;
protected parsedAddresses: string[] = []
protected random = false
protected distribution = 100
protected seed: number[] = []

public created(): void {
Expand Down
6 changes: 3 additions & 3 deletions components/rmrk/Create/AttributeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import { Component, Vue, PropSync, Prop, Emit } from 'nuxt-property-decorator'

@Component
export default class AttributeInput extends Vue {
@Prop(Number) index!: number;
@PropSync('trait_type', { type: String }) vKey!: string;
@PropSync('value', { type: String }) vValue!: string;
@Prop(Number) index!: number
@PropSync('trait_type', { type: String }) vKey!: string
@PropSync('value', { type: String }) vValue!: string

@Emit('remove')
protected remove() {
Expand Down
Loading