-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/hide-balance
- Loading branch information
Showing
8 changed files
with
385 additions
and
46 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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@leather.io/extension", | ||
"description": "Leather is a browser extension for interacting with Stacks apps", | ||
"private": true, | ||
"version": "6.46.0", | ||
"version": "6.47.0", | ||
"packageManager": "[email protected]", | ||
"author": { | ||
"name": "Leather Wallet LLC" | ||
|
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
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,30 @@ | ||
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 { | ||
listenForPopupClose, | ||
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); | ||
void trackRpcRequestSuccess({ endpoint: message.method }); | ||
|
||
listenForPopupClose({ | ||
tabId, | ||
id, | ||
response: makeRpcErrorResponse('open', { | ||
id: message.id, | ||
error: { | ||
code: RpcErrorCode.USER_REJECTION, | ||
message: 'User rejected request to open wallet', | ||
}, | ||
}), | ||
}); | ||
} |
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,14 @@ | ||
import { DefineRpcMethod, RpcRequest, RpcResponse } from '@btckit/types'; | ||
import * as yup from 'yup'; | ||
|
||
const rpcOpenParamsSchema = yup.object().shape({ | ||
url: yup.string(), | ||
}); | ||
|
||
type OpenRequestParams = yup.InferType<typeof rpcOpenParamsSchema>; | ||
|
||
export type OpenRequest = RpcRequest<'open', OpenRequestParams>; | ||
|
||
type OpenResponse = RpcResponse<Response>; | ||
|
||
export type Open = DefineRpcMethod<OpenRequest, OpenResponse>; |
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