feat: change project structure
This commit is contained in:
3
examples/sample/src/sample.ak
Normal file
3
examples/sample/src/sample.ak
Normal file
@@ -0,0 +1,3 @@
|
||||
pub type ScriptContext {
|
||||
thing: String
|
||||
}
|
||||
7
examples/sample/src/sample/syntax.ak
Normal file
7
examples/sample/src/sample/syntax.ak
Normal file
@@ -0,0 +1,7 @@
|
||||
pub type ScriptContext {
|
||||
idk: Int
|
||||
}
|
||||
|
||||
pub fn append(a: ByteArray, b: ByteArray) -> ByteArray {
|
||||
todo
|
||||
}
|
||||
24
examples/sample/src/scripts/swap.ak
Normal file
24
examples/sample/src/scripts/swap.ak
Normal file
@@ -0,0 +1,24 @@
|
||||
use sample
|
||||
use sample/syntax.{append}
|
||||
|
||||
pub type Datum {
|
||||
something: String,
|
||||
}
|
||||
|
||||
pub type Redeemer {
|
||||
Buy
|
||||
Sell
|
||||
}
|
||||
|
||||
pub fn validate(datum: Datum, rdmr: Redeemer, ctx: sample.ScriptContext) -> Bool {
|
||||
let thing = if True {
|
||||
3
|
||||
} else {
|
||||
"thing"
|
||||
}
|
||||
|
||||
when rdmr is {
|
||||
Buy -> True
|
||||
Sell -> datum.something == "Aiken"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user