
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@mailchain/messages-angular
Advanced tools
Mailchain Messages Angular - a service for calling the Mailchain API in Angular
This package is an Angular service that helps interact with the Mailchain API.
npm install @mailchain/messages-angular --save
In your Angular app.module.ts file, import the MessagesAngularModule:
import { MessagesAngularModule } from '@mailchain/messages-angular';
@NgModule({
declarations: [
AppComponent
...
],
imports: [
...
MessagesAngularModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
In an Angular component file, eg. my-component.component.ts, add the following:
// import the specific service you need (see README > Services)
import { MessagesSendAngularService } from '@mailchain/nameserver-angular';
// add to constructor
constructor(
private sendService: MessagesSendAngularService,
) { }
// add to function and then execute logic in the callback
myFunction() {
let outboundMail = this.sendService.initOutboundMail()
const protocol = "ethereum" // change accordingly or use function params
const network = "ropsten" // change accordingly or use function params
outboundMail.message["headers"]["from"] = "0x123...98"
outboundMail.message["headers"]["reply-to"] = "0x123...98"
outboundMail.message["headers"]["to"] = "0x999...111"
outboundMail.message["public-key"] = "0x5555...555"
outboundMail.message["subject"] = "Your subject"
outboundMail.message["body"] = "Your message body"
// Process message data here
this.sendService.sendMail(outboundMail, protocol, network).subscribe(res => {
this.messageResult = {
status: res['status'],
statusText: res['statusText']
}
},
err => {
this.messageResult = err['error']
})
}
This package includes multiple services that correspond to the Mailchain API structure.
Initializes an OutboundMail object with the attributes:
export class OutboundMail {
public message: any = {
"body": "",
"headers": {
"from": "",
"reply-to": "",
"to": ""
},
"public-key": "",
"public-key-encoding": "hex/0x-prefix",
"public-key-kind": "secp256k1",
"subject": ""
};
public "envelope": string = "0x01";
public "encryption-method-name": string = "aes256cbc";
public "content-type": string = "text/plain; charset=\"UTF-8\"";
}
Sends a message via the Mailchain api
@param outboundMail an outbound mail object (see initOutboundMail)
@param protocol is the protocol to use (e.g. "ethereum")
@param network is the network to send to (e.g. "ropsten", "mainnet" etc.)
This library was generated with Angular CLI version 8.2.14.
Run ng generate component component-name --project messages-angular to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project messages-angular.
Note: Don't forget to add
--project messages-angularor else it will be added to the default project in yourangular.jsonfile.
Run ng build messages-angular to build the project. The build artifacts will be stored in the dist/ directory.
After building your library with ng build messages-angular, go to the dist folder cd dist/messages-angular and run npm publish.
Run ng test messages-angular to execute the unit tests via Karma.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.
FAQs
Mailchain Messages Angular - a service for calling the Mailchain API in Angular
We found that @mailchain/messages-angular demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.