@connext/apps
Advanced tools
Comparing version 5.0.2 to 5.1.0
@@ -10,30 +10,16 @@ this.window = this.window || {}; | ||
function convertFastSignedTransferAppState(to, obj) { | ||
return Object.assign(Object.assign({}, obj), { coinTransfers: [ | ||
return Object.assign({ coinTransfers: [ | ||
types.convertAmountField(to, obj.coinTransfers[0]), | ||
types.convertAmountField(to, obj.coinTransfers[1]), | ||
], lockedPayments: obj.lockedPayments.map(lockedPayment => types.convertAmountField(to, lockedPayment)) }); | ||
] }, types.convertAmountField(to, obj)); | ||
} | ||
const FastSignedTransferApp = "FastSignedTransferApp"; | ||
const FastSignedTransferAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: FastSignedTransferApp, | ||
name: types.FastSignedTransferApp, | ||
outcomeType: types.OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: types.FastSignerTransferAppStateEncoding, | ||
actionEncoding: types.FastSignerTransferAppActionEncoding, | ||
stateEncoding: types.FastSignedTransferAppStateEncoding, | ||
actionEncoding: types.FastSignedTransferAppActionEncoding, | ||
}; | ||
function convertCoinBalanceRefund(to, obj) { | ||
const fromType = types.getType(obj.threshold); | ||
return types.convertFields(fromType, to, ["threshold"], obj); | ||
} | ||
const CoinBalanceRefundApp = "CoinBalanceRefundApp"; | ||
const CoinBalanceRefundAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: CoinBalanceRefundApp, | ||
outcomeType: types.OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: types.CoinBalanceRefundAppStateEncoding, | ||
}; | ||
const appProposalMatchesRegistry = (proposal, appRegistryInfo) => { | ||
@@ -80,3 +66,3 @@ if (!((proposal.abiEncodings.actionEncoding === appRegistryInfo.actionEncoding && | ||
initiatorDeposit.isZero() && | ||
appRegistryInfo.name !== CoinBalanceRefundApp) { | ||
appRegistryInfo.name !== types.CoinBalanceRefundApp) { | ||
throw new Error(`Cannot install an app with zero valued deposits for both initiator and responder.`); | ||
@@ -90,2 +76,5 @@ } | ||
initialState.coinTransfers = initialState.coinTransfers.map((transfer) => types.bigNumberifyObj(transfer)); | ||
if (initialState.paymentId !== constants.HashZero) { | ||
throw new Error(`Cannot install with pre-populated paymentId`); | ||
} | ||
const initiatorFreeBalanceAddress = cfCore.xkeyKthAddress(initiatorPublicIdentifier); | ||
@@ -121,7 +110,6 @@ const responderFreeBalanceAddress = cfCore.xkeyKthAddress(responderPublicIdentifier); | ||
const SimpleLinkedTransferApp = "SimpleLinkedTransferApp"; | ||
const SimpleLinkedTransferAppRegistryInfo = { | ||
actionEncoding: types.SimpleLinkedTransferAppActionEncoding, | ||
allowNodeInstall: true, | ||
name: SimpleLinkedTransferApp, | ||
name: types.SimpleLinkedTransferApp, | ||
outcomeType: types.OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
@@ -160,6 +148,5 @@ stateEncoding: types.SimpleLinkedTransferAppStateEncoding, | ||
const SimpleTwoPartySwapApp = "SimpleTwoPartySwapApp"; | ||
const SimpleTwoPartySwapAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: SimpleTwoPartySwapApp, | ||
name: types.SimpleTwoPartySwapApp, | ||
outcomeType: types.OutcomeType.MULTI_ASSET_MULTI_PARTY_COIN_TRANSFER, | ||
@@ -185,7 +172,19 @@ stateEncoding: types.SimpleSwapAppStateEncoding, | ||
function convertCoinBalanceRefund(to, obj) { | ||
const fromType = types.getType(obj.threshold); | ||
return types.convertFields(fromType, to, ["threshold"], obj); | ||
} | ||
const CoinBalanceRefundAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: types.CoinBalanceRefundApp, | ||
outcomeType: types.OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: types.CoinBalanceRefundAppStateEncoding, | ||
}; | ||
const SupportedApplications = { | ||
[CoinBalanceRefundApp]: CoinBalanceRefundApp, | ||
[SimpleLinkedTransferApp]: SimpleLinkedTransferApp, | ||
[SimpleTwoPartySwapApp]: SimpleTwoPartySwapApp, | ||
[FastSignedTransferApp]: FastSignedTransferApp, | ||
[types.CoinBalanceRefundApp]: types.CoinBalanceRefundApp, | ||
[types.SimpleLinkedTransferApp]: types.SimpleLinkedTransferApp, | ||
[types.SimpleTwoPartySwapApp]: types.SimpleTwoPartySwapApp, | ||
[types.FastSignedTransferApp]: types.FastSignedTransferApp, | ||
}; | ||
@@ -200,9 +199,5 @@ const AppRegistry = [ | ||
exports.AppRegistry = AppRegistry; | ||
exports.CoinBalanceRefundApp = CoinBalanceRefundApp; | ||
exports.CoinBalanceRefundAppRegistryInfo = CoinBalanceRefundAppRegistryInfo; | ||
exports.FastSignedTransferApp = FastSignedTransferApp; | ||
exports.FastSignedTransferAppRegistryInfo = FastSignedTransferAppRegistryInfo; | ||
exports.SimpleLinkedTransferApp = SimpleLinkedTransferApp; | ||
exports.SimpleLinkedTransferAppRegistryInfo = SimpleLinkedTransferAppRegistryInfo; | ||
exports.SimpleTwoPartySwapApp = SimpleTwoPartySwapApp; | ||
exports.SimpleTwoPartySwapAppRegistryInfo = SimpleTwoPartySwapAppRegistryInfo; | ||
@@ -209,0 +204,0 @@ exports.SupportedApplications = SupportedApplications; |
@@ -1,4 +0,4 @@ | ||
import { getType, convertFields, convertAmountField, OutcomeType, FastSignerTransferAppStateEncoding, FastSignerTransferAppActionEncoding, CoinBalanceRefundAppStateEncoding, bigNumberifyObj, stringify, convertAssetAmountWithId, SimpleLinkedTransferAppActionEncoding, SimpleLinkedTransferAppStateEncoding, makeChecksumOrEthAddress, SimpleSwapAppStateEncoding, calculateExchange } from '@connext/types'; | ||
import { getType, convertFields, convertAmountField, FastSignedTransferApp, OutcomeType, FastSignedTransferAppStateEncoding, FastSignedTransferAppActionEncoding, bigNumberifyObj, CoinBalanceRefundApp, stringify, convertAssetAmountWithId, SimpleLinkedTransferAppActionEncoding, SimpleLinkedTransferApp, SimpleLinkedTransferAppStateEncoding, makeChecksumOrEthAddress, SimpleTwoPartySwapApp, SimpleSwapAppStateEncoding, calculateExchange, CoinBalanceRefundAppStateEncoding } from '@connext/types'; | ||
import { xkeyKthAddress } from '@connext/cf-core'; | ||
import { Zero } from 'ethers/constants'; | ||
import { Zero, HashZero } from 'ethers/constants'; | ||
import { bigNumberify } from 'ethers/utils'; | ||
@@ -11,9 +11,8 @@ | ||
function convertFastSignedTransferAppState(to, obj) { | ||
return Object.assign(Object.assign({}, obj), { coinTransfers: [ | ||
return Object.assign({ coinTransfers: [ | ||
convertAmountField(to, obj.coinTransfers[0]), | ||
convertAmountField(to, obj.coinTransfers[1]), | ||
], lockedPayments: obj.lockedPayments.map(lockedPayment => convertAmountField(to, lockedPayment)) }); | ||
] }, convertAmountField(to, obj)); | ||
} | ||
const FastSignedTransferApp = "FastSignedTransferApp"; | ||
const FastSignedTransferAppRegistryInfo = { | ||
@@ -23,19 +22,6 @@ allowNodeInstall: true, | ||
outcomeType: OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: FastSignerTransferAppStateEncoding, | ||
actionEncoding: FastSignerTransferAppActionEncoding, | ||
stateEncoding: FastSignedTransferAppStateEncoding, | ||
actionEncoding: FastSignedTransferAppActionEncoding, | ||
}; | ||
function convertCoinBalanceRefund(to, obj) { | ||
const fromType = getType(obj.threshold); | ||
return convertFields(fromType, to, ["threshold"], obj); | ||
} | ||
const CoinBalanceRefundApp = "CoinBalanceRefundApp"; | ||
const CoinBalanceRefundAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: CoinBalanceRefundApp, | ||
outcomeType: OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: CoinBalanceRefundAppStateEncoding, | ||
}; | ||
const appProposalMatchesRegistry = (proposal, appRegistryInfo) => { | ||
@@ -91,2 +77,5 @@ if (!((proposal.abiEncodings.actionEncoding === appRegistryInfo.actionEncoding && | ||
initialState.coinTransfers = initialState.coinTransfers.map((transfer) => bigNumberifyObj(transfer)); | ||
if (initialState.paymentId !== HashZero) { | ||
throw new Error(`Cannot install with pre-populated paymentId`); | ||
} | ||
const initiatorFreeBalanceAddress = xkeyKthAddress(initiatorPublicIdentifier); | ||
@@ -122,3 +111,2 @@ const responderFreeBalanceAddress = xkeyKthAddress(responderPublicIdentifier); | ||
const SimpleLinkedTransferApp = "SimpleLinkedTransferApp"; | ||
const SimpleLinkedTransferAppRegistryInfo = { | ||
@@ -161,3 +149,2 @@ actionEncoding: SimpleLinkedTransferAppActionEncoding, | ||
const SimpleTwoPartySwapApp = "SimpleTwoPartySwapApp"; | ||
const SimpleTwoPartySwapAppRegistryInfo = { | ||
@@ -186,2 +173,14 @@ allowNodeInstall: true, | ||
function convertCoinBalanceRefund(to, obj) { | ||
const fromType = getType(obj.threshold); | ||
return convertFields(fromType, to, ["threshold"], obj); | ||
} | ||
const CoinBalanceRefundAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: CoinBalanceRefundApp, | ||
outcomeType: OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: CoinBalanceRefundAppStateEncoding, | ||
}; | ||
const SupportedApplications = { | ||
@@ -200,2 +199,2 @@ [CoinBalanceRefundApp]: CoinBalanceRefundApp, | ||
export { AppRegistry, CoinBalanceRefundApp, CoinBalanceRefundAppRegistryInfo, FastSignedTransferApp, FastSignedTransferAppRegistryInfo, SimpleLinkedTransferApp, SimpleLinkedTransferAppRegistryInfo, SimpleTwoPartySwapApp, SimpleTwoPartySwapAppRegistryInfo, SupportedApplications, baseCoinTransferValidation, commonAppProposalValidation, convertCoinBalanceRefund, convertFastSignedTransferAppState, convertFastSignedTransferParameters, convertLinkedTransferAppState, convertLinkedTransferParameters, convertLinkedTransferToRecipientParameters, convertResolveLinkedTransferParameters, convertResolveLinkedTransferToRecipientParameters, convertSimpleSwapAppState, convertSwapParameters, unidirectionalCoinTransferValidation, validateFastSignedTransferApp, validateSimpleLinkedTransferApp, validateSimpleSwapApp }; | ||
export { AppRegistry, CoinBalanceRefundAppRegistryInfo, FastSignedTransferAppRegistryInfo, SimpleLinkedTransferAppRegistryInfo, SimpleTwoPartySwapAppRegistryInfo, SupportedApplications, baseCoinTransferValidation, commonAppProposalValidation, convertCoinBalanceRefund, convertFastSignedTransferAppState, convertFastSignedTransferParameters, convertLinkedTransferAppState, convertLinkedTransferParameters, convertLinkedTransferToRecipientParameters, convertResolveLinkedTransferParameters, convertResolveLinkedTransferToRecipientParameters, convertSimpleSwapAppState, convertSwapParameters, unidirectionalCoinTransferValidation, validateFastSignedTransferApp, validateSimpleLinkedTransferApp, validateSimpleSwapApp }; |
@@ -15,30 +15,16 @@ 'use strict'; | ||
function convertFastSignedTransferAppState(to, obj) { | ||
return Object.assign(Object.assign({}, obj), { coinTransfers: [ | ||
return Object.assign({ coinTransfers: [ | ||
types.convertAmountField(to, obj.coinTransfers[0]), | ||
types.convertAmountField(to, obj.coinTransfers[1]), | ||
], lockedPayments: obj.lockedPayments.map(lockedPayment => types.convertAmountField(to, lockedPayment)) }); | ||
] }, types.convertAmountField(to, obj)); | ||
} | ||
const FastSignedTransferApp = "FastSignedTransferApp"; | ||
const FastSignedTransferAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: FastSignedTransferApp, | ||
name: types.FastSignedTransferApp, | ||
outcomeType: types.OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: types.FastSignerTransferAppStateEncoding, | ||
actionEncoding: types.FastSignerTransferAppActionEncoding, | ||
stateEncoding: types.FastSignedTransferAppStateEncoding, | ||
actionEncoding: types.FastSignedTransferAppActionEncoding, | ||
}; | ||
function convertCoinBalanceRefund(to, obj) { | ||
const fromType = types.getType(obj.threshold); | ||
return types.convertFields(fromType, to, ["threshold"], obj); | ||
} | ||
const CoinBalanceRefundApp = "CoinBalanceRefundApp"; | ||
const CoinBalanceRefundAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: CoinBalanceRefundApp, | ||
outcomeType: types.OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: types.CoinBalanceRefundAppStateEncoding, | ||
}; | ||
const appProposalMatchesRegistry = (proposal, appRegistryInfo) => { | ||
@@ -85,3 +71,3 @@ if (!((proposal.abiEncodings.actionEncoding === appRegistryInfo.actionEncoding && | ||
initiatorDeposit.isZero() && | ||
appRegistryInfo.name !== CoinBalanceRefundApp) { | ||
appRegistryInfo.name !== types.CoinBalanceRefundApp) { | ||
throw new Error(`Cannot install an app with zero valued deposits for both initiator and responder.`); | ||
@@ -95,2 +81,5 @@ } | ||
initialState.coinTransfers = initialState.coinTransfers.map((transfer) => types.bigNumberifyObj(transfer)); | ||
if (initialState.paymentId !== constants.HashZero) { | ||
throw new Error(`Cannot install with pre-populated paymentId`); | ||
} | ||
const initiatorFreeBalanceAddress = cfCore.xkeyKthAddress(initiatorPublicIdentifier); | ||
@@ -126,7 +115,6 @@ const responderFreeBalanceAddress = cfCore.xkeyKthAddress(responderPublicIdentifier); | ||
const SimpleLinkedTransferApp = "SimpleLinkedTransferApp"; | ||
const SimpleLinkedTransferAppRegistryInfo = { | ||
actionEncoding: types.SimpleLinkedTransferAppActionEncoding, | ||
allowNodeInstall: true, | ||
name: SimpleLinkedTransferApp, | ||
name: types.SimpleLinkedTransferApp, | ||
outcomeType: types.OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
@@ -165,6 +153,5 @@ stateEncoding: types.SimpleLinkedTransferAppStateEncoding, | ||
const SimpleTwoPartySwapApp = "SimpleTwoPartySwapApp"; | ||
const SimpleTwoPartySwapAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: SimpleTwoPartySwapApp, | ||
name: types.SimpleTwoPartySwapApp, | ||
outcomeType: types.OutcomeType.MULTI_ASSET_MULTI_PARTY_COIN_TRANSFER, | ||
@@ -190,7 +177,19 @@ stateEncoding: types.SimpleSwapAppStateEncoding, | ||
function convertCoinBalanceRefund(to, obj) { | ||
const fromType = types.getType(obj.threshold); | ||
return types.convertFields(fromType, to, ["threshold"], obj); | ||
} | ||
const CoinBalanceRefundAppRegistryInfo = { | ||
allowNodeInstall: true, | ||
name: types.CoinBalanceRefundApp, | ||
outcomeType: types.OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: types.CoinBalanceRefundAppStateEncoding, | ||
}; | ||
const SupportedApplications = { | ||
[CoinBalanceRefundApp]: CoinBalanceRefundApp, | ||
[SimpleLinkedTransferApp]: SimpleLinkedTransferApp, | ||
[SimpleTwoPartySwapApp]: SimpleTwoPartySwapApp, | ||
[FastSignedTransferApp]: FastSignedTransferApp, | ||
[types.CoinBalanceRefundApp]: types.CoinBalanceRefundApp, | ||
[types.SimpleLinkedTransferApp]: types.SimpleLinkedTransferApp, | ||
[types.SimpleTwoPartySwapApp]: types.SimpleTwoPartySwapApp, | ||
[types.FastSignedTransferApp]: types.FastSignedTransferApp, | ||
}; | ||
@@ -205,9 +204,5 @@ const AppRegistry = [ | ||
exports.AppRegistry = AppRegistry; | ||
exports.CoinBalanceRefundApp = CoinBalanceRefundApp; | ||
exports.CoinBalanceRefundAppRegistryInfo = CoinBalanceRefundAppRegistryInfo; | ||
exports.FastSignedTransferApp = FastSignedTransferApp; | ||
exports.FastSignedTransferAppRegistryInfo = FastSignedTransferAppRegistryInfo; | ||
exports.SimpleLinkedTransferApp = SimpleLinkedTransferApp; | ||
exports.SimpleLinkedTransferAppRegistryInfo = SimpleLinkedTransferAppRegistryInfo; | ||
exports.SimpleTwoPartySwapApp = SimpleTwoPartySwapApp; | ||
exports.SimpleTwoPartySwapAppRegistryInfo = SimpleTwoPartySwapAppRegistryInfo; | ||
@@ -214,0 +209,0 @@ exports.SupportedApplications = SupportedApplications; |
import { AppRegistryInfo } from "../shared"; | ||
export declare const CoinBalanceRefundApp = "CoinBalanceRefundApp"; | ||
export declare const CoinBalanceRefundAppRegistryInfo: AppRegistryInfo; | ||
//# sourceMappingURL=registry.d.ts.map |
@@ -1,3 +0,2 @@ | ||
import { CoinBalanceRefundAppStateEncoding, OutcomeType } from "@connext/types"; | ||
export const CoinBalanceRefundApp = "CoinBalanceRefundApp"; | ||
import { CoinBalanceRefundAppStateEncoding, OutcomeType, CoinBalanceRefundApp, } from "@connext/types"; | ||
export const CoinBalanceRefundAppRegistryInfo = { | ||
@@ -4,0 +3,0 @@ allowNodeInstall: true, |
@@ -7,7 +7,7 @@ import { getType, convertFields, convertAmountField, } from "@connext/types"; | ||
export function convertFastSignedTransferAppState(to, obj) { | ||
return Object.assign(Object.assign({}, obj), { coinTransfers: [ | ||
return Object.assign({ coinTransfers: [ | ||
convertAmountField(to, obj.coinTransfers[0]), | ||
convertAmountField(to, obj.coinTransfers[1]), | ||
], lockedPayments: obj.lockedPayments.map(lockedPayment => convertAmountField(to, lockedPayment)) }); | ||
] }, convertAmountField(to, obj)); | ||
} | ||
//# sourceMappingURL=convert.js.map |
import { AppRegistryInfo } from "../shared"; | ||
export declare const FastSignedTransferApp = "FastSignedTransferApp"; | ||
export declare const FastSignedTransferAppRegistryInfo: AppRegistryInfo; | ||
//# sourceMappingURL=registry.d.ts.map |
@@ -1,3 +0,2 @@ | ||
import { OutcomeType, FastSignerTransferAppStateEncoding, FastSignerTransferAppActionEncoding, } from "@connext/types"; | ||
export const FastSignedTransferApp = "FastSignedTransferApp"; | ||
import { OutcomeType, FastSignedTransferAppStateEncoding, FastSignedTransferAppActionEncoding, FastSignedTransferApp, } from "@connext/types"; | ||
export const FastSignedTransferAppRegistryInfo = { | ||
@@ -7,5 +6,5 @@ allowNodeInstall: true, | ||
outcomeType: OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: FastSignerTransferAppStateEncoding, | ||
actionEncoding: FastSignerTransferAppActionEncoding, | ||
stateEncoding: FastSignedTransferAppStateEncoding, | ||
actionEncoding: FastSignedTransferAppActionEncoding, | ||
}; | ||
//# sourceMappingURL=registry.js.map |
@@ -5,2 +5,3 @@ import { bigNumberifyObj } from "@connext/types"; | ||
import { convertFastSignedTransferAppState } from "./convert"; | ||
import { HashZero } from "ethers/constants"; | ||
export const validateFastSignedTransferApp = (params, initiatorPublicIdentifier, responderPublicIdentifier) => { | ||
@@ -10,2 +11,5 @@ const { responderDeposit, initiatorDeposit, initialState: initialStateBadType } = bigNumberifyObj(params); | ||
initialState.coinTransfers = initialState.coinTransfers.map((transfer) => bigNumberifyObj(transfer)); | ||
if (initialState.paymentId !== HashZero) { | ||
throw new Error(`Cannot install with pre-populated paymentId`); | ||
} | ||
const initiatorFreeBalanceAddress = xkeyKthAddress(initiatorPublicIdentifier); | ||
@@ -12,0 +16,0 @@ const responderFreeBalanceAddress = xkeyKthAddress(responderPublicIdentifier); |
import { BigNumber } from "ethers/utils"; | ||
import { FastSignedTransferApp } from "./FastSignedTransferApp"; | ||
import { AppRegistry as AppRegistryType } from "./shared"; | ||
import { SimpleLinkedTransferApp } from "./SimpleLinkedTransferApp"; | ||
import { SimpleTwoPartySwapApp } from "./SimpleTwoPartySwapApp"; | ||
import { CoinBalanceRefundApp } from "./CoinBalanceRefundApp"; | ||
import { SimpleLinkedTransferAppAction, SimpleSwapAppState, SimpleLinkedTransferAppState, FastSignedTransferAppAction, FastSignedTransferAppState } from "@connext/types"; | ||
import { SimpleLinkedTransferAppAction, SimpleSwapAppState, SimpleLinkedTransferAppState, FastSignedTransferAppAction, FastSignedTransferAppState, CoinBalanceRefundApp, SimpleLinkedTransferApp, SimpleTwoPartySwapApp, FastSignedTransferApp } from "@connext/types"; | ||
export * from "./shared"; | ||
@@ -9,0 +5,0 @@ export * from "./FastSignedTransferApp"; |
@@ -1,5 +0,6 @@ | ||
import { FastSignedTransferAppRegistryInfo, FastSignedTransferApp } from "./FastSignedTransferApp"; | ||
import { SimpleLinkedTransferApp, SimpleLinkedTransferAppRegistryInfo, } from "./SimpleLinkedTransferApp"; | ||
import { SimpleTwoPartySwapApp, SimpleTwoPartySwapAppRegistryInfo } from "./SimpleTwoPartySwapApp"; | ||
import { CoinBalanceRefundApp, CoinBalanceRefundAppRegistryInfo } from "./CoinBalanceRefundApp"; | ||
import { FastSignedTransferAppRegistryInfo } from "./FastSignedTransferApp"; | ||
import { SimpleLinkedTransferAppRegistryInfo } from "./SimpleLinkedTransferApp"; | ||
import { SimpleTwoPartySwapAppRegistryInfo } from "./SimpleTwoPartySwapApp"; | ||
import { CoinBalanceRefundAppRegistryInfo } from "./CoinBalanceRefundApp"; | ||
import { CoinBalanceRefundApp, SimpleLinkedTransferApp, SimpleTwoPartySwapApp, FastSignedTransferApp, } from "@connext/types"; | ||
export * from "./shared"; | ||
@@ -6,0 +7,0 @@ export * from "./FastSignedTransferApp"; |
@@ -1,4 +0,3 @@ | ||
import { stringify, bigNumberifyObj } from "@connext/types"; | ||
import { stringify, bigNumberifyObj, CoinBalanceRefundApp } from "@connext/types"; | ||
import { Zero } from "ethers/constants"; | ||
import { CoinBalanceRefundApp } from "../CoinBalanceRefundApp"; | ||
const appProposalMatchesRegistry = (proposal, appRegistryInfo) => { | ||
@@ -5,0 +4,0 @@ if (!((proposal.abiEncodings.actionEncoding === appRegistryInfo.actionEncoding && |
import { AppRegistryInfo } from "../shared"; | ||
export declare const SimpleLinkedTransferApp = "SimpleLinkedTransferApp"; | ||
export declare const SimpleLinkedTransferAppRegistryInfo: AppRegistryInfo; | ||
//# sourceMappingURL=registry.d.ts.map |
@@ -1,3 +0,2 @@ | ||
import { OutcomeType, SimpleLinkedTransferAppStateEncoding, SimpleLinkedTransferAppActionEncoding, } from "@connext/types"; | ||
export const SimpleLinkedTransferApp = "SimpleLinkedTransferApp"; | ||
import { OutcomeType, SimpleLinkedTransferAppStateEncoding, SimpleLinkedTransferAppActionEncoding, SimpleLinkedTransferApp, } from "@connext/types"; | ||
export const SimpleLinkedTransferAppRegistryInfo = { | ||
@@ -4,0 +3,0 @@ actionEncoding: SimpleLinkedTransferAppActionEncoding, |
import { AppRegistryInfo } from "../shared"; | ||
export declare const SimpleTwoPartySwapApp = "SimpleTwoPartySwapApp"; | ||
export declare const SimpleTwoPartySwapAppRegistryInfo: AppRegistryInfo; | ||
//# sourceMappingURL=registry.d.ts.map |
@@ -1,3 +0,2 @@ | ||
import { OutcomeType, SimpleSwapAppStateEncoding } from "@connext/types"; | ||
export const SimpleTwoPartySwapApp = "SimpleTwoPartySwapApp"; | ||
import { OutcomeType, SimpleSwapAppStateEncoding, SimpleTwoPartySwapApp } from "@connext/types"; | ||
export const SimpleTwoPartySwapAppRegistryInfo = { | ||
@@ -4,0 +3,0 @@ allowNodeInstall: true, |
{ | ||
"name": "@connext/apps", | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"description": "Connext Counterfactual Apps", | ||
@@ -19,3 +19,3 @@ "main": "dist/index.js", | ||
"@connext/cf-core": "5.0.2", | ||
"@connext/types": "5.0.2", | ||
"@connext/types": "5.1.0", | ||
"ethers": "4.0.45", | ||
@@ -22,0 +22,0 @@ "rollup": "1.31.1", |
@@ -1,7 +0,9 @@ | ||
import { CoinBalanceRefundAppStateEncoding, OutcomeType } from "@connext/types"; | ||
import { | ||
CoinBalanceRefundAppStateEncoding, | ||
OutcomeType, | ||
CoinBalanceRefundApp, | ||
} from "@connext/types"; | ||
import { AppRegistryInfo } from "../shared"; | ||
export const CoinBalanceRefundApp = "CoinBalanceRefundApp"; | ||
export const CoinBalanceRefundAppRegistryInfo: AppRegistryInfo = { | ||
@@ -8,0 +10,0 @@ allowNodeInstall: true, |
@@ -24,3 +24,2 @@ import { | ||
return { | ||
...obj, | ||
coinTransfers: [ | ||
@@ -30,4 +29,4 @@ convertAmountField(to, obj.coinTransfers[0]), | ||
], | ||
lockedPayments: obj.lockedPayments.map(lockedPayment => convertAmountField(to, lockedPayment)), | ||
...convertAmountField(to, obj), | ||
}; | ||
} |
import { | ||
OutcomeType, | ||
FastSignerTransferAppStateEncoding, | ||
FastSignerTransferAppActionEncoding, | ||
FastSignedTransferAppStateEncoding, | ||
FastSignedTransferAppActionEncoding, | ||
FastSignedTransferApp, | ||
} from "@connext/types"; | ||
@@ -10,4 +11,2 @@ | ||
export const FastSignedTransferApp = "FastSignedTransferApp"; | ||
export const FastSignedTransferAppRegistryInfo: AppRegistryInfo = { | ||
@@ -17,4 +16,4 @@ allowNodeInstall: true, | ||
outcomeType: OutcomeType.SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER, | ||
stateEncoding: FastSignerTransferAppStateEncoding, | ||
actionEncoding: FastSignerTransferAppActionEncoding, | ||
stateEncoding: FastSignedTransferAppStateEncoding, | ||
actionEncoding: FastSignedTransferAppActionEncoding, | ||
}; |
@@ -7,2 +7,3 @@ import { CFCoreTypes, bigNumberifyObj, CoinTransfer, CoinTransferBigNumber } from "@connext/types"; | ||
import { convertFastSignedTransferAppState } from "./convert"; | ||
import { HashZero } from "ethers/constants"; | ||
@@ -23,2 +24,6 @@ export const validateFastSignedTransferApp = ( | ||
if (initialState.paymentId !== HashZero) { | ||
throw new Error(`Cannot install with pre-populated paymentId`); | ||
} | ||
const initiatorFreeBalanceAddress = xkeyKthAddress(initiatorPublicIdentifier); | ||
@@ -25,0 +30,0 @@ const responderFreeBalanceAddress = xkeyKthAddress(responderPublicIdentifier); |
import { BigNumber } from "ethers/utils"; | ||
import { FastSignedTransferAppRegistryInfo, FastSignedTransferApp } from "./FastSignedTransferApp"; | ||
import { FastSignedTransferAppRegistryInfo } from "./FastSignedTransferApp"; | ||
import { AppRegistry as AppRegistryType } from "./shared"; | ||
import { SimpleLinkedTransferAppRegistryInfo } from "./SimpleLinkedTransferApp"; | ||
import { SimpleTwoPartySwapAppRegistryInfo } from "./SimpleTwoPartySwapApp"; | ||
import { CoinBalanceRefundAppRegistryInfo } from "./CoinBalanceRefundApp"; | ||
import { | ||
SimpleLinkedTransferApp, | ||
SimpleLinkedTransferAppRegistryInfo, | ||
} from "./SimpleLinkedTransferApp"; | ||
import { SimpleTwoPartySwapApp, SimpleTwoPartySwapAppRegistryInfo } from "./SimpleTwoPartySwapApp"; | ||
import { CoinBalanceRefundApp, CoinBalanceRefundAppRegistryInfo } from "./CoinBalanceRefundApp"; | ||
import { | ||
SimpleLinkedTransferAppAction, | ||
@@ -17,2 +14,6 @@ SimpleSwapAppState, | ||
FastSignedTransferAppState, | ||
CoinBalanceRefundApp, | ||
SimpleLinkedTransferApp, | ||
SimpleTwoPartySwapApp, | ||
FastSignedTransferApp, | ||
} from "@connext/types"; | ||
@@ -19,0 +20,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { CFCoreTypes, stringify, bigNumberifyObj, CoinTransferBigNumber } from "@connext/types"; | ||
import { CFCoreTypes, stringify, bigNumberifyObj, CoinTransferBigNumber, CoinBalanceRefundApp } from "@connext/types"; | ||
@@ -6,3 +6,2 @@ import { AppRegistryInfo } from "./registry"; | ||
import { Zero } from "ethers/constants"; | ||
import { CoinBalanceRefundApp } from "../CoinBalanceRefundApp"; | ||
@@ -9,0 +8,0 @@ const appProposalMatchesRegistry = ( |
@@ -5,2 +5,3 @@ import { | ||
SimpleLinkedTransferAppActionEncoding, | ||
SimpleLinkedTransferApp, | ||
} from "@connext/types"; | ||
@@ -10,4 +11,2 @@ | ||
export const SimpleLinkedTransferApp = "SimpleLinkedTransferApp"; | ||
export const SimpleLinkedTransferAppRegistryInfo: AppRegistryInfo = { | ||
@@ -14,0 +13,0 @@ actionEncoding: SimpleLinkedTransferAppActionEncoding, |
@@ -1,7 +0,5 @@ | ||
import { OutcomeType, SimpleSwapAppStateEncoding } from "@connext/types"; | ||
import { OutcomeType, SimpleSwapAppStateEncoding, SimpleTwoPartySwapApp } from "@connext/types"; | ||
import { AppRegistryInfo } from "../shared"; | ||
export const SimpleTwoPartySwapApp = "SimpleTwoPartySwapApp"; | ||
export const SimpleTwoPartySwapAppRegistryInfo: AppRegistryInfo = { | ||
@@ -8,0 +6,0 @@ allowNodeInstall: true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
394325
1352
1