@agoric/orchestration 0.1.1-dev-a9e951a.0 → 0.1.1-dev-607ed82.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 +16 -16
- package/src/cosmos-api.d.ts +4 -1
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +1 -1
- package/src/examples/auto-stake-it.contract.d.ts +1 -1
- package/src/examples/send-anywhere.contract.d.ts +1 -1
- package/src/examples/stakeIca.contract.d.ts +4 -2
- package/src/examples/stakeIca.contract.d.ts.map +1 -1
- package/src/examples/stakeIca.contract.js +3 -10
- package/src/examples/staking-combinations.contract.d.ts +14 -14
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +65 -32
- package/src/examples/staking-combinations.flows.d.ts +18 -4
- package/src/examples/staking-combinations.flows.d.ts.map +1 -1
- package/src/examples/staking-combinations.flows.js +42 -15
- package/src/exos/README.md +0 -1
- package/src/exos/chain-hub-admin.d.ts +2 -2
- package/src/exos/chain-hub-admin.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.js +2 -2
- package/src/exos/cosmos-orchestration-account.d.ts +15 -8
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +15 -16
- package/src/exos/remote-chain-facade.d.ts +12 -3
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +1 -4
- package/src/proposals/start-stakeAtom.d.ts +4 -1
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.js +0 -1
- package/src/proposals/start-stakeOsmo.d.ts +4 -1
- package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.js +0 -1
- package/src/typeGuards.d.ts +14 -4
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +19 -10
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-607ed82.0+607ed82",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
37
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/internal": "0.3.3-dev-
|
|
40
|
-
"@agoric/network": "0.1.1-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
45
|
-
"@agoric/vats": "0.15.2-dev-
|
|
46
|
-
"@agoric/vow": "0.1.1-dev-
|
|
47
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
48
|
-
"@agoric/zone": "0.2.3-dev-
|
|
36
|
+
"@agoric/async-flow": "0.1.1-dev-607ed82.0+607ed82",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-607ed82.0+607ed82",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-607ed82.0+607ed82",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-607ed82.0+607ed82",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-607ed82.0+607ed82",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-607ed82.0+607ed82",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-607ed82.0+607ed82",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-607ed82.0+607ed82",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-607ed82.0+607ed82",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-607ed82.0+607ed82",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-607ed82.0+607ed82",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-607ed82.0+607ed82",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-607ed82.0+607ed82",
|
|
49
49
|
"@endo/base64": "^1.0.7",
|
|
50
50
|
"@endo/errors": "^1.2.5",
|
|
51
51
|
"@endo/far": "^1.1.5",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@noble/hashes": "^1.5.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
57
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-607ed82.0+607ed82",
|
|
58
58
|
"@chain-registry/client": "^1.47.4",
|
|
59
59
|
"@cosmjs/amino": "^0.32.3",
|
|
60
60
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"typeCoverage": {
|
|
95
95
|
"atLeast": 97.57
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "607ed82dddecb1296b2c9507a55cd2c73be3537e"
|
|
98
98
|
}
|
package/src/cosmos-api.d.ts
CHANGED
|
@@ -144,7 +144,10 @@ export interface StakingAccountActions {
|
|
|
144
144
|
* The unbonding time is padded by 10 minutes to account for clock skew.
|
|
145
145
|
* @param delegations - the delegation to undelegate
|
|
146
146
|
*/
|
|
147
|
-
undelegate: (delegations:
|
|
147
|
+
undelegate: (delegations: {
|
|
148
|
+
amount: AmountArg;
|
|
149
|
+
validator: CosmosValidatorAddress;
|
|
150
|
+
}[]) => Promise<void>;
|
|
148
151
|
/**
|
|
149
152
|
* Withdraw rewards from all validators. The promise settles when the rewards are withdrawn.
|
|
150
153
|
* @returns The total amounts of rewards withdrawn
|
package/src/cosmos-api.d.ts.map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A6D;IAC7D,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,0CAA0C;IAC1C,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D;;;;;;;;;OASG;IACH,gBAAgB,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnE;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,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;AAET,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,KAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC"}
|
package/src/cosmos-api.ts
CHANGED
|
@@ -187,7 +187,7 @@ export interface StakingAccountActions {
|
|
|
187
187
|
* @param delegations - the delegation to undelegate
|
|
188
188
|
*/
|
|
189
189
|
undelegate: (
|
|
190
|
-
delegations:
|
|
190
|
+
delegations: { amount: AmountArg; validator: CosmosValidatorAddress }[],
|
|
191
191
|
) => Promise<void>;
|
|
192
192
|
|
|
193
193
|
/**
|
|
@@ -15,7 +15,7 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
15
15
|
}>>;
|
|
16
16
|
}>;
|
|
17
17
|
creatorFacet: import("@endo/exo").Guarded<{
|
|
18
|
-
|
|
18
|
+
registerChain(chainName: string, chainInfo: Readonly<{
|
|
19
19
|
chainId: string;
|
|
20
20
|
connections?: Record<string, import("../cosmos-api.js").IBCConnectionInfo>;
|
|
21
21
|
icqEnabled?: boolean;
|
|
@@ -13,7 +13,7 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
13
13
|
}>>;
|
|
14
14
|
}>;
|
|
15
15
|
creatorFacet: import("@endo/exo").Guarded<{
|
|
16
|
-
|
|
16
|
+
registerChain(chainName: string, chainInfo: Readonly<{
|
|
17
17
|
chainId: string;
|
|
18
18
|
connections?: Record<string, import("../cosmos-api.js").IBCConnectionInfo>;
|
|
19
19
|
icqEnabled?: boolean;
|
|
@@ -37,7 +37,10 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
37
37
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
38
38
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
39
39
|
withdrawRewards(): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
40
|
-
undelegate(delegations:
|
|
40
|
+
undelegate(delegations: {
|
|
41
|
+
amount: import("../orchestration-api.js").AmountArg;
|
|
42
|
+
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
43
|
+
}[]): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
41
44
|
deactivate(): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
42
45
|
reactivate(): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
43
46
|
}>>;
|
|
@@ -48,7 +51,6 @@ export type StakeIcaTerms = {
|
|
|
48
51
|
chainId: string;
|
|
49
52
|
hostConnectionId: IBCConnectionID;
|
|
50
53
|
controllerConnectionId: IBCConnectionID;
|
|
51
|
-
bondDenom: string;
|
|
52
54
|
icqEnabled: boolean;
|
|
53
55
|
};
|
|
54
56
|
export type StakeIcaSF = typeof start;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AAEH;;;;;;cAAsD;AAuB/C,2BAVI,GAAG,CAAC,aAAa,CAAC,eAClB;IACV,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,uBAA2B,EAAE,uBAAuB,CAAC;IACrD,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;IAC3B,KAAS,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;GAqGjB;4BAtHY;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,gBAAoB,EAAE,eAAe,CAAC;IACtC,sBAA0B,EAAE,eAAe,CAAC;IAC5C,UAAc,EAAE,OAAO,CAAC;CACrB;yBAoHU,OAAO,KAAK;6BApJiB,cAAc;4BADhC,kBAAkB;6CAIwB,aAAa;kCAFjD,cAAc;6BAHnB,kBAAkB;mDAII,uBAAuB;qCAF5B,cAAc"}
|
|
@@ -29,7 +29,6 @@ export const meta = harden({
|
|
|
29
29
|
chainId: M.string(),
|
|
30
30
|
hostConnectionId: M.string(),
|
|
31
31
|
controllerConnectionId: M.string(),
|
|
32
|
-
bondDenom: M.string(),
|
|
33
32
|
icqEnabled: M.boolean(),
|
|
34
33
|
},
|
|
35
34
|
privateArgsShape: {
|
|
@@ -49,7 +48,6 @@ harden(privateArgsShape);
|
|
|
49
48
|
* chainId: string;
|
|
50
49
|
* hostConnectionId: IBCConnectionID;
|
|
51
50
|
* controllerConnectionId: IBCConnectionID;
|
|
52
|
-
* bondDenom: string;
|
|
53
51
|
* icqEnabled: boolean;
|
|
54
52
|
* }} StakeIcaTerms
|
|
55
53
|
*/
|
|
@@ -66,13 +64,8 @@ harden(privateArgsShape);
|
|
|
66
64
|
* @param {Baggage} baggage
|
|
67
65
|
*/
|
|
68
66
|
export const start = async (zcf, privateArgs, baggage) => {
|
|
69
|
-
const {
|
|
70
|
-
|
|
71
|
-
hostConnectionId,
|
|
72
|
-
controllerConnectionId,
|
|
73
|
-
bondDenom,
|
|
74
|
-
icqEnabled,
|
|
75
|
-
} = zcf.getTerms();
|
|
67
|
+
const { chainId, hostConnectionId, controllerConnectionId, icqEnabled } =
|
|
68
|
+
zcf.getTerms();
|
|
76
69
|
const {
|
|
77
70
|
agoricNames,
|
|
78
71
|
cosmosInterchainService: orchestration,
|
|
@@ -125,7 +118,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
125
118
|
chainAddress.value,
|
|
126
119
|
);
|
|
127
120
|
const holder = makeCosmosOrchestrationAccount(
|
|
128
|
-
{ chainAddress,
|
|
121
|
+
{ chainAddress, localAddress, remoteAddress },
|
|
129
122
|
{
|
|
130
123
|
account,
|
|
131
124
|
storageNode: accountNode,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: {
|
|
2
|
-
agoricNames: Remote<NameHub>;
|
|
3
|
-
localchain: Remote<LocalChain>;
|
|
4
|
-
orchestrationService: Remote<CosmosInterchainService>;
|
|
5
|
-
storageNode: Remote<StorageNode>;
|
|
1
|
+
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: OrchestrationPowers & {
|
|
6
2
|
marshaller: Marshaller;
|
|
7
|
-
timerService: Remote<TimerService>;
|
|
8
3
|
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
9
4
|
publicFacet: import("@endo/exo").Guarded<{
|
|
10
|
-
makeAccount(): Promise<Invitation<Vow<ContinuingOfferResult>, {
|
|
5
|
+
makeAccount(): Promise<Invitation<import("@agoric/vow").Vow<import("@agoric/smart-wallet/src/types.js").ContinuingOfferResult>, {
|
|
11
6
|
chainName: string;
|
|
12
7
|
}>>;
|
|
13
8
|
}>;
|
|
9
|
+
creatorFacet: import("@endo/exo").Guarded<{
|
|
10
|
+
registerChain(chainName: string, chainInfo: Readonly<{
|
|
11
|
+
chainId: string;
|
|
12
|
+
connections?: Record<string, import("../cosmos-api.js").IBCConnectionInfo>;
|
|
13
|
+
icqEnabled?: boolean;
|
|
14
|
+
stakingTokens?: Readonly<Array<{
|
|
15
|
+
denom: string;
|
|
16
|
+
}>>;
|
|
17
|
+
}>, connectionInfo: import("../cosmos-api.js").IBCConnectionInfo): Promise<void>;
|
|
18
|
+
registerAsset(denom: import("../orchestration-api.js").Denom, detail: import("../types.js").DenomDetail): Promise<void>;
|
|
19
|
+
}>;
|
|
14
20
|
}>;
|
|
15
|
-
import type {
|
|
16
|
-
import type { Remote } from '@agoric/internal';
|
|
17
|
-
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
18
|
-
import type { CosmosInterchainService } from '../exos/exo-interfaces.js';
|
|
19
|
-
import type { TimerService } from '@agoric/time';
|
|
20
|
-
import type { ContinuingOfferResult } from '@agoric/smart-wallet/src/types.js';
|
|
21
|
-
import type { Vow } from '@agoric/vow';
|
|
21
|
+
import type { OrchestrationPowers } from '../utils/start-helper.js';
|
|
22
22
|
//# sourceMappingURL=staking-combinations.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking-combinations.contract.d.ts","sourceRoot":"","sources":["staking-combinations.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staking-combinations.contract.d.ts","sourceRoot":"","sources":["staking-combinations.contract.js"],"names":[],"mappings":"AA+JA;gBA1HiB,UAAU;;;;;;;;;;;;;;;;;;GA0HsB;yCA3IS,0BAA0B"}
|
|
@@ -5,26 +5,22 @@
|
|
|
5
5
|
* The primary offer result is a power for invitation makers that can perform
|
|
6
6
|
* actions with an ICA account.
|
|
7
7
|
*/
|
|
8
|
+
import { makeSharedStateRecord } from '@agoric/async-flow';
|
|
8
9
|
import { AmountShape } from '@agoric/ertp';
|
|
9
10
|
import { M } from '@endo/patterns';
|
|
10
11
|
import { prepareCombineInvitationMakers } from '../exos/combine-invitation-makers.js';
|
|
11
|
-
import {
|
|
12
|
+
import { CosmosOrchestrationInvitationMakersI } from '../exos/cosmos-orchestration-account.js';
|
|
13
|
+
import { ChainAddressShape, DelegationShape } from '../typeGuards.js';
|
|
12
14
|
import { withOrchestration } from '../utils/start-helper.js';
|
|
13
15
|
import * as flows from './staking-combinations.flows.js';
|
|
16
|
+
import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js';
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* @import {GuestInterface} from '@agoric/async-flow';
|
|
17
|
-
* @import {Delegation} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
18
|
-
* @import {ContinuingOfferResult} from '@agoric/smart-wallet/src/types.js';
|
|
19
|
-
* @import {TimerService} from '@agoric/time';
|
|
20
|
-
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
21
|
-
* @import {NameHub} from '@agoric/vats';
|
|
22
|
-
* @import {Vow} from '@agoric/vow';
|
|
23
|
-
* @import {Remote} from '@agoric/internal';
|
|
24
20
|
* @import {Zone} from '@agoric/zone';
|
|
25
|
-
* @import {
|
|
26
|
-
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
21
|
+
* @import {OrchestrationTools, OrchestrationPowers} from '../utils/start-helper.js';
|
|
27
22
|
* @import {CosmosOrchestrationAccount} from '../exos/cosmos-orchestration-account.js';
|
|
23
|
+
* @import {AmountArg, ChainAddress, CosmosValidatorAddress} from '../types.js';
|
|
28
24
|
*/
|
|
29
25
|
|
|
30
26
|
const emptyOfferShape = harden({
|
|
@@ -38,26 +34,43 @@ const emptyOfferShape = harden({
|
|
|
38
34
|
* Orchestration contract to be wrapped by withOrchestration for Zoe.
|
|
39
35
|
*
|
|
40
36
|
* @param {ZCF} zcf
|
|
41
|
-
* @param {{
|
|
42
|
-
* agoricNames: Remote<NameHub>;
|
|
43
|
-
* localchain: Remote<LocalChain>;
|
|
44
|
-
* orchestrationService: Remote<CosmosInterchainService>;
|
|
45
|
-
* storageNode: Remote<StorageNode>;
|
|
37
|
+
* @param {OrchestrationPowers & {
|
|
46
38
|
* marshaller: Marshaller;
|
|
47
|
-
* timerService: Remote<TimerService>;
|
|
48
39
|
* }} privateArgs
|
|
49
40
|
* @param {Zone} zone
|
|
50
41
|
* @param {OrchestrationTools} tools
|
|
51
42
|
*/
|
|
52
|
-
const contract = async (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
43
|
+
const contract = async (
|
|
44
|
+
zcf,
|
|
45
|
+
privateArgs,
|
|
46
|
+
zone,
|
|
47
|
+
{ orchestrateAll, zoeTools, chainHub },
|
|
48
|
+
) => {
|
|
49
|
+
const contractState = makeSharedStateRecord(
|
|
50
|
+
/**
|
|
51
|
+
* @type {{
|
|
52
|
+
* account: (OrchestrationAccount<any> & LocalAccountMethods) | undefined;
|
|
53
|
+
* }}
|
|
54
|
+
*/ {
|
|
55
|
+
localAccount: undefined,
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const StakingCombinationsInvitationMakersI = M.interface(
|
|
60
|
+
'StakingCombinationsInvitationMakersI',
|
|
61
|
+
{
|
|
62
|
+
DepositAndDelegate: M.call().returns(M.promise()),
|
|
63
|
+
UndelegateAndTransfer: M.call(
|
|
64
|
+
M.arrayOf(DelegationShape),
|
|
65
|
+
ChainAddressShape,
|
|
66
|
+
).returns(M.promise()),
|
|
67
|
+
},
|
|
68
|
+
);
|
|
69
|
+
|
|
57
70
|
/** @type {any} XXX async membrane */
|
|
58
71
|
const makeExtraInvitationMaker = zone.exoClass(
|
|
59
|
-
'
|
|
60
|
-
|
|
72
|
+
'StakingCombinationsInvitationMakers',
|
|
73
|
+
StakingCombinationsInvitationMakersI,
|
|
61
74
|
/** @param {GuestInterface<CosmosOrchestrationAccount>} account */
|
|
62
75
|
account => {
|
|
63
76
|
return { account };
|
|
@@ -67,27 +80,39 @@ const contract = async (zcf, privateArgs, zone, { orchestrateAll }) => {
|
|
|
67
80
|
const { account } = this.state;
|
|
68
81
|
|
|
69
82
|
return zcf.makeInvitation(
|
|
70
|
-
|
|
83
|
+
/**
|
|
84
|
+
* @param {ZCFSeat} seat
|
|
85
|
+
* @param {{ validator: CosmosValidatorAddress }} offerArgs
|
|
86
|
+
*/
|
|
87
|
+
(seat, { validator }) =>
|
|
71
88
|
// eslint-disable-next-line no-use-before-define -- defined by orchestrateAll, necessarily after this
|
|
72
|
-
orchFns.depositAndDelegate(account, seat,
|
|
89
|
+
orchFns.depositAndDelegate(account, seat, validator),
|
|
73
90
|
'Deposit and delegate',
|
|
74
91
|
undefined,
|
|
75
92
|
{
|
|
76
93
|
give: {
|
|
77
94
|
Stake: AmountShape,
|
|
78
95
|
},
|
|
96
|
+
want: {},
|
|
97
|
+
// user cannot exit their seat; contract must exit it.
|
|
98
|
+
exit: { waived: M.null() },
|
|
79
99
|
},
|
|
80
100
|
);
|
|
81
101
|
},
|
|
82
102
|
/**
|
|
83
|
-
* @param {
|
|
103
|
+
* @param {{ amount: AmountArg; validator: CosmosValidatorAddress }[]} delegations
|
|
104
|
+
* @param {ChainAddress} destination
|
|
84
105
|
*/
|
|
85
|
-
UndelegateAndTransfer(delegations) {
|
|
106
|
+
UndelegateAndTransfer(delegations, destination) {
|
|
86
107
|
const { account } = this.state;
|
|
87
108
|
|
|
88
109
|
return zcf.makeInvitation(
|
|
89
|
-
|
|
90
|
-
|
|
110
|
+
() =>
|
|
111
|
+
// eslint-disable-next-line no-use-before-define -- defined by orchestrateAll, necessarily after this
|
|
112
|
+
orchFns.undelegateAndTransfer(account, {
|
|
113
|
+
delegations,
|
|
114
|
+
destination,
|
|
115
|
+
}),
|
|
91
116
|
'Undelegate and transfer',
|
|
92
117
|
undefined,
|
|
93
118
|
emptyOfferShape,
|
|
@@ -99,17 +124,25 @@ const contract = async (zcf, privateArgs, zone, { orchestrateAll }) => {
|
|
|
99
124
|
/** @type {any} XXX async membrane */
|
|
100
125
|
const makeCombineInvitationMakers = prepareCombineInvitationMakers(
|
|
101
126
|
zone,
|
|
102
|
-
|
|
103
|
-
|
|
127
|
+
CosmosOrchestrationInvitationMakersI,
|
|
128
|
+
StakingCombinationsInvitationMakersI,
|
|
104
129
|
);
|
|
105
130
|
|
|
106
131
|
const orchFns = orchestrateAll(flows, {
|
|
132
|
+
contractState,
|
|
107
133
|
makeCombineInvitationMakers,
|
|
108
134
|
makeExtraInvitationMaker,
|
|
109
135
|
flows,
|
|
110
136
|
zcf,
|
|
137
|
+
zoeTools,
|
|
111
138
|
});
|
|
112
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Provide invitations to contract deployer for registering assets and chains
|
|
142
|
+
* in the local ChainHub for this contract.
|
|
143
|
+
*/
|
|
144
|
+
const creatorFacet = prepareChainHubAdmin(zone, chainHub);
|
|
145
|
+
|
|
113
146
|
const publicFacet = zone.exo('publicFacet', undefined, {
|
|
114
147
|
makeAccount() {
|
|
115
148
|
return zcf.makeInvitation(
|
|
@@ -121,7 +154,7 @@ const contract = async (zcf, privateArgs, zone, { orchestrateAll }) => {
|
|
|
121
154
|
},
|
|
122
155
|
});
|
|
123
156
|
|
|
124
|
-
return harden({ publicFacet });
|
|
157
|
+
return harden({ publicFacet, creatorFacet });
|
|
125
158
|
};
|
|
126
159
|
|
|
127
160
|
export const start = withOrchestration(contract);
|
|
@@ -4,15 +4,29 @@ export function makeAccount(orch: Orchestrator, ctx: {
|
|
|
4
4
|
}, _seat: ZCFSeat, { chainName }: {
|
|
5
5
|
chainName: string;
|
|
6
6
|
}): Promise<ContinuingOfferResult>;
|
|
7
|
-
export function depositAndDelegate(orch: Orchestrator,
|
|
8
|
-
|
|
7
|
+
export function depositAndDelegate(orch: Orchestrator, { contractState, zoeTools }: {
|
|
8
|
+
contractState: {
|
|
9
|
+
localAccount?: OrchestrationAccountI & LocalAccountMethods;
|
|
10
|
+
};
|
|
11
|
+
zoeTools: GuestInterface<ZoeTools>;
|
|
12
|
+
}, account: GuestInterface<CosmosOrchestrationAccount>, seat: ZCFSeat, validator: CosmosValidatorAddress): Promise<void>;
|
|
13
|
+
export function undelegateAndTransfer(orch: Orchestrator, ctx: object, account: GuestInterface<CosmosOrchestrationAccount>, { delegations, destination }: {
|
|
14
|
+
delegations: {
|
|
15
|
+
amount: AmountArg;
|
|
16
|
+
validator: CosmosValidatorAddress;
|
|
17
|
+
}[];
|
|
18
|
+
destination: ChainAddress;
|
|
19
|
+
}): Promise<void>;
|
|
9
20
|
import type { Orchestrator } from '../types.js';
|
|
10
21
|
import type { MakeCombineInvitationMakers } from '../exos/combine-invitation-makers.js';
|
|
11
22
|
import type { InvitationMakers } from '@agoric/smart-wallet/src/types.js';
|
|
12
23
|
import type { ContinuingOfferResult } from '@agoric/smart-wallet/src/types.js';
|
|
13
|
-
import type {
|
|
24
|
+
import type { OrchestrationAccountI } from '../types.js';
|
|
25
|
+
import type { LocalAccountMethods } from '../types.js';
|
|
26
|
+
import type { ZoeTools } from '../utils/zoe-tools.js';
|
|
14
27
|
import type { GuestInterface } from '@agoric/async-flow';
|
|
28
|
+
import type { CosmosOrchestrationAccount } from '../exos/cosmos-orchestration-account.js';
|
|
15
29
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
16
30
|
import type { AmountArg } from '../types.js';
|
|
17
|
-
import type {
|
|
31
|
+
import type { ChainAddress } from '../types.js';
|
|
18
32
|
//# sourceMappingURL=staking-combinations.flows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking-combinations.flows.d.ts","sourceRoot":"","sources":["staking-combinations.flows.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staking-combinations.flows.d.ts","sourceRoot":"","sources":["staking-combinations.flows.js"],"names":[],"mappings":"AA2BO,kCATI,YAAY,OACZ;IACV,2BAA+B,EAAE,2BAA2B,CAAC;IAC7D,wBAA4B,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,gBAAgB,CAAC;CAC9D,SACO,OAAO,iBACP;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAkB1C;AAcM,yCATI,YAAY,+BAEpB;IAA4E,aAAa,EAAjF;QAAE,YAAY,CAAC,EAAE,qBAAqB,GAAG,mBAAmB,CAAA;KAAE;IAChC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;CAChC,WAAQ,eAAe,0BAA0B,CAAC,QAC1C,OAAO,aACP,sBAAsB,GACpB,OAAO,CAAC,IAAI,CAAC,CA6BzB;AAcM,4CATI,YAAY,OACZ,MAAM,WACN,eAAe,0BAA0B,CAAC,gCAC1C;IACV,WAAe,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,SAAS,EAAE,sBAAsB,CAAA;KAAE,EAAE,CAAC;IAC5E,WAAe,EAAE,YAAY,CAAC;CAC3B,GACS,OAAO,CAAC,IAAI,CAAC,CAYzB;kCA1G8I,aAAa;iDAE9G,sCAAsC;sCAD1B,mCAAmC;2CAAnC,mCAAmC;2CADkD,aAAa;yCAAb,aAAa;8BAIjI,uBAAuB;oCALjB,oBAAoB;gDAIR,yCAAyC;4CAHyD,aAAa;+BAAb,aAAa;kCAAb,aAAa"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {GuestInterface} from '@agoric/async-flow';
|
|
3
|
-
* @import {Orchestrator, OrchestrationFlow,
|
|
3
|
+
* @import {Orchestrator, OrchestrationFlow, AmountArg, CosmosValidatorAddress, ChainAddress, LocalAccountMethods, OrchestrationAccountI} from '../types.js'
|
|
4
4
|
* @import {ContinuingOfferResult, InvitationMakers} from '@agoric/smart-wallet/src/types.js';
|
|
5
5
|
* @import {MakeCombineInvitationMakers} from '../exos/combine-invitation-makers.js';
|
|
6
|
-
* @import {Delegation} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
7
6
|
* @import {CosmosOrchestrationAccount} from '../exos/cosmos-orchestration-account.js';
|
|
7
|
+
* @import {ZoeTools} from '../utils/zoe-tools.js';
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import { mustMatch } from '@endo/patterns';
|
|
11
|
+
import { makeError } from '@endo/errors';
|
|
12
|
+
import { makeTracer } from '@agoric/internal';
|
|
13
|
+
import { ChainAddressShape } from '../typeGuards.js';
|
|
14
|
+
|
|
15
|
+
const trace = makeTracer('StakingCombinationsFlows');
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
18
|
* @satisfies {OrchestrationFlow}
|
|
12
19
|
* @param {Orchestrator} orch
|
|
@@ -41,24 +48,40 @@ harden(makeAccount);
|
|
|
41
48
|
* @satisfies {OrchestrationFlow}
|
|
42
49
|
* @param {Orchestrator} orch
|
|
43
50
|
* @param {object} ctx
|
|
51
|
+
* @param {{ localAccount?: OrchestrationAccountI & LocalAccountMethods }} ctx.contractState
|
|
52
|
+
* @param {GuestInterface<ZoeTools>} ctx.zoeTools
|
|
44
53
|
* @param {GuestInterface<CosmosOrchestrationAccount>} account
|
|
45
54
|
* @param {ZCFSeat} seat
|
|
46
55
|
* @param {CosmosValidatorAddress} validator
|
|
47
|
-
* @
|
|
48
|
-
* @returns {Promise<string>}
|
|
56
|
+
* @returns {Promise<void>}
|
|
49
57
|
*/
|
|
50
58
|
export const depositAndDelegate = async (
|
|
51
59
|
orch,
|
|
52
|
-
|
|
60
|
+
{ contractState, zoeTools },
|
|
53
61
|
account,
|
|
54
62
|
seat,
|
|
55
63
|
validator,
|
|
56
|
-
amount,
|
|
57
64
|
) => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
await null;
|
|
66
|
+
trace('depositAndDelegate', account, seat, validator);
|
|
67
|
+
mustMatch(validator, ChainAddressShape);
|
|
68
|
+
if (!contractState.localAccount) {
|
|
69
|
+
const agoricChain = await orch.getChain('agoric');
|
|
70
|
+
contractState.localAccount = await agoricChain.makeAccount();
|
|
71
|
+
}
|
|
72
|
+
const { give } = seat.getProposal();
|
|
73
|
+
await zoeTools.localTransfer(seat, contractState.localAccount, give);
|
|
74
|
+
|
|
75
|
+
const address = account.getAddress();
|
|
76
|
+
try {
|
|
77
|
+
await contractState.localAccount.transfer(give.Stake, address);
|
|
78
|
+
} catch (cause) {
|
|
79
|
+
// TODO, put funds back on user seat and exit
|
|
80
|
+
// https://github.com/Agoric/agoric-sdk/issues/9925
|
|
81
|
+
throw makeError('ibc transfer failed', undefined, { cause });
|
|
82
|
+
}
|
|
83
|
+
seat.exit();
|
|
84
|
+
await account.delegate(validator, give.Stake);
|
|
62
85
|
};
|
|
63
86
|
harden(depositAndDelegate);
|
|
64
87
|
|
|
@@ -67,17 +90,21 @@ harden(depositAndDelegate);
|
|
|
67
90
|
* @param {Orchestrator} orch
|
|
68
91
|
* @param {object} ctx
|
|
69
92
|
* @param {GuestInterface<CosmosOrchestrationAccount>} account
|
|
70
|
-
* @param {
|
|
71
|
-
*
|
|
93
|
+
* @param {{
|
|
94
|
+
* delegations: { amount: AmountArg; validator: CosmosValidatorAddress }[];
|
|
95
|
+
* destination: ChainAddress;
|
|
96
|
+
* }} offerArgs
|
|
97
|
+
* @returns {Promise<void>}
|
|
72
98
|
*/
|
|
73
99
|
export const undelegateAndTransfer = async (
|
|
74
100
|
orch,
|
|
75
101
|
ctx,
|
|
76
102
|
account,
|
|
77
|
-
delegations,
|
|
103
|
+
{ delegations, destination },
|
|
78
104
|
) => {
|
|
79
105
|
await account.undelegate(delegations);
|
|
80
|
-
|
|
81
|
-
|
|
106
|
+
for (const { amount } of delegations) {
|
|
107
|
+
await account.transfer(amount, destination);
|
|
108
|
+
}
|
|
82
109
|
};
|
|
83
110
|
harden(undelegateAndTransfer);
|
package/src/exos/README.md
CHANGED
|
@@ -6,7 +6,7 @@ export function prepareChainHubAdmin(zone: Zone, chainHub: ChainHub): import("@e
|
|
|
6
6
|
* @param {CosmosChainInfo} chainInfo
|
|
7
7
|
* @param {IBCConnectionInfo} connectionInfo - from Agoric chain
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
registerChain(chainName: string, chainInfo: CosmosChainInfo, connectionInfo: IBCConnectionInfo): Promise<void>;
|
|
10
10
|
/**
|
|
11
11
|
* Register an asset that may be held on a chain other than the issuing
|
|
12
12
|
* chain.
|
|
@@ -25,7 +25,7 @@ export type ChainHubAdmin = ReturnType<(zone: Zone, chainHub: ChainHub) => impor
|
|
|
25
25
|
* @param {CosmosChainInfo} chainInfo
|
|
26
26
|
* @param {IBCConnectionInfo} connectionInfo - from Agoric chain
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
registerChain(chainName: string, chainInfo: CosmosChainInfo, connectionInfo: IBCConnectionInfo): Promise<void>;
|
|
29
29
|
/**
|
|
30
30
|
* Register an asset that may be held on a chain other than the issuing
|
|
31
31
|
* chain.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"AAgCO,2CAHI,IAAI,YACJ,QAAQ;IAeb;;;;;;OAMG;
|
|
1
|
+
{"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"AAgCO,2CAHI,IAAI,YACJ,QAAQ;IAeb;;;;;;OAMG;6BAHQ,MAAM,aACN,eAAe,kBACf,iBAAiB;IAe5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAU3B;4BAEa,UAAU,QAtDb,IAAI,YACJ,QAAQ;IAeb;;;;;;OAMG;6BAHQ,MAAM,aACN,eAAe,kBACf,iBAAiB;IAe5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAYkB;0BA3EvB,cAAc;8BAEG,gBAAgB;qCADI,uBAAuB;uCAAvB,uBAAuB;2BAAvB,uBAAuB;iCAC3C,gBAAgB"}
|
|
@@ -35,7 +35,7 @@ export const prepareChainHubAdmin = (zone, chainHub) => {
|
|
|
35
35
|
const makeCreatorFacet = zone.exo(
|
|
36
36
|
'ChainHub Admin',
|
|
37
37
|
M.interface('ChainHub Admin', {
|
|
38
|
-
|
|
38
|
+
registerChain: M.callWhen(
|
|
39
39
|
M.string(),
|
|
40
40
|
CosmosChainInfoShape,
|
|
41
41
|
ConnectionInfoShape,
|
|
@@ -50,7 +50,7 @@ export const prepareChainHubAdmin = (zone, chainHub) => {
|
|
|
50
50
|
* @param {CosmosChainInfo} chainInfo
|
|
51
51
|
* @param {IBCConnectionInfo} connectionInfo - from Agoric chain
|
|
52
52
|
*/
|
|
53
|
-
async
|
|
53
|
+
async registerChain(chainName, chainInfo, connectionInfo) {
|
|
54
54
|
// when() because chainHub methods return vows. If this were inside
|
|
55
55
|
// orchestrate() the membrane would wrap/unwrap automatically.
|
|
56
56
|
const agoricChainInfo = await heapVowE.when(
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
* localAddress: LocalIbcAddress;
|
|
12
12
|
* remoteAddress: RemoteIbcAddress;
|
|
13
13
|
* icqConnection: ICQConnection | undefined;
|
|
14
|
-
* bondDenom: string;
|
|
15
14
|
* timer: Remote<TimerService>;
|
|
16
15
|
* }} State
|
|
17
16
|
* Internal to the IcaAccountHolder exo
|
|
@@ -41,7 +40,7 @@ export const IcaAccountHolderI: import("@endo/patterns").InterfaceGuard<{
|
|
|
41
40
|
asContinuingOffer: import("@endo/patterns").MethodGuard;
|
|
42
41
|
getPublicTopics: import("@endo/patterns").MethodGuard;
|
|
43
42
|
}>;
|
|
44
|
-
export const
|
|
43
|
+
export const CosmosOrchestrationInvitationMakersI: import("@endo/patterns").InterfaceGuard<{
|
|
45
44
|
Delegate: import("@endo/patterns").MethodGuard;
|
|
46
45
|
Redelegate: import("@endo/patterns").MethodGuard;
|
|
47
46
|
WithdrawReward: import("@endo/patterns").MethodGuard;
|
|
@@ -61,7 +60,6 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
61
60
|
zcf: ZCF;
|
|
62
61
|
}): (args_0: {
|
|
63
62
|
chainAddress: ChainAddress;
|
|
64
|
-
bondDenom: string;
|
|
65
63
|
localAddress: LocalIbcAddress;
|
|
66
64
|
remoteAddress: RemoteIbcAddress;
|
|
67
65
|
}, io: {
|
|
@@ -144,8 +142,16 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
144
142
|
Redelegate(srcValidator: CosmosValidatorAddress, dstValidator: CosmosValidatorAddress, amount: AmountArg): Promise<Invitation<Vow<void>, undefined>>;
|
|
145
143
|
/** @param {CosmosValidatorAddress} validator */
|
|
146
144
|
WithdrawReward(validator: CosmosValidatorAddress): Promise<Invitation<Vow<DenomAmount[]>, undefined>>;
|
|
147
|
-
/**
|
|
148
|
-
|
|
145
|
+
/**
|
|
146
|
+
* @param {{
|
|
147
|
+
* amount: AmountArg;
|
|
148
|
+
* validator: CosmosValidatorAddress;
|
|
149
|
+
* }[]} delegations
|
|
150
|
+
*/
|
|
151
|
+
Undelegate(delegations: {
|
|
152
|
+
amount: AmountArg;
|
|
153
|
+
validator: CosmosValidatorAddress;
|
|
154
|
+
}[]): Promise<Invitation<Vow<void>, undefined>>;
|
|
149
155
|
DeactivateAccount(): Promise<Invitation<Vow<void>, undefined>>;
|
|
150
156
|
ReactivateAccount(): Promise<Invitation<Vow<void>, undefined>>;
|
|
151
157
|
Send(): Promise<Invitation<Vow<void>, {
|
|
@@ -196,7 +202,10 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
196
202
|
/** @type {HostOf<StakingAccountActions['withdrawRewards']>} */
|
|
197
203
|
withdrawRewards(): Vow<DenomAmount[] extends import("@endo/pass-style").Passable ? DenomAmount[] : import("@agoric/async-flow").HostInterface<DenomAmount[]>>;
|
|
198
204
|
/** @type {HostOf<StakingAccountActions['undelegate']>} */
|
|
199
|
-
undelegate(delegations:
|
|
205
|
+
undelegate(delegations: {
|
|
206
|
+
amount: AmountArg;
|
|
207
|
+
validator: CosmosValidatorAddress;
|
|
208
|
+
}[]): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
200
209
|
/** @type {HostOf<IcaAccount['deactivate']>} */
|
|
201
210
|
deactivate(): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
202
211
|
/** @type {HostOf<IcaAccount['reactivate']>} */
|
|
@@ -223,7 +232,6 @@ export type State = {
|
|
|
223
232
|
localAddress: LocalIbcAddress;
|
|
224
233
|
remoteAddress: RemoteIbcAddress;
|
|
225
234
|
icqConnection: ICQConnection | undefined;
|
|
226
|
-
bondDenom: string;
|
|
227
235
|
timer: Remote<TimerService>;
|
|
228
236
|
};
|
|
229
237
|
export type CosmosOrchestrationAccountStorageState = {
|
|
@@ -252,6 +260,5 @@ import type { Vow } from '@agoric/vow';
|
|
|
252
260
|
import type { IBCConnectionInfo } from '../types.js';
|
|
253
261
|
import type { IBCMsgTransferOptions } from '../types.js';
|
|
254
262
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
255
|
-
import type { Delegation } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
256
263
|
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
257
264
|
//# sourceMappingURL=cosmos-orchestration-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAiEA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAiEA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AAEH,mCAAmC;AACnC;;;;;;;;;;;;;;;;;GAeG;AAOH;;;;;;;;;;;GAkBE;AAYK,2DARI,IAAI,gGAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACgB,eAAe,EAAvC,eAAe;IACc,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACI,GAAG,EAAf,GAAG;CACb;kBA8Dc,YAAY;kBACZ,eAAe;mBACf,gBAAgB;;aAEhB,UAAU;iBACV,OAAO,WAAW,CAAC;mBACnB,aAAa,GAAG,SAAS;WACzB,OAAO,YAAY,CAAC;;;QA+B3B,wDAAwD;;;QAWxD;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QAOjB;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAYpC;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAsBpC;;WAEG;4BADQ,MAAM;;IAgBnB;;;OAGG;;QAED,uDAAuD;4BAA3C,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;QAO5C,6BAA6B;4BAAjB,MAAM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,YAAY,qCAAqC,CAAC,CAAC;IACjE,OAAW,EAAE,UAAU,CAAC;IACxB,YAAgB,EAAE,YAAY,CAAC;IAC/B,YAAgB,EAAE,eAAe,CAAC;IAClC,aAAiB,EAAE,gBAAgB,CAAC;IACpC,aAAiB,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7C,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;CAC7B;qDAKS;IACZ,YAAgB,EAAE,eAAe,CAAC;IAClC,aAAiB,EAAE,gBAAgB,CAAC;CACjC;4CAiqBS,UAAU,CACtB,UAAc,CAAC,OAAO,oCAAoC,CAAC,CACxD;yCA8BU,6BAA6B,CAAC,QAAQ,CAAC;0BAnuB9B,cAAc;8BARuK,aAAa;qCAC1K,6CAA6C;kCAK7D,cAAc;4BAFpB,kBAAkB;8BAGX,aAAa;kCAP+J,aAAa;qCAYrK,iCAAiC;sCAAjC,iCAAiC;gCAZuH,aAAa;mCAAb,aAAa;+BAAb,aAAa;0BAElM,kDAAkD;mCAOzC,+CAA+C;8BACpD,sBAAsB;iCAV2J,aAAa;yBAOzL,aAAa;uCAP+J,aAAa;2CAAb,aAAa;4CAAb,aAAa;iCAC1K,6CAA6C"}
|
|
@@ -77,7 +77,6 @@ const { Vow$ } = NetworkShape; // TODO #9611
|
|
|
77
77
|
* localAddress: LocalIbcAddress;
|
|
78
78
|
* remoteAddress: RemoteIbcAddress;
|
|
79
79
|
* icqConnection: ICQConnection | undefined;
|
|
80
|
-
* bondDenom: string;
|
|
81
80
|
* timer: Remote<TimerService>;
|
|
82
81
|
* }} State
|
|
83
82
|
* Internal to the IcaAccountHolder exo
|
|
@@ -113,7 +112,7 @@ const PUBLIC_TOPICS = {
|
|
|
113
112
|
account: ['Staking Account holder status', M.any()],
|
|
114
113
|
};
|
|
115
114
|
|
|
116
|
-
export const
|
|
115
|
+
export const CosmosOrchestrationInvitationMakersI = M.interface(
|
|
117
116
|
'invitationMakers',
|
|
118
117
|
{
|
|
119
118
|
Delegate: M.call(ChainAddressShape, AmountArgShape).returns(M.promise()),
|
|
@@ -132,7 +131,7 @@ export const CosmosOrchestrationInvitationMakersInterface = M.interface(
|
|
|
132
131
|
Transfer: M.call().returns(M.promise()),
|
|
133
132
|
},
|
|
134
133
|
);
|
|
135
|
-
harden(
|
|
134
|
+
harden(CosmosOrchestrationInvitationMakersI);
|
|
136
135
|
|
|
137
136
|
/**
|
|
138
137
|
* @param {Zone} zone
|
|
@@ -200,12 +199,11 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
200
199
|
.returns(Vow$(M.record())),
|
|
201
200
|
}),
|
|
202
201
|
holder: IcaAccountHolderI,
|
|
203
|
-
invitationMakers:
|
|
202
|
+
invitationMakers: CosmosOrchestrationInvitationMakersI,
|
|
204
203
|
},
|
|
205
204
|
/**
|
|
206
205
|
* @param {object} info
|
|
207
206
|
* @param {ChainAddress} info.chainAddress
|
|
208
|
-
* @param {string} info.bondDenom e.g. 'uatom'
|
|
209
207
|
* @param {LocalIbcAddress} info.localAddress
|
|
210
208
|
* @param {RemoteIbcAddress} info.remoteAddress
|
|
211
209
|
* @param {object} io
|
|
@@ -215,7 +213,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
215
213
|
* @param {Remote<TimerService>} io.timer
|
|
216
214
|
* @returns {State}
|
|
217
215
|
*/
|
|
218
|
-
({ chainAddress,
|
|
216
|
+
({ chainAddress, localAddress, remoteAddress }, io) => {
|
|
219
217
|
const { storageNode } = io;
|
|
220
218
|
// must be the fully synchronous maker because the kit is held in durable state
|
|
221
219
|
const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]);
|
|
@@ -233,7 +231,6 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
233
231
|
const { account, icqConnection, timer } = io;
|
|
234
232
|
return {
|
|
235
233
|
account,
|
|
236
|
-
bondDenom,
|
|
237
234
|
chainAddress,
|
|
238
235
|
icqConnection,
|
|
239
236
|
localAddress,
|
|
@@ -407,16 +404,19 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
407
404
|
/** @param {CosmosValidatorAddress} validator */
|
|
408
405
|
WithdrawReward(validator) {
|
|
409
406
|
trace('WithdrawReward', validator);
|
|
410
|
-
|
|
411
407
|
return zcf.makeInvitation(seat => {
|
|
412
408
|
seat.exit();
|
|
413
409
|
return watch(this.facets.holder.withdrawReward(validator));
|
|
414
410
|
}, 'WithdrawReward');
|
|
415
411
|
},
|
|
416
|
-
/**
|
|
412
|
+
/**
|
|
413
|
+
* @param {{
|
|
414
|
+
* amount: AmountArg;
|
|
415
|
+
* validator: CosmosValidatorAddress;
|
|
416
|
+
* }[]} delegations
|
|
417
|
+
*/
|
|
417
418
|
Undelegate(delegations) {
|
|
418
419
|
trace('Undelegate', delegations);
|
|
419
|
-
|
|
420
420
|
return zcf.makeInvitation(seat => {
|
|
421
421
|
seat.exit();
|
|
422
422
|
return watch(this.facets.holder.undelegate(delegations));
|
|
@@ -537,10 +537,9 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
537
537
|
return asVow(() => {
|
|
538
538
|
trace('delegate', validator, amount);
|
|
539
539
|
const { helper } = this.facets;
|
|
540
|
-
const { chainAddress
|
|
540
|
+
const { chainAddress } = this.state;
|
|
541
541
|
|
|
542
542
|
const amountAsCoin = helper.amountToCoin(amount);
|
|
543
|
-
assert.equal(amountAsCoin.denom, bondDenom);
|
|
544
543
|
|
|
545
544
|
const results = E(helper.owned()).executeEncodedTx([
|
|
546
545
|
Any.toJSON(
|
|
@@ -725,16 +724,16 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
725
724
|
return asVow(() => {
|
|
726
725
|
trace('undelegate', delegations);
|
|
727
726
|
const { helper } = this.facets;
|
|
728
|
-
const { chainAddress
|
|
727
|
+
const { chainAddress } = this.state;
|
|
729
728
|
|
|
730
729
|
const undelegateV = watch(
|
|
731
730
|
E(helper.owned()).executeEncodedTx(
|
|
732
|
-
delegations.map(
|
|
731
|
+
delegations.map(({ validator, amount }) =>
|
|
733
732
|
Any.toJSON(
|
|
734
733
|
MsgUndelegate.toProtoMsg({
|
|
735
734
|
delegatorAddress: chainAddress.value,
|
|
736
|
-
validatorAddress:
|
|
737
|
-
amount:
|
|
735
|
+
validatorAddress: validator.value,
|
|
736
|
+
amount: coerceCoin(chainHub, amount),
|
|
738
737
|
}),
|
|
739
738
|
),
|
|
740
739
|
),
|
|
@@ -43,7 +43,10 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
|
|
|
43
43
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
44
44
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
45
45
|
withdrawRewards(): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
46
|
-
undelegate(delegations:
|
|
46
|
+
undelegate(delegations: {
|
|
47
|
+
amount: import("../orchestration-api.js").AmountArg;
|
|
48
|
+
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
49
|
+
}[]): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
47
50
|
deactivate(): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
48
51
|
reactivate(): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
49
52
|
}>>;
|
|
@@ -75,7 +78,10 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
|
|
|
75
78
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
76
79
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
77
80
|
withdrawRewards(): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
78
|
-
undelegate(delegations:
|
|
81
|
+
undelegate(delegations: {
|
|
82
|
+
amount: import("../orchestration-api.js").AmountArg;
|
|
83
|
+
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
84
|
+
}[]): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
79
85
|
deactivate(): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
80
86
|
reactivate(): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
81
87
|
}>>;
|
|
@@ -109,7 +115,10 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
|
|
|
109
115
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
110
116
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
111
117
|
withdrawRewards(): Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
112
|
-
undelegate(delegations:
|
|
118
|
+
undelegate(delegations: {
|
|
119
|
+
amount: import("../orchestration-api.js").AmountArg;
|
|
120
|
+
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
121
|
+
}[]): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
113
122
|
deactivate(): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
114
123
|
reactivate(): Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
115
124
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"AAqQO,+CAHI,IAAI,UACJ,uBAAuB;;;;;;;;;;;;;;;;QA7I1B,4CAA4C;;QAK5C,2CAA2C;;QA0B3C;;;;WAIG;;;;QAuBH;;WAEG;8CADQ,CAAC,UAAU,EAAE,aAAa,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;QAmBlD;;;;WAIG;mCAHQ,aAAa,QACb,SAAS,YAAY,CAAC,EAAE,GACtB,IAAI,SAAS,aAAa,CAAC,EAAE,CAAC;;;QAU3C;;;WAGG;iEAFQ,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,CAAC,WACjD,UAAU;;;;;;;;;;;;;;;;;;;;;;;QAWrB;;;;;;;;WAQG;+BAPQ,OAAO,WAAW,CAAC,0DACnB;YACV,OAAW,EAAE,UAAU,CAAC;YACxB,YAAgB,EAAE,YAAY,CAAC;YAC/B,YAAgB,EAAE,eAAe,CAAC;YAClC,aAAiB,EAAE,gBAAgB,CAAC;SACjC;;;;;;;;;;;;;;;;;;;;;;cAmCX;sCA1OY;IACZ,8BAAkC,EAAE,UAAU,CAC9C,wCAA8C,CACzC,CAAC;IACN,aAAiB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACnD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;IAChC,QAAY,EAAE,QAAQ,CAAC;CACpB;qCAIS;IACZ,eAAmB,EAAE,eAAe,CAAC;IACrC,cAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAiB,EAAE,aAAa,GAAG,SAAS,CAAC;CAC1C;oCA6NU,UAAU,CAAC,OAAO,wBAAwB,CAAC;gCAC3C,UAAU,CAAC,qBAAqB,CAAC;0BA7PxB,mBAAmB;uCAS2D,aAAa;yBAJlF,aAAa;kCAHC,+CAA+C;8BADlE,sBAAsB;mCACH,+CAA+C;gCAOQ,aAAa;mCAAb,aAAa;kCAAb,aAAa;qCAH9D,iCAAiC;sCAAjC,iCAAiC;4BAF5D,kBAAkB;uDAIS,mCAAmC;6CAD7C,qBAAqB;kCAJhC,cAAc;8BAEb,aAAa;qCAIwD,aAAa"}
|
|
@@ -233,14 +233,11 @@ const prepareRemoteChainFacadeKit = (
|
|
|
233
233
|
childNode,
|
|
234
234
|
{ account, chainAddress, localAddress, remoteAddress },
|
|
235
235
|
) {
|
|
236
|
-
const {
|
|
237
|
-
const stakingDenom = remoteChainInfo.stakingTokens?.[0]?.denom;
|
|
238
|
-
if (!stakingDenom) throw Fail`chain info lacks staking denom`;
|
|
236
|
+
const { icqConnection } = this.state;
|
|
239
237
|
|
|
240
238
|
return makeCosmosOrchestrationAccount(
|
|
241
239
|
{
|
|
242
240
|
chainAddress,
|
|
243
|
-
bondDenom: stakingDenom,
|
|
244
241
|
localAddress,
|
|
245
242
|
remoteAddress,
|
|
246
243
|
},
|
|
@@ -23,7 +23,10 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
|
|
|
23
23
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
24
24
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
25
25
|
withdrawRewards(): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
26
|
-
undelegate(delegations:
|
|
26
|
+
undelegate(delegations: {
|
|
27
|
+
amount: import("../orchestration-api.js").AmountArg;
|
|
28
|
+
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
29
|
+
}[]): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
27
30
|
deactivate(): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
28
31
|
reactivate(): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
29
32
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAyBO,0PAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B
|
|
1
|
+
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAyBO,0PAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA0D,CACjD,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAuDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;mCApG4C,+BAA+B"}
|
|
@@ -61,7 +61,6 @@ export const startStakeAtom = async ({
|
|
|
61
61
|
chainId: cosmoshub.chainId,
|
|
62
62
|
hostConnectionId: connectionInfo.counterparty.connection_id,
|
|
63
63
|
controllerConnectionId: connectionInfo.id,
|
|
64
|
-
bondDenom: cosmoshub.stakingTokens[0].denom,
|
|
65
64
|
icqEnabled: cosmoshub.icqEnabled,
|
|
66
65
|
},
|
|
67
66
|
privateArgs: await deeplyFulfilledObject(
|
|
@@ -23,7 +23,10 @@ export function startStakeOsmo({ consume: { agoricNames, board, chainStorage, ch
|
|
|
23
23
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
24
24
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
25
25
|
withdrawRewards(): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[] extends import("@endo/pass-style").Passable ? import("../orchestration-api.js").DenomAmount[] : import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").DenomAmount[]>>;
|
|
26
|
-
undelegate(delegations:
|
|
26
|
+
undelegate(delegations: {
|
|
27
|
+
amount: import("../orchestration-api.js").AmountArg;
|
|
28
|
+
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
29
|
+
}[]): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
27
30
|
deactivate(): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
28
31
|
reactivate(): import("@agoric/vow").Vow<void extends import("@endo/pass-style").Passable ? void : import("@agoric/async-flow").HostInterface<void>>;
|
|
29
32
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeOsmo.d.ts","sourceRoot":"","sources":["start-stakeOsmo.js"],"names":[],"mappings":"AA8BO,0PAfI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B
|
|
1
|
+
{"version":3,"file":"start-stakeOsmo.d.ts","sourceRoot":"","sources":["start-stakeOsmo.js"],"names":[],"mappings":"AA8BO,0PAfI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA0D,CACjD,CAAC;SACH,CAAC;KACH,CAAC;IACN,QAAY,EAAE;QACd,OAAa,EAAE;YACf,SAAiB,EAAE,GAAG,CAAC;SAChB,CAAC;KACH,CAAC;CACH,iBAuDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN"}
|
|
@@ -66,7 +66,6 @@ export const startStakeOsmo = async ({
|
|
|
66
66
|
chainId: osmosis.chainId,
|
|
67
67
|
hostConnectionId: connectionInfo.counterparty.connection_id,
|
|
68
68
|
controllerConnectionId: connectionInfo.id,
|
|
69
|
-
bondDenom: osmosis.stakingTokens[0].denom,
|
|
70
69
|
icqEnabled: osmosis.icqEnabled,
|
|
71
70
|
},
|
|
72
71
|
privateArgs: await deeplyFulfilledObject(
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {TypedPattern} from '@agoric/internal';
|
|
3
|
-
* @import {ChainAddress, CosmosAssetInfo, Chain, ChainInfo, CosmosChainInfo, DenomAmount, DenomDetail, DenomInfo, AmountArg} from './types.js';
|
|
3
|
+
* @import {ChainAddress, CosmosAssetInfo, Chain, ChainInfo, CosmosChainInfo, DenomAmount, DenomDetail, DenomInfo, AmountArg, CosmosValidatorAddress} from './types.js';
|
|
4
4
|
* @import {Any as Proto3Msg} from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
5
5
|
* @import {Delegation} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
6
6
|
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
@@ -19,8 +19,6 @@ export const OutboundConnectionHandlerI: import("@endo/patterns").InterfaceGuard
|
|
|
19
19
|
export const ChainAddressShape: TypedPattern<ChainAddress>;
|
|
20
20
|
/** @type {TypedPattern<Proto3Msg>} */
|
|
21
21
|
export const Proto3Shape: TypedPattern<Proto3Msg>;
|
|
22
|
-
/** @type {TypedPattern<Delegation>} */
|
|
23
|
-
export const DelegationShape: TypedPattern<Delegation>;
|
|
24
22
|
/** @internal */
|
|
25
23
|
export const IBCTransferOptionsShape: import("@endo/patterns").Matcher;
|
|
26
24
|
/** @internal */
|
|
@@ -43,8 +41,20 @@ export const DenomShape: import("@endo/patterns").Matcher;
|
|
|
43
41
|
export const DenomInfoShape: TypedPattern<DenomInfo<any, any>>;
|
|
44
42
|
/** @type {TypedPattern<DenomAmount>} */
|
|
45
43
|
export const DenomAmountShape: TypedPattern<DenomAmount>;
|
|
44
|
+
/** @type {TypedPattern<Amount<'nat'>>} */
|
|
45
|
+
export const AnyNatAmountShape: TypedPattern<Amount<"nat">>;
|
|
46
46
|
/** @type {TypedPattern<AmountArg>} */
|
|
47
47
|
export const AmountArgShape: TypedPattern<AmountArg>;
|
|
48
|
+
/**
|
|
49
|
+
* @type {TypedPattern<{
|
|
50
|
+
* validator: CosmosValidatorAddress;
|
|
51
|
+
* amount: AmountArg;
|
|
52
|
+
* }>}
|
|
53
|
+
*/
|
|
54
|
+
export const DelegationShape: TypedPattern<{
|
|
55
|
+
validator: CosmosValidatorAddress;
|
|
56
|
+
amount: AmountArg;
|
|
57
|
+
}>;
|
|
48
58
|
/** Approximately @see RequestQuery */
|
|
49
59
|
export const ICQMsgShape: import("@endo/patterns").Matcher;
|
|
50
60
|
/** @type {TypedPattern<TypedJson>} */
|
|
@@ -66,12 +76,12 @@ export const TxBodyOptsShape: import("@endo/patterns").Matcher;
|
|
|
66
76
|
import type { ChainAddress } from './types.js';
|
|
67
77
|
import type { TypedPattern } from '@agoric/internal';
|
|
68
78
|
import type { Any as Proto3Msg } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
69
|
-
import type { Delegation } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
70
79
|
import type { CosmosAssetInfo } from './types.js';
|
|
71
80
|
import type { CosmosChainInfo } from './types.js';
|
|
72
81
|
import type { ChainInfo } from './types.js';
|
|
73
82
|
import type { DenomInfo } from './types.js';
|
|
74
83
|
import type { DenomAmount } from './types.js';
|
|
75
84
|
import type { AmountArg } from './types.js';
|
|
85
|
+
import type { CosmosValidatorAddress } from './types.js';
|
|
76
86
|
import type { TypedJson } from '@agoric/cosmic-proto';
|
|
77
87
|
//# sourceMappingURL=typeGuards.d.ts.map
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH;;;;GAIG;AACH;;;GAQE;AAEF,yCAAyC;AACzC,gCADW,aAAa,YAAY,CAAC,CAKnC;AAEF,sCAAsC;AACtC,0BADW,aAAa,SAAS,CAAC,CAIhC;AAEF,gBAAgB;AAChB,uEAUE;AAEF,gBAAgB;AAChB,iEAA4C;AAC5C,gBAAgB;AAChB,mEAQG;AACH,gBAAgB;AAChB,oEAA+C;AAC/C,gBAAgB;AAChB,sEAYG;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CASrC;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CAWtC;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CAG/B;AACH,sEAAuE;AACvE,0DAAqC;AAErC,gDAAgD;AAChD,6BADW,aAAa,UAAU,GAAG,EAAE,GAAG,CAAC,CAAC,CAM1C;AAEF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CACqC;AAEzE,0CAA0C;AAC1C,gCADW,aAAa,MAAM,CAAC,KAAK,CAAC,CAAC,CAInC;AAEH,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CACsC;AAExE;;;;;GAKG;AACH,8BALU,aAAa;IACtB,SAAa,EAAE,sBAAsB,CAAC;IACtC,MAAU,EAAE,SAAS,CAAC;CACnB,CAAC,CAKF;AAEH,sCAAsC;AACtC,2DAGE;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CACmC;;;;;;;;;AAcrE;;;;GAIG;AACH,+DAQE;kCA7KyJ,YAAY;kCADxI,kBAAkB;sCAEd,6CAA6C;qCAD2E,YAAY;qCAAZ,YAAY;+BAAZ,YAAY;+BAAZ,YAAY;iCAAZ,YAAY;+BAAZ,YAAY;4CAAZ,YAAY;+BAI3I,sBAAsB"}
|
package/src/typeGuards.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AmountShape } from '@agoric/ertp';
|
|
2
1
|
import { VowShape } from '@agoric/vow';
|
|
3
2
|
import { M } from '@endo/patterns';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @import {TypedPattern} from '@agoric/internal';
|
|
7
|
-
* @import {ChainAddress, CosmosAssetInfo, Chain, ChainInfo, CosmosChainInfo, DenomAmount, DenomDetail, DenomInfo, AmountArg} from './types.js';
|
|
6
|
+
* @import {ChainAddress, CosmosAssetInfo, Chain, ChainInfo, CosmosChainInfo, DenomAmount, DenomDetail, DenomInfo, AmountArg, CosmosValidatorAddress} from './types.js';
|
|
8
7
|
* @import {Any as Proto3Msg} from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
9
8
|
* @import {Delegation} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
10
9
|
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
@@ -39,13 +38,6 @@ export const Proto3Shape = {
|
|
|
39
38
|
value: M.string(),
|
|
40
39
|
};
|
|
41
40
|
|
|
42
|
-
// FIXME missing `delegatorAddress` from the type
|
|
43
|
-
/** @type {TypedPattern<Delegation>} */
|
|
44
|
-
export const DelegationShape = harden({
|
|
45
|
-
validatorAddress: M.string(),
|
|
46
|
-
shares: M.string(), // TODO: bigint?
|
|
47
|
-
});
|
|
48
|
-
|
|
49
41
|
/** @internal */
|
|
50
42
|
export const IBCTransferOptionsShape = M.splitRecord(
|
|
51
43
|
{},
|
|
@@ -130,8 +122,25 @@ export const DenomInfoShape = {
|
|
|
130
122
|
/** @type {TypedPattern<DenomAmount>} */
|
|
131
123
|
export const DenomAmountShape = { denom: DenomShape, value: M.bigint() };
|
|
132
124
|
|
|
125
|
+
/** @type {TypedPattern<Amount<'nat'>>} */
|
|
126
|
+
export const AnyNatAmountShape = harden({
|
|
127
|
+
brand: M.remotable('Brand'),
|
|
128
|
+
value: M.nat(),
|
|
129
|
+
});
|
|
130
|
+
|
|
133
131
|
/** @type {TypedPattern<AmountArg>} */
|
|
134
|
-
export const AmountArgShape = M.or(
|
|
132
|
+
export const AmountArgShape = M.or(AnyNatAmountShape, DenomAmountShape);
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @type {TypedPattern<{
|
|
136
|
+
* validator: CosmosValidatorAddress;
|
|
137
|
+
* amount: AmountArg;
|
|
138
|
+
* }>}
|
|
139
|
+
*/
|
|
140
|
+
export const DelegationShape = harden({
|
|
141
|
+
validator: ChainAddressShape,
|
|
142
|
+
amount: AmountArgShape,
|
|
143
|
+
});
|
|
135
144
|
|
|
136
145
|
/** Approximately @see RequestQuery */
|
|
137
146
|
export const ICQMsgShape = M.splitRecord(
|