Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup
permissions:
contents: read
runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org

# For provenance https://docs.npmjs.com/generating-provenance-statements#prerequisites
- name: Install npm 9.5
run: npm install -g npm@^9.5.0
shell: bash

- name: Install node modules
run: yarn install --immutable
shell: bash
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
workflow_dispatch:
inputs:
packageVersion:
description: "The version to publish in MAJOR.MINOR.PATCH format"
required: true
default: ""

jobs:
release:
env:
PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }}
name: Release
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: 'Setup'
uses: ./.github/actions/setup

- name: Set version
run: yarn workspace @coinbase/wallet-sdk version ${{ env.PACKAGE_VERSION }}

# Build the package
- name: Prebuild Packages
run: yarn workspace @coinbase/wallet-sdk prebuild

- name: Build Packages
run: yarn workspace @coinbase/wallet-sdk build

# Publish to npm
- name: Set deployment token
run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"

- name: Publish to npm
run: |
cd packages/wallet-sdk
npm publish --tag latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
550 changes: 550 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

935 changes: 935 additions & 0 deletions .yarn/releases/yarn-4.8.1.cjs

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
checksumBehavior: update

nodeLinker: node-modules
compressionLevel: mixed

enableGlobalCache: false

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-4.8.1.cjs
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"eslint-plugin-unused-imports": "^3.0.0",
"prettier": "^3.0.0"
},
"packageManager": "yarn@3.6.1"
"packageManager": "yarn@4.8.1"
}
2 changes: 1 addition & 1 deletion packages/wallet-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/wallet-sdk",
"version": "3.9.3",
"version": "3.9.4",
"description": "Coinbase Wallet JavaScript SDK",
"keywords": [
"cipher",
Expand Down
13 changes: 12 additions & 1 deletion packages/wallet-sdk/src/CoinbaseWalletSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class CoinbaseWalletSDK {
private _overrideIsCoinbaseBrowser: boolean;
private _diagnosticLogger?: DiagnosticLogger;
private _reloadOnDisconnect?: boolean;
private _provider?: CoinbaseWalletProvider;

/**
* Constructor
Expand Down Expand Up @@ -103,6 +104,7 @@ export class CoinbaseWalletSDK {
diagnosticLogger: this._diagnosticLogger,
reloadOnDisconnect: this._reloadOnDisconnect,
enableMobileWalletLink: options.enableMobileWalletLink,
updateQrUrl: this.updateQrUrl.bind(this),
};

this._relay = isMobile ? new MobileRelay(relayOption) : new WalletLinkRelay(relayOption);
Expand Down Expand Up @@ -148,7 +150,7 @@ export class CoinbaseWalletSDK {

if (!jsonRpcUrl) relay.setConnectDisabled(true);

return new CoinbaseWalletProvider({
this._provider = new CoinbaseWalletProvider({
relayProvider: () => Promise.resolve(relay),
relayEventManager: this._relayEventManager,
storage: this._storage,
Expand All @@ -160,6 +162,8 @@ export class CoinbaseWalletSDK {
overrideIsCoinbaseWallet: this._overrideIsCoinbaseWallet,
overrideIsCoinbaseBrowser: this._overrideIsCoinbaseBrowser,
});

return this._provider;
}

/**
Expand Down Expand Up @@ -201,6 +205,13 @@ export class CoinbaseWalletSDK {
return this._relay?.getQRCodeUrl() ?? null;
}

public updateQrUrl(): void {
const url = this.getQrUrl();
if (url && this._provider) {
this._provider.qrUrl = url;
}
}

/**
* Official Coinbase Wallet logo for developers to use on their frontend
* @param type Type of wallet logo: "standard" | "circle" | "text" | "textWithLogo" | "textLight" | "textWithLogoLight"
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class CoinbaseWalletProvider extends EventEmitter implements Web3Provider
// So dapps can easily identify Coinbase Dapp Browser for enabling dapp browser specific features
public readonly isCoinbaseBrowser: boolean;

public readonly qrUrl?: string | null;
public qrUrl?: string | null;
public reloadOnDisconnect: boolean;

private readonly _filterPolyfill = new FilterPolyfill(this);
Expand Down
3 changes: 3 additions & 0 deletions packages/wallet-sdk/src/relay/walletlink/WalletLinkRelay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface WalletLinkRelayOptions {
diagnosticLogger?: DiagnosticLogger;
reloadOnDisconnect?: boolean;
enableMobileWalletLink?: boolean;
updateQrUrl?: () => void;
}

export class WalletLinkRelay extends RelayAbstract implements WalletLinkConnectionUpdateListener {
Expand Down Expand Up @@ -237,6 +238,8 @@ export class WalletLinkRelay extends RelayAbstract implements WalletLinkConnecti
this.connection = connection;
this.ui = ui;

this.options.updateQrUrl?.();

if (isStandalone && this.ui.setStandalone) this.ui.setStandalone(true);

if (!this.options.headlessMode) this.attachUI();
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const LIB_VERSION = '3.9.3';
export const LIB_VERSION = '3.9.4';
Loading