Giter Site home page Giter Site logo

drgnchan / argent-x Goto Github PK

View Code? Open in Web Editor NEW

This project forked from argentlabs/argent-x

0.0 1.0 0.0 42.41 MB

ArgentX browser extension for StarkNet - made with ❤️ by Argent

Home Page: https://github.com/argentlabs/argent-x

License: Other

Shell 0.37% JavaScript 0.26% Python 0.01% TypeScript 99.28% CSS 0.01% HTML 0.05% Dockerfile 0.01% MDX 0.01%

argent-x's Introduction


⬇️ Get Argent X for Starknet today:

Quality Gate Status Technical Debt Coverage


🌈 Table of contents

🧒 Example dapp

You can try the extension using our example dapp hosted at:

https://argentlabs.github.io/argent-x/

The example dapp is also contained in this repository.

🌐 Usage with your dapp

If you want to use this Starknet Wallet extension with your dapp, the easiest way is to checkout the starknetkit package

# starknet.js is a peer dependency
pnpm add starknetkit starknet
import { connect } from "starknetkit"

// Let the user pick a wallet (on button click)
const starknet = connect()

if (!starknet) {
  throw Error("User rejected wallet selection or silent connect found nothing")
}

// (optional) connect the wallet
await starknet.enable()

// Check if connection was successful
if(starknet.isConnected) {
    // If the extension was installed and successfully connected, you have access to a starknet.js Signer object to do all kinds of requests through the user's wallet contract.
    starknet.account.execute({ ... })
} else {
    // In case the extension wasn't successfully connected you still have access to a starknet.js Provider to read starknet states and sent anonymous transactions
    starknet.provider.callContract( ... )
}

Checkout starknet.js to learn more about how to use Provider and Signer.

🚀 Install from sources

First clone this repository on your machine then run:

pnpm run setup  # setup dependencies
pnpm build  # run build process for all packages

Now you need to load the locally built chrome extension into your browser, by loading an unpacked extension from path packages/extension/dist:

Chrome

  1. Open the Extension Management page by navigating to chrome://extensions.
  2. Enable Developer Mode by clicking the toggle switch next to Developer mode.
  3. Click the Load unpacked button and select the extension directory.

Chrome screenshot of setup

Source

Firefox

  1. Open the Extension Management page by navigating to about:debugging#/runtime/this-firefox
  2. Select the manifest.json from the dist folder

Source

👩🏾‍💻 Development

To contribute to this repository please read the contributing guidelines first.

To setup the repo on your machine just run:

pnpm run setup # setup dependencies
pnpm dev   # run build process for all packages in watch mode

This project contains 3 packages:

package description
extension Argent X extension
get-starknet npm module to get started with starknet.js and Argent X quickly
dapp example dapp for testing purposes and example for dapps how to use get-starknet

To test changes made to the extension package you need to load the local unpacked extension into Chrome as described above. Changes are shown after reopening the extension. Changes to background.js are just shown after a complete restart of the Chrome process.

🧪 Testing

Setup

Some tests require starknet-devnet to be available at http://127.0.0.1:5050/. If tests are run without then you may see errors including connect ECONNREFUSED 127.0.0.1:5050.

Run devnet locally

For convenience this service can be started with Docker desktop running;

  • For ARM computers (e.g. Mac computers with Apple silicon)

    docker run -it -p 5050:5050 shardlabs/starknet-devnet:latest-arm-seed0
  • Otherwise

    docker run -it -p 5050:5050 shardlabs/starknet-devnet:latest-seed0

Run tests

pnpm test      # run unit tests for all packages
pnpm test:e2e  # run end-to-end tests for all packages

Tools to help with testing

See also /docs/tools-for-local-testing.md

✏️ Contributing

Everyone is welcome to contribute. Please take a moment to review the contributing guidelines.

❤️ Family and friends

Since this project would not have been possible without starknet.js, we would like to say a big thank you to all starknet.js contributors and @0xs34n for starting it.

One more thank you to the StarkWare Team.

👨🏼‍🎨 Authors and license

Argent and contributors.

See the included License.md file.

argent-x's People

Contributors

janek26 avatar dependabot[bot] avatar simonheys avatar dhruvkelawala avatar delaaxe avatar bluecco avatar canlopes avatar gergold avatar diegodelrieu avatar graemeblackwood avatar jgresham avatar 0xs34n avatar jasonzhouu avatar gregoryguillou avatar juniset avatar anthony-urbina avatar mortimr avatar kankan-0 avatar ismaeldm95 avatar omahs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.