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

@blocto/sdk

Package Overview
Dependencies
Maintainers
3
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocto/sdk - npm Package Compare versions

Comparing version 0.2.11-beta.1 to 0.2.11-beta.2

2

dist/blocto-sdk.d.ts

@@ -49,3 +49,3 @@ /// <reference types="typescript" />

connect(): Promise<string[]>;
connect(): Promise<void>;
disconnect(): void;

@@ -52,0 +52,0 @@ request(params: { method: string }): Promise<any>;

{
"name": "@blocto/sdk",
"version": "0.2.11-beta.1",
"version": "0.2.11-beta.2",
"author": "Yang Lin",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -43,3 +43,3 @@ import invariant from 'invariant';

const existedSDK = (window as any).solana;
if (existedSDK && existedSDK.isBlocto) {
if (existedSDK && existedSDK.isBlocto && payload.method !== 'getAccounts') {
return existedSDK.request(payload);

@@ -85,8 +85,11 @@ }

connect(): Promise<string[]> {
async connect(): Promise<void> {
const existedSDK = (window as any).solana;
if (existedSDK && existedSDK.isBlocto) {
return existedSDK.connect();
existedSDK.once('connect', (pubkey: PublicKey) => {
this.accounts = [pubkey.toString()];
});
await existedSDK.connect();
}
return new Promise((resolve: (v: string[]) => void, reject) => {
return new Promise((resolve: () => void, reject) => {
if (typeof window === 'undefined') { reject('Currently only supported in browser'); }

@@ -111,3 +114,3 @@ const location = encodeURIComponent(window.location.origin);

this.accounts = [e.data.addr];
resolve(this.accounts as Array<string>);
resolve();
}

@@ -114,0 +117,0 @@

@@ -17,3 +17,3 @@ import { Connection, Transaction } from '@solana/web3.js';

connect(): Promise<string[]>;
connect(): Promise<void>;
disconnect(): void;

@@ -20,0 +20,0 @@ request(params: { method: string }): Promise<any>;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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