Skip to content

Commit

Permalink
Merge pull request #78 from kumulynja/rename-native-libs
Browse files Browse the repository at this point in the history
rename native libs
  • Loading branch information
BitcoinZavior authored May 15, 2023
2 parents bc3b6b4 + c614de4 commit 93dd086
Show file tree
Hide file tree
Showing 12 changed files with 599 additions and 1,114 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.27.2"
version: "0.27.3"
boolean_selector:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion ios/bdk_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ A new Flutter project.
s.public_header_files = 'Classes**/*.h'
s.source_files = 'Classes/**/*'
s.static_framework = true
s.vendored_libraries = "librust.a"
s.vendored_libraries = "librust_bdk_ffi.a"
end
Binary file renamed ios/librust.a → ios/librust_bdk_ffi.a
Binary file not shown.
1,363 changes: 465 additions & 898 deletions lib/src/generated/bindings.dart

Large diffs are not rendered by default.

123 changes: 34 additions & 89 deletions lib/src/generated/bridge_definitions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,24 @@ import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
part 'bridge_definitions.freezed.dart';

abstract class Rust {
Future<BlockchainInstance> blockchainInit(
{required BlockchainConfig config, dynamic hint});
Future<BlockchainInstance> blockchainInit({required BlockchainConfig config, dynamic hint});

FlutterRustBridgeTaskConstMeta get kBlockchainInitConstMeta;

Future<int> getBlockchainHeight(
{required BlockchainInstance blockchain, dynamic hint});
Future<int> getBlockchainHeight({required BlockchainInstance blockchain, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGetBlockchainHeightConstMeta;

Future<String> getBlockchainHash(
{required int blockchainHeight,
required BlockchainInstance blockchain,
dynamic hint});
{required int blockchainHeight, required BlockchainInstance blockchain, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGetBlockchainHashConstMeta;

Future<double> estimateFee(
{required int target,
required BlockchainInstance blockchain,
dynamic hint});
Future<double> estimateFee({required int target, required BlockchainInstance blockchain, dynamic hint});

FlutterRustBridgeTaskConstMeta get kEstimateFeeConstMeta;

Future<String> broadcast(
{required Uint8List tx,
required BlockchainInstance blockchain,
dynamic hint});
Future<String> broadcast({required Uint8List tx, required BlockchainInstance blockchain, dynamic hint});

FlutterRustBridgeTaskConstMeta get kBroadcastConstMeta;

Expand All @@ -62,8 +52,7 @@ abstract class Rust {

FlutterRustBridgeTaskConstMeta get kGetFeeAmountConstMeta;

Future<String> combinePsbt(
{required String psbtStr, required String other, dynamic hint});
Future<String> combinePsbt({required String psbtStr, required String other, dynamic hint});

FlutterRustBridgeTaskConstMeta get kCombinePsbtConstMeta;

Expand Down Expand Up @@ -97,16 +86,12 @@ abstract class Rust {

FlutterRustBridgeTaskConstMeta get kBumpFeeTxBuilderFinishConstMeta;

Future<BdkDescriptor> newDescriptor(
{required String descriptor, required Network network, dynamic hint});
Future<BdkDescriptor> newDescriptor({required String descriptor, required Network network, dynamic hint});

FlutterRustBridgeTaskConstMeta get kNewDescriptorConstMeta;

Future<BdkDescriptor> newBip44Descriptor(
{required KeychainKind keyChainKind,
required String secretKey,
required Network network,
dynamic hint});
{required KeychainKind keyChainKind, required String secretKey, required Network network, dynamic hint});

FlutterRustBridgeTaskConstMeta get kNewBip44DescriptorConstMeta;

Expand All @@ -120,10 +105,7 @@ abstract class Rust {
FlutterRustBridgeTaskConstMeta get kNewBip44PublicConstMeta;

Future<BdkDescriptor> newBip49Descriptor(
{required KeychainKind keyChainKind,
required String secretKey,
required Network network,
dynamic hint});
{required KeychainKind keyChainKind, required String secretKey, required Network network, dynamic hint});

FlutterRustBridgeTaskConstMeta get kNewBip49DescriptorConstMeta;

Expand All @@ -137,10 +119,7 @@ abstract class Rust {
FlutterRustBridgeTaskConstMeta get kNewBip49PublicConstMeta;

Future<BdkDescriptor> newBip84Descriptor(
{required KeychainKind keyChainKind,
required String secretKey,
required Network network,
dynamic hint});
{required KeychainKind keyChainKind, required String secretKey, required Network network, dynamic hint});

FlutterRustBridgeTaskConstMeta get kNewBip84DescriptorConstMeta;

Expand All @@ -153,8 +132,7 @@ abstract class Rust {

FlutterRustBridgeTaskConstMeta get kNewBip84PublicConstMeta;

Future<String> asStringPrivate(
{required BdkDescriptor descriptor, dynamic hint});
Future<String> asStringPrivate({required BdkDescriptor descriptor, dynamic hint});

FlutterRustBridgeTaskConstMeta get kAsStringPrivateConstMeta;

Expand All @@ -163,49 +141,39 @@ abstract class Rust {
FlutterRustBridgeTaskConstMeta get kAsStringConstMeta;

Future<String> createDescriptorSecret(
{required Network network,
required String mnemonic,
String? password,
dynamic hint});
{required Network network, required String mnemonic, String? password, dynamic hint});

FlutterRustBridgeTaskConstMeta get kCreateDescriptorSecretConstMeta;

Future<String> descriptorSecretFromString(
{required String xprv, dynamic hint});
Future<String> descriptorSecretFromString({required String xprv, dynamic hint});

FlutterRustBridgeTaskConstMeta get kDescriptorSecretFromStringConstMeta;

Future<String> descriptorSecretExtend(
{required String xprv, required String path, dynamic hint});
Future<String> descriptorSecretExtend({required String xprv, required String path, dynamic hint});

FlutterRustBridgeTaskConstMeta get kDescriptorSecretExtendConstMeta;

Future<String> descriptorSecretDerive(
{required String xprv, required String path, dynamic hint});
Future<String> descriptorSecretDerive({required String xprv, required String path, dynamic hint});

FlutterRustBridgeTaskConstMeta get kDescriptorSecretDeriveConstMeta;

Future<Uint8List> descriptorSecretAsSecretBytes(
{String? descriptorSecret, String? xprv, dynamic hint});
Future<Uint8List> descriptorSecretAsSecretBytes({String? descriptorSecret, String? xprv, dynamic hint});

FlutterRustBridgeTaskConstMeta get kDescriptorSecretAsSecretBytesConstMeta;

Future<String> descriptorSecretAsPublic(
{String? descriptorSecret, String? xprv, dynamic hint});
Future<String> descriptorSecretAsPublic({String? descriptorSecret, String? xprv, dynamic hint});

FlutterRustBridgeTaskConstMeta get kDescriptorSecretAsPublicConstMeta;

Future<String> createDerivationPath({required String path, dynamic hint});

FlutterRustBridgeTaskConstMeta get kCreateDerivationPathConstMeta;

Future<String> descriptorPublicFromString(
{required String publicKey, dynamic hint});
Future<String> descriptorPublicFromString({required String publicKey, dynamic hint});

FlutterRustBridgeTaskConstMeta get kDescriptorPublicFromStringConstMeta;

Future<String> createDescriptorPublic(
{String? xpub, required String path, required bool derive, dynamic hint});
Future<String> createDescriptorPublic({String? xpub, required String path, required bool derive, dynamic hint});

FlutterRustBridgeTaskConstMeta get kCreateDescriptorPublicConstMeta;

Expand All @@ -217,8 +185,7 @@ abstract class Rust {

FlutterRustBridgeTaskConstMeta get kInitAddressConstMeta;

Future<String> addressToScriptPubkeyHex(
{required String address, dynamic hint});
Future<String> addressToScriptPubkeyHex({required String address, dynamic hint});

FlutterRustBridgeTaskConstMeta get kAddressToScriptPubkeyHexConstMeta;

Expand All @@ -231,77 +198,58 @@ abstract class Rust {

FlutterRustBridgeTaskConstMeta get kWalletInitConstMeta;

Future<AddressInfo> getAddress(
{required WalletInstance wallet,
required AddressIndex addressIndex,
dynamic hint});
Future<AddressInfo> getAddress({required WalletInstance wallet, required AddressIndex addressIndex, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGetAddressConstMeta;

Future<AddressInfo> getInternalAddress(
{required WalletInstance wallet,
required AddressIndex addressIndex,
dynamic hint});
{required WalletInstance wallet, required AddressIndex addressIndex, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGetInternalAddressConstMeta;

Future<AddressInfo> getInternalizedAddress(
{required WalletInstance wallet,
required AddressIndex addressIndex,
dynamic hint});
{required WalletInstance wallet, required AddressIndex addressIndex, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGetInternalizedAddressConstMeta;

Future<void> syncWallet(
{required WalletInstance wallet,
required BlockchainInstance blockchain,
dynamic hint});
Future<void> syncWallet({required WalletInstance wallet, required BlockchainInstance blockchain, dynamic hint});

FlutterRustBridgeTaskConstMeta get kSyncWalletConstMeta;

Future<Balance> getBalance({required WalletInstance wallet, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGetBalanceConstMeta;

Future<List<LocalUtxo>> listUnspentOutputs(
{required WalletInstance wallet, dynamic hint});
Future<List<LocalUtxo>> listUnspentOutputs({required WalletInstance wallet, dynamic hint});

FlutterRustBridgeTaskConstMeta get kListUnspentOutputsConstMeta;

Future<List<TransactionDetails>> getTransactions(
{required WalletInstance wallet, dynamic hint});
Future<List<TransactionDetails>> getTransactions({required WalletInstance wallet, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGetTransactionsConstMeta;

Future<String?> sign(
{required WalletInstance wallet,
required String psbtStr,
required bool isMultiSig,
dynamic hint});
{required WalletInstance wallet, required String psbtStr, required bool isMultiSig, dynamic hint});

FlutterRustBridgeTaskConstMeta get kSignConstMeta;

Future<Network> getNetwork({required WalletInstance wallet, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGetNetworkConstMeta;

Future<List<LocalUtxo>> listUnspent(
{required WalletInstance wallet, dynamic hint});
Future<List<LocalUtxo>> listUnspent({required WalletInstance wallet, dynamic hint});

FlutterRustBridgeTaskConstMeta get kListUnspentConstMeta;

Future<String> generateSeedFromWordCount(
{required WordCount wordCount, dynamic hint});
Future<String> generateSeedFromWordCount({required WordCount wordCount, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGenerateSeedFromWordCountConstMeta;

Future<String> generateSeedFromString(
{required String mnemonic, dynamic hint});
Future<String> generateSeedFromString({required String mnemonic, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGenerateSeedFromStringConstMeta;

Future<String> generateSeedFromEntropy(
{required Uint8List entropy, dynamic hint});
Future<String> generateSeedFromEntropy({required Uint8List entropy, dynamic hint});

FlutterRustBridgeTaskConstMeta get kGenerateSeedFromEntropyConstMeta;

Expand All @@ -321,8 +269,7 @@ abstract class Rust {
@sealed
class BdkDescriptor extends FrbOpaque {
final Rust bridge;
BdkDescriptor.fromRaw(int ptr, int size, this.bridge)
: super.unsafe(ptr, size);
BdkDescriptor.fromRaw(int ptr, int size, this.bridge) : super.unsafe(ptr, size);
@override
DropFnType get dropFn => bridge.dropOpaqueBdkDescriptor;

Expand All @@ -336,8 +283,7 @@ class BdkDescriptor extends FrbOpaque {
@sealed
class BlockchainInstance extends FrbOpaque {
final Rust bridge;
BlockchainInstance.fromRaw(int ptr, int size, this.bridge)
: super.unsafe(ptr, size);
BlockchainInstance.fromRaw(int ptr, int size, this.bridge) : super.unsafe(ptr, size);
@override
DropFnType get dropFn => bridge.dropOpaqueBlockchainInstance;

Expand All @@ -351,8 +297,7 @@ class BlockchainInstance extends FrbOpaque {
@sealed
class WalletInstance extends FrbOpaque {
final Rust bridge;
WalletInstance.fromRaw(int ptr, int size, this.bridge)
: super.unsafe(ptr, size);
WalletInstance.fromRaw(int ptr, int size, this.bridge) : super.unsafe(ptr, size);
@override
DropFnType get dropFn => bridge.dropOpaqueWalletInstance;

Expand Down
Loading

0 comments on commit 93dd086

Please sign in to comment.