Skip to content

Commit

Permalink
chore: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Oct 23, 2024
2 parents ea5a1c2 + a9ffecb commit e217429
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitbook/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
* [Smart Contract](building-dapps/smart-contract.md)
* [DEX](building-dapps/dex.md)
* [Bridge](building-dapps/bridge.md)
* [Simple HTML example with Webpack](building-dapps/dapps-examples/simple-html-example-with-webpack.md)
* [Calculations](calculations/README.md)
* [Min Price Tick Size](calculations/min-price-tick-size.md)
* [Min Quantity Tick Size](calculations/min-quantity-tick-size.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Simple HTML example with Webpack

The [example](https://github.com/InjectiveLabs/injective-ts-webpack-example) is based on the [Cosmos transaction handling section](../../transactions/transactions-cosmos/).

## Running the example

Clone the project repo: 

```
git clone https://github.com/InjectiveLabs/injective-ts-webpack-example.git
```

Ensure you have npm installed and install dependencies:

```
cd injective-ts-webpack-example && npm install
```

Run the example:

```
npm start
....
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/, http://[::1]:8080/
....
```

Go to the http://localhost:8080/ in your browser. If you have a Kelr wallet set up and connected to the Injective testnet, you should see "Confirm Transaction" pop up window.

## How does it work?

Transaction logic is in the `src/sendTx.tx`, which is loaded by `src/index.html` Webpack is used to put eveything together and serve on the local server endpoint.

The `webpack.config.js` file configures Webpack to bundle a TypeScript application starting from `./src/sendTx.ts`, using `ts-loader` to transpile TypeScript files, and includes rules to handle `.js` and `.json` files appropriately. It resolves browser-compatible versions of Node.js core modules using the `fallback` option, enabling modules like `buffer`, `crypto`, and `stream` in the browser environment. The configuration utilizes `HtmlWebpackPlugin` to generate an HTML file based on `src/index.html`, and `ProvidePlugin` to automatically load `Buffer` and `process` variables globally. The bundled output is named `bundle.js` and placed in the `dist` directory, and the `devServer` is set up to serve content from `./dist` for development purposes.

4 changes: 2 additions & 2 deletions packages/exceptions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/exceptions",
"description": "List of exceptions that can be reused throughout Injective's projects.",
"version": "1.14.14",
"version": "1.14.15-beta.0",
"sideEffects": false,
"license": "Apache-2.0",
"types": "dist/cjs/index.d.ts",
Expand Down Expand Up @@ -33,7 +33,7 @@
},
"dependencies": {
"@injectivelabs/grpc-web": "^0.0.1",
"@injectivelabs/ts-types": "^1.14.14",
"@injectivelabs/ts-types": "^1.14.15-beta.0",
"http-status-codes": "^2.2.0",
"link-module-alias": "^1.2.0",
"shx": "^0.3.2"
Expand Down
8 changes: 4 additions & 4 deletions packages/networks/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/networks",
"description": "Endpoints, networks, etc. Can be reused throughout Injective's projects.",
"version": "1.14.15-beta.0",
"version": "1.14.15-beta.1",
"sideEffects": false,
"license": "Apache-2.0",
"author": {
Expand Down Expand Up @@ -32,9 +32,9 @@
"start": "node dist/index.js"
},
"dependencies": {
"@injectivelabs/exceptions": "^1.14.14",
"@injectivelabs/ts-types": "^1.14.14",
"@injectivelabs/utils": "^1.14.14",
"@injectivelabs/exceptions": "^1.14.15-beta.0",
"@injectivelabs/ts-types": "^1.14.15-beta.0",
"@injectivelabs/utils": "^1.14.15-beta.0",
"link-module-alias": "^1.2.0",
"shx": "^0.3.2"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/sdk-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/sdk-ts",
"description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.",
"version": "1.14.15-beta.9",
"version": "1.14.15-beta.10",
"sideEffects": false,
"license": "Apache-2.0",
"author": {
Expand Down Expand Up @@ -40,16 +40,16 @@
"@ethersproject/bytes": "^5.7.0",
"@injectivelabs/core-proto-ts": "0.0.34",
"@injectivelabs/dmm-proto-ts": "1.0.20",
"@injectivelabs/exceptions": "^1.14.14",
"@injectivelabs/exceptions": "^1.14.15-beta.0",
"@injectivelabs/grpc-web": "^0.0.1",
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
"@injectivelabs/indexer-proto-ts": "1.11.56",
"@injectivelabs/mito-proto-ts": "1.0.65",
"@injectivelabs/networks": "^1.14.15-beta.0",
"@injectivelabs/test-utils": "^1.14.14",
"@injectivelabs/ts-types": "^1.14.14",
"@injectivelabs/utils": "^1.14.14",
"@injectivelabs/networks": "^1.14.15-beta.1",
"@injectivelabs/test-utils": "^1.14.15-beta.0",
"@injectivelabs/ts-types": "^1.14.15-beta.0",
"@injectivelabs/utils": "^1.14.15-beta.0",
"@metamask/eth-sig-util": "^4.0.0",
"@noble/curves": "^1.4.0",
"axios": "^1.6.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/test-utils",
"description": "List of test-utils and helper functions that can be reused throughout Injective's projects.",
"version": "1.14.14",
"version": "1.14.15-beta.0",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -34,8 +34,8 @@
"dependencies": {
"@injectivelabs/exceptions": "^1.14.13",
"@injectivelabs/networks": "^1.14.13",
"@injectivelabs/ts-types": "^1.14.13",
"@injectivelabs/utils": "^1.14.13",
"@injectivelabs/ts-types": "^1.14.15-beta.0",
"@injectivelabs/utils": "^1.14.15-beta.0",
"axios": "^1.6.4",
"bignumber.js": "^9.0.1",
"link-module-alias": "^1.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ts-types/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/ts-types",
"description": "List of types that can be reused throughout Injective's projects.",
"version": "1.14.14",
"version": "1.14.15-beta.0",
"sideEffects": false,
"license": "Apache-2.0",
"types": "dist/cjs/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions packages/ts-types/src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export enum MsgType {
MsgValsetConfirm = 'injective.peggy.v1.MsgValsetConfirm',
MsgValsetUpdatedClaim = 'injective.peggy.v1.MsgValsetUpdatedClaim',
MsgWithdrawClaim = 'injective.peggy.v1.MsgWithdrawClaim',
MsgBlacklistEthereumAddresses = 'injective.peggy.v1.MsgBlacklistEthereumAddresses',
MsgRevokeEthereumBlacklist = 'injective.peggy.v1.MsgRevokeEthereumBlacklist',
MsgBurn = 'injective.tokenfactory.v1beta1.MsgBurn',
MsgMint = 'injective.tokenfactory.v1beta1.MsgMint',
MsgCreateDenom = 'injective.tokenfactory.v1beta1.MsgCreateDenom',
Expand Down
6 changes: 3 additions & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/utils",
"description": "List of utils and helper functions that can be reused throughout Injective's projects.",
"version": "1.14.14",
"version": "1.14.15-beta.0",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -32,8 +32,8 @@
"start": "node dist/index.js"
},
"dependencies": {
"@injectivelabs/exceptions": "^1.14.14",
"@injectivelabs/ts-types": "^1.14.14",
"@injectivelabs/exceptions": "^1.14.15-beta.0",
"@injectivelabs/ts-types": "^1.14.15-beta.0",
"axios": "^1.6.4",
"bignumber.js": "^9.0.1",
"http-status-codes": "^2.2.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/wallet-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-ts",
"description": "A convenient way to use and interact with different types of wallets on Injective.",
"version": "1.14.15-beta.13",
"version": "1.14.15-beta.14",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -40,11 +40,11 @@
"@cosmostation/extension-client": "^0.1.15",
"@ethereumjs/common": "^3.1.1",
"@ethereumjs/tx": "^4.1.1",
"@injectivelabs/exceptions": "^1.14.14",
"@injectivelabs/networks": "^1.14.15-beta.0",
"@injectivelabs/sdk-ts": "^1.14.15-beta.9",
"@injectivelabs/ts-types": "^1.14.14",
"@injectivelabs/utils": "^1.14.14",
"@injectivelabs/exceptions": "^1.14.15-beta.0",
"@injectivelabs/networks": "^1.14.15-beta.1",
"@injectivelabs/sdk-ts": "^1.14.15-beta.10",
"@injectivelabs/ts-types": "^1.14.15-beta.0",
"@injectivelabs/utils": "^1.14.15-beta.0",
"@keplr-wallet/cosmos": "^0.12.71",
"@keplr-wallet/types": "^0.12.71",
"@ledgerhq/hw-app-cosmos": "^6.29.5",
Expand Down

0 comments on commit e217429

Please sign in to comment.