@@ -83,6 +83,8 @@ public static void main(String[] args) {
8383 receivers .add ("105f6e8b-d249-4b4d-9beb-e03cefaebc37" );
8484 transactions (client , receivers , pinToken , pin );
8585
86+ transactionsOpponentKey (client , "XINQTmRReDuPEUAVEyDyE2mBgxa1ojVRAvpYcKs5nSA7FDBBfAEeVRn8s9vAm3Cn1qzQ7JtjG62go4jSJU6yWyRUKHpamWAM" , pinToken , pin );
87+
8688 networkSnapshot (client , "c8e73a02-b543-4100-bd7a-879ed4accdfc" );
8789 networkSnapshots (client , CNB_assetId );
8890 } catch (InterruptedException | IOException e ) {
@@ -245,7 +247,10 @@ private static SessionToken getUserToken(User user, KeyPair sessionKey, boolean
245247
246248 private static void transactions (HttpClient client , List <String > receivers , String aseKey , String pin ) throws IOException {
247249 MixinResponse <TransactionResponse > transactionResponse = client .getAssetService ().transactionsCall (
248- new TransactionRequest (Sample .CNB_assetId , null ,"XINQTmRReDuPEUAVEyDyE2mBgxa1ojVRAvpYcKs5nSA7FDBBfAEeVRn8s9vAm3Cn1qzQ7JtjG62go4jSJU6yWyRUKHpamWAM" , Sample .amount , encryptPin (aseKey , pin , System .nanoTime ())
250+ new TransactionRequest (Sample .CNB_assetId , new OpponentMultisig (
251+ receivers ,
252+ 2
253+ ), null , Sample .amount , encryptPin (aseKey , pin , System .nanoTime ())
249254 , null , null )).execute ().body ();
250255 assert transactionResponse != null ;
251256 if (transactionResponse .isSuccess ()) {
@@ -255,6 +260,19 @@ private static void transactions(HttpClient client, List<String> receivers, Stri
255260 }
256261 }
257262
263+ private static void transactionsOpponentKey (HttpClient client , String opponentKey , String aseKey , String pin ) throws IOException {
264+ MixinResponse <TransactionResponse > transactionResponse = client .getAssetService ().transactionsCall (
265+ new TransactionRequest (Sample .CNB_assetId , null , opponentKey , Sample .amount , encryptPin (aseKey , pin , System .nanoTime ())
266+ , null , null )).execute ().body ();
267+ assert transactionResponse != null ;
268+ if (transactionResponse .isSuccess ()) {
269+ System .out .printf ("TransactionsResponse success: %s%n" , Objects .requireNonNull (transactionResponse .getData ()).getTransactionHash ());
270+ } else {
271+ System .out .printf ("Transactions fail: %s" , Objects .requireNonNull (transactionResponse .getError ()).getDescription ());
272+ }
273+ }
274+
275+
258276 private static void networkSnapshot (HttpClient client , String snapshotId ) throws IOException {
259277 MixinResponse <NetworkSnapshot > snapshotResponse = client .getSnapshotService ().networkSnapshotCall (snapshotId ).execute ().body ();
260278 assert snapshotResponse != null ;
0 commit comments