Skip to content

Commit

Permalink
LICENSE, more util scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
micahkendall committed Feb 26, 2024
1 parent 3ae3bc2 commit eb4b24c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 MICAH KENDALL

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 changes: 16 additions & 0 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {Lucid, Maestro, Script} from "lucid-cardano"

const lucid = await Lucid.new(
new Maestro({
apiKey: "",
network: "Mainnet",
}),
"Mainnet"
);
const ns: Script = lucid.utils.nativeScriptFromJson({
type: 'before',
slot: 0,
})
const lockScript = lucid.utils.validatorToAddress(ns)

console.log(await lucid.utxosAt(lockScript))
26 changes: 26 additions & 0 deletions scripts/nft.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Blockfrost, Lucid, fromText, toHex, toUnit, Data } from "lucid-cardano"
import * as plutus from "./plutus"

const lucid = await Lucid.new(
new Blockfrost(
'https://cardano-mainnet.blockfrost.io/api/v0',
''
),
'Mainnet',
)

const utxo = lucid.utxosByOutRef([{txHash: "9fe7265c1022c6a68af14e7d4063b0f7a7832c58255a4a8d219f6fc5285c310a", outputIndex: 0}])

const nftScript = new plutus.NftNft({
transactionId: {hash: "9fe7265c1022c6a68af14e7d4063b0f7a7832c58255a4a8d219f6fc5285c310a"},
outputIndex: 0n
})
console.log(nftScript)

const policy = lucid.utils.mintingPolicyToId(nftScript)
const tokenName = fromText("SaleAdmin")
const tokenUnit = toUnit(policy, tokenName)

const tx = await lucid.newTx().mintAssets({
[tokenUnit]: -1n
}, Data.to(1n)).complete()

0 comments on commit eb4b24c

Please sign in to comment.