From 9f2cd59fa0a2522db7d3d8e2188b6e53cd42e8cc Mon Sep 17 00:00:00 2001 From: veralygit <57183851+veralygit@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:43:59 +0800 Subject: [PATCH] include optional datasource in publishCollection --- packages/sdk/src/inscription/collection.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/sdk/src/inscription/collection.ts b/packages/sdk/src/inscription/collection.ts index 94b644ec..66ffc768 100644 --- a/packages/sdk/src/inscription/collection.ts +++ b/packages/sdk/src/inscription/collection.ts @@ -48,6 +48,8 @@ export async function publishCollection({ }).format(royalty.pct) } + const datasource = options.datasource || new JsonRpcDatasource({ network: network, chain }) + const collectionMeta = { p: "vord", // protocol v: 1, // version @@ -62,7 +64,7 @@ export async function publishCollection({ insc: inscriptions } - return new Inscriber({ ...options, meta: collectionMeta, network, chain }) + return new Inscriber({ ...options, meta: collectionMeta, network, chain, datasource }) } export async function mintFromCollection({ chain = "bitcoin", ...options }: MintFromCollectionOptions) { @@ -118,7 +120,7 @@ export async function mintFromCollection({ chain = "bitcoin", ...options }: Mint meta.sig = options.signature - return new Inscriber({ ...options, meta }) + return new Inscriber({ ...options, meta, chain }) } export async function bulkMintFromCollection({ @@ -239,6 +241,7 @@ export type PublishCollectionOptions = Pick & { encodeMetadata?: boolean enableRBF?: boolean chain?: Chain + datasource?: BaseDatasource } export type CollectionInscription = {