This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add algosdk as a dependency (#41)
* chore: add algosdk as a dependency * chore: fixed the version * tests: adding the algosdk in tests * build: bumping dependencies * build: updating test artifacts * chore: adding engines field specifying node >= 18 * fix: fixing unit tests; removing deprecated algokit method --------- Co-authored-by: Altynbek Orumbayev <[email protected]>
- Loading branch information
1 parent
b7f76dc
commit 1fdb91d
Showing
47 changed files
with
591 additions
and
449 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
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
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
59 changes: 59 additions & 0 deletions
59
...lgokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2
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,59 @@ | ||
import * as algokit from '@algorandfoundation/algokit-utils' | ||
import { {{ contract_name.split('_')|map('capitalize')|join }}Client } from '../artifacts/{{ contract_name }}/client' | ||
|
||
// Below is a showcase of various deployment options you can use in TypeScript Client | ||
export async function deploy() { | ||
console.log('=== Deploying {{ contract_name.split('_')|map('capitalize')|join }} ===') | ||
|
||
const algod = algokit.getAlgoClient() | ||
const indexer = algokit.getAlgoIndexerClient() | ||
const deployer = await algokit.mnemonicAccountFromEnvironment({ name: 'DEPLOYER', fundWith: algokit.algos(3) }, algod) | ||
await algokit.ensureFunded( | ||
{ | ||
accountToFund: deployer, | ||
minSpendingBalance: algokit.algos(2), | ||
minFundingIncrement: algokit.algos(2), | ||
}, | ||
algod, | ||
) | ||
const appClient = new {{ contract_name.split('_')|map('capitalize')|join }}Client( | ||
{ | ||
resolveBy: 'creatorAndName', | ||
findExistingUsing: indexer, | ||
sender: deployer, | ||
creatorAddress: deployer.addr, | ||
}, | ||
algod, | ||
) | ||
|
||
{%- if preset_name == 'starter' %} | ||
const app = await appClient.deploy({ | ||
onSchemaBreak: 'append', | ||
onUpdate: 'append', | ||
}) | ||
{% elif preset_name == 'production' %} | ||
const isMainNet = await algokit.isMainNet(algod) | ||
const app = await appClient.deploy({ | ||
allowDelete: !isMainNet, | ||
allowUpdate: !isMainNet, | ||
onSchemaBreak: isMainNet ? 'append' : 'replace', | ||
onUpdate: isMainNet ? 'append' : 'update', | ||
}) | ||
{% endif %} | ||
|
||
// If app was just created fund the app account | ||
if (['create', 'replace'].includes(app.operationPerformed)) { | ||
algokit.transferAlgos( | ||
{ | ||
amount: algokit.algos(1), | ||
from: deployer, | ||
to: app.appAddress, | ||
}, | ||
algod, | ||
) | ||
} | ||
|
||
const method = 'hello' | ||
const response = await appClient.hello({ name: 'world' }) | ||
console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) | ||
} |
54 changes: 0 additions & 54 deletions
54
...lgokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy_config.py.j2
This file was deleted.
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
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
12 changes: 12 additions & 0 deletions
12
...erated/test_smart_contract_generator_default_production_preset_typescript/.prettierignore
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 @@ | ||
# don't ever format node_modules | ||
node_modules | ||
# don't lint format output (make sure it's set to your correct build folder name) | ||
dist | ||
build | ||
# don't format nyc coverage output | ||
coverage | ||
# don't format generated types | ||
**/generated/types.d.ts | ||
**/generated/types.ts | ||
# don't format ide files | ||
.idea |
10 changes: 10 additions & 0 deletions
10
...nerated/test_smart_contract_generator_default_production_preset_typescript/.prettierrc.js
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,10 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
jsxSingleQuote: false, | ||
semi: false, | ||
tabWidth: 2, | ||
trailingComma: 'all', | ||
printWidth: 120, | ||
endOfLine: 'lf', | ||
arrowParens: 'always', | ||
} |
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
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
Oops, something went wrong.