@mysten/dapp-kit 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/hooks/wallet/useSignPersonalMessage.js +19 -8
- package/dist/cjs/hooks/wallet/useSignPersonalMessage.js.map +2 -2
- package/dist/cjs/index.js +19 -8
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/hooks/wallet/useSignPersonalMessage.js +19 -8
- package/dist/esm/hooks/wallet/useSignPersonalMessage.js.map +2 -2
- package/dist/esm/index.js +19 -8
- package/dist/esm/index.js.map +2 -2
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/hooks/wallet/useSignPersonalMessage.ts +22 -8
|
@@ -101,16 +101,27 @@ function useSignPersonalMessage({
|
|
|
101
101
|
"No wallet account is selected to sign the personal message with."
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
const signPersonalMessageFeature = currentWallet.features["sui:signPersonalMessage"];
|
|
105
|
+
if (signPersonalMessageFeature) {
|
|
106
|
+
return await signPersonalMessageFeature.signPersonalMessage({
|
|
107
|
+
...signPersonalMessageArgs,
|
|
108
|
+
account: signerAccount
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
const signMessageFeature = currentWallet.features["sui:signMessage"];
|
|
112
|
+
if (signMessageFeature) {
|
|
113
|
+
console.warn(
|
|
114
|
+
"This wallet doesn't support the `signPersonalMessage` feature... falling back to `signMessage`."
|
|
108
115
|
);
|
|
116
|
+
const { messageBytes, signature } = await signMessageFeature.signMessage({
|
|
117
|
+
...signPersonalMessageArgs,
|
|
118
|
+
account: signerAccount
|
|
119
|
+
});
|
|
120
|
+
return { bytes: messageBytes, signature };
|
|
109
121
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
122
|
+
throw new WalletFeatureNotSupportedError(
|
|
123
|
+
"This wallet doesn't support the `signPersonalMessage` feature."
|
|
124
|
+
);
|
|
114
125
|
},
|
|
115
126
|
...mutationOptions
|
|
116
127
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/hooks/wallet/useSignPersonalMessage.ts", "../../../../src/errors/walletErrors.ts", "../../../../src/constants/walletMutationKeys.ts", "../../../../src/hooks/wallet/useWalletStore.ts", "../../../../src/contexts/walletContext.ts", "../../../../src/hooks/wallet/useCurrentAccount.ts", "../../../../src/hooks/wallet/useCurrentWallet.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n\tSuiSignPersonalMessageInput,\n\tSuiSignPersonalMessageOutput,\n} from '@mysten/wallet-standard';\nimport type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';\nimport { useMutation } from '@tanstack/react-query';\n\nimport {\n\tWalletFeatureNotSupportedError,\n\tWalletNoAccountSelectedError,\n\tWalletNotConnectedError,\n} from '../..//errors/walletErrors.js';\nimport { walletMutationKeys } from '../../constants/walletMutationKeys.js';\nimport type { PartialBy } from '../../types/utilityTypes.js';\nimport { useCurrentAccount } from './useCurrentAccount.js';\nimport { useCurrentWallet } from './useCurrentWallet.js';\n\ntype UseSignPersonalMessageArgs = PartialBy<SuiSignPersonalMessageInput, 'account'>;\n\ntype UseSignPersonalMessageResult = SuiSignPersonalMessageOutput;\n\ntype UseSignPersonalMessageError =\n\t| WalletFeatureNotSupportedError\n\t| WalletNoAccountSelectedError\n\t| WalletNotConnectedError\n\t| Error;\n\ntype UseSignPersonalMessageMutationOptions = Omit<\n\tUseMutationOptions<\n\t\tUseSignPersonalMessageResult,\n\t\tUseSignPersonalMessageError,\n\t\tUseSignPersonalMessageArgs,\n\t\tunknown\n\t>,\n\t'mutationFn'\n>;\n\n/**\n * Mutation hook for prompting the user to sign a message.\n */\nexport function useSignPersonalMessage({\n\tmutationKey,\n\t...mutationOptions\n}: UseSignPersonalMessageMutationOptions = {}): UseMutationResult<\n\tUseSignPersonalMessageResult,\n\tUseSignPersonalMessageError,\n\tUseSignPersonalMessageArgs\n> {\n\tconst { currentWallet } = useCurrentWallet();\n\tconst currentAccount = useCurrentAccount();\n\n\treturn useMutation({\n\t\tmutationKey: walletMutationKeys.signPersonalMessage(mutationKey),\n\t\tmutationFn: async (signPersonalMessageArgs) => {\n\t\t\tif (!currentWallet) {\n\t\t\t\tthrow new WalletNotConnectedError('No wallet is connected.');\n\t\t\t}\n\n\t\t\tconst signerAccount = signPersonalMessageArgs.account ?? currentAccount;\n\t\t\tif (!signerAccount) {\n\t\t\t\tthrow new WalletNoAccountSelectedError(\n\t\t\t\t\t'No wallet account is selected to sign the personal message with.',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst
|
|
5
|
-
"mappings": ";AAQA,SAAS,mBAAmB;;;ACFrB,IAAM,0BAAN,cAAsC,MAAM;AAAC;AAO7C,IAAM,+BAAN,cAA2C,MAAM;AAAC;AAKlD,IAAM,iCAAN,cAA6C,MAAM;AAAC;;;ACbpD,IAAM,qBAAqB;AAAA,EACjC,KAAK,EAAE,WAAW,SAAS;AAAA,EAC3B,eAAe,kBAAkB,gBAAgB;AAAA,EACjD,kBAAkB,kBAAkB,mBAAmB;AAAA,EACvD,qBAAqB,kBAAkB,uBAAuB;AAAA,EAC9D,sBAAsB,kBAAkB,wBAAwB;AAAA,EAChE,gCAAgC,kBAAkB,oCAAoC;AAAA,EACtF,eAAe,kBAAkB,gBAAgB;AAClD;AAEA,SAAS,kBAAkB,YAAoB;AAC9C,SAAO,SAAS,cAAc,iBAA8B,CAAC,GAAG;AAC/D,WAAO,CAAC,EAAE,GAAG,mBAAmB,KAAK,WAAW,GAAG,GAAG,cAAc;AAAA,EACrE;AACD;;;AChBA,SAAS,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CAAC,eAAe;AACnB,cAAM,IAAI;AAAA,UACT;AAAA,QACD;AAAA,MACD;AAEA,YAAM,
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n\tSuiSignPersonalMessageInput,\n\tSuiSignPersonalMessageOutput,\n} from '@mysten/wallet-standard';\nimport type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';\nimport { useMutation } from '@tanstack/react-query';\n\nimport {\n\tWalletFeatureNotSupportedError,\n\tWalletNoAccountSelectedError,\n\tWalletNotConnectedError,\n} from '../..//errors/walletErrors.js';\nimport { walletMutationKeys } from '../../constants/walletMutationKeys.js';\nimport type { PartialBy } from '../../types/utilityTypes.js';\nimport { useCurrentAccount } from './useCurrentAccount.js';\nimport { useCurrentWallet } from './useCurrentWallet.js';\n\ntype UseSignPersonalMessageArgs = PartialBy<SuiSignPersonalMessageInput, 'account'>;\n\ntype UseSignPersonalMessageResult = SuiSignPersonalMessageOutput;\n\ntype UseSignPersonalMessageError =\n\t| WalletFeatureNotSupportedError\n\t| WalletNoAccountSelectedError\n\t| WalletNotConnectedError\n\t| Error;\n\ntype UseSignPersonalMessageMutationOptions = Omit<\n\tUseMutationOptions<\n\t\tUseSignPersonalMessageResult,\n\t\tUseSignPersonalMessageError,\n\t\tUseSignPersonalMessageArgs,\n\t\tunknown\n\t>,\n\t'mutationFn'\n>;\n\n/**\n * Mutation hook for prompting the user to sign a message.\n */\nexport function useSignPersonalMessage({\n\tmutationKey,\n\t...mutationOptions\n}: UseSignPersonalMessageMutationOptions = {}): UseMutationResult<\n\tUseSignPersonalMessageResult,\n\tUseSignPersonalMessageError,\n\tUseSignPersonalMessageArgs\n> {\n\tconst { currentWallet } = useCurrentWallet();\n\tconst currentAccount = useCurrentAccount();\n\n\treturn useMutation({\n\t\tmutationKey: walletMutationKeys.signPersonalMessage(mutationKey),\n\t\tmutationFn: async (signPersonalMessageArgs) => {\n\t\t\tif (!currentWallet) {\n\t\t\t\tthrow new WalletNotConnectedError('No wallet is connected.');\n\t\t\t}\n\n\t\t\tconst signerAccount = signPersonalMessageArgs.account ?? currentAccount;\n\t\t\tif (!signerAccount) {\n\t\t\t\tthrow new WalletNoAccountSelectedError(\n\t\t\t\t\t'No wallet account is selected to sign the personal message with.',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst signPersonalMessageFeature = currentWallet.features['sui:signPersonalMessage'];\n\t\t\tif (signPersonalMessageFeature) {\n\t\t\t\treturn await signPersonalMessageFeature.signPersonalMessage({\n\t\t\t\t\t...signPersonalMessageArgs,\n\t\t\t\t\taccount: signerAccount,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// TODO: Remove this once we officially discontinue sui:signMessage in the wallet standard\n\t\t\tconst signMessageFeature = currentWallet.features['sui:signMessage'];\n\t\t\tif (signMessageFeature) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"This wallet doesn't support the `signPersonalMessage` feature... falling back to `signMessage`.\",\n\t\t\t\t);\n\n\t\t\t\tconst { messageBytes, signature } = await signMessageFeature.signMessage({\n\t\t\t\t\t...signPersonalMessageArgs,\n\t\t\t\t\taccount: signerAccount,\n\t\t\t\t});\n\t\t\t\treturn { bytes: messageBytes, signature };\n\t\t\t}\n\n\t\t\tthrow new WalletFeatureNotSupportedError(\n\t\t\t\t\"This wallet doesn't support the `signPersonalMessage` feature.\",\n\t\t\t);\n\t\t},\n\t\t...mutationOptions,\n\t});\n}\n", "// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * An error that is instantiated when someone attempts to perform an action that requires an active wallet connection.\n */\nexport class WalletNotConnectedError extends Error {}\n\n/**\n * An error that is instantiated when someone attempts to perform an action that requires a selected wallet account.\n * This is more of an edge case stemming from the fact that wallets don't technically require you to authorize any\n * accounts when connecting a wallet.\n */\nexport class WalletNoAccountSelectedError extends Error {}\n\n/**\n * An error that is instantiated when someone attempts to perform an action that isn't supported by a wallet.\n */\nexport class WalletFeatureNotSupportedError extends Error {}\n\n/**\n * An error that is instantiated when a wallet account can't be found for a specific wallet.\n */\nexport class WalletAccountNotFoundError extends Error {}\n", "// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { MutationKey } from '@tanstack/react-query';\n\nexport const walletMutationKeys = {\n\tall: { baseScope: 'wallet' },\n\tconnectWallet: formMutationKeyFn('connect-wallet'),\n\tdisconnectWallet: formMutationKeyFn('disconnect-wallet'),\n\tsignPersonalMessage: formMutationKeyFn('sign-personal-message'),\n\tsignTransactionBlock: formMutationKeyFn('sign-transaction-block'),\n\tsignAndExecuteTransactionBlock: formMutationKeyFn('sign-and-execute-transaction-block'),\n\tswitchAccount: formMutationKeyFn('switch-account'),\n};\n\nfunction formMutationKeyFn(baseEntity: string) {\n\treturn function mutationKeyFn(additionalKeys: MutationKey = []) {\n\t\treturn [{ ...walletMutationKeys.all, baseEntity }, ...additionalKeys];\n\t};\n}\n", "// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useContext } from 'react';\nimport { useStore } from 'zustand';\n\nimport { WalletContext } from '../../contexts/walletContext.js';\nimport type { StoreState } from '../../walletStore.js';\n\nexport function useWalletStore<T>(selector: (state: StoreState) => T): T {\n\tconst store = useContext(WalletContext);\n\tif (!store) {\n\t\tthrow new Error(\n\t\t\t'Could not find WalletContext. Ensure that you have set up the WalletProvider.',\n\t\t);\n\t}\n\treturn useStore(store, selector);\n}\n", "// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { createContext } from 'react';\n\nimport type { WalletStore } from '../walletStore.js';\n\nexport const WalletContext = createContext<WalletStore | null>(null);\n", "// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { WalletAccount } from '@mysten/wallet-standard';\n\nimport { useWalletStore } from './useWalletStore.js';\n\n/**\n * Retrieves the wallet account that is currently selected, if one exists.\n */\nexport function useCurrentAccount(): WalletAccount | null {\n\treturn useWalletStore((state) => state.currentAccount);\n}\n", "// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useWalletStore } from './useWalletStore.js';\n\n/**\n * Retrieves the wallet that is currently connected to the dApp, if one exists.\n */\nexport function useCurrentWallet() {\n\tconst currentWallet = useWalletStore((state) => state.currentWallet);\n\tconst connectionStatus = useWalletStore((state) => state.connectionStatus);\n\n\tswitch (connectionStatus) {\n\t\tcase 'connecting':\n\t\t\treturn {\n\t\t\t\tconnectionStatus,\n\t\t\t\tcurrentWallet: null,\n\t\t\t\tisDisconnected: false,\n\t\t\t\tisConnecting: true,\n\t\t\t\tisConnected: false,\n\t\t\t} as const;\n\t\tcase 'disconnected':\n\t\t\treturn {\n\t\t\t\tconnectionStatus,\n\t\t\t\tcurrentWallet: null,\n\t\t\t\tisDisconnected: true,\n\t\t\t\tisConnecting: false,\n\t\t\t\tisConnected: false,\n\t\t\t} as const;\n\t\tcase 'connected': {\n\t\t\treturn {\n\t\t\t\tconnectionStatus,\n\t\t\t\tcurrentWallet: currentWallet!,\n\t\t\t\tisDisconnected: false,\n\t\t\t\tisConnecting: false,\n\t\t\t\tisConnected: true,\n\t\t\t} as const;\n\t\t}\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";AAQA,SAAS,mBAAmB;;;ACFrB,IAAM,0BAAN,cAAsC,MAAM;AAAC;AAO7C,IAAM,+BAAN,cAA2C,MAAM;AAAC;AAKlD,IAAM,iCAAN,cAA6C,MAAM;AAAC;;;ACbpD,IAAM,qBAAqB;AAAA,EACjC,KAAK,EAAE,WAAW,SAAS;AAAA,EAC3B,eAAe,kBAAkB,gBAAgB;AAAA,EACjD,kBAAkB,kBAAkB,mBAAmB;AAAA,EACvD,qBAAqB,kBAAkB,uBAAuB;AAAA,EAC9D,sBAAsB,kBAAkB,wBAAwB;AAAA,EAChE,gCAAgC,kBAAkB,oCAAoC;AAAA,EACtF,eAAe,kBA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AAA,IAClB,aAAa,mBAAmB,oBAAoB,WAAW;AAAA,IAC/D,YAAY,OAAO,4BAA4B;AAC9C,UAAI,CAAC,eAAe;AACnB,cAAM,IAAI,wBAAwB,yBAAyB;AAAA,MAC5D;AAEA,YAAM,gBAAgB,wBAAwB,WAAW;AACzD,UAAI,CAAC,eAAe;AACnB,cAAM,IAAI;AAAA,UACT;AAAA,QACD;AAAA,MACD;AAEA,YAAM,6BAA6B,cAAc,SAAS,yBAAyB;AACnF,UAAI,4BAA4B;AAC/B,eAAO,MAAM,2BAA2B,oBAAoB;AAAA,UAC3D,GAAG;AAAA,UACH,SAAS;AAAA,QACV,CAAC;AAAA,MACF;AAGA,YAAM,qBAAqB,cAAc,SAAS,iBAAiB;AACnE,UAAI,oBAAoB;AACvB,gBAAQ;AAAA,UACP;AAAA,QACD;AAEA,cAAM,EAAE,cAAc,UAAU,IAAI,MAAM,mBAAmB,YAAY;AAAA,UACxE,GAAG;AAAA,UACH,SAAS;AAAA,QACV,CAAC;AACD,eAAO,EAAE,OAAO,cAAc,UAAU;AAAA,MACzC;AAEA,YAAM,IAAI;AAAA,QACT;AAAA,MACD;AAAA,IACD;AAAA,IACA,GAAG;AAAA,EACJ,CAAC;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1536,16 +1536,27 @@ function useSignPersonalMessage({
|
|
|
1536
1536
|
"No wallet account is selected to sign the personal message with."
|
|
1537
1537
|
);
|
|
1538
1538
|
}
|
|
1539
|
-
const
|
|
1540
|
-
if (
|
|
1541
|
-
|
|
1542
|
-
|
|
1539
|
+
const signPersonalMessageFeature = currentWallet.features["sui:signPersonalMessage"];
|
|
1540
|
+
if (signPersonalMessageFeature) {
|
|
1541
|
+
return await signPersonalMessageFeature.signPersonalMessage({
|
|
1542
|
+
...signPersonalMessageArgs,
|
|
1543
|
+
account: signerAccount
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
const signMessageFeature = currentWallet.features["sui:signMessage"];
|
|
1547
|
+
if (signMessageFeature) {
|
|
1548
|
+
console.warn(
|
|
1549
|
+
"This wallet doesn't support the `signPersonalMessage` feature... falling back to `signMessage`."
|
|
1543
1550
|
);
|
|
1551
|
+
const { messageBytes, signature } = await signMessageFeature.signMessage({
|
|
1552
|
+
...signPersonalMessageArgs,
|
|
1553
|
+
account: signerAccount
|
|
1554
|
+
});
|
|
1555
|
+
return { bytes: messageBytes, signature };
|
|
1544
1556
|
}
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
});
|
|
1557
|
+
throw new WalletFeatureNotSupportedError(
|
|
1558
|
+
"This wallet doesn't support the `signPersonalMessage` feature."
|
|
1559
|
+
);
|
|
1549
1560
|
},
|
|
1550
1561
|
...mutationOptions
|
|
1551
1562
|
});
|