@agoric/orchestration 0.1.1-dev-8879538.0 → 0.1.1-dev-35d20eb.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/examples/stakeAtom.contract.d.ts.map +1 -1
- package/src/examples/stakeAtom.contract.js +11 -12
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/examples/stakeBld.contract.js +1 -2
- package/src/examples/swapExample.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.js +11 -6
- package/src/examples/unbondExample.contract.d.ts.map +1 -1
- package/src/examples/unbondExample.contract.js +4 -4
- package/src/exos/chainAccountKit.d.ts +6 -2
- package/src/exos/chainAccountKit.d.ts.map +1 -1
- package/src/exos/chainAccountKit.js +14 -10
- package/src/exos/icqConnectionKit.d.ts.map +1 -1
- package/src/exos/icqConnectionKit.js +9 -8
- package/src/exos/local-chain-account-kit.d.ts +8 -7
- package/src/exos/local-chain-account-kit.d.ts.map +1 -1
- package/src/exos/local-chain-account-kit.js +8 -7
- package/src/exos/stakingAccountKit.d.ts +11 -9
- package/src/exos/stakingAccountKit.d.ts.map +1 -1
- package/src/exos/stakingAccountKit.js +13 -11
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +0 -1
- package/src/proposals/orchestration-proposal.d.ts.map +1 -1
- package/src/proposals/orchestration-proposal.js +1 -1
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.js +11 -3
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeBld.js +14 -2
- package/src/service.d.ts +3 -4
- package/src/service.d.ts.map +1 -1
- package/src/service.js +9 -10
- package/src/utils/address.d.ts.map +1 -1
- package/src/utils/address.js +15 -10
- package/src/utils/cosmos.d.ts.map +1 -1
- package/src/utils/cosmos.js +1 -2
- package/src/utils/mockChainInfo.js +3 -3
- package/src/utils/orc.d.ts +4 -2
- package/src/utils/orc.d.ts.map +1 -1
- package/src/utils/orc.js +4 -2
- package/src/utils/packet.d.ts +22 -16
- package/src/utils/packet.d.ts.map +1 -1
- package/src/utils/packet.js +22 -16
- package/src/utils/time.d.ts +6 -4
- package/src/utils/time.d.ts.map +1 -1
- package/src/utils/time.js +8 -6
- package/src/vat-orchestration.d.ts.map +1 -1
- package/src/vat-orchestration.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-35d20eb.0+35d20eb",
|
|
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-35d20eb.0+35d20eb",
|
|
35
|
+
"@agoric/cosmic-proto": "0.4.1-dev-35d20eb.0+35d20eb",
|
|
36
|
+
"@agoric/ertp": "0.16.3-dev-35d20eb.0+35d20eb",
|
|
37
|
+
"@agoric/internal": "0.3.3-dev-35d20eb.0+35d20eb",
|
|
38
|
+
"@agoric/network": "0.1.1-dev-35d20eb.0+35d20eb",
|
|
39
|
+
"@agoric/notifier": "0.6.3-dev-35d20eb.0+35d20eb",
|
|
40
|
+
"@agoric/store": "0.9.3-dev-35d20eb.0+35d20eb",
|
|
41
|
+
"@agoric/time": "0.3.3-dev-35d20eb.0+35d20eb",
|
|
42
|
+
"@agoric/vat-data": "0.5.3-dev-35d20eb.0+35d20eb",
|
|
43
|
+
"@agoric/vats": "0.15.2-dev-35d20eb.0+35d20eb",
|
|
44
|
+
"@agoric/vow": "0.1.1-dev-35d20eb.0+35d20eb",
|
|
45
|
+
"@agoric/zoe": "0.26.3-dev-35d20eb.0+35d20eb",
|
|
46
|
+
"@agoric/zone": "0.2.3-dev-35d20eb.0+35d20eb",
|
|
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.38
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "35d20ebc6d57520d19faea3f6e507e6f9bf1682e"
|
|
88
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeAtom.contract.d.ts","sourceRoot":"","sources":["stakeAtom.contract.js"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"stakeAtom.contract.d.ts","sourceRoot":"","sources":["stakeAtom.contract.js"],"names":[],"mappings":";;;;;;;;;AAiDO,2BATI,GAAG,CAAC,cAAc,CAAC;;;;;;;;;iBAGZ,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+FAiFq/E,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;GAH5hF;;;;eAvFe,MAAM;;0BAyFR,OAAO,KAAK;iCAxHmB,kBAAkB;kCAC7B,cAAc;kCAYjB,cAAc;6BAFnB,kBAAkB"}
|
|
@@ -13,10 +13,10 @@ import { prepareStakingAccountKit } from '../exos/stakingAccountKit.js';
|
|
|
13
13
|
|
|
14
14
|
const trace = makeTracer('StakeAtom');
|
|
15
15
|
/**
|
|
16
|
-
* @import {
|
|
17
|
-
* @import {
|
|
18
|
-
* @import {
|
|
19
|
-
* @import {
|
|
16
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
17
|
+
* @import {IBCConnectionID} from '@agoric/vats';
|
|
18
|
+
* @import {TimerService} from '@agoric/time';
|
|
19
|
+
* @import {ICQConnection, OrchestrationService} from '../types.js';
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
export const meta = harden({
|
|
@@ -31,20 +31,19 @@ export const privateArgsShape = meta.privateArgsShape;
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* @typedef {{
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* hostConnectionId: IBCConnectionID;
|
|
35
|
+
* controllerConnectionId: IBCConnectionID;
|
|
36
|
+
* bondDenom: string;
|
|
37
37
|
* }} StakeAtomTerms
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
41
|
* @param {ZCF<StakeAtomTerms>} zcf
|
|
43
42
|
* @param {{
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
43
|
+
* orchestration: OrchestrationService;
|
|
44
|
+
* storageNode: StorageNode;
|
|
45
|
+
* marshaller: Marshaller;
|
|
46
|
+
* timer: TimerService;
|
|
48
47
|
* }} privateArgs
|
|
49
48
|
* @param {Baggage} baggage
|
|
50
49
|
*/
|
|
@@ -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":"AA+BO,2BAVI,GAAG;gBAEG,OAAO,gCAAgC,EAAE,UAAU;gBACnD,UAAU;iBACT,WAAW;;;YAIlB,OAAO,kBAAkB,EAAE,OAAO;;QA+CvC;;WAEG;;;;;;;;;;+DAuCgC,OAAO,KAAK,CAAC;;;iEAWuP,OAAO,KAAK,CAAC;;;;;;;;;;;+DAAs4B,OAAO,KAAK,CAAC;;;iEAA+yB,OAAO,KAAK,CAAC;iCArEp+D,QAAQ,KAAK,CAClD,mBAA2B,OAAO;iCAiBN,OAAO,KAAK,CAAC;;;+BAclB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;QAiBnB;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBR;kCAhH0C,cAAc;gCAAd,cAAc"}
|
|
@@ -19,7 +19,6 @@ import { prepareMockChainInfo } from '../utils/mockChainInfo.js';
|
|
|
19
19
|
const trace = makeTracer('StakeBld');
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
22
|
* @param {ZCF} zcf
|
|
24
23
|
* @param {{
|
|
25
24
|
* localchain: import('@agoric/vats/src/localchain.js').LocalChain;
|
|
@@ -28,7 +27,7 @@ const trace = makeTracer('StakeBld');
|
|
|
28
27
|
* timerService: TimerService;
|
|
29
28
|
* timerBrand: TimerBrand;
|
|
30
29
|
* }} privateArgs
|
|
31
|
-
* @param {import(
|
|
30
|
+
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
32
31
|
*/
|
|
33
32
|
export const start = async (zcf, privateArgs, baggage) => {
|
|
34
33
|
const BLD = zcf.getTerms().brands.In;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AASA;;;;;;;GAOG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAUrB;AASK,0CAHI,KAAK;;;EAIsC;AAY/C,2BATI,GAAG;;;;
|
|
1
|
+
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AASA;;;;;;;GAOG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAUrB;AASK,0CAHI,KAAK;;;EAIsC;AAY/C,2BATI,GAAG;;;;8BAEqB,MAC9B,KAAI,CAAC;6BAeN,QAAG,KACJ,CAAC,mBACW,OACV;6BAkBO,OAAO,KAAI,CAAC;;;2BAe0B,EAAE;;uBAsC6qC,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;oBAhE38D,MAAM,CAAC,KAAK,CAAC;;;;;oBAAb,MAAM,CAAC,KAAK,CAAC;;;;GA+D7B;4BAvHwB,kBAAkB;gCAHwB,aAAa;kCACjD,cAAc;0BAItB,cAAc;4CAL8B,aAAa"}
|
|
@@ -41,11 +41,11 @@ export const makeNatAmountShape = (brand, min) =>
|
|
|
41
41
|
/**
|
|
42
42
|
* @param {ZCF} zcf
|
|
43
43
|
* @param {{
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
44
|
+
* localchain: Remote<LocalChain>;
|
|
45
|
+
* orchestrationService: Remote<OrchestrationService> | null;
|
|
46
|
+
* storageNode: Remote<StorageNode>;
|
|
47
|
+
* timerService: Remote<TimerService> | null;
|
|
48
|
+
* zone: Zone;
|
|
49
49
|
* }} privateArgs
|
|
50
50
|
*/
|
|
51
51
|
export const start = async (zcf, privateArgs) => {
|
|
@@ -64,7 +64,12 @@ export const start = async (zcf, privateArgs) => {
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
/** deprecated historical example */
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* @type {OfferHandler<
|
|
69
|
+
* unknown,
|
|
70
|
+
* { staked: Amount<'nat'>; validator: CosmosValidatorAddress }
|
|
71
|
+
* >}
|
|
72
|
+
*/
|
|
68
73
|
const swapAndStakeHandler = orchestrate(
|
|
69
74
|
'LSTTia',
|
|
70
75
|
{ zcf },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AAwBO,2BATI,GAAG;;;;
|
|
1
|
+
{"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AAwBO,2BATI,GAAG;;;;8BA8BD,MAAM,KAAK,CAAC;6BAQjB,QAAQ,KAAK,CAAC,mBAA2B,OAE/C;6BAcI,OAAG,KAAK,CAAC;;;2BAiB+I,EAAE;;uBAAupE,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;GADjjG;4BA3EwB,kBAAkB;gCAJwB,aAAa;kCACjD,cAAc;6BACnB,kBAAkB"}
|
|
@@ -15,10 +15,10 @@ import { makeOrchestrationFacade } from '../facade.js';
|
|
|
15
15
|
/**
|
|
16
16
|
* @param {ZCF} zcf
|
|
17
17
|
* @param {{
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* localchain: Remote<LocalChain>;
|
|
19
|
+
* orchestrationService: Remote<OrchestrationService>;
|
|
20
|
+
* storageNode: Remote<StorageNode>;
|
|
21
|
+
* timerService: Remote<TimerService>;
|
|
22
22
|
* }} privateArgs
|
|
23
23
|
* @param {Baggage} baggage
|
|
24
24
|
*/
|
|
@@ -20,10 +20,13 @@ export function prepareChainAccountKit(zone: Zone): (port: Port, requestedRemote
|
|
|
20
20
|
getPort(): Port;
|
|
21
21
|
executeTx(): never;
|
|
22
22
|
/**
|
|
23
|
-
* Submit a transaction on behalf of the remote account for execution on
|
|
23
|
+
* Submit a transaction on behalf of the remote account for execution on
|
|
24
|
+
* the remote chain.
|
|
25
|
+
*
|
|
24
26
|
* @param {AnyJson[]} msgs
|
|
25
27
|
* @param {Omit<TxBody, 'messages'>} [opts]
|
|
26
|
-
* @returns {Promise<string>} - base64 encoded bytes string. Can be
|
|
28
|
+
* @returns {Promise<string>} - base64 encoded bytes string. Can be
|
|
29
|
+
* decoded using the corresponding `Msg*Response` object.
|
|
27
30
|
* @throws {Error} if packet fails to send or an error is returned
|
|
28
31
|
*/
|
|
29
32
|
executeEncodedTx(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/google/protobuf/any.js").Any>[], opts?: Omit<TxBody, "messages"> | undefined): Promise<string>;
|
|
@@ -34,6 +37,7 @@ export function prepareChainAccountKit(zone: Zone): (port: Port, requestedRemote
|
|
|
34
37
|
deposit(payment: any): Promise<never>;
|
|
35
38
|
/**
|
|
36
39
|
* get Purse for a brand to .withdraw() a Payment from the account
|
|
40
|
+
*
|
|
37
41
|
* @param {Brand} brand
|
|
38
42
|
*/
|
|
39
43
|
getPurse(brand: Brand): Promise<never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainAccountKit.d.ts","sourceRoot":"","sources":["chainAccountKit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;GAYG;AAcI;;QAqBC;;WAEG;;;;;;QAyBH
|
|
1
|
+
{"version":3,"file":"chainAccountKit.d.ts","sourceRoot":"","sources":["chainAccountKit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;GAYG;AAcI;;QAqBC;;WAEG;;;;;;QAyBH;;;;;;;;;WASG;mLAHU,OAAO,CAAC,MAAM,CAAC;QAa5B;;WAEG;;;QAaH;;;;WAIG;wBADQ,KAAK;;;QAQhB;;;;WAIG;;;;;GAyBR;qCAvJW,0BAA0B;;;;;4BAsBX,MAAM;;;;8BAmIrB,UAAU,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;0BArK5C,mBAAmB;0BACP,iBAAiB;kCAKrB,aAAa;4BAFnB,8CAA8C;gCAHpC,iBAAiB;4BAC3B,aAAa"}
|
|
@@ -13,19 +13,19 @@ import {
|
|
|
13
13
|
import { makeTxPacket, parseTxPacket } from '../utils/packet.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @import {
|
|
17
|
-
* @import {
|
|
18
|
-
* @import {
|
|
19
|
-
* @import {
|
|
20
|
-
* @import {
|
|
21
|
-
* @import {
|
|
22
|
-
* @import {
|
|
16
|
+
* @import {Zone} from '@agoric/base-zone';
|
|
17
|
+
* @import {Connection, Port} from '@agoric/network';
|
|
18
|
+
* @import {Remote} from '@agoric/vow';
|
|
19
|
+
* @import {AnyJson} from '@agoric/cosmic-proto';
|
|
20
|
+
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
21
|
+
* @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
|
|
22
|
+
* @import {ChainAddress} from '../types.js';
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
const { Fail } = assert;
|
|
26
26
|
const trace = makeTracer('ChainAccountKit');
|
|
27
27
|
|
|
28
|
-
/** @typedef {'UNPARSABLE_CHAIN_ADDRESS'}
|
|
28
|
+
/** @typedef {'UNPARSABLE_CHAIN_ADDRESS'} UnparsableChainAddress */
|
|
29
29
|
const UNPARSABLE_CHAIN_ADDRESS = 'UNPARSABLE_CHAIN_ADDRESS';
|
|
30
30
|
|
|
31
31
|
export const ChainAccountI = M.interface('ChainAccount', {
|
|
@@ -103,10 +103,13 @@ export const prepareChainAccountKit = zone =>
|
|
|
103
103
|
throw new Error('not yet implemented');
|
|
104
104
|
},
|
|
105
105
|
/**
|
|
106
|
-
* Submit a transaction on behalf of the remote account for execution on
|
|
106
|
+
* Submit a transaction on behalf of the remote account for execution on
|
|
107
|
+
* the remote chain.
|
|
108
|
+
*
|
|
107
109
|
* @param {AnyJson[]} msgs
|
|
108
110
|
* @param {Omit<TxBody, 'messages'>} [opts]
|
|
109
|
-
* @returns {Promise<string>} - base64 encoded bytes string. Can be
|
|
111
|
+
* @returns {Promise<string>} - base64 encoded bytes string. Can be
|
|
112
|
+
* decoded using the corresponding `Msg*Response` object.
|
|
110
113
|
* @throws {Error} if packet fails to send or an error is returned
|
|
111
114
|
*/
|
|
112
115
|
executeEncodedTx(msgs, opts) {
|
|
@@ -135,6 +138,7 @@ export const prepareChainAccountKit = zone =>
|
|
|
135
138
|
},
|
|
136
139
|
/**
|
|
137
140
|
* get Purse for a brand to .withdraw() a Payment from the account
|
|
141
|
+
*
|
|
138
142
|
* @param {Brand} brand
|
|
139
143
|
*/
|
|
140
144
|
async getPurse(brand) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icqConnectionKit.d.ts","sourceRoot":"","sources":["icqConnectionKit.js"],"names":[],"mappings":"AAoBA,2DAGE;AAEF;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"icqConnectionKit.d.ts","sourceRoot":"","sources":["icqConnectionKit.js"],"names":[],"mappings":"AAoBA,2DAGE;AAEF;;;;GAIG;AA0BI;;;;QA8BC;;;;WAIG;;;;QAYH;;;;WAIG;;;;;GAgBR;;;;;;;+BAEW,UAAU,CAAC,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;4BACtD,gBAAgB,CAAC,YAAY,CAAC;0BAnHrB,mBAAmB;0BACP,iBAAiB;kCAGN,+CAA+C;8BADlE,sBAAsB;mCACH,+CAA+C;gCAH1D,iBAAiB;4BAC3B,aAAa"}
|
|
@@ -39,16 +39,17 @@ export const ICQConnectionI = M.interface('ICQConnection', {
|
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Prepares an ICQ Connection Kit based on the
|
|
42
|
+
* Prepares an ICQ Connection Kit based on the
|
|
43
|
+
* {@link https://github.com/cosmos/ibc-apps/blob/e9b46e4bf0ad0a66cf6bc53b5e5496f6e2b4b02b/modules/async-icq/README.md | `icq/v1` IBC application protocol}.
|
|
43
44
|
*
|
|
44
|
-
* `icq/v1`, also referred to as `async-icq`, is a protocol for asynchronous
|
|
45
|
-
* between IBC-enabled chains. It allows a chain to send queries to
|
|
46
|
-
* and receive responses asynchronously.
|
|
45
|
+
* `icq/v1`, also referred to as `async-icq`, is a protocol for asynchronous
|
|
46
|
+
* queries between IBC-enabled chains. It allows a chain to send queries to
|
|
47
|
+
* another chain and receive responses asynchronously.
|
|
47
48
|
*
|
|
48
|
-
* The ICQ connection kit provides the necessary functionality to establish and
|
|
49
|
-
* an ICQ connection between two chains. It includes methods for
|
|
50
|
-
* and remote addresses of the connection, as well as
|
|
51
|
-
* connection events.
|
|
49
|
+
* The ICQ connection kit provides the necessary functionality to establish and
|
|
50
|
+
* manage an ICQ connection between two chains. It includes methods for
|
|
51
|
+
* retrieving the local and remote addresses of the connection, as well as
|
|
52
|
+
* sending queries and handling connection events.
|
|
52
53
|
*
|
|
53
54
|
* @param {Zone} zone
|
|
54
55
|
*/
|
|
@@ -13,7 +13,6 @@ export function prepareLocalChainAccountKit(zone: Zone, makeRecorderKit: <T>(sto
|
|
|
13
13
|
}) => import("@endo/exo").GuardedKit<{
|
|
14
14
|
invitationMakers: {
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
16
|
* @param {string} validatorAddress
|
|
18
17
|
* @param {Amount<'nat'>} ertpAmount
|
|
19
18
|
*/
|
|
@@ -36,7 +35,6 @@ export function prepareLocalChainAccountKit(zone: Zone, makeRecorderKit: <T>(sto
|
|
|
36
35
|
};
|
|
37
36
|
};
|
|
38
37
|
/**
|
|
39
|
-
*
|
|
40
38
|
* @param {string} validatorAddress
|
|
41
39
|
* @param {Amount<'nat'>} ertpAmount
|
|
42
40
|
*/
|
|
@@ -44,15 +42,15 @@ export function prepareLocalChainAccountKit(zone: Zone, makeRecorderKit: <T>(sto
|
|
|
44
42
|
'@type': "/cosmos.staking.v1beta1.MsgDelegateResponse";
|
|
45
43
|
}>>;
|
|
46
44
|
/**
|
|
47
|
-
*
|
|
48
45
|
* @param {string} validatorAddress
|
|
49
46
|
* @param {Amount<'nat'>} ertpAmount
|
|
50
47
|
* @returns {Promise<void>}
|
|
51
48
|
*/
|
|
52
49
|
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<void>;
|
|
53
50
|
/**
|
|
54
|
-
* Starting a transfer revokes the account holder. The associated
|
|
55
|
-
* will get a special notification that the account is being
|
|
51
|
+
* Starting a transfer revokes the account holder. The associated
|
|
52
|
+
* updater will get a special notification that the account is being
|
|
53
|
+
* transferred.
|
|
56
54
|
*/
|
|
57
55
|
/** @type {LocalChainAccount['deposit']} */
|
|
58
56
|
deposit(payment: Payment<"nat">, optAmountShape?: Pattern): Promise<globalThis.Amount>;
|
|
@@ -67,9 +65,12 @@ export function prepareLocalChainAccountKit(zone: Zone, makeRecorderKit: <T>(sto
|
|
|
67
65
|
*/
|
|
68
66
|
getAddress(): string;
|
|
69
67
|
/**
|
|
70
|
-
* @param {AmountArg} amount an ERTP {@link Amount} or a
|
|
68
|
+
* @param {AmountArg} amount an ERTP {@link Amount} or a
|
|
69
|
+
* {@link DenomAmount}
|
|
71
70
|
* @param {ChainAddress} destination
|
|
72
|
-
* @param {IBCMsgTransferOptions} [opts] if either timeoutHeight or
|
|
71
|
+
* @param {IBCMsgTransferOptions} [opts] if either timeoutHeight or
|
|
72
|
+
* timeoutTimestamp are not supplied, a default timeoutTimestamp will
|
|
73
|
+
* be set for 5 minutes in the future
|
|
73
74
|
* @returns {Promise<void>}
|
|
74
75
|
*/
|
|
75
76
|
transfer(amount: AmountArg, destination: ChainAddress, opts?: IBCMsgTransferOptions | undefined): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-chain-account-kit.d.ts","sourceRoot":"","sources":["local-chain-account-kit.js"],"names":[],"mappings":"AAsEO,
|
|
1
|
+
{"version":3,"file":"local-chain-account-kit.d.ts","sourceRoot":"","sources":["local-chain-account-kit.js"],"names":[],"mappings":"AAsEO,0FAuED,WACD,GAAE,QACC,OAAA,WAAU,EAAE,MAAM,CAChB,WAAA,CAAC,CAAC,0HA/ED,GAAG,uEAGH,eAAe;;;0BA5Bd,MAAM,KAAK,CAAC;yBAWX,QAAQ,KAAK,CAAC,mBACZ,OAAO;yBAkBmB,OACvC,KAAK,CACP;;;uBAiBoB,EAAE;;;iBASP,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;yBAjKtC,QAAQ,KAAK,CAAC,mBACZ,OAAO;QAoKd,4CAA4C;yBAlJX,OACvC,KAAK,CACP;QAoJQ,6CAA6C;;;uBAnIjC,EAAE;QAwId;;WAEG;;QAIH;;;;;;;;WAQG;0GADU,OAAO,CAAC,IAAI,CAAC;;GA6CjC;;;;;aA1Pa,MAAM;;;;;;0BAOR,MAAM,KAAK,CAAC;yBAWX,QAAQ,KAAK,CAAC,mBACZ,OAAO;yBAkBmB,OACvC,KAAK,CACP;;;uBAiBoB,EAAE;;;;mCAmMR,UAAU,CAAC,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC;0BAvQjD,cAAc;iCADU,6CAA6C;kCAEjD,cAAc;gCAAd,cAAc;+BAHsC,uBAAuB;kCAAvB,uBAAuB;2CAAvB,uBAAuB"}
|
|
@@ -110,7 +110,6 @@ export const prepareLocalChainAccountKit = (
|
|
|
110
110
|
{
|
|
111
111
|
invitationMakers: {
|
|
112
112
|
/**
|
|
113
|
-
*
|
|
114
113
|
* @param {string} validatorAddress
|
|
115
114
|
* @param {Amount<'nat'>} ertpAmount
|
|
116
115
|
*/
|
|
@@ -153,7 +152,6 @@ export const prepareLocalChainAccountKit = (
|
|
|
153
152
|
});
|
|
154
153
|
},
|
|
155
154
|
/**
|
|
156
|
-
*
|
|
157
155
|
* @param {string} validatorAddress
|
|
158
156
|
* @param {Amount<'nat'>} ertpAmount
|
|
159
157
|
*/
|
|
@@ -178,7 +176,6 @@ export const prepareLocalChainAccountKit = (
|
|
|
178
176
|
return result;
|
|
179
177
|
},
|
|
180
178
|
/**
|
|
181
|
-
*
|
|
182
179
|
* @param {string} validatorAddress
|
|
183
180
|
* @param {Amount<'nat'>} ertpAmount
|
|
184
181
|
* @returns {Promise<void>}
|
|
@@ -209,8 +206,9 @@ export const prepareLocalChainAccountKit = (
|
|
|
209
206
|
);
|
|
210
207
|
},
|
|
211
208
|
/**
|
|
212
|
-
* Starting a transfer revokes the account holder. The associated
|
|
213
|
-
* will get a special notification that the account is being
|
|
209
|
+
* Starting a transfer revokes the account holder. The associated
|
|
210
|
+
* updater will get a special notification that the account is being
|
|
211
|
+
* transferred.
|
|
214
212
|
*/
|
|
215
213
|
/** @type {LocalChainAccount['deposit']} */
|
|
216
214
|
async deposit(payment, optAmountShape) {
|
|
@@ -232,9 +230,12 @@ export const prepareLocalChainAccountKit = (
|
|
|
232
230
|
return NonNullish(this.state.address, 'Chain address not available.');
|
|
233
231
|
},
|
|
234
232
|
/**
|
|
235
|
-
* @param {AmountArg} amount an ERTP {@link Amount} or a
|
|
233
|
+
* @param {AmountArg} amount an ERTP {@link Amount} or a
|
|
234
|
+
* {@link DenomAmount}
|
|
236
235
|
* @param {ChainAddress} destination
|
|
237
|
-
* @param {IBCMsgTransferOptions} [opts] if either timeoutHeight or
|
|
236
|
+
* @param {IBCMsgTransferOptions} [opts] if either timeoutHeight or
|
|
237
|
+
* timeoutTimestamp are not supplied, a default timeoutTimestamp will
|
|
238
|
+
* be set for 5 minutes in the future
|
|
238
239
|
* @returns {Promise<void>}
|
|
239
240
|
*/
|
|
240
241
|
async transfer(amount, destination, opts) {
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {{
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* topicKit: RecorderKit<StakingAccountNotification>;
|
|
8
|
+
* account: IcaAccount;
|
|
9
|
+
* chainAddress: ChainAddress;
|
|
10
|
+
* icqConnection: ICQConnection;
|
|
11
|
+
* bondDenom: string;
|
|
12
|
+
* timer: TimerService;
|
|
13
13
|
* }} State
|
|
14
14
|
*/
|
|
15
15
|
export const IcaAccountHolderI: import("@endo/patterns").InterfaceGuard<{
|
|
@@ -45,7 +45,6 @@ export function prepareStakingAccountKit(zone: Zone, makeRecorderKit: <T>(storag
|
|
|
45
45
|
};
|
|
46
46
|
invitationMakers: {
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
48
|
* @param {CosmosValidatorAddress} validator
|
|
50
49
|
* @param {Amount<'nat'>} amount
|
|
51
50
|
*/
|
|
@@ -64,8 +63,9 @@ export function prepareStakingAccountKit(zone: Zone, makeRecorderKit: <T>(storag
|
|
|
64
63
|
Undelegate(delegations: Delegation[]): Promise<Invitation<void, undefined>>;
|
|
65
64
|
CloseAccount(): never;
|
|
66
65
|
/**
|
|
67
|
-
* Starting a transfer revokes the account holder. The associated
|
|
68
|
-
* will get a special notification that the account is being
|
|
66
|
+
* Starting a transfer revokes the account holder. The associated
|
|
67
|
+
* updater will get a special notification that the account is being
|
|
68
|
+
* transferred.
|
|
69
69
|
*/
|
|
70
70
|
TransferAccount(): never;
|
|
71
71
|
};
|
|
@@ -81,12 +81,14 @@ export function prepareStakingAccountKit(zone: Zone, makeRecorderKit: <T>(storag
|
|
|
81
81
|
getAddress(): ChainAddress;
|
|
82
82
|
/**
|
|
83
83
|
* _Assumes users has already sent funds to their ICA, until #9193
|
|
84
|
+
*
|
|
84
85
|
* @param {CosmosValidatorAddress} validator
|
|
85
86
|
* @param {AmountArg} amount
|
|
86
87
|
*/
|
|
87
88
|
delegate(validator: CosmosValidatorAddress, amount: AmountArg): Promise<void>;
|
|
88
89
|
/**
|
|
89
90
|
* _Assumes users has already sent funds to their ICA, until #9193
|
|
91
|
+
*
|
|
90
92
|
* @param {CosmosValidatorAddress} srcValidator
|
|
91
93
|
* @param {CosmosValidatorAddress} dstValidator
|
|
92
94
|
* @param {AmountArg} amount
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakingAccountKit.d.ts","sourceRoot":"","sources":["stakingAccountKit.js"],"names":[],"mappings":"AAmDA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH;;;;;;;;;GAeG;AAOH,6CAGE;AAgBK,
|
|
1
|
+
{"version":3,"file":"stakingAccountKit.d.ts","sourceRoot":"","sources":["stakingAccountKit.js"],"names":[],"mappings":"AAmDA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH;;;;;;;;;GAeG;AAOH,6CAGE;AAgBK,uFAqCD,WAAW,GAAE,QAAS,OAAO,WAC5B,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,0HAxClB,GAAG;;iBAkCC,WAAW;;;;;;;;;QAelB,wDAAwD;;;QAWxD;;;WAGG;;;;QAgBH;;;WAGG;4DADQ,MAAM,CAAC,KAAK,CAAC;QAUxB;;;;WAIG;;QAaH,gDAAgD;;QAShD;;WAEG;;;QAYH;;;;WAIG;;;;;;;;;;;QAmBH,8BAA8B;;QAI9B;;;;;WAKG;;QAkBH;;;;;;WAMG;;QAmBH;;;WAGG;;QAmBH;;;WAGG;;;QA0BH;;WAEG;;;GA0CV;;;;;;;;;;;;;eAzVe,MAAM;;;gCA2VR,UAAU,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;kCACvD,iBAAiB,CAAC,QAAQ,CAAC;0BA7WlB,cAAc;iCAJU,6CAA6C;kCADqC,aAAa;gCAAb,aAAa;kCAI/G,cAAc;+BAJoF,aAAa;0BAEvH,kDAAkD;4CAFwD,aAAa;iCAAb,aAAa;gCAGjH,wDAAwD"}
|
|
@@ -56,12 +56,12 @@ const { Fail } = assert;
|
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* @typedef {{
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
59
|
+
* topicKit: RecorderKit<StakingAccountNotification>;
|
|
60
|
+
* account: IcaAccount;
|
|
61
|
+
* chainAddress: ChainAddress;
|
|
62
|
+
* icqConnection: ICQConnection;
|
|
63
|
+
* bondDenom: string;
|
|
64
|
+
* timer: TimerService;
|
|
65
65
|
* }} State
|
|
66
66
|
*/
|
|
67
67
|
|
|
@@ -98,7 +98,7 @@ const expect = (actual, expected, message) => {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
/** @type {(c: { denom: string
|
|
101
|
+
/** @type {(c: { denom: string; amount: string }) => DenomAmount} */
|
|
102
102
|
const toDenomAmount = c => ({ denom: c.denom, value: BigInt(c.amount) });
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -184,7 +184,6 @@ export const prepareStakingAccountKit = (zone, makeRecorderKit, zcf) => {
|
|
|
184
184
|
},
|
|
185
185
|
invitationMakers: {
|
|
186
186
|
/**
|
|
187
|
-
*
|
|
188
187
|
* @param {CosmosValidatorAddress} validator
|
|
189
188
|
* @param {Amount<'nat'>} amount
|
|
190
189
|
*/
|
|
@@ -237,8 +236,9 @@ export const prepareStakingAccountKit = (zone, makeRecorderKit, zcf) => {
|
|
|
237
236
|
throw Error('not yet implemented');
|
|
238
237
|
},
|
|
239
238
|
/**
|
|
240
|
-
* Starting a transfer revokes the account holder. The associated
|
|
241
|
-
* will get a special notification that the account is being
|
|
239
|
+
* Starting a transfer revokes the account holder. The associated
|
|
240
|
+
* updater will get a special notification that the account is being
|
|
241
|
+
* transferred.
|
|
242
242
|
*/
|
|
243
243
|
TransferAccount() {
|
|
244
244
|
throw Error('not yet implemented');
|
|
@@ -264,6 +264,7 @@ export const prepareStakingAccountKit = (zone, makeRecorderKit, zcf) => {
|
|
|
264
264
|
},
|
|
265
265
|
/**
|
|
266
266
|
* _Assumes users has already sent funds to their ICA, until #9193
|
|
267
|
+
*
|
|
267
268
|
* @param {CosmosValidatorAddress} validator
|
|
268
269
|
* @param {AmountArg} amount
|
|
269
270
|
*/
|
|
@@ -286,6 +287,7 @@ export const prepareStakingAccountKit = (zone, makeRecorderKit, zcf) => {
|
|
|
286
287
|
},
|
|
287
288
|
/**
|
|
288
289
|
* _Assumes users has already sent funds to their ICA, until #9193
|
|
290
|
+
*
|
|
289
291
|
* @param {CosmosValidatorAddress} srcValidator
|
|
290
292
|
* @param {CosmosValidatorAddress} dstValidator
|
|
291
293
|
* @param {AmountArg} amount
|
|
@@ -397,7 +399,7 @@ export const prepareStakingAccountKit = (zone, makeRecorderKit, zcf) => {
|
|
|
397
399
|
const typeCheck = () => {
|
|
398
400
|
/** @type {any} */
|
|
399
401
|
const arg = null;
|
|
400
|
-
/** @satisfies {
|
|
402
|
+
/** @satisfies {StakingAccountActions} */
|
|
401
403
|
// eslint-disable-next-line no-unused-vars
|
|
402
404
|
const kit = makeStakingAccountKit(arg, arg, arg).holder;
|
|
403
405
|
};
|
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":"AA8IO;;;SANG,GAAG;;;;;;;;;;;;;8BA5ER,MAAM,KAAK,CAAC;6BAeT,QAAA,KAAK,CAAC,mBACA,OAAO;6BAkBX,OAAG,KAAK,CAAC;;;2BAiBW,EAAE;;uBA6E6L,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;IA7Bp9B;;;;;;;OAOG;gBAFkC,OAAO,EACrB,IAAI,6BAHhB,MAAM,OAEoB,OAAO,AAD1B,gCACmB,OAAO,WACrB,IAAI,AADgC,KAAK,MAAM,GACzD,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC;EAoBnD;kCAEa,UAAU,CAAC,OAAO,uBAAuB,CAAC;0BAtLjC,cAAc;kCACN,cAAc;4BAEpB,kBAAkB;kCAE4B,YAAY"}
|
package/src/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-proposal.d.ts","sourceRoot":"","sources":["orchestration-proposal.js"],"names":[],"mappings":"AA0BO;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestration-proposal.d.ts","sourceRoot":"","sources":["orchestration-proposal.js"],"names":[],"mappings":"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"}
|
|
@@ -18,7 +18,7 @@ import { V as E } from '@agoric/vow/vat.js';
|
|
|
18
18
|
* orchestrationVat: Producer<any>;
|
|
19
19
|
* };
|
|
20
20
|
* }} powers
|
|
21
|
-
* @param {{ options: { orchestrationRef: VatSourceRef }}} options
|
|
21
|
+
* @param {{ options: { orchestrationRef: VatSourceRef } }} options
|
|
22
22
|
*
|
|
23
23
|
* @typedef {{
|
|
24
24
|
* orchestration: ERef<OrchestrationVat>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAoBO,0OAXI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,SAAiB,EAAE,YAAY,OAoCc,IAAI,cACjD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2GAuDgjH,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eA1FrjH,CAAC;SACH,CAAC;KACH,CAAC;CACH;;kBAuDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;oCAnG+C,gCAAgC"}
|
|
@@ -2,13 +2,21 @@ import { makeTracer } from '@agoric/internal';
|
|
|
2
2
|
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
3
3
|
import { E } from '@endo/far';
|
|
4
4
|
|
|
5
|
-
/** @import {
|
|
5
|
+
/** @import {StakeAtomSF, StakeAtomTerms} from '../examples/stakeAtom.contract' */
|
|
6
6
|
|
|
7
7
|
const trace = makeTracer('StartStakeAtom', true);
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @param {BootstrapPowers & {
|
|
11
|
-
*
|
|
10
|
+
* @param {BootstrapPowers & {
|
|
11
|
+
* installation: {
|
|
12
|
+
* consume: {
|
|
13
|
+
* stakeAtom: Installation<
|
|
14
|
+
* import('../examples/stakeAtom.contract.js').start
|
|
15
|
+
* >;
|
|
16
|
+
* };
|
|
17
|
+
* };
|
|
18
|
+
* }} powers
|
|
19
|
+
* @param {{ options: StakeAtomTerms }} options
|
|
12
20
|
*/
|
|
13
21
|
export const startStakeAtom = async (
|
|
14
22
|
{
|
|
@@ -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":"AAkBO,kSAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,OAqB7B,GAAA;;;;0CAyBmB,MAAM,KAAK,CAAC;yCAoBzB,QAAG,KAAK,CAAC,mBAEP,OAAD;yCAqB+E,OAAO,KAAK,CAAC;;;uCAAgiB,EAAE;;mCAAupE,OAAO,sBAAsB,EAAE,SAAS;;;wCAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;wBA3D5/G,OAAM,kBAAkB,EAAE,OAAO;;;;;;;;;;;2EA2Do2C,OAAO,KAAK,CAAC;;;6EAAid,OAAO,KAAK,CAAC;;;;;;;;;;;2EAAs4B,OAAO,KAAK,CAAC;;;6EAA+yB,OAAO,KAAK,CAAC;6CAvBplH,QAAG,KAAK,CAAC,mBAEP,OAAD;6CAqB+E,OAAO,KAAK,CAAC;;;2CAAgiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAvF7nB,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAsDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BN;sBAjGqB,gCAAgC"}
|
|
@@ -6,7 +6,15 @@ import { E } from '@endo/far';
|
|
|
6
6
|
const trace = makeTracer('StartStakeBld', true);
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @param {BootstrapPowers & {
|
|
9
|
+
* @param {BootstrapPowers & {
|
|
10
|
+
* installation: {
|
|
11
|
+
* consume: {
|
|
12
|
+
* stakeBld: Installation<
|
|
13
|
+
* import('../../src/examples/stakeBld.contract.js').start
|
|
14
|
+
* >;
|
|
15
|
+
* };
|
|
16
|
+
* };
|
|
17
|
+
* }} powers
|
|
10
18
|
*/
|
|
11
19
|
export const startStakeBld = async ({
|
|
12
20
|
consume: {
|
|
@@ -39,7 +47,11 @@ export const startStakeBld = async ({
|
|
|
39
47
|
chainTimerServiceP.then(ts => E(ts).getTimerBrand()),
|
|
40
48
|
]);
|
|
41
49
|
|
|
42
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* @type {StartUpgradableOpts<
|
|
52
|
+
* import('../../src/examples/stakeBld.contract.js').start
|
|
53
|
+
* >}
|
|
54
|
+
*/
|
|
43
55
|
const startOpts = {
|
|
44
56
|
label: 'stakeBld',
|
|
45
57
|
installation: stakeBld,
|
package/src/service.d.ts
CHANGED
|
@@ -10,10 +10,9 @@ export function prepareOrchestrationTools(zone: Zone): {
|
|
|
10
10
|
};
|
|
11
11
|
public: {
|
|
12
12
|
/**
|
|
13
|
-
* @param {IBCConnectionID} hostConnectionId
|
|
14
|
-
*
|
|
15
|
-
* @param {IBCConnectionID} controllerConnectionId
|
|
16
|
-
* self connection_id
|
|
13
|
+
* @param {IBCConnectionID} hostConnectionId the counterparty
|
|
14
|
+
* connection_id
|
|
15
|
+
* @param {IBCConnectionID} controllerConnectionId self connection_id
|
|
17
16
|
* @returns {Promise<IcaAccount>}
|
|
18
17
|
*/
|
|
19
18
|
makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<IcaAccount>;
|
package/src/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["service.js"],"names":[],"mappings":"AAoDA;;;GAOG;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["service.js"],"names":[],"mappings":"AAoDA;;;GAOG;AA2GI;;;;;;;YAxDC;;;;;eAKG;;YAkBH;;;eAGG;;;;;;;;EAwCV;;;;;;;;;;;;;;yBAhJY,QAAQ,CACpB,MAAU,mBAAmB,EAC7B,mBAAuB,CAAC,MAAM,mBAAmB,CAAC,CAC/C;;;;;;;;;;;;;iCA0BU;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,cAAc,EAAE,kBAAkB,CAAA;CAAE;iCAsH1D,UAAU,CAAC,OAAO,yBAAyB,CAAC;+BAC5C,UAAU,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;mCACtD,gBAAgB,CAAC,QAAQ,CAAC;0BAxKjB,mBAAmB;gCAIoB,YAAY;4BAHjD,kBAAkB"}
|
package/src/service.js
CHANGED
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
} from './utils/address.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @import {
|
|
14
|
+
* @import {Zone} from '@agoric/base-zone';
|
|
15
15
|
* @import {Remote} from '@agoric/internal';
|
|
16
|
-
* @import {
|
|
17
|
-
* @import {
|
|
18
|
-
* @import {
|
|
16
|
+
* @import {Port, PortAllocator} from '@agoric/network';
|
|
17
|
+
* @import {IBCConnectionID} from '@agoric/vats';
|
|
18
|
+
* @import {ICQConnection, IcaAccount, ICQConnectionKit} from './types.js';
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
const { Fail, bare } = assert;
|
|
@@ -37,7 +37,7 @@ const { Fail, bare } = assert;
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* @typedef {MapStore<IBCConnectionID,ICQConnectionKit>} ICQConnectionStore
|
|
40
|
+
* @typedef {MapStore<IBCConnectionID, ICQConnectionKit>} ICQConnectionStore
|
|
41
41
|
*/
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -59,7 +59,7 @@ export const OrchestrationI = M.interface('Orchestration', {
|
|
|
59
59
|
),
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
/** @typedef {{ powers: PowerStore; icqConnections: ICQConnectionStore }
|
|
62
|
+
/** @typedef {{ powers: PowerStore; icqConnections: ICQConnectionStore }} OrchestrationState */
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* @param {Zone} zone
|
|
@@ -109,10 +109,9 @@ const prepareOrchestrationKit = (
|
|
|
109
109
|
},
|
|
110
110
|
public: {
|
|
111
111
|
/**
|
|
112
|
-
* @param {IBCConnectionID} hostConnectionId
|
|
113
|
-
*
|
|
114
|
-
* @param {IBCConnectionID} controllerConnectionId
|
|
115
|
-
* self connection_id
|
|
112
|
+
* @param {IBCConnectionID} hostConnectionId the counterparty
|
|
113
|
+
* connection_id
|
|
114
|
+
* @param {IBCConnectionID} controllerConnectionId self connection_id
|
|
116
115
|
* @returns {Promise<IcaAccount>}
|
|
117
116
|
*/
|
|
118
117
|
async makeAccount(hostConnectionId, controllerConnectionId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["address.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["address.js"],"names":[],"mappings":"AAoBO;;;;;sHAqBN;AAQM;cAHgB,MAAM;sHAS5B;AAaM,iLASN"}
|
package/src/utils/address.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { Fail } from '@agoric/assert';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @import {
|
|
5
|
-
* @import {
|
|
6
|
-
* @import {
|
|
4
|
+
* @import {IBCConnectionID} from '@agoric/vats';
|
|
5
|
+
* @import {ChainAddress} from '../types.js';
|
|
6
|
+
* @import {RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @param {IBCConnectionID} hostConnectionId Counterpart Connection ID
|
|
11
11
|
* @param {IBCConnectionID} controllerConnectionId Self Connection ID
|
|
12
12
|
* @param {object} [opts]
|
|
13
|
-
* @param {string} [opts.encoding] - message encoding format for the channel.
|
|
14
|
-
*
|
|
13
|
+
* @param {string} [opts.encoding] - message encoding format for the channel.
|
|
14
|
+
* default is `proto3`
|
|
15
|
+
* @param {'ordered' | 'unordered'} [opts.ordering] - channel ordering.
|
|
16
|
+
* currently only `ordered` is supported for ics27-1
|
|
15
17
|
* @param {string} [opts.txType] - default is `sdk_multi_msg`
|
|
16
18
|
* @param {string} [opts.version] - default is `ics27-1`
|
|
17
19
|
* @returns {RemoteIbcAddress}
|
|
@@ -41,7 +43,7 @@ export const makeICAChannelAddress = (
|
|
|
41
43
|
harden(makeICAChannelAddress);
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
|
-
* @param {IBCConnectionID}
|
|
46
|
+
* @param {IBCConnectionID} controllerConnectionId
|
|
45
47
|
* @param {{ version?: string }} [opts]
|
|
46
48
|
* @returns {RemoteIbcAddress}
|
|
47
49
|
*/
|
|
@@ -55,10 +57,13 @@ export const makeICQChannelAddress = (
|
|
|
55
57
|
harden(makeICQChannelAddress);
|
|
56
58
|
|
|
57
59
|
/**
|
|
58
|
-
* Parse a chain address from a remote address string.
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* Parse a chain address from a remote address string. Assumes the address
|
|
61
|
+
* string is in a JSON format and contains an "address" field. This function is
|
|
62
|
+
* designed to be safe against malformed inputs and unexpected data types, and
|
|
63
|
+
* will return `undefined` in those cases.
|
|
64
|
+
*
|
|
65
|
+
* @param {RemoteIbcAddress} remoteAddressString - remote address string,
|
|
66
|
+
* including version
|
|
62
67
|
* @returns {ChainAddress['address'] | undefined} returns undefined on error
|
|
63
68
|
*/
|
|
64
69
|
export const findAddressField = remoteAddressString => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["cosmos.js"],"names":[],"mappings":"AAIA,mFAAmF;AACnF,kCAAsC;
|
|
1
|
+
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["cosmos.js"],"names":[],"mappings":"AAIA,mFAAmF;AACnF,kCAAsC;AAO/B,2CAJI,OAAO,cACP,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GACf,MAAM,CAQlB;AAOM,kCAFmD,CAAC,UADhD,MAAM,gBACN,CAAC,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,KAAK,CAAC,KAY1D;oBAlCmB,6CAA6C"}
|
package/src/utils/cosmos.js
CHANGED
|
@@ -6,7 +6,6 @@ import { decodeBase64, encodeBase64 } from '@endo/base64';
|
|
|
6
6
|
export const maxClockSkew = 10n * 60n;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
9
|
* @param {unknown} response
|
|
11
10
|
* @param {(msg: any) => Any} toProtoMsg
|
|
12
11
|
* @returns {string}
|
|
@@ -22,7 +21,7 @@ export const encodeTxResponse = (response, toProtoMsg) => {
|
|
|
22
21
|
/**
|
|
23
22
|
* @template T
|
|
24
23
|
* @param {string} ackStr
|
|
25
|
-
* @param {(p: {typeUrl: string
|
|
24
|
+
* @param {(p: { typeUrl: string; value: Uint8Array }) => T} fromProtoMsg
|
|
26
25
|
*/
|
|
27
26
|
export const tryDecodeResponse = (ackStr, fromProtoMsg) => {
|
|
28
27
|
try {
|
|
@@ -13,9 +13,9 @@ import { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/conne
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* currently keyed by ChainId, as this is what we have
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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
19
|
* @type {Record<string, IBCConnectionInfo>}
|
|
20
20
|
*/
|
|
21
21
|
const connectionEntries = harden({
|
package/src/utils/orc.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ export namespace orcUtils {
|
|
|
2
2
|
function makeTransferMsg(_args: Omit<TransferMsg, "memo">): TransferMsg;
|
|
3
3
|
/**
|
|
4
4
|
* SwapExact or SwapMaxSlippage, with optional AfterAction
|
|
5
|
-
*
|
|
6
|
-
|
|
5
|
+
*
|
|
6
|
+
* @param {(SwapExact | SwapMaxSlippage) &
|
|
7
|
+
* (AfterAction | Record<string, never>)} _args
|
|
8
|
+
*
|
|
7
9
|
* @returns {TransferMsg}
|
|
8
10
|
*/
|
|
9
11
|
function makeOsmosisSwap(_args: (SwapExact | SwapMaxSlippage) & (AfterAction | Record<string, never>)): TransferMsg;
|
package/src/utils/orc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orc.d.ts","sourceRoot":"","sources":["orc.js"],"names":[],"mappings":";IASmB,wEAShB;IACD
|
|
1
|
+
{"version":3,"file":"orc.d.ts","sourceRoot":"","sources":["orc.js"],"names":[],"mappings":";IASmB,wEAShB;IACD;;;;;;;OAOG;IACH,oHASC;;iCApCqE,aAAa;+BAAb,aAAa;qCAAb,aAAa;iCAAb,aAAa"}
|
package/src/utils/orc.js
CHANGED
|
@@ -19,8 +19,10 @@ export const orcUtils = {
|
|
|
19
19
|
},
|
|
20
20
|
/**
|
|
21
21
|
* SwapExact or SwapMaxSlippage, with optional AfterAction
|
|
22
|
-
*
|
|
23
|
-
|
|
22
|
+
*
|
|
23
|
+
* @param {(SwapExact | SwapMaxSlippage) &
|
|
24
|
+
* (AfterAction | Record<string, never>)} _args
|
|
25
|
+
*
|
|
24
26
|
* @returns {TransferMsg}
|
|
25
27
|
*/
|
|
26
28
|
makeOsmosisSwap(_args) {
|
package/src/utils/packet.d.ts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* @import {InterchainQueryPacketData} from '@agoric/cosmic-proto/icq/v1/packet.js';
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Makes an IBC transaction packet from an array of messages. Expects the
|
|
9
|
-
* to be base64 encoded bytes.
|
|
10
|
-
*
|
|
8
|
+
* Makes an IBC transaction packet from an array of messages. Expects the
|
|
9
|
+
* `value` of each message to be base64 encoded bytes. Skips checks for
|
|
10
|
+
* malformed messages in favor of interface guards.
|
|
11
|
+
*
|
|
11
12
|
* @param {AnyJson[]} msgs
|
|
12
13
|
* @param {Partial<Omit<TxBody, 'messages'>>} [opts]
|
|
13
14
|
* @returns {string} stringified InterchainAccountPacketData
|
|
@@ -15,33 +16,38 @@
|
|
|
15
16
|
*/
|
|
16
17
|
export function makeTxPacket(msgs: JsonSafe<Any>[], opts?: Partial<Omit<TxBody, "messages">> | undefined): string;
|
|
17
18
|
/**
|
|
18
|
-
* Makes an IBC query packet from an array of query messages. Expects the `data`
|
|
19
|
-
* to be base64 encoded bytes.
|
|
20
|
-
*
|
|
19
|
+
* Makes an IBC query packet from an array of query messages. Expects the `data`
|
|
20
|
+
* of each message to be base64 encoded bytes. Skips checks for malformed
|
|
21
|
+
* messages in favor of interface guards.
|
|
22
|
+
*
|
|
21
23
|
* @param {JsonSafe<RequestQuery>[]} msgs
|
|
22
24
|
* @returns {string} stringified InterchainQueryPacketData
|
|
23
25
|
* @throws {Error} if malformed messages are provided
|
|
24
26
|
*/
|
|
25
27
|
export function makeQueryPacket(msgs: JsonSafe<RequestQuery>[]): string;
|
|
26
28
|
/**
|
|
27
|
-
* Looks for a result or error key in the response string, and returns
|
|
28
|
-
*
|
|
29
|
-
* Msg*Response object.
|
|
30
|
-
*
|
|
29
|
+
* Looks for a result or error key in the response string, and returns a
|
|
30
|
+
* Base64Bytes string. This string can be decoded using the corresponding
|
|
31
|
+
* Msg*Response object. Error strings seem to be plain text and do not need
|
|
32
|
+
* decoding.
|
|
33
|
+
*
|
|
31
34
|
* @param {string} response
|
|
32
35
|
* @returns {string} - base64 encoded bytes string
|
|
33
|
-
* @throws {Error} if error key is detected in response string, or result key is
|
|
36
|
+
* @throws {Error} if error key is detected in response string, or result key is
|
|
37
|
+
* not found
|
|
34
38
|
*/
|
|
35
39
|
export function parseTxPacket(response: string): string;
|
|
36
40
|
/**
|
|
37
41
|
* Looks for a result or error key in the response string. If a result is found,
|
|
38
|
-
* `responses` is decoded via `CosmosResponse`. The `key` and `value` fields on
|
|
39
|
-
* resulting entries are base64 encoded for inter-vat communication. These
|
|
40
|
-
* decoded using the corresponding Query*Response objects.
|
|
41
|
-
*
|
|
42
|
+
* `responses` is decoded via `CosmosResponse`. The `key` and `value` fields on
|
|
43
|
+
* the resulting entries are base64 encoded for inter-vat communication. These
|
|
44
|
+
* can be decoded using the corresponding Query*Response objects. Error strings
|
|
45
|
+
* seem to be plain text and do not need decoding.
|
|
46
|
+
*
|
|
42
47
|
* @param {string} response
|
|
43
48
|
* @returns {JsonSafe<ResponseQuery>[]}
|
|
44
|
-
* @throws {Error} if error key is detected in response string, or result key is
|
|
49
|
+
* @throws {Error} if error key is detected in response string, or result key is
|
|
50
|
+
* not found
|
|
45
51
|
*/
|
|
46
52
|
export function parseQueryPacket(response: string): JsonSafe<ResponseQuery>[];
|
|
47
53
|
import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packet.d.ts","sourceRoot":"","sources":["packet.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"packet.d.ts","sourceRoot":"","sources":["packet.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH;;;;;;;;;GASG;AACH,2GAHa,MAAM,CAmBlB;AAGD;;;;;;;;GAQG;AACH,iEAHa,MAAM,CAgBlB;AAGD;;;;;;;;;;GAUG;AACH,wCALW,MAAM,GACJ,MAAM,CASlB;AAGD;;;;;;;;;;;GAWG;AACH,2CALW,MAAM,6BAkBhB;oBAlHmB,6CAA6C;8BAU7B,sBAAsB;uBAXnC,8CAA8C;6BAExC,+CAA+C;mCAU5C,+CAA+C"}
|
package/src/utils/packet.js
CHANGED
|
@@ -16,9 +16,10 @@ import { Type as PacketType } from '@agoric/cosmic-proto/ibc/applications/interc
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Makes an IBC transaction packet from an array of messages. Expects the
|
|
20
|
-
* to be base64 encoded bytes.
|
|
21
|
-
*
|
|
19
|
+
* Makes an IBC transaction packet from an array of messages. Expects the
|
|
20
|
+
* `value` of each message to be base64 encoded bytes. Skips checks for
|
|
21
|
+
* malformed messages in favor of interface guards.
|
|
22
|
+
*
|
|
22
23
|
* @param {AnyJson[]} msgs
|
|
23
24
|
* @param {Partial<Omit<TxBody, 'messages'>>} [opts]
|
|
24
25
|
* @returns {string} stringified InterchainAccountPacketData
|
|
@@ -44,9 +45,10 @@ export function makeTxPacket(msgs, opts) {
|
|
|
44
45
|
harden(makeTxPacket);
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
|
-
* Makes an IBC query packet from an array of query messages. Expects the `data`
|
|
48
|
-
* to be base64 encoded bytes.
|
|
49
|
-
*
|
|
48
|
+
* Makes an IBC query packet from an array of query messages. Expects the `data`
|
|
49
|
+
* of each message to be base64 encoded bytes. Skips checks for malformed
|
|
50
|
+
* messages in favor of interface guards.
|
|
51
|
+
*
|
|
50
52
|
* @param {JsonSafe<RequestQuery>[]} msgs
|
|
51
53
|
* @returns {string} stringified InterchainQueryPacketData
|
|
52
54
|
* @throws {Error} if malformed messages are provided
|
|
@@ -68,13 +70,15 @@ export function makeQueryPacket(msgs) {
|
|
|
68
70
|
harden(makeQueryPacket);
|
|
69
71
|
|
|
70
72
|
/**
|
|
71
|
-
* Looks for a result or error key in the response string, and returns
|
|
72
|
-
*
|
|
73
|
-
* Msg*Response object.
|
|
74
|
-
*
|
|
73
|
+
* Looks for a result or error key in the response string, and returns a
|
|
74
|
+
* Base64Bytes string. This string can be decoded using the corresponding
|
|
75
|
+
* Msg*Response object. Error strings seem to be plain text and do not need
|
|
76
|
+
* decoding.
|
|
77
|
+
*
|
|
75
78
|
* @param {string} response
|
|
76
79
|
* @returns {string} - base64 encoded bytes string
|
|
77
|
-
* @throws {Error} if error key is detected in response string, or result key is
|
|
80
|
+
* @throws {Error} if error key is detected in response string, or result key is
|
|
81
|
+
* not found
|
|
78
82
|
*/
|
|
79
83
|
export function parseTxPacket(response) {
|
|
80
84
|
const { result, error } = JSON.parse(response);
|
|
@@ -86,13 +90,15 @@ harden(parseTxPacket);
|
|
|
86
90
|
|
|
87
91
|
/**
|
|
88
92
|
* Looks for a result or error key in the response string. If a result is found,
|
|
89
|
-
* `responses` is decoded via `CosmosResponse`. The `key` and `value` fields on
|
|
90
|
-
* resulting entries are base64 encoded for inter-vat communication. These
|
|
91
|
-
* decoded using the corresponding Query*Response objects.
|
|
92
|
-
*
|
|
93
|
+
* `responses` is decoded via `CosmosResponse`. The `key` and `value` fields on
|
|
94
|
+
* the resulting entries are base64 encoded for inter-vat communication. These
|
|
95
|
+
* can be decoded using the corresponding Query*Response objects. Error strings
|
|
96
|
+
* seem to be plain text and do not need decoding.
|
|
97
|
+
*
|
|
93
98
|
* @param {string} response
|
|
94
99
|
* @returns {JsonSafe<ResponseQuery>[]}
|
|
95
|
-
* @throws {Error} if error key is detected in response string, or result key is
|
|
100
|
+
* @throws {Error} if error key is detected in response string, or result key is
|
|
101
|
+
* not found
|
|
96
102
|
*/
|
|
97
103
|
export function parseQueryPacket(response) {
|
|
98
104
|
const result = parseTxPacket(response);
|
package/src/utils/time.d.ts
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export function makeTimestampHelper(timer: TimerService, timerBrand: TimerBrand): {
|
|
6
6
|
/**
|
|
7
|
-
* Takes the current time from ChainTimerService and adds a relative
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Takes the current time from ChainTimerService and adds a relative time to
|
|
8
|
+
* determine a timeout timestamp in nanoseconds. Useful for
|
|
9
|
+
* {@link MsgTransfer.timeoutTimestamp}.
|
|
10
|
+
*
|
|
10
11
|
* @param {RelativeTimeRecord} [relativeTime] defaults to 5 minutes
|
|
11
|
-
* @returns {Promise<bigint>} Timeout timestamp in absolute nanoseconds
|
|
12
|
+
* @returns {Promise<bigint>} Timeout timestamp in absolute nanoseconds
|
|
13
|
+
* since unix epoch
|
|
12
14
|
*/
|
|
13
15
|
getTimeoutTimestampNS(relativeTime?: RelativeTimeRecord | undefined): Promise<bigint>;
|
|
14
16
|
};
|
package/src/utils/time.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["time.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;IAEI
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["time.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;IAEI;;;;;;;;OAQG;0EAFU,OAAO,CAAC,MAAM,CAAC;EAc/B;AAlCD;;;GAGG;AAEH,qCAAsC;AACtC,iDAAqD;AAuC9C,oCAHI,IAAI,GACF,MAAM,CAE2D;8BAThE,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;kCAnCE,cAAc;gCAAd,cAAc;wCAAd,cAAc"}
|
package/src/utils/time.js
CHANGED
|
@@ -16,11 +16,13 @@ export const NANOSECONDS_PER_SECOND = 1_000_000_000n;
|
|
|
16
16
|
export function makeTimestampHelper(timer, timerBrand) {
|
|
17
17
|
return harden({
|
|
18
18
|
/**
|
|
19
|
-
* Takes the current time from ChainTimerService and adds a relative
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* Takes the current time from ChainTimerService and adds a relative time to
|
|
20
|
+
* determine a timeout timestamp in nanoseconds. Useful for
|
|
21
|
+
* {@link MsgTransfer.timeoutTimestamp}.
|
|
22
|
+
*
|
|
22
23
|
* @param {RelativeTimeRecord} [relativeTime] defaults to 5 minutes
|
|
23
|
-
* @returns {Promise<bigint>} Timeout timestamp in absolute nanoseconds
|
|
24
|
+
* @returns {Promise<bigint>} Timeout timestamp in absolute nanoseconds
|
|
25
|
+
* since unix epoch
|
|
24
26
|
*/
|
|
25
27
|
async getTimeoutTimestampNS(relativeTime) {
|
|
26
28
|
const currentTime = await E(timer).getCurrentTimestamp();
|
|
@@ -38,8 +40,8 @@ export function makeTimestampHelper(timer, timerBrand) {
|
|
|
38
40
|
/** @typedef {Awaited<ReturnType<typeof makeTimestampHelper>>} TimestampHelper */
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
|
-
* Convert a Date from a Cosmos message, which has millisecond precision,
|
|
42
|
-
*
|
|
43
|
+
* Convert a Date from a Cosmos message, which has millisecond precision, to a
|
|
44
|
+
* BigInt for number of seconds since epoch, for use in a timer.
|
|
43
45
|
*
|
|
44
46
|
* @param {Date} date
|
|
45
47
|
* @returns {bigint}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat-orchestration.d.ts","sourceRoot":"","sources":["vat-orchestration.js"],"names":[],"mappings":"AAMO;IAOH,4DAA4D;;;;;;;;;;;;;;;;IAA5D,4DAA4D;;;;;;;;;;;;;;;GAK/D;+BAEa,UAAU,CAAC,OAAO,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"vat-orchestration.d.ts","sourceRoot":"","sources":["vat-orchestration.js"],"names":[],"mappings":"AAMO;IAOH,4DAA4D;;;;;;;;;;;;;;;;IAA5D,4DAA4D;;;;;;;;;;;;;;;GAK/D;+BAEa,UAAU,CAAC,OAAO,eAAe,CAAC;yCAhBT,cAAc"}
|
package/src/vat-orchestration.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Far } from '@endo/far';
|
|
|
2
2
|
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
3
3
|
import { prepareOrchestrationTools } from './service.js';
|
|
4
4
|
|
|
5
|
-
/** @import {
|
|
5
|
+
/** @import {OrchestrationPowers} from './service.js' */
|
|
6
6
|
|
|
7
7
|
export const buildRootObject = (_vatPowers, _args, baggage) => {
|
|
8
8
|
const zone = makeDurableZone(baggage);
|