@ckb-ccc/spore 1.5.18 → 1.6.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.
Files changed (221) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/advanced.d.mts +3 -0
  3. package/dist/advanced.mjs +1 -0
  4. package/dist/advancedBarrel.d.mts +30 -0
  5. package/dist/advancedBarrel.d.mts.map +1 -0
  6. package/dist/advancedBarrel.mjs +1 -0
  7. package/dist/barrel-C4fV1nUf.mjs +2 -0
  8. package/dist/barrel-C4fV1nUf.mjs.map +1 -0
  9. package/dist/barrel-Cqgd-hM0.d.mts +324 -0
  10. package/dist/barrel-Cqgd-hM0.d.mts.map +1 -0
  11. package/dist/barrel.d.mts +3 -0
  12. package/dist/barrel.mjs +1 -0
  13. package/dist/cluster-KsFIhwZx.mjs +2 -0
  14. package/dist/cluster-KsFIhwZx.mjs.map +1 -0
  15. package/dist/index.d.mts +3 -0
  16. package/dist/index.mjs +1 -0
  17. package/dist/rolldown-runtime-DK3Fl9T5.mjs +1 -0
  18. package/dist/types-DRzFzVRX.d.mts +1048 -0
  19. package/dist/types-DRzFzVRX.d.mts.map +1 -0
  20. package/dist.commonjs/advanced.d.ts +3 -3
  21. package/dist.commonjs/advanced.js +1 -41
  22. package/dist.commonjs/advancedBarrel.d.ts +29 -4
  23. package/dist.commonjs/advancedBarrel.d.ts.map +1 -1
  24. package/dist.commonjs/advancedBarrel.js +1 -20
  25. package/dist.commonjs/barrel-Dj4BYAYE.d.ts +324 -0
  26. package/dist.commonjs/barrel-Dj4BYAYE.d.ts.map +1 -0
  27. package/dist.commonjs/barrel-Dj_LwfvL.js +2 -0
  28. package/dist.commonjs/barrel-Dj_LwfvL.js.map +1 -0
  29. package/dist.commonjs/barrel.d.ts +3 -5
  30. package/dist.commonjs/barrel.js +1 -43
  31. package/dist.commonjs/cluster-CGo0DCM9.js +2 -0
  32. package/dist.commonjs/cluster-CGo0DCM9.js.map +1 -0
  33. package/dist.commonjs/index.d.ts +3 -3
  34. package/dist.commonjs/index.js +1 -41
  35. package/dist.commonjs/types-C1N7Mdzo.d.ts +1050 -0
  36. package/dist.commonjs/types-C1N7Mdzo.d.ts.map +1 -0
  37. package/package.json +30 -33
  38. package/tsdown.config.mts +43 -0
  39. package/dist/advanced.d.ts +0 -3
  40. package/dist/advanced.d.ts.map +0 -1
  41. package/dist/advanced.js +0 -2
  42. package/dist/advancedBarrel.d.ts +0 -5
  43. package/dist/advancedBarrel.d.ts.map +0 -1
  44. package/dist/advancedBarrel.js +0 -4
  45. package/dist/barrel.d.ts +0 -5
  46. package/dist/barrel.d.ts.map +0 -1
  47. package/dist/barrel.js +0 -4
  48. package/dist/cluster/index.d.ts +0 -95
  49. package/dist/cluster/index.d.ts.map +0 -1
  50. package/dist/cluster/index.js +0 -165
  51. package/dist/cobuild/index.d.ts +0 -12
  52. package/dist/cobuild/index.d.ts.map +0 -1
  53. package/dist/cobuild/index.js +0 -167
  54. package/dist/codec/cluster.d.ts +0 -34
  55. package/dist/codec/cluster.d.ts.map +0 -1
  56. package/dist/codec/cluster.js +0 -62
  57. package/dist/codec/cobuild/buildingPacket.d.ts +0 -268
  58. package/dist/codec/cobuild/buildingPacket.d.ts.map +0 -1
  59. package/dist/codec/cobuild/buildingPacket.js +0 -33
  60. package/dist/codec/cobuild/index.d.ts +0 -4
  61. package/dist/codec/cobuild/index.d.ts.map +0 -1
  62. package/dist/codec/cobuild/index.js +0 -3
  63. package/dist/codec/cobuild/sporeAction.d.ts +0 -589
  64. package/dist/codec/cobuild/sporeAction.d.ts.map +0 -1
  65. package/dist/codec/cobuild/sporeAction.js +0 -90
  66. package/dist/codec/cobuild/witnessLayout.d.ts +0 -126
  67. package/dist/codec/cobuild/witnessLayout.d.ts.map +0 -1
  68. package/dist/codec/cobuild/witnessLayout.js +0 -26
  69. package/dist/codec/index.d.ts +0 -4
  70. package/dist/codec/index.d.ts.map +0 -1
  71. package/dist/codec/index.js +0 -3
  72. package/dist/codec/spore.d.ts +0 -10
  73. package/dist/codec/spore.d.ts.map +0 -1
  74. package/dist/codec/spore.js +0 -16
  75. package/dist/dob/api/decode.d.ts +0 -8
  76. package/dist/dob/api/decode.d.ts.map +0 -1
  77. package/dist/dob/api/decode.js +0 -63
  78. package/dist/dob/api/encode.d.ts +0 -5
  79. package/dist/dob/api/encode.d.ts.map +0 -1
  80. package/dist/dob/api/encode.js +0 -81
  81. package/dist/dob/api/index.d.ts +0 -3
  82. package/dist/dob/api/index.d.ts.map +0 -1
  83. package/dist/dob/api/index.js +0 -2
  84. package/dist/dob/config/index.d.ts +0 -2
  85. package/dist/dob/config/index.d.ts.map +0 -1
  86. package/dist/dob/config/index.js +0 -1
  87. package/dist/dob/config/predefined.d.ts +0 -8
  88. package/dist/dob/config/predefined.d.ts.map +0 -1
  89. package/dist/dob/config/predefined.js +0 -59
  90. package/dist/dob/helper/check.d.ts +0 -5
  91. package/dist/dob/helper/check.d.ts.map +0 -1
  92. package/dist/dob/helper/check.js +0 -75
  93. package/dist/dob/helper/error.d.ts +0 -2
  94. package/dist/dob/helper/error.d.ts.map +0 -1
  95. package/dist/dob/helper/error.js +0 -40
  96. package/dist/dob/helper/index.d.ts +0 -4
  97. package/dist/dob/helper/index.d.ts.map +0 -1
  98. package/dist/dob/helper/index.js +0 -3
  99. package/dist/dob/helper/object.d.ts +0 -59
  100. package/dist/dob/helper/object.d.ts.map +0 -1
  101. package/dist/dob/helper/object.js +0 -1
  102. package/dist/dob/index.d.ts +0 -4
  103. package/dist/dob/index.d.ts.map +0 -1
  104. package/dist/dob/index.js +0 -3
  105. package/dist/helper/index.d.ts +0 -7
  106. package/dist/helper/index.d.ts.map +0 -1
  107. package/dist/helper/index.js +0 -18
  108. package/dist/index.d.ts +0 -3
  109. package/dist/index.d.ts.map +0 -1
  110. package/dist/index.js +0 -2
  111. package/dist/predefined/advanced.d.ts +0 -3
  112. package/dist/predefined/advanced.d.ts.map +0 -1
  113. package/dist/predefined/advanced.js +0 -2
  114. package/dist/predefined/index.d.ts +0 -3
  115. package/dist/predefined/index.d.ts.map +0 -1
  116. package/dist/predefined/index.js +0 -2
  117. package/dist/predefined/mainnet.advanced.d.ts +0 -4
  118. package/dist/predefined/mainnet.advanced.d.ts.map +0 -1
  119. package/dist/predefined/mainnet.advanced.js +0 -61
  120. package/dist/predefined/testnet.advanced.d.ts +0 -4
  121. package/dist/predefined/testnet.advanced.d.ts.map +0 -1
  122. package/dist/predefined/testnet.advanced.js +0 -88
  123. package/dist/predefined/types.d.ts +0 -17
  124. package/dist/predefined/types.d.ts.map +0 -1
  125. package/dist/predefined/types.js +0 -18
  126. package/dist/predefined/utils.d.ts +0 -7
  127. package/dist/predefined/utils.d.ts.map +0 -1
  128. package/dist/predefined/utils.js +0 -26
  129. package/dist/spore/advanced.d.ts +0 -4
  130. package/dist/spore/advanced.d.ts.map +0 -1
  131. package/dist/spore/advanced.js +0 -54
  132. package/dist/spore/index.d.ts +0 -129
  133. package/dist/spore/index.d.ts.map +0 -1
  134. package/dist/spore/index.js +0 -218
  135. package/dist.commonjs/advanced.d.ts.map +0 -1
  136. package/dist.commonjs/barrel.d.ts.map +0 -1
  137. package/dist.commonjs/cluster/index.d.ts +0 -95
  138. package/dist.commonjs/cluster/index.d.ts.map +0 -1
  139. package/dist.commonjs/cluster/index.js +0 -173
  140. package/dist.commonjs/cobuild/index.d.ts +0 -12
  141. package/dist.commonjs/cobuild/index.d.ts.map +0 -1
  142. package/dist.commonjs/cobuild/index.js +0 -178
  143. package/dist.commonjs/codec/cluster.d.ts +0 -34
  144. package/dist.commonjs/codec/cluster.d.ts.map +0 -1
  145. package/dist.commonjs/codec/cluster.js +0 -71
  146. package/dist.commonjs/codec/cobuild/buildingPacket.d.ts +0 -268
  147. package/dist.commonjs/codec/cobuild/buildingPacket.d.ts.map +0 -1
  148. package/dist.commonjs/codec/cobuild/buildingPacket.js +0 -36
  149. package/dist.commonjs/codec/cobuild/index.d.ts +0 -4
  150. package/dist.commonjs/codec/cobuild/index.d.ts.map +0 -1
  151. package/dist.commonjs/codec/cobuild/index.js +0 -19
  152. package/dist.commonjs/codec/cobuild/sporeAction.d.ts +0 -589
  153. package/dist.commonjs/codec/cobuild/sporeAction.d.ts.map +0 -1
  154. package/dist.commonjs/codec/cobuild/sporeAction.js +0 -93
  155. package/dist.commonjs/codec/cobuild/witnessLayout.d.ts +0 -126
  156. package/dist.commonjs/codec/cobuild/witnessLayout.d.ts.map +0 -1
  157. package/dist.commonjs/codec/cobuild/witnessLayout.js +0 -29
  158. package/dist.commonjs/codec/index.d.ts +0 -4
  159. package/dist.commonjs/codec/index.d.ts.map +0 -1
  160. package/dist.commonjs/codec/index.js +0 -19
  161. package/dist.commonjs/codec/spore.d.ts +0 -10
  162. package/dist.commonjs/codec/spore.d.ts.map +0 -1
  163. package/dist.commonjs/codec/spore.js +0 -21
  164. package/dist.commonjs/dob/api/decode.d.ts +0 -8
  165. package/dist.commonjs/dob/api/decode.d.ts.map +0 -1
  166. package/dist.commonjs/dob/api/decode.js +0 -70
  167. package/dist.commonjs/dob/api/encode.d.ts +0 -5
  168. package/dist.commonjs/dob/api/encode.d.ts.map +0 -1
  169. package/dist.commonjs/dob/api/encode.js +0 -86
  170. package/dist.commonjs/dob/api/index.d.ts +0 -3
  171. package/dist.commonjs/dob/api/index.d.ts.map +0 -1
  172. package/dist.commonjs/dob/api/index.js +0 -18
  173. package/dist.commonjs/dob/config/index.d.ts +0 -2
  174. package/dist.commonjs/dob/config/index.d.ts.map +0 -1
  175. package/dist.commonjs/dob/config/index.js +0 -17
  176. package/dist.commonjs/dob/config/predefined.d.ts +0 -8
  177. package/dist.commonjs/dob/config/predefined.d.ts.map +0 -1
  178. package/dist.commonjs/dob/config/predefined.js +0 -63
  179. package/dist.commonjs/dob/helper/check.d.ts +0 -5
  180. package/dist.commonjs/dob/helper/check.d.ts.map +0 -1
  181. package/dist.commonjs/dob/helper/check.js +0 -80
  182. package/dist.commonjs/dob/helper/error.d.ts +0 -2
  183. package/dist.commonjs/dob/helper/error.d.ts.map +0 -1
  184. package/dist.commonjs/dob/helper/error.js +0 -43
  185. package/dist.commonjs/dob/helper/index.d.ts +0 -4
  186. package/dist.commonjs/dob/helper/index.d.ts.map +0 -1
  187. package/dist.commonjs/dob/helper/index.js +0 -19
  188. package/dist.commonjs/dob/helper/object.d.ts +0 -59
  189. package/dist.commonjs/dob/helper/object.d.ts.map +0 -1
  190. package/dist.commonjs/dob/helper/object.js +0 -2
  191. package/dist.commonjs/dob/index.d.ts +0 -4
  192. package/dist.commonjs/dob/index.d.ts.map +0 -1
  193. package/dist.commonjs/dob/index.js +0 -19
  194. package/dist.commonjs/helper/index.d.ts +0 -7
  195. package/dist.commonjs/helper/index.d.ts.map +0 -1
  196. package/dist.commonjs/helper/index.js +0 -21
  197. package/dist.commonjs/index.d.ts.map +0 -1
  198. package/dist.commonjs/predefined/advanced.d.ts +0 -3
  199. package/dist.commonjs/predefined/advanced.d.ts.map +0 -1
  200. package/dist.commonjs/predefined/advanced.js +0 -18
  201. package/dist.commonjs/predefined/index.d.ts +0 -3
  202. package/dist.commonjs/predefined/index.d.ts.map +0 -1
  203. package/dist.commonjs/predefined/index.js +0 -18
  204. package/dist.commonjs/predefined/mainnet.advanced.d.ts +0 -4
  205. package/dist.commonjs/predefined/mainnet.advanced.d.ts.map +0 -1
  206. package/dist.commonjs/predefined/mainnet.advanced.js +0 -64
  207. package/dist.commonjs/predefined/testnet.advanced.d.ts +0 -4
  208. package/dist.commonjs/predefined/testnet.advanced.d.ts.map +0 -1
  209. package/dist.commonjs/predefined/testnet.advanced.js +0 -91
  210. package/dist.commonjs/predefined/types.d.ts +0 -17
  211. package/dist.commonjs/predefined/types.d.ts.map +0 -1
  212. package/dist.commonjs/predefined/types.js +0 -22
  213. package/dist.commonjs/predefined/utils.d.ts +0 -7
  214. package/dist.commonjs/predefined/utils.d.ts.map +0 -1
  215. package/dist.commonjs/predefined/utils.js +0 -32
  216. package/dist.commonjs/spore/advanced.d.ts +0 -4
  217. package/dist.commonjs/spore/advanced.d.ts.map +0 -1
  218. package/dist.commonjs/spore/advanced.js +0 -57
  219. package/dist.commonjs/spore/index.d.ts +0 -129
  220. package/dist.commonjs/spore/index.d.ts.map +0 -1
  221. package/dist.commonjs/spore/index.js +0 -227
@@ -1,43 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.dob = void 0;
40
- __exportStar(require("./cluster/index.js"), exports);
41
- exports.dob = __importStar(require("./dob/index.js"));
42
- __exportStar(require("./predefined/index.js"), exports);
43
- __exportStar(require("./spore/index.js"), exports);
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./cluster-CGo0DCM9.js"),t=require("./barrel-Dj_LwfvL.js");exports.DEFAULT_COBUILD_INFO_HASH=e.D,exports.SPORE_VERSION_DEFAULT=e.O,exports.SporeScriptInfo=e.k,exports.SporeVersion=e.A,exports.assertCluster=e.t,exports.assertSpore=t.n,exports.createSpore=t.r,exports.createSporeCluster=e.n,Object.defineProperty(exports,"dob",{enumerable:!0,get:function(){return t.l}}),exports.findCluster=e.r,exports.findSpore=t.i,exports.findSporeClusters=e.i,exports.findSporeClustersBySigner=e.a,exports.findSpores=t.a,exports.findSporesBySigner=t.o,exports.getClusterScriptInfo=e.y,exports.getClusterScriptInfos=e.b,exports.getSporeScriptInfo=e.x,exports.getSporeScriptInfos=e.S,exports.meltSpore=t.s,exports.transferSpore=t.c,exports.transferSporeCluster=e.o;
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};let n=require("@ckb-ccc/core");const r=n.mol.table({name:n.mol.String,description:n.mol.String}),i=n.mol.table({name:n.mol.String,description:n.mol.String,mutantId:n.mol.BytesOpt}),a=i;function o(e,t){if(!t)return c(e);switch(t){case`v1`:return s(e);case`v2`:return c(e)}}function s(e){return n.ccc.bytesFrom(r.encode({name:e.name,description:e.description}))}function c(e){return n.ccc.bytesFrom(i.encode({name:e.name,description:e.description,mutantId:e.mutantId}))}function l(e,t){if(t)switch(t){case`v1`:return u(e);case`v2`:return d(e)}try{return d(e)}catch{try{return u(e)}catch{throw Error(`Cannot unpack ClusterData, no matching molecule: ${n.ccc.hexFrom(e)}`)}}}function u(e){return r.decode(e)}function d(e){return i.decode(e)}const f=n.mol.table({scriptInfoHash:n.mol.Byte32,scriptHash:n.mol.Byte32,data:n.mol.Bytes}),p=n.mol.vector(f),m=n.mol.table({actions:p}),h=n.mol.table({outputs:n.ccc.CellOutputVec,outputsData:n.mol.BytesVec}),g=n.mol.table({name:n.mol.String,url:n.mol.String,scriptHash:n.mol.Byte32,schema:n.mol.String,messageType:n.mol.String}),_=n.mol.vector(g),v=n.mol.table({message:m,payload:n.ccc.Transaction,resolvedInputs:h,changeOutput:n.mol.Uint32Opt,scriptInfos:_,lockActions:p}),ee=n.mol.union({BuildingPacketV1:v}),y=n.mol.union({Script:n.ccc.Script}),b=n.mol.table({sporeId:n.mol.Byte32,to:y,dataHash:n.mol.Byte32}),x=n.mol.table({sporeId:n.mol.Byte32,from:y,to:y}),S=n.mol.table({sporeId:n.mol.Byte32,from:y}),C=n.mol.table({clusterId:n.mol.Byte32,to:y,dataHash:n.mol.Byte32}),w=n.mol.table({clusterId:n.mol.Byte32,from:y,to:y}),T=n.mol.table({clusterId:n.mol.Byte32,clusterProxyId:n.mol.Byte32,to:y}),E=n.mol.table({clusterId:n.mol.Byte32,clusterProxyId:n.mol.Byte32,from:y,to:y}),D=n.mol.table({clusterId:n.mol.Byte32,clusterProxyId:n.mol.Byte32,from:y}),O=n.mol.table({clusterId:n.mol.Byte32,clusterProxyId:n.mol.Byte32,to:y}),k=n.mol.table({clusterId:n.mol.Byte32,from:y,to:y}),A=n.mol.table({clusterId:n.mol.Byte32,from:y}),j=n.mol.union({CreateSpore:b,TransferSpore:x,MeltSpore:S,CreateCluster:C,TransferCluster:w,CreateClusterProxy:T,TransferClusterProxy:E,MeltClusterProxy:D,CreateClusterAgent:O,TransferClusterAgent:k,MeltClusterAgent:A}),M=n.mol.table({seal:n.mol.Bytes,message:m}),N=n.mol.table({seal:n.mol.Bytes}),P=n.mol.table({}),F=n.mol.table({}),I={SighashAll:4278190081,SighashAllOnly:4278190082,Otx:4278190083,OtxStart:4278190084},L=n.mol.union({SighashAll:M,SighashAllOnly:N,Otx:P,OtxStart:F},I),R=n.mol.table({contentType:n.mol.String,content:n.mol.Bytes,clusterId:n.mol.BytesOpt});function te(e){return n.ccc.bytesFrom(R.encode({contentType:e.contentType,content:e.content,clusterId:e.clusterId}))}function ne(e){return R.decode(e)}const z=n.ccc.hashCkb(n.ccc.bytesFrom(`CCC_DEFAULT_COBUILD_INFO`,`utf8`));let re=function(e){return e.V1=`V1`,e.V2=`V2`,e.DID=`DID`,e}({});var B=class e extends n.ccc.ScriptInfo{constructor(e,t,n,r){super(e,t,n),this.cobuild=r}static from(t){return new e(n.ccc.hexFrom(t.codeHash),n.ccc.hashTypeFrom(t.hashType),t.cellDeps.map(e=>n.ccc.CellDepInfo.from(e)),t.cobuild)}};const V=Object.freeze({DID:{codeHash:`0xcfba73b58b6f30e70caed8a999748781b164ef9a1e218424a6fb55ebf641cb33`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x37c80ba8124780920bc8fe06b49e3535b43ca339bb9a97fb462b16d575bfa9a6`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x62312cd846659e188b05da11dc3f080b083c27371ea701d6026e11e713e0e3de`}}],cobuild:!0},V2:{codeHash:`0x4a4dce1df3dffff7f8b2cd7dff7303df3b6150c9788cb75dcf6747247132b9f5`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x96b198fb5ddbd1eed57ed667068f1f1e55d07907b4c0dbd38675a69ea1b69824`,index:0},depType:`code`}}],cobuild:!0},V1:void 0}),H=Object.freeze({V2:{codeHash:`0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938`,index:0},depType:`code`}}],cobuild:!0},V1:void 0,DID:void 0}),U=Object.freeze({DID:{codeHash:`0x0b1f412fbae26853ff7d082d422c2bdd9e2ff94ee8aaec11240a5b34cc6e890f`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x306961e0eb04ed972c60cb89a0aed1b0ef065d96d2fc0000c62db5275e32dc6f`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x80f0d4bf6b3951911aa6b98cc609d477a8a10b903b35cfd528d098e95c36f680`}}]},V2:{codeHash:`0x685a60219309029d01310311dba953d67029170ca4848a4ff638e57002130a0d`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x5e8d2a517d50fd4bb4d01737a7952a1f1d35c8afc77240695bb569cd7d9d5a1f`,index:0},depType:`code`}}],cobuild:!0},V1:{codeHash:`0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xfd694382e621f175ddf81ce91ce2ecf8bfc027d53d7d31b8438f7d26fc37fd19`,index:0},depType:`code`}}]}}),W=Object.freeze({V2:{codeHash:`0x0bbe768b519d8ea7b96d58f1182eb7e6ef96c541fbd9526975077ee09f049058`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xcebb174d6e300e26074aea2f5dbd7f694bb4fe3de52b6dfe205e54f90164510a`,index:0},depType:`code`}}],cobuild:!0},V1:{codeHash:`0x598d793defef36e2eeba54a9b45130e4ca92822e1d193671f490950c3b856080`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x49551a20dfe39231e7db49431d26c9c08ceec96a29024eef3acc936deeb2ca76`,index:0},depType:`code`}}]},DID:void 0});function ie(e){return e.addressPrefix===`ckb`?V:U}function G(e){return e.addressPrefix===`ckb`?H:W}function ae(e,t){let n=ie(e)[t??`V2`];if(!n)throw Error(`Spore script info not found of for version ${t} on ${e.addressPrefix}`);return B.from(n)}function oe(e,t){let n=G(e)[t??`V2`];if(!n)throw Error(`Cluster script info not found of for version ${t} on ${e.addressPrefix}`);return B.from(n)}function K(e,t,r=z){if(!e.type)throw Error(`Spore cell must have a type script`);let i=n.ccc.Script.from(e.type),a=i.hash(),o=j.encode({type:`CreateSpore`,value:{sporeId:i.args,to:{type:`Script`,value:e.lock},dataHash:n.ccc.hashCkb(t)}});return{scriptInfoHash:n.ccc.hexFrom(r),scriptHash:a,data:n.ccc.hexFrom(o)}}function se(e,t,r=z){if(!e.type||!t.type)throw Error(`Spore cell must have a type script`);let i=n.ccc.Script.from(t.type),a=i.hash(),o=j.encode({type:`TransferSpore`,value:{sporeId:i.args,from:{type:`Script`,value:e.lock},to:{type:`Script`,value:t.lock}}});return{scriptInfoHash:n.ccc.hexFrom(r),scriptHash:a,data:n.ccc.hexFrom(o)}}function ce(e,t=z){if(!e.type)throw Error(`Spore cell must have a type script`);let r=n.ccc.Script.from(e.type),i=r.hash(),a=j.encode({type:`MeltSpore`,value:{sporeId:r.args,from:{type:`Script`,value:e.lock}}});return{scriptInfoHash:n.ccc.hexFrom(t),scriptHash:i,data:n.ccc.hexFrom(a)}}function q(e,t,r=z){if(!e.type)throw Error(`Cluster cell must have a type script`);let i=n.ccc.Script.from(e.type),a=i.hash(),o=j.encode({type:`CreateCluster`,value:{clusterId:i.args,to:{type:`Script`,value:e.lock},dataHash:n.ccc.hashCkb(t)}});return{scriptInfoHash:n.ccc.hexFrom(r),scriptHash:a,data:n.ccc.hexFrom(o)}}function J(e,t,r=z){if(!e.type||!t.type)throw Error(`Cluster cell must have a type script`);let i=n.ccc.Script.from(t.type),a=i.hash(),o=j.encode({type:`TransferCluster`,value:{clusterId:i.args,from:{type:`Script`,value:e.lock},to:{type:`Script`,value:t.lock}}});return{scriptInfoHash:n.ccc.hexFrom(r),scriptHash:a,data:n.ccc.hexFrom(o)}}async function Y(e,t,r){let i=n.ccc.Transaction.from(t);if(r.length===0)return e.prepareTransaction(i);let a=Z(i);return i=await e.prepareTransaction(i),Q(i,[a,r].flat()),i}function X(e){try{return L.decode(n.ccc.bytesFrom(e))}catch{return}}function Z(e){if(e.witnesses.length===0)return[];let t=X(e.witnesses[e.witnesses.length-1]);if(!t)return[];if(t.type!==`SighashAll`)throw Error(`Invalid cobuild proof type: SighashAll`);return e.witnesses.pop(),t.value.message.actions}function Q(e,t){e.setWitnessAt(Math.max(e.witnesses.length,e.inputs.length),L.encode({type:`SighashAll`,value:{seal:`0x`,message:{actions:t}}}))}async function le(e,t,r,i,a){if(!r.clusterId||i===`skip`)return;if(!i)throw Error(`clusterMode is undefined but the spore has a cluster`);let{cell:o,scriptInfo:s}=await $(e.client,r.clusterId);switch(i){case`lockProxy`:{let r=o.cellOutput.lock,i=await t.findInputIndexByLock(r,e.client);if(i===void 0&&(await t.completeInputsAddOne(new n.ccc.SignerCkbScriptReadonly(e.client,r)),i=await t.findInputIndexByLock(r,e.client),i===void 0))throw Error(`Lock proxy input not found`);t.outputs.some(e=>e.lock===r)||t.addOutput(await t.getInput(i).getCell(e.client)),t.addCellDeps({outPoint:o.outPoint,depType:`code`});return}case`clusterCell`:return t.inputs.some(e=>e.previousOutput.eq(o.outPoint))?void 0:(t.addInput(o),t.addOutput(o.cellOutput,o.outputData),await t.addCellDepInfos(e.client,s.cellDeps),t.addCellDeps({outPoint:o.outPoint,depType:`code`}),s.cobuild?J(o.cellOutput,o.cellOutput,a):void 0)}}var ue=t({Action:()=>f,ActionVec:()=>p,Address:()=>y,BuildingPacket:()=>ee,BuildingPacketV1:()=>v,ClusterData:()=>a,ClusterDataV1:()=>r,ClusterDataV2:()=>i,CreateCluster:()=>C,CreateClusterAgent:()=>O,CreateClusterProxy:()=>T,CreateSpore:()=>b,MeltClusterAgent:()=>A,MeltClusterProxy:()=>D,MeltSpore:()=>S,Message:()=>m,Otx:()=>P,OtxStart:()=>F,ResolvedInputs:()=>h,SCRIPTS_CLUSTER_MAINNET:()=>H,SCRIPTS_CLUSTER_TESTNET:()=>W,SCRIPTS_SPORE_MAINNET:()=>V,SCRIPTS_SPORE_TESTNET:()=>U,ScriptInfo:()=>g,ScriptInfoVec:()=>_,SighashAll:()=>M,SighashAllOnly:()=>N,SporeAction:()=>j,SporeData:()=>R,TransferCluster:()=>w,TransferClusterAgent:()=>k,TransferClusterProxy:()=>E,TransferSpore:()=>x,WitnessLayout:()=>L,WitnessLayoutFieldTags:()=>I,assembleCreateClusterAction:()=>q,assembleCreateSporeAction:()=>K,assembleMeltSporeAction:()=>ce,assembleTransferClusterAction:()=>J,assembleTransferSporeAction:()=>se,extractCobuildActionsFromTx:()=>Z,injectCobuild:()=>Q,packRawClusterData:()=>o,packRawClusterDataV1:()=>s,packRawClusterDataV2:()=>c,packRawSporeData:()=>te,prepareCluster:()=>le,prepareSporeTransaction:()=>Y,unpackCommonCobuildProof:()=>X,unpackToRawClusterData:()=>l,unpackToRawClusterDataV1:()=>u,unpackToRawClusterDataV2:()=>d,unpackToRawSporeData:()=>ne});async function de(e,t,n){for(let r of n){if(!r)continue;let n=await e.findSingletonCellByType({...r,args:t},!0);if(n)return{cell:n,scriptInfo:B.from(r)}}}async function fe(e,t,n){let r=await de(e,t,n??Object.values(G(e)));if(r)return{cell:r.cell,cluster:r.cell,clusterData:l(r.cell.outputData),scriptInfo:r.scriptInfo}}async function $(e,t,r){let i=await fe(e,t,r);if(!i)throw Error(`Cluster ${n.ccc.hexFrom(t)} not found`);return i}async function pe(e){let{signer:t,data:r,to:i,scriptInfoHash:a}=e,s=e.scriptInfo??oe(t.client),c=n.ccc.Transaction.from(e.tx??{});await c.completeInputsAtLeastOne(t);let l=n.ccc.hashTypeId(c.inputs[0],c.outputs.length),u=o(r);return c.addOutput({lock:i??(await t.getRecommendedAddressObj()).script,type:{...s,args:l}},u),await c.addCellDepInfos(t.client,s.cellDeps),{tx:await Y(t,c,s.cobuild?[q(c.outputs[c.outputs.length-1],u,a)]:[]),id:l}}async function me(e){let{signer:t,id:r,to:i,scripts:a,scriptInfoHash:o}=e,s=n.ccc.Transaction.from(e.tx??{}),{cell:c,scriptInfo:l}=await $(t.client,r,a);return s.addInput(c),s.addOutput({lock:i,type:c.cellOutput.type},c.outputData),await s.addCellDepInfos(t.client,l.cellDeps),{tx:await Y(t,s,l.cobuild?[J(c.cellOutput,s.outputs[s.outputs.length-1],o)]:[])}}async function*he(e){let{signer:t,order:n,limit:r,scriptInfos:i}=e;for(let e of i??Object.values(G(t.client)))if(e)for await(let i of t.findCells({script:{...e,args:``}},!0,n,r))yield{cell:i,cluster:i,clusterData:l(i.outputData),scriptInfo:B.from(e)}}async function*ge(e){let{client:t,lock:n,order:r,limit:i,scriptInfos:a}=e;for(let e of a??Object.values(G(t)))if(e)for await(let a of t.findCells({script:{...e,args:``},scriptType:`type`,scriptSearchMode:`prefix`,withData:!0,filter:n?{script:n}:void 0},r,i))yield{cell:a,cluster:a,clusterData:l(a.outputData),scriptInfo:B.from(e)}}Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return`V2`}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return I}});
2
+ //# sourceMappingURL=cluster-CGo0DCM9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cluster-CGo0DCM9.js","names":["mol","ccc","mol","ccc","mol","ccc","mol","mol","ccc","ccc","ccc","ccc","ccc"],"sources":["../src/codec/cluster.ts","../src/codec/cobuild/buildingPacket.ts","../src/codec/cobuild/sporeAction.ts","../src/codec/cobuild/witnessLayout.ts","../src/codec/spore.ts","../src/predefined/types.ts","../src/predefined/mainnet.advanced.ts","../src/predefined/testnet.advanced.ts","../src/predefined/utils.ts","../src/cobuild/index.ts","../src/spore/advanced.ts","../src/advancedBarrel.ts","../src/helper/index.ts","../src/cluster/index.ts"],"sourcesContent":["import { ccc, mol } from \"@ckb-ccc/core\";\n\nexport interface ClusterDataV1View {\n name: string;\n description: string;\n}\n\nexport const ClusterDataV1: ccc.Codec<ClusterDataV1View> = mol.table({\n name: mol.String,\n description: mol.String,\n});\n\nexport interface ClusterDataV2View {\n name: string;\n description: string;\n mutantId?: ccc.HexLike;\n}\n\nexport const ClusterDataV2: ccc.Codec<ClusterDataV2View> = mol.table({\n name: mol.String,\n description: mol.String,\n mutantId: mol.BytesOpt,\n});\n\nexport type ClusterDataView = ClusterDataV2View;\n\nexport type ClusterDataVersion = \"v1\" | \"v2\";\n\nexport const ClusterData = ClusterDataV2;\n\n/**\n * Pack RawClusterData to Uint8Array.\n * Pass an optional \"version\" field to select a specific packing version.\n */\nexport function packRawClusterData(packable: ClusterDataView): Uint8Array;\nexport function packRawClusterData(\n packable: ClusterDataV1View,\n version: \"v1\",\n): Uint8Array;\nexport function packRawClusterData(\n packable: ClusterDataV2View,\n version: \"v2\",\n): Uint8Array;\nexport function packRawClusterData(\n packable: ClusterDataV1View | ClusterDataV2View,\n version?: ClusterDataVersion,\n): Uint8Array {\n if (!version) {\n return packRawClusterDataV2(packable);\n }\n switch (version) {\n case \"v1\":\n return packRawClusterDataV1(packable);\n case \"v2\":\n return packRawClusterDataV2(packable);\n }\n}\n\nexport function packRawClusterDataV1(packable: ClusterDataV1View): Uint8Array {\n return ccc.bytesFrom(\n ClusterDataV1.encode({\n name: packable.name,\n description: packable.description,\n }),\n );\n}\n\nexport function packRawClusterDataV2(packable: ClusterDataV2View): Uint8Array {\n return ccc.bytesFrom(\n ClusterDataV2.encode({\n name: packable.name,\n description: packable.description,\n mutantId: packable.mutantId,\n }),\n );\n}\n\n/**\n * Unpack Hex/Bytes to RawClusterData.\n * Pass an optional \"version\" field to select a specific unpacking version.\n */\nexport function unpackToRawClusterData(\n unpackable: ccc.BytesLike,\n): ClusterDataView;\nexport function unpackToRawClusterData(\n unpackable: ccc.BytesLike,\n version: \"v1\",\n): ClusterDataV1View;\nexport function unpackToRawClusterData(\n unpackable: ccc.BytesLike,\n version: \"v2\",\n): ClusterDataV2View;\nexport function unpackToRawClusterData(\n unpackable: ccc.BytesLike,\n version?: ClusterDataVersion,\n): unknown {\n if (version) {\n switch (version) {\n case \"v1\":\n return unpackToRawClusterDataV1(unpackable);\n case \"v2\":\n return unpackToRawClusterDataV2(unpackable);\n }\n }\n try {\n return unpackToRawClusterDataV2(unpackable);\n } catch {\n try {\n return unpackToRawClusterDataV1(unpackable);\n } catch {\n throw new Error(\n `Cannot unpack ClusterData, no matching molecule: ${ccc.hexFrom(unpackable)}`,\n );\n }\n }\n}\n\nexport function unpackToRawClusterDataV1(\n unpackable: ccc.BytesLike,\n): ClusterDataV1View {\n return ClusterDataV1.decode(unpackable);\n}\n\nexport function unpackToRawClusterDataV2(\n unpackable: ccc.BytesLike,\n): ClusterDataV2View {\n return ClusterDataV2.decode(unpackable);\n}\n","import { ccc, mol } from \"@ckb-ccc/core\";\n\nexport const Action = mol.table({\n scriptInfoHash: mol.Byte32,\n scriptHash: mol.Byte32,\n data: mol.Bytes,\n});\n\nexport const ActionVec = mol.vector(Action);\n\nexport const Message = mol.table({\n actions: ActionVec,\n});\n\nexport const ResolvedInputs = mol.table({\n outputs: ccc.CellOutputVec,\n outputsData: mol.BytesVec,\n});\n\nexport const ScriptInfo = mol.table({\n name: mol.String,\n url: mol.String,\n scriptHash: mol.Byte32,\n schema: mol.String,\n messageType: mol.String,\n});\n\nexport const ScriptInfoVec = mol.vector(ScriptInfo);\n\nexport const BuildingPacketV1 = mol.table({\n message: Message,\n payload: ccc.Transaction,\n resolvedInputs: ResolvedInputs,\n changeOutput: mol.Uint32Opt,\n scriptInfos: ScriptInfoVec,\n lockActions: ActionVec,\n});\n\nexport const BuildingPacket = mol.union({\n BuildingPacketV1,\n});\n","import { ccc, mol } from \"@ckb-ccc/core\";\n\nexport const Address = mol.union({\n Script: ccc.Script,\n});\n\n/**\n * Spore\n */\nexport const CreateSpore = mol.table({\n sporeId: mol.Byte32,\n to: Address,\n dataHash: mol.Byte32,\n});\nexport const TransferSpore = mol.table({\n sporeId: mol.Byte32,\n from: Address,\n to: Address,\n});\nexport const MeltSpore = mol.table({\n sporeId: mol.Byte32,\n from: Address,\n});\n\n/**\n * Cluster\n */\nexport const CreateCluster = mol.table({\n clusterId: mol.Byte32,\n to: Address,\n dataHash: mol.Byte32,\n});\nexport const TransferCluster = mol.table({\n clusterId: mol.Byte32,\n from: Address,\n to: Address,\n});\n\n/**\n * ClusterProxy\n */\nexport const CreateClusterProxy = mol.table({\n clusterId: mol.Byte32,\n clusterProxyId: mol.Byte32,\n to: Address,\n});\nexport const TransferClusterProxy = mol.table({\n clusterId: mol.Byte32,\n clusterProxyId: mol.Byte32,\n from: Address,\n to: Address,\n});\nexport const MeltClusterProxy = mol.table({\n clusterId: mol.Byte32,\n clusterProxyId: mol.Byte32,\n from: Address,\n});\n\n/**\n * ClusterAgent\n */\nexport const CreateClusterAgent = mol.table({\n clusterId: mol.Byte32,\n clusterProxyId: mol.Byte32,\n to: Address,\n});\nexport const TransferClusterAgent = mol.table({\n clusterId: mol.Byte32,\n from: Address,\n to: Address,\n});\nexport const MeltClusterAgent = mol.table({\n clusterId: mol.Byte32,\n from: Address,\n});\n\n/**\n * Spore ScriptInfo Actions\n */\nexport const SporeAction = mol.union({\n // Spore\n CreateSpore,\n TransferSpore,\n MeltSpore,\n\n // Cluster\n CreateCluster,\n TransferCluster,\n\n // ClusterProxy\n CreateClusterProxy,\n TransferClusterProxy,\n MeltClusterProxy,\n\n // ClusterAgent\n CreateClusterAgent,\n TransferClusterAgent,\n MeltClusterAgent,\n});\n","import { mol } from \"@ckb-ccc/core\";\nimport { Message } from \"./buildingPacket.js\";\n\nexport const SighashAll = mol.table({\n seal: mol.Bytes,\n message: Message,\n});\n\nexport const SighashAllOnly = mol.table({\n seal: mol.Bytes,\n});\n\n/**\n * Otx related are not implemented yet, so just placeholders.\n */\nexport const Otx = mol.table({});\nexport const OtxStart = mol.table({});\n\nexport const WitnessLayoutFieldTags = {\n SighashAll: 4278190081,\n SighashAllOnly: 4278190082,\n Otx: 4278190083,\n OtxStart: 4278190084,\n} as const;\n\nexport const WitnessLayout = mol.union(\n {\n SighashAll,\n SighashAllOnly,\n Otx,\n OtxStart,\n },\n WitnessLayoutFieldTags,\n);\n","import { ccc, mol } from \"@ckb-ccc/core\";\n\nexport interface SporeDataView {\n contentType: string;\n content: ccc.BytesLike;\n clusterId?: ccc.HexLike;\n}\n\nexport const SporeData: ccc.Codec<SporeDataView> = mol.table({\n contentType: mol.String,\n content: mol.Bytes,\n clusterId: mol.BytesOpt,\n});\n\nexport function packRawSporeData(packable: SporeDataView): Uint8Array {\n return ccc.bytesFrom(\n SporeData.encode({\n contentType: packable.contentType,\n content: packable.content,\n clusterId: packable.clusterId,\n }),\n );\n}\n\nexport function unpackToRawSporeData(unpackable: ccc.BytesLike): SporeDataView {\n return SporeData.decode(unpackable);\n}\n","import { ccc } from \"@ckb-ccc/core\";\n\nexport const DEFAULT_COBUILD_INFO_HASH = ccc.hashCkb(\n ccc.bytesFrom(\"CCC_DEFAULT_COBUILD_INFO\", \"utf8\"),\n);\n\nexport enum SporeVersion {\n V1 = \"V1\",\n V2 = \"V2\",\n DID = \"DID\",\n}\n\nexport const SPORE_VERSION_DEFAULT = SporeVersion.V2;\n\nexport type SporeScriptInfoLike = ccc.ScriptInfoLike & {\n cobuild?: boolean;\n};\n\nexport class SporeScriptInfo extends ccc.ScriptInfo {\n constructor(\n codeHash: ccc.Hex,\n hashType: ccc.HashType,\n cellDeps: ccc.CellDepInfo[],\n public cobuild?: boolean,\n ) {\n super(codeHash, hashType, cellDeps);\n }\n\n static from(scriptInfoLike: SporeScriptInfoLike): SporeScriptInfo {\n return new SporeScriptInfo(\n ccc.hexFrom(scriptInfoLike.codeHash),\n ccc.hashTypeFrom(scriptInfoLike.hashType),\n scriptInfoLike.cellDeps.map((c) => ccc.CellDepInfo.from(c)),\n scriptInfoLike.cobuild,\n );\n }\n}\n","import { SporeScriptInfoLike, SporeVersion } from \"./types.js\";\n\nexport const SCRIPTS_SPORE_MAINNET: Record<\n SporeVersion,\n SporeScriptInfoLike | undefined\n> = Object.freeze({\n [SporeVersion.DID]: {\n codeHash:\n \"0xcfba73b58b6f30e70caed8a999748781b164ef9a1e218424a6fb55ebf641cb33\",\n hashType: \"type\",\n cellDeps: [\n {\n cellDep: {\n outPoint: {\n txHash:\n \"0x37c80ba8124780920bc8fe06b49e3535b43ca339bb9a97fb462b16d575bfa9a6\",\n index: 0,\n },\n depType: \"code\",\n },\n type: {\n codeHash:\n \"0x00000000000000000000000000000000000000000000000000545950455f4944\",\n hashType: \"type\",\n args: \"0x62312cd846659e188b05da11dc3f080b083c27371ea701d6026e11e713e0e3de\",\n },\n },\n ],\n cobuild: true,\n },\n [SporeVersion.V2]: {\n codeHash:\n \"0x4a4dce1df3dffff7f8b2cd7dff7303df3b6150c9788cb75dcf6747247132b9f5\",\n hashType: \"data1\",\n cellDeps: [\n {\n cellDep: {\n outPoint: {\n txHash:\n \"0x96b198fb5ddbd1eed57ed667068f1f1e55d07907b4c0dbd38675a69ea1b69824\",\n index: 0,\n },\n depType: \"code\",\n },\n },\n ],\n cobuild: true,\n },\n [SporeVersion.V1]: undefined,\n});\n\nexport const SCRIPTS_CLUSTER_MAINNET: Record<\n SporeVersion,\n SporeScriptInfoLike | undefined\n> = Object.freeze({\n [SporeVersion.V2]: {\n codeHash:\n \"0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075\",\n hashType: \"data1\",\n cellDeps: [\n {\n cellDep: {\n outPoint: {\n txHash:\n \"0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938\",\n index: 0,\n },\n depType: \"code\",\n },\n },\n ],\n cobuild: true,\n },\n [SporeVersion.V1]: undefined,\n [SporeVersion.DID]: undefined,\n});\n","import { SporeScriptInfoLike, SporeVersion } from \"./types.js\";\n\nexport const SCRIPTS_SPORE_TESTNET: Record<\n SporeVersion,\n SporeScriptInfoLike | undefined\n> = Object.freeze({\n [SporeVersion.DID]: {\n codeHash:\n \"0x0b1f412fbae26853ff7d082d422c2bdd9e2ff94ee8aaec11240a5b34cc6e890f\",\n hashType: \"type\",\n cellDeps: [\n {\n cellDep: {\n outPoint: {\n txHash:\n \"0x306961e0eb04ed972c60cb89a0aed1b0ef065d96d2fc0000c62db5275e32dc6f\",\n index: 0,\n },\n depType: \"code\",\n },\n type: {\n codeHash:\n \"0x00000000000000000000000000000000000000000000000000545950455f4944\",\n hashType: \"type\",\n args: \"0x80f0d4bf6b3951911aa6b98cc609d477a8a10b903b35cfd528d098e95c36f680\",\n },\n },\n ],\n },\n [SporeVersion.V2]: {\n codeHash:\n \"0x685a60219309029d01310311dba953d67029170ca4848a4ff638e57002130a0d\",\n hashType: \"data1\",\n cellDeps: [\n {\n cellDep: {\n outPoint: {\n txHash:\n \"0x5e8d2a517d50fd4bb4d01737a7952a1f1d35c8afc77240695bb569cd7d9d5a1f\",\n index: 0,\n },\n depType: \"code\",\n },\n },\n ],\n cobuild: true,\n },\n [SporeVersion.V1]: {\n codeHash:\n \"0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494\",\n hashType: \"data1\",\n cellDeps: [\n {\n cellDep: {\n outPoint: {\n txHash:\n \"0xfd694382e621f175ddf81ce91ce2ecf8bfc027d53d7d31b8438f7d26fc37fd19\",\n index: 0,\n },\n depType: \"code\",\n },\n },\n ],\n },\n});\n\nexport const SCRIPTS_CLUSTER_TESTNET: Record<\n SporeVersion,\n SporeScriptInfoLike | undefined\n> = Object.freeze({\n [SporeVersion.V2]: {\n codeHash:\n \"0x0bbe768b519d8ea7b96d58f1182eb7e6ef96c541fbd9526975077ee09f049058\",\n hashType: \"data1\",\n cellDeps: [\n {\n cellDep: {\n outPoint: {\n txHash:\n \"0xcebb174d6e300e26074aea2f5dbd7f694bb4fe3de52b6dfe205e54f90164510a\",\n index: 0,\n },\n depType: \"code\",\n },\n },\n ],\n cobuild: true,\n },\n [SporeVersion.V1]: {\n codeHash:\n \"0x598d793defef36e2eeba54a9b45130e4ca92822e1d193671f490950c3b856080\",\n hashType: \"data1\",\n cellDeps: [\n {\n cellDep: {\n outPoint: {\n txHash:\n \"0x49551a20dfe39231e7db49431d26c9c08ceec96a29024eef3acc936deeb2ca76\",\n index: 0,\n },\n depType: \"code\",\n },\n },\n ],\n },\n [SporeVersion.DID]: undefined,\n});\n","import { ccc } from \"@ckb-ccc/core\";\nimport {\n SCRIPTS_CLUSTER_MAINNET,\n SCRIPTS_CLUSTER_TESTNET,\n SCRIPTS_SPORE_MAINNET,\n SCRIPTS_SPORE_TESTNET,\n} from \"./advanced.js\";\nimport {\n SPORE_VERSION_DEFAULT,\n SporeScriptInfo,\n SporeVersion,\n} from \"./types.js\";\n\nexport function getSporeScriptInfos(client: ccc.Client) {\n return client.addressPrefix === \"ckb\"\n ? SCRIPTS_SPORE_MAINNET\n : SCRIPTS_SPORE_TESTNET;\n}\n\nexport function getClusterScriptInfos(client: ccc.Client) {\n return client.addressPrefix === \"ckb\"\n ? SCRIPTS_CLUSTER_MAINNET\n : SCRIPTS_CLUSTER_TESTNET;\n}\n\nexport function getSporeScriptInfo(\n client: ccc.Client,\n version?: SporeVersion,\n): SporeScriptInfo {\n const scriptInfo =\n getSporeScriptInfos(client)[version ?? SPORE_VERSION_DEFAULT];\n\n if (!scriptInfo) {\n throw new Error(\n `Spore script info not found of for version ${version} on ${client.addressPrefix}`,\n );\n }\n\n return SporeScriptInfo.from(scriptInfo);\n}\n\nexport function getClusterScriptInfo(\n client: ccc.Client,\n version?: SporeVersion,\n): SporeScriptInfo {\n const scriptInfo =\n getClusterScriptInfos(client)[version ?? SPORE_VERSION_DEFAULT];\n\n if (!scriptInfo) {\n throw new Error(\n `Cluster script info not found of for version ${version} on ${client.addressPrefix}`,\n );\n }\n\n return SporeScriptInfo.from(scriptInfo);\n}\n","import { ccc } from \"@ckb-ccc/core\";\nimport {\n Action,\n ActionVec,\n SporeAction,\n WitnessLayout,\n} from \"../codec/index.js\";\nimport { DEFAULT_COBUILD_INFO_HASH } from \"../predefined/index.js\";\n\nexport function assembleCreateSporeAction(\n sporeOutput: ccc.CellOutputLike,\n sporeData: ccc.BytesLike,\n scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,\n): ccc.EncodableType<typeof Action> {\n if (!sporeOutput.type) {\n throw new Error(\"Spore cell must have a type script\");\n }\n const sporeType = ccc.Script.from(sporeOutput.type);\n const sporeTypeHash = sporeType.hash();\n const actionData = SporeAction.encode({\n type: \"CreateSpore\",\n value: {\n sporeId: sporeType.args,\n to: {\n type: \"Script\",\n value: sporeOutput.lock,\n },\n dataHash: ccc.hashCkb(sporeData),\n },\n });\n return {\n scriptInfoHash: ccc.hexFrom(scriptInfoHash),\n scriptHash: sporeTypeHash,\n data: ccc.hexFrom(actionData),\n };\n}\n\nexport function assembleTransferSporeAction(\n sporeInput: ccc.CellOutputLike,\n sporeOutput: ccc.CellOutputLike,\n scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,\n): ccc.EncodableType<typeof Action> {\n if (!sporeInput.type || !sporeOutput.type) {\n throw new Error(\"Spore cell must have a type script\");\n }\n\n const sporeType = ccc.Script.from(sporeOutput.type);\n const sporeTypeHash = sporeType.hash();\n const actionData = SporeAction.encode({\n type: \"TransferSpore\",\n value: {\n sporeId: sporeType.args,\n from: {\n type: \"Script\",\n value: sporeInput.lock,\n },\n to: {\n type: \"Script\",\n value: sporeOutput.lock,\n },\n },\n });\n return {\n scriptInfoHash: ccc.hexFrom(scriptInfoHash),\n scriptHash: sporeTypeHash,\n data: ccc.hexFrom(actionData),\n };\n}\n\nexport function assembleMeltSporeAction(\n sporeInput: ccc.CellOutputLike,\n scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,\n): ccc.EncodableType<typeof Action> {\n if (!sporeInput.type) {\n throw new Error(\"Spore cell must have a type script\");\n }\n const sporeType = ccc.Script.from(sporeInput.type);\n const sporeTypeHash = sporeType.hash();\n const actionData = SporeAction.encode({\n type: \"MeltSpore\",\n value: {\n sporeId: sporeType.args,\n from: {\n type: \"Script\",\n value: sporeInput.lock,\n },\n },\n });\n return {\n scriptInfoHash: ccc.hexFrom(scriptInfoHash),\n scriptHash: sporeTypeHash,\n data: ccc.hexFrom(actionData),\n };\n}\n\nexport function assembleCreateClusterAction(\n clusterOutput: ccc.CellOutputLike,\n clusterData: ccc.BytesLike,\n scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,\n): ccc.EncodableType<typeof Action> {\n if (!clusterOutput.type) {\n throw new Error(\"Cluster cell must have a type script\");\n }\n const clusterType = ccc.Script.from(clusterOutput.type);\n const clusterTypeHash = clusterType.hash();\n const actionData = SporeAction.encode({\n type: \"CreateCluster\",\n value: {\n clusterId: clusterType.args,\n to: {\n type: \"Script\",\n value: clusterOutput.lock,\n },\n dataHash: ccc.hashCkb(clusterData),\n },\n });\n return {\n scriptInfoHash: ccc.hexFrom(scriptInfoHash),\n scriptHash: clusterTypeHash,\n data: ccc.hexFrom(actionData),\n };\n}\n\nexport function assembleTransferClusterAction(\n clusterInput: ccc.CellOutputLike,\n clusterOutput: ccc.CellOutputLike,\n scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,\n): ccc.EncodableType<typeof Action> {\n if (!clusterInput.type || !clusterOutput.type) {\n throw new Error(\"Cluster cell must have a type script\");\n }\n const clusterType = ccc.Script.from(clusterOutput.type);\n const clusterTypeHash = clusterType.hash();\n const actionData = SporeAction.encode({\n type: \"TransferCluster\",\n value: {\n clusterId: clusterType.args,\n from: {\n type: \"Script\",\n value: clusterInput.lock,\n },\n to: {\n type: \"Script\",\n value: clusterOutput.lock,\n },\n },\n });\n return {\n scriptInfoHash: ccc.hexFrom(scriptInfoHash),\n scriptHash: clusterTypeHash,\n data: ccc.hexFrom(actionData),\n };\n}\n\nexport async function prepareSporeTransaction(\n signer: ccc.Signer,\n txLike: ccc.TransactionLike,\n actions: ccc.EncodableType<typeof ActionVec>,\n): Promise<ccc.Transaction> {\n let tx = ccc.Transaction.from(txLike);\n\n if (actions.length === 0) {\n return signer.prepareTransaction(tx);\n }\n\n const existedActions = extractCobuildActionsFromTx(tx);\n tx = await signer.prepareTransaction(tx);\n injectCobuild(tx, [existedActions, actions].flat());\n return tx;\n}\n\nexport function unpackCommonCobuildProof(\n data: ccc.HexLike,\n): ccc.EncodableType<typeof WitnessLayout> | undefined {\n try {\n return WitnessLayout.decode(ccc.bytesFrom(data));\n } catch {\n return;\n }\n}\n\nexport function extractCobuildActionsFromTx(\n tx: ccc.Transaction,\n): ccc.EncodableType<typeof ActionVec> {\n if (tx.witnesses.length === 0) {\n return [];\n }\n const witnessLayout = unpackCommonCobuildProof(\n tx.witnesses[tx.witnesses.length - 1],\n );\n if (!witnessLayout) {\n return [];\n }\n if (witnessLayout.type !== \"SighashAll\") {\n throw new Error(\"Invalid cobuild proof type: SighashAll\");\n }\n\n // Remove existed cobuild witness\n tx.witnesses.pop();\n return witnessLayout.value.message.actions;\n}\n\nexport function injectCobuild(\n tx: ccc.Transaction,\n actions: ccc.EncodableType<typeof ActionVec>,\n): void {\n tx.setWitnessAt(\n Math.max(tx.witnesses.length, tx.inputs.length),\n WitnessLayout.encode({\n type: \"SighashAll\",\n value: {\n seal: \"0x\",\n message: {\n actions,\n },\n },\n }),\n );\n}\n","import { ccc } from \"@ckb-ccc/core\";\nimport { assembleTransferClusterAction } from \"../advanced.js\";\nimport { assertCluster } from \"../cluster/index.js\";\nimport { Action, SporeDataView } from \"../codec/index.js\";\n\nexport async function prepareCluster(\n signer: ccc.Signer,\n tx: ccc.Transaction,\n data: SporeDataView,\n clusterMode?: \"lockProxy\" | \"clusterCell\" | \"skip\",\n scriptInfoHash?: ccc.HexLike,\n): Promise<ccc.EncodableType<typeof Action> | undefined> {\n // skip if the spore is not belong to a cluster\n if (!data.clusterId || clusterMode === \"skip\") {\n return;\n }\n\n if (!clusterMode) {\n throw Error(\"clusterMode is undefined but the spore has a cluster\");\n }\n\n const { cell: cluster, scriptInfo } = await assertCluster(\n signer.client,\n data.clusterId,\n );\n\n // If this cluster has been processed, nothing will happen to the tx\n switch (clusterMode) {\n case \"lockProxy\": {\n const lock = cluster.cellOutput.lock;\n\n // Ensure a lock-proxy input is present, add one if absent\n let lockProxyInputIndex = await tx.findInputIndexByLock(\n lock,\n signer.client,\n );\n if (lockProxyInputIndex === undefined) {\n await tx.completeInputsAddOne(\n new ccc.SignerCkbScriptReadonly(signer.client, lock),\n );\n lockProxyInputIndex = await tx.findInputIndexByLock(\n lock,\n signer.client,\n );\n if (lockProxyInputIndex === undefined) {\n throw new Error(\"Lock proxy input not found\");\n }\n }\n\n // Add the output only if there's not already one with proxy lock\n if (!tx.outputs.some((output) => output.lock === lock)) {\n tx.addOutput(\n await tx.getInput(lockProxyInputIndex)!.getCell(signer.client),\n );\n }\n\n tx.addCellDeps({\n outPoint: cluster.outPoint,\n depType: \"code\",\n });\n return;\n }\n case \"clusterCell\": {\n if (tx.inputs.some((i) => i.previousOutput.eq(cluster.outPoint))) {\n return;\n }\n\n tx.addInput(cluster);\n tx.addOutput(cluster.cellOutput, cluster.outputData);\n await tx.addCellDepInfos(signer.client, scriptInfo.cellDeps);\n // note: add cluster as cellDep, which will be used in Spore contract\n tx.addCellDeps({\n outPoint: cluster.outPoint,\n depType: \"code\",\n });\n\n if (scriptInfo.cobuild) {\n return assembleTransferClusterAction(\n cluster.cellOutput,\n cluster.cellOutput,\n scriptInfoHash,\n );\n }\n return;\n }\n }\n}\n","export * from \"./cobuild/index.js\";\nexport * from \"./codec/index.js\";\nexport * from \"./predefined/advanced.js\";\nexport * from \"./spore/advanced.js\";\n","import { ccc } from \"@ckb-ccc/core\";\nimport { SporeScriptInfo, SporeScriptInfoLike } from \"../predefined/index.js\";\n\nexport async function findSingletonCellByArgs(\n client: ccc.Client,\n args: ccc.HexLike,\n scripts: (SporeScriptInfoLike | undefined)[],\n): Promise<\n | {\n cell: ccc.Cell;\n scriptInfo: SporeScriptInfo;\n }\n | undefined\n> {\n for (const scriptInfo of scripts) {\n if (!scriptInfo) {\n continue;\n }\n\n const cell = await client.findSingletonCellByType(\n {\n ...scriptInfo,\n args,\n },\n true,\n );\n\n if (cell) {\n return {\n cell,\n scriptInfo: SporeScriptInfo.from(scriptInfo),\n };\n }\n }\n}\n","import { ccc } from \"@ckb-ccc/core\";\nimport {\n assembleCreateClusterAction,\n assembleTransferClusterAction,\n prepareSporeTransaction,\n} from \"../advanced.js\";\nimport {\n ClusterDataView,\n packRawClusterData,\n unpackToRawClusterData,\n} from \"../codec/index.js\";\nimport { findSingletonCellByArgs } from \"../helper/index.js\";\nimport {\n SporeScriptInfo,\n SporeScriptInfoLike,\n getClusterScriptInfo,\n getClusterScriptInfos,\n} from \"../predefined/index.js\";\n\nexport async function findCluster(\n client: ccc.Client,\n id: ccc.HexLike,\n scripts?: SporeScriptInfoLike[],\n): Promise<\n | {\n cell: ccc.Cell;\n cluster: ccc.Cell;\n clusterData: ClusterDataView;\n scriptInfo: SporeScriptInfo;\n }\n | undefined\n> {\n const found = await findSingletonCellByArgs(\n client,\n id,\n scripts ?? Object.values(getClusterScriptInfos(client)),\n );\n if (!found) {\n return;\n }\n\n return {\n cell: found.cell,\n cluster: found.cell,\n clusterData: unpackToRawClusterData(found.cell.outputData),\n scriptInfo: found.scriptInfo,\n };\n}\n\nexport async function assertCluster(\n client: ccc.Client,\n args: ccc.HexLike,\n scripts?: SporeScriptInfoLike[],\n): Promise<{\n cell: ccc.Cell;\n scriptInfo: SporeScriptInfo;\n}> {\n const res = await findCluster(client, args, scripts);\n\n if (!res) {\n throw new Error(`Cluster ${ccc.hexFrom(args)} not found`);\n }\n\n return res;\n}\n\n/**\n * Create a new Cluster cell\n *\n * @param params.signer who takes the responsibility to balance and sign the transaction\n * @param params.data specific format of data required by Cluster protocol\n * @param params.to the owner of the Cluster cell, which will be replaced with signer if not provided\n * @param params.tx the transaction skeleton, if not provided, a new one will be created\n * @param params.scriptInfo the script info of new cluster, default spore version if undefined\n * @param params.scriptInfoHash the script info hash used in cobuild\n * @returns\n * - **tx**: a new transaction that contains created Cluster cell\n * - **id**: the id of the created Cluster cell\n */\nexport async function createSporeCluster(params: {\n signer: ccc.Signer;\n data: ClusterDataView;\n to?: ccc.ScriptLike;\n tx?: ccc.TransactionLike;\n scriptInfo?: SporeScriptInfoLike;\n scriptInfoHash?: ccc.HexLike;\n}): Promise<{\n tx: ccc.Transaction;\n id: ccc.Hex;\n}> {\n const { signer, data, to, scriptInfoHash } = params;\n const scriptInfo = params.scriptInfo ?? getClusterScriptInfo(signer.client);\n\n // prepare transaction\n const tx = ccc.Transaction.from(params.tx ?? {});\n await tx.completeInputsAtLeastOne(signer);\n\n // build cluster cell\n const id = ccc.hashTypeId(tx.inputs[0], tx.outputs.length);\n const packedClusterData = packRawClusterData(data);\n tx.addOutput(\n {\n lock: to ?? (await signer.getRecommendedAddressObj()).script,\n type: {\n ...scriptInfo,\n args: id,\n },\n },\n packedClusterData,\n );\n\n // complete cellDeps\n await tx.addCellDepInfos(signer.client, scriptInfo.cellDeps);\n\n // generate cobuild action\n const actions = scriptInfo.cobuild\n ? [\n assembleCreateClusterAction(\n tx.outputs[tx.outputs.length - 1],\n packedClusterData,\n scriptInfoHash,\n ),\n ]\n : [];\n\n return {\n tx: await prepareSporeTransaction(signer, tx, actions),\n id,\n };\n}\n\n/**\n * Transfer a Cluster cell\n *\n * @param params.signer who takes the responsibility to balance and sign the transaction\n * @param params.id the id of the Cluster cell to be transferred\n * @param params.to the new owner of the Cluster cell\n * @param params.tx the transaction skeleton, if not provided, a new one will be created\n * @param params.scriptInfoHash the script info hash used in cobuild\n * @returns\n * - **tx**: a new transaction that contains transferred Cluster cell\n */\nexport async function transferSporeCluster(params: {\n signer: ccc.Signer;\n id: ccc.HexLike;\n to: ccc.ScriptLike;\n tx?: ccc.TransactionLike;\n scripts?: SporeScriptInfoLike[];\n scriptInfoHash?: ccc.HexLike;\n}): Promise<{\n tx: ccc.Transaction;\n}> {\n const { signer, id, to, scripts, scriptInfoHash } = params;\n\n // prepare transaction\n const tx = ccc.Transaction.from(params.tx ?? {});\n\n // build cluster cell\n const { cell: cluster, scriptInfo: clusterScriptInfo } = await assertCluster(\n signer.client,\n id,\n scripts,\n );\n\n tx.addInput(cluster);\n tx.addOutput(\n {\n lock: to,\n type: cluster.cellOutput.type,\n },\n cluster.outputData,\n );\n\n // complete cellDeps\n await tx.addCellDepInfos(signer.client, clusterScriptInfo.cellDeps);\n\n // generate cobuild action\n const actions = clusterScriptInfo.cobuild\n ? [\n assembleTransferClusterAction(\n cluster.cellOutput,\n tx.outputs[tx.outputs.length - 1],\n scriptInfoHash,\n ),\n ]\n : [];\n\n return {\n tx: await prepareSporeTransaction(signer, tx, actions),\n };\n}\n\n/**\n * Search on-chain clusters under the signer's control\n *\n * @param params.signer the owner of clusters\n * @param params.order the order in creation time of clusters\n * @param params.scriptInfos the deployed script infos of clusters\n */\nexport async function* findSporeClustersBySigner(params: {\n signer: ccc.Signer;\n order?: \"asc\" | \"desc\";\n limit?: number;\n scriptInfos?: SporeScriptInfoLike[];\n}): AsyncGenerator<{\n cell: ccc.Cell;\n cluster: ccc.Cell;\n clusterData: ClusterDataView;\n scriptInfo: SporeScriptInfo;\n}> {\n const { signer, order, limit, scriptInfos } = params;\n for (const scriptInfo of scriptInfos ??\n Object.values(getClusterScriptInfos(signer.client))) {\n if (!scriptInfo) {\n continue;\n }\n\n for await (const cluster of signer.findCells(\n {\n script: {\n ...scriptInfo,\n args: \"\",\n },\n },\n true,\n order,\n limit,\n )) {\n yield {\n cell: cluster,\n cluster,\n clusterData: unpackToRawClusterData(cluster.outputData),\n scriptInfo: SporeScriptInfo.from(scriptInfo),\n };\n }\n }\n}\n\n/**\n * Search on-chain clusters under the specified lock or not\n *\n * @param params.client the client to search clusters\n * @param params.lock the lock of clusters\n */\nexport async function* findSporeClusters(params: {\n client: ccc.Client;\n lock?: ccc.ScriptLike;\n order?: \"asc\" | \"desc\";\n limit?: number;\n scriptInfos?: SporeScriptInfoLike[];\n}): AsyncGenerator<{\n cell: ccc.Cell;\n cluster: ccc.Cell;\n clusterData: ClusterDataView;\n scriptInfo: SporeScriptInfo;\n}> {\n const { client, lock, order, limit, scriptInfos } = params;\n for (const scriptInfo of scriptInfos ??\n Object.values(getClusterScriptInfos(client))) {\n if (!scriptInfo) {\n continue;\n }\n\n for await (const cluster of client.findCells(\n {\n script: {\n ...scriptInfo,\n args: \"\",\n },\n scriptType: \"type\",\n scriptSearchMode: \"prefix\",\n withData: true,\n filter: lock\n ? {\n script: lock,\n }\n : undefined,\n },\n order,\n limit,\n )) {\n yield {\n cell: cluster,\n cluster,\n clusterData: unpackToRawClusterData(cluster.outputData),\n scriptInfo: SporeScriptInfo.from(scriptInfo),\n };\n }\n }\n}\n"],"mappings":"mLAOA,MAAa,EAA8CA,EAAAA,IAAI,MAAM,CACnE,KAAMA,EAAAA,IAAI,OACV,YAAaA,EAAAA,IAAI,MACnB,CAAC,EAQY,EAA8CA,EAAAA,IAAI,MAAM,CACnE,KAAMA,EAAAA,IAAI,OACV,YAAaA,EAAAA,IAAI,OACjB,SAAUA,EAAAA,IAAI,QAChB,CAAC,EAMY,EAAc,EAe3B,SAAgB,EACd,EACA,EACY,CACZ,GAAI,CAAC,EACH,OAAO,EAAqB,CAAQ,EAEtC,OAAQ,EAAR,CACE,IAAK,KACH,OAAO,EAAqB,CAAQ,EACtC,IAAK,KACH,OAAO,EAAqB,CAAQ,CACxC,CACF,CAEA,SAAgB,EAAqB,EAAyC,CAC5E,OAAOC,EAAAA,IAAI,UACT,EAAc,OAAO,CACnB,KAAM,EAAS,KACf,YAAa,EAAS,WACxB,CAAC,CACH,CACF,CAEA,SAAgB,EAAqB,EAAyC,CAC5E,OAAOA,EAAAA,IAAI,UACT,EAAc,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,EAAe,SAAS,IAAK,GAAMA,EAAAA,IAAI,YAAY,KAAK,CAAC,CAAC,EAC1D,EAAe,OACjB,CACF,CACF,EClCA,MAAa,EAGT,OAAO,OAAO,KACI,CAClB,SACE,qEACF,SAAU,OACV,SAAU,CACR,CACE,QAAS,CACP,SAAU,CACR,OACE,qEACF,MAAO,CACT,EACA,QAAS,MACX,EACA,KAAM,CACJ,SACE,qEACF,SAAU,OACV,KAAM,oEACR,CACF,CACF,EACA,QAAS,EACX,KACmB,CACjB,SACE,qEACF,SAAU,QACV,SAAU,CACR,CACE,QAAS,CACP,SAAU,CACR,OACE,qEACF,MAAO,CACT,EACA,QAAS,MACX,CACF,CACF,EACA,QAAS,EACX,KACmB,IAAA,EACrB,CAAC,EAEY,EAGT,OAAO,OAAO,IACG,CACjB,SACE,qEACF,SAAU,QACV,SAAU,CACR,CACE,QAAS,CACP,SAAU,CACR,OACE,qEACF,MAAO,CACT,EACA,QAAS,MACX,CACF,CACF,EACA,QAAS,EACX,KACmB,IAAA,OACC,IAAA,EACtB,CAAC,ECzEY,EAGT,OAAO,OAAO,KACI,CAClB,SACE,qEACF,SAAU,OACV,SAAU,CACR,CACE,QAAS,CACP,SAAU,CACR,OACE,qEACF,MAAO,CACT,EACA,QAAS,MACX,EACA,KAAM,CACJ,SACE,qEACF,SAAU,OACV,KAAM,oEACR,CACF,CACF,CACF,KACmB,CACjB,SACE,qEACF,SAAU,QACV,SAAU,CACR,CACE,QAAS,CACP,SAAU,CACR,OACE,qEACF,MAAO,CACT,EACA,QAAS,MACX,CACF,CACF,EACA,QAAS,EACX,KACmB,CACjB,SACE,qEACF,SAAU,QACV,SAAU,CACR,CACE,QAAS,CACP,SAAU,CACR,OACE,qEACF,MAAO,CACT,EACA,QAAS,MACX,CACF,CACF,CACF,CACF,CAAC,EAEY,EAGT,OAAO,OAAO,IACG,CACjB,SACE,qEACF,SAAU,QACV,SAAU,CACR,CACE,QAAS,CACP,SAAU,CACR,OACE,qEACF,MAAO,CAC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EACJ,CACE,OAAQ,CACV,EACA,IAAA,EACN,EACA,EACA,CACF,EACE,KAAM,CACJ,KAAM,EACN,UACA,YAAa,EAAuB,EAAQ,UAAU,EACtD,WAAY,EAAgB,KAAK,CAAU,CAC7C,CAGN"}
@@ -1,3 +1,3 @@
1
- export * from "./barrel.js";
2
- export * as spore from "./barrel.js";
3
- //# sourceMappingURL=index.d.ts.map
1
+ import { a as SporeVersion, i as SporeScriptInfoLike, n as SPORE_VERSION_DEFAULT, r as SporeScriptInfo, t as DEFAULT_COBUILD_INFO_HASH } from "./types-C1N7Mdzo.js";
2
+ import { _ as getClusterScriptInfos, a as findSpores, c as transferSpore, d as createSporeCluster, f as findCluster, g as getClusterScriptInfo, h as transferSporeCluster, i as findSpore, l as index_d_exports, m as findSporeClustersBySigner, n as assertSpore, o as findSporesBySigner, p as findSporeClusters, r as createSpore, s as meltSpore, t as barrel_d_exports, u as assertCluster, v as getSporeScriptInfo, y as getSporeScriptInfos } from "./barrel-Dj4BYAYE.js";
3
+ export { DEFAULT_COBUILD_INFO_HASH, SPORE_VERSION_DEFAULT, SporeScriptInfo, SporeScriptInfoLike, SporeVersion, assertCluster, assertSpore, createSpore, createSporeCluster, index_d_exports as dob, findCluster, findSpore, findSporeClusters, findSporeClustersBySigner, findSpores, findSporesBySigner, getClusterScriptInfo, getClusterScriptInfos, getSporeScriptInfo, getSporeScriptInfos, meltSpore, barrel_d_exports as spore, transferSpore, transferSporeCluster };
@@ -1,41 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.spore = void 0;
40
- __exportStar(require("./barrel.js"), exports);
41
- exports.spore = __importStar(require("./barrel.js"));
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./cluster-CGo0DCM9.js"),t=require("./barrel-Dj_LwfvL.js");exports.DEFAULT_COBUILD_INFO_HASH=e.D,exports.SPORE_VERSION_DEFAULT=e.O,exports.SporeScriptInfo=e.k,exports.SporeVersion=e.A,exports.assertCluster=e.t,exports.assertSpore=t.n,exports.createSpore=t.r,exports.createSporeCluster=e.n,Object.defineProperty(exports,"dob",{enumerable:!0,get:function(){return t.l}}),exports.findCluster=e.r,exports.findSpore=t.i,exports.findSporeClusters=e.i,exports.findSporeClustersBySigner=e.a,exports.findSpores=t.a,exports.findSporesBySigner=t.o,exports.getClusterScriptInfo=e.y,exports.getClusterScriptInfos=e.b,exports.getSporeScriptInfo=e.x,exports.getSporeScriptInfos=e.S,exports.meltSpore=t.s,Object.defineProperty(exports,"spore",{enumerable:!0,get:function(){return t.t}}),exports.transferSpore=t.c,exports.transferSporeCluster=e.o;