-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update from tangem/wallet-core@63e861e (4.1.20-tangem2)
- Loading branch information
tangem
committed
Dec 6, 2024
1 parent
954aa90
commit 1592391
Showing
65 changed files
with
240,371 additions
and
256,858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWBech32.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Copyright © 2017 Trust Wallet. | ||
|
||
#pragma once | ||
|
||
#include "TWBase.h" | ||
#include "TWData.h" | ||
#include "TWString.h" | ||
|
||
TW_EXTERN_C_BEGIN | ||
|
||
/// Bech32 encode / decode functions | ||
TW_EXPORT_STRUCT | ||
struct TWBech32; | ||
|
||
/// Encodes data as a Bech32 string. | ||
/// | ||
/// \param hrp The human-readable part. | ||
/// \param data The data part. | ||
/// \return the encoded Bech32 string. | ||
TW_EXPORT_STATIC_METHOD | ||
TWString *_Nonnull TWBech32Encode(TWString* _Nonnull hrp, TWData *_Nonnull data); | ||
|
||
/// Decodes a Bech32 string. Returns null if the string is not a valid Bech32 string. | ||
/// | ||
/// \param string The Bech32 string to decode. | ||
/// \return the decoded data, null if the string is not a valid Bech32 string. Note that the human-readable part is not returned. | ||
TW_EXPORT_STATIC_METHOD | ||
TWData *_Nullable TWBech32Decode(TWString *_Nonnull string); | ||
|
||
/// Encodes data as a Bech32m string. | ||
/// | ||
/// \param hrp The human-readable part. | ||
/// \param data The data part. | ||
/// \return the encoded Bech32m string. | ||
TW_EXPORT_STATIC_METHOD | ||
TWString *_Nonnull TWBech32EncodeM(TWString* _Nonnull hrp, TWData *_Nonnull data); | ||
|
||
/// Decodes a Bech32m string. Returns null if the string is not a valid Bech32m string. | ||
/// | ||
/// \param string The Bech32m string to decode. | ||
/// \return the decoded data, null if the string is not a valid Bech32m string. Note that the human-readable part is not returned. | ||
TW_EXPORT_STATIC_METHOD | ||
TWData *_Nullable TWBech32DecodeM(TWString *_Nonnull string); | ||
|
||
TW_EXTERN_C_END |
23 changes: 0 additions & 23 deletions
23
WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWBitcoinFee.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWCryptoBox.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Copyright © 2017 Trust Wallet. | ||
|
||
#pragma once | ||
|
||
#include "TWBase.h" | ||
#include "TWCryptoBoxPublicKey.h" | ||
#include "TWCryptoBoxSecretKey.h" | ||
#include "TWData.h" | ||
#include "TWString.h" | ||
|
||
TW_EXTERN_C_BEGIN | ||
|
||
/// `crypto_box` encryption algorithms. | ||
TW_EXPORT_STRUCT | ||
struct TWCryptoBox; | ||
|
||
/// Encrypts message using `my_secret` and `other_pubkey`. | ||
/// The output will have a randomly generated nonce prepended to it. | ||
/// The output will be Overhead + 24 bytes longer than the original. | ||
/// | ||
/// \param mySecret *non-null* pointer to my secret key. | ||
/// \param otherPubkey *non-null* pointer to other's public key. | ||
/// \param message *non-null* pointer to the message to be encrypted. | ||
/// \return *nullable* pointer to the encrypted message with randomly generated nonce prepended to it. | ||
TW_EXPORT_STATIC_METHOD | ||
TWData* _Nonnull TWCryptoBoxEncryptEasy(struct TWCryptoBoxSecretKey* _Nonnull mySecret, struct TWCryptoBoxPublicKey* _Nonnull otherPubkey, TWData* _Nonnull message); | ||
|
||
/// Decrypts box produced by `TWCryptoBoxEncryptEasy`. | ||
/// We assume a 24-byte nonce is prepended to the encrypted text in box. | ||
/// | ||
/// \param mySecret *non-null* pointer to my secret key. | ||
/// \param otherPubkey *non-null* pointer to other's public key. | ||
/// \param encrypted *non-null* pointer to the encrypted message with nonce prepended to it. | ||
/// \return *nullable* pointer to the decrypted message. | ||
TW_EXPORT_STATIC_METHOD | ||
TWData* _Nullable TWCryptoBoxDecryptEasy(struct TWCryptoBoxSecretKey* _Nonnull mySecret, struct TWCryptoBoxPublicKey* _Nonnull otherPubkey, TWData* _Nonnull encrypted); | ||
|
||
TW_EXTERN_C_END |
45 changes: 45 additions & 0 deletions
45
WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWCryptoBoxPublicKey.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Copyright © 2017 Trust Wallet. | ||
|
||
#pragma once | ||
|
||
#include "TWBase.h" | ||
#include "TWData.h" | ||
#include "TWString.h" | ||
|
||
TW_EXTERN_C_BEGIN | ||
|
||
/// Public key used in `crypto_box` cryptography. | ||
TW_EXPORT_CLASS | ||
struct TWCryptoBoxPublicKey; | ||
|
||
/// Determines if the given public key is valid or not. | ||
/// | ||
/// \param data *non-null* byte array. | ||
/// \return true if the public key is valid, false otherwise. | ||
TW_EXPORT_STATIC_METHOD | ||
bool TWCryptoBoxPublicKeyIsValid(TWData* _Nonnull data); | ||
|
||
/// Create a `crypto_box` public key with the given block of data. | ||
/// | ||
/// \param data *non-null* byte array. Expected to have 32 bytes. | ||
/// \note Should be deleted with \tw_crypto_box_public_key_delete. | ||
/// \return Nullable pointer to Public Key. | ||
TW_EXPORT_STATIC_METHOD | ||
struct TWCryptoBoxPublicKey* _Nullable TWCryptoBoxPublicKeyCreateWithData(TWData* _Nonnull data); | ||
|
||
/// Delete the given public key. | ||
/// | ||
/// \param publicKey *non-null* pointer to public key. | ||
TW_EXPORT_METHOD | ||
void TWCryptoBoxPublicKeyDelete(struct TWCryptoBoxPublicKey* _Nonnull publicKey); | ||
|
||
/// Returns the raw data of the given public-key. | ||
/// | ||
/// \param publicKey *non-null* pointer to a public key. | ||
/// \return C-compatible result with a C-compatible byte array. | ||
TW_EXPORT_PROPERTY | ||
TWData* _Nonnull TWCryptoBoxPublicKeyData(struct TWCryptoBoxPublicKey* _Nonnull publicKey); | ||
|
||
TW_EXTERN_C_END |
60 changes: 60 additions & 0 deletions
60
WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWCryptoBoxSecretKey.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Copyright © 2017 Trust Wallet. | ||
|
||
#pragma once | ||
|
||
#include "TWBase.h" | ||
#include "TWCryptoBoxPublicKey.h" | ||
#include "TWData.h" | ||
#include "TWString.h" | ||
|
||
TW_EXTERN_C_BEGIN | ||
|
||
/// Secret key used in `crypto_box` cryptography. | ||
TW_EXPORT_CLASS | ||
struct TWCryptoBoxSecretKey; | ||
|
||
/// Determines if the given secret key is valid or not. | ||
/// | ||
/// \param data *non-null* byte array. | ||
/// \return true if the secret key is valid, false otherwise. | ||
TW_EXPORT_STATIC_METHOD | ||
bool TWCryptoBoxSecretKeyIsValid(TWData* _Nonnull data); | ||
|
||
/// Create a random secret key. | ||
/// | ||
/// \note Should be deleted with \tw_crypto_box_secret_key_delete. | ||
/// \return *non-null* pointer to Secret Key. | ||
TW_EXPORT_STATIC_METHOD | ||
struct TWCryptoBoxSecretKey* _Nonnull TWCryptoBoxSecretKeyCreate(); | ||
|
||
/// Create a `crypto_box` secret key with the given block of data. | ||
/// | ||
/// \param data *non-null* byte array. Expected to have 32 bytes. | ||
/// \note Should be deleted with \tw_crypto_box_secret_key_delete. | ||
/// \return Nullable pointer to Secret Key. | ||
TW_EXPORT_STATIC_METHOD | ||
struct TWCryptoBoxSecretKey* _Nullable TWCryptoBoxSecretKeyCreateWithData(TWData* _Nonnull data); | ||
|
||
/// Delete the given secret `key`. | ||
/// | ||
/// \param key *non-null* pointer to secret key. | ||
TW_EXPORT_METHOD | ||
void TWCryptoBoxSecretKeyDelete(struct TWCryptoBoxSecretKey* _Nonnull key); | ||
|
||
/// Returns the public key associated with the given `key`. | ||
/// | ||
/// \param key *non-null* pointer to the private key. | ||
/// \return *non-null* pointer to the corresponding public key. | ||
TW_EXPORT_METHOD | ||
struct TWCryptoBoxPublicKey* _Nonnull TWCryptoBoxSecretKeyGetPublicKey(struct TWCryptoBoxSecretKey* _Nonnull key); | ||
|
||
/// Returns the raw data of the given secret-key. | ||
/// | ||
/// \param secretKey *non-null* pointer to a secret key. | ||
/// \return C-compatible result with a C-compatible byte array. | ||
TW_EXPORT_PROPERTY | ||
TWData* _Nonnull TWCryptoBoxSecretKeyData(struct TWCryptoBoxSecretKey* _Nonnull secretKey); | ||
|
||
TW_EXTERN_C_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWMessageSigner.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Copyright © 2017 Trust Wallet. | ||
|
||
#pragma once | ||
|
||
#include "TWBase.h" | ||
#include "TWPrivateKey.h" | ||
#include "TWString.h" | ||
|
||
TW_EXTERN_C_BEGIN | ||
|
||
/// Represents a message signer to sign custom messages for any blockchain. | ||
TW_EXPORT_CLASS | ||
struct TWMessageSigner; | ||
|
||
/// Signs an arbitrary message to prove ownership of an address for off-chain services. | ||
/// | ||
/// \param coin The given coin type to sign the message for. | ||
/// \param input The serialized data of a `MessageSigningInput` proto object, (e.g. `TW.Solana.Proto.MessageSigningInput`). | ||
/// \return The serialized data of a `MessageSigningOutput` proto object, (e.g. `TW.Solana.Proto.MessageSigningOutput`). | ||
TW_EXPORT_STATIC_METHOD | ||
TWData* _Nullable TWMessageSignerSign(enum TWCoinType coin, TWData* _Nonnull input); | ||
|
||
/// Verifies a signature for a message. | ||
/// | ||
/// \param coin The given coin type to sign the message for. | ||
/// \param input The serialized data of a verifying input (e.g. TW.Ethereum.Proto.MessageVerifyingInput). | ||
/// \return whether the signature is valid. | ||
TW_EXPORT_STATIC_METHOD | ||
bool TWMessageSignerVerify(enum TWCoinType coin, TWData* _Nonnull input); | ||
|
||
TW_EXTERN_C_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.