New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@andamiojs/core

Package Overview
Dependencies
Maintainers
3
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@andamiojs/core - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

src/contracts/course/courseReference/data/queryCourseReferenceUTxObyModule.ts

14

package.json

@@ -6,3 +6,3 @@ {

"types": "./dist/index.d.ts",
"version": "0.0.16",
"version": "0.0.17",
"license": "MIT",

@@ -15,10 +15,10 @@ "scripts": {

"@meshsdk/core": "1.5.7-beta.1",
"@types/blake2b": "^2.1.2",
"blake2b": "^2.1.4",
"@types/blake2b": "2.1.2",
"blake2b": "2.1.4",
"graphql": "16.6.0",
"graphql-request": "6.1.0",
"tsup": "^7.2.0"
"tsup": "7.2.0"
},
"devDependencies": {
"typedoc": "^0.25.3",
"typedoc": "0.25.3",
"typescript": "4.6.4"

@@ -31,3 +31,3 @@ },

"type": "git",
"url": "https://gitlab.com/gimbalabs/andamio/andamiojs"
"url": "git+https://gitlab.com/gimbalabs/andamio/andamiojs.git"
},

@@ -37,5 +37,5 @@ "keywords": [],

"bugs": {
"url": "https://gitlab.com/gimbalabs/andamio/andamiojs/-/issues"
"url": "https://gitlab.com/gimbalabs/andamio/andamiojs-group/turborepo-andamiojs/-/issues"
},
"homepage": "https://andamio.io"
}

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

import { AndamioConfig } from "../../../../types";
import { AndamioConfig, CourseManagementConfig } from "../../../../types";
import { AssignmentData, AssignmentInfo, AssignmentUTxO } from "../assignment.types";

@@ -7,3 +7,3 @@ import { datumAssignmentByGraphqlUTxO } from "../datums";

export async function queryAssignmentValidatorInfo(andamioConfig: AndamioConfig): Promise<AssignmentInfo> {
export async function queryAssignmentValidatorInfo(andamioConfig: AndamioConfig<CourseManagementConfig>): Promise<AssignmentInfo> {
const UTxOs = await queryAssignmentValidatorUTxO(andamioConfig);

@@ -10,0 +10,0 @@

import { resolvePaymentKeyHash } from "@meshsdk/core";
import { AndamioConfig, Nothing, ResponseUTxO, TxOutRef } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, Nothing, ResponseUTxO, TxOutRef } from "../../../../types";
import { NothingDatum } from "../../../../utils";

@@ -9,3 +9,3 @@ import { AssignmentDatum, MaybeStudentAssignmentInfo } from "../assignment.types";

export function datumAssignmentFromLearner(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
selectedModuleUTxO: CourseReferenceUTxO,

@@ -48,3 +48,3 @@ learnerReferenceUTxO: ResponseUTxO,

const _assignmentId = getModuleTokenName(selectedModuleUTxO.utxo, andamioConfig.tokens.moduleTokenPolicyID)
const _assignmentId = getModuleTokenName(selectedModuleUTxO.utxo, andamioConfig.config.courseManagementTokens.moduleTokenPolicyID)

@@ -51,0 +51,0 @@ if(selectedModuleUTxO.datum.fields[2].alternative === 0 && _studentAssignmentInfo){

@@ -5,2 +5,3 @@ import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

ContractTransaction,
CourseManagementConfig,
ReferenceScriptUTxOs,

@@ -41,3 +42,3 @@ ResponseUTxO,

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
assignmentUTxO: AssignmentUTxO

@@ -92,9 +93,9 @@ ) {

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private assignmentUTxO: AssignmentUTxO
) {
this.initialized = false;
this.learnerTokenAssetID = getLearnerTokenUnit(this.assignmentUTxO.utxo, andamioConfig.tokens.learnerPolicyID);
this.learnerTokenAssetID = getLearnerTokenUnit(this.assignmentUTxO.utxo, andamioConfig.config.courseManagementTokens.learnerPolicyID);
this.moduleAssignmentName = this.assignmentUTxO.datum.fields[0];
this.moduleAssignmentToken = this.andamioConfig.tokens.moduleTokenPolicyID + this.moduleAssignmentName;
this.moduleAssignmentToken = this.andamioConfig.config.courseManagementTokens.moduleTokenPolicyID + this.moduleAssignmentName;
}

@@ -116,3 +117,3 @@

this.connectedDeciderToken = (await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.courseDeciderPolicyID
(asset) => asset.policyId === this.andamioConfig.config.courseManagementTokens.courseDeciderPolicyID
);

@@ -119,0 +120,0 @@ // learner address

import { UTxO } from "@meshsdk/core";
import { AndamioConfig, RedeemValue } from "../../../../../../types";
import { AndamioConfig, CourseManagementConfig, RedeemValue } from "../../../../../../types";
import { getLearnerNameHex } from "../../../../course-utils";

@@ -8,9 +8,9 @@ import { AssignmentUTxO } from "../../../assignment.types";

export function assignmentAcceptInputUTxO(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
assignmentUTxO: AssignmentUTxO,
refScriptUTxO: UTxO
): RedeemValue {
const _learnerName = getLearnerNameHex(assignmentUTxO.utxo, andamioConfig.tokens.learnerPolicyID);
const _learnerName = getLearnerNameHex(assignmentUTxO.utxo, andamioConfig.config.courseManagementTokens.learnerPolicyID);
if (_learnerName) {
const _redeemer = redeemerAssignmentAccept(andamioConfig.tokens.learnerPolicyID, _learnerName);
const _redeemer = redeemerAssignmentAccept(andamioConfig.config.courseManagementTokens.learnerPolicyID, _learnerName);
return {

@@ -17,0 +17,0 @@ value: assignmentUTxO.utxo,

import { UTxO } from "@meshsdk/core";
import { AndamioConfig, RedeemValue, ResponseUTxO } from "../../../../../../types";
import { AndamioConfig, CourseManagementConfig, RedeemValue, ResponseUTxO } from "../../../../../../types";
import { getLearnerNameHex } from "../../../../course-utils";

@@ -7,3 +7,3 @@ import { redeemerLearnerRefAddCompletedAssignment } from "../../../../learnerReference/redeemers";

export function learnerReferenceUTxO(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
learnerReferenceUTxO: ResponseUTxO,

@@ -13,3 +13,3 @@ refScriptUTxO: UTxO,

): RedeemValue {
const _learnerName = getLearnerNameHex(learnerReferenceUTxO.meshUTxO, andamioConfig.tokens.learnerPolicyID);
const _learnerName = getLearnerNameHex(learnerReferenceUTxO.meshUTxO, andamioConfig.config.courseManagementTokens.learnerPolicyID);

@@ -16,0 +16,0 @@ if(_learnerName){

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

import { AndamioConfig, ResponseUTxO, SendValue } from "../../../../../../types";
import { AndamioConfig, CourseManagementConfig, ResponseUTxO, SendValue } from "../../../../../../types";
import { datumLearnerRefAddAssignment } from "../../../../learnerReference";
export function updatedLearnerRefTokenToLearnerRef(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
learnerRefTokenUTxO: ResponseUTxO,

@@ -11,3 +11,3 @@ newAssignment: string

recipient: {
address: andamioConfig.learnerReference.address,
address: andamioConfig.config.learnerReference.address,
datum: {

@@ -14,0 +14,0 @@ value: datumLearnerRefAddAssignment(

@@ -7,2 +7,3 @@ import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

ContractTransaction,
CourseManagementConfig,
ReferenceScriptUTxOs,

@@ -39,3 +40,3 @@ ResponseUTxO,

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
selectedCourseReferenceUTxO: CourseReferenceUTxO,

@@ -69,3 +70,3 @@ studentAssignmentInfo: string | null

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private selectedModuleUTxO: CourseReferenceUTxO,

@@ -80,3 +81,3 @@ private studentAssignmentInfo: string | null

this.connectedLearnerToken = (await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.learnerPolicyID
(asset) => asset.policyId === this.andamioConfig.config.courseManagementTokens.learnerPolicyID
);

@@ -83,0 +84,0 @@ this.learnerRefTokenUTxO = await queryLearnerRefTokenUTxOByLearnerToken(

import { AssetExtended, UTxO } from "@meshsdk/core";
import { AndamioConfig, ResponseUTxO, SendValue } from "../../../../../../types";
import { AndamioConfig, CourseManagementConfig, ResponseUTxO, SendValue } from "../../../../../../types";
import { CourseReferenceUTxO } from "../../../../courseReference";

@@ -8,3 +8,3 @@ import { datumAssignmentFromLearner } from "../../../datums";

selectedModuleUTxO: CourseReferenceUTxO,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
connectedLearnerToken: AssetExtended,

@@ -28,3 +28,3 @@ learnerReferenceUTxO: ResponseUTxO,

output: {
address: andamioConfig.assignment.address,
address: andamioConfig.config.assignment.address,
amount: assetsToAssignmentValidator,

@@ -44,3 +44,3 @@ },

recipient: {
address: andamioConfig.assignment.address,
address: andamioConfig.config.assignment.address,
datum: {

@@ -47,0 +47,0 @@ value: datumToAssignmentUTxO,

@@ -5,2 +5,3 @@ import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

ContractTransaction,
CourseManagementConfig,
ReferenceScriptUTxOs,

@@ -37,3 +38,3 @@ ResponseUTxO,

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
assignmentUTxO: AssignmentUTxO

@@ -71,9 +72,9 @@ ) {

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private assignmentUTxO: AssignmentUTxO
) {
this.initialized = false;
this.learnerTokenAssetID = getLearnerTokenUnit(this.assignmentUTxO.utxo, andamioConfig.tokens.learnerPolicyID);
this.learnerTokenAssetID = getLearnerTokenUnit(this.assignmentUTxO.utxo, andamioConfig.config.courseManagementTokens.learnerPolicyID);
this.moduleAssignmentName = assignmentUTxO.datum.fields[0]; // HEX
this.moduleAssignmentToken = this.andamioConfig.tokens.moduleTokenPolicyID + this.moduleAssignmentName;
this.moduleAssignmentToken = this.andamioConfig.config.courseManagementTokens.moduleTokenPolicyID + this.moduleAssignmentName;
}

@@ -94,3 +95,3 @@

this.connectedDeciderToken = (await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.courseDeciderPolicyID
(asset) => asset.policyId === this.andamioConfig.config.courseManagementTokens.courseDeciderPolicyID
);

@@ -97,0 +98,0 @@ }

import { UTxO } from "@meshsdk/core";
import { AndamioConfig, RedeemValue } from "../../../../../../types";
import { AndamioConfig, CourseManagementConfig, RedeemValue } from "../../../../../../types";
import { getLearnerNameHex } from "../../../../course-utils";

@@ -8,9 +8,9 @@ import { AssignmentUTxO } from "../../../assignment.types";

export function assignmentDenyInputUTxO(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
assignmentUTxO: AssignmentUTxO,
refScriptUTxO: UTxO
): RedeemValue {
const _learnerName = getLearnerNameHex(assignmentUTxO.utxo, andamioConfig.tokens.learnerPolicyID);
const _learnerName = getLearnerNameHex(assignmentUTxO.utxo, andamioConfig.config.courseManagementTokens.learnerPolicyID);
if (_learnerName) {
const _redeemer = redeemerAssignmentDeny(andamioConfig.tokens.learnerPolicyID, _learnerName);
const _redeemer = redeemerAssignmentDeny(andamioConfig.config.courseManagementTokens.learnerPolicyID, _learnerName);
return {

@@ -17,0 +17,0 @@ value: assignmentUTxO.utxo,

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

import { AndamioConfig, ResponseUTxO, SendValue } from "../../../../../../types";
import { AndamioConfig, CourseManagementConfig, ResponseUTxO, SendValue } from "../../../../../../types";
import { AssignmentUTxO } from "../../../assignment.types";

@@ -6,3 +6,3 @@ import { datumAssignmentDeny } from "../../../datums";

export function deniedAssignmentOutput(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
assignmentUTxO: AssignmentUTxO,

@@ -12,3 +12,3 @@ ): SendValue {

recipient: {
address: andamioConfig.assignment.address,
address: andamioConfig.config.assignment.address,
datum: {

@@ -15,0 +15,0 @@ value: datumAssignmentDeny(

import { BrowserWallet, Transaction } from "@meshsdk/core";
import { AndamioConfig, ContractTransaction, ReferenceScriptUTxOs, TxInputs, TxOutputs } from "../../../../../types";
import { AndamioConfig, ContractTransaction, CourseManagementConfig, ReferenceScriptUTxOs, TxInputs, TxOutputs } from "../../../../../types";
import { SignAndSubmit } from "../../../../../utils";

@@ -26,3 +26,3 @@ import { getLearnerTokenUnit } from "../../../course-utils";

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
assignmentUTxO: AssignmentUTxO,

@@ -55,7 +55,7 @@ ) {

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private assignmentUTxO: AssignmentUTxO,
) {
this.initialized = false;
this.learnerTokenAssetId = getLearnerTokenUnit(this.assignmentUTxO.utxo, this.andamioConfig.tokens.learnerPolicyID);
this.learnerTokenAssetId = getLearnerTokenUnit(this.assignmentUTxO.utxo, this.andamioConfig.config.courseManagementTokens.learnerPolicyID);
}

@@ -62,0 +62,0 @@

import { BrowserWallet, Transaction } from "@meshsdk/core";
import { AndamioConfig, ContractTransaction, ReferenceScriptUTxOs, TxInputs, TxOutputs } from "../../../../../types";
import { AndamioConfig, ContractTransaction, CourseManagementConfig, ReferenceScriptUTxOs, TxInputs, TxOutputs } from "../../../../../types";
import { SignAndSubmit } from "../../../../../utils";

@@ -31,3 +31,3 @@ import { assignmentReferenceScriptUTxO } from "../../../referenceScriptUTxOs";

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
assignmentUTxO: AssignmentUTxO,

@@ -60,3 +60,3 @@ updatededStudentInfo: string

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private assignmentUTxO: AssignmentUTxO,

@@ -63,0 +63,0 @@ private updatedStudentInfo: string

import { UTxO } from "@meshsdk/core";
import { AndamioConfig } from "../../../../types";
import { AndamioConfig, CourseManagementConfig } from "../../../../types";
export function learnerTokenByCommittedUTxO(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
committedUTxO: UTxO
): string {
const asset = committedUTxO.output.amount.find((asset) =>
asset.unit.includes(andamioConfig.tokens.learnerPolicyID)
asset.unit.includes(andamioConfig.config.courseManagementTokens.learnerPolicyID)
);

@@ -11,0 +11,0 @@ if (asset) {

import { resolvePaymentKeyHash, UTxO } from "@meshsdk/core";
import { GraphQL } from "../../../../lib/graphql";
import { GetTransaction } from "../../../../lib/graphql/getTransaction";
import { AndamioConfig, GraphQLInputUTxO, GraphQLTxResponse } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, GraphQLInputUTxO, GraphQLTxResponse } from "../../../../types";
import { AssignmentUTxO } from "../assignment.types";

@@ -17,3 +17,3 @@ import { learnerTokenByCommittedUTxO } from "./learnerTokenByCommittedUTxO";

export async function queryLearnerAddressByCommittedUTxO(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
committedUTxO: AssignmentUTxO

@@ -20,0 +20,0 @@ ): Promise<string> {

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

import { AndamioConfig } from "../../../../types";
import { AndamioConfig, CourseManagementConfig } from "../../../../types";
import { AssignmentUTxO } from "../assignment.types";

@@ -6,3 +6,3 @@ import { queryAssignmentValidatorInfo } from "../data";

export async function queryAssignmentByConnectedPkh(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
connectedPkh: string

@@ -9,0 +9,0 @@ ): Promise<AssignmentUTxO> {

import { ContractUtxosQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxOsList } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, GraphQLUTxOResponse, ResponseUTxOsList } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryAssignmentValidatorUTxO(andamioConfig: AndamioConfig): Promise<ResponseUTxOsList> {
export async function queryAssignmentValidatorUTxO(andamioConfig: AndamioConfig<CourseManagementConfig>): Promise<ResponseUTxOsList> {
const graphql = new GraphQL();

@@ -10,3 +10,3 @@

const res: GraphQLUTxOResponse = await graphql.graphQLClient.request(ContractUtxosQuery, {
contractAddress: andamioConfig.assignment.address,
contractAddress: andamioConfig.config.assignment.address,
});

@@ -13,0 +13,0 @@

export * from './getCourseModuleData'
export * from './queryCourseReferenceInfo'
export * from './queryCourseReferenceInfo'
export * from './queryCourseReferenceUTxObyModule'

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

import { AndamioConfig } from "../../../../types";
import { AndamioConfig, CourseManagementConfig } from "../../../../types";
import { CourseReferenceInfo, CourseReferenceUTxO } from "../courseReference.types";

@@ -7,3 +7,3 @@ import { datumCourseRefByGraphqlUTxO } from "../datums";

export async function queryCourseReferenceInfo(andamioConfig: AndamioConfig): Promise<CourseReferenceInfo> {
export async function queryCourseReferenceInfo(andamioConfig: AndamioConfig<CourseManagementConfig>): Promise<CourseReferenceInfo> {
const UTxOs = await queryCourseReferenceUTxOs(andamioConfig);

@@ -10,0 +10,0 @@

@@ -5,2 +5,3 @@ import { Action, Asset, AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

BurningTransaction,
CourseManagementConfig,
ReferenceScriptUTxOs,

@@ -39,3 +40,3 @@ TxBurns,

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
courseModuleUTxO: CourseReferenceUTxO

@@ -65,3 +66,3 @@ ) {

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private courseModuleUTxO: CourseReferenceUTxO

@@ -74,3 +75,3 @@ ) {

this.connectedCourseAdminToken = (await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.courseCreatorPolicyID
(asset) => asset.policyId === this.andamioConfig.config.courseManagementTokens.courseCreatorPolicyID
);

@@ -88,3 +89,3 @@ this.connectedAddress = await this.wallet.getChangeAddress();

moduleTokenFromCourseRef: moduleTokenFromCourseRef(
this.andamioConfig.tokens.moduleTokenPolicyID,
this.andamioConfig.config.courseManagementTokens.moduleTokenPolicyID,
this.courseModuleUTxO,

@@ -91,0 +92,0 @@ this.referenceScriptUTxOs.courseReferenceRefScriptUTxO

@@ -11,2 +11,3 @@ import { AssetExtended, AssetMetadata, BrowserWallet, Mint, resolvePlutusScriptHash, Transaction } from "@meshsdk/core";

TxOutputs,
CourseManagementConfig,
} from "../../../../../types";

@@ -47,3 +48,3 @@ import { hashCourseModule, NothingDatum, SignAndSubmit } from "../../../../../utils";

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
courseModule: CourseModule,

@@ -78,3 +79,3 @@ assignmentContent: string

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private courseModule: CourseModule,

@@ -89,3 +90,3 @@ private assignmentContent: string

this.connectedCourseAdminToken = (await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.courseCreatorPolicyID
(asset) => asset.policyId === this.andamioConfig.config.courseManagementTokens.courseCreatorPolicyID
);

@@ -111,3 +112,3 @@ this.connectedAddress = await this.wallet.getChangeAddress();

// Todo: Is it worth it to extract all of this into datumCourseRefNewModule?
const assignmentPlutusScriptHash = resolvePlutusScriptHash(this.andamioConfig.assignment.address);
const assignmentPlutusScriptHash = resolvePlutusScriptHash(this.andamioConfig.config.assignment.address);

@@ -124,3 +125,3 @@ const _assignmentPlutusAddress: PlutusAddress = {

alternative: 0,
fields: [this.assignmentContent, [_assignmentPlutusAddress], [this.andamioConfig.tokens.learnerPolicyID], []],
fields: [this.assignmentContent, [_assignmentPlutusAddress], [this.andamioConfig.config.courseManagementTokens.learnerPolicyID], []],
},

@@ -131,3 +132,3 @@ ],

// Build the Datum
this.datum = datumCourseRefNewModule(this.andamioConfig.tokens.moduleTokenPolicyID, this.sltDatum, this.assignment);
this.datum = datumCourseRefNewModule(this.andamioConfig.config.courseManagementTokens.moduleTokenPolicyID, this.sltDatum, this.assignment);

@@ -151,3 +152,3 @@ // Build the Redeemer

recipient: {
address: this.andamioConfig.courseReference.address,
address: this.andamioConfig.config.courseReference.address,
datum: {

@@ -154,0 +155,0 @@ value: this.datum,

import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";
import { AndamioConfig, ContractTransaction, ReferenceScriptUTxOs, TxInputs, TxOutputs } from "../../../../../types";
import { AndamioConfig, ContractTransaction, CourseManagementConfig, ReferenceScriptUTxOs, TxInputs, TxOutputs } from "../../../../../types";
import { SignAndSubmit } from "../../../../../utils";

@@ -38,3 +38,3 @@ import { courseReferenceRefScriptUTxO } from "../../../referenceScriptUTxOs";

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
selectedCourseReferenceUTxO: CourseReferenceUTxO,

@@ -68,3 +68,3 @@ newLearnerCS: string

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private courseReferenceUTxO: CourseReferenceUTxO,

@@ -79,3 +79,3 @@ // Handle user input in the app

this.connectedCourseAdminToken = (await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.courseCreatorPolicyID
(asset) => asset.policyId === this.andamioConfig.config.courseManagementTokens.courseCreatorPolicyID
);

@@ -92,3 +92,3 @@ this.connectedAddress = await this.wallet.getChangeAddress();

moduleTokenFromCourseRef: moduleTokenFromCourseRef(
this.andamioConfig.tokens.moduleTokenPolicyID,
this.andamioConfig.config.courseManagementTokens.moduleTokenPolicyID,
this.newLearnerCS,

@@ -95,0 +95,0 @@ this.courseReferenceUTxO,

import { ContractUtxosQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxOsList } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, GraphQLUTxOResponse, ResponseUTxOsList } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryCourseReferenceUTxOs(andamioConfig: AndamioConfig): Promise<ResponseUTxOsList> {
export async function queryCourseReferenceUTxOs(andamioConfig: AndamioConfig<CourseManagementConfig>): Promise<ResponseUTxOsList> {
const graphql = new GraphQL();

@@ -10,3 +10,3 @@

const res: GraphQLUTxOResponse = await graphql.graphQLClient.request(ContractUtxosQuery, {
contractAddress: andamioConfig.courseReference.address,
contractAddress: andamioConfig.config.courseReference.address,
});

@@ -13,0 +13,0 @@

import { GetUTxOWithAssetQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxO } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, GraphQLUTxOResponse, ResponseUTxO } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryModuleRefTokenUTxOByModuleToken(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
moduleToken: string

@@ -13,3 +13,3 @@ ): Promise<ResponseUTxO> {

res = await graphql.graphQLClient.request(GetUTxOWithAssetQuery, {
address: andamioConfig.courseReference.address,
address: andamioConfig.config.courseReference.address,
assetId: moduleToken,

@@ -16,0 +16,0 @@ });

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

import { AndamioConfig, ResponseUTxO } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, ResponseUTxO } from "../../../../types";
import { hexToString } from "../../../../utils";

@@ -8,3 +8,3 @@ import { checkConnectedWalletMatchesRewardAddress, getLearnerNameHex } from "../../course-utils";

export function getLearnerReferenceData(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
learnerRefUTxO: ResponseUTxO

@@ -20,3 +20,3 @@ ): LearnerReferenceData {

let _contributorAlias: string;
const res = getLearnerNameHex(learnerRefUTxO.meshUTxO, andamioConfig.tokens.learnerPolicyID);
const res = getLearnerNameHex(learnerRefUTxO.meshUTxO, andamioConfig.config.courseManagementTokens.learnerPolicyID);

@@ -23,0 +23,0 @@ if (res) {

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

import { AndamioConfig, ResponseUTxO } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, ResponseUTxO } from "../../../../types";
import { hexToString } from "../../../../utils";

@@ -8,3 +8,3 @@ import { checkConnectedWalletMatchesRewardAddress, getLearnerNameHex } from "../../course-utils";

export function getLearnerReferenceDataConnectedWallet(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
learnerRefUTxO: ResponseUTxO,

@@ -22,3 +22,3 @@ connectedAddress: string,

let _contributorAlias: string;
const res = getLearnerNameHex(learnerRefUTxO.meshUTxO, andamioConfig.tokens.learnerPolicyID);
const res = getLearnerNameHex(learnerRefUTxO.meshUTxO, andamioConfig.config.courseManagementTokens.learnerPolicyID);

@@ -25,0 +25,0 @@ if (res) {

import { BrowserWallet, resolvePaymentKeyHash } from "@meshsdk/core";
import { AndamioConfig } from "../../../../types";
import { AndamioConfig, CourseManagementConfig } from "../../../../types";
import { hexToString } from "../../../../utils";

@@ -13,3 +13,3 @@ import { AssignmentUTxO, queryAssignmentByConnectedPkh } from "../../assignmentValidator";

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
connectedLearnerToken?: string

@@ -27,3 +27,3 @@ ): Promise<LearnerReferenceUTxO> {

learnerToken = assignment.utxo.output.amount.find(
(token) => token.unit.substring(0, 56) === andamioConfig.tokens.learnerPolicyID
(token) => token.unit.substring(0, 56) === andamioConfig.config.courseManagementTokens.learnerPolicyID
)?.unit;

@@ -30,0 +30,0 @@ }

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

import { AndamioConfig } from "../../../../types";
import { AndamioConfig, CourseManagementConfig } from "../../../../types";
import { datumLearnerRefByGraphqlUTxO } from "../datums";

@@ -7,3 +7,3 @@ import { LearnerReferenceInfo, LearnerReferenceUTxO } from "../learnerReference.types";

export async function queryLearnerReferenceInfo(andamioConfig: AndamioConfig): Promise<LearnerReferenceInfo> {
export async function queryLearnerReferenceInfo(andamioConfig: AndamioConfig<CourseManagementConfig>): Promise<LearnerReferenceInfo> {
const UTxOs = await queryLearnerReferenceUTxOs(andamioConfig);

@@ -10,0 +10,0 @@

@@ -5,2 +5,3 @@ import { Asset, AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

BurningTransaction,
CourseManagementConfig,
ReferenceScriptUTxOs,

@@ -39,3 +40,3 @@ TxBurns,

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
learnerReferenceUTxO: LearnerReferenceUTxO

@@ -66,3 +67,3 @@ ) {

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private learnerReferenceUTxO: LearnerReferenceUTxO

@@ -72,3 +73,3 @@ ) {

const _asset = this.learnerReferenceUTxO.utxo.output.amount.find(
(token) => token.unit.substring(0, 56) === this.andamioConfig.tokens.learnerPolicyID
(token) => token.unit.substring(0, 56) === this.andamioConfig.config.courseManagementTokens.learnerPolicyID
);

@@ -82,3 +83,3 @@ if (_asset) {

this.connectedLearnerToken = (await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.learnerPolicyID
(asset) => asset.policyId === this.andamioConfig.config.courseManagementTokens.learnerPolicyID
);

@@ -96,3 +97,3 @@ this.connectedAddress = await this.wallet.getChangeAddress();

tokenFromLearnerRef: tokenFromLearnerRef(
this.andamioConfig.tokens.learnerPolicyID,
this.andamioConfig.config.courseManagementTokens.learnerPolicyID,
this.learnerReferenceUTxO,

@@ -99,0 +100,0 @@ this.referenceScriptUTxOs.learnerReferenceRefScriptUTxO

import { AssetMetadata, BrowserWallet, Data, Mint, Transaction } from "@meshsdk/core";
import { AndamioConfig, MintingTransaction, ReferenceScriptUTxOs, TxMints } from "../../../../../types";
import { AndamioConfig, CourseManagementConfig, MintingTransaction, ReferenceScriptUTxOs, TxMints } from "../../../../../types";
import { SignAndSubmit } from "../../../../../utils";

@@ -41,4 +41,5 @@ import { learnerMintingRefScriptUTxO } from "../../../referenceScriptUTxOs";

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
learnerAlias: string
andamioConfig: AndamioConfig<CourseManagementConfig>,
learnerAlias: string,
nftArtURL: string
) {

@@ -48,3 +49,3 @@ // Todo: Add some learnerAlias validation here. It is not handled on-chain, but the UX could be more helpful.

// Maybe query existing tokens? (Great job for an indexer.)
const MINT_LEARNER_TOKEN_TX = new MintLearnerTokensTx(wallet, andamioConfig, learnerAlias);
const MINT_LEARNER_TOKEN_TX = new MintLearnerTokensTx(wallet, andamioConfig, learnerAlias, nftArtURL);
await MINT_LEARNER_TOKEN_TX.runQueries().then(() => MINT_LEARNER_TOKEN_TX.initialize());

@@ -58,2 +59,3 @@ return MINT_LEARNER_TOKEN_TX;

referenceScriptUTxOs!: ReferenceScriptUTxOs;
assetMetadata!: AssetMetadata;

@@ -68,4 +70,5 @@ // Tx Mints

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private learnerAlias: string
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private learnerAlias: string,
private nftArtURL: string
) {

@@ -88,7 +91,17 @@ this.initialized = false;

const assetMetadata: AssetMetadata = {
name: learnerTokenName,
image: "https://www.andamio.io/andamio.png",
};
if(this.nftArtURL.length <= 64) {
this.assetMetadata = {
name: learnerTokenName,
image: this.nftArtURL,
};
} else {
this.assetMetadata = {
name: learnerTokenName,
image: [this.nftArtURL.substring(0,64), this.nftArtURL.substring(64)]
}
}
const _learnerInfo = "You can update this information.";

@@ -102,3 +115,3 @@

_learnerInfo,
this.andamioConfig.tokens.learnerPolicyID
this.andamioConfig.config.courseManagementTokens.learnerPolicyID
);

@@ -109,3 +122,3 @@

assetQuantity: "1",
metadata: assetMetadata,
metadata: this.assetMetadata,
label: "721",

@@ -117,6 +130,6 @@ recipient: this.connectedAddress,

assetQuantity: "1",
metadata: assetMetadata,
metadata: this.assetMetadata,
label: "721",
recipient: {
address: this.andamioConfig.learnerReference.address,
address: this.andamioConfig.config.learnerReference.address,
datum: {

@@ -123,0 +136,0 @@ value: _learnerDatum,

import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";
import { AndamioConfig, ContractTransaction, ReferenceScriptUTxOs, TxInputs, TxOutputs } from "../../../../../types";
import { AndamioConfig, ContractTransaction, CourseManagementConfig, ReferenceScriptUTxOs, TxInputs, TxOutputs } from "../../../../../types";
import { SignAndSubmit } from "../../../../../utils";

@@ -33,3 +33,3 @@ import { LearnerReferenceUTxO } from "../../learnerReference.types";

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
learnerReferenceUTxO: LearnerReferenceUTxO,

@@ -65,3 +65,3 @@ newLearnerInfo: string

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<CourseManagementConfig>,
private learnerReferenceUTxO: LearnerReferenceUTxO,

@@ -75,3 +75,3 @@ private newLearnerInfo: string

this.connectedLearnerToken = (await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.learnerPolicyID
(asset) => asset.policyId === this.andamioConfig.config.courseManagementTokens.learnerPolicyID
);

@@ -90,3 +90,3 @@ this.connectedAddress = await this.wallet.getChangeAddress();

this.referenceScriptUTxOs.learnerReferenceRefScriptUTxO,
this.andamioConfig.tokens.learnerPolicyID,
this.andamioConfig.config.courseManagementTokens.learnerPolicyID,
this.connectedAddress,

@@ -93,0 +93,0 @@ this.newLearnerInfo

import { ContractUtxosQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxOsList } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, GraphQLUTxOResponse, ResponseUTxOsList } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryLearnerReferenceUTxOs(andamioConfig: AndamioConfig): Promise<ResponseUTxOsList> {
export async function queryLearnerReferenceUTxOs(andamioConfig: AndamioConfig<CourseManagementConfig>): Promise<ResponseUTxOsList> {
const graphql = new GraphQL();

@@ -10,3 +10,3 @@

const res: GraphQLUTxOResponse = await graphql.graphQLClient.request(ContractUtxosQuery, {
contractAddress: andamioConfig.learnerReference.address,
contractAddress: andamioConfig.config.learnerReference.address,
});

@@ -13,0 +13,0 @@

import { GetUTxOWithAssetQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxO } from "../../../../types";
import { AndamioConfig, CourseManagementConfig, GraphQLUTxOResponse, ResponseUTxO } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryLearnerRefTokenUTxOByLearnerToken(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<CourseManagementConfig>,
learnerToken: string

@@ -16,3 +16,3 @@ ): Promise<ResponseUTxO> {

res = await graphql.graphQLClient.request(GetUTxOWithAssetQuery, {
address: andamioConfig.learnerReference.address,
address: andamioConfig.config.learnerReference.address,
assetId: learnerRefToken,

@@ -19,0 +19,0 @@ });

import { PlutusScript, UTxO, resolveScriptRef } from '@meshsdk/core';
import { AndamioConfig } from '../../../types';
import { AndamioConfig, CourseManagementConfig } from '../../../types';
export function assignmentReferenceScriptUTxO(andamioConfig: AndamioConfig): UTxO {
export function assignmentReferenceScriptUTxO(andamioConfig: AndamioConfig<CourseManagementConfig>): UTxO {
const assignment_SCRIPT: PlutusScript = {
version: 'V2',
code: andamioConfig.assignment.cbor,
code: andamioConfig.config.assignment.cbor,
};

@@ -12,11 +12,11 @@

input: {
outputIndex: andamioConfig.assignment.referenceTxIx,
txHash: andamioConfig.assignment.referenceTxHash,
outputIndex: andamioConfig.config.assignment.referenceTxIx,
txHash: andamioConfig.config.assignment.referenceTxHash,
},
output: {
address: andamioConfig.assignment.referenceUTxOAddress,
address: andamioConfig.config.assignment.referenceUTxOAddress,
amount: [
{
unit: 'lovelace',
quantity: andamioConfig.assignment.referenceTxLovelace,
quantity: andamioConfig.config.assignment.referenceTxLovelace,
},

@@ -23,0 +23,0 @@ ],

import { PlutusScript, UTxO, resolveScriptRef } from '@meshsdk/core';
import { AndamioConfig } from '../../../types';
import { AndamioConfig, CourseManagementConfig } from '../../../types';
export function courseModuleMintingRefScriptUTxO(andamioConfig: AndamioConfig): UTxO {
export function courseModuleMintingRefScriptUTxO(andamioConfig: AndamioConfig<CourseManagementConfig>): UTxO {
const moduleMintingReference_SCRIPT: PlutusScript = {
version: 'V2',
code: andamioConfig.moduleMintingReference.cbor,
code: andamioConfig.config.moduleMintingReference.cbor,
};

@@ -12,11 +12,11 @@

input: {
outputIndex: andamioConfig.moduleMintingReference.referenceTxIx,
txHash: andamioConfig.moduleMintingReference.referenceTxHash,
outputIndex: andamioConfig.config.moduleMintingReference.referenceTxIx,
txHash: andamioConfig.config.moduleMintingReference.referenceTxHash,
},
output: {
address: andamioConfig.moduleMintingReference.referenceUTxOAddress,
address: andamioConfig.config.moduleMintingReference.referenceUTxOAddress,
amount: [
{
unit: 'lovelace',
quantity: andamioConfig.moduleMintingReference.referenceTxLovelace,
quantity: andamioConfig.config.moduleMintingReference.referenceTxLovelace,
},

@@ -23,0 +23,0 @@ ],

import { PlutusScript, UTxO, resolveScriptRef } from '@meshsdk/core';
import { AndamioConfig } from '../../../types';
import { AndamioConfig, CourseManagementConfig } from '../../../types';
export function courseReferenceRefScriptUTxO(andamioConfig: AndamioConfig): UTxO {
export function courseReferenceRefScriptUTxO(andamioConfig: AndamioConfig<CourseManagementConfig>): UTxO {
const courseReference_SCRIPT: PlutusScript = {
version: 'V2',
code: andamioConfig.courseReference.cbor,
code: andamioConfig.config.courseReference.cbor,
};

@@ -12,11 +12,11 @@

input: {
outputIndex: andamioConfig.courseReference.referenceTxIx,
txHash: andamioConfig.courseReference.referenceTxHash,
outputIndex: andamioConfig.config.courseReference.referenceTxIx,
txHash: andamioConfig.config.courseReference.referenceTxHash,
},
output: {
address: andamioConfig.courseReference.referenceUTxOAddress,
address: andamioConfig.config.courseReference.referenceUTxOAddress,
amount: [
{
unit: 'lovelace',
quantity: andamioConfig.courseReference.referenceTxLovelace,
quantity: andamioConfig.config.courseReference.referenceTxLovelace,
},

@@ -23,0 +23,0 @@ ],

import { PlutusScript, UTxO, resolveScriptRef } from '@meshsdk/core';
import { AndamioConfig } from '../../../types';
import { AndamioConfig, CourseManagementConfig } from '../../../types';
export function learnerMintingRefScriptUTxO(andamioConfig: AndamioConfig): UTxO {
export function learnerMintingRefScriptUTxO(andamioConfig: AndamioConfig<CourseManagementConfig>): UTxO {
const LEARNER_MINTING_SCRIPT: PlutusScript = {
version: 'V2',
code: andamioConfig.learnerMintingReference.cbor,
code: andamioConfig.config.learnerMintingReference.cbor,
};

@@ -12,11 +12,11 @@

input: {
outputIndex: andamioConfig.learnerMintingReference.referenceTxIx,
txHash: andamioConfig.learnerMintingReference.referenceTxHash,
outputIndex: andamioConfig.config.learnerMintingReference.referenceTxIx,
txHash: andamioConfig.config.learnerMintingReference.referenceTxHash,
},
output: {
address: andamioConfig.learnerMintingReference.referenceUTxOAddress,
address: andamioConfig.config.learnerMintingReference.referenceUTxOAddress,
amount: [
{
unit: 'lovelace',
quantity: andamioConfig.learnerMintingReference.referenceTxLovelace,
quantity: andamioConfig.config.learnerMintingReference.referenceTxLovelace,
},

@@ -23,0 +23,0 @@ ],

import { PlutusScript, UTxO, resolveScriptRef } from '@meshsdk/core';
import { AndamioConfig } from '../../../types';
import { AndamioConfig, CourseManagementConfig } from '../../../types';
export function learnerReferenceReferenceScriptUTxO(andamioConfig: AndamioConfig): UTxO {
export function learnerReferenceReferenceScriptUTxO(andamioConfig: AndamioConfig<CourseManagementConfig>): UTxO {
const learnerReference_SCRIPT: PlutusScript = {
version: 'V2',
code: andamioConfig.learnerReference.cbor,
code: andamioConfig.config.learnerReference.cbor,
};

@@ -12,11 +12,11 @@

input: {
outputIndex: andamioConfig.learnerReference.referenceTxIx,
txHash: andamioConfig.learnerReference.referenceTxHash,
outputIndex: andamioConfig.config.learnerReference.referenceTxIx,
txHash: andamioConfig.config.learnerReference.referenceTxHash,
},
output: {
address: andamioConfig.learnerReference.referenceUTxOAddress,
address: andamioConfig.config.learnerReference.referenceUTxOAddress,
amount: [
{
unit: 'lovelace',
quantity: andamioConfig.learnerReference.referenceTxLovelace,
quantity: andamioConfig.config.learnerReference.referenceTxLovelace,
},

@@ -23,0 +23,0 @@ ],

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

import { AndamioConfig } from "../../../../types";
import { AndamioConfig, ProjectManagementConfig } from "../../../../types";
import {

@@ -11,3 +11,3 @@ ContributorRefTokenInfo,

export async function queryContribRefInfo(
andamioConfig: AndamioConfig
andamioConfig: AndamioConfig<ProjectManagementConfig>
): Promise<ContributorReferenceInfo> {

@@ -22,3 +22,3 @@ const UTxOs = await queryContribRefUTxOs(andamioConfig);

contributorRefAssetId: item.utxo.output.amount.find((asset) =>
asset.unit.includes(andamioConfig.tokens.contributorPolicyID)
asset.unit.includes(andamioConfig.config.projectManagementTokens.contributorPolicyID)
)!.unit,

@@ -25,0 +25,0 @@ rewardAddress: "",

@@ -6,2 +6,3 @@ import { BrowserWallet, Transaction } from "@meshsdk/core";

MintingTransaction,
ProjectManagementConfig,
ReferenceScriptUTxOs,

@@ -18,3 +19,3 @@ TxInputs,

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
tokenAlias: string,

@@ -47,3 +48,3 @@ ) {

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<ProjectManagementConfig>,
private tokenAlias: string

@@ -50,0 +51,0 @@ ) {

@@ -9,3 +9,3 @@ import {

} from "@meshsdk/core";
import { AndamioConfig, MintAsset } from "../../../../../../types";
import { AndamioConfig, MintAsset, ProjectManagementConfig } from "../../../../../../types";
import { ContributorReferenceDatum } from "../../../contributorReference.types";

@@ -15,3 +15,3 @@ import { BuildPlutusAddressFromCardanoAddress } from "../../../utils";

export function contribRefTokenToContribRef(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
tokenAlias: string,

@@ -22,14 +22,14 @@ connectedAddress: string

input: {
txHash: andamioConfig.contributorMinter.referenceTxHash,
outputIndex: andamioConfig.contributorMinter.referenceTxIx,
txHash: andamioConfig.config.contributorMinter.referenceTxHash,
outputIndex: andamioConfig.config.contributorMinter.referenceTxIx,
},
output: {
address: andamioConfig.contributorMinter.referenceUTxOAddress,
address: andamioConfig.config.contributorMinter.referenceUTxOAddress,
amount: [
{
unit: "lovelace",
quantity: andamioConfig.contributorMinter.referenceTxLovelace,
quantity: andamioConfig.config.contributorMinter.referenceTxLovelace,
},
],
scriptRef: resolveScriptRef(andamioConfig.contributorMinter.plutusScript),
scriptRef: resolveScriptRef(andamioConfig.config.contributorMinter.plutusScript),
},

@@ -49,3 +49,3 @@ };

const referenceTokenRecipient: Recipient = {
address: andamioConfig.contributorReference.address,
address: andamioConfig.config.contributorReference.address,
datum: {

@@ -52,0 +52,0 @@ value: contributorReferenceDatum,

@@ -8,6 +8,6 @@ import {

} from "@meshsdk/core";
import { AndamioConfig, MintAsset } from "../../../../../../types";
import { AndamioConfig, MintAsset, ProjectManagementConfig } from "../../../../../../types";
export function contribTokenToContrib(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
tokenAlias: string,

@@ -18,14 +18,14 @@ connectedAddress: string

input: {
txHash: andamioConfig.contributorMinter.referenceTxHash,
outputIndex: andamioConfig.contributorMinter.referenceTxIx,
txHash: andamioConfig.config.contributorMinter.referenceTxHash,
outputIndex: andamioConfig.config.contributorMinter.referenceTxIx,
},
output: {
address: andamioConfig.contributorMinter.referenceUTxOAddress,
address: andamioConfig.config.contributorMinter.referenceUTxOAddress,
amount: [
{
unit: "lovelace",
quantity: andamioConfig.contributorMinter.referenceTxLovelace,
quantity: andamioConfig.config.contributorMinter.referenceTxLovelace,
},
],
scriptRef: resolveScriptRef(andamioConfig.contributorMinter.plutusScript),
scriptRef: resolveScriptRef(andamioConfig.config.contributorMinter.plutusScript),
},

@@ -32,0 +32,0 @@ };

import { UTxO } from "@meshsdk/core";
import { AndamioConfig } from "../../../../types";
import { AndamioConfig, ProjectManagementConfig } from "../../../../types";
export function ContributorTokenByCommittedUTxO(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
committedUTxO: UTxO
): string {
const asset = committedUTxO.output.amount.find((asset) =>
asset.unit.includes(andamioConfig.tokens.contributorPolicyID)
asset.unit.includes(andamioConfig.config.projectManagementTokens.contributorPolicyID)
);

@@ -11,0 +11,0 @@ if (asset) {

import { PlutusScript, UTxO, resolveScriptRef } from '@meshsdk/core';
import { AndamioConfig } from '../../../../types';
import { AndamioConfig, ProjectManagementConfig } from '../../../../types';
export function contribRefScriptUTxO(andamioConfig: AndamioConfig): UTxO {
export function contribRefScriptUTxO(andamioConfig: AndamioConfig<ProjectManagementConfig>): UTxO {
const contributorValidatorPlutusScript: PlutusScript = {
version: 'V2',
code: andamioConfig.contributorReference.cbor,
code: andamioConfig.config.contributorReference.cbor,
};
return {
input: {
outputIndex: andamioConfig.contributorReference.referenceTxIx,
txHash: andamioConfig.contributorReference.referenceTxHash,
outputIndex: andamioConfig.config.contributorReference.referenceTxIx,
txHash: andamioConfig.config.contributorReference.referenceTxHash,
},
output: {
address: andamioConfig.contributorReference.referenceUTxOAddress,
address: andamioConfig.config.contributorReference.referenceUTxOAddress,
amount: [
{
unit: 'lovelace',
quantity: andamioConfig.contributorReference.referenceTxLovelace,
quantity: andamioConfig.config.contributorReference.referenceTxLovelace,
},

@@ -21,0 +21,0 @@ ],

import { GetUTxOWithAssetQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxO } from "../../../../types";
import { AndamioConfig, GraphQLUTxOResponse, ProjectManagementConfig, ResponseUTxO } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryContribRefTokenUTxOByContribToken(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
contribToken: string

@@ -16,3 +16,3 @@ ): Promise<ResponseUTxO> {

res = await graphql.graphQLClient.request(GetUTxOWithAssetQuery, {
address: andamioConfig.contributorReference.address,
address: andamioConfig.config.contributorReference.address,
assetId: contribRefToken,

@@ -19,0 +19,0 @@ });

@@ -5,2 +5,3 @@ import { ContractUtxosQuery, GraphQL } from "../../../../lib/graphql";

GraphQLUTxOResponse,
ProjectManagementConfig,
ResponseUTxOsList,

@@ -11,3 +12,3 @@ } from "../../../../types";

export async function queryContribRefUTxOs(
andamioConfig: AndamioConfig
andamioConfig: AndamioConfig<ProjectManagementConfig>
): Promise<ResponseUTxOsList> {

@@ -20,3 +21,3 @@ const graphql = new GraphQL();

{
contractAddress: andamioConfig.contributorReference.address,
contractAddress: andamioConfig.config.contributorReference.address,
}

@@ -23,0 +24,0 @@ );

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

import { AndamioConfig, ResponseUTxOsList } from "../../../../types";
import { AndamioConfig, ProjectManagementConfig, ResponseUTxOsList } from "../../../../types";
import { queryEscrowUTxOsByContractToken } from "../utxos";

@@ -9,3 +9,3 @@ import { calculateTotalAmount } from "../../../../utils";

export async function queryEscrowsInfo(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
contractToken?: string

@@ -21,3 +21,3 @@ ): Promise<EscrowInfo> {

UTxOsList = await Promise.all(
andamioConfig.escrows.map(async (escrow) => {
andamioConfig.config.escrows.map(async (escrow) => {
const utxos = await queryEscrowUTxOsByContractToken(

@@ -43,3 +43,3 @@ andamioConfig,

UTxOsList.meshUTxOs,
andamioConfig.tokens.projectAsset
andamioConfig.config.projectManagementTokens.projectAsset
);

@@ -51,3 +51,3 @@ return {

UTxOsList.graphQLUTxOs,
andamioConfig.tokens.contributorPolicyID
andamioConfig.config.projectManagementTokens.contributorPolicyID
),

@@ -54,0 +54,0 @@ numLiveCommitments: UTxOsList.meshUTxOs.length,

import { resolvePlutusScriptHash } from '@meshsdk/core';
import { ProjectData } from '../../../contract.types';
import { AndamioConfig } from '../../../../types';
import { AndamioConfig, ProjectManagementConfig } from '../../../../types';
import { NothingDatum } from '../../../../utils';
export function DatumCommitToProject(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
selectedProject: ProjectData,
) {
const treasuryValidatorHash = resolvePlutusScriptHash(
andamioConfig.treasury.address,
andamioConfig.config.treasury.address,
);

@@ -13,0 +13,0 @@

@@ -6,2 +6,3 @@ import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

EscrowConfig,
ProjectManagementConfig,
ReferenceScriptUTxOs,

@@ -35,3 +36,3 @@ ResponseUTxO,

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
selectedProject: ProjectData

@@ -73,3 +74,3 @@ ) {

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<ProjectManagementConfig>,
private selectedProject: ProjectData

@@ -76,0 +77,0 @@ ) {

import { UTxO } from "@meshsdk/core";
import { AndamioConfig, SendValue } from "../../../../../../types";
import { AndamioConfig, ProjectManagementConfig, SendValue } from "../../../../../../types";
export function rewardToContrib(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
contributorAddress: string,

@@ -13,3 +13,3 @@ commitmentUTxO: UTxO

const PROJECT_TOKEN_IN_COMMITMENT = commitmentUTxO.output.amount.find(
(token) => token.unit === andamioConfig.tokens.projectAsset
(token) => token.unit === andamioConfig.config.projectManagementTokens.projectAsset
)?.quantity;

@@ -32,3 +32,3 @@ if (!LOVELACE_IN_COMMITMENT || !PROJECT_TOKEN_IN_COMMITMENT) {

{
unit: andamioConfig.tokens.projectAsset,
unit: andamioConfig.config.projectManagementTokens.projectAsset,
quantity: PROJECT_TOKEN_IN_COMMITMENT,

@@ -35,0 +35,0 @@ },

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

import { AndamioConfig, ResponseUTxO, SendValue } from "../../../../../../types";
import { AndamioConfig, ProjectManagementConfig, ResponseUTxO, SendValue } from "../../../../../../types";
import { DatumRaiseNumberOfCommitment } from "../../../../contributorReference";
export function updatedContribRefTokenToContribRef(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
contribRefTokenUTxO: ResponseUTxO,

@@ -11,3 +11,3 @@ contribAddress: string

recipient: {
address: andamioConfig.contributorReference.address,
address: andamioConfig.config.contributorReference.address,
datum: {

@@ -14,0 +14,0 @@ value: DatumRaiseNumberOfCommitment(

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

import { AndamioConfig, EscrowConfig } from "../../../../types";
import { AndamioConfig, EscrowConfig, ProjectManagementConfig } from "../../../../types";
export function escrowByContractToken(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
contractToken: string,
): EscrowConfig {
const ESCROW = andamioConfig.escrows.find((escrow) =>
const ESCROW = andamioConfig.config.escrows.find((escrow) =>
contractToken.includes(escrow.contractTokenName),

@@ -9,0 +9,0 @@ );

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

import { AndamioConfig, GraphQLUTxO } from "../../../../types";
import { AndamioConfig, GraphQLUTxO, ProjectManagementConfig } from "../../../../types";
import { ProjectData } from "../../../contract.types";

@@ -6,3 +6,3 @@ import { contractTokenByEscrowAddress } from "../../treasury/utils";

export function getCommittedProjectListFromGraphqlUTxOs(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
graphqlUTxOs: GraphQLUTxO[],

@@ -33,3 +33,3 @@ contributorPolicyId: string

(token) =>
token.asset.policyId === andamioConfig.tokens.projectTokenPolicyID
token.asset.policyId === andamioConfig.config.projectManagementTokens.projectTokenPolicyID
)?.quantity ?? "0"

@@ -36,0 +36,0 @@ ),

import { UTxO } from "@meshsdk/core";
import { AndamioConfig, GraphQLTxResponse } from "../../../../types";
import { AndamioConfig, GraphQLTxResponse, ProjectManagementConfig } from "../../../../types";
import { GraphQL } from "../../../../lib/graphql";

@@ -8,3 +8,3 @@ import { ContributorTokenByCommittedUTxO } from "../../contributorReference";

export async function queryContributorAddressByCommittedUTxO(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
committedUTxO: UTxO

@@ -11,0 +11,0 @@ ): Promise<string> {

import { PlutusScript, resolveScriptRef } from "@meshsdk/core";
import { AndamioConfig } from "../../../../types";
import { AndamioConfig, ProjectManagementConfig } from "../../../../types";
export function escrowRefScriptUTxOByContractToken(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
contractToken: string
) {
const ESCROW = andamioConfig.escrows.find((escrow) =>
const ESCROW = andamioConfig.config.escrows.find((escrow) =>
contractToken.includes(escrow.contractTokenName)

@@ -10,0 +10,0 @@ );

import { GetUTxOWithAssetQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxO } from "../../../../types";
import { AndamioConfig, GraphQLUTxOResponse, ProjectManagementConfig, ResponseUTxO } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";

@@ -8,3 +8,3 @@ import { ProjectData } from "../../../contract.types";

export async function queryCommitmentUTxOBySelectedProject(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
selectedProject: ProjectData,

@@ -11,0 +11,0 @@ ): Promise<ResponseUTxO> {

import {
AndamioConfig,
GraphQLUTxOResponse,
ProjectManagementConfig,
ResponseUTxOsList,

@@ -11,3 +12,3 @@ } from "../../../../types";

export async function queryEscrowUTxOsByContractToken(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
contractToken: string

@@ -14,0 +15,0 @@ ): Promise<ResponseUTxOsList> {

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

import { AndamioConfig } from "../../../../types";
import { AndamioConfig, ProjectManagementConfig } from "../../../../types";
import { ProjectData } from "../../../contract.types";

@@ -15,3 +15,3 @@ import { DatumContractTokenUTxOByGraphqlUTxO, DatumMeshFundUTxO } from "../datums";

export async function queryTreasuryInfo(
andamioConfig: AndamioConfig
andamioConfig: AndamioConfig<ProjectManagementConfig>
): Promise<TreasuryInfo> {

@@ -59,3 +59,3 @@ const UTxOs = await queryTreasuryUTxOs(andamioConfig);

treasuryUTxOs,
andamioConfig.tokens.projectAsset
andamioConfig.config.projectManagementTokens.projectAsset
);

@@ -62,0 +62,0 @@

@@ -5,2 +5,3 @@ import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

ContractTransaction,
ProjectManagementConfig,
ReferenceScriptUTxOs,

@@ -24,3 +25,3 @@ ResponseUTxO,

project: ProjectData,
andamioConfig: AndamioConfig
andamioConfig: AndamioConfig<ProjectManagementConfig>
) {

@@ -51,3 +52,3 @@ const MANAGE_TX = new AddNewProjectTx(wallet, andamioConfig, project);

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<ProjectManagementConfig>,
private project: ProjectData

@@ -62,3 +63,3 @@ ) {

(await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.adminPolicyID
(asset) => asset.policyId === this.andamioConfig.config.projectManagementTokens.adminPolicyID
) ||

@@ -65,0 +66,0 @@ (() => {

import {
AndamioConfig,
ProjectManagementConfig,
ResponseUTxO,

@@ -10,3 +11,3 @@ SendValue,

export function updatedContractTokenToTreasury(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
project: ProjectData,

@@ -17,3 +18,3 @@ contractTokenUTxO: ResponseUTxO

recipient: {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
datum: {

@@ -26,3 +27,3 @@ value: DatumAddNewProject(project, contractTokenUTxO.graphQLUTxO),

output: {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
amount: [

@@ -29,0 +30,0 @@ {

@@ -6,2 +6,3 @@ import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

EscrowConfig,
ProjectManagementConfig,
ReferenceScriptUTxOs,

@@ -33,3 +34,3 @@ ResponseUTxO,

selectedProject: ProjectData,
andamioConfig: AndamioConfig
andamioConfig: AndamioConfig<ProjectManagementConfig>
) {

@@ -65,3 +66,3 @@ const COMMIT_TX = new CommitTx(wallet, selectedProject, andamioConfig);

private selectedProject: ProjectData,
private andamioConfig: AndamioConfig
private andamioConfig: AndamioConfig<ProjectManagementConfig>
) {

@@ -76,3 +77,3 @@ this.initialized = false;

(asset) =>
asset.policyId === this.andamioConfig.tokens.contributorPolicyID
asset.policyId === this.andamioConfig.config.projectManagementTokens.contributorPolicyID
) ||

@@ -79,0 +80,0 @@ (() => {

import { AssetExtended, UTxO } from '@meshsdk/core';
import { ProjectData } from '../../../../../contract.types';
import { AndamioConfig, EscrowConfig, SendValue } from '../../../../../../types';
import { AndamioConfig, EscrowConfig, ProjectManagementConfig, SendValue } from '../../../../../../types';
import { DatumCommitToProject } from '../../../../escrow';
export function commitmentToEscrow(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
selectedProject: ProjectData,

@@ -18,3 +18,3 @@ escrow: EscrowConfig,

{
unit: andamioConfig.tokens.projectAsset,
unit: andamioConfig.config.projectManagementTokens.projectAsset,
quantity: selectedProject.projectTokenAmount.toString(),

@@ -21,0 +21,0 @@ },

import { UTxO } from '@meshsdk/core';
import { ProjectData } from '../../../../../contract.types';
import { AndamioConfig, ResponseUTxO, SendValue } from '../../../../../../types';
import { AndamioConfig, ProjectManagementConfig, ResponseUTxO, SendValue } from '../../../../../../types';
import { DatumRemoveProjectToBeCommitted } from '../../../datums';
export function contractTokenBackToTreasury(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
selectedProject: ProjectData,

@@ -33,3 +33,3 @@ treasuryContractTokenUTxO: ResponseUTxO,

output: {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
amount: ASSETS_BACK_TO_TREASURY,

@@ -46,3 +46,3 @@ },

recipient: {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
datum: {

@@ -49,0 +49,0 @@ value: OUTGOING_CONTARCT_DATUM,

import { UTxO } from '@meshsdk/core';
import { ProjectData } from '../../../../../contract.types';
import { AndamioConfig, SendValue } from '../../../../../../types';
import { AndamioConfig, ProjectManagementConfig, SendValue } from '../../../../../../types';
import { DatumMeshFundUTxO } from '../../../datums';
export function residueFundsToTreasury(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
selectedProject: ProjectData,

@@ -25,3 +25,3 @@ treasuryFundUTxO: UTxO,

const projectTokenAtTreasury = assetsAtTreasury.filter(
(asset) => asset.unit === andamioConfig.tokens.projectAsset,
(asset) => asset.unit === andamioConfig.config.projectManagementTokens.projectAsset,
);

@@ -40,3 +40,3 @@ const numberProjectTokenAtTreasury = parseInt(

{
unit: andamioConfig.tokens.projectAsset,
unit: andamioConfig.config.projectManagementTokens.projectAsset,
quantity: numberProjectTokenBackToTreasury.toString(),

@@ -48,3 +48,3 @@ },

output: {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
amount: ASSETS_BACK_TO_TREASURY,

@@ -57,3 +57,3 @@ },

recipient: {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
datum: {

@@ -60,0 +60,0 @@ value: OUTGOING_DATUM,

import { UTxO } from "@meshsdk/core";
import { ProjectData } from "../../../../../contract.types";
import { AndamioConfig } from "../../../../../../types";
import { AndamioConfig, ProjectManagementConfig } from "../../../../../../types";

@@ -8,3 +8,3 @@ export function selectFundUTxO(

selectedProject: ProjectData,
andamioConfig: AndamioConfig
andamioConfig: AndamioConfig<ProjectManagementConfig>
) {

@@ -20,3 +20,3 @@ const FundUTxO = FundUTxOsList.find((utxo) => {

utxo.output.amount.find(
(asset) => asset.unit === andamioConfig.tokens.projectAsset
(asset) => asset.unit === andamioConfig.config.projectManagementTokens.projectAsset
)?.quantity || "0"

@@ -23,0 +23,0 @@ ) > selectedProject.projectTokenAmount;

@@ -5,2 +5,3 @@ import { AssetExtended, BrowserWallet, Transaction } from "@meshsdk/core";

ContractTransaction,
ProjectManagementConfig,
ReferenceScriptUTxOs,

@@ -15,3 +16,3 @@ TxOutputs,

wallet: BrowserWallet,
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
adaAmount: number,

@@ -40,3 +41,3 @@ projectTokenAmount: number

private wallet: BrowserWallet,
private andamioConfig: AndamioConfig,
private andamioConfig: AndamioConfig<ProjectManagementConfig>,
private adaAmount: number,

@@ -51,3 +52,3 @@ private projectTokenAmount: number

(await this.wallet.getAssets()).find(
(asset) => asset.policyId === this.andamioConfig.tokens.adminPolicyID
(asset) => asset.policyId === this.andamioConfig.config.projectManagementTokens.adminPolicyID
) ||

@@ -54,0 +55,0 @@ (() => {

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

import { AndamioConfig } from "../../../../../../types";
import { AndamioConfig, ProjectManagementConfig } from "../../../../../../types";
import { DatumMeshFundUTxO } from "../../../datums";
export function fundsToTreasury(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
adaAmount: number,

@@ -11,3 +11,3 @@ projectTokenAmount: number

recipient: {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
datum: {

@@ -20,3 +20,3 @@ value: DatumMeshFundUTxO,

output: {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
amount: [

@@ -28,3 +28,3 @@ {

{
unit: andamioConfig.tokens.projectAsset,
unit: andamioConfig.config.projectManagementTokens.projectAsset,
quantity: projectTokenAmount.toString(),

@@ -31,0 +31,0 @@ },

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

import { AndamioConfig } from "../../../../types";
import { AndamioConfig, ProjectManagementConfig } from "../../../../types";

@@ -7,6 +7,6 @@ /**

export function contractTokenByEscrowAddress(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
escrowAddress: string,
) {
const ESCROW = andamioConfig.escrows.find(
const ESCROW = andamioConfig.config.escrows.find(
(escrow) => escrow.address === escrowAddress,

@@ -16,3 +16,3 @@ );

return (
andamioConfig.tokens.contractTokenPolicyID + ESCROW.contractTokenName
andamioConfig.config.projectManagementTokens.contractTokenPolicyID + ESCROW.contractTokenName
);

@@ -19,0 +19,0 @@ }

import { GetUTxOWithAssetQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxO } from "../../../../types";
import { AndamioConfig, GraphQLUTxOResponse, ProjectManagementConfig, ResponseUTxO } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryContractTokenUTxOByContractToken(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
contractToken: string,

@@ -14,3 +14,3 @@ ): Promise<ResponseUTxO> {

res = await graphql.graphQLClient.request(GetUTxOWithAssetQuery, {
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
assetId: contractToken,

@@ -17,0 +17,0 @@ });

import { GraphQL, getUTxOsByDatumHash } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxOsList } from "../../../../types";
import { AndamioConfig, GraphQLUTxOResponse, ProjectManagementConfig, ResponseUTxOsList } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryFundUTxOsByDatum(
andamioConfig: AndamioConfig,
andamioConfig: AndamioConfig<ProjectManagementConfig>,
): Promise<ResponseUTxOsList> {

@@ -16,3 +16,3 @@ const graphql = new GraphQL();

'923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec',
address: andamioConfig.treasury.address,
address: andamioConfig.config.treasury.address,
},

@@ -19,0 +19,0 @@ );

import { ContractUtxosQuery, GraphQL } from "../../../../lib/graphql";
import { AndamioConfig, GraphQLUTxOResponse, ResponseUTxOsList } from "../../../../types";
import { AndamioConfig, GraphQLUTxOResponse, ProjectManagementConfig, ResponseUTxOsList } from "../../../../types";
import { graphQLUTxOtoMeshUTxO } from "../../../../utils";
export async function queryTreasuryUTxOs(
andamioConfig: AndamioConfig
andamioConfig: AndamioConfig<ProjectManagementConfig>
): Promise<ResponseUTxOsList> {

@@ -14,3 +14,3 @@ const graphql = new GraphQL();

{
contractAddress: andamioConfig.treasury.address,
contractAddress: andamioConfig.config.treasury.address,
},

@@ -17,0 +17,0 @@ );

import { PlutusScript, UTxO, resolveScriptRef } from '@meshsdk/core';
import { AndamioConfig } from '../../../../types';
import { AndamioConfig, ProjectManagementConfig } from '../../../../types';
export function treasuryRefScriptUTxO(andamioConfig: AndamioConfig): UTxO {
export function treasuryRefScriptUTxO(andamioConfig: AndamioConfig<ProjectManagementConfig>): UTxO {
const TREASURY_SCRIPT: PlutusScript = {
version: 'V2',
code: andamioConfig.treasury.cbor,
code: andamioConfig.config.treasury.cbor,
};

@@ -12,11 +12,11 @@

input: {
outputIndex: andamioConfig.treasury.referenceTxIx,
txHash: andamioConfig.treasury.referenceTxHash,
outputIndex: andamioConfig.config.treasury.referenceTxIx,
txHash: andamioConfig.config.treasury.referenceTxHash,
},
output: {
address: andamioConfig.treasury.referenceUTxOAddress,
address: andamioConfig.config.treasury.referenceUTxOAddress,
amount: [
{
unit: 'lovelace',
quantity: andamioConfig.treasury.referenceTxLovelace,
quantity: andamioConfig.config.treasury.referenceTxLovelace,
},

@@ -23,0 +23,0 @@ ],

@@ -5,3 +5,3 @@ // In /starter, we break up into configs for each contract -- see starter/src/config

export declare type AndamioConfig = {
export interface AndamioConfig<T> {
title: string;

@@ -14,18 +14,13 @@ baseAddress: string;

network: '0' | '1';
tokens: {
config: T
}
export interface CourseManagementConfig {
courseManagementTokens: {
learnerPolicyID: string;
contributorPolicyID: string;
adminAsset: string;
adminPolicyID: string;
adminTokenName: string;
projectAsset: string;
projectTokenPolicyID: string;
projectTokenName: string;
contractTokenPolicyID: string;
moduleTokenPolicyID: string;
courseCreatorPolicyID: string;
courseDeciderPolicyID: string;
// deciderTokenNames: string[];
};
treasury: {
courseReference: {
address: string;

@@ -38,5 +33,4 @@ cbor: string;

};
escrows: EscrowConfig[];
contributorReference: {
address: string;
moduleMintingReference: {
policyid: string;
cbor: string;

@@ -48,4 +42,5 @@ referenceUTxOAddress: string;

};
contributorMinter: {
plutusScript: PlutusScript;
learnerMintingReference: {
policyid: string;
cbor: string;
referenceUTxOAddress: string;

@@ -56,3 +51,3 @@ referenceTxHash: string;

};
courseReference: {
learnerReference: {
address: string;

@@ -65,4 +60,4 @@ cbor: string;

};
moduleMintingReference: {
policyid: string;
assignment: {
address: string;
cbor: string;

@@ -74,4 +69,23 @@ referenceUTxOAddress: string;

};
learnerMintingReference: {
policyid: string;
coursemanagementNftArtwork?: {
learnerNFTURL?: string;
courseModuleNFTURL?: string;
courseCreatorNFTURL?: string;
courseDeciderNFTURL?: string;
}
}
export interface ProjectManagementConfig {
projectManagementTokens: {
contributorPolicyID: string;
adminAsset: string;
adminPolicyID: string;
adminTokenName: string;
projectAsset: string;
projectTokenPolicyID: string;
projectTokenName: string;
contractTokenPolicyID: string;
};
treasury: {
address: string;
cbor: string;

@@ -83,3 +97,4 @@ referenceUTxOAddress: string;

};
learnerReference: {
escrows: EscrowConfig[];
contributorReference: {
address: string;

@@ -92,5 +107,4 @@ cbor: string;

};
assignment: {
address: string;
cbor: string;
contributorMinter: {
plutusScript: PlutusScript;
referenceUTxOAddress: string;

@@ -101,3 +115,7 @@ referenceTxHash: string;

};
};
projectManagementNftArtwork?: {
contributorNFTURL?: string;
contractTokenNFTURL?: string;
}
}

@@ -115,1 +133,100 @@ export declare type EscrowConfig = {

};
// export declare type AndamioConfig = {
// title: string;
// baseAddress: string;
// enterpriseAddress: string;
// rewardAddress: string;
// // referenceScriptAddress: string;
// metadataKey: string;
// network: '0' | '1';
// tokens: {
// learnerPolicyID: string;
// contributorPolicyID: string;
// adminAsset: string;
// adminPolicyID: string;
// adminTokenName: string;
// projectAsset: string;
// projectTokenPolicyID: string;
// projectTokenName: string;
// contractTokenPolicyID: string;
// moduleTokenPolicyID: string;
// courseCreatorPolicyID: string;
// courseDeciderPolicyID: string;
// // deciderTokenNames: string[];
// };
// treasury: {
// address: string;
// cbor: string;
// referenceUTxOAddress: string;
// referenceTxHash: string;
// referenceTxIx: number;
// referenceTxLovelace: string;
// };
// escrows: EscrowConfig[];
// contributorReference: {
// address: string;
// cbor: string;
// referenceUTxOAddress: string;
// referenceTxHash: string;
// referenceTxIx: number;
// referenceTxLovelace: string;
// };
// contributorMinter: {
// plutusScript: PlutusScript;
// referenceUTxOAddress: string;
// referenceTxHash: string;
// referenceTxIx: number;
// referenceTxLovelace: string;
// };
// courseReference: {
// address: string;
// cbor: string;
// referenceUTxOAddress: string;
// referenceTxHash: string;
// referenceTxIx: number;
// referenceTxLovelace: string;
// };
// moduleMintingReference: {
// policyid: string;
// cbor: string;
// referenceUTxOAddress: string;
// referenceTxHash: string;
// referenceTxIx: number;
// referenceTxLovelace: string;
// };
// learnerMintingReference: {
// policyid: string;
// cbor: string;
// referenceUTxOAddress: string;
// referenceTxHash: string;
// referenceTxIx: number;
// referenceTxLovelace: string;
// };
// learnerReference: {
// address: string;
// cbor: string;
// referenceUTxOAddress: string;
// referenceTxHash: string;
// referenceTxIx: number;
// referenceTxLovelace: string;
// };
// assignment: {
// address: string;
// cbor: string;
// referenceUTxOAddress: string;
// referenceTxHash: string;
// referenceTxIx: number;
// referenceTxLovelace: string;
// };
// nftArtwork?: {
// learnerNFTURL?: string;
// courseModuleNFTURL?: string;
// courseCreatorNFTURL?: string;
// courseDeciderNFTURL?: string;
// contributorNFTURL?: string;
// contractTokenNFTURL?: string;
// }
// };
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