Skip to content

Commit

Permalink
Merge pull request #115 from Emurgo/update-csl-version-13.0.0
Browse files Browse the repository at this point in the history
Update CSL version to 13.0.0
  • Loading branch information
lisicky authored Oct 11, 2024
2 parents 3f03b2c + ae12b6c commit c4079d8
Show file tree
Hide file tree
Showing 11 changed files with 625 additions and 336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1530,9 +1530,9 @@ public final void csl_bridge_bootstrapWitnessesGet(String self, Double index, Pr
}

@ReactMethod
public final void csl_bridge_bootstrapWitnessesAdd(String self, String elem, Promise promise) {
public final void csl_bridge_bootstrapWitnessesAdd(String self, String witness, Promise promise) {
Native.I
.csl_bridge_bootstrapWitnessesAdd(new RPtr(self), new RPtr(elem))
.csl_bridge_bootstrapWitnessesAdd(new RPtr(self), new RPtr(witness))
.pour(promise);
}

Expand Down Expand Up @@ -2908,9 +2908,9 @@ public final void csl_bridge_credentialsGet(String self, Double index, Promise p
}

@ReactMethod
public final void csl_bridge_credentialsAdd(String self, String elem, Promise promise) {
public final void csl_bridge_credentialsAdd(String self, String credential, Promise promise) {
Native.I
.csl_bridge_credentialsAdd(new RPtr(self), new RPtr(elem))
.csl_bridge_credentialsAdd(new RPtr(self), new RPtr(credential))
.pour(promise);
}

Expand Down Expand Up @@ -3826,9 +3826,9 @@ public final void csl_bridge_ed25519KeyHashesGet(String self, Double index, Prom
}

@ReactMethod
public final void csl_bridge_ed25519KeyHashesAdd(String self, String elem, Promise promise) {
public final void csl_bridge_ed25519KeyHashesAdd(String self, String keyhash, Promise promise) {
Native.I
.csl_bridge_ed25519KeyHashesAdd(new RPtr(self), new RPtr(elem))
.csl_bridge_ed25519KeyHashesAdd(new RPtr(self), new RPtr(keyhash))
.pour(promise);
}

Expand Down Expand Up @@ -4189,6 +4189,14 @@ public final void csl_bridge_fixedTransactionNewWithAuxiliary(String rawBody, St
.pour(promise);
}

@ReactMethod
public final void csl_bridge_fixedTransactionNewFromBodyBytes(String rawBody, Promise promise) {
Native.I
.csl_bridge_fixedTransactionNewFromBodyBytes(Base64.decode(rawBody, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}

@ReactMethod
public final void csl_bridge_fixedTransactionBody(String self, Promise promise) {
Native.I
Expand Down Expand Up @@ -7869,64 +7877,64 @@ public final void csl_bridge_plutusDataFromAddress(String address, Promise promi


@ReactMethod
public final void csl_bridge_plutusListToBytes(String self, Promise promise) {
public final void csl_bridge_plutusListNew( Promise promise) {
Native.I
.csl_bridge_plutusListToBytes(new RPtr(self))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.csl_bridge_plutusListNew()
.map(RPtr::toJs)
.pour(promise);
}

@ReactMethod
public final void csl_bridge_plutusListFromBytes(String bytes, Promise promise) {
public final void csl_bridge_plutusListLen(String self, Promise promise) {
Native.I
.csl_bridge_plutusListFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.csl_bridge_plutusListLen(new RPtr(self))
.map(Utils::boxedLongToDouble)
.pour(promise);
}

@ReactMethod
public final void csl_bridge_plutusListToHex(String self, Promise promise) {
public final void csl_bridge_plutusListGet(String self, Double index, Promise promise) {
Native.I
.csl_bridge_plutusListToHex(new RPtr(self))
.csl_bridge_plutusListGet(new RPtr(self), index.longValue())
.map(RPtr::toJs)
.pour(promise);
}

@ReactMethod
public final void csl_bridge_plutusListFromHex(String hexStr, Promise promise) {
public final void csl_bridge_plutusListAdd(String self, String elem, Promise promise) {
Native.I
.csl_bridge_plutusListFromHex(hexStr)
.map(RPtr::toJs)
.csl_bridge_plutusListAdd(new RPtr(self), new RPtr(elem))
.pour(promise);
}

@ReactMethod
public final void csl_bridge_plutusListNew( Promise promise) {
public final void csl_bridge_plutusListToBytes(String self, Promise promise) {
Native.I
.csl_bridge_plutusListNew()
.map(RPtr::toJs)
.csl_bridge_plutusListToBytes(new RPtr(self))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}

@ReactMethod
public final void csl_bridge_plutusListLen(String self, Promise promise) {
public final void csl_bridge_plutusListFromBytes(String bytes, Promise promise) {
Native.I
.csl_bridge_plutusListLen(new RPtr(self))
.map(Utils::boxedLongToDouble)
.csl_bridge_plutusListFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}

@ReactMethod
public final void csl_bridge_plutusListGet(String self, Double index, Promise promise) {
public final void csl_bridge_plutusListToHex(String self, Promise promise) {
Native.I
.csl_bridge_plutusListGet(new RPtr(self), index.longValue())
.map(RPtr::toJs)
.csl_bridge_plutusListToHex(new RPtr(self))
.pour(promise);
}

@ReactMethod
public final void csl_bridge_plutusListAdd(String self, String elem, Promise promise) {
public final void csl_bridge_plutusListFromHex(String hexStr, Promise promise) {
Native.I
.csl_bridge_plutusListAdd(new RPtr(self), new RPtr(elem))
.csl_bridge_plutusListFromHex(hexStr)
.map(RPtr::toJs)
.pour(promise);
}

Expand Down Expand Up @@ -10092,6 +10100,13 @@ public final void csl_bridge_redeemersAdd(String self, String elem, Promise prom
.pour(promise);
}

@ReactMethod
public final void csl_bridge_redeemersGetContainerType(String self, Promise promise) {
Native.I
.csl_bridge_redeemersGetContainerType(new RPtr(self))
.pour(promise);
}

@ReactMethod
public final void csl_bridge_redeemersTotalExUnits(String self, Promise promise) {
Native.I
Expand Down Expand Up @@ -13351,9 +13366,9 @@ public final void csl_bridge_transactionInputsGet(String self, Double index, Pro
}

@ReactMethod
public final void csl_bridge_transactionInputsAdd(String self, String elem, Promise promise) {
public final void csl_bridge_transactionInputsAdd(String self, String input, Promise promise) {
Native.I
.csl_bridge_transactionInputsAdd(new RPtr(self), new RPtr(elem))
.csl_bridge_transactionInputsAdd(new RPtr(self), new RPtr(input))
.pour(promise);
}

Expand Down Expand Up @@ -15392,9 +15407,9 @@ public final void csl_bridge_vkeywitnessesGet(String self, Double index, Promise
}

@ReactMethod
public final void csl_bridge_vkeywitnessesAdd(String self, String elem, Promise promise) {
public final void csl_bridge_vkeywitnessesAdd(String self, String witness, Promise promise) {
Native.I
.csl_bridge_vkeywitnessesAdd(new RPtr(self), new RPtr(elem))
.csl_bridge_vkeywitnessesAdd(new RPtr(self), new RPtr(witness))
.pour(promise);
}

Expand Down Expand Up @@ -16178,6 +16193,21 @@ public final void csl_bridge_votingProposalsAdd(String self, String proposal, Pr
.pour(promise);
}

@ReactMethod
public final void csl_bridge_votingProposalsContains(String self, String elem, Promise promise) {
Native.I
.csl_bridge_votingProposalsContains(new RPtr(self), new RPtr(elem))
.pour(promise);
}

@ReactMethod
public final void csl_bridge_votingProposalsToOption(String self, Promise promise) {
Native.I
.csl_bridge_votingProposalsToOption(new RPtr(self))
.map(RPtr::toJs)
.pour(promise);
}


@ReactMethod
public final void csl_bridge_withdrawalsToBytes(String self, Promise promise) {
Expand Down Expand Up @@ -16443,6 +16473,13 @@ public final void csl_bridge_getImplicitInput(String txbody, String poolDeposit,
.pour(promise);
}

@ReactMethod
public final void csl_bridge_hasTransactionSetTag(String txBytes, Promise promise) {
Native.I
.csl_bridge_hasTransactionSetTag(Base64.decode(txBytes, Base64.DEFAULT))
.pour(promise);
}

@ReactMethod
public final void csl_bridge_hashAuxiliaryData(String auxiliaryData, Promise promise) {
Native.I
Expand Down Expand Up @@ -16476,14 +16513,6 @@ public final void csl_bridge_hashScriptDataWithDatums(String redeemers, String c
}


@ReactMethod
public final void csl_bridge_hashTransaction(String txBody, Promise promise) {
Native.I
.csl_bridge_hashTransaction(new RPtr(txBody))
.map(RPtr::toJs)
.pour(promise);
}

@ReactMethod
public final void csl_bridge_makeDaedalusBootstrapWitness(String txBodyHash, String addr, String key, Promise promise) {
Native.I
Expand Down
24 changes: 14 additions & 10 deletions android/src/main/java/io/emurgo/rnhaskellshelley/Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private Native() { }
public final native Result<RPtr> csl_bridge_bootstrapWitnessesNew();
public final native Result<Long> csl_bridge_bootstrapWitnessesLen(RPtr self);
public final native Result<RPtr> csl_bridge_bootstrapWitnessesGet(RPtr self, long index);
public final native Result<Boolean> csl_bridge_bootstrapWitnessesAdd(RPtr self, RPtr elem);
public final native Result<Boolean> csl_bridge_bootstrapWitnessesAdd(RPtr self, RPtr witness);

public final native Result<String> csl_bridge_byronAddressToBase58(RPtr self);
public final native Result<byte[]> csl_bridge_byronAddressToBytes(RPtr self);
Expand Down Expand Up @@ -413,7 +413,7 @@ private Native() { }
public final native Result<RPtr> csl_bridge_credentialsNew();
public final native Result<Long> csl_bridge_credentialsLen(RPtr self);
public final native Result<RPtr> csl_bridge_credentialsGet(RPtr self, long index);
public final native Result<Boolean> csl_bridge_credentialsAdd(RPtr self, RPtr elem);
public final native Result<Boolean> csl_bridge_credentialsAdd(RPtr self, RPtr credential);

public final native Result<byte[]> csl_bridge_dNSRecordAorAAAAToBytes(RPtr self);
public final native Result<RPtr> csl_bridge_dNSRecordAorAAAAFromBytes(byte[] bytes);
Expand Down Expand Up @@ -543,7 +543,7 @@ private Native() { }
public final native Result<RPtr> csl_bridge_ed25519KeyHashesNew();
public final native Result<Long> csl_bridge_ed25519KeyHashesLen(RPtr self);
public final native Result<RPtr> csl_bridge_ed25519KeyHashesGet(RPtr self, long index);
public final native Result<Boolean> csl_bridge_ed25519KeyHashesAdd(RPtr self, RPtr elem);
public final native Result<Boolean> csl_bridge_ed25519KeyHashesAdd(RPtr self, RPtr keyhash);
public final native Result<Boolean> csl_bridge_ed25519KeyHashesContains(RPtr self, RPtr elem);
public final native Result<RPtr> csl_bridge_ed25519KeyHashesToOption(RPtr self);

Expand Down Expand Up @@ -595,6 +595,7 @@ private Native() { }
public final native Result<RPtr> csl_bridge_fixedTransactionFromHex(String hexStr);
public final native Result<RPtr> csl_bridge_fixedTransactionNew(byte[] rawBody, byte[] rawWitnessSet, boolean isValid);
public final native Result<RPtr> csl_bridge_fixedTransactionNewWithAuxiliary(byte[] rawBody, byte[] rawWitnessSet, byte[] rawAuxiliaryData, boolean isValid);
public final native Result<RPtr> csl_bridge_fixedTransactionNewFromBodyBytes(byte[] rawBody);
public final native Result<RPtr> csl_bridge_fixedTransactionBody(RPtr self);
public final native Result<byte[]> csl_bridge_fixedTransactionRawBody(RPtr self);
public final native Result<Void> csl_bridge_fixedTransactionSetBody(RPtr self, byte[] rawBody);
Expand Down Expand Up @@ -1114,14 +1115,14 @@ private Native() { }
public final native Result<RPtr> csl_bridge_plutusDataFromJson(String json, int schema);
public final native Result<RPtr> csl_bridge_plutusDataFromAddress(RPtr address);

public final native Result<byte[]> csl_bridge_plutusListToBytes(RPtr self);
public final native Result<RPtr> csl_bridge_plutusListFromBytes(byte[] bytes);
public final native Result<String> csl_bridge_plutusListToHex(RPtr self);
public final native Result<RPtr> csl_bridge_plutusListFromHex(String hexStr);
public final native Result<RPtr> csl_bridge_plutusListNew();
public final native Result<Long> csl_bridge_plutusListLen(RPtr self);
public final native Result<RPtr> csl_bridge_plutusListGet(RPtr self, long index);
public final native Result<Void> csl_bridge_plutusListAdd(RPtr self, RPtr elem);
public final native Result<byte[]> csl_bridge_plutusListToBytes(RPtr self);
public final native Result<RPtr> csl_bridge_plutusListFromBytes(byte[] bytes);
public final native Result<String> csl_bridge_plutusListToHex(RPtr self);
public final native Result<RPtr> csl_bridge_plutusListFromHex(String hexStr);

public final native Result<byte[]> csl_bridge_plutusMapToBytes(RPtr self);
public final native Result<RPtr> csl_bridge_plutusMapFromBytes(byte[] bytes);
Expand Down Expand Up @@ -1423,6 +1424,7 @@ private Native() { }
public final native Result<Long> csl_bridge_redeemersLen(RPtr self);
public final native Result<RPtr> csl_bridge_redeemersGet(RPtr self, long index);
public final native Result<Void> csl_bridge_redeemersAdd(RPtr self, RPtr elem);
public final native Result<Integer> csl_bridge_redeemersGetContainerType(RPtr self);
public final native Result<RPtr> csl_bridge_redeemersTotalExUnits(RPtr self);

public final native Result<byte[]> csl_bridge_relayToBytes(RPtr self);
Expand Down Expand Up @@ -1882,7 +1884,7 @@ private Native() { }
public final native Result<RPtr> csl_bridge_transactionInputsNew();
public final native Result<Long> csl_bridge_transactionInputsLen(RPtr self);
public final native Result<RPtr> csl_bridge_transactionInputsGet(RPtr self, long index);
public final native Result<Boolean> csl_bridge_transactionInputsAdd(RPtr self, RPtr elem);
public final native Result<Boolean> csl_bridge_transactionInputsAdd(RPtr self, RPtr input);
public final native Result<RPtr> csl_bridge_transactionInputsToOption(RPtr self);

public final native Result<byte[]> csl_bridge_transactionMetadatumToBytes(RPtr self);
Expand Down Expand Up @@ -2170,7 +2172,7 @@ private Native() { }
public final native Result<RPtr> csl_bridge_vkeywitnessesNew();
public final native Result<Long> csl_bridge_vkeywitnessesLen(RPtr self);
public final native Result<RPtr> csl_bridge_vkeywitnessesGet(RPtr self, long index);
public final native Result<Boolean> csl_bridge_vkeywitnessesAdd(RPtr self, RPtr elem);
public final native Result<Boolean> csl_bridge_vkeywitnessesAdd(RPtr self, RPtr witness);

public final native Result<byte[]> csl_bridge_voteDelegationToBytes(RPtr self);
public final native Result<RPtr> csl_bridge_voteDelegationFromBytes(byte[] bytes);
Expand Down Expand Up @@ -2281,6 +2283,8 @@ private Native() { }
public final native Result<Long> csl_bridge_votingProposalsLen(RPtr self);
public final native Result<RPtr> csl_bridge_votingProposalsGet(RPtr self, long index);
public final native Result<Boolean> csl_bridge_votingProposalsAdd(RPtr self, RPtr proposal);
public final native Result<Boolean> csl_bridge_votingProposalsContains(RPtr self, RPtr elem);
public final native Result<RPtr> csl_bridge_votingProposalsToOption(RPtr self);

public final native Result<byte[]> csl_bridge_withdrawalsToBytes(RPtr self);
public final native Result<RPtr> csl_bridge_withdrawalsFromBytes(byte[] bytes);
Expand Down Expand Up @@ -2318,12 +2322,12 @@ private Native() { }
public final native Result<String> csl_bridge_encryptWithPassword(String password, String salt, String nonce, String data);
public final native Result<RPtr> csl_bridge_getDeposit(RPtr txbody, RPtr poolDeposit, RPtr keyDeposit);
public final native Result<RPtr> csl_bridge_getImplicitInput(RPtr txbody, RPtr poolDeposit, RPtr keyDeposit);
public final native Result<Integer> csl_bridge_hasTransactionSetTag(byte[] txBytes);
public final native Result<RPtr> csl_bridge_hashAuxiliaryData(RPtr auxiliaryData);
public final native Result<RPtr> csl_bridge_hashPlutusData(RPtr plutusData);
public final native Result<RPtr> csl_bridge_hashScriptData(RPtr redeemers, RPtr costModels);
public final native Result<RPtr> csl_bridge_hashScriptDataWithDatums(RPtr redeemers, RPtr costModels, RPtr datums);

public final native Result<RPtr> csl_bridge_hashTransaction(RPtr txBody);
public final native Result<RPtr> csl_bridge_makeDaedalusBootstrapWitness(RPtr txBodyHash, RPtr addr, RPtr key);
public final native Result<RPtr> csl_bridge_makeIcarusBootstrapWitness(RPtr txBodyHash, RPtr addr, RPtr key);
public final native Result<RPtr> csl_bridge_makeVkeyWitness(RPtr txBodyHash, RPtr sk);
Expand Down
Loading

0 comments on commit c4079d8

Please sign in to comment.