Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mysten/wallet-standard

Package Overview
Dependencies
Maintainers
4
Versions
773
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mysten/wallet-standard - npm Package Compare versions

Comparing version 0.0.0-experimental-20221026202654 to 0.0.0-experimental-20221027185422

10

CHANGELOG.md
# @mysten/wallet-standard
## 0.0.0-experimental-20221026202654
## 0.0.0-experimental-20221027185422
### Minor Changes
- 56de8448f: Update wallet standard adapters to use new wallet registration logic.
## 0.1.2
### Patch Changes

@@ -15,3 +21,3 @@

- Updated dependencies [4f0c611ff]
- @mysten/sui.js@0.0.0-experimental-20221026202654
- @mysten/sui.js@0.14.0

@@ -18,0 +24,0 @@ ## 0.1.1

3

dist/detect.d.ts

@@ -1,5 +0,4 @@

import { ConnectFeature, DisconnectFeature, EventsFeature } from "@wallet-standard/features";
import { Wallet, WalletWithFeatures } from "@wallet-standard/standard";
import { ConnectFeature, DisconnectFeature, EventsFeature, Wallet, WalletWithFeatures } from "@wallet-standard/core";
import { SuiSignAndExecuteTransactionFeature } from "./features";
export declare type StandardWalletAdapterWallet = WalletWithFeatures<ConnectFeature & EventsFeature & SuiSignAndExecuteTransactionFeature & Partial<DisconnectFeature>>;
export declare function isStandardWalletAdapterCompatibleWallet(wallet: Wallet): wallet is StandardWalletAdapterWallet;

@@ -1,2 +0,2 @@

import type { WalletWithFeatures } from "@wallet-standard/standard";
import type { WalletWithFeatures } from "@wallet-standard/core";
import type { SuiSignAndExecuteTransactionFeature } from "./suiSignAndExecuteTransaction";

@@ -3,0 +3,0 @@ /**

import type { SignableTransaction, SuiTransactionResponse } from "@mysten/sui.js";
import type { SignAndSendTransactionInput } from "@wallet-standard/features";
import type { SignAndSendTransactionInput } from "@wallet-standard/core";
/** The latest API version of the signAndExecuteTransaction API. */

@@ -4,0 +4,0 @@ export declare type SuiSignAndExecuteTransactionVersion = "1.0.0";

@@ -1,6 +0,4 @@

export * from '@wallet-standard/standard';
export * from '@wallet-standard/features';
export * from '@wallet-standard/util';
export * from '@wallet-standard/core';
export * from "./features";
export * from "./detect";
export * from './chains';

@@ -31,5 +31,3 @@ "use strict";

module.exports = __toCommonJS(src_exports);
__reExport(src_exports, require("@wallet-standard/standard"), module.exports);
__reExport(src_exports, require("@wallet-standard/features"), module.exports);
__reExport(src_exports, require("@wallet-standard/util"), module.exports);
__reExport(src_exports, require("@wallet-standard/core"), module.exports);

@@ -36,0 +34,0 @@ // src/detect.ts

{
"name": "@mysten/wallet-standard",
"version": "0.0.0-experimental-20221026202654",
"version": "0.0.0-experimental-20221027185422",
"description": "A suite of standard utilities for implementing wallets based on the Wallet Standard.",

@@ -22,6 +22,4 @@ "license": "Apache-2.0",

"dependencies": {
"@mysten/sui.js": "0.0.0-experimental-20221026202654",
"@wallet-standard/features": "0.1.0-alpha.4",
"@wallet-standard/standard": "0.1.0-alpha.5",
"@wallet-standard/util": "0.1.0-alpha.6"
"@mysten/sui.js": "0.14.0",
"@wallet-standard/core": "1.0.0-rc.5"
},

@@ -28,0 +26,0 @@ "devDependencies": {

@@ -75,9 +75,9 @@ # `@mysten/wallet-standard`

#connect: ConnectMethod = () => {
// Your wallet's connect implementation
};
#connect: ConnectMethod = () => {
// Your wallet's connect implementation
};
#signAndExecuteTransaction: SuiSignAndExecuteTransactionMethod = () => {
// Your wallet's signAndExecuteTransaction implementation
};
#signAndExecuteTransaction: SuiSignAndExecuteTransactionMethod = () => {
// Your wallet's signAndExecuteTransaction implementation
};
}

@@ -108,3 +108,3 @@ ```

// These features must exist on the wallet as well.
features: ["sui:signAndExecuteTransaction", "standard:signMessage"],
features: ["sui:signAndExecuteTransaction"],
})

@@ -118,13 +118,10 @@ );

Once you have a compatible interface for your wallet, you can register it in the window under the `window.navigator.wallets` interface. Wallets self-register by pushing their standard wallet interface to this array-like interface.
Once you have a compatible interface for your wallet, you can register it using the `registerWallet` function.
```typescript
// This makes TypeScript aware of the `window.navigator.wallets` interface.
declare const window: import("@mysten/wallet-standard").WalletsWindow;
import { registerWallet } from '@mysten/wallet-standard';
(window.navigator.wallets || []).push(({ register }) => {
register(new YourWallet());
});
registerWallet(new YourWallet());
```
> Note that while this interface is array-like, it is not always an array, and the only method that should be called on it is `push`.
> 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).

@@ -8,4 +8,5 @@ // Copyright (c) Mysten Labs, Inc.

EventsFeature,
} from "@wallet-standard/features";
import { Wallet, WalletWithFeatures } from "@wallet-standard/standard";
Wallet,
WalletWithFeatures,
} from "@wallet-standard/core";
import { SuiSignAndExecuteTransactionFeature } from "./features";

@@ -12,0 +13,0 @@

// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import type { WalletWithFeatures } from "@wallet-standard/standard";
import type { WalletWithFeatures } from "@wallet-standard/core";
import type { SuiSignAndExecuteTransactionFeature } from "./suiSignAndExecuteTransaction";

@@ -6,0 +6,0 @@

@@ -8,3 +8,3 @@ // Copyright (c) Mysten Labs, Inc.

} from "@mysten/sui.js";
import type { SignAndSendTransactionInput } from "@wallet-standard/features";
import type { SignAndSendTransactionInput } from "@wallet-standard/core";

@@ -11,0 +11,0 @@ /** The latest API version of the signAndExecuteTransaction API. */

// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
export * from '@wallet-standard/standard';
export * from '@wallet-standard/features';
export * from '@wallet-standard/util';
export * from '@wallet-standard/core';

@@ -8,0 +6,0 @@ export * from "./features";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc