forked from cardano-foundation/cardano-devkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/snippets-extension' of https://github.com/sidan…
…-lab/cardano-devkit into feature/snippets-extension
- Loading branch information
Showing
9 changed files
with
123 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Set default behavior to automatically normalize line endings. | ||
* text=auto |
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,3 @@ | ||
node_modules | ||
*.vsix | ||
test.* |
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,17 @@ | ||
// A launch configuration that launches the extension inside a new window | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
] | ||
} | ||
] | ||
} |
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 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
.gitignore | ||
vsc-extension-quickstart.md |
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,9 @@ | ||
# Change Log | ||
|
||
All notable changes to the "cardano-dev-snippet" extension will be documented in this file. | ||
|
||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. | ||
|
||
## [Unreleased] | ||
|
||
- Initial 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,28 @@ | ||
# cardano-dev-snippet | ||
|
||
## 🚧 Under Construction 🚧 | ||
|
||
## Introduction | ||
|
||
Snippets for Cardano Development | ||
|
||
## Contribution | ||
|
||
Add or modify the JSON files in the `snippets` folder. The file name should be the language identifier. For example, `mesh-react-hooks.json` for hooks in `@meshsdk/react`. | ||
|
||
## Publishing the Extension | ||
Before publishing, make sure you have the Visual Studio Code Extension Manager installed: | ||
```bash | ||
npm install -g @vscode/vsce | ||
``` | ||
|
||
To generate the `.vsix` file: | ||
```bash | ||
vsce package | ||
``` | ||
* You can install the extension from the `.vsix` file to test it locally. | ||
|
||
To publish the extension to VS Code Marketplace: | ||
```bash | ||
vsce publish | ||
``` |
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,24 @@ | ||
{ | ||
"name": "cardano-dev-snippet", | ||
"displayName": "cardano-dev-snippet", | ||
"description": "A snippet extension for cardano development", | ||
"version": "0.0.1", | ||
"engines": { | ||
"vscode": "^0.10.5" | ||
}, | ||
"categories": [ | ||
"Snippets" | ||
], | ||
"contributes": { | ||
"snippets": [ | ||
{ | ||
"language": "typescript", | ||
"path": "./snippets/meshsdk-txbuilder.json" | ||
}, | ||
{ | ||
"language": "typescript", | ||
"path": "./snippets/meshsdk-wallet-hooks.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"sendLovelace": { | ||
"prefix": "sendLovelace", | ||
"body": [ | ||
"import { Transaction } from '@meshsdk/core';", | ||
"const tx = new Transaction({ initiator: wallet }).sendLovelace('address','1000000');", | ||
"const unsignedTx = await tx.build();", | ||
"const signedTx = await wallet.signTx(unsignedTx);", | ||
"const txHash = await wallet.submitTx(signedTx);" | ||
], | ||
"description": "Using Mesh Tx Builder to build a transaction to send lovelace to the recipient's address" | ||
}, | ||
"useWalletList": { | ||
"prefix": "walletList", | ||
"body": [ | ||
"const wallets = useWalletList();" | ||
], | ||
"description": "useWalletList hook" | ||
} | ||
} |
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,16 @@ | ||
{ | ||
"useWallet": { | ||
"prefix": "useWallet", | ||
"body": [ | ||
"const { wallet, connected, name, connecting, connect, disconnect, error } = useWallet();" | ||
], | ||
"description": "useWallet hook" | ||
}, | ||
"useWalletList": { | ||
"prefix": "useWalletList", | ||
"body": [ | ||
"const wallets = useWalletList();" | ||
], | ||
"description": "useWalletList hook" | ||
} | ||
} |