@mysten/wallet-standard 0.1.2 → 0.2.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 +15 -0
- package/README.md +11 -14
- package/dist/detect.d.ts +1 -2
- package/dist/features/index.d.ts +1 -1
- package/dist/features/suiSignAndExecuteTransaction.d.ts +2 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -5
- package/src/detect.ts +3 -2
- package/src/features/index.ts +1 -1
- package/src/features/suiSignAndExecuteTransaction.ts +2 -9
- package/src/index.ts +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @mysten/wallet-standard
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e97d280d7: Update to 1.0 release of wallet standard
|
|
8
|
+
- 56de8448f: Update wallet standard adapters to use new wallet registration logic.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [c27933292]
|
|
13
|
+
- Updated dependencies [90898d366]
|
|
14
|
+
- Updated dependencies [c27933292]
|
|
15
|
+
- Updated dependencies [c27933292]
|
|
16
|
+
- @mysten/sui.js@0.15.0
|
|
17
|
+
|
|
3
18
|
## 0.1.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -72,13 +72,13 @@ class YourWallet implements Wallet {
|
|
|
72
72
|
// Your wallet's events on implementation.
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
#connect: ConnectMethod = () => {
|
|
76
|
+
// Your wallet's connect implementation
|
|
77
|
+
};
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
#signAndExecuteTransaction: SuiSignAndExecuteTransactionMethod = () => {
|
|
80
|
+
// Your wallet's signAndExecuteTransaction implementation
|
|
81
|
+
};
|
|
82
82
|
}
|
|
83
83
|
```
|
|
84
84
|
|
|
@@ -104,7 +104,7 @@ class YourWallet implements Wallet {
|
|
|
104
104
|
chains: [SUI_DEVNET_CHAIN],
|
|
105
105
|
// The features that this account supports. This can be a subset of the wallet's supported features.
|
|
106
106
|
// These features must exist on the wallet as well.
|
|
107
|
-
features: ["sui:signAndExecuteTransaction"
|
|
107
|
+
features: ["sui:signAndExecuteTransaction"],
|
|
108
108
|
})
|
|
109
109
|
);
|
|
110
110
|
}
|
|
@@ -113,15 +113,12 @@ class YourWallet implements Wallet {
|
|
|
113
113
|
|
|
114
114
|
### Registering in the window
|
|
115
115
|
|
|
116
|
-
Once you have a compatible interface for your wallet, you can register it
|
|
116
|
+
Once you have a compatible interface for your wallet, you can register it using the `registerWallet` function.
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
|
-
|
|
120
|
-
declare const window: import("@mysten/wallet-standard").WalletsWindow;
|
|
119
|
+
import { registerWallet } from '@mysten/wallet-standard';
|
|
121
120
|
|
|
122
|
-
(
|
|
123
|
-
register(new YourWallet());
|
|
124
|
-
});
|
|
121
|
+
registerWallet(new YourWallet());
|
|
125
122
|
```
|
|
126
123
|
|
|
127
|
-
>
|
|
124
|
+
> If you're interested in the internal implementation of the `registerWallet` method, you can [see how it works here](https://github.com/wallet-standard/wallet-standard/blob/b4794e761de688906827829d5380b24cb8ed5fd5/packages/core/wallet/src/register.ts#L9).
|
package/dist/detect.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ConnectFeature, DisconnectFeature, EventsFeature } from "@wallet-standard/
|
|
2
|
-
import { Wallet, WalletWithFeatures } from "@wallet-standard/standard";
|
|
1
|
+
import { ConnectFeature, DisconnectFeature, EventsFeature, Wallet, WalletWithFeatures } from "@wallet-standard/core";
|
|
3
2
|
import { SuiSignAndExecuteTransactionFeature } from "./features";
|
|
4
3
|
export declare type StandardWalletAdapterWallet = WalletWithFeatures<ConnectFeature & EventsFeature & SuiSignAndExecuteTransactionFeature & Partial<DisconnectFeature>>;
|
|
5
4
|
export declare function isStandardWalletAdapterCompatibleWallet(wallet: Wallet): wallet is StandardWalletAdapterWallet;
|
package/dist/features/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WalletWithFeatures } from "@wallet-standard/
|
|
1
|
+
import type { WalletWithFeatures } from "@wallet-standard/core";
|
|
2
2
|
import type { SuiSignAndExecuteTransactionFeature } from "./suiSignAndExecuteTransaction";
|
|
3
3
|
/**
|
|
4
4
|
* Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { SignableTransaction, SuiTransactionResponse } from "@mysten/sui.js";
|
|
2
|
-
import type { SignAndSendTransactionInput } from "@wallet-standard/features";
|
|
3
2
|
/** The latest API version of the signAndExecuteTransaction API. */
|
|
4
3
|
export declare type SuiSignAndExecuteTransactionVersion = "1.0.0";
|
|
5
4
|
/**
|
|
@@ -17,9 +16,9 @@ export declare type SuiSignAndExecuteTransactionFeature = {
|
|
|
17
16
|
};
|
|
18
17
|
export declare type SuiSignAndExecuteTransactionMethod = (input: SuiSignAndExecuteTransactionInput) => Promise<SuiSignAndExecuteTransactionOutput>;
|
|
19
18
|
/** Input for signing and sending transactions. */
|
|
20
|
-
export interface SuiSignAndExecuteTransactionInput
|
|
21
|
-
options?: SuiSignAndExecuteTransactionOptions;
|
|
19
|
+
export interface SuiSignAndExecuteTransactionInput {
|
|
22
20
|
transaction: SignableTransaction;
|
|
21
|
+
options?: SuiSignAndExecuteTransactionOptions;
|
|
23
22
|
}
|
|
24
23
|
/** Output of signing and sending transactions. */
|
|
25
24
|
export interface SuiSignAndExecuteTransactionOutput extends SuiTransactionResponse {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -28,9 +28,7 @@ __export(src_exports, {
|
|
|
28
28
|
isStandardWalletAdapterCompatibleWallet: () => isStandardWalletAdapterCompatibleWallet
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(src_exports);
|
|
31
|
-
__reExport(src_exports, require("@wallet-standard/
|
|
32
|
-
__reExport(src_exports, require("@wallet-standard/features"), module.exports);
|
|
33
|
-
__reExport(src_exports, require("@wallet-standard/util"), module.exports);
|
|
31
|
+
__reExport(src_exports, require("@wallet-standard/core"), module.exports);
|
|
34
32
|
|
|
35
33
|
// src/detect.ts
|
|
36
34
|
function isStandardWalletAdapterCompatibleWallet(wallet) {
|
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/
|
|
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 {\n ConnectFeature,\n DisconnectFeature,\n EventsFeature,\n Wallet,\n WalletWithFeatures,\n} from \"@wallet-standard/core\";\nimport { SuiSignAndExecuteTransactionFeature } from \"./features\";\n\nexport type StandardWalletAdapterWallet = WalletWithFeatures<\n ConnectFeature &\n EventsFeature &\n SuiSignAndExecuteTransactionFeature &\n // Disconnect is an optional feature:\n Partial<DisconnectFeature>\n>;\n\nexport function isStandardWalletAdapterCompatibleWallet(\n wallet: Wallet\n): wallet is StandardWalletAdapterWallet {\n return (\n \"standard:connect\" in wallet.features &&\n \"standard:events\" in wallet.features &&\n \"sui:signAndExecuteTransaction\" in wallet.features\n );\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\nexport const SUI_CHAINS = [\n SUI_DEVNET_CHAIN,\n SUI_TESTNET_CHAIN,\n SUI_LOCALNET_CHAIN,\n] as const;\n\nexport type SuiChain =\n | typeof SUI_DEVNET_CHAIN\n | typeof SUI_TESTNET_CHAIN\n | typeof SUI_LOCALNET_CHAIN;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAc,kCAHd;;;ACoBO,SAAS,wCACd,QACuC;AACvC,SACE,sBAAsB,OAAO,YAC7B,qBAAqB,OAAO,YAC5B,mCAAmC,OAAO;AAE9C;;;ACxBO,IAAM,mBAAmB;AAGzB,IAAM,oBAAoB;AAG1B,IAAM,qBAAqB;AAE3B,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
export * from "@wallet-standard/
|
|
3
|
-
export * from "@wallet-standard/features";
|
|
4
|
-
export * from "@wallet-standard/util";
|
|
2
|
+
export * from "@wallet-standard/core";
|
|
5
3
|
|
|
6
4
|
// src/detect.ts
|
|
7
5
|
function isStandardWalletAdapterCompatibleWallet(wallet) {
|
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/
|
|
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 {\n ConnectFeature,\n DisconnectFeature,\n EventsFeature,\n Wallet,\n WalletWithFeatures,\n} from \"@wallet-standard/core\";\nimport { SuiSignAndExecuteTransactionFeature } from \"./features\";\n\nexport type StandardWalletAdapterWallet = WalletWithFeatures<\n ConnectFeature &\n EventsFeature &\n SuiSignAndExecuteTransactionFeature &\n // Disconnect is an optional feature:\n Partial<DisconnectFeature>\n>;\n\nexport function isStandardWalletAdapterCompatibleWallet(\n wallet: Wallet\n): wallet is StandardWalletAdapterWallet {\n return (\n \"standard:connect\" in wallet.features &&\n \"standard:events\" in wallet.features &&\n \"sui:signAndExecuteTransaction\" in wallet.features\n );\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\nexport const SUI_CHAINS = [\n SUI_DEVNET_CHAIN,\n SUI_TESTNET_CHAIN,\n SUI_LOCALNET_CHAIN,\n] as const;\n\nexport type SuiChain =\n | typeof SUI_DEVNET_CHAIN\n | typeof SUI_TESTNET_CHAIN\n | typeof SUI_LOCALNET_CHAIN;\n"],"mappings":";AAGA,cAAc;;;ACiBP,SAAS,wCACd,QACuC;AACvC,SACE,sBAAsB,OAAO,YAC7B,qBAAqB,OAAO,YAC5B,mCAAmC,OAAO;AAE9C;;;ACxBO,IAAM,mBAAmB;AAGzB,IAAM,oBAAoB;AAG1B,IAAM,qBAAqB;AAE3B,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysten/wallet-standard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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>",
|
|
@@ -19,10 +19,8 @@
|
|
|
19
19
|
"CHANGELOG.md"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mysten/sui.js": "0.
|
|
23
|
-
"@wallet-standard/
|
|
24
|
-
"@wallet-standard/standard": "0.1.0-alpha.5",
|
|
25
|
-
"@wallet-standard/util": "0.1.0-alpha.6"
|
|
22
|
+
"@mysten/sui.js": "0.15.0",
|
|
23
|
+
"@wallet-standard/core": "1.0.0"
|
|
26
24
|
},
|
|
27
25
|
"devDependencies": {
|
|
28
26
|
"tsup": "^6.2.2",
|
package/src/detect.ts
CHANGED
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
ConnectFeature,
|
|
6
6
|
DisconnectFeature,
|
|
7
7
|
EventsFeature,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
Wallet,
|
|
9
|
+
WalletWithFeatures,
|
|
10
|
+
} from "@wallet-standard/core";
|
|
10
11
|
import { SuiSignAndExecuteTransactionFeature } from "./features";
|
|
11
12
|
|
|
12
13
|
export type StandardWalletAdapterWallet = WalletWithFeatures<
|
package/src/features/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import type { WalletWithFeatures } from "@wallet-standard/
|
|
4
|
+
import type { WalletWithFeatures } from "@wallet-standard/core";
|
|
5
5
|
import type { SuiSignAndExecuteTransactionFeature } from "./suiSignAndExecuteTransaction";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -5,7 +5,6 @@ import type {
|
|
|
5
5
|
SignableTransaction,
|
|
6
6
|
SuiTransactionResponse,
|
|
7
7
|
} from "@mysten/sui.js";
|
|
8
|
-
import type { SignAndSendTransactionInput } from "@wallet-standard/features";
|
|
9
8
|
|
|
10
9
|
/** The latest API version of the signAndExecuteTransaction API. */
|
|
11
10
|
export type SuiSignAndExecuteTransactionVersion = "1.0.0";
|
|
@@ -29,15 +28,9 @@ export type SuiSignAndExecuteTransactionMethod = (
|
|
|
29
28
|
) => Promise<SuiSignAndExecuteTransactionOutput>;
|
|
30
29
|
|
|
31
30
|
/** Input for signing and sending transactions. */
|
|
32
|
-
export interface SuiSignAndExecuteTransactionInput
|
|
33
|
-
extends Omit<
|
|
34
|
-
SignAndSendTransactionInput,
|
|
35
|
-
// TODO: Right now, we don't have intent signing, but eventually we'll need to re-introduce
|
|
36
|
-
// the concept of chains + account during the signing here.
|
|
37
|
-
"transaction" | "chain" | "account"
|
|
38
|
-
> {
|
|
39
|
-
options?: SuiSignAndExecuteTransactionOptions;
|
|
31
|
+
export interface SuiSignAndExecuteTransactionInput {
|
|
40
32
|
transaction: SignableTransaction;
|
|
33
|
+
options?: SuiSignAndExecuteTransactionOptions;
|
|
41
34
|
}
|
|
42
35
|
|
|
43
36
|
/** Output of signing and sending transactions. */
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
export * from '@wallet-standard/
|
|
5
|
-
export * from '@wallet-standard/features';
|
|
6
|
-
export * from '@wallet-standard/util';
|
|
4
|
+
export * from '@wallet-standard/core';
|
|
7
5
|
|
|
8
6
|
export * from "./features";
|
|
9
7
|
export * from "./detect";
|