Skip to content

Commit f9d4d18

Browse files
committed
feat: init commit
0 parents  commit f9d4d18

38 files changed

+5245
-0
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage
2+
public
3+
dist
4+
pnpm-lock.yaml
5+
pnpm-workspace.yaml

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit ${1}

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage
2+
public
3+
dist
4+
pnpm-lock.yaml
5+
pnpm-workspace.yaml

.prettierrc.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"singleQuote": true,
3+
"jsxSingleQuote": true,
4+
"bracketSpacing": true,
5+
"vueIndentScriptAndStyle": true,
6+
"endOfLine": "crlf",
7+
"trailingComma": "all",
8+
"arrowParens": "always",
9+
"printWidth": 100,
10+
"tabWidth": 2,
11+
"htmlWhitespaceSensitivity": "ignore"
12+
}

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# @boltbunny

apps/web-app/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

apps/web-app/.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar"]
3+
}

apps/web-app/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Vue 3 + TypeScript + Vite
2+
3+
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4+
5+
## Recommended Setup
6+
7+
- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously Volar) and disable Vetur
8+
9+
- Use [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) for performing the same type checking from the command line, or for generating d.ts files for SFCs.

apps/web-app/index.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<link
8+
href="https://cdn.jsdelivr.net/npm/daisyui@4.10.1/dist/full.min.css"
9+
rel="stylesheet"
10+
type="text/css"
11+
/>
12+
<script src="https://cdn.jsdelivr.net/npm/@unocss/runtime"></script>
13+
14+
<title>@BoltBunny Demo</title>
15+
</head>
16+
<body>
17+
<div id="app"></div>
18+
<script type="module" src="/src/main.ts"></script>
19+
</body>
20+
</html>

apps/web-app/package.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "web-app",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vue-tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@boltbunny/ts-sdk": "workspace:^",
13+
"petra-plugin-wallet-adapter": "^0.4.5",
14+
"vue": "^3.4.21"
15+
},
16+
"devDependencies": {
17+
"@vitejs/plugin-vue": "^5.0.4",
18+
"typescript": "^5.2.2",
19+
"vite": "^5.2.0",
20+
"vue-tsc": "^2.0.6"
21+
}
22+
}

apps/web-app/public/vite.svg

+1
Loading

apps/web-app/src/App.vue

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<template>
2+
<div class="flex flex-col max-w-[750px] mx-auto py-10">
3+
<button class="btn btn-neutral" @click="connectWallet" v-if="!address">Connect</button>
4+
<div class="flex flex-col gap-5" v-else>
5+
<span class="flex flex-col">
6+
<span>Connected Wallet Address:</span>
7+
<span class="font-bold">{{ address }}</span>
8+
</span>
9+
10+
<labe class="input input-bordered w-full flex items-center gap-2">
11+
<span class="w-24 text-gray">Transfer to:</span>
12+
<input v-model="reciept" type="text" placeholder="Type here" class="w-full" />
13+
</labe>
14+
<button class="btn btn-primary" @click="transfer">Transfer 0.01 APT</button>
15+
</div>
16+
</div>
17+
</template>
18+
19+
<script setup lang="ts">
20+
import { onMounted, ref } from 'vue';
21+
22+
const address = ref('');
23+
24+
const connectWallet = async () => {
25+
const result: any = await window.petra.connect();
26+
address.value = result.address;
27+
window.localStorage.setItem('petra-wallet', 'yes');
28+
};
29+
30+
const init = async () => {
31+
if (window.localStorage.getItem('petra-wallet')) {
32+
connectWallet();
33+
}
34+
};
35+
36+
const reciept = ref('0xe51c64d1f2595557676053e03ce637f9fe26af706c156cae7fff3ad4893ccc53');
37+
const transfer = async () => {
38+
const networkInfo: any = await window.petra.getNetwork();
39+
console.log(networkInfo);
40+
41+
if (networkInfo.chainId != 2) {
42+
alert('Please switch to testnet');
43+
return;
44+
}
45+
46+
if (!address.value) {
47+
alert('Please connect wallet');
48+
return;
49+
}
50+
51+
if (!reciept.value) {
52+
alert('Please enter reciept');
53+
return;
54+
}
55+
56+
const result: any = await window.petra.signAndSubmitTransaction({
57+
arguments: [reciept.value, '101'],
58+
function: '0x1::coin::transfer',
59+
type: 'entry_function_payload',
60+
type_arguments: ['0x1::aptos_coin::AptosCoin'],
61+
});
62+
console.log(result);
63+
alert(`Transaction submitted: ${result.hash}, ${result.vm_status}`);
64+
};
65+
66+
onMounted(() => {
67+
init();
68+
});
69+
</script>
70+
71+
<style scoped></style>

apps/web-app/src/assets/vue.svg

+1
Loading
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue';
3+
4+
defineProps<{ msg: string }>();
5+
6+
const count = ref(0);
7+
</script>
8+
9+
<template>
10+
<h1>{{ msg }}</h1>
11+
12+
<div class="card">
13+
<button type="button" @click="count++">count is {{ count }}</button>
14+
<p>
15+
Edit
16+
<code>components/HelloWorld.vue</code>
17+
to test HMR
18+
</p>
19+
</div>
20+
21+
<p>
22+
Check out
23+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">create-vue</a>
24+
, the official Vue + Vite starter
25+
</p>
26+
<p>
27+
Install
28+
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
29+
in your IDE for a better DX
30+
</p>
31+
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
32+
</template>
33+
34+
<style scoped>
35+
.read-the-docs {
36+
color: #888;
37+
}
38+
</style>

apps/web-app/src/main.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { createApp } from 'vue';
2+
import './style.css';
3+
import App from './App.vue';
4+
5+
createApp(App).mount('#app');

apps/web-app/src/style.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* {
2+
box-sizing: border-box;
3+
}

apps/web-app/src/vite-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="vite/client" />
2+
3+
interface Window {
4+
petra: any;
5+
}

apps/web-app/tsconfig.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"useDefineForClassFields": true,
5+
"module": "ESNext",
6+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7+
"skipLibCheck": true,
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"noEmit": true,
15+
"jsx": "preserve",
16+
17+
/* Linting */
18+
"strict": true,
19+
"noUnusedLocals": true,
20+
"noUnusedParameters": true,
21+
"noFallthroughCasesInSwitch": true
22+
},
23+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
24+
"references": [{ "path": "./tsconfig.node.json" }]
25+
}

apps/web-app/tsconfig.node.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"skipLibCheck": true,
5+
"module": "ESNext",
6+
"moduleResolution": "bundler",
7+
"allowSyntheticDefaultImports": true,
8+
"strict": true
9+
},
10+
"include": ["vite.config.ts"]
11+
}

apps/web-app/vite.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite';
2+
import vue from '@vitejs/plugin-vue';
3+
4+
// https://vitejs.dev/config/
5+
export default defineConfig({
6+
plugins: [vue()],
7+
});

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default { extends: ['@commitlint/config-conventional'] };

eslint.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import globals from 'globals';
2+
import pluginJs from '@eslint/js';
3+
import tseslint from 'typescript-eslint';
4+
5+
export default [
6+
{ languageOptions: { globals: globals.browser } },
7+
pluginJs.configs.recommended,
8+
...tseslint.configs.recommended,
9+
];

package.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "boltbunny",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"lint": "eslint .",
9+
"changeset-version": "pnpm changeset version",
10+
"dev:sdk": "pnpm ts-sdk build --watch",
11+
"format": "prettier --write .",
12+
"prepare": "husky install",
13+
"ts-sdk": "pnpm --filter ts-sdk",
14+
"app": "pnpm --filter web-app"
15+
},
16+
"keywords": [],
17+
"author": "",
18+
"license": "MIT",
19+
"engines": {
20+
"node": ">=20.11.0"
21+
},
22+
"type": "module",
23+
"devDependencies": {
24+
"@changesets/cli": "^2.27.1",
25+
"@commitlint/cli": "^19.2.2",
26+
"@commitlint/config-conventional": "^19.2.2",
27+
"@eslint/js": "^9.0.0",
28+
"eslint": "^9.0.0",
29+
"eslint-config-prettier": "^9.1.0",
30+
"eslint-plugin-prettier": "^5.1.3",
31+
"globals": "^15.0.0",
32+
"husky": "^9.0.11",
33+
"lint-staged": "^15.2.2",
34+
"prettier": "^3.2.5",
35+
"typescript-eslint": "^7.6.0"
36+
},
37+
"lint-staged": {
38+
"**/*.{js,ts,tsx}": [],
39+
"**/*": "prettier --write --ignore-unknown"
40+
}
41+
}

packages/ts-sdk/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

0 commit comments

Comments
 (0)