@agoric/orchestration 0.1.1-dev-95c7239.0 → 0.1.1-dev-4491bd1.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/chain-info.d.ts +101 -27
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +79 -9
- package/src/cosmos-api.d.ts +0 -5
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +0 -5
- package/src/examples/stakeBld.contract.d.ts +23 -1
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/examples/stakeBld.contract.js +11 -5
- package/src/examples/swapExample.contract.d.ts +3 -1
- package/src/examples/swapExample.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.js +15 -7
- package/src/examples/unbondExample.contract.d.ts +2 -0
- package/src/examples/unbondExample.contract.d.ts.map +1 -1
- package/src/examples/unbondExample.contract.js +13 -5
- package/src/exos/local-chain-account-kit.d.ts +23 -7
- package/src/exos/local-chain-account-kit.d.ts.map +1 -1
- package/src/exos/local-chain-account-kit.js +1 -4
- package/src/facade.d.ts +10 -4
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +24 -9
- package/src/proposals/start-stakeBld.d.ts +6 -3
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeBld.js +12 -1
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +0 -2
- package/src/utils/mockChainInfo.d.ts +0 -3
- package/src/utils/mockChainInfo.d.ts.map +0 -1
- package/src/utils/mockChainInfo.js +0 -78
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-4491bd1.0+4491bd1",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agoric/assert": "0.6.1-dev-
|
|
35
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
36
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
37
|
-
"@agoric/internal": "0.3.3-dev-
|
|
38
|
-
"@agoric/network": "0.1.1-dev-
|
|
39
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
40
|
-
"@agoric/store": "0.9.3-dev-
|
|
41
|
-
"@agoric/time": "0.3.3-dev-
|
|
42
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
43
|
-
"@agoric/vats": "0.15.2-dev-
|
|
44
|
-
"@agoric/vow": "0.1.1-dev-
|
|
45
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
46
|
-
"@agoric/zone": "0.2.3-dev-
|
|
34
|
+
"@agoric/assert": "0.6.1-dev-4491bd1.0+4491bd1",
|
|
35
|
+
"@agoric/cosmic-proto": "0.4.1-dev-4491bd1.0+4491bd1",
|
|
36
|
+
"@agoric/ertp": "0.16.3-dev-4491bd1.0+4491bd1",
|
|
37
|
+
"@agoric/internal": "0.3.3-dev-4491bd1.0+4491bd1",
|
|
38
|
+
"@agoric/network": "0.1.1-dev-4491bd1.0+4491bd1",
|
|
39
|
+
"@agoric/notifier": "0.6.3-dev-4491bd1.0+4491bd1",
|
|
40
|
+
"@agoric/store": "0.9.3-dev-4491bd1.0+4491bd1",
|
|
41
|
+
"@agoric/time": "0.3.3-dev-4491bd1.0+4491bd1",
|
|
42
|
+
"@agoric/vat-data": "0.5.3-dev-4491bd1.0+4491bd1",
|
|
43
|
+
"@agoric/vats": "0.15.2-dev-4491bd1.0+4491bd1",
|
|
44
|
+
"@agoric/vow": "0.1.1-dev-4491bd1.0+4491bd1",
|
|
45
|
+
"@agoric/zoe": "0.26.3-dev-4491bd1.0+4491bd1",
|
|
46
|
+
"@agoric/zone": "0.2.3-dev-4491bd1.0+4491bd1",
|
|
47
47
|
"@endo/base64": "^1.0.5",
|
|
48
48
|
"@endo/far": "^1.1.2",
|
|
49
49
|
"@endo/marshal": "^1.5.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"typeCoverage": {
|
|
85
85
|
"atLeast": 97.1
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "4491bd134d194ba5a965a6b0ff9f394563581162"
|
|
88
88
|
}
|
package/src/chain-info.d.ts
CHANGED
|
@@ -1,18 +1,86 @@
|
|
|
1
1
|
export namespace wellKnownChainInfo {
|
|
2
|
-
namespace
|
|
2
|
+
namespace agoric {
|
|
3
3
|
let chainId: string;
|
|
4
|
-
|
|
4
|
+
namespace connections {
|
|
5
|
+
namespace cosmoslocal {
|
|
6
|
+
let id: "connection-1";
|
|
7
|
+
let client_id: string;
|
|
8
|
+
namespace counterparty {
|
|
9
|
+
let client_id_1: string;
|
|
10
|
+
export { client_id_1 as client_id };
|
|
11
|
+
export let connection_id: "connection-1";
|
|
12
|
+
export namespace prefix {
|
|
13
|
+
let key_prefix: string;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
let state: 3;
|
|
17
|
+
namespace transferChannel {
|
|
18
|
+
export let portId: string;
|
|
19
|
+
export let channelId: "channel-1";
|
|
20
|
+
export let counterPartyChannelId: "channel-1";
|
|
21
|
+
export let counterPartyPortId: string;
|
|
22
|
+
export let ordering: 1;
|
|
23
|
+
let state_1: 3;
|
|
24
|
+
export { state_1 as state };
|
|
25
|
+
export let version: string;
|
|
26
|
+
}
|
|
27
|
+
let versions: {
|
|
28
|
+
identifier: string;
|
|
29
|
+
features: string[];
|
|
30
|
+
}[];
|
|
31
|
+
let delay_period: bigint;
|
|
32
|
+
}
|
|
33
|
+
namespace osmosislocal {
|
|
34
|
+
let id_1: "connection-0";
|
|
35
|
+
export { id_1 as id };
|
|
36
|
+
let client_id_2: string;
|
|
37
|
+
export { client_id_2 as client_id };
|
|
38
|
+
export namespace counterparty_1 {
|
|
39
|
+
let client_id_3: string;
|
|
40
|
+
export { client_id_3 as client_id };
|
|
41
|
+
let connection_id_1: "connection-1";
|
|
42
|
+
export { connection_id_1 as connection_id };
|
|
43
|
+
export namespace prefix_1 {
|
|
44
|
+
let key_prefix_1: string;
|
|
45
|
+
export { key_prefix_1 as key_prefix };
|
|
46
|
+
}
|
|
47
|
+
export { prefix_1 as prefix };
|
|
48
|
+
}
|
|
49
|
+
export { counterparty_1 as counterparty };
|
|
50
|
+
let state_2: 3;
|
|
51
|
+
export { state_2 as state };
|
|
52
|
+
export namespace transferChannel_1 {
|
|
53
|
+
let portId_1: string;
|
|
54
|
+
export { portId_1 as portId };
|
|
55
|
+
let channelId_1: "channel-0";
|
|
56
|
+
export { channelId_1 as channelId };
|
|
57
|
+
let counterPartyChannelId_1: "channel-1";
|
|
58
|
+
export { counterPartyChannelId_1 as counterPartyChannelId };
|
|
59
|
+
let counterPartyPortId_1: string;
|
|
60
|
+
export { counterPartyPortId_1 as counterPartyPortId };
|
|
61
|
+
let ordering_1: 1;
|
|
62
|
+
export { ordering_1 as ordering };
|
|
63
|
+
let state_3: 3;
|
|
64
|
+
export { state_3 as state };
|
|
65
|
+
let version_1: string;
|
|
66
|
+
export { version_1 as version };
|
|
67
|
+
}
|
|
68
|
+
export { transferChannel_1 as transferChannel };
|
|
69
|
+
let versions_1: {
|
|
70
|
+
identifier: string;
|
|
71
|
+
features: string[];
|
|
72
|
+
}[];
|
|
73
|
+
export { versions_1 as versions };
|
|
74
|
+
let delay_period_1: bigint;
|
|
75
|
+
export { delay_period_1 as delay_period };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
let ibcHooksEnabled: true;
|
|
5
79
|
let icaEnabled: true;
|
|
6
80
|
let icqEnabled: true;
|
|
7
81
|
let pfmEnabled: true;
|
|
8
|
-
let ibcHooksEnabled: true;
|
|
9
|
-
let allowedMessages: never[];
|
|
10
|
-
let allowedQueries: never[];
|
|
11
|
-
let stakingTokens: {
|
|
12
|
-
denom: string;
|
|
13
|
-
}[];
|
|
14
82
|
}
|
|
15
|
-
namespace
|
|
83
|
+
namespace stride {
|
|
16
84
|
let chainId_1: string;
|
|
17
85
|
export { chainId_1 as chainId };
|
|
18
86
|
let connections_1: {};
|
|
@@ -25,16 +93,11 @@ export namespace wellKnownChainInfo {
|
|
|
25
93
|
export { pfmEnabled_1 as pfmEnabled };
|
|
26
94
|
let ibcHooksEnabled_1: true;
|
|
27
95
|
export { ibcHooksEnabled_1 as ibcHooksEnabled };
|
|
28
|
-
let
|
|
29
|
-
export { allowedMessages_1 as allowedMessages };
|
|
30
|
-
let allowedQueries_1: never[];
|
|
31
|
-
export { allowedQueries_1 as allowedQueries };
|
|
32
|
-
let stakingTokens_1: {
|
|
96
|
+
export let stakingTokens: {
|
|
33
97
|
denom: string;
|
|
34
98
|
}[];
|
|
35
|
-
export { stakingTokens_1 as stakingTokens };
|
|
36
99
|
}
|
|
37
|
-
namespace
|
|
100
|
+
namespace cosmos {
|
|
38
101
|
let chainId_2: string;
|
|
39
102
|
export { chainId_2 as chainId };
|
|
40
103
|
let connections_2: {};
|
|
@@ -47,16 +110,12 @@ export namespace wellKnownChainInfo {
|
|
|
47
110
|
export { pfmEnabled_2 as pfmEnabled };
|
|
48
111
|
let ibcHooksEnabled_2: true;
|
|
49
112
|
export { ibcHooksEnabled_2 as ibcHooksEnabled };
|
|
50
|
-
let
|
|
51
|
-
export { allowedMessages_2 as allowedMessages };
|
|
52
|
-
let allowedQueries_2: never[];
|
|
53
|
-
export { allowedQueries_2 as allowedQueries };
|
|
54
|
-
let stakingTokens_2: {
|
|
113
|
+
let stakingTokens_1: {
|
|
55
114
|
denom: string;
|
|
56
115
|
}[];
|
|
57
|
-
export {
|
|
116
|
+
export { stakingTokens_1 as stakingTokens };
|
|
58
117
|
}
|
|
59
|
-
namespace
|
|
118
|
+
namespace celestia {
|
|
60
119
|
let chainId_3: string;
|
|
61
120
|
export { chainId_3 as chainId };
|
|
62
121
|
let connections_3: {};
|
|
@@ -69,16 +128,31 @@ export namespace wellKnownChainInfo {
|
|
|
69
128
|
export { pfmEnabled_3 as pfmEnabled };
|
|
70
129
|
let ibcHooksEnabled_3: true;
|
|
71
130
|
export { ibcHooksEnabled_3 as ibcHooksEnabled };
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export {
|
|
131
|
+
let stakingTokens_2: {
|
|
132
|
+
denom: string;
|
|
133
|
+
}[];
|
|
134
|
+
export { stakingTokens_2 as stakingTokens };
|
|
135
|
+
}
|
|
136
|
+
namespace osmosis {
|
|
137
|
+
let chainId_4: string;
|
|
138
|
+
export { chainId_4 as chainId };
|
|
139
|
+
let connections_4: {};
|
|
140
|
+
export { connections_4 as connections };
|
|
141
|
+
let icaEnabled_4: true;
|
|
142
|
+
export { icaEnabled_4 as icaEnabled };
|
|
143
|
+
let icqEnabled_4: true;
|
|
144
|
+
export { icqEnabled_4 as icqEnabled };
|
|
145
|
+
let pfmEnabled_4: true;
|
|
146
|
+
export { pfmEnabled_4 as pfmEnabled };
|
|
147
|
+
let ibcHooksEnabled_4: true;
|
|
148
|
+
export { ibcHooksEnabled_4 as ibcHooksEnabled };
|
|
76
149
|
let stakingTokens_3: {
|
|
77
150
|
denom: string;
|
|
78
151
|
}[];
|
|
79
152
|
export { stakingTokens_3 as stakingTokens };
|
|
80
153
|
}
|
|
81
154
|
}
|
|
155
|
+
export function registerChainNamespace(agoricNamesAdmin: ERef<import("@agoric/vats").NameHubKit["nameAdmin"]>, log: (...messages: string[]) => void): Promise<void>;
|
|
82
156
|
export type ChainInfo = CosmosChainInfo | EthChainInfo;
|
|
83
157
|
import type { CosmosChainInfo } from './types.js';
|
|
84
158
|
import type { EthChainInfo } from './types.js';
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsHO,yDAHI,IAAI,CAAC,OAAO,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,OACpD,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,iBAazC;;qCA1H+C,YAAY;kCAAZ,YAAY"}
|
package/src/chain-info.js
CHANGED
|
@@ -2,15 +2,76 @@
|
|
|
2
2
|
|
|
3
3
|
/** @file temporary static lookup of chain info */
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { E } from '@endo/far';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @import {CosmosChainInfo, EthChainInfo} from './types.js';
|
|
9
|
+
*/
|
|
6
10
|
|
|
7
11
|
/** @typedef {CosmosChainInfo | EthChainInfo} ChainInfo */
|
|
8
12
|
|
|
9
13
|
// TODO generate this automatically with a build script drawing on data sources such as https://github.com/cosmos/chain-registry
|
|
10
14
|
|
|
15
|
+
// XXX inlines the enum values to save the import (entraining cosmic-proto which is megabytes)
|
|
16
|
+
|
|
11
17
|
export const wellKnownChainInfo =
|
|
12
18
|
/** @satisfies {Record<string, ChainInfo>} */ (
|
|
13
19
|
harden({
|
|
20
|
+
agoric: {
|
|
21
|
+
chainId: 'agoriclocal',
|
|
22
|
+
connections: {
|
|
23
|
+
cosmoslocal: {
|
|
24
|
+
id: 'connection-1',
|
|
25
|
+
client_id: '07-tendermint-3',
|
|
26
|
+
counterparty: {
|
|
27
|
+
client_id: '07-tendermint-2',
|
|
28
|
+
connection_id: 'connection-1',
|
|
29
|
+
prefix: {
|
|
30
|
+
key_prefix: '',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
34
|
+
transferChannel: {
|
|
35
|
+
portId: 'transfer',
|
|
36
|
+
channelId: 'channel-1',
|
|
37
|
+
counterPartyChannelId: 'channel-1',
|
|
38
|
+
counterPartyPortId: 'transfer',
|
|
39
|
+
ordering: 1 /* Order.ORDER_UNORDERED */,
|
|
40
|
+
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
41
|
+
version: 'ics20-1',
|
|
42
|
+
},
|
|
43
|
+
versions: [{ identifier: '', features: ['', ''] }],
|
|
44
|
+
delay_period: 0n,
|
|
45
|
+
},
|
|
46
|
+
osmosislocal: {
|
|
47
|
+
id: 'connection-0',
|
|
48
|
+
client_id: '07-tendermint-2',
|
|
49
|
+
counterparty: {
|
|
50
|
+
client_id: '07-tendermint-2',
|
|
51
|
+
connection_id: 'connection-1',
|
|
52
|
+
prefix: {
|
|
53
|
+
key_prefix: '',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
57
|
+
transferChannel: {
|
|
58
|
+
portId: 'transfer',
|
|
59
|
+
channelId: 'channel-0',
|
|
60
|
+
counterPartyChannelId: 'channel-1',
|
|
61
|
+
counterPartyPortId: 'transfer',
|
|
62
|
+
ordering: 1 /* Order.ORDER_UNORDERED */,
|
|
63
|
+
state: 3 /* IBCConnectionState.STATE_OPEN */,
|
|
64
|
+
version: 'ics20-1',
|
|
65
|
+
},
|
|
66
|
+
versions: [{ identifier: '', features: ['', ''] }],
|
|
67
|
+
delay_period: 0n,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
ibcHooksEnabled: true,
|
|
71
|
+
icaEnabled: true,
|
|
72
|
+
icqEnabled: true,
|
|
73
|
+
pfmEnabled: true,
|
|
74
|
+
},
|
|
14
75
|
// https://github.com/cosmos/chain-registry/blob/master/stride/chain.json
|
|
15
76
|
stride: {
|
|
16
77
|
chainId: 'stride-1',
|
|
@@ -19,8 +80,6 @@ export const wellKnownChainInfo =
|
|
|
19
80
|
icqEnabled: true,
|
|
20
81
|
pfmEnabled: true,
|
|
21
82
|
ibcHooksEnabled: true,
|
|
22
|
-
allowedMessages: [],
|
|
23
|
-
allowedQueries: [],
|
|
24
83
|
stakingTokens: [{ denom: 'ustride' }],
|
|
25
84
|
},
|
|
26
85
|
cosmos: {
|
|
@@ -30,8 +89,6 @@ export const wellKnownChainInfo =
|
|
|
30
89
|
icqEnabled: true,
|
|
31
90
|
pfmEnabled: true,
|
|
32
91
|
ibcHooksEnabled: true,
|
|
33
|
-
allowedMessages: [],
|
|
34
|
-
allowedQueries: [],
|
|
35
92
|
stakingTokens: [{ denom: 'uatom' }],
|
|
36
93
|
},
|
|
37
94
|
celestia: {
|
|
@@ -41,8 +98,6 @@ export const wellKnownChainInfo =
|
|
|
41
98
|
icqEnabled: true,
|
|
42
99
|
pfmEnabled: true,
|
|
43
100
|
ibcHooksEnabled: true,
|
|
44
|
-
allowedMessages: [],
|
|
45
|
-
allowedQueries: [],
|
|
46
101
|
stakingTokens: [{ denom: 'utia' }],
|
|
47
102
|
},
|
|
48
103
|
osmosis: {
|
|
@@ -52,9 +107,24 @@ export const wellKnownChainInfo =
|
|
|
52
107
|
icqEnabled: true,
|
|
53
108
|
pfmEnabled: true,
|
|
54
109
|
ibcHooksEnabled: true,
|
|
55
|
-
allowedMessages: [],
|
|
56
|
-
allowedQueries: [],
|
|
57
110
|
stakingTokens: [{ denom: 'uosmo' }],
|
|
58
111
|
},
|
|
59
112
|
})
|
|
60
113
|
);
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @param {ERef<import('@agoric/vats').NameHubKit['nameAdmin']>} agoricNamesAdmin
|
|
117
|
+
* @param {(...messages: string[]) => void} log
|
|
118
|
+
*/
|
|
119
|
+
export const registerChainNamespace = async (agoricNamesAdmin, log) => {
|
|
120
|
+
const { nameAdmin } = await E(agoricNamesAdmin).provideChild('chain');
|
|
121
|
+
|
|
122
|
+
const registrationPromises = Object.entries(wellKnownChainInfo).map(
|
|
123
|
+
async ([name, info]) => {
|
|
124
|
+
log(`registering chain ${name}`);
|
|
125
|
+
return E(nameAdmin).update(name, info);
|
|
126
|
+
},
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
await Promise.all(registrationPromises);
|
|
130
|
+
};
|
package/src/cosmos-api.d.ts
CHANGED
|
@@ -57,11 +57,6 @@ export type CosmosChainInfo = {
|
|
|
57
57
|
icqEnabled: boolean;
|
|
58
58
|
pfmEnabled: boolean;
|
|
59
59
|
ibcHooksEnabled: boolean;
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
allowedMessages: TypeUrl[];
|
|
64
|
-
allowedQueries: TypeUrl[];
|
|
65
60
|
/**
|
|
66
61
|
* cf https://github.com/cosmos/chain-registry/blob/master/chain.schema.json#L117
|
|
67
62
|
*/
|
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,KAAK,EAAE,KAAK,EAAW,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,yDAAyD,CAAC;AACtF,OAAO,KAAK,EAAE,KAAK,IAAI,kBAAkB,E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,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
|
@@ -72,11 +72,6 @@ export type CosmosChainInfo = {
|
|
|
72
72
|
icqEnabled: boolean;
|
|
73
73
|
pfmEnabled: boolean;
|
|
74
74
|
ibcHooksEnabled: boolean;
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
|
-
allowedMessages: TypeUrl[];
|
|
79
|
-
allowedQueries: TypeUrl[];
|
|
80
75
|
|
|
81
76
|
/**
|
|
82
77
|
* cf https://github.com/cosmos/chain-registry/blob/master/chain.schema.json#L117
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
export function start(zcf: ZCF, privateArgs: {
|
|
2
|
-
|
|
2
|
+
agoricNames: Remote<NameHub>;
|
|
3
|
+
localchain: Remote<import("@endo/exo").Guarded<{
|
|
4
|
+
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
5
|
+
getAddress(): string;
|
|
6
|
+
getBalance(brand: Brand<"nat">): Promise<import("@agoric/ertp/src/types.js").NatAmount>;
|
|
7
|
+
deposit(payment: Payment<"nat">, optAmountShape?: Pattern): Promise<globalThis.Amount>;
|
|
8
|
+
withdraw(amount: Amount<"nat">): Promise<globalThis.Payment<"nat">>;
|
|
9
|
+
executeTx<MT extends {
|
|
10
|
+
'@type': string;
|
|
11
|
+
}[]>(messages: MT): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<MT[K]>>; }>;
|
|
12
|
+
}>>;
|
|
13
|
+
query(request: import("@agoric/cosmic-proto").TypedJson): Promise<{
|
|
14
|
+
'@type': string;
|
|
15
|
+
}>;
|
|
16
|
+
queryMany(requests: import("@agoric/cosmic-proto").TypedJson[]): Promise<{
|
|
17
|
+
error?: string | undefined;
|
|
18
|
+
reply: {
|
|
19
|
+
'@type': string;
|
|
20
|
+
};
|
|
21
|
+
}[]>;
|
|
22
|
+
}>>;
|
|
3
23
|
marshaller: Marshaller;
|
|
4
24
|
storageNode: StorageNode;
|
|
5
25
|
timerService: TimerService;
|
|
@@ -106,6 +126,8 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
106
126
|
}, undefined>>;
|
|
107
127
|
}>;
|
|
108
128
|
}>;
|
|
129
|
+
import type { NameHub } from '@agoric/vats';
|
|
130
|
+
import type { Remote } from '@agoric/internal';
|
|
109
131
|
import type { TimerService } from '@agoric/time';
|
|
110
132
|
import type { TimerBrand } from '@agoric/time';
|
|
111
133
|
//# sourceMappingURL=stakeBld.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAkCO,2BAXI,GAAG;;;;;8BAmBkC,MAAM,KACnD,CAAC;6BAgBgB,QAChB,KAAC,CAAC,mBAGA,OAAO;6BAeC,OAAO,KAAK,CAAC;;;2BAcb,EAAX;;uBA0CohC,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;gBA3GjwD,UAAU;iBACT,WAAW;;;YAIlB,OAAO,kBAAkB,EAAE,OAAO;;QAkDvC;;WAEG;;;;;;;;;;+DAiCqB,OACtB,KAAH,CAAC;;;iEAgB0B,OAAO,KAAK,CAAC;;;;;;;;;;;+DAAs4B,OAAO,KAAK,CAAC;;;iEAA+yB,OAAO,KAAK,CAAC;iCA3ExuD,QAChB,KAAC,CAAC,mBAGA,OAAO;iCAeC,OAAO,KAAK,CAAC;;;+BAcb,EAAX;;;;;;;;;;;;;;;;;;;;;;;;;QAsBG;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBR;6BAvHyB,cAAc;4BACf,kBAAkB;kCACA,cAAc;gCAAd,cAAc"}
|
|
@@ -10,10 +10,12 @@ import { E } from '@endo/far';
|
|
|
10
10
|
import { deeplyFulfilled } from '@endo/marshal';
|
|
11
11
|
import { M } from '@endo/patterns';
|
|
12
12
|
import { prepareLocalChainAccountKit } from '../exos/local-chain-account-kit.js';
|
|
13
|
-
import { prepareMockChainInfo } from '../utils/mockChainInfo.js';
|
|
14
13
|
|
|
15
14
|
/**
|
|
15
|
+
* @import {NameHub} from '@agoric/vats';
|
|
16
|
+
* @import {Remote} from '@agoric/internal';
|
|
16
17
|
* @import {TimerBrand, TimerService} from '@agoric/time';
|
|
18
|
+
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
17
19
|
*/
|
|
18
20
|
|
|
19
21
|
const trace = makeTracer('StakeBld');
|
|
@@ -21,7 +23,8 @@ const trace = makeTracer('StakeBld');
|
|
|
21
23
|
/**
|
|
22
24
|
* @param {ZCF} zcf
|
|
23
25
|
* @param {{
|
|
24
|
-
*
|
|
26
|
+
* agoricNames: Remote<NameHub>;
|
|
27
|
+
* localchain: Remote<LocalChain>;
|
|
25
28
|
* marshaller: Marshaller;
|
|
26
29
|
* storageNode: StorageNode;
|
|
27
30
|
* timerService: TimerService;
|
|
@@ -42,9 +45,12 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
42
45
|
privateArgs.marshaller,
|
|
43
46
|
);
|
|
44
47
|
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
const agoricChainInfo =
|
|
48
|
+
// FIXME in a second incarnation we can't make a remote call before defining all kinds
|
|
49
|
+
// UNTIL https://github.com/Agoric/agoric-sdk/issues/8879
|
|
50
|
+
const agoricChainInfo = await E(privateArgs.agoricNames).lookup(
|
|
51
|
+
'chain',
|
|
52
|
+
'agoric',
|
|
53
|
+
);
|
|
48
54
|
|
|
49
55
|
const makeLocalChainAccountKit = prepareLocalChainAccountKit(
|
|
50
56
|
zone,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @import {Remote} from '@agoric/internal';
|
|
6
6
|
* @import {OrchestrationService} from '../service.js';
|
|
7
7
|
* @import {Baggage} from '@agoric/vat-data'
|
|
8
|
-
* @import {
|
|
8
|
+
* @import {NameHub} from '@agoric/vats';
|
|
9
9
|
*/
|
|
10
10
|
/** @type {ContractMeta} */
|
|
11
11
|
export const meta: ContractMeta;
|
|
@@ -14,6 +14,7 @@ export function makeNatAmountShape(brand: Brand, min?: bigint | undefined): {
|
|
|
14
14
|
value: import("@endo/patterns").Matcher;
|
|
15
15
|
};
|
|
16
16
|
export function start(zcf: ZCF, privateArgs: {
|
|
17
|
+
agoricNames: Remote<NameHub>;
|
|
17
18
|
localchain: Remote<import("@endo/exo").Guarded<{
|
|
18
19
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
19
20
|
getAddress(): string;
|
|
@@ -57,6 +58,7 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
57
58
|
}>>;
|
|
58
59
|
}>;
|
|
59
60
|
}>;
|
|
61
|
+
import type { NameHub } from '@agoric/vats';
|
|
60
62
|
import type { Remote } from '@agoric/internal';
|
|
61
63
|
import type { IcaAccount } from '../types.js';
|
|
62
64
|
import type { TimerService } from '@agoric/time';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,
|
|
1
|
+
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAUrB;AASK,0CAHI,KAAK;;;EAIsC;AAa/C,2BAVI,GAAG;;;;;8BAJ0B,MAAO,KAC9C,CAAC;6BAciC,QAE9B,KAAK,CAAC,mBAA2B,OAEnC;6BA6BC,OADO,KAAK,CAAC;;;2BAcsC,EAAE;;uBA4C+5B,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;oBAhElsD,MAAM,CAAC,KAAK,CAAC;;;;;oBAAb,MAAM,CAAC,KAAK,CAAC;;;;GA+D7B;6BA9HyB,cAAc;4BAHf,kBAAkB;gCAHwB,aAAa;kCACjD,cAAc;6BAInB,kBAAkB;4CALuB,aAAa"}
|
|
@@ -15,12 +15,13 @@ import { orcUtils } from '../utils/orc.js';
|
|
|
15
15
|
* @import {Remote} from '@agoric/internal';
|
|
16
16
|
* @import {OrchestrationService} from '../service.js';
|
|
17
17
|
* @import {Baggage} from '@agoric/vat-data'
|
|
18
|
-
* @import {
|
|
18
|
+
* @import {NameHub} from '@agoric/vats';
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/** @type {ContractMeta} */
|
|
22
22
|
export const meta = {
|
|
23
23
|
privateArgsShape: {
|
|
24
|
+
agoricNames: M.remotable('agoricNames'),
|
|
24
25
|
localchain: M.remotable('localchain'),
|
|
25
26
|
orchestrationService: M.or(M.remotable('orchestration'), null),
|
|
26
27
|
storageNode: StorageNodeShape,
|
|
@@ -42,6 +43,7 @@ export const makeNatAmountShape = (brand, min) =>
|
|
|
42
43
|
/**
|
|
43
44
|
* @param {ZCF} zcf
|
|
44
45
|
* @param {{
|
|
46
|
+
* agoricNames: Remote<NameHub>;
|
|
45
47
|
* localchain: Remote<LocalChain>;
|
|
46
48
|
* orchestrationService: Remote<OrchestrationService>;
|
|
47
49
|
* storageNode: Remote<StorageNode>;
|
|
@@ -54,16 +56,22 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
54
56
|
|
|
55
57
|
const zone = makeDurableZone(baggage);
|
|
56
58
|
|
|
57
|
-
const {
|
|
58
|
-
|
|
59
|
+
const {
|
|
60
|
+
agoricNames,
|
|
61
|
+
localchain,
|
|
62
|
+
orchestrationService,
|
|
63
|
+
storageNode,
|
|
64
|
+
timerService,
|
|
65
|
+
} = privateArgs;
|
|
59
66
|
|
|
60
67
|
const { orchestrate } = makeOrchestrationFacade({
|
|
61
|
-
|
|
62
|
-
timerService,
|
|
63
|
-
zcf,
|
|
68
|
+
agoricNames,
|
|
64
69
|
localchain,
|
|
65
|
-
storageNode,
|
|
66
70
|
orchestrationService,
|
|
71
|
+
storageNode,
|
|
72
|
+
timerService,
|
|
73
|
+
zcf,
|
|
74
|
+
zone,
|
|
67
75
|
});
|
|
68
76
|
|
|
69
77
|
/** deprecated historical example */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export function start(zcf: ZCF, privateArgs: {
|
|
2
|
+
agoricNames: Remote<NameHub>;
|
|
2
3
|
localchain: Remote<import("@endo/exo").Guarded<{
|
|
3
4
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
4
5
|
getAddress(): string;
|
|
@@ -36,6 +37,7 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
36
37
|
makeUnbondAndLiquidStakeInvitation: () => Promise<Invitation<unknown, never>>;
|
|
37
38
|
}>;
|
|
38
39
|
}>;
|
|
40
|
+
import type { NameHub } from '@agoric/vats';
|
|
39
41
|
import type { Remote } from '@agoric/internal';
|
|
40
42
|
import type { IcaAccount } from '../types.js';
|
|
41
43
|
import type { TimerService } from '@agoric/time';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AA0BO,2BAVI,GAAG;;;;;8BAmCJ,MAAM,KAAK,CAAC;6BAQZ,QAAQ,KAAK,CAAC,mBACH,OAAO;6BAUU,OAAO,KAAK,CAAC;;;2BAqBxC,EAAE;;uBAKmkE,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;GAD10F;6BArFyB,cAAc;4BACf,kBAAkB;gCALwB,aAAa;kCACjD,cAAc;6BACnB,kBAAkB"}
|
|
@@ -8,6 +8,7 @@ import { makeOrchestrationFacade } from '../facade.js';
|
|
|
8
8
|
* @import {TimerService} from '@agoric/time';
|
|
9
9
|
* @import {Baggage} from '@agoric/vat-data';
|
|
10
10
|
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
11
|
+
* @import {NameHub} from '@agoric/vats';
|
|
11
12
|
* @import {Remote} from '@agoric/internal';
|
|
12
13
|
* @import {OrchestrationService} from '../service.js';
|
|
13
14
|
*/
|
|
@@ -15,6 +16,7 @@ import { makeOrchestrationFacade } from '../facade.js';
|
|
|
15
16
|
/**
|
|
16
17
|
* @param {ZCF} zcf
|
|
17
18
|
* @param {{
|
|
19
|
+
* agoricNames: Remote<NameHub>;
|
|
18
20
|
* localchain: Remote<LocalChain>;
|
|
19
21
|
* orchestrationService: Remote<OrchestrationService>;
|
|
20
22
|
* storageNode: Remote<StorageNode>;
|
|
@@ -23,17 +25,23 @@ import { makeOrchestrationFacade } from '../facade.js';
|
|
|
23
25
|
* @param {Baggage} baggage
|
|
24
26
|
*/
|
|
25
27
|
export const start = async (zcf, privateArgs, baggage) => {
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
+
const {
|
|
29
|
+
agoricNames,
|
|
30
|
+
localchain,
|
|
31
|
+
orchestrationService,
|
|
32
|
+
storageNode,
|
|
33
|
+
timerService,
|
|
34
|
+
} = privateArgs;
|
|
28
35
|
const zone = makeDurableZone(baggage);
|
|
29
36
|
|
|
30
37
|
const { orchestrate } = makeOrchestrationFacade({
|
|
38
|
+
agoricNames,
|
|
31
39
|
localchain,
|
|
32
|
-
|
|
40
|
+
orchestrationService,
|
|
41
|
+
storageNode,
|
|
33
42
|
timerService,
|
|
34
43
|
zcf,
|
|
35
|
-
|
|
36
|
-
orchestrationService,
|
|
44
|
+
zone,
|
|
37
45
|
});
|
|
38
46
|
|
|
39
47
|
/** @type {OfferHandler} */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function prepareLocalChainAccountKit(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, timerService: TimerService, timerBrand: TimerBrand, agoricChainInfo:
|
|
1
|
+
export function prepareLocalChainAccountKit(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, timerService: TimerService, timerBrand: TimerBrand, agoricChainInfo: CosmosChainInfo): (args_0: {
|
|
2
2
|
account: import("@endo/exo").Guarded<{
|
|
3
3
|
getAddress(): string;
|
|
4
4
|
getBalance(brand: Brand<"nat">): Promise<import("@agoric/ertp/src/types.js").NatAmount>;
|
|
@@ -6,7 +6,13 @@ export function prepareLocalChainAccountKit(zone: Zone, makeRecorderKit: <T>(sto
|
|
|
6
6
|
withdraw(amount: Amount<"nat">): Promise<globalThis.Payment<"nat">>;
|
|
7
7
|
executeTx<MT extends {
|
|
8
8
|
'@type': string;
|
|
9
|
-
}[]>(messages: MT
|
|
9
|
+
}[]>(messages: MT /**
|
|
10
|
+
* @param {object} initState
|
|
11
|
+
* @param {LocalChainAccount} initState.account
|
|
12
|
+
* @param {ChainAddress['address']} initState.address
|
|
13
|
+
* @param {StorageNode} initState.storageNode
|
|
14
|
+
* @returns {State}
|
|
15
|
+
*/): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/vatsafe").ResponseTo<MT[K]>>; }>;
|
|
10
16
|
}>;
|
|
11
17
|
address: string;
|
|
12
18
|
storageNode: StorageNode;
|
|
@@ -59,7 +65,13 @@ export function prepareLocalChainAccountKit(zone: Zone, makeRecorderKit: <T>(sto
|
|
|
59
65
|
/** @type {LocalChainAccount['executeTx']} */
|
|
60
66
|
executeTx<MT extends {
|
|
61
67
|
'@type': string;
|
|
62
|
-
}[]>(messages: MT
|
|
68
|
+
}[]>(messages: MT /**
|
|
69
|
+
* @param {object} initState
|
|
70
|
+
* @param {LocalChainAccount} initState.account
|
|
71
|
+
* @param {ChainAddress['address']} initState.address
|
|
72
|
+
* @param {StorageNode} initState.storageNode
|
|
73
|
+
* @returns {State}
|
|
74
|
+
*/): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/vatsafe").ResponseTo<MT[K]>>; }>;
|
|
63
75
|
/**
|
|
64
76
|
* @returns {ChainAddress['address']}
|
|
65
77
|
*/
|
|
@@ -76,9 +88,6 @@ export function prepareLocalChainAccountKit(zone: Zone, makeRecorderKit: <T>(sto
|
|
|
76
88
|
transfer(amount: AmountArg, destination: ChainAddress, opts?: IBCMsgTransferOptions | undefined): Promise<void>;
|
|
77
89
|
};
|
|
78
90
|
}>;
|
|
79
|
-
export type AgoricChainInfo = {
|
|
80
|
-
connections: Record<string, import("@agoric/orchestration").IBCConnectionInfo>;
|
|
81
|
-
};
|
|
82
91
|
export type LocalChainAccountNotification = {
|
|
83
92
|
address: string;
|
|
84
93
|
};
|
|
@@ -91,7 +100,13 @@ export type State = {
|
|
|
91
100
|
withdraw(amount: Amount<"nat">): Promise<globalThis.Payment<"nat">>;
|
|
92
101
|
executeTx<MT extends {
|
|
93
102
|
'@type': string;
|
|
94
|
-
}[]>(messages: MT
|
|
103
|
+
}[]>(messages: MT /**
|
|
104
|
+
* @param {object} initState
|
|
105
|
+
* @param {LocalChainAccount} initState.account
|
|
106
|
+
* @param {ChainAddress['address']} initState.address
|
|
107
|
+
* @param {StorageNode} initState.storageNode
|
|
108
|
+
* @returns {State}
|
|
109
|
+
*/): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/vatsafe").ResponseTo<MT[K]>>; }>;
|
|
95
110
|
}>;
|
|
96
111
|
address: string;
|
|
97
112
|
};
|
|
@@ -100,6 +115,7 @@ import type { Zone } from '@agoric/zone';
|
|
|
100
115
|
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
101
116
|
import type { TimerService } from '@agoric/time';
|
|
102
117
|
import type { TimerBrand } from '@agoric/time';
|
|
118
|
+
import type { CosmosChainInfo } from '@agoric/orchestration';
|
|
103
119
|
import type { AmountArg } from '@agoric/orchestration';
|
|
104
120
|
import type { ChainAddress } from '@agoric/orchestration';
|
|
105
121
|
import type { IBCMsgTransferOptions } from '@agoric/orchestration';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-chain-account-kit.d.ts","sourceRoot":"","sources":["local-chain-account-kit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-chain-account-kit.d.ts","sourceRoot":"","sources":["local-chain-account-kit.js"],"names":[],"mappings":"AAmEO,0FA2EG,WAAG,GAAE,QAAS,OACZ,WAAI,EAAE,MACjB,CAAa,WAAD,CAAC,CAAC,0HAlFJ,GAAG;;;0BApBT,MAAM,KAAK,CAAC;yBAQmB,QAClC,KAAG,CAAC,mBAA2B,OAAO;yBAuBtC,OACA,KAAI,CAAC;;;uBAuBH,EAPD,CAAC;;;;;;WAMG;;;iBAFQ,WAAW;;;QAalB;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;QAYxB;;;WAGG;qCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;;;;;;;;;QA0BxB;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;QAsBxB;;;;WAIG;qCAHQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC,GACX,OAAO,CAAC,IAAI,CAAC;QA2B1B;;;;WAIG;QACH,2CAA2C;yBA/Jf,QAClC,KAAG,CAAC,mBAA2B,OAAO;QAkKhC,4CAA4C;yBA3IlD,OACA,KAAI,CAAC;QA8IC,6CAA6C;;;uBAvHjD,EAPD,CAAC;;;;;;WAMG;QA6HC;;WAEG;;QAIH;;;;;;;;WAQG;0GADU,OAAO,CAAC,IAAI,CAAC;;GA+CjC;;aA5Pa,MAAM;;;;;;0BAYf,MAAM,KAAK,CAAC;yBAQmB,QAClC,KAAG,CAAC,mBAA2B,OAAO;yBAuBtC,OACA,KAAI,CAAC;;;uBAuBH,EAPD,CAAC;;;;;;WAMG;;;;mCA0LO,UAAU,CAAC,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC;0BAtQjD,cAAc;iCADU,6CAA6C;kCAEjD,cAAc;gCAAd,cAAc;qCAHsC,uBAAuB;+BAAvB,uBAAuB;kCAAvB,uBAAuB;2CAAvB,uBAAuB"}
|
|
@@ -23,9 +23,6 @@ import { dateInSeconds, makeTimestampHelper } from '../utils/time.js';
|
|
|
23
23
|
* @import {TimerService, TimerBrand} from '@agoric/time';
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
// partial until #8879
|
|
27
|
-
/** @typedef {Pick<CosmosChainInfo, 'connections'>} AgoricChainInfo */
|
|
28
|
-
|
|
29
26
|
const trace = makeTracer('LCAH');
|
|
30
27
|
|
|
31
28
|
const { Fail } = assert;
|
|
@@ -66,7 +63,7 @@ const PUBLIC_TOPICS = {
|
|
|
66
63
|
* @param {ZCF} zcf
|
|
67
64
|
* @param {TimerService} timerService
|
|
68
65
|
* @param {TimerBrand} timerBrand
|
|
69
|
-
* @param {
|
|
66
|
+
* @param {CosmosChainInfo} agoricChainInfo
|
|
70
67
|
*/
|
|
71
68
|
export const prepareLocalChainAccountKit = (
|
|
72
69
|
zone,
|
package/src/facade.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** agoricNames key for ChainInfo hub */
|
|
2
|
+
export const CHAIN_KEY: "chain";
|
|
3
|
+
export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode, orchestrationService, localchain, agoricNames, }: {
|
|
2
4
|
zone: Zone;
|
|
3
5
|
timerService: Remote<TimerService>;
|
|
4
6
|
zcf: ZCF;
|
|
@@ -16,12 +18,14 @@ export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode,
|
|
|
16
18
|
getAddress(): string;
|
|
17
19
|
getBalance(brand: Brand<"nat">): Promise<import("@agoric/ertp/src/types.js").NatAmount>;
|
|
18
20
|
deposit(payment: Payment<"nat">, optAmountShape?: Pattern): Promise<globalThis.Amount>;
|
|
19
|
-
withdraw(amount: Amount
|
|
20
|
-
"nat">): Promise<globalThis.Payment<"nat">>;
|
|
21
|
+
withdraw(amount: Amount<"nat">): Promise<globalThis.Payment<"nat">>;
|
|
21
22
|
executeTx<MT extends {
|
|
22
23
|
'@type': string;
|
|
23
24
|
}[]>(messages: MT): Promise<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<MT[K]>>; }>;
|
|
24
|
-
}>>;
|
|
25
|
+
}>>; /**
|
|
26
|
+
* @param {string} name
|
|
27
|
+
* @returns {Promise<CosmosChainInfo>}
|
|
28
|
+
*/
|
|
25
29
|
query(request: import("@agoric/cosmic-proto").TypedJson): Promise<{
|
|
26
30
|
'@type': string;
|
|
27
31
|
}>;
|
|
@@ -32,6 +36,7 @@ export function makeOrchestrationFacade({ zone, timerService, zcf, storageNode,
|
|
|
32
36
|
};
|
|
33
37
|
}[]>;
|
|
34
38
|
}>>;
|
|
39
|
+
agoricNames: Remote<NameHub>;
|
|
35
40
|
}): {
|
|
36
41
|
/**
|
|
37
42
|
* Register a new chain in a heap store. The name will override a name in
|
|
@@ -61,6 +66,7 @@ export type OrchestrationFacade = ReturnType<typeof makeOrchestrationFacade>;
|
|
|
61
66
|
import type { Zone } from '@agoric/zone';
|
|
62
67
|
import type { TimerService } from '@agoric/time';
|
|
63
68
|
import type { Remote } from '@agoric/internal';
|
|
69
|
+
import type { NameHub } from '@agoric/vats';
|
|
64
70
|
import type { ChainInfo } from './types.js';
|
|
65
71
|
import type { Orchestrator } from './types.js';
|
|
66
72
|
//# 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":"AAsBA,wCAAwC;AACxC,gCAAiC;AA2I1B;;;SAPG,GAAG;;;;;;;;;;;;;8BA1G+B,MAAM,KAAK,CAAC;6BAgBrC,QAAQ,KAAI,CAAC,mBACZ,OAAO;6BAcgB,OAAO,KACjD,CAAC;;;2BAqBD,EAAE;aAkFD;;;WAGG;uBAIC,OAAG,sBAAsB,EAAE,SAGjC;;;4BAmBwB,OAAM,sBACf,EAAE,SAAS,EAAE;;;;;;;;;IAbxB;;;;;;;;;;;OAWG;wBAFQ,MAAM;IAMjB;;;;;;;;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;EA4BnD;kCAEa,UAAU,CAAC,OAAO,uBAAuB,CAAC;0BAnPjC,cAAc;kCACN,cAAc;4BAEpB,kBAAkB;6BAJjB,cAAc;+BAMgD,YAAY;kCAAZ,YAAY"}
|
package/src/facade.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
4
4
|
import { E } from '@endo/far';
|
|
5
5
|
import { M } from '@endo/patterns';
|
|
6
|
-
import { wellKnownChainInfo } from './chain-info.js';
|
|
7
6
|
import { prepareCosmosOrchestrationAccount } from './exos/cosmosOrchestrationAccount.js';
|
|
8
7
|
import { CosmosChainInfoShape } from './typeGuards.js';
|
|
9
8
|
|
|
10
9
|
/**
|
|
10
|
+
* @import {NameHub} from '@agoric/vats';
|
|
11
11
|
* @import {Zone} from '@agoric/zone';
|
|
12
12
|
* @import {TimerService} from '@agoric/time';
|
|
13
13
|
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
@@ -19,12 +19,14 @@ import { CosmosChainInfoShape } from './typeGuards.js';
|
|
|
19
19
|
/** @type {any} */
|
|
20
20
|
const anyVal = null;
|
|
21
21
|
|
|
22
|
+
// TODO define key hierarchy in shared constants
|
|
23
|
+
/** agoricNames key for ChainInfo hub */
|
|
24
|
+
export const CHAIN_KEY = 'chain';
|
|
25
|
+
|
|
22
26
|
// FIXME look up real values
|
|
23
27
|
// UNTIL https://github.com/Agoric/agoric-sdk/issues/9063
|
|
24
28
|
const mockLocalChainInfo = {
|
|
25
29
|
allegedName: 'agoric',
|
|
26
|
-
allowedMessages: [],
|
|
27
|
-
allowedQueries: [],
|
|
28
30
|
chainId: 'agoriclocal',
|
|
29
31
|
connections: anyVal,
|
|
30
32
|
ibcHooksEnabled: true,
|
|
@@ -155,6 +157,7 @@ const makeRemoteChainFacade = (
|
|
|
155
157
|
* storageNode: Remote<StorageNode>;
|
|
156
158
|
* orchestrationService: Remote<OrchestrationService>;
|
|
157
159
|
* localchain: Remote<LocalChain>;
|
|
160
|
+
* agoricNames: Remote<NameHub>;
|
|
158
161
|
* }} powers
|
|
159
162
|
*/
|
|
160
163
|
export const makeOrchestrationFacade = ({
|
|
@@ -164,6 +167,7 @@ export const makeOrchestrationFacade = ({
|
|
|
164
167
|
storageNode,
|
|
165
168
|
orchestrationService,
|
|
166
169
|
localchain,
|
|
170
|
+
agoricNames,
|
|
167
171
|
}) => {
|
|
168
172
|
console.log('makeOrchestrationFacade got', {
|
|
169
173
|
zone,
|
|
@@ -178,6 +182,22 @@ export const makeOrchestrationFacade = ({
|
|
|
178
182
|
valueShape: CosmosChainInfoShape,
|
|
179
183
|
});
|
|
180
184
|
|
|
185
|
+
/**
|
|
186
|
+
* @param {string} name
|
|
187
|
+
* @returns {Promise<CosmosChainInfo>}
|
|
188
|
+
*/
|
|
189
|
+
const getChainInfo = async name => {
|
|
190
|
+
// Either from registerChain or memoized remote lookup()
|
|
191
|
+
if (chainInfos.has(name)) {
|
|
192
|
+
return chainInfos.get(name);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const chainInfo = await E(agoricNames).lookup(CHAIN_KEY, name);
|
|
196
|
+
assert(chainInfo, `unknown chain ${name}`);
|
|
197
|
+
chainInfos.init(name, chainInfo);
|
|
198
|
+
return chainInfo;
|
|
199
|
+
};
|
|
200
|
+
|
|
181
201
|
return {
|
|
182
202
|
/**
|
|
183
203
|
* Register a new chain in a heap store. The name will override a name in
|
|
@@ -211,12 +231,7 @@ export const makeOrchestrationFacade = ({
|
|
|
211
231
|
return makeLocalChainFacade(localchain);
|
|
212
232
|
}
|
|
213
233
|
|
|
214
|
-
|
|
215
|
-
const chainInfo = chainInfos.has(name)
|
|
216
|
-
? chainInfos.get(name)
|
|
217
|
-
: // @ts-expect-error may be undefined
|
|
218
|
-
wellKnownChainInfo[name];
|
|
219
|
-
assert(chainInfo, `unknown chain ${name}`);
|
|
234
|
+
const chainInfo = await getChainInfo(name);
|
|
220
235
|
|
|
221
236
|
return makeRemoteChainFacade(chainInfo, {
|
|
222
237
|
orchestration: orchestrationService,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export function startStakeBld({ consume: { board, chainStorage, chainTimerService: chainTimerServiceP, localchain, startUpgradable, }, installation: { consume: { stakeBld }, }, instance: { produce: { stakeBld: produceInstance }, }, issuer: { consume: { [Stake.symbol]: stakeIssuer }, }, }: BootstrapPowers & {
|
|
1
|
+
export function startStakeBld({ consume: { agoricNames: agoricNamesP, agoricNamesAdmin, board, chainStorage, chainTimerService: chainTimerServiceP, localchain, startUpgradable, }, installation: { consume: { stakeBld }, }, instance: { produce: { stakeBld: produceInstance }, }, issuer: { consume: { [Stake.symbol]: stakeIssuer }, }, }: BootstrapPowers & {
|
|
2
2
|
installation: {
|
|
3
3
|
consume: {
|
|
4
4
|
stakeBld: Installation<(zcf: ZCF, privateArgs: {
|
|
5
|
-
|
|
5
|
+
agoricNames: import("@agoric/internal").Remote<import("@agoric/vats").NameHub>;
|
|
6
|
+
localchain: import("@agoric/internal").Remote<import("@endo/exo").Guarded<{
|
|
6
7
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
7
8
|
getAddress(): string;
|
|
8
9
|
getBalance(brand: Brand<"nat">): Promise<import("@agoric/ertp/src/types.js").NatAmount>;
|
|
@@ -21,7 +22,7 @@ export function startStakeBld({ consume: { board, chainStorage, chainTimerServic
|
|
|
21
22
|
'@type': string;
|
|
22
23
|
};
|
|
23
24
|
}[]>;
|
|
24
|
-
}
|
|
25
|
+
}>>;
|
|
25
26
|
marshaller: {
|
|
26
27
|
toCapData: import("@endo/marshal").ToCapData<unknown>;
|
|
27
28
|
fromCapData: import("@endo/marshal").FromCapData<unknown>;
|
|
@@ -138,6 +139,8 @@ export function getManifestForStakeBld({ restoreRef }: {
|
|
|
138
139
|
manifest: {
|
|
139
140
|
[x: string]: {
|
|
140
141
|
consume: {
|
|
142
|
+
agoricNames: boolean;
|
|
143
|
+
agoricNamesAdmin: boolean;
|
|
141
144
|
board: boolean;
|
|
142
145
|
chainStorage: boolean;
|
|
143
146
|
chainTimerService: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeBld.d.ts","sourceRoot":"","sources":["start-stakeBld.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start-stakeBld.d.ts","sourceRoot":"","sources":["start-stakeBld.js"],"names":[],"mappings":"AAmBO,+UAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,OAqBX,GAAG;;;;;0CAmBL,MACd,KAAC,CAAC;yCAgBG,QAAS,KAAI,CAAC,mBACT,OACb;yCAsBY,OAAO,KAAK,CAAC;;;uCAkBoL,EAAE;;mCAAupE,OAAO,sBAAsB,EAAE,SAAS;;;wCAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;wBApE1lG,OAAO,kBAAkB,EAAE,OAAO;;;;;;;;;;;2EAoEw2B,OAAO,KAAK,CAAC;;;6EAAid,OAAO,KAAK,CAAC;;;;;;;;;;;2EAAs4B,OAAO,KAAK,CAAC;;;6EAA+yB,OAAO,KAAK,CAAC;6CA1CnkG,QAAS,KAAI,CAAC,mBACT,OACb;6CAsBY,OAAO,KAAK,CAAC;;;2CAkBoL,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAjGtM,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBA8DH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;sBA5GqB,gCAAgC"}
|
|
@@ -2,6 +2,7 @@ import { makeTracer } from '@agoric/internal';
|
|
|
2
2
|
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
3
3
|
import { Stake } from '@agoric/internal/src/tokens.js';
|
|
4
4
|
import { E } from '@endo/far';
|
|
5
|
+
import { registerChainNamespace } from '../chain-info.js';
|
|
5
6
|
|
|
6
7
|
const trace = makeTracer('StartStakeBld', true);
|
|
7
8
|
|
|
@@ -18,6 +19,8 @@ const trace = makeTracer('StartStakeBld', true);
|
|
|
18
19
|
*/
|
|
19
20
|
export const startStakeBld = async ({
|
|
20
21
|
consume: {
|
|
22
|
+
agoricNames: agoricNamesP,
|
|
23
|
+
agoricNamesAdmin,
|
|
21
24
|
board,
|
|
22
25
|
chainStorage,
|
|
23
26
|
chainTimerService: chainTimerServiceP,
|
|
@@ -37,12 +40,16 @@ export const startStakeBld = async ({
|
|
|
37
40
|
const VSTORAGE_PATH = 'stakeBld';
|
|
38
41
|
trace('startStakeBld');
|
|
39
42
|
|
|
43
|
+
// Assumes this is the first proposal to need/provide `chain` namespace
|
|
44
|
+
await registerChainNamespace(agoricNamesAdmin, trace);
|
|
45
|
+
|
|
40
46
|
const storageNode = await makeStorageNodeChild(chainStorage, VSTORAGE_PATH);
|
|
41
47
|
|
|
42
48
|
// NB: committee must only publish what it intended to be public
|
|
43
49
|
const marshaller = await E(board).getPublishingMarshaller();
|
|
44
50
|
|
|
45
|
-
const [timerService, timerBrand] = await Promise.all([
|
|
51
|
+
const [agoricNames, timerService, timerBrand] = await Promise.all([
|
|
52
|
+
agoricNamesP,
|
|
46
53
|
chainTimerServiceP,
|
|
47
54
|
chainTimerServiceP.then(ts => E(ts).getTimerBrand()),
|
|
48
55
|
]);
|
|
@@ -58,6 +65,8 @@ export const startStakeBld = async ({
|
|
|
58
65
|
issuerKeywordRecord: harden({ In: await stakeIssuer }),
|
|
59
66
|
terms: {},
|
|
60
67
|
privateArgs: {
|
|
68
|
+
// BEFOREPUSh populate agoricNames with 'agoric' info and test in a3p
|
|
69
|
+
agoricNames,
|
|
61
70
|
localchain: await localchain,
|
|
62
71
|
timerService,
|
|
63
72
|
timerBrand,
|
|
@@ -76,6 +85,8 @@ export const getManifestForStakeBld = ({ restoreRef }, { installKeys }) => {
|
|
|
76
85
|
manifest: {
|
|
77
86
|
[startStakeBld.name]: {
|
|
78
87
|
consume: {
|
|
88
|
+
agoricNames: true,
|
|
89
|
+
agoricNamesAdmin: true,
|
|
79
90
|
board: true,
|
|
80
91
|
chainStorage: true,
|
|
81
92
|
chainTimerService: true,
|
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;;;;;;AAQlE,uEAUE;AAEF,
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;AAiBH,8DAAkE;;;;;;AAQlE,uEAUE;AAEF,oEAYE"}
|
package/src/typeGuards.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mockChainInfo.d.ts","sourceRoot":"","sources":["mockChainInfo.js"],"names":[],"mappings":"AAwEO,yFAKN;qCAlEoD,kBAAkB"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Mocked Chain Info object until #8879
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
Order,
|
|
6
|
-
State as IBCChannelState,
|
|
7
|
-
} from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
|
|
8
|
-
import { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @import {Zone} from '@agoric/zone';
|
|
12
|
-
* @import {CosmosChainInfo, IBCConnectionInfo} from '../cosmos-api.js';
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* currently keyed by ChainId, as this is what we have available in ChainAddress
|
|
17
|
-
* to determine the correct IBCChannelID's for a .transfer() msg.
|
|
18
|
-
*
|
|
19
|
-
* @type {Record<string, IBCConnectionInfo>}
|
|
20
|
-
*/
|
|
21
|
-
const connectionEntries = harden({
|
|
22
|
-
cosmoslocal: {
|
|
23
|
-
id: 'connection-1',
|
|
24
|
-
client_id: '07-tendermint-3',
|
|
25
|
-
counterparty: {
|
|
26
|
-
client_id: '07-tendermint-2',
|
|
27
|
-
connection_id: 'connection-1',
|
|
28
|
-
prefix: {
|
|
29
|
-
key_prefix: '',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
state: IBCConnectionState.STATE_OPEN,
|
|
33
|
-
transferChannel: {
|
|
34
|
-
portId: 'transfer',
|
|
35
|
-
channelId: 'channel-1',
|
|
36
|
-
counterPartyChannelId: 'channel-1',
|
|
37
|
-
counterPartyPortId: 'transfer',
|
|
38
|
-
ordering: Order.ORDER_UNORDERED,
|
|
39
|
-
state: IBCChannelState.STATE_OPEN,
|
|
40
|
-
version: 'ics20-1',
|
|
41
|
-
},
|
|
42
|
-
versions: [{ identifier: '', features: ['', ''] }],
|
|
43
|
-
delay_period: 0n,
|
|
44
|
-
},
|
|
45
|
-
osmosislocal: {
|
|
46
|
-
id: 'connection-0',
|
|
47
|
-
client_id: '07-tendermint-2',
|
|
48
|
-
counterparty: {
|
|
49
|
-
client_id: '07-tendermint-2',
|
|
50
|
-
connection_id: 'connection-1',
|
|
51
|
-
prefix: {
|
|
52
|
-
key_prefix: '',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
state: IBCConnectionState.STATE_OPEN,
|
|
56
|
-
transferChannel: {
|
|
57
|
-
portId: 'transfer',
|
|
58
|
-
channelId: 'channel-0',
|
|
59
|
-
counterPartyChannelId: 'channel-1',
|
|
60
|
-
counterPartyPortId: 'transfer',
|
|
61
|
-
ordering: Order.ORDER_UNORDERED,
|
|
62
|
-
state: IBCChannelState.STATE_OPEN,
|
|
63
|
-
version: 'ics20-1',
|
|
64
|
-
},
|
|
65
|
-
versions: [{ identifier: '', features: ['', ''] }],
|
|
66
|
-
delay_period: 0n,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @returns {Pick<CosmosChainInfo, 'connections' | 'chainId'>}
|
|
72
|
-
*/
|
|
73
|
-
export const prepareMockChainInfo = () => {
|
|
74
|
-
return harden({
|
|
75
|
-
chainId: 'agoriclocal',
|
|
76
|
-
connections: connectionEntries,
|
|
77
|
-
});
|
|
78
|
-
};
|