Skip to content

Commit 799a6d2

Browse files
committed
chore: merge use-algorand
2 parents f3a929a + de2b4a8 commit 799a6d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+8609
-157
lines changed

.gitignore

+68-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ logs
44
npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
712

813
# Runtime data
914
pids
@@ -20,11 +25,12 @@ lib-cov
2025

2126
# Coverage directory used by tools like istanbul
2227
coverage
28+
*.lcov
2329

2430
# nyc test coverage
2531
.nyc_output
2632

27-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
33+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
2834
.grunt
2935

3036
# Bower dependency directory (https://bower.io/)
@@ -42,13 +48,27 @@ jspm_packages/
4248

4349
# TypeScript v1 declaration files
4450
typings/
51+
# Snowpack dependency directory (https://snowpack.dev/)
52+
web_modules/
53+
54+
# TypeScript cache
55+
*.tsbuildinfo
4556

4657
# Optional npm cache directory
4758
.npm
4859

4960
# Optional eslint cache
5061
.eslintcache
5162

63+
# Optional stylelint cache
64+
.stylelintcache
65+
66+
# Microbundle cache
67+
.rpt2_cache/
68+
.rts2_cache_cjs/
69+
.rts2_cache_es/
70+
.rts2_cache_umd/
71+
5272
# Optional REPL history
5373
.node_repl_history
5474

@@ -60,9 +80,18 @@ typings/
6080

6181
# dotenv environment variables file
6282
.env
83+
.env.development.local
84+
.env.test.local
85+
.env.production.local
86+
.env.local
87+
88+
# parcel-bundler cache (https://parceljs.org/)
89+
.cache
90+
.parcel-cache
6391

64-
# next.js build output
92+
# Next.js build output
6593
.next
94+
out
6695

6796
# build output
6897
lib/
@@ -71,9 +100,46 @@ esm
71100
.DS_Store
72101

73102
src/parser.ts
103+
# Nuxt.js build / generate output
104+
.nuxt
74105

106+
# Gatsby files
75107
.cache/
76108
.puppet-main/
109+
# Comment in the public line in if your project uses Gatsby and not Next.js
110+
# https://nextjs.org/blog/next-9-1#public-directory-support
111+
# public
112+
113+
# vuepress build output
114+
.vuepress/dist
115+
116+
# vuepress v2.x temp and cache directory
117+
.temp
118+
.cache
119+
120+
# Docusaurus cache and generated files
121+
.docusaurus
122+
123+
# Serverless directories
124+
.serverless/
125+
126+
# FuseBox cache
127+
.fusebox/
128+
129+
# DynamoDB Local files
130+
.dynamodb/
131+
132+
# TernJS port file
133+
.tern-port
77134

78135
storybook-static/
79136
package-lock.json
137+
# Stores VSCode versions used for testing VSCode extensions
138+
.vscode-test
139+
140+
# yarn v2
141+
.yarn/cache
142+
.yarn/unplugged
143+
.yarn/build-state.yml
144+
.yarn/install-state.gz
145+
.pnp.*

.run/example) commonjs-ts.run.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="example) commonjs-ts" type="js.build_tools.npm">
3+
<package-json value="$PROJECT_DIR$/examples/commonjs-ts-example/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="dev" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<envs />
10+
<method v="2" />
11+
</configuration>
12+
</component>

.run/example) commonjs.run.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="example) commonjs" type="js.build_tools.npm">
3+
<package-json value="$PROJECT_DIR$/examples/commonjs-example/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="dev" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<envs />
10+
<method v="2" />
11+
</configuration>
12+
</component>

.run/example) esm.run.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="example) esm" type="js.build_tools.npm">
3+
<package-json value="$PROJECT_DIR$/examples/esm-example/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="dev" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<envs />
10+
<method v="2" />
11+
</configuration>
12+
</component>

.run/queries) build.run.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="queries) build" type="js.build_tools.npm">
3+
<package-json value="$PROJECT_DIR$/packages/queries/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="build" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<envs />
10+
<method v="2" />
11+
</configuration>
12+
</component>

.run/queries) docs.run.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="queries) docs" type="js.build_tools.npm">
3+
<package-json value="$PROJECT_DIR$/packages/queries/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="docs" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<envs />
10+
<method v="2" />
11+
</configuration>
12+
</component>

.run/svelte) dev.run.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="svelte) dev" type="js.build_tools.npm">
3+
<package-json value="$PROJECT_DIR$/packages/svelte/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="dev" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<envs />
10+
<method v="2" />
11+
</configuration>
12+
</component>

examples/commonjs-example/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require('dotenv').config()
2+
const algosdk = require('algosdk')
3+
const {getClient} = require('@algofam/use-algorand-queries/algod')
4+
const assert = require('node:assert')
5+
const client = getClient({
6+
server: process.env.ALGOD_SERVER,
7+
port: process.env.ALGOD_PORT,
8+
token: process.env.ALGOD_TOKEN,
9+
})
10+
import('chalk').then(({default: chalk})=>{
11+
console.log(chalk.yellow("Loading from"),chalk.blue(require.resolve('@algofam/use-algorand-queries')))
12+
assert(client instanceof algosdk.Algodv2)
13+
console.log(chalk.green('Finished!'))
14+
})
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "commonjs-example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "commonjs",
7+
"scripts": {
8+
"dev": "node index.js",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"author": "",
12+
"license": "MIT",
13+
"dependencies": {
14+
"@algofam/use-algorand-queries": "^1.0.0",
15+
"chalk": "^5.3.0",
16+
"dotenv": "^16.3.1"
17+
}
18+
}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ENVIRONMENT=local
2+
3+
# Algod
4+
ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5+
ALGOD_SERVER=http://localhost
6+
ALGOD_PORT=4001
7+
ALGOD_NETWORK=""
8+
9+
# Indexer
10+
INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
11+
INDEXER_SERVER=http://localhost
12+
INDEXER_PORT=8980
13+
14+
# KMD
15+
# Please note:
16+
# 1. This is only needed for LocalNet since
17+
# by default KMD provider is ignored on other networks.
18+
# 2. AlgoKit LocalNet starts with a single wallet called 'unencrypted-default-wallet',
19+
# with heaps of tokens available for testing.
20+
KMD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
21+
KMD_SERVER=http://localhost
22+
KMD_PORT=4002
23+
KMD_WALLET="unencrypted-default-wallet"
24+
KMD_PASSWORD=""
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.js

examples/commonjs-ts-example/index.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import "dotenv/config";
2+
import chalk from 'chalk'
3+
import algosdk from 'algosdk'
4+
import {getClient} from "@algofam/use-algorand-queries/algod";
5+
import assert from "node:assert";
6+
const client = getClient({
7+
server: process.env.ALGOD_SERVER,
8+
port: process.env.ALGOD_PORT,
9+
token: process.env.ALGOD_TOKEN,
10+
})
11+
console.log(chalk.yellow("Loading from"),chalk.blue(require.resolve('@algofam/use-algorand-queries')))
12+
assert(client instanceof algosdk.Algodv2)
13+
console.log(chalk.green('Finished!'))
14+
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "commonjs-ts-example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "commonjs",
7+
"scripts": {
8+
"dev": "ts-node index.ts",
9+
"build": "tsc"
10+
},
11+
"author": "",
12+
"license": "MIT",
13+
"dependencies": {
14+
"@algofam/use-algorand-queries": "^1.0.0",
15+
"chalk": "^4.1.2",
16+
"dotenv": "^16.3.1"
17+
},
18+
"devDependencies": {
19+
"ts-node": "^10.9.1",
20+
"typescript": "^5.2.2"
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"moduleResolution": "node",
5+
"esModuleInterop": true,
6+
"strict": true,
7+
}
8+
}

examples/esm-example/.env.sample

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ENVIRONMENT=local
2+
3+
# Algod
4+
ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5+
ALGOD_SERVER=http://localhost
6+
ALGOD_PORT=4001
7+
ALGOD_NETWORK=""
8+
9+
# Indexer
10+
INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
11+
INDEXER_SERVER=http://localhost
12+
INDEXER_PORT=8980
13+
14+
# KMD
15+
# Please note:
16+
# 1. This is only needed for LocalNet since
17+
# by default KMD provider is ignored on other networks.
18+
# 2. AlgoKit LocalNet starts with a single wallet called 'unencrypted-default-wallet',
19+
# with heaps of tokens available for testing.
20+
KMD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
21+
KMD_SERVER=http://localhost
22+
KMD_PORT=4002
23+
KMD_WALLET="unencrypted-default-wallet"
24+
KMD_PASSWORD=""

examples/esm-example/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import "dotenv/config";
2+
import chalk from 'chalk'
3+
import {resolve} from 'import-meta-resolve'
4+
import algosdk from 'algosdk'
5+
import {getClient} from "@algofam/use-algorand-queries/algod";
6+
import assert from "node:assert";
7+
const client = getClient({
8+
server: process.env.ALGOD_SERVER,
9+
port: process.env.ALGOD_PORT,
10+
token: process.env.ALGOD_TOKEN,
11+
})
12+
13+
console.log(chalk.yellow("Loading from"),chalk.blue(resolve('@algofam/use-algorand-queries', import.meta.url)))
14+
assert(client instanceof algosdk.Algodv2)
15+
console.log(chalk.green('Finished!'))

examples/esm-example/package.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "esm-example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "module",
7+
"scripts": {
8+
"dev": "node --experimental-import-meta-resolve index.js",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"author": "",
12+
"license": "MIT",
13+
"dependencies": {
14+
"@algofam/use-algorand-queries": "^1.0.0",
15+
"chalk": "^5.3.0",
16+
"dotenv": "^16.3.1",
17+
"import-meta-resolve": "^3.0.0"
18+
}
19+
}

examples/esm-ts-example/.env.sample

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ENVIRONMENT=local
2+
3+
# Algod
4+
ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5+
ALGOD_SERVER=http://localhost
6+
ALGOD_PORT=4001
7+
ALGOD_NETWORK=""
8+
9+
# Indexer
10+
INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
11+
INDEXER_SERVER=http://localhost
12+
INDEXER_PORT=8980
13+
14+
# KMD
15+
# Please note:
16+
# 1. This is only needed for LocalNet since
17+
# by default KMD provider is ignored on other networks.
18+
# 2. AlgoKit LocalNet starts with a single wallet called 'unencrypted-default-wallet',
19+
# with heaps of tokens available for testing.
20+
KMD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
21+
KMD_SERVER=http://localhost
22+
KMD_PORT=4002
23+
KMD_WALLET="unencrypted-default-wallet"
24+
KMD_PASSWORD=""

0 commit comments

Comments
 (0)