Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"@polymeshassociation/local-signing-manager": "^3.5.2",
"@polymeshassociation/polymesh-sdk": "29.0.0-next.4",
"@polymeshassociation/polymesh-sdk": "29.0.0-next.5",
"cross-fetch": "^4.1.0",
"dotenv": "^16.5.0"
},
Expand Down
40 changes: 40 additions & 0 deletions tests/src/sdk/settlements/createSto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
OfferingBalanceStatus,
OfferingSaleStatus,
OfferingTimingStatus,
SignerKeyRingType,
VenueType,
} from '@polymeshassociation/polymesh-sdk/types';
import assert from 'node:assert';
Expand Down Expand Up @@ -123,6 +124,45 @@ export const createSto = async (
await investTx.run();
assert(investTx.isSuccess);

let offChainFundingDetails = await investableOffering.offChainFundingDetails();
assert(offChainFundingDetails.enabled === false, 'off chain funding should be disabled');

const enableOffChainFundingTx = await investableOffering.enableOffChainFunding({
offChainTicker: 'OFFCHAIN1234',
});
await enableOffChainFundingTx.run();
assert(enableOffChainFundingTx.isSuccess);

offChainFundingDetails = await investableOffering.offChainFundingDetails();
assert(offChainFundingDetails.enabled === true, 'off chain funding should be enabled');
assert(
offChainFundingDetails.offChainTicker === 'OFFCHAIN1234',
'off chain funding should be enabled'
);

const authChainFundingReceipt = await investableOffering.generateOffChainFundingReceipt({
uid: new BigNumber(1),
offChainTicker: 'OFFCHAIN1234',
amount: new BigNumber(100),
sender: investor,
metadata: 'Off chain metadata',
signer: investorAccount,
});

const offChainInvestTx = await investableOffering.invest(
{
offChainTicker: 'OFFCHAIN1234',
offChainFundingReceipt: authChainFundingReceipt,
purchasePortfolio: investorPortfolio,
purchaseAmount: new BigNumber(10),
maxPrice: new BigNumber(11),
},
{ signingAccount: investorAccount }
);

await offChainInvestTx.run();
assert(offChainInvestTx.isSuccess);

// Freeze the offering
const freezeTx = await offering.freeze();
await freezeTx.run();
Expand Down
10 changes: 5 additions & 5 deletions tests/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1637,9 +1637,9 @@ __metadata:
languageName: node
linkType: hard

"@polymeshassociation/polymesh-sdk@npm:29.0.0-next.4":
version: 29.0.0-next.4
resolution: "@polymeshassociation/polymesh-sdk@npm:29.0.0-next.4"
"@polymeshassociation/polymesh-sdk@npm:29.0.0-next.5":
version: 29.0.0-next.5
resolution: "@polymeshassociation/polymesh-sdk@npm:29.0.0-next.5"
dependencies:
"@apollo/client": "npm:^3.8.1"
"@polkadot/api": "npm:11.2.1"
Expand All @@ -1657,7 +1657,7 @@ __metadata:
semver: "npm:^7.5.4"
ts-morph: "npm:^25.0.1"
websocket: "npm:^1.0.34"
checksum: 10c0/2f2bc65b9d5bb62532525fd5b2c207ff62f9a37ccf343fe933f8bd4f1c05a898fd91fda232a187286d789f5c36d457f74c287125196826d2cc44cfee450654f2
checksum: 10c0/23c86ada463d9c6ce99aae3e576ea2fde5aa71960142411ce1d2e2f0bb0c52be59bbac4636fd52f83a63eb63dc1d25341eee5bb3427de8eb51d1a860c93153de
languageName: node
linkType: hard

Expand Down Expand Up @@ -6800,7 +6800,7 @@ __metadata:
resolution: "polymesh-dev-env@workspace:."
dependencies:
"@polymeshassociation/local-signing-manager": "npm:^3.5.2"
"@polymeshassociation/polymesh-sdk": "npm:29.0.0-next.4"
"@polymeshassociation/polymesh-sdk": "npm:29.0.0-next.5"
"@types/jest": "npm:^29.5.14"
"@types/node": "npm:^22.15.17"
"@typescript-eslint/eslint-plugin": "npm:4.29.0"
Expand Down
Loading