Skip to content

Commit

Permalink
include optional datasource in publishCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
veralygit committed Oct 28, 2024
1 parent a8a235c commit 9f2cd59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/sdk/src/inscription/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -239,6 +241,7 @@ export type PublishCollectionOptions = Pick<GetWalletOptions, "safeMode"> & {
encodeMetadata?: boolean
enableRBF?: boolean
chain?: Chain
datasource?: BaseDatasource
}

export type CollectionInscription = {
Expand Down

0 comments on commit 9f2cd59

Please sign in to comment.