-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5838 from leather-io/release/chivalrous-pigeon
release: chivalrous-pigeon
- Loading branch information
Showing
18 changed files
with
165 additions
and
81 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,30 +1,21 @@ | ||
import { RpcErrorCode } from '@btckit/types'; | ||
|
||
import { RouteUrls } from '@shared/route-urls'; | ||
import { OpenRequest } from '@shared/rpc/methods/open'; | ||
import { makeRpcErrorResponse } from '@shared/rpc/rpc-methods'; | ||
import { makeRpcSuccessResponse } from '@shared/rpc/rpc-methods'; | ||
|
||
import { | ||
listenForPopupClose, | ||
makeSearchParamsWithDefaults, | ||
triggerRequestWindowOpen, | ||
} from '../messaging-utils'; | ||
import { makeSearchParamsWithDefaults, triggerRequestWindowOpen } from '../messaging-utils'; | ||
import { trackRpcRequestSuccess } from '../rpc-message-handler'; | ||
|
||
export async function rpcOpen(message: OpenRequest, port: chrome.runtime.Port) { | ||
const { urlParams, tabId } = makeSearchParamsWithDefaults(port, [['requestId', message.id]]); | ||
const { id } = await triggerRequestWindowOpen(RouteUrls.Home, urlParams); | ||
|
||
await triggerRequestWindowOpen(RouteUrls.Home, urlParams); | ||
void trackRpcRequestSuccess({ endpoint: message.method }); | ||
|
||
listenForPopupClose({ | ||
chrome.tabs.sendMessage( | ||
tabId, | ||
id, | ||
response: makeRpcErrorResponse('open', { | ||
makeRpcSuccessResponse('open', { | ||
id: message.id, | ||
error: { | ||
code: RpcErrorCode.USER_REJECTION, | ||
message: 'User rejected request to open wallet', | ||
}, | ||
}), | ||
}); | ||
result: { message: 'Success' }, | ||
}) | ||
); | ||
} |
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 |
---|---|---|
@@ -1,14 +1,7 @@ | ||
import { DefineRpcMethod, RpcRequest, RpcResponse } from '@btckit/types'; | ||
import * as yup from 'yup'; | ||
|
||
const rpcOpenParamsSchema = yup.object().shape({ | ||
url: yup.string(), | ||
}); | ||
export type OpenRequest = RpcRequest<'open'>; | ||
|
||
type OpenRequestParams = yup.InferType<typeof rpcOpenParamsSchema>; | ||
|
||
export type OpenRequest = RpcRequest<'open', OpenRequestParams>; | ||
|
||
type OpenResponse = RpcResponse<Response>; | ||
type OpenResponse = RpcResponse<{ message: string }>; | ||
|
||
export type Open = DefineRpcMethod<OpenRequest, OpenResponse>; |
Oops, something went wrong.