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: support flow chain config for its #487

Merged
merged 40 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cc44c6d
feat: support chain type vm for flow
npty Jan 8, 2025
ab04633
feat: add VMChainConfigs
npty Jan 8, 2025
9c49e67
feat: refactor EVMChainsDropdown to support all chains
npty Jan 8, 2025
01fd7de
feat: support vm chains in deploy and register state
npty Jan 9, 2025
fcdf3bb
feat: support vm chains in multiplle components
npty Jan 9, 2025
a41ab6c
chore: bump axelarjs-sdk to latest to fix gas estimation for flow
npty Jan 9, 2025
3c658fd
feat: support vm chains in recordInterchainTokenDeployment
npty Jan 9, 2025
acddf36
feat: support vm chains for chain picker and tx status monitor
npty Jan 9, 2025
5614260
chore: fix rpc urls for sepolia testnet
npty Jan 10, 2025
738e3d5
chore: remove console.log
npty Jan 10, 2025
57865bb
chore: bump axelarjs-sdk
npty Jan 10, 2025
9cbbfdd
chore: update lock file
npty Jan 10, 2025
02b66d2
chore: add callback type to search gmp api
npty Jan 10, 2025
7a3d0a3
chore: remove log
npty Jan 10, 2025
6f9811f
feat: support vm chains for record interchain token deployment
npty Jan 10, 2025
0d35f0f
chore: fix the its-hub destination chain
npty Jan 10, 2025
e44ac57
fix: Review component
npty Jan 10, 2025
2292766
fix: CanonicalTokenDeployment
npty Jan 10, 2025
9a6fab4
fix: getInterchainTokenDetails
npty Jan 10, 2025
b36c9c7
chore: fix getInterchainTokenRolesForAcction
npty Jan 10, 2025
05f9ea0
chore: fix gmp hooks
npty Jan 10, 2025
a9d1759
chore: fix GMPTxStatusMonitor edge case
npty Jan 10, 2025
eb44a45
fix: support vm chain for SendInterchainToken
npty Jan 10, 2025
af75380
fix: recordRemoteTokensDeployment
npty Jan 10, 2025
e9b1b6b
fix: wagmiConfig in hooks
npty Jan 10, 2025
ad8414a
chore: support vm chain configs in Transactions
npty Jan 10, 2025
973c25d
chore: fix GMPTxStatusMonitor when chain not found
npty Jan 10, 2025
f8d1aa6
chore: fix vm chain overrides evm chain
npty Jan 10, 2025
70a1986
chore: fix vm computes overrides
npty Jan 10, 2025
ad05b00
chore: fix chain not found error in tx monitor
npty Jan 10, 2025
c3483b6
chore: fix lint
npty Jan 13, 2025
68b2eda
chore: support vm chain in connected interchain token page
npty Jan 13, 2025
ebeb77b
chore: fix remaining evm chain config query
npty Jan 13, 2025
10695d7
chore: fix import
npty Jan 13, 2025
fc1a86c
refactor: useAllChainConfigsQuery
npty Jan 14, 2025
61513d7
refactor: add chains array to useAllChainConfigsQuery
npty Jan 14, 2025
29241b4
chore: revert its contract addresses
npty Jan 14, 2025
2ce05b0
chore: remove web-streams-polyfill
npty Jan 14, 2025
155ab44
chore: fix eligible chains and chain name
npty Jan 14, 2025
d95cba0
chore: remove logs and commented code
npty Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: support vm chains in recordInterchainTokenDeployment
npty committed Jan 9, 2025
commit 3c658fd576b758e6cf656d23e8a5dcc5f375ff8b
4 changes: 2 additions & 2 deletions apps/maestro/src/server/context.ts
Original file line number Diff line number Diff line change
@@ -105,8 +105,8 @@ const createContextInner = async ({ req, res }: ContextConfig) => {
createInterchainTokenClient(chain: Chain, address: `0x${string}`) {
return new InterchainTokenClient({ chain, address });
},
createTokenManagerClient(chain: Chain, address: `0x${string}`) {
return new TokenManagerClient({ chain, address });
createTokenManagerClient(chain: Chain, address: string) {
return new TokenManagerClient({ chain, address: address as `0x${string}` });
},
createInterchainTokenServiceClient(
chain: Chain,
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { invariant, Maybe } from "@axelarjs/utils";

import { always } from "rambda";
import { z } from "zod";

@@ -18,41 +17,43 @@ const recordInterchainTokenDeploymentInput = newInterchainTokenSchema
tokenManagerAddress: true,
});

export type RecordInterchainTokenDeploymentInput = z.infer<
typeof recordInterchainTokenDeploymentInput
>;

export const recordInterchainTokenDeployment = protectedProcedure
.input(recordInterchainTokenDeploymentInput)
.mutation(async ({ ctx, input }) => {
invariant(ctx.session?.address, "ctx.session.address is required");

const chains = await ctx.configs.evmChains();
const configs = chains[input.axelarChainId];
const evmChains = await ctx.configs.evmChains();
const vmChains = await ctx.configs.vmChains();
const configs = evmChains[input.axelarChainId] || vmChains[input.axelarChainId];

invariant(configs, `No configuration found for chain ${input.axelarChainId}`);

// Handle different chain types
const createServiceClient = () => {
return ctx.contracts.createInterchainTokenServiceClient(configs.wagmi);
};

const originChainServiceClient =
ctx.contracts.createInterchainTokenServiceClient(configs.wagmi);
const originChainServiceClient = createServiceClient();

const tokenManagerAddress = (await originChainServiceClient.reads
.tokenManagerAddress({
tokenId: input.tokenId as `0x${string}`,
})
.catch(() => null)) as `0x${string}`;

const createTokenManagerClient = (address: string) => {
return ctx.contracts.createTokenManagerClient(configs.wagmi, address);
};

const tokenManagerClient = !tokenManagerAddress
? null
: ctx.contracts.createTokenManagerClient(
configs.wagmi,
tokenManagerAddress
);
: createTokenManagerClient(tokenManagerAddress);

const tokenManagerTypeCode = !tokenManagerClient
? null
: await tokenManagerClient.reads.implementationType().catch(() => null);

const tokenManagerType = Maybe.of(tokenManagerTypeCode).mapOr(
// default to mint_burn for interchain tokens
// and lock_unlock for canonical tokens
input.kind === "canonical" ? "lock_unlock" : "mint_burn",
(value) => getTokenManagerTypeFromBigInt(value as bigint)
);
@@ -69,12 +70,16 @@ export const recordInterchainTokenDeployment = protectedProcedure

const remoteTokens = await Promise.all(
input.destinationAxelarChainIds.map(async (axelarChainId) => {
const chains = await ctx.configs.evmChains();
const configs = chains[axelarChainId];
const chains = {
...await ctx.configs.evmChains(),
...await ctx.configs.vmChains(),
};
const chainConfig = chains[axelarChainId];
invariant(chainConfig, `No configuration found for chain ${axelarChainId}`);

invariant(chainConfig.wagmi, `No wagmi configuration found for chain ${axelarChainId}`);

const itsClient = ctx.contracts.createInterchainTokenServiceClient(
configs.wagmi
);
const itsClient = ctx.contracts.createInterchainTokenServiceClient(chainConfig.wagmi);

const [tokenManagerAddress, tokenAddress] = await Promise.all([
itsClient.reads

Unchanged files with check annotations Beta

}
});
expect(supportedChains.length).toBe(chains.length - 1); // Excluding centrifuge-2 chain because public rpc is not available

Check failure on line 64 in packages/evm/src/clients/clients.spec.ts

GitHub Actions / setup-and-test

src/clients/clients.spec.ts > EVM Clients > should support all testnet chains

AssertionError: expected 21 to be 24 // Object.is equality - Expected + Received - 24 + 21 ❯ src/clients/clients.spec.ts:64:36
});
});