Socket
Socket
Sign inDemoInstall

@stellar/stellar-base

Package Overview
Dependencies
Maintainers
8
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stellar/stellar-base - npm Package Compare versions

Comparing version 12.0.0 to 12.0.1

25

lib/operations/extend_footprint_ttl.js

@@ -10,10 +10,19 @@ "use strict";

/**
* Builds an operation to bump the time-to-live of a footprint (read and written
* ledger keys). Its only parameter is the new, absolute ledger sequence number
* at which the entry will expire.
* Builds an operation to bump the time-to-live (TTL) of the ledger keys. The
* keys for extension have to be provided in the read-only footprint of
* the transaction.
*
* The footprint itself is derived from the transaction (see
* The only parameter of the operation itself is the new minimum TTL for
* all the provided entries. If an entry already has a higher TTL, then it
* will just be skipped.
*
* TTL is the number of ledgers from the current ledger (exclusive) until
* the last ledger the entry is still considered alive (inclusive). Thus
* the exact ledger until the entries will live will only be determined
* when transaction has been applied.
*
* The footprint has to be specified in the transaction. See
* {@link TransactionBuilder}'s `opts.sorobanData` parameter, which is a
* {@link xdr.SorobanTransactionData} instance that contains fee data & resource
* usage as part of {@link xdr.SorobanResources}).
* usage as part of {@link xdr.SorobanResources}.
*

@@ -24,4 +33,4 @@ * @function

* @param {object} opts - object holding operation parameters
* @param {number} opts.extendTo - the absolute ledger sequence number at which
* the transaction's ledger keys will now expire
* @param {number} opts.extendTo - the minimum TTL that all the entries in
* the read-only footprint will have
* @param {string} [opts.source] - an optional source account

@@ -35,3 +44,3 @@ *

if (((_opts$extendTo = opts.extendTo) !== null && _opts$extendTo !== void 0 ? _opts$extendTo : -1) <= 0) {
throw new RangeError("extendTo isn't a ledger quantity (uint32)");
throw new RangeError('extendTo has to be positive');
}

@@ -38,0 +47,0 @@ var extendFootprintOp = new _xdr["default"].ExtendFootprintTtlOp({

@@ -10,10 +10,14 @@ "use strict";

/**
* Builds a footprint restoration operation.
* Builds an operation to restore the archived ledger entries specified
* by the ledger keys.
*
* The ledger keys to restore are specified separately from the operation
* in read-write footprint of the transaction.
*
* It takes no parameters because the relevant footprint is derived from the
* transaction itself (see {@link TransactionBuilder}'s `opts.sorobanData`
* transaction itself. See {@link TransactionBuilder}'s `opts.sorobanData`
* parameter (or {@link TransactionBuilder.setSorobanData} /
* {@link TransactionBuilder.setLedgerKeys}), which is a
* {@link xdr.SorobanTransactionData} instance that contains fee data & resource
* usage as part of {@link xdr.SorobanTransactionData}).
* usage as part of {@link xdr.SorobanTransactionData}.
*

@@ -20,0 +24,0 @@ * @function

@@ -353,17 +353,19 @@ "use strict";

return new _xdr["default"].Uint64(scv.value()).toBigInt();
case _xdr["default"].ScValType.scvStatus().value:
// TODO: Convert each status type into a human-readable error string?
switch (scv.value()["switch"]()) {
case _xdr["default"].ScStatusType.sstOk().value:
case _xdr["default"].ScStatusType.sstUnknownError().value:
case _xdr["default"].ScStatusType.sstHostValueError().value:
case _xdr["default"].ScStatusType.sstHostObjectError().value:
case _xdr["default"].ScStatusType.sstHostFunctionError().value:
case _xdr["default"].ScStatusType.sstHostStorageError().value:
case _xdr["default"].ScStatusType.sstHostContextError().value:
case _xdr["default"].ScStatusType.sstVmError().value:
case _xdr["default"].ScStatusType.sstContractError().value:
case _xdr["default"].ScStatusType.sstHostAuthError().value:
case _xdr["default"].ScValType.scvError().value:
switch (scv.error()["switch"]().value) {
// Distinguish errors from the user contract.
case _xdr["default"].ScErrorType.sceContract().value:
return {
type: 'contract',
code: scv.error().contractCode()
};
default:
break;
{
var err = scv.error();
return {
type: 'system',
code: err.code().value,
value: err.code().name
};
}
}

@@ -370,0 +372,0 @@

{
"name": "@stellar/stellar-base",
"version": "12.0.0",
"version": "12.0.1",
"description": "Low-level support library for the Stellar network.",

@@ -73,11 +73,11 @@ "main": "./lib/index.js",

"devDependencies": {
"@babel/cli": "^7.24.6",
"@babel/core": "^7.24.6",
"@babel/eslint-parser": "^7.24.6",
"@babel/eslint-plugin": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"@babel/cli": "^7.24.7",
"@babel/core": "^7.24.7",
"@babel/eslint-parser": "^7.24.7",
"@babel/eslint-plugin": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/register": "^7.24.6",
"@definitelytyped/dtslint": "^0.0.182",
"@istanbuljs/nyc-config-babel": "3.0.0",
"@types/node": "^20.12.13",
"@types/node": "^20.14.2",
"@typescript-eslint/parser": "^6.20.0",

@@ -107,3 +107,3 @@ "babel-loader": "^9.1.3",

"karma-webpack": "^5.0.1",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.7",
"minami": "^1.1.1",

@@ -113,3 +113,3 @@ "mocha": "^10.4.0",

"nyc": "^15.1.0",
"prettier": "^3.2.5",
"prettier": "^3.3.2",
"randombytes": "^2.1.0",

@@ -122,3 +122,3 @@ "sinon": "^16.1.0",

"typescript": "^5.4.5",
"webpack": "^5.90.3",
"webpack": "^5.92.0",
"webpack-cli": "^5.1.1"

@@ -125,0 +125,0 @@ },

@@ -991,2 +991,3 @@ // TypeScript Version: 2.9

function decodeContract(address: string): Buffer;
function isValidContract(address: string): boolean;
}

@@ -993,0 +994,0 @@

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

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