Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dev-sdk-webpack/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
1 change: 1 addition & 0 deletions dev-sdk-webpack/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
33 changes: 33 additions & 0 deletions dev-sdk-webpack/MetisSDK.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dev-sdk-webpack/dist/_version.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const version = "nuvo-sdk/1.31.1";
4 changes: 4 additions & 0 deletions dev-sdk-webpack/dist/_version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "nuvo-sdk/1.31.1";
14 changes: 14 additions & 0 deletions dev-sdk-webpack/dist/endpoints.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
declare class Endpoints {
wsServer: string;
confirmUrl: string;
apiHost: string;
authHost: string;
oauthRedirectUrl: string;
constructor(host?: string);
getWsServer(): string;
getConfirmUrl(): string;
getBridgeUrl(): string;
getApiHost(): string;
getOauthRedirectUrl(): string;
}
export default Endpoints;
31 changes: 31 additions & 0 deletions dev-sdk-webpack/dist/endpoints.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class Endpoints {
constructor(host = "https://api.nuvosphere.io/") {
this.wsServer = 'wss://polis.metis.io/wss/mts-l2';
this.confirmUrl = '#/oauth2/confirm';
this.apiHost = 'https://api.nuvosphere.io/';
this.authHost = this.apiHost.replace("//api.", "//auth.");
this.oauthRedirectUrl = '#/oauth2-login?';
if (!host.endsWith('/')) {
host = host + '/';
}
this.apiHost = host;
}
getWsServer() {
return this.apiHost.replace("https", "wss").replace("http", "wss") + this.wsServer;
}
getConfirmUrl() {
return this.authHost + this.confirmUrl;
}
getBridgeUrl() {
return this.authHost + "#/oauth2/bridge";
}
getApiHost() {
return this.apiHost;
}
getOauthRedirectUrl() {
return this.authHost + this.oauthRedirectUrl;
}
}
exports.default = Endpoints;
2 changes: 2 additions & 0 deletions dev-sdk-webpack/dist/error.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const errData: any;
export default errData;
9 changes: 9 additions & 0 deletions dev-sdk-webpack/dist/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const errData = {
'MM_ERROR': 100000,
'MM_SWITCH_CHAIN_CANCEL': 100001,
'MM_ACCOUNT_NOT_MATCH': 100002,
'MM_ACCOUNT_LOGOUT_ERROR': 100003,
};
exports.default = errData;
49 changes: 49 additions & 0 deletions dev-sdk-webpack/dist/http-client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { IHttpClient } from './interfaces';
import { Oauth2Client } from './oauth2-client';
import endpoints from './endpoints';
import Swal from 'sweetalert2';
export declare class HttpClient implements IHttpClient {
appId: string;
accessToken: string;
refreshToken: string;
endpoints: endpoints;
apiHost: string;
confirmUrl: string;
bridgeUrl: string;
oAuth2Client: Oauth2Client;
swalPromise: any;
env: string;
txStatus: string;
loadingDialog: typeof Swal;
bridgeMetaMask: boolean;
constructor(appId: string, accessToken: string, refreshToken: string, expiresIn: number, apiHost?: string, bridgeMetaMask?: boolean);
handleRefreshToken(callback?: Function): void;
getBalance(chainId: number, address?: string): Promise<any>;
getLogsAsync(data: any): Promise<any>;
getTxLogsAsync(data: any): Promise<any>;
post(method: string, data: any, disableTooltip?: boolean, httpMethod?: string, returnObj?: boolean): Promise<any>;
handleRefreshTokenAsync(): Promise<any>;
sendTx(domain: string, chainId: number, fun: string, args?: any[], succCallback?: Function, errCallback?: Function, extendParams?: any, disableTooltip?: boolean): any;
estimateGasAsync(domain: string, chainId: number, fun: string, args?: any[], disableTooltip?: boolean, extendParams?: any): Promise<any>;
sendTxAsync(domain: string, chainId: number, func: string, args?: any[], disableTooltip?: boolean, extendParams?: any): Promise<any>;
private polisBridgePage;
beforeConfirm(data: any): Promise<any>;
queryTx(chainId: number, tx: string, succCallback?: Function, errCallback?: Function, extendParams?: any, disableTooltip?: boolean): void;
queryTxAsync(chainId: number, tx: string, disableTooltip?: boolean): Promise<any>;
closeConfirmDialog(): void;
getChainUrl(chainId: string): Promise<any>;
addTokenToMM(token: any, tokenAddress?: string, tokenDecimals?: number, tokenImage?: string, chainId?: number): Promise<any>;
getDomain(name: string, chainId: string): Promise<any>;
createDomain(param: any, disableTooltip?: boolean): Promise<any>;
saveDomainChains(param: any, disableTooltip?: boolean): Promise<any>;
delDomain(domain: string, disableTooltip?: boolean): Promise<any>;
providerCall(param: any): Promise<any>;
createDapp(param: any, disableTooltip?: boolean): Promise<any>;
modifyDapp(param: any, disableTooltip?: boolean): Promise<any>;
deleteDapps(param: any, disableTooltip?: boolean): Promise<any>;
getDappList(pageSize: number, pageIndex: number): Promise<any>;
getDapp(dappId: string): Promise<any>;
applyToDeveloper(): Promise<any>;
showLoading(): void;
closeLoading(): void;
}
Loading