@mysten/wallet-standard 0.6.0 → 0.7.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/detect.d.ts +5 -4
- package/dist/features/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/detect.ts +6 -19
- package/src/features/index.ts +13 -2
- package/src/chains.ts.rej +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @mysten/wallet-standard
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 85f785c97: Rebuild wallet kit and wallet standard to no longer use wallet adapters.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [ba8e3b857]
|
|
12
|
+
- Updated dependencies [f4b7b3474]
|
|
13
|
+
- @mysten/sui.js@0.41.0
|
|
14
|
+
|
|
3
15
|
## 0.6.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/detect.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import { Wallet } from '@wallet-standard/core';
|
|
2
|
+
import { WalletWithSuiFeatures } from './features';
|
|
3
|
+
export declare function isWalletWithSuiFeatures(wallet: Wallet,
|
|
4
|
+
/** Extra features that are required to be present, in addition to the expected feature set. */
|
|
5
|
+
features?: string[]): wallet is WalletWithSuiFeatures;
|
package/dist/features/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WalletWithFeatures } from '@wallet-standard/core';
|
|
1
|
+
import type { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, WalletWithFeatures } from '@wallet-standard/core';
|
|
2
2
|
import type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock';
|
|
3
3
|
import type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock';
|
|
4
4
|
import { SuiSignMessageFeature } from './suiSignMessage';
|
|
@@ -7,7 +7,7 @@ import { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage';
|
|
|
7
7
|
* Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement.
|
|
8
8
|
*/
|
|
9
9
|
export type SuiFeatures = SuiSignTransactionBlockFeature & SuiSignAndExecuteTransactionBlockFeature & SuiSignPersonalMessageFeature & Partial<SuiSignMessageFeature>;
|
|
10
|
-
export type WalletWithSuiFeatures = WalletWithFeatures<SuiFeatures
|
|
10
|
+
export type WalletWithSuiFeatures = WalletWithFeatures<StandardConnectFeature & StandardEventsFeature & SuiFeatures & Partial<StandardDisconnectFeature>>;
|
|
11
11
|
export * from './suiSignMessage';
|
|
12
12
|
export * from './suiSignTransactionBlock';
|
|
13
13
|
export * from './suiSignAndExecuteTransactionBlock';
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ __export(src_exports, {
|
|
|
26
26
|
SUI_LOCALNET_CHAIN: () => SUI_LOCALNET_CHAIN,
|
|
27
27
|
SUI_MAINNET_CHAIN: () => SUI_MAINNET_CHAIN,
|
|
28
28
|
SUI_TESTNET_CHAIN: () => SUI_TESTNET_CHAIN,
|
|
29
|
-
|
|
29
|
+
isWalletWithSuiFeatures: () => isWalletWithSuiFeatures
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(src_exports);
|
|
32
32
|
__reExport(src_exports, require("@wallet-standard/core"), module.exports);
|
|
@@ -36,7 +36,7 @@ var REQUIRED_FEATURES = [
|
|
|
36
36
|
"standard:connect",
|
|
37
37
|
"standard:events"
|
|
38
38
|
];
|
|
39
|
-
function
|
|
39
|
+
function isWalletWithSuiFeatures(wallet, features = []) {
|
|
40
40
|
return [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -58,7 +58,7 @@ var SUI_CHAINS = [
|
|
|
58
58
|
SUI_LOCALNET_CHAIN,
|
|
59
59
|
SUI_MAINNET_CHAIN,
|
|
60
60
|
SUI_TESTNET_CHAIN,
|
|
61
|
-
|
|
61
|
+
isWalletWithSuiFeatures,
|
|
62
62
|
...require("@wallet-standard/core")
|
|
63
63
|
});
|
|
64
64
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/detect.ts","../src/chains.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from '@wallet-standard/core';\n\nexport * from './features';\nexport * from './detect';\nexport * from './chains';\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/detect.ts","../src/chains.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from '@wallet-standard/core';\n\nexport * from './features';\nexport * from './detect';\nexport * from './chains';\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Wallet } from '@wallet-standard/core';\nimport { WalletWithSuiFeatures } from './features';\n\n// These features are absolutely required for wallets to function in the Sui ecosystem.\n// Eventually, as wallets have more consistent support of features, we may want to extend this list.\nconst REQUIRED_FEATURES: (keyof WalletWithSuiFeatures['features'])[] = [\n\t'standard:connect',\n\t'standard:events',\n];\n\nexport function isWalletWithSuiFeatures(\n\twallet: Wallet,\n\t/** Extra features that are required to be present, in addition to the expected feature set. */\n\tfeatures: string[] = [],\n): wallet is WalletWithSuiFeatures {\n\treturn [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/** Sui Devnet */\nexport const SUI_DEVNET_CHAIN = 'sui:devnet';\n\n/** Sui Testnet */\nexport const SUI_TESTNET_CHAIN = 'sui:testnet';\n\n/** Sui Localnet */\nexport const SUI_LOCALNET_CHAIN = 'sui:localnet';\n\n/** Sui Mainnet */\nexport const SUI_MAINNET_CHAIN = 'sui:mainnet';\n\nexport const SUI_CHAINS = [\n\tSUI_DEVNET_CHAIN,\n\tSUI_TESTNET_CHAIN,\n\tSUI_LOCALNET_CHAIN,\n\tSUI_MAINNET_CHAIN,\n] as const;\n\nexport type SuiChain =\n\t| typeof SUI_DEVNET_CHAIN\n\t| typeof SUI_TESTNET_CHAIN\n\t| typeof SUI_LOCALNET_CHAIN\n\t| typeof SUI_MAINNET_CHAIN;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAc,kCAHd;;;ACQA,IAAM,oBAAiE;AAAA,EACtE;AAAA,EACA;AACD;AAEO,SAAS,wBACf,QAEA,WAAqB,CAAC,GACY;AAClC,SAAO,CAAC,GAAG,mBAAmB,GAAG,QAAQ,EAAE,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ;AACzF;;;ACfO,IAAM,mBAAmB;AAGzB,IAAM,oBAAoB;AAG1B,IAAM,qBAAqB;AAG3B,IAAM,oBAAoB;AAE1B,IAAM,aAAa;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var REQUIRED_FEATURES = [
|
|
|
6
6
|
"standard:connect",
|
|
7
7
|
"standard:events"
|
|
8
8
|
];
|
|
9
|
-
function
|
|
9
|
+
function isWalletWithSuiFeatures(wallet, features = []) {
|
|
10
10
|
return [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -27,6 +27,6 @@ export {
|
|
|
27
27
|
SUI_LOCALNET_CHAIN,
|
|
28
28
|
SUI_MAINNET_CHAIN,
|
|
29
29
|
SUI_TESTNET_CHAIN,
|
|
30
|
-
|
|
30
|
+
isWalletWithSuiFeatures
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/detect.ts","../src/chains.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from '@wallet-standard/core';\n\nexport * from './features';\nexport * from './detect';\nexport * from './chains';\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/detect.ts","../src/chains.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from '@wallet-standard/core';\n\nexport * from './features';\nexport * from './detect';\nexport * from './chains';\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Wallet } from '@wallet-standard/core';\nimport { WalletWithSuiFeatures } from './features';\n\n// These features are absolutely required for wallets to function in the Sui ecosystem.\n// Eventually, as wallets have more consistent support of features, we may want to extend this list.\nconst REQUIRED_FEATURES: (keyof WalletWithSuiFeatures['features'])[] = [\n\t'standard:connect',\n\t'standard:events',\n];\n\nexport function isWalletWithSuiFeatures(\n\twallet: Wallet,\n\t/** Extra features that are required to be present, in addition to the expected feature set. */\n\tfeatures: string[] = [],\n): wallet is WalletWithSuiFeatures {\n\treturn [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);\n}\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/** Sui Devnet */\nexport const SUI_DEVNET_CHAIN = 'sui:devnet';\n\n/** Sui Testnet */\nexport const SUI_TESTNET_CHAIN = 'sui:testnet';\n\n/** Sui Localnet */\nexport const SUI_LOCALNET_CHAIN = 'sui:localnet';\n\n/** Sui Mainnet */\nexport const SUI_MAINNET_CHAIN = 'sui:mainnet';\n\nexport const SUI_CHAINS = [\n\tSUI_DEVNET_CHAIN,\n\tSUI_TESTNET_CHAIN,\n\tSUI_LOCALNET_CHAIN,\n\tSUI_MAINNET_CHAIN,\n] as const;\n\nexport type SuiChain =\n\t| typeof SUI_DEVNET_CHAIN\n\t| typeof SUI_TESTNET_CHAIN\n\t| typeof SUI_LOCALNET_CHAIN\n\t| typeof SUI_MAINNET_CHAIN;\n"],"mappings":";AAGA,cAAc;;;ACKd,IAAM,oBAAiE;AAAA,EACtE;AAAA,EACA;AACD;AAEO,SAAS,wBACf,QAEA,WAAqB,CAAC,GACY;AAClC,SAAO,CAAC,GAAG,mBAAmB,GAAG,QAAQ,EAAE,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ;AACzF;;;ACfO,IAAM,mBAAmB;AAGzB,IAAM,oBAAoB;AAG1B,IAAM,qBAAqB;AAG3B,IAAM,oBAAoB;AAE1B,IAAM,aAAa;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysten/wallet-standard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A suite of standard utilities for implementing wallets based on the Wallet Standard.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@wallet-standard/core": "1.0.3",
|
|
25
|
-
"@mysten/sui.js": "0.
|
|
25
|
+
"@mysten/sui.js": "0.41.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"tsup": "^7.1.0",
|
package/src/detect.ts
CHANGED
|
@@ -1,33 +1,20 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
StandardDisconnectFeature,
|
|
7
|
-
StandardEventsFeature,
|
|
8
|
-
Wallet,
|
|
9
|
-
WalletWithFeatures,
|
|
10
|
-
} from '@wallet-standard/core';
|
|
11
|
-
import { SuiFeatures } from './features';
|
|
12
|
-
|
|
13
|
-
export type StandardWalletAdapterWallet = WalletWithFeatures<
|
|
14
|
-
StandardConnectFeature &
|
|
15
|
-
StandardEventsFeature &
|
|
16
|
-
SuiFeatures &
|
|
17
|
-
// Disconnect is an optional feature:
|
|
18
|
-
Partial<StandardDisconnectFeature>
|
|
19
|
-
>;
|
|
4
|
+
import { Wallet } from '@wallet-standard/core';
|
|
5
|
+
import { WalletWithSuiFeatures } from './features';
|
|
20
6
|
|
|
21
7
|
// These features are absolutely required for wallets to function in the Sui ecosystem.
|
|
22
8
|
// Eventually, as wallets have more consistent support of features, we may want to extend this list.
|
|
23
|
-
const REQUIRED_FEATURES: (keyof
|
|
9
|
+
const REQUIRED_FEATURES: (keyof WalletWithSuiFeatures['features'])[] = [
|
|
24
10
|
'standard:connect',
|
|
25
11
|
'standard:events',
|
|
26
12
|
];
|
|
27
13
|
|
|
28
|
-
export function
|
|
14
|
+
export function isWalletWithSuiFeatures(
|
|
29
15
|
wallet: Wallet,
|
|
16
|
+
/** Extra features that are required to be present, in addition to the expected feature set. */
|
|
30
17
|
features: string[] = [],
|
|
31
|
-
): wallet is
|
|
18
|
+
): wallet is WalletWithSuiFeatures {
|
|
32
19
|
return [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);
|
|
33
20
|
}
|
package/src/features/index.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
StandardConnectFeature,
|
|
6
|
+
StandardDisconnectFeature,
|
|
7
|
+
StandardEventsFeature,
|
|
8
|
+
WalletWithFeatures,
|
|
9
|
+
} from '@wallet-standard/core';
|
|
5
10
|
import type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock';
|
|
6
11
|
import type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock';
|
|
7
12
|
import { SuiSignMessageFeature } from './suiSignMessage';
|
|
@@ -16,7 +21,13 @@ export type SuiFeatures = SuiSignTransactionBlockFeature &
|
|
|
16
21
|
// This deprecated feature should be removed once wallets update to the new method:
|
|
17
22
|
Partial<SuiSignMessageFeature>;
|
|
18
23
|
|
|
19
|
-
export type WalletWithSuiFeatures = WalletWithFeatures<
|
|
24
|
+
export type WalletWithSuiFeatures = WalletWithFeatures<
|
|
25
|
+
StandardConnectFeature &
|
|
26
|
+
StandardEventsFeature &
|
|
27
|
+
SuiFeatures &
|
|
28
|
+
// Disconnect is an optional feature:
|
|
29
|
+
Partial<StandardDisconnectFeature>
|
|
30
|
+
>;
|
|
20
31
|
|
|
21
32
|
export * from './suiSignMessage';
|
|
22
33
|
export * from './suiSignTransactionBlock';
|
package/src/chains.ts.rej
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
diff a/sdk/wallet-adapter/wallet-standard/src/chains.ts b/sdk/wallet-adapter/wallet-standard/src/chains.ts (rejected hunks)
|
|
2
|
-
@@ -10,13 +10,18 @@ export const SUI_TESTNET_CHAIN = "sui:testnet";
|
|
3
|
-
/** Sui Localnet */
|
|
4
|
-
export const SUI_LOCALNET_CHAIN = "sui:localnet";
|
|
5
|
-
|
|
6
|
-
+/** Sui Mainnet */
|
|
7
|
-
+export const SUI_MAINNET_CHAIN = "sui:mainnet";
|
|
8
|
-
+
|
|
9
|
-
export const SUI_CHAINS = [
|
|
10
|
-
SUI_DEVNET_CHAIN,
|
|
11
|
-
SUI_TESTNET_CHAIN,
|
|
12
|
-
SUI_LOCALNET_CHAIN,
|
|
13
|
-
+ SUI_MAINNET_CHAIN,
|
|
14
|
-
] as const;
|
|
15
|
-
|
|
16
|
-
export type SuiChain =
|
|
17
|
-
| typeof SUI_DEVNET_CHAIN
|
|
18
|
-
| typeof SUI_TESTNET_CHAIN
|
|
19
|
-
- | typeof SUI_LOCALNET_CHAIN;
|
|
20
|
-
+ | typeof SUI_LOCALNET_CHAIN
|
|
21
|
-
+ | typeof SUI_MAINNET_CHAIN;
|