@nimiq/rpc
Advanced tools
Comparing version 0.1.2 to 0.1.4
@@ -667,3 +667,3 @@ 'use strict'; | ||
} | ||
toRequestUrl(baseUrl = '') { | ||
toRequestUrl(baseUrl) { | ||
return UrlRpcEncoder.prepareRedirectInvocation(baseUrl, this.id, this.returnURL || POSTMESSAGE_RETURN_URL, this.data.command, this.data.args); | ||
@@ -670,0 +670,0 @@ } |
@@ -664,3 +664,3 @@ class RandomUtils { | ||
} | ||
toRequestUrl(baseUrl = '') { | ||
toRequestUrl(baseUrl) { | ||
return UrlRpcEncoder.prepareRedirectInvocation(baseUrl, this.id, this.returnURL || POSTMESSAGE_RETURN_URL, this.data.command, this.data.args); | ||
@@ -667,0 +667,0 @@ } |
@@ -669,3 +669,3 @@ (function (global, factory) { | ||
} | ||
toRequestUrl(baseUrl = '') { | ||
toRequestUrl(baseUrl) { | ||
return UrlRpcEncoder.prepareRedirectInvocation(baseUrl, this.id, this.returnURL || POSTMESSAGE_RETURN_URL, this.data.command, this.data.args); | ||
@@ -672,0 +672,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { ObjectType } from './ObjectType'; | ||
export declare class RequestIdStorage { | ||
@@ -12,4 +13,4 @@ static readonly KEY: string; | ||
getCommand(id: number | string): string | null; | ||
getState(id: number | string): string | null; | ||
add(id: number, command: string, state?: string | null): void; | ||
getState(id: number | string): ObjectType | null; | ||
add(id: number, command: string, state?: ObjectType | null): void; | ||
remove(id: number | string): void; | ||
@@ -16,0 +17,0 @@ clear(): void; |
import { ResponseMessage } from './Messages'; | ||
import { RequestIdStorage } from './RequestIdStorage'; | ||
import { ObjectType } from './ObjectType'; | ||
export interface ResponseHandler { | ||
resolve: (result: any, id?: number, state?: string | null) => any; | ||
reject: (error: any, id?: number, state?: string | null) => any; | ||
resolve: (result: any, id?: number, state?: ObjectType | null) => any; | ||
reject: (error: any, id?: number, state?: ObjectType | null) => any; | ||
} | ||
@@ -13,3 +14,3 @@ export declare abstract class RpcClient { | ||
protected constructor(allowedOrigin: string, storeState?: boolean); | ||
onResponse(command: string, resolve: (result: any, id?: number, state?: string | null) => any, reject: (error: any, id?: number, state?: string | null) => any): void; | ||
onResponse(command: string, resolve: (result: any, id?: number, state?: ObjectType | null) => any, reject: (error: any, id?: number, state?: ObjectType | null) => any): void; | ||
abstract init(): Promise<void>; | ||
@@ -50,4 +51,4 @@ abstract close(): void; | ||
call(returnURL: string, command: string, ...args: any[]): void; | ||
callAndSaveLocalState(returnURL: string, state: string | null, command: string, ...args: any[]): void; | ||
callAndSaveLocalState(returnURL: string, state: ObjectType | null, command: string, ...args: any[]): void; | ||
private _rejectOnBack; | ||
} |
@@ -24,3 +24,3 @@ import { PostMessage, RedirectRequest, ResponseStatus } from './Messages'; | ||
reply(status: ResponseStatus, result: any): void; | ||
toRequestUrl(baseUrl?: string): string; | ||
toRequestUrl(baseUrl: string): string; | ||
} |
{ | ||
"name": "@nimiq/rpc", | ||
"version": "0.1.2", | ||
"version": "0.1.4", | ||
"description": "RPC Client/Server", | ||
@@ -5,0 +5,0 @@ "repository": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
106493
18
2424
0