com.samsung.android.sdk.coldwallet

Class ScwService

  • java.lang.Object
    • com.samsung.android.sdk.coldwallet.ScwService
    • Method Detail

      • getInstance

        public static ScwService getInstance()
        Return the instance of the Keystore proxy object
        Returns:
        the instance, or null if Samsung Blockchain Keystore is not available on the device
      • getKeystoreApiLevel

        public int getKeystoreApiLevel()
        Get API level which the Keystore in the device supports

        Caution : You should check the API level before invoking any APIs. Otherwise, it will return ScwApiLevelException. If Keystore API level is lower than the required level, update the Keystore app first via ScwDeepLink.GALAXY_STORE

        Returns:
        API level
        Since:
        API Level 1
      • getSeedHash

        public java.lang.String getSeedHash()
        Get the pseudo seed hash which is randomly generated when the HD wallet created Whenever the seed for the wallet is changed, this key shall be changed.
        Returns:
        null if keystore does not support wallet key, zero-length string if the wallet is not created. Otherwise, wallet is created.
        Since:
        API Level 1
      • checkForMandatoryAppUpdate

        public void checkForMandatoryAppUpdate(@NonNull
                                               ScwService.ScwCheckForMandatoryAppUpdateCallback callback)
        Checks whether a mandatory update of Samsung Blockchain Keystore is needed or not. Do not call this method in the background thread. If there is a mandatory update, you need to open the app update link, ScwDeepLink.GALAXY_STORE
        Parameters:
        callback - Result callback
        Since:
        API Level 1
      • getExtendedPublicKeyList

        public void getExtendedPublicKeyList(@NonNull
                                             ScwService.ScwGetExtendedPublicKeyListCallback callback,
                                             @NonNull
                                             java.util.ArrayList<java.lang.String> hdPath)
        Request to get a list of extended Public Keys that corresponds to a list of HD Paths
        Parameters:
        callback - Result callback
        hdPath - The HD Path List to bring the public keys. The depth of a path should be between 3 and 6. For example, "m/44'/60'", "m/44'/60'/0'/0/0"
        Since:
        API Level 1
        See Also:
        https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
      • getAddressList

        public void getAddressList(@NonNull
                                   ScwService.ScwGetAddressListCallback callback,
                                   @NonNull
                                   java.util.ArrayList<java.lang.String> hdPath)
        Request to get a list of addresses that corresponds to a list of HD Paths
        Parameters:
        callback - Result callback
        hdPath - The HD Path list to bring the addresses. The depth of a path should be between 3 and 6. For example, "m/44'/60'", "m/44'/60'/0'/0/0"
        Since:
        API Level 1
        See Also:
        https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
      • signEthTransaction

        public void signEthTransaction(@NonNull
                                       ScwService.ScwSignEthTransactionCallback callback,
                                       @NonNull
                                       byte[] transaction,
                                       @NonNull
                                       java.lang.String hdPath)
        Request to sign Ethereum transaction
        Parameters:
        callback - Result callback
        transaction - A byte array of a RLP-encoded unsigned Ethereum transaction
        hdPath - HD Path that corresponds to public key needed for signing
        Since:
        API Level 1
      • signEthPersonalMessage

        public void signEthPersonalMessage(@NonNull
                                           ScwService.ScwSignEthPersonalMessageCallback callback,
                                           @NonNull
                                           byte[] msg,
                                           @NonNull
                                           java.lang.String hdPath)
        Request to sign Ethereum typed structured data
        Parameters:
        callback - Result callback
        msg - A byte array of raw message to be signed. The Keystore will add "Ethereum Signed Message:\n" prefix, so it should not be included in msg.
        hdPath - HD Path that corresponds to public key needed for signing
        Since:
        API Level 1
        See Also:
        https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md
      • signKlayTransaction

        public void signKlayTransaction(@NonNull
                                        ScwService.ScwSignKlayTransactionCallback callback,
                                        @NonNull
                                        byte[] transaction,
                                        @NonNull
                                        java.lang.String hdPath,
                                        @NonNull
                                        int networkId)
        Request to sign Klay Transaction
        Parameters:
        callback - Result callback
        transaction - A byte array of a raw transaction to be signed by Samsung Blockchain Keystore. The transaction is same as the sigRLP value mentioned in Klaytn's official document.
        hdPath - HD Path that corresponds to public key needed for signing
        networkId - the Klaytn network ID, or the integer to identify the network. "8217" is Klaytn Cypress Mainnet and "1001" is Klaytn Baobab Testnet.
        Since:
        API Level 2
        See Also:
        https://docs.klaytn.com/node/en/installation/config