@agoric/orchestration 0.2.0-upgrade-20-dev-ef71cfd.0 → 0.2.0-upgrade-19-devnet-dev-5428c4d.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 +27 -29
- package/src/chain-capabilities.d.ts +12 -7
- package/src/chain-capabilities.d.ts.map +1 -1
- package/src/chain-capabilities.js +21 -46
- package/src/chain-info.d.ts +97 -839
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +12 -38
- package/src/cosmos-api.d.ts +13 -41
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +16 -52
- package/src/ethereum-api.d.ts +5 -6
- package/src/ethereum-api.d.ts.map +1 -1
- package/src/ethereum-api.ts +5 -7
- package/src/examples/auto-stake-it-tap-kit.d.ts +4 -4
- package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
- package/src/examples/auto-stake-it-tap-kit.js +8 -8
- package/src/examples/auto-stake-it.contract.d.ts +23 -5
- package/src/examples/auto-stake-it.contract.d.ts.map +1 -1
- package/src/examples/auto-stake-it.contract.js +0 -1
- package/src/examples/basic-flows.contract.d.ts +13 -5
- package/src/examples/basic-flows.contract.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.js +0 -1
- package/src/examples/send-anywhere.contract.d.ts +27 -7
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +12 -40
- package/src/examples/send-anywhere.flows.d.ts +3 -563
- package/src/examples/send-anywhere.flows.d.ts.map +1 -1
- package/src/examples/send-anywhere.flows.js +31 -112
- package/src/examples/stake-bld.contract.d.ts +7 -8
- package/src/examples/stake-bld.contract.d.ts.map +1 -1
- package/src/examples/stake-bld.contract.js +1 -3
- package/src/examples/stake-ica.contract.d.ts +13 -82
- package/src/examples/stake-ica.contract.d.ts.map +1 -1
- package/src/examples/stake-ica.contract.js +0 -1
- package/src/examples/staking-combinations.contract.d.ts +11 -3
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +4 -5
- package/src/examples/staking-combinations.flows.d.ts +2 -2
- package/src/examples/staking-combinations.flows.d.ts.map +1 -1
- package/src/examples/staking-combinations.flows.js +4 -4
- package/src/examples/swap.contract.d.ts +13 -4
- package/src/examples/swap.contract.d.ts.map +1 -1
- package/src/examples/swap.contract.js +2 -2
- package/src/examples/unbond.contract.d.ts +2 -2
- package/src/exos/README.md +0 -1
- package/src/exos/chain-hub-admin.d.ts +9 -9
- package/src/exos/chain-hub-admin.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.js +17 -17
- package/src/exos/chain-hub.d.ts +17 -69
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +55 -289
- package/src/exos/cosmos-orchestration-account.d.ts +17 -86
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +26 -111
- package/src/exos/ibc-packet.d.ts +0 -1
- package/src/exos/ibc-packet.d.ts.map +1 -1
- package/src/exos/ibc-packet.js +1 -8
- package/src/exos/ica-account-kit.d.ts +4 -8
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/ica-account-kit.js +5 -8
- package/src/exos/local-chain-facade.d.ts +23 -3
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +3 -3
- package/src/exos/local-orchestration-account.d.ts +12 -16
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +8 -13
- package/src/exos/orchestrator.d.ts +15 -5
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +10 -9
- package/src/exos/packet-tools.d.ts +1 -1
- package/src/exos/packet-tools.d.ts.map +1 -1
- package/src/exos/packet-tools.js +12 -17
- package/src/exos/portfolio-holder-kit.d.ts +0 -1
- package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
- package/src/exos/portfolio-holder-kit.js +0 -1
- package/src/exos/remote-chain-facade.d.ts +15 -5
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +13 -23
- package/src/facade.js +1 -1
- package/src/fetched-chain-info.d.ts +86 -676
- package/src/fetched-chain-info.js +41 -553
- package/src/fixtures/query-flows.contract.d.ts +4 -5
- package/src/fixtures/query-flows.contract.d.ts.map +1 -1
- package/src/fixtures/query-flows.contract.js +0 -1
- package/src/orchestration-api.d.ts +16 -73
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +19 -89
- package/src/proposals/start-send-anywhere.js +0 -4
- package/src/typeGuards.d.ts +4 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +13 -52
- package/src/types.d.ts +1 -1
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +1 -2
- package/src/utils/address.d.ts +3 -13
- package/src/utils/address.d.ts.map +1 -1
- package/src/utils/address.js +5 -97
- package/src/utils/chain-hub-helper.d.ts +2 -2
- package/src/utils/chain-hub-helper.d.ts.map +1 -1
- package/src/utils/chain-hub-helper.js +5 -9
- package/src/utils/cosmos.d.ts +1 -1
- package/src/utils/cosmos.d.ts.map +1 -1
- package/src/utils/cosmos.js +2 -2
- package/src/utils/orchestrationAccount.js +5 -6
- package/src/utils/registry.d.ts +12 -2
- package/src/utils/registry.d.ts.map +1 -1
- package/src/utils/registry.js +2 -4
- package/src/utils/start-helper.d.ts +6 -20
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +2 -13
- package/src/utils/zoe-tools.d.ts +2 -2
- package/src/utils/zoe-tools.d.ts.map +1 -1
- package/src/utils/zoe-tools.js +2 -5
- package/tools/ibc-mocks.d.ts +5 -6
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +4 -10
- package/tools/make-test-address.d.ts +1 -2
- package/tools/make-test-address.d.ts.map +1 -1
- package/tools/make-test-address.js +2 -6
- package/src/cctp-chain-info.d.ts +0 -65
- package/src/cctp-chain-info.d.ts.map +0 -1
- package/src/cctp-chain-info.js +0 -52
- package/src/utils/chain-info.d.ts +0 -5
- package/src/utils/chain-info.d.ts.map +0 -1
- package/src/utils/chain-info.js +0 -11
|
@@ -5,7 +5,7 @@ import { M } from '@endo/patterns';
|
|
|
5
5
|
import { NonNullish, makeTracer } from '@agoric/internal';
|
|
6
6
|
import { VowShape } from '@agoric/vow';
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
ChainAddressShape,
|
|
9
9
|
OutboundConnectionHandlerI,
|
|
10
10
|
Proto3Shape,
|
|
11
11
|
TxBodyOptsShape,
|
|
@@ -21,7 +21,7 @@ import { makeTxPacket, parseTxPacket } from '../utils/packet.js';
|
|
|
21
21
|
* @import {AnyJson} from '@agoric/cosmic-proto';
|
|
22
22
|
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
23
23
|
* @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
|
|
24
|
-
* @import {
|
|
24
|
+
* @import {ChainAddress, IcaAccount} from '../types.js';
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
const trace = makeTracer('IcaAccountKit');
|
|
@@ -29,7 +29,7 @@ const trace = makeTracer('IcaAccountKit');
|
|
|
29
29
|
const UNPARSABLE_CHAIN_ADDRESS = 'UNPARSABLE_CHAIN_ADDRESS';
|
|
30
30
|
|
|
31
31
|
export const IcaAccountI = M.interface('IcaAccount', {
|
|
32
|
-
getAddress: M.call().returns(
|
|
32
|
+
getAddress: M.call().returns(ChainAddressShape),
|
|
33
33
|
getLocalAddress: M.call().returns(M.string()),
|
|
34
34
|
getRemoteAddress: M.call().returns(M.string()),
|
|
35
35
|
getPort: M.call().returns(M.remotable('Port')),
|
|
@@ -51,9 +51,7 @@ export const IcaAccountI = M.interface('IcaAccount', {
|
|
|
51
51
|
* localAddress: LocalIbcAddress | undefined;
|
|
52
52
|
* requestedRemoteAddress: string;
|
|
53
53
|
* remoteAddress: RemoteIbcAddress | undefined;
|
|
54
|
-
* chainAddress:
|
|
55
|
-
* | (CosmosChainAddress | { value: typeof UNPARSABLE_CHAIN_ADDRESS })
|
|
56
|
-
* | undefined;
|
|
54
|
+
* chainAddress: ChainAddress | undefined;
|
|
57
55
|
* isInitiatingClose: boolean;
|
|
58
56
|
* }} State
|
|
59
57
|
* Internal to the IcaAccountKit exo
|
|
@@ -103,9 +101,8 @@ export const prepareIcaAccountKit = (zone, { watch, asVow }) =>
|
|
|
103
101
|
},
|
|
104
102
|
},
|
|
105
103
|
account: {
|
|
106
|
-
/** @returns {
|
|
104
|
+
/** @returns {ChainAddress} */
|
|
107
105
|
getAddress() {
|
|
108
|
-
// @ts-expect-error value may be UNPARSABLE_CHAIN_ADDRESS
|
|
109
106
|
return NonNullish(
|
|
110
107
|
this.state.chainAddress,
|
|
111
108
|
'ICA channel creation acknowledgement not yet received.',
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowers): (localChainInfo:
|
|
2
|
-
|
|
1
|
+
export function prepareLocalChainFacade(zone: Zone, powers: LocalChainFacadePowers): (localChainInfo: Readonly<{
|
|
2
|
+
bech32Prefix?: string;
|
|
3
|
+
chainId: string;
|
|
4
|
+
connections?: Record<string, IBCConnectionInfo>;
|
|
5
|
+
icqEnabled?: boolean;
|
|
6
|
+
pfmEnabled?: boolean;
|
|
7
|
+
stakingTokens?: Readonly<Array<{
|
|
8
|
+
denom: string;
|
|
9
|
+
}>>;
|
|
10
|
+
icaEnabled?: boolean;
|
|
11
|
+
}>) => import("@endo/exo").Guarded<{
|
|
12
|
+
getChainInfo(): Vow<Readonly<{
|
|
13
|
+
bech32Prefix?: string;
|
|
14
|
+
chainId: string;
|
|
15
|
+
connections?: Record<string, IBCConnectionInfo>;
|
|
16
|
+
icqEnabled?: boolean;
|
|
17
|
+
pfmEnabled?: boolean;
|
|
18
|
+
stakingTokens?: Readonly<Array<{
|
|
19
|
+
denom: string;
|
|
20
|
+
}>>;
|
|
21
|
+
icaEnabled?: boolean;
|
|
22
|
+
}>>;
|
|
3
23
|
/** @returns {Vow<LocalOrchestrationAccountKit['holder']>} */
|
|
4
24
|
makeAccount(): Vow<LocalOrchestrationAccountKit["holder"]>;
|
|
5
25
|
query(args_0: {
|
|
@@ -36,7 +56,7 @@ export type LocalChainFacadePowers = {
|
|
|
36
56
|
export type MakeLocalChainFacade = ReturnType<typeof prepareLocalChainFacade>;
|
|
37
57
|
export type LocalChainFacade = ReturnType<MakeLocalChainFacade>;
|
|
38
58
|
import type { Zone } from '@agoric/base-zone';
|
|
39
|
-
import type {
|
|
59
|
+
import type { IBCConnectionInfo } from '../types.js';
|
|
40
60
|
import type { Vow } from '@agoric/vow';
|
|
41
61
|
import type { LocalOrchestrationAccountKit } from './local-orchestration-account.js';
|
|
42
62
|
import type { AssetInfo } from '@agoric/vats/src/vat-bank.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AA8LO,8CAJI,IAAI,UACJ,sBAAsB
|
|
1
|
+
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AA8LO,8CAJI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;IAtFzB,6DAA6D;mBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;;GA4FhE;;;;;;;;;;;uBArKa,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;;qCAO3B;IACR,gCAAgC,EAAE,gCAAgC,CAAC;IACnE,aAAa,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC/C,WAAW,EAAE,OAAO,WAAW,CAAC,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,OAAO,YAAY,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;CACpB;mCAyJU,UAAU,CAAC,OAAO,uBAAuB,CAAC;+BAC1C,UAAU,CAAC,oBAAoB,CAAC;0BAzLvB,mBAAmB;uCASiE,aAAa;yBAHxF,aAAa;kDAEoC,kCAAkC;+BAJvF,8BAA8B;sDAIuB,kCAAkC;6CADzE,qBAAqB;4BALtC,kBAAkB;6BAGjB,cAAc;kCAJT,cAAc;gCAEgB,gCAAgC;8BAG7D,aAAa"}
|
|
@@ -19,7 +19,7 @@ import { chainFacadeMethods, TypedJsonShape } from '../typeGuards.js';
|
|
|
19
19
|
* @import {Vow, VowTools} from '@agoric/vow';
|
|
20
20
|
* @import {CosmosInterchainService} from './exo-interfaces.js';
|
|
21
21
|
* @import {LocalOrchestrationAccountKit, MakeLocalOrchestrationAccountKit} from './local-orchestration-account.js';
|
|
22
|
-
* @import {Chain,
|
|
22
|
+
* @import {Chain, ChainAddress, ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount} from '../types.js';
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -142,7 +142,7 @@ const prepareLocalChainFacadeKit = (
|
|
|
142
142
|
},
|
|
143
143
|
makeAccountWatcher: {
|
|
144
144
|
/**
|
|
145
|
-
* @param {[LocalChainAccount,
|
|
145
|
+
* @param {[LocalChainAccount, ChainAddress['value']]} results
|
|
146
146
|
*/
|
|
147
147
|
onFulfilled([account, address]) {
|
|
148
148
|
const optionalStorageNode = storageNode
|
|
@@ -159,7 +159,7 @@ const prepareLocalChainFacadeKit = (
|
|
|
159
159
|
* @param {Remote<StorageNode>} childNode
|
|
160
160
|
* @param {{
|
|
161
161
|
* account: LocalChainAccount;
|
|
162
|
-
* address:
|
|
162
|
+
* address: ChainAddress['value'];
|
|
163
163
|
* }} ctx
|
|
164
164
|
*/
|
|
165
165
|
onFulfilled(childNode, { account, address }) {
|
|
@@ -8,7 +8,7 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
8
8
|
zoeTools: ZoeTools;
|
|
9
9
|
}): (args_0: {
|
|
10
10
|
account: LocalChainAccount;
|
|
11
|
-
address:
|
|
11
|
+
address: ChainAddress;
|
|
12
12
|
storageNode?: Remote<globalThis.StorageNode> | undefined;
|
|
13
13
|
}) => import("@endo/exo").GuardedKit<{
|
|
14
14
|
helper: {
|
|
@@ -32,16 +32,16 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
32
32
|
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<TimestampRecord>, undefined>>;
|
|
33
33
|
CloseAccount(): never;
|
|
34
34
|
Send(): Promise<Invitation<Vow<void>, {
|
|
35
|
-
toAccount:
|
|
35
|
+
toAccount: ChainAddress;
|
|
36
36
|
amount: AmountArg;
|
|
37
37
|
}>>;
|
|
38
38
|
SendAll(): Promise<Invitation<Vow<void>, {
|
|
39
|
-
toAccount:
|
|
39
|
+
toAccount: ChainAddress;
|
|
40
40
|
amounts: AmountArg[];
|
|
41
41
|
}>>;
|
|
42
42
|
Transfer(): Promise<Invitation<Vow<void>, {
|
|
43
43
|
amount: AmountArg;
|
|
44
|
-
destination:
|
|
44
|
+
destination: ChainAddress;
|
|
45
45
|
opts?: IBCMsgTransferOptions;
|
|
46
46
|
}>>;
|
|
47
47
|
Withdraw(): Promise<Invitation<Vow<void>, undefined>>;
|
|
@@ -156,11 +156,11 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
156
156
|
}[]): Vow<{
|
|
157
157
|
'@type': string;
|
|
158
158
|
}[]>;
|
|
159
|
-
getAddress():
|
|
160
|
-
send(toAccount:
|
|
161
|
-
sendAll(toAccount:
|
|
159
|
+
getAddress(): ChainAddress;
|
|
160
|
+
send(toAccount: ChainAddress, amount: AmountArg): Vow<void>;
|
|
161
|
+
sendAll(toAccount: ChainAddress, amounts: AmountArg[]): Vow<void>;
|
|
162
162
|
/**
|
|
163
|
-
* @param {
|
|
163
|
+
* @param {ChainAddress} destination
|
|
164
164
|
* @param {AmountArg} amount an ERTP {@link Amount} or a
|
|
165
165
|
* {@link DenomAmount}
|
|
166
166
|
* @param {IBCMsgTransferOptions} [opts] if either timeoutHeight or
|
|
@@ -171,10 +171,10 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
171
171
|
* recognized, or the transfer is rejected (insufficient funds,
|
|
172
172
|
* timeout)
|
|
173
173
|
*/
|
|
174
|
-
transfer(destination:
|
|
174
|
+
transfer(destination: ChainAddress, amount: AmountArg, opts?: IBCMsgTransferOptions): Vow<any>;
|
|
175
175
|
transferSteps(amount: AmountArg, msg: import("@agoric/orchestration").TransferMsg): Vow<void>;
|
|
176
176
|
sendThenWaitForAck(packetSender: Remote<import("./packet-tools.js").PacketSender>, opts?: import("./packet-tools.js").PacketOptions | undefined): import("@agoric/async-flow").HostInterface<Vow<any>>;
|
|
177
|
-
matchFirstPacket(args_0?: import("@agoric/vow").EVow<Pattern>): import("@agoric/async-flow").HostInterface<Vow<{
|
|
177
|
+
matchFirstPacket(args_0?: import("@agoric/vow").EVow<globalThis.Pattern>): import("@agoric/async-flow").HostInterface<Vow<{
|
|
178
178
|
resolver: import("@agoric/vow").VowResolver<any>;
|
|
179
179
|
match: Vow<any>;
|
|
180
180
|
}>>;
|
|
@@ -191,13 +191,12 @@ export type State = {
|
|
|
191
191
|
topicKit: RecorderKit<LocalChainAccountNotification> | undefined;
|
|
192
192
|
packetTools: PacketTools;
|
|
193
193
|
account: LocalChainAccount;
|
|
194
|
-
address:
|
|
194
|
+
address: ChainAddress;
|
|
195
195
|
};
|
|
196
196
|
export type MakeLocalOrchestrationAccountKit = ReturnType<typeof prepareLocalOrchestrationAccountKit>;
|
|
197
197
|
export type LocalOrchestrationAccountKit = ReturnType<MakeLocalOrchestrationAccountKit>;
|
|
198
198
|
import type { Zone } from '@agoric/zone';
|
|
199
199
|
import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
200
|
-
import type { ZCF } from '@agoric/zoe';
|
|
201
200
|
import type { TimerService } from '@agoric/time';
|
|
202
201
|
import type { Remote } from '@agoric/internal';
|
|
203
202
|
import type { VowTools } from '@agoric/vow';
|
|
@@ -205,19 +204,16 @@ import type { ChainHub } from './chain-hub.js';
|
|
|
205
204
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
206
205
|
import type { ZoeTools } from '../utils/zoe-tools.js';
|
|
207
206
|
import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
|
|
208
|
-
import type {
|
|
207
|
+
import type { ChainAddress } from '@agoric/orchestration';
|
|
209
208
|
import type { AmountArg } from '@agoric/orchestration';
|
|
210
209
|
import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
211
210
|
import type { Vow } from '@agoric/vow';
|
|
212
|
-
import type { Invitation } from '@agoric/zoe';
|
|
213
211
|
import type { TimestampRecord } from '@agoric/time';
|
|
214
|
-
import type { AccountIdArg } from '@agoric/orchestration';
|
|
215
212
|
import type { IBCMsgTransferOptions } from '@agoric/orchestration';
|
|
216
213
|
import type { TypedJson } from '@agoric/cosmic-proto';
|
|
217
214
|
import type { JsonSafe } from '@agoric/cosmic-proto';
|
|
218
215
|
import type { TransferRoute } from '@agoric/orchestration';
|
|
219
216
|
import type { DenomAmount } from '@agoric/orchestration';
|
|
220
|
-
import type { ZCFSeat } from '@agoric/zoe';
|
|
221
217
|
import type { ResponseTo } from '@agoric/cosmic-proto';
|
|
222
218
|
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
223
219
|
import type { PacketTools } from './packet-tools.js';
|
|
@@ -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":"AAiGO,0DAVI,IAAI,qFAEZ;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,OAAO,UAAU,CAAC;IACD,QAAQ,EAAzB,QAAQ;CAClB;aAqFc,iBAAiB;aACjB,YAAY;;;;QAoBnB;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QAOjB;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;QAiCxB;;;WAGG;qCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;uBAmBJ,YAAY;oBAAU,SAAS;;;uBAa/B,YAAY;qBAAW,SAAS,EAAE;;;oBAcrC,SAAS;yBACJ,YAAY;mBAClB,qBAAqB;;;;;QAmCrC;;;;;;WAMG;8BALQ,CACV,SACA,UAAgB,+CAA+C,CAAC,CAC3D,CACF;;;QAcJ;;;;;;WAMG;sCALQ,MAAM,mBACN;YACN,IAAI,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAAC;YAClD,KAAK,EAAE,aAAa,CAAC;SACtB;;IAsCN;;;OAGG;;QAED,kDAAkD;6BAAtC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;;;;;IAYxC;;;OAGG;;QAED;;;;WAIG;+BAHQ,MAAM,CAAC,KAAK,CAAC,SACb,WAAW,CAAC,OAAO,CAAC,GAClB,WAAW;;IAM1B,kDAAkD;;QAEhD;;;WAGG;uBAFQ,SAAS,QACT,OAAO;QAKlB;;;WAGG;2BAFQ,KAAK,QACL,OAAO;;IAOpB;;;OAGG;;QAED;;;;;WAKG;4BAJQ,WACV,UAAc,0CAA0C,CAAC,CACtD,GACS,WAAW;;IAU1B;;;OAGG;;QAED;;;;;;;WAOG;4BANQ,SACV,WACA,UAAgB,8CAA8C,CAAC,CAC1D,CACF,GACS,WAAW,EAAE;;;;;;;QA8F1B;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;QAmBxB;;;;WAIG;qCAHQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC,GACX,IAAI,IAAI,GAAG,eAAe,CAAC;;;;;;;;;;;QAkFxC;;;;;;;;;;;WAWG;8BAVQ,YAAY,UACZ,SAAS,SAET,qBAAqB,GAGnB,IAAI,GAAG,CAAC;;;;;;;;;GAmE5B;;aArrBa,MAAM;;;;;oBAKP;IACR,QAAQ,EAAE,YAAY,6BAA6B,CAAC,GAAG,SAAS,CAAC;IACjE,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,YAAY,CAAC;CACvB;+CA6qBU,UAAU,CAAC,OAAO,mCAAmC,CAAC;2CACtD,UAAU,CAAC,gCAAgC,CAAC;0BA7sBnC,cAAc;qCADU,6CAA6C;kCAI5C,cAAc;4BAFrC,kBAAkB;8BAGX,aAAa;8BAIlB,gBAAgB;gCAXK,gCAAgC;8BAarD,uBAAuB;uCAbF,gCAAgC;kCACiF,uBAAuB;+BAAvB,uBAAuB;0BAQjK,kDAAkD;yBAFzC,aAAa;qCADG,cAAc;2CALmG,uBAAuB;+BAOtI,sBAAsB;8BAAtB,sBAAsB;mCAPyF,uBAAuB;iCAAvB,uBAAuB;gCAOtI,sBAAsB;iCANzB,6CAA6C;iCAU9D,mBAAmB"}
|
|
@@ -28,8 +28,7 @@ import { TransferRouteShape } from './chain-hub.js';
|
|
|
28
28
|
/**
|
|
29
29
|
* @import {HostOf} from '@agoric/async-flow';
|
|
30
30
|
* @import {LocalChain, LocalChainAccount} from '@agoric/vats/src/localchain.js';
|
|
31
|
-
* @import {AmountArg,
|
|
32
|
-
* @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
31
|
+
* @import {AmountArg, ChainAddress, DenomAmount, IBCMsgTransferOptions, IBCConnectionInfo, OrchestrationAccountCommon, LocalAccountMethods, TransferRoute} from '@agoric/orchestration';
|
|
33
32
|
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'.
|
|
34
33
|
* @import {Zone} from '@agoric/zone';
|
|
35
34
|
* @import {Remote} from '@agoric/internal';
|
|
@@ -61,7 +60,7 @@ const EVow$ = shape => M.or(Vow$(shape), M.promise(/* shape */));
|
|
|
61
60
|
* topicKit: RecorderKit<LocalChainAccountNotification> | undefined;
|
|
62
61
|
* packetTools: PacketTools;
|
|
63
62
|
* account: LocalChainAccount;
|
|
64
|
-
* address:
|
|
63
|
+
* address: ChainAddress;
|
|
65
64
|
* }} State
|
|
66
65
|
* Internal to the LocalOrchestrationAccount exo
|
|
67
66
|
*/
|
|
@@ -181,7 +180,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
181
180
|
/**
|
|
182
181
|
* @param {object} initState
|
|
183
182
|
* @param {LocalChainAccount} initState.account
|
|
184
|
-
* @param {
|
|
183
|
+
* @param {ChainAddress} initState.address
|
|
185
184
|
* @param {Remote<StorageNode>} [initState.storageNode]
|
|
186
185
|
* @returns {State}
|
|
187
186
|
*/
|
|
@@ -266,7 +265,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
266
265
|
/**
|
|
267
266
|
* @type {OfferHandler<
|
|
268
267
|
* Vow<void>,
|
|
269
|
-
* { toAccount:
|
|
268
|
+
* { toAccount: ChainAddress; amount: AmountArg }
|
|
270
269
|
* >}
|
|
271
270
|
*/
|
|
272
271
|
const offerHandler = (seat, { toAccount, amount }) => {
|
|
@@ -279,7 +278,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
279
278
|
/**
|
|
280
279
|
* @type {OfferHandler<
|
|
281
280
|
* Vow<void>,
|
|
282
|
-
* { toAccount:
|
|
281
|
+
* { toAccount: ChainAddress; amounts: AmountArg[] }
|
|
283
282
|
* >}
|
|
284
283
|
*/
|
|
285
284
|
const offerHandler = (seat, { toAccount, amounts }) => {
|
|
@@ -294,7 +293,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
294
293
|
* Vow<void>,
|
|
295
294
|
* {
|
|
296
295
|
* amount: AmountArg;
|
|
297
|
-
* destination:
|
|
296
|
+
* destination: ChainAddress;
|
|
298
297
|
* opts?: IBCMsgTransferOptions;
|
|
299
298
|
* }
|
|
300
299
|
* >}
|
|
@@ -637,15 +636,12 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
637
636
|
send(toAccount, amount) {
|
|
638
637
|
return asVow(() => {
|
|
639
638
|
trace('send', toAccount, amount);
|
|
640
|
-
const cosmosDest = chainHub.coerceCosmosAddress(toAccount);
|
|
641
|
-
cosmosDest.chainId === this.state.address.chainId ||
|
|
642
|
-
Fail`bank/send cannot send to a different chain ${q(cosmosDest.chainId)}`;
|
|
643
639
|
const { helper } = this.facets;
|
|
644
640
|
return watch(
|
|
645
641
|
E(this.state.account).executeTx([
|
|
646
642
|
typedJson('/cosmos.bank.v1beta1.MsgSend', {
|
|
647
643
|
amount: [helper.amountToCoin(amount)],
|
|
648
|
-
toAddress:
|
|
644
|
+
toAddress: toAccount.value,
|
|
649
645
|
fromAddress: this.state.address.value,
|
|
650
646
|
}),
|
|
651
647
|
]),
|
|
@@ -675,7 +671,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
675
671
|
});
|
|
676
672
|
},
|
|
677
673
|
/**
|
|
678
|
-
* @param {
|
|
674
|
+
* @param {ChainAddress} destination
|
|
679
675
|
* @param {AmountArg} amount an ERTP {@link Amount} or a
|
|
680
676
|
* {@link DenomAmount}
|
|
681
677
|
* @param {IBCMsgTransferOptions} [opts] if either timeoutHeight or
|
|
@@ -689,7 +685,6 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
689
685
|
transfer(destination, amount, opts) {
|
|
690
686
|
return asVow(() => {
|
|
691
687
|
trace('Transferring funds over IBC');
|
|
692
|
-
|
|
693
688
|
const denomAmount = coerceDenomAmount(chainHub, amount);
|
|
694
689
|
|
|
695
690
|
const { forwardOpts, ...rest } = opts ?? {};
|
|
@@ -11,7 +11,7 @@ export function prepareOrchestrator(zone: Zone, powers: {
|
|
|
11
11
|
vowTools: VowTools;
|
|
12
12
|
}): () => import("@endo/exo").Guarded<{
|
|
13
13
|
getChain(chainName: string): Vow<HostInterface<Chain<any> & object>>;
|
|
14
|
-
getDenomInfo(denom: string, srcChainName: "agoric" | "
|
|
14
|
+
getDenomInfo(denom: string, srcChainName: "agoric" | "archway" | "celestia" | "dydx" | "evmos" | "haqq" | "juno" | "kava" | "kujira" | "migaloo" | "neutron" | "noble" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "stride" | "titan" | "umee" | "beezee" | "carbon" | "coreum" | "cosmoshub" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "omniflixhub" | "osmosis" | "planq" | "provenance" | "quicksilver" | "secretnetwork" | "sifchain" | "stargaze" | "terra2"): HostInterface<import("../orchestration-api.js").DenomInfo<"agoric" | "archway" | "celestia" | "dydx" | "evmos" | "haqq" | "juno" | "kava" | "kujira" | "migaloo" | "neutron" | "noble" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "stride" | "titan" | "umee" | "beezee" | "carbon" | "coreum" | "cosmoshub" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "omniflixhub" | "osmosis" | "planq" | "provenance" | "quicksilver" | "secretnetwork" | "sifchain" | "stargaze" | "terra2", "agoric" | "archway" | "celestia" | "dydx" | "evmos" | "haqq" | "juno" | "kava" | "kujira" | "migaloo" | "neutron" | "noble" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "stride" | "titan" | "umee" | "beezee" | "carbon" | "coreum" | "cosmoshub" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "omniflixhub" | "osmosis" | "planq" | "provenance" | "quicksilver" | "secretnetwork" | "sifchain" | "stargaze" | "terra2">>;
|
|
15
15
|
/** @type {HostOf<Orchestrator['asAmount']>} */
|
|
16
16
|
asAmount: HostOf<Orchestrator["asAmount"]>;
|
|
17
17
|
}>;
|
|
@@ -51,7 +51,17 @@ declare function prepareOrchestratorKit(zone: Zone, { chainHub, makeLocalChainFa
|
|
|
51
51
|
* @param {ActualChainInfo<'agoric'>} agoricChainInfo
|
|
52
52
|
*/
|
|
53
53
|
onFulfilled(agoricChainInfo: ActualChainInfo<"agoric">): import("@endo/exo").Guarded<{
|
|
54
|
-
getChainInfo(): Vow<
|
|
54
|
+
getChainInfo(): Vow<Readonly<{
|
|
55
|
+
bech32Prefix?: string;
|
|
56
|
+
chainId: string;
|
|
57
|
+
connections?: Record<string, IBCConnectionInfo>;
|
|
58
|
+
icqEnabled?: boolean;
|
|
59
|
+
pfmEnabled?: boolean;
|
|
60
|
+
stakingTokens?: Readonly<Array<{
|
|
61
|
+
denom: string;
|
|
62
|
+
}>>;
|
|
63
|
+
icaEnabled?: boolean;
|
|
64
|
+
}>>;
|
|
55
65
|
makeAccount(): Vow<import("./local-orchestration-account.js").LocalOrchestrationAccountKit["holder"]>;
|
|
56
66
|
query(args_0: {
|
|
57
67
|
'@type': string;
|
|
@@ -78,7 +88,7 @@ declare function prepareOrchestratorKit(zone: Zone, { chainHub, makeLocalChainFa
|
|
|
78
88
|
*/
|
|
79
89
|
onFulfilled([_agoricChainInfo, remoteChainInfo, connectionInfo]: [ChainInfo, ChainInfo, IBCConnectionInfo], name: string): import("@endo/exo").Guarded<{
|
|
80
90
|
getChainInfo(): Vow<any>;
|
|
81
|
-
makeAccount(): Vow<HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & object> | HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").LocalAccountMethods> | HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").IcaAccountMethods & object
|
|
91
|
+
makeAccount(): Vow<HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & object> | HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").LocalAccountMethods> | HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").IcaAccountMethods & object> | HostInterface<import("../orchestration-api.js").OrchestrationAccountCommon & import("../cosmos-api.js").IcaAccountMethods & import("../cosmos-api.js").StakingAccountActions & import("../cosmos-api.js").StakingAccountQueries>>;
|
|
82
92
|
query(msgs: {
|
|
83
93
|
data: string;
|
|
84
94
|
path: string;
|
|
@@ -105,13 +115,13 @@ declare function prepareOrchestratorKit(zone: Zone, { chainHub, makeLocalChainFa
|
|
|
105
115
|
};
|
|
106
116
|
orchestrator: {
|
|
107
117
|
getChain(chainName: string): Vow<HostInterface<Chain<any> & object>>;
|
|
108
|
-
getDenomInfo(denom: string, srcChainName: "agoric" | "
|
|
118
|
+
getDenomInfo(denom: string, srcChainName: "agoric" | "archway" | "celestia" | "dydx" | "evmos" | "haqq" | "juno" | "kava" | "kujira" | "migaloo" | "neutron" | "noble" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "stride" | "titan" | "umee" | "beezee" | "carbon" | "coreum" | "cosmoshub" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "omniflixhub" | "osmosis" | "planq" | "provenance" | "quicksilver" | "secretnetwork" | "sifchain" | "stargaze" | "terra2"): HostInterface<import("../orchestration-api.js").DenomInfo<"agoric" | "archway" | "celestia" | "dydx" | "evmos" | "haqq" | "juno" | "kava" | "kujira" | "migaloo" | "neutron" | "noble" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "stride" | "titan" | "umee" | "beezee" | "carbon" | "coreum" | "cosmoshub" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "omniflixhub" | "osmosis" | "planq" | "provenance" | "quicksilver" | "secretnetwork" | "sifchain" | "stargaze" | "terra2", "agoric" | "archway" | "celestia" | "dydx" | "evmos" | "haqq" | "juno" | "kava" | "kujira" | "migaloo" | "neutron" | "noble" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "stride" | "titan" | "umee" | "beezee" | "carbon" | "coreum" | "cosmoshub" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "omniflixhub" | "osmosis" | "planq" | "provenance" | "quicksilver" | "secretnetwork" | "sifchain" | "stargaze" | "terra2">>;
|
|
109
119
|
/** @type {HostOf<Orchestrator['asAmount']>} */
|
|
110
120
|
asAmount: HostOf<Orchestrator["asAmount"]>;
|
|
111
121
|
};
|
|
112
122
|
}>;
|
|
113
123
|
import type { ActualChainInfo } from './chain-hub.js';
|
|
114
|
-
import type { ChainInfo } from '../types.js';
|
|
115
124
|
import type { IBCConnectionInfo } from '../types.js';
|
|
125
|
+
import type { ChainInfo } from '../types.js';
|
|
116
126
|
export {};
|
|
117
127
|
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["orchestrator.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["orchestrator.js"],"names":[],"mappings":"AAiCA,0BAA0B;AAC1B;;;;GAIG;AAiJI,0CARI,IAAI,UACJ;IACN,QAAQ,EAAE,QAAQ,CAAC;IACnB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,EAAE,QAAQ,CAAC;CACpB;;;IAfI,+CAA+C;cAApC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;GAoBlD;;;;;+BAMY,UAAU,CAClB,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAC1C,CAAC,cAAc,CAAC;0BAnLG,mBAAmB;8BACE,gBAAgB;0CASrB,yBAAyB;2CACxB,0BAA0B;8BARlC,aAAa;2BASoC,aAAa;mCAVtC,oBAAoB;yBAC5C,aAAa;kCASoC,aAAa;4BAVtC,oBAAoB;AAuB5E;;;;;;;;GAQG;AACH,8CARW,IAAI,0FACJ;IACN,QAAQ,EAAE,QAAQ,CAAC;IACnB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,EAAE,QAAQ,CAAC;CACpB;IAwCE,2DAA2D;;QAEzD;;WAEG;qCADQ,gBAAgB,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;IAQtC;;;OAGG;;QAED;;;;;;WAMG;0HADQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0DjB,+CAA+C;kBAApC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;;GAKlD;qCA3J2C,gBAAgB;uCAWqB,aAAa;+BAAb,aAAa"}
|
package/src/exos/orchestrator.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/** @file Orchestrator exo */
|
|
2
2
|
import { AmountShape } from '@agoric/ertp';
|
|
3
|
-
import {
|
|
3
|
+
import { pickFacet } from '@agoric/vat-data';
|
|
4
4
|
import { makeTracer } from '@agoric/internal';
|
|
5
5
|
import { Shape as NetworkShape } from '@agoric/network';
|
|
6
6
|
import { Fail, q } from '@endo/errors';
|
|
7
7
|
import { M } from '@endo/patterns';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
DenomInfoShape,
|
|
10
|
+
ChainInfoShape,
|
|
11
|
+
DenomAmountShape,
|
|
12
|
+
DenomShape,
|
|
13
|
+
} from '../typeGuards.js';
|
|
9
14
|
|
|
10
15
|
/**
|
|
11
16
|
* @import {Zone} from '@agoric/base-zone';
|
|
@@ -28,7 +33,7 @@ const trace = makeTracer('Orchestrator');
|
|
|
28
33
|
|
|
29
34
|
/** @see {Orchestrator} */
|
|
30
35
|
export const OrchestratorI = M.interface('Orchestrator', {
|
|
31
|
-
getChain: M.call(M.string()).returns(Vow$(
|
|
36
|
+
getChain: M.call(M.string()).returns(Vow$(ChainInfoShape)),
|
|
32
37
|
getDenomInfo: M.call(DenomShape, M.string()).returns(DenomInfoShape),
|
|
33
38
|
asAmount: M.call(DenomAmountShape).returns(AmountShape),
|
|
34
39
|
});
|
|
@@ -56,12 +61,8 @@ const prepareOrchestratorKit = (
|
|
|
56
61
|
* @typedef {{ vow: Vow<T>; pending: true } | { value: T; pending: false }} MaybePendingValue
|
|
57
62
|
*/
|
|
58
63
|
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
* @type {MapStore<string, MaybePendingValue<HostInterface<Chain>>>}
|
|
63
|
-
*/
|
|
64
|
-
const chainByName = makeScalarMapStore('chainName');
|
|
64
|
+
/** @type {MapStore<string, MaybePendingValue<HostInterface<Chain>>>} */
|
|
65
|
+
const chainByName = zone.mapStore('chainName');
|
|
65
66
|
|
|
66
67
|
return zone.exoClassKit(
|
|
67
68
|
'Orchestrator',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function preparePacketTools(zone: import("@agoric/base-zone").Zone, vowTools: VowTools): (lca: import("@endo/exo").Guarded<{
|
|
2
|
-
getAddress():
|
|
2
|
+
getAddress(): string;
|
|
3
3
|
getBalance(brand: Brand<"nat">): import("@agoric/vow").PromiseVow<Amount<"nat">>;
|
|
4
4
|
deposit(payment: ERef<Payment<"nat">>, optAmountShape?: Pattern): import("@agoric/vow").PromiseVow<Amount<"nat">>;
|
|
5
5
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<Payment<"nat">>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packet-tools.d.ts","sourceRoot":"","sources":["packet-tools.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"packet-tools.d.ts","sourceRoot":"","sources":["packet-tools.js"],"names":[],"mappings":"AA2DO,yCAHI,OAAO,mBAAmB,EAAE,IAAI,YAChC,QAAQ;;;;;;;;IAiFX;;OAEG;8BADQ,IAAI,CAAC,SAAS,CAAC;;;;8BAnHvB,KAAK,OAAO,CAAC,GACX,IAAI;QAAE,QAAQ,EAAE,YAAY,GAAG,CAAC,CAAC;QAAC,KAAK,EAAE,IAAI,GAAG,CAAC,CAAA;KAAE,CAAC;IAsIzD;;;;OAIG;qCAHQ,OAAO,YAAY,CAAC,SACpB,aAAa,GACX,IAAI,GAAG,CAAC;GAwM5B;mCAlVU,KAAK,OAAO,CAAC,KACX,IAAI;IAAE,QAAQ,EAAE,YAAY,GAAG,CAAC,CAAC;IAAC,KAAK,EAAE,IAAI,GAAG,CAAC,CAAA;CAAE,CAAC;;gBAKnD,CACT,IAAI,EAAE,aAAa,KAChB,IAAI;QAAE,YAAY,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAA;KAAE,CAAC;;;;;;4BAU5C,IAAI,CAChB,OAAW,eAAe,EAAE,qBAAqB,EACjD,eAAmB,GAAG,kBAAkB,CACrC;0BAiUS,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;8BA7VZ,aAAa;6BAD9C,gBAAgB;+BAGM,mCAAmC;wCAAnC,mCAAmC;0BAFxB,aAAa;iCAAb,aAAa;yBAAb,aAAa;4BAAb,aAAa"}
|
package/src/exos/packet-tools.js
CHANGED
|
@@ -3,9 +3,6 @@ import { Shape as NetworkShape } from '@agoric/network';
|
|
|
3
3
|
import { M, matches } from '@endo/patterns';
|
|
4
4
|
import { E } from '@endo/far';
|
|
5
5
|
import { pickFacet } from '@agoric/vat-data';
|
|
6
|
-
import { makeTracer } from '@agoric/internal';
|
|
7
|
-
|
|
8
|
-
const trace = makeTracer('PacketTools');
|
|
9
6
|
|
|
10
7
|
const { toCapData } = makeMarshal(undefined, undefined, {
|
|
11
8
|
marshalName: 'JustEncoder',
|
|
@@ -13,14 +10,13 @@ const { toCapData } = makeMarshal(undefined, undefined, {
|
|
|
13
10
|
});
|
|
14
11
|
const just = obj => {
|
|
15
12
|
const { body } = toCapData(obj);
|
|
16
|
-
return decodeToJustin(JSON.parse(body),
|
|
13
|
+
return decodeToJustin(JSON.parse(body), true);
|
|
17
14
|
};
|
|
18
15
|
|
|
19
16
|
/**
|
|
20
17
|
* @import {Pattern} from '@endo/patterns';
|
|
21
18
|
* @import {EVow, Remote, Vow, VowResolver, VowTools} from '@agoric/vow';
|
|
22
19
|
* @import {LocalChainAccount} from '@agoric/vats/src/localchain.js';
|
|
23
|
-
* @import {VTransferIBCEvent} from '@agoric/vats';
|
|
24
20
|
* @import {TargetApp, TargetRegistration} from '@agoric/vats/src/bridge-target.js';
|
|
25
21
|
*/
|
|
26
22
|
|
|
@@ -207,13 +203,11 @@ export const preparePacketTools = (zone, vowTools) => {
|
|
|
207
203
|
},
|
|
208
204
|
},
|
|
209
205
|
tap: {
|
|
210
|
-
|
|
211
|
-
* @param {VTransferIBCEvent} obj
|
|
212
|
-
*/
|
|
206
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
213
207
|
async receiveUpcall(obj) {
|
|
214
208
|
const { monitor, resolverToPattern, upcallQueue, pending } =
|
|
215
209
|
this.state;
|
|
216
|
-
|
|
210
|
+
console.debug(
|
|
217
211
|
`Trying ${resolverToPattern.getSize()} current patterns and ${pending} pending patterns against`,
|
|
218
212
|
just(obj),
|
|
219
213
|
);
|
|
@@ -225,7 +219,7 @@ export const preparePacketTools = (zone, vowTools) => {
|
|
|
225
219
|
// Check all our fulfilled patterns for matches.
|
|
226
220
|
for (const [resolver, pattern] of resolverToPattern.entries()) {
|
|
227
221
|
if (matches(obj, pattern)) {
|
|
228
|
-
|
|
222
|
+
console.debug('Matched pattern:', just(pattern));
|
|
229
223
|
resolver.resolve(obj);
|
|
230
224
|
resolverToPattern.delete(resolver);
|
|
231
225
|
return;
|
|
@@ -234,10 +228,10 @@ export const preparePacketTools = (zone, vowTools) => {
|
|
|
234
228
|
if (upcallQueue) {
|
|
235
229
|
// We have some pending patterns (ones that have been requested but
|
|
236
230
|
// haven't yet settled) that may match this object.
|
|
237
|
-
|
|
231
|
+
console.debug('Stashing object in upcallQueue');
|
|
238
232
|
this.state.upcallQueue = harden(upcallQueue.concat(obj));
|
|
239
233
|
}
|
|
240
|
-
|
|
234
|
+
console.debug('No match yet.');
|
|
241
235
|
},
|
|
242
236
|
},
|
|
243
237
|
sendPacketWatcher: {
|
|
@@ -282,24 +276,25 @@ export const preparePacketTools = (zone, vowTools) => {
|
|
|
282
276
|
onFulfilled(pattern, { resolver }) {
|
|
283
277
|
const { resolverToPattern, upcallQueue } = this.state;
|
|
284
278
|
|
|
285
|
-
|
|
279
|
+
console.debug('watchPacketPattern onFulfilled', just(pattern));
|
|
286
280
|
if (!upcallQueue) {
|
|
287
281
|
// Save the pattern for later.
|
|
288
|
-
|
|
282
|
+
console.debug('No upcall queue yet. Save the pattern for later.');
|
|
289
283
|
resolverToPattern.init(resolver, pattern);
|
|
290
284
|
return;
|
|
291
285
|
}
|
|
292
286
|
|
|
293
287
|
// Try matching the first in queue.
|
|
294
288
|
const i = upcallQueue.findIndex(obj => matches(obj, pattern));
|
|
295
|
-
if (i
|
|
296
|
-
|
|
289
|
+
if (i < 0) {
|
|
290
|
+
// No match yet. Save the pattern for later.
|
|
291
|
+
console.debug('No match yet. Save the pattern for later.');
|
|
297
292
|
resolverToPattern.init(resolver, pattern);
|
|
298
293
|
return;
|
|
299
294
|
}
|
|
300
295
|
|
|
301
296
|
// Success! Remove the matched object from the queue.
|
|
302
|
-
|
|
297
|
+
console.debug(
|
|
303
298
|
'Success! Remove the matched object from the queue.',
|
|
304
299
|
just(upcallQueue[i]),
|
|
305
300
|
);
|
|
@@ -60,7 +60,6 @@ import type { OrchestrationAccount } from '@agoric/orchestration';
|
|
|
60
60
|
import type { HostInterface } from '@agoric/async-flow';
|
|
61
61
|
import type { MapStore } from '@agoric/store';
|
|
62
62
|
import type { ResolvedPublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
|
|
63
|
-
import type { Invitation } from '@agoric/zoe';
|
|
64
63
|
import type { OrchestrationAccountCommon } from '@agoric/orchestration';
|
|
65
64
|
export {};
|
|
66
65
|
//# sourceMappingURL=portfolio-holder-kit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portfolio-holder-kit.d.ts","sourceRoot":"","sources":["portfolio-holder-kit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"portfolio-holder-kit.d.ts","sourceRoot":"","sources":["portfolio-holder-kit.js"],"names":[],"mappings":"AAgOO,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;mCAhNY;IACR,QAAQ,EAAE,SAAS,MAAM,EAAE,cAAc,qBAAqB,GAAG,CAAC,CAAC,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,MAAM,EAAE,oBAAoB,OAAO,CAAC,CAAC,CAAC;CAC9D;kCA8MU,UAAU,CAAC,OAAO,sBAAsB,CAAC;8BACzC,UAAU,CAAC,mBAAmB,CAAC;0BAvNtB,cAAc;8BAFV,aAAa;AAqBxC;;;;;;GAMG;AACH,iDAHW,IAAI,mBACJ,QAAQ;;QAkDX;;;;;;WAMG;iBALsB,EAAE,SAAb,OAAO,EAAG,aACb,MAAM,UACN,MAAM,mBACN,EAAE,GACA,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;;;;;;;;gBAL7C;;;;;;mBAMG;yBALsB,EAAE,SAAb,OAAO,EAAG,aACb,MAAM,UACN,MAAM,mBACN,EAAE,GACA,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;;;;;;QA+B7C;;;;WAIG;8BAHQ,MAAM,WACN,cAAc,qBAAqB,GAAG,CAAC,CAAC,eACxC,oBAAoB,OAAO,CAAC;QAgBvC;;WAEG;8BADQ,MAAM;;GAQxB;0CAzI+F,uBAAuB;mCAL/E,oBAAoB;8BACjC,eAAe;yCAEJ,2CAA2C;gDAEe,uBAAuB"}
|
|
@@ -12,7 +12,6 @@ const { fromEntries } = Object;
|
|
|
12
12
|
* @import {MapStore} from '@agoric/store';
|
|
13
13
|
* @import {VowTools} from '@agoric/vow';
|
|
14
14
|
* @import {ResolvedPublicTopic} from '@agoric/zoe/src/contractSupport/topics.js';
|
|
15
|
-
* @import {Invitation, ZCF} from '@agoric/zoe';
|
|
16
15
|
* @import {Zone} from '@agoric/zone';
|
|
17
16
|
* @import {OrchestrationAccount, OrchestrationAccountCommon, MakeCombineInvitationMakers} from '@agoric/orchestration';
|
|
18
17
|
*/
|