Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds a wip SDK structure #130

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: adds a wip SDK structure #130

wants to merge 1 commit into from

Conversation

austbot
Copy link
Contributor

@austbot austbot commented Jan 3, 2022

No description provided.

}

export class AuctionHouse {
private settings: AuctionHouseSettings;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call those args or config. It's not exactly settings that are stored in a file or something.


constructor(private connection: Connection) { }

get AuctionHouse() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this have to live on the client instead of just being returned?
i.e. if I'm done with it the GC cannot collect it now because it's still referenced.
Incurring that memory overhead only makes sense if creating it is expensive (which I don't think it is given you're just calling a constructor).


}

async execute_sale() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use camel case?

@thlorenz
Copy link
Contributor

thlorenz commented Jan 4, 2022

Thought about this a bit more and we should consider making the main exports object just be the thing that everything hangs off, thus you'd do.

import * as msdk from '@metaplex-foundation/sdk'

const house = msdk.getAuctionHouse()
await house.doSomething()

If we include snippets like these in the docs then people will get it I think and advanced users can still do import getAuctionHouse from '@metaplex-foundation/sdk' if they like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants