@agoric/orchestration 0.1.1-dev-c56c51e.0 → 0.1.1-dev-42d1d4f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +16 -16
- package/src/examples/auto-stake-it.contract.d.ts +1 -1
- package/src/examples/auto-stake-it.flows.d.ts +1 -3
- package/src/examples/auto-stake-it.flows.d.ts.map +1 -1
- package/src/examples/auto-stake-it.flows.js +4 -7
- package/src/examples/sendAnywhere.contract.d.ts +1 -0
- package/src/examples/sendAnywhere.contract.d.ts.map +1 -1
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/examples/stakeBld.contract.js +15 -3
- package/src/exos/chain-hub-admin.d.ts +20 -0
- package/src/exos/chain-hub-admin.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.js +18 -3
- package/src/exos/chain-hub.d.ts +10 -2
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +23 -1
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +4 -14
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +19 -26
- package/src/exos/orchestrator.d.ts +5 -9183
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +6 -7
- package/src/orchestration-api.d.ts +13 -12
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +18 -13
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/typeGuards.d.ts +4 -2
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +9 -3
- package/src/utils/amounts.d.ts +10 -0
- package/src/utils/amounts.d.ts.map +1 -0
- package/src/utils/amounts.js +53 -0
- package/src/utils/orchestrationAccount.js +5 -2
- package/src/utils/start-helper.d.ts +2 -1
- package/src/utils/start-helper.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchest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CAAC;IACvB,GAAO,EAAE,GAAG,CAAC;CACV;IAkCE,2DAA2D;;QAEzD;;WAEG;qCADQ,gBAAgB,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQtC;;;OAGG;;QAED;;;;;;WAMG;0HADQ,MAAM;;;;;;;QASjB,+CAA+C;;;;;;;;;;QAoB/C,mDAAmD;;QAYnD,+CAA+C;kBAApC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;;GAIhD"}
|
package/src/exos/orchestrator.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Fail, q } from '@endo/errors';
|
|
|
7
7
|
import { E } from '@endo/far';
|
|
8
8
|
import { M } from '@endo/patterns';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
DenomInfoShape,
|
|
11
11
|
ChainInfoShape,
|
|
12
12
|
DenomAmountShape,
|
|
13
13
|
DenomShape,
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
* @import {Remote} from '@agoric/internal';
|
|
26
26
|
* @import {PickFacet} from '@agoric/swingset-liveslots';
|
|
27
27
|
* @import {CosmosInterchainService} from './cosmos-interchain-service.js';
|
|
28
|
-
* @import {MakeLocalOrchestrationAccountKit} from './local-orchestration-account.js';
|
|
29
28
|
* @import {MakeLocalChainFacade} from './local-chain-facade.js';
|
|
30
29
|
* @import {MakeRemoteChainFacade} from './remote-chain-facade.js';
|
|
31
30
|
* @import {Chain, ChainInfo, IBCConnectionInfo, Orchestrator} from '../types.js';
|
|
@@ -38,7 +37,7 @@ const trace = makeTracer('Orchestrator');
|
|
|
38
37
|
export const OrchestratorI = M.interface('Orchestrator', {
|
|
39
38
|
getChain: M.call(M.string()).returns(Vow$(ChainInfoShape)),
|
|
40
39
|
makeLocalAccount: M.call().returns(Vow$(LocalChainAccountShape)),
|
|
41
|
-
|
|
40
|
+
getDenomInfo: M.call(DenomShape).returns(DenomInfoShape),
|
|
42
41
|
asAmount: M.call(DenomAmountShape).returns(AmountShape),
|
|
43
42
|
});
|
|
44
43
|
|
|
@@ -141,15 +140,15 @@ const prepareOrchestratorKit = (
|
|
|
141
140
|
makeLocalAccount() {
|
|
142
141
|
return watch(E(localchain).makeAccount());
|
|
143
142
|
},
|
|
144
|
-
/** @type {HostOf<Orchestrator['
|
|
145
|
-
|
|
143
|
+
/** @type {HostOf<Orchestrator['getDenomInfo']>} */
|
|
144
|
+
getDenomInfo(denom) {
|
|
146
145
|
const { chainName, baseName, baseDenom, brand } =
|
|
147
146
|
chainHub.lookupAsset(denom);
|
|
148
147
|
chainByName.has(chainName) ||
|
|
149
|
-
Fail`use getChain(${q(chainName)}) before
|
|
148
|
+
Fail`use getChain(${q(chainName)}) before getDenomInfo(${q(denom)})`;
|
|
150
149
|
const chain = chainByName.get(chainName);
|
|
151
150
|
chainByName.has(baseName) ||
|
|
152
|
-
Fail`use getChain(${q(baseName)}) before
|
|
151
|
+
Fail`use getChain(${q(baseName)}) before getDenomInfo(${q(denom)})`;
|
|
153
152
|
const base = chainByName.get(baseName);
|
|
154
153
|
return harden({ chain, base, brand, baseDenom });
|
|
155
154
|
},
|
|
@@ -26,7 +26,7 @@ export type Denom = string;
|
|
|
26
26
|
* In many cases, either a denom string or a local Brand can be used to
|
|
27
27
|
* designate a remote token type.
|
|
28
28
|
*/
|
|
29
|
-
export type DenomArg = Denom | Brand
|
|
29
|
+
export type DenomArg = Denom | Brand<'nat'>;
|
|
30
30
|
/**
|
|
31
31
|
* Count of some fungible token on some blockchain.
|
|
32
32
|
*
|
|
@@ -37,7 +37,7 @@ export type DenomAmount = {
|
|
|
37
37
|
value: bigint;
|
|
38
38
|
};
|
|
39
39
|
/** Amounts can be provided as pure data using denoms or as ERTP Amounts */
|
|
40
|
-
export type AmountArg = DenomAmount | Amount
|
|
40
|
+
export type AmountArg = DenomAmount | Amount<'nat'>;
|
|
41
41
|
/** An address on some blockchain, e.g., cosmos, eth, etc. */
|
|
42
42
|
export type ChainAddress = {
|
|
43
43
|
/** e.g. 1 for Ethereum, agoric-3 for Agoric, cosmoshub-4 for Cosmos */
|
|
@@ -64,6 +64,16 @@ export interface Chain<CI extends ChainInfo> {
|
|
|
64
64
|
icqEnabled: true;
|
|
65
65
|
} ? ICQQueryFunction : CI['chainId'] extends `agoric${string}` ? QueryManyFn : never;
|
|
66
66
|
}
|
|
67
|
+
export interface DenomInfo<HoldingChain extends keyof KnownChains, IssuingChain extends keyof KnownChains> {
|
|
68
|
+
/** The well-known Brand on Agoric for the direct asset */
|
|
69
|
+
brand?: Brand;
|
|
70
|
+
/** The Chain at which the argument `denom` exists (where the asset is currently held) */
|
|
71
|
+
chain: Chain<KnownChains[HoldingChain]>;
|
|
72
|
+
/** The Chain that is the issuer of the underlying asset */
|
|
73
|
+
base: Chain<KnownChains[IssuingChain]>;
|
|
74
|
+
/** the Denom for the underlying asset on its issuer chain */
|
|
75
|
+
baseDenom: Denom;
|
|
76
|
+
}
|
|
67
77
|
/**
|
|
68
78
|
* Provided in the callback to `orchestrate()`.
|
|
69
79
|
*/
|
|
@@ -76,16 +86,7 @@ export interface Orchestrator {
|
|
|
76
86
|
* issues the corresponding asset.
|
|
77
87
|
* @param denom
|
|
78
88
|
*/
|
|
79
|
-
|
|
80
|
-
/** The well-known Brand on Agoric for the direct asset */
|
|
81
|
-
brand?: Brand;
|
|
82
|
-
/** The Chain at which the argument `denom` exists (where the asset is currently held) */
|
|
83
|
-
chain: Chain<KnownChains[HoldingChain]>;
|
|
84
|
-
/** The Chain that is the issuer of the underlying asset */
|
|
85
|
-
base: Chain<KnownChains[IssuingChain]>;
|
|
86
|
-
/** the Denom for the underlying asset on its issuer chain */
|
|
87
|
-
baseDenom: Denom;
|
|
88
|
-
};
|
|
89
|
+
getDenomInfo: <HoldingChain extends keyof KnownChains, IssuingChain extends keyof KnownChains>(denom: Denom) => DenomInfo<HoldingChain, IssuingChain>;
|
|
89
90
|
/**
|
|
90
91
|
* Convert an amount described in native data to a local, structured Amount.
|
|
91
92
|
* @param amount - the described amount
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACZ,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,yBAAyB,EACzB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAI3B;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACZ,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT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,WAAW,EAAE,YAAY,CAAA;CAAE,CAAC;AAC3E,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/src/orchestration-api.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type Denom = string; // ibc/... or uist
|
|
|
44
44
|
* In many cases, either a denom string or a local Brand can be used to
|
|
45
45
|
* designate a remote token type.
|
|
46
46
|
*/
|
|
47
|
-
export type DenomArg = Denom | Brand
|
|
47
|
+
export type DenomArg = Denom | Brand<'nat'>;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Count of some fungible token on some blockchain.
|
|
@@ -57,7 +57,7 @@ export type DenomAmount = {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
/** Amounts can be provided as pure data using denoms or as ERTP Amounts */
|
|
60
|
-
export type AmountArg = DenomAmount | Amount
|
|
60
|
+
export type AmountArg = DenomAmount | Amount<'nat'>;
|
|
61
61
|
|
|
62
62
|
/** An address on some blockchain, e.g., cosmos, eth, etc. */
|
|
63
63
|
export type ChainAddress = {
|
|
@@ -101,6 +101,20 @@ export interface Chain<CI extends ChainInfo> {
|
|
|
101
101
|
// TODO provide a way to get the local denom/brand/whatever for this chain
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
export interface DenomInfo<
|
|
105
|
+
HoldingChain extends keyof KnownChains,
|
|
106
|
+
IssuingChain extends keyof KnownChains,
|
|
107
|
+
> {
|
|
108
|
+
/** The well-known Brand on Agoric for the direct asset */
|
|
109
|
+
brand?: Brand;
|
|
110
|
+
/** The Chain at which the argument `denom` exists (where the asset is currently held) */
|
|
111
|
+
chain: Chain<KnownChains[HoldingChain]>;
|
|
112
|
+
/** The Chain that is the issuer of the underlying asset */
|
|
113
|
+
base: Chain<KnownChains[IssuingChain]>;
|
|
114
|
+
/** the Denom for the underlying asset on its issuer chain */
|
|
115
|
+
baseDenom: Denom;
|
|
116
|
+
}
|
|
117
|
+
|
|
104
118
|
/**
|
|
105
119
|
* Provided in the callback to `orchestrate()`.
|
|
106
120
|
*/
|
|
@@ -119,21 +133,12 @@ export interface Orchestrator {
|
|
|
119
133
|
* issues the corresponding asset.
|
|
120
134
|
* @param denom
|
|
121
135
|
*/
|
|
122
|
-
|
|
136
|
+
getDenomInfo: <
|
|
123
137
|
HoldingChain extends keyof KnownChains,
|
|
124
138
|
IssuingChain extends keyof KnownChains,
|
|
125
139
|
>(
|
|
126
140
|
denom: Denom,
|
|
127
|
-
) =>
|
|
128
|
-
/** The well-known Brand on Agoric for the direct asset */
|
|
129
|
-
brand?: Brand;
|
|
130
|
-
/** The Chain at which the argument `denom` exists (where the asset is currently held) */
|
|
131
|
-
chain: Chain<KnownChains[HoldingChain]>;
|
|
132
|
-
/** The Chain that is the issuer of the underlying asset */
|
|
133
|
-
base: Chain<KnownChains[IssuingChain]>;
|
|
134
|
-
/** the Denom for the underlying asset on its issuer chain */
|
|
135
|
-
baseDenom: Denom;
|
|
136
|
-
};
|
|
141
|
+
) => DenomInfo<HoldingChain, IssuingChain>;
|
|
137
142
|
// TODO preload the mapping so this can be synchronous
|
|
138
143
|
/**
|
|
139
144
|
* Convert an amount described in native data to a local, structured Amount.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-stakeBld.d.ts","sourceRoot":"","sources":["start-stakeBld.js"],"names":[],"mappings":"AAkBO,6TAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;+
|
|
1
|
+
{"version":3,"file":"start-stakeBld.d.ts","sourceRoot":"","sources":["start-stakeBld.js"],"names":[],"mappings":"AAkBO,6TAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,CAC9B;;;;;;+BAmCG,kBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAnC8C,CACxD,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAwDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BN;sBApGqB,gCAAgC"}
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {TypedPattern} from '@agoric/internal';
|
|
3
|
-
* @import {ChainAddress, CosmosAssetInfo, ChainInfo, CosmosChainInfo, DenomAmount} from './types.js';
|
|
3
|
+
* @import {ChainAddress, CosmosAssetInfo, Chain, ChainInfo, CosmosChainInfo, DenomAmount, DenomDetail, DenomInfo} from './types.js';
|
|
4
4
|
* @import {Delegation} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
5
5
|
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
6
6
|
* @import {TypedJson} from '@agoric/cosmic-proto';
|
|
@@ -35,7 +35,8 @@ export const CosmosChainInfoShape: TypedPattern<CosmosChainInfo>;
|
|
|
35
35
|
export const ChainInfoShape: TypedPattern<ChainInfo>;
|
|
36
36
|
export const LocalChainAccountShape: import("@endo/patterns").Matcher;
|
|
37
37
|
export const DenomShape: import("@endo/patterns").Matcher;
|
|
38
|
-
|
|
38
|
+
/** @type {TypedPattern<DenomInfo<any, any>>} */
|
|
39
|
+
export const DenomInfoShape: TypedPattern<DenomInfo<any, any>>;
|
|
39
40
|
/** @type {TypedPattern<DenomAmount>} */
|
|
40
41
|
export const DenomAmountShape: TypedPattern<DenomAmount>;
|
|
41
42
|
export const AmountArgShape: import("@endo/patterns").Matcher;
|
|
@@ -58,6 +59,7 @@ import type { Delegation } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/sta
|
|
|
58
59
|
import type { CosmosAssetInfo } from './types.js';
|
|
59
60
|
import type { CosmosChainInfo } from './types.js';
|
|
60
61
|
import type { ChainInfo } from './types.js';
|
|
62
|
+
import type { DenomInfo } from './types.js';
|
|
61
63
|
import type { DenomAmount } from './types.js';
|
|
62
64
|
import type { TypedJson } from '@agoric/cosmic-proto';
|
|
63
65
|
//# sourceMappingURL=typeGuards.d.ts.map
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH;;;;GAIG;AACH;;;GAQE;AAEF,yCAAyC;AACzC,gCADW,aAAa,YAAY,CAAC,CAKnC;;;;;AAQF,uCAAuC;AACvC,8BADW,aAAa,UAAU,CAAC,CAIhC;AAEH,uEAUE;AAEF,iEAA4C;AAC5C,mEAQG;AACH,oEAA+C;AAC/C,sEAYG;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CASrC;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CAWtC;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CAG/B;AACH,sEAAuE;AACvE,0DAAqC;AAErC,
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH;;;;GAIG;AACH;;;GAQE;AAEF,yCAAyC;AACzC,gCADW,aAAa,YAAY,CAAC,CAKnC;;;;;AAQF,uCAAuC;AACvC,8BADW,aAAa,UAAU,CAAC,CAIhC;AAEH,uEAUE;AAEF,iEAA4C;AAC5C,mEAQG;AACH,oEAA+C;AAC/C,sEAYG;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CASrC;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CAWtC;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CAG/B;AACH,sEAAuE;AACvE,0DAAqC;AAErC,gDAAgD;AAChD,6BADW,aAAa,UAAU,GAAG,EAAE,GAAG,CAAC,CAAC,CAM1C;AAEF,wCAAwC;AACxC,+BADW,aAAa,WAAW,CAAC,CACqC;AAEzE,8DAAkE;AAElE,2DAGE;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CACmC;;;;;;;;;AAcrE,0CAA0C;AAC1C,+DAQE;kCAtJsH,YAAY;kCADrG,kBAAkB;gCAEpB,wDAAwD;qCADmC,YAAY;qCAAZ,YAAY;+BAAZ,YAAY;+BAAZ,YAAY;iCAAZ,YAAY;+BAGxG,sBAAsB"}
|
package/src/typeGuards.js
CHANGED
|
@@ -4,7 +4,7 @@ import { M } from '@endo/patterns';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @import {TypedPattern} from '@agoric/internal';
|
|
7
|
-
* @import {ChainAddress, CosmosAssetInfo, ChainInfo, CosmosChainInfo, DenomAmount} from './types.js';
|
|
7
|
+
* @import {ChainAddress, CosmosAssetInfo, Chain, ChainInfo, CosmosChainInfo, DenomAmount, DenomDetail, DenomInfo} from './types.js';
|
|
8
8
|
* @import {Delegation} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
9
9
|
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
10
10
|
* @import {TypedJson} from '@agoric/cosmic-proto';
|
|
@@ -111,8 +111,14 @@ export const ChainInfoShape = M.splitRecord({
|
|
|
111
111
|
});
|
|
112
112
|
export const LocalChainAccountShape = M.remotable('LocalChainAccount');
|
|
113
113
|
export const DenomShape = M.string();
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
|
|
115
|
+
/** @type {TypedPattern<DenomInfo<any, any>>} */
|
|
116
|
+
export const DenomInfoShape = {
|
|
117
|
+
chain: M.remotable('Chain'),
|
|
118
|
+
base: M.remotable('Chain'),
|
|
119
|
+
brand: M.or(M.remotable('Brand'), M.undefined()),
|
|
120
|
+
baseDenom: M.string(),
|
|
121
|
+
};
|
|
116
122
|
|
|
117
123
|
/** @type {TypedPattern<DenomAmount>} */
|
|
118
124
|
export const DenomAmountShape = { denom: DenomShape, value: M.bigint() };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function coerceDenom(chainHub: ChainHub, denomArg: DenomArg): Denom;
|
|
2
|
+
export function coerceDenomAmount(chainHub: ChainHub, amount: DenomAmount | Amount<"nat">): DenomAmount;
|
|
3
|
+
export function coerceCoin(chainHub: ChainHub, amount: AmountArg | Amount<"nat">): Coin;
|
|
4
|
+
import type { ChainHub } from "../types.js";
|
|
5
|
+
import type { DenomArg } from "../orchestration-api.js";
|
|
6
|
+
import type { Denom } from "../orchestration-api.js";
|
|
7
|
+
import type { DenomAmount } from "../orchestration-api.js";
|
|
8
|
+
import type { AmountArg } from "../orchestration-api.js";
|
|
9
|
+
import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
10
|
+
//# sourceMappingURL=amounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amounts.d.ts","sourceRoot":"","sources":["amounts.js"],"names":[],"mappings":"AAaO,sCAJI,QAAQ,YACR,QAAQ,GACN,KAAK,CAWjB;AAOM,4CAJI,QAAQ,UACR,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GACzB,WAAW,CAWvB;AAOM,qCAJI,QAAQ,UACR,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,GACvB,IAAI,CAShB;8BAjD0B,aAAa;8BACkB,yBAAyB;2BAAzB,yBAAyB;iCAAzB,yBAAyB;+BAAzB,yBAAyB;0BAC5D,kDAAkD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { makeError } from '@endo/errors';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @import {ChainHub} from "../types.js";
|
|
5
|
+
* @import {AmountArg, Denom, DenomAmount, DenomArg} from "../orchestration-api.js";
|
|
6
|
+
* @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {ChainHub} chainHub
|
|
11
|
+
* @param {DenomArg} denomArg
|
|
12
|
+
* @returns {Denom}
|
|
13
|
+
*/
|
|
14
|
+
export const coerceDenom = (chainHub, denomArg) => {
|
|
15
|
+
if (typeof denomArg === 'string') {
|
|
16
|
+
return denomArg;
|
|
17
|
+
}
|
|
18
|
+
const denom = chainHub.lookupDenom(denomArg);
|
|
19
|
+
if (!denom) {
|
|
20
|
+
throw makeError(`No denomination for brand ${denomArg}`);
|
|
21
|
+
}
|
|
22
|
+
return denom;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @param {ChainHub} chainHub
|
|
27
|
+
* @param {DenomAmount | Amount<'nat'>} amount
|
|
28
|
+
* @returns {DenomAmount}
|
|
29
|
+
*/
|
|
30
|
+
export const coerceDenomAmount = (chainHub, amount) => {
|
|
31
|
+
if ('denom' in amount) {
|
|
32
|
+
return amount;
|
|
33
|
+
}
|
|
34
|
+
const denom = coerceDenom(chainHub, amount.brand);
|
|
35
|
+
return harden({
|
|
36
|
+
denom,
|
|
37
|
+
value: amount.value,
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {ChainHub} chainHub
|
|
43
|
+
* @param {AmountArg | Amount<'nat'>} amount
|
|
44
|
+
* @returns {Coin}
|
|
45
|
+
*/
|
|
46
|
+
export const coerceCoin = (chainHub, amount) => {
|
|
47
|
+
const denom =
|
|
48
|
+
'denom' in amount ? amount.denom : coerceDenom(chainHub, amount.brand);
|
|
49
|
+
return harden({
|
|
50
|
+
denom,
|
|
51
|
+
amount: String(amount.value),
|
|
52
|
+
});
|
|
53
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BrandShape } from '@agoric/ertp';
|
|
2
2
|
import { Shape as NetworkShape } from '@agoric/network';
|
|
3
3
|
import { VowShape } from '@agoric/vow';
|
|
4
4
|
import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/topics.js';
|
|
5
|
+
import { M } from '@endo/patterns';
|
|
5
6
|
import {
|
|
6
7
|
AmountArgShape,
|
|
7
8
|
ChainAddressShape,
|
|
@@ -16,7 +17,9 @@ const { Vow$ } = NetworkShape; // TODO #9611
|
|
|
16
17
|
/** @see {OrchestrationAccountI} */
|
|
17
18
|
export const orchestrationAccountMethods = {
|
|
18
19
|
getAddress: M.call().returns(ChainAddressShape),
|
|
19
|
-
getBalance: M.call(M.
|
|
20
|
+
getBalance: M.call(M.or(BrandShape, M.string())).returns(
|
|
21
|
+
Vow$(DenomAmountShape),
|
|
22
|
+
),
|
|
20
23
|
getBalances: M.call().returns(Vow$(M.arrayOf(DenomAmountShape))),
|
|
21
24
|
send: M.call(ChainAddressShape, AmountArgShape).returns(VowShape),
|
|
22
25
|
sendAll: M.call(ChainAddressShape, M.arrayOf(AmountArgShape)).returns(
|
|
@@ -16,7 +16,8 @@ export function provideOrchestration(zcf: ZCF, baggage: Baggage, remotePowers: O
|
|
|
16
16
|
}): import("@agoric/vow").Vow<import("../cosmos-api.js").IBCConnectionInfo>;
|
|
17
17
|
getChainsAndConnection<C1 extends string, C2 extends string>(primaryName: C1, counterName: C2): import("@agoric/vow").Vow<[ActualChainInfo<C1>, ActualChainInfo<C2>, import("../cosmos-api.js").IBCConnectionInfo]>;
|
|
18
18
|
registerAsset(denom: import("../orchestration-api.js").Denom, detail: DenomDetail): void;
|
|
19
|
-
lookupAsset(denom: import("../orchestration-api.js").Denom):
|
|
19
|
+
lookupAsset(denom: import("../orchestration-api.js").Denom): DenomDetail;
|
|
20
|
+
lookupDenom(brand: Brand): string | undefined;
|
|
20
21
|
}>;
|
|
21
22
|
vowTools: {
|
|
22
23
|
when: <T, TResult1 = import("@agoric/vow").EUnwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").EUnwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA6CO,0CALI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+BAwGR,IAAI
|
|
1
|
+
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA6CO,0CALI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+BAwGR,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;wCAzEW,GAAG;;+BA/CvB,GAAG,+EAIV,GAAC,yCAIM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0IV;AAuBM,kCAdgC,EAAE,SAA3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,EAGhC,EAAE,SAFM,mBAAmB,GAAG;IACnC,UAAc,EAAE,UAAU,CAAC;CACvB,EACQ,CAAC,cACH,CACV,GAAO,EAAE,GAAG,CAAC,EAAE,CAAC,EAChB,WAAe,EAAE,EAAE,EACnB,IAAQ,EAAE,IAAI,EACd,KAAS,EAAE,kBAAkB,KACtB,OAAO,CAAC,CAAC,CAAC,GACL,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAYzE;kCApLU;IACZ,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,oBAAwB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC1D,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;iCAiJU,IAAI,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAAE,MAAM,CAAC;6BA/JzC,kBAAkB;0BAGrB,cAAc;gCALR,gCAAgC;4BAIpC,aAAa;6CAEI,sCAAsC;kCALrC,cAAc;6BAE/B,cAAc"}
|