Skip to content

Commit

Permalink
Merge branch 'main' into feat/consent-message-build
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Jan 8, 2025
2 parents 58dd4b0 + 307eb61 commit eb9959e
Show file tree
Hide file tree
Showing 89 changed files with 2,254 additions and 114 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ VITE_AUTH_DERIVATION_ORIGIN=
VITE_ONRAMPER_API_KEY_DEV=pk_test_
VITE_ONRAMPER_API_KEY_PROD=pk_prod_
VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED=
VITE_SWAP_ACTION_ENABLED=
2 changes: 2 additions & 0 deletions .github/workflows/deploy-to-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
echo "VITE_POUH_ENABLED=${{ secrets.VITE_POUH_ENABLED_STAGING }}" >> $GITHUB_ENV
echo "VITE_AUTH_DERIVATION_ORIGIN=${{ secrets.VITE_AUTH_DERIVATION_ORIGIN_STAGING }}" >> $GITHUB_ENV
echo "VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED=${{ secrets.VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED_STAGING }}" >> $GITHUB_ENV
echo "VITE_SWAP_ACTION_ENABLED=${{ secrets.VITE_SWAP_ACTION_ENABLED_STAGING }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_DEV=${{ secrets.VITE_ONRAMPER_API_KEY_DEV_STAGING }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_PROD=${{ secrets.VITE_ONRAMPER_API_KEY_PROD_STAGING }}" >> $GITHUB_ENV
if [[ "$NETWORK" == "staging" ]]; then
Expand Down Expand Up @@ -136,6 +137,7 @@ jobs:
echo "VITE_AUTH_DERIVATION_ORIGIN=${{ secrets.VITE_AUTH_DERIVATION_ORIGIN_BETA }}" >> $GITHUB_ENV
echo "VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED=${{ secrets.VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED_BETA }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_DEV=${{ secrets.VITE_ONRAMPER_API_KEY_DEV_BETA }}" >> $GITHUB_ENV
echo "VITE_SWAP_ACTION_ENABLED=${{ secrets.VITE_SWAP_ACTION_ENABLED_BETA }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_PROD=${{ secrets.VITE_ONRAMPER_API_KEY_PROD_BETA }}" >> $GITHUB_ENV
{
echo 'DFX_DEPLOY_KEY<<EOF'
Expand Down
13 changes: 12 additions & 1 deletion dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,18 @@
"rewards": {
"type": "custom",
"candid": "https://github.com/dfinity/oisy-wallet/releases/download/rc0.0.0/rewards.did",
"wasm": "https://github.com/dfinity/oisy-wallet/releases/download/rc0.0.0/rewards.wasm.gz"
"wasm": "https://github.com/dfinity/oisy-wallet/releases/download/rc0.0.0/rewards.wasm.gz",
"remote": {
"id": {
"ic": "nynz6-haaaa-aaaan-qzqda-cai",
"staging": "vi6cu-aiaaa-aaaad-aad7q-cai",
"test_be_1": "k2sla-fiaaa-aaaag-atvfa-cai",
"test_fe_1": "vi6cu-aiaaa-aaaad-aad7q-cai",
"test_fe_2": "vi6cu-aiaaa-aaaad-aad7q-cai",
"test_fe_3": "vi6cu-aiaaa-aaaad-aad7q-cai",
"test_fe_4": "vi6cu-aiaaa-aaaad-aad7q-cai"
}
}
}
},
"defaults": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 113 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dfinity/oisy-wallet",
"version": "0.11.0",
"version": "0.12.0",
"private": true,
"license": "Apache-2.0",
"repository": {
Expand Down Expand Up @@ -66,6 +66,7 @@
"@metamask/detect-provider": "^2.0.0",
"@solana/addresses": "^2.0.0",
"@solana/rpc": "^2.0.0",
"@solana/rpc-subscriptions": "^2.0.0",
"@walletconnect/web3wallet": "1.14.0",
"alchemy-sdk": "3.4.1",
"buffer": "^6.0.3",
Expand Down
8 changes: 5 additions & 3 deletions scripts/build.utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ export const findHtmlFiles = (dir = join(process.cwd(), 'build')) =>
export const ENV =
process.env.ENV === 'ic'
? 'production'
: ['staging', 'beta'].includes(process.env.ENV)
? process.env.ENV
: 'development';
: (process.env.ENV ?? '').startsWith('test_fe_')
? 'staging'
: ['staging', 'beta'].includes(process.env.ENV)
? process.env.ENV
: 'development';

export const replaceEnv = ({ content, pattern, value }) => {
const regex = new RegExp(pattern, 'g');
Expand Down
13 changes: 11 additions & 2 deletions scripts/deploy.backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ II_CANISTER_ID="$(dfx canister id internet_identity --network "${ENV:-local}")"
BACKEND_CANISTER_ID="$(dfx canister id backend --network "${ENV:-local}")"
POUH_ISSUER_CANISTER_ID="$(dfx canister id pouh_issuer --network "${ENV:-local}")"
SIGNER_CANISTER_ID="$(dfx canister id signer --network "${ENV:-local}")"
# Rewards canister is optional for local deployments:
REWARDS_CANISTER_ID="$(dfx canister id rewards --network "${ENV:-local}" || [[ "${ENV:-local}" == "local" ]])"

case $ENV in
"staging")
Expand Down Expand Up @@ -41,6 +43,13 @@ case $ENV in
;;
esac

# If the rewards canister is known, it may perform priviliged actions such as find which users are eligible for rewards.
if [[ "${REWARDS_CANISTER_ID:-}" == "" ]]; then
ALLOWED_CALLERS="vec {}"
else
ALLOWED_CALLERS="vec{ principal \"$REWARDS_CANISTER_ID\" }"
fi

# URL used by II-issuer in the id_alias-verifiable credentials (hard-coded in II)
# Represents more an ID than a URL
II_VC_URL="https://identity.ic0.app"
Expand All @@ -51,7 +60,7 @@ if [ -n "${ENV+1}" ]; then
dfx deploy backend --argument "(variant {
Init = record {
ecdsa_key_name = \"$ECDSA_KEY_NAME\";
allowed_callers = vec {};
allowed_callers = $ALLOWED_CALLERS;
cfs_canister_id = opt principal \"$SIGNER_CANISTER_ID\";
derivation_origin = opt \"$DERIVATION_ORIGIN\";
supported_credentials = opt vec {
Expand All @@ -71,7 +80,7 @@ else
dfx deploy backend --argument "(variant {
Init = record {
ecdsa_key_name = \"$ECDSA_KEY_NAME\";
allowed_callers = vec {};
allowed_callers = $ALLOWED_CALLERS;
cfs_canister_id = opt principal \"$SIGNER_CANISTER_ID\";
derivation_origin = opt \"$DERIVATION_ORIGIN\";
supported_credentials = opt vec {
Expand Down
2 changes: 1 addition & 1 deletion scripts/did.update.types.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const copyCertifiedFactory = async ({ dest = `./src/declarations` }) => {

const certifiedFactoryPath = join(dest, dir, `${dir}.factory.certified.did.js`);

await writeFile(certifiedFactoryPath, content.toString().replace(/\['query']/g, ''));
await writeFile(certifiedFactoryPath, content.toString().replace(/\['query'],?/g, ''));

resolve();
};
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/btc/schedulers/btc-wallet.scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export class BtcWalletScheduler implements Scheduler<PostMessageDataRequestBtc>
const newBalance =
isNullish(this.store.balance) ||
this.store.balance.data !== balance.data ||
// TODO, align with sol-wallet.scheduler.ts, crash if certified changes
(!this.store.balance.certified && balance.certified);
const newTransactions = uncertifiedTransactions.length > 0;

Expand Down
3 changes: 3 additions & 0 deletions src/frontend/src/env/actions.env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// TODO: to be removed when the feature is fully implemented
export const SWAP_ACTION_ENABLED =
JSON.parse(import.meta.env.VITE_SWAP_ACTION_ENABLED ?? false) === true;
20 changes: 19 additions & 1 deletion src/frontend/src/env/networks/networks.icrc.env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,20 @@ const BURN_IC_DATA: IcInterface | undefined = nonNullish(ADDITIONAL_ICRC_PRODUCT
}
: undefined;

const POPEYE_IC_DATA: IcInterface | undefined = nonNullish(ADDITIONAL_ICRC_PRODUCTION_DATA?.POPEYE)
? {
...ADDITIONAL_ICRC_PRODUCTION_DATA.POPEYE,
position: 13
}
: undefined;

const CLOUD_IC_DATA: IcInterface | undefined = nonNullish(ADDITIONAL_ICRC_PRODUCTION_DATA?.CLOUD)
? {
...ADDITIONAL_ICRC_PRODUCTION_DATA.CLOUD,
position: 14
}
: undefined;

export const CKERC20_LEDGER_CANISTER_TESTNET_IDS: CanisterIdText[] = [
...(nonNullish(LOCAL_CKUSDC_LEDGER_CANISTER_ID) ? [LOCAL_CKUSDC_LEDGER_CANISTER_ID] : []),
...(nonNullish(CKUSDC_STAGING_DATA?.ledgerCanisterId)
Expand Down Expand Up @@ -460,7 +474,11 @@ const ICRC_CK_TOKENS: IcInterface[] = [
...(nonNullish(CKXAUT_IC_DATA) ? [CKXAUT_IC_DATA] : [])
];

const ADDITIONAL_ICRC_TOKENS: IcInterface[] = [...(nonNullish(BURN_IC_DATA) ? [BURN_IC_DATA] : [])];
const ADDITIONAL_ICRC_TOKENS: IcInterface[] = [
...(nonNullish(BURN_IC_DATA) ? [BURN_IC_DATA] : []),
...(nonNullish(POPEYE_IC_DATA) ? [POPEYE_IC_DATA] : []),
...(nonNullish(CLOUD_IC_DATA) ? [CLOUD_IC_DATA] : [])
];

export const ICRC_TOKENS: IcInterface[] = [
...PUBLIC_ICRC_TOKENS,
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/src/env/networks/networks.sol.env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export const SOLANA_RPC_HTTP_URL_TESTNET = 'https://api.testnet.solana.com';
export const SOLANA_RPC_HTTP_URL_DEVNET = `https://solana-devnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`;
export const SOLANA_RPC_HTTP_URL_LOCAL = 'http://localhost:8899';

export const SOLANA_RPC_WS_URL_MAINNET = 'wss://api.mainnet-beta.solana.com/';
export const SOLANA_RPC_WS_URL_TESTNET = 'wss://api.testnet.solana.com/';
export const SOLANA_RPC_WS_URL_DEVNET = 'wss://api.devnet.solana.com/';
export const SOLANA_RPC_WS_URL_LOCAL = 'ws://localhost:8900';

/**
* SOL
*/
Expand Down
8 changes: 8 additions & 0 deletions src/frontend/src/env/tokens/tokens.icrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@
"BURN": {
"indexCanisterId": "nrant-tyaaa-aaaag-atsjq-cai",
"ledgerCanisterId": "egjwt-lqaaa-aaaak-qi2aa-cai"
},
"POPEYE": {
"indexCanisterId": "gg3c3-6iaaa-aaaah-aq6dq-cai",
"ledgerCanisterId": "6fvyi-faaaa-aaaam-qbiga-cai"
},
"CLOUD": {
"indexCanisterId": "72uqs-pqaaa-aaaak-aes7a-cai",
"ledgerCanisterId": "pcj6u-uaaaa-aaaak-aewnq-cai"
}
}
8 changes: 4 additions & 4 deletions src/frontend/src/eth/components/send/SendForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { isNullish } from '@dfinity/utils';
import { createEventDispatcher, getContext } from 'svelte';
import FeeDisplay from '$eth/components/fee/FeeDisplay.svelte';
import SendAmount from '$eth/components/send/SendAmount.svelte';
import SendDestination from '$eth/components/send/SendDestination.svelte';
import EthSendAmount from '$eth/components/send/EthSendAmount.svelte';
import EthSendDestination from '$eth/components/send/EthSendDestination.svelte';
import SendInfo from '$eth/components/send/SendInfo.svelte';
import SendNetworkICP from '$eth/components/send/SendNetworkICP.svelte';
import type { EthereumNetwork } from '$eth/types/network';
Expand Down Expand Up @@ -42,7 +42,7 @@
<form on:submit={() => dispatch('icNext')} method="POST">
<ContentWithToolbar>
{#if destinationEditable}
<SendDestination
<EthSendDestination
token={$sendToken}
{network}
bind:destination
Expand All @@ -53,7 +53,7 @@
<SendNetworkICP {destination} {sourceNetwork} bind:network />
{/if}

<SendAmount {nativeEthereumToken} bind:amount bind:insufficientFunds />
<EthSendAmount {nativeEthereumToken} bind:amount bind:insufficientFunds />

<SendSource
token={$sendToken}
Expand Down
Loading

0 comments on commit eb9959e

Please sign in to comment.