Commit 06f6052b authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

u

parent 44c72fb3
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.history
\ No newline at end of file
# readme
\ No newline at end of file
import {create, encrypt} from 'web3-eth-accounts'
export class AON {
constructor() {
if (window.Telegram && window.Telegram.WebApp) {
this.webapp = window.Telegram.WebApp
this.storage = window.Telegram.WebApp.CloudStorage
}
}
async getKeystore({password}){
this.storage.getItem('keystore', (error) => {
throw new Error()
})
const account = create()
const keystore = await encrypt(account.privateKey, password)
console.log(JSON.stringify(keystore))
}
async getPassword() {
}
}
import { AON } from "./lib/main.js"
const aon = new AON()
await aon.getKeystore({
password: '1234'
})
\ No newline at end of file
{
"name": "aon_sdk",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"vite": "^5.2.10"
},
"dependencies": {
"web3": "^4.8.0"
}
}
import { defineConfig } from 'vite'
export default defineConfig({
build: {
lib: {
entry: './lib/main.js',
name: 'AON',
fileName: 'aon',
formats: [
'es', 'cjs', 'iife', 'umd'
],
},
minify: false,
}
})
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment