@agoric/orchestration 0.1.1-dev-7b30169.0 → 0.1.1-dev-24665a9.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 +15 -15
- package/src/cosmos-api.d.ts +1 -1
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +3 -1
- package/src/examples/sendAnywhere.contract.d.ts.map +1 -1
- package/src/examples/sendAnywhere.contract.js +1 -0
- package/src/examples/stakeIca.contract.d.ts +7 -6
- package/src/examples/stakeIca.contract.d.ts.map +1 -1
- package/src/examples/stakeIca.contract.js +27 -11
- package/src/examples/swapExample.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.js +7 -2
- package/src/examples/unbondExample.contract.d.ts.map +1 -1
- package/src/examples/unbondExample.contract.js +1 -0
- package/src/exos/chainAccountKit.d.ts.map +1 -1
- package/src/exos/chainAccountKit.js +2 -0
- package/src/exos/cosmosOrchestrationAccount.d.ts +13 -13
- package/src/exos/cosmosOrchestrationAccount.d.ts.map +1 -1
- package/src/exos/cosmosOrchestrationAccount.js +16 -10
- package/src/facade.d.ts +3 -1
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +9 -3
- package/src/proposals/start-stakeAtom.d.ts +5 -5
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.js +3 -5
- package/src/proposals/start-stakeOsmo.d.ts +120 -0
- package/src/proposals/start-stakeOsmo.d.ts.map +1 -0
- package/src/proposals/start-stakeOsmo.js +109 -0
- package/src/typeGuards.d.ts +0 -1
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +0 -1
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-24665a9.0+24665a9",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@agoric/assert": "0.6.1-dev-
|
|
36
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
37
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
38
|
-
"@agoric/internal": "0.3.3-dev-
|
|
39
|
-
"@agoric/network": "0.1.1-dev-
|
|
40
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
41
|
-
"@agoric/store": "0.9.3-dev-
|
|
42
|
-
"@agoric/time": "0.3.3-dev-
|
|
43
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
44
|
-
"@agoric/vats": "0.15.2-dev-
|
|
45
|
-
"@agoric/vow": "0.1.1-dev-
|
|
46
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
47
|
-
"@agoric/zone": "0.2.3-dev-
|
|
35
|
+
"@agoric/assert": "0.6.1-dev-24665a9.0+24665a9",
|
|
36
|
+
"@agoric/cosmic-proto": "0.4.1-dev-24665a9.0+24665a9",
|
|
37
|
+
"@agoric/ertp": "0.16.3-dev-24665a9.0+24665a9",
|
|
38
|
+
"@agoric/internal": "0.3.3-dev-24665a9.0+24665a9",
|
|
39
|
+
"@agoric/network": "0.1.1-dev-24665a9.0+24665a9",
|
|
40
|
+
"@agoric/notifier": "0.6.3-dev-24665a9.0+24665a9",
|
|
41
|
+
"@agoric/store": "0.9.3-dev-24665a9.0+24665a9",
|
|
42
|
+
"@agoric/time": "0.3.3-dev-24665a9.0+24665a9",
|
|
43
|
+
"@agoric/vat-data": "0.5.3-dev-24665a9.0+24665a9",
|
|
44
|
+
"@agoric/vats": "0.15.2-dev-24665a9.0+24665a9",
|
|
45
|
+
"@agoric/vow": "0.1.1-dev-24665a9.0+24665a9",
|
|
46
|
+
"@agoric/zoe": "0.26.3-dev-24665a9.0+24665a9",
|
|
47
|
+
"@agoric/zone": "0.2.3-dev-24665a9.0+24665a9",
|
|
48
48
|
"@endo/base64": "^1.0.5",
|
|
49
49
|
"@endo/far": "^1.1.2",
|
|
50
50
|
"@endo/marshal": "^1.5.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"typeCoverage": {
|
|
88
88
|
"atLeast": 97.1
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "24665a97248b854fcb01185d360429301470ed57"
|
|
91
91
|
}
|
package/src/cosmos-api.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ export interface StakingAccountActions {
|
|
|
111
111
|
* The unbonding time is padded by 10 minutes to account for clock skew.
|
|
112
112
|
* @param delegations - the delegation to undelegate
|
|
113
113
|
*/
|
|
114
|
-
undelegate: (delegations: Delegation[]) => Promise<void>;
|
|
114
|
+
undelegate: (delegations: Omit<Delegation, 'delegatorAddress'>[]) => Promise<void>;
|
|
115
115
|
/**
|
|
116
116
|
* Withdraw rewards from all validators. The promise settles when the rewards are withdrawn.
|
|
117
117
|
* @returns The total amounts of rewards withdrawn
|
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,UAAU,EACV,YAAY,EACZ,mBAAmB,EACpB,MAAM,wDAAwD,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,yDAAyD,CAAC;AACtF,OAAO,KAAK,EACV,KAAK,IAAI,eAAe,EACxB,KAAK,EACN,MAAM,qDAAqD,CAAC;AAC7D,OAAO,KAAK,EAAE,KAAK,IAAI,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;A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,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD;;;;;OAKG;IACH,gBAAgB,EAAE,CAChB,IAAI,EAAE,OAAO,EAAE,EACf,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,KACrC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,sEAAsE;IACtE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3C;;OAEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,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;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,GAAG,SAAS,eAAe,IAC/D,CAAC,GAAG,SAAS;IACX,UAAU,EAAE,IAAI,CAAC;CAClB,GACG,UAAU,GACV,EAAE,CAAC,GACL,GAAG,SAAS;IACZ,aAAa,EAAE,EAAE,CAAC;CACnB,GACG,qBAAqB,GACrB,EAAE,CAAC"}
|
package/src/cosmos-api.ts
CHANGED
|
@@ -151,7 +151,9 @@ export interface StakingAccountActions {
|
|
|
151
151
|
* The unbonding time is padded by 10 minutes to account for clock skew.
|
|
152
152
|
* @param delegations - the delegation to undelegate
|
|
153
153
|
*/
|
|
154
|
-
undelegate: (
|
|
154
|
+
undelegate: (
|
|
155
|
+
delegations: Omit<Delegation, 'delegatorAddress'>[],
|
|
156
|
+
) => Promise<void>;
|
|
155
157
|
|
|
156
158
|
/**
|
|
157
159
|
* Withdraw rewards from all validators. The promise settles when the rewards are withdrawn.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH,kEAKE;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB;;;;;
|
|
1
|
+
{"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH,kEAKE;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB;;;;;QAsGE;;;WAGG;;;;;;;;;;GAgBR;;;;;8BAjEO,MAAC,KAAK,CAAC;6BAiBb,QAEA,KAAI,CAAC,mBACH,OAAO;6BAuBL,OACF,KAAE,CAAC;;;2BAsBwG,EAAE;;;;;;;oBAAqjG,CAAC;;;uBAA6lB,EAAE;;;;;;;;;;;;;;;;;6BAxJ5uH,kBAAkB;uCACS,eAAe;4BAK3C,aAAa;kCAJK,cAAc;6BAG/B,cAAc"}
|
|
@@ -36,10 +36,10 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
39
|
-
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount:
|
|
39
|
+
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
40
40
|
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
41
41
|
WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
|
|
42
|
-
Undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<Invitation<void, undefined>>;
|
|
42
|
+
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<void, undefined>>;
|
|
43
43
|
CloseAccount(): never;
|
|
44
44
|
TransferAccount(): never;
|
|
45
45
|
}>;
|
|
@@ -63,7 +63,7 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
63
63
|
transfer(amount: any, msg: any): never;
|
|
64
64
|
transferSteps(amount: any, msg: any): never;
|
|
65
65
|
withdrawRewards(): never;
|
|
66
|
-
undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<void>;
|
|
66
|
+
undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<void>;
|
|
67
67
|
}>>;
|
|
68
68
|
makeAccountInvitationMaker(): Promise<Invitation<{
|
|
69
69
|
publicSubscribers: {
|
|
@@ -74,10 +74,10 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
77
|
-
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount:
|
|
77
|
+
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
78
78
|
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
79
79
|
WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
|
|
80
|
-
Undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<Invitation<void, undefined>>;
|
|
80
|
+
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<void, undefined>>;
|
|
81
81
|
CloseAccount(): never;
|
|
82
82
|
TransferAccount(): never;
|
|
83
83
|
}>;
|
|
@@ -90,8 +90,9 @@ export type StakeIcaTerms = {
|
|
|
90
90
|
hostConnectionId: `connection-${number}`;
|
|
91
91
|
controllerConnectionId: `connection-${number}`;
|
|
92
92
|
bondDenom: string;
|
|
93
|
+
icqEnabled: boolean;
|
|
93
94
|
};
|
|
94
|
-
export type
|
|
95
|
+
export type StakeIcaSF = typeof start;
|
|
95
96
|
import type { TimerService } from '@agoric/time';
|
|
96
97
|
import type { Baggage } from '@agoric/vat-data';
|
|
97
98
|
//# sourceMappingURL=stakeIca.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AACH;;;;;cAAsD;AAsB/C,2BATI,GAAG,CAAC,aAAa,CAAC;;;;;;;;;iBAGX,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkF1B;;aA/Fa,MAAM;;;eAGJ,MAAM;gBACL,OAAO;;yBA6FV,OAAO,KAAK;kCAzHK,cAAc;6BAFnB,kBAAkB"}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
import { makeTracer, StorageNodeShape } from '@agoric/internal';
|
|
4
4
|
import { TimerServiceShape } from '@agoric/time';
|
|
5
5
|
import { V as E } from '@agoric/vow/vat.js';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
prepareRecorderKitMakers,
|
|
8
|
+
provideAll,
|
|
9
|
+
} from '@agoric/zoe/src/contractSupport';
|
|
7
10
|
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
8
11
|
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
9
12
|
import { M } from '@endo/patterns';
|
|
@@ -24,6 +27,7 @@ export const meta = harden({
|
|
|
24
27
|
hostConnectionId: M.string(),
|
|
25
28
|
controllerConnectionId: M.string(),
|
|
26
29
|
bondDenom: M.string(),
|
|
30
|
+
icqEnabled: M.boolean(),
|
|
27
31
|
},
|
|
28
32
|
privateArgsShape: {
|
|
29
33
|
orchestration: M.remotable('orchestration'),
|
|
@@ -40,6 +44,7 @@ export const privateArgsShape = meta.privateArgsShape;
|
|
|
40
44
|
* hostConnectionId: IBCConnectionID;
|
|
41
45
|
* controllerConnectionId: IBCConnectionID;
|
|
42
46
|
* bondDenom: string;
|
|
47
|
+
* icqEnabled: boolean;
|
|
43
48
|
* }} StakeIcaTerms
|
|
44
49
|
*/
|
|
45
50
|
|
|
@@ -54,12 +59,21 @@ export const privateArgsShape = meta.privateArgsShape;
|
|
|
54
59
|
* @param {Baggage} baggage
|
|
55
60
|
*/
|
|
56
61
|
export const start = async (zcf, privateArgs, baggage) => {
|
|
57
|
-
const {
|
|
58
|
-
|
|
62
|
+
const {
|
|
63
|
+
chainId,
|
|
64
|
+
hostConnectionId,
|
|
65
|
+
controllerConnectionId,
|
|
66
|
+
bondDenom,
|
|
67
|
+
icqEnabled,
|
|
68
|
+
} = zcf.getTerms();
|
|
59
69
|
const { orchestration, marshaller, storageNode, timer } = privateArgs;
|
|
60
70
|
|
|
61
71
|
const zone = makeDurableZone(baggage);
|
|
62
72
|
|
|
73
|
+
const { accountsStorageNode } = await provideAll(baggage, {
|
|
74
|
+
accountsStorageNode: () => E(storageNode).makeChildNode('accounts'),
|
|
75
|
+
});
|
|
76
|
+
|
|
63
77
|
const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller);
|
|
64
78
|
|
|
65
79
|
const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
|
|
@@ -74,17 +88,19 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
74
88
|
hostConnectionId,
|
|
75
89
|
controllerConnectionId,
|
|
76
90
|
);
|
|
77
|
-
// TODO https://github.com/Agoric/agoric-sdk/issues/9326
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
);
|
|
91
|
+
// TODO permissionless queries https://github.com/Agoric/agoric-sdk/issues/9326
|
|
92
|
+
const icqConnection = icqEnabled
|
|
93
|
+
? await E(orchestration).provideICQConnection(controllerConnectionId)
|
|
94
|
+
: undefined;
|
|
95
|
+
|
|
83
96
|
const accountAddress = await E(account).getAddress();
|
|
84
97
|
trace('account address', accountAddress);
|
|
98
|
+
const accountNode = await E(accountsStorageNode).makeChildNode(
|
|
99
|
+
accountAddress.address,
|
|
100
|
+
);
|
|
85
101
|
const holder = makeCosmosOrchestrationAccount(accountAddress, bondDenom, {
|
|
86
102
|
account,
|
|
87
|
-
storageNode,
|
|
103
|
+
storageNode: accountNode,
|
|
88
104
|
icqConnection,
|
|
89
105
|
timer,
|
|
90
106
|
});
|
|
@@ -121,4 +137,4 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
121
137
|
return { publicFacet };
|
|
122
138
|
};
|
|
123
139
|
|
|
124
|
-
/** @typedef {typeof start}
|
|
140
|
+
/** @typedef {typeof start} StakeIcaSF */
|
|
@@ -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":"AAcA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAWnC;AASK,0CAHI,KAAK;;;EAIsC;AAc/C,2BAXI,GAAG;;;;;8BAyDA,MAAM,KAAK,CAAC;6BAec,QAAQ,KAEhD,CAAC,mBAA6B,OAAO;6BAiB3B,OAAA,KAAC,CAAC;;;2BA2BmC,EAAE;;;;;;;oBAAqjG,CAAC;;;uBAA6lB,EAAE;;;;;;;;;;;;;;;gBA/GrrH,UAAU;;;;oBA+CV,MAAM,CAAC,KAAK,CAAC;;;;;oBAAb,MAAM,CAAC,KAAK,CAAC;;;;GA+D7B;6BAhJyB,cAAc;4BAHf,kBAAkB;gCAHwB,aAAa;kCACjD,cAAc;6BAInB,kBAAkB;4CALuB,aAAa"}
|
|
@@ -2,9 +2,10 @@ import { StorageNodeShape } from '@agoric/internal';
|
|
|
2
2
|
import { TimerServiceShape } from '@agoric/time';
|
|
3
3
|
import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js';
|
|
4
4
|
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
5
|
-
import { Far } from '@endo/far';
|
|
5
|
+
import { E, Far } from '@endo/far';
|
|
6
6
|
import { deeplyFulfilled } from '@endo/marshal';
|
|
7
7
|
import { M, objectMap } from '@endo/patterns';
|
|
8
|
+
import { provideAll } from '@agoric/zoe/src/contractSupport';
|
|
8
9
|
import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
9
10
|
import { makeOrchestrationFacade } from '../facade.js';
|
|
10
11
|
import { orcUtils } from '../utils/orc.js';
|
|
@@ -79,16 +80,20 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
79
80
|
timerService,
|
|
80
81
|
chainHub,
|
|
81
82
|
);
|
|
83
|
+
const { accountsStorageNode } = await provideAll(baggage, {
|
|
84
|
+
accountsStorageNode: () => E(storageNode).makeChildNode('accounts'),
|
|
85
|
+
});
|
|
82
86
|
|
|
83
87
|
const { orchestrate } = makeOrchestrationFacade({
|
|
84
88
|
localchain,
|
|
85
89
|
orchestrationService,
|
|
86
|
-
storageNode,
|
|
90
|
+
storageNode: accountsStorageNode,
|
|
87
91
|
timerService,
|
|
88
92
|
zcf,
|
|
89
93
|
zone,
|
|
90
94
|
chainHub,
|
|
91
95
|
makeLocalChainAccountKit,
|
|
96
|
+
makeRecorderKit,
|
|
92
97
|
});
|
|
93
98
|
|
|
94
99
|
/** deprecated historical example */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AA8BO,2BAXI,GAAG;;;;;
|
|
1
|
+
{"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AA8BO,2BAXI,GAAG;;;;;8BA0E+B,MACzC,KAAC,CAAC;6BAkBoG,QAAQ,KAAK,CAAC,mBAA6B,OAAO;6BAAwjB,OAAO,KAAK,CAAC;;;2BAA6rB,EAAE;;;;;;;oBAAqjG,CAAC;;;uBAA6lB,EAAE;;;;;;;;;;;;;;gBAvFpiK,UAAU;;;;;;;;GAsF1B;6BAlGyB,cAAc;4BACf,kBAAkB;gCALwB,aAAa;kCACjD,cAAc;6BACnB,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainAccountKit.d.ts","sourceRoot":"","sources":["chainAccountKit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;GAaG;AAeI;;QAqBC,8BAA8B;;;;;;;;QAiC9B;;;;;;;;;WASG;mLAHU,OAAO,CAAC,MAAM,CAAC;QAa5B,+BAA+B;;QAS/B;;;;WAIG;wBADQ,KAAK;;;QAQhB;;;;WAIG;;;;;
|
|
1
|
+
{"version":3,"file":"chainAccountKit.d.ts","sourceRoot":"","sources":["chainAccountKit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;GAaG;AAeI;;QAqBC,8BAA8B;;;;;;;;QAiC9B;;;;;;;;;WASG;mLAHU,OAAO,CAAC,MAAM,CAAC;QAa5B,+BAA+B;;QAS/B;;;;WAIG;wBADQ,KAAK;;;QAQhB;;;;WAIG;;;;;GAyBR;qCAzJW,0BAA0B;;aAoB1B,MAAM;;;;4BAIS,MAAM;;;;8BAmIrB,UAAU,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;0BAvK5C,mBAAmB;0BACP,iBAAiB;kCAKrB,aAAa;4BAFnB,8CAA8C;gCAHpC,iBAAiB;4BAC3B,aAAa"}
|
|
@@ -160,6 +160,8 @@ export const prepareChainAccountKit = zone =>
|
|
|
160
160
|
this.state.remoteAddress = remoteAddr;
|
|
161
161
|
this.state.localAddress = localAddr;
|
|
162
162
|
this.state.chainAddress = harden({
|
|
163
|
+
// FIXME need a fallback value like icacontroller-1-connection-1 if this fails
|
|
164
|
+
// https://github.com/Agoric/agoric-sdk/issues/9066
|
|
163
165
|
address: findAddressField(remoteAddr) || UNPARSABLE_CHAIN_ADDRESS,
|
|
164
166
|
chainId: this.state.chainId,
|
|
165
167
|
addressEncoding: 'bech32',
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
|
|
8
8
|
* account: IcaAccount;
|
|
9
9
|
* chainAddress: ChainAddress;
|
|
10
|
-
* icqConnection: ICQConnection;
|
|
10
|
+
* icqConnection: ICQConnection | undefined;
|
|
11
11
|
* bondDenom: string;
|
|
12
12
|
* timer: Remote<TimerService>;
|
|
13
13
|
* }} State
|
|
@@ -37,7 +37,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
37
37
|
getLocalAddress(): `/ibc-port/${string}`;
|
|
38
38
|
getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
|
|
39
39
|
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>;
|
|
40
|
-
}
|
|
40
|
+
}> | undefined;
|
|
41
41
|
timer: Remote<TimerService>;
|
|
42
42
|
}) => import("@endo/exo").GuardedKit<{
|
|
43
43
|
helper: {
|
|
@@ -53,9 +53,9 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
53
53
|
invitationMakers: {
|
|
54
54
|
/**
|
|
55
55
|
* @param {CosmosValidatorAddress} validator
|
|
56
|
-
* @param {
|
|
56
|
+
* @param {AmountArg} amount
|
|
57
57
|
*/
|
|
58
|
-
Delegate(validator: CosmosValidatorAddress, amount:
|
|
58
|
+
Delegate(validator: CosmosValidatorAddress, amount: AmountArg): Promise<Invitation<void, undefined>>;
|
|
59
59
|
/**
|
|
60
60
|
* @param {CosmosValidatorAddress} srcValidator
|
|
61
61
|
* @param {CosmosValidatorAddress} dstValidator
|
|
@@ -64,8 +64,8 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
64
64
|
Redelegate(srcValidator: CosmosValidatorAddress, dstValidator: CosmosValidatorAddress, amount: AmountArg): Promise<Invitation<void, undefined>>;
|
|
65
65
|
/** @param {CosmosValidatorAddress} validator */
|
|
66
66
|
WithdrawReward(validator: CosmosValidatorAddress): Promise<Invitation<DenomAmount[], undefined>>;
|
|
67
|
-
/** @param {Delegation[]} delegations */
|
|
68
|
-
Undelegate(delegations: Delegation[]): Promise<Invitation<void, undefined>>;
|
|
67
|
+
/** @param {Omit<Delegation, 'delegatorAddress'>[]} delegations */
|
|
68
|
+
Undelegate(delegations: Omit<Delegation, "delegatorAddress">[]): Promise<Invitation<void, undefined>>;
|
|
69
69
|
CloseAccount(): never;
|
|
70
70
|
/**
|
|
71
71
|
* Starting a transfer revokes the account holder. The associated
|
|
@@ -86,9 +86,9 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
86
86
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
87
87
|
/**
|
|
88
88
|
* @param {CosmosValidatorAddress} validator
|
|
89
|
-
* @param {
|
|
89
|
+
* @param {AmountArg} amount
|
|
90
90
|
*/
|
|
91
|
-
Delegate(validator: CosmosValidatorAddress, amount:
|
|
91
|
+
Delegate(validator: CosmosValidatorAddress, amount: AmountArg): Promise<Invitation<void, undefined>>;
|
|
92
92
|
/**
|
|
93
93
|
* @param {CosmosValidatorAddress} srcValidator
|
|
94
94
|
* @param {CosmosValidatorAddress} dstValidator
|
|
@@ -97,8 +97,8 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
97
97
|
Redelegate(srcValidator: CosmosValidatorAddress, dstValidator: CosmosValidatorAddress, amount: AmountArg): Promise<Invitation<void, undefined>>;
|
|
98
98
|
/** @param {CosmosValidatorAddress} validator */
|
|
99
99
|
WithdrawReward(validator: CosmosValidatorAddress): Promise<Invitation<DenomAmount[], undefined>>;
|
|
100
|
-
/** @param {Delegation[]} delegations */
|
|
101
|
-
Undelegate(delegations: Delegation[]): Promise<Invitation<void, undefined>>;
|
|
100
|
+
/** @param {Omit<Delegation, 'delegatorAddress'>[]} delegations */
|
|
101
|
+
Undelegate(delegations: Omit<Delegation, "delegatorAddress">[]): Promise<Invitation<void, undefined>>;
|
|
102
102
|
CloseAccount(): never;
|
|
103
103
|
/**
|
|
104
104
|
* Starting a transfer revokes the account holder. The associated
|
|
@@ -149,8 +149,8 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, makeRecorderKit
|
|
|
149
149
|
transfer(amount: any, msg: any): never;
|
|
150
150
|
transferSteps(amount: any, msg: any): never;
|
|
151
151
|
withdrawRewards(): never;
|
|
152
|
-
/** @param {Delegation[]} delegations */
|
|
153
|
-
undelegate(delegations: Delegation[]): Promise<void>;
|
|
152
|
+
/** @param {Omit<Delegation, 'delegatorAddress'>[]} delegations */
|
|
153
|
+
undelegate(delegations: Omit<Delegation, "delegatorAddress">[]): Promise<void>;
|
|
154
154
|
};
|
|
155
155
|
}>;
|
|
156
156
|
export function prepareCosmosOrchestrationAccount(zone: Zone, makeRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T> | undefined) => RecorderKit<T>, zcf: ZCF): (...args: Parameters<ReturnType<typeof prepareCosmosOrchestrationAccountKit>>) => CosmosOrchestrationAccountKit["holder"];
|
|
@@ -165,7 +165,7 @@ export type State = {
|
|
|
165
165
|
getLocalAddress(): `/ibc-port/${string}`;
|
|
166
166
|
getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
|
|
167
167
|
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>;
|
|
168
|
-
}
|
|
168
|
+
}> | undefined;
|
|
169
169
|
bondDenom: string;
|
|
170
170
|
timer: Remote<TimerService>;
|
|
171
171
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosOrchestrationAccount.d.ts","sourceRoot":"","sources":["cosmosOrchestrationAccount.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cosmosOrchestrationAccount.d.ts","sourceRoot":"","sources":["cosmosOrchestrationAccount.js"],"names":[],"mappings":"AAmDA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,mCAAmC;AACnC;;;;;;;;;;;;;;;GAqBG;AAOH,6CAGE;AAgBK,mGAgCsB,WAAW,GACnC,QAAI,OAAO,WAAW,EAAE,MAAM,CAAC,WACnC,CAAC,CAAC,0HApCQ,GAAG;;;;;;;;;;;QAuDN,wDAAwD;;;QAWxD;;;WAGG;;;;QAgBH;;;WAGG;;QASH;;;;WAIG;;QAaH,gDAAgD;;QAShD,kEAAkE;;;QAYlE;;;;WAIG;;;;;;;;;;;;;gBAtDH;;;mBAGG;;gBASH;;;;mBAIG;;gBAaH,gDAAgD;;gBAShD,kEAAkE;;;gBAYlE;;;;mBAIG;;;;;;;;;;;;QA2BH,8BAA8B;;QAI9B;;;;;WAKG;;;;QA2BH;;;;;;WAMG;;QAmBH;;;WAGG;;QAmBH;;;WAGG;;;;;;QA4CH,kEAAkE;;;GAgCzE;AAkBM,0IAvTsB,MAAM,wIAgTxB,GAAG,GACD,CACZ,GAAO,IAAI,EAAE,UAAU,CACvB,UAAgB,CAAC,OAAO,oCAAoC,CAAC,CACxD,KACE,6BAA6B,CAAC,QAAQ,CAAC,CAa9C;;;;;;;;;;;;;eAxZe,MAAM;;;4CA8XT,UAAU,CACtB,UAAc,CAAC,OAAO,oCAAoC,CAAC,CACxD;yCAyBU,6BAA6B,CAAC,QAAQ,CAAC;0BA1a9B,cAAc;iCALU,6CAA6C;kCADsE,aAAa;gCAAb,aAAa;4BAItJ,kBAAkB;kCACZ,cAAc;+BALqH,aAAa;0BAExJ,kDAAkD;4CAFyF,aAAa;iCAAb,aAAa;gCAGlJ,wDAAwD;8BAH6E,aAAa"}
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
MsgUndelegateResponse,
|
|
17
17
|
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
|
|
18
18
|
import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
19
|
-
import { AmountShape } from '@agoric/ertp';
|
|
20
19
|
import { makeTracer } from '@agoric/internal';
|
|
21
20
|
import { M } from '@agoric/vat-data';
|
|
22
21
|
import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/index.js';
|
|
@@ -60,7 +59,7 @@ const { Fail } = assert;
|
|
|
60
59
|
* topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
|
|
61
60
|
* account: IcaAccount;
|
|
62
61
|
* chainAddress: ChainAddress;
|
|
63
|
-
* icqConnection: ICQConnection;
|
|
62
|
+
* icqConnection: ICQConnection | undefined;
|
|
64
63
|
* bondDenom: string;
|
|
65
64
|
* timer: Remote<TimerService>;
|
|
66
65
|
* }} State
|
|
@@ -75,11 +74,13 @@ export const IcaAccountHolderI = M.interface('IcaAccountHolder', {
|
|
|
75
74
|
holder: M.any(),
|
|
76
75
|
}),
|
|
77
76
|
getPublicTopics: M.call().returns(TopicsRecordShape),
|
|
78
|
-
delegate: M.callWhen(ChainAddressShape,
|
|
77
|
+
delegate: M.callWhen(ChainAddressShape, AmountArgShape).returns(
|
|
78
|
+
M.undefined(),
|
|
79
|
+
),
|
|
79
80
|
redelegate: M.callWhen(
|
|
80
81
|
ChainAddressShape,
|
|
81
82
|
ChainAddressShape,
|
|
82
|
-
|
|
83
|
+
AmountArgShape,
|
|
83
84
|
).returns(M.undefined()),
|
|
84
85
|
withdrawReward: M.callWhen(ChainAddressShape).returns(
|
|
85
86
|
M.arrayOf(ChainAmountShape),
|
|
@@ -123,11 +124,11 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
123
124
|
helper: M.interface('helper', {
|
|
124
125
|
owned: M.call().returns(M.remotable()),
|
|
125
126
|
getUpdater: M.call().returns(M.remotable()),
|
|
126
|
-
amountToCoin: M.call(
|
|
127
|
+
amountToCoin: M.call(AmountArgShape).returns(M.record()),
|
|
127
128
|
}),
|
|
128
129
|
holder: IcaAccountHolderI,
|
|
129
130
|
invitationMakers: M.interface('invitationMakers', {
|
|
130
|
-
Delegate: M.callWhen(ChainAddressShape,
|
|
131
|
+
Delegate: M.callWhen(ChainAddressShape, AmountArgShape).returns(
|
|
131
132
|
InvitationShape,
|
|
132
133
|
),
|
|
133
134
|
Redelegate: M.callWhen(
|
|
@@ -149,7 +150,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
149
150
|
* @param {object} io
|
|
150
151
|
* @param {IcaAccount} io.account
|
|
151
152
|
* @param {Remote<StorageNode>} io.storageNode
|
|
152
|
-
* @param {ICQConnection} io.icqConnection
|
|
153
|
+
* @param {ICQConnection | undefined} io.icqConnection
|
|
153
154
|
* @param {Remote<TimerService>} io.timer
|
|
154
155
|
* @returns {State}
|
|
155
156
|
*/
|
|
@@ -158,6 +159,8 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
158
159
|
// must be the fully synchronous maker because the kit is held in durable state
|
|
159
160
|
// @ts-expect-error XXX Patterns
|
|
160
161
|
const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]);
|
|
162
|
+
// TODO determine what goes in vstorage https://github.com/Agoric/agoric-sdk/issues/9066
|
|
163
|
+
void E(topicKit.recorder).write('');
|
|
161
164
|
|
|
162
165
|
return { chainAddress, bondDenom, topicKit, ...rest };
|
|
163
166
|
},
|
|
@@ -195,7 +198,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
195
198
|
invitationMakers: {
|
|
196
199
|
/**
|
|
197
200
|
* @param {CosmosValidatorAddress} validator
|
|
198
|
-
* @param {
|
|
201
|
+
* @param {AmountArg} amount
|
|
199
202
|
*/
|
|
200
203
|
Delegate(validator, amount) {
|
|
201
204
|
trace('Delegate', validator, amount);
|
|
@@ -231,7 +234,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
231
234
|
return this.facets.holder.withdrawReward(validator);
|
|
232
235
|
}, 'WithdrawReward');
|
|
233
236
|
},
|
|
234
|
-
/** @param {Delegation[]} delegations */
|
|
237
|
+
/** @param {Omit<Delegation, 'delegatorAddress'>[]} delegations */
|
|
235
238
|
Undelegate(delegations) {
|
|
236
239
|
trace('Undelegate', delegations);
|
|
237
240
|
|
|
@@ -363,6 +366,9 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
363
366
|
*/
|
|
364
367
|
async getBalance(denom) {
|
|
365
368
|
const { chainAddress, icqConnection } = this.state;
|
|
369
|
+
if (!icqConnection) {
|
|
370
|
+
throw Fail`Queries not available for chain ${chainAddress.chainId}`;
|
|
371
|
+
}
|
|
366
372
|
// TODO #9211 lookup denom from brand
|
|
367
373
|
assert.typeof(denom, 'string');
|
|
368
374
|
|
|
@@ -401,7 +407,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
401
407
|
throw assert.error('Not implemented');
|
|
402
408
|
},
|
|
403
409
|
|
|
404
|
-
/** @param {Delegation[]} delegations */
|
|
410
|
+
/** @param {Omit<Delegation, 'delegatorAddress'>[]} delegations */
|
|
405
411
|
async undelegate(delegations) {
|
|
406
412
|
trace('undelegate', delegations);
|
|
407
413
|
const { helper } = this.facets;
|
package/src/facade.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode, orchestrationService, localchain, chainHub, makeLocalChainAccountKit, }: {
|
|
1
|
+
export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode, orchestrationService, localchain, chainHub, makeLocalChainAccountKit, makeRecorderKit, }: {
|
|
2
2
|
zone: Zone;
|
|
3
3
|
timerService: Remote<TimerService>;
|
|
4
4
|
zcf: ZCF;
|
|
@@ -36,6 +36,7 @@ export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode,
|
|
|
36
36
|
}>>;
|
|
37
37
|
chainHub: import("./utils/chainHub.js").ChainHub;
|
|
38
38
|
makeLocalChainAccountKit: ReturnType<typeof import("./exos/local-chain-account-kit.js").prepareLocalChainAccountKit>;
|
|
39
|
+
makeRecorderKit: <T_1>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: import("@agoric/zoe/src/contractSupport/recorder.js").TypedMatcher<T_1> | undefined) => RecorderKit<T_1>;
|
|
39
40
|
}): {
|
|
40
41
|
/**
|
|
41
42
|
* @template Context
|
|
@@ -52,5 +53,6 @@ export type OrchestrationFacade = ReturnType<typeof makeOrchestrationFacade>;
|
|
|
52
53
|
import type { Zone } from '@agoric/zone';
|
|
53
54
|
import type { TimerService } from '@agoric/time';
|
|
54
55
|
import type { Remote } from '@agoric/internal';
|
|
56
|
+
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
55
57
|
import type { Orchestrator } from './types.js';
|
|
56
58
|
//# 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":"AAgKO;;;SAXG,GAAG;;;;;;;;;;;;;8BA7CZ,MACC,KAAK,CAAC;6BAiBS,QAAQ,KACtB,CAAC,mBAA6B,OAAO;6BA0BnC,OAAM,KACV,CAAC;;;2BA2BA,EAAE;;;;;;;oBAqDu8C,CAAC;;;uBAA6lB,EAAE;;;;;cA7E5hE,OAAO,qBAAqB,EAAE,QAAQ;8BACtB,UAAU,CACxC,cAAoB,mCAAmC,EAAE,2BAA2B,CAC/E;wCAC+B,WAC5B,GAAE,QAER,OAAO,WAAW,EAAE,MAAM,CAAC,WAAW,CACzC,CAAC;;IAmBG;;;;;;;;OAQG;gBAFkC,OAAO,EACrB,IAAI,6BAJhB,MAAM,OAGoB,OAAO,AAD1B,gCACmB,OAAO,WACrB,IAAI,AADgC,KAAK,MAAM,GACzD,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC;EAwCnD;kCAEa,UAAU,CAAC,OAAO,uBAAuB,CAAC;0BA/NjC,cAAc;kCACN,cAAc;4BAIpB,kBAAkB;iCADI,6CAA6C;kCAGe,YAAY"}
|
package/src/facade.js
CHANGED
|
@@ -8,6 +8,7 @@ import { prepareCosmosOrchestrationAccount } from './exos/cosmosOrchestrationAcc
|
|
|
8
8
|
* @import {TimerService} from '@agoric/time';
|
|
9
9
|
* @import {IBCConnectionID} from '@agoric/vats';
|
|
10
10
|
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
11
|
+
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'.
|
|
11
12
|
* @import {Remote} from '@agoric/internal';
|
|
12
13
|
* @import {OrchestrationService} from './service.js';
|
|
13
14
|
* @import {Chain, ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount, Orchestrator} from './types.js';
|
|
@@ -95,6 +96,8 @@ const makeLocalChainFacade = (
|
|
|
95
96
|
* @param {IBCConnectionInfo} connectionInfo
|
|
96
97
|
* @param {object} io
|
|
97
98
|
* @param {Remote<OrchestrationService>} io.orchestration
|
|
99
|
+
* @param {MakeRecorderKit} io.makeRecorderKit
|
|
100
|
+
* @param {Remote<StorageNode>} io.storageNode
|
|
98
101
|
* @param {Remote<TimerService>} io.timer
|
|
99
102
|
* @param {ZCF} io.zcf
|
|
100
103
|
* @param {Zone} io.zone
|
|
@@ -103,9 +106,8 @@ const makeLocalChainFacade = (
|
|
|
103
106
|
const makeRemoteChainFacade = (
|
|
104
107
|
chainInfo,
|
|
105
108
|
connectionInfo,
|
|
106
|
-
{ orchestration, timer, zcf, zone },
|
|
109
|
+
{ orchestration, makeRecorderKit, storageNode, timer, zcf, zone },
|
|
107
110
|
) => {
|
|
108
|
-
const makeRecorderKit = () => anyVal;
|
|
109
111
|
const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
|
|
110
112
|
zone.subZone(chainInfo.chainId),
|
|
111
113
|
makeRecorderKit,
|
|
@@ -133,7 +135,7 @@ const makeRemoteChainFacade = (
|
|
|
133
135
|
// @ts-expect-error XXX dynamic method availability
|
|
134
136
|
return makeCosmosOrchestrationAccount(address, bondDenom, {
|
|
135
137
|
account: icaAccount,
|
|
136
|
-
storageNode
|
|
138
|
+
storageNode,
|
|
137
139
|
icqConnection: anyVal,
|
|
138
140
|
timer,
|
|
139
141
|
});
|
|
@@ -153,6 +155,7 @@ const makeRemoteChainFacade = (
|
|
|
153
155
|
* makeLocalChainAccountKit: ReturnType<
|
|
154
156
|
* typeof import('./exos/local-chain-account-kit.js').prepareLocalChainAccountKit
|
|
155
157
|
* >;
|
|
158
|
+
* makeRecorderKit: MakeRecorderKit;
|
|
156
159
|
* }} powers
|
|
157
160
|
*/
|
|
158
161
|
export const makeOrchestrationFacade = ({
|
|
@@ -164,6 +167,7 @@ export const makeOrchestrationFacade = ({
|
|
|
164
167
|
localchain,
|
|
165
168
|
chainHub,
|
|
166
169
|
makeLocalChainAccountKit,
|
|
170
|
+
makeRecorderKit,
|
|
167
171
|
}) => {
|
|
168
172
|
console.log('makeOrchestrationFacade got', {
|
|
169
173
|
zone,
|
|
@@ -205,6 +209,8 @@ export const makeOrchestrationFacade = ({
|
|
|
205
209
|
|
|
206
210
|
return makeRemoteChainFacade(remoteChainInfo, connectionInfo, {
|
|
207
211
|
orchestration: orchestrationService,
|
|
212
|
+
makeRecorderKit,
|
|
213
|
+
storageNode,
|
|
208
214
|
timer: timerService,
|
|
209
215
|
zcf,
|
|
210
216
|
zone,
|
|
@@ -30,10 +30,10 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
|
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
32
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
33
|
-
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount:
|
|
33
|
+
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
34
34
|
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
35
35
|
WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
|
|
36
|
-
Undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<Invitation<void, undefined>>;
|
|
36
|
+
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<void, undefined>>;
|
|
37
37
|
CloseAccount(): never;
|
|
38
38
|
TransferAccount(): never;
|
|
39
39
|
}>;
|
|
@@ -57,7 +57,7 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
|
|
|
57
57
|
transfer(amount: any, msg: any): never;
|
|
58
58
|
transferSteps(amount: any, msg: any): never;
|
|
59
59
|
withdrawRewards(): never;
|
|
60
|
-
undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<void>;
|
|
60
|
+
undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<void>;
|
|
61
61
|
}>>;
|
|
62
62
|
makeAccountInvitationMaker(): Promise<Invitation<{
|
|
63
63
|
publicSubscribers: {
|
|
@@ -68,10 +68,10 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
|
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
71
|
-
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount:
|
|
71
|
+
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
72
72
|
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
73
73
|
WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
|
|
74
|
-
Undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<Invitation<void, undefined>>;
|
|
74
|
+
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<void, undefined>>;
|
|
75
75
|
CloseAccount(): never;
|
|
76
76
|
TransferAccount(): never;
|
|
77
77
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAuBO,yOAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAuBO,yOAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,OA2CxB,IAAI,aACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA1CF,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAuDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;mCApG4C,+BAA+B"}
|
|
@@ -5,7 +5,7 @@ import { makeChainHub } from '../utils/chainHub.js';
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @import {IBCConnectionID} from '@agoric/vats';
|
|
8
|
-
* @import {
|
|
8
|
+
* @import {StakeIcaSF, StakeIcaTerms} from '../examples/stakeIca.contract';
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
const trace = makeTracer('StartStakeAtom', true);
|
|
@@ -43,8 +43,6 @@ export const startStakeAtom = async ({
|
|
|
43
43
|
|
|
44
44
|
const storageNode = await makeStorageNodeChild(chainStorage, VSTORAGE_PATH);
|
|
45
45
|
const marshaller = await E(board).getPublishingMarshaller();
|
|
46
|
-
const atomIssuer = await E(agoricNames).lookup('issuer', 'ATOM');
|
|
47
|
-
trace('ATOM Issuer', atomIssuer);
|
|
48
46
|
|
|
49
47
|
const chainHub = makeChainHub(await agoricNames);
|
|
50
48
|
|
|
@@ -55,16 +53,16 @@ export const startStakeAtom = async ({
|
|
|
55
53
|
cosmoshub.chainId,
|
|
56
54
|
);
|
|
57
55
|
|
|
58
|
-
/** @type {StartUpgradableOpts<
|
|
56
|
+
/** @type {StartUpgradableOpts<StakeIcaSF>} */
|
|
59
57
|
const startOpts = {
|
|
60
58
|
label: 'stakeAtom',
|
|
61
59
|
installation: stakeIca,
|
|
62
|
-
issuerKeywordRecord: harden({ ATOM: atomIssuer }),
|
|
63
60
|
terms: {
|
|
64
61
|
chainId: cosmoshub.chainId,
|
|
65
62
|
hostConnectionId: connectionInfo.id,
|
|
66
63
|
controllerConnectionId: connectionInfo.counterparty.connection_id,
|
|
67
64
|
bondDenom: cosmoshub.stakingTokens[0].denom,
|
|
65
|
+
icqEnabled: cosmoshub.icqEnabled,
|
|
68
66
|
},
|
|
69
67
|
privateArgs: {
|
|
70
68
|
orchestration: await orchestration,
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export function startStakeOsmo({ consume: { agoricNames, board, chainStorage, chainTimerService, orchestration, startUpgradable, }, installation: { consume: { stakeIca }, }, instance: { produce: { stakeOsmo: produceInstance }, }, }: BootstrapPowers & {
|
|
2
|
+
installation: {
|
|
3
|
+
consume: {
|
|
4
|
+
stakeIca: Installation<(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
5
|
+
orchestration: import("@endo/exo").Guarded<{
|
|
6
|
+
makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
|
|
7
|
+
provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
|
|
8
|
+
getLocalAddress(): `/ibc-port/${string}`;
|
|
9
|
+
getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
|
|
10
|
+
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>;
|
|
11
|
+
}>>;
|
|
12
|
+
}>;
|
|
13
|
+
storageNode: globalThis.StorageNode;
|
|
14
|
+
marshaller: {
|
|
15
|
+
toCapData: import("@endo/marshal").ToCapData<unknown>;
|
|
16
|
+
fromCapData: import("@endo/marshal").FromCapData<unknown>;
|
|
17
|
+
serialize: import("@endo/marshal").ToCapData<unknown>;
|
|
18
|
+
unserialize: import("@endo/marshal").FromCapData<unknown>;
|
|
19
|
+
};
|
|
20
|
+
timer: import("@agoric/time").TimerService;
|
|
21
|
+
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
22
|
+
publicFacet: import("@endo/exo").Guarded<{
|
|
23
|
+
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
24
|
+
asContinuingOffer(): {
|
|
25
|
+
publicSubscribers: {
|
|
26
|
+
account: {
|
|
27
|
+
description: string;
|
|
28
|
+
subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
|
|
29
|
+
storagePath: Promise<string>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
33
|
+
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
34
|
+
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
35
|
+
WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
|
|
36
|
+
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<void, undefined>>;
|
|
37
|
+
CloseAccount(): never;
|
|
38
|
+
TransferAccount(): never;
|
|
39
|
+
}>;
|
|
40
|
+
holder: import("@endo/exo").Guarded<any>;
|
|
41
|
+
};
|
|
42
|
+
getPublicTopics(): {
|
|
43
|
+
account: {
|
|
44
|
+
description: string;
|
|
45
|
+
subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
|
|
46
|
+
storagePath: Promise<string>;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
50
|
+
delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
|
|
51
|
+
deposit(payment: any): Promise<void>;
|
|
52
|
+
getBalances(): Promise<never>;
|
|
53
|
+
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
|
|
54
|
+
withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<import("../orchestration-api.js").DenomAmount[]>;
|
|
55
|
+
getBalance(denom: import("../orchestration-api.js").DenomArg): Promise<import("../orchestration-api.js").DenomAmount>;
|
|
56
|
+
send(toAccount: any, amount: any): never;
|
|
57
|
+
transfer(amount: any, msg: any): never;
|
|
58
|
+
transferSteps(amount: any, msg: any): never;
|
|
59
|
+
withdrawRewards(): never;
|
|
60
|
+
undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<void>;
|
|
61
|
+
}>>;
|
|
62
|
+
makeAccountInvitationMaker(): Promise<Invitation<{
|
|
63
|
+
publicSubscribers: {
|
|
64
|
+
account: {
|
|
65
|
+
description: string;
|
|
66
|
+
subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
|
|
67
|
+
storagePath: Promise<string>;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
71
|
+
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
72
|
+
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
|
|
73
|
+
WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
|
|
74
|
+
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<void, undefined>>;
|
|
75
|
+
CloseAccount(): never;
|
|
76
|
+
TransferAccount(): never;
|
|
77
|
+
}>;
|
|
78
|
+
holder: import("@endo/exo").Guarded<any>;
|
|
79
|
+
}, undefined>>;
|
|
80
|
+
}>;
|
|
81
|
+
}>>;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}): Promise<void>;
|
|
85
|
+
export function getManifestForStakeOsmo({ restoreRef }: {
|
|
86
|
+
restoreRef: any;
|
|
87
|
+
}, { installKeys, ...options }: {
|
|
88
|
+
[x: string]: any;
|
|
89
|
+
installKeys: any;
|
|
90
|
+
}): {
|
|
91
|
+
manifest: {
|
|
92
|
+
[x: string]: {
|
|
93
|
+
consume: {
|
|
94
|
+
agoricNames: boolean;
|
|
95
|
+
board: boolean;
|
|
96
|
+
chainStorage: boolean;
|
|
97
|
+
chainTimerService: boolean;
|
|
98
|
+
orchestration: boolean;
|
|
99
|
+
startUpgradable: boolean;
|
|
100
|
+
};
|
|
101
|
+
installation: {
|
|
102
|
+
consume: {
|
|
103
|
+
stakeIca: boolean;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
instance: {
|
|
107
|
+
produce: {
|
|
108
|
+
stakeOsmo: boolean;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
installations: {
|
|
114
|
+
stakeIca: any;
|
|
115
|
+
};
|
|
116
|
+
options: {
|
|
117
|
+
[x: string]: any;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=start-stakeOsmo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start-stakeOsmo.d.ts","sourceRoot":"","sources":["start-stakeOsmo.js"],"names":[],"mappings":"AAuBO,yOAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,OA2ClB,IAAK,aAChB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA1CO,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAwDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { makeTracer } from '@agoric/internal';
|
|
2
|
+
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
3
|
+
import { E } from '@endo/far';
|
|
4
|
+
import { makeChainHub } from '../utils/chainHub.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @import {IBCConnectionID} from '@agoric/vats';
|
|
8
|
+
* @import {StakeIcaSF} from '../examples/stakeIca.contract';
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const trace = makeTracer('StartStakeOsmo', true);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {BootstrapPowers & {
|
|
15
|
+
* installation: {
|
|
16
|
+
* consume: {
|
|
17
|
+
* stakeIca: Installation<
|
|
18
|
+
* import('../examples/stakeIca.contract.js').start
|
|
19
|
+
* >;
|
|
20
|
+
* };
|
|
21
|
+
* };
|
|
22
|
+
* }} powers
|
|
23
|
+
*/
|
|
24
|
+
export const startStakeOsmo = async ({
|
|
25
|
+
consume: {
|
|
26
|
+
agoricNames,
|
|
27
|
+
board,
|
|
28
|
+
chainStorage,
|
|
29
|
+
chainTimerService,
|
|
30
|
+
orchestration,
|
|
31
|
+
startUpgradable,
|
|
32
|
+
},
|
|
33
|
+
installation: {
|
|
34
|
+
consume: { stakeIca },
|
|
35
|
+
},
|
|
36
|
+
instance: {
|
|
37
|
+
// @ts-expect-error stakeOsmo not typed
|
|
38
|
+
produce: { stakeOsmo: produceInstance },
|
|
39
|
+
},
|
|
40
|
+
}) => {
|
|
41
|
+
const VSTORAGE_PATH = 'stakeOsmo';
|
|
42
|
+
trace('startStakeOsmo');
|
|
43
|
+
await null;
|
|
44
|
+
|
|
45
|
+
const storageNode = await makeStorageNodeChild(chainStorage, VSTORAGE_PATH);
|
|
46
|
+
const marshaller = await E(board).getPublishingMarshaller();
|
|
47
|
+
|
|
48
|
+
const chainHub = makeChainHub(await agoricNames);
|
|
49
|
+
|
|
50
|
+
const agoric = await chainHub.getChainInfo('agoric');
|
|
51
|
+
const osmosis = await chainHub.getChainInfo('osmosis');
|
|
52
|
+
const connectionInfo = await chainHub.getConnectionInfo(
|
|
53
|
+
agoric.chainId,
|
|
54
|
+
osmosis.chainId,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
/** @type {StartUpgradableOpts<StakeIcaSF>} */
|
|
58
|
+
const startOpts = {
|
|
59
|
+
label: 'stakeOsmo',
|
|
60
|
+
installation: stakeIca,
|
|
61
|
+
terms: {
|
|
62
|
+
chainId: osmosis.chainId,
|
|
63
|
+
hostConnectionId: connectionInfo.id,
|
|
64
|
+
controllerConnectionId: connectionInfo.counterparty.connection_id,
|
|
65
|
+
bondDenom: osmosis.stakingTokens[0].denom,
|
|
66
|
+
icqEnabled: osmosis.icqEnabled,
|
|
67
|
+
},
|
|
68
|
+
privateArgs: {
|
|
69
|
+
orchestration: await orchestration,
|
|
70
|
+
storageNode,
|
|
71
|
+
marshaller,
|
|
72
|
+
timer: await chainTimerService,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const { instance } = await E(startUpgradable)(startOpts);
|
|
77
|
+
produceInstance.resolve(instance);
|
|
78
|
+
};
|
|
79
|
+
harden(startStakeOsmo);
|
|
80
|
+
|
|
81
|
+
export const getManifestForStakeOsmo = (
|
|
82
|
+
{ restoreRef },
|
|
83
|
+
{ installKeys, ...options },
|
|
84
|
+
) => {
|
|
85
|
+
return {
|
|
86
|
+
manifest: {
|
|
87
|
+
[startStakeOsmo.name]: {
|
|
88
|
+
consume: {
|
|
89
|
+
agoricNames: true,
|
|
90
|
+
board: true,
|
|
91
|
+
chainStorage: true,
|
|
92
|
+
chainTimerService: true,
|
|
93
|
+
orchestration: true,
|
|
94
|
+
startUpgradable: true,
|
|
95
|
+
},
|
|
96
|
+
installation: {
|
|
97
|
+
consume: { stakeIca: true },
|
|
98
|
+
},
|
|
99
|
+
instance: {
|
|
100
|
+
produce: { stakeOsmo: true },
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
installations: {
|
|
105
|
+
stakeIca: restoreRef(installKeys.stakeIca),
|
|
106
|
+
},
|
|
107
|
+
options,
|
|
108
|
+
};
|
|
109
|
+
};
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -25,7 +25,6 @@ export namespace ChainAmountShape {
|
|
|
25
25
|
}
|
|
26
26
|
export const AmountArgShape: import("@endo/patterns").Matcher;
|
|
27
27
|
export namespace DelegationShape {
|
|
28
|
-
let delegatorAddress: import("@endo/patterns").Matcher;
|
|
29
28
|
let validatorAddress: import("@endo/patterns").Matcher;
|
|
30
29
|
let shares: import("@endo/patterns").Matcher;
|
|
31
30
|
}
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;AAiBH,8DAAkE
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;AAiBH,8DAAkE;;;;;AAOlE,uEAUE;AAEF,iEAA4C;AAC5C,mEAQG;AACH,oEAA+C;AAC/C,sEAYG;AAEH,oEAUE"}
|
package/src/typeGuards.js
CHANGED
|
@@ -25,7 +25,6 @@ export const ChainAmountShape = harden({ denom: M.string(), value: M.nat() });
|
|
|
25
25
|
export const AmountArgShape = M.or(AmountShape, ChainAmountShape);
|
|
26
26
|
|
|
27
27
|
export const DelegationShape = harden({
|
|
28
|
-
delegatorAddress: M.string(),
|
|
29
28
|
validatorAddress: M.string(),
|
|
30
29
|
shares: M.string(), // TODO: bigint?
|
|
31
30
|
});
|