@agoric/orchestration 0.2.0-upgrade-17-dev-ec448b0.0 → 0.2.0-upgrade-18-dev-b9b8db4.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.
Files changed (126) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +2 -1
  3. package/package.json +29 -28
  4. package/src/chain-info.d.ts +31 -387
  5. package/src/chain-info.d.ts.map +1 -1
  6. package/src/chain-info.js +10 -64
  7. package/src/cosmos-api.d.ts +21 -10
  8. package/src/cosmos-api.d.ts.map +1 -1
  9. package/src/cosmos-api.ts +33 -14
  10. package/src/examples/README.md +3 -4
  11. package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
  12. package/src/examples/auto-stake-it-tap-kit.js +4 -7
  13. package/src/examples/auto-stake-it.contract.d.ts +1 -1
  14. package/src/examples/auto-stake-it.flows.d.ts +1 -1
  15. package/src/examples/auto-stake-it.flows.d.ts.map +1 -1
  16. package/src/examples/basic-flows.contract.d.ts +1 -1
  17. package/src/examples/basic-flows.flows.d.ts +1 -1
  18. package/src/examples/send-anywhere.contract.d.ts +20 -2
  19. package/src/examples/send-anywhere.contract.d.ts.map +1 -1
  20. package/src/examples/send-anywhere.contract.js +34 -18
  21. package/src/examples/send-anywhere.flows.d.ts +7 -7
  22. package/src/examples/send-anywhere.flows.d.ts.map +1 -1
  23. package/src/examples/send-anywhere.flows.js +40 -20
  24. package/src/examples/shared.flows.d.ts +4 -0
  25. package/src/examples/shared.flows.d.ts.map +1 -0
  26. package/src/examples/shared.flows.js +21 -0
  27. package/src/examples/stake-bld.contract.d.ts +49 -0
  28. package/src/examples/stake-bld.contract.d.ts.map +1 -0
  29. package/src/examples/{stakeBld.contract.js → stake-bld.contract.js} +10 -1
  30. package/src/examples/stake-ica.contract.d.ts +126 -0
  31. package/src/examples/stake-ica.contract.d.ts.map +1 -0
  32. package/src/examples/{stakeIca.contract.js → stake-ica.contract.js} +6 -2
  33. package/src/examples/staking-combinations.contract.d.ts +1 -1
  34. package/src/examples/staking-combinations.contract.d.ts.map +1 -1
  35. package/src/examples/staking-combinations.contract.js +16 -13
  36. package/src/examples/staking-combinations.flows.d.ts +6 -9
  37. package/src/examples/staking-combinations.flows.d.ts.map +1 -1
  38. package/src/examples/staking-combinations.flows.js +19 -16
  39. package/src/examples/swap.contract.d.ts.map +1 -1
  40. package/src/examples/swap.contract.js +0 -1
  41. package/src/examples/unbond.contract.d.ts +1 -1
  42. package/src/examples/unbond.contract.d.ts.map +1 -1
  43. package/src/examples/unbond.contract.js +10 -5
  44. package/src/examples/unbond.flows.d.ts +4 -3
  45. package/src/examples/unbond.flows.d.ts.map +1 -1
  46. package/src/examples/unbond.flows.js +23 -31
  47. package/src/exos/chain-hub.d.ts +12 -4
  48. package/src/exos/chain-hub.d.ts.map +1 -1
  49. package/src/exos/chain-hub.js +28 -19
  50. package/src/exos/combine-invitation-makers.d.ts +1 -0
  51. package/src/exos/combine-invitation-makers.d.ts.map +1 -1
  52. package/src/exos/combine-invitation-makers.js +6 -0
  53. package/src/exos/cosmos-interchain-service.d.ts +20 -70
  54. package/src/exos/cosmos-interchain-service.d.ts.map +1 -1
  55. package/src/exos/cosmos-orchestration-account.d.ts +152 -47
  56. package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
  57. package/src/exos/cosmos-orchestration-account.js +355 -13
  58. package/src/exos/exo-interfaces.d.ts +3 -3
  59. package/src/exos/exo-interfaces.d.ts.map +1 -1
  60. package/src/exos/exo-interfaces.ts +3 -3
  61. package/src/exos/ica-account-kit.d.ts +2 -2
  62. package/src/exos/ica-account-kit.d.ts.map +1 -1
  63. package/src/exos/icq-connection-kit.d.ts +17 -1
  64. package/src/exos/icq-connection-kit.d.ts.map +1 -1
  65. package/src/exos/local-chain-facade.d.ts +22 -170
  66. package/src/exos/local-chain-facade.d.ts.map +1 -1
  67. package/src/exos/local-orchestration-account.d.ts +41 -48
  68. package/src/exos/local-orchestration-account.d.ts.map +1 -1
  69. package/src/exos/local-orchestration-account.js +94 -13
  70. package/src/exos/orchestrator.d.ts +44 -136
  71. package/src/exos/orchestrator.d.ts.map +1 -1
  72. package/src/exos/orchestrator.js +42 -44
  73. package/src/exos/packet-tools.d.ts +21 -81
  74. package/src/exos/packet-tools.d.ts.map +1 -1
  75. package/src/exos/portfolio-holder-kit.d.ts +4 -4
  76. package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
  77. package/src/exos/portfolio-holder-kit.js +65 -10
  78. package/src/exos/remote-chain-facade.d.ts +35 -128
  79. package/src/exos/remote-chain-facade.d.ts.map +1 -1
  80. package/src/facade.d.ts.map +1 -1
  81. package/src/facade.js +7 -0
  82. package/src/fetched-chain-info.d.ts +30 -340
  83. package/src/fetched-chain-info.js +18 -329
  84. package/src/fixtures/query-flows.flows.d.ts.map +1 -1
  85. package/src/orchestration-api.d.ts +4 -8
  86. package/src/orchestration-api.d.ts.map +1 -1
  87. package/src/orchestration-api.ts +3 -8
  88. package/src/proposals/init-chain-info.js +3 -3
  89. package/src/proposals/orchestration-proposal.d.ts.map +1 -1
  90. package/src/proposals/start-stakeAtom.d.ts +78 -16
  91. package/src/proposals/start-stakeAtom.d.ts.map +1 -1
  92. package/src/proposals/start-stakeAtom.js +9 -4
  93. package/src/proposals/start-stakeBld.d.ts +13 -39
  94. package/src/proposals/start-stakeBld.d.ts.map +1 -1
  95. package/src/proposals/start-stakeBld.js +2 -2
  96. package/src/proposals/start-stakeOsmo.d.ts +77 -15
  97. package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
  98. package/src/proposals/start-stakeOsmo.js +9 -4
  99. package/src/typeGuards.d.ts +5 -1
  100. package/src/typeGuards.d.ts.map +1 -1
  101. package/src/typeGuards.js +21 -9
  102. package/src/types-index.d.ts +1 -0
  103. package/src/types-index.js +1 -0
  104. package/src/types.d.ts +14 -4
  105. package/src/types.d.ts.map +1 -1
  106. package/src/types.ts +15 -4
  107. package/src/utils/cosmos.d.ts +40 -1
  108. package/src/utils/cosmos.d.ts.map +1 -1
  109. package/src/utils/cosmos.js +48 -1
  110. package/src/utils/orchestrationAccount.js +1 -1
  111. package/src/utils/registry.d.ts.map +1 -1
  112. package/src/utils/registry.js +0 -3
  113. package/src/utils/start-helper.d.ts +4 -10
  114. package/src/utils/start-helper.d.ts.map +1 -1
  115. package/src/utils/start-helper.js +18 -15
  116. package/src/utils/zcf-tools.d.ts +5 -0
  117. package/src/utils/zcf-tools.d.ts.map +1 -0
  118. package/src/utils/zcf-tools.js +35 -0
  119. package/src/utils/zoe-tools.d.ts +5 -8
  120. package/src/utils/zoe-tools.d.ts.map +1 -1
  121. package/src/utils/zoe-tools.js +136 -33
  122. package/src/vat-orchestration.d.ts.map +1 -1
  123. package/src/examples/stakeBld.contract.d.ts +0 -75
  124. package/src/examples/stakeBld.contract.d.ts.map +0 -1
  125. package/src/examples/stakeIca.contract.d.ts +0 -64
  126. package/src/examples/stakeIca.contract.d.ts.map +0 -1
package/src/typeGuards.js CHANGED
@@ -73,9 +73,6 @@ export const IBCConnectionInfoShape = M.splitRecord({
73
73
  counterparty: {
74
74
  client_id: M.string(),
75
75
  connection_id: IBCConnectionIDShape,
76
- prefix: {
77
- key_prefix: M.string(),
78
- },
79
76
  },
80
77
  transferChannel: IBCChannelInfoShape,
81
78
  });
@@ -108,7 +105,6 @@ export const CosmosChainInfoShape = M.splitRecord(
108
105
  export const ChainInfoShape = M.splitRecord({
109
106
  chainId: M.string(),
110
107
  });
111
- export const LocalChainAccountShape = M.remotable('LocalChainAccount');
112
108
  export const DenomShape = M.string();
113
109
 
114
110
  /** @type {TypedPattern<DenomInfo<any, any>>} */
@@ -137,10 +133,13 @@ export const AmountArgShape = M.or(AnyNatAmountShape, DenomAmountShape);
137
133
  * amount: AmountArg;
138
134
  * }>}
139
135
  */
140
- export const DelegationShape = harden({
141
- validator: ChainAddressShape,
142
- amount: AmountArgShape,
143
- });
136
+ export const DelegationShape = M.splitRecord(
137
+ {
138
+ validator: ChainAddressShape,
139
+ amount: AmountArgShape,
140
+ },
141
+ { delegator: ChainAddressShape },
142
+ );
144
143
 
145
144
  /** Approximately @see RequestQuery */
146
145
  export const ICQMsgShape = M.splitRecord(
@@ -160,8 +159,11 @@ export const chainFacadeMethods = harden({
160
159
  /**
161
160
  * for google/protobuf/timestamp.proto, not to be confused with TimestampShape
162
161
  * from `@agoric/time`
162
+ *
163
+ * `seconds` is a big integer but since it goes through JSON it is encoded as
164
+ * string
163
165
  */
164
- export const TimestampProtoShape = { seconds: M.nat(), nanos: M.number() };
166
+ export const TimestampProtoShape = { seconds: M.string(), nanos: M.number() };
165
167
 
166
168
  /**
167
169
  * see {@link TxBody} for more details
@@ -177,3 +179,13 @@ export const TxBodyOptsShape = M.splitRecord(
177
179
  nonCriticalExtensionOptions: M.arrayOf(M.any()),
178
180
  },
179
181
  );
182
+
183
+ /**
184
+ * Ensures at least one {@link AmountKeywordRecord} entry is present and only
185
+ * permits Nat (fungible) amounts.
186
+ */
187
+ export const AnyNatAmountsRecord = M.and(
188
+ M.recordOf(M.string(), AnyNatAmountShape),
189
+ M.not(harden({})),
190
+ );
191
+ harden(AnyNatAmountsRecord);
@@ -0,0 +1 @@
1
+ export type * from './types.js';
@@ -0,0 +1 @@
1
+ export {};
package/src/types.d.ts CHANGED
@@ -2,12 +2,22 @@
2
2
  export type * from './chain-info.js';
3
3
  export type * from './cosmos-api.js';
4
4
  export type * from './ethereum-api.js';
5
+ export type * from './exos/chain-hub.js';
6
+ export type * from './exos/combine-invitation-makers.js';
7
+ export type * from './exos/cosmos-interchain-service.js';
8
+ export type * from './exos/exo-interfaces.js';
5
9
  export type * from './exos/ica-account-kit.js';
6
- export type * from './exos/local-chain-facade.js';
7
10
  export type * from './exos/icq-connection-kit.js';
8
- export type * from './exos/exo-interfaces.js';
11
+ export type * from './exos/local-chain-facade.js';
12
+ export type * from './exos/portfolio-holder-kit.js';
9
13
  export type * from './orchestration-api.js';
10
- export type * from './exos/cosmos-interchain-service.js';
11
- export type * from './exos/chain-hub.js';
12
14
  export type * from './vat-orchestration.js';
15
+ /**
16
+ * ({@link ZCF})-like tools for use in {@link OrchestrationFlow}s.
17
+ */
18
+ export interface ZcfTools {
19
+ assertUniqueKeyword: ZCF['assertUniqueKeyword'];
20
+ atomicRearrange: ZCF['atomicRearrange'];
21
+ makeInvitation: ZCF['makeInvitation'];
22
+ }
13
23
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,wBAAwB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,wBAAwB,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,mBAAmB,EAAE,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAChD,eAAe,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACxC,cAAc,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACvC"}
package/src/types.ts CHANGED
@@ -3,11 +3,22 @@
3
3
  export type * from './chain-info.js';
4
4
  export type * from './cosmos-api.js';
5
5
  export type * from './ethereum-api.js';
6
+ export type * from './exos/chain-hub.js';
7
+ export type * from './exos/combine-invitation-makers.js';
8
+ export type * from './exos/cosmos-interchain-service.js';
9
+ export type * from './exos/exo-interfaces.js';
6
10
  export type * from './exos/ica-account-kit.js';
7
- export type * from './exos/local-chain-facade.js';
8
11
  export type * from './exos/icq-connection-kit.js';
9
- export type * from './exos/exo-interfaces.js';
12
+ export type * from './exos/local-chain-facade.js';
13
+ export type * from './exos/portfolio-holder-kit.js';
10
14
  export type * from './orchestration-api.js';
11
- export type * from './exos/cosmos-interchain-service.js';
12
- export type * from './exos/chain-hub.js';
13
15
  export type * from './vat-orchestration.js';
16
+
17
+ /**
18
+ * ({@link ZCF})-like tools for use in {@link OrchestrationFlow}s.
19
+ */
20
+ export interface ZcfTools {
21
+ assertUniqueKeyword: ZCF['assertUniqueKeyword'];
22
+ atomicRearrange: ZCF['atomicRearrange'];
23
+ makeInvitation: ZCF['makeInvitation'];
24
+ }
@@ -1,6 +1,7 @@
1
1
  /**
2
- * @import {DenomAmount} from '../types.js';
2
+ * @import {CosmosDelegationResponse, CosmosValidatorAddress, DenomAmount} from '../types.js';
3
3
  * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js'
4
+ * @import {DelegationResponse} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
4
5
  */
5
6
  /** maximum clock skew, in seconds, for unbonding time reported from other chain */
6
7
  export const maxClockSkew: bigint;
@@ -12,10 +13,48 @@ export function tryDecodeResponse<T>(ackStr: string, fromProtoMsg: (p: {
12
13
  * Transform a cosmos-sdk {@link Coin} object into a {@link DenomAmount}
13
14
  *
14
15
  * @type {(c: { denom: string; amount: string }) => DenomAmount}
16
+ * @see {@link toTruncatedDenomAmount} for DecCoin
15
17
  */
16
18
  export const toDenomAmount: (c: {
17
19
  denom: string;
18
20
  amount: string;
19
21
  }) => DenomAmount;
22
+ /**
23
+ * Transform a cosmos-sdk {@link DecCoin} object into a {@link DenomAmount}, by
24
+ * truncating the fractional portion.
25
+ *
26
+ * @type {(c: { denom: string; amount: string }) => DenomAmount}
27
+ */
28
+ export const toTruncatedDenomAmount: (c: {
29
+ denom: string;
30
+ amount: string;
31
+ }) => DenomAmount;
32
+ /**
33
+ * Transform a cosmos-sdk `{validatorAddress}` object into an Orchestration
34
+ * {@link CosmosValidatorAddress}
35
+ *
36
+ * @type {(
37
+ * r: { validatorAddress: string },
38
+ * chainId: string,
39
+ * ) => CosmosValidatorAddress}
40
+ */
41
+ export const toCosmosValidatorAddress: (r: {
42
+ validatorAddress: string;
43
+ }, chainId: string) => CosmosValidatorAddress;
44
+ /**
45
+ * Transform a cosmos-sdk {@link DelegationResponse} object into an Orchestration
46
+ * {@link CosmosDelegationResponse}
47
+ *
48
+ * @type {(
49
+ * chainInfo: { chainId: string },
50
+ * r: DelegationResponse,
51
+ * ) => CosmosDelegationResponse}
52
+ */
53
+ export const toCosmosDelegationResponse: (chainInfo: {
54
+ chainId: string;
55
+ }, r: DelegationResponse) => CosmosDelegationResponse;
20
56
  import type { DenomAmount } from '../types.js';
57
+ import type { CosmosValidatorAddress } from '../types.js';
58
+ import type { DelegationResponse } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
59
+ import type { CosmosDelegationResponse } from '../types.js';
21
60
  //# sourceMappingURL=cosmos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["cosmos.js"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,mFAAmF;AACnF,kCAAsC;AAO/B,kCAJM,CAAC,UACH,MAAM,gBACN,CAAC,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,KAAK,CAAC,KAY1D;AAED;;;;GAIG;AACH,4BAFU,CAAC,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,KAAK,WAAW,CAEiB;iCA7BlD,aAAa"}
1
+ {"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["cosmos.js"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,mFAAmF;AACnF,kCAAsC;AAO/B,kCAJM,CAAC,UACH,MAAM,gBACN,CAAC,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,KAAK,CAAC,KAY1D;AAED;;;;;GAKG;AACH,4BAHU,CAAC,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,KAAK,WAAW,CAGiB;AAEhF;;;;;GAKG;AACH,qCAFU,CAAC,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,KAAK,WAAW,CAK5D;AAEH;;;;;;;;GAQG;AACH,uCALU,CACL,CAAC,EAAE;IAAE,gBAAgB,EAAE,MAAM,CAAA;CAAE,EAC/B,OAAO,EAAE,MAAM,KACZ,sBAAsB,CAM3B;AAEH;;;;;;;;GAQG;AACH,yCALU,CACL,SAAS,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAC9B,CAAC,EAAE,kBAAkB,KAClB,wBAAwB,CAU7B;iCA5E6E,aAAa;4CAAb,aAAa;wCAExD,wDAAwD;8CAFb,aAAa"}
@@ -3,8 +3,9 @@ import { decodeBase64 } from '@endo/base64';
3
3
  import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
4
4
 
5
5
  /**
6
- * @import {DenomAmount} from '../types.js';
6
+ * @import {CosmosDelegationResponse, CosmosValidatorAddress, DenomAmount} from '../types.js';
7
7
  * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js'
8
+ * @import {DelegationResponse} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
8
9
  */
9
10
 
10
11
  /** maximum clock skew, in seconds, for unbonding time reported from other chain */
@@ -31,5 +32,51 @@ export const tryDecodeResponse = (ackStr, fromProtoMsg) => {
31
32
  * Transform a cosmos-sdk {@link Coin} object into a {@link DenomAmount}
32
33
  *
33
34
  * @type {(c: { denom: string; amount: string }) => DenomAmount}
35
+ * @see {@link toTruncatedDenomAmount} for DecCoin
34
36
  */
35
37
  export const toDenomAmount = c => ({ denom: c.denom, value: BigInt(c.amount) });
38
+
39
+ /**
40
+ * Transform a cosmos-sdk {@link DecCoin} object into a {@link DenomAmount}, by
41
+ * truncating the fractional portion.
42
+ *
43
+ * @type {(c: { denom: string; amount: string }) => DenomAmount}
44
+ */
45
+ export const toTruncatedDenomAmount = c => ({
46
+ denom: c.denom,
47
+ value: BigInt(c.amount.split('.')[0]),
48
+ });
49
+
50
+ /**
51
+ * Transform a cosmos-sdk `{validatorAddress}` object into an Orchestration
52
+ * {@link CosmosValidatorAddress}
53
+ *
54
+ * @type {(
55
+ * r: { validatorAddress: string },
56
+ * chainId: string,
57
+ * ) => CosmosValidatorAddress}
58
+ */
59
+ export const toCosmosValidatorAddress = (r, chainId) => ({
60
+ encoding: 'bech32',
61
+ value: /** @type {CosmosValidatorAddress['value']} */ (r.validatorAddress),
62
+ chainId,
63
+ });
64
+
65
+ /**
66
+ * Transform a cosmos-sdk {@link DelegationResponse} object into an Orchestration
67
+ * {@link CosmosDelegationResponse}
68
+ *
69
+ * @type {(
70
+ * chainInfo: { chainId: string },
71
+ * r: DelegationResponse,
72
+ * ) => CosmosDelegationResponse}
73
+ */
74
+ export const toCosmosDelegationResponse = ({ chainId }, r) => ({
75
+ delegator: {
76
+ chainId,
77
+ encoding: 'bech32',
78
+ value: r.delegation.delegatorAddress,
79
+ },
80
+ validator: toCosmosValidatorAddress(r.delegation, chainId),
81
+ amount: toDenomAmount(r.balance),
82
+ });
@@ -25,7 +25,7 @@ export const orchestrationAccountMethods = {
25
25
  sendAll: M.call(ChainAddressShape, M.arrayOf(AmountArgShape)).returns(
26
26
  VowShape,
27
27
  ),
28
- transfer: M.call(AmountArgShape, ChainAddressShape)
28
+ transfer: M.call(ChainAddressShape, AmountArgShape)
29
29
  .optional(IBCTransferOptionsShape)
30
30
  .returns(VowShape),
31
31
  transferSteps: M.call(AmountArgShape, M.any()).returns(VowShape),
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["registry.js"],"names":[],"mappings":"AAwFO,2CAFI,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,SAAS,CAAC;;;;;;;;;GA4CzD;yCAxHqC,wBAAwB;uCACT,kBAAkB"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["registry.js"],"names":[],"mappings":"AAqFO,2CAFI,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,SAAS,CAAC;;;;;;;;;GA4CzD;yCArHqC,wBAAwB;uCACT,kBAAkB"}
@@ -61,9 +61,6 @@ function toConnectionEntry(ibcInfo, name, chainInfo) {
61
61
  counterparty: {
62
62
  client_id: to.client_id,
63
63
  connection_id: /** @type {IBCConnectionID} */ (to.connection_id),
64
- prefix: {
65
- key_prefix: 'FIXME',
66
- },
67
64
  },
68
65
  state: IBCConnectionState.STATE_OPEN, // XXX presumably
69
66
  transferChannel: {
@@ -19,15 +19,7 @@ export function provideOrchestration(zcf: ZCF, baggage: Baggage, remotePowers: O
19
19
  getAsset(denom: import("../orchestration-api.js").Denom): DenomDetail | undefined;
20
20
  getDenom(brand: Brand): import("../orchestration-api.js").Denom | undefined;
21
21
  }>;
22
- vowTools: {
23
- when: <T, TResult1 = import("@agoric/vow").EUnwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").EUnwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
24
- watch: <T = any, TResult1 = T, TResult2 = never, C extends any[] = any[]>(specimenP: import("@agoric/vow").EVow<T>, watcher?: import("@agoric/vow").Watcher<T, TResult1, TResult2, C> | undefined, ...watcherArgs: C) => import("@agoric/vow").Vow<Exclude<TResult1, void> | Exclude<TResult2, void> extends never ? TResult1 : Exclude<TResult1, void> | Exclude<TResult2, void>>;
25
- makeVowKit: <T>() => import("@agoric/vow").VowKit<T>;
26
- allVows: (maybeVows: import("@agoric/vow").EVow<unknown>[]) => import("@agoric/vow").Vow<any[]>;
27
- asVow: <T extends unknown>(fn: (...args: any[]) => import("@agoric/vow").Vow<Awaited<T>> | Awaited<T> | import("@agoric/vow").PromiseVow<T>) => import("@agoric/vow").Vow<Awaited<T>>;
28
- asPromise: import("@agoric/vow").AsPromiseFunction;
29
- retriable: <F extends (...args: any[]) => Promise<any>>(fnZone: Zone, name: string, fn: F) => F extends (...args: infer Args) => Promise<infer R> ? (...args: Args) => import("@agoric/vow").Vow<R> : never;
30
- };
22
+ vowTools: import("@agoric/vow").VowTools;
31
23
  asyncFlowTools: {
32
24
  prepareAsyncFlowKit: (zone: Zone, tag: string, guestAsyncFunc: import("@agoric/async-flow").GuestAsyncFunc, options?: {
33
25
  startEager?: boolean;
@@ -61,8 +53,10 @@ export function provideOrchestration(zcf: ZCF, baggage: Baggage, remotePowers: O
61
53
  allWokenP: Promise<void>;
62
54
  prepareEndowment: (zone: Zone, tag: string, e: unknown) => any;
63
55
  };
56
+ zcfTools: import("@agoric/async-flow").HostInterface<import("../types.js").ZcfTools>;
64
57
  zoeTools: {
65
- localTransfer: (srcSeat: ZCFSeat, localAccount: import("../cosmos-api.js").LocalAccountMethods, give: AmountKeywordRecord) => import("@agoric/vow").Vow<void>;
58
+ localTransfer: (srcSeat: ZCFSeat, localAccount: import("../cosmos-api.js").LocalAccountMethods, amounts: AmountKeywordRecord) => import("@agoric/vow").Vow<void>;
59
+ withdrawToSeat: (localAccount: import("../cosmos-api.js").LocalAccountMethods, destSeat: ZCFSeat, amounts: AmountKeywordRecord) => import("@agoric/vow").Vow<void>;
66
60
  };
67
61
  zone: Zone;
68
62
  orchestrate: <HC, GF extends import("../orchestration-api.js").OrchestrationFlow<import("@agoric/async-flow").GuestInterface<HC>>>(durableName: string, hostCtx: HC, guestFn: GF) => HostForGuest<GF>;
@@ -1 +1 @@
1
- {"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA6CO,0CANI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+BAqGR,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;wCAnEH,GAAG;;+BAjDT,GAAG,+EAOa,GAAG,yCAAyC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuItE;AA8BM,kCAdgC,EAAE,SAA3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,EAGhC,EAAE,SAFM,mBAAmB,GAAG;IACnC,UAAc,EAAE,UAAU,CAAC;CACvB,EACQ,CAAC,cACH,CACV,GAAO,EAAE,GAAG,CAAC,EAAE,CAAC,EAChB,WAAe,EAAE,EAAE,EACnB,IAAQ,EAAE,IAAI,EACd,KAAS,EAAE,kBAAkB,KACtB,OAAO,CAAC,CAAC,CAAC,GACL,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAYzE;kCAxLU;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;iCA8IU,IAAI,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAAE,MAAM,CAAC;6BA5JzC,kBAAkB;0BAGrB,cAAc;gCALR,gCAAgC;4BAIpC,aAAa;6CAEI,2BAA2B;kCAL1B,cAAc;6BAE/B,cAAc"}
1
+ {"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA8CO,0CANI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+BAqGR,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BhB;AA8BM,kCAdgC,EAAE,SAA3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,EAGhC,EAAE,SAFM,mBAAmB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;CACvB,EACQ,CAAC,cACH,CACN,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EACZ,WAAW,EAAE,EAAE,EACf,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,kBAAkB,KACtB,OAAO,CAAC,CAAC,CAAC,GACL,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAYzE;kCA1LU;IACR,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,oBAAoB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACtD,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,YAAY,CAAC,CAAC;IACnC,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;iCAgJU,IAAI,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAAE,MAAM,CAAC;6BA9JzC,kBAAkB;0BAGrB,cAAc;gCALR,gCAAgC;4BAIpC,aAAa;6CAEI,2BAA2B;kCAL1B,cAAc;6BAE/B,cAAc"}
@@ -10,6 +10,7 @@ import { prepareOrchestrator } from '../exos/orchestrator.js';
10
10
  import { prepareRemoteChainFacade } from '../exos/remote-chain-facade.js';
11
11
  import { makeOrchestrationFacade } from '../facade.js';
12
12
  import { makeZoeTools } from './zoe-tools.js';
13
+ import { makeZcfTools } from './zcf-tools.js';
13
14
 
14
15
  /**
15
16
  * @import {LocalChain} from '@agoric/vats/src/localchain.js';
@@ -61,10 +62,10 @@ export const provideOrchestration = (
61
62
  asyncFlow: zone.subZone('asyncFlow'),
62
63
  /** system names for orchestration implementation */
63
64
  orchestration: zone.subZone('orchestration'),
65
+ /** system names for chainHub */
66
+ chainHub: zone.subZone('chainHub'),
64
67
  /** system names for vows */
65
68
  vows: zone.subZone('vows'),
66
- /** system names for zoe */
67
- zoe: zone.subZone('zoe'),
68
69
  /** contract-provided names, and subzones */
69
70
  contract: zone.subZone('contract'),
70
71
  };
@@ -74,14 +75,24 @@ export const provideOrchestration = (
74
75
 
75
76
  const vowTools = prepareVowTools(zones.vows);
76
77
 
77
- const chainHub = makeChainHub(agoricNames, vowTools);
78
+ const chainHub = makeChainHub(zones.chainHub, agoricNames, vowTools);
78
79
 
79
- const zoeTools = makeZoeTools(zones.zoe, { zcf, vowTools });
80
+ const zoeTools = makeZoeTools(zcf, vowTools);
81
+
82
+ const zcfTools = makeZcfTools(zcf, vowTools);
80
83
 
81
84
  const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller);
82
85
  const makeLocalOrchestrationAccountKit = prepareLocalOrchestrationAccountKit(
83
86
  zones.orchestration,
84
- { makeRecorderKit, zcf, timerService, vowTools, chainHub, localchain },
87
+ {
88
+ makeRecorderKit,
89
+ zcf,
90
+ timerService,
91
+ vowTools,
92
+ chainHub,
93
+ localchain,
94
+ zoeTools,
95
+ },
85
96
  );
86
97
 
87
98
  const asyncFlowTools = prepareAsyncFlowTools(zones.asyncFlow, {
@@ -118,21 +129,11 @@ export const provideOrchestration = (
118
129
  vowTools,
119
130
  });
120
131
 
121
- const chainByName = zones.orchestration.mapStore('chainName');
122
-
123
132
  const makeOrchestrator = prepareOrchestrator(zones.orchestration, {
124
- asyncFlowTools,
125
133
  chainHub,
126
- localchain: remotePowers.localchain,
127
- chainByName,
128
- makeRecorderKit,
129
134
  makeLocalChainFacade,
130
135
  makeRemoteChainFacade,
131
- storageNode: remotePowers.storageNode,
132
- orchestrationService: remotePowers.orchestrationService,
133
- timerService,
134
136
  vowTools,
135
- zcf,
136
137
  });
137
138
 
138
139
  /**
@@ -158,12 +159,14 @@ export const provideOrchestration = (
158
159
  const defaultOrchestrateKit = makeOrchestrateKit(
159
160
  zones.contract.subZone('orchestration'),
160
161
  );
162
+
161
163
  return {
162
164
  ...defaultOrchestrateKit,
163
165
  makeOrchestrateKit,
164
166
  chainHub,
165
167
  vowTools,
166
168
  asyncFlowTools,
169
+ zcfTools,
167
170
  zoeTools,
168
171
  zone: zones.contract,
169
172
  };
@@ -0,0 +1,5 @@
1
+ export function makeZcfTools(zcf: ZCF, vowTools: VowTools): HostInterface<ZcfTools>;
2
+ import type { VowTools } from '@agoric/vow';
3
+ import type { ZcfTools } from '../types.js';
4
+ import type { HostInterface } from '@agoric/async-flow';
5
+ //# sourceMappingURL=zcf-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zcf-tools.d.ts","sourceRoot":"","sources":["zcf-tools.js"],"names":[],"mappings":"AAeO,kCAJI,GAAG,YACH,QAAQ,GACN,cAAc,QAAQ,CAAC,CAqBhC;8BAhCuB,aAAa;8BACb,aAAa;mCAFR,oBAAoB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @import {HostInterface} from '@agoric/async-flow';
3
+ * @import {VowTools} from '@agoric/vow';
4
+ * @import {ZcfTools} from '../types.js';
5
+ */
6
+
7
+ import { M, mustMatch } from '@endo/patterns';
8
+
9
+ const HandlerShape = M.remotable('OfferHandler');
10
+
11
+ /**
12
+ * @param {ZCF} zcf
13
+ * @param {VowTools} vowTools
14
+ * @returns {HostInterface<ZcfTools>}
15
+ */
16
+ export const makeZcfTools = (zcf, vowTools) =>
17
+ harden({
18
+ makeInvitation(offerHandler, description, customDetails, proposalShape) {
19
+ mustMatch(offerHandler, HandlerShape);
20
+ return vowTools.watch(
21
+ zcf.makeInvitation(
22
+ offerHandler,
23
+ description,
24
+ customDetails,
25
+ proposalShape,
26
+ ),
27
+ );
28
+ },
29
+ atomicRearrange(transfers) {
30
+ zcf.atomicRearrange(transfers);
31
+ },
32
+ assertUniqueKeyword(keyword) {
33
+ zcf.assertUniqueKeyword(keyword);
34
+ },
35
+ });
@@ -1,19 +1,16 @@
1
- export function makeZoeTools(zone: Zone, { zcf, vowTools }: {
2
- zcf: ZCF;
3
- vowTools: VowTools;
4
- }): {
5
- localTransfer: (srcSeat: ZCFSeat, localAccount: LocalAccountMethods, give: AmountKeywordRecord) => Vow<void>;
1
+ export function makeZoeTools(zcf: ZCF, { when, allVows, allSettled, asVow }: VowTools): {
2
+ localTransfer: (srcSeat: ZCFSeat, localAccount: LocalAccountMethods, amounts: AmountKeywordRecord) => import("@agoric/vow").Vow<void>;
3
+ withdrawToSeat: (localAccount: LocalAccountMethods, destSeat: ZCFSeat, amounts: AmountKeywordRecord) => import("@agoric/vow").Vow<void>;
6
4
  };
7
5
  export type ResolvedContinuingOfferResult = {
8
6
  invitationMakers: InvitationMakers;
9
7
  publicSubscribers: Record<string, ResolvedPublicTopic<any>>;
10
8
  };
11
- export type LocalTransfer = (srcSeat: ZCFSeat, localAccount: LocalAccountMethods, give: AmountKeywordRecord) => Promise<void>;
9
+ export type LocalTransfer = (srcSeat: ZCFSeat, localAccount: LocalAccountMethods, amounts: AmountKeywordRecord) => Promise<void>;
10
+ export type WithdrawToSeat = (localAccount: LocalAccountMethods, destSeat: ZCFSeat, amounts: AmountKeywordRecord) => Promise<void>;
12
11
  export type ZoeTools = ReturnType<typeof makeZoeTools>;
13
- import type { Zone } from '@agoric/zone';
14
12
  import type { VowTools } from '@agoric/vow';
15
13
  import type { LocalAccountMethods } from '../types.js';
16
- import type { Vow } from '@agoric/vow';
17
14
  import type { InvitationMakers } from '@agoric/smart-wallet/src/types.js';
18
15
  import type { ResolvedPublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
19
16
  //# sourceMappingURL=zoe-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zoe-tools.d.ts","sourceRoot":"","sources":["zoe-tools.js"],"names":[],"mappings":"AAkCO,mCAHI,IAAI,qBACJ;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE;;EAiD1C;4CAnEY;IACZ,gBAAoB,EAAE,gBAAgB,CAAC;IACvC,iBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;CAC7D;4BAMS,CACZ,OAAW,EAAE,OAAO,EACpB,YAAgB,EAAE,mBAAmB,EACrC,IAAQ,EAAE,mBAAmB,KACtB,OAAO,CAAC,IAAI,CAAC;uBAuDP,UAAU,CAAC,OAAO,YAAY,CAAC;0BA1EtB,cAAc;8BADL,aAAa;yCAGP,aAAa;yBAHnB,aAAa;sCAFV,mCAAmC;yCAChC,2CAA2C"}
1
+ {"version":3,"file":"zoe-tools.d.ts","sourceRoot":"","sources":["zoe-tools.js"],"names":[],"mappings":"AA4DO,kCAHI,GAAG,wCACH,QAAQ;;;EA6HlB;4CAvJY;IACR,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;CAC7D;4BAMS,CACR,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,mBAAmB,EACjC,OAAO,EAAE,mBAAmB,KACzB,OAAO,CAAC,IAAI,CAAC;6BAIR,CACR,YAAY,EAAE,mBAAmB,EACjC,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,mBAAmB,KACzB,OAAO,CAAC,IAAI,CAAC;uBAoIP,UAAU,CAAC,OAAO,YAAY,CAAC;8BA9JlB,aAAa;yCACF,aAAa;sCAHhB,mCAAmC;yCAChC,2CAA2C"}