@sovrano-io/auth-sdk
Version:
Sovrano wallet auth sdk for koinos dapps
69 lines (68 loc) • 1.71 kB
TypeScript
import { TransactionJson } from "koilib";
/**
* Represents the request to the Broadcast
*/
export type BroadcastRequest = {
/** The transaction that needs to be broadcasted */
transactionJson: TransactionJson;
/** The URL to redirect to after broadcast */
redirectUrl: string;
};
/**
* Represents the response from the Broadcast request
*/
export type BroadcastResponse = {
/** Indicates a successful broadcast */
type: "success";
} | {
/** Indicates an error during broadcast */
type: "error";
/** The error code */
errorCode: number;
/** The error message */
errorMessage: string;
};
export declare class Broadcast {
/**
* Get the URL to redirect to for broadcast
* @param data
* @returns
*/
static getRequestUrl(data: BroadcastRequest): string;
/**
* Get the URL to redirect to after broadcast
*
* @param data
* @param url
* @returns
*/
static getResponseUrl(data: BroadcastResponse, url: string): string;
/**
* Encode the request data
* @param data
* @returns
*/
static encodeRequest(data: BroadcastRequest): string;
/**
* Decode the request data
* @param data
* @returns
*/
static decodeRequest(data: string): BroadcastRequest;
/**
* Encode the response data
* @returns
*/
static encodeResponse(data: BroadcastResponse): string;
/**
* Decode the response data
* @param data
* @returns
*/
static decodeResponse(data: string): BroadcastResponse;
/**
* Get the response data from the URL
* @returns
*/
static getResponse(responseUrl: string): BroadcastResponse;
}