# pachacuy-sc

> Interface that implements Smart Contract functions for Pachacuy game

Latest version **1.0.3** (published 2022-09-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install pachacuy-sc
pnpm add pachacuy-sc
yarn add pachacuy-sc
bun add pachacuy-sc
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-09-16 |
| First published | 2022-03-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 402.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lee Marreros |
| Maintainers | leecrosby |

## Links

- npm: https://www.npmjs.com/package/pachacuy-sc
- npm.io page: https://npm.io/package/pachacuy-sc

## Dependencies (1)

- [ethers](https://npm.io/package/ethers.md) ^5.6.2

## Recent versions

- 1.0.3 (latest) — 2022-09-16
- 1.0.2 — 2022-09-16
- 0.0.117 — 2022-09-15
- 1.0.1 — 2022-08-29
- 1.0.0 — 2022-08-29
- 0.0.116 — 2022-08-10
- 0.0.115 — 2022-08-10
- 0.0.114 — 2022-07-28
- 0.0.113 — 2022-07-28
- 0.0.112 — 2022-07-27
- 0.0.111 — 2022-07-27
- 0.0.110 — 2022-07-21
- 0.0.109 — 2022-07-18
- 0.0.108 — 2022-07-17
- 0.0.107 — 2022-07-16
- … 103 more at https://npm.io/package/pachacuy-sc/versions

## README

**CHANGELOGS**
<u>0.0.106</u>

```js
interface HistoricWinners {
    owner: string;
    ticketUuid: string;
    misayWasiUuid: string;
    pachaUuid: string;
    winner: string;
    netPrize: string;
    feePrize: string;
}
function getHistoricWinners(_arrayMisayWasiUuid):Promise<HistoricWinners[]>
```

<u>0.0.104</u>
Corrects PurchaseChakra event

<u>0.0.102</u>

```js
interface IPurchasePP {
  uuid: string;
  account: string;
  pachaOwner: string; // <-- new field
  pachaUuid: string;
  pachaPassUuid: string;
  price: string;
  pcuyReceived: string;
  pcuyTaxed: string;
  balanceOwner: string;
  balanceConsumer: string;
}
pac.on(
  "PurchasePachaPass",
  (
    uuid,
    account,
    pachaOwner, // <-- new field
    pachaUuid,
    pachaPassUuid,
    price,
    pcuyReceived,
    pcuyTaxed,
    balanceOwner,
    balanceConsumer
  ) => console.log
);
```

<u>0.0.99</u>
PurchaseAssetController Contract

- event GuineaPigPurchaseFinish - new field balanceConsumer - no devuelto en método
- event PurchaseLand - new field balance balanceConsumer - devuelto en método
- event PurchasePachaPass - new fields balanceOwner and balanceConsumer - devuelto en método
- event PurchaseFoodChakra - new fields balanceOwner and balanceConsumer - devuelto en método
- event PurchaseTicket - new fields balanceOwner and balanceConsumer - devuelto en método

Chakra

- event PurchaseChakra - new field balanceConsumer

MisayWasi

- event PurchaseMisayWasi - new field balanceConsumer

QhatuWasi

- event PurchaseQhatuWasi - new field balanceConsumer

<u>0.0.97</u>

```js
PurchaseAssetController.on("PurchaseLand". …)
Chakra.on("PurchaseChakra", …)
PurchaseAssetController.on("PurchaseFoodChakra". …)
MisayWasi.on("PurchaseTicketFromMisayWasi", …)
MisayWasi.on("PurchaseMisayWasi", …)
QhatuWasi.on("PurchaseQhatuWasi", …)
PurchaseAssetController.on("PurchasePachaPass". …)
Wiracocha.on("MintWiracocha", ...)
Tatacuy.on("MintTatacuy", ...)
HatunWasi.on("MintHatunWasi", ...)
getComponentsInPacha
```

Smart Contract Order

```js
return [
  nftpContract,
  pacContract,
  tataCuyContract,
  wiracochaContract,
  chakraContract,
  hatunWasiContract,
  misayWasiContract,
  qhatuWasiContract,
];
```

```js
// Purhchase Asset Controller
export interface PurchaseLand {
  _account: string;
  uuid: number;
  landPrice: number;
  _location: number;
  poolRewardsAddress: string;
}

export interface PurchaseFoodChakra {
  chakraUuid: number;
  amountOfFood: number;
  availableFood: number;
  chakraOwner: string;
  pcuyReceived: number;
  pcuyTaxed: number;
  tax: number;
}
export interface PurchasePachaPass {
  account: string;
  pachaUuid: number;
  pachaPassUuid: number;
  price: number;
  pcuyReceived: number;
  pcuyTaxed: number;
}

// chakra
export interface PurchaseChakra {
  owner: string;
  chakraUuid: number;
  pachaUuid: number;
  chakraPrice: number;
  creationDate: number;
}

// misay wasi
export interface PurchaseTicketFromMisayWasi {
  account: string;
  misayWasiUuid: number;
  pachaUuid: number;
  ticketPrice: number;
  amountOfTickets: number;
}

export interface PurchaseMisayWasi {
  account: string;
  misayWasiUuid: number;
  pachaUuid: number;
  creationDate: number;
  misayWasiPrice: number;
}

// qhatu wasi
export interface PurchaseQhatuWasi {
  owner: string;
  qhatuWasiUuid: number;
  pachaUuid: number;
  qhatuWasiPrice: number;
  creationDate: number;
}

// wiracocha
export interface MintWiracocha {
  owner: string;
  wiracochaUuid: number;
  pachaUuid: number;
  creationDate: number;
}

// tatacuy
export interface MintTatacuy {
  owner: string;
  tatacuyUuid: number;
  pachaUuid: number;
  creationDate: number;
}

// hatun wasi
export interface MintHatunWasi {
  owner: string;
  hatunWasiUuid: number;
  pachaUuid: number;
  creationDate: number;
}
```

<u>0.0.83</u>
Pacha

- PachaInfo has another property listPachaPassOwners
- setPachaToPublic
- setPachaPrivacyAndDistribution
- getListOfPachaPasses
- getPachaPassWithUuid
- isPachaAlreadyTaken

Purchase asset controller

- purchasePachaPass

Nft Producer

- isGuineaPigAllowedInPacha
- mintPachaPassAsOwner

Misay Wasi

- getMisayWasiWithUuid,
- getMiswayWasiWithTicketUuid
- getListOfActiveMWRaffles
- getListOfMisayWasisReadyToRaffle,

<u>0.0.69</u>

- getPachacuyBalance
- nuevo parametro para 'startQhatuWasiCampaign': \_prizePerView

<u>0.0.52</u>

- Se cambio de "finishTatacuyCampaign(uint256 \_pachaUuid)" a "finishTatacuyCampaign(uint256 \_tatacuyUuid)"
- "getTatacuyInfoForAccount" solo necesita \_tatacuyUuid
- "signTatacuyTxAndVerify" no necesita "\_pachaOwner" ni "\_pachaUuid" pero sí "\_tatacuyUuid"
- "startTatacuyCampaign" no lleva \_pachaUuid
- "finishTatacuyCampaign" solo necesita \_tatacuyUuid
- "getWiracochaInfoForAccount" solo necesita "\_wiracochaUuid"
- "signWiracochaTxAndReceivePcuy" no necesita "\_pachaOwner" pero sí "\_wiracochaUuid"
- cambio nombre de métodos "getWiracochaInfoForAccount" => "getWiracochaWithUuid"
- cambio nombre de métodos "getTatacuyInfoForAccount" => "getTatacuyWithUuid"
- una pacha puede tener multiples tatacuy
- cambio nombre de métodos "getAHatunWasi" => "getHatunWasiWithUuid"

<u>0.0.51</u>

- new methods
  - purchaseTicketFromMisayWasi
  - purchaseMisayWasi
  - purchaseQhatuWasi
  - getGuineaPigWithUuid
  - getListOfGuineaPigs
  - isPachaAlreadyTaken
  - getListOfPachas
  - getPachaWithUuid
  - startMisayWasiRaffle
  - startRaffleContest
  - getListOfMisayWasisReadyToRaffle
  - getListOfActiveMWRaffles
  - getMisayWasiWithUuid
  - getMiswayWasiWithTicketUuid
  - startQhatuWasiCampaign
  - getListOfQhatuWasi
  - getQhatuWasiWithUuid
- purchaseFoodFromChakra has additional field \_guineaPigUuid

<u>0.0.4</u>

- `race` was added to `IDataGuineaPig`
- `tokenBalance` was added to `IWalletInfo`
- `privacy` and `location` was added to `IPachaData`

---
_Source: https://npm.io/package/pachacuy-sc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
