New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aptos-connect/web-transport

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aptos-connect/web-transport - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

3

dist/index.d.ts

@@ -5,3 +5,4 @@ import { SerializedWalletRequest } from '@aptos-connect/wallet-api';

private readonly provider;
constructor(baseUrl: string, provider?: 'google' | 'apple');
private readonly tgWebAppUrl?;
constructor(baseUrl: string, provider?: 'google' | 'apple', tgWebAppUrl?: string | undefined);
sendPromptRequest(request: SerializedWalletRequest): Promise<import("@aptos-connect/wallet-api").SerializedWalletResponse>;

@@ -8,0 +9,0 @@ sendRequest(request: SerializedWalletRequest): Promise<import("@aptos-connect/wallet-api").SerializedWalletResponse>;

@@ -249,3 +249,4 @@ "use strict";

// src/telegram/openTelegramPrompt.ts
async function openTelegramPrompt(baseUrl, request) {
async function openTelegramPrompt(args) {
const { baseUrl, request: body, tgWebAppUrl = "/AptosConnectBot/AptosConnect" } = args;
const identityKey = getClientIdentityKey();

@@ -255,6 +256,6 @@ const clientIdentityKey = identityKey.publicKey();

const timestamp = Date.now();
const challenge = (0, import_wallet_api5.makePopupWalletRequestChallenge)({ body: request, id: requestId, timestamp });
const challenge = (0, import_wallet_api5.makePopupWalletRequestChallenge)({ body, id: requestId, timestamp });
const signature = identityKey.sign(challenge);
const signedWalletRequest = {
body: request,
body,
clientIdentityKey,

@@ -276,3 +277,3 @@ id: requestId,

(0, import_bridge.postEvent)("web_app_open_tg_link", {
path_full: `/AptosConnectBot/AptosConnect?startapp=${encodedRequest}`
path_full: `${tgWebAppUrl}?startapp=${encodedRequest}`
});

@@ -289,5 +290,6 @@ return getWalletResponse(baseUrl, clientIdentityKey, requestId);

var WebWalletTransport = class {
constructor(baseUrl, provider = "google") {
constructor(baseUrl, provider = "google", tgWebAppUrl) {
this.baseUrl = baseUrl;
this.provider = provider;
this.tgWebAppUrl = tgWebAppUrl;
this.baseUrl = baseUrl;

@@ -297,3 +299,7 @@ }

if (isTelegramMiniApp()) {
return openTelegramPrompt(this.baseUrl, request);
return openTelegramPrompt({
baseUrl: this.baseUrl,
request,
tgWebAppUrl: this.tgWebAppUrl
});
}

@@ -300,0 +306,0 @@ const url = new URL(`${this.baseUrl}/prompt/`);

import { SerializedWalletRequest } from '@aptos-connect/wallet-api';
export declare function openTelegramPrompt(baseUrl: string, request: SerializedWalletRequest): Promise<import("@aptos-connect/wallet-api").SerializedWalletResponse>;
export declare function openTelegramPrompt(args: {
baseUrl: string;
request: SerializedWalletRequest;
tgWebAppUrl?: string;
}): Promise<import("@aptos-connect/wallet-api").SerializedWalletResponse>;
//# sourceMappingURL=openTelegramPrompt.d.ts.map
{
"name": "@aptos-connect/web-transport",
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -28,2 +28,3 @@ // Copyright © Aptos

private readonly provider: 'google' | 'apple' = 'google',
private readonly tgWebAppUrl?: string,
) {

@@ -35,3 +36,7 @@ this.baseUrl = baseUrl;

if (isTelegramMiniApp()) {
return openTelegramPrompt(this.baseUrl, request);
return openTelegramPrompt({
baseUrl: this.baseUrl,
request,
tgWebAppUrl: this.tgWebAppUrl,
});
}

@@ -38,0 +43,0 @@

@@ -16,3 +16,8 @@ // Copyright © Aptos

export async function openTelegramPrompt(baseUrl: string, request: SerializedWalletRequest) {
export async function openTelegramPrompt(args: {
baseUrl: string;
request: SerializedWalletRequest;
tgWebAppUrl?: string;
}) {
const { baseUrl, request: body, tgWebAppUrl = '/AptosConnectBot/AptosConnect' } = args;
const identityKey = getClientIdentityKey();

@@ -23,7 +28,7 @@ const clientIdentityKey = identityKey.publicKey();

const challenge = makePopupWalletRequestChallenge({ body: request, id: requestId, timestamp });
const challenge = makePopupWalletRequestChallenge({ body, id: requestId, timestamp });
const signature = identityKey.sign(challenge);
const signedWalletRequest: SignedPopupWalletRequest = {
body: request,
body,
clientIdentityKey,

@@ -50,3 +55,3 @@ id: requestId,

postTelegramEvent('web_app_open_tg_link', {
path_full: `/AptosConnectBot/AptosConnect?startapp=${encodedRequest}`,
path_full: `${tgWebAppUrl}?startapp=${encodedRequest}`,
});

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

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

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