feat: rework how modules are loaded
This commit is contained in:
36
examples/sample/lib/sample.ak
Normal file
36
examples/sample/lib/sample.ak
Normal file
@@ -0,0 +1,36 @@
|
||||
pub type Signer {
|
||||
hash: Int,
|
||||
}
|
||||
|
||||
pub type ScriptContext {
|
||||
signer: Signer,
|
||||
}
|
||||
|
||||
pub type Redeem {
|
||||
Buy
|
||||
Sell
|
||||
}
|
||||
|
||||
pub type Datum {
|
||||
fin: Int,
|
||||
sc: ScriptContext,
|
||||
rdmr: Redeem,
|
||||
}
|
||||
|
||||
pub fn eqInt(a: Int, b: Int) {
|
||||
a == b
|
||||
}
|
||||
|
||||
pub fn eqString(a: ByteArray, b: ByteArray) {
|
||||
a == b
|
||||
}
|
||||
|
||||
pub type Thing {
|
||||
Some
|
||||
None
|
||||
}
|
||||
|
||||
pub type Other {
|
||||
Wow
|
||||
Yes
|
||||
}
|
||||
8
examples/sample/lib/sample/context.ak
Normal file
8
examples/sample/lib/sample/context.ak
Normal file
@@ -0,0 +1,8 @@
|
||||
pub type ScriptContext(purpose) {
|
||||
tx_info: TxInfo,
|
||||
script_purpose: purpose,
|
||||
}
|
||||
|
||||
pub type TxInfo {
|
||||
idk: Int,
|
||||
}
|
||||
8
examples/sample/lib/sample/mint.ak
Normal file
8
examples/sample/lib/sample/mint.ak
Normal file
@@ -0,0 +1,8 @@
|
||||
use sample/context
|
||||
|
||||
pub type Mint {
|
||||
currency_symbol: ByteArray,
|
||||
}
|
||||
|
||||
pub type ScriptContext =
|
||||
context.ScriptContext(Mint)
|
||||
8
examples/sample/lib/sample/spend.ak
Normal file
8
examples/sample/lib/sample/spend.ak
Normal file
@@ -0,0 +1,8 @@
|
||||
use sample/context
|
||||
|
||||
pub type Spend {
|
||||
idk: Int,
|
||||
}
|
||||
|
||||
pub type ScriptContext =
|
||||
context.ScriptContext(Spend)
|
||||
Reference in New Issue
Block a user