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

@secux/app-eth

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@secux/app-eth - npm Package Compare versions

Comparing version 3.0.6 to 3.0.7

2

lib/erc1155.js

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

"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.erc1155_def=exports.ERC1155=void 0;const a=require("@ethersproject/abi"),r=require("./app-eth"),t=e(require("ow")),d=require("./interface"),s=require("./transaction"),n=require("@secux/utility");exports.ERC1155=class{static prepareSafeTransferFrom(e,a,n){var i;(0,t.default)(a,d.ow_baseData),(0,t.default)(n,o);const u=exports.erc1155_def.encodeFunctionData("safeTransferFrom",[n.fromAddress,n.toAddress,n.id,n.value,null!==(i=n.data)&&void 0!==i?i:Buffer.alloc(0)]),l=(0,s.getBuilder)(Object.assign(Object.assign({},a),{data:u}));return(0,r.prepareSign)(e,l,!0)}static prepareSafeBatchTransferFrom(e,a,n){var o;(0,t.default)(a,d.ow_baseData),(0,t.default)(n,u);const i=[...n.items].sort(((e,a)=>{const r=l(e.id)-l(a.id);if(0===r)throw Error(`ArgumentError: duplicate id found, got "${l(e.id)}"`);return r})),f=exports.erc1155_def.encodeFunctionData("safeBatchTransferFrom",[n.fromAddress,n.toAddress,i.map((e=>e.id)),i.map((e=>e.value)),null!==(o=n.data)&&void 0!==o?o:Buffer.alloc(0)]),c=(0,s.getBuilder)(Object.assign(Object.assign({},a),{data:f}));return(0,r.prepareSign)(e,c,!0)}},exports.erc1155_def=new a.Interface(["function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data)","function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data)","function balanceOf(address _owner, uint256 _id) external view returns (uint256)","function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory)","function setApprovalForAll(address _operator, bool _approved)","function isApprovedForAll(address _owner, address _operator) external view returns (bool)","event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value)","event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values)","event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved)","event URI(string _value, uint256 indexed _id)","function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _value, bytes calldata _data) external returns(bytes4)","function onERC1155BatchReceived(address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external returns(bytes4)"]);const o=t.default.object.exactShape({fromAddress:d.ow_address,toAddress:d.ow_address,id:t.default.any(t.default.number.positive,d.ow_hexString32),value:t.default.any(t.default.number.positive,d.ow_hexString32),data:t.default.any(t.default.undefined,n.owTool.prefixedhexString,t.default.buffer)}),i=t.default.object.exactShape({id:t.default.any(t.default.number.positive,d.ow_hexString32),value:t.default.any(t.default.number.positive,d.ow_hexString32)}),u=t.default.object.exactShape({fromAddress:d.ow_address,toAddress:d.ow_address,items:t.default.array.ofType(i),data:t.default.any(t.default.undefined,n.owTool.prefixedhexString,t.default.buffer)});function l(e){return"number"==typeof e?e:parseInt(e.slice(2),16)}
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.erc1155_def=exports.ERC1155=void 0;const a=require("@ethersproject/abi"),r=require("./app-eth"),t=e(require("ow")),d=require("./interface"),s=require("./transaction"),n=require("@secux/utility");exports.ERC1155=class{static prepareSafeTransferFrom(e,a,n){var i;(0,t.default)(a,d.ow_baseData),(0,t.default)(n,o);const u=exports.erc1155_def.encodeFunctionData("safeTransferFrom",[n.fromAddress,n.toAddress,n.id,n.value,null!==(i=n.data)&&void 0!==i?i:Buffer.alloc(0)]),l=(0,s.getBuilder)(Object.assign(Object.assign({},a),{data:u}));return(0,r.prepareSign)(e,l,!1)}static prepareSafeBatchTransferFrom(e,a,n){var o;(0,t.default)(a,d.ow_baseData),(0,t.default)(n,u);const i=[...n.items].sort(((e,a)=>{const r=l(e.id)-l(a.id);if(0===r)throw Error(`ArgumentError: duplicate id found, got "${l(e.id)}"`);return r})),f=exports.erc1155_def.encodeFunctionData("safeBatchTransferFrom",[n.fromAddress,n.toAddress,i.map((e=>e.id)),i.map((e=>e.value)),null!==(o=n.data)&&void 0!==o?o:Buffer.alloc(0)]),c=(0,s.getBuilder)(Object.assign(Object.assign({},a),{data:f}));return(0,r.prepareSign)(e,c,!0)}},exports.erc1155_def=new a.Interface(["function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data)","function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data)","function balanceOf(address _owner, uint256 _id) external view returns (uint256)","function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory)","function setApprovalForAll(address _operator, bool _approved)","function isApprovedForAll(address _owner, address _operator) external view returns (bool)","event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value)","event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values)","event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved)","event URI(string _value, uint256 indexed _id)","function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _value, bytes calldata _data) external returns(bytes4)","function onERC1155BatchReceived(address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external returns(bytes4)"]);const o=t.default.object.exactShape({fromAddress:d.ow_address,toAddress:d.ow_address,id:t.default.any(t.default.number.positive,d.ow_hexString32),value:t.default.any(t.default.number.positive,d.ow_hexString32),data:t.default.any(t.default.undefined,n.owTool.prefixedhexString,t.default.buffer)}),i=t.default.object.exactShape({id:t.default.any(t.default.number.positive,d.ow_hexString32),value:t.default.any(t.default.number.positive,d.ow_hexString32)}),u=t.default.object.exactShape({fromAddress:d.ow_address,toAddress:d.ow_address,items:t.default.array.ofType(i),data:t.default.any(t.default.undefined,n.owTool.prefixedhexString,t.default.buffer)});function l(e){return"number"==typeof e?e:parseInt(e.slice(2),16)}
{
"name": "@secux/app-eth",
"version": "3.0.6",
"version": "3.0.7",
"description": "SecuX Hardware Wallet ETH API",

@@ -5,0 +5,0 @@ "keywords": [

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