Skip to content

Commit 444a107

Browse files
authored
Merge pull request #160 from owl352/feat/add-token-verify
Implement address info verify
2 parents 8a533e1 + 813e7f7 commit 444a107

25 files changed

+250
-71
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "pshenmic-dpp"
33
authors = ["owl352 <kokosinca123@gmail.com>"]
4-
version = "2.0.0-dev.6"
4+
version = "2.0.0-dev.7"
55
edition = "2024"
66

77
[lib]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pshenmic-dpp",
3-
"version": "2.0.0-dev.6",
3+
"version": "2.0.0-dev.7",
44
"main": "dist/src/wasm.js",
55
"types": "dist/src/wasm.d.ts",
66
"react-native": "./dist/src/react-native.js",

pkg/src/dpp/dpp.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export { StateTransitionWASM } from './structs/StateTransition.js'
2121
export { PrivateEncryptedNoteWASM } from './structs/EncryptedNote/PrivateEncryptedNote.js'
2222
export { SharedEncryptedNoteWASM } from './structs/EncryptedNote/SharedEncryptedNote.js'
2323
export { GroupStateTransitionInfoWASM } from './structs/GroupStateTransitionInfo.js'
24-
export { PlatformAddressWASM } from './structs/Address/PlatformAddress.js'
25-
export { AddressWitnessWASM } from './structs/Address/AddressWitness.js'
24+
export { PlatformAddressWASM } from './structs/PlatformAddress/PlatformAddress.js'
25+
export { AddressWitnessWASM } from './structs/PlatformAddress/AddressWitness.js'
2626
export { IdentityCreateTransitionWASM } from './structs/IdentityTransitions/IdentityCreateTransition.js'
2727
export { IdentityTopUpTransitionWASM } from './structs/IdentityTransitions/IdentityTopUpTransition.js'
2828
export { IdentityUpdateTransitionWASM } from './structs/IdentityTransitions/IdentityUpdateTransition.js'
@@ -125,3 +125,4 @@ export { verifyTokenContractInfoProof } from './verify/Tokens/verifyTokenContrac
125125
export { verifyTokenDirectPurchasePrices } from './verify/Tokens/verifyTokenDirectPurchasePrices.js'
126126
export { verifyTokenTotalSupplyProof } from './verify/Tokens/verifyTokenTotalSupplyProof.js'
127127
export { verifyTokensBalancesForIdentityProof } from './verify/Tokens/verifyTokensBalancesForIdentityProof.js'
128+
export { verifyPlatformAddressInfo } from './verify/PlatformAddress/verifyPlatformAddressInfo.js'

pkg/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { InputAddressWASM } from './entities/InputAddress.js'
33
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js'
44
import { PoolingLike } from '../../types.js'
55
import { CoreScriptWASM } from '../CoreScript.js'
6-
import { AddressWitnessWASM } from '../Address/AddressWitness.js'
6+
import { AddressWitnessWASM } from '../PlatformAddress/AddressWitness.js'
77
import { OutputAddressWASM } from './entities/OutputAddress.js'
88
import { dppProvider } from '../../provider.js'
99
import { valueToDynamicValue } from '../../utils.js'

pkg/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { AddressFundingFromAssetLockTransitionNAPI } from '../../../../bina
22
import { AssetLockProofWASM } from '../AssetLockProof/AssetLockProof.js'
33
import { InputAddressWASM } from './entities/InputAddress.js'
44
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js'
5-
import { AddressWitnessWASM } from '../Address/AddressWitness.js'
5+
import { AddressWitnessWASM } from '../PlatformAddress/AddressWitness.js'
66
import { OutputAddressNullableCreditsWASM } from './entities/OutputAddressNullableCredits.js'
77
import { dppProvider } from '../../provider.js'
88
import { StateTransitionWASM } from '../StateTransition.js'

pkg/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { AddressFundsTransferTransitionNAPI } from '../../../../binaries/bindingsTypes.js'
22
import { InputAddressWASM } from './entities/InputAddress.js'
33
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js'
4-
import { AddressWitnessWASM } from '../Address/AddressWitness.js'
4+
import { AddressWitnessWASM } from '../PlatformAddress/AddressWitness.js'
55
import { OutputAddressWASM } from './entities/OutputAddress.js'
66
import { dppProvider } from '../../provider.js'
77
import { StateTransitionWASM } from '../StateTransition.js'

pkg/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { IdentityCreateFromAddressesTransitionNAPI } from '../../../../bina
22
import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js'
33
import { InputAddressWASM } from './entities/InputAddress.js'
44
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js'
5-
import { AddressWitnessWASM } from '../Address/AddressWitness.js'
5+
import { AddressWitnessWASM } from '../PlatformAddress/AddressWitness.js'
66
import { OutputAddressWASM } from './entities/OutputAddress.js'
77
import { dppProvider } from '../../provider.js'
88
import { StateTransitionWASM } from '../StateTransition.js'

pkg/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { dppProvider } from '../../provider.js'
33
import { IdentifierLike } from '../../types.js'
44
import { InputAddressWASM } from './entities/InputAddress.js'
55
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js'
6-
import { AddressWitnessWASM } from '../Address/AddressWitness.js'
6+
import { AddressWitnessWASM } from '../PlatformAddress/AddressWitness.js'
77
import { OutputAddressWASM } from './entities/OutputAddress.js'
88
import { prepareIdentifierValue } from '../../utils.js'
99
import { StateTransitionWASM } from '../StateTransition.js'

pkg/src/dpp/structs/AddressTransitions/entities/InputAddress.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import type { InputAddressNAPI } from '../../../../../binaries/bindingsTypes.js'
2-
import { PlatformAddressWASM } from '../../Address/PlatformAddress.js'
2+
import { PlatformAddressWASM } from '../../PlatformAddress/PlatformAddress.js'
33
import { dppProvider } from '../../../provider.js'
4+
import { PlatformAddressLike } from '../../../types.js'
5+
import { preparePlatformAddressValue } from '../../../utils.js'
46

57
export class InputAddressWASM {
68
/** @private **/
79
_rawInputAddress: InputAddressNAPI
810

9-
constructor (address: PlatformAddressWASM, nonce: number, credits: bigint) {
10-
this._rawInputAddress = new dppProvider.dpp.InputAddressNAPI(address._rawPlatformAddress, nonce, credits.toString())
11+
constructor (address: PlatformAddressLike, nonce: number, credits: bigint) {
12+
this._rawInputAddress = new dppProvider.dpp.InputAddressNAPI(preparePlatformAddressValue(address), nonce, credits.toString())
1113
}
1214

1315
get address (): PlatformAddressWASM {
1416
return PlatformAddressWASM.createFromRawInstance(this._rawInputAddress.address)
1517
}
1618

17-
set address (value: PlatformAddressWASM) {
18-
this._rawInputAddress.address = value._rawPlatformAddress
19+
set address (value: PlatformAddressLike) {
20+
this._rawInputAddress.address = preparePlatformAddressValue(value)
1921
}
2022

2123
get nonce (): number {

0 commit comments

Comments
 (0)