@agoric/orchestration 0.1.1-dev-67275c2.0 → 0.1.1-dev-2e66067.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/package.json +17 -17
- package/src/chain-info.d.ts +11 -2
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +16 -4
- package/src/cosmos-api.d.ts +38 -10
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +39 -10
- package/src/examples/auto-stake-it.contract.d.ts +5 -16
- package/src/examples/auto-stake-it.contract.d.ts.map +1 -1
- package/src/examples/auto-stake-it.contract.js +1 -16
- package/src/examples/basic-flows.contract.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.js +1 -2
- package/src/examples/send-anywhere.contract.d.ts +3 -30
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +1 -17
- package/src/examples/staking-combinations.contract.d.ts +1 -1
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +1 -1
- package/src/examples/swap.contract.d.ts +2 -2
- package/src/examples/swap.contract.d.ts.map +1 -1
- package/src/examples/swap.contract.js +1 -1
- package/src/examples/unbond.contract.d.ts +1 -1
- package/src/examples/unbond.contract.d.ts.map +1 -1
- package/src/examples/unbond.contract.js +1 -1
- package/src/examples/unbond.flows.js +1 -1
- package/src/exos/chain-hub-admin.d.ts +8 -4
- package/src/exos/chain-hub-admin.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.js +15 -2
- package/src/exos/chain-hub.d.ts +1 -1
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +5 -1
- package/src/exos/cosmos-interchain-service.d.ts +70 -19
- package/src/exos/cosmos-interchain-service.d.ts.map +1 -1
- package/src/exos/cosmos-interchain-service.js +13 -6
- package/src/exos/cosmos-orchestration-account.d.ts +5 -0
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +2 -0
- package/src/exos/exo-interfaces.d.ts +27 -0
- package/src/exos/exo-interfaces.d.ts.map +1 -0
- package/src/exos/exo-interfaces.ts +35 -0
- package/src/exos/ica-account-kit.d.ts +3 -1
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/ica-account-kit.js +7 -1
- package/src/exos/icq-connection-kit.d.ts.map +1 -1
- package/src/exos/icq-connection-kit.js +3 -0
- package/src/exos/local-chain-facade.d.ts +4 -1
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +6 -1
- package/src/exos/local-orchestration-account.d.ts +3 -0
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +2 -0
- package/src/exos/orchestrator.d.ts +1 -1
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +1 -1
- package/src/exos/remote-chain-facade.d.ts +1 -1
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +1 -1
- package/src/facade.d.ts +1 -1
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +1 -1
- package/src/orchestration-api.d.ts +45 -8
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +51 -7
- package/src/typeGuards.d.ts +19 -7
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +15 -2
- package/src/types.d.ts +1 -0
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +1 -0
- package/src/utils/start-helper.d.ts +1 -1
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +9 -2
- package/src/vat-orchestration.d.ts +4 -1
- package/src/vat-orchestration.d.ts.map +1 -1
- package/src/vat-orchestration.js +14 -2
|
@@ -13,6 +13,6 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: {
|
|
|
13
13
|
import type { NameHub } from '@agoric/vats';
|
|
14
14
|
import type { Remote } from '@agoric/internal';
|
|
15
15
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
16
|
-
import type { CosmosInterchainService } from '../exos/
|
|
16
|
+
import type { CosmosInterchainService } from '../exos/exo-interfaces.js';
|
|
17
17
|
import type { TimerService } from '@agoric/time';
|
|
18
18
|
//# sourceMappingURL=unbond.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unbond.contract.d.ts","sourceRoot":"","sources":["unbond.contract.js"],"names":[],"mappings":"AAmDA;iBAhCkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;gBACpB,UAAU;kBACR,OAAO,YAAY,CAAC;;;;;GA2BU;6BA5CvB,cAAc;4BACf,kBAAkB;gCAFd,gCAAgC;6CAInB,
|
|
1
|
+
{"version":3,"file":"unbond.contract.d.ts","sourceRoot":"","sources":["unbond.contract.js"],"names":[],"mappings":"AAmDA;iBAhCkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;gBACpB,UAAU;kBACR,OAAO,YAAY,CAAC;;;;;GA2BU;6BA5CvB,cAAc;4BACf,kBAAkB;gCAFd,gCAAgC;6CAInB,2BAA2B;kCALtC,cAAc"}
|
|
@@ -8,7 +8,7 @@ import * as flows from './unbond.flows.js';
|
|
|
8
8
|
* @import {NameHub} from '@agoric/vats';
|
|
9
9
|
* @import {Remote} from '@agoric/internal';
|
|
10
10
|
* @import {Zone} from '@agoric/zone';
|
|
11
|
-
* @import {CosmosInterchainService} from '../exos/
|
|
11
|
+
* @import {CosmosInterchainService} from '../exos/exo-interfaces.js';
|
|
12
12
|
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
13
13
|
*/
|
|
14
14
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @import {NameHub} from '@agoric/vats';
|
|
6
6
|
* @import {Remote} from '@agoric/internal';
|
|
7
7
|
* @import {Zone} from '@agoric/zone';
|
|
8
|
-
* @import {CosmosInterchainService} from '../exos/
|
|
8
|
+
* @import {CosmosInterchainService} from '../exos/exo-interfaces.js';
|
|
9
9
|
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export function prepareChainHubAdmin(zone: Zone, chainHub: ChainHub): import("@endo/exo").Guarded<{
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Register information for a chain
|
|
4
|
+
*
|
|
5
|
+
* @param {string} chainName - must not exist in chainHub
|
|
4
6
|
* @param {CosmosChainInfo} chainInfo
|
|
5
|
-
* @param {IBCConnectionInfo} connectionInfo
|
|
7
|
+
* @param {IBCConnectionInfo} connectionInfo - from Agoric chain
|
|
6
8
|
*/
|
|
7
9
|
initChain(chainName: string, chainInfo: CosmosChainInfo, connectionInfo: IBCConnectionInfo): Promise<void>;
|
|
8
10
|
/**
|
|
@@ -17,9 +19,11 @@ export function prepareChainHubAdmin(zone: Zone, chainHub: ChainHub): import("@e
|
|
|
17
19
|
}>;
|
|
18
20
|
export type ChainHubAdmin = ReturnType<(zone: Zone, chainHub: ChainHub) => import("@endo/exo").Guarded<{
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* Register information for a chain
|
|
23
|
+
*
|
|
24
|
+
* @param {string} chainName - must not exist in chainHub
|
|
21
25
|
* @param {CosmosChainInfo} chainInfo
|
|
22
|
-
* @param {IBCConnectionInfo} connectionInfo
|
|
26
|
+
* @param {IBCConnectionInfo} connectionInfo - from Agoric chain
|
|
23
27
|
*/
|
|
24
28
|
initChain(chainName: string, chainInfo: CosmosChainInfo, connectionInfo: IBCConnectionInfo): Promise<void>;
|
|
25
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"AAgCO,2CAHI,IAAI,YACJ,QAAQ;IAeb;;;;;;OAMG;yBAHQ,MAAM,aACN,eAAe,kBACf,iBAAiB;IAe5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAU3B;4BAEa,UAAU,QAtDb,IAAI,YACJ,QAAQ;IAeb;;;;;;OAMG;yBAHQ,MAAM,aACN,eAAe,kBACf,iBAAiB;IAe5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAYkB;0BA3EvB,cAAc;8BAEG,gBAAgB;qCADI,uBAAuB;uCAAvB,uBAAuB;2BAAvB,uBAAuB;iCAC3C,gBAAgB"}
|
|
@@ -16,6 +16,17 @@ import { DenomDetailShape } from './chain-hub.js';
|
|
|
16
16
|
* developers to add new chain configurations to a local chainHub, in the event
|
|
17
17
|
* the information is not available widely in `agoricNames`.
|
|
18
18
|
*
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* ```js
|
|
22
|
+
* const chainHubAdmin = prepareChainHubAdmin(zone, chainHub);
|
|
23
|
+
* chainHubAdmin.initChain(
|
|
24
|
+
* 'hotNewChain',
|
|
25
|
+
* hotNewChainInfo,
|
|
26
|
+
* agoricTohotNewChainConnectionInfo,
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
19
30
|
* @param {Zone} zone
|
|
20
31
|
* @param {ChainHub} chainHub
|
|
21
32
|
*/
|
|
@@ -33,9 +44,11 @@ export const prepareChainHubAdmin = (zone, chainHub) => {
|
|
|
33
44
|
}),
|
|
34
45
|
{
|
|
35
46
|
/**
|
|
36
|
-
*
|
|
47
|
+
* Register information for a chain
|
|
48
|
+
*
|
|
49
|
+
* @param {string} chainName - must not exist in chainHub
|
|
37
50
|
* @param {CosmosChainInfo} chainInfo
|
|
38
|
-
* @param {IBCConnectionInfo} connectionInfo
|
|
51
|
+
* @param {IBCConnectionInfo} connectionInfo - from Agoric chain
|
|
39
52
|
*/
|
|
40
53
|
async initChain(chainName, chainInfo, connectionInfo) {
|
|
41
54
|
// when() because chainHub methods return vows. If this were inside
|
package/src/exos/chain-hub.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* @typedef {K extends keyof KnownChains
|
|
15
15
|
* ? ChainInfo & Omit<KnownChains[K], 'connections'>
|
|
16
16
|
* : ChainInfo} ActualChainInfo
|
|
17
|
+
* @internal
|
|
17
18
|
*/
|
|
18
19
|
/**
|
|
19
20
|
* @typedef {object} DenomDetail
|
|
@@ -32,7 +33,6 @@ export const CONNECTIONS_KEY: "chainConnection";
|
|
|
32
33
|
/** namehub for assets info */
|
|
33
34
|
export const ASSETS_KEY: "chainAssets";
|
|
34
35
|
export function connectionKey(chainId1: string, chainId2: string): string;
|
|
35
|
-
export function reverseConnInfo(connInfo: IBCConnectionInfo): IBCConnectionInfo;
|
|
36
36
|
export function normalizeConnectionInfo(primaryChainId: string, counterChainId: string, directed: IBCConnectionInfo): [string, IBCConnectionInfo];
|
|
37
37
|
export function makeChainHub(agoricNames: Remote<NameHub>, vowTools: VowTools): import("@endo/exo").Guarded<{
|
|
38
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AAEH
|
|
1
|
+
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CAIlC;AAGF,wCAAwC;AACxC,gCAAiC;AACjC,kCAAkC;AAClC,gDAAiD;AACjD,8BAA8B;AAC9B,uCAAwC;AAqBjC,wCAHI,MAAM,YACN,M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a;qCACyB,kBAAkB;yBADxD,aAAa;2BAGrB,yBAAyB;qCAFqB,kBAAkB;iCAC/C,kBAAkB;+BAAlB,kBAAkB"}
|
package/src/exos/chain-hub.js
CHANGED
|
@@ -24,6 +24,7 @@ import { CosmosChainInfoShape, IBCConnectionInfoShape } from '../typeGuards.js';
|
|
|
24
24
|
* @typedef {K extends keyof KnownChains
|
|
25
25
|
* ? ChainInfo & Omit<KnownChains[K], 'connections'>
|
|
26
26
|
* : ChainInfo} ActualChainInfo
|
|
27
|
+
* @internal
|
|
27
28
|
*/
|
|
28
29
|
|
|
29
30
|
/**
|
|
@@ -40,6 +41,7 @@ export const DenomDetailShape = M.splitRecord(
|
|
|
40
41
|
{ brand: BrandShape },
|
|
41
42
|
);
|
|
42
43
|
|
|
44
|
+
// TODO refactor into an enum-ish object
|
|
43
45
|
/** agoricNames key for ChainInfo hub */
|
|
44
46
|
export const CHAIN_KEY = 'chain';
|
|
45
47
|
/** namehub for connection info */
|
|
@@ -82,7 +84,7 @@ export const connectionKey = (chainId1, chainId2) => {
|
|
|
82
84
|
* @param {IBCConnectionInfo} connInfo
|
|
83
85
|
* @returns {IBCConnectionInfo}
|
|
84
86
|
*/
|
|
85
|
-
|
|
87
|
+
const reverseConnInfo = connInfo => {
|
|
86
88
|
const { transferChannel } = connInfo;
|
|
87
89
|
return {
|
|
88
90
|
id: connInfo.counterparty.connection_id,
|
|
@@ -421,6 +423,8 @@ export const makeChainHub = (agoricNames, vowTools) => {
|
|
|
421
423
|
/** @typedef {ReturnType<typeof makeChainHub>} ChainHub */
|
|
422
424
|
|
|
423
425
|
/**
|
|
426
|
+
* Register assets with the given ChainHub so they are available for lookup
|
|
427
|
+
*
|
|
424
428
|
* @param {ChainHub} chainHub
|
|
425
429
|
* @param {string} name
|
|
426
430
|
* @param {CosmosAssetInfo[]} assets
|
|
@@ -1,21 +1,71 @@
|
|
|
1
|
-
export function prepareCosmosInterchainService(zone: Zone, vowTools: VowTools): (
|
|
1
|
+
export function prepareCosmosInterchainService(zone: Zone, vowTools: VowTools): (powers: Partial<OrchestrationPowers>) => ReturnType<(powers: Partial<OrchestrationPowers>) => import("@endo/exo").GuardedKit<{
|
|
2
|
+
requestICAChannelWatcher: {
|
|
3
|
+
/**
|
|
4
|
+
* @param {Port} port
|
|
5
|
+
* @param {{
|
|
6
|
+
* chainId: string;
|
|
7
|
+
* remoteConnAddr: RemoteIbcAddress;
|
|
8
|
+
* }} watchContext
|
|
9
|
+
*/
|
|
10
|
+
onFulfilled(port: Port, { chainId, remoteConnAddr }: {
|
|
11
|
+
chainId: string;
|
|
12
|
+
remoteConnAddr: RemoteIbcAddress;
|
|
13
|
+
}): Vow<any>;
|
|
14
|
+
};
|
|
15
|
+
requestICQChannelWatcher: {
|
|
16
|
+
/**
|
|
17
|
+
* @param {Port} port
|
|
18
|
+
* @param {{
|
|
19
|
+
* remoteConnAddr: RemoteIbcAddress;
|
|
20
|
+
* icqLookupKey: string;
|
|
21
|
+
* }} watchContext
|
|
22
|
+
*/
|
|
23
|
+
onFulfilled(port: Port, { remoteConnAddr, icqLookupKey }: {
|
|
24
|
+
remoteConnAddr: RemoteIbcAddress;
|
|
25
|
+
icqLookupKey: string;
|
|
26
|
+
}): Vow<any>;
|
|
27
|
+
};
|
|
2
28
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param {IBCConnectionID} controllerConnectionId self connection_id
|
|
7
|
-
* @param {ICAChannelAddressOpts} [opts] optional to configure the
|
|
8
|
-
* channel address, such as version and ordering
|
|
9
|
-
* @returns {Vow<IcaAccount>}
|
|
29
|
+
* Waits for a channel (ICA, ICQ) to open and returns the consumer-facing
|
|
30
|
+
* facet of the ConnectionKit, specified by `returnFacet`. Saves the
|
|
31
|
+
* ConnectionKit if `saveICQConnection` is provided.
|
|
10
32
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
33
|
+
channelOpenWatcher: {
|
|
34
|
+
/**
|
|
35
|
+
* @param {Connection} _connection
|
|
36
|
+
* @param {{
|
|
37
|
+
* connectionKit: ConnectionKit;
|
|
38
|
+
* returnFacet: string;
|
|
39
|
+
* icqLookupKey?: string;
|
|
40
|
+
* }} watchContext
|
|
41
|
+
*/
|
|
42
|
+
onFulfilled(_connection: Connection, { connectionKit, returnFacet, icqLookupKey }: {
|
|
43
|
+
connectionKit: ConnectionKit;
|
|
44
|
+
returnFacet: string;
|
|
45
|
+
icqLookupKey?: string;
|
|
46
|
+
}): any;
|
|
47
|
+
};
|
|
48
|
+
public: {
|
|
49
|
+
/**
|
|
50
|
+
* @satisfies {CosmosInterchainService['makeAccount']}
|
|
51
|
+
* @param {string} chainId
|
|
52
|
+
* @param {IBCConnectionID} hostConnectionId the counterparty
|
|
53
|
+
* connection_id
|
|
54
|
+
* @param {IBCConnectionID} controllerConnectionId self connection_id
|
|
55
|
+
* @param {ICAChannelAddressOpts} [opts] optional to configure the
|
|
56
|
+
* channel address, such as version and ordering
|
|
57
|
+
* @returns {Vow<IcaAccount>}
|
|
58
|
+
*/
|
|
59
|
+
makeAccount(chainId: string, hostConnectionId: IBCConnectionID, controllerConnectionId: IBCConnectionID, opts?: ICAChannelAddressOpts | undefined): Vow<IcaAccount>;
|
|
60
|
+
/**
|
|
61
|
+
* @satisfies {CosmosInterchainService['provideICQConnection']}
|
|
62
|
+
* @param {IBCConnectionID} controllerConnectionId
|
|
63
|
+
* @param {string} [version]
|
|
64
|
+
* @returns {Vow<ICQConnection> | ICQConnection}
|
|
65
|
+
*/
|
|
66
|
+
provideICQConnection(controllerConnectionId: IBCConnectionID, version?: string | undefined): Vow<ICQConnection> | ICQConnection;
|
|
67
|
+
};
|
|
68
|
+
}>>["public"];
|
|
19
69
|
export type OrchestrationPowers = {
|
|
20
70
|
portAllocator: Remote<PortAllocator>;
|
|
21
71
|
/**
|
|
@@ -31,17 +81,18 @@ export type OrchestrationState = {
|
|
|
31
81
|
sharedICQPort: Remote<Port> | undefined;
|
|
32
82
|
} & OrchestrationPowers;
|
|
33
83
|
export type MakeCosmosInterchainService = ReturnType<typeof prepareCosmosInterchainService>;
|
|
34
|
-
export type CosmosInterchainService = ReturnType<MakeCosmosInterchainService>;
|
|
35
84
|
import type { Zone } from '@agoric/base-zone';
|
|
36
85
|
import type { VowTools } from '@agoric/vow';
|
|
86
|
+
import type { Port } from '@agoric/network';
|
|
87
|
+
import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
88
|
+
import type { Vow } from '@agoric/vow';
|
|
89
|
+
import type { Connection } from '@agoric/network';
|
|
37
90
|
import type { IBCConnectionID } from '@agoric/vats';
|
|
38
91
|
import type { ICAChannelAddressOpts } from '../utils/address.js';
|
|
39
92
|
import type { IcaAccount } from '../types.js';
|
|
40
|
-
import type { Vow } from '@agoric/vow';
|
|
41
93
|
import type { ICQConnection } from '../types.js';
|
|
42
94
|
import type { PortAllocator } from '@agoric/network';
|
|
43
95
|
import type { Remote } from '@agoric/internal';
|
|
44
96
|
import type { ICQConnectionKit } from '../types.js';
|
|
45
97
|
import type { IcaAccountKit } from '../types.js';
|
|
46
|
-
import type { Port } from '@agoric/network';
|
|
47
98
|
//# sourceMappingURL=cosmos-interchain-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-interchain-service.d.ts","sourceRoot":"","sources":["cosmos-interchain-service.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cosmos-interchain-service.d.ts","sourceRoot":"","sources":["cosmos-interchain-service.js"],"names":[],"mappings":"AAmQO,qDAJI,IAAI,YACJ,QAAQ;;QA5IX;;;;;;WAMG;0BALQ,IAAI,+BACJ;YACV,OAAW,EAAE,MAAM,CAAC;YACpB,cAAkB,EAAE,gBAAgB,CAAC;SAClC;;;QAgBJ;;;;;;WAMG;0BALQ,IAAI,oCACJ;YACV,cAAkB,EAAE,gBAAgB,CAAC;YACrC,YAAgB,EAAE,MAAM,CAAC;SACtB;;IAkBN;;;;OAIG;;QAED;;;;;;;WAOG;iCANQ,UAAU,gDACV;YACV,aAAiB,EAAE,aAAa,CAAC;YACjC,WAAe,EAAE,MAAM,CAAC;YACxB,YAAgB,CAAC,EAAE,MAAM,CAAC;SACvB;;;QAaJ;;;;;;;;;WASG;6BAPQ,MAAM,oBACN,eAAe,0BAEf,eAAe,6CAGb,IAAI,UAAU,CAAC;QAkB5B;;;;;WAKG;qDAHQ,eAAe,iCAEb,IAAI,aAAa,CAAC,GAAG,aAAa;;cA6DtD;;mBAxPa,OAAO,aAAa,CAAC;;;;;cACrB,SAAS;;iCAIT,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;4BAElC,aAAa,GAAG,gBAAgB;iCAGjC;IACZ,cAAkB,EAAE,kBAAkB,CAAC;IACvC,aAAiB,EAAE,OAAO,IAAI,CAAC,GAAG,SAAS,CAAC;CACzC,GAAG,mBAAmB;0CA8OZ,UAAU,CAAC,OAAO,8BAA8B,CAAC;0BAxQxC,mBAAmB;8BAKV,aAAa;0BAHK,iBAAiB;sCAEhC,iCAAiC;yBACpC,aAAa;gCAHK,iBAAiB;qCACjC,cAAc;2CAIR,qBAAqB;gCADgB,aAAa;mCAAb,aAAa;mCAJxC,iBAAiB;4BAD1C,kBAAkB;sCAKkC,aAAa;mCAAb,aAAa"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/** @file Orchestration service */
|
|
2
2
|
|
|
3
|
+
import { Shape as NetworkShape } from '@agoric/network';
|
|
4
|
+
import { pickFacet } from '@agoric/vat-data';
|
|
3
5
|
import { E } from '@endo/far';
|
|
4
6
|
import { M, mustMatch } from '@endo/patterns';
|
|
5
|
-
import { Shape as NetworkShape } from '@agoric/network';
|
|
6
|
-
import { prepareIcaAccountKit } from './ica-account-kit.js';
|
|
7
|
-
import { prepareICQConnectionKit } from './icq-connection-kit.js';
|
|
8
7
|
import {
|
|
9
8
|
DEFAULT_ICQ_VERSION,
|
|
10
9
|
makeICAChannelAddress,
|
|
11
10
|
makeICQChannelAddress,
|
|
12
11
|
} from '../utils/address.js';
|
|
12
|
+
import { prepareIcaAccountKit } from './ica-account-kit.js';
|
|
13
|
+
import { prepareICQConnectionKit } from './icq-connection-kit.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @import {Zone} from '@agoric/base-zone';
|
|
@@ -183,6 +184,7 @@ const prepareCosmosOrchestrationServiceKit = (
|
|
|
183
184
|
},
|
|
184
185
|
public: {
|
|
185
186
|
/**
|
|
187
|
+
* @satisfies {CosmosInterchainService['makeAccount']}
|
|
186
188
|
* @param {string} chainId
|
|
187
189
|
* @param {IBCConnectionID} hostConnectionId the counterparty
|
|
188
190
|
* connection_id
|
|
@@ -208,6 +210,7 @@ const prepareCosmosOrchestrationServiceKit = (
|
|
|
208
210
|
);
|
|
209
211
|
},
|
|
210
212
|
/**
|
|
213
|
+
* @satisfies {CosmosInterchainService['provideICQConnection']}
|
|
211
214
|
* @param {IBCConnectionID} controllerConnectionId
|
|
212
215
|
* @param {string} [version]
|
|
213
216
|
* @returns {Vow<ICQConnection> | ICQConnection}
|
|
@@ -248,8 +251,11 @@ const prepareCosmosOrchestrationServiceKit = (
|
|
|
248
251
|
);
|
|
249
252
|
|
|
250
253
|
/**
|
|
254
|
+
* Used only by vat-orchestration and tests mocking it
|
|
255
|
+
*
|
|
251
256
|
* @param {Zone} zone
|
|
252
257
|
* @param {VowTools} vowTools
|
|
258
|
+
* @internal
|
|
253
259
|
*/
|
|
254
260
|
export const prepareCosmosInterchainService = (zone, vowTools) => {
|
|
255
261
|
const makeIcaAccountKit = prepareIcaAccountKit(zone, vowTools);
|
|
@@ -262,12 +268,13 @@ export const prepareCosmosInterchainService = (zone, vowTools) => {
|
|
|
262
268
|
makeICQConnectionKit,
|
|
263
269
|
);
|
|
264
270
|
|
|
265
|
-
const makeCosmosInterchainService =
|
|
266
|
-
makeCosmosOrchestrationServiceKit
|
|
271
|
+
const makeCosmosInterchainService = pickFacet(
|
|
272
|
+
makeCosmosOrchestrationServiceKit,
|
|
273
|
+
'public',
|
|
274
|
+
);
|
|
267
275
|
|
|
268
276
|
return makeCosmosInterchainService;
|
|
269
277
|
};
|
|
270
278
|
harden(prepareCosmosInterchainService);
|
|
271
279
|
|
|
272
280
|
/** @typedef {ReturnType<typeof prepareCosmosInterchainService>} MakeCosmosInterchainService */
|
|
273
|
-
/** @typedef {ReturnType<MakeCosmosInterchainService>} CosmosInterchainService */
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @property {ChainAddress} chainAddress
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
+
* @private
|
|
6
7
|
* @typedef {{
|
|
7
8
|
* topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
|
|
8
9
|
* account: IcaAccount;
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
* bondDenom: string;
|
|
14
15
|
* timer: Remote<TimerService>;
|
|
15
16
|
* }} State
|
|
17
|
+
* Internal to the IcaAccountHolder exo
|
|
16
18
|
*/
|
|
17
19
|
/**
|
|
18
20
|
* @typedef {{
|
|
@@ -211,6 +213,9 @@ export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeRe
|
|
|
211
213
|
export type ComosOrchestrationAccountNotification = {
|
|
212
214
|
chainAddress: ChainAddress;
|
|
213
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* Internal to the IcaAccountHolder exo
|
|
218
|
+
*/
|
|
214
219
|
export type State = {
|
|
215
220
|
topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
|
|
216
221
|
account: IcaAccount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAiEA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js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;kCAK7D,cAAc;4BAFpB,kBAAkB;8BAGX,aAAa;kCAP+J,aAAa;qCAYrK,iCAAiC;sCAAjC,iCAAiC;gCAZuH,aAAa;mCAAb,aAAa;+BAAb,aAAa;0BAElM,kDAAkD;mCAOzC,+CAA+C;8BACpD,sBAAsB;iCAV2J,aAAa;yBAOzL,aAAa;uCAP+J,aAAa;2CAAb,aAAa;4CAAb,aAAa;gCAG5L,wDAAwD;iCAFtC,6CAA6C"}
|
|
@@ -69,6 +69,7 @@ const { Vow$ } = NetworkShape; // TODO #9611
|
|
|
69
69
|
*/
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
+
* @private
|
|
72
73
|
* @typedef {{
|
|
73
74
|
* topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
|
|
74
75
|
* account: IcaAccount;
|
|
@@ -79,6 +80,7 @@ const { Vow$ } = NetworkShape; // TODO #9611
|
|
|
79
80
|
* bondDenom: string;
|
|
80
81
|
* timer: Remote<TimerService>;
|
|
81
82
|
* }} State
|
|
83
|
+
* Internal to the IcaAccountHolder exo
|
|
82
84
|
*/
|
|
83
85
|
|
|
84
86
|
/**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IBCConnectionID } from '@agoric/vats';
|
|
2
|
+
import type { Vow } from '@agoric/vow';
|
|
3
|
+
import type { IcaAccount } from '../cosmos-api.ts';
|
|
4
|
+
import type { ICAChannelAddressOpts } from '../utils/address';
|
|
5
|
+
import type { ICQConnection } from './icq-connection-kit';
|
|
6
|
+
/**
|
|
7
|
+
* Authority to make a Cosmos interchain account or an interchain query connection.
|
|
8
|
+
*/
|
|
9
|
+
export interface CosmosInterchainService {
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} chainId
|
|
12
|
+
* @param {IBCConnectionID} hostConnectionId the counterparty
|
|
13
|
+
* connection_id
|
|
14
|
+
* @param {IBCConnectionID} controllerConnectionId self connection_id
|
|
15
|
+
* @param {ICAChannelAddressOpts} [opts] optional to configure the
|
|
16
|
+
* channel address, such as version and ordering
|
|
17
|
+
* @returns {Vow<IcaAccount>}
|
|
18
|
+
*/
|
|
19
|
+
makeAccount(chainId: string, hostConnectionId: IBCConnectionID, controllerConnectionId: IBCConnectionID, opts?: ICAChannelAddressOpts | undefined): Vow<IcaAccount>;
|
|
20
|
+
/**
|
|
21
|
+
* @param {IBCConnectionID} controllerConnectionId
|
|
22
|
+
* @param {string} [version]
|
|
23
|
+
* @returns {Vow<ICQConnection> | ICQConnection}
|
|
24
|
+
*/
|
|
25
|
+
provideICQConnection(controllerConnectionId: IBCConnectionID, version?: string | undefined): Vow<ICQConnection> | ICQConnection;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=exo-interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exo-interfaces.d.ts","sourceRoot":"","sources":["exo-interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;OAQG;IACH,WAAW,CACT,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,eAAe,EACjC,sBAAsB,EAAE,eAAe,EACvC,IAAI,CAAC,EAAE,qBAAqB,GAAG,SAAS,GACvC,GAAG,CAAC,UAAU,CAAC,CAAC;IACnB;;;;OAIG;IACH,oBAAoB,CAClB,sBAAsB,EAAE,eAAe,EACvC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAC3B,GAAG,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC;CACvC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IBCConnectionID } from '@agoric/vats';
|
|
2
|
+
import type { Vow } from '@agoric/vow';
|
|
3
|
+
import type { IcaAccount } from '../cosmos-api.ts';
|
|
4
|
+
import type { ICAChannelAddressOpts } from '../utils/address';
|
|
5
|
+
import type { ICQConnection } from './icq-connection-kit';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Authority to make a Cosmos interchain account or an interchain query connection.
|
|
9
|
+
*/
|
|
10
|
+
export interface CosmosInterchainService {
|
|
11
|
+
/**
|
|
12
|
+
* @param {string} chainId
|
|
13
|
+
* @param {IBCConnectionID} hostConnectionId the counterparty
|
|
14
|
+
* connection_id
|
|
15
|
+
* @param {IBCConnectionID} controllerConnectionId self connection_id
|
|
16
|
+
* @param {ICAChannelAddressOpts} [opts] optional to configure the
|
|
17
|
+
* channel address, such as version and ordering
|
|
18
|
+
* @returns {Vow<IcaAccount>}
|
|
19
|
+
*/
|
|
20
|
+
makeAccount(
|
|
21
|
+
chainId: string,
|
|
22
|
+
hostConnectionId: IBCConnectionID,
|
|
23
|
+
controllerConnectionId: IBCConnectionID,
|
|
24
|
+
opts?: ICAChannelAddressOpts | undefined,
|
|
25
|
+
): Vow<IcaAccount>;
|
|
26
|
+
/**
|
|
27
|
+
* @param {IBCConnectionID} controllerConnectionId
|
|
28
|
+
* @param {string} [version]
|
|
29
|
+
* @returns {Vow<ICQConnection> | ICQConnection}
|
|
30
|
+
*/
|
|
31
|
+
provideICQConnection(
|
|
32
|
+
controllerConnectionId: IBCConnectionID,
|
|
33
|
+
version?: string | undefined,
|
|
34
|
+
): Vow<ICQConnection> | ICQConnection;
|
|
35
|
+
}
|
|
@@ -63,7 +63,9 @@ export function prepareIcaAccountKit(zone: Zone, { watch, asVow }: VowTools): (c
|
|
|
63
63
|
onClose(_connection: Remote<Connection>, reason: unknown): Promise<void>;
|
|
64
64
|
};
|
|
65
65
|
}>;
|
|
66
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Internal to the IcaAccountKit exo
|
|
68
|
+
*/
|
|
67
69
|
export type State = {
|
|
68
70
|
chainId: string;
|
|
69
71
|
port: Port;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ica-account-kit.d.ts","sourceRoot":"","sources":["ica-account-kit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ica-account-kit.d.ts","sourceRoot":"","sources":["ica-account-kit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;GAWG;AA0BI,2CAJI,IAAI,oBACJ,QAAQ;;QAiCX,0BAA0B;yBAAd,MAAM;;;QAMlB,8BAA8B;sBAAhB,YAAY;;;;;QAyB1B;;;;;;;;;WASG;+BALQ,OAAO,EAAE,gDAEP,IAAI,MAAM,CAAC;QAgBxB,+CAA+C;;QAS/C,+CAA+C;;;;QAiB/C;;;;WAIG;2BAHQ,OAAO,UAAU,CAAC,aAClB,eAAe,cACf,gBAAgB;QAiB3B;;;;;;;;;;;;;;;;WAgBG;6BAHQ,OAAO,UAAU,CAAC,UAClB,OAAO;;GAkBvB;;;;oBAtLU;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,IAAQ,EAAE,IAAI,CAAC;IACf,UAAc,EAAE,OAAO,UAAU,CAAC,GAAG,SAAS,CAAC;IAC/C,YAAgB,EAAE,eAAe,GAAG,SAAS,CAAC;IAC9C,sBAA0B,EAAE,MAAM,CAAC;IACnC,aAAiB,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAChD,YAAgB,EAAE,YAAY,GAAG,SAAS,CAAC;IAC3C,iBAAqB,EAAE,OAAO,CAAC;CAC5B;4BA+KU,UAAU,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;0BArN1C,mBAAmB;8BAEF,aAAa;0BADlB,iBAAiB;kCAKT,aAAa;yBAJhB,aAAa;6BAC3B,sBAAsB;4BACvB,8CAA8C;gCAHpC,iBAAiB;4BACZ,aAAa;qCAGD,iCAAiC;sCAAjC,iCAAiC"}
|
|
@@ -26,7 +26,6 @@ import { makeTxPacket, parseTxPacket } from '../utils/packet.js';
|
|
|
26
26
|
|
|
27
27
|
const trace = makeTracer('IcaAccountKit');
|
|
28
28
|
|
|
29
|
-
/** @typedef {'UNPARSABLE_CHAIN_ADDRESS'} UnparsableChainAddress */
|
|
30
29
|
const UNPARSABLE_CHAIN_ADDRESS = 'UNPARSABLE_CHAIN_ADDRESS';
|
|
31
30
|
|
|
32
31
|
export const IcaAccountI = M.interface('IcaAccount', {
|
|
@@ -42,7 +41,9 @@ export const IcaAccountI = M.interface('IcaAccount', {
|
|
|
42
41
|
reactivate: M.call().returns(VowShape),
|
|
43
42
|
});
|
|
44
43
|
|
|
44
|
+
// XXX none of these modifiers are working to exclude this type from api-docs
|
|
45
45
|
/**
|
|
46
|
+
* @private
|
|
46
47
|
* @typedef {{
|
|
47
48
|
* chainId: string;
|
|
48
49
|
* port: Port;
|
|
@@ -53,11 +54,16 @@ export const IcaAccountI = M.interface('IcaAccount', {
|
|
|
53
54
|
* chainAddress: ChainAddress | undefined;
|
|
54
55
|
* isInitiatingClose: boolean;
|
|
55
56
|
* }} State
|
|
57
|
+
* Internal to the IcaAccountKit exo
|
|
58
|
+
* @internal
|
|
56
59
|
*/
|
|
57
60
|
|
|
58
61
|
/**
|
|
62
|
+
* Used only by CosmosInterchainService
|
|
63
|
+
*
|
|
59
64
|
* @param {Zone} zone
|
|
60
65
|
* @param {VowTools} vowTools
|
|
66
|
+
* @internal
|
|
61
67
|
*/
|
|
62
68
|
export const prepareIcaAccountKit = (zone, { watch, asVow }) =>
|
|
63
69
|
zone.exoClassKit(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icq-connection-kit.d.ts","sourceRoot":"","sources":["icq-connection-kit.js"],"names":[],"mappings":"AAoBA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"icq-connection-kit.d.ts","sourceRoot":"","sources":["icq-connection-kit.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AA8BI,8CAJI,IAAI,oBACJ,QAAQ;;;;QAqCX;;;;;WAKG;oBAFQ,SAAS,YAAY,CAAC,EAAE,GACtB,IAAI,SAAS,aAAa,CAAC,EAAE,CAAC;;;QAc3C,wDAAwD;yBAA5C,MAAM;;;QAMlB;;;;WAIG;2BAHQ,OAAO,UAAU,CAAC,aAClB,eAAe,cACf,gBAAgB;;;GAahC;oCArGU;IACZ,IAAQ,EAAE,IAAI,CAAC;IACf,UAAc,EAAE,OAAO,UAAU,CAAC,GAAG,SAAS,CAAC;IAC/C,YAAgB,EAAE,eAAe,GAAG,SAAS,CAAC;IAC9C,aAAiB,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC7C;+BAkGU,UAAU,CAAC,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;4BACtD,gBAAgB,CAAC,YAAY,CAAC;0BAzHrB,mBAAmB;8BAEF,aAAa;0BADlB,iBAAiB;kCAGN,+CAA+C;8BADlE,sBAAsB;mCACH,+CAA+C;yBAFrD,aAAa;gCADlB,iBAAiB;4BACZ,aAAa;qCAGD,iCAAiC;sCAAjC,iCAAiC"}
|
|
@@ -34,6 +34,8 @@ export const ICQConnectionI = M.interface('ICQConnection', {
|
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
+
* Used only by CosmosInterchainService
|
|
38
|
+
*
|
|
37
39
|
* Prepares an ICQ Connection Kit based on the
|
|
38
40
|
* {@link https://github.com/cosmos/ibc-apps/blob/e9b46e4bf0ad0a66cf6bc53b5e5496f6e2b4b02b/modules/async-icq/README.md | `icq/v1` IBC application protocol}.
|
|
39
41
|
*
|
|
@@ -48,6 +50,7 @@ export const ICQConnectionI = M.interface('ICQConnection', {
|
|
|
48
50
|
*
|
|
49
51
|
* @param {Zone} zone
|
|
50
52
|
* @param {VowTools} vowTools
|
|
53
|
+
* @internal
|
|
51
54
|
*/
|
|
52
55
|
export const prepareICQConnectionKit = (zone, { watch, asVow }) =>
|
|
53
56
|
zone.exoClassKit(
|
|
@@ -174,6 +174,9 @@ export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowe
|
|
|
174
174
|
}>;
|
|
175
175
|
};
|
|
176
176
|
}>>["public"];
|
|
177
|
+
/**
|
|
178
|
+
* Chain facade methods unique to the Agoric (local) chain.
|
|
179
|
+
*/
|
|
177
180
|
export type AgoricChainMethods = {
|
|
178
181
|
/**
|
|
179
182
|
* Get asset info from
|
|
@@ -203,7 +206,7 @@ import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
|
|
|
203
206
|
import type { ChainAddress } from '../types.js';
|
|
204
207
|
import type { Remote } from '@agoric/internal';
|
|
205
208
|
import type { MakeLocalOrchestrationAccountKit } from './local-orchestration-account.js';
|
|
206
|
-
import type { CosmosInterchainService } from './
|
|
209
|
+
import type { CosmosInterchainService } from './exo-interfaces.js';
|
|
207
210
|
import type { NameHub } from '@agoric/vats';
|
|
208
211
|
import type { TimerService } from '@agoric/time';
|
|
209
212
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AA4LO,8CAJI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;QApFzB,6DAA6D;uBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;QAWzD,iEAAiE;;;;;;;;;;;;;;;;;;;QAIjE,8DAA8D;;;;QAe9D;;WAEG;4BADQ,SAAS,EAAE;;;QAWtB;;WAEG;wCADQ,CAAC,iBAAiB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAWrD;;;;;;WAMG;+BALQ,OAAO,WAAW,CAAC,wBACnB;YACV,OAAW,EAAE,iBAAiB,CAAC;YAC/B,OAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;SAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BX;;;;;;;;;;;uBAnKa,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;;qCAO3B;IACZ,gCAAoC,EAAE,gCAAgC,CAAC;IACvE,aAAiB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACnD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;IAChC,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,QAAY,EAAE,QAAQ,CAAC;CACpB;mCAuJU,UAAU,CAAC,OAAO,uBAAuB,CAAC;+BAC1C,UAAU,CAAC,oBAAoB,CAAC;0BAvLvB,mBAAmB;uCASiE,aAAa;yBAHxF,aAAa;kDAEoC,kCAAkC;+BAJvF,8BAA8B;uCADG,gCAAgC;kCAMc,aAAa;4BAP/F,kBAAkB;sDAMsC,kCAAkC;6CADzE,qBAAqB;6BAFrC,cAAc;kCAJT,cAAc;gCAEgB,gCAAgC;8BAG7D,aAAa"}
|
|
@@ -17,12 +17,14 @@ import { chainFacadeMethods, TypedJsonShape } from '../typeGuards.js';
|
|
|
17
17
|
* @import {AssetInfo} from '@agoric/vats/src/vat-bank.js';
|
|
18
18
|
* @import {NameHub} from '@agoric/vats';
|
|
19
19
|
* @import {Vow, VowTools} from '@agoric/vow';
|
|
20
|
-
* @import {CosmosInterchainService} from './
|
|
20
|
+
* @import {CosmosInterchainService} from './exo-interfaces.js';
|
|
21
21
|
* @import {LocalOrchestrationAccountKit, MakeLocalOrchestrationAccountKit} from './local-orchestration-account.js';
|
|
22
22
|
* @import {Chain, ChainAddress, ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount} from '../types.js';
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
+
* Chain facade methods unique to the Agoric (local) chain.
|
|
27
|
+
*
|
|
26
28
|
* @typedef {object} AgoricChainMethods
|
|
27
29
|
* @property {() => Promise<AssetInfo[]>} getVBankAssetInfo Get asset info from
|
|
28
30
|
* agoricNames.vbankAsset.
|
|
@@ -178,8 +180,11 @@ const prepareLocalChainFacadeKit = (
|
|
|
178
180
|
harden(prepareLocalChainFacadeKit);
|
|
179
181
|
|
|
180
182
|
/**
|
|
183
|
+
* Used only by `withOrchestration` helper
|
|
184
|
+
*
|
|
181
185
|
* @param {Zone} zone
|
|
182
186
|
* @param {LocalChainFacadePowers} powers
|
|
187
|
+
* @internal
|
|
183
188
|
*/
|
|
184
189
|
export const prepareLocalChainFacade = (zone, powers) => {
|
|
185
190
|
const makeLocalChainFacadeKit = prepareLocalChainFacadeKit(zone, powers);
|
|
@@ -229,6 +229,9 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
229
229
|
export type LocalChainAccountNotification = {
|
|
230
230
|
address: string;
|
|
231
231
|
};
|
|
232
|
+
/**
|
|
233
|
+
* Internal to the LocalOrchestrationAccount exo
|
|
234
|
+
*/
|
|
232
235
|
export type State = {
|
|
233
236
|
topicKit: RecorderKit<LocalChainAccountNotification>;
|
|
234
237
|
packetTools: PacketTools;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"AA8FO,0DATI,IAAI,0EAEZ;IAAgC,eAAe,EAAvC,eAAe;IACH,GAAG,EAAf,GAAG;IAC0B,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACS,QAAQ,EAAzB,QAAQ;IACmB,UAAU,EAArC,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