
# Cardano Example Dapp

## **Convert Bech32 address into Plutus Data**

Convert your current address from Bech32 representation into Plutus Data object (back and forth). Also exports address information, hexadecimal representation and hash


## Try it online: 

-  Visit [HTML+JS Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Convert%20Bech32%20address%20into%20Plutus%20Data.html)
-  Visit [HTML+React Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Convert%20Bech32%20address%20into%20Plutus%20Data_react.html)
-  Visit [Native HTML dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Convert%20Bech32%20address%20into%20Plutus%20Data_nolib.html)
-  Run [Standalone URL dapp connection](https://wallet.gamechanger.finance/api/2/run/1-H4sIAAAAAAAAA41Sy07DMBD8lZUvTaSoEnDjFsoFDhSJ_oBjb0lKEkf2BrWK-u-sa4eEAoWc9jUzOxsPgiqqUdyKlWnf0RLcoSpvrkFqbdE5qFoy8Fz31Du4lyRFJjQ6ZauOKtPOcAfTW1C9tdjSJ3prTTMyWuy4xl3pkd-IwRQ7VARJIdUbyFbD1lgq0yXktTOA-45TN9uL282JKoMS91KjqhpZn8t4olK6kvemQ-eNhuU5D5S545oOzmzPjgYRNXwYMa9Iq2Atj71jNo498Caz0UYqa0YuMTAyn-YSTpOFkqrEZYQv0vQ4Y8tduMnp1r-yxuFw2Y2ZIOti9x-NAPyT_wvvxgTUD_zzpS_44ej8Wt1kNgt_gXv-1Ty-rJ987Fim4epVJviBxItelGd1_30ABsvQu9oCAAA)

## Source code:

- dapp connection code: [GCScript DSL](Convert%20Bech32%20address%20into%20Plutus%20Data.gcscript)
- frontend (using @gamechanger-finance/gc): [HTML+JS dapp](Convert%20Bech32%20address%20into%20Plutus%20Data.html)
- frontend (using @gamechanger-finance/gc): [HTML+React dapp](Convert%20Bech32%20address%20into%20Plutus%20Data_react.html)
- frontend (without official library): [Native HTML dapp](Convert%20Bech32%20address%20into%20Plutus%20Data_nolib.html)

Dapp code was autogenerated by [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground)

## GCScript code (dapp connection):
```json
{
  "title": "Convert Bech32 address into Plutus Data",
  "description": "Convert your current address from Bech32 representation into Plutus Data object (back and forth). Also exports address information, hexadecimal representation and hash",
  "type": "script",
  "exportAs": "data",
  "run": {
    "address": {
      "type": "getCurrentAddress"
    },
    "addressInfo": {
      "type": "macro",
      "run": "{getAddressInfo(get('cache.address'))}"
    },
    "addressAsPlutusData": {
      "type": "macro",
      "run": "{addressBech32ToPlutusDataObj(get('cache.address'))}"
    },
    "addressAsBech32": {
      "type": "macro",
      "run": "{addressPlutusDataObjToBech32(get('cache.addressAsPlutusData'))}"
    },
    "addressAsPlutusDataPlusInfo": {
      "type": "plutusData",
      "data": {
        "fromJSON": {
          "schema": 1,
          "obj": "{get('cache.addressAsPlutusData')}"
        }
      }
    }
  }
}
```

## Run standalone QR dapp connection: 

You can use [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground) in `QR URL Transport` mode to capture results

[![This GCScript/URL is too large! make it shorter uploading parts to GCFS. Unable to generate QR code](Convert%20Bech32%20address%20into%20Plutus%20Data.png)](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Convert%20Bech32%20address%20into%20Plutus%20Data.png)

## Resources
- [How to connect?](https://www.npmjs.com/package/@gamechanger-finance/gc)
- [Docs and examples on Github](https://github.com/GameChangerFinance/gamechanger.wallet/)
- [GCScript documentation](https://wallet.gamechanger.finance/doc/api/v2)
- [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground)
- [Tutorials on Youtube](https://www.youtube.com/@gamechanger.finance)
- [Support on Discord](https://discord.gg/vpbfyRaDKG)
- [News on Twitter](https://twitter.com/GameChangerOk)
- [Website](https://gamechanger.finance)

## License
MIT 
    
