Socket
Socket
Sign inDemoInstall

@metaplex-foundation/cusper

Package Overview
Dependencies
0
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @metaplex-foundation/cusper

Resolves Custom Program Errors from Solana program logs or error codes.


Version published
Weekly downloads
27K
decreased by-21.28%
Maintainers
3
Install size
54.7 kB
Created
Weekly downloads
 

Readme

Source

Cusper Build Lint and Test Cusper

Resolves Custom Program Errors from Solana program logs or error codes.

Example

import { initCusper } from '@metaplex-foundation/cusper'

const cusper = initCusper(/* optionally provide custom error resolver here */)

const logs = [
  'Program CwrqeMj2U8tFr1Rhkgwc84tpAsqbt9pTt2a4taoTADPr invoke [1]',
  'Program log: Custom program error: 0x07D0',
]
function showError() {
  try {
    const error = { ...new Error('Test error'), logs }
    cusper.throwError(error)
  } catch (err) {
    console.error(err)
  }
}

showError()
AnchorError#ConstraintMut: A mut constraint was violated
    at showError (/cusper/test/test/ex.ts:13:12)
    [ .. ]

API

Please find the API docs here

LICENSE

Apache-2.0

Keywords

FAQs

Last updated on 28 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc