UnityTransport

class AnchorLinkTransportSharp::Src::UnityTransport
  : public MonoBehaviour
  : public ILinkTransport

Summary

MembersDescriptions

The Storage used for sessions and metadata.

public UnityTransport(TransportOptions options)

public void OnRequest(SigningRequest request, Action< object > cancel)

public void OnSessionRequest( LinkSession session, SigningRequest request, Action< object > cancel)

public async Task< SigningRequest > Prepare(SigningRequest request, LinkSession session)

public void CopyToClipboard(string targetString)

Puts the passed string into the clipboard buffer to be pasted elsewhere.

public Texture2D StringToQRCodeTexture2D(string textForEncoding, int textureWidth, int textureHeight, Color32 baseColor, Color32 pixelColor)

Call this to generate a QR code based on the parameters passed.

public abstract void ShowLoading()

Method is invoked when a request is made and user signing on the wallet is required.

public abstract void OnSuccess(SigningRequest request, TransactResult result)

Method is invoked when a succesful signing request is completed.

public abstract void OnFailure(SigningRequest request, Exception exception)

Method is invoked when a signing request fails or is cancelled.

public abstract void DisplayRequest(SigningRequest request)

Method is invoked when a request to sign or login is made and the QR code and link are generated and displayed.

private readonly bool _requestStatus

The Status of the current Request.

private SigningRequest _activeRequest

The current active Request.

private Action< object > _activeCancel

The activeCancel Delegate (invoked when a Request is cancelled)

private Color32[] StringEncoder(string textForEncoding, int width, int height)

Members

public ILinkStorage Storage

The Storage used for sessions and metadata.

public UnityTransport(TransportOptions options)

public void OnRequest(SigningRequest request, Action< object > cancel)

public void OnSessionRequest( LinkSession session, SigningRequest request, Action< object > cancel)

public async Task< SigningRequest > Prepare(SigningRequest request, LinkSession session)

public void CopyToClipboard(string targetString)

Puts the passed string into the clipboard buffer to be pasted elsewhere.

Parameters

  • targetString Text to be copied to the buffer

public Texture2D StringToQRCodeTexture2D(string textForEncoding, int textureWidth, int textureHeight, Color32 baseColor, Color32 pixelColor)

Call this to generate a QR code based on the parameters passed.

Parameters

  • textForEncoding The actual texture that will be encoded into a QRCode

  • textureWidth How wide the new texture should be

  • textureHeight How high the new texture should be

Returns

public abstract void ShowLoading()

Method is invoked when a request is made and user signing on the wallet is required.

public abstract void OnSuccess(SigningRequest request, TransactResult result)

Method is invoked when a succesful signing request is completed.

Parameters

  • request

  • result

public abstract void OnFailure(SigningRequest request, Exception exception)

Method is invoked when a signing request fails or is cancelled.

Parameters

  • request

  • exception

public abstract void DisplayRequest(SigningRequest request)

Method is invoked when a request to sign or login is made and the QR code and link are generated and displayed.

Parameters

  • request

private readonly bool _requestStatus

The Status of the current Request.

private SigningRequest _activeRequest

The current active Request.

private Action< object > _activeCancel

The activeCancel Delegate (invoked when a Request is cancelled)

private Color32[] StringEncoder(string textForEncoding, int width, int height)

Last updated