open-index/open-npm huggingface dataset:
npm package: @stefanzoid/core
Description: ## Example
Latest version: 1.4.12

# sc-decoder

## Example

---

```js
const { decode } = require('@stefanzoid/sc-decoder')

const scAddress = "erd1qqqqqqqqqqqqqpgqd06v3r6r94hgyarcar27hkexamh50u283tpqlyspkr";
const funcName = "getStaking";
const struct = {
  "pool_id": "Address",
  "staked_amount": "BigUint",
  "timestamp": "u64",
  "months": "u16",
  "is_pool": "bool",
  "address": "Address"
};
const type = "VecMapper<struct>";
const args = ["df1262d8e96f1f24ffff170e6eb5be6b0fd9fa7fb1dc53dc71b2822c42fc7ed4"];
const result = await decode(scAddress, funcName, struct, type, args);
```

## Use cases:

---

### Single value || SingleValueMapper:

```json5
{
  "scAddress": "erd1qqqqqqqqqqqqqpgqd06v3r6r94hgyarcar27hkexamh50u283tpqlyspkr",
  "funcName": "getPoolLimit",
  "struct": {},
  "type": "u32",
  "args": []
}
```

#### If single value === struct:

```json5
{
  "scAddress": "erd1qqqqqqqqqqqqqpgqd06v3r6r94hgyarcar27hkexamh50u283tpqlyspkr",
  "funcName": "getPool",
  "struct": {
    "id": "Address",
    "owner": "Address",
    "total_staked": "BigUint",
    "zoidsters": "u32",
    "name": "String",
    "status": "u8"
  },
  "type": "struct",
  "args": [
    "df1262d8e96f1f24ffff170e6eb5be6b0fd9fa7fb1dc53dc71b2822c42fc7ed4"
  ]
}
```

### VecMapper

```json5
{
  "scAddress": "erd1qqqqqqqqqqqqqpgqd06v3r6r94hgyarcar27hkexamh50u283tpqlyspkr",
    "funcName": "getStaking",
    "struct": {
        "pool_id": "Address",
        "staked_amount": "BidUint",
        "timestamp": "u64",
        "months": "u16",
        "is_pool": "bool",
        "address": "Address"
    },
    "type": "VecMapper<struct>",
    "args": [
        "df1262d8e96f1f24ffff170e6eb5be6b0fd9fa7fb1dc53dc71b2822c42fc7ed4"
    ]
}
```

### MapMapper

```json5
{
  "scAddress": "erd1qqqqqqqqqqqqqpgqd06v3r6r94hgyarcar27hkexamh50u283tpqlyspkr",
  "funcName": "getPools",
  "struct": {
    "id": "Address",
    "owner": "Address",
    "total_staked": "BigUint",
    "zoidsters": "u32",
    "name": "String",
    "status": "u8"
  },
  "type": "MapMapper<Address, struct>",
  "args": []
}
```