@alephium/web3 0.2.0-rc.12 → 0.2.0-rc.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/alephium-web3.min.js +1 -1
  2. package/dist/alephium-web3.min.js.map +1 -1
  3. package/dist/src/api/api-alephium.d.ts +72 -11
  4. package/dist/src/api/api-alephium.js +64 -5
  5. package/dist/src/contract/contract.d.ts +6 -4
  6. package/dist/src/contract/contract.js +32 -30
  7. package/package.json +4 -13
  8. package/src/api/api-alephium.ts +112 -14
  9. package/src/contract/contract.ts +43 -40
  10. package/src/utils/utils.ts +0 -2
  11. package/contracts/greeter/greeter.ral +0 -7
  12. package/contracts/greeter/greeter_interface.ral +0 -4
  13. package/contracts/greeter_main.ral +0 -7
  14. package/dev/user.conf +0 -29
  15. package/dist/scripts/create-project.d.ts +0 -2
  16. package/dist/scripts/create-project.js +0 -125
  17. package/dist/scripts/start-devnet.d.ts +0 -1
  18. package/dist/scripts/start-devnet.js +0 -131
  19. package/dist/scripts/stop-devnet.d.ts +0 -1
  20. package/dist/scripts/stop-devnet.js +0 -32
  21. package/scripts/create-project.ts +0 -137
  22. package/scripts/start-devnet.js +0 -141
  23. package/scripts/stop-devnet.js +0 -32
  24. package/templates/base/README.md +0 -34
  25. package/templates/base/package.json +0 -35
  26. package/templates/base/src/greeter.ts +0 -42
  27. package/templates/base/tsconfig.json +0 -19
  28. package/templates/react/README.md +0 -34
  29. package/templates/react/config-overrides.js +0 -18
  30. package/templates/react/package.json +0 -66
  31. package/templates/react/src/App.tsx +0 -42
  32. package/templates/react/src/artifacts/greeter.ral.json +0 -26
  33. package/templates/react/src/artifacts/greeter_main.ral.json +0 -22
  34. package/templates/shared/.eslintrc.json +0 -12
  35. package/templates/shared/scripts/header.js +0 -0
@@ -1,66 +0,0 @@
1
- {
2
- "name": "my-dapp",
3
- "version": "0.1.0",
4
- "config": {
5
- "alephium_version": "1.5.0-rc7"
6
- },
7
- "dependencies": {
8
- "@testing-library/jest-dom": "^5.16.4",
9
- "@testing-library/react": "^13.0.1",
10
- "@testing-library/user-event": "^13.5.0",
11
- "@types/jest": "^27.4.1",
12
- "@types/node": "^16.11.26",
13
- "@types/react": "^18.0.3",
14
- "@types/react-dom": "^18.0.0",
15
- "@alephium/web3": "0.2.0-rc.12",
16
- "react": "^18.0.0",
17
- "react-dom": "^18.0.0",
18
- "react-scripts": "5.0.1",
19
- "typescript": "^4.6.3",
20
- "web-vitals": "^2.1.4"
21
- },
22
- "scripts": {
23
- "start": "react-app-rewired start",
24
- "build": "react-app-rewired build",
25
- "test": "react-app-rewired test",
26
- "eject": "react-scripts eject",
27
- "lint": "eslint . --ext ts",
28
- "prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\""
29
- },
30
- "eslintConfig": {
31
- "extends": [
32
- "react-app",
33
- "react-app/jest"
34
- ]
35
- },
36
- "browserslist": {
37
- "production": [
38
- ">0.2%",
39
- "not dead",
40
- "not op_mini all"
41
- ],
42
- "development": [
43
- "last 1 chrome version",
44
- "last 1 firefox version",
45
- "last 1 safari version"
46
- ]
47
- },
48
- "devDependencies": {
49
- "buffer": "^6.0.3",
50
- "crypto-browserify": "^3.12.0",
51
- "eslint-config-prettier": "^8.5.0",
52
- "process": "^0.11.10",
53
- "react-app-rewired": "^2.2.1",
54
- "stream-browserify": "^3.0.0"
55
- },
56
- "prettier": {
57
- "printWidth": 120,
58
- "tabWidth": 2,
59
- "useTabs": false,
60
- "semi": false,
61
- "singleQuote": true,
62
- "jsxSingleQuote": true,
63
- "bracketSameLine": false,
64
- "trailingComma": "none"
65
- }
66
- }
@@ -1,42 +0,0 @@
1
- import React, { useEffect, useState } from 'react'
2
- import './App.css'
3
-
4
- import { ExplorerProvider, Contract, Script } from '@alephium/web3'
5
- import contractJson from './artifacts/greeter.ral.json'
6
- import scriptJson from './artifacts/greeter_main.ral.json'
7
-
8
- function Dashboard() {
9
- const api = new ExplorerProvider('https://mainnet-backend.alephium.org')
10
- const contract = Contract.fromJson(contractJson).toString()
11
- const script = Script.fromJson(scriptJson).toString()
12
- const [blocks, setBlocks] = useState('')
13
-
14
- useEffect(() => {
15
- async function fetchBlocks() {
16
- const blocks = (await api.blocks.getBlocks({ page: 1 })).total
17
- setBlocks(JSON.stringify(blocks))
18
- }
19
-
20
- fetchBlocks()
21
- })
22
-
23
- return (
24
- <div>
25
- <p>blocks: {blocks}</p>
26
- <p>contract: {contract}</p>
27
- <p>script: {script}</p>
28
- </div>
29
- )
30
- }
31
-
32
- function App() {
33
- return (
34
- <div className='App'>
35
- <header className='App-header'>
36
- <Dashboard />
37
- </header>
38
- </div>
39
- )
40
- }
41
-
42
- export default App
@@ -1,26 +0,0 @@
1
- {
2
- "sourceCodeSha256": "10fe90ccf08b6b3fd2a653bd4258628f5dd165788cc48a83f9d6ff8039404588",
3
- "functions": [
4
- {
5
- "name": "greet",
6
- "signature": "pub greet()->(U256)",
7
- "argNames": [],
8
- "argTypes": [],
9
- "returnTypes": [
10
- "U256"
11
- ]
12
- }
13
- ],
14
- "bytecode": "010109010000000102a00002",
15
- "codeHash": "39debc1122591f4c96e2f807632acc6d137ea9bba303a4e04476cd8cade35242",
16
- "fieldsSig": {
17
- "signature": "TxContract Greeter(btcPrice:U256)",
18
- "names": [
19
- "btcPrice"
20
- ],
21
- "types": [
22
- "U256"
23
- ]
24
- },
25
- "eventsSig": []
26
- }
@@ -1,22 +0,0 @@
1
- {
2
- "sourceCodeSha256": "c1f3b4c4a8c6832d0c9b3e2c7c623de85331d8b0d853daf2acc4288e5655aff7",
3
- "functions": [
4
- {
5
- "name": "main",
6
- "signature": "pub payable main()->()",
7
- "argNames": [],
8
- "argTypes": [],
9
- "returnTypes": []
10
- }
11
- ],
12
- "bytecodeTemplate": "0101010002000e{0}1700160001000d2f4d{0}1701160101000d2f4d",
13
- "fieldsSig": {
14
- "signature": "TxScript Main(greeterContractId:ByteVec)",
15
- "names": [
16
- "greeterContractId"
17
- ],
18
- "types": [
19
- "ByteVec"
20
- ]
21
- }
22
- }
@@ -1,12 +0,0 @@
1
- {
2
- "extends": ["prettier", "plugin:react/recommended"],
3
- "rules": {
4
- "header/header": [0]
5
- },
6
- "parserOptions": {
7
- "project": "tsconfig.json",
8
- "ecmaVersion": 2020,
9
- "sourceType": "module"
10
- },
11
- "parser": "@typescript-eslint/parser"
12
- }
File without changes