@ckb-ccc/core 1.17.0 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/address.advanced-Dw4qPDGb.mjs +2 -0
- package/dist/address.advanced-Dw4qPDGb.mjs.map +1 -0
- package/dist/advanced.d.mts +1 -1
- package/dist/advanced.mjs +1 -1
- package/{dist.commonjs/advancedBarrel-DrAHz5UG.d.ts → dist/advancedBarrel-BbbHx4z4.d.mts} +39 -4
- package/dist/advancedBarrel-BbbHx4z4.d.mts.map +1 -0
- package/dist/advancedBarrel.d.mts +1 -1
- package/dist/advancedBarrel.mjs +1 -1
- package/dist/barrel-BsC1djHG.mjs +7 -0
- package/dist/barrel-BsC1djHG.mjs.map +1 -0
- package/dist/barrel.d.mts +2 -2
- package/dist/barrel.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist.commonjs/address.advanced-DG1gpW7t.js +2 -0
- package/dist.commonjs/address.advanced-DG1gpW7t.js.map +1 -0
- package/dist.commonjs/advanced.d.ts +1 -1
- package/dist.commonjs/advanced.js +1 -1
- package/{dist/advancedBarrel-Bk19lQjR.d.mts → dist.commonjs/advancedBarrel-CJAh6sm8.d.ts} +40 -3
- package/dist.commonjs/advancedBarrel-CJAh6sm8.d.ts.map +1 -0
- package/dist.commonjs/advancedBarrel.d.ts +1 -1
- package/dist.commonjs/advancedBarrel.js +1 -1
- package/dist.commonjs/barrel-C_zSgXKn.js +21 -0
- package/dist.commonjs/barrel-C_zSgXKn.js.map +1 -0
- package/dist.commonjs/barrel.d.ts +2 -2
- package/dist.commonjs/barrel.js +1 -1
- package/dist.commonjs/index.d.ts +2 -2
- package/dist.commonjs/index.js +1 -1
- package/package.json +2 -2
- package/src/ckb/transaction.ts +19 -11
- package/src/client/jsonRpc/client.ts +1 -1
- package/src/jsonRpc/requestor.ts +9 -4
- package/src/jsonRpc/transports/fallback.ts +14 -11
- package/src/signer/ckb/index.ts +1 -0
- package/src/signer/ckb/signerCkbAlwaysSuccess.ts +71 -0
- package/dist/address.advanced-DpcI420e.mjs +0 -2
- package/dist/address.advanced-DpcI420e.mjs.map +0 -1
- package/dist/advancedBarrel-Bk19lQjR.d.mts.map +0 -1
- package/dist/barrel-BwuHQ4NS.mjs +0 -7
- package/dist/barrel-BwuHQ4NS.mjs.map +0 -1
- package/dist.commonjs/address.advanced--1eOp1GP.js +0 -2
- package/dist.commonjs/address.advanced--1eOp1GP.js.map +0 -1
- package/dist.commonjs/advancedBarrel-DrAHz5UG.d.ts.map +0 -1
- package/dist.commonjs/barrel-BIo8E9Ci.js +0 -21
- package/dist.commonjs/barrel-BIo8E9Ci.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as CellDep, $i as
|
|
2
|
-
export { Address, AddressLike, Bytes, BytesLike, Cell, CellAny, CellAnyLike, CellDep, CellDepInfo, CellDepInfoLike, CellDepLike, CellDepVec, CellInput, CellInputLike, CellInputVec, CellLike, CellOutput, CellOutputLike, CellOutputVec, Client, ClientBlock, ClientBlockHeader, ClientBlockHeaderLike, ClientBlockLike, ClientBlockUncle, ClientBlockUncleLike, ClientCache, ClientCacheMemory, ClientFindCellsResponse, ClientFindTransactionsGroupedResponse, ClientFindTransactionsResponse, ClientIndexerSearchKey, ClientIndexerSearchKeyFilter, ClientIndexerSearchKeyFilterLike, ClientIndexerSearchKeyLike, ClientIndexerSearchKeyTransaction, ClientIndexerSearchKeyTransactionLike, ClientJsonRpc, ClientJsonRpcConfig, ClientPublicMainnet, ClientPublicTestnet, ClientTransactionResponse, ClientTransactionResponseLike, Codec, CodecBool, CodecByte, CodecByte16, CodecByte32, CodecByte4, CodecByte8, CodecBytes, CodecLike, CodecRaw, CodecUint128, CodecUint128BE, CodecUint128LE, CodecUint16, CodecUint16BE, CodecUint16LE, CodecUint256, CodecUint256BE, CodecUint256LE, CodecUint32, CodecUint32BE, CodecUint32LE, CodecUint512, CodecUint512BE, CodecUint512LE, CodecUint64, CodecUint64BE, CodecUint64LE, CodecUint8, Constructor, DecodedType, DepType, DepTypeCodec, DepTypeLike, EncodableType, Entity, Epoch, EpochLike, ErrorClientBase, ErrorClientBaseLike, ErrorClientDuplicatedTransaction, ErrorClientMaxFeeRateExceeded, ErrorClientRBFRejected, ErrorClientResolveUnknown, ErrorClientVerification, ErrorClientWaitTransactionTimeout, ErrorTransactionInsufficientCapacity, ErrorTransactionInsufficientCoin, FixedPoint, FixedPointLike, HASH_CKB_LENGTH, HASH_CKB_SHORT_LENGTH, HashType, HashTypeCodec, HashTypeLike, Hasher, HasherCkb, HasherKeecak256, Hex, HexLike, InputToSign, InputToSignLike, KnownScript, LumosTransactionSkeletonType, MultisigCkbWitness, MultisigCkbWitnessLike, NetworkPreference, NostrEvent, Num, NumLike, One, OutPoint, OutPointLike, OutputsValidator, RawTransaction, RequestorJsonRpc, RequestorJsonRpcConfig, SECP256K1_SIGNATURE_LENGTH, Script, ScriptInfo, ScriptInfoLike, ScriptLike, ScriptOpt, ScriptVec, SignPsbtOptions, SignPsbtOptionsLike, Signature, Signer, SignerAlwaysError, SignerBtc, SignerBtcPublicKeyReadonly, SignerCkbPrivateKey, SignerCkbPublicKey, SignerCkbScriptReadonly, SignerDoge, SignerDogeAddressReadonly, SignerDogePrivateKey, SignerDummy, SignerEvm, SignerEvmAddressReadonly, SignerInfo, SignerMultisig, SignerMultisigCkbPrivateKey, SignerMultisigCkbReadonly, SignerMultisigNotEnoughSignaturesError, SignerNostr, SignerNostrPrivateKey, SignerNostrPublicKeyReadonly, SignerOpenLink, SignerSignType, SignerType, Since, SinceLike, Transaction, TransactionLike, TransactionStatus, Wallet, WitnessArgs, WitnessArgsLike, Zero, apply, btcEcdsaPublicKeyHash, btcP2pkhAddressFromPublicKey, btcPublicKeyFromP2pkhAddress, btcVarLengthBytesFrom, buildNostrEventFromMessage, bytesConcat, bytesConcatTo, bytesEq, bytesFrom, bytesLen, bytesLenUnsafe, bytesTo, calcDaoClaimEpoch, calcDaoProfit, codec, codecPadding, codecUint, codecUintNumber, depTypeFrom, depTypeFromBytes, depTypeToBytes, epochFrom, epochFromHex, epochToHex, fixedPointFrom, fixedPointToString, gcd, hashCkb, hashCkbShort, hashTypeFrom, hashTypeFromBytes, hashTypeId, hashTypeToBytes, hexFrom, isDaoOutputLimitExceeded, isWebview, keystoreDecrypt, keystoreEncrypt, messageHashBtcEcdsa, messageHashCkbSecp256k1, messageHashDogeEcdsa, barrel_d_exports as mol, nostrEventHash, numBeFromBytes, numBeToBytes, numFrom, numFromBytes, numLeFromBytes, numLeToBytes, numMax, numMin, numToBytes, numToHex, recoverMessageSecp256k1, reduceAsync, signMessageSecp256k1, sleep, stringify, udtBalanceFrom, verifyMessageBtcEcdsa, verifyMessageCkbSecp256k1, verifyMessageDogeEcdsa, verifyMessageEvmPersonal, verifyMessageJoyId, verifyMessageNostrEvent, verifyMessageSecp256k1 };
|
|
1
|
+
import { $ as CellDep, $i as Address, $n as SignerCkbPublicKey, $r as CodecByte, $t as ClientFindCellsResponse, Ai as Constructor, An as verifyMessageNostrEvent, Ar as keystoreEncrypt, At as HashTypeCodec, B as ClientPublicTestnet, Bi as numBeToBytes, Bn as SignerDummy, Br as HASH_CKB_LENGTH, Bt as Epoch, Ci as CodecUint64LE, Cr as Wallet, Ct as depTypeFrom, Di as codecUintNumber, Dr as SignPsbtOptionsLike, Dt as udtBalanceFrom, Ei as codecUint, Er as SignPsbtOptions, Et as isDaoOutputLimitExceeded, Fi as sleep, Fn as verifyMessageEvmPersonal, Ft as ScriptVec, G as ClientCacheMemory, Gi as numMax, Gn as SignerDoge, Gr as Hasher, Gt as CellDepInfo, H as ClientJsonRpc, Hi as numFromBytes, Hn as verifyMessageDogeEcdsa, Hr as HasherCkb, Ht as epochFrom, Ii as stringify, In as SignerEvmAddressReadonly, It as hashTypeFrom, J as ErrorTransactionInsufficientCoin, Ji as numToHex, Jn as MultisigCkbWitness, Jr as One, Jt as ClientBlockHeader, K as ClientCache, Ki as numMin, Kn as verifyMessageJoyId, Kr as FixedPoint, Kt as CellDepInfoLike, Li as Num, Ln as SignerEvm, Lt as hashTypeFromBytes, Mi as gcd, Mn as SignerNostrPublicKeyReadonly, Mr as RequestorJsonRpcConfig, Mt as Script, Ni as isWebview, Nn as NostrEvent, Nt as ScriptLike, Oi as Entity, On as buildNostrEventFromMessage, Or as barrel_d_exports, Ot as LumosTransactionSkeletonType, Pi as reduceAsync, Pn as SignerNostr, Pt as ScriptOpt, Q as CellAnyLike, Qi as EncodableType, Qn as SignerCkbPrivateKey, Qr as CodecBool, Qt as ClientBlockUncleLike, Ri as NumLike, Rn as SignerOpenLink, Rt as hashTypeToBytes, Si as CodecUint64BE, Sr as SignerType, St as calcDaoProfit, Ti as codecPadding, Tr as InputToSignLike, Tt as depTypeToBytes, U as ClientJsonRpcConfig, Ui as numLeFromBytes, Un as SignerDogePrivateKey, Ur as hashCkb, Ut as epochFromHex, V as ClientPublicMainnet, Vi as numFrom, Vn as messageHashDogeEcdsa, Vr as HASH_CKB_SHORT_LENGTH, Vt as EpochLike, W as Client, Wi as numLeToBytes, Wn as SignerDogeAddressReadonly, Wr as hashCkbShort, Wt as epochToHex, X as Cell, Xi as CodecLike, Xn as SignerMultisigCkbReadonly, Xr as fixedPointFrom, Xt as ClientBlockLike, Y as hashTypeId, Yi as Codec, Yn as MultisigCkbWitnessLike, Yr as Zero, Yt as ClientBlockHeaderLike, Z as CellAny, Zi as DecodedType, Zn as SignerCkbScriptReadonly, Zr as fixedPointToString, Zt as ClientBlockUncle, _i as CodecUint32LE, _n as ErrorClientWaitTransactionTimeout, _r as Signer, _t as Transaction, aa as hexFrom, ai as CodecRaw, an as ClientIndexerSearchKeyLike, ar as verifyMessageCkbSecp256k1, at as CellLike, bi as CodecUint512LE, bn as ScriptInfoLike, br as SignerMultisigNotEnoughSignaturesError, bt as WitnessArgsLike, ca as bytesConcat, ci as CodecUint128LE, cn as ClientTransactionResponse, cr as btcP2pkhAddressFromPublicKey, ct as CellOutputVec, da as bytesFrom, di as CodecUint16LE, dn as ErrorClientBaseLike, dr as messageHashBtcEcdsa, dt as DepTypeLike, ea as AddressLike, ei as CodecByte16, en as ClientFindTransactionsGroupedResponse, er as SignerCkbAlwaysSuccess, et as CellDepLike, fa as bytesTo, fi as CodecUint256, fn as ErrorClientDuplicatedTransaction, fr as verifyMessageBtcEcdsa, ft as OutPoint, gi as CodecUint32BE, gn as ErrorClientVerification, gr as Signature, gt as SinceLike, hi as CodecUint32, hn as ErrorClientResolveUnknown, hr as NetworkPreference, ht as Since, ia as bytesLenUnsafe, ii as CodecBytes, in as ClientIndexerSearchKeyFilterLike, ir as signMessageSecp256k1, it as CellInputVec, ji as apply, jn as SignerNostrPrivateKey, jr as RequestorJsonRpc, jt as HashTypeLike, ki as codec, kn as nostrEventHash, kr as keystoreDecrypt, kt as HashType, la as bytesConcatTo, li as CodecUint16, ln as ClientTransactionResponseLike, lr as btcPublicKeyFromP2pkhAddress, lt as DepType, mi as CodecUint256LE, mn as ErrorClientRBFRejected, mr as SignerBtc, mt as RawTransaction, na as HexLike, ni as CodecByte4, nn as ClientIndexerSearchKey, nr as messageHashCkbSecp256k1, nt as CellInput, oa as Bytes, oi as CodecUint128, on as ClientIndexerSearchKeyTransaction, or as verifyMessageSecp256k1, ot as CellOutput, pi as CodecUint256BE, pn as ErrorClientMaxFeeRateExceeded, pr as SignerBtcPublicKeyReadonly, pt as OutPointLike, q as ErrorTransactionInsufficientCapacity, qi as numToBytes, qn as SignerMultisigCkbPrivateKey, qr as FixedPointLike, qt as ClientBlock, ra as bytesLen, ri as CodecByte8, rn as ClientIndexerSearchKeyFilter, rr as recoverMessageSecp256k1, rt as CellInputLike, sa as BytesLike, si as CodecUint128BE, sn as ClientIndexerSearchKeyTransactionLike, sr as btcEcdsaPublicKeyHash, st as CellOutputLike, ta as Hex, ti as CodecByte32, tn as ClientFindTransactionsResponse, tr as SECP256K1_SIGNATURE_LENGTH, tt as CellDepVec, ua as bytesEq, ui as CodecUint16BE, un as ErrorClientBase, ur as btcVarLengthBytesFrom, ut as DepTypeCodec, vi as CodecUint512, vn as OutputsValidator, vr as SignerInfo, vt as TransactionLike, wi as CodecUint8, wr as InputToSign, wt as depTypeFromBytes, xi as CodecUint64, xn as TransactionStatus, xr as SignerSignType, xt as calcDaoClaimEpoch, yi as CodecUint512BE, yn as ScriptInfo, yr as SignerMultisig, yt as WitnessArgs, zi as numBeFromBytes, zn as SignerAlwaysError, zr as HasherKeecak256, zt as KnownScript } from "./advancedBarrel-CJAh6sm8.js";
|
|
2
|
+
export { Address, AddressLike, Bytes, BytesLike, Cell, CellAny, CellAnyLike, CellDep, CellDepInfo, CellDepInfoLike, CellDepLike, CellDepVec, CellInput, CellInputLike, CellInputVec, CellLike, CellOutput, CellOutputLike, CellOutputVec, Client, ClientBlock, ClientBlockHeader, ClientBlockHeaderLike, ClientBlockLike, ClientBlockUncle, ClientBlockUncleLike, ClientCache, ClientCacheMemory, ClientFindCellsResponse, ClientFindTransactionsGroupedResponse, ClientFindTransactionsResponse, ClientIndexerSearchKey, ClientIndexerSearchKeyFilter, ClientIndexerSearchKeyFilterLike, ClientIndexerSearchKeyLike, ClientIndexerSearchKeyTransaction, ClientIndexerSearchKeyTransactionLike, ClientJsonRpc, ClientJsonRpcConfig, ClientPublicMainnet, ClientPublicTestnet, ClientTransactionResponse, ClientTransactionResponseLike, Codec, CodecBool, CodecByte, CodecByte16, CodecByte32, CodecByte4, CodecByte8, CodecBytes, CodecLike, CodecRaw, CodecUint128, CodecUint128BE, CodecUint128LE, CodecUint16, CodecUint16BE, CodecUint16LE, CodecUint256, CodecUint256BE, CodecUint256LE, CodecUint32, CodecUint32BE, CodecUint32LE, CodecUint512, CodecUint512BE, CodecUint512LE, CodecUint64, CodecUint64BE, CodecUint64LE, CodecUint8, Constructor, DecodedType, DepType, DepTypeCodec, DepTypeLike, EncodableType, Entity, Epoch, EpochLike, ErrorClientBase, ErrorClientBaseLike, ErrorClientDuplicatedTransaction, ErrorClientMaxFeeRateExceeded, ErrorClientRBFRejected, ErrorClientResolveUnknown, ErrorClientVerification, ErrorClientWaitTransactionTimeout, ErrorTransactionInsufficientCapacity, ErrorTransactionInsufficientCoin, FixedPoint, FixedPointLike, HASH_CKB_LENGTH, HASH_CKB_SHORT_LENGTH, HashType, HashTypeCodec, HashTypeLike, Hasher, HasherCkb, HasherKeecak256, Hex, HexLike, InputToSign, InputToSignLike, KnownScript, LumosTransactionSkeletonType, MultisigCkbWitness, MultisigCkbWitnessLike, NetworkPreference, NostrEvent, Num, NumLike, One, OutPoint, OutPointLike, OutputsValidator, RawTransaction, RequestorJsonRpc, RequestorJsonRpcConfig, SECP256K1_SIGNATURE_LENGTH, Script, ScriptInfo, ScriptInfoLike, ScriptLike, ScriptOpt, ScriptVec, SignPsbtOptions, SignPsbtOptionsLike, Signature, Signer, SignerAlwaysError, SignerBtc, SignerBtcPublicKeyReadonly, SignerCkbAlwaysSuccess, SignerCkbPrivateKey, SignerCkbPublicKey, SignerCkbScriptReadonly, SignerDoge, SignerDogeAddressReadonly, SignerDogePrivateKey, SignerDummy, SignerEvm, SignerEvmAddressReadonly, SignerInfo, SignerMultisig, SignerMultisigCkbPrivateKey, SignerMultisigCkbReadonly, SignerMultisigNotEnoughSignaturesError, SignerNostr, SignerNostrPrivateKey, SignerNostrPublicKeyReadonly, SignerOpenLink, SignerSignType, SignerType, Since, SinceLike, Transaction, TransactionLike, TransactionStatus, Wallet, WitnessArgs, WitnessArgsLike, Zero, apply, btcEcdsaPublicKeyHash, btcP2pkhAddressFromPublicKey, btcPublicKeyFromP2pkhAddress, btcVarLengthBytesFrom, buildNostrEventFromMessage, bytesConcat, bytesConcatTo, bytesEq, bytesFrom, bytesLen, bytesLenUnsafe, bytesTo, calcDaoClaimEpoch, calcDaoProfit, codec, codecPadding, codecUint, codecUintNumber, depTypeFrom, depTypeFromBytes, depTypeToBytes, epochFrom, epochFromHex, epochToHex, fixedPointFrom, fixedPointToString, gcd, hashCkb, hashCkbShort, hashTypeFrom, hashTypeFromBytes, hashTypeId, hashTypeToBytes, hexFrom, isDaoOutputLimitExceeded, isWebview, keystoreDecrypt, keystoreEncrypt, messageHashBtcEcdsa, messageHashCkbSecp256k1, messageHashDogeEcdsa, barrel_d_exports as mol, nostrEventHash, numBeFromBytes, numBeToBytes, numFrom, numFromBytes, numLeFromBytes, numLeToBytes, numMax, numMin, numToBytes, numToHex, recoverMessageSecp256k1, reduceAsync, signMessageSecp256k1, sleep, stringify, udtBalanceFrom, verifyMessageBtcEcdsa, verifyMessageCkbSecp256k1, verifyMessageDogeEcdsa, verifyMessageEvmPersonal, verifyMessageJoyId, verifyMessageNostrEvent, verifyMessageSecp256k1 };
|
package/dist.commonjs/barrel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./address.advanced
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./address.advanced-DG1gpW7t.js"),t=require("./barrel-C_zSgXKn.js");exports.Address=t.Q,exports.Bytes=e.qr,exports.Cell=e.a,exports.CellAny=e.o,Object.defineProperty(exports,"CellDep",{enumerable:!0,get:function(){return e.s}}),exports.CellDepInfo=e.nt,exports.CellDepVec=e.c,Object.defineProperty(exports,"CellInput",{enumerable:!0,get:function(){return e.l}}),exports.CellInputVec=e.u,Object.defineProperty(exports,"CellOutput",{enumerable:!0,get:function(){return e.d}}),exports.CellOutputVec=e.f,exports.Client=t.it,exports.ClientBlock=e.rt,exports.ClientBlockHeader=e.it,exports.ClientBlockUncle=e.at,exports.ClientCache=t.ot,exports.ClientCacheMemory=t.at,exports.ClientIndexerSearchKey=e.ot,exports.ClientIndexerSearchKeyFilter=e.st,exports.ClientIndexerSearchKeyTransaction=e.ct,exports.ClientJsonRpc=t.nt,exports.ClientPublicMainnet=t.tt,exports.ClientPublicTestnet=t.et,exports.ClientTransactionResponse=e.lt,exports.Codec=e.Kr,exports.CodecBool=e.yn,exports.CodecByte=e.bn,exports.CodecByte16=e.xn,exports.CodecByte32=e.Sn,exports.CodecByte4=e.Cn,exports.CodecByte8=e.wn,exports.CodecBytes=e.Tn,exports.CodecRaw=e.En,exports.CodecUint128=e.Dn,exports.CodecUint128BE=e.On,exports.CodecUint128LE=e.kn,exports.CodecUint16=e.An,exports.CodecUint16BE=e.jn,exports.CodecUint16LE=e.Mn,exports.CodecUint256=e.Nn,exports.CodecUint256BE=e.Pn,exports.CodecUint256LE=e.Fn,exports.CodecUint32=e.In,exports.CodecUint32BE=e.Ln,exports.CodecUint32LE=e.Rn,exports.CodecUint512=e.zn,exports.CodecUint512BE=e.Bn,exports.CodecUint512LE=e.Vn,exports.CodecUint64=e.Hn,exports.CodecUint64BE=e.Un,exports.CodecUint64LE=e.Wn,exports.CodecUint8=e.Gn,exports.DepTypeCodec=e.p,exports.Entity=e.lr,Object.defineProperty(exports,"Epoch",{enumerable:!0,get:function(){return e.xt}}),exports.ErrorClientBase=e.ut,exports.ErrorClientDuplicatedTransaction=e.dt,exports.ErrorClientMaxFeeRateExceeded=e.ft,exports.ErrorClientRBFRejected=e.pt,exports.ErrorClientResolveUnknown=e.mt,exports.ErrorClientVerification=e.ht,exports.ErrorClientWaitTransactionTimeout=e.gt,exports.ErrorTransactionInsufficientCapacity=e.E,exports.ErrorTransactionInsufficientCoin=e.D,exports.HASH_CKB_LENGTH=e.dr,exports.HASH_CKB_SHORT_LENGTH=e.fr,exports.HashTypeCodec=e.j,exports.HasherCkb=e.pr,exports.HasherKeecak256=t.ct,exports.InputToSign=t.J,exports.KnownScript=e.J,Object.defineProperty(exports,"MultisigCkbWitness",{enumerable:!0,get:function(){return t.m}}),exports.One=e.ar,Object.defineProperty(exports,"OutPoint",{enumerable:!0,get:function(){return e.m}}),exports.RawTransaction=e.h,exports.RequestorJsonRpc=t.rt,exports.SECP256K1_SIGNATURE_LENGTH=t.I,Object.defineProperty(exports,"Script",{enumerable:!0,get:function(){return e.M}}),exports.ScriptInfo=e._t,exports.ScriptOpt=e.N,exports.ScriptVec=e.P,exports.SignPsbtOptions=t.Y,exports.Signature=t.S,exports.Signer=t.C,exports.SignerAlwaysError=t.c,exports.SignerBtc=t.x,exports.SignerBtcPublicKeyReadonly=t.b,exports.SignerCkbAlwaysSuccess=t.y,exports.SignerCkbPrivateKey=t._,exports.SignerCkbPublicKey=t.v,exports.SignerCkbScriptReadonly=t.g,exports.SignerDoge=t.f,exports.SignerDogeAddressReadonly=t.d,exports.SignerDogePrivateKey=t.u,exports.SignerDummy=t.l,exports.SignerEvm=t.o,exports.SignerEvmAddressReadonly=t.a,exports.SignerInfo=t.w,exports.SignerMultisig=t.T,exports.SignerMultisigCkbPrivateKey=t.p,exports.SignerMultisigCkbReadonly=t.h,exports.SignerMultisigNotEnoughSignaturesError=t.E,exports.SignerNostr=t.i,exports.SignerNostrPrivateKey=t.n,exports.SignerNostrPublicKeyReadonly=t.r,exports.SignerOpenLink=t.s,exports.SignerSignType=t.D,exports.SignerType=t.O,Object.defineProperty(exports,"Since",{enumerable:!0,get:function(){return e.g}}),Object.defineProperty(exports,"Transaction",{enumerable:!0,get:function(){return e._}}),Object.defineProperty(exports,"WitnessArgs",{enumerable:!0,get:function(){return e.v}}),exports.Zero=e.or,exports.apply=e.Et,exports.btcEcdsaPublicKeyHash=t.H,exports.btcP2pkhAddressFromPublicKey=t.U,exports.btcPublicKeyFromP2pkhAddress=t.W,exports.btcVarLengthBytesFrom=t.G,exports.buildNostrEventFromMessage=t.k,exports.bytesConcat=e.Jr,exports.bytesConcatTo=e.Yr,exports.bytesEq=e.Xr,exports.bytesFrom=e.Zr,exports.bytesLen=e._r,exports.bytesLenUnsafe=e.vr,exports.bytesTo=e.Qr,exports.calcDaoClaimEpoch=e.y,exports.calcDaoProfit=e.b,exports.codec=e.ur,exports.codecPadding=e.Kn,exports.codecUint=e.qn,exports.codecUintNumber=e.Jn,exports.depTypeFrom=e.x,exports.depTypeFromBytes=e.S,exports.depTypeToBytes=e.C,exports.epochFrom=e.St,exports.epochFromHex=e.Ct,exports.epochToHex=e.wt,exports.fixedPointFrom=e.sr,exports.fixedPointToString=e.cr,exports.gcd=e.Dt,exports.hashCkb=e.mr,exports.hashCkbShort=e.hr,exports.hashTypeFrom=e.F,exports.hashTypeFromBytes=e.I,exports.hashTypeId=t.$,exports.hashTypeToBytes=e.L,exports.hexFrom=e.yr,exports.isDaoOutputLimitExceeded=e.w,exports.isWebview=e.Ot,exports.keystoreDecrypt=t.X,exports.keystoreEncrypt=t.Z,exports.messageHashBtcEcdsa=t.K,exports.messageHashCkbSecp256k1=t.L,exports.messageHashDogeEcdsa=t.N,Object.defineProperty(exports,"mol",{enumerable:!0,get:function(){return t.st}}),exports.nostrEventHash=t.A,exports.numBeFromBytes=e.Yn,exports.numBeToBytes=e.Xn,exports.numFrom=e.Zn,exports.numFromBytes=e.Qn,exports.numLeFromBytes=e.$n,exports.numLeToBytes=e.er,exports.numMax=e.tr,exports.numMin=e.nr,exports.numToBytes=e.rr,exports.numToHex=e.ir,exports.recoverMessageSecp256k1=t.R,exports.reduceAsync=e.kt,exports.signMessageSecp256k1=t.z,exports.sleep=e.At,exports.stringify=e.jt,exports.udtBalanceFrom=e.T,exports.verifyMessageBtcEcdsa=t.q,exports.verifyMessageCkbSecp256k1=t.B,exports.verifyMessageDogeEcdsa=t.P,exports.verifyMessageEvmPersonal=t.M,exports.verifyMessageJoyId=t.F,exports.verifyMessageNostrEvent=t.j,exports.verifyMessageSecp256k1=t.V;
|
package/dist.commonjs/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as CellDep, $i as
|
|
2
|
-
export { Address, AddressLike, Bytes, BytesLike, Cell, CellAny, CellAnyLike, CellDep, CellDepInfo, CellDepInfoLike, CellDepLike, CellDepVec, CellInput, CellInputLike, CellInputVec, CellLike, CellOutput, CellOutputLike, CellOutputVec, Client, ClientBlock, ClientBlockHeader, ClientBlockHeaderLike, ClientBlockLike, ClientBlockUncle, ClientBlockUncleLike, ClientCache, ClientCacheMemory, ClientFindCellsResponse, ClientFindTransactionsGroupedResponse, ClientFindTransactionsResponse, ClientIndexerSearchKey, ClientIndexerSearchKeyFilter, ClientIndexerSearchKeyFilterLike, ClientIndexerSearchKeyLike, ClientIndexerSearchKeyTransaction, ClientIndexerSearchKeyTransactionLike, ClientJsonRpc, ClientJsonRpcConfig, ClientPublicMainnet, ClientPublicTestnet, ClientTransactionResponse, ClientTransactionResponseLike, Codec, CodecBool, CodecByte, CodecByte16, CodecByte32, CodecByte4, CodecByte8, CodecBytes, CodecLike, CodecRaw, CodecUint128, CodecUint128BE, CodecUint128LE, CodecUint16, CodecUint16BE, CodecUint16LE, CodecUint256, CodecUint256BE, CodecUint256LE, CodecUint32, CodecUint32BE, CodecUint32LE, CodecUint512, CodecUint512BE, CodecUint512LE, CodecUint64, CodecUint64BE, CodecUint64LE, CodecUint8, Constructor, DecodedType, DepType, DepTypeCodec, DepTypeLike, EncodableType, Entity, Epoch, EpochLike, ErrorClientBase, ErrorClientBaseLike, ErrorClientDuplicatedTransaction, ErrorClientMaxFeeRateExceeded, ErrorClientRBFRejected, ErrorClientResolveUnknown, ErrorClientVerification, ErrorClientWaitTransactionTimeout, ErrorTransactionInsufficientCapacity, ErrorTransactionInsufficientCoin, FixedPoint, FixedPointLike, HASH_CKB_LENGTH, HASH_CKB_SHORT_LENGTH, HashType, HashTypeCodec, HashTypeLike, Hasher, HasherCkb, HasherKeecak256, Hex, HexLike, InputToSign, InputToSignLike, KnownScript, LumosTransactionSkeletonType, MultisigCkbWitness, MultisigCkbWitnessLike, NetworkPreference, NostrEvent, Num, NumLike, One, OutPoint, OutPointLike, OutputsValidator, RawTransaction, RequestorJsonRpc, RequestorJsonRpcConfig, SECP256K1_SIGNATURE_LENGTH, Script, ScriptInfo, ScriptInfoLike, ScriptLike, ScriptOpt, ScriptVec, SignPsbtOptions, SignPsbtOptionsLike, Signature, Signer, SignerAlwaysError, SignerBtc, SignerBtcPublicKeyReadonly, SignerCkbPrivateKey, SignerCkbPublicKey, SignerCkbScriptReadonly, SignerDoge, SignerDogeAddressReadonly, SignerDogePrivateKey, SignerDummy, SignerEvm, SignerEvmAddressReadonly, SignerInfo, SignerMultisig, SignerMultisigCkbPrivateKey, SignerMultisigCkbReadonly, SignerMultisigNotEnoughSignaturesError, SignerNostr, SignerNostrPrivateKey, SignerNostrPublicKeyReadonly, SignerOpenLink, SignerSignType, SignerType, Since, SinceLike, Transaction, TransactionLike, TransactionStatus, Wallet, WitnessArgs, WitnessArgsLike, Zero, apply, btcEcdsaPublicKeyHash, btcP2pkhAddressFromPublicKey, btcPublicKeyFromP2pkhAddress, btcVarLengthBytesFrom, buildNostrEventFromMessage, bytesConcat, bytesConcatTo, bytesEq, bytesFrom, bytesLen, bytesLenUnsafe, bytesTo, calcDaoClaimEpoch, calcDaoProfit, barrel_d_exports as ccc, codec, codecPadding, codecUint, codecUintNumber, depTypeFrom, depTypeFromBytes, depTypeToBytes, epochFrom, epochFromHex, epochToHex, fixedPointFrom, fixedPointToString, gcd, hashCkb, hashCkbShort, hashTypeFrom, hashTypeFromBytes, hashTypeId, hashTypeToBytes, hexFrom, isDaoOutputLimitExceeded, isWebview, keystoreDecrypt, keystoreEncrypt, messageHashBtcEcdsa, messageHashCkbSecp256k1, messageHashDogeEcdsa, barrel_d_exports$1 as mol, nostrEventHash, numBeFromBytes, numBeToBytes, numFrom, numFromBytes, numLeFromBytes, numLeToBytes, numMax, numMin, numToBytes, numToHex, recoverMessageSecp256k1, reduceAsync, signMessageSecp256k1, sleep, stringify, udtBalanceFrom, verifyMessageBtcEcdsa, verifyMessageCkbSecp256k1, verifyMessageDogeEcdsa, verifyMessageEvmPersonal, verifyMessageJoyId, verifyMessageNostrEvent, verifyMessageSecp256k1 };
|
|
1
|
+
import { $ as CellDep, $i as Address, $n as SignerCkbPublicKey, $r as CodecByte, $t as ClientFindCellsResponse, Ai as Constructor, An as verifyMessageNostrEvent, Ar as keystoreEncrypt, At as HashTypeCodec, B as ClientPublicTestnet, Bi as numBeToBytes, Bn as SignerDummy, Br as HASH_CKB_LENGTH, Bt as Epoch, Ci as CodecUint64LE, Cr as Wallet, Ct as depTypeFrom, Di as codecUintNumber, Dn as barrel_d_exports, Dr as SignPsbtOptionsLike, Dt as udtBalanceFrom, Ei as codecUint, Er as SignPsbtOptions, Et as isDaoOutputLimitExceeded, Fi as sleep, Fn as verifyMessageEvmPersonal, Ft as ScriptVec, G as ClientCacheMemory, Gi as numMax, Gn as SignerDoge, Gr as Hasher, Gt as CellDepInfo, H as ClientJsonRpc, Hi as numFromBytes, Hn as verifyMessageDogeEcdsa, Hr as HasherCkb, Ht as epochFrom, Ii as stringify, In as SignerEvmAddressReadonly, It as hashTypeFrom, J as ErrorTransactionInsufficientCoin, Ji as numToHex, Jn as MultisigCkbWitness, Jr as One, Jt as ClientBlockHeader, K as ClientCache, Ki as numMin, Kn as verifyMessageJoyId, Kr as FixedPoint, Kt as CellDepInfoLike, Li as Num, Ln as SignerEvm, Lt as hashTypeFromBytes, Mi as gcd, Mn as SignerNostrPublicKeyReadonly, Mr as RequestorJsonRpcConfig, Mt as Script, Ni as isWebview, Nn as NostrEvent, Nt as ScriptLike, Oi as Entity, On as buildNostrEventFromMessage, Or as barrel_d_exports$1, Ot as LumosTransactionSkeletonType, Pi as reduceAsync, Pn as SignerNostr, Pt as ScriptOpt, Q as CellAnyLike, Qi as EncodableType, Qn as SignerCkbPrivateKey, Qr as CodecBool, Qt as ClientBlockUncleLike, Ri as NumLike, Rn as SignerOpenLink, Rt as hashTypeToBytes, Si as CodecUint64BE, Sr as SignerType, St as calcDaoProfit, Ti as codecPadding, Tr as InputToSignLike, Tt as depTypeToBytes, U as ClientJsonRpcConfig, Ui as numLeFromBytes, Un as SignerDogePrivateKey, Ur as hashCkb, Ut as epochFromHex, V as ClientPublicMainnet, Vi as numFrom, Vn as messageHashDogeEcdsa, Vr as HASH_CKB_SHORT_LENGTH, Vt as EpochLike, W as Client, Wi as numLeToBytes, Wn as SignerDogeAddressReadonly, Wr as hashCkbShort, Wt as epochToHex, X as Cell, Xi as CodecLike, Xn as SignerMultisigCkbReadonly, Xr as fixedPointFrom, Xt as ClientBlockLike, Y as hashTypeId, Yi as Codec, Yn as MultisigCkbWitnessLike, Yr as Zero, Yt as ClientBlockHeaderLike, Z as CellAny, Zi as DecodedType, Zn as SignerCkbScriptReadonly, Zr as fixedPointToString, Zt as ClientBlockUncle, _i as CodecUint32LE, _n as ErrorClientWaitTransactionTimeout, _r as Signer, _t as Transaction, aa as hexFrom, ai as CodecRaw, an as ClientIndexerSearchKeyLike, ar as verifyMessageCkbSecp256k1, at as CellLike, bi as CodecUint512LE, bn as ScriptInfoLike, br as SignerMultisigNotEnoughSignaturesError, bt as WitnessArgsLike, ca as bytesConcat, ci as CodecUint128LE, cn as ClientTransactionResponse, cr as btcP2pkhAddressFromPublicKey, ct as CellOutputVec, da as bytesFrom, di as CodecUint16LE, dn as ErrorClientBaseLike, dr as messageHashBtcEcdsa, dt as DepTypeLike, ea as AddressLike, ei as CodecByte16, en as ClientFindTransactionsGroupedResponse, er as SignerCkbAlwaysSuccess, et as CellDepLike, fa as bytesTo, fi as CodecUint256, fn as ErrorClientDuplicatedTransaction, fr as verifyMessageBtcEcdsa, ft as OutPoint, gi as CodecUint32BE, gn as ErrorClientVerification, gr as Signature, gt as SinceLike, hi as CodecUint32, hn as ErrorClientResolveUnknown, hr as NetworkPreference, ht as Since, ia as bytesLenUnsafe, ii as CodecBytes, in as ClientIndexerSearchKeyFilterLike, ir as signMessageSecp256k1, it as CellInputVec, ji as apply, jn as SignerNostrPrivateKey, jr as RequestorJsonRpc, jt as HashTypeLike, ki as codec, kn as nostrEventHash, kr as keystoreDecrypt, kt as HashType, la as bytesConcatTo, li as CodecUint16, ln as ClientTransactionResponseLike, lr as btcPublicKeyFromP2pkhAddress, lt as DepType, mi as CodecUint256LE, mn as ErrorClientRBFRejected, mr as SignerBtc, mt as RawTransaction, na as HexLike, ni as CodecByte4, nn as ClientIndexerSearchKey, nr as messageHashCkbSecp256k1, nt as CellInput, oa as Bytes, oi as CodecUint128, on as ClientIndexerSearchKeyTransaction, or as verifyMessageSecp256k1, ot as CellOutput, pi as CodecUint256BE, pn as ErrorClientMaxFeeRateExceeded, pr as SignerBtcPublicKeyReadonly, pt as OutPointLike, q as ErrorTransactionInsufficientCapacity, qi as numToBytes, qn as SignerMultisigCkbPrivateKey, qr as FixedPointLike, qt as ClientBlock, ra as bytesLen, ri as CodecByte8, rn as ClientIndexerSearchKeyFilter, rr as recoverMessageSecp256k1, rt as CellInputLike, sa as BytesLike, si as CodecUint128BE, sn as ClientIndexerSearchKeyTransactionLike, sr as btcEcdsaPublicKeyHash, st as CellOutputLike, ta as Hex, ti as CodecByte32, tn as ClientFindTransactionsResponse, tr as SECP256K1_SIGNATURE_LENGTH, tt as CellDepVec, ua as bytesEq, ui as CodecUint16BE, un as ErrorClientBase, ur as btcVarLengthBytesFrom, ut as DepTypeCodec, vi as CodecUint512, vn as OutputsValidator, vr as SignerInfo, vt as TransactionLike, wi as CodecUint8, wr as InputToSign, wt as depTypeFromBytes, xi as CodecUint64, xn as TransactionStatus, xr as SignerSignType, xt as calcDaoClaimEpoch, yi as CodecUint512BE, yn as ScriptInfo, yr as SignerMultisig, yt as WitnessArgs, zi as numBeFromBytes, zn as SignerAlwaysError, zr as HasherKeecak256, zt as KnownScript } from "./advancedBarrel-CJAh6sm8.js";
|
|
2
|
+
export { Address, AddressLike, Bytes, BytesLike, Cell, CellAny, CellAnyLike, CellDep, CellDepInfo, CellDepInfoLike, CellDepLike, CellDepVec, CellInput, CellInputLike, CellInputVec, CellLike, CellOutput, CellOutputLike, CellOutputVec, Client, ClientBlock, ClientBlockHeader, ClientBlockHeaderLike, ClientBlockLike, ClientBlockUncle, ClientBlockUncleLike, ClientCache, ClientCacheMemory, ClientFindCellsResponse, ClientFindTransactionsGroupedResponse, ClientFindTransactionsResponse, ClientIndexerSearchKey, ClientIndexerSearchKeyFilter, ClientIndexerSearchKeyFilterLike, ClientIndexerSearchKeyLike, ClientIndexerSearchKeyTransaction, ClientIndexerSearchKeyTransactionLike, ClientJsonRpc, ClientJsonRpcConfig, ClientPublicMainnet, ClientPublicTestnet, ClientTransactionResponse, ClientTransactionResponseLike, Codec, CodecBool, CodecByte, CodecByte16, CodecByte32, CodecByte4, CodecByte8, CodecBytes, CodecLike, CodecRaw, CodecUint128, CodecUint128BE, CodecUint128LE, CodecUint16, CodecUint16BE, CodecUint16LE, CodecUint256, CodecUint256BE, CodecUint256LE, CodecUint32, CodecUint32BE, CodecUint32LE, CodecUint512, CodecUint512BE, CodecUint512LE, CodecUint64, CodecUint64BE, CodecUint64LE, CodecUint8, Constructor, DecodedType, DepType, DepTypeCodec, DepTypeLike, EncodableType, Entity, Epoch, EpochLike, ErrorClientBase, ErrorClientBaseLike, ErrorClientDuplicatedTransaction, ErrorClientMaxFeeRateExceeded, ErrorClientRBFRejected, ErrorClientResolveUnknown, ErrorClientVerification, ErrorClientWaitTransactionTimeout, ErrorTransactionInsufficientCapacity, ErrorTransactionInsufficientCoin, FixedPoint, FixedPointLike, HASH_CKB_LENGTH, HASH_CKB_SHORT_LENGTH, HashType, HashTypeCodec, HashTypeLike, Hasher, HasherCkb, HasherKeecak256, Hex, HexLike, InputToSign, InputToSignLike, KnownScript, LumosTransactionSkeletonType, MultisigCkbWitness, MultisigCkbWitnessLike, NetworkPreference, NostrEvent, Num, NumLike, One, OutPoint, OutPointLike, OutputsValidator, RawTransaction, RequestorJsonRpc, RequestorJsonRpcConfig, SECP256K1_SIGNATURE_LENGTH, Script, ScriptInfo, ScriptInfoLike, ScriptLike, ScriptOpt, ScriptVec, SignPsbtOptions, SignPsbtOptionsLike, Signature, Signer, SignerAlwaysError, SignerBtc, SignerBtcPublicKeyReadonly, SignerCkbAlwaysSuccess, SignerCkbPrivateKey, SignerCkbPublicKey, SignerCkbScriptReadonly, SignerDoge, SignerDogeAddressReadonly, SignerDogePrivateKey, SignerDummy, SignerEvm, SignerEvmAddressReadonly, SignerInfo, SignerMultisig, SignerMultisigCkbPrivateKey, SignerMultisigCkbReadonly, SignerMultisigNotEnoughSignaturesError, SignerNostr, SignerNostrPrivateKey, SignerNostrPublicKeyReadonly, SignerOpenLink, SignerSignType, SignerType, Since, SinceLike, Transaction, TransactionLike, TransactionStatus, Wallet, WitnessArgs, WitnessArgsLike, Zero, apply, btcEcdsaPublicKeyHash, btcP2pkhAddressFromPublicKey, btcPublicKeyFromP2pkhAddress, btcVarLengthBytesFrom, buildNostrEventFromMessage, bytesConcat, bytesConcatTo, bytesEq, bytesFrom, bytesLen, bytesLenUnsafe, bytesTo, calcDaoClaimEpoch, calcDaoProfit, barrel_d_exports as ccc, codec, codecPadding, codecUint, codecUintNumber, depTypeFrom, depTypeFromBytes, depTypeToBytes, epochFrom, epochFromHex, epochToHex, fixedPointFrom, fixedPointToString, gcd, hashCkb, hashCkbShort, hashTypeFrom, hashTypeFromBytes, hashTypeId, hashTypeToBytes, hexFrom, isDaoOutputLimitExceeded, isWebview, keystoreDecrypt, keystoreEncrypt, messageHashBtcEcdsa, messageHashCkbSecp256k1, messageHashDogeEcdsa, barrel_d_exports$1 as mol, nostrEventHash, numBeFromBytes, numBeToBytes, numFrom, numFromBytes, numLeFromBytes, numLeToBytes, numMax, numMin, numToBytes, numToHex, recoverMessageSecp256k1, reduceAsync, signMessageSecp256k1, sleep, stringify, udtBalanceFrom, verifyMessageBtcEcdsa, verifyMessageCkbSecp256k1, verifyMessageDogeEcdsa, verifyMessageEvmPersonal, verifyMessageJoyId, verifyMessageNostrEvent, verifyMessageSecp256k1 };
|
package/dist.commonjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./address.advanced
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./address.advanced-DG1gpW7t.js"),t=require("./barrel-C_zSgXKn.js");exports.Address=t.Q,exports.Bytes=e.qr,exports.Cell=e.a,exports.CellAny=e.o,Object.defineProperty(exports,"CellDep",{enumerable:!0,get:function(){return e.s}}),exports.CellDepInfo=e.nt,exports.CellDepVec=e.c,Object.defineProperty(exports,"CellInput",{enumerable:!0,get:function(){return e.l}}),exports.CellInputVec=e.u,Object.defineProperty(exports,"CellOutput",{enumerable:!0,get:function(){return e.d}}),exports.CellOutputVec=e.f,exports.Client=t.it,exports.ClientBlock=e.rt,exports.ClientBlockHeader=e.it,exports.ClientBlockUncle=e.at,exports.ClientCache=t.ot,exports.ClientCacheMemory=t.at,exports.ClientIndexerSearchKey=e.ot,exports.ClientIndexerSearchKeyFilter=e.st,exports.ClientIndexerSearchKeyTransaction=e.ct,exports.ClientJsonRpc=t.nt,exports.ClientPublicMainnet=t.tt,exports.ClientPublicTestnet=t.et,exports.ClientTransactionResponse=e.lt,exports.Codec=e.Kr,exports.CodecBool=e.yn,exports.CodecByte=e.bn,exports.CodecByte16=e.xn,exports.CodecByte32=e.Sn,exports.CodecByte4=e.Cn,exports.CodecByte8=e.wn,exports.CodecBytes=e.Tn,exports.CodecRaw=e.En,exports.CodecUint128=e.Dn,exports.CodecUint128BE=e.On,exports.CodecUint128LE=e.kn,exports.CodecUint16=e.An,exports.CodecUint16BE=e.jn,exports.CodecUint16LE=e.Mn,exports.CodecUint256=e.Nn,exports.CodecUint256BE=e.Pn,exports.CodecUint256LE=e.Fn,exports.CodecUint32=e.In,exports.CodecUint32BE=e.Ln,exports.CodecUint32LE=e.Rn,exports.CodecUint512=e.zn,exports.CodecUint512BE=e.Bn,exports.CodecUint512LE=e.Vn,exports.CodecUint64=e.Hn,exports.CodecUint64BE=e.Un,exports.CodecUint64LE=e.Wn,exports.CodecUint8=e.Gn,exports.DepTypeCodec=e.p,exports.Entity=e.lr,Object.defineProperty(exports,"Epoch",{enumerable:!0,get:function(){return e.xt}}),exports.ErrorClientBase=e.ut,exports.ErrorClientDuplicatedTransaction=e.dt,exports.ErrorClientMaxFeeRateExceeded=e.ft,exports.ErrorClientRBFRejected=e.pt,exports.ErrorClientResolveUnknown=e.mt,exports.ErrorClientVerification=e.ht,exports.ErrorClientWaitTransactionTimeout=e.gt,exports.ErrorTransactionInsufficientCapacity=e.E,exports.ErrorTransactionInsufficientCoin=e.D,exports.HASH_CKB_LENGTH=e.dr,exports.HASH_CKB_SHORT_LENGTH=e.fr,exports.HashTypeCodec=e.j,exports.HasherCkb=e.pr,exports.HasherKeecak256=t.ct,exports.InputToSign=t.J,exports.KnownScript=e.J,Object.defineProperty(exports,"MultisigCkbWitness",{enumerable:!0,get:function(){return t.m}}),exports.One=e.ar,Object.defineProperty(exports,"OutPoint",{enumerable:!0,get:function(){return e.m}}),exports.RawTransaction=e.h,exports.RequestorJsonRpc=t.rt,exports.SECP256K1_SIGNATURE_LENGTH=t.I,Object.defineProperty(exports,"Script",{enumerable:!0,get:function(){return e.M}}),exports.ScriptInfo=e._t,exports.ScriptOpt=e.N,exports.ScriptVec=e.P,exports.SignPsbtOptions=t.Y,exports.Signature=t.S,exports.Signer=t.C,exports.SignerAlwaysError=t.c,exports.SignerBtc=t.x,exports.SignerBtcPublicKeyReadonly=t.b,exports.SignerCkbAlwaysSuccess=t.y,exports.SignerCkbPrivateKey=t._,exports.SignerCkbPublicKey=t.v,exports.SignerCkbScriptReadonly=t.g,exports.SignerDoge=t.f,exports.SignerDogeAddressReadonly=t.d,exports.SignerDogePrivateKey=t.u,exports.SignerDummy=t.l,exports.SignerEvm=t.o,exports.SignerEvmAddressReadonly=t.a,exports.SignerInfo=t.w,exports.SignerMultisig=t.T,exports.SignerMultisigCkbPrivateKey=t.p,exports.SignerMultisigCkbReadonly=t.h,exports.SignerMultisigNotEnoughSignaturesError=t.E,exports.SignerNostr=t.i,exports.SignerNostrPrivateKey=t.n,exports.SignerNostrPublicKeyReadonly=t.r,exports.SignerOpenLink=t.s,exports.SignerSignType=t.D,exports.SignerType=t.O,Object.defineProperty(exports,"Since",{enumerable:!0,get:function(){return e.g}}),Object.defineProperty(exports,"Transaction",{enumerable:!0,get:function(){return e._}}),Object.defineProperty(exports,"WitnessArgs",{enumerable:!0,get:function(){return e.v}}),exports.Zero=e.or,exports.apply=e.Et,exports.btcEcdsaPublicKeyHash=t.H,exports.btcP2pkhAddressFromPublicKey=t.U,exports.btcPublicKeyFromP2pkhAddress=t.W,exports.btcVarLengthBytesFrom=t.G,exports.buildNostrEventFromMessage=t.k,exports.bytesConcat=e.Jr,exports.bytesConcatTo=e.Yr,exports.bytesEq=e.Xr,exports.bytesFrom=e.Zr,exports.bytesLen=e._r,exports.bytesLenUnsafe=e.vr,exports.bytesTo=e.Qr,exports.calcDaoClaimEpoch=e.y,exports.calcDaoProfit=e.b,Object.defineProperty(exports,"ccc",{enumerable:!0,get:function(){return t.t}}),exports.codec=e.ur,exports.codecPadding=e.Kn,exports.codecUint=e.qn,exports.codecUintNumber=e.Jn,exports.depTypeFrom=e.x,exports.depTypeFromBytes=e.S,exports.depTypeToBytes=e.C,exports.epochFrom=e.St,exports.epochFromHex=e.Ct,exports.epochToHex=e.wt,exports.fixedPointFrom=e.sr,exports.fixedPointToString=e.cr,exports.gcd=e.Dt,exports.hashCkb=e.mr,exports.hashCkbShort=e.hr,exports.hashTypeFrom=e.F,exports.hashTypeFromBytes=e.I,exports.hashTypeId=t.$,exports.hashTypeToBytes=e.L,exports.hexFrom=e.yr,exports.isDaoOutputLimitExceeded=e.w,exports.isWebview=e.Ot,exports.keystoreDecrypt=t.X,exports.keystoreEncrypt=t.Z,exports.messageHashBtcEcdsa=t.K,exports.messageHashCkbSecp256k1=t.L,exports.messageHashDogeEcdsa=t.N,Object.defineProperty(exports,"mol",{enumerable:!0,get:function(){return t.st}}),exports.nostrEventHash=t.A,exports.numBeFromBytes=e.Yn,exports.numBeToBytes=e.Xn,exports.numFrom=e.Zn,exports.numFromBytes=e.Qn,exports.numLeFromBytes=e.$n,exports.numLeToBytes=e.er,exports.numMax=e.tr,exports.numMin=e.nr,exports.numToBytes=e.rr,exports.numToHex=e.ir,exports.recoverMessageSecp256k1=t.R,exports.reduceAsync=e.kt,exports.signMessageSecp256k1=t.z,exports.sleep=e.At,exports.stringify=e.jt,exports.udtBalanceFrom=e.T,exports.verifyMessageBtcEcdsa=t.q,exports.verifyMessageCkbSecp256k1=t.B,exports.verifyMessageDogeEcdsa=t.P,exports.verifyMessageEvmPersonal=t.M,exports.verifyMessageJoyId=t.F,exports.verifyMessageNostrEvent=t.j,exports.verifyMessageSecp256k1=t.V;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.1",
|
|
4
4
|
"description": "Core of CCC - CKBer's Codebase",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"eslint-plugin-prettier": "^5.5.6",
|
|
41
41
|
"prettier": "^3.8.4",
|
|
42
42
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
43
|
-
"tsdown": "0.22.
|
|
43
|
+
"tsdown": "0.22.12",
|
|
44
44
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
45
45
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
46
46
|
"typescript-eslint": "^8.61.1",
|
package/src/ckb/transaction.ts
CHANGED
|
@@ -1193,6 +1193,10 @@ export class Transaction extends Entity.Base<TransactionLike, Transaction>() {
|
|
|
1193
1193
|
* ```
|
|
1194
1194
|
*/
|
|
1195
1195
|
copy(txLike: TransactionLike) {
|
|
1196
|
+
if (txLike === this) {
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1196
1200
|
const tx = Transaction.from(txLike);
|
|
1197
1201
|
this.version = tx.version;
|
|
1198
1202
|
this.cellDeps = tx.cellDeps;
|
|
@@ -2422,6 +2426,8 @@ export class Transaction extends Entity.Base<TransactionLike, Transaction>() {
|
|
|
2422
2426
|
let leastFee = Zero;
|
|
2423
2427
|
let leastExtraCapacity = Zero;
|
|
2424
2428
|
let collected = 0;
|
|
2429
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2430
|
+
let tx: Transaction = this;
|
|
2425
2431
|
|
|
2426
2432
|
// ===
|
|
2427
2433
|
// Usually, for the worst situation, three iterations are needed
|
|
@@ -2436,7 +2442,7 @@ export class Transaction extends Entity.Base<TransactionLike, Transaction>() {
|
|
|
2436
2442
|
}
|
|
2437
2443
|
|
|
2438
2444
|
try {
|
|
2439
|
-
return await
|
|
2445
|
+
return await tx.completeInputsByCapacity(
|
|
2440
2446
|
from,
|
|
2441
2447
|
leastFee + leastExtraCapacity,
|
|
2442
2448
|
filter,
|
|
@@ -2455,7 +2461,8 @@ export class Transaction extends Entity.Base<TransactionLike, Transaction>() {
|
|
|
2455
2461
|
}
|
|
2456
2462
|
})();
|
|
2457
2463
|
|
|
2458
|
-
|
|
2464
|
+
tx = await from.prepareTransaction(tx);
|
|
2465
|
+
const fee = await tx.getFee(from.client);
|
|
2459
2466
|
if (fee < leastFee + leastExtraCapacity) {
|
|
2460
2467
|
// Not enough capacity are collected, it should only happens when shouldAddInputs is false
|
|
2461
2468
|
throw new ErrorTransactionInsufficientCapacity(
|
|
@@ -2463,44 +2470,45 @@ export class Transaction extends Entity.Base<TransactionLike, Transaction>() {
|
|
|
2463
2470
|
{ isForChange: leastExtraCapacity !== Zero },
|
|
2464
2471
|
);
|
|
2465
2472
|
}
|
|
2466
|
-
|
|
2467
|
-
await from.prepareTransaction(this);
|
|
2468
2473
|
if (leastFee === Zero) {
|
|
2469
2474
|
// The initial fee is calculated based on prepared transaction
|
|
2470
2475
|
// This should only happens during the first iteration
|
|
2471
|
-
leastFee =
|
|
2476
|
+
leastFee = tx.estimateFee(feeRate);
|
|
2472
2477
|
}
|
|
2473
2478
|
// The extra capacity paid the fee without a change
|
|
2474
2479
|
// leastExtraCapacity should be 0 here, otherwise we should failed in the previous check
|
|
2475
2480
|
// So this only happens in the first iteration
|
|
2476
2481
|
if (fee === leastFee) {
|
|
2482
|
+
this.copy(tx);
|
|
2477
2483
|
return [collected, false];
|
|
2478
2484
|
}
|
|
2479
2485
|
|
|
2480
2486
|
// Invoke the change function on a transaction multiple times may cause problems, so we clone it
|
|
2481
|
-
|
|
2482
|
-
const needed = numFrom(
|
|
2487
|
+
let changedTx = tx.clone();
|
|
2488
|
+
const needed = numFrom(
|
|
2489
|
+
await Promise.resolve(change(changedTx, fee - leastFee)),
|
|
2490
|
+
);
|
|
2483
2491
|
if (needed > Zero) {
|
|
2484
2492
|
// No enough extra capacity to create new cells for change, collect inputs again
|
|
2485
2493
|
leastExtraCapacity = needed;
|
|
2486
2494
|
continue;
|
|
2487
2495
|
}
|
|
2488
2496
|
|
|
2489
|
-
if ((await
|
|
2497
|
+
if ((await changedTx.getFee(from.client)) !== leastFee) {
|
|
2490
2498
|
throw new Error(
|
|
2491
2499
|
"The change function doesn't use all available capacity",
|
|
2492
2500
|
);
|
|
2493
2501
|
}
|
|
2494
2502
|
|
|
2495
2503
|
// New change cells created, update the fee
|
|
2496
|
-
await from.prepareTransaction(
|
|
2497
|
-
const changedFee =
|
|
2504
|
+
changedTx = await from.prepareTransaction(changedTx);
|
|
2505
|
+
const changedFee = changedTx.estimateFee(feeRate);
|
|
2498
2506
|
if (leastFee > changedFee) {
|
|
2499
2507
|
throw new Error("The change function removed existed transaction data");
|
|
2500
2508
|
}
|
|
2501
2509
|
// The fee has been paid
|
|
2502
2510
|
if (leastFee === changedFee) {
|
|
2503
|
-
this.copy(
|
|
2511
|
+
this.copy(changedTx);
|
|
2504
2512
|
return [collected, true];
|
|
2505
2513
|
}
|
|
2506
2514
|
|
|
@@ -43,7 +43,7 @@ const ERROR_PARSERS: [
|
|
|
43
43
|
new ErrorClientResolveUnknown(error, OutPoint.fromBytes(match[1])),
|
|
44
44
|
],
|
|
45
45
|
[
|
|
46
|
-
"Verification\\(Error { kind: Script, inner: TransactionScriptError { source: (Inputs|Outputs)\\[([0-9]*)\\].(Lock|Type), cause: ValidationFailure: see error code (-?[0-9])
|
|
46
|
+
"Verification\\(Error { kind: Script, inner: TransactionScriptError { source: (Inputs|Outputs)\\[([0-9]*)\\].(Lock|Type), cause: ValidationFailure: see error code (-?[0-9]+) on page https://nervosnetwork\\.github\\.io/ckb-script-error-codes/by-(type|data)-hash/(.*)\\.html",
|
|
47
47
|
(error, match) =>
|
|
48
48
|
new ErrorClientVerification(
|
|
49
49
|
error,
|
package/src/jsonRpc/requestor.ts
CHANGED
|
@@ -129,14 +129,19 @@ export class RequestorJsonRpc {
|
|
|
129
129
|
await pending;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
const res = (await (async () => {
|
|
133
|
+
this.concurrent += 1;
|
|
134
|
+
try {
|
|
135
|
+
return await this.transport.request(payload);
|
|
136
|
+
} finally {
|
|
137
|
+
this.concurrent -= 1;
|
|
138
|
+
this.pending.shift()?.();
|
|
139
|
+
}
|
|
140
|
+
})()) as {
|
|
134
141
|
id: number;
|
|
135
142
|
error: unknown;
|
|
136
143
|
result: unknown;
|
|
137
144
|
};
|
|
138
|
-
this.concurrent -= 1;
|
|
139
|
-
this.pending.shift()?.();
|
|
140
145
|
|
|
141
146
|
if (res.id !== payload.id) {
|
|
142
147
|
throw new Error(`Id mismatched, got ${res.id}, expected ${payload.id}`);
|
|
@@ -7,21 +7,24 @@ export class TransportFallback implements Transport {
|
|
|
7
7
|
constructor(private readonly transports: Transport[]) {}
|
|
8
8
|
|
|
9
9
|
async request(data: JsonRpcPayload): Promise<unknown> {
|
|
10
|
-
|
|
10
|
+
const startI = this.i;
|
|
11
|
+
let lastErr: unknown = new Error(
|
|
12
|
+
"TransportFallback requires at least one transport",
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
for (let tried = 0; tried < this.transports.length; tried += 1) {
|
|
16
|
+
const i = (startI + tried) % this.transports.length;
|
|
11
17
|
|
|
12
|
-
while (true) {
|
|
13
18
|
try {
|
|
14
|
-
|
|
15
|
-
data,
|
|
16
|
-
);
|
|
17
|
-
} catch (err) {
|
|
18
|
-
triedCount += 1;
|
|
19
|
-
this.i += 1;
|
|
19
|
+
const res = await this.transports[i].request(data);
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
this.i = i;
|
|
22
|
+
return res;
|
|
23
|
+
} catch (err) {
|
|
24
|
+
lastErr = err;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
|
|
28
|
+
throw lastErr;
|
|
26
29
|
}
|
|
27
30
|
}
|
package/src/signer/ckb/index.ts
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Address } from "../../address/index.js";
|
|
2
|
+
import { Transaction, TransactionLike } from "../../ckb/index.js";
|
|
3
|
+
import { Client, KnownScript } from "../../client/index.js";
|
|
4
|
+
import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A signer for the well-known always-success lock script.
|
|
8
|
+
*
|
|
9
|
+
* The always-success script does not require a signature, so signing a
|
|
10
|
+
* transaction only needs to add its cell dependency.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export class SignerCkbAlwaysSuccess extends Signer {
|
|
15
|
+
get type(): SignerType {
|
|
16
|
+
return SignerType.CKB;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get signType(): SignerSignType {
|
|
20
|
+
return SignerSignType.Unknown;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of SignerCkbAlwaysSuccess.
|
|
25
|
+
*
|
|
26
|
+
* @param client - The client instance used for communication and resolving
|
|
27
|
+
* the always-success deployment.
|
|
28
|
+
*/
|
|
29
|
+
constructor(client: Client) {
|
|
30
|
+
super(client);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async connect(): Promise<void> {}
|
|
34
|
+
|
|
35
|
+
async isConnected(): Promise<boolean> {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getInternalAddress(): Promise<string> {
|
|
40
|
+
return this.getRecommendedAddress();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the address of the always-success lock script.
|
|
45
|
+
*/
|
|
46
|
+
async getAddressObjs(): Promise<Address[]> {
|
|
47
|
+
return [
|
|
48
|
+
await Address.fromKnownScript(
|
|
49
|
+
this.client,
|
|
50
|
+
KnownScript.AlwaysSuccess,
|
|
51
|
+
"0x",
|
|
52
|
+
),
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Adds the always-success cell dependency to a transaction.
|
|
58
|
+
*/
|
|
59
|
+
async prepareTransaction(txLike: TransactionLike): Promise<Transaction> {
|
|
60
|
+
const tx = Transaction.from(txLike);
|
|
61
|
+
await tx.addCellDepsOfKnownScripts(this.client, KnownScript.AlwaysSuccess);
|
|
62
|
+
return tx;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The always-success script requires no signature.
|
|
67
|
+
*/
|
|
68
|
+
async signOnlyTransaction(txLike: TransactionLike): Promise<Transaction> {
|
|
69
|
+
return Transaction.from(txLike);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{bech32 as e,bech32m as t}from"bech32";import{Buffer as n}from"buffer/index.js";import{blake2b as r}from"@noble/hashes/blake2.js";import i from"isomorphic-ws";const a=Uint8Array;function o(e,...t){return t.reduce((t,n)=>{let r=l(n);for(let t of r)e.push(t);return t},e)}function s(...e){return new Uint8Array(o([],...e))}function c(e,t){return n.from(l(e)).toString(t)}function l(e,t){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(typeof e==`string`){if(t!==void 0)return n.from(e,t);let r=e.startsWith(`0x`)?e.slice(2):e,i=r.length%2==0?r:`0${r}`,a=n.from(i,`hex`);if(a.length*2!==i.length)throw Error(`Invalid bytes ${e}`);return a}if(Array.from(e).some(e=>e<0||255<e))throw Error(`Invalid bytes ${JSON.stringify(e)}`);return new Uint8Array(e)}function u(e,t){if(e===t)return!0;let n=l(e),r=l(t);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}var d=class e{constructor(e,t,n){this.encode=e,this.decode=t,this.byteLength=n}encodeOr(e,t){try{return this.encode(e)}catch{return t}}decodeOr(e,t,n){try{return this.decode(e,n)}catch{return t}}static from({encode:t,decode:n,byteLength:r}){return new e(e=>{let n=t(e);if(r!==void 0&&n.byteLength!==r)throw Error(`Codec.encode: expected byte length ${r}, got ${n.byteLength}`);return n},(e,t)=>{let i=l(e);if(r!==void 0&&i.byteLength!==r)throw Error(`Codec.decode: expected byte length ${r}, got ${i.byteLength}`);return n(e,t)},r)}map({inMap:t,outMap:n}){return new e(e=>this.encode(t?t(e):e),(e,t)=>n?n(this.decode(e,t)):this.decode(e,t),this.byteLength)}mapIn(e){return this.map({inMap:e})}mapOut(e){return this.map({outMap:e})}};function ee(e){if(!(typeof e==`string`&&e.length%2==0&&e.startsWith(`0x`)))return!1;for(let t=2;t<e.length;t++){let n=e.charAt(t);if(!(`0`<=n&&n<=`9`||`a`<=n&&n<=`f`))return!1}return!0}function f(e){return ee(e)?e:`0x${c(l(e),`hex`)}`}function te(e){return ee(e)?ne(e):l(e).length}function ne(e){return Math.floor((e.length-1)/2)}const re=l(`ckb-default-hash`,`utf8`),ie=32,ae=20;var oe=class{constructor(e=32,t=re){this.hasher=r.create({personalization:t,dkLen:e})}update(e){return this.hasher.update(l(e)),this}digest(){return f(this.hasher.digest())}};function se(...e){let t=new oe;return e.forEach(e=>t.update(e)),t.digest()}function ce(...e){return se(...e).slice(0,42)}var p=class{static Base(){class e extends p{static encode(e){throw Error(`encode not implemented, use @ccc.codec to decorate your type`)}static decode(e){throw Error(`decode not implemented, use @ccc.codec to decorate your type`)}static fromBytes(e){throw Error(`fromBytes not implemented, use @ccc.codec to decorate your type`)}static from(e){throw Error(`from not implemented`)}toBytes(){return this.constructor.encode(this)}clone(){return this.constructor.fromBytes(this.toBytes())}eq(e){return this===e||u(this.toBytes(),(this.constructor?.from(e)??e).toBytes())}hash(){return se(this.toBytes())}toHex(){return f(this.toBytes())}}return e.encode=void 0,e.decode=void 0,e.fromBytes=void 0,e}static BaseUnion(){class e extends p.Base(){constructor(e){super(),this.inner=e}match(e){let t=e[this.inner.type];return t==null?e._(this.inner):t(this.inner.value)}}return e}};function m(e){return function(t,...n){return t.byteLength=e.byteLength,t.encode===void 0&&(t.encode=function(n){return e.encode(t.from(n))}),t.decode===void 0&&(t.decode=function(n){return t.from(e.decode(l(n)))}),t.fromBytes===void 0&&(t.fromBytes=function(n){return t.from(e.decode(l(n)))}),t}}function le(e,t=8){let n=h(e).toString();if(t===0)return n;let r=n.length<=t?`0`:n.slice(0,-t),i=n.slice(-t).padStart(t,`0`).replace(/0*$/,``);return i===``?r:`${r}.${i}`}function h(e,t=8){if(typeof e==`bigint`)return e;let[n,r]=(typeof e==`number`?e.toFixed(t):e.toString()).split(`.`),i=BigInt(n.padEnd(n.length+t,`0`));return r===void 0?i:i+BigInt(r.slice(0,t).padEnd(t,`0`))}const g=0n,ue=h(`1`);function de(e,...t){let n=_(e);return t.forEach(e=>{let t=_(e);t<n&&(n=t)}),n}function fe(e,...t){let n=_(e);return t.forEach(e=>{let t=_(e);t>n&&(n=t)}),n}function _(e){if(typeof e==`bigint`)return e;if(e===`0x`)return BigInt(0);if(typeof e==`string`||typeof e==`number`)return BigInt(e);let t=f(e);return BigInt(t)}function v(e){let t=_(e);if(t<0n)throw Error(`value must be non-negative`);return`0x${t.toString(16)}`}function pe(e,t){return me(e,t)}function me(e,t){return he(e,t).reverse()}function he(e,t){let n=_(e);if(n<_(0)){if(t==null)throw Error(`negative number can not be serialized without knowing bytes length`);if(n=(_(1)<<_(8)*_(t))+n,n<0)throw Error(`negative number underflow`)}let r=l(n.toString(16));if(t==null)return r;if(r.length>t)throw Error(`number overflow`);return s(`00`.repeat(t-r.length),r)}function y(e){return b(e)}function b(e){return ge(l(e).map(e=>e).reverse())}function ge(e){return _(l(e))}function x(e,t=!1){return d.from({byteLength:e,encode:n=>t?pe(n,e):he(n,e),decode:e=>t?y(e):ge(e)})}function S(e,t=!1){if(e>4)throw Error(`uintNumber: byteLength must be less than or equal to 4`);return x(e,t).map({outMap:e=>Number(e)})}function _e(e){return d.from({byteLength:e,encode:()=>new Uint8Array(e),decode:()=>{}})}const ve=d.from({encode:e=>l(e),decode:e=>l(e)}),ye=d.from({encode:e=>l(e),decode:e=>f(e)}),be=S(1,!0),xe=S(2,!0),Se=S(2),Ce=xe,we=S(4,!0),Te=S(4),Ee=we,De=x(8,!0),Oe=x(8),ke=De,Ae=x(16,!0),je=x(16),Me=Ae,Ne=x(32,!0),Pe=x(32),Fe=Ne,Ie=x(64,!0),Le=x(64),Re=Ie,ze=d.from({byteLength:1,encode:e=>l(e?[1]:[0]),decode:e=>l(e)[0]!==0}),Be=d.from({byteLength:1,encode:e=>l(e),decode:e=>f(e)}),Ve=d.from({byteLength:4,encode:e=>l(e),decode:e=>f(e)}),He=d.from({byteLength:8,encode:e=>l(e),decode:e=>f(e)}),Ue=d.from({byteLength:16,encode:e=>l(e),decode:e=>f(e)}),C=d.from({byteLength:32,encode:e=>l(e),decode:e=>f(e)});function w(e){return pe(e,4)}function T(e){return Number(y(e))}function E(e){return e instanceof Error?e.message:String(e)}function We(e){let t=e.byteLength;if(t===void 0)throw Error(`fixedItemVec: itemCodec requires a byte length`);return d.from({encode(t){try{let n=[];o(n,w(t.length));for(let r of t)o(n,e.encode(r));return l(n)}catch(e){throw Error(`fixedItemVec - ${E(e)}`,{cause:e})}},decode(n,r){let i=l(n);if(i.byteLength<4)throw Error(`fixedItemVec: too short buffer, expected at least 4 bytes, but got ${i.byteLength}`);let a=4+T(i.slice(0,4))*t;if(i.byteLength!==a)throw Error(`fixedItemVec: invalid buffer size, expected ${a}, but got ${i.byteLength}`);try{let n=[];for(let o=4;o<a;o+=t)n.push(e.decode(i.slice(o,o+t),r));return n}catch(e){throw Error(`fixedItemVec - ${E(e)}`,{cause:e})}}})}function Ge(e){return d.from({encode(t){try{let n=4+t.length*4,r=[],i=[];for(let a of t){let t=e.encode(a);o(r,w(n)),o(i,t),n+=t.byteLength}return s(w(r.length+i.length+4),r,i)}catch(e){throw Error(`dynItemVec - ${E(e)}`,{cause:e})}},decode(t,n){let r=l(t);if(r.byteLength<4)throw Error(`dynItemVec: too short buffer, expected at least 4 bytes, but got ${r.byteLength}`);let i=T(r.slice(0,4));if(i!==r.byteLength)throw Error(`dynItemVec: invalid buffer size, expected ${i}, but got ${r.byteLength}`);if(i===4)return[];let a=(T(r.slice(4,8))-4)/4,o=Array.from(Array(a),(e,t)=>T(r.slice(4+t*4,8+t*4)));o.push(i);try{let t=[];for(let i=0;i<o.length-1;i++){let a=o[i],s=o[i+1],c=r.slice(a,s);t.push(e.decode(c,n))}return t}catch(e){throw Error(`dynItemVec - ${E(e)}`,{cause:e})}}})}function D(e){return e.byteLength===void 0?Ge(e):We(e)}function O(e){return d.from({encode(t){if(t==null)return l([]);try{return e.encode(t)}catch(e){throw Error(`option - ${E(e)}`,{cause:e})}},decode(t,n){if(l(t).byteLength!==0)try{return e.decode(t,n)}catch(e){throw Error(`option - ${E(e)}`,{cause:e})}}})}function Ke(e){return d.from({encode(t){try{let n=l(e.encode(t));return s(w(n.byteLength),n)}catch(e){throw Error(`byteVec - ${E(e)}`,{cause:e})}},decode(t,n){let r=l(t);if(r.byteLength<4)throw Error(`byteVec: too short buffer, expected at least 4 bytes, but got ${r.byteLength}`);let i=T(r.slice(0,4));if(i!==r.byteLength-4)throw Error(`byteVec: invalid buffer size, expected ${i}, but got ${r.byteLength}`);try{return e.decode(r.slice(4),n)}catch(e){throw Error(`byteVec - ${E(e)}`,{cause:e})}}})}function k(e){let t=Object.keys(e);return d.from({encode(n){let r=4+t.length*4,i=[],a=[];for(let s of t)try{let t=e[s].encode(n[s]);o(i,w(r)),o(a,t),r+=t.byteLength}catch(e){throw Error(`table.${s} - ${E(e)}`,{cause:e})}return s(w(i.length+a.length+4),i,a)},decode(n,r){let i=l(n);if(i.byteLength<4)throw Error(`table: too short buffer, expected at least 4 bytes, but got ${i.byteLength}`);let a=T(i.slice(0,4)),o=(T(i.slice(4,8))-4)/4;if(a!==i.byteLength)throw Error(`table: invalid buffer size, expected ${a}, but got ${i.byteLength}`);if(o<t.length)throw Error(`table: invalid field count, expected ${t.length}, but got ${o}`);if(o>t.length&&!r?.isExtraFieldIgnored)throw Error(`table: invalid field count, expected ${t.length}, but got ${o}, and extra fields are not allowed in the current configuration. If you want to ignore extra fields, set isExtraFieldIgnored to true.`);let s=t.map((e,t)=>T(i.slice(4+t*4,8+t*4)));o>t.length?s.push(T(i.slice(4+t.length*4,8+t.length*4))):s.push(a);let c={};for(let n=0;n<s.length-1;n++){let a=s[n],o=s[n+1],l=t[n],u=e[l],d=i.slice(a,o);try{Object.assign(c,{[l]:u.decode(d,r)})}catch(e){throw Error(`table.${l} - ${E(e)}`,{cause:e})}}return c}})}function qe(e,t){let n=Object.entries(e),r;if(n.length>0){let e=n[0][1].byteLength;e!==void 0&&n.every(([,{byteLength:t}])=>t===e)&&(r=e+4)}function i(e){return`type`in e&&`value`in e?e:e.inner}return d.from({byteLength:r,encode(r){let{type:a,value:o}=i(r),c=a.toString(),l=e[c];if(!l)throw Error(`union: invalid type, expected ${n.map(e=>e[0]).toString()}, but got ${c}`);let u=t?t[c]??-1:n.findIndex(e=>e[0]===c);if(u<0)throw Error(`union: invalid field id ${u} of ${c}`);let d=w(u);try{return s(d,l.encode(o))}catch(e){throw Error(`union.(${c}) - ${E(e)}`,{cause:e})}},decode(n,r){let i=l(n),a=T(i.slice(0,4)),o=Object.keys(e),s=t?Object.entries(t).find(([,e])=>e===a)?.[0]:o[a];if(!s){if(!t)throw Error(`union: unknown union field index ${a}, only ${o.toString()} are allowed`);let e=Object.keys(t);throw Error(`union: unknown union field index ${a}, only ${e.toString()} and ${o.toString()} are allowed`)}return{type:s,value:e[s].decode(i.slice(4),r)}}})}function Je(e){let t=Object.values(e),n=Object.keys(e);return d.from({byteLength:t.reduce((e,t)=>{if(t.byteLength===void 0)throw Error(`struct: all fields must be fixed-size`);return e+t.byteLength},0),encode(t){let r=[];for(let i of n)try{o(r,e[i].encode(t[i]))}catch(e){throw Error(`struct.${i} - ${E(e)}`,{cause:e})}return l(r)},decode(t,n){let r=l(t),i={},a=0;return Object.entries(e).forEach(([e,t])=>{let o=r.slice(a,a+t.byteLength);try{Object.assign(i,{[e]:t.decode(o,n)})}catch(t){throw Error(`struct.${e} - ${E(t)}`,{cause:t})}a+=t.byteLength}),i}})}function Ye(e,t){if(e.byteLength===void 0)throw Error(`array: itemCodec requires a byte length`);let n=e.byteLength*t;return d.from({byteLength:n,encode(t){try{let n=[];for(let r of t)o(n,e.encode(r));return l(n)}catch(e){throw Error(`array - ${E(e)}`,{cause:e})}},decode(t,r){let i=l(t);if(i.byteLength!=n)throw Error(`array: invalid buffer size, expected ${n}, but got ${i.byteLength}`);try{let t=[];for(let n=0;n<i.byteLength;n+=e.byteLength)t.push(e.decode(i.slice(n,n+e.byteLength),r));return t}catch(e){throw Error(`array - ${E(e)}`,{cause:e})}}})}const Xe=O(be),Ze=D(be),Qe=O(Ce),$e=D(Ce),et=O(Ee),tt=D(Ee),nt=O(ke),rt=D(ke),it=O(Me),at=D(Me),ot=O(Fe),st=D(Fe),ct=O(Re),lt=D(Re),ut=Ke(ye),dt=O(ut),ft=D(ut),pt=O(ze),mt=D(ze),ht=O(Be),gt=D(Be),_t=O(Ve),vt=D(Ve),yt=O(He),bt=D(He),xt=O(Ue),St=D(Ue),Ct=O(C),wt=D(C),Tt=Ke({encode:e=>l(e,`utf8`),decode:e=>c(e,`utf8`)}),Et=D(Tt),Dt=O(Tt);function A(e,t){if(t!=null)return e(t)}async function Ot(e,t,n){if(n===void 0){if(e.length===0)throw TypeError(`Reduce of empty array with no initial value`);n=e[0],e=e.slice(1)}return e.reduce((e,n,r,i)=>e.then(e=>Promise.resolve(t(e,n,r,i)).then(t=>t??e)),Promise.resolve(n))}function kt(e){return new Promise(t=>setTimeout(t,Number(_(e))))}function At(e){return/webview|wv|ip((?!.*Safari)|(?=.*like Safari))/i.test(e)}function jt(e){return JSON.stringify(e,(e,t)=>typeof t==`bigint`?v(t):t)}function Mt(e,t){for(e=_(e),t=_(t),e=e<0n?-e:e,t=t<0n?-t:t;t!==g;)[e,t]=[t,e%t];return e}function j(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var M;let N=M=class extends p.Base(){constructor(e,t,n){super(),this.integer=e,this.numerator=t,this.denominator=n}normalizeBase(){return this.denominator===0n?M.from([this.integer,g,_(1)]):this.denominator<0n?M.from([this.integer,-this.numerator,-this.denominator]):this}normalizeCanonical(){let{integer:e,numerator:t,denominator:n}=this.normalizeBase();if(t<0n){let r=(-t+n-1n)/n;e-=r,t+=n*r}let r=Mt(t,n);return t/=r,n/=r,e+=t/n,t%=n,M.from([e,t,n])}get 0(){return this.integer}get 1(){return this.numerator}get 2(){return this.denominator}toNum(){if(this.integer<0n||this.numerator<0n||this.denominator<0n)throw Error(`Negative values in Epoch to Num conversion`);if(this.integer>=_(`0x1000000`)||this.numerator>=_(`0x10000`)||this.denominator>=_(`0x10000`))throw Error(`Integer must be < 2^24, numerator and denominator must be < 2^16`);return this.integer+(this.numerator<<_(24))+(this.denominator<<_(40))}toPackedHex(){return v(this.toNum())}static fromNum(e){let t=_(e);return new M(t&_(`0xffffff`),t>>_(24)&_(`0xffff`),t>>_(40)&_(`0xffff`))}static from(e){return e instanceof M?e:Array.isArray(e)?new M(_(e[0]),_(e[1]),_(e[2])):typeof e==`object`?new M(_(e.integer),_(e.numerator),_(e.denominator)):M.fromNum(e)}clone(){return M.from([this.integer,this.numerator,this.denominator])}static get Genesis(){return M.from([g,g,g])}static get OneNervosDaoCycle(){return M.from([_(180),g,_(1)])}compare(e){if(this===e)return 0;let t=this.normalizeBase(),n=M.from(e).normalizeBase(),r=(t.integer*t.denominator+t.numerator)*n.denominator,i=(n.integer*n.denominator+n.numerator)*t.denominator;return r>i?1:r<i?-1:0}lt(e){return this.compare(e)<0}le(e){return this.compare(e)<=0}eq(e){return this.compare(e)===0}ge(e){return this.compare(e)>=0}gt(e){return this.compare(e)>0}add(e){let t=this.normalizeBase(),n=M.from(e).normalizeBase(),r=t.integer+n.integer,i,a;return t.denominator===n.denominator?(i=t.numerator+n.numerator,a=t.denominator):(i=t.numerator*n.denominator+n.numerator*t.denominator,a=t.denominator*n.denominator),M.from([r,i,a]).normalizeCanonical()}sub(e){let{integer:t,numerator:n,denominator:r}=M.from(e);return this.add(M.from([-t,-n,r]))}toUnix(e,t=_(14400*1e3)){let{integer:n,numerator:r,denominator:i}=this.sub(e.epoch);return e.timestamp+t*n+t*r/i}};N=M=j([m(Je({padding:_e(1),denominator:x(2),numerator:x(2),integer:x(3)}))],N);function Nt(e){return N.from(e)}function Pt(e){return N.fromNum(e)}function Ft(e){return N.from(e).toPackedHex()}const It=_(1e7),Lt=_(1e3);function P([e,t]){return[_(e),_(t)]}var Rt=class e{constructor(e,t){this.cellDep=e,this.type=t}static from(t){return t instanceof e?t:new e(X.from(t.cellDep),A(B.from,t.type))}},zt=class e{constructor(e,t,n){this.codeHash=e,this.hashType=t,this.cellDeps=n}static from(t){return t instanceof e?t:new e(f(t.codeHash),z(t.hashType),t.cellDeps.map(e=>Rt.from(e)))}},Bt=class e{constructor(e,t,n,r,i,a,o){this.transaction=e,this.status=t,this.cycles=n,this.blockHash=r,this.blockNumber=i,this.txIndex=a,this.reason=o}static from(t){return t instanceof e?t:new e($.from(t.transaction),t.status,A(_,t.cycles),A(f,t.blockHash),A(_,t.blockNumber),A(_,t.txIndex),t.reason)}clone(){return new e(this.transaction.clone(),this.status,this.cycles,this.blockHash,this.blockNumber,this.txIndex,this.reason)}},Vt=class e{constructor(e,t,n,r,i,a,o){this.script=e,this.scriptLenRange=t,this.outputData=n,this.outputDataSearchMode=r,this.outputDataLenRange=i,this.outputCapacityRange=a,this.blockRange=o}static from(t){return t instanceof e?t:new e(A(B.from,t.script),A(P,t.scriptLenRange),A(f,t.outputData),t.outputDataSearchMode??void 0,A(P,t.outputDataLenRange),A(P,t.outputCapacityRange),A(P,t.blockRange))}},Ht=class e{constructor(e,t,n,r,i){this.script=e,this.scriptType=t,this.scriptSearchMode=n,this.filter=r,this.withData=i}static from(t){return t instanceof e?t:new e(B.from(t.script),t.scriptType,t.scriptSearchMode,A(Vt.from,t.filter),t.withData??void 0)}},Ut=class e{constructor(e,t,n,r,i){this.script=e,this.scriptType=t,this.scriptSearchMode=n,this.filter=r,this.groupByTransaction=i}static from(t){return t instanceof e?t:new e(B.from(t.script),t.scriptType,t.scriptSearchMode,A(Vt.from,t.filter),t.groupByTransaction??void 0)}},F=class e{constructor(e,t,n,r,i,a,o,s,c,l,u,d){this.compactTarget=e,this.dao=t,this.epoch=n,this.extraHash=r,this.hash=i,this.nonce=a,this.number=o,this.parentHash=s,this.proposalsHash=c,this.timestamp=l,this.transactionsRoot=u,this.version=d}static from(t){return t instanceof e?t:new e(_(t.compactTarget),{c:_(t.dao.c),ar:_(t.dao.ar),s:_(t.dao.s),u:_(t.dao.u)},N.from(t.epoch),f(t.extraHash),f(t.hash),_(t.nonce),_(t.number),f(t.parentHash),f(t.proposalsHash),_(t.timestamp),f(t.transactionsRoot),_(t.version))}},Wt=class e{constructor(e,t){this.header=e,this.proposals=t}static from(t){return t instanceof e?t:new e(F.from(t.header),t.proposals.map(f))}},Gt=class e{constructor(e,t,n,r){this.header=e,this.proposals=t,this.transactions=n,this.uncles=r}static from(t){return t instanceof e?t:new e(F.from(t.header),t.proposals.map(f),t.transactions.map($.from),t.uncles.map(Wt.from))}},I=class extends Error{constructor(e){super(`Client request error ${e.message}`),this.code=e.code,this.data=e.data}},Kt=class extends I{constructor(e,t){super(e),this.outPoint=G.from(t)}},qt=class extends I{constructor(e,t,n,r,i,a){super(e),this.source=t,this.errorCode=r,this.scriptHashType=i,this.sourceIndex=_(n),this.scriptCodeHash=f(a)}},Jt=class extends I{constructor(e,t){super(e),this.txHash=f(t)}},Yt=class extends I{constructor(e,t,n){super(e),this.currentFee=_(t),this.leastFee=_(n)}},Xt=class extends I{constructor(e){let t=_(e).toString();super({message:`Wait transaction timeout ${t}ms`,data:JSON.stringify({timeout:t})})}},Zt=class extends I{constructor(e,t){let n=_(e).toString(),r=_(t).toString();super({message:`Max fee rate exceeded limit ${n}, actual ${r}. Developer might forgot to complete transaction fee before sending. See https://api.ckbccc.com/classes/_ckb_ccc_core.index.ccc.Transaction.html#completeFeeBy.`,data:JSON.stringify({limit:n,actual:r})})}};const Qt=_(1e3*10*50);function $t(e,t,n){if(!t)return!0;let r=f(e),i=f(t);return!(n===`exact`&&r!==i||n===`prefix`&&!r.startsWith(i)||n===`partial`&&r.search(i)===-1)}function L(e,t,n){if(!t)return!0;if(!e)return!1;let r=B.from(e),i=B.from(t);return r.codeHash!==i.codeHash||r.hashType!==i.hashType?!1:$t(r.args,i?.args,n)}function en(e,t){if(!t)return!0;let n=_(e),[r,i]=P(t);return r<=n&&n<i}function tn(e,t){return!t||en(e?l(B.from(e).args).length+33:0,t)}function nn(e,t){let n=Ht.from(e),r=Ln.from(t);return!(n.scriptType===`lock`&&(!L(r.cellOutput.lock,n.script,n.scriptSearchMode)||!L(r.cellOutput.type,n.filter?.script,`prefix`)||!tn(r.cellOutput.type,n.filter?.scriptLenRange))||n.scriptType===`type`&&(!L(r.cellOutput.type,n.script,n.scriptSearchMode)||!L(r.cellOutput.lock,n.filter?.script,`prefix`)||!tn(r.cellOutput.lock,n.filter?.scriptLenRange))||!$t(r.outputData,n.filter?.outputData,n.filter?.outputDataSearchMode??`prefix`)||!en(l(r.outputData).length,n.filter?.outputDataLenRange)||!en(r.cellOutput.capacity,n.filter?.outputCapacityRange))}var rn=class extends Map{constructor(e){if(super(),this.capacity=e,this.lru=new Set,!Number.isInteger(e)||e<1)throw Error(`Capacity must be a positive integer`)}get(e){if(super.has(e))return this.lru.delete(e),this.lru.add(e),super.get(e)}set(e,t){if(super.set(e,t),this.lru.delete(e),this.lru.add(e),this.lru.size>this.capacity){let e=this.lru.keys().next().value;this.delete(e)}return this}delete(e){return super.delete(e)?(this.lru.delete(e),!0):!1}clear(){super.clear(),this.lru.clear()}};let an=function(e){return e.NervosDao=`NervosDao`,e.Secp256k1Blake160=`Secp256k1Blake160`,e.Secp256k1Multisig=`Secp256k1Multisig`,e.Secp256k1MultisigV2Beta=`Secp256k1MultisigV2Beta`,e.Secp256k1MultisigV2=`Secp256k1MultisigV2`,e.AnyoneCanPay=`AnyoneCanPay`,e.TypeId=`TypeId`,e.SUdt=`SUdt`,e.XUdt=`XUdt`,e.JoyId=`JoyId`,e.COTA=`COTA`,e.PWLock=`PWLock`,e.OmniLock=`OmniLock`,e.NostrLock=`NostrLock`,e.UniqueType=`UniqueType`,e.DidCkb=`DidCkb`,e.AlwaysSuccess=`AlwaysSuccess`,e.InputTypeProxyLock=`InputTypeProxyLock`,e.OutputTypeProxyLock=`OutputTypeProxyLock`,e.LockProxyLock=`LockProxyLock`,e.SingleUseLock=`SingleUseLock`,e.TypeBurnLock=`TypeBurnLock`,e.EasyToDiscoverType=`EasyToDiscoverType`,e.TimeLock=`TimeLock`,e}({});const on=Object.freeze({NervosDao:{codeHash:`0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c`,index:2},depType:`code`}}]},Secp256k1Blake160:{codeHash:`0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}}]},Secp256k1Multisig:{codeHash:`0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:1},depType:`depGroup`}}]},Secp256k1MultisigV2Beta:{codeHash:`0xd1a9f877aed3f5e07cb9c52b61ab96d06f250ae6883cc7f0a2423db0976fc821`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x44be4f4feda80c0e41783ab10e191df3b2bb5c3731b0970c916dbec385dcdc60`,index:0},depType:`depGroup`}}]},Secp256k1MultisigV2:{codeHash:`0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x6888aa39ab30c570c2c30d9d5684d3769bf77265a7973211a3c087fe8efbf738`,index:0},depType:`depGroup`}}]},AnyoneCanPay:{codeHash:`0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x4153a2014952d7cac45f285ce9a7c5c0c0e1b21f2d378b82ac1433cb11c25c4d`,index:0},depType:`depGroup`}}]},TypeId:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,cellDeps:[]},SUdt:{codeHash:`0x5e7a36a77e68eecc013dfa2fe6a23f3b6c344b04005808694ae6dd45eea4cfd5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xc7813f6a415144643970c2e88e0bb6ca6a8edc5dd7c1022746f628284a9936d5`,index:0},depType:`code`}}]},XUdt:{codeHash:`0x50bd8d6680b8b9cf98b73f3c08faf8b2a21914311954118ad6609be6e78a1b95`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xc07844ce21b38e4b071dd0e1ee3b0e27afd8d7532491327f39b786343f558ab7`,index:0},depType:`code`}}]},JoyId:{codeHash:`0xd00c84f0ec8fd441c38bc3f87a371f547190f2fcff88e642bc5bf54b9e318323`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x2d1f2d4d1514ccc3bb4f04f5437a5ae30d00636ee57cedd2c70ab3ea75b62adc`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xc086090432098835ec542a1b94bdd1b842c5aa1ccd1616873fe77f4a04044417`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:2},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x165b225c6fbed7e655b024384d9083de3243375f9893706f4452858ecd694e96`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:3},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xafb8408d0094ab944e6286aac750b9bb854ac0bcb66dfe5c60559744a700e70c`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:4},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x773bf0647be24b4e18ef44068fd069b9de5549c4b86be227779ceb9179598ec4`}}]},COTA:{codeHash:`0x1122a4fb54697cf2e6e3a96c9d80fd398a936559b90954c6e88eb7ba0cf652df`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xabaa25237554f0d6c586dc010e7e85e6870bcfd9fb8773257ecacfbe1fd738a0`,index:0},depType:`depGroup`}}]},PWLock:{codeHash:`0xbf43c3602455798c1a61a596e0d95278864c552fafe231c063b3fabf97a8febc`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0x1d60cb8f4666e039f418ea94730b1a8c5aa0bf2f7781474406387462924d15d4`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x42ade2f25eb938b5dbfd3d8f07b8b07aa593d848e7ff14bdfbbea5aeb6175261`}}]},OmniLock:{codeHash:`0x9b819793a64463aed77c615d6cb226eea5487ccfc0783043a587254cda2b6f26`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0xc76edf469816aa22f416503c38d0b533d2a018e253e379f134c3985b3472c842`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x855508fe0f0ca25b935b070452ecaee48f6c9f1d66cd15f046616b99e948236a`}}]},NostrLock:{codeHash:`0x641a89ad2f77721b803cd50d01351c1f308444072d5fa20088567196c0574c68`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x99b116dd1e4f1fa903b70112ae672c18bb34241d3d03a9ad555cd2a611be7327`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xfad8cb75eb0bb01718e2336002064568bc05887af107f74ed5dd501829e192f8`}}]},UniqueType:{codeHash:`0x2c8c11c985da60b0a330c61a85507416d6382c130ba67f0c47ab071e00aec628`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x67524c01c0cb5492e499c7c7e406f2f9d823e162d6b0cf432eacde0c9808c2ad`,index:0},depType:`code`}}]},DidCkb:{codeHash:`0x4a06164dc34dccade5afe3e847a97b6db743e79f5477fa3295acf02849c5984a`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe2f74c56cdc610d2b9fe898a96a80118845f5278605d7f9ad535dad69ae015bf`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,args:`0x55573ef6d78e3ca75170ff476176732309a8b31efe94320a954ded3d75c2cb18`,hashType:`type`}}]},AlwaysSuccess:{codeHash:`0x3b521cc4b552f109d092d8cc468a8048acb53c5952dbe769d2b2f9cf6e47f7f1`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:0},depType:`code`}}]},InputTypeProxyLock:{codeHash:`0x5123908965c711b0ffd8aec642f1ede329649bda1ebdca6bd24124d3796f768a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:1},depType:`code`}}]},OutputTypeProxyLock:{codeHash:`0x2df53b592db3ae3685b7787adcfef0332a611edb83ca3feca435809964c3aff2`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:2},depType:`code`}}]},LockProxyLock:{codeHash:`0x5d41e32e224c15f152b7e6529100ebeac83b162f5f692a5365774dad2c1a1d02`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:3},depType:`code`}}]},SingleUseLock:{codeHash:`0x8290467a512e5b9a6b816469b0edabba1f4ac474e28ffdd604c2a7c76446bbaf`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:4},depType:`code`}}]},TypeBurnLock:{codeHash:`0xff78bae0abf17d7a404c0be0f9ad9c9185b3f88dcc60403453d5ba8e1f22f53a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:5},depType:`code`}}]},EasyToDiscoverType:{codeHash:`0xaba4430cc7110d699007095430a1faa72973edf2322ddbfd4d1d219cacf237af`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb0ed754fb27d67fd8388c97fed914fb7998eceaa01f3e6f967e498de1ba0ac9b`,index:0},depType:`code`}}]},TimeLock:{codeHash:`0x6fac4b2e89360a1e692efcddcb3a28656d8446549fb83da6d896db8b714f4451`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb0ed754fb27d67fd8388c97fed914fb7998eceaa01f3e6f967e498de1ba0ac9b`,index:1},depType:`code`}}]}});var sn=class{constructor(e,t=3e4){this.url=e,this.timeout=t}async request(e){let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout),r=await(await fetch(this.url,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e),signal:t.signal})).json();return clearTimeout(n),r}},cn=class{constructor(e,t=3e4){this.url=e,this.timeout=t,this.ongoing=new Map}request(e){let t=(()=>{if(this.socket&&this.socket.readyState!==this.socket.CLOSING&&this.socket.readyState!==this.socket.CLOSED&&this.openSocket)return this.openSocket;let e=new i(this.url),t=({data:e})=>{let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.id!=`number`)throw Error(`Unknown response ${e}`);let n=t.id,r=this.ongoing.get(n);if(!r)return;let[i,a,o]=r;clearTimeout(o),this.ongoing.delete(n),i(t)},n=()=>{this.ongoing.forEach(([e,t,n])=>{clearTimeout(n),t(Error(`Connection closed`))}),this.ongoing.clear()};return e.onclose=n,e.onerror=n,e.onmessage=t,this.socket=e,this.openSocket=new Promise(t=>{e.readyState===e.OPEN?t(e):e.onopen=()=>{t(e)}}),this.openSocket})();return new Promise((n,r)=>{let i=[n,r,setTimeout(()=>{this.ongoing.delete(e.id),t.then(e=>e.close()).catch(e=>r(e)),r(Error(`Request timeout`))},this.timeout)];this.ongoing.set(e.id,i),t.then(t=>{t.readyState===t.CLOSED||t.readyState===t.CLOSING?(clearTimeout(i[2]),this.ongoing.delete(e.id),r(Error(`Connection closed`))):t.send(JSON.stringify(e))}).catch(e=>r(e))})}};function ln(e,t){return e.startsWith(`wss://`)||e.startsWith(`ws://`)?new cn(e,t?.timeout):new sn(e,t?.timeout)}var un=class{constructor(e){this.transports=e,this.i=0}async request(e){let t=0;for(;;)try{return await this.transports[this.i%this.transports.length].request(e)}catch(e){if(t+=1,this.i+=1,t>=this.transports.length)throw e}}},dn=class e{static hashTypeFrom(e){return z(e)}static hashTypeTo(e){return e}static depTypeFrom(e){switch(Nn(e)){case`code`:return`code`;case`depGroup`:return`dep_group`}}static depTypeTo(e){switch(e){case`code`:return`code`;case`dep_group`:return`depGroup`}}static scriptFrom(t){let n=B.from(t);return{code_hash:n.codeHash,hash_type:e.hashTypeFrom(n.hashType),args:n.args}}static scriptTo(t){return B.from({codeHash:t.code_hash,hashType:e.hashTypeTo(t.hash_type),args:t.args})}static outPointFrom(e){let t=G.from(e);return{index:v(t.index),tx_hash:t.txHash}}static outPointTo(e){return G.from({index:e.index,txHash:e.tx_hash})}static cellInputFrom(t){let n=Y.from(t);return{previous_output:e.outPointFrom(n.previousOutput),since:v(n.since)}}static cellInputTo(t){return Y.from({previousOutput:e.outPointTo(t.previous_output),since:t.since})}static cellOutputFrom(t,n){let r=K.from(t,n);return{capacity:v(r.capacity),lock:e.scriptFrom(r.lock),type:A(e.scriptFrom,r.type)}}static cellOutputTo(t){return K.from({capacity:t.capacity,lock:e.scriptTo(t.lock),type:A(e.scriptTo,t.type)})}static cellDepFrom(t){return{out_point:e.outPointFrom(t.outPoint),dep_type:e.depTypeFrom(t.depType)}}static cellDepTo(t){return X.from({outPoint:e.outPointTo(t.out_point),depType:e.depTypeTo(t.dep_type)})}static transactionFrom(t){let n=$.from(t);return{version:v(n.version),cell_deps:n.cellDeps.map(t=>e.cellDepFrom(t)),header_deps:n.headerDeps,inputs:n.inputs.map(t=>e.cellInputFrom(t)),outputs:n.outputs.map(t=>e.cellOutputFrom(t)),outputs_data:n.outputsData,witnesses:n.witnesses}}static transactionTo(t){return $.from({version:t.version,cellDeps:t.cell_deps.map(t=>e.cellDepTo(t)),headerDeps:t.header_deps,inputs:t.inputs.map(t=>e.cellInputTo(t)),outputs:t.outputs.map(t=>e.cellOutputTo(t)),outputsData:t.outputs_data,witnesses:t.witnesses})}static transactionResponseTo({cycles:t,tx_status:{status:n,block_number:r,block_hash:i,tx_index:a,reason:o},transaction:s}){if(s!=null)return Bt.from({transaction:e.transactionTo(s),status:n,cycles:A(_,t),blockHash:A(f,i),blockNumber:A(_,r),txIndex:A(_,a),reason:o})}static blockHeaderTo(e){let t=l(e.dao);return{compactTarget:_(e.compact_target),dao:{c:b(t.slice(0,8)),ar:b(t.slice(8,16)),s:b(t.slice(16,24)),u:b(t.slice(24,32))},epoch:N.fromNum(e.epoch),extraHash:e.extra_hash,hash:e.hash,nonce:_(e.nonce),number:_(e.number),parentHash:e.parent_hash,proposalsHash:e.proposals_hash,timestamp:_(e.timestamp),transactionsRoot:e.transactions_root,version:_(e.version)}}static blockUncleTo(t){return{header:e.blockHeaderTo(t.header),proposals:t.proposals}}static blockTo(t){return{header:e.blockHeaderTo(t.header),proposals:t.proposals,transactions:t.transactions.map(t=>e.transactionTo(t)),uncles:t.uncles.map(t=>e.blockUncleTo(t))}}static rangeFrom([e,t]){return[v(e),v(t)]}static indexerSearchKeyFilterFrom(t){return{script:A(e.scriptFrom,t.script),script_len_range:A(e.rangeFrom,t.scriptLenRange),output_data:t.outputData,output_data_filter_mode:t.outputDataSearchMode,output_data_len_range:A(e.rangeFrom,t.outputDataLenRange),output_capacity_range:A(e.rangeFrom,t.outputCapacityRange),block_range:A(e.rangeFrom,t.blockRange)}}static indexerSearchKeyFrom(t){let n=Ht.from(t);return{script:e.scriptFrom(n.script),script_type:n.scriptType,script_search_mode:n.scriptSearchMode,filter:A(e.indexerSearchKeyFilterFrom,n.filter),with_data:n.withData}}static findCellsResponseTo({last_cursor:t,objects:n}){return{lastCursor:t,cells:n.map(t=>Ln.from({outPoint:e.outPointTo(t.out_point),cellOutput:e.cellOutputTo(t.output),outputData:t.output_data??`0x`}))}}static indexerSearchKeyTransactionFrom(t){let n=Ut.from(t);return{script:e.scriptFrom(n.script),script_type:n.scriptType,script_search_mode:n.scriptSearchMode,filter:A(e.indexerSearchKeyFilterFrom,n.filter),group_by_transaction:n.groupByTransaction}}static findTransactionsResponseTo({last_cursor:e,objects:t}){return t.length===0?{lastCursor:e,transactions:[]}:`io_index`in t[0]?{lastCursor:e,transactions:t.map(e=>({txHash:e.tx_hash,blockNumber:_(e.block_number),txIndex:_(e.tx_index),cellIndex:_(e.io_index),isInput:e.io_type===`input`}))}:{lastCursor:e,transactions:t.map(e=>({txHash:e.tx_hash,blockNumber:_(e.block_number),txIndex:_(e.tx_index),cells:e.cells.map(([e,t])=>({isInput:e===`input`,cellIndex:_(t)}))}))}}};const fn=Object.freeze({NervosDao:{codeHash:`0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x8f8c79eb6671709633fe6a46de93c0fedc9c1b8a6527a18d3983879542635c9f`,index:2},depType:`code`}}]},Secp256k1Blake160:{codeHash:`0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}}]},Secp256k1Multisig:{codeHash:`0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:1},depType:`depGroup`}}]},Secp256k1MultisigV2Beta:{codeHash:`0x765b3ed6ae264b335d07e73ac332bf2c0f38f8d3340ed521cb447b4c42dd5f09`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf2013f123b2cb745e3fdf5c935a3925647496f88090503eef58332a9245b4172`,index:0},depType:`depGroup`}}]},Secp256k1MultisigV2:{codeHash:`0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x2eefdeb21f3a3edf697c28a52601b4419806ed60bb427420455cc29a090b26d5`,index:0},depType:`depGroup`}}]},AnyoneCanPay:{codeHash:`0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xec26b0f85ed839ece5f11c4c4e837ec359f5adc4420410f6453b1f6b60fb96a6`,index:0},depType:`depGroup`}}]},TypeId:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,cellDeps:[]},SUdt:{codeHash:`0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe12877ebd2c3c364dc46c5c992bcfaf4fee33fa13eebdf82c591fc9825aab769`,index:0},depType:`code`}}]},XUdt:{codeHash:`0x25c29dc317811a6f6f3985a7a9ebc4838bd388d19d0feeecf0bcd60f6c0975bb`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xbf6fb538763efec2a70a6a3dcb7242787087e1030c4e7d86585bc63a9d337f5f`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x44ec8b96663e06cc94c8c468a4d46d7d9af69eaf418f6390c9f11bb763dda0ae`}}]},JoyId:{codeHash:`0xd23761b364210735c19c60561d213fb3beae2fd6172743719eff6920e020baac`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x4a596d31dc35e88fb1591debbf680b04a44b4a434e3a94453c21ea8950ffb4d9`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x1c9fc299ba0570d077b4d7fb9acff1ccc0de69d369942d82678bae937c44ec30`}},{cellDep:{outPoint:{txHash:`0x4a596d31dc35e88fb1591debbf680b04a44b4a434e3a94453c21ea8950ffb4d9`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x27f0d3ccdc2fcd52ae31fbacad5f86b97bc147d7093e4807cd6e3d21c1fe6841`}},{cellDep:{outPoint:{txHash:`0xf2c9dbfe7438a8c622558da8fa912d36755271ea469d3a25cb8d3373d35c8638`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x0ac15fe5b2d059ec39de03f2d3159d5463abb918a1a07a9fa00d2b9c61d89ef3`}},{cellDep:{outPoint:{txHash:`0x95ecf9b41701b45d431657a67bbfa3f07ef7ceb53bf87097f3674e1a4a19ce62`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xc7bafc5550ccad7cea32c27764f5df6aca4de547da65e3e67fa08477a1af7f5e`}},{cellDep:{outPoint:{txHash:`0x8b3255491f3c4dcc1cfca33d5c6bcaec5409efe4bbda243900f9580c47e0242e`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x71decef9ca8725e64ec99a5521790d16b8d5daadb4989b45dd6ab51806a8c0e4`}}]},COTA:{codeHash:`0x89cd8003a0eaf8e65e0c31525b7d1d5c1becefd2ea75bb4cff87810ae37764d8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x636a786001f87cb615acfcf408be0f9a1f077001f0bbc75ca54eadfe7e221713`,index:0},depType:`depGroup`}}]},PWLock:{codeHash:`0x58c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0x57a62003daeab9d54aa29b944fc3b451213a5ebdf2e232216a3cfed0dde61b38`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xf6d90bfe3041d0fd7e01c45770241697f5f837974bd6ae1672a7ec0f9f523268`}}]},OmniLock:{codeHash:`0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0xec18bf0d857c981c3d1f4e17999b9b90c484b303378e94de1a57b0872f5d4602`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x761f51fc9cd6a504c32c6ae64b3746594d1af27629b427c5ccf6c9a725a89144`}}]},NostrLock:{codeHash:`0x6ae5ee0cb887b2df5a9a18137315b9bdc55be8d52637b2de0624092d5f0c91d5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xa2a434dcdbe280b9ed75bb7d6c7d68186a842456aba0fc506657dc5ed7c01d68`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x8dc56c6f35f0c535e23ded1629b1f20535477a1b43e59f14617d11e32c50e0aa`}}]},UniqueType:{codeHash:`0x8e341bcfec6393dcd41e635733ff2dca00a6af546949f70c57a706c0f344df8b`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xff91b063c78ed06f10a1ed436122bd7d671f9a72ef5f5fa28d05252c17cf4cef`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xe04976b67600fd25ac50305f77b33aee2c12e3c18e63ece9119e5b32117884b5`}}]},DidCkb:{codeHash:`0x510150477b10d6ab551a509b71265f3164e9fd4137fcb5a4322f49f03092c7c5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x0e7a830e2d5ebd05cd45a55f93f94559edea0ef1237b7233f49f7facfb3d6a6c`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,args:`0x3c27695173b888ed44ddf36f901789014384ad6c05a9137f3db9a0779c141c35`,hashType:`type`}}]},AlwaysSuccess:{codeHash:`0x3b521cc4b552f109d092d8cc468a8048acb53c5952dbe769d2b2f9cf6e47f7f1`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:0},depType:`code`}}]},InputTypeProxyLock:{codeHash:`0x5123908965c711b0ffd8aec642f1ede329649bda1ebdca6bd24124d3796f768a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:1},depType:`code`}}]},OutputTypeProxyLock:{codeHash:`0x2df53b592db3ae3685b7787adcfef0332a611edb83ca3feca435809964c3aff2`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:2},depType:`code`}}]},LockProxyLock:{codeHash:`0x5d41e32e224c15f152b7e6529100ebeac83b162f5f692a5365774dad2c1a1d02`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:3},depType:`code`}}]},SingleUseLock:{codeHash:`0x8290467a512e5b9a6b816469b0edabba1f4ac474e28ffdd604c2a7c76446bbaf`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:4},depType:`code`}}]},TypeBurnLock:{codeHash:`0xff78bae0abf17d7a404c0be0f9ad9c9185b3f88dcc60403453d5ba8e1f22f53a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:5},depType:`code`}}]},EasyToDiscoverType:{codeHash:`0xaba4430cc7110d699007095430a1faa72973edf2322ddbfd4d1d219cacf237af`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x1b4ffcad55ecd36ffb2715b6816b83da73851f1a24fe594f263c4f34dad90792`,index:0},depType:`code`}}]},TimeLock:{codeHash:`0x6fac4b2e89360a1e692efcddcb3a28656d8446549fb83da6d896db8b714f4451`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x1b4ffcad55ecd36ffb2715b6816b83da73851f1a24fe594f263c4f34dad90792`,index:1},depType:`code`}}]}}),pn={type:1,data:0,data1:2,data2:4},mn={1:`type`,0:`data`,2:`data1`,4:`data2`},hn=Object.keys(pn);var R;const gn=d.from({byteLength:1,encode:_n,decode:vn});function z(e){let t=(()=>{if(typeof e==`number`)return mn[e];if(typeof e==`bigint`)return mn[Number(e)];if(hn.includes(e))return e})();if(t===void 0)throw Error(`Invalid hash type ${e}`);return t}function _n(e){return l([pn[z(e)]])}function vn(e){return mn[l(e)[0]]}let B=R=class extends p.Base(){constructor(e,t,n){super(),this.codeHash=e,this.hashType=t,this.args=n}get occupiedSize(){return 33+l(this.args).length}clone(){return R.from({codeHash:this.codeHash,hashType:this.hashType,args:this.args})}eq(e){return e=R.from(e),this.args===e.args&&this.codeHash===e.codeHash&&this.hashType===e.hashType}static from(e){return e instanceof R?e:new R(f(e.codeHash),z(e.hashType),f(e.args))}static async fromKnownScript(e,t,n){let r=await e.getKnownScript(t);return R.from({codeHash:r.codeHash,hashType:r.hashType,args:f(n)})}};B=R=j([m(k({codeHash:C,hashType:gn,args:ut}))],B);const yn=O(B),bn=D(B),xn={code:0,depGroup:1},Sn={0:`code`,1:`depGroup`},Cn=Object.keys(xn);var V=class extends Error{constructor(e,t){let n=_(e),r=t?.isForChange??!1;super(`Insufficient CKB, need ${le(n)} extra CKB${r?` for the change cell`:``}`),this.amount=n,this.isForChange=r}},wn=class extends Error{constructor(e,t){let n=_(e),r=B.from(t);super(`Insufficient coin, need ${n} extra coin`),this.amount=n,this.type=r}},H,Tn,U,En,Dn,On,W;const kn=2n**32n-2n;function An(e){try{let t=_(e);return t<0n||t>kn?void 0:Number(t)}catch{return}}function jn(e){let t=An(e);if(t===void 0)throw Error(`Index ${e} must be a valid array index between 0 and ${kn}`);return t}const Mn=d.from({byteLength:1,encode:Pn,decode:Fn});function Nn(e){let t=typeof e==`number`?Sn[e]:typeof e==`bigint`?Sn[Number(e)]:e;if(t===void 0)throw Error(`Invalid dep type ${e}`);return t}function Pn(e){return l([xn[Nn(e)]])}function Fn(e){return Sn[l(e)[0]]}let G=H=class extends p.Base(){constructor(e,t){super(),this.txHash=e,this.index=t}static from(e){return e instanceof H?e:new H(f(e.txHash),_(e.index))}clone(){return H.from({txHash:this.txHash,index:this.index})}eq(e){return e=H.from(e),this.txHash===e.txHash&&this.index===e.index}};G=H=j([m(Je({txHash:C,index:Ee}))],G);let K=Tn=class extends p.Base(){constructor(e,t,n){super(),this.capacity=e,this.lock=t,this.type=n}get occupiedSize(){return 8+this.lock.occupiedSize+(this.type?.occupiedSize??0)}static from(e,t){let n=e instanceof Tn?e:new Tn(_(e.capacity??0),B.from(e.lock),A(B.from,e.type));return t!=null&&(n.capacity=fe(n.capacity,h(n.occupiedSize+l(t).length))),n}clone(){return Tn.from({capacity:this.capacity,lock:this.lock.clone(),type:this.type?.clone()})}};K=Tn=j([m(k({capacity:ke,lock:B,type:yn}))],K);const In=D(K);var q=class e{constructor(e,t,n){this.cellOutput=e,this.outputData=t,this.outPoint=n}static from(t){if(t instanceof e)return t;let n=f(t.outputData??`0x`);return new e(K.from(t.cellOutput,n),n,A(G.from,t.outPoint??t.previousOutput))}get occupiedSize(){return this.cellOutput.occupiedSize+l(this.outputData).byteLength}get capacityFree(){return this.cellOutput.capacity-h(this.occupiedSize)}async isNervosDao(e,t){let{type:n}=this.cellOutput,r=await e.getKnownScript(`NervosDao`);if(!n||n.codeHash!==r.codeHash||n.hashType!==r.hashType)return!1;let i=_(this.outputData)!==g;return!t||t===`deposited`&&!i||t===`withdrew`&&i}clone(){return e.from({cellOutput:this.cellOutput.clone(),outputData:this.outputData,outPoint:this.outPoint?.clone()})}},Ln=class e extends q{constructor(e,t,n){super(t,n,e),this.outPoint=e}static from(t){return t instanceof e?t:new e(G.from(t.outPoint??t.previousOutput),K.from(t.cellOutput,t.outputData),f(t.outputData??`0x`))}async getDaoProfit(e){if(!await this.isNervosDao(e,`withdrew`))return g;let{depositHeader:t,withdrawHeader:n}=await this.getNervosDaoInfo(e);if(!n||!t)throw Error(`Unable to get headers of a Nervos DAO cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return Hn(this.capacityFree,t,n)}async getNervosDaoInfo(e){if(!await this.isNervosDao(e))return{};if(_(this.outputData)===0n){let t=await e.getCellWithHeader(this.outPoint);if(!t?.header)throw Error(`Unable to get header of a Nervos DAO deposited cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return{depositHeader:t.header}}let[t,n]=await Promise.all([e.getHeaderByNumber(y(this.outputData)),e.getCellWithHeader(this.outPoint)]);if(!n?.header||!t)throw Error(`Unable to get headers of a Nervos DAO withdrew cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return{depositHeader:t,withdrawHeader:n.header}}clone(){return e.from({outPoint:this.outPoint.clone(),cellOutput:this.cellOutput.clone(),outputData:this.outputData})}};let J=U=class extends p.Base(){constructor(e,t,n){super(),this.relative=e,this.metric=t,this.value=n}clone(){return U.from({relative:this.relative,metric:this.metric,value:this.value})}static from(e){return e instanceof U?e:typeof e==`object`&&`relative`in e?new U(e.relative,e.metric,_(e.value)):U.fromNum(e)}toNum(){return this.value|(this.relative===`absolute`?g:_(`0x8000000000000000`))|{blockNumber:_(`0x0000000000000000`),epoch:_(`0x2000000000000000`),timestamp:_(`0x4000000000000000`)}[this.metric]}static fromNum(e){let t=_(e),n=t>>_(63)===0n?`absolute`:`relative`,r=[`blockNumber`,`epoch`,`timestamp`][Number(t>>_(61)&_(3))],i=t&_(`0x00ffffffffffffff`);return new U(n,r,i)}};J=U=j([m(ke.mapIn(e=>J.from(e).toNum()))],J);let Y=En=class extends p.Base(){constructor(e,t,n,r){super(),this.previousOutput=e,this.since=t,this.cellOutput=n,this.outputData=r}static from(e){return e instanceof En?e:new En(G.from(`previousOutput`in e?e.previousOutput:e.outPoint),J.from(e.since??0).toNum(),A(K.from,e.cellOutput),A(f,e.outputData))}async getCell(e){if(await this.completeExtraInfos(e),!this.cellOutput||!this.outputData)throw Error(`Unable to complete input`);return Ln.from({outPoint:this.previousOutput,cellOutput:this.cellOutput,outputData:this.outputData})}async completeExtraInfos(e){if(this.cellOutput&&this.outputData)return;let t=await e.getCell(this.previousOutput);t&&(this.cellOutput=t.cellOutput,this.outputData=t.outputData)}async getExtraCapacity(e){return(await this.getCell(e)).getDaoProfit(e)}clone(){return En.from({previousOutput:this.previousOutput.clone(),since:this.since,cellOutput:this.cellOutput?.clone(),outputData:this.outputData})}};Y=En=j([m(Je({since:J,previousOutput:G}).mapIn(e=>Y.from(e)))],Y);const Rn=D(Y);let X=Dn=class extends p.Base(){constructor(e,t){super(),this.outPoint=e,this.depType=t}static from(e){return e instanceof Dn?e:new Dn(G.from(e.outPoint),Nn(e.depType))}clone(){return Dn.from({outPoint:this.outPoint.clone(),depType:this.depType})}};X=Dn=j([m(Je({outPoint:G,depType:Mn}))],X);const zn=D(X);let Z=On=class extends p.Base(){constructor(e,t,n){super(),this.lock=e,this.inputType=t,this.outputType=n}static from(e){return e instanceof On?e:new On(A(f,e.lock),A(f,e.inputType),A(f,e.outputType))}};Z=On=j([m(k({lock:dt,inputType:dt,outputType:dt}))],Z);function Q(e){let t=l(e).slice(0,16);return t.length===0?g:y(t)}const Bn=k({version:Ee,cellDeps:zn,headerDeps:wt,inputs:Rn,outputs:In,outputsData:ft});let $=W=class extends p.Base(){constructor(e,t,n,r,i,a,o){super(),this.version=e,this.cellDeps=t,this.headerDeps=n,this.inputs=r,this.outputs=i,this.outputsData=a,this.witnesses=o}static default(){return W.from({})}copy(e){let t=W.from(e);this.version=t.version,this.cellDeps=t.cellDeps,this.headerDeps=t.headerDeps,this.inputs=t.inputs,this.outputs=t.outputs,this.outputsData=t.outputsData,this.witnesses=t.witnesses}clone(){return W.from({version:this.version,cellDeps:this.cellDeps.map(e=>e.clone()),headerDeps:this.headerDeps.map(e=>e),inputs:this.inputs.map(e=>e.clone()),outputs:this.outputs.map(e=>e.clone()),outputsData:this.outputsData.map(e=>e),witnesses:this.witnesses.map(e=>e)})}static from(e){if(e instanceof W)return e;let t=e.outputs?.map((t,n)=>K.from(t,e.outputsData?.[n]??[]))??[],n=t.map((t,n)=>f(e.outputsData?.[n]??`0x`));return e.outputsData!=null&&n.length<e.outputsData.length&&n.push(...e.outputsData.slice(n.length).map(e=>f(e))),new W(_(e.version??0),e.cellDeps?.map(e=>X.from(e))??[],e.headerDeps?.map(f)??[],e.inputs?.map(e=>Y.from(e))??[],t,n,e.witnesses?.map(f)??[])}static fromLumosSkeleton(e){return W.from({version:0n,cellDeps:e.cellDeps.toArray(),headerDeps:e.headerDeps.toArray(),inputs:e.inputs.toArray().map((t,n)=>{if(!t.outPoint)throw Error(`outPoint is required in input`);return Y.from({previousOutput:t.outPoint,since:e.inputSinces.get(n,`0x0`),cellOutput:t.cellOutput,outputData:t.data})}),outputs:e.outputs.toArray().map(e=>e.cellOutput),outputsData:e.outputs.toArray().map(e=>e.data),witnesses:e.witnesses.toArray()})}stringify(){return JSON.stringify(this,(e,t)=>typeof t==`bigint`?v(t):t)}rawToBytes(){return Bn.encode(this)}hash(){return se(this.rawToBytes())}hashFull(){return se(this.toBytes())}static hashWitnessToHasher(e,t){let n=l(f(e));t.update(pe(n.length,8)),t.update(n)}async getSignHashInfo(e,t,n=new oe){let r=B.from(e),i=-1;n.update(this.hash());for(let e=0;e<this.witnesses.length;e+=1){let a=this.inputs[e];if(a){let{cellOutput:n}=await a.getCell(t);if(!r.eq(n.lock))continue;i===-1&&(i=e)}if(i===-1)return;W.hashWitnessToHasher(this.witnesses[e],n)}if(i!==-1)return{message:n.digest(),position:i}}async findInputIndexByLockId(e,t){let n=B.from({...e,args:`0x`});for(let e=0;e<this.inputs.length;e+=1){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.codeHash===r.lock.codeHash&&n.hashType===r.lock.hashType)return e}}async findInputIndexByLock(e,t){let n=B.from(e);for(let e=0;e<this.inputs.length;e+=1){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.eq(r.lock))return e}}async findLastInputIndexByLock(e,t){let n=B.from(e);for(let e=this.inputs.length-1;e>=0;--e){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.eq(r.lock))return e}}addCellDeps(...e){e.flat().forEach(e=>{let t=X.from(e);this.cellDeps.some(e=>e.eq(t))||this.cellDeps.push(t)})}addCellDepsAtStart(...e){e.flat().forEach(e=>{let t=X.from(e);this.cellDeps.some(e=>e.eq(t))||this.cellDeps.unshift(t)})}async addCellDepInfos(e,...t){this.addCellDeps(await e.getCellDeps(...t))}async addCellDepsOfKnownScripts(e,...t){await Promise.all(t.flat().map(async t=>this.addCellDepInfos(e,(await e.getKnownScript(t)).cellDeps)))}setOutputDataAt(e,t){this.setOutputData(e,t)}setOutputData(e,t){let n=jn(e);if(n>=this.outputs.length)throw Error(`Index ${e} is out of bounds for outputs of length ${this.outputs.length}`);this.outputsData.length<n&&this.outputsData.push(...Array.from(Array(n-this.outputsData.length),()=>`0x`)),this.outputsData[n]=f(t)}getOutputData(e){let t=An(e);return t!==void 0&&t<this.outputs.length?this.outputsData[t]??`0x`:void 0}getInput(e){let t=An(e);return t===void 0?void 0:this.inputs[t]}addInput(e){return this.witnesses.length>this.inputs.length&&this.witnesses.splice(this.inputs.length,0,`0x`),this.inputs.push(Y.from(e))}getOutput(e){let t=An(e);if(!(t===void 0||t>=this.outputs.length))return q.from({cellOutput:this.outputs[t],outputData:this.outputsData[t]??`0x`})}get outputCells(){let{outputs:e,outputsData:t}=this;function*n(){for(let n=0;n<e.length;n++)yield q.from({cellOutput:e[n],outputData:t[n]??`0x`})}return n()}addOutput(e,t){let n=`cellOutput`in e?q.from(e):q.from({cellOutput:e,outputData:t}),r=this.outputs.push(n.cellOutput);return this.setOutputData(r-1,n.outputData),r}setOutput(e,t,n){let r=jn(e);if(r>this.outputs.length)throw Error(`Index ${e} is out of bounds for outputs of length ${this.outputs.length}`);let i=`cellOutput`in t?q.from(t):q.from({cellOutput:t,outputData:n});r===this.outputs.length?this.addOutput(i):(this.outputs[r]=i.cellOutput,this.setOutputData(r,i.outputData))}setInput(e,t){let n=jn(e);if(n>this.inputs.length)throw Error(`Index ${e} is out of bounds for inputs of length ${this.inputs.length}`);n===this.inputs.length?this.addInput(t):this.inputs[n]=Y.from(t)}getWitness(e){let t=An(e);return t===void 0?void 0:this.witnesses[t]}getWitnessArgs(e){try{return this.getWitnessArgsUnsafe(e)}catch{return}}getWitnessArgsUnsafe(e){let t=this.getWitness(e);return t&&t!==`0x`?Z.fromBytes(t):void 0}setWitnessArgs(e,t){this.setWitness(e,Z.from(t).toBytes())}setWitness(e,t){let n=jn(e);this.witnesses.length<n&&this.witnesses.push(...Array.from(Array(n-this.witnesses.length),()=>`0x`)),this.witnesses[n]=f(t)}getWitnessArgsAt(e){return this.getWitnessArgs(e)}getWitnessArgsAtUnsafe(e){return this.getWitnessArgsUnsafe(e)}setWitnessArgsAt(e,t){this.setWitnessArgs(e,t)}setWitnessAt(e,t){this.setWitness(e,t)}async prepareSighashAllWitness(e,t,n){let r=await this.findInputIndexByLock(e,n);if(r===void 0)return;let i=this.getWitnessArgs(r)??Z.from({});i.lock=f(Array.from(Array(t),()=>0)),this.setWitnessArgs(r,i)}async getInputsCapacityExtra(e){return Ot(this.inputs,async(t,n)=>t+await n.getExtraCapacity(e),g)}async getInputsCapacity(e){return await Ot(this.inputs,async(t,n)=>{let{cellOutput:{capacity:r}}=await n.getCell(e);return t+r},g)+await this.getInputsCapacityExtra(e)}getOutputsCapacity(){return this.outputs.reduce((e,{capacity:t})=>e+t,g)}async getInputsUdtBalance(e,t){return Ot(this.inputs,async(n,r)=>{let{cellOutput:i,outputData:a}=await r.getCell(e);if(i.type?.eq(t))return n+Q(a)},g)}getOutputsUdtBalance(e){return this.outputs.reduce((t,n,r)=>n.type?.eq(e)?t+Q(this.outputsData[r]):t,g)}async completeInputs(e,t,n,r){let i=[],a=r,o=!1;for await(let r of e.findCells(t,!0)){if(this.inputs.some(({previousOutput:e})=>e.eq(r.outPoint)))continue;let e=i.push(r),t=await Promise.resolve(n(a,r,e-1,i));if(t===void 0){o=!0;break}a=t}return i.forEach(e=>this.addInput(e)),o?{addedCount:i.length}:{addedCount:i.length,accumulated:a}}async completeInputsByCapacity(e,t,n){let r=this.getOutputsCapacity()+_(t??0),i=await this.getInputsCapacity(e.client);if(i>=r)return 0;let{addedCount:a,accumulated:o}=await this.completeInputs(e,n??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},(e,{cellOutput:{capacity:t}})=>{let n=e+t;return n>=r?void 0:n},i);if(o===void 0)return a;throw new V(r-o)}async completeInputsAll(e,t){let{addedCount:n}=await this.completeInputs(e,t??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},(e,{cellOutput:{capacity:t}})=>e+t,g);return n}async completeInputsByUdt(e,t,n){let r=this.getOutputsUdtBalance(t)+_(n??0);if(r===0n)return 0;let[i,a]=await Ot(this.inputs,async([n,r],i)=>{let{cellOutput:a,outputData:o}=await i.getCell(e.client);if(a.type?.eq(t))return[n+Q(o),r+1]},[g,0]);if(i===r||i>=r&&a>=2)return 0;let{addedCount:o,accumulated:s}=await this.completeInputs(e,{script:t,outputDataLenRange:[16,_(`0xffffffff`)]},(e,{outputData:t},n,i)=>{let o=e+Q(t);return o===r||o>=r&&a+i.length>=2?void 0:o},i);if(s===void 0||s>=r)return o;throw new wn(r-s,t)}async completeInputsAddOne(e,t){let{addedCount:n,accumulated:r}=await this.completeInputs(e,t??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},()=>void 0,!0);if(r===void 0)return n;throw Error(`Insufficient CKB, need at least one new cell`)}async completeInputsAtLeastOne(e,t){return this.inputs.length>0?0:this.completeInputsAddOne(e,t)}async getFee(e){return await this.getInputsCapacity(e)-this.getOutputsCapacity()}async getFeeRate(e){return await this.getFee(e)*_(1e3)/_(this.toBytes().length+4)}estimateFee(e){return(_(this.toBytes().length+4)*_(e)+_(999))/_(1e3)}async completeFee(e,t,n,r,i){let a=n??await e.client.getFeeRate(i?.feeRateBlockRange,i);await this.getInputsCapacity(e.client);let o=g,s=g,c=0;for(;;){c+=await(async()=>{if(!(i?.shouldAddInputs??!0))return 0;try{return await this.completeInputsByCapacity(e,o+s,r)}catch(e){throw e instanceof V&&s!==0n?new V(e.amount,{isForChange:!0}):e}})();let n=await this.getFee(e.client);if(n<o+s)throw new V(o+s-n,{isForChange:s!==g});if(await e.prepareTransaction(this),o===0n&&(o=this.estimateFee(a)),n===o)return[c,!1];let l=this.clone(),u=_(await Promise.resolve(t(l,n-o)));if(u>0n){s=u;continue}if(await l.getFee(e.client)!==o)throw Error(`The change function doesn't use all available capacity`);await e.prepareTransaction(l);let d=l.estimateFee(a);if(o>d)throw Error(`The change function removed existed transaction data`);if(o===d)return this.copy(l),[c,!0];o=d}}completeFeeChangeToLock(e,t,n,r,i){let a=B.from(t);return this.completeFee(e,(e,t)=>{let n=K.from({capacity:0,lock:a}),r=h(n.occupiedSize);return t<r?r:(n.capacity=t,e.addOutput(n),0)},n,r,i)}async completeFeeBy(e,t,n,r){let{script:i}=await e.getRecommendedAddressObj();return this.completeFeeChangeToLock(e,i,t,n,r)}completeFeeChangeToOutput(e,t,n,r,i){let a=Number(_(t));if(!this.outputs[a])throw Error(`Non-existed output to change`);return this.completeFee(e,(e,t)=>(e.outputs[a].capacity+=t,0),n,r,i)}};$=W=j([m(k({raw:Bn,witnesses:ft}).mapIn(e=>{let t=$.from(e);return{raw:t,witnesses:t.witnesses}}).mapOut(e=>$.from({...e.raw,witnesses:e.witnesses})))],$);async function Vn(e,t){if(e.outputs.length<=64)return!1;let{codeHash:n,hashType:r}=await t.getKnownScript(`NervosDao`),i=B.from({codeHash:n,hashType:r,args:`0x`});if(e.outputs.some(e=>e.type?.eq(i)))return!0;for(let n of e.inputs)if(await n.completeExtraInfos(t),n.cellOutput?.type?.eq(i))return!0;return!1}function Hn(e,t,n){let r=F.from(t),i=F.from(n),a=_(e);return a*i.dao.ar/r.dao.ar-a}function Un(e,t){let n=F.from(e).epoch.normalizeBase(),r=F.from(t).epoch.normalizeBase(),i=_(180),a=(r.integer-n.integer)%i,o=r.integer;return(a!==0n||n.numerator*r.denominator<=r.numerator*n.denominator)&&(o+=-a+i),N.from([o,n.numerator,n.denominator])}function Wn(n){try{let{words:e,prefix:r}=t.decode(n,qn),i=t.fromWords(e),a=i[0],o=i.slice(1);if(a===0)return{prefix:r,format:0,payload:o}}catch{}try{let{prefix:t,words:r}=e.decode(n,qn),i=e.fromWords(r),a=i[0],o=i.slice(1);if([2,4,1].includes(a))return{prefix:t,format:a,payload:o}}catch{}throw Error(`Unknown address format ${n}`)}async function Gn(e,t,n,r){if(t===0){if(n.length<33)throw Error(`Invalid full address without enough payload ${f(n)}`);return{script:{codeHash:n.slice(0,32),hashType:vn(n.slice(32,33)),args:n.slice(33)},prefix:e}}if(t===2){if(n.length<32)throw Error(`Invalid full data address without enough payload ${f(n)}`);return{script:{codeHash:n.slice(0,32),hashType:`data`,args:n.slice(32)},prefix:e}}if(t===4){if(n.length<32)throw Error(`Invalid full type address without enough payload ${f(n)}`);return{script:{codeHash:n.slice(0,32),hashType:`type`,args:n.slice(32)},prefix:e}}if(n.length!==21)throw Error(`Invalid short address without enough payload ${f(n)}`);let i=[`Secp256k1Blake160`,`Secp256k1Multisig`,`AnyoneCanPay`][n[0]];if(i===void 0)throw Error(`Invalid short address with unknown script ${f(n)}`);return{script:await B.fromKnownScript(r,i,n.slice(1)),prefix:e}}let Kn=function(e){return e[e.Full=0]=`Full`,e[e.Short=1]=`Short`,e[e.FullData=2]=`FullData`,e[e.FullType=4]=`FullType`,e}({});const qn=1023;export{en as $,b as $n,$e as $t,Sn as A,Ce as An,kt as At,mn as B,Le as Bn,yt as Bt,Pn as C,Ve as Cn,o as Cr,Pt as Ct,wn as D,Me as Dn,Mt as Dt,V as E,ve as En,c as Er,A as Et,z as F,Ne as Fn,St as Ft,cn as G,be as Gn,dt as Gt,dn as H,ke as Hn,ht as Ht,vn as I,Ee as In,Ct as It,an as J,S as Jn,Dt as Jt,sn as K,_e as Kn,ft as Kt,_n as L,Te as Ln,wt as Lt,B as M,xe as Mn,pt as Mt,yn as N,Fe as Nn,mt as Nt,Cn as O,je as On,At as Ot,bn as P,Pe as Pn,xt as Pt,$t as Q,y as Qn,Qe as Qt,hn as R,we as Rn,_t as Rt,Fn as S,C as Sn,s as Sr,Nt as St,Q as T,ye as Tn,l as Tr,j as Tt,un as U,Oe as Un,gt as Ut,fn as V,Ie as Vn,bt as Vt,ln as W,De as Wn,ut as Wt,rn as X,he as Xn,it as Xt,Qt as Y,ge as Yn,Et as Yt,nn as Z,_ as Zn,at as Zt,$ as _,qe as _n,te as _r,zt as _t,Ln as a,lt as an,ue as ar,Wt as at,Hn as b,Be as bn,d as br,P as bt,zn as c,Xe as cn,le as cr,Ut as ct,K as d,Ke as dn,ie as dr,Jt as dt,ot as en,me as er,L as et,In as f,Ge as fn,ae as fr,Zt as ft,J as g,k as gn,re as gr,Xt as gt,Bn as h,Je as hn,ce as hr,qt as ht,Wn as i,ct as in,v as ir,F as it,gn as j,Se as jn,jt,xn as k,Ae as kn,Ot as kt,Y as l,Ze as ln,p as lr,Bt as lt,G as m,O as mn,se as mr,Kt as mt,Kn as n,et as nn,de as nr,Rt as nt,q as o,nt as on,g as or,Ht as ot,Mn as p,We as pn,oe as pr,Yt as pt,on as q,x as qn,Tt as qt,Gn as r,tt as rn,pe as rr,Gt as rt,X as s,rt as sn,h as sr,Vt as st,qn as t,st as tn,fe as tr,tn as tt,Rn as u,Ye as un,m as ur,I as ut,Z as v,D as vn,ne as vr,It as vt,Vn as w,He as wn,u as wr,Ft as wt,Nn as x,Ue as xn,a as xr,N as xt,Un as y,ze as yn,f as yr,Lt as yt,pn as z,Re as zn,vt as zt};
|
|
2
|
-
//# sourceMappingURL=address.advanced-DpcI420e.mjs.map
|