Skip to content

Commit

Permalink
Feat: enable signAllTransactions for Ingame & External walllets (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
owais-star authored Oct 29, 2024
1 parent 90edc61 commit 92491f6
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 421 deletions.
71 changes: 0 additions & 71 deletions Runtime/Plugins/Phantom.jslib

This file was deleted.

86 changes: 0 additions & 86 deletions Runtime/Plugins/Phantom.jslib.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ mergeInto(LibraryManager.library, {
var serializedSignedTransactions = [];
for (var i = 0; i < signedTransactions.length; i++) {
var signedTransaction = signedTransactions[i];
var txStr = signedTransaction.serialize().toString("base64");
var txStr = Buffer.from(signedTransaction.serialize()).toString("base64");
serializedSignedTransactions.push(txStr);
}
var txsStr = serializedSignedTransactions.join(",");
Expand Down
122 changes: 0 additions & 122 deletions Runtime/codebase/DeepLinkWallets/PhantomWebGL.cs

This file was deleted.

3 changes: 0 additions & 3 deletions Runtime/codebase/DeepLinkWallets/PhantomWebGL.cs.meta

This file was deleted.

53 changes: 53 additions & 0 deletions Runtime/codebase/DeepLinkWallets/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,57 @@ public class PhantomWalletMessageSignedSuccessfully
{
public string signature;
}

[Serializable]
public class PhantomWalletOptions
{
[SerializeField]
private string apiVersion = "v1";
public virtual string ApiVersion
{
get => apiVersion;
set => apiVersion = value;
}

[SerializeField]
private string appMetaDataUrl = "https://github.com/magicblock-labs/Solana.Unity-SDK";
public virtual string AppMetaDataUrl
{
get => appMetaDataUrl;
set => appMetaDataUrl = value;
}

[SerializeField]
private string deeplinkUrlScheme = "unitydl";
public virtual string DeeplinkUrlScheme
{
get => deeplinkUrlScheme;
set => deeplinkUrlScheme = value;
}

[SerializeField]
private string sessionEncryptionPassword = "use a strong password";
public virtual string SessionEncryptionPassword
{
get => sessionEncryptionPassword;
set => sessionEncryptionPassword = value;
}

[SerializeField]
private string baseUrl = "https://phantom.app";
public virtual string BaseUrl
{
get => baseUrl;
set => baseUrl = value;
}

[SerializeField]
private string walletName = "phantom";
public virtual string WalletName
{
get => walletName;
set => walletName = value;
}
}

}
6 changes: 5 additions & 1 deletion Runtime/codebase/InGameWallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ protected override Task<Transaction> _SignTransaction(Transaction transaction)

protected override Task<Transaction[]> _SignAllTransactions(Transaction[] transactions)
{
throw new NotImplementedException();
foreach (Transaction transaction in transactions)
{
transaction.PartialSign(Account);
}
return Task.FromResult(transactions);
}

public override Task<byte[]> SignMessage(byte[] message)
Expand Down
Loading

0 comments on commit 92491f6

Please sign in to comment.