Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NorbertBodziony committed Sep 24, 2023
1 parent 855de10 commit 1b8003e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 29 deletions.
6 changes: 3 additions & 3 deletions sdk/apps/modal-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@mysten/wallet-adapter-wallet-standard": "^0.8.0",
"@nightlylabs/wallet-selector-solana": "0.2.2",
"@nightlylabs/nightly-connect-solana": "0.0.26",
"@nightlylabs/nightly-connect-sui": "0.0.25",
"@nightlylabs/wallet-selector-sui": "0.2.2",
"@nightlylabs/nightly-connect-sui": "0.0.26",
"@nightlylabs/wallet-selector-sui": "0.2.3",
"@nightlylabs/nightly-connect-polkadot": "0.0.6",
"@nightlylabs/wallet-selector-polkadot": "0.1.2",
"@polkadot/extension-inject": "^0.46.5",
Expand All @@ -38,4 +38,4 @@
"engines": {
"node": ">=16.8"
}
}
}
6 changes: 3 additions & 3 deletions sdk/packages/selector-sui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nightlylabs/wallet-selector-sui",
"version": "0.2.2",
"version": "0.2.3",
"description": "",
"type": "module",
"exports": {
Expand Down Expand Up @@ -28,7 +28,7 @@
"@mysten/wallet-adapter-wallet-standard": "^0.8.0",
"@mysten/wallet-standard": "^0.8.0",
"@mysten/wallet-adapter-base": "^0.9.0",
"@nightlylabs/nightly-connect-sui": "0.0.25",
"@nightlylabs/nightly-connect-sui": "0.0.26",
"@nightlylabs/wallet-selector-base": "0.2.2",
"@wallet-standard/core": "^1.0.3",
"bs58": "^4.0.1",
Expand All @@ -45,4 +45,4 @@
"tslib": "^2.5.3",
"typescript": "^5.1.3"
}
}
}
4 changes: 0 additions & 4 deletions sdk/packages/selector-sui/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ export default [
],
external: [
'@mysten/sui.js',
'@mysten/sui.js/verify',
'@mysten/sui.js/dist/cjs/signers/types',
'@mysten/sui.js/client',
'@mysten/wallet-adapter-wallet-standard',
'@mysten/wallet-adapter-wallet-standard/dist/StandardWalletAdapter',
'@mysten/wallet-standard',
'@nightlylabs/nightly-connect-sui',
'@nightlylabs/wallet-selector-base',
Expand Down
29 changes: 12 additions & 17 deletions sdk/packages/selector-sui/src/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/* eslint-disable @typescript-eslint/no-empty-function */
import { publicKeyFromRawBytes } from '@mysten/sui.js/verify'
import { SignedTransaction } from '@mysten/sui.js/dist/cjs/signers/types'
import { SuiTransactionBlockResponse } from '@mysten/sui.js/client'
// import { WalletAdapter } from '@mysten/wallet-adapter-base'
import { StandardWalletAdapter } from '@mysten/wallet-adapter-wallet-standard'
import type {
SignedPersonalMessage,
SuiSignAndExecuteTransactionBlockInput,
SuiSignPersonalMessageInput,
SuiSignTransactionBlockInput
SuiSignAndExecuteTransactionBlockMethod,
SuiSignPersonalMessageMethod,
SuiSignTransactionBlockMethod
} from '@mysten/wallet-standard'

import { type StandardWalletAdapterConfig } from '@mysten/wallet-adapter-wallet-standard/dist/StandardWalletAdapter'
import { SUI_CHAINS } from '@mysten/wallet-standard'
import { AppSui, SUI_NETWORK } from '@nightlylabs/nightly-connect-sui'
import {
Expand All @@ -35,7 +33,6 @@ import {
import type { StandardEventsOnMethod, WalletAccount } from '@wallet-standard/core'
import bs58 from 'bs58'
import { suiWalletsFilter } from './detection'
import { StandardWalletAdapterConfig } from '@mysten/wallet-adapter-wallet-standard/dist/StandardWalletAdapter'

export const convertBase58toBase64 = (base58: string) => {
const buffer = bs58.decode(base58)
Expand Down Expand Up @@ -428,9 +425,7 @@ export class NightlyConnectSuiAdapter {
this.connecting = false
}

signPersonalMessage = async (
messageInput: SuiSignPersonalMessageInput
): Promise<SignedPersonalMessage> => {
signPersonalMessage: SuiSignPersonalMessageMethod = async (messageInput) => {
if (!this._app || !this._connectionType) {
throw new Error('Wallet not ready')
}
Expand All @@ -451,15 +446,15 @@ export class NightlyConnectSuiAdapter {
}
}

signTransactionBlock = async (
transactionInput: SuiSignTransactionBlockInput
): Promise<SignedTransaction> => {
//
signTransactionBlock: SuiSignTransactionBlockMethod = async (transactionInput) => {
if (!this._app || !this._connectionType) {
throw new Error('Wallet not ready')
}
switch (this._connectionType) {
case ConnectionType.Nightly: {
return await this._app.signTransactionBlock(transactionInput)
// return { bytes: res.transactionBlockBytes, signature: res.signature }
}
case ConnectionType.WalletStandard: {
if (!this._innerStandardAdapter) {
Expand All @@ -471,9 +466,9 @@ export class NightlyConnectSuiAdapter {
}
}

signAndExecuteTransactionBlock = async (
transactionInput: SuiSignAndExecuteTransactionBlockInput
): Promise<SuiTransactionBlockResponse> => {
signAndExecuteTransactionBlock: SuiSignAndExecuteTransactionBlockMethod = async (
transactionInput
) => {
if (!this._app || !this._connectionType) {
throw new Error('Wallet not ready')
}
Expand Down
2 changes: 0 additions & 2 deletions sdk/packages/selector-sui/src/detection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ export const suiWalletsFilter = (wallet: Wallet) => {
'sui:signAndExecuteTransactionBlock',
'sui:signTransactionBlock'
])
console.log(wallet)
console.log(is)
return is
}

0 comments on commit 1b8003e

Please sign in to comment.