-
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.
- Loading branch information
0 parents
commit efef700
Showing
11 changed files
with
95 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,3 @@ | ||
# Myfish Examples | ||
|
||
每个文件夹下都是一个示例。 |
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 @@ | ||
# project | ||
.DS_Store | ||
.vscode | ||
.idea | ||
node_modules | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# build | ||
dist | ||
|
||
# contract | ||
myfish.*.js | ||
testdb | ||
log |
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 @@ | ||
蚂蚁链 TypeScript 智能合约研发脚手架模板。 | ||
|
||
**不建议直接使用这个包,请直接使用 [Myfish](https://www.npmjs.com/package/@antchain/myfish) 初始化项目。** | ||
|
||
更多信息请查看 [官方文档](https://opendocs.antchain.antgroup.com/) 🚀🚀🚀 |
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 @@ | ||
import { my, Storage, BaseContract } from '@antchain/myassembly'; | ||
|
||
export default class Contract extends BaseContract { | ||
protected name: Storage<string> = new Storage('name', 'myfish'); | ||
|
||
@EXPORT | ||
public SetName(name: string): void { | ||
this.name.setData(name); | ||
} | ||
|
||
@EXPORT | ||
public GetName(): string { | ||
return this.name.getData(); | ||
} | ||
|
||
@EXPORT | ||
public GetLastBlockNumber(): u64 { | ||
return my.getBlockNumber(); | ||
} | ||
} |
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 @@ | ||
你需要把这个文件替换成你自己的 Key |
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 @@ | ||
你需要把这个文件替换成你自己的 Key |
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 @@ | ||
// 配置说明请参考 https://opendocs.antchain.antgroup.com/myfish/myfish-config | ||
module.exports = { | ||
// 合约相关配置 | ||
contract: { | ||
name: 'myfish-demo', | ||
version: 1, | ||
}, | ||
// rest 链接链相关配置 | ||
// 请获取你的链的相关 AK/SK 等信息填入配置 | ||
// 参考文档 https://opendocs.antchain.antgroup.com/myfish/connect | ||
rest: { | ||
bizid: '0b06e2744ad341538b7a3b3cc5ad9e57', // 链的 ID,这里默认是实验链的 ID | ||
restUrl: 'https://rest.baas.alipay.com', | ||
accessId: 'inputYourAccessId', | ||
accessSecret: './certs/access.key', | ||
account: 'inputYourAccount', | ||
accountPrivateKey: './certs/user.key', | ||
accountPrivateKeyPassword: 'inputYourPassword', | ||
}, | ||
}; |
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 @@ | ||
/// <reference types="@antchain/myassembly/assembly/types" /> |
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 @@ | ||
module.exports = function () { | ||
// 该文件只是用于 require.resolve 可以找到该包,没有任何实际意义 | ||
}; |
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,21 @@ | ||
{ | ||
"name": "@antchain/myfish-scaffold", | ||
"version": "0.2.0", | ||
"files": [ | ||
"assembly", | ||
"config/myfish.js", | ||
"config/certs", | ||
".gitignore", | ||
"global.d.ts", | ||
"index.js", | ||
"package.json", | ||
"tsconfig.json" | ||
], | ||
"dependencies": { | ||
"@antchain/myassembly": "^0.2.0" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org", | ||
"access": "public" | ||
} | ||
} |
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 @@ | ||
{ | ||
"extends": "@antchain/myassembly/assembly.json", | ||
"include": ["assembly", "global.d.ts"] | ||
} |