@agoric/orchestration 0.1.1-dev-b953651.0 → 0.1.1-dev-8343a0c.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -3
- package/package.json +16 -16
- package/src/cosmos-api.d.ts +1 -1
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +1 -1
- package/src/examples/swapExample.contract.d.ts +34 -2
- package/src/examples/swapExample.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.js +42 -17
- package/src/examples/unbondExample.contract.d.ts +19 -1
- package/src/examples/unbondExample.contract.d.ts.map +1 -1
- package/src/examples/unbondExample.contract.js +8 -8
- package/src/exos/chainAccountKit.d.ts.map +1 -1
- package/src/exos/chainAccountKit.js +0 -3
- package/src/exos/localchainAccountKit.d.ts +2 -2
- package/src/facade.d.ts +24 -5
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +143 -4
- package/src/orchestration-api.d.ts +1 -1
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +1 -1
- package/src/service.d.ts +14 -2
- package/src/service.d.ts.map +1 -1
- package/src/service.js +0 -3
- package/src/utils/orc.d.ts +1 -0
- package/src/utils/orc.d.ts.map +1 -1
- package/src/utils/orc.js +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/// <reference types="@agoric/internal/exported" />
|
|
2
2
|
/// <reference types="@agoric/vats/src/core/types-ambient" />
|
|
3
|
-
|
|
4
|
-
// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
|
|
5
|
-
import '@agoric/zoe/exported.js';
|
|
3
|
+
/// <reference types="@agoric/zoe/exported" />
|
|
6
4
|
|
|
7
5
|
export * from './src/types.js';
|
|
8
6
|
export * from './src/service.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-8343a0c.0+8343a0c",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agoric/assert": "0.6.1-dev-
|
|
35
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
36
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
37
|
-
"@agoric/internal": "0.3.3-dev-
|
|
38
|
-
"@agoric/network": "0.1.1-dev-
|
|
39
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
40
|
-
"@agoric/store": "0.9.3-dev-
|
|
41
|
-
"@agoric/time": "0.3.3-dev-
|
|
42
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
43
|
-
"@agoric/vats": "0.15.2-dev-
|
|
44
|
-
"@agoric/vow": "0.1.1-dev-
|
|
45
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
46
|
-
"@agoric/zone": "0.2.3-dev-
|
|
34
|
+
"@agoric/assert": "0.6.1-dev-8343a0c.0+8343a0c",
|
|
35
|
+
"@agoric/cosmic-proto": "0.4.1-dev-8343a0c.0+8343a0c",
|
|
36
|
+
"@agoric/ertp": "0.16.3-dev-8343a0c.0+8343a0c",
|
|
37
|
+
"@agoric/internal": "0.3.3-dev-8343a0c.0+8343a0c",
|
|
38
|
+
"@agoric/network": "0.1.1-dev-8343a0c.0+8343a0c",
|
|
39
|
+
"@agoric/notifier": "0.6.3-dev-8343a0c.0+8343a0c",
|
|
40
|
+
"@agoric/store": "0.9.3-dev-8343a0c.0+8343a0c",
|
|
41
|
+
"@agoric/time": "0.3.3-dev-8343a0c.0+8343a0c",
|
|
42
|
+
"@agoric/vat-data": "0.5.3-dev-8343a0c.0+8343a0c",
|
|
43
|
+
"@agoric/vats": "0.15.2-dev-8343a0c.0+8343a0c",
|
|
44
|
+
"@agoric/vow": "0.1.1-dev-8343a0c.0+8343a0c",
|
|
45
|
+
"@agoric/zoe": "0.26.3-dev-8343a0c.0+8343a0c",
|
|
46
|
+
"@agoric/zone": "0.2.3-dev-8343a0c.0+8343a0c",
|
|
47
47
|
"@endo/base64": "^1.0.5",
|
|
48
48
|
"@endo/far": "^1.1.2",
|
|
49
49
|
"@endo/marshal": "^1.5.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
85
|
"typeCoverage": {
|
|
86
|
-
"atLeast": 97.
|
|
86
|
+
"atLeast": 97.38
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "8343a0ca16603ce52aeb4818d4dbf2529b9a59f7"
|
|
89
89
|
}
|
package/src/cosmos-api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AnyJson } from '@agoric/cosmic-proto';
|
|
2
2
|
import type { Delegation, Redelegation, UnbondingDelegation } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
3
3
|
import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
4
|
-
import type { Brand, Payment, Purse } from '@agoric/ertp/
|
|
4
|
+
import type { Brand, Payment, Purse } from '@agoric/ertp/src/types.js';
|
|
5
5
|
import type { Port } from '@agoric/network';
|
|
6
6
|
import type { LocalIbcAddress, RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
7
7
|
import type { AmountArg, ChainAddress, DenomAmount } from './types.js';
|
package/src/cosmos-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-api.d.ts","sourceRoot":"","sources":["cosmos-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EACV,UA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AEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B,eAAe,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;IACzC,gDAAgD;IAChD,eAAe,EAAE,MAAM,eAAe,CAAC;IACvC,oDAAoD;IACpD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD,CAAC"}
|
package/src/cosmos-api.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
UnbondingDelegation,
|
|
6
6
|
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
7
7
|
import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
8
|
-
import type { Brand, Payment, Purse } from '@agoric/ertp/
|
|
8
|
+
import type { Brand, Payment, Purse } from '@agoric/ertp/src/types.js';
|
|
9
9
|
import type { Port } from '@agoric/network';
|
|
10
10
|
import type {
|
|
11
11
|
LocalIbcAddress,
|
|
@@ -1,4 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {Orchestrator, IcaAccount, CosmosValidatorAddress} from '../types.js'
|
|
3
|
+
* @import {TimerService} from '@agoric/time';
|
|
4
|
+
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
5
|
+
* @import {ERef} from '@endo/far'
|
|
6
|
+
* @import {OrchestrationService} from '../service.js';
|
|
7
|
+
* @import {Zone} from '@agoric/zone';
|
|
8
|
+
*/
|
|
9
|
+
/** @type {ContractMeta} */
|
|
10
|
+
export const meta: ContractMeta;
|
|
11
|
+
export function makeNatAmountShape(brand: Brand, min?: bigint | undefined): {
|
|
12
|
+
brand: globalThis.Brand;
|
|
13
|
+
value: import("@endo/patterns").Matcher;
|
|
14
|
+
};
|
|
1
15
|
export function start(zcf: ZCF, privateArgs: {
|
|
16
|
+
localchain: ERef<import("@endo/exo").Guarded<{
|
|
17
|
+
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
18
|
+
getAddress(): Promise<string>;
|
|
19
|
+
deposit(payment: Payment): Promise<import("@agoric/ertp/src/types.js").NatAmount | import("@agoric/ertp/src/types.js").CopySetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").SetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").CopyBagAmount<import("@endo/patterns").Key>>;
|
|
20
|
+
executeTx<MT extends {
|
|
21
|
+
'@type': string;
|
|
22
|
+
}[]>(messages: MT): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto").ResponseTo<MT[K]>; }>;
|
|
23
|
+
}>>;
|
|
24
|
+
query(request: import("@agoric/cosmic-proto").TypedJson): Promise<{
|
|
25
|
+
'@type': string;
|
|
26
|
+
}>;
|
|
27
|
+
queryMany(requests: import("@agoric/cosmic-proto").TypedJson[]): Promise<{
|
|
28
|
+
error?: string | undefined;
|
|
29
|
+
reply: {
|
|
30
|
+
'@type': string;
|
|
31
|
+
};
|
|
32
|
+
}[]>;
|
|
33
|
+
}>>;
|
|
2
34
|
orchestrationService: ERef<import("@endo/exo").Guarded<{
|
|
3
35
|
makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<IcaAccount>;
|
|
4
36
|
provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
|
|
@@ -16,15 +48,15 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
16
48
|
staked: Amount<"nat">;
|
|
17
49
|
validator: CosmosValidatorAddress;
|
|
18
50
|
}>>;
|
|
19
|
-
} & import("@endo/
|
|
51
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
20
52
|
makeSwapAndStakeInvitation: () => Promise<Invitation<unknown, {
|
|
21
53
|
staked: Amount<"nat">;
|
|
22
54
|
validator: CosmosValidatorAddress;
|
|
23
55
|
}>>;
|
|
24
56
|
}>;
|
|
25
57
|
}>;
|
|
26
|
-
import type { IcaAccount } from '../types.js';
|
|
27
58
|
import type { ERef } from '@endo/far';
|
|
59
|
+
import type { IcaAccount } from '../types.js';
|
|
28
60
|
import type { TimerService } from '@agoric/time';
|
|
29
61
|
import type { Zone } from '@agoric/zone';
|
|
30
62
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAUrB;AASK,0CAHI,KAAK;;;EAIsC;AAY/C,2BATI,GAAG;;;;6BAUH,OAAO;;;2BAmB4D,EAAE;;uBAyD8a,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;oBA7D7sC,MAAM,CAAC,KAAK,CAAC;;;;;oBAAb,MAAM,CAAC,KAAK,CAAC;;;;GA4DxD;0BAjHsB,WAAW;gCAHiC,aAAa;kCACjD,cAAc;0BAItB,cAAc;4CAL8B,aAAa"}
|
|
@@ -1,21 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { StorageNodeShape } from '@agoric/internal';
|
|
2
|
+
import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js';
|
|
3
|
+
import { Far } from '@endo/far';
|
|
4
|
+
import { deeplyFulfilled } from '@endo/marshal';
|
|
5
|
+
import { M, objectMap } from '@endo/patterns';
|
|
5
6
|
import { makeOrchestrationFacade } from '../facade.js';
|
|
6
7
|
import { orcUtils } from '../utils/orc.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @import {Orchestrator, IcaAccount, CosmosValidatorAddress} from '../types.js'
|
|
10
11
|
* @import {TimerService} from '@agoric/time';
|
|
12
|
+
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
11
13
|
* @import {ERef} from '@endo/far'
|
|
12
14
|
* @import {OrchestrationService} from '../service.js';
|
|
13
15
|
* @import {Zone} from '@agoric/zone';
|
|
14
16
|
*/
|
|
15
17
|
|
|
18
|
+
/** @type {ContractMeta} */
|
|
19
|
+
export const meta = {
|
|
20
|
+
privateArgsShape: {
|
|
21
|
+
localchain: M.any(),
|
|
22
|
+
orchestrationService: M.any(),
|
|
23
|
+
storageNode: StorageNodeShape,
|
|
24
|
+
timerService: M.any(),
|
|
25
|
+
zone: M.any(),
|
|
26
|
+
},
|
|
27
|
+
upgradability: 'canUpgrade',
|
|
28
|
+
};
|
|
29
|
+
harden(meta);
|
|
30
|
+
|
|
31
|
+
// XXX copied from inter-protocol
|
|
32
|
+
// TODO move to new `@agoric/contracts` package when we have it
|
|
33
|
+
/**
|
|
34
|
+
* @param {Brand} brand must be a 'nat' brand, not checked
|
|
35
|
+
* @param {NatValue} [min]
|
|
36
|
+
*/
|
|
37
|
+
export const makeNatAmountShape = (brand, min) =>
|
|
38
|
+
harden({ brand, value: min ? M.gte(min) : M.nat() });
|
|
39
|
+
|
|
16
40
|
/**
|
|
17
41
|
* @param {ZCF} zcf
|
|
18
42
|
* @param {{
|
|
43
|
+
* localchain: ERef<LocalChain>;
|
|
19
44
|
* orchestrationService: ERef<OrchestrationService>;
|
|
20
45
|
* storageNode: ERef<StorageNode>;
|
|
21
46
|
* timerService: ERef<TimerService>;
|
|
@@ -23,12 +48,16 @@ import { orcUtils } from '../utils/orc.js';
|
|
|
23
48
|
* }} privateArgs
|
|
24
49
|
*/
|
|
25
50
|
export const start = async (zcf, privateArgs) => {
|
|
26
|
-
const {
|
|
51
|
+
const { brands } = zcf.getTerms();
|
|
52
|
+
|
|
53
|
+
const { localchain, orchestrationService, storageNode, timerService, zone } =
|
|
54
|
+
privateArgs;
|
|
27
55
|
|
|
28
56
|
const { orchestrate } = makeOrchestrationFacade({
|
|
29
57
|
zone,
|
|
30
58
|
timerService,
|
|
31
59
|
zcf,
|
|
60
|
+
localchain,
|
|
32
61
|
storageNode,
|
|
33
62
|
orchestrationService,
|
|
34
63
|
});
|
|
@@ -41,7 +70,6 @@ export const start = async (zcf, privateArgs) => {
|
|
|
41
70
|
// eslint-disable-next-line no-shadow -- this `zcf` is enclosed in a membrane
|
|
42
71
|
async (/** @type {Orchestrator} */ orch, { zcf }, seat, offerArgs) => {
|
|
43
72
|
const { give } = seat.getProposal();
|
|
44
|
-
!AmountMath.isEmpty(give.USDC.value) || Fail`Must provide USDC.`;
|
|
45
73
|
|
|
46
74
|
const celestia = await orch.getChain('celestia');
|
|
47
75
|
const agoric = await orch.getChain('agoric');
|
|
@@ -51,33 +79,30 @@ export const start = async (zcf, privateArgs) => {
|
|
|
51
79
|
agoric.makeAccount(),
|
|
52
80
|
]);
|
|
53
81
|
|
|
54
|
-
const tiaAddress =
|
|
82
|
+
const tiaAddress = celestiaAccount.getAddress();
|
|
55
83
|
|
|
56
84
|
// deposit funds from user seat to LocalChainAccount
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
// seat.exit() // exit user seat now, or later?
|
|
60
|
-
const payment = await E(seatKit.userSeat).getPayout('USDC');
|
|
61
|
-
await localAccount.deposit(payment);
|
|
85
|
+
const payments = await withdrawFromSeat(zcf, seat, give);
|
|
86
|
+
await deeplyFulfilled(objectMap(payments, localAccount.deposit));
|
|
62
87
|
|
|
63
88
|
// build swap instructions with orcUtils library
|
|
64
89
|
const transferMsg = orcUtils.makeOsmosisSwap({
|
|
65
90
|
destChain: 'celestia',
|
|
66
91
|
destAddress: tiaAddress,
|
|
67
|
-
amountIn: give.
|
|
68
|
-
brandOut:
|
|
92
|
+
amountIn: give.Stable,
|
|
93
|
+
brandOut: /** @type {any} */ ('FIXME'),
|
|
69
94
|
slippage: 0.03,
|
|
70
95
|
});
|
|
71
96
|
|
|
72
97
|
await localAccount
|
|
73
|
-
.transferSteps(give.
|
|
98
|
+
.transferSteps(give.Stable, transferMsg)
|
|
74
99
|
.then(_txResult =>
|
|
75
100
|
celestiaAccount.delegate(offerArgs.validator, offerArgs.staked),
|
|
76
101
|
)
|
|
77
102
|
.catch(e => console.error(e));
|
|
78
103
|
|
|
79
104
|
// XXX close localAccount?
|
|
80
|
-
|
|
105
|
+
// return continuing inv since this is an offer?
|
|
81
106
|
},
|
|
82
107
|
);
|
|
83
108
|
|
|
@@ -87,7 +112,7 @@ export const start = async (zcf, privateArgs) => {
|
|
|
87
112
|
'Swap for TIA and stake',
|
|
88
113
|
undefined,
|
|
89
114
|
harden({
|
|
90
|
-
give: {
|
|
115
|
+
give: { Stable: makeNatAmountShape(brands.Stable, 1n) },
|
|
91
116
|
want: {}, // XXX ChainAccount Ownable?
|
|
92
117
|
exit: M.any(),
|
|
93
118
|
}),
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
export function start(zcf: ZCF, privateArgs: {
|
|
2
|
+
localchain: ERef<import("@endo/exo").Guarded<{
|
|
3
|
+
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
4
|
+
getAddress(): Promise<string>;
|
|
5
|
+
deposit(payment: Payment): Promise<import("@agoric/ertp/src/types.js").NatAmount | import("@agoric/ertp/src/types.js").CopySetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").SetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").CopyBagAmount<import("@endo/patterns").Key>>;
|
|
6
|
+
executeTx<MT extends {
|
|
7
|
+
'@type': string;
|
|
8
|
+
}[]>(messages: MT): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto").ResponseTo<MT[K]>; }>;
|
|
9
|
+
}>>;
|
|
10
|
+
query(request: import("@agoric/cosmic-proto").TypedJson): Promise<{
|
|
11
|
+
'@type': string;
|
|
12
|
+
}>;
|
|
13
|
+
queryMany(requests: import("@agoric/cosmic-proto").TypedJson[]): Promise<{
|
|
14
|
+
error?: string | undefined;
|
|
15
|
+
reply: {
|
|
16
|
+
'@type': string;
|
|
17
|
+
};
|
|
18
|
+
}[]>;
|
|
19
|
+
}>>;
|
|
2
20
|
orchestrationService: ERef<import("@endo/exo").Guarded<{
|
|
3
21
|
makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<IcaAccount>;
|
|
4
22
|
provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
|
|
@@ -17,8 +35,8 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
17
35
|
makeUnbondAndLiquidStakeInvitation: () => Promise<Invitation<unknown, never>>;
|
|
18
36
|
}>;
|
|
19
37
|
}>;
|
|
20
|
-
import type { IcaAccount } from '../types.js';
|
|
21
38
|
import type { ERef } from '@endo/far';
|
|
39
|
+
import type { IcaAccount } from '../types.js';
|
|
22
40
|
import type { TimerService } from '@agoric/time';
|
|
23
41
|
import type { Zone } from '@agoric/zone';
|
|
24
42
|
//# sourceMappingURL=unbondExample.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AAuBO,
|
|
1
|
+
{"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AAuBO,2BATI,GAAG;;;;6BAgCyB,OAAO;;;2BAYV,EAAE;;uBA0B4+C,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;GAD5wE;0BA3EsB,WAAW;gCAHiC,aAAa;kCACjD,cAAc;0BAItB,cAAc"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Fail } from '@agoric/assert';
|
|
2
|
-
import { AmountMath, AmountShape } from '@agoric/ertp';
|
|
3
1
|
import { Far } from '@endo/far';
|
|
4
2
|
import { M } from '@endo/patterns';
|
|
5
3
|
import { makeOrchestrationFacade } from '../facade.js';
|
|
@@ -7,6 +5,7 @@ import { makeOrchestrationFacade } from '../facade.js';
|
|
|
7
5
|
/**
|
|
8
6
|
* @import {Orchestrator, IcaAccount, CosmosValidatorAddress} from '../types.js'
|
|
9
7
|
* @import {TimerService} from '@agoric/time';
|
|
8
|
+
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
10
9
|
* @import {ERef} from '@endo/far'
|
|
11
10
|
* @import {OrchestrationService} from '../service.js';
|
|
12
11
|
* @import {Zone} from '@agoric/zone';
|
|
@@ -15,6 +14,7 @@ import { makeOrchestrationFacade } from '../facade.js';
|
|
|
15
14
|
/**
|
|
16
15
|
* @param {ZCF} zcf
|
|
17
16
|
* @param {{
|
|
17
|
+
* localchain: ERef<LocalChain>;
|
|
18
18
|
* orchestrationService: ERef<OrchestrationService>;
|
|
19
19
|
* storageNode: ERef<StorageNode>;
|
|
20
20
|
* timerService: ERef<TimerService>;
|
|
@@ -22,9 +22,11 @@ import { makeOrchestrationFacade } from '../facade.js';
|
|
|
22
22
|
* }} privateArgs
|
|
23
23
|
*/
|
|
24
24
|
export const start = async (zcf, privateArgs) => {
|
|
25
|
-
const { orchestrationService, storageNode, timerService, zone } =
|
|
25
|
+
const { localchain, orchestrationService, storageNode, timerService, zone } =
|
|
26
|
+
privateArgs;
|
|
26
27
|
|
|
27
28
|
const { orchestrate } = makeOrchestrationFacade({
|
|
29
|
+
localchain,
|
|
28
30
|
zone,
|
|
29
31
|
timerService,
|
|
30
32
|
zcf,
|
|
@@ -37,11 +39,8 @@ export const start = async (zcf, privateArgs) => {
|
|
|
37
39
|
'LSTTia',
|
|
38
40
|
{ zcf },
|
|
39
41
|
// eslint-disable-next-line no-shadow -- this `zcf` is enclosed in a membrane
|
|
40
|
-
async (/** @type {Orchestrator} */ orch, { zcf },
|
|
42
|
+
async (/** @type {Orchestrator} */ orch, { zcf }, _seat, _offerArgs) => {
|
|
41
43
|
console.log('zcf within the membrane', zcf);
|
|
42
|
-
const { give } = seat.getProposal();
|
|
43
|
-
!AmountMath.isEmpty(give.USDC.value) || Fail`Must provide USDC.`;
|
|
44
|
-
|
|
45
44
|
// We would actually alreaady have the account from the orchestrator
|
|
46
45
|
// ??? could these be passed in? It would reduce the size of this handler,
|
|
47
46
|
// keeping it focused on long-running operations.
|
|
@@ -70,7 +69,8 @@ export const start = async (zcf, privateArgs) => {
|
|
|
70
69
|
'Unbond and liquid stake',
|
|
71
70
|
undefined,
|
|
72
71
|
harden({
|
|
73
|
-
give
|
|
72
|
+
// Nothing to give; the funds come from undelegating
|
|
73
|
+
give: {},
|
|
74
74
|
want: {}, // XXX ChainAccount Ownable?
|
|
75
75
|
exit: M.any(),
|
|
76
76
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainAccountKit.d.ts","sourceRoot":"","sources":["chainAccountKit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chainAccountKit.d.ts","sourceRoot":"","sources":["chainAccountKit.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;GAaG;AAcI;;QAqBC;;WAEG;;;;;;QAyBH;;;;;;WAMG;wFAFU,OAAO,CAAC,MAAM,CAAC;QAY5B;;WAEG;;;QAaH;;;WAGG;wBADQ,KAAK;;;;QAahB;;;;WAIG;;;;;GAyBR;qCAzJW,0BAA0B;;;;;4BAuBX,MAAM;;;;8BAoIrB,UAAU,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;0BAvK1C,mBAAmB;0BACP,iBAAiB;kCAKrB,aAAa;6BAHlB,sBAAsB;4BACvB,8CAA8C;gCAHpC,iBAAiB;4BAC3B,aAAa"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/** @file ChainAccount exo */
|
|
2
2
|
|
|
3
|
-
// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
|
|
4
|
-
import '@agoric/network/exported.js';
|
|
5
|
-
|
|
6
3
|
import { NonNullish } from '@agoric/assert';
|
|
7
4
|
import { makeTracer } from '@agoric/internal';
|
|
8
5
|
import { V as E } from '@agoric/vow/vat.js';
|
|
@@ -5,7 +5,7 @@ export function prepareLocalchainAccountKit(baggage: import("@agoric/swingset-li
|
|
|
5
5
|
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit
|
|
6
6
|
* @param {ZCF} zcf
|
|
7
7
|
*/
|
|
8
|
-
deposit(payment: Payment): Promise<import("@agoric/ertp/
|
|
8
|
+
deposit(payment: Payment): Promise<import("@agoric/ertp/src/types.js").NatAmount | import("@agoric/ertp/src/types.js").CopySetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").SetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").CopyBagAmount<import("@endo/patterns").Key>>;
|
|
9
9
|
executeTx<MT extends {
|
|
10
10
|
'@type': string;
|
|
11
11
|
}[]>(messages: MT): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto/vatsafe").ResponseTo<MT[K]>; }>;
|
|
@@ -19,7 +19,7 @@ export function prepareLocalchainAccountKit(baggage: import("@agoric/swingset-li
|
|
|
19
19
|
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit
|
|
20
20
|
* @param {ZCF} zcf
|
|
21
21
|
*/
|
|
22
|
-
deposit(payment: Payment): Promise<import("@agoric/ertp/
|
|
22
|
+
deposit(payment: Payment): Promise<import("@agoric/ertp/src/types.js").NatAmount | import("@agoric/ertp/src/types.js").CopySetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").SetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").CopyBagAmount<import("@endo/patterns").Key>>;
|
|
23
23
|
executeTx<MT extends {
|
|
24
24
|
'@type': string;
|
|
25
25
|
}[]>(messages: MT): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto/vatsafe").ResponseTo<MT[K]>; }>;
|
package/src/facade.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode, orchestrationService, }: {
|
|
1
|
+
export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode, orchestrationService, localchain, }: {
|
|
2
2
|
zone: Zone;
|
|
3
|
-
timerService:
|
|
4
|
-
zcf:
|
|
5
|
-
storageNode: ERef<StorageNode>;
|
|
6
|
-
orchestrationService:
|
|
3
|
+
timerService: ERef<TimerService>;
|
|
4
|
+
zcf: ZCF;
|
|
5
|
+
storageNode: ERef<globalThis.StorageNode>;
|
|
6
|
+
orchestrationService: ERef<import("@endo/exo").Guarded<{
|
|
7
7
|
makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("./cosmos-api.js").IcaAccount>;
|
|
8
8
|
provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
|
|
9
9
|
getLocalAddress(): `/ibc-port/${string}`;
|
|
@@ -11,6 +11,24 @@ export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode,
|
|
|
11
11
|
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").Base64Any<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>;
|
|
12
12
|
}>>;
|
|
13
13
|
}>>;
|
|
14
|
+
localchain: ERef<import("@endo/exo").Guarded<{
|
|
15
|
+
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
16
|
+
getAddress(): Promise<string>;
|
|
17
|
+
deposit(payment: Payment): Promise<import("@agoric/ertp/src/types.js").NatAmount | import("@agoric/ertp/src/types.js").CopySetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").SetAmount<import("@endo/patterns").Key> | import("@agoric/ertp/src/types.js").CopyBagAmount<import("@endo/patterns").Key>>;
|
|
18
|
+
executeTx<MT extends {
|
|
19
|
+
'@type': string;
|
|
20
|
+
}[]>(messages: MT): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto").ResponseTo<MT[K]>; }>;
|
|
21
|
+
}>>;
|
|
22
|
+
query(request: import("@agoric/cosmic-proto").TypedJson): Promise<{
|
|
23
|
+
'@type': string;
|
|
24
|
+
}>;
|
|
25
|
+
queryMany(requests: import("@agoric/cosmic-proto").TypedJson[]): Promise<{
|
|
26
|
+
error?: string | undefined;
|
|
27
|
+
reply: {
|
|
28
|
+
'@type': string;
|
|
29
|
+
};
|
|
30
|
+
}[]>;
|
|
31
|
+
}>>;
|
|
14
32
|
}): {
|
|
15
33
|
/**
|
|
16
34
|
* @template Context
|
|
@@ -25,5 +43,6 @@ export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode,
|
|
|
25
43
|
export type OrchestrationFacade = ReturnType<typeof makeOrchestrationFacade>;
|
|
26
44
|
import type { Zone } from '@agoric/zone';
|
|
27
45
|
import type { TimerService } from '@agoric/time';
|
|
46
|
+
import type { ERef } from '@endo/far';
|
|
28
47
|
import type { Orchestrator } from './types.js';
|
|
29
48
|
//# sourceMappingURL=facade.d.ts.map
|
package/src/facade.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["facade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["facade.js"],"names":[],"mappings":"AAgJO;;;SANG,GAAG;;;;;;;;;;;;;6BA7EK,OAChB;;;2BAkBM,EAAN;;uBAoF6B,OAC1B,sBAAoB,EACpB,SAAG;;;4BAuBK,OAAM,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;IA5BlD;;;;;;;OAOG;gBAFkC,OAAO,EACrB,IAAI,6BAHhB,MAAM,OAEoB,OAAO,AAD1B,gCACmB,OAAO,WACrB,IAAI,AADgC,KAAK,MAAM,GACzD,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC;EAoBnD;kCAEa,UAAU,CAAC,OAAO,uBAAuB,CAAC;0BAxLjC,cAAc;kCACN,cAAc;0BAEtB,WAAW;kCAEqC,YAAY"}
|
package/src/facade.js
CHANGED
|
@@ -1,20 +1,145 @@
|
|
|
1
1
|
/** @file Orchestration service */
|
|
2
2
|
|
|
3
|
+
import { E } from '@endo/far';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* @import {Zone} from '@agoric/zone';
|
|
5
7
|
* @import {TimerService} from '@agoric/time';
|
|
8
|
+
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
9
|
+
* @import {ERef} from '@endo/far';
|
|
6
10
|
* @import {OrchestrationService} from './service.js';
|
|
7
|
-
* @import {Orchestrator} from './types.js';
|
|
11
|
+
* @import {Chain, ChainInfo, OrchestrationAccount, Orchestrator} from './types.js';
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** @type {any} */
|
|
15
|
+
const anyVal = null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {ERef<LocalChain>} localchain
|
|
19
|
+
* @returns {Chain}
|
|
8
20
|
*/
|
|
21
|
+
const makeLocalChainFacade = localchain => {
|
|
22
|
+
return {
|
|
23
|
+
/** @returns {Promise<ChainInfo>} */
|
|
24
|
+
async getChainInfo() {
|
|
25
|
+
return {
|
|
26
|
+
allegedName: 'agoric',
|
|
27
|
+
allowedMessages: [],
|
|
28
|
+
allowedQueries: [],
|
|
29
|
+
chainId: 'agoric-3',
|
|
30
|
+
ibcConnectionInfo: anyVal,
|
|
31
|
+
ibcHooksEnabled: true,
|
|
32
|
+
icaEnabled: true,
|
|
33
|
+
icqEnabled: true,
|
|
34
|
+
pfmEnabled: true,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
async makeAccount() {
|
|
38
|
+
const account = await E(localchain).makeAccount();
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
deposit(payment) {
|
|
42
|
+
console.log('deposit got', payment);
|
|
43
|
+
// XXX yet again tripped up on remote methods looking local statically
|
|
44
|
+
return E(account).deposit(payment);
|
|
45
|
+
},
|
|
46
|
+
transferSteps(amount, msg) {
|
|
47
|
+
console.log('transferSteps got', amount, msg);
|
|
48
|
+
return Promise.resolve();
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @template {string} C
|
|
57
|
+
* @param {C} name
|
|
58
|
+
* @returns {Chain}
|
|
59
|
+
*/
|
|
60
|
+
const makeRemoteChainFacade = name => {
|
|
61
|
+
const chainInfo = {
|
|
62
|
+
allegedName: name,
|
|
63
|
+
chainId: 'fixme',
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
/** @returns {Promise<ChainInfo>} */
|
|
67
|
+
getChainInfo: async () => anyVal,
|
|
68
|
+
/** @returns {Promise<OrchestrationAccount<C>>} */
|
|
69
|
+
makeAccount: async () => {
|
|
70
|
+
console.log('makeAccount for', name);
|
|
71
|
+
// @ts-expect-error fake yet
|
|
72
|
+
return {
|
|
73
|
+
delegate(validator, amount) {
|
|
74
|
+
console.log('delegate got', validator, amount);
|
|
75
|
+
return Promise.resolve();
|
|
76
|
+
},
|
|
77
|
+
deposit(payment) {
|
|
78
|
+
console.log('deposit got', payment);
|
|
79
|
+
return Promise.resolve();
|
|
80
|
+
},
|
|
81
|
+
getAddress() {
|
|
82
|
+
return {
|
|
83
|
+
chainId: chainInfo.chainId,
|
|
84
|
+
address: 'an address!',
|
|
85
|
+
addressEncoding: 'bech32',
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
getBalance(_denom) {
|
|
89
|
+
console.error('getBalance not yet implemented');
|
|
90
|
+
return Promise.resolve({ denom: 'fixme', value: 0n });
|
|
91
|
+
},
|
|
92
|
+
getBalances() {
|
|
93
|
+
throw new Error('not yet implemented');
|
|
94
|
+
},
|
|
95
|
+
getDelegations() {
|
|
96
|
+
console.error('getDelegations not yet implemented');
|
|
97
|
+
return [];
|
|
98
|
+
},
|
|
99
|
+
getRedelegations() {
|
|
100
|
+
throw new Error('not yet implemented');
|
|
101
|
+
},
|
|
102
|
+
getUnbondingDelegations() {
|
|
103
|
+
throw new Error('not yet implemented');
|
|
104
|
+
},
|
|
105
|
+
liquidStake() {
|
|
106
|
+
console.error('liquidStake not yet implemented');
|
|
107
|
+
return 0n;
|
|
108
|
+
},
|
|
109
|
+
send(toAccount, amount) {
|
|
110
|
+
console.log('send got', toAccount, amount);
|
|
111
|
+
return Promise.resolve();
|
|
112
|
+
},
|
|
113
|
+
transfer(amount, destination, memo) {
|
|
114
|
+
console.log('transfer got', amount, destination, memo);
|
|
115
|
+
return Promise.resolve();
|
|
116
|
+
},
|
|
117
|
+
transferSteps(amount, msg) {
|
|
118
|
+
console.log('transferSteps got', amount, msg);
|
|
119
|
+
return Promise.resolve();
|
|
120
|
+
},
|
|
121
|
+
undelegate(validator, amount) {
|
|
122
|
+
console.log('undelegate got', validator, amount);
|
|
123
|
+
return Promise.resolve();
|
|
124
|
+
},
|
|
125
|
+
withdraw(amount) {
|
|
126
|
+
console.log('withdraw got', amount);
|
|
127
|
+
return Promise.resolve();
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
};
|
|
9
133
|
|
|
10
134
|
/**
|
|
11
135
|
*
|
|
12
136
|
* @param {{
|
|
13
137
|
* zone: Zone;
|
|
14
138
|
* timerService: ERef<TimerService>;
|
|
15
|
-
* zcf:
|
|
139
|
+
* zcf: ZCF;
|
|
16
140
|
* storageNode: ERef<StorageNode>;
|
|
17
141
|
* orchestrationService: ERef<OrchestrationService>;
|
|
142
|
+
* localchain: ERef<LocalChain>;
|
|
18
143
|
* }} powers
|
|
19
144
|
*/
|
|
20
145
|
export const makeOrchestrationFacade = ({
|
|
@@ -23,6 +148,7 @@ export const makeOrchestrationFacade = ({
|
|
|
23
148
|
zcf,
|
|
24
149
|
storageNode,
|
|
25
150
|
orchestrationService,
|
|
151
|
+
localchain,
|
|
26
152
|
}) => {
|
|
27
153
|
console.log('makeOrchestrationFacade got', {
|
|
28
154
|
zone,
|
|
@@ -42,8 +168,21 @@ export const makeOrchestrationFacade = ({
|
|
|
42
168
|
* @returns {(...args: Args) => Promise<unknown>}
|
|
43
169
|
*/
|
|
44
170
|
orchestrate(durableName, ctx, fn) {
|
|
45
|
-
|
|
46
|
-
|
|
171
|
+
/** @type {Orchestrator} */
|
|
172
|
+
const orc = {
|
|
173
|
+
async getChain(name) {
|
|
174
|
+
if (name === 'agoric') {
|
|
175
|
+
return makeLocalChainFacade(localchain);
|
|
176
|
+
}
|
|
177
|
+
return makeRemoteChainFacade(name);
|
|
178
|
+
},
|
|
179
|
+
makeLocalAccount() {
|
|
180
|
+
return E(localchain).makeAccount();
|
|
181
|
+
},
|
|
182
|
+
getBrandInfo: anyVal,
|
|
183
|
+
asAmount: anyVal,
|
|
184
|
+
};
|
|
185
|
+
return async (...args) => fn(orc, ctx, ...args);
|
|
47
186
|
},
|
|
48
187
|
};
|
|
49
188
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* - must not have chain-specific types without runtime narrowing by chain id
|
|
4
4
|
* - should remain relatively stable.
|
|
5
5
|
*/
|
|
6
|
-
import type { Amount, Brand, NatAmount, Payment } from '@agoric/ertp/
|
|
6
|
+
import type { Amount, Brand, NatAmount, Payment } from '@agoric/ertp/src/types.js';
|
|
7
7
|
import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
|
|
8
8
|
import type { Timestamp } from '@agoric/time';
|
|
9
9
|
import type { KnownChains } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EACL,SAAS,EACT,OAAO,EACR,MAAM,
|
|
1
|
+
{"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EACL,SAAS,EACT,OAAO,EACR,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAI3B;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;AAE7C,6DAA6D;AAC7D,MAAM,MAAM,YAAY,GAAG;IACzB,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAEhB,eAAe,EAAE,QAAQ,GAAG,UAAU,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,MAAM,WAAW,IAC1D,qBAAqB,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,SAAS,MAAM,WAAW;IAChD,YAAY,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CA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E,SAAS,EACjB,WAAW,EAAE,YAAY,EACzB,IAAI,CAAC,EAAE,MAAM,KACV,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnB;;;;;;OAMG;IACH,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE;;;OAGG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,YAAY,CAAA;CAAE,CAAC;AAC3E,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/src/orchestration-api.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
Brand,
|
|
10
10
|
NatAmount,
|
|
11
11
|
Payment,
|
|
12
|
-
} from '@agoric/ertp/
|
|
12
|
+
} from '@agoric/ertp/src/types.js';
|
|
13
13
|
import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
|
|
14
14
|
import type { Timestamp } from '@agoric/time';
|
|
15
15
|
import type { KnownChains } from './types.js';
|
package/src/service.d.ts
CHANGED
|
@@ -24,7 +24,13 @@ export function prepareOrchestrationTools(zone: Zone): {
|
|
|
24
24
|
provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
|
|
25
25
|
getLocalAddress(): `/ibc-port/${string}`;
|
|
26
26
|
getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
|
|
27
|
-
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").Base64Any<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>;
|
|
27
|
+
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").Base64Any<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>; /**
|
|
28
|
+
* @param {IBCConnectionID} hostConnectionId
|
|
29
|
+
* the counterparty connection_id
|
|
30
|
+
* @param {IBCConnectionID} controllerConnectionId
|
|
31
|
+
* self connection_id
|
|
32
|
+
* @returns {Promise<IcaAccount>}
|
|
33
|
+
*/
|
|
28
34
|
}>>;
|
|
29
35
|
};
|
|
30
36
|
}>;
|
|
@@ -47,7 +53,13 @@ export type ICQConnectionStore = import("@endo/pass-style").RemotableObject & im
|
|
|
47
53
|
connection: {
|
|
48
54
|
getLocalAddress(): `/ibc-port/${string}`;
|
|
49
55
|
getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
|
|
50
|
-
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").Base64Any<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>;
|
|
56
|
+
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").Base64Any<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>; /**
|
|
57
|
+
* @param {IBCConnectionID} hostConnectionId
|
|
58
|
+
* the counterparty connection_id
|
|
59
|
+
* @param {IBCConnectionID} controllerConnectionId
|
|
60
|
+
* self connection_id
|
|
61
|
+
* @returns {Promise<IcaAccount>}
|
|
62
|
+
*/
|
|
51
63
|
};
|
|
52
64
|
connectionHandler: {
|
|
53
65
|
onOpen(connection: import("@agoric/vow").Remote<import("@agoric/network").Connection>, localAddr: `/ibc-port/${string}`, remoteAddr: `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`): Promise<void>;
|
package/src/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["service.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["service.js"],"names":[],"mappings":"AAmDA;;;GAOG;AA4GI;;;;;;;YAzDC;;;;;;eAMG;;YAkBH;;;eAGG;;;;0QA3BH;;;;;;mBAMG;;;;EA6DV;;;;;;;;;;;;;;yBAjJY,QAAQ,CACpB,MAAU,mBAAmB,EAC7B,mBAAuB,CAAC,MAAM,mBAAmB,CAAC,CAC/C;;;;;kQA2EI;;;;;;WAMG;;;;;;;;iCAvDG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,cAAc,EAAE,kBAAkB,CAAA;CAAE;iCAuH1D,UAAU,CAAC,OAAO,yBAAyB,CAAC;+BAC5C,UAAU,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;mCACtD,gBAAgB,CAAC,QAAQ,CAAC;0BAxKf,mBAAmB;gCAGoB,YAAY"}
|
package/src/service.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/** @file Orchestration service */
|
|
2
2
|
|
|
3
|
-
// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512
|
|
4
|
-
import '@agoric/network/exported.js';
|
|
5
|
-
|
|
6
3
|
import { V as E } from '@agoric/vow/vat.js';
|
|
7
4
|
import { M } from '@endo/patterns';
|
|
8
5
|
import { Shape as NetworkShape } from '@agoric/network';
|
package/src/utils/orc.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export namespace orcUtils {
|
|
|
9
9
|
function makeOsmosisSwap(_args: (SwapExact | SwapMaxSlippage) & (AfterAction | Record<string, never>)): TransferMsg;
|
|
10
10
|
}
|
|
11
11
|
import type { TransferMsg } from '../types.js';
|
|
12
|
+
import type { SwapExact } from '../types.js';
|
|
12
13
|
import type { SwapMaxSlippage } from '../types.js';
|
|
13
14
|
import type { AfterAction } from '../types.js';
|
|
14
15
|
//# sourceMappingURL=orc.d.ts.map
|
package/src/utils/orc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orc.d.ts","sourceRoot":"","sources":["orc.js"],"names":[],"mappings":";IASmB,wEAShB;IACD;;;;;OAKG;IACH,oHASC;;
|
|
1
|
+
{"version":3,"file":"orc.d.ts","sourceRoot":"","sources":["orc.js"],"names":[],"mappings":";IASmB,wEAShB;IACD;;;;;OAKG;IACH,oHASC;;iCAlCqE,aAAa;+BAAb,aAAa;qCAAb,aAAa;iCAAb,aAAa"}
|
package/src/utils/orc.js
CHANGED