Git Product home page Git Product logo

starknet.swift's Introduction

alt text

starknet.swift

StarkNet SDK for Swift to interact with the starknet rpc nodes.

Installation

XCode

In XCode, go to your project, then select Package Dependencies tab. Click the + button, and in the window that just appeared search for starknet.swift package or paste the following url directly: https://github.com/software-mansion/starknet.swift. Select package and install it.

Swift Package Manager

Just add the package to the dependencies array in your Package.swift file:

dependencies: [
  ...
  .package(url: "https://github.com/software-mansion/starknet.swift.git", from: "0.7.0")
]

Then add `starknet.swift` to the dependencies array of every target you want to use the package in.

Documentation

You can find the documentation of the project here.

Demo app

In the Examples folder you can find a demo ios application.

Before running it, make sure to run starknet devnet with given configuration:

starknet-devnet --port 5050 --seed 0

and run the demo app on ios simulator, to be able to access the local devnet instance.

Development

Git hooks

Install hooks by running install_hooks.sh script from Scripts folder.

Code formatting

This project uses SwiftFormat for linting and formatting code. You can install it by running brew install swiftformat. Unformatted code will be rejected by pre push hook and lint github action. To format code in the project, run

swiftformat .

in main project directory.

Testing

Platforms

Due to reliability on starknet-devnet-rs for testing, tests can be ran on macOS targets only.

Prerequisites

You will need to set some environment variables:

  • DEVNET_PATH - points to starknet-devnet-rs cli
  • SCARB_PATH - points to scarb cli.
  • SNCAST_PATH - points to sncast cli.

You can set them in XCode scheme or by running these commands:

export DEVNET_PATH="$(which starknet-devnet)"
export SCARB_PATH="$(which scarb)"
export SNCAST_PATH="$(which sncast)"

This assumes you already have the following tools installed:


Binary dependencies

This project depends on two binary frameworks.

  • crypto-cpp from starkware, with c bindings. Compiled for ios and macosx targets. Built in this repo
  • poseidon from CryptoExperts. Compiled for ios and macosx targets. Built in this repo
  • generate_k method, from starknet-rs sdk, wrapped in a c binding. Compiled for ios and macosx targets. Built in this repo

Acknowledgements

This product includes software developed by the "Marcin Krzyzanowski" (http://krzyzanowskim.com/).

starknet.swift's People

Contributors

bartekryba avatar delevoxdg avatar 4rgorok avatar dmcrodrigues avatar diokaratzas avatar gooddaisy avatar

Stargazers

noelle avatar josh 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.