Skip to content

Merge release/0.3.0 to main branch #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5ec4f2b
feat: Add utils to dynamic fetch cell deps
duanyytop May 21, 2024
d76c283
refactor: Use selected parameter to fetch cell deps
duanyytop May 24, 2024
f4b270e
refactor: Dynamic fetch rgbpp xudt cell deps
duanyytop May 24, 2024
104e878
refactor: Dynamic fetch rgbpp spore cell deps
duanyytop May 24, 2024
89944a6
refactor: Fetch cell deps for xudt examples
duanyytop May 24, 2024
648d14f
refactor: Delete fetching cell deps error log
duanyytop May 24, 2024
2730f59
docs: Add annotations about rgbpp and btc time config cell
duanyytop May 24, 2024
3d41751
feat: batch queries in the sendRgbppUtxos() and TxBuilder.validateInp…
ShookLyngs May 24, 2024
a65d425
feat: Return needPaymasterCell for spore
duanyytop May 28, 2024
fc1128b
fix: Update pnpm-lock.yaml
duanyytop May 28, 2024
ef0b2a4
feat: Update CkbVirtualTxResultType for new field
duanyytop May 28, 2024
1310d40
feat: Fetch cell deps from CDN
duanyytop May 28, 2024
d2d963c
chore: Add changeset
duanyytop May 28, 2024
d900e41
Merge pull request #197 from ckb-cell/feat/return-need-paymaster
duanyytop May 28, 2024
d0e62e2
feat: add needPaymaster option to the sendRgbppUtxos() API
ShookLyngs May 28, 2024
6c540de
feat: use needPaymasterCell in step3 of the launch examples
ShookLyngs May 28, 2024
2b18e8f
fix: include range in tsconfig.json of the rgbpp examples
ShookLyngs May 28, 2024
dcfdaf4
feat: use needPaymasterCell in all spore examples and xudt launch exa…
ShookLyngs May 28, 2024
5785f5a
Merge pull request #199 from ckb-cell/feat/need-paymaster-option
Flouse May 29, 2024
f0b99c7
Merge pull request #200 from ckb-cell/feat/batch-queries
Flouse May 29, 2024
fb5ca24
test: skip dust_satoshi check in service tests
ShookLyngs May 29, 2024
0f33e45
Merge pull request #203 from ckb-cell/test/skip-dust-test
ShookLyngs May 30, 2024
1d985b9
docs: Add more annotations to rgbpp examples
duanyytop May 29, 2024
263b1bc
docs: Update examples readme
duanyytop May 30, 2024
fa9188e
docs: Add replacing parameters warning to readme
duanyytop May 30, 2024
da7cc35
Update examples/rgbpp/README.md
duanyytop May 30, 2024
c8694dd
docs: Introduction BTC P2WPKH address
duanyytop May 30, 2024
e455bab
Merge pull request #202 from ckb-cell/docs/examples-annotations
Flouse May 30, 2024
95d1f75
docs(FAQ): Where is the error code description for the RgbppLockScrip…
Flouse May 31, 2024
b7a8309
docs(examples): Add example commands comment and FAQ link (#206)
duanyytop May 31, 2024
207ca98
Merge pull request #191 from ckb-cell/feat/dynamic-fetch-cell-dep
Flouse Jun 2, 2024
ebb098b
fix: use rgbpp@worksapce to prevent unresolved dep issue (#209)
ShookLyngs Jun 3, 2024
4f05b1b
feat: adapt btc-assets-api#154, add total_satoshi/available_satoshi i…
ShookLyngs Jun 2, 2024
4c77e69
fix: load the first 16 bytes of the XUDT cell data (#212)
ShookLyngs Jun 3, 2024
964c8c8
fix: ckb-leap-btc not reading env variables
Dawn-githup Jun 3, 2024
6c3a0dc
refactor: Replace example ckb short address with full address
duanyytop Jun 3, 2024
b5d9928
Merge pull request #214 from Dawn-githup/develop
duanyytop Jun 3, 2024
cd3df77
Merge pull request #208 from ckb-cell/feat/service-154
Flouse Jun 3, 2024
fe3f055
Merge pull request #215 from ckb-cell/ref/examples-full-address
Flouse Jun 3, 2024
6a44c3b
Bump RGB++ SDK to v0.3.0 (#213)
ShookLyngs Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ This repository offers utilities for Bitcoin and RGB++ asset integration.
### How to get an access token of Bitcoin/RGB++ Assets Service?
See [Generate a JSON Web Token (JWT) for Bitcoin/RGB++ Assets Service](./packages/service/README.md#get-an-access-token)

### Where is the error code description for the RgbppLockScript?
See [RGB++ Lock Script Error Codes](https://github.com/nervosnetwork/ckb-script-error-codes/blob/main/by-type-hash/bc6c568a1a0d0a09f6844dc9d74ddb4343c32143ff25f727c59edf4fb72d6936.md)

## License

Expand Down
2 changes: 2 additions & 0 deletions examples/rgbpp/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ CKB_INDEXER_URL=https://testnet.ckb.dev/indexer
# BTC Variables

# The BTC private key whose format is 32bytes hex string without 0x prefix
# The Native Segwit P2WPKH address will be generated with the BTC private key
# Read more about P2WPKH in BIP141: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#p2wpkh
BTC_PRIVATE_KEY=private-key

# The BTC assets api url which should be matched with IS_MAINNET
Expand Down
46 changes: 45 additions & 1 deletion examples/rgbpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
- xUDT directory: The examples for RGB++ UDT issuance, transfer, and leap
- Spore directory: The examples for RGB++ Spore creation, transfer and leap

> [!TIP]
> All the parameters of the examples should be repalced with your own, including BTC private key, CKB private key, BTC Service origin, BTC Service token, BTC UTXO, xUDT type args, Spore type args, etc. Please confirm whether the parameters are correct according to the code comments

## How to Start

### Install dependencies and build packages

```
pnpm install && pnpm build:packages
```
### Update .env

Copy the `.env.example` file to `.env`:

```shell
Expand All @@ -31,6 +41,8 @@ CKB_INDEXER_URL=https://testnet.ckb.dev/indexer
# BTC Variables

# The BTC private key whose format is 32bytes hex string without 0x prefix
# The Native Segwit P2WPKH address will be generated with the BTC private key
# Read more about P2WPKH in BIP141: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#p2wpkh
BTC_PRIVATE_KEY=private-key

# The BTC assets api url which should be matched with IS_MAINNET
Expand All @@ -44,23 +56,36 @@ VITE_BTC_SERVICE_TOKEN=;
VITE_BTC_SERVICE_ORIGIN=https://btc-test.app;
```


## RGB++ xUDT Examples

### RGB++ xUDT Launch on BTC

#### 1. Prepare Launch

> [!TIP]
> Please make sure the CKB private key in the .env is correct

```shell
# Create a CKB empty rgbpp lock cell to launch RGB++ xUDT assets later
npx ts-node xudt/launch/1-prepare-launch.ts
```
#### 2. Launch RGB++ xUDT on BTC

> [!TIP]
> Please make sure the `1-prepare-launch.ts` has been run and the corresponding CKB transaction has been committed

```shell
npx ts-node xudt/launch/2-launch-rgbpp.ts
```

When the command is executed successfully, the **RGB++ Asset type script args** will appear in the output log

#### 3. Distribute RGB++ xUDT on BTC

> [!TIP]
> Please make sure the `2-launch-rgbpp.ts` has been run and the corresponding BTC and CKB transactions have been committed
> The **RGB++ Asset type script args** in the above should be set to the `xudtTypeArgs`

```shell
npx ts-node xudt/launch/3-distribute-rgbpp.ts
```
Expand Down Expand Up @@ -103,14 +128,26 @@ npx ts-node xudt/4-unlock-btc-time.ts

#### 1. Create RGB++ Cluster Cell

> [!TIP]
> Please make sure all the variables in the .env are correct
> The BTC UTXO of `1-prepare-cluster.ts` and `2-create-cluster.ts` should be same

```shell
# Create a CKB empty rgbpp lock cell to create cluster later
npx ts-node spore/launch/1-prepare-cluster.ts

# Create a cluster cell with rgbpp lock
npx ts-node spore/launch/2-create-cluster.ts
```

When the commands are executed successfully, the **clusterId** and **cluster rgbpp lock args** will appear in the output log

#### 2. Create RGB++ Spores with Cluster on BTC

> [!TIP]
> Please make sure the `2-create-cluster.ts` has been run and the corresponding BTC and CKB transactions have been committed
> The **clusterId** in the above should be set to the `clusterId` and the **cluster rgbpp lock args** should be set to the `clusterRgbppLockArgs`

```shell
npx ts-node spore/launch/3-create-spores.ts
```
Expand Down Expand Up @@ -147,6 +184,13 @@ npx ts-node spore/6-unlock-btc-time-cell.ts
npx ts-node spore/7-leap-spore-to-btc.ts
```

## FAQ

If you have any questions, please refer to the FAQ first.

See [RGBPP FAQ](https://github.com/ckb-cell/rgbpp-sdk/wiki/RGBPP--FAQ)


## What you must know about BTC transaction id

**The BTC transaction id(hash) displayed on BTC explorer is different from the BTC transaction id(hash) in RGB++ lock args. They are in reverse byte order.**
Expand Down
18 changes: 14 additions & 4 deletions examples/rgbpp/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { AddressPrefix, privateKeyToAddress } from '@nervosnetwork/ckb-sdk-utils';
import {
blake160,
bytesToHex,
privateKeyToPublicKey,
scriptToAddress,
systemScripts,
} from '@nervosnetwork/ckb-sdk-utils';
import { DataSource, BtcAssetsApi } from 'rgbpp';
import { ECPair, ECPairInterface, bitcoin, NetworkType } from 'rgbpp/btc';
import dotenv from 'dotenv';
Expand All @@ -13,9 +19,11 @@ export const collector = new Collector({
ckbIndexerUrl: process.env.CKB_INDEXER_URL!,
});
export const CKB_PRIVATE_KEY = process.env.CKB_SECP256K1_PRIVATE_KEY!;
export const ckbAddress = privateKeyToAddress(CKB_PRIVATE_KEY, {
prefix: isMainnet ? AddressPrefix.Mainnet : AddressPrefix.Testnet,
});
const secp256k1Lock: CKBComponents.Script = {
...systemScripts.SECP256K1_BLAKE160,
args: bytesToHex(blake160(privateKeyToPublicKey(CKB_PRIVATE_KEY))),
};
export const ckbAddress = scriptToAddress(secp256k1Lock, isMainnet);

export const BTC_PRIVATE_KEY = process.env.BTC_PRIVATE_KEY!;
export const BTC_SERVICE_URL = process.env.VITE_BTC_SERVICE_URL!;
Expand All @@ -24,6 +32,8 @@ export const BTC_SERVICE_ORIGIN = process.env.VITE_BTC_SERVICE_ORIGIN!;

const network = isMainnet ? bitcoin.networks.bitcoin : bitcoin.networks.testnet;
export const btcKeyPair: ECPairInterface = ECPair.fromPrivateKey(Buffer.from(BTC_PRIVATE_KEY, 'hex'), { network });
// The Native Segwit P2WPKH address will be generated with the BTC private key
// Read more about P2WPKH in BIP141: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#p2wpkh
export const { address: btcAddress } = bitcoin.payments.p2wpkh({
pubkey: btcKeyPair.publicKey,
network,
Expand Down
2 changes: 2 additions & 0 deletions examples/rgbpp/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
SporeVirtualTxResult,
SporeCreateVirtualTxResult,
SporeTransferVirtualTxResult,
RgbppLaunchVirtualTxResult,
} from 'rgbpp/ckb';

/**
Expand All @@ -15,6 +16,7 @@ import {

export type CkbVirtualTxResultType =
| BaseCkbVirtualTxResult
| RgbppLaunchVirtualTxResult
| SporeVirtualTxResult
| SporeCreateVirtualTxResult
| SporeTransferVirtualTxResult;
Expand Down
6 changes: 4 additions & 2 deletions examples/rgbpp/spore/4-transfer-spore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ const transferSpore = async ({ sporeRgbppLockArgs, toBtcAddress, sporeTypeArgs }
// Save ckbVirtualTxResult
saveCkbVirtualTxResult(ckbVirtualTxResult, '4-transfer-spore');

const { commitment, ckbRawTx } = ckbVirtualTxResult;
const { commitment, ckbRawTx, needPaymasterCell } = ckbVirtualTxResult;

// Send BTC tx
const psbt = await sendRgbppUtxos({
ckbVirtualTx: ckbRawTx,
commitment,
tos: [toBtcAddress],
needPaymaster: needPaymasterCell,
ckbCollector: collector,
from: btcAddress!,
source: btcDataSource,
Expand Down Expand Up @@ -68,10 +69,11 @@ const transferSpore = async ({ sporeRgbppLockArgs, toBtcAddress, sporeTypeArgs }
}
};

// Use your real BTC UTXO information on the BTC Testnet
// Please use your real BTC UTXO information on the BTC Testnet
// rgbppLockArgs: outIndexU32 + btcTxId
transferSpore({
sporeRgbppLockArgs: buildRgbppLockArgs(2, 'd5868dbde4be5e49876b496449df10150c356843afb6f94b08f8d81f394bb350'),
toBtcAddress: 'tb1qhp9fh9qsfeyh0yhewgu27ndqhs5qlrqwau28m7',
// Please use your own RGB++ spore asset's sporeTypeArgs
sporeTypeArgs: '0x42898ea77062256f46e8f1b861d526ae47810ecc51ab50477945d5fa90452706',
});
6 changes: 4 additions & 2 deletions examples/rgbpp/spore/5-leap-spore-to-ckb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ const leapSporeFromBtcToCkb = async ({ sporeRgbppLockArgs, toCkbAddress, sporeTy
// Save ckbVirtualTxResult
saveCkbVirtualTxResult(ckbVirtualTxResult, '5-leap-spore-to-ckb');

const { commitment, ckbRawTx } = ckbVirtualTxResult;
const { commitment, ckbRawTx, needPaymasterCell } = ckbVirtualTxResult;

// Send BTC tx
const psbt = await sendRgbppUtxos({
ckbVirtualTx: ckbRawTx,
commitment,
tos: [btcAddress!],
needPaymaster: needPaymasterCell,
ckbCollector: collector,
from: btcAddress!,
source: btcDataSource,
Expand Down Expand Up @@ -69,10 +70,11 @@ const leapSporeFromBtcToCkb = async ({ sporeRgbppLockArgs, toCkbAddress, sporeTy
}
};

// Use your real BTC UTXO information on the BTC Testnet
// Please use your real BTC UTXO information on the BTC Testnet
// rgbppLockArgs: outIndexU32 + btcTxId
leapSporeFromBtcToCkb({
sporeRgbppLockArgs: buildRgbppLockArgs(3, 'd8a31796fbd42c546f6b22014b9b82b16586ce1df81b0e7ca9a552cdc492a0af'),
toCkbAddress: 'ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq0e4xk4rmg5jdkn8aams492a7jlg73ue0gc0ddfj',
// Please use your own RGB++ spore asset's sporeTypeArgs
sporeTypeArgs: '0x42898ea77062256f46e8f1b861d526ae47810ecc51ab50477945d5fa90452706',
});
3 changes: 2 additions & 1 deletion examples/rgbpp/spore/7-leap-spore-to-btc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ const leapSporeFromCkbToBtc = async ({
console.info(`RGB++ Spore has been jumped from CKB to BTC and tx hash is ${txHash}`);
};

// Use your real BTC UTXO information on the BTC Testnet
// Please use your real BTC UTXO information on the BTC Testnet
leapSporeFromCkbToBtc({
outIndex: 1,
btcTxId: '448897515cf07b4ca0cd38af9806399ede55775b4c760b274ed2322121ed185f',
// Please use your own RGB++ spore asset's sporeTypeArgs
sporeTypeArgs: '0x42898ea77062256f46e8f1b861d526ae47810ecc51ab50477945d5fa90452706',
});
1 change: 1 addition & 0 deletions examples/rgbpp/spore/launch/1-prepare-cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const prepareClusterCell = async ({ outIndex, btcTxId }: { outIndex: number; btc
console.info(`Cluster cell has been prepared and the tx hash ${txHash}`);
};

// Please use your real BTC UTXO information on the BTC Testnet
prepareClusterCell({
outIndex: 3,
btcTxId: 'aee4e8e3aa95e9e9ab1f0520714031d92d3263262099dcc7f7d64e62fa2fcb44',
Expand Down
6 changes: 4 additions & 2 deletions examples/rgbpp/spore/launch/2-create-cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from 'rgbpp/ckb';
import { saveCkbVirtualTxResult } from '../../shared/utils';

// Warning: Before runing this file, please run 1-prepare-cluster.ts
const createCluster = async ({ ownerRgbppLockArgs }: { ownerRgbppLockArgs: string }) => {
const ckbVirtualTxResult = await genCreateClusterCkbVirtualTx({
collector,
Expand All @@ -23,7 +24,7 @@ const createCluster = async ({ ownerRgbppLockArgs }: { ownerRgbppLockArgs: strin
// Save ckbVirtualTxResult
saveCkbVirtualTxResult(ckbVirtualTxResult, '2-create-cluster');

const { commitment, ckbRawTx, clusterId } = ckbVirtualTxResult;
const { commitment, ckbRawTx, clusterId, needPaymasterCell } = ckbVirtualTxResult;

console.log('clusterId: ', clusterId);

Expand All @@ -32,6 +33,7 @@ const createCluster = async ({ ownerRgbppLockArgs }: { ownerRgbppLockArgs: strin
ckbVirtualTx: ckbRawTx,
commitment,
tos: [btcAddress!],
needPaymaster: needPaymasterCell,
ckbCollector: collector,
from: btcAddress!,
source: btcDataSource,
Expand Down Expand Up @@ -79,7 +81,7 @@ const createCluster = async ({ ownerRgbppLockArgs }: { ownerRgbppLockArgs: strin
}, 30 * 1000);
};

// Use your real BTC UTXO information on the BTC Testnet
// Please use your real BTC UTXO information on the BTC Testnet which should be same as the 1-prepare-cluster.ts
// rgbppLockArgs: outIndexU32 + btcTxId
createCluster({
ownerRgbppLockArgs: buildRgbppLockArgs(3, 'aee4e8e3aa95e9e9ab1f0520714031d92d3263262099dcc7f7d64e62fa2fcb44'),
Expand Down
6 changes: 4 additions & 2 deletions examples/rgbpp/spore/launch/3-create-spores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface SporeCreateParams {
}[];
}

// Warning: Before runing this file for the first time, please run 2-prepare-cluster.ts
const createSpores = async ({ clusterRgbppLockArgs, receivers }: SporeCreateParams) => {
const ckbVirtualTxResult = await genCreateSporeCkbVirtualTx({
collector,
Expand All @@ -42,7 +43,7 @@ const createSpores = async ({ clusterRgbppLockArgs, receivers }: SporeCreatePara
// Save ckbVirtualTxResult
saveCkbVirtualTxResult(ckbVirtualTxResult, '3-create-spores');

const { commitment, ckbRawTx, sumInputsCapacity, clusterCell } = ckbVirtualTxResult;
const { commitment, ckbRawTx, sumInputsCapacity, clusterCell, needPaymasterCell } = ckbVirtualTxResult;

// Send BTC tx
// The first btc address is the owner of the cluster cell and the rest btc addresses are spore receivers
Expand All @@ -51,6 +52,7 @@ const createSpores = async ({ clusterRgbppLockArgs, receivers }: SporeCreatePara
ckbVirtualTx: ckbRawTx,
commitment,
tos: btcTos,
needPaymaster: needPaymasterCell,
ckbCollector: collector,
from: btcAddress!,
source: btcDataSource,
Expand Down Expand Up @@ -114,7 +116,7 @@ const createSpores = async ({ clusterRgbppLockArgs, receivers }: SporeCreatePara
}, 30 * 1000);
};

// Use your real BTC UTXO information on the BTC Testnet
// Please use your real BTC UTXO information on the BTC Testnet
// rgbppLockArgs: outIndexU32 + btcTxId
createSpores({
// The cluster cell will be spent and the new cluster cell will be created in each spore creation tx,
Expand Down
6 changes: 4 additions & 2 deletions examples/rgbpp/spore/local/4-transfer-spore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const transferSpore = async ({ sporeRgbppLockArgs, toBtcAddress, sporeTypeArgs }
// Save ckbVirtualTxResult
saveCkbVirtualTxResult(ckbVirtualTxResult, '4-transfer-spore-local');

const { commitment, ckbRawTx, sporeCell } = ckbVirtualTxResult;
const { commitment, ckbRawTx, sporeCell, needPaymasterCell } = ckbVirtualTxResult;

// console.log(JSON.stringify(ckbRawTx))

Expand All @@ -48,6 +48,7 @@ const transferSpore = async ({ sporeRgbppLockArgs, toBtcAddress, sporeTypeArgs }
ckbVirtualTx: ckbRawTx,
commitment,
tos: [toBtcAddress],
needPaymaster: needPaymasterCell,
ckbCollector: collector,
from: btcAddress!,
source: btcDataSource,
Expand Down Expand Up @@ -91,11 +92,12 @@ const transferSpore = async ({ sporeRgbppLockArgs, toBtcAddress, sporeTypeArgs }
}, 30 * 1000);
};

// Use your real BTC UTXO information on the BTC Testnet
// Please use your real BTC UTXO information on the BTC Testnet
// rgbppLockArgs: outIndexU32 + btcTxId
transferSpore({
// The spore rgbpp lock args is from 3-create-spore.ts
sporeRgbppLockArgs: buildRgbppLockArgs(1, 'f203c8c13eacdbd126f85d286a963c85f233f8145363b1d997c4d552afb990e1'),
toBtcAddress: 'tb1qhp9fh9qsfeyh0yhewgu27ndqhs5qlrqwau28m7',
// Please use your own RGB++ spore asset's sporeTypeArgs
sporeTypeArgs: '0x42898ea77062256f46e8f1b861d526ae47810ecc51ab50477945d5fa90452706',
});
6 changes: 4 additions & 2 deletions examples/rgbpp/spore/local/5-leap-spore-to-ckb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const leapSpore = async ({ sporeRgbppLockArgs, toCkbAddress, sporeTypeArgs }: Sp
// Save ckbVirtualTxResult
saveCkbVirtualTxResult(ckbVirtualTxResult, '5-leap-spore-to-ckb-local');

const { commitment, ckbRawTx, sporeCell } = ckbVirtualTxResult;
const { commitment, ckbRawTx, sporeCell, needPaymasterCell } = ckbVirtualTxResult;

// console.log(JSON.stringify(ckbRawTx))

Expand All @@ -48,6 +48,7 @@ const leapSpore = async ({ sporeRgbppLockArgs, toCkbAddress, sporeTypeArgs }: Sp
ckbVirtualTx: ckbRawTx,
commitment,
tos: [btcAddress!],
needPaymaster: needPaymasterCell,
ckbCollector: collector,
from: btcAddress!,
source: btcDataSource,
Expand Down Expand Up @@ -91,11 +92,12 @@ const leapSpore = async ({ sporeRgbppLockArgs, toCkbAddress, sporeTypeArgs }: Sp
}, 30 * 1000);
};

// Use your real BTC UTXO information on the BTC Testnet
// Please use your real BTC UTXO information on the BTC Testnet
// rgbppLockArgs: outIndexU32 + btcTxId
leapSpore({
// The spore rgbpp lock args is from 3-create-spore.ts
sporeRgbppLockArgs: buildRgbppLockArgs(3, 'd8a31796fbd42c546f6b22014b9b82b16586ce1df81b0e7ca9a552cdc492a0af'),
toCkbAddress: 'ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq0e4xk4rmg5jdkn8aams492a7jlg73ue0gc0ddfj',
// Please use your own RGB++ spore asset's sporeTypeArgs
sporeTypeArgs: '0x42898ea77062256f46e8f1b861d526ae47810ecc51ab50477945d5fa90452706',
});
2 changes: 1 addition & 1 deletion examples/rgbpp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"skipLibCheck": true,
"strict": true
},
"include": ["queue/**/*.ts", "xudt/**/*.ts"],
"include": ["spore", "xudt", "shared"],
"exclude": ["node_modules"]
}
Loading