@agoric/orchestration 0.1.1-dev-71db129.0 → 0.1.1-dev-4687f0d.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 +19 -16
- package/src/chain-info.d.ts +1776 -150
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +50 -99
- package/src/cosmos-api.d.ts +9 -18
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +20 -20
- package/src/examples/{stakeAtom.contract.d.ts → stakeIca.contract.d.ts} +3 -3
- package/src/examples/stakeIca.contract.d.ts.map +1 -0
- package/src/examples/{stakeAtom.contract.js → stakeIca.contract.js} +2 -3
- package/src/exos/local-chain-account-kit.d.ts +1781 -3
- package/src/exos/local-chain-account-kit.d.ts.map +1 -1
- package/src/exos/local-chain-account-kit.js +0 -1
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +15 -18
- package/src/fetched-chain-info.d.ts +3073 -0
- package/src/fetched-chain-info.d.ts.map +1 -0
- package/src/fetched-chain-info.js +1752 -0
- package/src/orchestration-api.d.ts +1 -3
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +1 -3
- package/src/proposals/orchestration-proposal.d.ts +39 -37
- package/src/proposals/orchestration-proposal.d.ts.map +1 -1
- package/src/proposals/orchestration-proposal.js +74 -1
- package/src/proposals/start-stakeAtom.d.ts +5 -7
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.js +39 -33
- package/src/proposals/start-stakeBld.d.ts +1 -2
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeBld.js +1 -7
- package/src/service.d.ts +7 -6
- package/src/service.d.ts.map +1 -1
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +2 -9
- package/src/utils/chainHub.d.ts +1792 -4
- package/src/utils/chainHub.d.ts.map +1 -1
- package/src/utils/chainHub.js +21 -8
- package/src/vat-orchestration.d.ts +4 -4
- package/src/examples/stakeAtom.contract.d.ts.map +0 -1
package/src/chain-info.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-info.d.ts","sourceRoot":"","sources":["chain-info.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chain-info.d.ts","sourceRoot":"","sources":["chain-info.js"],"names":[],"mappings":"AAoEO,yDAHI,IAAI,CAAC,OAAO,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,OACpD,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,iBAMzC;;0BAVa,OAAO,WAAW;qCAzDiB,YAAY;kCAAZ,YAAY;AAA7D,iEAAiE;AAEjE,0DAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDE"}
|
package/src/chain-info.js
CHANGED
|
@@ -1,122 +1,73 @@
|
|
|
1
|
-
// UNTIL https://github.com/Agoric/agoric-sdk/issues/8879
|
|
2
|
-
|
|
3
|
-
/** @file temporary static lookup of chain info */
|
|
4
|
-
|
|
5
1
|
import { registerChain } from './utils/chainHub.js';
|
|
6
2
|
|
|
3
|
+
// Refresh with scripts/refresh-chain-info.ts
|
|
4
|
+
import fetchedChainInfo from './fetched-chain-info.js';
|
|
5
|
+
|
|
7
6
|
/** @import {CosmosChainInfo, EthChainInfo} from './types.js'; */
|
|
8
7
|
|
|
9
8
|
/** @typedef {CosmosChainInfo | EthChainInfo} ChainInfo */
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
client_id: '07-tendermint-2',
|
|
26
|
-
connection_id: 'connection-1',
|
|
27
|
-
prefix: {
|
|
28
|
-
key_prefix: '',
|
|
29
|
-
},
|
|
10
|
+
const knownChains = /** @satisfies {Record<string, ChainInfo>} */ (
|
|
11
|
+
harden({
|
|
12
|
+
...fetchedChainInfo,
|
|
13
|
+
agoric: {
|
|
14
|
+
chainId: 'agoriclocal',
|
|
15
|
+
connections: {
|
|
16
|
+
'cosmoshub-4': {
|
|
17
|
+
id: 'connection-1',
|
|
18
|
+
client_id: '07-tendermint-3',
|
|
19
|
+
counterparty: {
|
|
20
|
+
client_id: '07-tendermint-2',
|
|
21
|
+
connection_id: 'connection-1',
|
|
22
|
+
prefix: {
|
|
23
|
+
key_prefix: '',
|
|
30
24
|
},
|
|
25
|
+
},
|
|
26
|
+
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
27
|
+
transferChannel: {
|
|
28
|
+
portId: 'transfer',
|
|
29
|
+
channelId: 'channel-1',
|
|
30
|
+
counterPartyChannelId: 'channel-1',
|
|
31
|
+
counterPartyPortId: 'transfer',
|
|
32
|
+
ordering: 1 /* Order.ORDER_UNORDERED */,
|
|
31
33
|
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
32
|
-
|
|
33
|
-
portId: 'transfer',
|
|
34
|
-
channelId: 'channel-1',
|
|
35
|
-
counterPartyChannelId: 'channel-1',
|
|
36
|
-
counterPartyPortId: 'transfer',
|
|
37
|
-
ordering: 1 /* Order.ORDER_UNORDERED */,
|
|
38
|
-
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
39
|
-
version: 'ics20-1',
|
|
40
|
-
},
|
|
41
|
-
versions: [{ identifier: '', features: ['', ''] }],
|
|
42
|
-
delay_period: 0n,
|
|
34
|
+
version: 'ics20-1',
|
|
43
35
|
},
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
},
|
|
37
|
+
osmosislocal: {
|
|
38
|
+
id: 'connection-0',
|
|
39
|
+
client_id: '07-tendermint-2',
|
|
40
|
+
counterparty: {
|
|
46
41
|
client_id: '07-tendermint-2',
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
prefix: {
|
|
51
|
-
key_prefix: '',
|
|
52
|
-
},
|
|
42
|
+
connection_id: 'connection-1',
|
|
43
|
+
prefix: {
|
|
44
|
+
key_prefix: '',
|
|
53
45
|
},
|
|
46
|
+
},
|
|
47
|
+
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
48
|
+
transferChannel: {
|
|
49
|
+
portId: 'transfer',
|
|
50
|
+
channelId: 'channel-0',
|
|
51
|
+
counterPartyChannelId: 'channel-1',
|
|
52
|
+
counterPartyPortId: 'transfer',
|
|
53
|
+
ordering: 1 /* Order.ORDER_UNORDERED */,
|
|
54
54
|
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
55
|
-
|
|
56
|
-
portId: 'transfer',
|
|
57
|
-
channelId: 'channel-0',
|
|
58
|
-
counterPartyChannelId: 'channel-1',
|
|
59
|
-
counterPartyPortId: 'transfer',
|
|
60
|
-
ordering: 1 /* Order.ORDER_UNORDERED */,
|
|
61
|
-
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
62
|
-
version: 'ics20-1',
|
|
63
|
-
},
|
|
64
|
-
versions: [{ identifier: '', features: ['', ''] }],
|
|
65
|
-
delay_period: 0n,
|
|
55
|
+
version: 'ics20-1',
|
|
66
56
|
},
|
|
67
57
|
},
|
|
68
|
-
ibcHooksEnabled: true,
|
|
69
|
-
icaEnabled: true,
|
|
70
|
-
icqEnabled: true,
|
|
71
|
-
pfmEnabled: true,
|
|
72
|
-
},
|
|
73
|
-
// https://github.com/cosmos/chain-registry/blob/master/stride/chain.json
|
|
74
|
-
stride: {
|
|
75
|
-
chainId: 'stride-1',
|
|
76
|
-
connections: {},
|
|
77
|
-
icaEnabled: true,
|
|
78
|
-
icqEnabled: true,
|
|
79
|
-
pfmEnabled: true,
|
|
80
|
-
ibcHooksEnabled: true,
|
|
81
|
-
stakingTokens: [{ denom: 'ustride' }],
|
|
82
58
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
pfmEnabled: true,
|
|
89
|
-
ibcHooksEnabled: true,
|
|
90
|
-
stakingTokens: [{ denom: 'uatom' }],
|
|
91
|
-
},
|
|
92
|
-
celestia: {
|
|
93
|
-
chainId: 'celestia',
|
|
94
|
-
connections: {},
|
|
95
|
-
icaEnabled: true,
|
|
96
|
-
icqEnabled: true,
|
|
97
|
-
pfmEnabled: true,
|
|
98
|
-
ibcHooksEnabled: true,
|
|
99
|
-
stakingTokens: [{ denom: 'utia' }],
|
|
100
|
-
},
|
|
101
|
-
osmosis: {
|
|
102
|
-
chainId: 'osmosislocal',
|
|
103
|
-
connections: {},
|
|
104
|
-
icaEnabled: true,
|
|
105
|
-
icqEnabled: true,
|
|
106
|
-
pfmEnabled: true,
|
|
107
|
-
ibcHooksEnabled: true,
|
|
108
|
-
stakingTokens: [{ denom: 'uosmo' }],
|
|
109
|
-
},
|
|
110
|
-
})
|
|
111
|
-
);
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
/** @typedef {typeof knownChains} KnownChains */
|
|
112
64
|
|
|
113
65
|
/**
|
|
114
66
|
* @param {ERef<import('@agoric/vats').NameHubKit['nameAdmin']>} agoricNamesAdmin
|
|
115
67
|
* @param {(...messages: string[]) => void} log
|
|
116
68
|
*/
|
|
117
69
|
export const registerChainNamespace = async (agoricNamesAdmin, log) => {
|
|
118
|
-
for await (const [name, info] of Object.entries(
|
|
119
|
-
|
|
120
|
-
await registerChain(agoricNamesAdmin, name, info);
|
|
70
|
+
for await (const [name, info] of Object.entries(knownChains)) {
|
|
71
|
+
await registerChain(agoricNamesAdmin, name, info, log);
|
|
121
72
|
}
|
|
122
73
|
};
|
package/src/cosmos-api.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { AnyJson } from '@agoric/cosmic-proto';
|
|
2
2
|
import type { Delegation, Redelegation, UnbondingDelegation } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
3
3
|
import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
4
|
+
import { MsgTransfer } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
|
|
5
|
+
import type { State as IBCChannelState, Order } from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
|
|
6
|
+
import type { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js';
|
|
4
7
|
import type { Brand, Purse } from '@agoric/ertp/src/types.js';
|
|
5
8
|
import type { Port } from '@agoric/network';
|
|
6
9
|
import type { LocalIbcAddress, RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
7
|
-
import { MsgTransfer } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
|
|
8
|
-
import type { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js';
|
|
9
|
-
import type { Order, State as IBCChannelState } from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
|
|
10
|
-
import { IBCChannelID, IBCConnectionID } from '@agoric/vats';
|
|
11
10
|
import type { AmountArg, ChainAddress, DenomAmount } from './types.js';
|
|
12
11
|
/** A helper type for type extensions. */
|
|
13
12
|
export type TypeUrl = string;
|
|
@@ -22,26 +21,21 @@ export type CosmosValidatorAddress = ChainAddress & {
|
|
|
22
21
|
};
|
|
23
22
|
/** Represents an IBC Connection between two chains, which can contain multiple Channels. */
|
|
24
23
|
export type IBCConnectionInfo = {
|
|
25
|
-
id:
|
|
24
|
+
id: string;
|
|
26
25
|
client_id: string;
|
|
27
26
|
state: IBCConnectionState;
|
|
28
27
|
counterparty: {
|
|
29
28
|
client_id: string;
|
|
30
|
-
connection_id:
|
|
29
|
+
connection_id: string;
|
|
31
30
|
prefix: {
|
|
32
31
|
key_prefix: string;
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
|
-
versions: {
|
|
36
|
-
identifier: string;
|
|
37
|
-
features: string[];
|
|
38
|
-
}[];
|
|
39
|
-
delay_period: bigint;
|
|
40
34
|
transferChannel: {
|
|
41
35
|
portId: string;
|
|
42
|
-
channelId:
|
|
36
|
+
channelId: string;
|
|
43
37
|
counterPartyPortId: string;
|
|
44
|
-
counterPartyChannelId:
|
|
38
|
+
counterPartyChannelId: string;
|
|
45
39
|
ordering: Order;
|
|
46
40
|
state: IBCChannelState;
|
|
47
41
|
version: string;
|
|
@@ -52,11 +46,8 @@ export type IBCConnectionInfo = {
|
|
|
52
46
|
*/
|
|
53
47
|
export type CosmosChainInfo = {
|
|
54
48
|
chainId: string;
|
|
55
|
-
connections
|
|
56
|
-
|
|
57
|
-
icqEnabled: boolean;
|
|
58
|
-
pfmEnabled: boolean;
|
|
59
|
-
ibcHooksEnabled: boolean;
|
|
49
|
+
connections?: Record<string, IBCConnectionInfo>;
|
|
50
|
+
icqEnabled?: boolean;
|
|
60
51
|
/**
|
|
61
52
|
* cf https://github.com/cosmos/chain-registry/blob/master/chain.schema.json#L117
|
|
62
53
|
*/
|
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,
|
|
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;AAC7G,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACj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AI,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
|
@@ -5,20 +5,19 @@ import type {
|
|
|
5
5
|
UnbondingDelegation,
|
|
6
6
|
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
7
7
|
import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
8
|
-
import
|
|
8
|
+
import { MsgTransfer } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
|
|
9
|
+
import type {
|
|
10
|
+
State as IBCChannelState,
|
|
11
|
+
Order,
|
|
12
|
+
} from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
|
|
13
|
+
import type { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js';
|
|
14
|
+
import type { Brand, Purse } from '@agoric/ertp/src/types.js';
|
|
9
15
|
import type { Port } from '@agoric/network';
|
|
16
|
+
import { IBCChannelID } from '@agoric/vats';
|
|
10
17
|
import type {
|
|
11
18
|
LocalIbcAddress,
|
|
12
19
|
RemoteIbcAddress,
|
|
13
20
|
} from '@agoric/vats/tools/ibc-utils.js';
|
|
14
|
-
import { MsgTransfer } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
|
|
15
|
-
import type { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js';
|
|
16
|
-
import type {
|
|
17
|
-
Order,
|
|
18
|
-
State as IBCChannelState,
|
|
19
|
-
} from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
|
|
20
|
-
import { IBCChannelID, IBCConnectionID } from '@agoric/vats';
|
|
21
|
-
import { MapStore } from '@agoric/store';
|
|
22
21
|
import type { AmountArg, ChainAddress, DenomAmount } from './types.js';
|
|
23
22
|
|
|
24
23
|
/** A helper type for type extensions. */
|
|
@@ -39,23 +38,25 @@ export type CosmosValidatorAddress = ChainAddress & {
|
|
|
39
38
|
|
|
40
39
|
/** Represents an IBC Connection between two chains, which can contain multiple Channels. */
|
|
41
40
|
export type IBCConnectionInfo = {
|
|
42
|
-
|
|
41
|
+
// XXX really IBCConnectionID but our chain info fetcher doesn't know
|
|
42
|
+
id: string; // e.g. connection-0
|
|
43
43
|
client_id: string; // '07-tendermint-0'
|
|
44
44
|
state: IBCConnectionState;
|
|
45
45
|
counterparty: {
|
|
46
46
|
client_id: string;
|
|
47
|
-
|
|
47
|
+
// XXX really IBCConnectionID but our chain info fetcher doesn't know
|
|
48
|
+
connection_id: string;
|
|
48
49
|
prefix: {
|
|
49
50
|
key_prefix: string;
|
|
50
51
|
};
|
|
51
52
|
};
|
|
52
|
-
versions: { identifier: string; features: string[] }[];
|
|
53
|
-
delay_period: bigint;
|
|
54
53
|
transferChannel: {
|
|
55
54
|
portId: string;
|
|
56
|
-
|
|
55
|
+
// XXX really IBCChannelID but our chain info fetcher doesn't know
|
|
56
|
+
channelId: string;
|
|
57
57
|
counterPartyPortId: string;
|
|
58
|
-
|
|
58
|
+
// XXX really IBCChannelID but our chain info fetcher doesn't know
|
|
59
|
+
counterPartyChannelId: string;
|
|
59
60
|
ordering: Order;
|
|
60
61
|
state: IBCChannelState;
|
|
61
62
|
version: string; // e.eg. 'ics20-1'
|
|
@@ -67,11 +68,10 @@ export type IBCConnectionInfo = {
|
|
|
67
68
|
*/
|
|
68
69
|
export type CosmosChainInfo = {
|
|
69
70
|
chainId: string;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
ibcHooksEnabled: boolean;
|
|
71
|
+
|
|
72
|
+
connections?: Record<string, IBCConnectionInfo>; // chainId or wellKnownName
|
|
73
|
+
// UNTIL https://github.com/Agoric/agoric-sdk/issues/9326
|
|
74
|
+
icqEnabled?: boolean;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* cf https://github.com/cosmos/chain-registry/blob/master/chain.schema.json#L117
|
|
@@ -12,7 +12,7 @@ export namespace meta {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export namespace privateArgsShape { }
|
|
15
|
-
export function start(zcf: ZCF<
|
|
15
|
+
export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
16
16
|
orchestration: import("@endo/exo").Guarded<{
|
|
17
17
|
makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
|
|
18
18
|
provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
|
|
@@ -85,7 +85,7 @@ export function start(zcf: ZCF<StakeAtomTerms>, privateArgs: {
|
|
|
85
85
|
}, undefined>>;
|
|
86
86
|
}>;
|
|
87
87
|
}>;
|
|
88
|
-
export type
|
|
88
|
+
export type StakeIcaTerms = {
|
|
89
89
|
hostConnectionId: `connection-${number}`;
|
|
90
90
|
controllerConnectionId: `connection-${number}`;
|
|
91
91
|
bondDenom: string;
|
|
@@ -95,4 +95,4 @@ import { StorageNodeShape } from '@agoric/internal';
|
|
|
95
95
|
import { TimerServiceShape } from '@agoric/time';
|
|
96
96
|
import type { TimerService } from '@agoric/time';
|
|
97
97
|
import type { Baggage } from '@agoric/vat-data';
|
|
98
|
-
//# sourceMappingURL=
|
|
98
|
+
//# sourceMappingURL=stakeIca.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAoDO,2BATI,GAAG,CAAC,aAAa,CAAC;;;;;;;;;iBAGX,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;mGA0E8tF,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAHrwF;;;;eAhFe,MAAM;;0BAkFR,OAAO,KAAK;iCAtHmB,kBAAkB;kCAC7B,cAAc;kCAYjB,cAAc;6BAFnB,kBAAkB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** @file Example contract that uses orchestration */
|
|
2
|
-
// TODO rename to "stakeIca" or something else that conveys is parameterized nature
|
|
3
2
|
|
|
4
3
|
import { makeTracer, StorageNodeShape } from '@agoric/internal';
|
|
5
4
|
import { TimerServiceShape } from '@agoric/time';
|
|
@@ -38,11 +37,11 @@ export const privateArgsShape = meta.privateArgsShape;
|
|
|
38
37
|
* hostConnectionId: IBCConnectionID;
|
|
39
38
|
* controllerConnectionId: IBCConnectionID;
|
|
40
39
|
* bondDenom: string;
|
|
41
|
-
* }}
|
|
40
|
+
* }} StakeIcaTerms
|
|
42
41
|
*/
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
|
-
* @param {ZCF<
|
|
44
|
+
* @param {ZCF<StakeIcaTerms>} zcf
|
|
46
45
|
* @param {{
|
|
47
46
|
* orchestration: OrchestrationService;
|
|
48
47
|
* storageNode: StorageNode;
|