This is a open source library on kotlin for Solana protocol.

Overview

Solana + RxSolana

This is a open source library on kotlin for Solana protocol.

The objective is to create a cross platform, fully functional, highly tested and less depencies as posible.

Features

  • Sign and send transactions.
  • Key pair generation
  • RPC configuration.
  • Few libraries requirement (Moshi, okhttp3, bitcoinj, eddsa). RxKotlin is optional.
  • Fully tested (53%)
  • Sockets

Support it

SOL: CN87nZuhnFdz74S9zn3bxCcd5ZxW55nwvgAv5C2Tz3K7

Comments
  • Expose sendRawTransaction

    Expose sendRawTransaction

    Description

    • Adding option to send raw transaction for cases where you already have fully defined transactions. Example workflow where sendRawTransaction is: 1. Request partial signed transaction from a server, 2. Sign transaction as user 3. send transaction.

    Work Completed

    • Added sendRawTransaction function
    • Refactor sendTransaction function to use sendRawTransaction to avoid code duplication
    opened by MirekR 13
  • Feature Request: Change name to work with Jitpack

    Feature Request: Change name to work with Jitpack

    Currently the library cannot be pulled from Jitpack because of the "." in Solana.kt. I've tested on my fork changing the name to SolanaKT and it fixed the issue, so I propose doing that here.

    opened by samdowd 5
  • Add @FieldOrder annotation so Rule classes are minimized

    Add @FieldOrder annotation so Rule classes are minimized

    When digging through the Borsh operation, it became clear that for serializing/deserializing the fields need to be encountered in the same order so the bytes can be read/written properly. Your most recent Rule system really helped formalize making that happen, but I realized that for many field types if we could just specify the order, that would be enough.

    Hence this PR - now you can just annotate the fields with @FieldOrder() and for many classes, no Rule class will be necessary. The rule system still works great for special cases, but hopefully this should reduce the boilerplate needed for most classes. Even the PublicKeyRule could likely be simplified/removed as a result of this annotation, though I didn't do that work for this PR.

    opened by creativedrewy 5
  • Feature request: Make Account() additionally generate mnemonic

    Feature request: Make Account() additionally generate mnemonic

    Currently Account() returns a keypair with publicKey and privateKey. There's already support for reading accounts from mnemonics, should be relatively easy to generate a mnemonic instead.

    opened by samdowd 4
  • Implement MintTo instruction

    Implement MintTo instruction

    Description

    • Implements MintTo instruction so we can mint Solana NFTs in Kotlin!
    • This implements a very basic version of MintTo so misses out on some features.
    • I opted for the most absolute bare-bones implementation, but we can add more later as optional params.

    Testing

    Tests copied from JS tests here: https://github.com/nickcruz/solana-js-sandbox/blob/main/tests/mintTo.test.ts

    Missing features from spl-token JS library

    Reference code in solana-labs/solana-program-library

    • The actual spl-token library allows for an amount ranging from 0 to 2^64 -1. We use Long here, so we only allow 0 to 2^63 -1 (negative numbers will create a valid transaction, but will fail when sent to Solana).
    • Multi-signers are not supported.
    • The program ID is always hardcoded to the SPL token program (TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA).
    opened by nickcruz 3
  • Add ability to setFeePayer, add toString methods

    Add ability to setFeePayer, add toString methods

    Currently Message.setFeePayer is not exposed to the Transaction. It's only used to automatically set the first signature in the list to FeePayer. Acording to the Solana spec, this is a good default but it should be configurable. This PR adds the ability to specify a fee payer. See below in-line github comments for places it may need to be written differently.

    I also added toString methods to all the Transaction components because they made my debugging easier.

    opened by samdowd 3
  • Artifact resolving via Jitpack does not work

    Artifact resolving via Jitpack does not work

    Adding dependency to build.gradle

        implementation "com.github.ajamaica.Solana.kt:solana:1.0.0"
    

    results in

          > Could not resolve com.github.ajamaica.Solana.kt:solana:1.0.0.
             > Could not get resource 'https://jitpack.io/com/github/ajamaica/Solana/kt/solana/1.0.0/solana-1.0.0.pom'.
                > Could not GET 'https://jitpack.io/com/github/ajamaica/Solana/kt/solana/1.0.0/solana-1.0.0.pom'. Received status code 401 from server: Unauthorized
    

    Is there any other way to try the library without building it locally?

    opened by antonyshchenko 3
  • Annotation Processing Tweaks

    Annotation Processing Tweaks

    I was attempting to consume the deserialization in an app and I kept getting the intentional exception even though the annotations were in the classes I was trying to parse. Basically, the code that was throwing the exception was wrong, but also I think I may have originally had the annotation setup wrong.

    Anyway, with these changes the code works great when consumed by another app.

    opened by creativedrewy 3
  • added change parameter to bip44WithChange private key generator

    added change parameter to bip44WithChange private key generator

    Description

    • closes https://github.com/metaplex-foundation/SolanaKT/issues/116

    Work Completed

    • added a parameter to getPrivateKeyFromSeed to allow consumers to use Bip44 with change

    API Changes

    • added a parameter to getPrivateKeyFromSeed, but provided default value so non-breaking
    opened by samdowd 2
  • sendSPLTokens throws NullPointerException

    sendSPLTokens throws NullPointerException

    I need to send SPL Token with android, so I'm researching this library.

    When I tested sendSPLTokens, it throws NullPointerException.

    I debugged the code, then sendSPLTokens -> fingSPLTokenDestinationAddress -> getAccountInfo with createProgramAddress throws the error.

    Also, I explored your Solana.Swift code, and I found that there are some commits about findSPLTokenDestinationAddress

    Is it related to this issue?

    opened by MountainNine 2
  • Feature Request: Partial Signing Transactions

    Feature Request: Partial Signing Transactions

    In line with Solana.swift, I'd like the ability to partially sign transactions. I'm trying to partially sign the transaction on the device with a remote fee payer (see my PR: https://github.com/ajamaica/Solana.kt/pull/83) then send the partially signed transaction to a JS server that will sign the transaction as the fee payer and submit it.

    opened by samdowd 2
  • Suspended functions for actions

    Suspended functions for actions

    Description

    • Suspended functions for actions

    Work Completed

    • close token
    • create token
    • get mint
    • get token wallets
    • send sol
    • send spl
    • serialize and send with fee
    opened by ajamaica 1
  • Exception: Transaction version (0) is not supported by the requesting client.

    Exception: Transaction version (0) is not supported by the requesting client.

    When we try to request block what contains new versioned transaction, client throws exception:

    Transaction version (0) is not supported by the requesting client. Please try the request again with the following configuration parameter: "maxSupportedTransactionVersion": 0 java.lang.Error: Transaction version (0) is not supported by the requesting client. Please try the request again with the following configuration parameter: "maxSupportedTransactionVersion": 0

    How to reproduce exception: In the Methods.TestGetConfirmedBlock change slot number to 169877549L

    It's related to the changes around transaction version, see description for parameter _ maxSupportedTransactionVersion_ - https://docs.solana.com/developing/clients/jsonrpc-api#getblock

    opened by MirekR 0
  • Exception while passing own moshiAdapters to NetworkingRouterConfig

    Exception while passing own moshiAdapters to NetworkingRouterConfig

    I need to pass my own JsonAdapter that implements the MoshiAdapterFactory interface to the NetworkingRouterConfig() then it throws an exception as soon as it get used.

    UserJsonAdapter.kt:

    class UserJsonAdapter: MoshiAdapterFactory {
        private lateinit var borsh: Borsh
    
        override fun create(borsh: Borsh): Object {
            this.borsh = borsh
            return Object()
        }
    
        @FromJson
        fun fromJson(rawData: Any): Buffer<User> = Buffer.create(borsh = borsh, rawData = rawData, clazz = User::class.java)
    }
    

    Solana initialization:

    Solana(
               router = OkHttpNetworkingRouter(
                    endpoint = RPCEndpoint.mainnetBetaSolana,
                    httpClient = get(),
                    config = NetworkingRouterConfig(rules = listOf(UserRule()), moshiAdapters = listOf(UserJsonAdapter()))
                )
            )
    

    Exception: java.lang.IllegalArgumentException: Expected at least one @ToJson or @FromJson method on java.lang.Object at com.squareup.moshi.AdapterMethodsFactory.get(AdapterMethodsFactory.java:153) at com.squareup.moshi.Moshi$Builder.add(Moshi.java:223) at com.solana.networking.OkHttpNetworkingRouter$moshi$2.invoke(NetworkingRouter.kt:68) at com.solana.networking.OkHttpNetworkingRouter$moshi$2.invoke(NetworkingRouter.kt:60)

    opened by tmcyrix 1
  • sendSplToken: invalid account data for instruction

    sendSplToken: invalid account data for instruction

    While sending transaction with original solana address I get this exception, however all params are correct.

    java.lang.Exception: invalidResponse(rpcError=RPCError(code=-32002, message=Transaction simulation failed: Error processing Instruction 0: invalid account data for instruction))

    Method: solana.action.sendSPLTokens( PublicKey(tokenAddress), account.publicKey, PublicKey(address), amount.toLong(), allowUnfundedRecipient = true, account )

    opened by kambaroff 2
  • Adding other Solana programs (Mango,Raydium etc)

    Adding other Solana programs (Mango,Raydium etc)

    Hello, i would like to ask you if it is OK to add more Solana Programs in this repo, with full functionality for example of Mango exchange, Raydium exchange etc.

    opened by makarid 1
Releases(2.0.0)
  • 2.0.0(Oct 25, 2022)

    What's Changed

    • martini/Update SYSVAR Constants to match JS repo by @Funkatronics in https://github.com/metaplex-foundation/SolanaKT/pull/105
    • Mnemonic Generation with tested HotAccount by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/106
    • Adding unit tests for Transaction Message compilation and fixing public key sorting issue by @MirekR in https://github.com/metaplex-foundation/SolanaKT/pull/109
    • Add Suspended Functions and Kotlin Serialization by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/107
    • Kotlin serializer on sockets and Removes Moshi by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/110
    • Bump sdk to 2.0 by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/113

    New Contributors

    • @Funkatronics made their first contribution in https://github.com/metaplex-foundation/SolanaKT/pull/105
    • @MirekR made their first contribution in https://github.com/metaplex-foundation/SolanaKT/pull/109

    Full Changelog: https://github.com/metaplex-foundation/SolanaKT/compare/1.2...2.0.0

    Source code(tar.gz)
    Source code(zip)
  • 1.2(Sep 13, 2022)

    What's Changed

    • Use min sdk 16 by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/82
    • Add ability to setFeePayer, add toString methods by @samdowd in https://github.com/metaplex-foundation/SolanaKT/pull/83
    • Add readme by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/89
    • Allow unfunded recipient by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/91
    • Make the networking router an interface by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/93
    • Implement initializeMint instruction by @nickcruz in https://github.com/metaplex-foundation/SolanaKT/pull/96
    • Implement MintTo instruction by @nickcruz in https://github.com/metaplex-foundation/SolanaKT/pull/98
    • Adds and interface for Account and HotAccount implementation by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/99
    • Add Pr templates by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/100
    • Pass correct response type to getConfirmedSignaturesForAddress2 request by @esen in https://github.com/metaplex-foundation/SolanaKT/pull/101
    • update readme to reflect new repo location by @nickcruz in https://github.com/metaplex-foundation/SolanaKT/pull/102
    • WIP: Partial Signing by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/92
    • Bump to 1.2 by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/103
    • New maven url by @ajamaica in https://github.com/metaplex-foundation/SolanaKT/pull/104

    New Contributors

    • @samdowd made their first contribution in https://github.com/metaplex-foundation/SolanaKT/pull/83
    • @nickcruz made their first contribution in https://github.com/metaplex-foundation/SolanaKT/pull/96
    • @esen made their first contribution in https://github.com/metaplex-foundation/SolanaKT/pull/101

    Full Changelog: https://github.com/metaplex-foundation/SolanaKT/compare/1.1.5...1.2

    Source code(tar.gz)
    Source code(zip)
  • 1.1.5(May 13, 2022)

    What's Changed

    • Fix a issue that returns null when data is null on getMultipleAccounts by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/80
    • Bump tp 1.1.5 by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/81

    Full Changelog: https://github.com/ajamaica/Solana.kt/compare/1.1.4...1.1.5

    Source code(tar.gz)
    Source code(zip)
  • 1.1.4(May 12, 2022)

    What's Changed

    • Fix error in networking module when falure by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/77
    • Bump 1.1.4 by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/78

    Full Changelog: https://github.com/ajamaica/Solana.kt/compare/1.1.3...1.1.4

    Source code(tar.gz)
    Source code(zip)
  • 1.1.3(May 12, 2022)

    What's Changed

    • Moshi addapter factories by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/75
    • 1.1.3 by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/76

    Full Changelog: https://github.com/ajamaica/Solana.kt/compare/1.1.2...1.1.3

    Source code(tar.gz)
    Source code(zip)
  • 1.1.2(May 12, 2022)

    What's Changed

    • Add custom rules and adapters borsh as config by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/73
    • Bump to 1.1.2 by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/74

    Full Changelog: https://github.com/ajamaica/Solana.kt/compare/1.1.1...1.1.2

    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(May 4, 2022)

    What's Changed

    • Make getProgramAccounts configuration public by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/71
    • Bump 1.1.1 by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/72

    Full Changelog: https://github.com/ajamaica/Solana.kt/compare/1.1.0...1.1.1

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Apr 26, 2022)

    What's Changed

    • Remove auth from Solana by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/67
    • Remove Donation address by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/57
    • Support getSignatureStatuses by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/68
    • Bump 1.1.0 by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/69
    • Solana version update by @ajamaica in https://github.com/ajamaica/Solana.kt/pull/70

    Full Changelog: https://github.com/ajamaica/Solana.kt/compare/1.0.0...1.1.0

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Aug 19, 2021)

Owner
Arturo Jamaica
Arturo Jamaica
Open-source Kotlin library to connect Alsat pardakht peyment API (Core)

Alsat IPG Core با استفاده از این کتابخانه میتوانید پروژه جاوا یا کاتلین خودتون رو به شبکه پرداخت آل‌سات پرداخت وصل کنید و به راحتی محصولات خودتون رو د

Alsat Pardakht 4 Mar 14, 2022
A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs

Smack About Smack is an open-source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android. Being a

Ignite Realtime 2.3k Dec 28, 2022
A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs

Smack About Smack is an open-source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android. Being a

Ignite Realtime 2.3k Dec 21, 2021
Open-source ‌‌Android library to connect Alsat pardakht peyment API

Open-source ‌‌Android library to connect Alsat pardakht peyment API

Alsat Pardakht 4 Apr 4, 2022
Open source Crypto Currency Tracker Android App made fully in Kotlin

CoinBit CoinBit is a beautiful CryptoCurrency app, completely open sourced and 100% in kotlin. It supports following features Track prices of over 300

Pranay Airan 50 Dec 5, 2022
A Free, open source Contacts Butler App built with kotlin

Contacts Butler Do you have a bunch of contacts that are missing a lot of info such as names, emails, phone numbers, etc? Do you really know the conta

Android Contacts Butlers 1 Nov 30, 2021
An Open-Source repository that contains all the Android Dev and Kotlin concepts and several projects on android ranging in difficulty making this repo completely beginner-friendly.

An Open-Source repository that contains all the Android Dev and Kotlin concepts and several projects on android ranging in difficulty making this repo completely beginner-friendly. The main aim of this repository is to help students who are learning Android Development or preparing for an Android Developer role-based job.

Mimo Patra 15 Dec 29, 2022
🚧 A fully open-source project for creating and maintaining a Kotlin-based Minecraft: Java Edition server.

Hexalite: Java Edition ⚠️ WARNING: The Hexalite Network is a work in progress. It is not yet ready for production. You may encounter bugs and other is

Hexalite Studios 38 Nov 28, 2022
🚧 A fully open-source project for creating and maintaining a Kotlin-based Minecraft: Java Edition server.

Hexalite: Java Edition ⚠️ WARNING: The Hexalite Network is a work in progress. It is not yet ready for production. You may encounter bugs and other is

Hexalite Network 38 Nov 28, 2022
Android + Kotlin Project for the 2022 edition of the Open Source Contribution competition, JGEC Winter of Code aka JWoC.

QuotesApp-JWoC Android + Kotlin Project for the 2022 edition of the Open Source Contribution competition, JGEC Winter of Code aka JWoC. ?? Project Obj

null 4 Feb 16, 2022
Open Super dApp - Your gateway to the new digital commons. Integrated mobile messenger, Ethereum wallet, and Web 3.0 browser built on open, decentralized, and encrypted protocols.

A fully open source, open standard, decentralized "super app" including a secure, encrypted Matrix compatible messenger based off of the Element Messenger, and an Ethereum crypto wallet and web3 browser based off of Alpha Wallet.

2Gather 6 Jul 25, 2022
An open source Hacker News client for Android.

Hacker News Come chat with us on Gitter.im! An open source Hacker News client for Android phones & tablets. Available on the Google Play Store How to

Matthew Bishop 227 Dec 11, 2022
An open source clone of a famous flappy bird game for Android using AndEngine

OpenFlappyBird An open source clone of a famous flappy bird game for Android using the amazing AndEngine History When the original Flappy Bird game wa

Dean Wild 299 Dec 26, 2022
A Free, Fully Fledged, Open-Source Music Player for Android

Turtle Player Free, Fully Fledged & Open-Source. The Music Player for Android. Turtle Player is designed to be a fun and unique app for playing your m

Edd Turtle 178 Nov 18, 2022
Freegemas libGDX is an Android and Java desktop port of Freegemas, which in turn is an open source version of the well known Bejeweled.

freegemas-gdx Freegemas libGDX is an Android, HTML 5 and Java desktop port of Freegemas, which in turn is an open source version of the well known Bej

David Saltares 144 Jun 21, 2022
Open source Imgur Android App

Opengur NO LONGER UNDER ACTIVE DEVELOPMENT Open source Imgur Android App Want to become a beta tester? Click Here! #Features Built in native java Nati

Kenny 324 Nov 22, 2022
Android open source calendar

Etar Calendar Etar (from Arabic: إِيتَار) is an open source material designed calendar made for everyone! Why? Well, I wanted a simple, material desig

null 1.5k Dec 30, 2022
Open source Imgur Android App

Opengur NO LONGER UNDER ACTIVE DEVELOPMENT Open source Imgur Android App Want to become a beta tester? Click Here! #Features Built in native java Nati

Kenny 324 Nov 22, 2022
Freegemas libGDX is an Android and Java desktop port of Freegemas, which in turn is an open source version of the well known Bejeweled.

freegemas-gdx Freegemas libGDX is an Android, HTML 5 and Java desktop port of Freegemas, which in turn is an open source version of the well known Bej

David Saltares 144 Jun 21, 2022