Skip to content

Commit

Permalink
chore: add link of migration example
Browse files Browse the repository at this point in the history
  • Loading branch information
fospring committed Jun 3, 2024
1 parent c509f7f commit 4148f44
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions near-sdk-js@2.0.0-diff-1.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class StatusMessage {
```

## js contract migration with data fields
### example1
* using for: contract state migrations
* [example](https://github.com/near/near-sdk-js/blob/develop/examples/src/status-message-migrate-add-field.js)
```js
Expand Down Expand Up @@ -63,6 +64,12 @@ export class StatusMessage {
}
}
```
### example2
* another migration example can be found in [test-basic-updates.ava.js](https://github.com/near/near-sdk-js/blob/feat-migrate-example/examples/__tests__/test-basic-updates.ava.js) with [old state contract](https://github.com/near/near-sdk-js/blob/feat-migrate-example/examples/src/basic-updates-base.js) and new [new state contract](https://github.com/fospring/near-sdk-js/blob/feat-migrate-example/examples/src/basic-updates-update.js).
with the test command in [examples directory](./examples):
```shell
pnpm run test:basic-updates
```

## auto reconstruct class from object by static json schema
* use for contract serialzed by default method(json), the detail document is here: https://github.com/near/near-sdk-js/blob/develop/AUTO_RECONSCTRUCT_BY_JSON_SCHEME.md#the-schema-format
Expand Down

0 comments on commit 4148f44

Please sign in to comment.