Socket
Socket
Sign inDemoInstall

@safe-global/safe-apps-sdk

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@safe-global/safe-apps-sdk - npm Package Compare versions

Comparing version 8.1.0 to 9.0.0-next.0

dist/cjs/communication/index.d.ts

6

CHANGELOG.md
# @safe-global/safe-apps-sdk
## 9.0.0-next.0
### Major Changes
- 9fb93b1: Added ESM version of SDK to improve tree shaking
## 8.1.0

@@ -4,0 +10,0 @@

24

package.json
{
"name": "@safe-global/safe-apps-sdk",
"version": "8.1.0",
"version": "9.0.0-next.0",
"description": "SDK developed to integrate third-party apps with Safe app.",
"main": "dist/src/index.js",
"typings": "dist/src/index.d.ts",
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"files": [

@@ -21,5 +23,15 @@ "dist/**/*",

"test": "jest",
"format-dist": "sed -i '' 's/\"files\":/\"_files\":/' dist/package.json",
"build": "yarn rimraf dist && tsc && yarn format-dist"
"prebuild": "node -p \"'export const getSDKVersion = () => \\'' + require('./package.json').version.split('-')[0] + '\\';'\" > src/version.ts",
"build": "yarn rimraf ./dist && yarn build:cjs && yarn build:esm && yarn build:types",
"build:cjs": "tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
"build:esm": "tsc --project tsconfig.json --module es2020 --outDir ./dist/esm && echo '{\"type\": \"module\"}' > ./dist/esm/package.json",
"build:types": "tsc --project tsconfig.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap"
},
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js"
}
},
"author": "Safe (https://safe.global)",

@@ -29,3 +41,3 @@ "license": "MIT",

"@safe-global/safe-gateway-typescript-sdk": "^3.5.3",
"viem": "^1.0.0"
"viem": "^1.6.0"
},

@@ -32,0 +44,0 @@ "repository": {

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

import { SDKMessageEvent } from './../types/messaging';
import { Methods } from './methods';
import PostMessageCommunicator from './';
import { MessageFormatter } from './messageFormatter';
import { SDKMessageEvent } from './../types/messaging.js';
import { Methods } from './methods.js';
import PostMessageCommunicator from './index.js';
import { MessageFormatter } from './messageFormatter.js';

@@ -6,0 +6,0 @@ describe('PostMessageCommunicator', () => {

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

import { MessageFormatter } from './messageFormatter';
import { Methods } from './methods';
import { InterfaceMessageEvent, Communicator, Response, SuccessResponse } from '../types';
import { MessageFormatter } from './messageFormatter.js';
import { Methods } from './methods.js';
import { InterfaceMessageEvent, Communicator, Response, SuccessResponse } from '../types/index.js';

@@ -27,3 +27,3 @@ // eslint-disable-next-line

const majorVersionNumber = typeof data.version !== 'undefined' && parseInt(data.version.split('.')[0]);
const allowedSDKVersion = majorVersionNumber >= 1;
const allowedSDKVersion = typeof majorVersionNumber === 'number' && majorVersionNumber >= 1;
let validOrigin = true;

@@ -81,2 +81,2 @@ if (Array.isArray(this.allowedOrigins)) {

export default PostMessageCommunicator;
export * from './methods';
export * from './methods.js';

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

import { ErrorResponse, SDKRequestData, RequestId, SuccessResponse, MethodToResponse } from '../types';
import { getSDKVersion } from '../utils';
import { Methods } from './methods';
import { generateRequestId } from './utils';
import { ErrorResponse, SDKRequestData, RequestId, SuccessResponse, MethodToResponse } from '../types/index.js';
import { getSDKVersion } from '../version.js';
import { Methods } from './methods.js';
import { generateRequestId } from './utils.js';

@@ -6,0 +6,0 @@ class MessageFormatter {

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

import { Methods } from '../communication';
import { Safe } from '../safe';
import { Wallet } from '../wallet';
import { Methods } from '../communication/index.js';
import { Safe } from '../safe/index.js';
import { Wallet } from '../wallet/index.js';
import { Permission, PermissionsError, PERMISSIONS_REQUEST_REJECTED } from '../types/permissions';
import { Permission, PermissionsError, PERMISSIONS_REQUEST_REJECTED } from '../types/permissions.js';

@@ -7,0 +7,0 @@ const hasPermission = (required: Methods, permissions: Permission[]): boolean =>

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

import SDK from '../index';
import { Methods } from '../communication';
import { PastLogsOptions, PostMessageOptions, TransactionConfig } from '../types';
import SDK from '../index.js';
import { Methods } from '../communication/index.js';
import { PastLogsOptions, PostMessageOptions, TransactionConfig } from '../types/index.js';

@@ -5,0 +5,0 @@ describe('Safe Apps SDK Read RPC Requests', () => {

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

import { RPC_CALLS } from '../eth/constants';
import { RPC_CALLS } from '../eth/constants.js';
import {

@@ -15,4 +15,4 @@ BlockNumberArg,

SafeSettings,
} from '../types';
import { Methods } from '../communication/methods';
} from '../types/index.js';
import { Methods } from '../communication/methods.js';

@@ -19,0 +19,0 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -1,8 +0,8 @@

import SDK from './sdk';
import SDK from './sdk.js';
export default SDK;
export * from './sdk';
export * from './types';
export * from './communication/methods';
export * from './communication/messageFormatter';
export { getSDKVersion } from './utils';
export * from './sdk.js';
export * from './types/index.js';
export * from './communication/methods.js';
export * from './communication/messageFormatter.js';
export { getSDKVersion } from './version.js';
import { encodeFunctionData, Address, hashMessage, hashTypedData } from 'viem';
import { MAGIC_VALUE_BYTES, MAGIC_VALUE } from './signatures';
import { Methods } from '../communication/methods';
import { RPC_CALLS } from '../eth/constants';
import { MAGIC_VALUE_BYTES, MAGIC_VALUE } from './signatures.js';
import { Methods } from '../communication/methods.js';
import { RPC_CALLS } from '../eth/constants.js';
import {

@@ -17,4 +17,4 @@ Communicator,

EIP712TypedData,
} from '../types';
import requirePermission from '../decorators/requirePermissions';
} from '../types/index.js';
import requirePermission from '../decorators/requirePermissions.js';

@@ -21,0 +21,0 @@ class Safe {

@@ -1,7 +0,7 @@

import SDK from '../sdk';
import { SafeInfo } from '../types';
import { Methods } from '../communication/methods';
import { PostMessageOptions } from '../types';
import { PermissionsError } from '../types/permissions';
import { Wallet } from '../wallet';
import SDK from '../sdk.js';
import { SafeInfo } from '../types/index.js';
import { Methods } from '../communication/methods.js';
import { PostMessageOptions } from '../types/index.js';
import { PermissionsError } from '../types/permissions.js';
import { Wallet } from '../wallet/index.js';

@@ -8,0 +8,0 @@ const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

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

import SDK from './index';
import SDK from './index.js';

@@ -3,0 +3,0 @@ describe('Safe apps SDK', () => {

@@ -1,7 +0,7 @@

import { Communicator } from './types';
import InterfaceCommunicator from './communication';
import { TXs } from './txs';
import { Eth } from './eth';
import { Safe } from './safe';
import { Wallet } from './wallet';
import { Communicator } from './types/index.js';
import InterfaceCommunicator from './communication/index.js';
import { TXs } from './txs/index.js';
import { Eth } from './eth/index.js';
import { Safe } from './safe/index.js';
import { Wallet } from './wallet/index.js';

@@ -8,0 +8,0 @@ export type Opts = {

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

import { Methods } from '../communication/methods';
import { Methods } from '../communication/methods.js';
import {

@@ -13,3 +13,3 @@ GatewayTransactionDetails,

SignMessageResponse,
} from '../types';
} from '../types/index.js';

@@ -16,0 +16,0 @@ class TXs {

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

import SDK, { SafeInfo } from '../index';
import { Methods } from '../communication/methods';
import { PostMessageOptions } from '../types';
import SDK, { SafeInfo } from '../index.js';
import { Methods } from '../communication/methods.js';
import { PostMessageOptions } from '../types/index.js';

@@ -5,0 +5,0 @@ describe('Safe Apps SDK transaction methods', () => {

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

export * from './sdk';
export * from './rpc';
export * from './gateway';
export * from './messaging';
export * from './sdk.js';
export * from './rpc.js';
export * from './gateway.js';
export * from './messaging.js';

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

import { Methods } from '../communication/methods';
import { Methods } from '../communication/methods.js';
import {

@@ -9,5 +9,5 @@ SafeInfo,

SignMessageResponse,
} from './sdk';
import { GatewayTransactionDetails, SafeBalances } from './gateway';
import { Permission } from './permissions';
} from './sdk.js';
import { GatewayTransactionDetails, SafeBalances } from './gateway.js';
import { Permission } from './permissions.js';

@@ -14,0 +14,0 @@ export type RequestId = string;

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

import { RPC_CALLS } from '../eth/constants';
import { RPC_CALLS } from '../eth/constants.js';

@@ -3,0 +3,0 @@ export type RpcCallNames = keyof typeof RPC_CALLS;

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

import { Methods, RestrictedMethods } from '../communication/methods';
import { Communicator } from '../types';
import { PermissionRequest, Permission, PermissionsError, PERMISSIONS_REQUEST_REJECTED } from '../types/permissions';
import { Methods, RestrictedMethods } from '../communication/methods.js';
import { Communicator } from '../types/index.js';
import { PermissionRequest, Permission, PermissionsError, PERMISSIONS_REQUEST_REJECTED } from '../types/permissions.js';

@@ -5,0 +5,0 @@ class Wallet {

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

import SDK from '../sdk';
import { Methods } from '../communication/methods';
import { PostMessageOptions, SDKMessageEvent } from '../types';
import { MessageFormatter } from '../communication/messageFormatter';
import { PermissionsError } from '../types/permissions';
import SDK from '../sdk.js';
import { Methods } from '../communication/methods.js';
import { PostMessageOptions, SDKMessageEvent } from '../types/index.js';
import { MessageFormatter } from '../communication/messageFormatter.js';
import { PermissionsError } from '../types/permissions.js';

@@ -7,0 +7,0 @@ const date = Date.now();

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