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

10445 transfer pfm #10448

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions multichain-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@cosmjs/stargate": "^0.32.4",
"@endo/errors": "^1.2.5",
"@endo/far": "^1.1.5",
"@endo/init": "1.1.4",
"@endo/nat": "^5.0.10",
"@endo/ses-ava": "^1.2.5",
"@types/eslint": "^8",
Expand Down
1 change: 1 addition & 0 deletions multichain-testing/scripts/fetch-starship-chain-info.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env tsx
/* eslint-env node */

import '@endo/init';
import fsp from 'node:fs/promises';
import prettier from 'prettier';

Expand Down
3 changes: 2 additions & 1 deletion multichain-testing/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ __metadata:
languageName: node
linkType: hard

"@endo/init@npm:^1.1.2, @endo/init@npm:^1.1.4":
"@endo/init@npm:1.1.4, @endo/init@npm:^1.1.2, @endo/init@npm:^1.1.4":
version: 1.1.4
resolution: "@endo/init@npm:1.1.4"
dependencies:
Expand Down Expand Up @@ -3902,6 +3902,7 @@ __metadata:
"@cosmjs/stargate": "npm:^0.32.4"
"@endo/errors": "npm:^1.2.5"
"@endo/far": "npm:^1.1.5"
"@endo/init": "npm:1.1.4"
"@endo/nat": "npm:^5.0.10"
"@endo/ses-ava": "npm:^1.2.5"
"@types/eslint": "npm:^8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@ Generated by [AVA](https://avajs.dev).
[
[
'published.agoricNames.chain.agoric',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"agoric\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"agoric-3\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ubld\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"agoric\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"agoric-3\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ubld\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.celestia',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"celestia\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"celestia\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"utia\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"celestia\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"celestia\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"utia\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.cosmoshub',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"cosmos\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"cosmoshub-4\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uatom\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"cosmos\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"cosmoshub-4\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uatom\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.dydx',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"dydx\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"dydx-mainnet-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"adydx\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"dydx\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"dydx-mainnet-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"adydx\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.juno',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"juno\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"juno-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ujuno\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"juno\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"juno-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ujuno\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.neutron',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"neutron\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"neutron-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"untrn\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"neutron\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"neutron-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"untrn\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.noble',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"noble\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"noble-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"noble\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"noble-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.omniflixhub',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"omniflix\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"omniflixhub-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uflix\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"omniflix\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"omniflixhub-1\\\\\\",\\\\\\"icqEnabled\\\\\\":true,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uflix\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.osmosis',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"osmo\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"osmosis-1\\\\\\",\\\\\\"icqEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uosmo\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"osmo\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"osmosis-1\\\\\\",\\\\\\"icqEnabled\\\\\\":true,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uosmo\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.secretnetwork',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"secret\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"secret-4\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uscrt\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"secret\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"secret-4\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uscrt\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.stargaze',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"stars\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"stargaze-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ustars\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"stars\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"stargaze-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ustars\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.stride',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"stride\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"stride-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ustrd\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"stride\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"stride-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ustrd\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chain.umee',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"umee\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"umee-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uumee\\\\\\"}]}\\",\\"slots\\":[]}"]}',
'{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"bech32Prefix\\\\\\":\\\\\\"umee\\\\\\",\\\\\\"chainId\\\\\\":\\\\\\"umee-1\\\\\\",\\\\\\"icqEnabled\\\\\\":false,\\\\\\"pfmEnabled\\\\\\":true,\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"uumee\\\\\\"}]}\\",\\"slots\\":[]}"]}',
],
[
'published.agoricNames.chainConnection.agoric-3_cosmoshub-4',
Expand Down
Binary file not shown.
16 changes: 7 additions & 9 deletions packages/boot/test/orchestration/contract-upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ test('resume', async t => {

t.log('start sendAnywhere');
await evalProposal(
buildProposal(
'@agoric/builders/scripts/testing/start-buggy-sendAnywhere.js',
),
buildProposal('@agoric/builders/scripts/testing/start-send-anywhere.js'),
);

t.log('making offer');
Expand All @@ -70,23 +68,23 @@ test('resume', async t => {

// XXX golden test
const getLogged = () =>
JSON.parse(storage.data.get('published.sendAnywhere.log')!).values;
JSON.parse(storage.data.get('published.send-anywhere.log')!).values;

// This log shows the flow started, but didn't get past the name lookup
t.deepEqual(getLogged(), ['sending {0} from cosmoshub to cosmos1whatever']);

t.log('upgrade sendAnywhere with fix');
await evalProposal(
buildProposal('@agoric/builders/scripts/testing/fix-buggy-sendAnywhere.js'),
);

t.deepEqual(getLogged(), [
'sending {0} from cosmoshub to cosmos1whatever',
'got info for denoms: ibc/toyatom, ibc/toyusdc, ubld, uist',
'got info for chain: cosmoshub cosmoshub-4',
'completed transfer to localAccount',
]);

t.log('upgrade sendAnywhere with fix');
await evalProposal(
buildProposal('@agoric/builders/scripts/testing/upgrade-send-anywhere.js'),
);

// simulate ibc/MsgTransfer ack from remote chain, enabling `.transfer()` promise
// to resolve
await runInbound(
Expand Down
7 changes: 7 additions & 0 deletions packages/builders/scripts/testing/start-send-anywhere.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ const trace = makeTracer('StartSA', true);
* sendAnywhere: Installation<StartFn>;
* };
* };
* issuer: {
* consume: {
* BLD: Brand<'nat'>;
* IST: Brand<'nat'>;
* USDC: Brand<'nat'>;
* };
* };
* }} powers
*/
export const startSendAnywhere = async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {
makeTracer,
NonNullish,
} from '@agoric/internal';
import { E, Far } from '@endo/far';
import { E } from '@endo/far';

/// <reference types="@agoric/vats/src/core/types-ambient"/>
/**
* @import {Installation, Instance} from '@agoric/zoe/src/zoeService/utils.js';
*/

const trace = makeTracer('FixBuggySA', true);
const trace = makeTracer('UpgradeSA', true);

/**
* @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
Expand All @@ -30,7 +30,7 @@ const trace = makeTracer('FixBuggySA', true);
* }} powers
* @param {...any} rest
*/
export const fixSendAnywhere = async (
export const upgradeSendAnywhere = async (
{
consume: {
agoricNames,
Expand All @@ -45,50 +45,43 @@ export const fixSendAnywhere = async (
},
{ options: { sendAnywhereRef } },
) => {
trace(fixSendAnywhere.name);
trace(upgradeSendAnywhere.name);

const saInstance = await instances.consume.sendAnywhere;
trace('saInstance', saInstance);
const saKit = await E(contractKits).get(saInstance);

const marshaller = await E(board).getReadonlyMarshaller();

// This apparently pointless wrapper is to maintain structural parity
// with the buggy core-eval's wrapper to make lookup() hang.
const agoricNamesResolves = Far('agoricNames that resolves', {
lookup: async (...args) => {
return E(agoricNames).lookup(...args);
},
});

const privateArgs = await deeplyFulfilledObject(
harden({
agoricNames: agoricNamesResolves,
agoricNames,
localchain,
marshaller,
orchestrationService: cosmosInterchainService,
storageNode: E(NonNullish(await chainStorage)).makeChildNode(
'sendAnywhere',
'send-anywhere',
),
timerService: chainTimerService,
}),
);

trace('upgrading...');
trace('ref', sendAnywhereRef);
await E(saKit.adminFacet).upgradeContract(
sendAnywhereRef.bundleID,
privateArgs,
);

trace('done');
};
harden(fixSendAnywhere);
harden(upgradeSendAnywhere);

export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
console.log('sendAnywhereRef', sendAnywhereRef);
return {
manifest: {
[fixSendAnywhere.name]: {
[upgradeSendAnywhere.name]: {
consume: {
agoricNames: true,
board: true,
Expand Down Expand Up @@ -120,7 +113,7 @@ export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
export const defaultProposalBuilder = async ({ publishRef, install }) =>
harden({
// Somewhat unorthodox, source the exports from this builder module
sourceSpec: '@agoric/builders/scripts/testing/fix-buggy-sendAnywhere.js',
sourceSpec: '@agoric/builders/scripts/testing/upgrade-send-anywhere.js',
getManifestCall: [
'getManifestForValueVow',
{
Expand All @@ -139,5 +132,5 @@ export default async (homeP, endowments) => {
const dspModule = await import('@agoric/deploy-script-support');
const { makeHelpers } = dspModule;
const { writeCoreEval } = await makeHelpers(homeP, endowments);
await writeCoreEval(fixSendAnywhere.name, defaultProposalBuilder);
await writeCoreEval(upgradeSendAnywhere.name, defaultProposalBuilder);
};
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ Generated by [AVA](https://avajs.dev).
icqEnabled: Object @match:kind {
payload: 'boolean',
},
pfmEnabled: Object @match:kind {
payload: 'boolean',
},
stakingTokens: Object @match:arrayOf {
payload: [
{
Expand Down Expand Up @@ -527,5 +530,6 @@ Generated by [AVA](https://avajs.dev).
denomHash: Function denomHash {},
prepareChainHubAdmin: Function prepareChainHubAdmin {},
prepareCosmosInterchainService: Function prepareCosmosInterchainService {},
registerKnownChainsAndAssets: AsyncFunction {},
withOrchestration: Function withOrchestration {},
}
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/orchestration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export * from './src/typeGuards.js';
export * from './src/utils/denomHash.js';

export { withOrchestration } from './src/utils/start-helper.js';

export { registerKnownChainsAndAssets } from './src/utils/chain-hub-helper.js';
1 change: 1 addition & 0 deletions packages/orchestration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@cosmjs/proto-signing": "^0.32.3",
"@endo/bundle-source": "^3.4.2",
"@endo/import-bundle": "^1.3.1",
"@endo/init": "^1.1.6",
"@endo/ses-ava": "^1.2.7",
"ava": "^5.3.1",
"c8": "^9.1.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/orchestration/scripts/fetch-chain-info.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env tsx
#!/usr/bin/env TS_BLANK_SPACE_EMIT=false node --import ts-blank-space/register
/** @file Fetch canonical chain info to generate the minimum needed for agoricNames */
import '@endo/init';
import { ChainRegistryClient } from '@chain-registry/client';
import fsp from 'node:fs/promises';
import prettier from 'prettier';
Expand Down
45 changes: 45 additions & 0 deletions packages/orchestration/src/chain-capabilities.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @file Contains ChainInfo that not available from a well-known chain registry.
*
* This is used to seed `agoricNames` and `ChainHub`. However, the data is
* dynamic and can change over time. (Remote chains can choose to add or
* remove ibc application modules with chain software upgrades and change
* allowlist settings.)
*
* Developers should use `ChainHubAdmin` as part of their creator or governed
* facet if they wish to have fine-grained control over the data in their
* local `ChainHub`.
*
* Last Updated November 11, 2024
*/

/** @import {KnownChains} from '@agoric/orchestration'; */

/**
* Chains with the async-icq (icq-1) module available.
*
* @satisfies {(keyof KnownChains)[]}
*/
export const ICQ_ENABLED = /** @type {const} } */ ['omniflixhub', 'osmosis'];
harden(ICQ_ENABLED);

/**
* Chains with the packet-forward-middleware module available.
*
* @satisfies {(keyof KnownChains)[]}
*/
export const PFM_ENABLED = /** @type {const} } */ [
'agoric',
'celestia',
'cosmoshub',
'juno',
'neutron',
'noble',
'omniflixhub',
'osmosis',
'secretnetwork',
'stargaze',
'stride',
'umee',
];
harden(PFM_ENABLED);
27 changes: 26 additions & 1 deletion packages/orchestration/src/cosmos-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import type { Port } from '@agoric/network';
import type {
IBCChannelID,
IBCConnectionID,
IBCPortID,
VTransferIBCEvent,
} from '@agoric/vats';
import type {
Expand Down Expand Up @@ -97,7 +98,11 @@ export type CosmosChainInfo = Readonly<{
connections?: Record<string, IBCConnectionInfo>; // chainId or wellKnownName
// UNTIL https://github.com/Agoric/agoric-sdk/issues/9326
icqEnabled?: boolean;

/**
* Note: developers must provide this value themselves for `.transfer` to work
* as expected. Please see examples for details.
*/
pfmEnabled?: boolean;
/**
* cf https://github.com/cosmos/chain-registry/blob/master/chain.schema.json#L117
*/
Expand Down Expand Up @@ -348,3 +353,23 @@ export type CosmosChainAccountMethods<CCI extends CosmosChainInfo> =
export type ICQQueryFunction = (
msgs: JsonSafe<RequestQuery>[],
) => Promise<JsonSafe<ResponseQuery>[]>;

/**
* Message structure for PFM memo
*
* @see {@link https://github.com/cosmos/chain-registry/blob/58b603bbe01f70e911e3ad2bdb6b90c4ca665735/_memo_keys/ICS20_memo_keys.json#L38-L60}
*/
export interface ForwardInfo {
forward: {
receiver: ChainAddress['value'];
port: IBCPortID;
channel: IBCChannelID;
// TODO type me better e.g. '30min'
timeout: string;
/** default is 3? */
retries: number;
next?: {
forward: ForwardInfo;
};
};
}
Loading
Loading