@agoric/orchestration 0.2.0 → 0.2.1-upgrade-23-dev-bd79330.0.bd79330
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.js +0 -4
- package/package.json +27 -27
- package/src/axelar-types.d.ts +2 -0
- package/src/axelar-types.d.ts.map +1 -1
- package/src/axelar-types.js +2 -0
- package/src/cctp-chain-info.js +4 -1
- package/src/chain-info.d.ts +21 -6
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +9 -8
- package/src/cosmos-api.d.ts +102 -29
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.js +585 -0
- package/src/{ethereum-api.ts → ethereum-api.js} +1 -1
- package/src/examples/auto-stake-it-tap-kit.d.ts +4 -3
- package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
- package/src/examples/auto-stake-it-tap-kit.js +3 -4
- package/src/examples/auto-stake-it.contract.d.ts +6 -4
- package/src/examples/auto-stake-it.contract.d.ts.map +1 -1
- package/src/examples/auto-stake-it.contract.js +3 -1
- package/src/examples/auto-stake-it.flows.d.ts +2 -1
- package/src/examples/auto-stake-it.flows.d.ts.map +1 -1
- package/src/examples/auto-stake-it.flows.js +1 -0
- package/src/examples/axelar-gmp-account-kit.d.ts +6 -4
- package/src/examples/axelar-gmp-account-kit.d.ts.map +1 -1
- package/src/examples/axelar-gmp-account-kit.js +4 -2
- package/src/examples/axelar-gmp.contract.d.ts +8 -8
- package/src/examples/axelar-gmp.contract.d.ts.map +1 -1
- package/src/examples/axelar-gmp.contract.js +2 -2
- package/src/examples/axelar-gmp.flows.d.ts +1 -1
- package/src/examples/basic-flows.contract.d.ts +7 -5
- package/src/examples/basic-flows.contract.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.js +3 -1
- package/src/examples/basic-flows.flows.d.ts +2 -1
- package/src/examples/basic-flows.flows.d.ts.map +1 -1
- package/src/examples/basic-flows.flows.js +1 -0
- package/src/examples/send-anywhere.contract.d.ts +12 -6
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +4 -1
- package/src/examples/send-anywhere.flows.d.ts +3 -2
- package/src/examples/send-anywhere.flows.d.ts.map +1 -1
- package/src/examples/send-anywhere.flows.js +3 -6
- package/src/examples/stake-bld.contract.d.ts +206 -25
- package/src/examples/stake-bld.contract.d.ts.map +1 -1
- package/src/examples/stake-bld.contract.js +19 -4
- package/src/examples/stake-ica.contract.d.ts +434 -71
- package/src/examples/stake-ica.contract.d.ts.map +1 -1
- package/src/examples/stake-ica.contract.js +28 -6
- package/src/examples/staking-combinations.contract.d.ts +4 -2
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +5 -3
- package/src/examples/staking-combinations.flows.d.ts +3 -2
- package/src/examples/staking-combinations.flows.d.ts.map +1 -1
- package/src/examples/staking-combinations.flows.js +7 -6
- package/src/examples/swap-anything.contract.d.ts +14 -7
- package/src/examples/swap-anything.contract.d.ts.map +1 -1
- package/src/examples/swap-anything.contract.js +12 -8
- package/src/examples/swap.contract.d.ts +18 -6
- package/src/examples/swap.contract.d.ts.map +1 -1
- package/src/examples/swap.contract.js +9 -3
- package/src/examples/swap.flows.d.ts +2 -0
- package/src/examples/swap.flows.d.ts.map +1 -1
- package/src/examples/swap.flows.js +2 -0
- package/src/examples/unbond.contract.d.ts +7 -4
- package/src/examples/unbond.contract.d.ts.map +1 -1
- package/src/examples/unbond.contract.js +6 -3
- package/src/exos/chain-hub-admin.d.ts +1 -19
- package/src/exos/chain-hub-admin.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.js +1 -1
- package/src/exos/chain-hub.d.ts +4 -2
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +2 -1
- package/src/exos/combine-invitation-makers.d.ts +2 -1
- package/src/exos/combine-invitation-makers.d.ts.map +1 -1
- package/src/exos/combine-invitation-makers.js +2 -1
- package/src/exos/cosmos-orchestration-account.d.ts +615 -98
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +695 -306
- package/src/exos/exo-interfaces.js +35 -0
- package/src/exos/ibc-packet.d.ts +11 -9
- package/src/exos/ibc-packet.d.ts.map +1 -1
- package/src/exos/ibc-packet.js +33 -8
- package/src/exos/ica-account-kit.d.ts +4 -9
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/ica-account-kit.js +10 -7
- package/src/exos/icq-connection-kit.d.ts +1 -1
- package/src/exos/local-chain-facade.d.ts +1542 -5
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +4 -2
- package/src/exos/local-orchestration-account.d.ts +201 -56
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +260 -51
- package/src/exos/orchestrator.d.ts +35813 -73
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +7 -10
- package/src/exos/packet-tools.d.ts +19 -8
- package/src/exos/packet-tools.d.ts.map +1 -1
- package/src/exos/packet-tools.js +92 -9
- package/src/exos/portfolio-holder-kit.d.ts +90 -2
- package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.d.ts +1499 -1
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +8 -3
- package/src/facade.d.ts +1 -0
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +4 -6
- package/src/fixtures/query-flows.contract.d.ts +8 -6
- package/src/fixtures/query-flows.contract.d.ts.map +1 -1
- package/src/fixtures/query-flows.contract.js +3 -1
- package/src/fixtures/query-flows.flows.d.ts +1 -0
- package/src/fixtures/query-flows.flows.d.ts.map +1 -1
- package/src/fixtures/query-flows.flows.js +1 -0
- package/src/orchestration-api.d.ts +46 -16
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.js +410 -0
- package/src/proposals/init-chain-info.js +10 -2
- package/src/proposals/orchestration-proposal.js +3 -0
- package/src/proposals/revise-chain-info.js +4 -1
- package/src/proposals/start-auto-stake-it.js +1 -0
- package/src/proposals/start-axelar-gmp.js +2 -2
- package/src/proposals/start-basic-flows.js +5 -0
- package/src/proposals/start-send-anywhere.js +4 -2
- package/src/proposals/start-stakeAtom.js +5 -4
- package/src/proposals/start-stakeBld.js +8 -6
- package/src/proposals/start-stakeOsmo.js +5 -4
- package/src/proposals/start-swap-anything.js +4 -2
- package/src/stubs/{viem-abi.d.ts → viem-typedData.js} +10 -4
- package/src/typeGuards.d.ts +38 -5
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +92 -22
- package/src/types.d.ts +1 -0
- package/src/types.d.ts.map +1 -1
- package/src/types.js +27 -0
- package/src/utils/abitype.d.ts +6 -0
- package/src/utils/abitype.d.ts.map +1 -0
- package/src/utils/abitype.js +13 -0
- package/src/utils/address.d.ts +3 -1
- package/src/utils/address.d.ts.map +1 -1
- package/src/utils/address.js +24 -2
- package/src/utils/agd-lib.d.ts +1 -51
- package/src/utils/agd-lib.d.ts.map +1 -1
- package/src/utils/agd-lib.js +1 -1
- package/src/utils/amounts.d.ts +1 -0
- package/src/utils/amounts.d.ts.map +1 -1
- package/src/utils/amounts.js +1 -0
- package/src/utils/asset.d.ts +1 -0
- package/src/utils/asset.d.ts.map +1 -1
- package/src/utils/asset.js +1 -0
- package/src/utils/chain-hub-helper.d.ts +1 -0
- package/src/utils/chain-hub-helper.d.ts.map +1 -1
- package/src/utils/chain-hub-helper.js +1 -0
- package/src/utils/codecs.d.ts +145 -0
- package/src/utils/codecs.d.ts.map +1 -0
- package/src/utils/codecs.js +206 -0
- package/src/utils/cosmos.d.ts +5 -4
- package/src/utils/cosmos.d.ts.map +1 -1
- package/src/utils/cosmos.js +29 -9
- package/src/utils/exo-helpers.d.ts +156 -0
- package/src/utils/exo-helpers.d.ts.map +1 -0
- package/src/utils/exo-helpers.js +241 -0
- package/src/utils/gmp.d.ts +2 -2
- package/src/utils/gmp.d.ts.map +1 -1
- package/src/utils/gmp.js +31 -15
- package/src/utils/orchestrationAccount.d.ts +79 -0
- package/src/utils/orchestrationAccount.d.ts.map +1 -1
- package/src/utils/orchestrationAccount.js +210 -6
- package/src/utils/packet.d.ts.map +1 -1
- package/src/utils/packet.js +5 -0
- package/src/utils/permit2/signatureTransfer.d.ts +221 -0
- package/src/utils/permit2/signatureTransfer.d.ts.map +1 -0
- package/src/utils/permit2/signatureTransfer.js +265 -0
- package/src/utils/permit2/signatureTransferHelpers.d.ts +334 -0
- package/src/utils/permit2/signatureTransferHelpers.d.ts.map +1 -0
- package/src/utils/permit2/signatureTransferHelpers.js +270 -0
- package/src/utils/permit2.d.ts +11 -0
- package/src/utils/permit2.d.ts.map +1 -0
- package/src/utils/permit2.js +11 -0
- package/src/utils/progress.d.ts +41 -0
- package/src/utils/progress.d.ts.map +1 -0
- package/src/utils/progress.js +180 -0
- package/src/utils/start-helper.d.ts +28 -10
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +30 -7
- package/src/utils/time.d.ts +2 -2
- package/src/utils/time.d.ts.map +1 -1
- package/src/utils/time.js +1 -1
- package/src/utils/viem-utils/hashTypedData.d.ts +21 -0
- package/src/utils/viem-utils/hashTypedData.d.ts.map +1 -0
- package/src/utils/viem-utils/hashTypedData.js +61 -0
- package/src/utils/viem-utils/types.d.ts +6 -0
- package/src/utils/viem-utils/types.d.ts.map +1 -0
- package/src/utils/viem-utils/types.js +18 -0
- package/src/utils/viem.d.ts +11 -0
- package/src/utils/viem.d.ts.map +1 -0
- package/src/utils/viem.js +11 -0
- package/src/utils/zcf-tools.d.ts +15 -1
- package/src/utils/zcf-tools.d.ts.map +1 -1
- package/src/utils/zcf-tools.js +19 -3
- package/src/utils/zoe-tools.d.ts +5 -2
- package/src/utils/zoe-tools.d.ts.map +1 -1
- package/src/utils/zoe-tools.js +8 -2
- package/src/vat-orchestration.d.ts +5 -3
- package/src/vat-orchestration.d.ts.map +1 -1
- package/src/vat-orchestration.js +4 -3
- package/src/vendor/viem/{_esm-YOAV66U4.js → _esm-OKAICHVC.js} +2 -2
- package/src/vendor/viem/{ccip-AAQDZF3N.js → ccip-34BSSMV5.js} +1 -2
- package/src/vendor/viem/{chunk-4EF4K2MH.js → chunk-GCI53Z2G.js} +35 -1
- package/src/vendor/viem/chunk-ZKSIP2AM.js +326 -0
- package/src/vendor/viem/viem-abi.js +2 -2
- package/src/vendor/viem/viem-typedData.d.ts +19 -0
- package/src/vendor/viem/viem-typedData.js +59 -0
- package/tools/contract-tests.d.ts +34 -19
- package/tools/contract-tests.d.ts.map +1 -1
- package/tools/contract-tests.ts +15 -3
- package/tools/ibc-mock-fixtures.d.ts +49 -0
- package/tools/ibc-mock-fixtures.d.ts.map +1 -0
- package/tools/ibc-mock-fixtures.ts +161 -0
- package/tools/ibc-mocks.d.ts +2 -3
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +2 -1
- package/tools/make-test-address.d.ts +1 -1
- package/tools/make-test-address.d.ts.map +1 -1
- package/tools/make-test-address.js +1 -2
- package/tools/network-fakes.d.ts +142 -0
- package/tools/network-fakes.d.ts.map +1 -0
- package/tools/network-fakes.ts +388 -0
- package/tsup.config.ts +3 -1
- package/src/cosmos-api.ts +0 -469
- package/src/exos/exo-interfaces.ts +0 -35
- package/src/orchestration-api.ts +0 -365
- package/src/stubs/viem-abi.d.ts.map +0 -1
- package/src/types.ts +0 -26
- package/src/vendor/viem/chunk-XN4LUOIH.js +0 -253
- package/src/vendor/viem/secp256k1-WHBDSQB2.js +0 -1914
- /package/src/stubs/{viem-abi.ts → viem-abi.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @file Example contract that uses orchestration */
|
|
2
2
|
|
|
3
3
|
import { makeTracer, StorageNodeShape } from '@agoric/internal';
|
|
4
|
+
import { wrapRemoteMarshaller } from '@agoric/internal/src/marshal/wrap-marshaller.js';
|
|
4
5
|
import { TimerServiceShape } from '@agoric/time';
|
|
5
6
|
import { heapVowE as E, prepareVowTools } from '@agoric/vow/vat.js';
|
|
6
7
|
import {
|
|
@@ -11,17 +12,20 @@ import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
|
11
12
|
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
12
13
|
import { M } from '@endo/patterns';
|
|
13
14
|
import { prepareCosmosOrchestrationAccount } from '../exos/cosmos-orchestration-account.js';
|
|
15
|
+
import { prepareProgressTracker } from '../utils/progress.js';
|
|
14
16
|
import { makeChainHub } from '../exos/chain-hub.js';
|
|
15
17
|
|
|
16
18
|
const trace = makeTracer('StakeIca');
|
|
17
19
|
/**
|
|
18
20
|
* @import {Baggage} from '@agoric/vat-data';
|
|
19
|
-
* @import {Remote} from '@agoric/internal';
|
|
21
|
+
* @import {ERemote, Remote} from '@agoric/internal';
|
|
20
22
|
* @import {CosmosChainInfo, CosmosInterchainService, Denom, DenomDetail} from '@agoric/orchestration';
|
|
21
23
|
* @import {ContractMeta, Invitation, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
22
24
|
* @import {IBCConnectionID, NameHub} from '@agoric/vats';
|
|
23
25
|
* @import {TimerService} from '@agoric/time';
|
|
24
26
|
* @import {ResolvedContinuingOfferResult} from '../utils/zoe-tools.js';
|
|
27
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
28
|
+
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js';
|
|
25
29
|
*/
|
|
26
30
|
|
|
27
31
|
/** @type {ContractMeta<typeof start>} */
|
|
@@ -58,8 +62,8 @@ harden(privateArgsShape);
|
|
|
58
62
|
* @param {{
|
|
59
63
|
* agoricNames: Remote<NameHub>;
|
|
60
64
|
* cosmosInterchainService: CosmosInterchainService;
|
|
61
|
-
* storageNode: StorageNode
|
|
62
|
-
* marshaller: Marshaller
|
|
65
|
+
* storageNode: Remote<StorageNode>;
|
|
66
|
+
* marshaller: Remote<Marshaller>;
|
|
63
67
|
* timer: TimerService;
|
|
64
68
|
* }} privateArgs
|
|
65
69
|
* @param {Baggage} baggage
|
|
@@ -70,7 +74,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
70
74
|
const {
|
|
71
75
|
agoricNames,
|
|
72
76
|
cosmosInterchainService: orchestration,
|
|
73
|
-
marshaller,
|
|
77
|
+
marshaller: remoteMarshaller,
|
|
74
78
|
storageNode,
|
|
75
79
|
timer,
|
|
76
80
|
} = privateArgs;
|
|
@@ -78,13 +82,29 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
78
82
|
const zone = makeDurableZone(baggage);
|
|
79
83
|
|
|
80
84
|
const { accountsStorageNode } = await provideAll(baggage, {
|
|
81
|
-
accountsStorageNode: () =>
|
|
85
|
+
accountsStorageNode: () =>
|
|
86
|
+
/** @type {ERemote<StorageNode>} */ (
|
|
87
|
+
E(storageNode).makeChildNode('accounts')
|
|
88
|
+
),
|
|
82
89
|
});
|
|
83
90
|
|
|
84
|
-
|
|
91
|
+
// withOrchestration() provides this but this contract shows how to use orchestration without that
|
|
92
|
+
const cachingMarshaller = wrapRemoteMarshaller(remoteMarshaller);
|
|
93
|
+
|
|
94
|
+
const { makeRecorderKit } = prepareRecorderKitMakers(
|
|
95
|
+
baggage,
|
|
96
|
+
cachingMarshaller,
|
|
97
|
+
);
|
|
85
98
|
|
|
86
99
|
const vowTools = prepareVowTools(zone.subZone('vows'));
|
|
87
100
|
|
|
101
|
+
const makeProgressTracker = prepareProgressTracker(
|
|
102
|
+
zone.subZone('orchestration'),
|
|
103
|
+
{
|
|
104
|
+
vowTools,
|
|
105
|
+
},
|
|
106
|
+
);
|
|
107
|
+
|
|
88
108
|
const chainHub = makeChainHub(
|
|
89
109
|
zone.subZone('chainHub'),
|
|
90
110
|
agoricNames,
|
|
@@ -95,6 +115,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
95
115
|
zone,
|
|
96
116
|
{
|
|
97
117
|
chainHub,
|
|
118
|
+
makeProgressTracker,
|
|
98
119
|
makeRecorderKit,
|
|
99
120
|
timerService: timer,
|
|
100
121
|
vowTools,
|
|
@@ -119,6 +140,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
119
140
|
E(account).getRemoteAddress(),
|
|
120
141
|
]);
|
|
121
142
|
trace('account address', chainAddress);
|
|
143
|
+
/** @type {Remote<StorageNode>} */
|
|
122
144
|
const accountNode = await E(accountsStorageNode).makeChildNode(
|
|
123
145
|
chainAddress.value,
|
|
124
146
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: OrchestrationPowers & {
|
|
2
|
-
marshaller: Marshaller
|
|
3
|
-
}, baggage: Baggage) => Promise<{
|
|
2
|
+
marshaller: Remote<Marshaller>;
|
|
3
|
+
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
4
4
|
publicFacet: import("@endo/exo").Guarded<{
|
|
5
5
|
makeAccount(): Promise<Invitation<import("@agoric/vow").Vow<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>, {
|
|
6
6
|
chainName: string;
|
|
@@ -13,5 +13,7 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
13
13
|
}>;
|
|
14
14
|
import type { ZCF } from '@agoric/zoe';
|
|
15
15
|
import type { OrchestrationPowers } from '../utils/start-helper.js';
|
|
16
|
+
import type { Marshaller } from '@agoric/internal/src/lib-chainStorage.js';
|
|
17
|
+
import type { Remote } from '@agoric/internal';
|
|
16
18
|
import type { Invitation } from '@agoric/zoe';
|
|
17
19
|
//# sourceMappingURL=staking-combinations.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking-combinations.contract.d.ts","sourceRoot":"","sources":["staking-combinations.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staking-combinations.contract.d.ts","sourceRoot":"","sources":["staking-combinations.contract.js"],"names":[],"mappings":"AAoKA;gBA5HiB,OAAO,UAAU,CAAC;;;;;;;;;;;GA4H4C;yBAhJtB,aAAa;yCAEZ,0BAA0B;gCAGvD,0CAA0C;4BAP9C,kBAAkB;gCAEc,aAAa"}
|
|
@@ -16,12 +16,14 @@ import * as sharedFlows from './shared.flows.js';
|
|
|
16
16
|
import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
+
* @import {Remote} from '@agoric/internal';
|
|
19
20
|
* @import {GuestInterface} from '@agoric/async-flow';
|
|
20
21
|
* @import {ContractMeta, Invitation, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
21
22
|
* @import {Zone} from '@agoric/zone';
|
|
22
23
|
* @import {OrchestrationTools, OrchestrationPowers} from '../utils/start-helper.js';
|
|
23
24
|
* @import {CosmosOrchestrationAccount} from '../exos/cosmos-orchestration-account.js';
|
|
24
25
|
* @import {AmountArg, CosmosChainAddress, CosmosValidatorAddress} from '../types.js';
|
|
26
|
+
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js';
|
|
25
27
|
*/
|
|
26
28
|
|
|
27
29
|
const emptyOfferShape = harden({
|
|
@@ -36,14 +38,14 @@ const emptyOfferShape = harden({
|
|
|
36
38
|
*
|
|
37
39
|
* @param {ZCF} zcf
|
|
38
40
|
* @param {OrchestrationPowers & {
|
|
39
|
-
* marshaller: Marshaller
|
|
40
|
-
* }}
|
|
41
|
+
* marshaller: Remote<Marshaller>;
|
|
42
|
+
* }} _privateArgs
|
|
41
43
|
* @param {Zone} zone
|
|
42
44
|
* @param {OrchestrationTools} tools
|
|
43
45
|
*/
|
|
44
46
|
const contract = async (
|
|
45
47
|
zcf,
|
|
46
|
-
|
|
48
|
+
_privateArgs,
|
|
47
49
|
zone,
|
|
48
50
|
{ orchestrateAll, zoeTools, chainHub },
|
|
49
51
|
) => {
|
|
@@ -4,12 +4,12 @@ export function makeAccount(orch: Orchestrator, ctx: {
|
|
|
4
4
|
}, _seat: ZCFSeat, { chainName }: {
|
|
5
5
|
chainName: string;
|
|
6
6
|
}): Promise<ResolvedContinuingOfferResult>;
|
|
7
|
-
export function depositAndDelegate(
|
|
7
|
+
export function depositAndDelegate(_orch: Orchestrator, { chainHub, sharedLocalAccountP, zoeTools }: {
|
|
8
8
|
chainHub: GuestInterface<ChainHub>;
|
|
9
9
|
sharedLocalAccountP: Promise<GuestInterface<LocalOrchestrationAccountKit["holder"]>>;
|
|
10
10
|
zoeTools: GuestInterface<ZoeTools>;
|
|
11
11
|
}, account: GuestInterface<CosmosOrchestrationAccount>, seat: ZCFSeat, validator: CosmosValidatorAddress): Promise<void>;
|
|
12
|
-
export function undelegateAndTransfer(
|
|
12
|
+
export function undelegateAndTransfer(_orch: Orchestrator, _ctx: object, account: GuestInterface<CosmosOrchestrationAccount>, { delegations, destination }: {
|
|
13
13
|
delegations: {
|
|
14
14
|
amount: AmountArg;
|
|
15
15
|
validator: CosmosValidatorAddress;
|
|
@@ -19,6 +19,7 @@ export function undelegateAndTransfer(orch: Orchestrator, ctx: object, account:
|
|
|
19
19
|
import type { Orchestrator } from '../types.js';
|
|
20
20
|
import type { MakeCombineInvitationMakers } from '../exos/combine-invitation-makers.js';
|
|
21
21
|
import type { InvitationMakers } from '@agoric/smart-wallet/src/types.js';
|
|
22
|
+
import type { ZCFSeat } from '@agoric/zoe';
|
|
22
23
|
import type { ResolvedContinuingOfferResult } from '../utils/zoe-tools.js';
|
|
23
24
|
import type { ChainHub } from '../types.js';
|
|
24
25
|
import type { GuestInterface } from '@agoric/async-flow';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking-combinations.flows.d.ts","sourceRoot":"","sources":["staking-combinations.flows.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staking-combinations.flows.d.ts","sourceRoot":"","sources":["staking-combinations.flows.js"],"names":[],"mappings":"AA6BO,kCATI,YAAY,OACZ;IACN,2BAA2B,EAAE,2BAA2B,CAAC;IACzD,wBAAwB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,gBAAgB,CAAC;CAC9D,SACO,OAAO,iBACP;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GACnB,OAAO,CAAC,6BAA6B,CAAC,CAiBlD;AAeM,0CAVI,YAAY,+CAEpB;IAAsC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;IAC6C,mBAAmB,EAAxF,OAAO,CAAC,eAAe,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;CAChC,WAAQ,eAAe,0BAA0B,CAAC,QAC1C,OAAO,aACP,sBAAsB,GACpB,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAcM,6CATI,YAAY,QACZ,MAAM,WACN,eAAe,0BAA0B,CAAC,gCAC1C;IACN,WAAW,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,SAAS,EAAE,sBAAsB,CAAA;KAAE,EAAE,CAAC;IACxE,WAAW,EAAE,kBAAkB,CAAC;CACjC,GACS,OAAO,CAAC,IAAI,CAAC,CAYzB;kCAnHmK,aAAa;iDAGnI,sCAAsC;sCAF1B,mCAAmC;6BAKnE,aAAa;mDADmB,uBAAuB;8BALmF,aAAa;oCADhJ,oBAAoB;kDAGN,wCAAwC;8BAG7B,uBAAuB;gDADpC,yCAAyC;4CAJ8E,aAAa;+BAAb,aAAa;wCAAb,aAAa"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @import {MakeCombineInvitationMakers} from '../exos/combine-invitation-makers.js';
|
|
7
7
|
* @import {CosmosOrchestrationAccount} from '../exos/cosmos-orchestration-account.js';
|
|
8
8
|
* @import {ResolvedContinuingOfferResult, ZoeTools} from '../utils/zoe-tools.js';
|
|
9
|
+
* @import {ZCFSeat} from '@agoric/zoe';
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import { mustMatch } from '@endo/patterns';
|
|
@@ -46,7 +47,7 @@ harden(makeAccount);
|
|
|
46
47
|
|
|
47
48
|
/**
|
|
48
49
|
* @satisfies {OrchestrationFlow}
|
|
49
|
-
* @param {Orchestrator}
|
|
50
|
+
* @param {Orchestrator} _orch
|
|
50
51
|
* @param {object} ctx
|
|
51
52
|
* @param {GuestInterface<ChainHub>} ctx.chainHub
|
|
52
53
|
* @param {Promise<GuestInterface<LocalOrchestrationAccountKit['holder']>>} ctx.sharedLocalAccountP
|
|
@@ -57,7 +58,7 @@ harden(makeAccount);
|
|
|
57
58
|
* @returns {Promise<void>}
|
|
58
59
|
*/
|
|
59
60
|
export const depositAndDelegate = async (
|
|
60
|
-
|
|
61
|
+
_orch,
|
|
61
62
|
{ chainHub, sharedLocalAccountP, zoeTools },
|
|
62
63
|
account,
|
|
63
64
|
seat,
|
|
@@ -95,8 +96,8 @@ harden(depositAndDelegate);
|
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* @satisfies {OrchestrationFlow}
|
|
98
|
-
* @param {Orchestrator}
|
|
99
|
-
* @param {object}
|
|
99
|
+
* @param {Orchestrator} _orch
|
|
100
|
+
* @param {object} _ctx
|
|
100
101
|
* @param {GuestInterface<CosmosOrchestrationAccount>} account
|
|
101
102
|
* @param {{
|
|
102
103
|
* delegations: { amount: AmountArg; validator: CosmosValidatorAddress }[];
|
|
@@ -105,8 +106,8 @@ harden(depositAndDelegate);
|
|
|
105
106
|
* @returns {Promise<void>}
|
|
106
107
|
*/
|
|
107
108
|
export const undelegateAndTransfer = async (
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
_orch,
|
|
110
|
+
_ctx,
|
|
110
111
|
account,
|
|
111
112
|
{ delegations, destination },
|
|
112
113
|
) => {
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* @import {Zone} from '@agoric/zone';
|
|
4
4
|
* @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js';
|
|
5
5
|
* @import {CosmosChainInfo, Denom, DenomDetail, OrchestrationAccount} from '@agoric/orchestration';
|
|
6
|
+
* @import {VTransferIBCEvent} from '@agoric/vats';
|
|
7
|
+
* @import {ZCF} from '@agoric/zoe';
|
|
8
|
+
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js';
|
|
9
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
6
10
|
*/
|
|
7
11
|
export const SingleNatAmountRecord: import("@endo/patterns").Matcher;
|
|
8
12
|
export function contract(zcf: ZCF, privateArgs: OrchestrationPowers & {
|
|
@@ -10,38 +14,41 @@ export function contract(zcf: ZCF, privateArgs: OrchestrationPowers & {
|
|
|
10
14
|
brandKey?: string;
|
|
11
15
|
}][];
|
|
12
16
|
chainInfo?: Record<string, CosmosChainInfo>;
|
|
13
|
-
marshaller: Marshaller
|
|
17
|
+
marshaller: Remote<Marshaller>;
|
|
14
18
|
storageNode: Remote<StorageNode>;
|
|
15
|
-
}, zone: Zone, { chainHub, orchestrate, vowTools, zoeTools }: OrchestrationTools): Promise<{
|
|
19
|
+
}, zone: Zone, { cachingMarshaller, chainHub, orchestrate, vowTools, zoeTools }: OrchestrationTools): Promise<{
|
|
16
20
|
publicFacet: import("@endo/exo").Guarded<{
|
|
17
|
-
makeSwapInvitation(): Promise<
|
|
21
|
+
makeSwapInvitation(): Promise<import("@agoric/zoe").Invitation<Vow<string>, import("./swap-anything.flows.js").SwapInfo>>;
|
|
18
22
|
}>;
|
|
19
23
|
creatorFacet: import("@endo/exo").Guarded<{
|
|
20
24
|
registerChain(chainName: string, chainInfo: import("@agoric/orchestration").ChainInfo, ibcConnectionInfo?: import("@agoric/orchestration").IBCConnectionInfo): Promise<void>;
|
|
21
25
|
registerAsset(denom: Denom, detail: DenomDetail): Promise<void>;
|
|
22
26
|
}>;
|
|
23
27
|
}>;
|
|
24
|
-
export const start: (zcf:
|
|
28
|
+
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: OrchestrationPowers & {
|
|
25
29
|
assetInfo?: [Denom, DenomDetail & {
|
|
26
30
|
brandKey?: string;
|
|
27
31
|
}][];
|
|
28
32
|
chainInfo?: Record<string, CosmosChainInfo>;
|
|
29
|
-
marshaller: Marshaller
|
|
33
|
+
marshaller: Remote<Marshaller>;
|
|
30
34
|
storageNode: Remote<StorageNode>;
|
|
31
|
-
}, baggage: Baggage) => Promise<{
|
|
35
|
+
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
32
36
|
publicFacet: import("@endo/exo").Guarded<{
|
|
33
|
-
makeSwapInvitation(): Promise<
|
|
37
|
+
makeSwapInvitation(): Promise<import("@agoric/zoe").Invitation<Vow<string>, import("./swap-anything.flows.js").SwapInfo>>;
|
|
34
38
|
}>;
|
|
35
39
|
creatorFacet: import("@endo/exo").Guarded<{
|
|
36
40
|
registerChain(chainName: string, chainInfo: import("@agoric/orchestration").ChainInfo, ibcConnectionInfo?: import("@agoric/orchestration").IBCConnectionInfo): Promise<void>;
|
|
37
41
|
registerAsset(denom: Denom, detail: DenomDetail): Promise<void>;
|
|
38
42
|
}>;
|
|
39
43
|
}>;
|
|
44
|
+
import type { ZCF } from '@agoric/zoe';
|
|
40
45
|
import type { OrchestrationPowers } from '../utils/start-helper.js';
|
|
41
46
|
import type { Denom } from '@agoric/orchestration';
|
|
42
47
|
import type { DenomDetail } from '@agoric/orchestration';
|
|
43
48
|
import type { CosmosChainInfo } from '@agoric/orchestration';
|
|
49
|
+
import type { Marshaller } from '@agoric/internal/src/lib-chainStorage.js';
|
|
44
50
|
import type { Remote } from '@agoric/vow';
|
|
51
|
+
import type { StorageNode } from '@agoric/internal/src/lib-chainStorage.js';
|
|
45
52
|
import type { Zone } from '@agoric/zone';
|
|
46
53
|
import type { OrchestrationTools } from '../utils/start-helper.js';
|
|
47
54
|
import type { Vow } from '@agoric/vow';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap-anything.contract.d.ts","sourceRoot":"","sources":["swap-anything.contract.js"],"names":[],"mappings":"AAcA
|
|
1
|
+
{"version":3,"file":"swap-anything.contract.d.ts","sourceRoot":"","sources":["swap-anything.contract.js"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AAEH,qEAGE;AAmBK,8BAVI,GAAG,eACH,mBAAmB,GAAG;IAC5B,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;CAClC,QACO,IAAI,oEACJ,kBAAkB;;;;;;;;GA6I5B;AAGD;gBAtJiB,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;gBAC9C,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC;gBAC/B,OAAO,UAAU,CAAC;iBACjB,OAAO,WAAW,CAAC;;;;;;;;;GAmJ0C;yBAzKzD,aAAa;yCAHuB,0BAA0B;2BACR,uBAAuB;iCAAvB,uBAAuB;qCAAvB,uBAAuB;gCAGtE,0CAA0C;4BANzC,aAAa;iCAOb,0CAA0C;0BANjD,cAAc;wCACqB,0BAA0B;yBAFtD,aAAa"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { decodeAddressHook } from '@agoric/cosmic-proto/address-hooks.js';
|
|
2
2
|
import { makeTracer } from '@agoric/internal';
|
|
3
|
+
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
3
4
|
import { E } from '@endo/far';
|
|
4
5
|
import { M } from '@endo/patterns';
|
|
5
|
-
import { decodeAddressHook } from '@agoric/cosmic-proto/address-hooks.js';
|
|
6
6
|
import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js';
|
|
7
|
+
import { AnyNatAmountShape } from '../typeGuards.js';
|
|
8
|
+
import { registerChainsAndAssets } from '../utils/chain-hub-helper.js';
|
|
7
9
|
import { withOrchestration } from '../utils/start-helper.js';
|
|
8
10
|
import * as sharedFlows from './shared.flows.js';
|
|
9
11
|
import { swapAnythingViaHook, swapIt } from './swap-anything.flows.js';
|
|
10
|
-
import { AnyNatAmountShape } from '../typeGuards.js';
|
|
11
|
-
import { registerChainsAndAssets } from '../utils/chain-hub-helper.js';
|
|
12
12
|
|
|
13
13
|
const trace = makeTracer('SwapAnything.Contract');
|
|
14
14
|
const interfaceTODO = undefined;
|
|
@@ -17,6 +17,10 @@ const interfaceTODO = undefined;
|
|
|
17
17
|
* @import {Zone} from '@agoric/zone';
|
|
18
18
|
* @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js';
|
|
19
19
|
* @import {CosmosChainInfo, Denom, DenomDetail, OrchestrationAccount} from '@agoric/orchestration';
|
|
20
|
+
* @import {VTransferIBCEvent} from '@agoric/vats';
|
|
21
|
+
* @import {ZCF} from '@agoric/zoe';
|
|
22
|
+
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js';
|
|
23
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
20
24
|
*/
|
|
21
25
|
|
|
22
26
|
export const SingleNatAmountRecord = M.and(
|
|
@@ -35,7 +39,7 @@ harden(SingleNatAmountRecord);
|
|
|
35
39
|
* @param {OrchestrationPowers & {
|
|
36
40
|
* assetInfo?: [Denom, DenomDetail & { brandKey?: string }][];
|
|
37
41
|
* chainInfo?: Record<string, CosmosChainInfo>;
|
|
38
|
-
* marshaller: Marshaller
|
|
42
|
+
* marshaller: Remote<Marshaller>;
|
|
39
43
|
* storageNode: Remote<StorageNode>;
|
|
40
44
|
* }} privateArgs
|
|
41
45
|
* @param {Zone} zone
|
|
@@ -45,7 +49,7 @@ export const contract = async (
|
|
|
45
49
|
zcf,
|
|
46
50
|
privateArgs,
|
|
47
51
|
zone,
|
|
48
|
-
{ chainHub, orchestrate, vowTools, zoeTools },
|
|
52
|
+
{ cachingMarshaller, chainHub, orchestrate, vowTools, zoeTools },
|
|
49
53
|
) => {
|
|
50
54
|
const creatorFacet = prepareChainHubAdmin(zone, chainHub);
|
|
51
55
|
|
|
@@ -101,7 +105,7 @@ export const contract = async (
|
|
|
101
105
|
console.log('making tap');
|
|
102
106
|
return zone.exo('tap', interfaceTODO, {
|
|
103
107
|
/**
|
|
104
|
-
* @param {
|
|
108
|
+
* @param {VTransferIBCEvent} event
|
|
105
109
|
*/
|
|
106
110
|
async receiveUpcall(event) {
|
|
107
111
|
await null;
|
|
@@ -155,7 +159,7 @@ export const contract = async (
|
|
|
155
159
|
void vowTools.when(sharedLocalAccountP, async lca => {
|
|
156
160
|
sharedLocalAccount = lca;
|
|
157
161
|
await sharedLocalAccount.monitorTransfers(tap);
|
|
158
|
-
const encoded = await E(
|
|
162
|
+
const encoded = await E(cachingMarshaller).toCapData({
|
|
159
163
|
sharedLocalAccount: sharedLocalAccount.getAddress(),
|
|
160
164
|
});
|
|
161
165
|
void E(privateArgs.storageNode).setValue(JSON.stringify(encoded));
|
|
@@ -7,37 +7,49 @@
|
|
|
7
7
|
* @import {Zone} from '@agoric/zone';
|
|
8
8
|
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
9
9
|
* @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
|
|
10
|
+
* @import {ContractMeta} from '@agoric/zoe';
|
|
11
|
+
* @import {ZCF} from '@agoric/zoe';
|
|
12
|
+
* @import {Brand} from '@agoric/ertp';
|
|
13
|
+
* @import {NatValue} from '@agoric/ertp';
|
|
14
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
15
|
+
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js';
|
|
10
16
|
*/
|
|
11
17
|
/** @type {ContractMeta<typeof start>} */
|
|
12
18
|
export const meta: ContractMeta<typeof start>;
|
|
13
19
|
export function makeNatAmountShape(brand: Brand, min?: NatValue): {
|
|
14
|
-
brand:
|
|
20
|
+
brand: Brand;
|
|
15
21
|
value: import("@endo/patterns").Matcher;
|
|
16
22
|
};
|
|
17
|
-
export const start: (zcf:
|
|
23
|
+
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: {
|
|
18
24
|
agoricNames: Remote<NameHub>;
|
|
19
25
|
localchain: Remote<LocalChain>;
|
|
20
26
|
orchestrationService: Remote<CosmosInterchainService>;
|
|
21
27
|
storageNode: Remote<StorageNode>;
|
|
22
28
|
timerService: Remote<TimerService>;
|
|
23
|
-
marshaller: Marshaller
|
|
29
|
+
marshaller: Remote<Marshaller>;
|
|
24
30
|
chainInfo: Record<string, CosmosChainInfo>;
|
|
25
31
|
assetInfo: [Denom, DenomDetail & {
|
|
26
32
|
brandKey?: string;
|
|
27
33
|
}][];
|
|
28
|
-
}, baggage: Baggage) => Promise<{
|
|
34
|
+
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
29
35
|
publicFacet: import("@endo/exo").Guarded<{
|
|
30
|
-
makeSwapAndStakeInvitation(): Promise<
|
|
31
|
-
staked: Amount<"nat">;
|
|
36
|
+
makeSwapAndStakeInvitation(): Promise<import("@agoric/zoe").Invitation<import("@agoric/vow").Vow<void>, {
|
|
37
|
+
staked: import("@agoric/ertp").Amount<"nat">;
|
|
32
38
|
validator: import("@agoric/orchestration").CosmosValidatorAddress;
|
|
33
39
|
}>>;
|
|
34
40
|
}>;
|
|
35
41
|
}>;
|
|
42
|
+
import type { ContractMeta } from '@agoric/zoe';
|
|
43
|
+
import type { Brand } from '@agoric/ertp';
|
|
44
|
+
import type { NatValue } from '@agoric/ertp';
|
|
45
|
+
import type { ZCF } from '@agoric/zoe';
|
|
36
46
|
import type { NameHub } from '@agoric/vats';
|
|
37
47
|
import type { Remote } from '@agoric/internal';
|
|
38
48
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
39
49
|
import type { CosmosInterchainService } from '../exos/exo-interfaces.js';
|
|
50
|
+
import type { StorageNode } from '@agoric/internal/src/lib-chainStorage.js';
|
|
40
51
|
import type { TimerService } from '@agoric/time';
|
|
52
|
+
import type { Marshaller } from '@agoric/internal/src/lib-chainStorage.js';
|
|
41
53
|
import type { CosmosChainInfo } from '@agoric/orchestration';
|
|
42
54
|
import type { Denom } from '@agoric/orchestration';
|
|
43
55
|
import type { DenomDetail } from '@agoric/orchestration';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.contract.d.ts","sourceRoot":"","sources":["swap.contract.js"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"swap.contract.d.ts","sourceRoot":"","sources":["swap.contract.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AAEH,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAanC;AASK,0CAHI,KAAK,QACL,QAAQ;;;EAGmC;AAkDtD;iBA1CkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;kBAClB,OAAO,YAAY,CAAC;gBACtB,OAAO,UAAU,CAAC;eACnB,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC;eAC/B,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;GAmCiB;kCAjFhD,aAAa;2BAEpB,cAAc;8BACX,cAAc;yBAFnB,aAAa;6BALT,cAAc;4BAFf,kBAAkB;gCADd,gCAAgC;6CAEnB,2BAA2B;iCASvC,0CAA0C;kCAZzC,cAAc;gCAahB,0CAA0C;qCANjB,uBAAuB;2BAAvB,uBAAuB;iCAAvB,uBAAuB"}
|
|
@@ -14,6 +14,12 @@ import { ChainInfoShape, DenomDetailShape } from '../typeGuards.js';
|
|
|
14
14
|
* @import {Zone} from '@agoric/zone';
|
|
15
15
|
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
16
16
|
* @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
|
|
17
|
+
* @import {ContractMeta} from '@agoric/zoe';
|
|
18
|
+
* @import {ZCF} from '@agoric/zoe';
|
|
19
|
+
* @import {Brand} from '@agoric/ertp';
|
|
20
|
+
* @import {NatValue} from '@agoric/ertp';
|
|
21
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
22
|
+
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js';
|
|
17
23
|
*/
|
|
18
24
|
|
|
19
25
|
/** @type {ContractMeta<typeof start>} */
|
|
@@ -52,16 +58,16 @@ harden(makeNatAmountShape);
|
|
|
52
58
|
* orchestrationService: Remote<CosmosInterchainService>;
|
|
53
59
|
* storageNode: Remote<StorageNode>;
|
|
54
60
|
* timerService: Remote<TimerService>;
|
|
55
|
-
* marshaller: Marshaller
|
|
61
|
+
* marshaller: Remote<Marshaller>;
|
|
56
62
|
* chainInfo: Record<string, CosmosChainInfo>;
|
|
57
63
|
* assetInfo: [Denom, DenomDetail & { brandKey?: string }][];
|
|
58
|
-
* }}
|
|
64
|
+
* }} _privateArgs
|
|
59
65
|
* @param {Zone} zone
|
|
60
66
|
* @param {OrchestrationTools} tools
|
|
61
67
|
*/
|
|
62
68
|
const contract = async (
|
|
63
69
|
zcf,
|
|
64
|
-
|
|
70
|
+
_privateArgs,
|
|
65
71
|
zone,
|
|
66
72
|
{ orchestrateAll, zoeTools },
|
|
67
73
|
) => {
|
|
@@ -6,5 +6,7 @@ export function stakeAndSwap(orch: Orchestrator, { localTransfer }: {
|
|
|
6
6
|
}): Promise<void>;
|
|
7
7
|
import type { Orchestrator } from '../types.js';
|
|
8
8
|
import type { LocalTransfer } from '../utils/zoe-tools.js';
|
|
9
|
+
import type { ZCFSeat } from '@agoric/zoe';
|
|
10
|
+
import type { Amount } from '@agoric/ertp';
|
|
9
11
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
10
12
|
//# sourceMappingURL=swap.flows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.flows.d.ts","sourceRoot":"","sources":["swap.flows.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"swap.flows.d.ts","sourceRoot":"","sources":["swap.flows.js"],"names":[],"mappings":"AAoBO,mCARI,YAAY,qBAEpB;IAA2B,aAAa,EAAhC,aAAa;CACrB,QAAQ,OAAO,aAEf;IAAiC,MAAM,EAA/B,OAAO,KAAK,CAAC;IACqB,SAAS,EAA3C,sBAAsB;CAChC,iBAsCA;kCArDyE,aAAa;mCADvD,uBAAuB;6BAE7B,aAAa;4BACd,cAAc;4CAFmC,aAAa"}
|
|
@@ -3,6 +3,8 @@ import { orcUtils } from '../utils/orc.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* @import {LocalTransfer} from '../utils/zoe-tools.js';
|
|
5
5
|
* @import {Orchestrator, CosmosValidatorAddress, OrchestrationFlow} from '../types.js'
|
|
6
|
+
* @import {ZCFSeat} from '@agoric/zoe';
|
|
7
|
+
* @import {Amount} from '@agoric/ertp';
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
10
|
// XXX does not actually work. An early illustration that needs to be fixed.
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
export const start: (zcf:
|
|
1
|
+
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: {
|
|
2
2
|
agoricNames: Remote<NameHub>;
|
|
3
3
|
localchain: Remote<LocalChain>;
|
|
4
4
|
orchestrationService: Remote<CosmosInterchainService>;
|
|
5
5
|
storageNode: Remote<StorageNode>;
|
|
6
|
-
marshaller: Marshaller
|
|
6
|
+
marshaller: Remote<Marshaller>;
|
|
7
7
|
timerService: Remote<TimerService>;
|
|
8
|
-
}, baggage: Baggage) => Promise<{
|
|
8
|
+
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
9
9
|
publicFacet: import("@endo/exo").Guarded<{
|
|
10
|
-
makeUnbondAndTransferInvitation(): Promise<
|
|
10
|
+
makeUnbondAndTransferInvitation(): Promise<import("@agoric/zoe").Invitation<import("@agoric/vow").Vow<void>, undefined>>;
|
|
11
11
|
}>;
|
|
12
12
|
}>;
|
|
13
|
+
import type { ZCF } from '@agoric/zoe';
|
|
13
14
|
import type { NameHub } from '@agoric/vats';
|
|
14
15
|
import type { Remote } from '@agoric/internal';
|
|
15
16
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
16
17
|
import type { CosmosInterchainService } from '../exos/exo-interfaces.js';
|
|
18
|
+
import type { StorageNode } from '@agoric/internal/src/lib-chainStorage.js';
|
|
19
|
+
import type { Marshaller } from '@agoric/internal/src/lib-chainStorage.js';
|
|
17
20
|
import type { TimerService } from '@agoric/time';
|
|
18
21
|
//# sourceMappingURL=unbond.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unbond.contract.d.ts","sourceRoot":"","sources":["unbond.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unbond.contract.d.ts","sourceRoot":"","sources":["unbond.contract.js"],"names":[],"mappings":"AA2DA;iBArCkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;gBACpB,OAAO,UAAU,CAAC;kBAChB,OAAO,YAAY,CAAC;;;;;GAgCwC;yBA/CzD,aAAa;6BALT,cAAc;4BACf,kBAAkB;gCAFd,gCAAgC;6CAInB,2BAA2B;iCAGvC,0CAA0C;gCAC3C,0CAA0C;kCATxC,cAAc"}
|
|
@@ -10,6 +10,9 @@ import * as flows from './unbond.flows.js';
|
|
|
10
10
|
* @import {Zone} from '@agoric/zone';
|
|
11
11
|
* @import {CosmosInterchainService} from '../exos/exo-interfaces.js';
|
|
12
12
|
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
13
|
+
* @import {ZCF} from '@agoric/zoe';
|
|
14
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
15
|
+
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js';
|
|
13
16
|
*/
|
|
14
17
|
|
|
15
18
|
/**
|
|
@@ -21,15 +24,15 @@ import * as flows from './unbond.flows.js';
|
|
|
21
24
|
* localchain: Remote<LocalChain>;
|
|
22
25
|
* orchestrationService: Remote<CosmosInterchainService>;
|
|
23
26
|
* storageNode: Remote<StorageNode>;
|
|
24
|
-
* marshaller: Marshaller
|
|
27
|
+
* marshaller: Remote<Marshaller>;
|
|
25
28
|
* timerService: Remote<TimerService>;
|
|
26
|
-
* }}
|
|
29
|
+
* }} _privateArgs
|
|
27
30
|
* @param {Zone} zone
|
|
28
31
|
* @param {OrchestrationTools} tools
|
|
29
32
|
*/
|
|
30
33
|
const contract = async (
|
|
31
34
|
zcf,
|
|
32
|
-
|
|
35
|
+
_privateArgs,
|
|
33
36
|
zone,
|
|
34
37
|
{ orchestrateAll, zcfTools },
|
|
35
38
|
) => {
|
|
@@ -17,25 +17,7 @@ export function prepareChainHubAdmin(zone: Zone, chainHub: ChainHub): import("@e
|
|
|
17
17
|
*/
|
|
18
18
|
registerAsset(denom: Denom, detail: DenomDetail): Promise<void>;
|
|
19
19
|
}>;
|
|
20
|
-
export type ChainHubAdmin = ReturnType<
|
|
21
|
-
/**
|
|
22
|
-
* Register information for a Cosmos chain
|
|
23
|
-
*
|
|
24
|
-
* @param {string} chainName - must not exist in chainHub
|
|
25
|
-
* @param {ChainInfo} chainInfo
|
|
26
|
-
* @param {IBCConnectionInfo} [ibcConnectionInfo] - from Agoric chain
|
|
27
|
-
*/
|
|
28
|
-
registerChain(chainName: string, chainInfo: ChainInfo, ibcConnectionInfo?: IBCConnectionInfo): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Register an asset that may be held on a chain other than the issuing
|
|
31
|
-
* chain.
|
|
32
|
-
*
|
|
33
|
-
* @param {Denom} denom - on the holding chain, whose name is given in
|
|
34
|
-
* `detail.chainName`
|
|
35
|
-
* @param {DenomDetail} detail - chainName and baseName must be registered
|
|
36
|
-
*/
|
|
37
|
-
registerAsset(denom: Denom, detail: DenomDetail): Promise<void>;
|
|
38
|
-
}>>;
|
|
20
|
+
export type ChainHubAdmin = ReturnType<typeof prepareChainHubAdmin>;
|
|
39
21
|
import type { Zone } from '@agoric/zone';
|
|
40
22
|
import type { ChainHub } from './chain-hub.js';
|
|
41
23
|
import type { ChainInfo } from '@agoric/orchestration';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"AA+BO,2CAHI,IAAI,YACJ,QAAQ;IAab;;;;;;OAMG;6BAHQ,MAAM,aACN,SAAS,sBACT,iBAAiB;IAiB5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAU3B;4BAEa,UAAU,
|
|
1
|
+
{"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"AA+BO,2CAHI,IAAI,YACJ,QAAQ;IAab;;;;;;OAMG;6BAHQ,MAAM,aACN,SAAS,sBACT,iBAAiB;IAiB5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAU3B;4BAEa,UAAU,CAAC,OAAO,oBAAoB,CAAC;0BA3E9B,cAAc;8BAEG,gBAAgB;+BADe,uBAAuB;uCAAvB,uBAAuB;2BAAvB,uBAAuB;iCACtD,gBAAgB"}
|
package/src/exos/chain-hub.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @import {Remote, TypedPattern} from '@agoric/internal';
|
|
9
9
|
* @import {Pattern} from '@endo/patterns';
|
|
10
10
|
* @import {MapStore, SetStore} from '@agoric/store';
|
|
11
|
+
* @import {Brand} from '@agoric/ertp';
|
|
11
12
|
*/
|
|
12
13
|
/** receiver address value for ibc transfers that involve PFM */
|
|
13
14
|
export const PFM_RECEIVER: "pfm";
|
|
@@ -142,7 +143,7 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
|
|
|
142
143
|
*/
|
|
143
144
|
resolveAccountId(partialId: AccountId | Bech32Address): AccountId;
|
|
144
145
|
/**
|
|
145
|
-
* Like
|
|
146
|
+
* Like `resolveAccountId` but always returns a CosmosChainAddress.
|
|
146
147
|
*
|
|
147
148
|
* @param {AccountIdArg | Bech32Address} partialId CAIP-10 account ID or a
|
|
148
149
|
* Cosmos bech32 address
|
|
@@ -196,7 +197,7 @@ export type DenomDetail = {
|
|
|
196
197
|
/**
|
|
197
198
|
* - vbank brand, if registered
|
|
198
199
|
*/
|
|
199
|
-
brand?:
|
|
200
|
+
brand?: Brand<"nat"> | undefined;
|
|
200
201
|
};
|
|
201
202
|
export type IbcConnectionKey = `${string}${"_"}${string}`;
|
|
202
203
|
export type ChainHub = ReturnType<typeof makeChainHub>;
|
|
@@ -212,6 +213,7 @@ import type { ChainInfo } from '../orchestration-api.js';
|
|
|
212
213
|
import type { Vow } from '@agoric/vow';
|
|
213
214
|
import type { CaipChainId } from '../orchestration-api.js';
|
|
214
215
|
import type { Denom } from '../orchestration-api.js';
|
|
216
|
+
import type { Brand } from '@agoric/ertp';
|
|
215
217
|
import type { AccountId } from '../orchestration-api.js';
|
|
216
218
|
import type { Bech32Address } from '../cosmos-api.js';
|
|
217
219
|
import type { AccountIdArg } from '../orchestration-api.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AAqBA
|
|
1
|
+
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"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"}
|