diff --git a/TangemWalletCore.podspec b/TangemWalletCore.podspec index 09ea273..97e04c9 100644 --- a/TangemWalletCore.podspec +++ b/TangemWalletCore.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'TangemWalletCore' - s.version = '3.1.9-tangem1' + s.version = '3.2.1-tangem1' s.summary = 'Use TW xcframework for Tangem integration' # This description is used to generate tags and improve search results. diff --git a/WalletCore.xcframework/Info.plist b/WalletCore.xcframework/Info.plist index 9d02d0b..972e19c 100644 --- a/WalletCore.xcframework/Info.plist +++ b/WalletCore.xcframework/Info.plist @@ -6,30 +6,30 @@ LibraryIdentifier - ios-arm64_x86_64-simulator + ios-arm64 LibraryPath WalletCore.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform ios - SupportedPlatformVariant - simulator LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-simulator LibraryPath WalletCore.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator CFBundlePackageType diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWAsnParser.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWAsnParser.h new file mode 100644 index 0000000..67d0c65 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWAsnParser.h @@ -0,0 +1,24 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWData.h" + +TW_EXTERN_C_BEGIN + +/// Represents an ASN.1 DER parser. +TW_EXPORT_STRUCT +struct TWAsnParser; + +/// Parses the given ECDSA signature from ASN.1 DER encoded bytes. +/// +/// \param encoded The ASN.1 DER encoded signature. +/// \return The ECDSA signature standard binary representation: RS, where R - 32 byte array, S - 32 byte array. +TW_EXPORT_STATIC_METHOD +TWData* _Nullable TWAsnParserEcdsaSignatureFromDer(TWData* _Nonnull encoded); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWBarz.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWBarz.h new file mode 100644 index 0000000..e68a652 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWBarz.h @@ -0,0 +1,44 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" +#include "TWPublicKey.h" + +TW_EXTERN_C_BEGIN + +/// Barz functions +TW_EXPORT_STRUCT +struct TWBarz; + +/// Calculate a counterfactual address for the smart contract wallet +/// +/// \param input The serialized data of ContractAddressInput. +/// \return The address. +TW_EXPORT_STATIC_METHOD +TWString *_Nonnull TWBarzGetCounterfactualAddress(TWData *_Nonnull input); + +/// Returns the init code parameter of ERC-4337 User Operation +/// +/// \param factory Wallet factory address (BarzFactory) +/// \param publicKey Public key for the verification facet +/// \param verificationFacet Verification facet address +/// \return The address. +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWBarzGetInitCode(TWString* _Nonnull factory, struct TWPublicKey* _Nonnull publicKey, TWString* _Nonnull verificationFacet); + +/// Converts the original ASN-encoded signature from webauthn to the format accepted by Barz +/// +/// \param signature Original signature +/// \param challenge The original challenge that was signed +/// \param authenticatorData Returned from Webauthn API +/// \param clientDataJSON Returned from Webauthn API +/// \return Bytes of the formatted signature +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWBarzGetFormattedSignature(TWData* _Nonnull signature, TWData* _Nonnull challenge, TWData* _Nonnull authenticatorData, TWString* _Nonnull clientDataJSON); +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWFilecoinAddressConverter.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWFilecoinAddressConverter.h new file mode 100644 index 0000000..aa5e37b --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWFilecoinAddressConverter.h @@ -0,0 +1,33 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" + +TW_EXTERN_C_BEGIN + +/// Filecoin-Ethereum address converter. +TW_EXPORT_STRUCT +struct TWFilecoinAddressConverter; + +/// Converts a Filecoin address to Ethereum. +/// +/// \param filecoinAddress: a Filecoin address. +/// \returns the Ethereum address. On invalid input empty string is returned. Returned object needs to be deleted after use. +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWFilecoinAddressConverterConvertToEthereum(TWString* _Nonnull filecoinAddress); + +/// Converts an Ethereum address to Filecoin. +/// +/// \param ethAddress: an Ethereum address. +/// \returns the Filecoin address. On invalid input empty string is returned. Returned object needs to be deleted after use. +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWFilecoinAddressConverterConvertFromEthereum(TWString* _Nonnull ethAddress); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWFilecoinAddressType.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWFilecoinAddressType.h new file mode 100644 index 0000000..98f8245 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWFilecoinAddressType.h @@ -0,0 +1,20 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" + +TW_EXTERN_C_BEGIN + +/// Filecoin address type. +TW_EXPORT_ENUM(uint32_t) +enum TWFilecoinAddressType { + TWFilecoinAddressTypeDefault = 0, // default + TWFilecoinAddressTypeDelegated = 1, +}; + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWLiquidStaking.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWLiquidStaking.h new file mode 100644 index 0000000..4829ef3 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWLiquidStaking.h @@ -0,0 +1,25 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" + +TW_EXTERN_C_BEGIN + +/// THORChain swap functions +TW_EXPORT_STRUCT +struct TWLiquidStaking; + +/// Builds a LiquidStaking transaction input. +/// +/// \param input The serialized data of LiquidStakingInput. +/// \return The serialized data of LiquidStakingOutput. +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWLiquidStakingBuildRequest(TWData *_Nonnull input); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWSubstrateAddress.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWSubstrateAddress.h new file mode 100644 index 0000000..9b059b0 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWSubstrateAddress.h @@ -0,0 +1,48 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWHRP.h" +#include "TWString.h" + +// TODO: Adjust definitions below + +TW_EXTERN_C_BEGIN + +struct TWPublicKey; + +/// Represents a Substrate address. +TW_EXPORT_CLASS +struct TWSubstrateAddress; + +/// Compares two addresses for equality. +TW_EXPORT_STATIC_METHOD +bool TWSubstrateAddressEqual(struct TWSubstrateAddress *_Nonnull lhs, struct TWSubstrateAddress *_Nonnull rhs); + +/// Determines if the string is a valid Substrate address. +TW_EXPORT_STATIC_METHOD +bool TWSubstrateAddressIsValidString(TWString *_Nonnull string, int32_t network); + +/// Creates an address from a string representaion. +TW_EXPORT_STATIC_METHOD +struct TWSubstrateAddress *_Nullable TWSubstrateAddressCreateWithString(TWString *_Nonnull string, int32_t network); + +/// Creates an address from a public key. +TW_EXPORT_STATIC_METHOD +struct TWSubstrateAddress *_Nonnull TWSubstrateAddressCreateWithPublicKey(struct TWPublicKey *_Nonnull publicKey, int32_t network); + +/// Delete address object +TW_EXPORT_METHOD +void TWSubstrateAddressDelete(struct TWSubstrateAddress *_Nonnull address); + +/// Returns the address string representation. +TW_EXPORT_PROPERTY +TWString *_Nonnull TWSubstrateAddressDescription(struct TWSubstrateAddress *_Nonnull address); + +TW_EXTERN_C_END \ No newline at end of file diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWSubstrateSigner.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWSubstrateSigner.h new file mode 100644 index 0000000..cac91c1 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWSubstrateSigner.h @@ -0,0 +1,26 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWSubstrateSigner.h" + +TW_EXTERN_C_BEGIN + +TW_EXPORT_CLASS +struct TWSubstrateSigner; + +/// Builds a message to be signed +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWSubstrateSignerMessage(TWData *_Nonnull data); + +/// Builds a transaction to be broadcasted +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWSubstrateSignerTransaction(TWData *_Nonnull data, TWData *_Nonnull publicKey, TWData *_Nonnull signature); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWTezosMessageSigner.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWTezosMessageSigner.h new file mode 100644 index 0000000..bcb99bf --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWTezosMessageSigner.h @@ -0,0 +1,53 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" +#include "TWPrivateKey.h" +#include "TWPublicKey.h" + +TW_EXTERN_C_BEGIN + +/// Tezos message signing, verification and utilities. +TW_EXPORT_STRUCT +struct TWTezosMessageSigner; + +/// Implement format input as described in https://tezostaquito.io/docs/signing/ +/// +/// \param message message to format e.g: Hello, World +/// \param dAppUrl the app url, e.g: testUrl +/// \returns the formatted message as a string +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWTezosMessageSignerFormatMessage(TWString* _Nonnull message, TWString* _Nonnull url); + +/// Implement input to payload as described in: https://tezostaquito.io/docs/signing/ +/// +/// \param message formatted message to be turned into an hex payload +/// \return the hexpayload of the formated message as a hex string +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWTezosMessageSignerInputToPayload(TWString* _Nonnull message); + +/// Sign a message as described in https://tezostaquito.io/docs/signing/ +/// +/// \param privateKey: the private key used for signing +/// \param message: A custom message payload (hex) which is input to the signing. +/// \returns the signature, Hex-encoded. On invalid input empty string is returned. Returned object needs to be deleted after use. +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWTezosMessageSignerSignMessage(const struct TWPrivateKey* _Nonnull privateKey, TWString* _Nonnull message); + +/// Verify signature for a message as described in https://tezostaquito.io/docs/signing/ +/// +/// \param pubKey: pubKey that will verify the message from the signature +/// \param message: the message signed as a payload (hex) +/// \param signature: in Base58-encoded form. +/// \returns false on any invalid input (does not throw), true if the message can be verified from the signature +TW_EXPORT_STATIC_METHOD +bool TWTezosMessageSignerVerifyMessage(const struct TWPublicKey* _Nonnull pubKey, TWString* _Nonnull message, TWString* _Nonnull signature); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWTronMessageSigner.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWTronMessageSigner.h new file mode 100644 index 0000000..56f326d --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWTronMessageSigner.h @@ -0,0 +1,41 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" +#include "TWPrivateKey.h" +#include "TWPublicKey.h" + +TW_EXTERN_C_BEGIN + +/// Tron message signing and verification. +/// +/// Tron and some other wallets support a message signing & verification format, to create a proof (a signature) +/// that someone has access to the private keys of a specific address. +TW_EXPORT_STRUCT +struct TWTronMessageSigner; + +/// Sign a message. +/// +/// \param privateKey: the private key used for signing +/// \param message: A custom message which is input to the signing. +/// \returns the signature, Hex-encoded. On invalid input empty string is returned. Returned object needs to be deleted after use. +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWTronMessageSignerSignMessage(const struct TWPrivateKey* _Nonnull privateKey, TWString* _Nonnull message); + +/// Verify signature for a message. +/// +/// \param pubKey: pubKey that will verify and recover the message from the signature +/// \param message: the message signed (without prefix) +/// \param signature: in Hex-encoded form. +/// \returns false on any invalid input (does not throw), true if the message can be recovered from the signature +TW_EXPORT_STATIC_METHOD +bool TWTronMessageSignerVerifyMessage(const struct TWPublicKey* _Nonnull pubKey, TWString* _Nonnull message, TWString* _Nonnull signature); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWWebAuthn.h b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWWebAuthn.h new file mode 100644 index 0000000..073fa16 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64/WalletCore.framework/Headers/TWWebAuthn.h @@ -0,0 +1,23 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWPublicKey.h" + +TW_EXTERN_C_BEGIN + +TW_EXPORT_STRUCT +struct TWWebAuthn; + +/// Converts attestation object to the public key on P256 curve +/// +/// \param attestationObject Attestation object retrieved from webuthn.get method +/// \return Public key. +TW_EXPORT_STATIC_METHOD +struct TWPublicKey *_Nullable TWWebAuthnGetPublicKey(TWData *_Nonnull attestationObject); +TW_EXTERN_C_END \ No newline at end of file diff --git a/WalletCore.xcframework/ios-arm64/WalletCore.framework/WalletCore b/WalletCore.xcframework/ios-arm64/WalletCore.framework/WalletCore index 98eb721..e187d0b 100755 Binary files a/WalletCore.xcframework/ios-arm64/WalletCore.framework/WalletCore and b/WalletCore.xcframework/ios-arm64/WalletCore.framework/WalletCore differ diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWAsnParser.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWAsnParser.h new file mode 100644 index 0000000..67d0c65 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWAsnParser.h @@ -0,0 +1,24 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWData.h" + +TW_EXTERN_C_BEGIN + +/// Represents an ASN.1 DER parser. +TW_EXPORT_STRUCT +struct TWAsnParser; + +/// Parses the given ECDSA signature from ASN.1 DER encoded bytes. +/// +/// \param encoded The ASN.1 DER encoded signature. +/// \return The ECDSA signature standard binary representation: RS, where R - 32 byte array, S - 32 byte array. +TW_EXPORT_STATIC_METHOD +TWData* _Nullable TWAsnParserEcdsaSignatureFromDer(TWData* _Nonnull encoded); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWBarz.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWBarz.h new file mode 100644 index 0000000..e68a652 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWBarz.h @@ -0,0 +1,44 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" +#include "TWPublicKey.h" + +TW_EXTERN_C_BEGIN + +/// Barz functions +TW_EXPORT_STRUCT +struct TWBarz; + +/// Calculate a counterfactual address for the smart contract wallet +/// +/// \param input The serialized data of ContractAddressInput. +/// \return The address. +TW_EXPORT_STATIC_METHOD +TWString *_Nonnull TWBarzGetCounterfactualAddress(TWData *_Nonnull input); + +/// Returns the init code parameter of ERC-4337 User Operation +/// +/// \param factory Wallet factory address (BarzFactory) +/// \param publicKey Public key for the verification facet +/// \param verificationFacet Verification facet address +/// \return The address. +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWBarzGetInitCode(TWString* _Nonnull factory, struct TWPublicKey* _Nonnull publicKey, TWString* _Nonnull verificationFacet); + +/// Converts the original ASN-encoded signature from webauthn to the format accepted by Barz +/// +/// \param signature Original signature +/// \param challenge The original challenge that was signed +/// \param authenticatorData Returned from Webauthn API +/// \param clientDataJSON Returned from Webauthn API +/// \return Bytes of the formatted signature +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWBarzGetFormattedSignature(TWData* _Nonnull signature, TWData* _Nonnull challenge, TWData* _Nonnull authenticatorData, TWString* _Nonnull clientDataJSON); +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWFilecoinAddressConverter.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWFilecoinAddressConverter.h new file mode 100644 index 0000000..aa5e37b --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWFilecoinAddressConverter.h @@ -0,0 +1,33 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" + +TW_EXTERN_C_BEGIN + +/// Filecoin-Ethereum address converter. +TW_EXPORT_STRUCT +struct TWFilecoinAddressConverter; + +/// Converts a Filecoin address to Ethereum. +/// +/// \param filecoinAddress: a Filecoin address. +/// \returns the Ethereum address. On invalid input empty string is returned. Returned object needs to be deleted after use. +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWFilecoinAddressConverterConvertToEthereum(TWString* _Nonnull filecoinAddress); + +/// Converts an Ethereum address to Filecoin. +/// +/// \param ethAddress: an Ethereum address. +/// \returns the Filecoin address. On invalid input empty string is returned. Returned object needs to be deleted after use. +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWFilecoinAddressConverterConvertFromEthereum(TWString* _Nonnull ethAddress); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWFilecoinAddressType.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWFilecoinAddressType.h new file mode 100644 index 0000000..98f8245 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWFilecoinAddressType.h @@ -0,0 +1,20 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" + +TW_EXTERN_C_BEGIN + +/// Filecoin address type. +TW_EXPORT_ENUM(uint32_t) +enum TWFilecoinAddressType { + TWFilecoinAddressTypeDefault = 0, // default + TWFilecoinAddressTypeDelegated = 1, +}; + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWLiquidStaking.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWLiquidStaking.h new file mode 100644 index 0000000..4829ef3 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWLiquidStaking.h @@ -0,0 +1,25 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" + +TW_EXTERN_C_BEGIN + +/// THORChain swap functions +TW_EXPORT_STRUCT +struct TWLiquidStaking; + +/// Builds a LiquidStaking transaction input. +/// +/// \param input The serialized data of LiquidStakingInput. +/// \return The serialized data of LiquidStakingOutput. +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWLiquidStakingBuildRequest(TWData *_Nonnull input); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWSubstrateAddress.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWSubstrateAddress.h new file mode 100644 index 0000000..9b059b0 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWSubstrateAddress.h @@ -0,0 +1,48 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWHRP.h" +#include "TWString.h" + +// TODO: Adjust definitions below + +TW_EXTERN_C_BEGIN + +struct TWPublicKey; + +/// Represents a Substrate address. +TW_EXPORT_CLASS +struct TWSubstrateAddress; + +/// Compares two addresses for equality. +TW_EXPORT_STATIC_METHOD +bool TWSubstrateAddressEqual(struct TWSubstrateAddress *_Nonnull lhs, struct TWSubstrateAddress *_Nonnull rhs); + +/// Determines if the string is a valid Substrate address. +TW_EXPORT_STATIC_METHOD +bool TWSubstrateAddressIsValidString(TWString *_Nonnull string, int32_t network); + +/// Creates an address from a string representaion. +TW_EXPORT_STATIC_METHOD +struct TWSubstrateAddress *_Nullable TWSubstrateAddressCreateWithString(TWString *_Nonnull string, int32_t network); + +/// Creates an address from a public key. +TW_EXPORT_STATIC_METHOD +struct TWSubstrateAddress *_Nonnull TWSubstrateAddressCreateWithPublicKey(struct TWPublicKey *_Nonnull publicKey, int32_t network); + +/// Delete address object +TW_EXPORT_METHOD +void TWSubstrateAddressDelete(struct TWSubstrateAddress *_Nonnull address); + +/// Returns the address string representation. +TW_EXPORT_PROPERTY +TWString *_Nonnull TWSubstrateAddressDescription(struct TWSubstrateAddress *_Nonnull address); + +TW_EXTERN_C_END \ No newline at end of file diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWSubstrateSigner.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWSubstrateSigner.h new file mode 100644 index 0000000..cac91c1 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWSubstrateSigner.h @@ -0,0 +1,26 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWSubstrateSigner.h" + +TW_EXTERN_C_BEGIN + +TW_EXPORT_CLASS +struct TWSubstrateSigner; + +/// Builds a message to be signed +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWSubstrateSignerMessage(TWData *_Nonnull data); + +/// Builds a transaction to be broadcasted +TW_EXPORT_STATIC_METHOD +TWData *_Nonnull TWSubstrateSignerTransaction(TWData *_Nonnull data, TWData *_Nonnull publicKey, TWData *_Nonnull signature); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWTezosMessageSigner.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWTezosMessageSigner.h new file mode 100644 index 0000000..bcb99bf --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWTezosMessageSigner.h @@ -0,0 +1,53 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" +#include "TWPrivateKey.h" +#include "TWPublicKey.h" + +TW_EXTERN_C_BEGIN + +/// Tezos message signing, verification and utilities. +TW_EXPORT_STRUCT +struct TWTezosMessageSigner; + +/// Implement format input as described in https://tezostaquito.io/docs/signing/ +/// +/// \param message message to format e.g: Hello, World +/// \param dAppUrl the app url, e.g: testUrl +/// \returns the formatted message as a string +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWTezosMessageSignerFormatMessage(TWString* _Nonnull message, TWString* _Nonnull url); + +/// Implement input to payload as described in: https://tezostaquito.io/docs/signing/ +/// +/// \param message formatted message to be turned into an hex payload +/// \return the hexpayload of the formated message as a hex string +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWTezosMessageSignerInputToPayload(TWString* _Nonnull message); + +/// Sign a message as described in https://tezostaquito.io/docs/signing/ +/// +/// \param privateKey: the private key used for signing +/// \param message: A custom message payload (hex) which is input to the signing. +/// \returns the signature, Hex-encoded. On invalid input empty string is returned. Returned object needs to be deleted after use. +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWTezosMessageSignerSignMessage(const struct TWPrivateKey* _Nonnull privateKey, TWString* _Nonnull message); + +/// Verify signature for a message as described in https://tezostaquito.io/docs/signing/ +/// +/// \param pubKey: pubKey that will verify the message from the signature +/// \param message: the message signed as a payload (hex) +/// \param signature: in Base58-encoded form. +/// \returns false on any invalid input (does not throw), true if the message can be verified from the signature +TW_EXPORT_STATIC_METHOD +bool TWTezosMessageSignerVerifyMessage(const struct TWPublicKey* _Nonnull pubKey, TWString* _Nonnull message, TWString* _Nonnull signature); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWTronMessageSigner.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWTronMessageSigner.h new file mode 100644 index 0000000..56f326d --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWTronMessageSigner.h @@ -0,0 +1,41 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. + +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWString.h" +#include "TWPrivateKey.h" +#include "TWPublicKey.h" + +TW_EXTERN_C_BEGIN + +/// Tron message signing and verification. +/// +/// Tron and some other wallets support a message signing & verification format, to create a proof (a signature) +/// that someone has access to the private keys of a specific address. +TW_EXPORT_STRUCT +struct TWTronMessageSigner; + +/// Sign a message. +/// +/// \param privateKey: the private key used for signing +/// \param message: A custom message which is input to the signing. +/// \returns the signature, Hex-encoded. On invalid input empty string is returned. Returned object needs to be deleted after use. +TW_EXPORT_STATIC_METHOD +TWString* _Nonnull TWTronMessageSignerSignMessage(const struct TWPrivateKey* _Nonnull privateKey, TWString* _Nonnull message); + +/// Verify signature for a message. +/// +/// \param pubKey: pubKey that will verify and recover the message from the signature +/// \param message: the message signed (without prefix) +/// \param signature: in Hex-encoded form. +/// \returns false on any invalid input (does not throw), true if the message can be recovered from the signature +TW_EXPORT_STATIC_METHOD +bool TWTronMessageSignerVerifyMessage(const struct TWPublicKey* _Nonnull pubKey, TWString* _Nonnull message, TWString* _Nonnull signature); + +TW_EXTERN_C_END diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWWebAuthn.h b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWWebAuthn.h new file mode 100644 index 0000000..073fa16 --- /dev/null +++ b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/Headers/TWWebAuthn.h @@ -0,0 +1,23 @@ +// Copyright © 2017-2023 Trust Wallet. +// +// This file is part of Trust. The full Trust copyright notice, including +// terms governing use, modification, and redistribution, is contained in the +// file LICENSE at the root of the source code distribution tree. +#pragma once + +#include "TWBase.h" +#include "TWData.h" +#include "TWPublicKey.h" + +TW_EXTERN_C_BEGIN + +TW_EXPORT_STRUCT +struct TWWebAuthn; + +/// Converts attestation object to the public key on P256 curve +/// +/// \param attestationObject Attestation object retrieved from webuthn.get method +/// \return Public key. +TW_EXPORT_STATIC_METHOD +struct TWPublicKey *_Nullable TWWebAuthnGetPublicKey(TWData *_Nonnull attestationObject); +TW_EXTERN_C_END \ No newline at end of file diff --git a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/WalletCore b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/WalletCore index a2f17a2..3b4e3c7 100755 Binary files a/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/WalletCore and b/WalletCore.xcframework/ios-arm64_x86_64-simulator/WalletCore.framework/WalletCore differ