forked from jackyzha0/quartz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Signal-K/cli
Cli interface with starter react props
- Loading branch information
Showing
24 changed files
with
28,817 additions
and
0 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
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,37 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
dappyaccount.json | ||
dappykeys.json | ||
userkeys.json | ||
useraccount.json | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
|
||
#Hardhat files | ||
cache | ||
artifacts |
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 @@ | ||
Documentation related to typescript components of the Quartz repo, as well as examples for integration with LedgerStream-CLI (signal-k/cli) repo on Github.com |
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,3 @@ | ||
const add = (a: number, b: number): number => { | ||
return a + b; | ||
}; |
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,12 @@ | ||
const today = new Date(); | ||
today.getMonth(); | ||
|
||
const person = { | ||
age: 20 | ||
}; | ||
person.age += 1; | ||
|
||
class Colour { | ||
|
||
} | ||
const red = new Colour(); |
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,58 @@ | ||
let apples: number = 5; | ||
let speed: string = 'fast'; | ||
let hasName: boolean = true; | ||
let applesInference = 5; | ||
let applesAnnotation: number = 5; | ||
|
||
let nothing: null = null; | ||
let nothingu: undefined = undefined; | ||
|
||
// Built in objects | ||
let now: Date = new Date(); | ||
|
||
// Array that only contains strings | ||
let colours: string[] = ['red', 'green', 'blue']; | ||
let myNumbers: number[] = [1, 2, 3]; | ||
let statements: boolean[] = [true, false, true]; | ||
|
||
// Classes with type annoations | ||
class Car { | ||
|
||
} | ||
let car: Car = new Car(); | ||
|
||
// Object literal with type annoations | ||
let point: { x: number; y: number; } = { | ||
x: 10, | ||
y: 20 | ||
} | ||
|
||
// Function with type annoations | ||
const logNumber: (i: number) => void = (i: number) => { | ||
console.log(i); | ||
} | ||
|
||
// Json annotations | ||
const json = '{"x": 10, "y": 20}'; | ||
const coordinates: { x: number; y: number } = JSON.parse(json); | ||
console.log(coordinates); | ||
|
||
// Anotation for declaring and later initializing variables | ||
let words = ['red', 'green', 'blue']; | ||
let foundWord: boolean; | ||
|
||
for (let i = 0; i < words.length; i++) { | ||
if (words[i] === 'green') { | ||
foundWord = true; | ||
} | ||
} | ||
|
||
// Non-inferrable variable | ||
let numbers = [-10, -1, 12]; | ||
let numberAboveZero: boolean | number = false; | ||
|
||
for (let i = 0; i < numbers.length; i++) { | ||
if (numbers[i] > 0) { | ||
numberAboveZero = numbers[i]; | ||
} | ||
} |
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,2 @@ | ||
MY_ACCOUNT_ID = # | ||
MY_PRIVATE_KEY = # |
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,18 @@ | ||
const { Client } = require("@hashgraph/sdk"); | ||
require("dotenv").config(); | ||
|
||
async function main() { | ||
const myAccountId = process.env.MY_ACCOUNT_ID | ||
const myPrivateKey = process.env.MY_PRIVATE_KEY | ||
|
||
if (myAccountId == null || | ||
myPrivateKey == null ) { | ||
throw new Error("Environment variables must be present"); | ||
} | ||
} | ||
|
||
const client = Client.forTestnet(); | ||
|
||
client.setOperator(myAccountId, myPrivateKey); | ||
|
||
// put into async function main() { |
Oops, something went wrong.