Skip to content

Commit

Permalink
feat(lumos): mint
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryl-L committed Jan 17, 2024
1 parent 9abb302 commit 00ffa90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions offchain-modules/packages/x/src/ckb/tx-helper/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ export class CkbTxGenerator extends CkbTxHelper {
chain: asset.chainType,
asset: fromHexString(toHexString(stringToUint8Array(asset.getAddress()))).buffer,
amount: fromHexString(utils.toBigUInt128LE(amount)).buffer,
bridge_lock_codeHash: fromHexString(ForceBridgeCore.config.ckb.deps.bridgeLock.script.codeHash).buffer,
bridge_lock_hashType: hashType,
bridge_lock_code_hash: fromHexString(ForceBridgeCore.config.ckb.deps.bridgeLock.script.codeHash).buffer,
bridge_lock_hash_type: hashType,
owner_cell_type_hash: fromHexString(ownerCellTypeHash).buffer,
};

Expand Down
3 changes: 2 additions & 1 deletion offchain-modules/packages/x/src/handlers/ckb.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { utils } from '@ckb-lumos/base';
import { WitnessArgs } from '@ckb-lumos/base/lib/blockchain';
import { IndexerTransaction, ScriptType, SearchKey } from '@ckb-lumos/ckb-indexer/src/type';
import { bytify } from '@ckb-lumos/codec/lib/bytes';
import { serializeMultisigScript } from '@ckb-lumos/common-scripts/lib/secp256k1_blake160_multisig';
import { key } from '@ckb-lumos/hd';
import { encodeToAddress, sealTransaction, TransactionSkeletonType } from '@ckb-lumos/helpers';
Expand Down Expand Up @@ -422,7 +423,7 @@ export class CkbHandler {
if (0 === mintedSudtCellIndexes.length) return null;

const witnessArgs = WitnessArgs.unpack(tx.witnesses[0]);
const inputTypeWitness = witnessArgs.inputType;
const inputTypeWitness = bytify(witnessArgs.inputType ?? '').buffer;
const mintWitness = new MintWitness(inputTypeWitness, { validate: true });
const lockTxHashes = mintWitness.getLockTxHashes();
const parsedResult: MintedRecord[] = [];
Expand Down

0 comments on commit 00ffa90

Please sign in to comment.