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

v1.3.6 Improved Session Handling and Logging #318

Closed
wants to merge 20 commits into from
Closed
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
44 changes: 44 additions & 0 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Canary
on:
pull_request:
branches:
- main

jobs:
publish-canary:
name: Publish Canary
runs-on: wallet-tools-linux-medium
permissions:
contents: read

steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup NodeJS Environment
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 18.x

- name: Install dependencies
run: npm install

- name: Create .npmrc
run: |
touch .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc

- name: Set prerelease version
run: |
npm version prerelease --preid="canary.$(git rev-parse --short HEAD)" --no-git-tag-version

- name: Publish
run: npm publish --tag canary --public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

5 changes: 3 additions & 2 deletions demos/react-dapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
transactionToBase64String,
SignAndExecuteQueryParams,
ExecuteTransactionParams,
} from '@hashgraph/hedera-wallet-connect'
} from '../../../dist/src/index'

import React, { useEffect, useMemo, useState } from 'react'
import Modal from './components/Modal'
Expand Down Expand Up @@ -263,6 +263,7 @@ const App: React.FC = () => {

_dAppConnector.onSessionIframeCreated = (session) => {
setNewSession(session)
setSessions((prev) => [...prev, session])
}

_dAppConnector?.extensions?.forEach((extension) => {
Expand Down Expand Up @@ -643,4 +644,4 @@ const AccountSelector = ({ accounts, selectedAccount, onSelect }: AccountSelecto
</select>
</label>
)
}
}
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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hashgraph/hedera-wallet-connect",
"version": "1.3.5",
"version": "1.3.6",
"description": "A library to facilitate integrating Hedera with WalletConnect",
"repository": {
"type": "git",
Expand Down
10 changes: 8 additions & 2 deletions src/lib/dapp/DAppSigner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
TransactionRecordQuery,
} from '@hashgraph/sdk'
import { proto } from '@hashgraph/proto'
import type { ISignClient } from '@walletconnect/types'
import type { CoreTypes, ISignClient } from '@walletconnect/types'

import {
HederaJsonRpcMethod,
Expand Down Expand Up @@ -99,7 +99,9 @@ export class DAppSigner implements Signer {
}

request<T>(request: { method: string; params: any }): Promise<T> {
if (this.extensionId) extensionOpen(this.extensionId)
if (this.extensionId) {
extensionOpen(this.extensionId)
}
return this.signClient.request<T>({
topic: this.topic,
request,
Expand Down Expand Up @@ -139,6 +141,10 @@ export class DAppSigner implements Signer {
return this.call(new AccountRecordsQuery().setAccountId(this.accountId))
}

getMetadata(): CoreTypes.Metadata {
return this.signClient.metadata
}

async sign(
data: Uint8Array[],
signOptions?: Record<string, any>,
Expand Down
Loading
Loading