diff --git a/.github/ISSUE_TEMPLATE/change_request.md b/.github/ISSUE_TEMPLATE/change_request.md index 4670f3aab..659f4ebc3 100644 --- a/.github/ISSUE_TEMPLATE/change_request.md +++ b/.github/ISSUE_TEMPLATE/change_request.md @@ -2,7 +2,7 @@ name: Change request about: Template for change requests title: '' -labels: task +labels: change-request assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/epic-template.md b/.github/ISSUE_TEMPLATE/epic-template.md new file mode 100644 index 000000000..cbf504cb6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/epic-template.md @@ -0,0 +1,26 @@ +--- +name: Epic Template +about: Epics are milestones or groups of alike issues +title: "[Epic] " +labels: Emerging Tech, Epic, Near BOS +assignees: '' + +--- + +### Description + +(Overview of milestone or function governed by this epic) + +### Resources + +(Relevant documentation, Figma links, and other reference material) + +Item 1 + +Item 2 + +Item 3 + +```[tasklist] +### Related Issues +``` diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md new file mode 100644 index 000000000..cd812980d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -0,0 +1,16 @@ +--- +name: Issue Template +about: Issues are general tasks to be compeleted +title: '' +labels: Emerging Tech, Near BOS +assignees: '' + +--- + +### Description + +(Summary of task, purpose, impact) + +### Optional: User Story + +(As a [user], I need [function, outcome, enhancement] that [provides value].) diff --git a/packages/nightly/src/lib/injected-nightly.ts b/packages/nightly/src/lib/injected-nightly.ts index 5551abe4a..99a386370 100644 --- a/packages/nightly/src/lib/injected-nightly.ts +++ b/packages/nightly/src/lib/injected-nightly.ts @@ -1,4 +1,8 @@ -import type { AccountImportData } from "@near-wallet-selector/core"; +import type { + AccountImportData, + SignedMessage, + SignMessageParams, +} from "@near-wallet-selector/core"; import type { SignedTransaction as NearSignedTransaction, Transaction as NearTransaction, @@ -10,7 +14,8 @@ interface NightlyAccount { } export interface NearNightly { account: NightlyAccount; - connected: boolean; + isConnected: boolean; + signMessage: (params: SignMessageParams) => Promise; signTransaction: ( transaction: NearTransaction ) => Promise; diff --git a/packages/nightly/src/lib/nightly.ts b/packages/nightly/src/lib/nightly.ts index 3efcdd6f9..238da134b 100644 --- a/packages/nightly/src/lib/nightly.ts +++ b/packages/nightly/src/lib/nightly.ts @@ -185,6 +185,28 @@ const Nightly: WalletBehaviourFactory = async ({ throw new Error(`Method not supported by ${metadata.name}`); }, + async signMessage({ message, nonce, recipient, state }) { + logger.log("Nightly:signMessage", { + message, + nonce, + recipient, + state, + }); + + if (_state.wallet.isConnected) { + await _state.wallet.connect(); + } + + const signature = await _state.wallet.signMessage({ + message, + nonce, + recipient, + state, + }); + + return signature; + }, + async signAndSendTransaction({ signerId, receiverId, actions }) { logger.log("signAndSendTransaction", { signerId, receiverId, actions });