-
Notifications
You must be signed in to change notification settings - Fork 4
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: bic-333_mee_support #166
Conversation
size-limit report 📦
|
0dd7c8c
to
743196e
Compare
6b89cac
to
1d6ac35
Compare
1d6ac35
to
061709c
Compare
8f7a543
to
74a7e09
Compare
// First instruction: Bridge USDC tokens | ||
mcNexus.buildInstructions({ | ||
action: { | ||
type: "BRIDGE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the biggest fan of using the string as a selector here.
const intent = await prepareIntent({
account: mcNexus,
amount: parseUnits('100', 6),
toChain: optimism,
token: mcUSDC
})
Maybe an extensions model would be better. As I do believe we'll be developing quite a few plugins and we'd like to enable others to do so as well.
Idea:
const mcNexus = await toMultichainNexusAccount({
chains: [optimism, base, polygon],
signer: eoa,
extensions: [
intentActions
]
})
const intent = await mcNexus.buildIntent({
amount: parseUnits('100', 6),
toChain: optimism,
token: mcUSDC
})
``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I like the intstruction -> intent terminology change, but the "BRIDGE" here is how we differentiate between the different types of intents, because we want each of them to be build from the same generic helper (prepareIntent being generic helper in this case). Would you prefer enums over strings here? I prefer strings because users don't have to import the enum from our package. Typing the string is more straightforward...
Does this work for you @TurboFolkBlackMetal?
const intent = await mcNexus.buildIntent({
type: "BRIDGE",
amount: parseUnits('100', 6),
toChain: optimism,
token: mcUSDC
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An Intent
is just one type of Instruction
, actually prepareIntent
would return Instruction[]
.
It has specific terminology in the space where intent means - "move tokens from multiple chains to one or more chains".
Best if we go through some things on a short call imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me semantically I prefer this (1):
const instructions: Instruction[] = [
buildInstruction({ type: "intent", params: ... }),
buildInstruction({ type: "anotherInstructionType", params: ... })
]
over this (2):
const instructions: Instruction[] = [
buildIntent({ params: ... }),
buildAnotherInstructionType({ params: "" })
]
Because in option 1 it's clear that each of the elements in the array resolve to the same thing (an instruction), and I know immediately know about the only multipurpose helper which generates instructions. With option two if I don't know what helpers are available I'd need to visit the docs to investigate each of the different types of instruction helpers I can use. With option 1 I can use my IDE and know everything I need to know about building every instruction type by clicking this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to be guided by typescript in my IDE over visiting docs, especially given our troubled history of keeping documentation up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will get us to a happy medium so that we have the benefit of these helpers being ‘modularised’ & ‘standalone’ helpers in their own directory with custom names, but I will still access them from this ‘buildInstructions’ helper. That work for you?
e5ef20c
to
bf56eac
Compare
7911577
to
5baa467
Compare
5baa467
to
46316c2
Compare
52a3cce
to
9b9cf7d
Compare
9b9cf7d
to
07acd5f
Compare
64fe8ae
to
96ff060
Compare
PR-Codex overview
This PR focuses on the rebranding of
AbstractJS
, introduces support formeeNode
, and enhances the SDK with new functionalities and constants. It also updates various components to improve the overall structure and usability of the codebase.Detailed summary
getCounterFactualAddress.ts
.tokens/index.ts
to export__AUTO_GENERATED__
.mee
inclients/decorators/index.ts
.account/decorators/instructions/index.ts
.CHANGELOG.md
for version0.0.29
.style
settings inbiome.json
.ALT_CHAIN_ID
toMAINNET_CHAIN_ID
inworkflows/unit-tests.yml
.useTestBundler
option throughout various client and decorator files.account/utils/Types.ts
andaccount/utils/contractSimulation.ts
.abstractJS
.