Skip to content

Commit

Permalink
Merge branch 'dev' into configure-bot-on-stage
Browse files Browse the repository at this point in the history
  • Loading branch information
mazhutoanton authored Jan 8, 2025
2 parents a7a22f1 + 335611b commit 188c66f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
install_packages_command: 'cp .env.dev .env; npm ci'
build_command: 'npm run build'
path_to_static_files_to_upload: 'build'
aws_account_id: ${{ vars.DEV_CORE_AWS_ACCOUNT_ID }}
s3_bucket_name: 'dev-cere-wallet-client-dist'
aws_account_id: ${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}
s3_bucket_name: 'wallet.dev.cere.io'
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_READ }}
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/embed-wallet-inject/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cere/embed-wallet-inject",
"version": "0.22.2",
"version": "0.22.3",
"sideEffects": false,
"type": "module",
"types": "./dist/types/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/embed-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cere/embed-wallet",
"version": "0.22.2",
"version": "0.22.3",
"description": "Cere Wallet SDK to integrate the wallet into a web application.",
"sideEffects": false,
"main": "dist/bundle.umd.js",
Expand Down
14 changes: 11 additions & 3 deletions packages/embed-wallet/src/EmbedWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,18 @@ export class EmbedWallet {
private proxyProvider: ProxyProvider;
private connectOptions: WalletConnectOptions = {};
private onAfterInit?: (error?: any) => void;
private onAfterConnect?: (error?: any) => void;

/**
* @description Promise that resolves when the wallet instance is initialized and ready
*/
readonly isReady: Promise<EmbedWallet>;

/**
* @description Promise that resolves when the wallet instance is connected
*/
readonly isConnected: Promise<EmbedWallet>;

constructor({ env, clientVersion = WALLET_CLIENT_VERSION, ...options }: WalletOptions = {}) {
if (env) {
preloadIframe(buildEnvMap[env], clientVersion);
Expand All @@ -91,7 +97,9 @@ export class EmbedWallet {
this.isReady = new Promise((resolve, reject) => {
this.onAfterInit = (error) => (error ? reject(error) : resolve(this));
});

this.isConnected = new Promise((resolve, reject) => {
this.onAfterConnect = (error) => (error ? reject(error) : resolve(this));
});
this.provider.on('message', this.handleEvenets);
}

Expand Down Expand Up @@ -215,11 +223,11 @@ export class EmbedWallet {
});

this.setStatus('connected');

this.onAfterConnect?.();
return address;
} catch (error) {
rollback();

this.onAfterConnect?.(error);
throw error;
}
}
Expand Down

0 comments on commit 188c66f

Please sign in to comment.