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.2 to 0.2.11-beta.3

2

dist/blocto-sdk.d.ts

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

connect(): Promise<void>;
disconnect(): void;
disconnect(): Promise<void> ;
request(params: { method: string }): Promise<any>;

@@ -53,0 +53,0 @@

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

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

@@ -20,3 +20,2 @@ import invariant from 'invariant';

}
export default class SolanaProvider extends BloctoProvider implements SolanaProviderInterface {

@@ -43,7 +42,2 @@ code: string | null = null;

async request(payload: SolanaRequest) {
const existedSDK = (window as any).solana;
if (existedSDK && existedSDK.isBlocto && payload.method !== 'getAccounts') {
return existedSDK.request(payload);
}
if (!this.connected) {

@@ -60,2 +54,5 @@ await this.connect();

break;
case 'disconnect':
this.disconnect();
break;
case 'getAccounts':

@@ -90,6 +87,9 @@ result = this.accounts.length ? this.accounts : await this.fetchAccounts();

if (existedSDK && existedSDK.isBlocto) {
existedSDK.once('connect', (pubkey: PublicKey) => {
this.accounts = [pubkey.toString()];
return new Promise((resolve) => {
existedSDK.once('connect', (pubkey: PublicKey) => {
this.accounts = [pubkey.toBase58()];
resolve();
});
existedSDK.connect();
});
await existedSDK.connect();
}

@@ -129,3 +129,8 @@ return new Promise((resolve: () => void, reject) => {

disconnect(): void {
async disconnect(): Promise<void> {
const existedSDK = (window as any).solana;
if (existedSDK && existedSDK.isBlocto) {
await existedSDK.dicconnect();
return;
}
this.code = null;

@@ -156,2 +161,6 @@ this.accounts = [];

async convertToProgramWalletTransaction(transaction: Transaction): Promise<Transaction> {
const existedSDK = (window as any).solana;
if (existedSDK && existedSDK.isBlocto) {
return existedSDK.convertToProgramWalletTransaction(transaction);
}
const message = await this.request({

@@ -168,2 +177,6 @@ method: 'convertToProgramWalletTransaction',

async signAndSendTransaction(transaction: Transaction, connection?: Connection): Promise<string> {
const existedSDK = (window as any).solana;
if (existedSDK && existedSDK.isBlocto) {
return existedSDK.signAndSendTransaction(transaction);
}
const extra: any = {};

@@ -170,0 +183,0 @@ if (connection) {

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

connect(): Promise<void>;
disconnect(): void;
disconnect(): Promise<void> ;
request(params: { method: string }): Promise<any>;

@@ -21,0 +21,0 @@

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