@agoric/orchestration 0.1.1-dev-0889e20.0 → 0.1.1-dev-81ac381.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/package.json +16 -16
- package/src/cosmos-api.d.ts +12 -0
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +15 -0
- package/src/examples/auto-stake-it-tap-kit.d.ts +49 -0
- package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -0
- package/src/examples/auto-stake-it-tap-kit.js +157 -0
- package/src/examples/auto-stake-it.contract.d.ts +45 -0
- package/src/examples/auto-stake-it.contract.d.ts.map +1 -0
- package/src/examples/auto-stake-it.contract.js +188 -0
- package/src/examples/basic-flows.contract.d.ts +14 -5
- package/src/examples/basic-flows.contract.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.js +74 -12
- package/src/examples/sendAnywhere.contract.d.ts +3 -9
- package/src/examples/sendAnywhere.contract.d.ts.map +1 -1
- package/src/examples/sendAnywhere.contract.js +3 -35
- package/src/examples/stakeBld.contract.d.ts +21 -0
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.d.ts +21 -0
- package/src/exos/chain-hub-admin.d.ts.map +1 -0
- package/src/exos/chain-hub-admin.js +56 -0
- package/src/exos/local-chain-facade.d.ts +42 -0
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.d.ts +22 -0
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +10 -3
- package/src/exos/portfolio-holder-kit.d.ts +64 -0
- package/src/exos/portfolio-holder-kit.d.ts.map +1 -0
- package/src/exos/portfolio-holder-kit.js +174 -0
- package/src/proposals/start-stakeBld.d.ts +21 -0
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/utils/time.d.ts +1 -0
- package/src/utils/time.d.ts.map +1 -1
- package/src/utils/time.js +1 -0
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
6
6
|
import { M, mustMatch } from '@endo/patterns';
|
|
7
|
-
import {
|
|
7
|
+
import { withOrchestration } from '../utils/start-helper.js';
|
|
8
|
+
import { preparePortfolioHolder } from '../exos/portfolio-holder-kit.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
* @import {
|
|
11
|
-
* @import {Orchestrator} from '@agoric/orchestration';
|
|
12
|
-
* @import {
|
|
11
|
+
* @import {Zone} from '@agoric/zone';
|
|
12
|
+
* @import {OrchestrationAccount, Orchestrator} from '@agoric/orchestration';
|
|
13
|
+
* @import {ResolvedPublicTopic} from '@agoric/zoe/src/contractSupport/topics.js';
|
|
13
14
|
* @import {OrchestrationPowers} from '../utils/start-helper.js';
|
|
15
|
+
* @import {MakePortfolioHolder} from '../exos/portfolio-holder-kit.js';
|
|
16
|
+
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
14
17
|
*/
|
|
15
18
|
|
|
16
19
|
/**
|
|
@@ -30,19 +33,63 @@ const makeOrchAccountHandler = async (orch, _ctx, seat, { chainName }) => {
|
|
|
30
33
|
return cosmosAccount.asContinuingOffer();
|
|
31
34
|
};
|
|
32
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Create accounts on multiple chains and return them in a single continuing
|
|
38
|
+
* offer with invitations makers for Delegate, WithdrawRewards, Transfer, etc.
|
|
39
|
+
* Calls to the underlying invitationMakers are proxied through the
|
|
40
|
+
* `MakeInvitation` invitation maker.
|
|
41
|
+
*
|
|
42
|
+
* @param {Orchestrator} orch
|
|
43
|
+
* @param {MakePortfolioHolder} makePortfolioHolder
|
|
44
|
+
* @param {ZCFSeat} seat
|
|
45
|
+
* @param {{ chainNames: string[] }} offerArgs
|
|
46
|
+
*/
|
|
47
|
+
const makePortfolioAcctHandler = async (
|
|
48
|
+
orch,
|
|
49
|
+
makePortfolioHolder,
|
|
50
|
+
seat,
|
|
51
|
+
{ chainNames },
|
|
52
|
+
) => {
|
|
53
|
+
seat.exit(); // no funds exchanged
|
|
54
|
+
mustMatch(chainNames, M.arrayOf(M.string()));
|
|
55
|
+
const allChains = await Promise.all(chainNames.map(n => orch.getChain(n)));
|
|
56
|
+
const allAccounts = await Promise.all(allChains.map(c => c.makeAccount()));
|
|
57
|
+
|
|
58
|
+
const accountEntries = harden(
|
|
59
|
+
/** @type {[string, OrchestrationAccount<any>][]} */ (
|
|
60
|
+
chainNames.map((chainName, index) => [chainName, allAccounts[index]])
|
|
61
|
+
),
|
|
62
|
+
);
|
|
63
|
+
const publicTopicEntries = harden(
|
|
64
|
+
/** @type {[string, ResolvedPublicTopic<unknown>][]} */ (
|
|
65
|
+
await Promise.all(
|
|
66
|
+
accountEntries.map(async ([name, account]) => {
|
|
67
|
+
const { account: topicRecord } = await account.getPublicTopics();
|
|
68
|
+
return [name, topicRecord];
|
|
69
|
+
}),
|
|
70
|
+
)
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
const portfolioHolder = makePortfolioHolder(
|
|
74
|
+
accountEntries,
|
|
75
|
+
publicTopicEntries,
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
return portfolioHolder.asContinuingOffer();
|
|
79
|
+
};
|
|
80
|
+
|
|
33
81
|
/**
|
|
34
82
|
* @param {ZCF} zcf
|
|
35
83
|
* @param {OrchestrationPowers & {
|
|
36
84
|
* marshaller: Marshaller;
|
|
37
|
-
* }}
|
|
38
|
-
* @param {
|
|
85
|
+
* }} _privateArgs
|
|
86
|
+
* @param {Zone} zone
|
|
87
|
+
* @param {OrchestrationTools} tools
|
|
39
88
|
*/
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
privateArgs,
|
|
45
|
-
privateArgs.marshaller,
|
|
89
|
+
const contract = async (zcf, _privateArgs, zone, { orchestrate, vowTools }) => {
|
|
90
|
+
const makePortfolioHolder = preparePortfolioHolder(
|
|
91
|
+
zone.subZone('portfolio'),
|
|
92
|
+
vowTools,
|
|
46
93
|
);
|
|
47
94
|
|
|
48
95
|
const makeOrchAccount = orchestrate(
|
|
@@ -51,10 +98,17 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
51
98
|
makeOrchAccountHandler,
|
|
52
99
|
);
|
|
53
100
|
|
|
101
|
+
const makePortfolioAccount = orchestrate(
|
|
102
|
+
'makePortfolioAccount',
|
|
103
|
+
makePortfolioHolder,
|
|
104
|
+
makePortfolioAcctHandler,
|
|
105
|
+
);
|
|
106
|
+
|
|
54
107
|
const publicFacet = zone.exo(
|
|
55
108
|
'Basic Flows Public Facet',
|
|
56
109
|
M.interface('Basic Flows PF', {
|
|
57
110
|
makeOrchAccountInvitation: M.callWhen().returns(InvitationShape),
|
|
111
|
+
makePortfolioAccountInvitation: M.callWhen().returns(InvitationShape),
|
|
58
112
|
}),
|
|
59
113
|
{
|
|
60
114
|
makeOrchAccountInvitation() {
|
|
@@ -63,10 +117,18 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
63
117
|
'Make an Orchestration Account',
|
|
64
118
|
);
|
|
65
119
|
},
|
|
120
|
+
makePortfolioAccountInvitation() {
|
|
121
|
+
return zcf.makeInvitation(
|
|
122
|
+
makePortfolioAccount,
|
|
123
|
+
'Make an Orchestration Account',
|
|
124
|
+
);
|
|
125
|
+
},
|
|
66
126
|
},
|
|
67
127
|
);
|
|
68
128
|
|
|
69
129
|
return { publicFacet };
|
|
70
130
|
};
|
|
71
131
|
|
|
132
|
+
export const start = withOrchestration(contract);
|
|
133
|
+
|
|
72
134
|
/** @typedef {typeof start} BasicFlowsSF */
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* @import {Remote, Vow} from '@agoric/vow';
|
|
6
6
|
* @import {Zone} from '@agoric/zone';
|
|
7
7
|
* @import {VBankAssetDetail} from '@agoric/vats/tools/board-utils.js';
|
|
8
|
-
* @import {CosmosChainInfo, IBCConnectionInfo} from '../cosmos-api';
|
|
9
8
|
* @import {CosmosInterchainService} from '../exos/cosmos-interchain-service.js';
|
|
10
9
|
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
11
10
|
*/
|
|
@@ -29,18 +28,14 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
29
28
|
}>>;
|
|
30
29
|
}>;
|
|
31
30
|
creatorFacet: import("@endo/exo").Guarded<{
|
|
32
|
-
|
|
33
|
-
* @param {CosmosChainInfo} chainInfo
|
|
34
|
-
* @param {IBCConnectionInfo} connectionInfo
|
|
35
|
-
*/
|
|
36
|
-
addChain(chainInfo: Readonly<{
|
|
31
|
+
initChain(chainName: string, chainInfo: Readonly<{
|
|
37
32
|
chainId: string;
|
|
38
|
-
connections?: Record<string, IBCConnectionInfo>;
|
|
33
|
+
connections?: Record<string, import("../cosmos-api.js").IBCConnectionInfo>;
|
|
39
34
|
icqEnabled?: boolean;
|
|
40
35
|
stakingTokens?: Readonly<Array<{
|
|
41
36
|
denom: string;
|
|
42
37
|
}>>;
|
|
43
|
-
}>, connectionInfo: IBCConnectionInfo): Promise<
|
|
38
|
+
}>, connectionInfo: import("../cosmos-api.js").IBCConnectionInfo): Promise<void>;
|
|
44
39
|
}>;
|
|
45
40
|
}>;
|
|
46
41
|
export type OrchestrationPowers = {
|
|
@@ -51,7 +46,6 @@ export type OrchestrationPowers = {
|
|
|
51
46
|
agoricNames: Remote<NameHub>;
|
|
52
47
|
};
|
|
53
48
|
import type { Vow } from '@agoric/vow';
|
|
54
|
-
import type { IBCConnectionInfo } from '../cosmos-api';
|
|
55
49
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
56
50
|
import type { Remote } from '@agoric/vow';
|
|
57
51
|
import type { CosmosInterchainService } from '../exos/cosmos-interchain-service.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAUA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AAEH,kEAKE;AAqEF;gBA9DiB,UAAU;;;;;;;;;;;;;;;;;;GA8DsB;kCAnFpC;IACZ,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,oBAAwB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC1D,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;yBAd0B,aAAa;gCAFd,gCAAgC;4BAE/B,aAAa;6CAGD,sCAAsC;kCANjD,cAAc;6BAEnB,cAAc"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { makeStateRecord } from '@agoric/async-flow';
|
|
2
2
|
import { AmountShape } from '@agoric/ertp';
|
|
3
|
-
import { heapVowE } from '@agoric/vow/vat.js';
|
|
4
3
|
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
5
4
|
import { Fail } from '@endo/errors';
|
|
6
5
|
import { E } from '@endo/far';
|
|
7
6
|
import { M } from '@endo/patterns';
|
|
8
|
-
import { CosmosChainInfoShape } from '../typeGuards.js';
|
|
9
7
|
import { withOrchestration } from '../utils/start-helper.js';
|
|
10
8
|
import { orchestrationFns } from './sendAnywhereFlows.js';
|
|
9
|
+
import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* @import {TimerService} from '@agoric/time';
|
|
@@ -16,7 +15,6 @@ import { orchestrationFns } from './sendAnywhereFlows.js';
|
|
|
16
15
|
* @import {Remote, Vow} from '@agoric/vow';
|
|
17
16
|
* @import {Zone} from '@agoric/zone';
|
|
18
17
|
* @import {VBankAssetDetail} from '@agoric/vats/tools/board-utils.js';
|
|
19
|
-
* @import {CosmosChainInfo, IBCConnectionInfo} from '../cosmos-api';
|
|
20
18
|
* @import {CosmosInterchainService} from '../exos/cosmos-interchain-service.js';
|
|
21
19
|
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
22
20
|
*/
|
|
@@ -60,6 +58,8 @@ const contract = async (
|
|
|
60
58
|
},
|
|
61
59
|
);
|
|
62
60
|
|
|
61
|
+
const creatorFacet = prepareChainHubAdmin(zone, chainHub);
|
|
62
|
+
|
|
63
63
|
// TODO should be a provided helper
|
|
64
64
|
/** @type {(brand: Brand) => Vow<VBankAssetDetail>} */
|
|
65
65
|
const findBrandInVBank = vowTools.retriable(
|
|
@@ -100,38 +100,6 @@ const contract = async (
|
|
|
100
100
|
},
|
|
101
101
|
);
|
|
102
102
|
|
|
103
|
-
let nonce = 0n;
|
|
104
|
-
const ConnectionInfoShape = M.record(); // TODO
|
|
105
|
-
const creatorFacet = zone.exo(
|
|
106
|
-
'Send CF',
|
|
107
|
-
M.interface('Send CF', {
|
|
108
|
-
addChain: M.callWhen(CosmosChainInfoShape, ConnectionInfoShape).returns(
|
|
109
|
-
M.scalar(),
|
|
110
|
-
),
|
|
111
|
-
}),
|
|
112
|
-
{
|
|
113
|
-
/**
|
|
114
|
-
* @param {CosmosChainInfo} chainInfo
|
|
115
|
-
* @param {IBCConnectionInfo} connectionInfo
|
|
116
|
-
*/
|
|
117
|
-
async addChain(chainInfo, connectionInfo) {
|
|
118
|
-
const chainKey = `${chainInfo.chainId}-${(nonce += 1n)}`;
|
|
119
|
-
// when() because chainHub methods return vows. If this were inside
|
|
120
|
-
// orchestrate() the membrane would wrap/unwrap automatically.
|
|
121
|
-
const agoricChainInfo = await heapVowE.when(
|
|
122
|
-
chainHub.getChainInfo('agoric'),
|
|
123
|
-
);
|
|
124
|
-
chainHub.registerChain(chainKey, chainInfo);
|
|
125
|
-
chainHub.registerConnection(
|
|
126
|
-
agoricChainInfo.chainId,
|
|
127
|
-
chainInfo.chainId,
|
|
128
|
-
connectionInfo,
|
|
129
|
-
);
|
|
130
|
-
return chainKey;
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
);
|
|
134
|
-
|
|
135
103
|
return { publicFacet, creatorFacet };
|
|
136
104
|
};
|
|
137
105
|
|
|
@@ -32,6 +32,27 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
32
32
|
send(toAccount: any, amount: any): import("@agoric/vow").Vow<never>;
|
|
33
33
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): import("@agoric/vow").Vow<void>;
|
|
34
34
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/marshal").Passable ? import("@endo/marshal").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
35
|
+
monitorTransfers(tap: import("@agoric/vats/src/bridge-target.js").TargetApp): import("@agoric/vow").Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration | import("@agoric/vow").Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration> extends import("@endo/marshal").Passable ? (string & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (string & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
36
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
37
|
+
}) | (number & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (number & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
38
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
39
|
+
}) | (bigint & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
40
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
41
|
+
}) | (true & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (true & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
42
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
43
|
+
}) | (symbol & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (symbol & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
44
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
45
|
+
}) | (import("@endo/marshal").RemotableObject<string> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
46
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
47
|
+
}) | (Error & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Error & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
48
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
49
|
+
}) | (import("@endo/marshal").CopyArrayI<import("@endo/marshal").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/marshal").CopyArrayI<import("@endo/marshal").PassableCap, Error> & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
50
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
51
|
+
}) | (import("@endo/marshal").CopyRecordI<import("@endo/marshal").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/marshal").CopyRecordI<import("@endo/marshal").PassableCap, Error> & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
52
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
53
|
+
}) | (import("@endo/marshal").CopyTaggedI<import("@endo/marshal").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/marshal").CopyTaggedI<import("@endo/marshal").PassableCap, Error> & import("@endo/marshal").PassStyled<"tagged", "Vow"> & {
|
|
54
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
55
|
+
}) : import("@agoric/async-flow").HostInterface<import("@agoric/vats/src/bridge-target.js").TargetRegistration | import("@agoric/vow").Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration>>>;
|
|
35
56
|
}>>;
|
|
36
57
|
/**
|
|
37
58
|
* Invitation to make an account, without any funds
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAkCO,2BAVI,GAAG,eACH;IACV,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,UAAc,EAAE,UAAU,CAAC;IAC3B,WAAe,EAAE,WAAW,CAAC;IAC7B,YAAgB,EAAE,YAAY,CAAC;CAC5B,WACO,OAAO,kBAAkB,EAAE,OAAO;;QAiDvC;;WAEG
|
|
1
|
+
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAkCO,2BAVI,GAAG,eACH;IACV,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,UAAc,EAAE,UAAU,CAAC;IAC3B,WAAe,EAAE,WAAW,CAAC;IAC7B,YAAgB,EAAE,YAAY,CAAC;CAC5B,WACO,OAAO,kBAAkB,EAAE,OAAO;;QAiDvC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0BH;;WAEG;;;GAaR;6BA7GyB,cAAc;4BACf,kBAAkB;gCAEd,gCAAgC;kCAD9B,cAAc"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function prepareChainHubAdmin(zone: Zone, chainHub: ChainHub): import("@endo/exo").Guarded<{
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} chainName
|
|
4
|
+
* @param {CosmosChainInfo} chainInfo
|
|
5
|
+
* @param {IBCConnectionInfo} connectionInfo
|
|
6
|
+
*/
|
|
7
|
+
initChain(chainName: string, chainInfo: CosmosChainInfo, connectionInfo: IBCConnectionInfo): Promise<void>;
|
|
8
|
+
}>;
|
|
9
|
+
export type ChainHubAdmin = ReturnType<(zone: Zone, chainHub: ChainHub) => import("@endo/exo").Guarded<{
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} chainName
|
|
12
|
+
* @param {CosmosChainInfo} chainInfo
|
|
13
|
+
* @param {IBCConnectionInfo} connectionInfo
|
|
14
|
+
*/
|
|
15
|
+
initChain(chainName: string, chainInfo: CosmosChainInfo, connectionInfo: IBCConnectionInfo): Promise<void>;
|
|
16
|
+
}>>;
|
|
17
|
+
import type { Zone } from '@agoric/zone';
|
|
18
|
+
import type { ChainHub } from './chain-hub.js';
|
|
19
|
+
import type { CosmosChainInfo } from '@agoric/orchestration';
|
|
20
|
+
import type { IBCConnectionInfo } from '@agoric/orchestration';
|
|
21
|
+
//# sourceMappingURL=chain-hub-admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"AAoBO,2CAHI,IAAI,YACJ,QAAQ;IAcb;;;;OAIG;yBAHQ,MAAM,aACN,eAAe,kBACf,iBAAiB;GAkBjC;4BAEa,UAAU,QAtCb,IAAI,YACJ,QAAQ;IAcb;;;;OAIG;yBAHQ,MAAM,aACN,eAAe,kBACf,iBAAiB;GAoBY;0BAhDvB,cAAc;8BAEV,gBAAgB;qCADU,uBAAuB;uCAAvB,uBAAuB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* we expect promises to resolved promptly, */
|
|
2
|
+
/* eslint-disable no-restricted-syntax */
|
|
3
|
+
import { M } from '@endo/patterns';
|
|
4
|
+
import { heapVowE } from '@agoric/vow/vat.js';
|
|
5
|
+
import { CosmosChainInfoShape } from '../typeGuards.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @import {Zone} from '@agoric/zone';
|
|
9
|
+
* @import {CosmosChainInfo, IBCConnectionInfo} from '@agoric/orchestration';
|
|
10
|
+
* @import {ChainHub} from './chain-hub.js';
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* For use with async-flow contracts: can be used as a creator facet that allows
|
|
15
|
+
* developers to add new chain configurations to a local chainHub, in the event
|
|
16
|
+
* the information is not available widely in `agoricNames`.
|
|
17
|
+
*
|
|
18
|
+
* @param {Zone} zone
|
|
19
|
+
* @param {ChainHub} chainHub
|
|
20
|
+
*/
|
|
21
|
+
export const prepareChainHubAdmin = (zone, chainHub) => {
|
|
22
|
+
const ConnectionInfoShape = M.record(); // TODO
|
|
23
|
+
const makeCreatorFacet = zone.exo(
|
|
24
|
+
'ChainHub Admin',
|
|
25
|
+
M.interface('ChainHub Admin', {
|
|
26
|
+
initChain: M.callWhen(
|
|
27
|
+
M.string(),
|
|
28
|
+
CosmosChainInfoShape,
|
|
29
|
+
ConnectionInfoShape,
|
|
30
|
+
).returns(M.undefined()),
|
|
31
|
+
}),
|
|
32
|
+
{
|
|
33
|
+
/**
|
|
34
|
+
* @param {string} chainName
|
|
35
|
+
* @param {CosmosChainInfo} chainInfo
|
|
36
|
+
* @param {IBCConnectionInfo} connectionInfo
|
|
37
|
+
*/
|
|
38
|
+
async initChain(chainName, chainInfo, connectionInfo) {
|
|
39
|
+
// when() because chainHub methods return vows. If this were inside
|
|
40
|
+
// orchestrate() the membrane would wrap/unwrap automatically.
|
|
41
|
+
const agoricChainInfo = await heapVowE.when(
|
|
42
|
+
chainHub.getChainInfo('agoric'),
|
|
43
|
+
);
|
|
44
|
+
chainHub.registerChain(chainName, chainInfo);
|
|
45
|
+
chainHub.registerConnection(
|
|
46
|
+
agoricChainInfo.chainId,
|
|
47
|
+
chainInfo.chainId,
|
|
48
|
+
connectionInfo,
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
return makeCreatorFacet;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** @typedef {ReturnType<prepareChainHubAdmin>} ChainHubAdmin */
|
|
@@ -51,6 +51,27 @@ export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowe
|
|
|
51
51
|
send(toAccount: any, amount: any): Vow<never>;
|
|
52
52
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void>;
|
|
53
53
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
54
|
+
monitorTransfers(tap: import("@agoric/vats/src/bridge-target.js").TargetApp): Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration | Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration> extends import("@endo/pass-style").Passable ? (string & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (string & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
55
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
56
|
+
}) | (number & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (number & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
57
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
58
|
+
}) | (bigint & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
59
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
60
|
+
}) | (true & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (true & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
61
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
62
|
+
}) | (symbol & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (symbol & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
63
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
64
|
+
}) | (import("@endo/pass-style").RemotableObject<string> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
65
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
66
|
+
}) | (Error & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Error & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
67
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
68
|
+
}) | (import("@endo/pass-style").CopyArrayI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyArrayI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
69
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
70
|
+
}) | (import("@endo/pass-style").CopyRecordI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyRecordI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
71
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
72
|
+
}) | (import("@endo/pass-style").CopyTaggedI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyTaggedI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
73
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
74
|
+
}) : import("@agoric/async-flow").HostInterface<import("@agoric/vats/src/bridge-target.js").TargetRegistration | Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration>>>;
|
|
54
75
|
}>>;
|
|
55
76
|
};
|
|
56
77
|
makeChildNodeWatcher: {
|
|
@@ -86,6 +107,27 @@ export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowe
|
|
|
86
107
|
send(toAccount: any, amount: any): Vow<never>;
|
|
87
108
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void>;
|
|
88
109
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
110
|
+
monitorTransfers(tap: import("@agoric/vats/src/bridge-target.js").TargetApp): Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration | Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration> extends import("@endo/pass-style").Passable ? (string & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (string & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
111
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
112
|
+
}) | (number & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (number & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
113
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
114
|
+
}) | (bigint & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
115
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
116
|
+
}) | (true & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (true & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
117
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
118
|
+
}) | (symbol & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (symbol & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
119
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
120
|
+
}) | (import("@endo/pass-style").RemotableObject<string> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
121
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
122
|
+
}) | (Error & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Error & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
123
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
124
|
+
}) | (import("@endo/pass-style").CopyArrayI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyArrayI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
125
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
126
|
+
}) | (import("@endo/pass-style").CopyRecordI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyRecordI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
127
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
128
|
+
}) | (import("@endo/pass-style").CopyTaggedI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyTaggedI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
129
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
130
|
+
}) : import("@agoric/async-flow").HostInterface<import("@agoric/vats/src/bridge-target.js").TargetRegistration | Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration>>>;
|
|
89
131
|
}>;
|
|
90
132
|
};
|
|
91
133
|
}>>["public"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AAiIO,8CAHI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;QArDzB,6DAA6D;uBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;;;QAazD;;WAEG;wCADQ,CAAC,iBAAiB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AAiIO,8CAHI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;QArDzB,6DAA6D;uBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;;;QAazD;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4BX;qCA9GY;IACZ,gCAAoC,EAAE,gCAAgC,CAAC;IACvE,aAAiB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACnD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;IAChC,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,QAAY,EAAE,QAAQ,CAAC;CACpB;mCA0GU,UAAU,CAAC,OAAO,uBAAuB,CAAC;+BAC1C,UAAU,CAAC,oBAAoB,CAAC;0BA7HvB,mBAAmB;uCAO0D,aAAa;yBAHjF,aAAa;kDAEoC,kCAAkC;uCAHnE,gCAAgC;kCAIoB,aAAa;4BALxF,kBAAkB;sDAIsC,kCAAkC;6CADzE,gCAAgC;kCAJ3C,cAAc;gCAEG,gCAAgC;8BAChD,aAAa"}
|
|
@@ -147,6 +147,28 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, makeRecorderKit:
|
|
|
147
147
|
transfer(amount: AmountArg, destination: ChainAddress, opts?: IBCMsgTransferOptions | undefined): Vow<void>;
|
|
148
148
|
/** @type {HostOf<OrchestrationAccountI['transferSteps']>} */
|
|
149
149
|
transferSteps(amount: AmountArg, msg: import("@agoric/orchestration").TransferMsg): Vow<void extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & void : import("@agoric/async-flow").HostInterface<void>>;
|
|
150
|
+
/** @type {HostOf<LocalChainAccount['monitorTransfers']>} */
|
|
151
|
+
monitorTransfers(tap: import("@agoric/vats/src/bridge-target.js").TargetApp): Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration | Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration> extends import("@endo/pass-style").Passable ? (string & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (string & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
152
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
153
|
+
}) | (number & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (number & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
154
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
155
|
+
}) | (bigint & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (false & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
156
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
157
|
+
}) | (true & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (true & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
158
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
159
|
+
}) | (symbol & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (symbol & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
160
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
161
|
+
}) | (import("@endo/pass-style").RemotableObject<string> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Promise<any> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
162
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
163
|
+
}) | (Error & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (Error & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
164
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
165
|
+
}) | (import("@endo/pass-style").CopyArrayI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyArrayI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
166
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
167
|
+
}) | (import("@endo/pass-style").CopyRecordI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyRecordI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
168
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
169
|
+
}) | (import("@endo/pass-style").CopyTaggedI<import("@endo/pass-style").PassableCap, Error> & import("@agoric/vats/src/bridge-target.js").TargetRegistration) | (import("@endo/pass-style").CopyTaggedI<import("@endo/pass-style").PassableCap, Error> & import("@endo/pass-style").PassStyled<"tagged", "Vow"> & {
|
|
170
|
+
payload: import("@agoric/vow").VowPayload<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
171
|
+
}) : import("@agoric/async-flow").HostInterface<import("@agoric/vats/src/bridge-target.js").TargetRegistration | Vow<import("@agoric/vats/src/bridge-target.js").TargetRegistration>>>;
|
|
150
172
|
};
|
|
151
173
|
}>;
|
|
152
174
|
export type LocalChainAccountNotification = {
|
|
@@ -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":"AA6EO,0DAPI,IAAI,mBACJ,eAAe,OACf,GAAG,gBACH,OAAO,YAAY,CAAC,mCACpB,QAAQ,YACR,QAAQ;aA6DJ,iBAAiB;aACjB,YAAY;iBACZ,OAAO,WAAW,CAAC;;;QAa1B;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;QAYxB;;;WAGG;qCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;;QAiBxB;;;;;;WAMG;8BALQ,CACV,SACA,UAAgB,+CAA+C,CAAC,CAC3D,CACF;;;QAcJ;;;WAGG;6DADQ,YAAY;;;QAUvB;;;;;;;;;;WAUG;6DATQ,CACV;YAAM,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;SAAE,EAC7D,MAAU,CACP,iCACO;YACV,WAAe,EAAE,YAAY,CAAC;YAC9B,IAAQ,EAAE,qBAAqB,CAAC;YAChC,MAAU,EAAE,WAAW,CAAC;SACrB;;;;IA4BN;;;OAGG;;QAED;;WAEG;6BADQ,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;;IAQvC;;;OAGG;;QAED;;WAEG;6BADQ,OAAO;;IAMpB;;;OAGG;;QAED;;;;WAIG;+BAHQ,MAAM,CAAC,KAAK,CAAC,SACb,WAAW,CAAC,OAAO,CAAC,GAClB,WAAW;;;QAOxB,iEAAiE;;QAqBjE;;;;WAIG;;QAeH,2DAA2D;;QAM3D;;WAEG;;QAiBH;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;QAsBxB;;;;WAIG;qCAHQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC,GACX,IAAI,IAAI,GAAG,eAAe,CAAC;QAoBxC;;;;WAIG;QACH,mDAAmD;;QAOnD,oDAAoD;;QAIpD,qDAAqD;;;;;;;;;;QAIrD,kDAAkD;;;QAWlD;;;;;;;;WAQG;yBAPQ,SAAS,eAET,YAAY,6CAIV,IAAI,IAAI,CAAC;QA8BtB,6DAA6D;;QAO7D,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;GAQnE;;aA/ba,MAAM;;oBAIP;IACZ,QAAY,EAAE,YAAY,6BAA6B,CAAC,CAAC;IACzD,OAAW,EAAE,iBAAiB,CAAC;IAC/B,OAAW,EAAE,YAAY,CAAC;CACvB;+CAwbU,UAAU,CAAC,OAAO,mCAAmC,CAAC;2CACtD,UAAU,CAAC,gCAAgC,CAAC;0BAldnC,cAAc;qCADU,6CAA6C;kCAI5C,cAAc;4BAFrC,kBAAkB;8BAGX,aAAa;8BAGlB,gBAAgB;uCAVP,gCAAgC;kCAC+D,uBAAuB;yBAM1H,aAAa;qCADG,cAAc;+BAExB,sBAAsB;8BAAtB,sBAAsB;+BAPuE,uBAAuB;uCAAvB,uBAAuB;2CAAvB,uBAAuB;iCAAvB,uBAAuB;+BAAvB,uBAAuB;iCAC3G,6CAA6C"}
|
|
@@ -20,13 +20,13 @@ import { makeTimestampHelper } from '../utils/time.js';
|
|
|
20
20
|
/**
|
|
21
21
|
* @import {HostOf} from '@agoric/async-flow';
|
|
22
22
|
* @import {LocalChainAccount} from '@agoric/vats/src/localchain.js';
|
|
23
|
-
* @import {AmountArg, ChainAddress, DenomAmount, IBCMsgTransferOptions,
|
|
23
|
+
* @import {AmountArg, ChainAddress, DenomAmount, IBCMsgTransferOptions, ChainInfo, IBCConnectionInfo, OrchestrationAccountI} from '@agoric/orchestration';
|
|
24
24
|
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'.
|
|
25
25
|
* @import {Zone} from '@agoric/zone';
|
|
26
26
|
* @import {Remote} from '@agoric/internal';
|
|
27
27
|
* @import {InvitationMakers} from '@agoric/smart-wallet/src/types.js';
|
|
28
|
-
* @import {TimerService,
|
|
29
|
-
* @import {
|
|
28
|
+
* @import {TimerService, TimestampRecord} from '@agoric/time';
|
|
29
|
+
* @import {Vow, VowTools} from '@agoric/vow';
|
|
30
30
|
* @import {TypedJson, JsonSafe} from '@agoric/cosmic-proto';
|
|
31
31
|
* @import {Matcher} from '@endo/patterns';
|
|
32
32
|
* @import {ChainHub} from './chain-hub.js';
|
|
@@ -57,6 +57,9 @@ const HolderI = M.interface('holder', {
|
|
|
57
57
|
deposit: M.call(PaymentShape).returns(VowShape),
|
|
58
58
|
withdraw: M.call(AmountShape).returns(Vow$(PaymentShape)),
|
|
59
59
|
executeTx: M.call(M.arrayOf(M.record())).returns(Vow$(M.record())),
|
|
60
|
+
monitorTransfers: M.call(M.remotable('TransferTap')).returns(
|
|
61
|
+
Vow$(M.remotable('TargetRegistration')),
|
|
62
|
+
),
|
|
60
63
|
});
|
|
61
64
|
|
|
62
65
|
/** @type {{ [name: string]: [description: string, valueShape: Matcher] }} */
|
|
@@ -475,6 +478,10 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
475
478
|
throw Fail`not yet implemented`;
|
|
476
479
|
});
|
|
477
480
|
},
|
|
481
|
+
/** @type {HostOf<LocalChainAccount['monitorTransfers']>} */
|
|
482
|
+
monitorTransfers(tap) {
|
|
483
|
+
return watch(E(this.state.account).monitorTransfers(tap));
|
|
484
|
+
},
|
|
478
485
|
},
|
|
479
486
|
},
|
|
480
487
|
);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export function preparePortfolioHolder(zone: Zone, vowTools: VowTools): (...args: Parameters<ReturnType<typeof preparePortfolioHolderKit>>) => ReturnType<ReturnType<typeof preparePortfolioHolderKit>>["holder"];
|
|
2
|
+
export type PortfolioHolderState = {
|
|
3
|
+
accounts: MapStore<string, OrchestrationAccount<any>>;
|
|
4
|
+
publicTopics: MapStore<string, ResolvedPublicTopic<unknown>>;
|
|
5
|
+
};
|
|
6
|
+
export type MakePortfolioHolder = ReturnType<typeof preparePortfolioHolder>;
|
|
7
|
+
export type PortfolioHolder = ReturnType<MakePortfolioHolder>;
|
|
8
|
+
import type { Zone } from '@agoric/zone';
|
|
9
|
+
import type { VowTools } from '@agoric/vow';
|
|
10
|
+
/**
|
|
11
|
+
* Kit that holds several OrchestrationAccountKits and returns a invitation
|
|
12
|
+
* makers.
|
|
13
|
+
*
|
|
14
|
+
* @param {Zone} zone
|
|
15
|
+
* @param {VowTools} vowTools
|
|
16
|
+
*/
|
|
17
|
+
declare function preparePortfolioHolderKit(zone: Zone, { asVow, when }: VowTools): (accountEntries: Iterable<[string, OrchestrationAccount<any>]>, publicTopicEntries: Iterable<[string, ResolvedPublicTopic<unknown>]>) => import("@endo/exo").GuardedKit<{
|
|
18
|
+
invitationMakers: {
|
|
19
|
+
/**
|
|
20
|
+
* @template {unknown[]} IA
|
|
21
|
+
* @param {string} chainName key where the account is stored
|
|
22
|
+
* @param {string} action invitation maker name, e.g. 'Delegate'
|
|
23
|
+
* @param {IA} invitationArgs
|
|
24
|
+
* @returns {Promise<Invitation<unknown, IA>>}
|
|
25
|
+
*/
|
|
26
|
+
MakeInvitation<IA extends unknown[]>(chainName: string, action: string, invitationArgs: IA): Promise<Invitation<unknown, IA>>;
|
|
27
|
+
};
|
|
28
|
+
holder: {
|
|
29
|
+
asContinuingOffer(): import("@agoric/vow").Vow<{
|
|
30
|
+
publicSubscribers: {
|
|
31
|
+
[k: string]: ResolvedPublicTopic<unknown>;
|
|
32
|
+
};
|
|
33
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
34
|
+
/**
|
|
35
|
+
* @template {unknown[]} IA
|
|
36
|
+
* @param {string} chainName key where the account is stored
|
|
37
|
+
* @param {string} action invitation maker name, e.g. 'Delegate'
|
|
38
|
+
* @param {IA} invitationArgs
|
|
39
|
+
* @returns {Promise<Invitation<unknown, IA>>}
|
|
40
|
+
*/
|
|
41
|
+
MakeInvitation<IA extends unknown[]>(chainName: string, action: string, invitationArgs: IA): Promise<Invitation<unknown, IA>>;
|
|
42
|
+
}>;
|
|
43
|
+
}>;
|
|
44
|
+
getPublicTopics(): import("@agoric/vow").Vow<{
|
|
45
|
+
[k: string]: ResolvedPublicTopic<unknown>;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* @param {string} chainName key where the account is stored
|
|
49
|
+
* @param {OrchestrationAccount<any>} account
|
|
50
|
+
* @param {ResolvedPublicTopic<unknown>} publicTopic
|
|
51
|
+
*/
|
|
52
|
+
addAccount(chainName: string, account: OrchestrationAccount<any>, publicTopic: ResolvedPublicTopic<unknown>): import("@agoric/vow").Vow<void>;
|
|
53
|
+
/**
|
|
54
|
+
* @param {string} chainName key where the account is stored
|
|
55
|
+
*/
|
|
56
|
+
getAccount(chainName: string): import("@agoric/vow").Vow<OrchestrationAccountI>;
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
import type { OrchestrationAccount } from '@agoric/orchestration';
|
|
60
|
+
import type { MapStore } from '@agoric/store';
|
|
61
|
+
import type { ResolvedPublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
|
|
62
|
+
import type { OrchestrationAccountI } from '@agoric/orchestration';
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=portfolio-holder-kit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio-holder-kit.d.ts","sourceRoot":"","sources":["portfolio-holder-kit.js"],"names":[],"mappings":"AAwKO,6CANI,IAAI,YACJ,QAAQ,GACN,CACZ,GAAO,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,KAC9D,UAAU,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAKzE;mCAxJY;IACZ,QAAY,EAAE,SAAS,MAAM,EAAE,qBAAqB,GAAG,CAAC,CAAC,CAAC;IAC1D,YAAgB,EAAE,SAAS,MAAM,EAAE,oBAAoB,OAAO,CAAC,CAAC,CAAC;CAC9D;kCAsJU,UAAU,CAAC,OAAO,sBAAsB,CAAC;8BACzC,UAAU,CAAC,mBAAmB,CAAC;0BA/JtB,cAAc;8BAFV,aAAa;AAqBxC;;;;;;GAMG;AACH,iDAHW,IAAI,mBACJ,QAAQ;;QAoDX;;;;;;WAMG;uBALsB,EAAE,SAAb,OAAO,EAAG,aACb,MAAM,UACN,MAAM,kBACN,EAAE,GACA,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;;;;;;;;gBAL7C;;;;;;mBAMG;+BALsB,EAAE,SAAb,OAAO,EAAG,aACb,MAAM,UACN,MAAM,kBACN,EAAE,GACA,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;;;;;;QA8B7C;;;;WAIG;8BAHQ,MAAM,WACN,qBAAqB,GAAG,CAAC,eACzB,oBAAoB,OAAO,CAAC;QAgBvC;;WAEG;8BADQ,MAAM;;GAQxB;0CA1I6D,uBAAuB;8BAJ1D,eAAe;yCAEJ,2CAA2C;2CAEnB,uBAAuB"}
|