@alephium/web3 0.0.3 → 0.1.0-rc.2
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.
- package/.editorconfig +13 -0
- package/.eslintignore +2 -0
- package/.eslintrc.json +21 -0
- package/README.md +2 -2
- package/contracts/add.ral +7 -3
- package/contracts/greeter.ral +3 -1
- package/contracts/greeter_interface.ral +3 -0
- package/contracts/greeter_main.ral +9 -0
- package/contracts/main.ral +3 -5
- package/dev/user.conf +8 -4
- package/dist/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/scripts/check-versions.d.ts +1 -0
- package/dist/scripts/check-versions.js +39 -0
- package/dist/{cli → scripts}/create-project.d.ts +0 -0
- package/dist/scripts/create-project.js +124 -0
- package/dist/scripts/header.d.ts +0 -0
- package/dist/scripts/header.js +18 -0
- package/dist/scripts/rename-gitignore.d.ts +1 -0
- package/dist/scripts/rename-gitignore.js +24 -0
- package/dist/scripts/start-devnet.d.ts +1 -0
- package/dist/scripts/start-devnet.js +131 -0
- package/dist/scripts/stop-devnet.d.ts +1 -0
- package/dist/scripts/stop-devnet.js +32 -0
- package/dist/{api → src/api}/api-alephium.d.ts +287 -168
- package/dist/{api → src/api}/api-alephium.js +497 -115
- package/dist/{api → src/api}/api-explorer.d.ts +117 -19
- package/dist/{api → src/api}/api-explorer.js +206 -46
- package/dist/src/api/index.d.ts +10 -0
- package/dist/src/api/index.js +55 -0
- package/dist/{lib → src}/constants.d.ts +0 -0
- package/dist/{lib → src}/constants.js +0 -0
- package/dist/src/contract/contract.d.ts +182 -0
- package/dist/src/contract/contract.js +760 -0
- package/dist/src/contract/events.d.ts +29 -0
- package/dist/src/contract/events.js +77 -0
- package/dist/src/contract/index.d.ts +3 -0
- package/dist/src/contract/index.js +32 -0
- package/dist/src/contract/ralph.d.ts +12 -0
- package/dist/src/contract/ralph.js +362 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +34 -0
- package/dist/src/signer/index.d.ts +2 -0
- package/dist/src/signer/index.js +31 -0
- package/dist/src/signer/node-wallet.d.ts +13 -0
- package/dist/src/signer/node-wallet.js +60 -0
- package/dist/src/signer/signer.d.ts +143 -0
- package/dist/src/signer/signer.js +184 -0
- package/dist/src/test/index.d.ts +7 -0
- package/dist/src/test/index.js +41 -0
- package/dist/src/test/privatekey-wallet.d.ts +12 -0
- package/dist/src/test/privatekey-wallet.js +68 -0
- package/dist/{lib → src/utils}/address.d.ts +0 -0
- package/dist/{lib → src/utils}/address.js +1 -1
- package/dist/{lib → src/utils}/bs58.d.ts +2 -2
- package/dist/{lib → src/utils}/bs58.js +3 -1
- package/dist/{lib → src/utils}/djb2.d.ts +0 -0
- package/dist/{lib → src/utils}/djb2.js +1 -1
- package/dist/src/utils/index.d.ts +6 -0
- package/dist/src/utils/index.js +35 -0
- package/dist/{lib → src/utils}/password-crypto.d.ts +0 -0
- package/dist/{lib → src/utils}/password-crypto.js +8 -7
- package/dist/src/utils/transaction.d.ts +2 -0
- package/dist/src/utils/transaction.js +58 -0
- package/dist/src/utils/utils.d.ts +30 -0
- package/dist/{lib → src/utils}/utils.js +83 -19
- package/gitignore +5 -4
- package/package.json +55 -41
- package/scripts/create-project.ts +136 -0
- package/scripts/header.js +17 -0
- package/scripts/start-devnet.js +3 -3
- package/src/api/api-alephium.ts +2323 -0
- package/src/api/api-explorer.ts +808 -0
- package/src/api/index.ts +35 -0
- package/src/constants.ts +20 -0
- package/src/contract/contract.ts +1014 -0
- package/src/contract/events.ts +102 -0
- package/src/contract/index.ts +21 -0
- package/src/contract/ralph.test.ts +178 -0
- package/src/contract/ralph.ts +362 -0
- package/src/fixtures/address.json +36 -0
- package/src/fixtures/balance.json +9 -0
- package/src/fixtures/self-clique.json +19 -0
- package/src/fixtures/transaction.json +13 -0
- package/src/fixtures/transactions.json +179 -0
- package/src/index.ts +24 -0
- package/src/signer/fixtures/genesis.json +26 -0
- package/src/signer/fixtures/wallets.json +26 -0
- package/src/signer/index.ts +20 -0
- package/src/signer/node-wallet.ts +74 -0
- package/src/signer/signer.ts +313 -0
- package/src/test/index.ts +32 -0
- package/src/test/privatekey-wallet.ts +58 -0
- package/src/utils/address.test.ts +47 -0
- package/src/utils/address.ts +39 -0
- package/src/utils/bs58.ts +26 -0
- package/src/utils/djb2.test.ts +35 -0
- package/src/utils/djb2.ts +25 -0
- package/src/utils/index.ts +24 -0
- package/src/utils/password-crypto.test.ts +27 -0
- package/src/utils/password-crypto.ts +77 -0
- package/src/utils/transaction.test.ts +50 -0
- package/src/utils/transaction.ts +39 -0
- package/src/utils/utils.test.ts +160 -0
- package/src/utils/utils.ts +209 -0
- package/templates/{README.md → base/README.md} +4 -4
- package/templates/base/package.json +35 -0
- package/templates/base/src/greeter.ts +41 -0
- package/templates/base/tsconfig.json +19 -0
- package/templates/react/README.md +34 -0
- package/templates/react/config-overrides.js +18 -0
- package/templates/react/package.json +66 -0
- package/templates/react/src/App.tsx +42 -0
- package/templates/react/src/artifacts/greeter.ral.json +26 -0
- package/templates/react/src/artifacts/greeter_main.ral.json +22 -0
- package/templates/shared/.eslintrc.json +12 -0
- package/templates/shared/scripts/header.js +0 -0
- package/test/contract.test.ts +161 -0
- package/test/events.test.ts +139 -0
- package/webpack.config.js +1 -1
- package/contracts/greeter-main.ral +0 -8
- package/dist/cli/create-project.js +0 -87
- package/dist/lib/clique.d.ts +0 -23
- package/dist/lib/clique.js +0 -149
- package/dist/lib/contract.d.ts +0 -152
- package/dist/lib/contract.js +0 -711
- package/dist/lib/explorer.d.ts +0 -8
- package/dist/lib/explorer.js +0 -46
- package/dist/lib/index.d.ts +0 -12
- package/dist/lib/index.js +0 -60
- package/dist/lib/node.d.ts +0 -10
- package/dist/lib/node.js +0 -64
- package/dist/lib/numbers.d.ts +0 -7
- package/dist/lib/numbers.js +0 -128
- package/dist/lib/signer.d.ts +0 -17
- package/dist/lib/signer.js +0 -70
- package/dist/lib/storage-browser.d.ts +0 -9
- package/dist/lib/storage-browser.js +0 -52
- package/dist/lib/storage-node.d.ts +0 -9
- package/dist/lib/storage-node.js +0 -65
- package/dist/lib/utils.d.ts +0 -11
- package/dist/lib/wallet.d.ts +0 -30
- package/dist/lib/wallet.js +0 -142
- package/templates/package.json +0 -29
package/src/api/index.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 - 2022 The Alephium Authors
|
|
3
|
+
This file is part of the alephium project.
|
|
4
|
+
|
|
5
|
+
The library is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Lesser General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
The library is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Lesser General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Lesser General Public License
|
|
16
|
+
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { Api as NodeApi } from './api-alephium'
|
|
20
|
+
import { Api as ExplorerApi } from './api-explorer'
|
|
21
|
+
|
|
22
|
+
export class NodeProvider extends NodeApi<null> {
|
|
23
|
+
constructor(baseUrl: string) {
|
|
24
|
+
super({ baseUrl: baseUrl })
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class ExplorerProvider extends ExplorerApi<null> {
|
|
29
|
+
constructor(baseUrl: string) {
|
|
30
|
+
super({ baseUrl: baseUrl })
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export * as node from './api-alephium'
|
|
35
|
+
export * as explorer from './api-explorer'
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 - 2022 The Alephium Authors
|
|
3
|
+
This file is part of the alephium project.
|
|
4
|
+
|
|
5
|
+
The library is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Lesser General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
The library is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Lesser General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Lesser General Public License
|
|
16
|
+
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export const TOTAL_NUMBER_OF_GROUPS = 4
|
|
20
|
+
export const MIN_UTXO_SET_AMOUNT = BigInt(1000000000000)
|