diff --git a/dapp/README.md b/dapp/README.md index e45ce16..206769e 100644 --- a/dapp/README.md +++ b/dapp/README.md @@ -1,9 +1,21 @@ # Spore Typed Message +## Create and transfer Spore on test network by default secp256k1 lock + ```shell $ npm install -$ npm run indexCreateSpore -# Replace TxHash in src/indexTransferSpore.ts -$ npm run indexTransferSpore +$ npm run skCreateSpore +# Replace TxHash in src/skTransferSpore.ts +$ npm run skTransferSpore +``` + +## Create and transfer Spore on dev network by typed message + +**Not yet testable!** + +```shell +$ npm run tmCreateSpore +# Replace TxHash in src/tmTransferSpore.ts +$ npm run tmTransferSpore ``` diff --git a/dapp/package.json b/dapp/package.json index c777e4e..cc72e0c 100644 --- a/dapp/package.json +++ b/dapp/package.json @@ -3,11 +3,11 @@ "version": "0.1.0", "license": "MIT", "scripts": { - "rawCreateImmortalSpore": "ts-node src/rawCreateImmortalSpore.ts", - "rawCreatePrivateCluster": "ts-node src/rawCreatePrivateCluster.ts", - "rawCreateSpore": "ts-node src/rawCreateSpore.ts", - "rawCreateSporeWithCluster": "ts-node src/rawCreateSporeWithCluster.ts", - "rawTransferSpore": "ts-node src/rawTransferSpore.ts", + "skCreateImmortalSpore": "ts-node src/skCreateImmortalSpore.ts", + "skCreatePrivateCluster": "ts-node src/skCreatePrivateCluster.ts", + "skCreateSpore": "ts-node src/skCreateSpore.ts", + "skCreateSporeWithCluster": "ts-node src/skCreateSporeWithCluster.ts", + "skTransferSpore": "ts-node src/skTransferSpore.ts", "tmCreateSpore": "ts-node src/tmCreateSpore.ts", "tmTransferSpore": "ts-node src/tmTransferSpore.ts" }, diff --git a/dapp/src/rawCreateImmortalSpore.ts b/dapp/src/skCreateImmortalSpore.ts similarity index 96% rename from dapp/src/rawCreateImmortalSpore.ts rename to dapp/src/skCreateImmortalSpore.ts index 4a87670..7d0ab70 100644 --- a/dapp/src/rawCreateImmortalSpore.ts +++ b/dapp/src/skCreateImmortalSpore.ts @@ -1,7 +1,7 @@ import { createSpore } from '@spore-sdk/core'; import { readFileSync } from 'fs'; import { resolve } from 'path'; -import { accounts } from './rawWallet'; +import { accounts } from './skWallet'; export async function fetchLocalFile(src: string) { const buffer = readFileSync(resolve(__dirname, src)); diff --git a/dapp/src/rawCreatePrivateCluster.ts b/dapp/src/skCreatePrivateCluster.ts similarity index 95% rename from dapp/src/rawCreatePrivateCluster.ts rename to dapp/src/skCreatePrivateCluster.ts index e78db08..3a0811a 100644 --- a/dapp/src/rawCreatePrivateCluster.ts +++ b/dapp/src/skCreatePrivateCluster.ts @@ -1,5 +1,5 @@ import { createCluster } from '@spore-sdk/core'; -import { accounts } from './rawWallet'; +import { accounts } from './skWallet'; export async function main() { let { txSkeleton, outputIndex } = await createCluster({ diff --git a/dapp/src/rawCreateSpore.ts b/dapp/src/skCreateSpore.ts similarity index 95% rename from dapp/src/rawCreateSpore.ts rename to dapp/src/skCreateSpore.ts index f16a043..8cb859e 100644 --- a/dapp/src/rawCreateSpore.ts +++ b/dapp/src/skCreateSpore.ts @@ -1,7 +1,7 @@ import { createSpore } from '@spore-sdk/core'; import { readFileSync } from 'fs'; import { resolve } from 'path'; -import { accounts } from './rawWallet'; +import { accounts } from './skWallet'; export async function fetchLocalFile(src: string) { const buffer = readFileSync(resolve(__dirname, src)); diff --git a/dapp/src/rawCreateSporeWithCluster.ts b/dapp/src/skCreateSporeWithCluster.ts similarity index 96% rename from dapp/src/rawCreateSporeWithCluster.ts rename to dapp/src/skCreateSporeWithCluster.ts index dfd1731..185d34b 100644 --- a/dapp/src/rawCreateSporeWithCluster.ts +++ b/dapp/src/skCreateSporeWithCluster.ts @@ -1,7 +1,7 @@ import { createSpore } from '@spore-sdk/core'; import { readFileSync } from 'fs'; import { resolve } from 'path'; -import { accounts } from './rawWallet'; +import { accounts } from './skWallet'; export async function fetchLocalFile(src: string) { const buffer = readFileSync(resolve(__dirname, src)); diff --git a/dapp/src/rawTransferSpore.ts b/dapp/src/skTransferSpore.ts similarity index 92% rename from dapp/src/rawTransferSpore.ts rename to dapp/src/skTransferSpore.ts index 28d8476..c86bc17 100644 --- a/dapp/src/rawTransferSpore.ts +++ b/dapp/src/skTransferSpore.ts @@ -1,5 +1,5 @@ import { transferSpore } from '@spore-sdk/core'; -import { accounts } from './rawWallet'; +import { accounts } from './skWallet'; async function main() { let { txSkeleton } = await transferSpore({ diff --git a/dapp/src/rawWallet.ts b/dapp/src/skWallet.ts similarity index 100% rename from dapp/src/rawWallet.ts rename to dapp/src/skWallet.ts diff --git a/dapp/src/tmConfig.ts b/dapp/src/tmConfig.ts index 97bc58e..d198d7f 100644 --- a/dapp/src/tmConfig.ts +++ b/dapp/src/tmConfig.ts @@ -1,4 +1,5 @@ import { createConfig } from '@ckb-lumos/config-manager'; +import { HashType } from '@ckb-lumos/base'; import { SporeConfig, PredefinedSporeConfigScriptName } from '@spore-sdk/core'; // export const config: SporeConfig = { @@ -156,7 +157,7 @@ export const config: SporeConfig = { export const configAuth = { script: { codeHash: '0x9017dadb5493e6317da3bab8a1456851d45043ff701d6455a03abdabcad99e3e', - hashType: 'data1', + hashType: 'data1' as HashType, }, cellDep: { outPoint: { @@ -170,7 +171,7 @@ export const configAuth = { export const configTypedMessageLockDemo = { script: { codeHash: '0xcf37fcee5e82ead0393c3aad78a7560a6f242fcc7d64aa2e6324de875ef1f2d5', - hashType: 'data1', + hashType: 'data1' as HashType, }, cellDep: { outPoint: {