-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3003c36
commit e1a26c6
Showing
28 changed files
with
1,330 additions
and
836 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
meta.txt | ||
meta.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ dev-server.mjs | |
esbuild.config.cjs | ||
tsconfig.json | ||
meta.txt | ||
meta.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Used for xPortal Hub integration | ||
*/ | ||
export declare function loginWithNativeAuthToken(token: string, elven: any): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Required for xPortal Hub integration | ||
* Based on sdk-dapp webview provider implementation | ||
* It will probably be replaced with separate library in the future | ||
*/ | ||
export declare function isStringBase64(str: string): boolean; | ||
export declare function encodeToBase64(string: string): string; | ||
export declare function decodeBase64(string: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Required for xPortal Hub integration | ||
* Based on sdk-dapp webview provider implementation | ||
* It will probably be replaced with separate library in the future | ||
*/ | ||
export interface DecodedLoginTokenType { | ||
blockHash: string; | ||
extraInfo?: { | ||
timestamp: number; | ||
}; | ||
origin: string; | ||
ttl: number; | ||
} | ||
export declare const decodeLoginToken: (loginToken: string) => DecodedLoginTokenType | null; |
13 changes: 13 additions & 0 deletions
13
build/types/webview-provider/decode-native-auth-token.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Required for xPortal Hub integration | ||
* Based on sdk-dapp webview provider implementation | ||
* It will probably be replaced with separate library in the future | ||
*/ | ||
import { DecodedLoginTokenType } from './decode-login-token'; | ||
interface DecodedNativeAuthTokenType extends DecodedLoginTokenType { | ||
address: string; | ||
body: string; | ||
signature: string; | ||
} | ||
export declare const decodeNativeAuthToken: (accessToken?: string) => DecodedNativeAuthTokenType | null; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Required for xPortal Hub integration | ||
* Based on sdk-dapp webview provider implementation | ||
* It will probably be replaced with separate library in the future | ||
*/ | ||
export type CustomRequestPayloadType = { | ||
request: { | ||
method: string; | ||
params: any; | ||
}; | ||
}; | ||
export declare const requestMethods: { | ||
signTransactions: { | ||
ios: (transactions: any) => any; | ||
reactNative: (message: any) => any; | ||
web: (message: any) => any; | ||
}; | ||
signMessage: { | ||
ios: (message: string) => any; | ||
reactNative: (message: any) => any; | ||
web: (message: any) => any; | ||
}; | ||
logout: { | ||
ios: () => any; | ||
reactNative: () => any; | ||
web: () => any; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Required for xPortal Hub integration | ||
* Based on sdk-dapp webview provider implementation | ||
* It will probably be replaced with separate library in the future | ||
*/ | ||
export declare enum PlatformsEnum { | ||
ios = "ios", | ||
reactNative = "reactNative", | ||
web = "web", | ||
webWallet = "webWallet" | ||
} | ||
export declare enum WebViewProviderResponseBaseEnums { | ||
reloginResponse = "RELOGIN_RESPONSE" | ||
} | ||
declare enum CrossWindowProviderResponseEnums { | ||
handshakeResponse = "HANDSHAKE_RESPONSE", | ||
loginResponse = "LOGIN_RESPONSE", | ||
disconnectResponse = "DISCONNECT_RESPONSE", | ||
cancelResponse = "CANCEL_RESPONSE", | ||
signTransactionsResponse = "SIGN_TRANSACTIONS_RESPONSE", | ||
signMessageResponse = "SIGN_MESSAGE_RESPONSE", | ||
noneResponse = "NONE_RESPONSE" | ||
} | ||
export declare const WebViewProviderResponseEnums: { | ||
reloginResponse: WebViewProviderResponseBaseEnums.reloginResponse; | ||
handshakeResponse: CrossWindowProviderResponseEnums.handshakeResponse; | ||
loginResponse: CrossWindowProviderResponseEnums.loginResponse; | ||
disconnectResponse: CrossWindowProviderResponseEnums.disconnectResponse; | ||
cancelResponse: CrossWindowProviderResponseEnums.cancelResponse; | ||
signTransactionsResponse: CrossWindowProviderResponseEnums.signTransactionsResponse; | ||
signMessageResponse: CrossWindowProviderResponseEnums.signMessageResponse; | ||
noneResponse: CrossWindowProviderResponseEnums.noneResponse; | ||
}; | ||
export declare enum WebViewProviderRequestBaseEnums { | ||
signTransactionsWithGuardianResponse = "SIGN_TRANSACTIONS_WITH_GUARDIAN_RESPONSE", | ||
reloginRequest = "RELOGIN_REQUEST" | ||
} | ||
declare enum CrossWindowProviderRequestEnums { | ||
signTransactionsRequest = "SIGN_TRANSACTIONS_REQUEST", | ||
signMessageRequest = "SIGN_MESSAGE_REQUEST", | ||
loginRequest = "LOGIN_REQUEST", | ||
logoutRequest = "LOGOUT_REQUEST", | ||
cancelAction = "CANCEL_ACTION_REQUEST", | ||
finalizeHandshakeRequest = "FINALIZE_HANDSHAKE_REQUEST" | ||
} | ||
export declare const WebViewProviderRequestEnums: { | ||
signTransactionsWithGuardianResponse: WebViewProviderRequestBaseEnums.signTransactionsWithGuardianResponse; | ||
reloginRequest: WebViewProviderRequestBaseEnums.reloginRequest; | ||
signTransactionsRequest: CrossWindowProviderRequestEnums.signTransactionsRequest; | ||
signMessageRequest: CrossWindowProviderRequestEnums.signMessageRequest; | ||
loginRequest: CrossWindowProviderRequestEnums.loginRequest; | ||
logoutRequest: CrossWindowProviderRequestEnums.logoutRequest; | ||
cancelAction: CrossWindowProviderRequestEnums.cancelAction; | ||
finalizeHandshakeRequest: CrossWindowProviderRequestEnums.finalizeHandshakeRequest; | ||
}; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Required for xPortal Hub integration | ||
* Based on sdk-dapp webview provider implementation | ||
* It will probably be replaced with separate library in the future | ||
*/ | ||
import { PlatformsEnum } from './types'; | ||
export declare const detectCurrentPlatform: () => PlatformsEnum.ios | PlatformsEnum.reactNative | PlatformsEnum.web; | ||
export declare const getTargetOrigin: () => string; | ||
export declare const isString: (x: any) => boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Required for xPortal Hub integration | ||
* Based on sdk-dapp webview provider implementation | ||
* It will probably be replaced with separate library in the future | ||
*/ | ||
import { Transaction } from '@multiversx/sdk-core'; | ||
export declare class WebviewProvider { | ||
constructor(); | ||
logout(): Promise<unknown>; | ||
signMessage(message: string): Promise<string>; | ||
signTransactions(transactions: Transaction[]): Promise<Transaction[]>; | ||
signTransaction(transaction: Transaction): Promise<Transaction>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.