-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Rust bindings to make the package publishable (#19)
* Move cardano code to its own folder * Regenerate with new cddl-codegen * work on json codegen * Undo changes to Plutus.json * cargo fmt * Update github action cwd * Fix git workflow configs * Fix cargo fmt in github actions * Fix clippy error * Add stronger git hook * cargo fmt * Fix publish-helper script * Add NPM packages to the README * cargo fmt
- Loading branch information
1 parent
102d909
commit 0479a97
Showing
58 changed files
with
2,798 additions
and
630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,3 @@ sdk/Cargo.lock | |
**/target | ||
**/pkg | ||
**/node_modules | ||
**/package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
members = [ | ||
"sdk/rust", | ||
"sdk/wasm", | ||
"sdk/wasm/json-gen", | ||
] | ||
|
||
[workspace.metadata.release] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Building | ||
|
||
1. Install [Aiken](https://aiken-lang.org/installation-instructions) | ||
2. Run `aiken build` or `aiken check` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Generated inspired from the code generated using [projected-nft.cddl](./projected-nft.cddl) with the following cddl-codegen command | ||
|
||
```bash | ||
cargo run -- --input=projected-nft.cddl.cddl --output=. --json-serde-derives true --json-schema-export true --to-from-bytes-methods false --common-import-override=cml_core | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
policy_id = _CDDL_CODEGEN_RAW_BYTES_TYPE_ | ||
asset_name = _CDDL_CODEGEN_EXTERN_TYPE_ | ||
ed25519_key_hash = _CDDL_CODEGEN_RAW_BYTES_TYPE_ | ||
out_ref = _CDDL_CODEGEN_EXTERN_TYPE_ | ||
big_int = _CDDL_CODEGEN_EXTERN_TYPE_ ; https://github.com/dcSpark/cddl-codegen/issues/220 | ||
|
||
owner = | ||
ed25519_key_hash ; @name PKH | ||
/ [policy_id, asset_name] ; @name NFT | ||
/ asset_name ; @name Receipt | ||
|
||
status = | ||
0 ; @name Locked | ||
/ [out_ref: out_ref, for_how_long: big_int] ; @name Unlocking | ||
|
||
|
||
state = | ||
[ owner: owner | ||
, status: status | ||
] | ||
|
||
redeem = | ||
[ partial_withdraw: bool | ||
, nft_input_owner: out_ref / null | ||
, new_receipt_owner: asset_name / null | ||
] | ||
|
||
mint_redeemer = | ||
[total: big_int] ; @name MintTokens | ||
/ 1 ; @name BurnTokens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "cardano-projected-nft-sdk" | ||
name = "cardano-projected-nft" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sdk/wasm/example_dapp/src/run.ts → cardano/sdk/wasm/example_dapp/src/run.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "cardano-projected-nft-json-schema-gen" | ||
version = "0.0.1" | ||
edition = "2018" | ||
|
||
|
||
[dependencies] | ||
serde_json = "1.0.57" | ||
schemars = "0.8.8" | ||
cardano-projected-nft = { path = "../../rust" } | ||
cml-chain = { version = "0.1.0" } | ||
cml-crypto = { version = "0.1.0" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
export type MintRedeemerJSON = | ||
| "BurnTokens" | ||
| { | ||
MintTokens: { | ||
total: string; | ||
[k: string]: unknown; | ||
}; | ||
}; | ||
export interface OutRefJSON { | ||
index: number; | ||
tx_id: string; | ||
} | ||
export type OwnerJSON = | ||
| { | ||
PKH: string; | ||
} | ||
| { | ||
NFT: [string, AssetNameJSON]; | ||
} | ||
| { | ||
Receipt: AssetNameJSON; | ||
}; | ||
export interface RedeemJSON { | ||
new_receipt_owner?: AssetNameJSON | null; | ||
nft_input_owner?: OutRefJSON | null; | ||
partial_withdraw: boolean; | ||
} | ||
export interface StateJSON { | ||
owner: OwnerJSON; | ||
status: StatusJSON; | ||
} | ||
export type StatusJSON = | ||
| "Locked" | ||
| { | ||
Unlocking: { | ||
for_how_long: string; | ||
out_ref: OutRefJSON; | ||
[k: string]: unknown; | ||
}; | ||
}; | ||
export type ScriptHashJSON = string; | ||
export interface AssetNameJSON { | ||
inner: number[]; | ||
} | ||
export type BigIntJSON = string; | ||
export type Ed25519KeyHashJSON = string; |
Oops, something went wrong.