Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring integration #3720

Open
wants to merge 56 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
944d2e2
fix: EOL bug
kalfada Sep 3, 2024
6bc3d45
feat: add cashback tab and page
kalfada Sep 11, 2024
12a9f9a
Merge branch 'develop' into integration
kalfada Sep 11, 2024
0b9e6f9
Merge pull request #4 from Bring-Web3-LTD/integration
kalfada Sep 11, 2024
5a2feaa
bundle and inject code for bring
yushih Sep 12, 2024
0a29c0f
fix: change cashback page to use function component
kalfada Sep 18, 2024
05488ba
fix: add not added files
kalfada Sep 18, 2024
5812794
Merge branch 'develop' into feat/bundle-and-inject-bring
yushih Sep 23, 2024
0207012
move Bring code into a content script
yushih Sep 23, 2024
754b8fd
add example for calling chrome.runtime.onMessage
yushih Sep 23, 2024
d4493f2
fix webpack
yushih Sep 23, 2024
e988a0e
Bring content script gets addresses
yushih Sep 23, 2024
c29e5c0
get theme
yushih Sep 24, 2024
5cda0cf
bug fix
yushih Sep 24, 2024
6b511a0
Binds a wallet to bring
yushih Sep 24, 2024
370d8cd
Revert "Binds a wallet to bring"
yushih Sep 24, 2024
2c6d422
fix get address for new wallet
yushih Sep 24, 2024
510449c
add events for active wallet
yushih Sep 25, 2024
64012ff
pop up Yoroi extension if no wallet
yushih Sep 25, 2024
b83688c
get address function returns address in Bech32
yushih Sep 30, 2024
c9e910c
fix: iframeUrl source
kalfada Oct 6, 2024
d05d8de
fix: iframeUrl source
kalfada Oct 7, 2024
93baceb
fix: remove unused config
kalfada Oct 7, 2024
4530486
fix: change event names
kalfada Oct 8, 2024
3395dcc
only fire active-wallet-open event when active wallet changes
yushih Oct 8, 2024
5928827
feat: bringweb3 popup
kalfada Oct 10, 2024
d64b181
fix: change env to sandbox
kalfada Oct 10, 2024
b93140f
Merge branch 'portal-and-popup' into cashback-integration
kalfada Oct 16, 2024
60cc393
Merge pull request #5 from Bring-Web3-LTD/cashback-integration
kalfada Oct 16, 2024
6ddab67
fix: configure sandbox and prod for bringweb3
kalfada Oct 16, 2024
b817054
remove .d.ts files
yushih Oct 30, 2024
3c0a4df
Merge branch 'bring/portal-and-popup' into bring-integration
yushih Oct 30, 2024
3305974
mv3 Bring integration support
yushih Oct 30, 2024
fe7fd04
fire active-wallet-open event after the first wallet is created
yushih Oct 14, 2024
64f4e53
flow fix
yushih Oct 30, 2024
9e7ea12
revert translation file changes
yushih Oct 30, 2024
5e80da9
add frame-src and connect-src for Bring
yushih Oct 30, 2024
40bf7c7
fix flow
yushih Oct 30, 2024
ac4581e
hardware wallet cashback support
yushih Oct 30, 2024
cb46cbe
handling cashback submission errors
yushih Oct 31, 2024
f50fa93
indent code
yushih Oct 31, 2024
25265e0
i18n
yushih Oct 31, 2024
f63a452
style: change cashback icon
kalfada Oct 31, 2024
6d0cf10
Merge pull request #3722 from Bring-Web3-LTD/bring-integration
yushih Oct 31, 2024
9a6b807
stylize error text
yushih Oct 31, 2024
3f6f276
use wildcard in frame-src and connect-src to allow both Bring product…
yushih Oct 31, 2024
e538d97
sign message hash
yushih Oct 31, 2024
d0b63da
fix for Ledger wallet
yushih Nov 4, 2024
c3c3864
fix for Ledger wallet
yushih Nov 4, 2024
7297cee
Merge branch 'develop' into bring-integration
yushih Nov 5, 2024
85075e7
fix code format
yushih Nov 5, 2024
40c1f3d
fix: update bringweb3 package
kalfada Nov 5, 2024
8b71046
Merge pull request #3727 from Bring-Web3-LTD/bring-integration
yushih Nov 5, 2024
5030e42
fix Ledger error message handling
yushih Nov 6, 2024
b451b6a
clear error message after closing cashback claiming dialog
yushih Nov 6, 2024
610a19f
get rid of double scroll
yushih Nov 14, 2024
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
7 changes: 7 additions & 0 deletions packages/yoroi-extension/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ const TokensPageRevamp = React.lazy(TokensPageRevampPromise);
const TokensDetailPageRevampPromise = () => import('./containers/wallet/TokenDetailPageRevamp');
const TokensDetailPageRevamp = React.lazy(TokensDetailPageRevampPromise);

const CashbackPagePromise = () => import('./containers/cashback/CashbackPage');
const CashbackPage = React.lazy(CashbackPagePromise)

const NFTsPageRevampPromise = () => import('./containers/wallet/NFTsPageRevamp');
const NFTsPageRevamp = React.lazy(NFTsPageRevampPromise);

Expand Down Expand Up @@ -251,6 +254,10 @@ export const Routes = (stores: StoresMap, actions: ActionsMap): Node => {
path={ROUTES.NFTS.ROOT}
component={props => wrapNFTs({ ...props, stores, actions }, NFTsSubPages(stores, actions))}
/>
<Route
path={ROUTES.CASHBACK.ROOT}
component={props => <CashbackPage {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.WALLETS.ADD}
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/UI/context/IntlProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export const IntlProvider = ({ children, intl }: { children: React.ReactNode; in
};

export const useIntl = () =>
React.useContext(IntlProviderContext) ?? console.warn('IntlProviderontext: needs to be wrapped in a IntlProvider');
React.useContext(IntlProviderContext) ?? console.warn('IntlProviderContext: needs to be wrapped in a IntlProvider');
2 changes: 2 additions & 0 deletions packages/yoroi-extension/app/api/ada/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2686,11 +2686,13 @@ export async function encodeHardwareWalletSignResult(
signatureHex: string,
payloadHex: string,
signingPublicKeyHex: string,
payloadHashed: boolean = false,
): Promise<{| signature: string, key: string |}> {
const coseSign1 = await buildCoseSign1FromSignature (
hexToBytes(addressHex),
hexToBytes(signatureHex),
hexToBytes(payloadHex),
payloadHashed,
);

const key = makeCip8Key(hexToBytes(signingPublicKeyHex));
Expand Down
12 changes: 12 additions & 0 deletions packages/yoroi-extension/app/api/ada/lib/cardanoCrypto/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export const buildCoseSign1FromSignature = async (
address: Buffer,
signature: Buffer,
payload: Buffer,
payloadHashed: boolean = false,
): Promise<RustModule.MessageSigning.COSESign1> => {
const protectedHeader = RustModule.MessageSigning.HeaderMap.new();
protectedHeader.set_algorithm_id(
Expand All @@ -132,8 +133,19 @@ export const buildCoseSign1FromSignature = async (
);
const protectedSerialized = RustModule.MessageSigning.ProtectedHeaderMap.new(protectedHeader);
const unprotected = RustModule.MessageSigning.HeaderMap.new();
if (payloadHashed) {
unprotected.set_header(
RustModule.MessageSigning.Label.new_text('hashed'),
RustModule.MessageSigning.CBORValue.new_special(
RustModule.MessageSigning.CBORSpecial.new_bool(true)
),
);
}
const headers = RustModule.MessageSigning.Headers.new(protectedSerialized, unprotected);
const builder = RustModule.MessageSigning.COSESign1Builder.new(headers, payload, false);
if (payloadHashed) {
builder.hash_payload();
}
return builder.build(signature);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const CONFIG: ConfigType = {
pubKeyData: '',
pubKeyMaster: '',
},
bring: {
baseUrl: '',
identifier: '',
apiEndpoint: ''
}
};

global.CONFIG = CONFIG;
4 changes: 2 additions & 2 deletions packages/yoroi-extension/app/api/thunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export async function getWallets(walletId?: number): Promise<Array<WalletState>>
return resp;
}

export async function subscribe(activeWalletId: ?number): Promise<void> {
await callBackground({ type: 'subscribe', request: { activeWalletId } });
export async function subscribe(activeWalletId: ?number, changed?: boolean): Promise<void> {
await callBackground({ type: 'subscribe', request: { activeWalletId, changed: changed === true } });
}

export const createWallet: GetEntryFuncType<typeof CreateWallet> = async (request) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading