Skip to content

Commit

Permalink
fix: auto gen file
Browse files Browse the repository at this point in the history
Signed-off-by: bkioshn <bkioshn@gmail.com>
  • Loading branch information
bkioshn committed Nov 5, 2024
1 parent cbe61e4 commit f22ddcf
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ abstract class Bip32Ed25519Signature implements RustOpaqueInterface {
factory Bip32Ed25519Signature({required U8Array64 sigBytes}) =>
RustLib.instance.api
.crateApiKeyDerivationBip32Ed25519SignatureNew(sigBytes: sigBytes);

/// Convert to a hex string.
String toHex();
}

// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<Bip32Ed25519XPrivateKey>>
Expand Down Expand Up @@ -104,6 +107,9 @@ abstract class Bip32Ed25519XPrivateKey implements RustOpaqueInterface {
/// Returns an error if the extended private key is invalid.
Future<Bip32Ed25519Signature> signData({required List<int> data});

/// Convert to a hex string.
String toHex();

/// Verify the signature on the given data using extended private key.
///
/// # Arguments
Expand Down Expand Up @@ -160,6 +166,9 @@ abstract class Bip32Ed25519XPublicKey implements RustOpaqueInterface {
RustLib.instance.api
.crateApiKeyDerivationBip32Ed25519XPublicKeyNew(xpubBytes: xpubBytes);

/// Convert to a hex string.
String toHex();

/// Verify the signature on the given data using extended public key.
///
/// # Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
String get codegenVersion => '2.5.1';

@override
int get rustContentHash => -1380090306;
int get rustContentHash => -1976079523;

static const kDefaultExternalLibraryLoaderConfig =
ExternalLibraryLoaderConfig(
Expand All @@ -83,6 +83,9 @@ abstract class RustLibApi extends BaseApi {
Bip32Ed25519Signature crateApiKeyDerivationBip32Ed25519SignatureNew(
{required U8Array64 sigBytes});

String crateApiKeyDerivationBip32Ed25519SignatureToHex(
{required Bip32Ed25519Signature that});

Future<Bip32Ed25519XPrivateKey>
crateApiKeyDerivationBip32Ed25519XPrivateKeyDeriveXprv(
{required Bip32Ed25519XPrivateKey that, required String path});
Expand All @@ -106,6 +109,9 @@ abstract class RustLibApi extends BaseApi {
crateApiKeyDerivationBip32Ed25519XPrivateKeySignData(
{required Bip32Ed25519XPrivateKey that, required List<int> data});

String crateApiKeyDerivationBip32Ed25519XPrivateKeyToHex(
{required Bip32Ed25519XPrivateKey that});

Future<bool> crateApiKeyDerivationBip32Ed25519XPrivateKeyVerifySignature(
{required Bip32Ed25519XPrivateKey that,
required List<int> data,
Expand All @@ -127,6 +133,9 @@ abstract class RustLibApi extends BaseApi {
Bip32Ed25519XPublicKey crateApiKeyDerivationBip32Ed25519XPublicKeyNew(
{required U8Array64 xpubBytes});

String crateApiKeyDerivationBip32Ed25519XPublicKeyToHex(
{required Bip32Ed25519XPublicKey that});

Future<bool> crateApiKeyDerivationBip32Ed25519XPublicKeyVerifySignature(
{required Bip32Ed25519XPublicKey that,
required List<int> data,
Expand Down Expand Up @@ -224,6 +233,32 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
argNames: ["sigBytes"],
);

@override
String crateApiKeyDerivationBip32Ed25519SignatureToHex(
{required Bip32Ed25519Signature that}) {
return handler.executeSync(SyncTask(
callFfi: () {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519Signature(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 3)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_String,
decodeErrorData: null,
),
constMeta: kCrateApiKeyDerivationBip32Ed25519SignatureToHexConstMeta,
argValues: [that],
apiImpl: this,
));
}

TaskConstMeta get kCrateApiKeyDerivationBip32Ed25519SignatureToHexConstMeta =>
const TaskConstMeta(
debugName: "Bip32Ed25519Signature_to_hex",
argNames: ["that"],
);

@override
Future<Bip32Ed25519XPrivateKey>
crateApiKeyDerivationBip32Ed25519XPrivateKeyDeriveXprv(
Expand All @@ -235,7 +270,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
that, serializer);
sse_encode_String(path, serializer);
pdeCallFfi(generalizedFrbRustBinding, serializer,
funcId: 3, port: port_);
funcId: 4, port: port_);
},
codec: SseCodec(
decodeSuccessData:
Expand Down Expand Up @@ -264,7 +299,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPrivateKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 4)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 5)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_unit,
Expand All @@ -291,7 +326,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPrivateKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 5)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 6)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_u_8_array_32,
Expand Down Expand Up @@ -319,7 +354,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPrivateKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 6)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 7)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_u_8_array_64,
Expand Down Expand Up @@ -347,7 +382,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPrivateKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 7)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 8)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_u_8_array_96,
Expand All @@ -373,7 +408,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
callFfi: () {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_u_8_array_96(xprvBytes, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 8)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 9)!;
},
codec: SseCodec(
decodeSuccessData:
Expand Down Expand Up @@ -403,7 +438,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
that, serializer);
sse_encode_list_prim_u_8_loose(data, serializer);
pdeCallFfi(generalizedFrbRustBinding, serializer,
funcId: 9, port: port_);
funcId: 10, port: port_);
},
codec: SseCodec(
decodeSuccessData:
Expand All @@ -423,6 +458,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
argNames: ["that", "data"],
);

@override
String crateApiKeyDerivationBip32Ed25519XPrivateKeyToHex(
{required Bip32Ed25519XPrivateKey that}) {
return handler.executeSync(SyncTask(
callFfi: () {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPrivateKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 11)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_String,
decodeErrorData: null,
),
constMeta: kCrateApiKeyDerivationBip32Ed25519XPrivateKeyToHexConstMeta,
argValues: [that],
apiImpl: this,
));
}

TaskConstMeta
get kCrateApiKeyDerivationBip32Ed25519XPrivateKeyToHexConstMeta =>
const TaskConstMeta(
debugName: "Bip32Ed25519XPrivateKey_to_hex",
argNames: ["that"],
);

@override
Future<bool> crateApiKeyDerivationBip32Ed25519XPrivateKeyVerifySignature(
{required Bip32Ed25519XPrivateKey that,
Expand All @@ -437,7 +499,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519Signature(
signature, serializer);
pdeCallFfi(generalizedFrbRustBinding, serializer,
funcId: 10, port: port_);
funcId: 12, port: port_);
},
codec: SseCodec(
decodeSuccessData: sse_decode_bool,
Expand Down Expand Up @@ -467,7 +529,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPrivateKey(
that, serializer);
pdeCallFfi(generalizedFrbRustBinding, serializer,
funcId: 11, port: port_);
funcId: 13, port: port_);
},
codec: SseCodec(
decodeSuccessData:
Expand Down Expand Up @@ -496,7 +558,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPublicKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 12)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 14)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_u_8_array_32,
Expand Down Expand Up @@ -524,7 +586,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPublicKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 13)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 15)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_u_8_array_64,
Expand All @@ -551,7 +613,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPublicKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 14)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 16)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_u_8_array_32,
Expand All @@ -578,7 +640,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
callFfi: () {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_u_8_array_64(xpubBytes, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 15)!;
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 17)!;
},
codec: SseCodec(
decodeSuccessData:
Expand All @@ -597,6 +659,33 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
argNames: ["xpubBytes"],
);

@override
String crateApiKeyDerivationBip32Ed25519XPublicKeyToHex(
{required Bip32Ed25519XPublicKey that}) {
return handler.executeSync(SyncTask(
callFfi: () {
final serializer = SseSerializer(generalizedFrbRustBinding);
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519XPublicKey(
that, serializer);
return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 18)!;
},
codec: SseCodec(
decodeSuccessData: sse_decode_String,
decodeErrorData: null,
),
constMeta: kCrateApiKeyDerivationBip32Ed25519XPublicKeyToHexConstMeta,
argValues: [that],
apiImpl: this,
));
}

TaskConstMeta
get kCrateApiKeyDerivationBip32Ed25519XPublicKeyToHexConstMeta =>
const TaskConstMeta(
debugName: "Bip32Ed25519XPublicKey_to_hex",
argNames: ["that"],
);

@override
Future<bool> crateApiKeyDerivationBip32Ed25519XPublicKeyVerifySignature(
{required Bip32Ed25519XPublicKey that,
Expand All @@ -611,7 +700,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBip32Ed25519Signature(
signature, serializer);
pdeCallFfi(generalizedFrbRustBinding, serializer,
funcId: 16, port: port_);
funcId: 19, port: port_);
},
codec: SseCodec(
decodeSuccessData: sse_decode_bool,
Expand Down Expand Up @@ -640,7 +729,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
sse_encode_String(mnemonic, serializer);
sse_encode_opt_String(passphrase, serializer);
pdeCallFfi(generalizedFrbRustBinding, serializer,
funcId: 17, port: port_);
funcId: 20, port: port_);
},
codec: SseCodec(
decodeSuccessData:
Expand Down Expand Up @@ -1235,6 +1324,12 @@ class Bip32Ed25519SignatureImpl extends RustOpaque
RustLib.instance.api.crateApiKeyDerivationBip32Ed25519SignatureGetInner(
that: this,
);

/// Convert to a hex string.
String toHex() =>
RustLib.instance.api.crateApiKeyDerivationBip32Ed25519SignatureToHex(
that: this,
);
}

@sealed
Expand Down Expand Up @@ -1329,6 +1424,12 @@ class Bip32Ed25519XPrivateKeyImpl extends RustOpaque
RustLib.instance.api.crateApiKeyDerivationBip32Ed25519XPrivateKeySignData(
that: this, data: data);

/// Convert to a hex string.
String toHex() =>
RustLib.instance.api.crateApiKeyDerivationBip32Ed25519XPrivateKeyToHex(
that: this,
);

/// Verify the signature on the given data using extended private key.
///
/// # Arguments
Expand Down Expand Up @@ -1415,6 +1516,12 @@ class Bip32Ed25519XPublicKeyImpl extends RustOpaque
that: this,
);

/// Convert to a hex string.
String toHex() =>
RustLib.instance.api.crateApiKeyDerivationBip32Ed25519XPublicKeyToHex(
that: this,
);

/// Verify the signature on the given data using extended public key.
///
/// # Arguments
Expand Down

0 comments on commit f22ddcf

Please sign in to comment.