@agoric/orchestration 0.1.1-dev-a446a00.0 → 0.1.1-dev-ceec1d5.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.
Files changed (43) hide show
  1. package/package.json +15 -15
  2. package/src/chain-info.d.ts +5 -2
  3. package/src/chain-info.d.ts.map +1 -1
  4. package/src/chain-info.ts +3 -3
  5. package/src/cosmos-api.d.ts +2 -5
  6. package/src/cosmos-api.d.ts.map +1 -1
  7. package/src/cosmos-api.ts +1 -3
  8. package/src/examples/stakeAtom.contract.d.ts +32 -19
  9. package/src/examples/stakeAtom.contract.d.ts.map +1 -1
  10. package/src/examples/stakeAtom.contract.js +21 -24
  11. package/src/examples/stakeBld.contract.d.ts.map +1 -1
  12. package/src/examples/stakeBld.contract.js +1 -1
  13. package/src/examples/swapExample.contract.d.ts +17 -6
  14. package/src/examples/swapExample.contract.d.ts.map +1 -1
  15. package/src/examples/swapExample.contract.js +9 -6
  16. package/src/examples/unbondExample.contract.d.ts.map +1 -1
  17. package/src/examples/unbondExample.contract.js +9 -7
  18. package/src/exos/chainAccountKit.d.ts +6 -8
  19. package/src/exos/chainAccountKit.d.ts.map +1 -1
  20. package/src/exos/chainAccountKit.js +23 -24
  21. package/src/exos/{stakingAccountKit.d.ts → cosmosOrchestrationAccount.d.ts} +69 -24
  22. package/src/exos/cosmosOrchestrationAccount.d.ts.map +1 -0
  23. package/src/exos/{stakingAccountKit.js → cosmosOrchestrationAccount.js} +89 -34
  24. package/src/exos/icqConnectionKit.d.ts.map +1 -1
  25. package/src/exos/icqConnectionKit.js +6 -8
  26. package/src/exos/local-chain-account-kit.d.ts +1 -1
  27. package/src/exos/local-chain-account-kit.d.ts.map +1 -1
  28. package/src/exos/local-chain-account-kit.js +5 -3
  29. package/src/facade.d.ts +3 -3
  30. package/src/facade.d.ts.map +1 -1
  31. package/src/facade.js +95 -80
  32. package/src/orchestration-api.d.ts +1 -1
  33. package/src/orchestration-api.d.ts.map +1 -1
  34. package/src/orchestration-api.ts +1 -1
  35. package/src/proposals/start-stakeAtom.d.ts +27 -19
  36. package/src/proposals/start-stakeAtom.d.ts.map +1 -1
  37. package/src/utils/mockChainInfo.d.ts +1 -2
  38. package/src/utils/mockChainInfo.d.ts.map +1 -1
  39. package/src/utils/mockChainInfo.js +2 -10
  40. package/src/utils/orchestrationAccount.d.ts +10 -0
  41. package/src/utils/orchestrationAccount.d.ts.map +1 -0
  42. package/src/utils/orchestrationAccount.js +19 -0
  43. package/src/exos/stakingAccountKit.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/orchestration",
3
- "version": "0.1.1-dev-a446a00.0+a446a00",
3
+ "version": "0.1.1-dev-ceec1d5.0+ceec1d5",
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-a446a00.0+a446a00",
35
- "@agoric/cosmic-proto": "0.4.1-dev-a446a00.0+a446a00",
36
- "@agoric/ertp": "0.16.3-dev-a446a00.0+a446a00",
37
- "@agoric/internal": "0.3.3-dev-a446a00.0+a446a00",
38
- "@agoric/network": "0.1.1-dev-a446a00.0+a446a00",
39
- "@agoric/notifier": "0.6.3-dev-a446a00.0+a446a00",
40
- "@agoric/store": "0.9.3-dev-a446a00.0+a446a00",
41
- "@agoric/time": "0.3.3-dev-a446a00.0+a446a00",
42
- "@agoric/vat-data": "0.5.3-dev-a446a00.0+a446a00",
43
- "@agoric/vats": "0.15.2-dev-a446a00.0+a446a00",
44
- "@agoric/vow": "0.1.1-dev-a446a00.0+a446a00",
45
- "@agoric/zoe": "0.26.3-dev-a446a00.0+a446a00",
46
- "@agoric/zone": "0.2.3-dev-a446a00.0+a446a00",
34
+ "@agoric/assert": "0.6.1-dev-ceec1d5.0+ceec1d5",
35
+ "@agoric/cosmic-proto": "0.4.1-dev-ceec1d5.0+ceec1d5",
36
+ "@agoric/ertp": "0.16.3-dev-ceec1d5.0+ceec1d5",
37
+ "@agoric/internal": "0.3.3-dev-ceec1d5.0+ceec1d5",
38
+ "@agoric/network": "0.1.1-dev-ceec1d5.0+ceec1d5",
39
+ "@agoric/notifier": "0.6.3-dev-ceec1d5.0+ceec1d5",
40
+ "@agoric/store": "0.9.3-dev-ceec1d5.0+ceec1d5",
41
+ "@agoric/time": "0.3.3-dev-ceec1d5.0+ceec1d5",
42
+ "@agoric/vat-data": "0.5.3-dev-ceec1d5.0+ceec1d5",
43
+ "@agoric/vats": "0.15.2-dev-ceec1d5.0+ceec1d5",
44
+ "@agoric/vow": "0.1.1-dev-ceec1d5.0+ceec1d5",
45
+ "@agoric/zoe": "0.26.3-dev-ceec1d5.0+ceec1d5",
46
+ "@agoric/zone": "0.2.3-dev-ceec1d5.0+ceec1d5",
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": "a446a008f656ae3866a469385453b0132b4fd287"
87
+ "gitHead": "ceec1d5655ab909bfa85e312d53cddeee64623f3"
88
88
  }
@@ -3,7 +3,11 @@
3
3
  * additional chain-specific operations like `liquidStake`
4
4
  */
5
5
  import type { CosmosChainInfo, EthChainInfo, IcaAccount, ICQConnection, LiquidStakingMethods, StakingAccountActions, StakingAccountQueries } from './types.js';
6
- export type KnownChains = {
6
+ export type ChainInfo = CosmosChainInfo | EthChainInfo;
7
+ export type KnownChains = Record<string, {
8
+ info: ChainInfo;
9
+ methods?: {};
10
+ }> & {
7
11
  stride: {
8
12
  info: CosmosChainInfo;
9
13
  methods: IcaAccount & ICQConnection & StakingAccountActions & StakingAccountQueries & LiquidStakingMethods;
@@ -33,5 +37,4 @@ export type KnownChains = {
33
37
  methods: IcaAccount & ICQConnection & StakingAccountActions & StakingAccountQueries;
34
38
  };
35
39
  };
36
- export type ChainInfo = CosmosChainInfo | EthChainInfo;
37
40
  //# sourceMappingURL=chain-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain-info.d.ts","sourceRoot":"","sources":["chain-info.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAKpB,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE;QACN,IAAI,EAAE,eAAe,CAAC;QACtB,OAAO,EAAE,UAAU,GACjB,aAAa,GACb,qBAAqB,GACrB,qBAAqB,GACrB,oBAAoB,CAAC;KACxB,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,eAAe,CAAC;QACtB,OAAO,EAAE,UAAU,GACjB,aAAa,GACb,qBAAqB,GACrB,qBAAqB,CAAC;KACzB,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,eAAe,CAAC;QACtB,OAAO,EAAE;YAEP;;;eAGG;YACH,iBAAiB,EAAE,CAAC,GAAG,CAAC,EAAE;gBACxB,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;aACrC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;SACrB,CAAC;KACH,CAAC;IACF,QAAQ,EAAE;QACR,IAAI,EAAE,eAAe,CAAC;QACtB,OAAO,EAAE,UAAU,GACjB,aAAa,GACb,qBAAqB,GACrB,qBAAqB,CAAC;KACzB,CAAC;IACF,OAAO,EAAE;QACP,IAAI,EAAE,eAAe,CAAC;QACtB,OAAO,EAAE,UAAU,GACjB,aAAa,GACb,qBAAqB,GACrB,qBAAqB,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,SAAS,GAA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H,CAAC"}
package/src/chain-info.ts CHANGED
@@ -13,10 +13,12 @@ import type {
13
13
  StakingAccountQueries,
14
14
  } from './types.js';
15
15
 
16
+ export type ChainInfo = CosmosChainInfo | EthChainInfo;
17
+
16
18
  // TODO generate this automatically with a build script drawing on data sources such as https://github.com/cosmos/chain-registry
17
19
 
18
20
  // XXX methods ad-hoc and not fully accurate
19
- export type KnownChains = {
21
+ export type KnownChains = Record<string, { info: ChainInfo; methods?: {} }> & {
20
22
  stride: {
21
23
  info: CosmosChainInfo;
22
24
  methods: IcaAccount &
@@ -60,5 +62,3 @@ export type KnownChains = {
60
62
  StakingAccountQueries;
61
63
  };
62
64
  };
63
-
64
- export type ChainInfo = CosmosChainInfo | EthChainInfo;
@@ -1,14 +1,13 @@
1
1
  import type { AnyJson } from '@agoric/cosmic-proto';
2
2
  import type { Delegation, Redelegation, UnbondingDelegation } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
3
3
  import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
4
- import type { Brand, Payment, Purse } from '@agoric/ertp/src/types.js';
4
+ import type { Brand, Purse } from '@agoric/ertp/src/types.js';
5
5
  import type { Port } from '@agoric/network';
6
6
  import type { LocalIbcAddress, RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
7
7
  import { MsgTransfer } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
8
8
  import type { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js';
9
9
  import type { Order, State as IBCChannelState } from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
10
10
  import { IBCChannelID, IBCConnectionID } from '@agoric/vats';
11
- import { MapStore } from '@agoric/store';
12
11
  import type { AmountArg, ChainAddress, DenomAmount } from './types.js';
13
12
  /** A helper type for type extensions. */
14
13
  export type TypeUrl = string;
@@ -53,7 +52,7 @@ export type IBCConnectionInfo = {
53
52
  */
54
53
  export type CosmosChainInfo = {
55
54
  chainId: string;
56
- connections: MapStore<string, IBCConnectionInfo>;
55
+ connections: Record<string, IBCConnectionInfo>;
57
56
  icaEnabled: boolean;
58
57
  icqEnabled: boolean;
59
58
  pfmEnabled: boolean;
@@ -153,8 +152,6 @@ export interface IcaAccount {
153
152
  * @returns acknowledgement string
154
153
  */
155
154
  executeEncodedTx: (msgs: AnyJson[], opts?: Partial<Omit<TxBody, 'messages'>>) => Promise<string>;
156
- /** deposit payment from zoe to the account*/
157
- deposit: (payment: Payment) => Promise<void>;
158
155
  /** get Purse for a brand to .withdraw() a Payment from the account */
159
156
  getPurse: (brand: Brand) => Promise<Purse>;
160
157
  /**
@@ -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,EAAE,OAAO,EAAE,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,EAAE,MAAM,2DAA2D,CAAC;AAC7G,OAAO,KAAK,EACV,KAAK,EACL,KAAK,IAAI,eAAe,EACzB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,E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AEG;IACH,UAAU,EAAE,MAAM,YAAY,CAAC;IAE/B;;;;OAIG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD;;;;;OAKG;IACH,gBAAgB,EAAE,CAChB,IAAI,EAAE,OAAO,EAAE,EACf,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,KACrC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,sEAAsE;IACtE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3C;;OAEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;IACzC,gDAAgD;IAChD,eAAe,EAAE,MAAM,eAAe,CAAC;IACvC,oDAAoD;IACpD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
package/src/cosmos-api.ts CHANGED
@@ -67,7 +67,7 @@ export type IBCConnectionInfo = {
67
67
  */
68
68
  export type CosmosChainInfo = {
69
69
  chainId: string;
70
- connections: MapStore<string, IBCConnectionInfo>; // chainId or wellKnownName
70
+ connections: Record<string, IBCConnectionInfo>; // chainId or wellKnownName
71
71
  icaEnabled: boolean;
72
72
  icqEnabled: boolean;
73
73
  pfmEnabled: boolean;
@@ -196,8 +196,6 @@ export interface IcaAccount {
196
196
  msgs: AnyJson[],
197
197
  opts?: Partial<Omit<TxBody, 'messages'>>,
198
198
  ) => Promise<string>;
199
- /** deposit payment from zoe to the account*/
200
- deposit: (payment: Payment) => Promise<void>;
201
199
  /** get Purse for a brand to .withdraw() a Payment from the account */
202
200
  getPurse: (brand: Brand) => Promise<Purse>;
203
201
  /**
@@ -1,4 +1,9 @@
1
1
  export namespace meta {
2
+ namespace customTermsShape {
3
+ let hostConnectionId: import("@endo/patterns").Matcher;
4
+ let controllerConnectionId: import("@endo/patterns").Matcher;
5
+ let bondDenom: import("@endo/patterns").Matcher;
6
+ }
2
7
  namespace privateArgsShape {
3
8
  export let orchestration: import("@endo/patterns").Matcher;
4
9
  export { StorageNodeShape as storageNode };
@@ -22,18 +27,41 @@ export function start(zcf: ZCF<StakeAtomTerms>, privateArgs: {
22
27
  }, baggage: Baggage): Promise<{
23
28
  publicFacet: import("@endo/exo").Guarded<{
24
29
  makeAccount(): Promise<import("@endo/exo").Guarded<{
30
+ asContinuingOffer(): {
31
+ publicSubscribers: {
32
+ account: {
33
+ description: string;
34
+ subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
35
+ storagePath: Promise<string>;
36
+ };
37
+ };
38
+ invitationMakers: import("@endo/exo").Guarded<{
39
+ Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: Amount<"nat">): Promise<Invitation<void, undefined>>;
40
+ Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
41
+ WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
42
+ Undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<Invitation<void, undefined>>;
43
+ CloseAccount(): never;
44
+ TransferAccount(): never;
45
+ }>;
46
+ holder: import("@endo/exo").Guarded<any>;
47
+ };
25
48
  getPublicTopics(): {
26
49
  account: {
27
50
  description: string;
28
- subscriber: globalThis.Subscriber<import("../exos/stakingAccountKit.js").StakingAccountNotification>;
51
+ subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
29
52
  storagePath: Promise<string>;
30
53
  };
31
54
  };
32
55
  getAddress(): import("../orchestration-api.js").ChainAddress;
33
56
  delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
57
+ deposit(payment: any): Promise<void>;
58
+ getBalances(): Promise<never>;
34
59
  redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
35
60
  withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<import("../orchestration-api.js").DenomAmount[]>;
36
- getBalance(denom?: string | undefined): Promise<import("../orchestration-api.js").DenomAmount>;
61
+ getBalance(denom: import("../orchestration-api.js").DenomArg): Promise<import("../orchestration-api.js").DenomAmount>;
62
+ send(toAccount: any, amount: any): never;
63
+ transfer(amount: any, msg: any): never;
64
+ transferSteps(amount: any, msg: any): never;
37
65
  withdrawRewards(): never;
38
66
  undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<void>;
39
67
  }>>;
@@ -41,7 +69,7 @@ export function start(zcf: ZCF<StakeAtomTerms>, privateArgs: {
41
69
  publicSubscribers: {
42
70
  account: {
43
71
  description: string;
44
- subscriber: globalThis.Subscriber<import("../exos/stakingAccountKit.js").StakingAccountNotification>;
72
+ subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
45
73
  storagePath: Promise<string>;
46
74
  };
47
75
  };
@@ -53,22 +81,7 @@ export function start(zcf: ZCF<StakeAtomTerms>, privateArgs: {
53
81
  CloseAccount(): never;
54
82
  TransferAccount(): never;
55
83
  }>;
56
- account: import("@endo/exo").Guarded<{
57
- getPublicTopics(): {
58
- account: {
59
- description: string;
60
- subscriber: globalThis.Subscriber<import("../exos/stakingAccountKit.js").StakingAccountNotification>;
61
- storagePath: Promise<string>;
62
- };
63
- };
64
- getAddress(): import("../orchestration-api.js").ChainAddress;
65
- delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
66
- redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
67
- withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<import("../orchestration-api.js").DenomAmount[]>;
68
- getBalance(denom?: string | undefined): Promise<import("../orchestration-api.js").DenomAmount>;
69
- withdrawRewards(): never;
70
- undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<void>;
71
- }>;
84
+ holder: import("@endo/exo").Guarded<any>;
72
85
  }, undefined>>;
73
86
  }>;
74
87
  }>;
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"stakeAtom.contract.d.ts","sourceRoot":"","sources":["stakeAtom.contract.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAqDO,2BATI,GAAG,CAAC,cAAc,CAAC;;;;;;;;;iBAGZ,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;mGA0EwoF,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAH/qF;;;;eAhFe,MAAM;;0BAkFR,OAAO,KAAK;iCAtHmB,kBAAkB;kCAC7B,cAAc;kCAYjB,cAAc;6BAFnB,kBAAkB"}
@@ -1,6 +1,5 @@
1
- /**
2
- * @file Example contract that uses orchestration
3
- */
1
+ /** @file Example contract that uses orchestration */
2
+ // TODO rename to "stakeIca" or something else that conveys is parameterized nature
4
3
 
5
4
  import { makeTracer, StorageNodeShape } from '@agoric/internal';
6
5
  import { TimerServiceShape } from '@agoric/time';
@@ -9,7 +8,7 @@ import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport';
9
8
  import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
10
9
  import { makeDurableZone } from '@agoric/zone/durable.js';
11
10
  import { M } from '@endo/patterns';
12
- import { prepareStakingAccountKit } from '../exos/stakingAccountKit.js';
11
+ import { prepareCosmosOrchestrationAccount } from '../exos/cosmosOrchestrationAccount.js';
13
12
 
14
13
  const trace = makeTracer('StakeAtom');
15
14
  /**
@@ -20,6 +19,11 @@ const trace = makeTracer('StakeAtom');
20
19
  */
21
20
 
22
21
  export const meta = harden({
22
+ customTermsShape: {
23
+ hostConnectionId: M.string(),
24
+ controllerConnectionId: M.string(),
25
+ bondDenom: M.string(),
26
+ },
23
27
  privateArgsShape: {
24
28
  orchestration: M.remotable('orchestration'),
25
29
  storageNode: StorageNodeShape,
@@ -57,7 +61,7 @@ export const start = async (zcf, privateArgs, baggage) => {
57
61
 
58
62
  const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller);
59
63
 
60
- const makeStakingAccountKit = prepareStakingAccountKit(
64
+ const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
61
65
  zone,
62
66
  makeRecorderKit,
63
67
  zcf,
@@ -68,28 +72,21 @@ export const start = async (zcf, privateArgs, baggage) => {
68
72
  hostConnectionId,
69
73
  controllerConnectionId,
70
74
  );
71
- // #9212 TODO do not fail if host does not have `async-icq` module;
75
+ // TODO https://github.com/Agoric/agoric-sdk/issues/9326
76
+ // Should not fail if host does not have `async-icq` module;
72
77
  // communicate to OrchestrationAccount that it can't send queries
73
78
  const icqConnection = await E(orchestration).provideICQConnection(
74
79
  controllerConnectionId,
75
80
  );
76
81
  const accountAddress = await E(account).getAddress();
77
82
  trace('account address', accountAddress);
78
- const { holder, invitationMakers } = makeStakingAccountKit(
79
- accountAddress,
80
- bondDenom,
81
- {
82
- account,
83
- storageNode,
84
- icqConnection,
85
- timer,
86
- },
87
- );
88
- return {
89
- publicSubscribers: holder.getPublicTopics(),
90
- invitationMakers,
91
- account: holder,
92
- };
83
+ const holder = makeCosmosOrchestrationAccount(accountAddress, bondDenom, {
84
+ account,
85
+ storageNode,
86
+ icqConnection,
87
+ timer,
88
+ });
89
+ return holder;
93
90
  }
94
91
 
95
92
  const publicFacet = zone.exo(
@@ -101,15 +98,15 @@ export const start = async (zcf, privateArgs, baggage) => {
101
98
  {
102
99
  async makeAccount() {
103
100
  trace('makeAccount');
104
- const { account } = await makeAccountKit();
105
- return account;
101
+ return makeAccountKit();
106
102
  },
107
103
  makeAccountInvitationMaker() {
108
104
  trace('makeCreateAccountInvitation');
109
105
  return zcf.makeInvitation(
110
106
  async seat => {
111
107
  seat.exit();
112
- return makeAccountKit();
108
+ const holder = await makeAccountKit();
109
+ return holder.asContinuingOffer();
113
110
  },
114
111
  'wantStakingAccount',
115
112
  undefined,
@@ -1 +1 @@
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"}
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;;;;;;;;;;+DAuCoC,OAAO,KACpD,CAAC;;;iEAUgT,OAAO,KAAK,CAAC;;;;;;;;;;;+DAAs4B,OAAO,KAAK,CAAC;;;iEAA+yB,OAAO,KAAK,CAAC;iCArEp+D,QAAQ,KAC9C,CAAC,mBAA4B,OAAM;iCAiBN,OAAQ,KAAI,CAAC;;;+BAclB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;QAiBvB;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBR;kCAhH0C,cAAc;gCAAd,cAAc"}
@@ -44,7 +44,7 @@ export const start = async (zcf, privateArgs, baggage) => {
44
44
 
45
45
  // Mocked until #8879
46
46
  // Would expect this to be instantiated elsewhere, and passed in as a reference
47
- const agoricChainInfo = prepareMockChainInfo(zone);
47
+ const agoricChainInfo = prepareMockChainInfo();
48
48
 
49
49
  const makeLocalChainAccountKit = prepareLocalChainAccountKit(
50
50
  zone,
@@ -4,6 +4,7 @@
4
4
  * @import {LocalChain} from '@agoric/vats/src/localchain.js';
5
5
  * @import {Remote} from '@agoric/internal';
6
6
  * @import {OrchestrationService} from '../service.js';
7
+ * @import {Baggage} from '@agoric/vat-data'
7
8
  * @import {Zone} from '@agoric/zone';
8
9
  */
9
10
  /** @type {ContractMeta} */
@@ -16,7 +17,18 @@ export function start(zcf: ZCF, privateArgs: {
16
17
  localchain: Remote<import("@endo/exo").Guarded<{
17
18
  makeAccount(): Promise<import("@endo/exo").Guarded<{
18
19
  getAddress(): Promise<string>;
19
- getBalance(brand: Brand<"nat">): Promise<import("@agoric/ertp/src/types.js").NatAmount>;
20
+ getBalance(brand: Brand<"nat"
21
+ /**
22
+ * @param {ZCF} zcf
23
+ * @param {{
24
+ * localchain: Remote<LocalChain>;
25
+ * orchestrationService: Remote<OrchestrationService>;
26
+ * storageNode: Remote<StorageNode>;
27
+ * timerService: Remote<TimerService>;
28
+ * }} privateArgs
29
+ * @param {Baggage} baggage
30
+ */
31
+ >): Promise<import("@agoric/ertp/src/types.js").NatAmount>;
20
32
  deposit(payment: Payment<"nat">, optAmountShape?: Pattern): Promise<globalThis.Amount>;
21
33
  withdraw(amount: Amount<"nat">): Promise<globalThis.Payment<"nat">>;
22
34
  executeTx<MT extends {
@@ -40,11 +52,10 @@ export function start(zcf: ZCF, privateArgs: {
40
52
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
41
53
  query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>;
42
54
  }>>;
43
- }>> | null;
55
+ }>>;
44
56
  storageNode: Remote<globalThis.StorageNode>;
45
- timerService: Remote<TimerService> | null;
46
- zone: Zone;
47
- }): Promise<{
57
+ timerService: Remote<TimerService>;
58
+ }, baggage: Baggage): Promise<{
48
59
  publicFacet: {
49
60
  makeSwapAndStakeInvitation: () => Promise<Invitation<unknown, {
50
61
  staked: Amount<"nat">;
@@ -60,6 +71,6 @@ export function start(zcf: ZCF, privateArgs: {
60
71
  import type { Remote } from '@agoric/internal';
61
72
  import type { IcaAccount } from '../types.js';
62
73
  import type { TimerService } from '@agoric/time';
63
- import type { Zone } from '@agoric/zone';
74
+ import type { Baggage } from '@agoric/vat-data';
64
75
  import type { CosmosValidatorAddress } from '../types.js';
65
76
  //# sourceMappingURL=swapExample.contract.d.ts.map
@@ -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;;;;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"}
1
+ {"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CASrB;AASK,0CAHI,KAAK;;;EAIsC;AAY/C,2BATI,GAAG;;;;8BAH8B,MAAM,KAAK;YAEvD;;;;;;;;;eASG;aAVH;6BAgB4C,QAAQ,KAAK,CAAC,mBAC/C,OAEX;6BAoB4D,OAAO,KAAK,CAAC;;;2BAeH,EACtE;;uBAyCkmC,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;oBAhE50D,MAAM,CAAC,KAAK,CAAC;;;;;oBAAb,MAAM,CAAC,KAAK,CAAC;;;;GA+D7B;4BAzHwB,kBAAkB;gCAHwB,aAAa;kCACjD,cAAc;6BAInB,kBAAkB;4CALuB,aAAa"}
@@ -1,6 +1,7 @@
1
1
  import { StorageNodeShape } from '@agoric/internal';
2
2
  import { TimerServiceShape } from '@agoric/time';
3
3
  import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js';
4
+ import { makeDurableZone } from '@agoric/zone/durable.js';
4
5
  import { Far } from '@endo/far';
5
6
  import { deeplyFulfilled } from '@endo/marshal';
6
7
  import { M, objectMap } from '@endo/patterns';
@@ -13,6 +14,7 @@ import { orcUtils } from '../utils/orc.js';
13
14
  * @import {LocalChain} from '@agoric/vats/src/localchain.js';
14
15
  * @import {Remote} from '@agoric/internal';
15
16
  * @import {OrchestrationService} from '../service.js';
17
+ * @import {Baggage} from '@agoric/vat-data'
16
18
  * @import {Zone} from '@agoric/zone';
17
19
  */
18
20
 
@@ -23,7 +25,6 @@ export const meta = {
23
25
  orchestrationService: M.or(M.remotable('orchestration'), null),
24
26
  storageNode: StorageNodeShape,
25
27
  timerService: M.or(TimerServiceShape, null),
26
- zone: M.any(),
27
28
  },
28
29
  upgradability: 'canUpgrade',
29
30
  };
@@ -42,16 +43,18 @@ export const makeNatAmountShape = (brand, min) =>
42
43
  * @param {ZCF} zcf
43
44
  * @param {{
44
45
  * localchain: Remote<LocalChain>;
45
- * orchestrationService: Remote<OrchestrationService> | null;
46
+ * orchestrationService: Remote<OrchestrationService>;
46
47
  * storageNode: Remote<StorageNode>;
47
- * timerService: Remote<TimerService> | null;
48
- * zone: Zone;
48
+ * timerService: Remote<TimerService>;
49
49
  * }} privateArgs
50
+ * @param {Baggage} baggage
50
51
  */
51
- export const start = async (zcf, privateArgs) => {
52
+ export const start = async (zcf, privateArgs, baggage) => {
52
53
  const { brands } = zcf.getTerms();
53
54
 
54
- const { localchain, orchestrationService, storageNode, timerService, zone } =
55
+ const zone = makeDurableZone(baggage);
56
+
57
+ const { localchain, orchestrationService, storageNode, timerService } =
55
58
  privateArgs;
56
59
 
57
60
  const { orchestrate } = makeOrchestrationFacade({
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AAwBO,2BATI,GAAG;;;;8BA8BD,MAAM,KAAK,CAAC;6BAQkB,QAAQ,KAAK,CAAC,mBAC5C,OAAO;6BAWsB,OAAO,KAC9C,CAAC;;;2BAsBuD,EAAE;;uBAAupE,OAAO,sBAAsB,EAAE,SAAS;;;4BAAyqB,OAAO,sBAAsB,EAAE,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;GAD98F;4BA7EwB,kBAAkB;gCAJwB,aAAa;kCACjD,cAAc;6BACnB,kBAAkB"}
@@ -1,6 +1,6 @@
1
+ import { makeDurableZone } from '@agoric/zone/durable.js';
1
2
  import { Far } from '@endo/far';
2
3
  import { M } from '@endo/patterns';
3
- import { makeDurableZone } from '@agoric/zone/durable.js';
4
4
  import { makeOrchestrationFacade } from '../facade.js';
5
5
 
6
6
  /**
@@ -49,19 +49,21 @@ export const start = async (zcf, privateArgs, baggage) => {
49
49
  const celestia = await orch.getChain('celestia');
50
50
  const celestiaAccount = await celestia.makeAccount();
51
51
 
52
- const delegations = await celestiaAccount.getDelegations();
53
- // wait for the undelegations to be complete (may take weeks)
54
- await celestiaAccount.undelegate(delegations);
52
+ // TODO implement these
53
+ // const delegations = await celestiaAccount.getDelegations();
54
+ // // wait for the undelegations to be complete (may take weeks)
55
+ // await celestiaAccount.undelegate(delegations);
55
56
 
56
57
  // ??? should this be synchronous? depends on how names are resolved.
57
58
  const stride = await orch.getChain('stride');
58
59
  const strideAccount = await stride.makeAccount();
59
60
 
60
61
  // TODO the `TIA` string actually needs to be the Brand from AgoricNames
61
- const tiaAmt = await celestiaAccount.getBalance('TIA');
62
- await celestiaAccount.transfer(tiaAmt, strideAccount.getAddress());
62
+ // const tiaAmt = await celestiaAccount.getBalance('TIA');
63
+ // await celestiaAccount.transfer(tiaAmt, strideAccount.getAddress());
63
64
 
64
- await strideAccount.liquidStake(tiaAmt);
65
+ // await strideAccount.liquidStake(tiaAmt);
66
+ console.log(celestiaAccount, strideAccount);
65
67
  },
66
68
  );
67
69
 
@@ -1,20 +1,21 @@
1
1
  export const ChainAccountI: import("@endo/patterns").InterfaceGuard<{
2
2
  getAddress: import("@endo/patterns").MethodGuard;
3
+ getBalance: import("@endo/patterns").MethodGuard;
4
+ getBalances: import("@endo/patterns").MethodGuard;
3
5
  getLocalAddress: import("@endo/patterns").MethodGuard;
4
6
  getRemoteAddress: import("@endo/patterns").MethodGuard;
5
7
  getPort: import("@endo/patterns").MethodGuard;
6
8
  executeTx: import("@endo/patterns").MethodGuard;
7
9
  executeEncodedTx: import("@endo/patterns").MethodGuard;
8
10
  close: import("@endo/patterns").MethodGuard;
9
- deposit: import("@endo/patterns").MethodGuard;
10
11
  getPurse: import("@endo/patterns").MethodGuard;
11
12
  }>;
12
13
  export function prepareChainAccountKit(zone: Zone): (port: Port, requestedRemoteAddress: string) => import("@endo/exo").GuardedKit<{
13
14
  account: {
14
- /**
15
- * @returns {ChainAddress}
16
- */
15
+ /** @returns {ChainAddress} */
17
16
  getAddress(): ChainAddress;
17
+ getBalance(_denom: any): never;
18
+ getBalances(): never;
18
19
  getLocalAddress(): `/ibc-port/${string}`;
19
20
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
20
21
  getPort(): Port;
@@ -30,11 +31,8 @@ export function prepareChainAccountKit(zone: Zone): (port: Port, requestedRemote
30
31
  * @throws {Error} if packet fails to send or an error is returned
31
32
  */
32
33
  executeEncodedTx(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/google/protobuf/any.js").Any>[], opts?: Omit<TxBody, "messages"> | undefined): Promise<string>;
33
- /**
34
- * Close the remote account
35
- */
34
+ /** Close the remote account */
36
35
  close(): Promise<void>;
37
- deposit(payment: any): Promise<never>;
38
36
  /**
39
37
  * get Purse for a brand to .withdraw() a Payment from the account
40
38
  *
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"chainAccountKit.d.ts","sourceRoot":"","sources":["chainAccountKit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;GAaG;AAcI;;QAmBC,8BAA8B;;;;;;;;QAiC9B;;;;;;;;;WASG;mLAHU,OAAO,CAAC,MAAM,CAAC;QAa5B,+BAA+B;;QAS/B;;;;WAIG;wBADQ,KAAK;;;QAQhB;;;;WAIG;;;;;GAyBR;qCAtJW,0BAA0B;;;;;4BAuBX,MAAM;;;;8BAiIrB,UAAU,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;0BApK5C,mBAAmB;0BACP,iBAAiB;kCAKrB,aAAa;4BAFnB,8CAA8C;gCAHpC,iBAAiB;4BAC3B,aAAa"}